cloudstudio
Version:
Run VS Code on a remote server.
1 lines • 279 kB
JavaScript
(()=>{"use strict";var e={9444:(e,t,n)=>{e.exports=n(6087)},1006:(e,t,n)=>{const o=n(5622),r="\\.{1,2}(?:\\/|$)",i={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:r,NO_DOT:"(?!\\.)",NO_DOTS:`(?!(?:^|\\/)${r})`,NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:`(?!${r})`,QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},s={...i,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:o.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?s:i}},3376:(e,t,n)=>{const o=n(1006),r=n(8702),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:s,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:c,REPLACEMENTS:u}=o,l=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch(t){return e.map((e=>r.escapeRegex(e))).join("..")}return n},d=(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=u[e]||e;const n={...t},f="number"==typeof n.maxLength?Math.min(i,n.maxLength):i;let g=e.length;if(g>f)throw new SyntaxError(`Input length: ${g}, exceeds maximum allowed length: ${f}`);const p={type:"bos",value:"",output:n.prepend||""},m=[p],y=n.capture?"":"?:",v=r.isWindows(t),R=o.globChars(v),k=o.extglobChars(R),{DOT_LITERAL:b,PLUS_LITERAL:D,SLASH_LITERAL:_,ONE_CHAR:w,DOTS_SLASH:C,NO_DOT:T,NO_DOT_SLASH:P,NO_DOTS_SLASH:S,QMARK:x,QMARK_NO_DOT:M,STAR:E,START_ANCHOR:L}=R,q=e=>`(${y}(?:(?!${L}${e.dot?C:b}).)*?)`,O=n.dot?"":T,N=n.dot?x:M;let A=!0===n.bash?q(n):E;n.capture&&(A=`(${A})`),"boolean"==typeof n.noext&&(n.noextglob=n.noext);const F={input:e,index:-1,start:0,dot:!0===n.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:m};e=r.removePrefix(e,F),g=e.length;const I=[],j=[],W=[];let H,U=p;const $=()=>F.index===g-1,K=F.peek=(t=1)=>e[F.index+t],z=F.advance=()=>e[++F.index]||"",B=()=>e.slice(F.index+1),V=(e="",t=0)=>{F.consumed+=e,F.index+=t},G=e=>{F.output+=null!=e.output?e.output:e.value,V(e.value)},X=()=>{let e=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)z(),F.start++,e++;return e%2!=0&&(F.negated=!0,F.start++,!0)},J=e=>{F[e]++,W.push(e)},Q=e=>{F[e]--,W.pop()},Y=e=>{if("globstar"===U.type){const t=F.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||I.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(F.output=F.output.slice(0,-U.output.length),U.type="star",U.value="*",U.output=A,F.output+=U.output)}if(I.length&&"paren"!==e.type&&(I[I.length-1].inner+=e.value),(e.value||e.output)&&G(e),U&&"text"===U.type&&"text"===e.type)return U.value+=e.value,void(U.output=(U.output||"")+e.value);e.prev=U,m.push(e),U=e},Z=(e,t)=>{const o={...k[t],conditions:1,inner:""};o.prev=U,o.parens=F.parens,o.output=F.output;const r=(n.capture?"(":"")+o.open;J("parens"),Y({type:e,value:t,output:F.output?"":w}),Y({type:"paren",extglob:!0,value:z(),output:r}),I.push(o)},ee=e=>{let o,r=e.close+(n.capture?")":"");if("negate"===e.type){let i=A;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(i=q(n)),(i!==A||$()||/^\)+$/.test(B()))&&(r=e.close=`)$))${i}`),e.inner.includes("*")&&(o=B())&&/^\.[^\\/.]+$/.test(o)){const n=h(o,{...t,fastpaths:!1}).output;r=e.close=`)${n})${i})`}"bos"===e.prev.type&&(F.negatedExtglob=!0)}Y({type:"paren",extglob:!0,value:H,output:r}),Q("parens")};if(!1!==n.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let o=!1,i=e.replace(c,((e,t,n,r,i,s)=>"\\"===r?(o=!0,e):"?"===r?t?t+r+(i?x.repeat(i.length):""):0===s?N+(i?x.repeat(i.length):""):x.repeat(n.length):"."===r?b.repeat(n.length):"*"===r?t?t+r+(i?A:""):A:t?e:`\\${e}`));return!0===o&&(i=!0===n.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),i===e&&!0===n.contains?(F.output=e,F):(F.output=r.wrapOutput(i,F,t),F)}for(;!$();){if(H=z(),"\0"===H)continue;if("\\"===H){const e=K();if("/"===e&&!0!==n.bash)continue;if("."===e||";"===e)continue;if(!e){H+="\\",Y({type:"text",value:H});continue}const t=/^\\+/.exec(B());let o=0;if(t&&t[0].length>2&&(o=t[0].length,F.index+=o,o%2!=0&&(H+="\\")),!0===n.unescape?H=z():H+=z(),0===F.brackets){Y({type:"text",value:H});continue}}if(F.brackets>0&&("]"!==H||"["===U.value||"[^"===U.value)){if(!1!==n.posix&&":"===H){const e=U.value.slice(1);if(e.includes("[")&&(U.posix=!0,e.includes(":"))){const e=U.value.lastIndexOf("["),t=U.value.slice(0,e),n=U.value.slice(e+2),o=s[n];if(o){U.value=t+o,F.backtrack=!0,z(),p.output||1!==m.indexOf(U)||(p.output=w);continue}}}("["===H&&":"!==K()||"-"===H&&"]"===K())&&(H=`\\${H}`),"]"!==H||"["!==U.value&&"[^"!==U.value||(H=`\\${H}`),!0===n.posix&&"!"===H&&"["===U.value&&(H="^"),U.value+=H,G({value:H});continue}if(1===F.quotes&&'"'!==H){H=r.escapeRegex(H),U.value+=H,G({value:H});continue}if('"'===H){F.quotes=1===F.quotes?0:1,!0===n.keepQuotes&&Y({type:"text",value:H});continue}if("("===H){J("parens"),Y({type:"paren",value:H});continue}if(")"===H){if(0===F.parens&&!0===n.strictBrackets)throw new SyntaxError(d("opening","("));const e=I[I.length-1];if(e&&F.parens===e.parens+1){ee(I.pop());continue}Y({type:"paren",value:H,output:F.parens?")":"\\)"}),Q("parens");continue}if("["===H){if(!0!==n.nobracket&&B().includes("]"))J("brackets");else{if(!0!==n.nobracket&&!0===n.strictBrackets)throw new SyntaxError(d("closing","]"));H=`\\${H}`}Y({type:"bracket",value:H});continue}if("]"===H){if(!0===n.nobracket||U&&"bracket"===U.type&&1===U.value.length){Y({type:"text",value:H,output:`\\${H}`});continue}if(0===F.brackets){if(!0===n.strictBrackets)throw new SyntaxError(d("opening","["));Y({type:"text",value:H,output:`\\${H}`});continue}Q("brackets");const e=U.value.slice(1);if(!0===U.posix||"^"!==e[0]||e.includes("/")||(H=`/${H}`),U.value+=H,G({value:H}),!1===n.literalBrackets||r.hasRegexChars(e))continue;const t=r.escapeRegex(U.value);if(F.output=F.output.slice(0,-U.value.length),!0===n.literalBrackets){F.output+=t,U.value=t;continue}U.value=`(${y}${t}|${U.value})`,F.output+=U.value;continue}if("{"===H&&!0!==n.nobrace){J("braces");const e={type:"brace",value:H,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};j.push(e),Y(e);continue}if("}"===H){const e=j[j.length-1];if(!0===n.nobrace||!e){Y({type:"text",value:H,output:H});continue}let t=")";if(!0===e.dots){const e=m.slice(),o=[];for(let t=e.length-1;t>=0&&(m.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&o.unshift(e[t].value);t=l(o,n),F.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=F.output.slice(0,e.outputIndex),o=F.tokens.slice(e.tokensIndex);e.value=e.output="\\{",H=t="\\}",F.output=n;for(const e of o)F.output+=e.output||e.value}Y({type:"brace",value:H,output:t}),Q("braces"),j.pop();continue}if("|"===H){I.length>0&&I[I.length-1].conditions++,Y({type:"text",value:H});continue}if(","===H){let e=H;const t=j[j.length-1];t&&"braces"===W[W.length-1]&&(t.comma=!0,e="|"),Y({type:"comma",value:H,output:e});continue}if("/"===H){if("dot"===U.type&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",m.pop(),U=p;continue}Y({type:"slash",value:H,output:_});continue}if("."===H){if(F.braces>0&&"dot"===U.type){"."===U.value&&(U.output=b);const e=j[j.length-1];U.type="dots",U.output+=H,U.value+=H,e.dots=!0;continue}if(F.braces+F.parens===0&&"bos"!==U.type&&"slash"!==U.type){Y({type:"text",value:H,output:b});continue}Y({type:"dot",value:H,output:b});continue}if("?"===H){if((!U||"("!==U.value)&&!0!==n.noextglob&&"("===K()&&"?"!==K(2)){Z("qmark",H);continue}if(U&&"paren"===U.type){const e=K();let t=H;if("<"===e&&!r.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===U.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(B()))&&(t=`\\${H}`),Y({type:"text",value:H,output:t});continue}if(!0!==n.dot&&("slash"===U.type||"bos"===U.type)){Y({type:"qmark",value:H,output:M});continue}Y({type:"qmark",value:H,output:x});continue}if("!"===H){if(!0!==n.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){Z("negate",H);continue}if(!0!==n.nonegate&&0===F.index){X();continue}}if("+"===H){if(!0!==n.noextglob&&"("===K()&&"?"!==K(2)){Z("plus",H);continue}if(U&&"("===U.value||!1===n.regex){Y({type:"plus",value:H,output:D});continue}if(U&&("bracket"===U.type||"paren"===U.type||"brace"===U.type)||F.parens>0){Y({type:"plus",value:H});continue}Y({type:"plus",value:D});continue}if("@"===H){if(!0!==n.noextglob&&"("===K()&&"?"!==K(2)){Y({type:"at",extglob:!0,value:H,output:""});continue}Y({type:"text",value:H});continue}if("*"!==H){"$"!==H&&"^"!==H||(H=`\\${H}`);const e=a.exec(B());e&&(H+=e[0],F.index+=e[0].length),Y({type:"text",value:H});continue}if(U&&("globstar"===U.type||!0===U.star)){U.type="star",U.star=!0,U.value+=H,U.output=A,F.backtrack=!0,F.globstar=!0,V(H);continue}let t=B();if(!0!==n.noextglob&&/^\([^?]/.test(t)){Z("star",H);continue}if("star"===U.type){if(!0===n.noglobstar){V(H);continue}const o=U.prev,r=o.prev,i="slash"===o.type||"bos"===o.type,s=r&&("star"===r.type||"globstar"===r.type);if(!0===n.bash&&(!i||t[0]&&"/"!==t[0])){Y({type:"star",value:H,output:""});continue}const a=F.braces>0&&("comma"===o.type||"brace"===o.type),c=I.length&&("pipe"===o.type||"paren"===o.type);if(!i&&"paren"!==o.type&&!a&&!c){Y({type:"star",value:H,output:""});continue}for(;"/**"===t.slice(0,3);){const n=e[F.index+4];if(n&&"/"!==n)break;t=t.slice(3),V("/**",3)}if("bos"===o.type&&$()){U.type="globstar",U.value+=H,U.output=q(n),F.output=U.output,F.globstar=!0,V(H);continue}if("slash"===o.type&&"bos"!==o.prev.type&&!s&&$()){F.output=F.output.slice(0,-(o.output+U.output).length),o.output=`(?:${o.output}`,U.type="globstar",U.output=q(n)+(n.strictSlashes?")":"|$)"),U.value+=H,F.globstar=!0,F.output+=o.output+U.output,V(H);continue}if("slash"===o.type&&"bos"!==o.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";F.output=F.output.slice(0,-(o.output+U.output).length),o.output=`(?:${o.output}`,U.type="globstar",U.output=`${q(n)}${_}|${_}${e})`,U.value+=H,F.output+=o.output+U.output,F.globstar=!0,V(H+z()),Y({type:"slash",value:"/",output:""});continue}if("bos"===o.type&&"/"===t[0]){U.type="globstar",U.value+=H,U.output=`(?:^|${_}|${q(n)}${_})`,F.output=U.output,F.globstar=!0,V(H+z()),Y({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-U.output.length),U.type="globstar",U.output=q(n),U.value+=H,F.output+=U.output,F.globstar=!0,V(H);continue}const o={type:"star",value:H,output:A};!0!==n.bash?!U||"bracket"!==U.type&&"paren"!==U.type||!0!==n.regex?(F.index!==F.start&&"slash"!==U.type&&"dot"!==U.type||("dot"===U.type?(F.output+=P,U.output+=P):!0===n.dot?(F.output+=S,U.output+=S):(F.output+=O,U.output+=O),"*"!==K()&&(F.output+=w,U.output+=w)),Y(o)):(o.output=H,Y(o)):(o.output=".*?","bos"!==U.type&&"slash"!==U.type||(o.output=O+o.output),Y(o))}for(;F.brackets>0;){if(!0===n.strictBrackets)throw new SyntaxError(d("closing","]"));F.output=r.escapeLast(F.output,"["),Q("brackets")}for(;F.parens>0;){if(!0===n.strictBrackets)throw new SyntaxError(d("closing",")"));F.output=r.escapeLast(F.output,"("),Q("parens")}for(;F.braces>0;){if(!0===n.strictBrackets)throw new SyntaxError(d("closing","}"));F.output=r.escapeLast(F.output,"{"),Q("braces")}if(!0===n.strictSlashes||"star"!==U.type&&"bracket"!==U.type||Y({type:"maybe_slash",value:"",output:`${_}?`}),!0===F.backtrack){F.output="";for(const e of F.tokens)F.output+=null!=e.output?e.output:e.value,e.suffix&&(F.output+=e.suffix)}return F};h.fastpaths=(e,t)=>{const n={...t},s="number"==typeof n.maxLength?Math.min(i,n.maxLength):i,a=e.length;if(a>s)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${s}`);e=u[e]||e;const c=r.isWindows(t),{DOT_LITERAL:l,SLASH_LITERAL:d,ONE_CHAR:h,DOTS_SLASH:f,NO_DOT:g,NO_DOTS:p,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:v}=o.globChars(c),R=n.dot?p:g,k=n.dot?m:g,b=n.capture?"":"?:";let D=!0===n.bash?".*?":y;n.capture&&(D=`(${D})`);const _=e=>!0===e.noglobstar?D:`(${b}(?:(?!${v}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case"*":return`${R}${h}${D}`;case".*":return`${l}${h}${D}`;case"*.*":return`${R}${D}${l}${h}${D}`;case"*/*":return`${R}${D}${d}${h}${k}${D}`;case"**":return R+_(n);case"**/*":return`(?:${R}${_(n)}${d})?${k}${h}${D}`;case"**/*.*":return`(?:${R}${_(n)}${d})?${k}${D}${l}${h}${D}`;case"**/.*":return`(?:${R}${_(n)}${d})?${l}${h}${D}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=w(t[1]);if(!n)return;return n+l+t[2]}}},C=r.removePrefix(e,{negated:!1,prefix:""});let T=w(C);return T&&!0!==n.strictSlashes&&(T+=`${d}?`),T},e.exports=h},6087:(e,t,n)=>{const o=n(5622),r=n(3921),i=n(3376),s=n(8702),a=n(1006),c=(e,t,n=!1)=>{if(Array.isArray(e)){const o=e.map((e=>c(e,t,n)));return e=>{for(const t of o){const n=t(e);if(n)return n}return!1}}const o=(r=e)&&"object"==typeof r&&!Array.isArray(r)&&e.tokens&&e.input;var r;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},a=s.isWindows(t),u=o?c.compileRe(e,t):c.makeRe(e,t,!1,!0),l=u.state;delete u.state;let d=()=>!1;if(i.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};d=c(i.ignore,e,n)}const h=(n,o=!1)=>{const{isMatch:r,match:s,output:h}=c.test(n,u,t,{glob:e,posix:a}),f={glob:e,state:l,regex:u,posix:a,input:n,output:h,match:s,isMatch:r};return"function"==typeof i.onResult&&i.onResult(f),!1===r?(f.isMatch=!1,!!o&&f):d(n)?("function"==typeof i.onIgnore&&i.onIgnore(f),f.isMatch=!1,!!o&&f):("function"==typeof i.onMatch&&i.onMatch(f),!o||f)};return n&&(h.state=l),h};c.test=(e,t,n,{glob:o,posix:r}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const i=n||{},a=i.format||(r?s.toPosixSlashes:null);let u=e===o,l=u&&a?a(e):e;return!1===u&&(l=a?a(e):e,u=l===o),!1!==u&&!0!==i.capture||(u=!0===i.matchBase||!0===i.basename?c.matchBase(e,t,n,r):t.exec(l)),{isMatch:Boolean(u),match:u,output:l}},c.matchBase=(e,t,n,r=s.isWindows(n))=>(t instanceof RegExp?t:c.makeRe(t,n)).test(o.basename(e)),c.isMatch=(e,t,n)=>c(t,n)(e),c.parse=(e,t)=>Array.isArray(e)?e.map((e=>c.parse(e,t))):i(e,{...t,fastpaths:!1}),c.scan=(e,t)=>r(e,t),c.compileRe=(e,t,n=!1,o=!1)=>{if(!0===n)return e.output;const r=t||{},i=r.contains?"":"^",s=r.contains?"":"$";let a=`${i}(?:${e.output})${s}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const u=c.toRegex(a,t);return!0===o&&(u.state=e),u},c.makeRe=(e,t={},n=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let r={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(r.output=i.fastpaths(e,t)),r.output||(r=i(e,t)),c.compileRe(r,t,n,o)},c.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},c.constants=a,e.exports=c},3921:(e,t,n)=>{const o=n(8702),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:s,CHAR_COMMA:a,CHAR_DOT:c,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:d,CHAR_LEFT_PARENTHESES:h,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:g,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:m,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:v}=n(1006),R=e=>e===l||e===s,k=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};e.exports=(e,t)=>{const n=t||{},b=e.length-1,D=!0===n.parts||!0===n.scanToEnd,_=[],w=[],C=[];let T,P,S=e,x=-1,M=0,E=0,L=!1,q=!1,O=!1,N=!1,A=!1,F=!1,I=!1,j=!1,W=!1,H=!1,U=0,$={value:"",depth:0,isGlob:!1};const K=()=>x>=b,z=()=>(T=P,S.charCodeAt(++x));for(;x<b;){let e;if(P=z(),P!==s){if(!0===F||P===d){for(U++;!0!==K()&&(P=z());)if(P!==s)if(P!==d){if(!0!==F&&P===c&&(P=z())===c){if(L=$.isBrace=!0,O=$.isGlob=!0,H=!0,!0===D)continue;break}if(!0!==F&&P===a){if(L=$.isBrace=!0,O=$.isGlob=!0,H=!0,!0===D)continue;break}if(P===m&&(U--,0===U)){F=!1,L=$.isBrace=!0,H=!0;break}}else U++;else I=$.backslashes=!0,z();if(!0===D)continue;break}if(P!==l){if(!0!==n.noext&&!0==(P===g||P===i||P===r||P===p||P===u)&&S.charCodeAt(x+1)===h){if(O=$.isGlob=!0,N=$.isExtglob=!0,H=!0,P===u&&x===M&&(W=!0),!0===D){for(;!0!==K()&&(P=z());)if(P!==s){if(P===y){O=$.isGlob=!0,H=!0;break}}else I=$.backslashes=!0,P=z();continue}break}if(P===r){if(T===r&&(A=$.isGlobstar=!0),O=$.isGlob=!0,H=!0,!0===D)continue;break}if(P===p){if(O=$.isGlob=!0,H=!0,!0===D)continue;break}if(P===f){for(;!0!==K()&&(e=z());)if(e!==s){if(e===v){q=$.isBracket=!0,O=$.isGlob=!0,H=!0;break}}else I=$.backslashes=!0,z();if(!0===D)continue;break}if(!0===n.nonegate||P!==u||x!==M){if(!0!==n.noparen&&P===h){if(O=$.isGlob=!0,!0===D){for(;!0!==K()&&(P=z());)if(P!==h){if(P===y){H=!0;break}}else I=$.backslashes=!0,P=z();continue}break}if(!0===O){if(H=!0,!0===D)continue;break}}else j=$.negated=!0,M++}else{if(_.push(x),w.push($),$={value:"",depth:0,isGlob:!1},!0===H)continue;if(T===c&&x===M+1){M+=2;continue}E=x+1}}else I=$.backslashes=!0,P=z(),P===d&&(F=!0)}!0===n.noext&&(N=!1,O=!1);let B=S,V="",G="";M>0&&(V=S.slice(0,M),S=S.slice(M),E-=M),B&&!0===O&&E>0?(B=S.slice(0,E),G=S.slice(E)):!0===O?(B="",G=S):B=S,B&&""!==B&&"/"!==B&&B!==S&&R(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),!0===n.unescape&&(G&&(G=o.removeBackslashes(G)),B&&!0===I&&(B=o.removeBackslashes(B)));const X={prefix:V,input:e,start:M,base:B,glob:G,isBrace:L,isBracket:q,isGlob:O,isExtglob:N,isGlobstar:A,negated:j,negatedExtglob:W};if(!0===n.tokens&&(X.maxDepth=0,R(P)||w.push($),X.tokens=w),!0===n.parts||!0===n.tokens){let t;for(let o=0;o<_.length;o++){const r=t?t+1:M,i=_[o],s=e.slice(r,i);n.tokens&&(0===o&&0!==M?(w[o].isPrefix=!0,w[o].value=V):w[o].value=s,k(w[o]),X.maxDepth+=w[o].depth),0===o&&""===s||C.push(s),t=i}if(t&&t+1<e.length){const o=e.slice(t+1);C.push(o),n.tokens&&(w[w.length-1].value=o,k(w[w.length-1]),X.maxDepth+=w[w.length-1].depth)}X.slashes=_,X.parts=C}return X}},8702:(e,t,n)=>{const o=n(5622),r="win32"===process.platform,{REGEX_BACKSLASH:i,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:c}=n(1006);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(i,"/"),t.removeBackslashes=e=>e.replace(s,(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===r||"\\"===o.sep,t.escapeLast=(e,n,o)=>{const r=e.lastIndexOf(n,o);return-1===r?e:"\\"===e[r-1]?t.escapeLast(e,n,r-1):`${e.slice(0,r)}\\${e.slice(r)}`},t.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},t.wrapOutput=(e,t={},n={})=>{let o=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(o=`(?:^(?!${o}).*$)`),o}},3870:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFormat=t.TraceValues=t.Trace=t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=void 0;const o=n(839);Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return o.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return o.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return o.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return o.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return o.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return o.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return o.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return o.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return o.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return o.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return o.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return o.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return o.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return o.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return o.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return o.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return o.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return o.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return o.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return o.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return o.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return o.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return o.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return o.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return o.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return o.ParameterStructures}});const r=n(6184);Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return r.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return r.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return r.Touch}});const i=n(3911);Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const s=n(7135);Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});const a=n(3881);Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});const c=n(6525);Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return c.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return c.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return c.ReadableStreamMessageReader}});const u=n(6654);Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return u.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return u.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return u.WriteableStreamMessageWriter}});const l=n(1343);Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return l.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return l.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return l.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return l.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return l.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return l.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return l.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return l.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return l.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return l.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return l.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return l.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return l.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return l.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return l.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return l.CancellationStrategy}});const d=n(147);t.RAL=d.default},3881:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;const o=n(147),r=n(7574),i=n(7135);var s;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:i.Event.None}),e.is=function(t){const n=t;return n&&(n===e.None||n===e.Cancelled||r.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}}(s=t.CancellationToken||(t.CancellationToken={}));const a=Object.freeze((function(e,t){const n=(0,o.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}));class c{constructor(){this._isCancelled=!1}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 i.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}t.CancellationTokenSource=class{get token(){return this._token||(this._token=new c),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof c&&this._token.dispose():this._token=s.None}}},1343:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const o=n(147),r=n(7574),i=n(839),s=n(6184),a=n(7135),c=n(3881);var u,l,d,h,f,g,p,m,y,v,R,k,b,D,_;!function(e){e.type=new i.NotificationType("$/cancelRequest")}(u||(u={})),function(e){e.is=function(e){return"string"==typeof e||"number"==typeof e}}(l=t.ProgressToken||(t.ProgressToken={})),function(e){e.type=new i.NotificationType("$/progress")}(d||(d={})),t.ProgressType=class{constructor(){}},function(e){e.is=function(e){return r.func(e)}}(h||(h={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"}(f=t.Trace||(t.Trace={})),(_=t.TraceValues||(t.TraceValues={})).Off="off",_.Messages="messages",_.Compact="compact",_.Verbose="verbose",function(e){e.fromString=function(t){if(!r.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose;default:return e.Off}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}}(f=t.Trace||(t.Trace={})),function(e){e.Text="text",e.JSON="json"}(t.TraceFormat||(t.TraceFormat={})),function(e){e.fromString=function(t){return r.string(t)&&"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(g=t.TraceFormat||(t.TraceFormat={})),function(e){e.type=new i.NotificationType("$/setTrace")}(p=t.SetTraceNotification||(t.SetTraceNotification={})),function(e){e.type=new i.NotificationType("$/logTrace")}(m=t.LogTraceNotification||(t.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(y=t.ConnectionErrors||(t.ConnectionErrors={}));class w extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,w.prototype)}}t.ConnectionError=w,function(e){e.is=function(e){const t=e;return t&&r.func(t.cancelUndispatched)}}(v=t.ConnectionStrategy||(t.ConnectionStrategy={})),function(e){e.Message=Object.freeze({createCancellationTokenSource:e=>new c.CancellationTokenSource}),e.is=function(e){const t=e;return t&&r.func(t.createCancellationTokenSource)}}(R=t.CancellationReceiverStrategy||(t.CancellationReceiverStrategy={})),function(e){e.Message=Object.freeze({sendCancellation:(e,t)=>e.sendNotification(u.type,{id:t}),cleanup(e){}}),e.is=function(e){const t=e;return t&&r.func(t.sendCancellation)&&r.func(t.cleanup)}}(k=t.CancellationSenderStrategy||(t.CancellationSenderStrategy={})),function(e){e.Message=Object.freeze({receiver:R.Message,sender:k.Message}),e.is=function(e){const t=e;return t&&R.is(t.receiver)&&k.is(t.sender)}}(b=t.CancellationStrategy||(t.CancellationStrategy={})),(t.ConnectionOptions||(t.ConnectionOptions={})).is=function(e){const t=e;return t&&(b.is(t.cancellationStrategy)||v.is(t.connectionStrategy))},function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"}(D||(D={})),t.createMessageConnection=function(e,n,v,R){const k=void 0!==v?v:t.NullLogger;let _=0,C=0,T=0;const P="2.0";let S;const x=new Map;let M;const E=new Map,L=new Map;let q,O,N=new s.LinkedMap,A=new Map,F=new Set,I=new Map,j=f.Off,W=g.Text,H=D.New;const U=new a.Emitter,$=new a.Emitter,K=new a.Emitter,z=new a.Emitter,B=new a.Emitter,V=R&&R.cancellationStrategy?R.cancellationStrategy:b.Message;function G(e){if(null===e)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+e.toString()}function X(e){}function J(){return H===D.Listening}function Q(){return H===D.Closed}function Y(){return H===D.Disposed}function Z(){H!==D.New&&H!==D.Listening||(H=D.Closed,$.fire(void 0))}function ee(){q||0===N.size||(q=(0,o.default)().timer.setImmediate((()=>{q=void 0,function(){if(0===N.size)return;const e=N.shift();try{i.Message.isRequest(e)?function(e){if(Y())return;function t(t,o,r){const s={jsonrpc:P,id:e.id};t instanceof i.ResponseError?s.error=t.toJson():s.result=void 0===t?null:t,oe(s,o,r),n.write(s).catch((()=>k.error("Sending response failed.")))}function o(t,o,r){const i={jsonrpc:P,id:e.id,error:t.toJson()};oe(i,o,r),n.write(i).catch((()=>k.error("Sending response failed.")))}!function(e){if(j!==f.Off&&O)if(W===g.Text){let t;j!==f.Verbose&&j!==f.Compact||!e.params||(t=`Params: ${ne(e.params)}\n\n`),O.log(`Received request '${e.method} - (${e.id})'.`,t)}else ie("receive-request",e)}(e);const s=x.get(e.method);let a,c;s&&(a=s.type,c=s.handler);const u=Date.now();if(c||S){const s=e.id??String(Date.now()),l=V.receiver.createCancellationTokenSource(s);null!==e.id&&F.has(e.id)&&l.cancel(),null!==e.id&&I.set(s,l);try{let d;if(c)if(void 0===e.params){if(void 0!==a&&0!==a.numberOfParams)return void o(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${e.method} defines ${a.numberOfParams} params but received none.`),e.method,u);d=c(l.token)}else if(Array.isArray(e.params)){if(void 0!==a&&a.parameterStructures===i.ParameterStructures.byName)return void o(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,u);d=c(...e.params,l.token)}else{if(void 0!==a&&a.parameterStructures===i.ParameterStructures.byPosition)return void o(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,u);d=c(e.params,l.token)}else S&&(d=S(e.method,e.params,l.token));const h=d;d?h.then?h.then((n=>{I.delete(s),t(n,e.method,u)}),(t=>{I.delete(s),t instanceof i.ResponseError?o(t,e.method,u):t&&r.string(t.message)?o(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):o(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)})):(I.delete(s),t(d,e.method,u)):(I.delete(s),function(t,o,r){void 0===t&&(t=null);const i={jsonrpc:P,id:e.id,result:t};oe(i,o,r),n.write(i).catch((()=>k.error("Sending response failed.")))}(d,e.method,u))}catch(n){I.delete(s),n instanceof i.ResponseError?t(n,e.method,u):n&&r.string(n.message)?o(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${n.message}`),e.method,u):o(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else o(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}(e):i.Message.isNotification(e)?function(e){if(Y())return;let t,n;if(e.method===u.type.method){const t=e.params.id;return F.delete(t),void re(e)}{const o=E.get(e.method);o&&(n=o.handler,t=o.type)}if(n||M)try{if(re(e),n)if(void 0===e.params)void 0!==t&&0!==t.numberOfParams&&t.parameterStructures!==i.ParameterStructures.byName&&k.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){const o=e.params;e.method===d.type.method&&2===o.length&&l.is(o[0])?n({token:o[0],value:o[1]}):(void 0!==t&&(t.parameterStructures===i.ParameterStructures.byName&&k.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&k.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${o.length} arguments`)),n(...o))}else void 0!==t&&t.parameterStructures===i.ParameterStructures.byPosition&&k.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params);else M&&M(e.method,e.params)}catch(t){t.message?k.error(`Notification handler '${e.method}' failed with message: ${t.message}`):k.error(`Notification handler '${e.method}' failed unexpectedly.`)}else K.fire(e)}(e):i.Message.isResponse(e)?function(e){if(!Y())if(null===e.id)e.error?k.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):k.error("Received response message without id. No further error information provided.");else{const t=e.id,n=A.get(t);if(function(e,t){if(j!==f.Off&&O)if(W===g.Text){let n;if(j!==f.Verbose&&j!==f.Compact||(e.error&&e.error.data?n=`Error data: ${ne(e.error.data)}\n\n`:e.result?n=`Result: ${ne(e.result)}\n\n`:void 0===e.error&&(n="No result returned.\n\n")),t){const o=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:"";O.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${o}`,n)}else O.log(`Received response ${e.id} without active response promise.`,n)}else ie("receive-response",e)}(e,n),void 0!==n){A.delete(t);try{if(e.error){const t=e.error;n.reject(new i.ResponseError(t.code,t.message,t.data))}else{if(void 0===e.result)throw new Error("Should never happen.");n.resolve(e.result)}}catch(e){e.message?k.error(`Response handler '${n.method}' failed with message: ${e.message}`):k.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void k.error("Received empty message.");k.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);const t=e;if(r.string(t.id)||r.number(t.id)){const e=t.id,n=A.get(e);n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}finally{ee()}}()})))}e.onClose(Z),e.onError((function(e){U.fire([e,void 0,void 0])})),n.onClose(Z),n.onError((function(e){U.fire(e)}));const te=e=>{try{if(i.Message.isNotification(e)&&e.method===u.type.method){const t=e.params.id,o=G(t),r=N.get(o);if(i.Message.isRequest(r)){const i=R?.connectionStrategy,s=i&&i.cancelUndispatched?i.cancelUndispatched(r,X):void 0;if(s&&(void 0!==s.error||void 0!==s.result))return N.delete(o),I.delete(t),s.id=r.id,oe(s,e.method,Date.now()),void n.write(s).catch((()=>k.error("Sending response for canceled message failed.")))}const s=I.get(t);if(void 0!==s)return s.cancel(),void re(e);F.add(t)}!function(e,t){var n;i.Message.isRequest(t)?e.set(G(t.id),t):i.Message.isResponse(t)?e.set(null===(n=t.id)?"res-unknown-"+(++T).toString():"res-"+n.toString(),t):e.set("not-"+(++C).toString(),t)}(N,e)}finally{ee()}};function ne(e){if(null!=e)switch(j){case f.Verbose:return JSON.stringify(e,null,4);case f.Compact:return JSON.stringify(e);default:return}}function oe(e,t,n){if(j!==f.Off&&O)if(W===g.Text){let o;j!==f.Verbose&&j!==f.Compact||(e.error&&e.error.data?o=`Error data: ${ne(e.error.data)}\n\n`:e.result?o=`Result: ${ne(e.result)}\n\n`:void 0===e.error&&(o="No result returned.\n\n")),O.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,o)}else ie("send-response",e)}function re(e){if(j!==f.Off&&O&&e.method!==m.type.method)if(W===g.Text){let t;j!==f.Verbose&&j!==f.Compact||(t=e.params?`Params: ${ne(e.params)}\n\n`:"No parameters provided.\n\n"),O.log(`Received notification '${e.method}'.`,t)}else ie("receive-notification",e)}function ie(e,t){if(!O||j===f.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};O.log(n)}function se(){if(Q())throw new w(y.Closed,"Connection is closed.");if(Y())throw new w(y.Disposed,"Connection is disposed.")}function ae(e){return void 0===e?null:e}function ce(e){return null===e?void 0:e}function ue(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function le(e,t){switch(e){case i.ParameterStructures.auto:return ue(t)?ce(t):[ae(t)];case i.ParameterStructures.byName:if(!ue(t))throw new Error("Received parameters by name but param is not an object literal.");return ce(t);case i.ParameterStructures.byPosition:return[ae(t)];default:throw new Error(`Unknown parameter structure ${e.toString()}`)}}function de(e,t){let n;const o=e.numberOfParams;switch(o){case 0:n=void 0;break;case 1:n=le(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<o;e++)n.push(ae(t[e]));if(t.length<o)for(let e=t.length;e<o;e++)n.push(null)}return n}const he={sendNotification:(e,...t)=>{let o,s;if(se(),r.string(e)){o=e;const n=t[0];let r=0,a=i.ParameterStructures.auto;i.ParameterStructures.is(n)&&(r=1,a=n);let c=t.length;const u=c-r;switch(u){case 0:s=void 0;break;case 1:s=le(a,t[r]);break;default:if(a===i.ParameterStructures.byName)throw new Error(`Received ${u} parameters for 'by Name' notification parameter structure.`);s=t.slice(r,c).map((e=>ae(e)))}}else{const n=t;o=e.method,s=de(e,n)}const a={jsonrpc:P,method:o,params:s};return function(e){if(j!==f.Off&&O)if(W===g.Text){let t;j!==f.Verbose&&j!==f.Compact||(t=e.params?`Params: ${ne(e.params)}\n\n`:"No parameters provided.\n\n"),O.log(`Sending notification '${e.method}'.`,t)}else ie("send-notification",e)}(a),n.write(a).catch((()=>k.error("Sending notification failed.")))},onNotification:(e,t)=>{let n;return se(),r.func(e)?M=e:t&&(r.string(e)?(n=e,E.set(e,{type:void 0,handler:t})):(n=e.method,E.set(e.method,{type:e,handler:t}))),{dispose:()=>{void 0!==n?E.delete(n):M=void 0}}},onProgress:(e,t,n)=>{if(L.has(t))throw new Error(`Progress handler for token ${t} already registered`);return L.set(t,n),{dispose:()=>{L.delete(t)}}},sendProgress:(e,t,n)=>he.sendNotification(d.type,{token:t,value:n}),onUnhandledProgress:z.event,sendRequest:(e,...t)=>{let o,s,a;if(se(),function(){if(!J())throw new Error("Call listen() first.")}(),r.string(e)){o=e;const n=t[0],r=t[t.length-1];let u=0,l=i.ParameterStructures.auto;i.ParameterStructures.is(n)&&(u=1,l=n);let d=t.length;c.CancellationToken.is(r)&&(d-=1,a=r);const h=d-u;switch(h){case 0:s=void 0;break;case 1:s=le(l,t[u]);break;default:if(l===i.ParameterStructures.byName)throw new Error(`Received ${h} parameters for 'by Name' request parameter structure.`);s=t.slice(u,d).map((e=>ae(e)))}}else{const n=t;o=e.method,s=de(e,n);const r=e.numberOfParams;a=c.CancellationToken.is(n[r])?n[r]:void 0}const u=_++;let l;return a&&(l=a.onCancellationRequested((()=>{const e=V.sender.sendCancellation(he,u);return void 0===e?(k.log(`Received no promise from cancellation strategy when cancelling id ${u}`),Promise.resolve()):e.catch((()=>{k.log(`Sending cancellation messages for id ${u} failed`)}))}))),new Promise(((e,t)=>{const r={jsonrpc:P,id:u,method:o,params:s};let a={method:o,timerStart:Date.now(),resolve:t=>{e(t),V.sender.cleanup(u),l?.dispose()},reject:e=>{t(e),V.sender.cleanup(u),l?.dispose()}};!function(e){if(j!==f.Off&&O)if(W===g.Text){let t;j!==f.Verbose&&j!==f.Compact||!e.params||(t=`Params: ${ne(e.params)}\n\n`),O.log(`Sending request '${e.method} - (${e.id})'.`,t)}else ie("send-request",e)}(r);try{n.write(r).catch((()=>k.error("Sending request failed.")))}catch(e){a.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),a=null}a&&A.set(u,a)}))},onRequest:(e,t)=>{se();let n=null;return h.is(e)?(n=void 0,S=e):r.string(e)?(n=null,void 0!==t&&(n=e,x.set(e,{handler:t,type:void 0}))):void 0!==t&&(n=e.method,x.set(e.method,{type:e,handler:t})),{dispose:()=>{null!==n&&(void 0!==n?x.delete(n):S=void 0)}}},hasPendingResponse:()=>A.size>0,trace:async(e,t,n)=>{let o=!1,i=g.Text;void 0!==n&&(r.boolean(n)?o=n:(o=n.sendNotification||!1,i=n.traceFormat||g.Text)),j=e,W=i,O=j===f.Off?void 0:t,!o||Q()||Y()||await he.sendNotification(p.type,{value:f.toString(e)})},onError:U.event,onClose:$.event,onUnhandledNotification:K.event,onDispose:B.event,end:()=>{n.end()},dispose:()=>{if(Y())return;H=D.Disposed,B.fire(void 0);const t=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const e of A.values())e.reject(t);A=new Map,I=new Map,F=new Set,N=new s.LinkedMap,r.func(n.dispose)&&n.dispose(),r.func(e.dispose)&&e.dispose()},listen:()=>{se(),function(){if(J())throw new w(y.AlreadyListening,"Connection is already listening")}(),H=D.Listening,e.listen(te)},inspect:()=>{(0,o.default)().console.log("inspect")}};return he.onNotification(m.type,(e=>{if(j===f.Off||!O)return;const t=j===f.Verbose||j===f.Compact;O.log(e.message,t?e.verbose:void 0)})),he.onNotification(d.type,(e=>{const t=L.get(e.token);t?t(e.value):z.fire(e)})),he}},3911:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0,(t.Disposable||(t.Disposable={})).create=function(e){return{dispose:e}}},7135:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;const o=n(147);!function(e){const t={dispose(){}};e.None=function(){return t}}(t.Event||(t.Event={}));class r{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let o=0,r=this._callbacks.length;o<r;o++)if(this._callbacks[o]===e){if(this._contexts[o]===t)return this._callbacks.splice(o,1),void this._contexts.splice(o,1);n=!0}if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const t=[],n=this._callbacks.slice(0),r=this._contexts.slice(0);for(let i=0,s=n.length;i<s;i++)try{t.push(n[i].apply(r[i],e))}catch(e){(0,o.default)().console.error(e)}return t}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}}class i{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,n)=>{this._callbacks||(this._callbacks=new r),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const o={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),o.dispose=i._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(o),o}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}t.Emitter=i,i._noop=function(){}},7574:(e,t)=>{function n(e){return"string"==typeof e||e instanceof String}function o(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=o,t.stringArray=function(e){return o(e)&&e.every((e=>n(e)))}},6184:(e,t)=>{var n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0,function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last}(o=t.Touch||(t.Touch={}));class r{constructor(){this[n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=o.None){const n=this._map.get(e);if(n)return t!==o.None&&this.touch(n,t),n.value}set(e,t,n=o.None){let r=this._map.get(e);if(r)r.value=t,n!==o.None&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){case o.None:this.addItemLast(r);break;case o.First:this.addItemFirst(r);break;case o.Last:default:this.addItemLast(r)}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const n=this._state;let o=this._head;for(;o;){if(t?e.bind(t)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:[t.key,t.value],done:!1};ret