UNPKG

code-server

Version:

Run VS Code on a remote server.

3 lines • 99 kB
/*! For license information please see bootloader.bundle.js.LICENSE.txt */
(()=>{var __webpack_modules__={8586:(e,t,r)=>{"use strict";const s=r(3837),o=r(3610),n=r(1147),i=r(9451),a=e=>""===e||"./"===e,c=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let s=new Set,o=new Set,i=new Set,a=0,c=e=>{i.add(e.output),r&&r.onResult&&r.onResult(e)};for(let i=0;i<t.length;i++){let l=n(String(t[i]),{...r,onResult:c},!0),u=l.state.negated||l.state.negatedExtglob;u&&a++;for(let t of e){let e=l(t,!0);(u?!e.isMatch:e.isMatch)&&(u?s.add(e.output):(s.delete(e.output),o.add(e.output)))}}let l=(a===t.length?[...i]:[...o]).filter((e=>!s.has(e)));if(r&&0===l.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}return l};c.match=c,c.matcher=(e,t)=>n(e,t),c.any=c.isMatch=(e,t,r)=>n(t,r)(e),c.not=(e,t,r={})=>{t=[].concat(t).map(String);let s=new Set,o=[],n=c(e,t,{...r,onResult:e=>{r.onResult&&r.onResult(e),o.push(e.output)}});for(let e of o)n.includes(e)||s.add(e);return[...s]},c.contains=(e,t,r)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${s.inspect(e)}"`);if(Array.isArray(t))return t.some((t=>c.contains(e,t,r)));if("string"==typeof t){if(a(e)||a(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return c.isMatch(e,t,{...r,contains:!0})},c.matchKeys=(e,t,r)=>{if(!i.isObject(e))throw new TypeError("Expected the first argument to be an object");let s=c(Object.keys(e),t,r),o={};for(let t of s)o[t]=e[t];return o},c.some=(e,t,r)=>{let s=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(s.some((e=>t(e))))return!0}return!1},c.every=(e,t,r)=>{let s=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!s.every((e=>t(e))))return!1}return!0},c.all=(e,t,r)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${s.inspect(e)}"`);return[].concat(t).every((t=>n(t,r)(e)))},c.capture=(e,t,r)=>{let s=i.isWindows(r),o=n.makeRe(String(e),{...r,capture:!0}).exec(s?i.toPosixSlashes(t):t);if(o)return o.slice(1).map((e=>void 0===e?"":e))},c.makeRe=(...e)=>n.makeRe(...e),c.scan=(...e)=>n.scan(...e),c.parse=(e,t)=>{let r=[];for(let s of[].concat(e||[]))for(let e of o(String(s),t))r.push(n.parse(e,t));return r},c.braces=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return t&&!0===t.nobrace||!/\{.*\}/.test(e)?[e]:o(e,t)},c.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return c.braces(e,{...t,expand:!0})},e.exports=c},3610:(e,t,r)=>{"use strict";const s=r(5226),o=r(7104),n=r(5341),i=r(8707),a=(e,t={})=>{let r=[];if(Array.isArray(e))for(let s of e){let e=a.create(s,t);Array.isArray(e)?r.push(...e):r.push(e)}else r=[].concat(a.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(r=[...new Set(r)]),r};a.parse=(e,t={})=>i(e,t),a.stringify=(e,t={})=>s("string"==typeof e?a.parse(e,t):e,t),a.compile=(e,t={})=>("string"==typeof e&&(e=a.parse(e,t)),o(e,t)),a.expand=(e,t={})=>{"string"==typeof e&&(e=a.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},a.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?a.compile(e,t):a.expand(e,t),e.exports=a},7104:(e,t,r)=>{"use strict";const s=r(8459),o=r(3991);e.exports=(e,t={})=>{let r=(e,n={})=>{let i=o.isInvalidBrace(n),a=!0===e.invalid&&!0===t.escapeInvalid,c=!0===i||!0===a,l=!0===t.escapeInvalid?"\\":"",u="";if(!0===e.isOpen)return l+e.value;if(!0===e.isClose)return l+e.value;if("open"===e.type)return c?l+e.value:"(";if("close"===e.type)return c?l+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":c?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){let r=o.reduce(e.nodes),n=s(...r,{...t,wrap:!1,toRegex:!0});if(0!==n.length)return r.length>1&&n.length>1?`(${n})`:n}if(e.nodes)for(let t of e.nodes)u+=r(t,e);return u};return r(e)}},7874:e=>{"use strict";e.exports={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},5341:(e,t,r)=>{"use strict";const s=r(8459),o=r(5226),n=r(3991),i=(e="",t="",r=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return r?n.flatten(t).map((e=>`{${e}}`)):t;for(let o of e)if(Array.isArray(o))for(let e of o)s.push(i(e,t,r));else for(let e of t)!0===r&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?i(o,e,r):o+e);return n.flatten(s)};e.exports=(e,t={})=>{let r=void 0===t.rangeLimit?1e3:t.rangeLimit,a=(e,c={})=>{e.queue=[];let l=c,u=c.queue;for(;"brace"!==l.type&&"root"!==l.type&&l.parent;)l=l.parent,u=l.queue;if(e.invalid||e.dollar)return void u.push(i(u.pop(),o(e,t)));if("brace"===e.type&&!0!==e.invalid&&2===e.nodes.length)return void u.push(i(u.pop(),["{}"]));if(e.nodes&&e.ranges>0){let a=n.reduce(e.nodes);if(n.exceedsLimit(...a,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let c=s(...a,t);return 0===c.length&&(c=o(e,t)),u.push(i(u.pop(),c)),void(e.nodes=[])}let p=n.encloseBrace(e),h=e.queue,d=e;for(;"brace"!==d.type&&"root"!==d.type&&d.parent;)d=d.parent,h=d.queue;for(let t=0;t<e.nodes.length;t++){let r=e.nodes[t];"comma"!==r.type||"brace"!==e.type?"close"!==r.type?r.value&&"open"!==r.type?h.push(i(h.pop(),r.value)):r.nodes&&a(r,e):u.push(i(u.pop(),h,p)):(1===t&&h.push(""),h.push(""))}return h};return n.flatten(a(e))}},8707:(e,t,r)=>{"use strict";const s=r(5226),{MAX_LENGTH:o,CHAR_BACKSLASH:n,CHAR_BACKTICK:i,CHAR_COMMA:a,CHAR_DOT:c,CHAR_LEFT_PARENTHESES:l,CHAR_RIGHT_PARENTHESES:u,CHAR_LEFT_CURLY_BRACE:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_LEFT_SQUARE_BRACKET:d,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:_,CHAR_SINGLE_QUOTE:g,CHAR_NO_BREAK_SPACE:m,CHAR_ZERO_WIDTH_NOBREAK_SPACE:y}=r(7874);e.exports=(e,t={})=>{if("string"!=typeof e)throw new TypeError("Expected a string");let r=t||{},v="number"==typeof r.maxLength?Math.min(o,r.maxLength):o;if(e.length>v)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${v})`);let b,E={type:"root",input:e,nodes:[]},S=[E],x=E,R=E,C=0,k=e.length,w=0,A=0;const O=()=>e[w++],T=e=>{if("text"===e.type&&"dot"===R.type&&(R.type="text"),!R||"text"!==R.type||"text"!==e.type)return x.nodes.push(e),e.parent=x,e.prev=R,R=e,e;R.value+=e.value};for(T({type:"bos"});w<k;)if(x=S[S.length-1],b=O(),b!==y&&b!==m)if(b!==n)if(b!==f)if(b!==d)if(b!==l)if(b!==u)if(b!==_&&b!==g&&b!==i)if(b!==p)if(b!==h)if(b===a&&A>0){if(x.ranges>0){x.ranges=0;let e=x.nodes.shift();x.nodes=[e,{type:"text",value:s(x)}]}T({type:"comma",value:b}),x.commas++}else if(b===c&&A>0&&0===x.commas){let e=x.nodes;if(0===A||0===e.length){T({type:"text",value:b});continue}if("dot"===R.type){if(x.range=[],R.value+=b,R.type="range",3!==x.nodes.length&&5!==x.nodes.length){x.invalid=!0,x.ranges=0,R.type="text";continue}x.ranges++,x.args=[];continue}if("range"===R.type){e.pop();let t=e[e.length-1];t.value+=R.value+b,R=t,x.ranges--;continue}T({type:"dot",value:b})}else T({type:"text",value:b});else{if("brace"!==x.type){T({type:"text",value:b});continue}let e="close";x=S.pop(),x.close=!0,T({type:e,value:b}),A--,x=S[S.length-1]}else{A++;let e=R.value&&"$"===R.value.slice(-1)||!0===x.dollar;x=T({type:"brace",open:!0,close:!1,dollar:e,depth:A,commas:0,ranges:0,nodes:[]}),S.push(x),T({type:"open",value:b})}else{let e,r=b;for(!0!==t.keepQuotes&&(b="");w<k&&(e=O());)if(e!==n){if(e===r){!0===t.keepQuotes&&(b+=e);break}b+=e}else b+=e+O();T({type:"text",value:b})}else{if("paren"!==x.type){T({type:"text",value:b});continue}x=S.pop(),T({type:"text",value:b}),x=S[S.length-1]}else x=T({type:"paren",nodes:[]}),S.push(x),T({type:"text",value:b});else{let e;for(C++;w<k&&(e=O());)if(b+=e,e!==d)if(e!==n){if(e===f&&(C--,0===C))break}else b+=O();else C++;T({type:"text",value:b})}else T({type:"text",value:"\\"+b});else T({type:"text",value:(t.keepEscaping?b:"")+O()});do{if(x=S.pop(),"root"!==x.type){x.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=S[S.length-1],t=e.nodes.indexOf(x);e.nodes.splice(t,1,...x.nodes)}}while(S.length>0);return T({type:"eos"}),E}},5226:(e,t,r)=>{"use strict";const s=r(3991);e.exports=(e,t={})=>{let r=(e,o={})=>{let n=t.escapeInvalid&&s.isInvalidBrace(o),i=!0===e.invalid&&!0===t.escapeInvalid,a="";if(e.value)return(n||i)&&s.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)a+=r(t);return a};return r(e)}},3991:(e,t)=>{"use strict";t.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),t.find=(e,t)=>e.nodes.find((e=>e.type===t)),t.exceedsLimit=(e,r,s=1,o)=>!1!==o&&!(!t.isInteger(e)||!t.isInteger(r))&&(Number(r)-Number(e))/Number(s)>=o,t.escapeNode=(e,t=0,r)=>{let s=e.nodes[t];s&&(r&&s.type===r||"open"===s.type||"close"===s.type)&&!0!==s.escaped&&(s.value="\\"+s.value,s.escaped=!0)},t.encloseBrace=e=>"brace"===e.type&&e.commas>>0+e.ranges>>0==0&&(e.invalid=!0,!0),t.isInvalidBrace=e=>!("brace"!==e.type||!0!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges>>0!=0&&!0===e.open&&!0===e.close||(e.invalid=!0,0))),t.isOpenOrClose=e=>"open"===e.type||"close"===e.type||!0===e.open||!0===e.close,t.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),t.flatten=(...e)=>{const t=[],r=e=>{for(let s=0;s<e.length;s++){let o=e[s];Array.isArray(o)?r(o,t):void 0!==o&&t.push(o)}return t};return r(e),t}},8459:(e,t,r)=>{"use strict";const s=r(3837),o=r(5109),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),i=e=>"number"==typeof e||"string"==typeof e&&""!==e,a=e=>Number.isInteger(+e),c=e=>{let t=`${e}`,r=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++r];);return r>0},l=(e,t,r)=>{if(t>0){let r="-"===e[0]?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return!1===r?String(e):e},u=(e,t)=>{let r="-"===e[0]?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},p=(e,t,r,s)=>{if(r)return o(e,t,{wrap:!1,...s});let n=String.fromCharCode(e);return e===t?n:`[${n}-${String.fromCharCode(t)}]`},h=(e,t,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,s=r.capture?"":"?:";return t?`(${s}${e.join("|")})`:e.join("|")}return o(e,t,r)},d=(...e)=>new RangeError("Invalid range arguments: "+s.inspect(...e)),f=(e,t,r)=>{if(!0===r.strictRanges)throw d([e,t]);return[]},_=(e,t,r,s={})=>{if(null==t&&i(e))return[e];if(!i(e)||!i(t))return f(e,t,s);if("function"==typeof r)return _(e,t,1,{transform:r});if(n(r))return _(e,t,0,r);let o={...s};return!0===o.capture&&(o.wrap=!0),r=r||o.step||1,a(r)?a(e)&&a(t)?((e,t,r=1,s={})=>{let o=Number(e),n=Number(t);if(!Number.isInteger(o)||!Number.isInteger(n)){if(!0===s.strictRanges)throw d([e,t]);return[]}0===o&&(o=0),0===n&&(n=0);let i=o>n,a=String(e),f=String(t),_=String(r);r=Math.max(Math.abs(r),1);let g=c(a)||c(f)||c(_),m=g?Math.max(a.length,f.length,_.length):0,y=!1===g&&!1===((e,t,r)=>"string"==typeof e||"string"==typeof t||!0===r.stringify)(e,t,s),v=s.transform||(e=>t=>!0===e?Number(t):String(t))(y);if(s.toRegex&&1===r)return p(u(e,m),u(t,m),!0,s);let b={negatives:[],positives:[]},E=[],S=0;for(;i?o>=n:o<=n;)!0===s.toRegex&&r>1?b[(x=o)<0?"negatives":"positives"].push(Math.abs(x)):E.push(l(v(o,S),m,y)),o=i?o-r:o+r,S++;var x;return!0===s.toRegex?r>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let r,s=t.capture?"":"?:",o="",n="";return e.positives.length&&(o=e.positives.join("|")),e.negatives.length&&(n=`-(${s}${e.negatives.join("|")})`),r=o&&n?`${o}|${n}`:o||n,t.wrap?`(${s}${r})`:r})(b,s):h(E,null,{wrap:!1,...s}):E})(e,t,r,o):((e,t,r=1,s={})=>{if(!a(e)&&e.length>1||!a(t)&&t.length>1)return f(e,t,s);let o=s.transform||(e=>String.fromCharCode(e)),n=`${e}`.charCodeAt(0),i=`${t}`.charCodeAt(0),c=n>i,l=Math.min(n,i),u=Math.max(n,i);if(s.toRegex&&1===r)return p(l,u,!1,s);let d=[],_=0;for(;c?n>=i:n<=i;)d.push(o(n,_)),n=c?n-r:n+r,_++;return!0===s.toRegex?h(d,null,{wrap:!1,options:s}):d})(e,t,Math.max(Math.abs(r),1),o):null==r||n(r)?_(e,t,1,r):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(r,o)};e.exports=_},535:e=>{"use strict";e.exports=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))}},1147:(e,t,r)=>{"use strict";e.exports=r(3148)},2819:(e,t,r)=>{"use strict";const s=r(1017),o="\\.{1,2}(?:\\/|$)",n={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:o,NO_DOT:"(?!\\.)",NO_DOTS:`(?!(?:^|\\/)${o})`,NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},i={...n,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"};e.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:s.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?i:n}},688:(e,t,r)=>{"use strict";const s=r(2819),o=r(9451),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:i,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:c,REPLACEMENTS:l}=s,u=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map((e=>o.escapeRegex(e))).join("..")}return r},p=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,h=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=l[e]||e;const r={...t},h="number"==typeof r.maxLength?Math.min(n,r.maxLength):n;let d=e.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const f={type:"bos",value:"",output:r.prepend||""},_=[f],g=r.capture?"":"?:",m=o.isWindows(t),y=s.globChars(m),v=s.extglobChars(y),{DOT_LITERAL:b,PLUS_LITERAL:E,SLASH_LITERAL:S,ONE_CHAR:x,DOTS_SLASH:R,NO_DOT:C,NO_DOT_SLASH:k,NO_DOTS_SLASH:w,QMARK:A,QMARK_NO_DOT:O,STAR:T,START_ANCHOR:N}=y,L=e=>`(${g}(?:(?!${N}${e.dot?R:b}).)*?)`,P=r.dot?"":C,I=r.dot?A:O;let H=!0===r.bash?L(r):T;r.capture&&(H=`(${H})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const $={input:e,index:-1,start:0,dot:!0===r.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:_};e=o.removePrefix(e,$),d=e.length;const M=[],B=[],D=[];let U,j=f;const F=()=>$.index===d-1,G=$.peek=(t=1)=>e[$.index+t],W=$.advance=()=>e[++$.index]||"",q=()=>e.slice($.index+1),K=(e="",t=0)=>{$.consumed+=e,$.index+=t},V=e=>{$.output+=null!=e.output?e.output:e.value,K(e.value)},Q=()=>{let e=1;for(;"!"===G()&&("("!==G(2)||"?"===G(3));)W(),$.start++,e++;return e%2!=0&&($.negated=!0,$.start++,!0)},z=e=>{$[e]++,D.push(e)},X=e=>{$[e]--,D.pop()},Y=e=>{if("globstar"===j.type){const t=$.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||M.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||($.output=$.output.slice(0,-j.output.length),j.type="star",j.value="*",j.output=H,$.output+=j.output)}if(M.length&&"paren"!==e.type&&(M[M.length-1].inner+=e.value),(e.value||e.output)&&V(e),j&&"text"===j.type&&"text"===e.type)return j.value+=e.value,void(j.output=(j.output||"")+e.value);e.prev=j,_.push(e),j=e},Z=(e,t)=>{const s={...v[t],conditions:1,inner:""};s.prev=j,s.parens=$.parens,s.output=$.output;const o=(r.capture?"(":"")+s.open;z("parens"),Y({type:e,value:t,output:$.output?"":x}),Y({type:"paren",extglob:!0,value:W(),output:o}),M.push(s)},J=e=>{let t,s=e.close+(r.capture?")":"");if("negate"===e.type){let o=H;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(o=L(r)),(o!==H||F()||/^\)+$/.test(q()))&&(s=e.close=`)$))${o}`),e.inner.includes("*")&&(t=q())&&/^\.[^\\/.]+$/.test(t)&&(s=e.close=`)${t})${o})`),"bos"===e.prev.type&&($.negatedExtglob=!0)}Y({type:"paren",extglob:!0,value:U,output:s}),X("parens")};if(!1!==r.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let s=!1,n=e.replace(c,((e,t,r,o,n,i)=>"\\"===o?(s=!0,e):"?"===o?t?t+o+(n?A.repeat(n.length):""):0===i?I+(n?A.repeat(n.length):""):A.repeat(r.length):"."===o?b.repeat(r.length):"*"===o?t?t+o+(n?H:""):H:t?e:`\\${e}`));return!0===s&&(n=!0===r.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),n===e&&!0===r.contains?($.output=e,$):($.output=o.wrapOutput(n,$,t),$)}for(;!F();){if(U=W(),"\0"===U)continue;if("\\"===U){const e=G();if("/"===e&&!0!==r.bash)continue;if("."===e||";"===e)continue;if(!e){U+="\\",Y({type:"text",value:U});continue}const t=/^\\+/.exec(q());let s=0;if(t&&t[0].length>2&&(s=t[0].length,$.index+=s,s%2!=0&&(U+="\\")),!0===r.unescape?U=W():U+=W(),0===$.brackets){Y({type:"text",value:U});continue}}if($.brackets>0&&("]"!==U||"["===j.value||"[^"===j.value)){if(!1!==r.posix&&":"===U){const e=j.value.slice(1);if(e.includes("[")&&(j.posix=!0,e.includes(":"))){const e=j.value.lastIndexOf("["),t=j.value.slice(0,e),r=j.value.slice(e+2),s=i[r];if(s){j.value=t+s,$.backtrack=!0,W(),f.output||1!==_.indexOf(j)||(f.output=x);continue}}}("["===U&&":"!==G()||"-"===U&&"]"===G())&&(U=`\\${U}`),"]"!==U||"["!==j.value&&"[^"!==j.value||(U=`\\${U}`),!0===r.posix&&"!"===U&&"["===j.value&&(U="^"),j.value+=U,V({value:U});continue}if(1===$.quotes&&'"'!==U){U=o.escapeRegex(U),j.value+=U,V({value:U});continue}if('"'===U){$.quotes=1===$.quotes?0:1,!0===r.keepQuotes&&Y({type:"text",value:U});continue}if("("===U){z("parens"),Y({type:"paren",value:U});continue}if(")"===U){if(0===$.parens&&!0===r.strictBrackets)throw new SyntaxError(p("opening","("));const e=M[M.length-1];if(e&&$.parens===e.parens+1){J(M.pop());continue}Y({type:"paren",value:U,output:$.parens?")":"\\)"}),X("parens");continue}if("["===U){if(!0!==r.nobracket&&q().includes("]"))z("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(p("closing","]"));U=`\\${U}`}Y({type:"bracket",value:U});continue}if("]"===U){if(!0===r.nobracket||j&&"bracket"===j.type&&1===j.value.length){Y({type:"text",value:U,output:`\\${U}`});continue}if(0===$.brackets){if(!0===r.strictBrackets)throw new SyntaxError(p("opening","["));Y({type:"text",value:U,output:`\\${U}`});continue}X("brackets");const e=j.value.slice(1);if(!0===j.posix||"^"!==e[0]||e.includes("/")||(U=`/${U}`),j.value+=U,V({value:U}),!1===r.literalBrackets||o.hasRegexChars(e))continue;const t=o.escapeRegex(j.value);if($.output=$.output.slice(0,-j.value.length),!0===r.literalBrackets){$.output+=t,j.value=t;continue}j.value=`(${g}${t}|${j.value})`,$.output+=j.value;continue}if("{"===U&&!0!==r.nobrace){z("braces");const e={type:"brace",value:U,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};B.push(e),Y(e);continue}if("}"===U){const e=B[B.length-1];if(!0===r.nobrace||!e){Y({type:"text",value:U,output:U});continue}let t=")";if(!0===e.dots){const e=_.slice(),s=[];for(let t=e.length-1;t>=0&&(_.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&s.unshift(e[t].value);t=u(s,r),$.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=$.output.slice(0,e.outputIndex),s=$.tokens.slice(e.tokensIndex);e.value=e.output="\\{",U=t="\\}",$.output=r;for(const e of s)$.output+=e.output||e.value}Y({type:"brace",value:U,output:t}),X("braces"),B.pop();continue}if("|"===U){M.length>0&&M[M.length-1].conditions++,Y({type:"text",value:U});continue}if(","===U){let e=U;const t=B[B.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),Y({type:"comma",value:U,output:e});continue}if("/"===U){if("dot"===j.type&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",_.pop(),j=f;continue}Y({type:"slash",value:U,output:S});continue}if("."===U){if($.braces>0&&"dot"===j.type){"."===j.value&&(j.output=b);const e=B[B.length-1];j.type="dots",j.output+=U,j.value+=U,e.dots=!0;continue}if($.braces+$.parens===0&&"bos"!==j.type&&"slash"!==j.type){Y({type:"text",value:U,output:b});continue}Y({type:"dot",value:U,output:b});continue}if("?"===U){if((!j||"("!==j.value)&&!0!==r.noextglob&&"("===G()&&"?"!==G(2)){Z("qmark",U);continue}if(j&&"paren"===j.type){const e=G();let t=U;if("<"===e&&!o.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===j.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(q()))&&(t=`\\${U}`),Y({type:"text",value:U,output:t});continue}if(!0!==r.dot&&("slash"===j.type||"bos"===j.type)){Y({type:"qmark",value:U,output:O});continue}Y({type:"qmark",value:U,output:A});continue}if("!"===U){if(!0!==r.noextglob&&"("===G()&&("?"!==G(2)||!/[!=<:]/.test(G(3)))){Z("negate",U);continue}if(!0!==r.nonegate&&0===$.index){Q();continue}}if("+"===U){if(!0!==r.noextglob&&"("===G()&&"?"!==G(2)){Z("plus",U);continue}if(j&&"("===j.value||!1===r.regex){Y({type:"plus",value:U,output:E});continue}if(j&&("bracket"===j.type||"paren"===j.type||"brace"===j.type)||$.parens>0){Y({type:"plus",value:U});continue}Y({type:"plus",value:E});continue}if("@"===U){if(!0!==r.noextglob&&"("===G()&&"?"!==G(2)){Y({type:"at",extglob:!0,value:U,output:""});continue}Y({type:"text",value:U});continue}if("*"!==U){"$"!==U&&"^"!==U||(U=`\\${U}`);const e=a.exec(q());e&&(U+=e[0],$.index+=e[0].length),Y({type:"text",value:U});continue}if(j&&("globstar"===j.type||!0===j.star)){j.type="star",j.star=!0,j.value+=U,j.output=H,$.backtrack=!0,$.globstar=!0,K(U);continue}let t=q();if(!0!==r.noextglob&&/^\([^?]/.test(t)){Z("star",U);continue}if("star"===j.type){if(!0===r.noglobstar){K(U);continue}const s=j.prev,o=s.prev,n="slash"===s.type||"bos"===s.type,i=o&&("star"===o.type||"globstar"===o.type);if(!0===r.bash&&(!n||t[0]&&"/"!==t[0])){Y({type:"star",value:U,output:""});continue}const a=$.braces>0&&("comma"===s.type||"brace"===s.type),c=M.length&&("pipe"===s.type||"paren"===s.type);if(!n&&"paren"!==s.type&&!a&&!c){Y({type:"star",value:U,output:""});continue}for(;"/**"===t.slice(0,3);){const r=e[$.index+4];if(r&&"/"!==r)break;t=t.slice(3),K("/**",3)}if("bos"===s.type&&F()){j.type="globstar",j.value+=U,j.output=L(r),$.output=j.output,$.globstar=!0,K(U);continue}if("slash"===s.type&&"bos"!==s.prev.type&&!i&&F()){$.output=$.output.slice(0,-(s.output+j.output).length),s.output=`(?:${s.output}`,j.type="globstar",j.output=L(r)+(r.strictSlashes?")":"|$)"),j.value+=U,$.globstar=!0,$.output+=s.output+j.output,K(U);continue}if("slash"===s.type&&"bos"!==s.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";$.output=$.output.slice(0,-(s.output+j.output).length),s.output=`(?:${s.output}`,j.type="globstar",j.output=`${L(r)}${S}|${S}${e})`,j.value+=U,$.output+=s.output+j.output,$.globstar=!0,K(U+W()),Y({type:"slash",value:"/",output:""});continue}if("bos"===s.type&&"/"===t[0]){j.type="globstar",j.value+=U,j.output=`(?:^|${S}|${L(r)}${S})`,$.output=j.output,$.globstar=!0,K(U+W()),Y({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-j.output.length),j.type="globstar",j.output=L(r),j.value+=U,$.output+=j.output,$.globstar=!0,K(U);continue}const s={type:"star",value:U,output:H};!0!==r.bash?!j||"bracket"!==j.type&&"paren"!==j.type||!0!==r.regex?($.index!==$.start&&"slash"!==j.type&&"dot"!==j.type||("dot"===j.type?($.output+=k,j.output+=k):!0===r.dot?($.output+=w,j.output+=w):($.output+=P,j.output+=P),"*"!==G()&&($.output+=x,j.output+=x)),Y(s)):(s.output=U,Y(s)):(s.output=".*?","bos"!==j.type&&"slash"!==j.type||(s.output=P+s.output),Y(s))}for(;$.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(p("closing","]"));$.output=o.escapeLast($.output,"["),X("brackets")}for(;$.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(p("closing",")"));$.output=o.escapeLast($.output,"("),X("parens")}for(;$.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(p("closing","}"));$.output=o.escapeLast($.output,"{"),X("braces")}if(!0===r.strictSlashes||"star"!==j.type&&"bracket"!==j.type||Y({type:"maybe_slash",value:"",output:`${S}?`}),!0===$.backtrack){$.output="";for(const e of $.tokens)$.output+=null!=e.output?e.output:e.value,e.suffix&&($.output+=e.suffix)}return $};h.fastpaths=(e,t)=>{const r={...t},i="number"==typeof r.maxLength?Math.min(n,r.maxLength):n,a=e.length;if(a>i)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${i}`);e=l[e]||e;const c=o.isWindows(t),{DOT_LITERAL:u,SLASH_LITERAL:p,ONE_CHAR:h,DOTS_SLASH:d,NO_DOT:f,NO_DOTS:_,NO_DOTS_SLASH:g,STAR:m,START_ANCHOR:y}=s.globChars(c),v=r.dot?_:f,b=r.dot?g:f,E=r.capture?"":"?:";let S=!0===r.bash?".*?":m;r.capture&&(S=`(${S})`);const x=e=>!0===e.noglobstar?S:`(${E}(?:(?!${y}${e.dot?d:u}).)*?)`,R=e=>{switch(e){case"*":return`${v}${h}${S}`;case".*":return`${u}${h}${S}`;case"*.*":return`${v}${S}${u}${h}${S}`;case"*/*":return`${v}${S}${p}${h}${b}${S}`;case"**":return v+x(r);case"**/*":return`(?:${v}${x(r)}${p})?${b}${h}${S}`;case"**/*.*":return`(?:${v}${x(r)}${p})?${b}${S}${u}${h}${S}`;case"**/.*":return`(?:${v}${x(r)}${p})?${u}${h}${S}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=R(t[1]);if(!r)return;return r+u+t[2]}}},C=o.removePrefix(e,{negated:!1,prefix:""});let k=R(C);return k&&!0!==r.strictSlashes&&(k+=`${p}?`),k},e.exports=h},3148:(e,t,r)=>{"use strict";const s=r(1017),o=r(9488),n=r(688),i=r(9451),a=r(2819),c=(e,t,r=!1)=>{if(Array.isArray(e)){const s=e.map((e=>c(e,t,r))),o=e=>{for(const t of s){const r=t(e);if(r)return r}return!1};return o}const s=(o=e)&&"object"==typeof o&&!Array.isArray(o)&&e.tokens&&e.input;var o;if(""===e||"string"!=typeof e&&!s)throw new TypeError("Expected pattern to be a non-empty string");const n=t||{},a=i.isWindows(t),l=s?c.compileRe(e,t):c.makeRe(e,t,!1,!0),u=l.state;delete l.state;let p=()=>!1;if(n.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};p=c(n.ignore,e,r)}const h=(r,s=!1)=>{const{isMatch:o,match:i,output:h}=c.test(r,l,t,{glob:e,posix:a}),d={glob:e,state:u,regex:l,posix:a,input:r,output:h,match:i,isMatch:o};return"function"==typeof n.onResult&&n.onResult(d),!1===o?(d.isMatch=!1,!!s&&d):p(r)?("function"==typeof n.onIgnore&&n.onIgnore(d),d.isMatch=!1,!!s&&d):("function"==typeof n.onMatch&&n.onMatch(d),!s||d)};return r&&(h.state=u),h};c.test=(e,t,r,{glob:s,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const n=r||{},a=n.format||(o?i.toPosixSlashes:null);let l=e===s,u=l&&a?a(e):e;return!1===l&&(u=a?a(e):e,l=u===s),!1!==l&&!0!==n.capture||(l=!0===n.matchBase||!0===n.basename?c.matchBase(e,t,r,o):t.exec(u)),{isMatch:Boolean(l),match:l,output:u}},c.matchBase=(e,t,r,o=i.isWindows(r))=>(t instanceof RegExp?t:c.makeRe(t,r)).test(s.basename(e)),c.isMatch=(e,t,r)=>c(t,r)(e),c.parse=(e,t)=>Array.isArray(e)?e.map((e=>c.parse(e,t))):n(e,{...t,fastpaths:!1}),c.scan=(e,t)=>o(e,t),c.compileRe=(e,t,r=!1,s=!1)=>{if(!0===r)return e.output;const o=t||{},n=o.contains?"":"^",i=o.contains?"":"$";let a=`${n}(?:${e.output})${i}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const l=c.toRegex(a,t);return!0===s&&(l.state=e),l},c.makeRe=(e,t={},r=!1,s=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(o.output=n.fastpaths(e,t)),o.output||(o=n(e,t)),c.compileRe(o,t,r,s)},c.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},c.constants=a,e.exports=c},9488:(e,t,r)=>{"use strict";const s=r(9451),{CHAR_ASTERISK:o,CHAR_AT:n,CHAR_BACKWARD_SLASH:i,CHAR_COMMA:a,CHAR_DOT:c,CHAR_EXCLAMATION_MARK:l,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:p,CHAR_LEFT_PARENTHESES:h,CHAR_LEFT_SQUARE_BRACKET:d,CHAR_PLUS:f,CHAR_QUESTION_MARK:_,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:m,CHAR_RIGHT_SQUARE_BRACKET:y}=r(2819),v=e=>e===u||e===i,b=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};e.exports=(e,t)=>{const r=t||{},E=e.length-1,S=!0===r.parts||!0===r.scanToEnd,x=[],R=[],C=[];let k,w,A=e,O=-1,T=0,N=0,L=!1,P=!1,I=!1,H=!1,$=!1,M=!1,B=!1,D=!1,U=!1,j=!1,F=0,G={value:"",depth:0,isGlob:!1};const W=()=>O>=E,q=()=>(k=w,A.charCodeAt(++O));for(;O<E;){let e;if(w=q(),w!==i){if(!0===M||w===p){for(F++;!0!==W()&&(w=q());)if(w!==i)if(w!==p){if(!0!==M&&w===c&&(w=q())===c){if(L=G.isBrace=!0,I=G.isGlob=!0,j=!0,!0===S)continue;break}if(!0!==M&&w===a){if(L=G.isBrace=!0,I=G.isGlob=!0,j=!0,!0===S)continue;break}if(w===g&&(F--,0===F)){M=!1,L=G.isBrace=!0,j=!0;break}}else F++;else B=G.backslashes=!0,q();if(!0===S)continue;break}if(w!==u){if(!0!==r.noext&&!0==(w===f||w===n||w===o||w===_||w===l)&&A.charCodeAt(O+1)===h){if(I=G.isGlob=!0,H=G.isExtglob=!0,j=!0,w===l&&O===T&&(U=!0),!0===S){for(;!0!==W()&&(w=q());)if(w!==i){if(w===m){I=G.isGlob=!0,j=!0;break}}else B=G.backslashes=!0,w=q();continue}break}if(w===o){if(k===o&&($=G.isGlobstar=!0),I=G.isGlob=!0,j=!0,!0===S)continue;break}if(w===_){if(I=G.isGlob=!0,j=!0,!0===S)continue;break}if(w===d){for(;!0!==W()&&(e=q());)if(e!==i){if(e===y){P=G.isBracket=!0,I=G.isGlob=!0,j=!0;break}}else B=G.backslashes=!0,q();if(!0===S)continue;break}if(!0===r.nonegate||w!==l||O!==T){if(!0!==r.noparen&&w===h){if(I=G.isGlob=!0,!0===S){for(;!0!==W()&&(w=q());)if(w!==h){if(w===m){j=!0;break}}else B=G.backslashes=!0,w=q();continue}break}if(!0===I){if(j=!0,!0===S)continue;break}}else D=G.negated=!0,T++}else{if(x.push(O),R.push(G),G={value:"",depth:0,isGlob:!1},!0===j)continue;if(k===c&&O===T+1){T+=2;continue}N=O+1}}else B=G.backslashes=!0,w=q(),w===p&&(M=!0)}!0===r.noext&&(H=!1,I=!1);let K=A,V="",Q="";T>0&&(V=A.slice(0,T),A=A.slice(T),N-=T),K&&!0===I&&N>0?(K=A.slice(0,N),Q=A.slice(N)):!0===I?(K="",Q=A):K=A,K&&""!==K&&"/"!==K&&K!==A&&v(K.charCodeAt(K.length-1))&&(K=K.slice(0,-1)),!0===r.unescape&&(Q&&(Q=s.removeBackslashes(Q)),K&&!0===B&&(K=s.removeBackslashes(K)));const z={prefix:V,input:e,start:T,base:K,glob:Q,isBrace:L,isBracket:P,isGlob:I,isExtglob:H,isGlobstar:$,negated:D,negatedExtglob:U};if(!0===r.tokens&&(z.maxDepth=0,v(w)||R.push(G),z.tokens=R),!0===r.parts||!0===r.tokens){let t;for(let s=0;s<x.length;s++){const o=t?t+1:T,n=x[s],i=e.slice(o,n);r.tokens&&(0===s&&0!==T?(R[s].isPrefix=!0,R[s].value=V):R[s].value=i,b(R[s]),z.maxDepth+=R[s].depth),0===s&&""===i||C.push(i),t=n}if(t&&t+1<e.length){const s=e.slice(t+1);C.push(s),r.tokens&&(R[R.length-1].value=s,b(R[R.length-1]),z.maxDepth+=R[R.length-1].depth)}z.slashes=x,z.parts=C}return z}},9451:(e,t,r)=>{"use strict";const s=r(1017),o="win32"===process.platform,{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:c}=r(2819);t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>a.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(c,"\\$1"),t.toPosixSlashes=e=>e.replace(n,"/"),t.removeBackslashes=e=>e.replace(i,(e=>"\\"===e?"":e)),t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},t.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===o||"\\"===s.sep,t.escapeLast=(e,r,s)=>{const o=e.lastIndexOf(r,s);return-1===o?e:"\\"===e[o-1]?t.escapeLast(e,r,o-1):`${e.slice(0,o)}\\${e.slice(o)}`},t.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},t.wrapOutput=(e,t={},r={})=>{let s=`${r.contains?"":"^"}(?:${e})${r.contains?"":"$"}`;return!0===t.negated&&(s=`(?:^(?!${s}).*$)`),s}},5109:(e,t,r)=>{"use strict";const s=r(535),o=(e,t,r)=>{if(!1===s(e))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===t||e===t)return String(e);if(!1===s(t))throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};"boolean"==typeof n.strictZeros&&(n.relaxZeros=!1===n.strictZeros);let c=e+":"+t+"="+String(n.relaxZeros)+String(n.shorthand)+String(n.capture)+String(n.wrap);if(o.cache.hasOwnProperty(c))return o.cache[c].result;let l=Math.min(e,t),u=Math.max(e,t);if(1===Math.abs(l-u)){let r=e+"|"+t;return n.capture?`(${r})`:!1===n.wrap?r:`(?:${r})`}let p=d(e)||d(t),h={min:e,max:t,a:l,b:u},f=[],_=[];return p&&(h.isPadded=p,h.maxLen=String(h.max).length),l<0&&(_=i(u<0?Math.abs(u):1,Math.abs(l),h,n),l=h.a=0),u>=0&&(f=i(l,u,h,n)),h.negatives=_,h.positives=f,h.result=function(e,t,r){let s=a(e,t,"-",!1)||[],o=a(t,e,"",!1)||[],n=a(e,t,"-?",!0)||[];return s.concat(n).concat(o).join("|")}(_,f),!0===n.capture?h.result=`(${h.result})`:!1!==n.wrap&&f.length+_.length>1&&(h.result=`(?:${h.result})`),o.cache[c]=h,h.result};function n(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let s=function(e,t){let r=[];for(let s=0;s<e.length;s++)r.push([e[s],t[s]]);return r}(e,t),o=s.length,n="",i=0;for(let e=0;e<o;e++){let[t,r]=s[e];t===r?n+=t:"0"!==t||"9"!==r?n+=`[${a=t}${(c=r)-a==1?"":"-"}${c}]`:i++}var a,c;return i&&(n+=!0===r.shorthand?"\\d":"[0-9]"),{pattern:n,count:[i],digits:o}}function i(e,t,r,s){let o,i=function(e,t){let r=1,s=1,o=u(e,r),n=new Set([t]);for(;e<=o&&o<=t;)n.add(o),r+=1,o=u(e,r);for(o=p(t+1,s)-1;e<o&&o<=t;)n.add(o),s+=1,o=p(t+1,s)-1;return n=[...n],n.sort(c),n}(e,t),a=[],l=e;for(let e=0;e<i.length;e++){let t=i[e],c=n(String(l),String(t),s),u="";r.isPadded||!o||o.pattern!==c.pattern?(r.isPadded&&(u=f(t,r,s)),c.string=u+c.pattern+h(c.count),a.push(c),l=t+1,o=c):(o.count.length>1&&o.count.pop(),o.count.push(c.count[0]),o.string=o.pattern+h(o.count),l=t+1)}return a}function a(e,t,r,s,o){let n=[];for(let o of e){let{string:e}=o;s||l(t,"string",e)||n.push(r+e),s&&l(t,"string",e)&&n.push(r+e)}return n}function c(e,t){return e>t?1:t>e?-1:0}function l(e,t,r){return e.some((e=>e[t]===r))}function u(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function p(e,t){return e-e%Math.pow(10,t)}function h(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function d(e){return/^-?(0+)\d/.test(e)}function f(e,t,r){if(!t.isPadded)return e;let s=Math.abs(t.maxLen-String(e).length),o=!1!==r.relaxZeros;switch(s){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${s}}`:`0{${s}}`}}o.cache={},o.clearCache=()=>o.cache={},e.exports=o},8681:(e,t,r)=>{"use strict";const s=r(2982);s.createWebSocketStream=r(5519),s.Server=r(58),s.Receiver=r(3091),s.Sender=r(2091),s.WebSocket=s,s.WebSocketServer=s.Server,e.exports=s},4847:(e,t,r)=>{"use strict";const{EMPTY_BUFFER:s}=r(9864);function o(e,t){if(0===e.length)return s;if(1===e.length)return e[0];const r=Buffer.allocUnsafe(t);let o=0;for(let t=0;t<e.length;t++){const s=e[t];r.set(s,o),o+=s.length}return o<t?r.slice(0,o):r}function n(e,t,r,s,o){for(let n=0;n<o;n++)r[s+n]=e[n]^t[3&n]}function i(e,t){for(let r=0;r<e.length;r++)e[r]^=t[3&r]}function a(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=r(Object(function(){var e=new Error("Cannot find module 'bufferutil'");throw e.code="MODULE_NOT_FOUND",e}()));e.exports={concat:o,mask(e,r,s,o,i){i<48?n(e,r,s,o,i):t.mask(e,r,s,o,i)},toArrayBuffer:a,toBuffer:c,unmask(e,r){e.length<32?i(e,r):t.unmask(e,r)}}}catch(t){e.exports={concat:o,mask:n,toArrayBuffer:a,toBuffer:c,unmask:i}}},9864:e=>{"use strict";e.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}},5831:(e,t,r)=>{"use strict";const{kForOnEventAttribute:s,kListener:o}=r(9864),n=Symbol("kCode"),i=Symbol("kData"),a=Symbol("kError"),c=Symbol("kMessage"),l=Symbol("kReason"),u=Symbol("kTarget"),p=Symbol("kType"),h=Symbol("kWasClean");class d{constructor(e){this[u]=null,this[p]=e}get target(){return this[u]}get type(){return this[p]}}Object.defineProperty(d.prototype,"target",{enumerable:!0}),Object.defineProperty(d.prototype,"type",{enumerable:!0});class f extends d{constructor(e,t={}){super(e),this[n]=void 0===t.code?0:t.code,this[l]=void 0===t.reason?"":t.reason,this[h]=void 0!==t.wasClean&&t.wasClean}get code(){return this[n]}get reason(){return this[l]}get wasClean(){return this[h]}}Object.defineProperty(f.prototype,"code",{enumerable:!0}),Object.defineProperty(f.prototype,"reason",{enumerable:!0}),Object.defineProperty(f.prototype,"wasClean",{enumerable:!0});class _ extends d{constructor(e,t={}){super(e),this[a]=void 0===t.error?null:t.error,this[c]=void 0===t.message?"":t.message}get error(){return this[a]}get message(){return this[c]}}Object.defineProperty(_.prototype,"error",{enumerable:!0}),Object.defineProperty(_.prototype,"message",{enumerable:!0});class g extends d{constructor(e,t={}){super(e),this[i]=void 0===t.data?null:t.data}get data(){return this[i]}}Object.defineProperty(g.prototype,"data",{enumerable:!0});const m={addEventListener(e,t,r={}){let n;if("message"===e)n=function(e,r){const s=new g("message",{data:r?e:e.toString()});s[u]=this,t.call(this,s)};else if("close"===e)n=function(e,r){const s=new f("close",{code:e,reason:r.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});s[u]=this,t.call(this,s)};else if("error"===e)n=function(e){const r=new _("error",{error:e,message:e.message});r[u]=this,t.call(this,r)};else{if("open"!==e)return;n=function(){const e=new d("open");e[u]=this,t.call(this,e)}}n[s]=!!r[s],n[o]=t,r.once?this.once(e,n):this.on(e,n)},removeEventListener(e,t){for(const r of this.listeners(e))if(r[o]===t&&!r[s]){this.removeListener(e,r);break}}};e.exports={CloseEvent:f,ErrorEvent:_,Event:d,EventTarget:m,MessageEvent:g}},3071:(e,t,r)=>{"use strict";const{tokenChars:s}=r(1607);function o(e,t,r){void 0===e[t]?e[t]=[r]:e[t].push(r)}e.exports={format:function(e){return Object.keys(e).map((t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map((e=>[t].concat(Object.keys(e).map((t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map((e=>!0===e?t:`${t}=${e}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")},parse:function(e){const t=Object.create(null);let r,n,i=Object.create(null),a=!1,c=!1,l=!1,u=-1,p=-1,h=-1,d=0;for(;d<e.length;d++)if(p=e.charCodeAt(d),void 0===r)if(-1===h&&1===s[p])-1===u&&(u=d);else if(0===d||32!==p&&9!==p){if(59!==p&&44!==p)throw new SyntaxError(`Unexpected character at index ${d}`);{if(-1===u)throw new SyntaxError(`Unexpected character at index ${d}`);-1===h&&(h=d);const s=e.slice(u,h);44===p?(o(t,s,i),i=Object.create(null)):r=s,u=h=-1}}else-1===h&&-1!==u&&(h=d);else if(void 0===n)if(-1===h&&1===s[p])-1===u&&(u=d);else if(32===p||9===p)-1===h&&-1!==u&&(h=d);else if(59===p||44===p){if(-1===u)throw new SyntaxError(`Unexpected character at index ${d}`);-1===h&&(h=d),o(i,e.slice(u,h),!0),44===p&&(o(t,r,i),i=Object.create(null),r=void 0),u=h=-1}else{if(61!==p||-1===u||-1!==h)throw new SyntaxError(`Unexpected character at index ${d}`);n=e.slice(u,d),u=h=-1}else if(c){if(1!==s[p])throw new SyntaxError(`Unexpected character at index ${d}`);-1===u?u=d:a||(a=!0),c=!1}else if(l)if(1===s[p])-1===u&&(u=d);else if(34===p&&-1!==u)l=!1,h=d;else{if(92!==p)throw new SyntaxError(`Unexpected character at index ${d}`);c=!0}else if(34===p&&61===e.charCodeAt(d-1))l=!0;else if(-1===h&&1===s[p])-1===u&&(u=d);else if(-1===u||32!==p&&9!==p){if(59!==p&&44!==p)throw new SyntaxError(`Unexpected character at index ${d}`);{if(-1===u)throw new SyntaxError(`Unexpected character at index ${d}`);-1===h&&(h=d);let s=e.slice(u,h);a&&(s=s.replace(/\\/g,""),a=!1),o(i,n,s),44===p&&(o(t,r,i),i=Object.create(null),r=void 0),n=void 0,u=h=-1}}else-1===h&&(h=d);if(-1===u||l||32===p||9===p)throw new SyntaxError("Unexpected end of input");-1===h&&(h=d);const f=e.slice(u,h);return void 0===r?o(t,f,i):(void 0===n?o(i,f,!0):o(i,n,a?f.replace(/\\/g,""):f),o(t,r,i)),t}}},8528:e=>{"use strict";const t=Symbol("kDone"),r=Symbol("kRun");e.exports=class{constructor(e){this[t]=()=>{this.pending--,this[r]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[r]()}[r](){if(this.pending!==this.concurrency&&this.jobs.length){const e=this.jobs.shift();this.pending++,e(this[t])}}}},7567:(e,t,r)=>{"use strict";const s=r(9796),o=r(4847),n=r(8528),{kStatusCode:i}=r(9864),a=Buffer.from([0,0,255,255]),c=Symbol("permessage-deflate"),l=Symbol("total-length"),u=Symbol("callback"),p=Symbol("buffers"),h=Symbol("error");let d;function f(e){this[p].push(e),this[l]+=e.length}function _(e){this[l]+=e.length,this[c]._maxPayload<1||this[l]<=this[c]._maxPayload?this[p].push(e):(this[h]=new RangeError("Max payload size exceeded"),this[h].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[h][i]=1009,this.removeListener("data",_),this.reset())}function g(e){this[c]._inflate=null,e[i]=1007,this[u](e)}e.exports=class{constructor(e,t,r){if(this._maxPayload=0|r,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,!d){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;d=new n(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[u];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,r=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(!r)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(r.server_no_context_takeover=!0),t.clientNoContextTakeover&&(r.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(r.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?r.client_max_window_bits=t.clientMaxWindowBits:!0!==r.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete r.client_max_window_bits,r}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 r=e[t];if(r.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(r=r[0],"client_max_window_bits"===t){if(!0!==r){const e=+r;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${r}`);r=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}else if("server_max_window_bits"===t){const e=+r;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${r}`);r=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==r)throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}e[t]=r}))})),e}decompress(e,t,r){d.add((s=>{this._decompress(e,t,((e,t)=>{s(),r(e,t)}))}))}compress(e,t,r){d.add((s=>{this._compress(e,t,((e,t)=>{s(),r(e,t)}))}))}_decompress(e,t,r){const n=this._isServer?"client":"server";if(!this._inflate){const e=`${n}_max_window_bits`,t="number"!=typeof this.params[e]?s.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=s.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[c]=this,this._inflate[l]=0,this._inflate[p]=[],this._inflate.on("error",g),this._inflate.on("data",_)}this._inflate[u]=r,this._inflate.write(e),t&&this._inflate.write(a),this._inflate.flush((()=>{const e=this._inflate[h];if(e)return this._inflate.close(),this._inflate=null,void r(e);const s=o.concat(this._inflate[p],this._inflate[l]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[l]=0,this._inflate[p]=[],t&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),r(null,s)}))}_compress(e,t,r){const n=this._isServer?"server":"client";if(!this._deflate){const e=`${n}_max_window_bits`,t="number"!=typeof this.params[e]?s.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=s.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[l]=0,this._deflate[p]=[],this._deflate.on("data",f)}this._deflate[u]=r,this._deflate.write(e),this._deflate.flush(s.Z_SYNC_FLUSH,(()=>{if(!this._deflate)return;let e=o.concat(this._deflate[p],this._deflate[l]);t&&(e=e.slice(0,e.length-4)),this._deflate[u]=null,this._deflate[l]=0,this._deflate[p]=[],t&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),r(null,e)}))}}},3091:(e,t,r)=>{"use strict";const{Writable:s}=r(2781),o=r(7567),{BINARY_TYPES:n,EMPTY_BUFFER:i,kStatusCode:a,kWebSocket:c}=r(9864),{concat:l,toArrayBuffer:u,unmask:p}=r(4847),{isValidStatusCode:h,isValidUTF8:d}=r(1607);function f(e,t,r,s,o){const n=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(n,f),n.code=o,n[a]=s,n}e.exports=class extends s{constructor(e={}){super(),this._binaryType=e.binaryType||n[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=0|e.maxPayload,this._skipUTF8Validation=!!e.skipUTF8Validation,this[c]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=0,this._loop=!1}_write(e,t,r){if(8===this._opcode&&0==this._state)return r();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){const t=this._buffers[0];return this._buffers[0]=t.slice(e),t.slice(0,e)}const t=Buffer.allocUnsafe(e);do{const r=this._buffers[0],s=t.length-e;e>=r.length?t.set(this._buffers.shift(),s):(t.set(new Uint8Array(r.buffer,r.byteOffset,e),s),this._buffers[0]=r.slice(e)),e-=r.length}while(e>0);return t}startLoop(e){let t;this._loop=!0;do{switch(this._state){case 0:t=this.getInfo();break;case 1:t=this.getPayloadLength16();break;case 2:t=this.getPayloadLength64();break;case 3:this.getMask();break;case 4:t=this.getData(e);break;default:return void(this._loop=!1)}}while(this._loop);e(t)}getInfo(){if(this._bufferedBytes<2)return void(this._loop=!1);const e=this.consume(2);if(0!=(48&e[0]))return this._loop=!1,f(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");const t=64==(64&e[0]);if(t&&!this._extensions[o.extensionName])return this._loop=!1,f(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=128==(128&e[0]),this._opcode=15&e[0],this._payloadLength=127&e[1],0===this._opcode){if(t)return this._loop=!1,f(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,f(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return this._loop=!1,f(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=t}else{if(!(this._opcode>7&&this._opcode<11))return this._loop=!1,f(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin)return this._loop=!1,f(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(t)return this._loop=!1,f(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,f(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=128==(128&e[1]),this._isServer){if(!this._masked)return this._loop=!1,f(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,f(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(126===this._payloadLength)this._state=1;else{if(127!==this._payloadLength)return this.haveLength();this._state=2}}getPayloadLength16(){if(!(this._bufferedBytes<2))return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength();this._loop=!1}getPayloadLength64(){if(this._bufferedBytes<8)return void(this._loop=!1);const e=this.consume(8),t=e.readUInt32BE(0);return t>Math.pow(2,21)-1?(this._loop=!1,f(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=t*Math.pow(2,32)+e.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,f(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(e){let t=i;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength)return void(this._loop=!1);t=this.consume(this._payloadLength),this._masked&&0!=(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])&&p(t,this._mask)}return this._opcode>7?this.controlMessage(t):this._compressed?(this._state=5,void this.decompress(t,e)):(t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage())}decompress(e,t){this._extensions[o.extensionName].decompress(e,this._fin,((e,r)=>{if(e)return t(e);if(r.length){if(this._messageLength+=r.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return t(f(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(r)}const s=this.dataMessage();if(s)return t(s);this.startLoop(t)}))}dataMessage(){if(this._fin){const e=this._messageLength,t=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let r;r="nodebuffer"===this._binaryType?l(t,e):"arraybuffer"===this._binaryType?u(l(t,e)):t,this.emit("message",r,!0)}else{const r=l(t,e);if(!this._skipUTF8Validation&&!d(r))return this._loop=!1,f(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",r,!1)}}this._state=0}controlMessage(e){if(8===this._opcode)if(this._loop=!1,0===e.length)this.emit("conclude",1005,i),this.end();else{if(1===e.length)return f(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{const t=e.readUInt16BE(0);if(!h(t))return f(RangeError,`invalid status code ${t}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");const r=e.slice(2);if(!this._skipUTF8Validation&&!d(r))return f(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",t,r),this.end()}}else 9===this._opcode?this.emit("ping",e):this.emit("pong",e);this._state=0}}},2091:(e,t,r)=>{"use strict";r(1808),r(4404);const{randomFillSync:s}=r(6113),o=r(7567),{EMPTY_BUFFER:n}=r(9864),{isValidStatusCode:i}=r(1607),{mask:a,toBuffer:c}=r(4847),l=Symbol("kByteLength"),u=Buffer.alloc(4);class p{constructor(e,t,r){this._extensions=t||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){let r,o,n=!1,i=2,c=!1;t.mask&&(r=t.maskBuffer||u,t.generateMask?t.generateMask(r):s(r,0,4),c=0==(r[0]|r[1]|r[2]|r[3]),i=6),"string"==typeof e?o=t.mask&&!c||void 0===t[l]?(e=Buffer.from(e)).length:t[l]:(o=e.length,n=t.mask&&t.readOnly&&!c);let p=o;o>=65536?(i+=8,p=127):o>125&&(i+=2,p=126);const h=Buffer.allocUnsafe(n?o+i:i);return h[0]=t.fin?128|t.opcode:t.opcode,t.rsv1&&(h[0]|=64),h[1]=p,126===p?h.writeUInt16BE(o,2):127===p&&(h[2]=h[3]=0,h.writeUIntBE(o,4,6)),t.mask?(h[1]|=128,h[i-4]=r[0],h[i-3]=r[1],h[i-2]=r[2],h[i-1]=r[3],c?[h,e]:n?(a(e,r,h,i,o),[h]):(a(e,r,e,0,o),[h,e])):[h,e]}close(e,t,r,s){let o;if(void 0===e)o=n;else{if("number"!=typeof e||!i(e))throw new TypeError("First argument must be a valid error code number");if(void 0!==t&&t.length){const r=Buffer.byteLength(t);if(r>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+r),o.writeUInt16BE(e,0),"string"==typeof t?o.write(t,2):o.set(t,2)}else o=Buffer.allocUnsafe(2),o.writeUInt16BE(e,0)}const a={[l]:o.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,o,!1,a,s]):this.sendFrame(p.frame(o,a),s)}ping(e,t,r){let s,o;if("string"==typeof e?(s=Buffer.byteLength(e),o=!1):(s=(e=c(e)).length,o=c.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");const n={[l]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,n,r]):this.sendFrame(p.frame(e,n),r)}pong(e,t,r){let s,o;if("string"==typeof e?(s=Buffer.byteLength(e),o=!1):(s=(e=c(e)).length,o=c.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");const n={[l]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,n,r]):this.sendFrame(p.frame(e,n),r)}send(e,t,r){const s=this._extensions[o.extensionName];let n,i,a=t.binary?2:1,u=t.compress;if("string"==typeof e?(n=Buffer.byteLength(e),i=!1):(n=(e=c(e)).length,i=c.readOnly),this._firstFragment?(this._firstFragment=!1,u&&s&&s.params[s._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(u=n>=s._threshold),this._compress=u):(u=!1,a=0),t.fin&&(this._firstFragment=!0),s){const s={[l]:n,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:i,rsv1:u};this._deflating?this.enqueue([this.dispatch,e,this._compress,s,r]):this.dispatch(e,this._compress,s,r)}else this.sendFrame(p.frame(e,{[l]:n,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:i,rsv1:!1}),r)}dispatch(e,t,r,s){if(!t)return void this.sendFrame(p.frame(e,r),s);const n=this._extensions[o.extensionName];this._bufferedBytes+=r[l],this._deflating=!0,n.compress(e,r.fin,((e,t)=>{if(this._socket.destroyed){const e=new Error("The socket was closed while data was being compressed");"function"==typeof s&&s(e);for(let t=0;t<this._queue.length;t++){const r=this._queue[t],s=r[r.length-1];"function"==typeof s&&s(e)}}else this._bufferedBytes-=r[l],this._deflating=!1,r.readOnly=!1,this.sendFrame(p.frame(t,r),s),this.dequeue()}))}dequeue(){for(;!this._deflating&&this._queue.length;){const e=this._queue.shift();this._bufferedBytes-=e[3][l],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][l],this._queue.push(e)}sendFrame(e,t){2===e.length?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}}e.exports=p},5519:(e,t,r)=>{"use strict";const{Duplex:s}=r(2781);function o(e){e.emit("close")}function n(){!this.destroyed&&this._writableState.finished&&this.destroy()}function i(e){this.removeListener("error",i),this.destroy(),0===this.listenerCount("error")&&this.emit("error",e)}e.exports=function(e,t){let r=!0;const a=new s({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",(function(t,r){const s=!r&&a._readableState.objectMode?t.toString():t;a.push(s)||e.pause()})),e.once("error",(function(e){a.destroyed||(r=!1,a.destroy(e))})),e.once("close",(function(){a.destroyed||a.push(null)})),a._destroy=function(t,s){if(e.readyState===e.CLOSED)return s(t),void process.nextTick(o,a);let n=!1;e.once("error",(function(e){n=!0,s(e)})),e.once("close",(function(){n||s(t),process.nextTick(o,a)})),r&&e.terminate()},a._final=function(t){e.readyState!==e.CONNECTING?null!==e._socket&&(e._socket._writableState.finished?(t(),a._readableState.endEmitted&&a.destroy()):(e._socket.once("finish",(function(){t()})),e.close())):e.once("open",(function(){a._final(t)}))},a._read=function(){e.isPaused&&e.resume()},a._write=function(t,r,s){e.readyState!==e.CONNECTING?e.send(t,s):e.once("open",(function(){a._write(t,r,s)}))},a.on("end",n),a.on("error",i),a}},2217:(e,t,r)=>{"use strict";const{tokenChars:s}=r(1607);e.exports={parse:function(e){const t=new Set;let r=-1,o=-1,n=0;for(;n<e.length;n++){const i=e.charCodeAt(n);if(-1===o&&1===s[i])-1===r&&(r=n);else if(0===n||32!==i&&9!==i){if(44!==i)throw new SyntaxError(`Unexpected character at index ${n}`);{if(-1===r)throw new SyntaxError(`Unexpected character at index ${n}`);-1===o&&(o=n);const s=e.slice(r,o);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);t.add(s),r=o=-1}}else-1===o&&-1!==r&&(o=n)}if(-1===r||-1!==o)throw new SyntaxError("Unexpected end of input");const i=e.slice(r,n);if(t.has(i))throw new SyntaxError(`The "${i}" subprotocol is duplicated`);return t.add(i),t}}},1607:(e,t,r)=>{"use strict";const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function o(e){return e>=1e3&&e<=1014&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999}function n(e){const t=e.length;let r=0;for(;r<t;)if(0==(128&e[r]))r++;else if(192==(224&e[r])){if(r+1===t||128!=(192&e[r+1])||192==(254&e[r]))return!1;r+=2}else if(224==(240&e[r])){if(r+2>=t||128!=(192&e[r+1])||128!=(192&e[r+2])||224===e[r]&&128==(224&e[r+1])||237===e[r]&&160==(224&e[r+1]))return!1;r+=3}else{if(240!=(248&e[r]))return!1;if(r+3>=t||128!=(192&e[r+1])||128!=(192&e[r+2])||128!=(192&e[r+3])||240===e[r]&&128==(240&e[r+1])||244===e[r]&&e[r+1]>143||e[r]>244)return!1;r+=4}return!0}try{const t=r(Object(function(){var e=new Error("Cannot find module 'utf-8-validate'");throw e.code="MODULE_NOT_FOUND",e}()));e.exports={isValidStatusCode:o,isValidUTF8:e=>e.length<150?n(e):t(e),tokenChars:s}}catch(t){e.exports={isValidStatusCode:o,isValidUTF8:n,tokenChars:s}}},58:(e,t,r)=>{"use strict";const s=r(2361),o=r(3685),{createHash:n}=(r(5687),r(1808),r(4404),r(6113)),i=r(3071),a=r(7567),c=r(2217),l=r(2982),{GUID:u,kWebSocket:p}=r(9864),h=/^[+/0-9A-Za-z]{22}==$/;function d(e){e._state=2,e.emit("close")}function f(){this.destroy()}function _(e,t,r,s){e.writable&&(r=r||o.STATUS_CODES[t],s={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...s},e.write(`HTTP/1.1 ${t} ${o.STATUS_CODES[t]}\r\n`+Object.keys(s).map((e=>`${e}: ${s[e]}`)).join("\r\n")+"\r\n\r\n"+r)),e.removeListener("error",f),e.destroy()}e.exports=class extends s{constructor(e,t){if(super(),null==(e={maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...e}).port&&!e.server&&!e.noServer||null!=e.port&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(null!=e.port?(this._server=o.createServer(((e,t)=>{const r=o.STATUS_CODES[426];t.writeHead(426,{"Content-Length":r.length,"Content-Type":"text/plain"}),t.end(r)})),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){const e=this.emit.bind(this,"connection");this._removeListeners=function(e,t){for(const r of Object.keys(t))e.on(r,t[r]);return function(){for(const r of Object.keys(t))e.removeListener(r,t[r])}}(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(t,r,s)=>{this.handleUpgrade(t,r,s,e)}})}!0===e.perMessageDeflate&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=0}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(2===this._state)return e&&this.once("close",(()=>{e(new Error("The server is not running"))})),void process.nextTick(d,this);if(e&&this.once("close",e),1!==this._state)if(this._state=1,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients&&this.clients.size?this._shouldEmitClose=!0:process.nextTick(d,this);else{const e=this._server;this._removeListeners(),this._removeListeners=this._server=null,e.close((()=>{d(this)}))}}shouldHandle(e){if(this.options.path){const t=e.url.indexOf("?");if((-1!==t?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,r,s){t.on("error",f);const o=void 0!==e.headers["sec-websocket-key"]&&e.headers["sec-websocket-key"],n=+e.headers["sec-websocket-version"];if("GET"!==e.method||"websocket"!==e.headers.upgrade.toLowerCase()||!o||!h.test(o)||8!==n&&13!==n||!this.shouldHandle(e))return _(t,400);const l=e.headers["sec-websocket-protocol"];let u=new Set;if(void 0!==l)try{u=c.parse(l)}catch(e){return _(t,400)}const p=e.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&void 0!==p){const e=new a(this.options.perMessageDeflate,!0,this.options.maxPayload);try{const t=i.parse(p);t[a.extensionName]&&(e.accept(t[a.extensionName]),d[a.extensionName]=e)}catch(e){return _(t,400)}}if(this.options.verifyClient){const i={origin:e.headers[8===n?"sec-websocket-origin":"origin"],secure:!(!e.socket.authorized&&!e.socket.encrypted),req:e};if(2===this.options.verifyClient.length)return void this.options.verifyClient(i,((n,i,a,c)=>{if(!n)return _(t,i||401,a,c);this.completeUpgrade(d,o,u,e,t,r,s)}));if(!this.options.verifyClient(i))return _(t,401)}this.completeUpgrade(d,o,u,e,t,r,s)}completeUpgrade(e,t,r,s,o,c,h){if(!o.readable||!o.writable)return o.destroy();if(o[p])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return _(o,503);const g=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${n("sha1").update(t+u).digest("base64")}`],m=new l(null);if(r.size){const e=this.options.handleProtocols?this.options.handleProtocols(r,s):r.values().next().value;e&&(g.push(`Sec-WebSocket-Protocol: ${e}`),m._protocol=e)}if(e[a.extensionName]){const t=e[a.extensionName].params,r=i.format({[a.extensionName]:[t]});g.push(`Sec-WebSocket-Extensions: ${r}`),m._extensions=e}this.emit("headers",g,s),o.write(g.concat("\r\n").join("\r\n")),o.removeListener("error",f),m.setSocket(o,c,{maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(m),m.on("close",(()=>{this.clients.delete(m),this._shouldEmitClose&&!this.clients.size&&process.nextTick(d,this)}))),h(m,s)}}},2982:(e,t,r)=>{"use strict";const s=r(2361),o=r(5687),n=r(3685),i=r(1808),a=r(4404),{randomBytes:c,createHash:l}=r(6113),{Readable:u}=r(2781),{URL:p}=r(7310),h=r(7567),d=r(3091),f=r(2091),{BINARY_TYPES:_,EMPTY_BUFFER:g,GUID:m,kForOnEventAttribute:y,kListener:v,kStatusCode:b,kWebSocket:E,NOOP:S}=r(9864),{EventTarget:{addEventListener:x,removeEventListener:R}}=r(5831),{format:C,parse:k}=r(3071),{toBuffer:w}=r(4847),A=["CONNECTING","OPEN","CLOSING","CLOSED"],O=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,T=[8,13];class N extends s{constructor(e,t,r){super(),this._binaryType=_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=g,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=N.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==e?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,void 0===t?t=[]:Array.isArray(t)||("object"==typeof t&&null!==t?(r=t,t=[]):t=[t]),L(this,e,t,r)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(e){_.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 isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,r){const s=new d({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation});this._sender=new f(e,this._extensions,r.generateMask),this._receiver=s,this._socket=e,s[E]=this,e[E]=this,s.on("conclude",B),s.on("drain",D),s.on("error",U),s.on("message",F),s.on("ping",G),s.on("pong",W),e.setTimeout(0),e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",K),e.on("data",V),e.on("end",Q),e.on("error",z),this._readyState=N.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this._readyState=N.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[h.extensionName]&&this._extensions[h.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=N.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==N.CLOSED){if(this.readyState===N.CONNECTING){const e="WebSocket was closed before the connection was established";return $(this,this._req,e)}this.readyState!==N.CLOSING?(this._readyState=N.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()}}pause(){this.readyState!==N.CONNECTING&&this.readyState!==N.CLOSED&&(this._paused=!0,this._socket.pause())}ping(e,t,r){if(this.readyState===N.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(r=e,e=t=void 0):"function"==typeof t&&(r=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===N.OPEN?(void 0===t&&(t=!this._isServer),this._sender.ping(e||g,t,r)):M(this,e,r)}pong(e,t,r){if(this.readyState===N.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(r=e,e=t=void 0):"function"==typeof t&&(r=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===N.OPEN?(void 0===t&&(t=!this._isServer),this._sender.pong(e||g,t,r)):M(this,e,r)}resume(){this.readyState!==N.CONNECTING&&this.readyState!==N.CLOSED&&(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,r){if(this.readyState===N.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof t&&(r=t,t={}),"number"==typeof e&&(e=e.toString()),this.readyState!==N.OPEN)return void M(this,e,r);const s={binary:"string"!=typeof e,mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[h.extensionName]||(s.compress=!1),this._sender.send(e||g,s,r)}terminate(){if(this.readyState!==N.CLOSED){if(this.readyState===N.CONNECTING){const e="WebSocket was closed before the connection was established";return $(this,this._req,e)}this._socket&&(this._readyState=N.CLOSING,this._socket.destroy())}}}function L(e,t,r,s){const i={protocolVersion:T[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,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(!T.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${T.join(", ")})`);let a;if(t instanceof p)a=t,e._url=t.href;else{try{a=new p(t)}catch(e){throw new SyntaxError(`Invalid URL: ${t}`)}e._url=t}const u="wss:"===a.protocol,d="ws+unix:"===a.protocol;let f;if("ws:"===a.protocol||u||d?d&&!a.pathname?f="The URL's pathname is empty":a.hash&&(f="The URL contains a fragment identifier"):f='The URL\'s protocol must be one of "ws:", "wss:", or "ws+unix:"',f){const t=new SyntaxError(f);if(0===e._redirects)throw t;return void P(e,t)}const _=u?443:80,g=c(16).toString("base64"),y=u?o.get:n.get,v=new Set;let b;if(i.createConnection=u?H:I,i.defaultPort=i.defaultPort||_,i.port=a.port||_,i.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname,i.headers={"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":g,Connection:"Upgrade",Upgrade:"websocket",...i.headers},i.path=a.pathname+a.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(b=new h(!0!==i.perMessageDeflate?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=C({[h.extensionName]:b.offer()})),r.length){for(const e of r){if("string"!=typeof e||!O.test(e)||v.has(e))throw new SyntaxError("An invalid or duplicated subprotocol was specified");v.add(e)}i.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(a.username||a.password)&&(i.auth=`${a.username}:${a.password}`),d){const e=i.path.split(":");i.socketPath=e[0],i.path=e[1]}let E=e._req=y(i);i.timeout&&E.on("timeout",(()=>{$(e,E,"Opening handshake has timed out")})),E.on("error",(t=>{null===E||E.aborted||(E=e._req=null,P(e,t))})),E.on("response",(o=>{const n=o.headers.location,a=o.statusCode;if(n&&i.followRedirects&&a>=300&&a<400){if(++e._redirects>i.maxRedirects)return void $(e,E,"Maximum redirects exceeded");let o;E.abort();try{o=new p(n,t)}catch(t){const r=new SyntaxError(`Invalid URL: ${n}`);return void P(e,r)}L(e,o,r,s)}else e.emit("unexpected-response",E,o)||$(e,E,`Unexpected server response: ${o.statusCode}`)})),E.on("upgrade",((t,r,s)=>{if(e.emit("upgrade",t),e.readyState!==N.CONNECTING)return;E=e._req=null;const o=l("sha1").update(g+m).digest("base64");if(t.headers["sec-websocket-accept"]!==o)return void $(e,r,"Invalid Sec-WebSocket-Accept header");const n=t.headers["sec-websocket-protocol"];let a;if(void 0!==n?v.size?v.has(n)||(a="Server sent an invalid subprotocol"):a="Server sent a subprotocol but none was requested":v.size&&(a="Server sent no subprotocol"),a)return void $(e,r,a);n&&(e._protocol=n);const c=t.headers["sec-websocket-extensions"];if(void 0!==c){if(!b)return void $(e,r,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");let t;try{t=k(c)}catch(t){return void $(e,r,"Invalid Sec-WebSocket-Extensions header")}const s=Object.keys(t);if(1!==s.length||s[0]!==h.extensionName)return void $(e,r,"Server indicated an extension that was not requested");try{b.accept(t[h.extensionName])}catch(t){return void $(e,r,"Invalid Sec-WebSocket-Extensions header")}e._extensions[h.extensionName]=b}e.setSocket(r,s,{generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}))}function P(e,t){e._readyState=N.CLOSING,e.emit("error",t),e.emitClose()}function I(e){return e.path=e.socketPath,i.connect(e)}function H(e){return e.path=void 0,e.servername||""===e.servername||(e.servername=i.isIP(e.host)?"":e.host),a.connect(e)}function $(e,t,r){e._readyState=N.CLOSING;const s=new Error(r);Error.captureStackTrace(s,$),t.setHeader?(t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),t.once("abort",e.emitClose.bind(e)),e.emit("error",s)):(t.destroy(s),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function M(e,t,r){if(t){const r=w(t).length;e._socket?e._sender._bufferedBytes+=r:e._bufferedAmount+=r}r&&r(new Error(`WebSocket is not open: readyState ${e.readyState} (${A[e.readyState]})`))}function B(e,t){const r=this[E];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,void 0!==r._socket[E]&&(r._socket.removeListener("data",V),process.nextTick(q,r._socket),1005===e?r.close():r.close(e,t))}function D(){const e=this[E];e.isPaused||e._socket.resume()}function U(e){const t=this[E];void 0!==t._socket[E]&&(t._socket.removeListener("data",V),process.nextTick(q,t._socket),t.close(e[b])),t.emit("error",e)}function j(){this[E].emitClose()}function F(e,t){this[E].emit("message",e,t)}function G(e){const t=this[E];t.pong(e,!t._isServer,S),t.emit("ping",e)}function W(e){this[E].emit("pong",e)}function q(e){e.resume()}function K(){const e=this[E];let t;this.removeListener("close",K),this.removeListener("data",V),this.removeListener("end",Q),e._readyState=N.CLOSING,this._readableState.endEmitted||e._closeFrameReceived||e._receiver._writableState.errorEmitted||null===(t=e._socket.read())||e._receiver.write(t),e._receiver.end(),this[E]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",j),e._receiver.on("finish",j))}function V(e){this[E]._receiver.write(e)||this.pause()}function Q(){const e=this[E];e._readyState=N.CLOSING,e._receiver.end(),this.end()}function z(){const e=this[E];this.removeListener("error",z),this.on("error",S),e&&(e._readyState=N.CLOSING,this.destroy())}Object.defineProperty(N,"CONNECTING",{enumerable:!0,value:A.indexOf("CONNECTING")}),Object.defineProperty(N.prototype,"CONNECTING",{enumerable:!0,value:A.indexOf("CONNECTING")}),Object.defineProperty(N,"OPEN",{enumerable:!0,value:A.indexOf("OPEN")}),Object.defineProperty(N.prototype,"OPEN",{enumerable:!0,value:A.indexOf("OPEN")}),Object.defineProperty(N,"CLOSING",{enumerable:!0,value:A.indexOf("CLOSING")}),Object.defineProperty(N.prototype,"CLOSING",{enumerable:!0,value:A.indexOf("CLOSING")}),Object.defineProperty(N,"CLOSED",{enumerable:!0,value:A.indexOf("CLOSED")}),Object.defineProperty(N.prototype,"CLOSED",{enumerable:!0,value:A.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((e=>{Object.defineProperty(N.prototype,e,{enumerable:!0})})),["open","error","close","message"].forEach((e=>{Object.defineProperty(N.prototype,`on${e}`,{enumerable:!0,get(){for(const t of this.listeners(e))if(t[y])return t[v];return null},set(t){for(const t of this.listeners(e))if(t[y]){this.removeListener(e,t);break}"function"==typeof t&&this.addEventListener(e,t,{[y]:!0})}})})),N.prototype.addEventListener=x,N.prototype.removeEventListener=R,e.exports=N},5370:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.Cancelled=t.NeverCancelled=t.cancellableRace=t.timeoutPromise=t.TaskCancelledError=void 0;const s=r(1032),o=r(4936),n=r(8986);class i extends s.ProtocolError{constructor(e){super({id:9243,format:e,showUser:!0}),this._cause={id:9243,format:e,showUser:!0}}}t.TaskCancelledError=i,t.timeoutPromise=function(e,t,r){if(t.isCancellationRequested)return Promise.reject(new i(r||"Task cancelled"));const s=(0,n.getDeferred)(),o=t.onCancellationRequested(s.resolve);return Promise.race([s.promise.then((()=>{throw new i(r||"Task cancelled")})),e.then((e=>(o.dispose(),e))).catch((e=>{throw o.dispose(),e}))])},t.cancellableRace=function(e,t){const r=new c(t),s=e.map((async e=>{try{return await e(r.token)}finally{r.cancel()}}));return Promise.race(s)};const a=Object.freeze((function(e,t){const r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}));t.NeverCancelled=Object.freeze({isCancellationRequested:!1,onCancellationRequested:()=>({dispose:()=>{}})}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:a});class c{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}static withTimeout(e,t){const r=new c(t),s=r._token=new l,o=setTimeout((()=>s.cancel()),e);return s.onCancellationRequested((()=>clearTimeout(o))),r}get token(){return this._token||(this._token=new l),this._token}cancel(){this._token?this._token instanceof l&&this._token.cancel():this._token=t.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof l&&this._token.dispose():this._token=t.NeverCancelled}}t.CancellationTokenSource=c;class l{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new o.EventEmitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}},4936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListenerMap=t.EventEmitter=void 0;const s=r(7678);class o{constructor(){this._listeners=new Set,this.event=(e,t,r)=>{const s={listener:e,thisArg:t};this._listeners.add(s);const o={dispose:()=>{o.dispose=()=>{},this._listeners.delete(s)}};return r&&r.push(o),o}}get size(){return this._listeners.size}fire(e){const t=!this._deliveryQueue;this._deliveryQueue||(this._deliveryQueue=[]);for(const t of this._listeners)this._deliveryQueue.push({data:t,event:e});if(t){for(let e=0;e<this._deliveryQueue.length;e++){const{data:t,event:r}=this._deliveryQueue[e];t.listener.call(t.thisArg,r)}this._deliveryQueue=void 0}}dispose(){this._listeners.clear(),this._deliveryQueue&&(this._deliveryQueue=[])}}t.EventEmitter=o,t.ListenerMap=class{constructor(){this.map=new Map,this.listeners=this.map}listen(e,t){let r=this.map.get(e);r||(r=new o,this.map.set(e,r));const n=r.event(t);return{dispose:(0,s.once)((()=>{n.dispose(),0===(null==r?void 0:r.size)&&this.map.delete(e)}))}}emit(e,t){var r;null===(r=this.listeners.get(e))||void 0===r||r.fire(t)}}},7551:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.waitForServerToListen=t.makeAcquireWebSocketServer=t.makeAcquireTcpServer=t.acquirePortNumber=t.isPortOpen=t.findOpenPort=void 0;const i=n(r(1808)),a=n(r(8681)),c=r(5370),l=r(7999);function u(e,t=c.NeverCancelled){let r;return new Promise(((s,o)=>{const n=i.createServer();n.listen(e,"127.0.0.1",(()=>{const e=n.address();n.close((()=>s(e.port)))})),n.on("error",o),r=t.onCancellationRequested((()=>{n.close(),o(new c.TaskCancelledError("Port open lookup cancelled"))}))})).finally((()=>null==r?void 0:r.dispose()))}t.findOpenPort=async function({min:e=53e3,max:t=54e3,attempts:r=1e3,tester:s=u}={},o=c.NeverCancelled){let n=(0,l.randomInRange)(e,t);for(let i=Math.min(r,t-e);;i--)try{return await s(n,o)}catch(r){if(0===i||r instanceof c.TaskCancelledError)throw r;n=n===t-1?e:n+1}},t.isPortOpen=async function(e,t){try{return await u(e,t),!0}catch(e){return!1}},t.acquirePortNumber=u,t.makeAcquireTcpServer=e=>(r,s)=>{const o=i.createServer(e);return o.listen(r,"127.0.0.1"),(0,t.waitForServerToListen)(o,s)},t.makeAcquireWebSocketServer=e=>(r,s)=>(0,t.waitForServerToListen)(new a.Server(Object.assign(Object.assign({host:"127.0.0.1"},e),{port:r})),s),t.waitForServerToListen=(e,t)=>{let r;return new Promise(((s,o)=>{e.on("error",o),e.on("listening",(()=>s(e))),r=t.onCancellationRequested((()=>{e.close(),o(new c.TaskCancelledError("Port open lookup cancelled"))}))})).finally((()=>null==r?void 0:r.dispose()))}},9140:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findOpenPortSync=t.acquirePortNumber=void 0;const s=r(2081),o=r(7999);var n=r(7551);Object.defineProperty(t,"acquirePortNumber",{enumerable:!0,get:function(){return n.acquirePortNumber}}),t.findOpenPortSync=function({min:e=53e3,max:t=54e3,attempts:r=1e3}={}){const s=i();let n=(0,o.randomInRange)(e,t);for(let o=Math.min(r,t-e);o>=0;o--){if(s(n))return n;n=n===t-1?e:n+1}throw new Error("No open port found")};const i=()=>{const e=e=>0===(0,s.spawnSync)(process.execPath,["-e",'require("net").createServer().on("listening",()=>process.exit(0)).on("error",()=>process.exit(1)).listen(+process.env.PORT)'],{env:Object.assign(Object.assign({},process.env),{PORT:String(e),NODE_OPTIONS:void 0,ELECTRON_RUN_AS_NODE:"1"})}).status;let t="win32"===process.platform?e:r=>{var o;const n=(0,s.spawnSync)("nc",["-z","127.0.0.1",String(r)]);return"ENOENT"===(null===(o=n.error)||void 0===o?void 0:o.code)&&(t=e),1===n.status};return e=>t(e)}},7873:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.knownToolGlob=t.knownToolToken=void 0;const r=new Set(["mocha","jest","jest-cli","ava","tape","tap","ts-node","babel-node"]);t.knownToolToken="$KNOWN_TOOLS$",t.knownToolGlob=`{${[...r].join(",")}}`},7678:(e,t)=>{"use strict";function r(e,t){const r={};for(const s of Object.keys(e)){const o=e[s];t(o,s)&&(r[s]=o)}return r}Object.defineProperty(t,"__esModule",{value:!0}),t.invertMap=t.upcastPartial=t.pick=t.flatten=t.bisectArray=t.trailingEdgeThrottle=t.debounce=t.memoizeWeak=t.memoize=t.once=t.getCaseInsensitiveProperty=t.caseInsensitiveMerge=t.walkObject=t.sortKeys=t.filterObject=t.mapKeys=t.mapValues=t.filterValues=t.assertNever=t.removeUndefined=t.removeNulls=t.truthy=void 0,t.truthy=e=>!!e,t.removeNulls=e=>r(e,(e=>null!==e)),t.removeUndefined=e=>r(e,(e=>void 0!==e)),t.assertNever=(e,t)=>{throw new Error(t.replace("{value}",JSON.stringify(e)))},t.filterValues=r,t.mapValues=function(e,t){const r={};for(const s of Object.keys(e)){const o=e[s];r[s]=t(o,s)}return r},t.mapKeys=function(e,t){const r={};for(const s of Object.keys(e)){const o=t(s,e[s]);void 0!==o&&(r[o]=e[s])}return r},t.filterObject=function(e,t){const r={};for(const s of Object.keys(e))t(s,e[s])&&(r[s]=e[s]);return r},t.sortKeys=function(e,t){if(!e||"object"!=typeof e||e instanceof Array)return e;const r={};for(const s of Object.keys(e).sort(t))r[s]=e[s];return r},t.walkObject=function e(t,r){if(t=r(t))if(t instanceof Array)t=t.map((t=>e(t,r)));else if("object"==typeof t&&t)for(const s of Object.keys(t))t[s]=e(t[s],r);return t},t.caseInsensitiveMerge=function(...e){if(0===e.length)return{};const t={},r=Object.create(null);for(const s of e)if(s)for(const e of Object.keys(s)){const o=e.toLowerCase();r[o]?t[r[o]]=s[e]:(r[o]=e,t[e]=s[e])}return t},t.getCaseInsensitiveProperty=function(e,t){if(e.hasOwnProperty(t))return e[t];const r=t.toLowerCase();for(const t of Object.keys(e))if(t.toLowerCase()===r)return e[t]};const s=Symbol("unset");t.once=function(e){let t=s;const r=(...o)=>(t===s&&(r.value=t=e(...o)),t);return r.forget=()=>{t=s,r.value=void 0},r.value=void 0,r},t.memoize=function(e){const t=new Map,r=r=>{if(t.has(r))return t.get(r);const s=e(r);return t.set(r,s),s};return r.clear=()=>t.clear(),r},t.memoizeWeak=function(e){const t=new WeakMap;return r=>{if(t.has(r))return t.get(r);const s=e(r);return t.set(r,s),s}},t.debounce=function(e,t){let r;const s=()=>{void 0!==r&&clearTimeout(r),r=setTimeout((()=>{r=void 0,t()}),e)};return s.clear=()=>{r&&(clearTimeout(r),r=void 0)},s},t.trailingEdgeThrottle=function(e,t){let r;const s=()=>{void 0===r&&(r=setTimeout((()=>{r=void 0,t()}),e))};return s.queued=()=>!!r,s.clear=()=>{r&&(clearTimeout(r),r=void 0)},s},t.bisectArray=function(e,t){const r=[],s=[];for(const o of e)t(o)?r.push(o):s.push(o);return[r,s]},t.flatten=function(e){let t=[];for(const r of e)t=t.concat(r);return t},t.pick=function(e,t){const r={};for(const s of t)r[s]=e[s];return r},t.upcastPartial=e=>e,t.invertMap=function(e){const t=new Map;for(const[r,s]of e)t.set(s,r);return t}},8986:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDeferred=t.some=t.disposableTimeout=t.delay=void 0,t.delay=e=>isFinite(e)?new Promise((t=>setTimeout(t,e))):new Promise((()=>{})),t.disposableTimeout=(e,t)=>{const r=setTimeout(e,t);return{dispose:()=>clearTimeout(r)}},t.some=function(e){return new Promise(((t,r)=>{let s=e.length;for(const o of e)o.then((e=>{e?(t(e),s=-1):0==--s&&t(void 0)})).catch(r)}))},t.getDeferred=function(){let e,t=null,r=null,s=!1;const o=new Promise(((o,n)=>{t=t=>{s=!0,e=t,o(t)},r=e=>{s=!0,n(e)}}));return{resolve:t,reject:r,promise:o,get settledValue(){return e},hasSettled:()=>s}}},7999:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomInRange=void 0,t.randomInRange=(e,t)=>e+Math.floor(Math.random()*(t-e))},1032:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolError=void 0;class r extends Error{constructor(e){super("__errorMarker"in e?e.error.format:e.format),this._cause="__errorMarker"in e?e.error:e}get cause(){return this._cause}}t.ProtocolError=r},7207:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=r(2081),c=n(r(7147)),l=n(r(1405)),u=i(r(8586)),p=n(r(1017)),h=r(9140),d=r(7873),f=r(3915),_=r(1465),g=r(8745),m=r(3783),y=r(1446),v={cwd:process.cwd(),processId:process.pid,nodeVersion:process.version,architecture:process.arch},b="$jsDebugIsRegistered";(()=>{try{if(b in global)return;const e=new f.BootloaderEnvironment(process.env),t=e.inspectorOptions;if(g.bootloaderLogger.enabled=!!(null==t?void 0:t.verbose),g.bootloaderLogger.info("runtime.launch","Bootloader imported",{env:t,args:process.argv}),Object.defineProperty(global,b,{value:!0,enumerable:!1}),!(0,_.checkAll)(t))return void e.unsetForTree();try{if(!r(1267).isMainThread)return}catch(e){}!function(e){var t;const r=null===(t=e.inspectorOptions)||void 0===t?void 0:t.fileCallback;r&&(c.writeFileSync(r,JSON.stringify(v)),e.updateInspectorOption("fileCallback",void 0))}(e),/(\\|\/|^)node(64)?(.exe)?$/.test(process.execPath)&&(t.execPath=process.execPath);const s=(0,y.createTargetId)(),o=function(e,t){const r=function(e){if(!e)return!1;try{return c.readdirSync(p.dirname(e)).includes(p.basename(e))}catch(e){return!1}}(e.inspectorIpc)?e.deferredMode?1:0:2;if(g.bootloaderLogger.info("runtime","Set debug mode",{mode:r}),2===r)return!1;const s=void 0!==l.url();if(!s){if(!function(e){switch(e.autoAttachMode){case"always":return!0;case"smart":return function(e){const t=process.argv[1];return!t||function(e,t){return!!t.aaPatterns&&(0,u.default)([e.replace(/\\/g,"/")],[...t.aaPatterns.map((e=>e.replace(d.knownToolToken,d.knownToolGlob)))],{dot:!0,nocase:!0}).length>0}(t,e)}(e);default:return!1}}(e))return!1;l.open(function(e){if(!e.mandatePortTracking)return 0;try{return(0,h.findOpenPortSync)({attempts:20})}catch(e){return 0}}(e),void 0,!1)}const o={ipcAddress:e.inspectorIpc||"",pid:String(process.pid),telemetry:v,scriptName:process.argv[1],inspectorURL:l.url(),waitForDebugger:!0,ownId:t,openerId:e.openerId};if(0===r)n=e.execPath||process.execPath,i=o,(0,a.spawn)(n,[m.watchdogPath],{env:{NODE_INSPECTOR_INFO:JSON.stringify(i),NODE_SKIP_PLATFORM_CHECK:process.env.NODE_SKIP_PLATFORM_CHECK},stdio:"ignore",detached:!0}).unref();else{const{status:t,stderr:r}=(0,a.spawnSync)(e.execPath||process.execPath,["-e",'const c=require("net").createConnection(process.env.NODE_INSPECTOR_IPC);setTimeout(()=>{console.error("timeout"),process.exit(1)},10000),c.on("error",e=>{console.error(e),process.exit(1)}),c.on("connect",()=>{c.write(process.env.NODE_INSPECTOR_INFO,"utf-8"),c.write(Buffer.from([0])),c.on("data",e=>{console.error("read byte",e[0]),process.exit(e[0])})});'],{env:{NODE_SKIP_PLATFORM_CHECK:process.env.NODE_SKIP_PLATFORM_CHECK,NODE_INSPECTOR_INFO:JSON.stringify(o),NODE_INSPECTOR_IPC:e.inspectorIpc}});if(t)return console.error(r.toString()),console.error("Error activating auto attach, please report to https://aka.ms/js-dbg-issue"),!1}var n,i;const f=l;return f.waitForDebugger?f.waitForDebugger():l.open(s?void 0:0,void 0,!0),!0}(t,s);t.onlyEntrypoint?e.unsetForTree():o&&e.updateInspectorOption("openerId",s)}catch(e){console.error(`Error in the js-debug bootloader, please report to https://aka.ms/js-dbg-issue: ${e.stack}`)}})()},3915:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BootloaderEnvironment=t.variableDelimiter=void 0,t.variableDelimiter=":::",t.BootloaderEnvironment=class{constructor(e){this.processEnv=e}get nodeOptions(){return this.processEnv.NODE_OPTIONS}set nodeOptions(e){void 0===e?delete this.processEnv.NODE_OPTIONS:this.processEnv.NODE_OPTIONS=e}get inspectorOptions(){const e=this.processEnv.VSCODE_INSPECTOR_OPTIONS;if(!e)return;const r=e.split(t.variableDelimiter).find((e=>!!e));if(r)try{return JSON.parse(r)}catch(e){return}}set inspectorOptions(e){void 0===e?delete this.processEnv.VSCODE_INSPECTOR_OPTIONS:this.processEnv.VSCODE_INSPECTOR_OPTIONS=JSON.stringify(e)}unsetForTree(){delete this.processEnv.VSCODE_INSPECTOR_OPTIONS}updateInspectorOption(e,t){const r=this.inspectorOptions;r&&(this.inspectorOptions=Object.assign(Object.assign({},r),{[e]:t}))}}},1465:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkAll=exports.checkIsNotNodeGyp=exports.checkNotNpmPrefixCheckOnWindows=exports.checkProcessFilter=exports.checkNotElectron=exports.checkLeaseFile=exports.checkIsDebugMode=void 0;const path_1=__webpack_require__(1017),lease_file_1=__webpack_require__(9597),logger_1=__webpack_require__(8745),checkIsDebugMode=e=>!(!e||!e.inspectorIpc)||(logger_1.bootloaderLogger.info("runtime.launch","Disabling due to lack of IPC server"),!1);exports.checkIsDebugMode=checkIsDebugMode;const checkLeaseFile=e=>{const t=e.requireLease;return!(t&&!lease_file_1.LeaseFile.isValid(t)&&(logger_1.bootloaderLogger.info("runtime.launch","Disabling due to invalid lease file"),1))};exports.checkLeaseFile=checkLeaseFile;const checkNotElectron=()=>{try{return eval("window"),logger_1.bootloaderLogger.info("runtime.launch","Disabling in Electron (window is set)"),!1}catch(e){return!0}};exports.checkNotElectron=checkNotElectron;const checkProcessFilter=e=>{let t,r="";try{r=__webpack_require__(3121).resolve(process.argv[1])}catch(e){r=process.argv[1]}try{t=new RegExp(e.waitForDebugger||"").test(r)}catch(e){t=!0}return t||logger_1.bootloaderLogger.info("runtime.launch","Disabling due to not matching pattern",{pattern:e.waitForDebugger,scriptName:r}),t};exports.checkProcessFilter=checkProcessFilter;const checkNotNpmPrefixCheckOnWindows=()=>{const e=process.argv;return!(4===e.length&&"npm-cli.js"===(0,path_1.basename)(e[1])&&"prefix"===e[2]&&"-g"===e[3])};exports.checkNotNpmPrefixCheckOnWindows=checkNotNpmPrefixCheckOnWindows;const checkIsNotNodeGyp=e=>!(e.deferredMode&&process.argv.length>=2&&"node-gyp.js"===(0,path_1.basename)(process.argv[1]));exports.checkIsNotNodeGyp=checkIsNotNodeGyp;const allChecks=[exports.checkIsNotNodeGyp,exports.checkIsDebugMode,exports.checkLeaseFile,exports.checkNotElectron,exports.checkProcessFilter,exports.checkNotNpmPrefixCheckOnWindows],checkAll=e=>!!e&&!allChecks.some((t=>!t(e)));exports.checkAll=checkAll},8745:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bootloaderLogger=void 0,t.bootloaderLogger={enabled:!1,info:(...e)=>{t.bootloaderLogger.enabled&&console.log(...e)}}},3783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bootloaderDefaultPath=t.watchdogPath=void 0;const s=r(1017);t.watchdogPath=(0,s.join)(__dirname,"watchdog.bundle.js"),t.bootloaderDefaultPath=(0,s.join)(__dirname,"bootloader.bundle.js")},1446:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTargetId=void 0;const s=r(6113);t.createTargetId=()=>(0,s.randomBytes)(12).toString("hex")},9597:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LeaseFile=void 0;const i=r(6113),a=r(7147),c=r(2037),l=n(r(1017));class u{constructor(){this.disposed=!1,this.path=l.join((0,c.tmpdir)(),`node-debug-callback-${(0,i.randomBytes)(8).toString("hex")}`),this.file=a.promises.open(this.path,"w")}static isValid(e){try{const t=(0,a.readFileSync)(e);return!!t.length&&t.readDoubleBE()>Date.now()-u.recencyDeadline}catch(e){return!1}}async startTouchLoop(){await this.touch(),this.disposed||(this.updateInterval=setInterval((()=>this.touch()),u.updateInterval))}async touch(e=(()=>Date.now())){const t=await this.file,r=Buffer.alloc(8);r.writeDoubleBE(e()),await t.write(r,0,r.length,0)}async dispose(){if(!this.disposed){this.disposed=!0,this.updateInterval&&clearInterval(this.updateInterval);try{const e=await this.file;await e.close(),await a.promises.unlink(this.path)}catch(e){}}}}t.LeaseFile=u,u.updateInterval=1e3,u.recencyDeadline=2e3},3121:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=3121,e.exports=t},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1405:e=>{"use strict";e.exports=require("inspector")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},2781:e=>{"use strict";e.exports=require("stream")},4404:e=>{"use strict";e.exports=require("tls")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},1267:e=>{"use strict";e.exports=require("worker_threads")},9796:e=>{"use strict";e.exports=require("zlib")}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__=__webpack_require__(7207)})();
//# sourceURL=bootloader.bundle.cdp