UNPKG

code-server

Version:

Run VS Code on a remote server.

6 lines 51.9 kB
/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/(function(){var B=["require","exports","vs/base/common/platform","vs/base/common/path","vs/base/common/process","vs/base/common/uri","vs/base/common/network","vs/base/common/extpath","vs/base/common/strings","vs/base/common/types","vs/base/common/objects","vs/base/common/resources","vs/base/common/async","vs/base/common/errors","vs/base/common/event","vs/base/common/lifecycle","vs/base/common/cancellation","vs/platform/extensions/node/extensionHostStarterWorker","child_process","string_decoder","vs/base/common/stopwatch"],K=function(j){for(var e=[],y=0,I=j.length;y<I;y++)e[y]=B[j[y]];return e};define(B[4],K([0,1,2]),function(j,e,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arch=e.platform=e.env=e.cwd=void 0;let I;if(typeof y.globals.vscode!="undefined"&&typeof y.globals.vscode.process!="undefined"){const q=y.globals.vscode.process;I={get platform(){return q.platform},get arch(){return q.arch},get env(){return q.env},cwd(){return q.cwd()}}}else typeof process!="undefined"?I={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:I={get platform(){return y.isWindows?"win32":y.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};e.cwd=I.cwd,e.env=I.env,e.platform=I.platform,e.arch=I.arch}),define(B[3],K([0,1,4]),function(j,e,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.delimiter=e.sep=e.toNamespacedPath=e.parse=e.format=e.extname=e.basename=e.dirname=e.relative=e.resolve=e.join=e.isAbsolute=e.normalize=e.posix=e.win32=void 0;const I=65,q=97,L=90,U=122,S=46,T=47,O=92,E=58,$=63;class F extends Error{constructor(n,c,g){let f;typeof c=="string"&&c.indexOf("not ")===0?(f="must not be",c=c.replace(/^not /,"")):f="must be";const s=n.indexOf(".")!==-1?"property":"argument";let o=`The "${n}" ${s} ${f} of type ${c}`;o+=`. Received type ${typeof g}`;super(o);this.code="ERR_INVALID_ARG_TYPE"}}function k(i,n){if(typeof i!="string")throw new F(n,"string",i)}function a(i){return i===T||i===O}function u(i){return i===T}function d(i){return i>=I&&i<=L||i>=q&&i<=U}function m(i,n,c,g){let f="",s=0,o=-1,t=0,l=0;for(let w=0;w<=i.length;++w){if(w<i.length)l=i.charCodeAt(w);else{if(g(l))break;l=T}if(g(l)){if(!(o===w-1||t===1))if(t===2){if(f.length<2||s!==2||f.charCodeAt(f.length-1)!==S||f.charCodeAt(f.length-2)!==S){if(f.length>2){const v=f.lastIndexOf(c);v===-1?(f="",s=0):(f=f.slice(0,v),s=f.length-1-f.lastIndexOf(c)),o=w,t=0;continue}else if(f.length!==0){f="",s=0,o=w,t=0;continue}}n&&(f+=f.length>0?`${c}..`:"..",s=2)}else f.length>0?f+=`${c}${i.slice(o+1,w)}`:f=i.slice(o+1,w),s=w-o-1;o=w,t=0}else l===S&&t!==-1?++t:t=-1}return f}function A(i,n){if(n===null||typeof n!="object")throw new F("pathObject","Object",n);const c=n.dir||n.root,g=n.base||`${n.name||""}${n.ext||""}`;return c?c===n.root?`${c}${g}`:`${c}${i}${g}`:g}e.win32={resolve(...i){let n="",c="",g=!1;for(let f=i.length-1;f>=-1;f--){let s;if(f>=0){if(s=i[f],k(s,"path"),s.length===0)continue}else n.length===0?s=y.cwd():(s=y.env[`=${n}`]||y.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==n.toLowerCase()&&s.charCodeAt(2)===O)&&(s=`${n}\\`));const o=s.length;let t=0,l="",w=!1;const v=s.charCodeAt(0);if(o===1)a(v)&&(t=1,w=!0);else if(a(v))if(w=!0,a(s.charCodeAt(1))){let P=2,R=P;for(;P<o&&!a(s.charCodeAt(P));)P++;if(P<o&&P!==R){const N=s.slice(R,P);for(R=P;P<o&&a(s.charCodeAt(P));)P++;if(P<o&&P!==R){for(R=P;P<o&&!a(s.charCodeAt(P));)P++;(P===o||P!==R)&&(l=`\\\\${N}\\${s.slice(R,P)}`,t=P)}}}else t=1;else d(v)&&s.charCodeAt(1)===E&&(l=s.slice(0,2),t=2,o>2&&a(s.charCodeAt(2))&&(w=!0,t=3));if(l.length>0)if(n.length>0){if(l.toLowerCase()!==n.toLowerCase())continue}else n=l;if(g){if(n.length>0)break}else if(c=`${s.slice(t)}\\${c}`,g=w,w&&n.length>0)break}return c=m(c,!g,"\\",a),g?`${n}\\${c}`:`${n}${c}`||"."},normalize(i){k(i,"path");const n=i.length;if(n===0)return".";let c=0,g,f=!1;const s=i.charCodeAt(0);if(n===1)return u(s)?"\\":i;if(a(s))if(f=!0,a(i.charCodeAt(1))){let t=2,l=t;for(;t<n&&!a(i.charCodeAt(t));)t++;if(t<n&&t!==l){const w=i.slice(l,t);for(l=t;t<n&&a(i.charCodeAt(t));)t++;if(t<n&&t!==l){for(l=t;t<n&&!a(i.charCodeAt(t));)t++;if(t===n)return`\\\\${w}\\${i.slice(l)}\\`;t!==l&&(g=`\\\\${w}\\${i.slice(l,t)}`,c=t)}}}else c=1;else d(s)&&i.charCodeAt(1)===E&&(g=i.slice(0,2),c=2,n>2&&a(i.charCodeAt(2))&&(f=!0,c=3));let o=c<n?m(i.slice(c),!f,"\\",a):"";return o.length===0&&!f&&(o="."),o.length>0&&a(i.charCodeAt(n-1))&&(o+="\\"),g===void 0?f?`\\${o}`:o:f?`${g}\\${o}`:`${g}${o}`},isAbsolute(i){k(i,"path");const n=i.length;if(n===0)return!1;const c=i.charCodeAt(0);return a(c)||n>2&&d(c)&&i.charCodeAt(1)===E&&a(i.charCodeAt(2))},join(...i){if(i.length===0)return".";let n,c;for(let s=0;s<i.length;++s){const o=i[s];k(o,"path"),o.length>0&&(n===void 0?n=c=o:n+=`\\${o}`)}if(n===void 0)return".";let g=!0,f=0;if(typeof c=="string"&&a(c.charCodeAt(0))){++f;const s=c.length;s>1&&a(c.charCodeAt(1))&&(++f,s>2&&(a(c.charCodeAt(2))?++f:g=!1))}if(g){for(;f<n.length&&a(n.charCodeAt(f));)f++;f>=2&&(n=`\\${n.slice(f)}`)}return e.win32.normalize(n)},relative(i,n){if(k(i,"from"),k(n,"to"),i===n)return"";const c=e.win32.resolve(i),g=e.win32.resolve(n);if(c===g||(i=c.toLowerCase(),n=g.toLowerCase(),i===n))return"";let f=0;for(;f<i.length&&i.charCodeAt(f)===O;)f++;let s=i.length;for(;s-1>f&&i.charCodeAt(s-1)===O;)s--;const o=s-f;let t=0;for(;t<n.length&&n.charCodeAt(t)===O;)t++;let l=n.length;for(;l-1>t&&n.charCodeAt(l-1)===O;)l--;const w=l-t,v=o<w?o:w;let P=-1,R=0;for(;R<v;R++){const W=i.charCodeAt(f+R);if(W!==n.charCodeAt(t+R))break;W===O&&(P=R)}if(R!==v){if(P===-1)return g}else{if(w>v){if(n.charCodeAt(t+R)===O)return g.slice(t+R+1);if(R===2)return g.slice(t+R)}o>v&&(i.charCodeAt(f+R)===O?P=R:R===2&&(P=3)),P===-1&&(P=0)}let N="";for(R=f+P+1;R<=s;++R)(R===s||i.charCodeAt(R)===O)&&(N+=N.length===0?"..":"\\..");return t+=P,N.length>0?`${N}${g.slice(t,l)}`:(g.charCodeAt(t)===O&&++t,g.slice(t,l))},toNamespacedPath(i){if(typeof i!="string")return i;if(i.length===0)return"";const n=e.win32.resolve(i);if(n.length<=2)return i;if(n.charCodeAt(0)===O){if(n.charCodeAt(1)===O){const c=n.charCodeAt(2);if(c!==$&&c!==S)return`\\\\?\\UNC\\${n.slice(2)}`}}else if(d(n.charCodeAt(0))&&n.charCodeAt(1)===E&&n.charCodeAt(2)===O)return`\\\\?\\${n}`;return i},dirname(i){k(i,"path");const n=i.length;if(n===0)return".";let c=-1,g=0;const f=i.charCodeAt(0);if(n===1)return a(f)?i:".";if(a(f)){if(c=g=1,a(i.charCodeAt(1))){let t=2,l=t;for(;t<n&&!a(i.charCodeAt(t));)t++;if(t<n&&t!==l){for(l=t;t<n&&a(i.charCodeAt(t));)t++;if(t<n&&t!==l){for(l=t;t<n&&!a(i.charCodeAt(t));)t++;if(t===n)return i;t!==l&&(c=g=t+1)}}}}else d(f)&&i.charCodeAt(1)===E&&(c=n>2&&a(i.charCodeAt(2))?3:2,g=c);let s=-1,o=!0;for(let t=n-1;t>=g;--t)if(a(i.charCodeAt(t))){if(!o){s=t;break}}else o=!1;if(s===-1){if(c===-1)return".";s=c}return i.slice(0,s)},basename(i,n){n!==void 0&&k(n,"ext"),k(i,"path");let c=0,g=-1,f=!0,s;if(i.length>=2&&d(i.charCodeAt(0))&&i.charCodeAt(1)===E&&(c=2),n!==void 0&&n.length>0&&n.length<=i.length){if(n===i)return"";let o=n.length-1,t=-1;for(s=i.length-1;s>=c;--s){const l=i.charCodeAt(s);if(a(l)){if(!f){c=s+1;break}}else t===-1&&(f=!1,t=s+1),o>=0&&(l===n.charCodeAt(o)?--o==-1&&(g=s):(o=-1,g=t))}return c===g?g=t:g===-1&&(g=i.length),i.slice(c,g)}for(s=i.length-1;s>=c;--s)if(a(i.charCodeAt(s))){if(!f){c=s+1;break}}else g===-1&&(f=!1,g=s+1);return g===-1?"":i.slice(c,g)},extname(i){k(i,"path");let n=0,c=-1,g=0,f=-1,s=!0,o=0;i.length>=2&&i.charCodeAt(1)===E&&d(i.charCodeAt(0))&&(n=g=2);for(let t=i.length-1;t>=n;--t){const l=i.charCodeAt(t);if(a(l)){if(!s){g=t+1;break}continue}f===-1&&(s=!1,f=t+1),l===S?c===-1?c=t:o!==1&&(o=1):c!==-1&&(o=-1)}return c===-1||f===-1||o===0||o===1&&c===f-1&&c===g+1?"":i.slice(c,f)},format:A.bind(null,"\\"),parse(i){k(i,"path");const n={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return n;const c=i.length;let g=0,f=i.charCodeAt(0);if(c===1)return a(f)?(n.root=n.dir=i,n):(n.base=n.name=i,n);if(a(f)){if(g=1,a(i.charCodeAt(1))){let P=2,R=P;for(;P<c&&!a(i.charCodeAt(P));)P++;if(P<c&&P!==R){for(R=P;P<c&&a(i.charCodeAt(P));)P++;if(P<c&&P!==R){for(R=P;P<c&&!a(i.charCodeAt(P));)P++;P===c?g=P:P!==R&&(g=P+1)}}}}else if(d(f)&&i.charCodeAt(1)===E){if(c<=2)return n.root=n.dir=i,n;if(g=2,a(i.charCodeAt(2))){if(c===3)return n.root=n.dir=i,n;g=3}}g>0&&(n.root=i.slice(0,g));let s=-1,o=g,t=-1,l=!0,w=i.length-1,v=0;for(;w>=g;--w){if(f=i.charCodeAt(w),a(f)){if(!l){o=w+1;break}continue}t===-1&&(l=!1,t=w+1),f===S?s===-1?s=w:v!==1&&(v=1):s!==-1&&(v=-1)}return t!==-1&&(s===-1||v===0||v===1&&s===t-1&&s===o+1?n.base=n.name=i.slice(o,t):(n.name=i.slice(o,s),n.base=i.slice(o,t),n.ext=i.slice(s,t))),o>0&&o!==g?n.dir=i.slice(0,o-1):n.dir=n.root,n},sep:"\\",delimiter:";",win32:null,posix:null},e.posix={resolve(...i){let n="",c=!1;for(let g=i.length-1;g>=-1&&!c;g--){const f=g>=0?i[g]:y.cwd();k(f,"path"),f.length!==0&&(n=`${f}/${n}`,c=f.charCodeAt(0)===T)}return n=m(n,!c,"/",u),c?`/${n}`:n.length>0?n:"."},normalize(i){if(k(i,"path"),i.length===0)return".";const n=i.charCodeAt(0)===T,c=i.charCodeAt(i.length-1)===T;return i=m(i,!n,"/",u),i.length===0?n?"/":c?"./":".":(c&&(i+="/"),n?`/${i}`:i)},isAbsolute(i){return k(i,"path"),i.length>0&&i.charCodeAt(0)===T},join(...i){if(i.length===0)return".";let n;for(let c=0;c<i.length;++c){const g=i[c];k(g,"path"),g.length>0&&(n===void 0?n=g:n+=`/${g}`)}return n===void 0?".":e.posix.normalize(n)},relative(i,n){if(k(i,"from"),k(n,"to"),i===n||(i=e.posix.resolve(i),n=e.posix.resolve(n),i===n))return"";const c=1,g=i.length,f=g-c,s=1,o=n.length-s,t=f<o?f:o;let l=-1,w=0;for(;w<t;w++){const P=i.charCodeAt(c+w);if(P!==n.charCodeAt(s+w))break;P===T&&(l=w)}if(w===t)if(o>t){if(n.charCodeAt(s+w)===T)return n.slice(s+w+1);if(w===0)return n.slice(s+w)}else f>t&&(i.charCodeAt(c+w)===T?l=w:w===0&&(l=0));let v="";for(w=c+l+1;w<=g;++w)(w===g||i.charCodeAt(w)===T)&&(v+=v.length===0?"..":"/..");return`${v}${n.slice(s+l)}`},toNamespacedPath(i){return i},dirname(i){if(k(i,"path"),i.length===0)return".";const n=i.charCodeAt(0)===T;let c=-1,g=!0;for(let f=i.length-1;f>=1;--f)if(i.charCodeAt(f)===T){if(!g){c=f;break}}else g=!1;return c===-1?n?"/":".":n&&c===1?"//":i.slice(0,c)},basename(i,n){n!==void 0&&k(n,"ext"),k(i,"path");let c=0,g=-1,f=!0,s;if(n!==void 0&&n.length>0&&n.length<=i.length){if(n===i)return"";let o=n.length-1,t=-1;for(s=i.length-1;s>=0;--s){const l=i.charCodeAt(s);if(l===T){if(!f){c=s+1;break}}else t===-1&&(f=!1,t=s+1),o>=0&&(l===n.charCodeAt(o)?--o==-1&&(g=s):(o=-1,g=t))}return c===g?g=t:g===-1&&(g=i.length),i.slice(c,g)}for(s=i.length-1;s>=0;--s)if(i.charCodeAt(s)===T){if(!f){c=s+1;break}}else g===-1&&(f=!1,g=s+1);return g===-1?"":i.slice(c,g)},extname(i){k(i,"path");let n=-1,c=0,g=-1,f=!0,s=0;for(let o=i.length-1;o>=0;--o){const t=i.charCodeAt(o);if(t===T){if(!f){c=o+1;break}continue}g===-1&&(f=!1,g=o+1),t===S?n===-1?n=o:s!==1&&(s=1):n!==-1&&(s=-1)}return n===-1||g===-1||s===0||s===1&&n===g-1&&n===c+1?"":i.slice(n,g)},format:A.bind(null,"/"),parse(i){k(i,"path");const n={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return n;const c=i.charCodeAt(0)===T;let g;c?(n.root="/",g=1):g=0;let f=-1,s=0,o=-1,t=!0,l=i.length-1,w=0;for(;l>=g;--l){const v=i.charCodeAt(l);if(v===T){if(!t){s=l+1;break}continue}o===-1&&(t=!1,o=l+1),v===S?f===-1?f=l:w!==1&&(w=1):f!==-1&&(w=-1)}if(o!==-1){const v=s===0&&c?1:s;f===-1||w===0||w===1&&f===o-1&&f===s+1?n.base=n.name=i.slice(v,o):(n.name=i.slice(v,f),n.base=i.slice(v,o),n.ext=i.slice(f,o))}return s>0?n.dir=i.slice(0,s-1):c&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null},e.posix.win32=e.win32.win32=e.win32,e.posix.posix=e.win32.posix=e.posix,e.normalize=y.platform==="win32"?e.win32.normalize:e.posix.normalize,e.isAbsolute=y.platform==="win32"?e.win32.isAbsolute:e.posix.isAbsolute,e.join=y.platform==="win32"?e.win32.join:e.posix.join,e.resolve=y.platform==="win32"?e.win32.resolve:e.posix.resolve,e.relative=y.platform==="win32"?e.win32.relative:e.posix.relative,e.dirname=y.platform==="win32"?e.win32.dirname:e.posix.dirname,e.basename=y.platform==="win32"?e.win32.basename:e.posix.basename,e.extname=y.platform==="win32"?e.win32.extname:e.posix.extname,e.format=y.platform==="win32"?e.win32.format:e.posix.format,e.parse=y.platform==="win32"?e.win32.parse:e.posix.parse,e.toNamespacedPath=y.platform==="win32"?e.win32.toNamespacedPath:e.posix.toNamespacedPath,e.sep=y.platform==="win32"?e.win32.sep:e.posix.sep,e.delimiter=y.platform==="win32"?e.win32.delimiter:e.posix.delimiter}),define(B[7],K([0,1,3,2,8,9]),function(j,e,y,I,q,L){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.randomPath=e.parseLineAndColumnAware=e.indexOfPath=e.getDriveLetter=e.hasDriveLetter=e.isRootOrDriveLetter=e.sanitizeFilePath=e.isWindowsDriveLetter=e.isEqualOrParent=e.isEqual=e.isValidBasename=e.isUNC=e.getRoot=e.toPosixPath=e.toSlashes=e.isPathSeparator=void 0;function U(t){return t===47||t===92}e.isPathSeparator=U;function S(t){return t.replace(/[\\/]/g,y.posix.sep)}e.toSlashes=S;function T(t){return t.indexOf("/")===-1&&(t=S(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}e.toPosixPath=T;function O(t,l=y.posix.sep){if(!t)return"";const w=t.length,v=t.charCodeAt(0);if(U(v)){if(U(t.charCodeAt(1))&&!U(t.charCodeAt(2))){let R=3;const N=R;for(;R<w&&!U(t.charCodeAt(R));R++);if(N!==R&&!U(t.charCodeAt(R+1))){for(R+=1;R<w;R++)if(U(t.charCodeAt(R)))return t.slice(0,R+1).replace(/[\\/]/g,l)}}return l}else if(m(v)&&t.charCodeAt(1)===58)return U(t.charCodeAt(2))?t.slice(0,2)+l:t.slice(0,2);let P=t.indexOf("://");if(P!==-1){for(P+=3;P<w;P++)if(U(t.charCodeAt(P)))return t.slice(0,P+1)}return""}e.getRoot=O;function E(t){if(!I.isWindows||!t||t.length<5)return!1;let l=t.charCodeAt(0);if(l!==92||(l=t.charCodeAt(1),l!==92))return!1;let w=2;const v=w;for(;w<t.length&&(l=t.charCodeAt(w),l!==92);w++);return!(v===w||(l=t.charCodeAt(w+1),isNaN(l)||l===92))}e.isUNC=E;const $=/[\\/:\*\?"<>\|]/g,F=/[\\/]/g,k=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function a(t,l=I.isWindows){const w=l?$:F;return!(!t||t.length===0||/^\s+$/.test(t)||(w.lastIndex=0,w.test(t))||l&&k.test(t)||t==="."||t===".."||l&&t[t.length-1]==="."||l&&t.length!==t.trim().length||t.length>255)}e.isValidBasename=a;function u(t,l,w){const v=t===l;return!w||v?v:!t||!l?!1:(0,q.equalsIgnoreCase)(t,l)}e.isEqual=u;function d(t,l,w,v=y.sep){if(t===l)return!0;if(!t||!l||l.length>t.length)return!1;if(w){if(!(0,q.startsWithIgnoreCase)(t,l))return!1;if(l.length===t.length)return!0;let R=l.length;return l.charAt(l.length-1)===v&&R--,t.charAt(R)===v}return l.charAt(l.length-1)!==v&&(l+=v),t.indexOf(l)===0}e.isEqualOrParent=d;function m(t){return t>=65&&t<=90||t>=97&&t<=122}e.isWindowsDriveLetter=m;function A(t,l){return I.isWindows&&t.endsWith(":")&&(t+=y.sep),(0,y.isAbsolute)(t)||(t=(0,y.join)(l,t)),t=(0,y.normalize)(t),I.isWindows?(t=(0,q.rtrim)(t,y.sep),t.endsWith(":")&&(t+=y.sep)):(t=(0,q.rtrim)(t,y.sep),t||(t=y.sep)),t}e.sanitizeFilePath=A;function i(t){const l=(0,y.normalize)(t);return I.isWindows?t.length>3?!1:n(l)&&(t.length===2||l.charCodeAt(2)===92):l===y.posix.sep}e.isRootOrDriveLetter=i;function n(t,l){return(l!==void 0?l:I.isWindows)?m(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}e.hasDriveLetter=n;function c(t){return n(t)?t[0]:void 0}e.getDriveLetter=c;function g(t,l,w){return l.length>t.length?-1:t===l?0:(w&&(t=t.toLowerCase(),l=l.toLowerCase()),t.indexOf(l))}e.indexOfPath=g;function f(t){const l=t.split(":");let w,v,P;for(const R of l){const N=Number(R);(0,L.isNumber)(N)?v===void 0?v=N:P===void 0&&(P=N):w=w?[w,R].join(":"):R}if(!w)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:w,line:v!==void 0?v:void 0,column:P!==void 0?P:v!==void 0?1:void 0}}e.parseLineAndColumnAware=f;const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function o(t,l,w=8){let v="";for(let R=0;R<w;R++)v+=s.charAt(Math.floor(Math.random()*s.length));let P;return l?P=`${l}-${v}`:P=v,t?(0,y.join)(t,P):P}e.randomPath=o}),define(B[10],K([0,1,9]),function(j,e,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.filter=e.getCaseInsensitive=e.distinct=e.getOrDefault=e.safeStringify=e.equals=e.mixin=e.cloneAndChange=e.deepFreeze=e.deepClone=void 0;function I(u){if(!u||typeof u!="object"||u instanceof RegExp)return u;const d=Array.isArray(u)?[]:{};return Object.keys(u).forEach(m=>{u[m]&&typeof u[m]=="object"?d[m]=I(u[m]):d[m]=u[m]}),d}e.deepClone=I;function q(u){if(!u||typeof u!="object")return u;const d=[u];for(;d.length>0;){const m=d.shift();Object.freeze(m);for(const A in m)if(L.call(m,A)){const i=m[A];typeof i=="object"&&!Object.isFrozen(i)&&d.push(i)}}return u}e.deepFreeze=q;const L=Object.prototype.hasOwnProperty;function U(u,d){return S(u,d,new Set)}e.cloneAndChange=U;function S(u,d,m){if((0,y.isUndefinedOrNull)(u))return u;const A=d(u);if(typeof A!="undefined")return A;if((0,y.isArray)(u)){const i=[];for(const n of u)i.push(S(n,d,m));return i}if((0,y.isObject)(u)){if(m.has(u))throw new Error("Cannot clone recursive data-structure");m.add(u);const i={};for(let n in u)L.call(u,n)&&(i[n]=S(u[n],d,m));return m.delete(u),i}return u}function T(u,d,m=!0){return(0,y.isObject)(u)?((0,y.isObject)(d)&&Object.keys(d).forEach(A=>{A in u?m&&((0,y.isObject)(u[A])&&(0,y.isObject)(d[A])?T(u[A],d[A],m):u[A]=d[A]):u[A]=d[A]}),u):d}e.mixin=T;function O(u,d){if(u===d)return!0;if(u==null||d===null||d===void 0||typeof u!=typeof d||typeof u!="object"||Array.isArray(u)!==Array.isArray(d))return!1;let m,A;if(Array.isArray(u)){if(u.length!==d.length)return!1;for(m=0;m<u.length;m++)if(!O(u[m],d[m]))return!1}else{const i=[];for(A in u)i.push(A);i.sort();const n=[];for(A in d)n.push(A);if(n.sort(),!O(i,n))return!1;for(m=0;m<i.length;m++)if(!O(u[i[m]],d[i[m]]))return!1}return!0}e.equals=O;function E(u){const d=new Set;return JSON.stringify(u,(m,A)=>{if((0,y.isObject)(A)||Array.isArray(A)){if(d.has(A))return"[Circular]";d.add(A)}return A})}e.safeStringify=E;function $(u,d,m){const A=d(u);return typeof A=="undefined"?m:A}e.getOrDefault=$;function F(u,d){const m=Object.create(null);return!u||!d||Object.keys(d).forEach(i=>{const n=u[i],c=d[i];O(n,c)||(m[i]=c)}),m}e.distinct=F;function k(u,d){const m=d.toLowerCase(),A=Object.keys(u).find(i=>i.toLowerCase()===m);return A?u[A]:u[d]}e.getCaseInsensitive=k;function a(u,d){const m=Object.create(null);for(const[A,i]of Object.entries(u))d(A,i)&&(m[A]=i);return m}e.filter=a}),define(B[5],K([0,1,3,2]),function(j,e,y,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uriToFsPath=e.URI=void 0;const q=/^\w[\w\d+.-]*$/,L=/^\//,U=/^\/\//;function S(s,o){if(!s.scheme&&o)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${s.authority}", path: "${s.path}", query: "${s.query}", fragment: "${s.fragment}"}`);if(s.scheme&&!q.test(s.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(s.path){if(s.authority){if(!L.test(s.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(U.test(s.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function T(s,o){return!s&&!o?"file":s}function O(s,o){switch(s){case"https":case"http":case"file":o?o[0]!==$&&(o=$+o):o=$;break}return o}const E="",$="/",F=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class k{constructor(o,t,l,w,v,P=!1){typeof o=="object"?(this.scheme=o.scheme||E,this.authority=o.authority||E,this.path=o.path||E,this.query=o.query||E,this.fragment=o.fragment||E):(this.scheme=T(o,P),this.authority=t||E,this.path=O(this.scheme,l||E),this.query=w||E,this.fragment=v||E,S(this,P))}static isUri(o){return o instanceof k?!0:o?typeof o.authority=="string"&&typeof o.fragment=="string"&&typeof o.path=="string"&&typeof o.query=="string"&&typeof o.scheme=="string"&&typeof o.fsPath=="string"&&typeof o.with=="function"&&typeof o.toString=="function":!1}get fsPath(){return i(this,!1)}with(o){if(!o)return this;let{scheme:t,authority:l,path:w,query:v,fragment:P}=o;return t===void 0?t=this.scheme:t===null&&(t=E),l===void 0?l=this.authority:l===null&&(l=E),w===void 0?w=this.path:w===null&&(w=E),v===void 0?v=this.query:v===null&&(v=E),P===void 0?P=this.fragment:P===null&&(P=E),t===this.scheme&&l===this.authority&&w===this.path&&v===this.query&&P===this.fragment?this:new u(t,l,w,v,P)}static parse(o,t=!1){const l=F.exec(o);return l?new u(l[2]||E,f(l[4]||E),f(l[5]||E),f(l[7]||E),f(l[9]||E),t):new u(E,E,E,E,E)}static file(o){let t=E;if(I.isWindows&&(o=o.replace(/\\/g,$)),o[0]===$&&o[1]===$){const l=o.indexOf($,2);l===-1?(t=o.substring(2),o=$):(t=o.substring(2,l),o=o.substring(l)||$)}return new u("file",t,o,E,E)}static from(o){const t=new u(o.scheme,o.authority,o.path,o.query,o.fragment);return S(t,!0),t}static joinPath(o,...t){if(!o.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let l;return I.isWindows&&o.scheme==="file"?l=k.file(y.win32.join(i(o,!0),...t)).path:l=y.posix.join(o.path,...t),o.with({path:l})}toString(o=!1){return n(this,o)}toJSON(){return this}static revive(o){if(o){if(o instanceof k)return o;{const t=new u(o);return t._formatted=o.external,t._fsPath=o._sep===a?o.fsPath:null,t}}else return o}}e.URI=k;const a=I.isWindows?1:void 0;class u extends k{constructor(){super(...arguments);this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=i(this,!1)),this._fsPath}toString(o=!1){return o?n(this,!0):(this._formatted||(this._formatted=n(this,!1)),this._formatted)}toJSON(){const o={$mid:1};return this._fsPath&&(o.fsPath=this._fsPath,o._sep=a),this._formatted&&(o.external=this._formatted),this.path&&(o.path=this.path),this.scheme&&(o.scheme=this.scheme),this.authority&&(o.authority=this.authority),this.query&&(o.query=this.query),this.fragment&&(o.fragment=this.fragment),o}}const d={[58]:"%3A",[47]:"%2F",[63]:"%3F",[35]:"%23",[91]:"%5B",[93]:"%5D",[64]:"%40",[33]:"%21",[36]:"%24",[38]:"%26",[39]:"%27",[40]:"%28",[41]:"%29",[42]:"%2A",[43]:"%2B",[44]:"%2C",[59]:"%3B",[61]:"%3D",[32]:"%20"};function m(s,o){let t,l=-1;for(let w=0;w<s.length;w++){const v=s.charCodeAt(w);if(v>=97&&v<=122||v>=65&&v<=90||v>=48&&v<=57||v===45||v===46||v===95||v===126||o&&v===47)l!==-1&&(t+=encodeURIComponent(s.substring(l,w)),l=-1),t!==void 0&&(t+=s.charAt(w));else{t===void 0&&(t=s.substr(0,w));const P=d[v];P!==void 0?(l!==-1&&(t+=encodeURIComponent(s.substring(l,w)),l=-1),t+=P):l===-1&&(l=w)}}return l!==-1&&(t+=encodeURIComponent(s.substring(l))),t!==void 0?t:s}function A(s){let o;for(let t=0;t<s.length;t++){const l=s.charCodeAt(t);l===35||l===63?(o===void 0&&(o=s.substr(0,t)),o+=d[l]):o!==void 0&&(o+=s[t])}return o!==void 0?o:s}function i(s,o){let t;return s.authority&&s.path.length>1&&s.scheme==="file"?t=`//${s.authority}${s.path}`:s.path.charCodeAt(0)===47&&(s.path.charCodeAt(1)>=65&&s.path.charCodeAt(1)<=90||s.path.charCodeAt(1)>=97&&s.path.charCodeAt(1)<=122)&&s.path.charCodeAt(2)===58?o?t=s.path.substr(1):t=s.path[1].toLowerCase()+s.path.substr(2):t=s.path,I.isWindows&&(t=t.replace(/\//g,"\\")),t}e.uriToFsPath=i;function n(s,o){const t=o?A:m;let l="",{scheme:w,authority:v,path:P,query:R,fragment:N}=s;if(w&&(l+=w,l+=":"),(v||w==="file")&&(l+=$,l+=$),v){let W=v.indexOf("@");if(W!==-1){const Q=v.substr(0,W);v=v.substr(W+1),W=Q.indexOf(":"),W===-1?l+=t(Q,!1):(l+=t(Q.substr(0,W),!1),l+=":",l+=t(Q.substr(W+1),!1)),l+="@"}v=v.toLowerCase(),W=v.indexOf(":"),W===-1?l+=t(v,!1):(l+=t(v.substr(0,W),!1),l+=v.substr(W))}if(P){if(P.length>=3&&P.charCodeAt(0)===47&&P.charCodeAt(2)===58){const W=P.charCodeAt(1);W>=65&&W<=90&&(P=`/${String.fromCharCode(W+32)}:${P.substr(3)}`)}else if(P.length>=2&&P.charCodeAt(1)===58){const W=P.charCodeAt(0);W>=65&&W<=90&&(P=`${String.fromCharCode(W+32)}:${P.substr(2)}`)}l+=t(P,!0)}return R&&(l+="?",l+=t(R,!1)),N&&(l+="#",l+=o?N:m(N,!1)),l}function c(s){try{return decodeURIComponent(s)}catch{return s.length>3?s.substr(0,3)+c(s.substr(3)):s}}const g=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function f(s){return s.match(g)?s.replace(g,o=>c(o)):s}}),define(B[6],K([0,1,2,5]),function(j,e,y,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileAccess=e.RemoteAuthorities=e.connectionTokenQueryName=e.connectionTokenCookieName=e.Schemas=void 0;var q;(function(S){S.inMemory="inmemory",S.vscode="vscode",S.internal="private",S.walkThrough="walkThrough",S.walkThroughSnippet="walkThroughSnippet",S.http="http",S.https="https",S.file="file",S.mailto="mailto",S.untitled="untitled",S.data="data",S.command="command",S.vscodeRemote="vscode-remote",S.vscodeRemoteResource="vscode-remote-resource",S.userData="vscode-userdata",S.vscodeCustomEditor="vscode-custom-editor",S.vscodeNotebook="vscode-notebook",S.vscodeNotebookCell="vscode-notebook-cell",S.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",S.vscodeNotebookCellOutput="vscode-notebook-cell-output",S.vscodeInteractive="vscode-interactive",S.vscodeInteractiveInput="vscode-interactive-input",S.vscodeSettings="vscode-settings",S.vscodeWorkspaceTrust="vscode-workspace-trust",S.vscodeTerminal="vscode-terminal",S.webviewPanel="webview-panel",S.vscodeWebview="vscode-webview",S.extension="extension",S.vscodeFileResource="vscode-file",S.tmp="tmp",S.vsls="vsls"})(q=e.Schemas||(e.Schemas={})),e.connectionTokenCookieName="vscode-tkn",e.connectionTokenQueryName="tkn";class L{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null}setPreferredWebSchema(T){this._preferredWebSchema=T}setDelegate(T){this._delegate=T}set(T,O,E){this._hosts[T]=O,this._ports[T]=E}setConnectionToken(T,O){this._connectionTokens[T]=O}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(T){if(this._delegate)return this._delegate(T);const O=T.authority;let E=this._hosts[O];E&&E.indexOf(":")!==-1&&(E=`[${E}]`);const $=this._ports[O],F=this._connectionTokens[O];let k=`path=${encodeURIComponent(T.path)}`;return typeof F=="string"&&(k+=`&${e.connectionTokenQueryName}=${encodeURIComponent(F)}`),I.URI.from({scheme:y.isWeb?this._preferredWebSchema:q.vscodeRemoteResource,authority:y.isWeb?window.location.host:`${E}:${$}`,path:y.isWeb?I.URI.joinPath(I.URI.parse(window.location.href),"/vscode-remote-resource").path:"/vscode-remote-resource",query:k})}}e.RemoteAuthorities=new L;class U{asBrowserUri(T,O){const E=this.toUri(T,O);return E.scheme===q.vscodeRemote?e.RemoteAuthorities.rewrite(E):E.scheme===q.file&&(y.isNative||y.isWebWorker&&y.globals.origin===`${q.vscodeFileResource}://${U.FALLBACK_AUTHORITY}`)?E.with({scheme:q.vscodeFileResource,authority:E.authority||U.FALLBACK_AUTHORITY,query:null,fragment:null}):E}asFileUri(T,O){const E=this.toUri(T,O);return E.scheme===q.vscodeFileResource?E.with({scheme:q.file,authority:E.authority!==U.FALLBACK_AUTHORITY?E.authority:null,query:null,fragment:null}):E}toUri(T,O){return I.URI.isUri(T)?T:I.URI.parse(O.toUrl(T))}}U.FALLBACK_AUTHORITY="vscode-app",e.FileAccess=new U}),define(B[11],K([0,1,7,6,3,2,8,5]),function(j,e,y,I,q,L,U,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toLocalResource=e.DataUri=e.distinctParents=e.addTrailingPathSeparator=e.removeTrailingPathSeparator=e.hasTrailingPathSeparator=e.isEqualAuthority=e.isAbsolutePath=e.resolvePath=e.relativePath=e.normalizePath=e.joinPath=e.dirname=e.extname=e.basename=e.basenameOrAuthority=e.getComparisonKey=e.isEqualOrParent=e.isEqual=e.extUriIgnorePathCase=e.extUriBiasedIgnorePathCase=e.extUri=e.ExtUri=e.originalFSPath=void 0;function T(k){return(0,S.uriToFsPath)(k,!0)}e.originalFSPath=T;class O{constructor(a){this._ignorePathCasing=a}compare(a,u,d=!1){return a===u?0:(0,U.compare)(this.getComparisonKey(a,d),this.getComparisonKey(u,d))}isEqual(a,u,d=!1){return a===u?!0:!a||!u?!1:this.getComparisonKey(a,d)===this.getComparisonKey(u,d)}getComparisonKey(a,u=!1){return a.with({path:this._ignorePathCasing(a)?a.path.toLowerCase():void 0,fragment:u?null:void 0}).toString()}ignorePathCasing(a){return this._ignorePathCasing(a)}isEqualOrParent(a,u,d=!1){if(a.scheme===u.scheme){if(a.scheme===I.Schemas.file)return y.isEqualOrParent(T(a),T(u),this._ignorePathCasing(a))&&a.query===u.query&&(d||a.fragment===u.fragment);if((0,e.isEqualAuthority)(a.authority,u.authority))return y.isEqualOrParent(a.path,u.path,this._ignorePathCasing(a),"/")&&a.query===u.query&&(d||a.fragment===u.fragment)}return!1}joinPath(a,...u){return S.URI.joinPath(a,...u)}basenameOrAuthority(a){return(0,e.basename)(a)||a.authority}basename(a){return q.posix.basename(a.path)}extname(a){return q.posix.extname(a.path)}dirname(a){if(a.path.length===0)return a;let u;return a.scheme===I.Schemas.file?u=S.URI.file(q.dirname(T(a))).path:(u=q.posix.dirname(a.path),a.authority&&u.length&&u.charCodeAt(0)!==47&&(console.error(`dirname("${a.toString})) resulted in a relative path`),u="/")),a.with({path:u})}normalizePath(a){if(!a.path.length)return a;let u;return a.scheme===I.Schemas.file?u=S.URI.file(q.normalize(T(a))).path:u=q.posix.normalize(a.path),a.with({path:u})}relativePath(a,u){if(a.scheme!==u.scheme||!(0,e.isEqualAuthority)(a.authority,u.authority))return;if(a.scheme===I.Schemas.file){const A=q.relative(T(a),T(u));return L.isWindows?y.toSlashes(A):A}let d=a.path||"/",m=u.path||"/";if(this._ignorePathCasing(a)){let A=0;for(const i=Math.min(d.length,m.length);A<i&&!(d.charCodeAt(A)!==m.charCodeAt(A)&&d.charAt(A).toLowerCase()!==m.charAt(A).toLowerCase());A++);d=m.substr(0,A)+d.substr(A)}return q.posix.relative(d,m)}resolvePath(a,u){if(a.scheme===I.Schemas.file){const d=S.URI.file(q.resolve(T(a),u));return a.with({authority:d.authority,path:d.path})}return u=y.toPosixPath(u),a.with({path:q.posix.resolve(a.path,u)})}isAbsolutePath(a){return!!a.path&&a.path[0]==="/"}isEqualAuthority(a,u){return a===u||a!==void 0&&u!==void 0&&(0,U.equalsIgnoreCase)(a,u)}hasTrailingPathSeparator(a,u=q.sep){if(a.scheme===I.Schemas.file){const d=T(a);return d.length>y.getRoot(d).length&&d[d.length-1]===u}else{const d=a.path;return d.length>1&&d.charCodeAt(d.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(a.fsPath)}}removeTrailingPathSeparator(a,u=q.sep){return(0,e.hasTrailingPathSeparator)(a,u)?a.with({path:a.path.substr(0,a.path.length-1)}):a}addTrailingPathSeparator(a,u=q.sep){let d=!1;if(a.scheme===I.Schemas.file){const m=T(a);d=m!==void 0&&m.length===y.getRoot(m).length&&m[m.length-1]===u}else{u="/";const m=a.path;d=m.length===1&&m.charCodeAt(m.length-1)===47}return!d&&!(0,e.hasTrailingPathSeparator)(a,u)?a.with({path:a.path+"/"}):a}}e.ExtUri=O,e.extUri=new O(()=>!1),e.extUriBiasedIgnorePathCase=new O(k=>k.scheme===I.Schemas.file?!L.isLinux:!0),e.extUriIgnorePathCase=new O(k=>!0),e.isEqual=e.extUri.isEqual.bind(e.extUri),e.isEqualOrParent=e.extUri.isEqualOrParent.bind(e.extUri),e.getComparisonKey=e.extUri.getComparisonKey.bind(e.extUri),e.basenameOrAuthority=e.extUri.basenameOrAuthority.bind(e.extUri),e.basename=e.extUri.basename.bind(e.extUri),e.extname=e.extUri.extname.bind(e.extUri),e.dirname=e.extUri.dirname.bind(e.extUri),e.joinPath=e.extUri.joinPath.bind(e.extUri),e.normalizePath=e.extUri.normalizePath.bind(e.extUri),e.relativePath=e.extUri.relativePath.bind(e.extUri),e.resolvePath=e.extUri.resolvePath.bind(e.extUri),e.isAbsolutePath=e.extUri.isAbsolutePath.bind(e.extUri),e.isEqualAuthority=e.extUri.isEqualAuthority.bind(e.extUri),e.hasTrailingPathSeparator=e.extUri.hasTrailingPathSeparator.bind(e.extUri),e.removeTrailingPathSeparator=e.extUri.removeTrailingPathSeparator.bind(e.extUri),e.addTrailingPathSeparator=e.extUri.addTrailingPathSeparator.bind(e.extUri);function E(k,a){const u=[];for(let d=0;d<k.length;d++){const m=a(k[d]);k.some((A,i)=>i===d?!1:(0,e.isEqualOrParent)(m,a(A)))||u.push(k[d])}return u}e.distinctParents=E;var $;(function(k){k.META_DATA_LABEL="label",k.META_DATA_DESCRIPTION="description",k.META_DATA_SIZE="size",k.META_DATA_MIME="mime";function a(u){const d=new Map;u.path.substring(u.path.indexOf(";")+1,u.path.lastIndexOf(";")).split(";").forEach(i=>{const[n,c]=i.split(":");n&&c&&d.set(n,c)});const A=u.path.substring(0,u.path.indexOf(";"));return A&&d.set(k.META_DATA_MIME,A),d}k.parseMetaData=a})($=e.DataUri||(e.DataUri={}));function F(k,a,u){if(a){let d=k.path;return d&&d[0]!==q.posix.sep&&(d=q.posix.sep+d),k.with({scheme:u,authority:a,path:d})}return k.with({scheme:u})}e.toLocalResource=F}),define(B[12],K([0,1,16,13,14,15,11,2]),function(j,e,y,I,q,L,U,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createCancelableAsyncIterable=e.CancelableAsyncIterableObject=e.AsyncIterableObject=e.Promises=e.DeferredPromise=e.IntervalCounter=e.TaskSequentializer=e.retry=e.IdleValue=e.runWhenIdle=e.ThrottledWorker=e.RunOnceWorker=e.ProcessTimeRunOnceScheduler=e.RunOnceScheduler=e.IntervalTimer=e.TimeoutTimer=e.ResourceQueue=e.Queue=e.Limiter=e.firstParallel=e.first=e.sequence=e.disposableTimeout=e.timeout=e.AutoOpenBarrier=e.Barrier=e.ThrottledDelayer=e.Delayer=e.MicrotaskDelay=e.SequencerByKey=e.Sequencer=e.Throttler=e.asPromise=e.raceTimeout=e.raceCancellablePromises=e.raceCancellationError=e.raceCancellation=e.createCancelablePromise=e.isThenable=void 0;function T(_){return!!_&&typeof _.then=="function"}e.isThenable=T;function O(_){const r=new y.CancellationTokenSource,h=_(r.token),C=new Promise((b,D)=>{const M=r.token.onCancellationRequested(()=>{M.dispose(),r.dispose(),D(new I.CancellationError)});Promise.resolve(h).then(z=>{M.dispose(),r.dispose(),b(z)},z=>{M.dispose(),r.dispose(),D(z)})});return new class{cancel(){r.cancel()}then(b,D){return C.then(b,D)}catch(b){return this.then(void 0,b)}finally(b){return C.finally(b)}}}e.createCancelablePromise=O;function E(_,r,h){return new Promise((C,b)=>{const D=r.onCancellationRequested(()=>{D.dispose(),C(h)});_.then(C,b).finally(()=>D.dispose())})}e.raceCancellation=E;function $(_,r){return new Promise((h,C)=>{const b=r.onCancellationRequested(()=>{b.dispose(),C(new I.CancellationError)});_.then(h,C).finally(()=>b.dispose())})}e.raceCancellationError=$;async function F(_){let r=-1;const h=_.map((b,D)=>b.then(M=>(r=D,M))),C=await Promise.race(h);return _.forEach((b,D)=>{D!==r&&b.cancel()}),C}e.raceCancellablePromises=F;function k(_,r,h){let C;const b=setTimeout(()=>{C?.(void 0),h?.()},r);return Promise.race([_.finally(()=>clearTimeout(b)),new Promise(D=>C=D)])}e.raceTimeout=k;function a(_){return new Promise((r,h)=>{const C=_();T(C)?C.then(r,h):r(C)})}e.asPromise=a;class u{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(r){if(this.activePromise){if(this.queuedPromiseFactory=r,!this.queuedPromise){const h=()=>{this.queuedPromise=null;const C=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,C};this.queuedPromise=new Promise(C=>{this.activePromise.then(h,h).then(C)})}return new Promise((h,C)=>{this.queuedPromise.then(h,C)})}return this.activePromise=r(),new Promise((h,C)=>{this.activePromise.then(b=>{this.activePromise=null,h(b)},b=>{this.activePromise=null,C(b)})})}}e.Throttler=u;class d{constructor(){this.current=Promise.resolve(null)}queue(r){return this.current=this.current.then(()=>r(),()=>r())}}e.Sequencer=d;class m{constructor(){this.promiseMap=new Map}queue(r,h){const b=(this.promiseMap.get(r)??Promise.resolve()).catch(()=>{}).then(h).finally(()=>{this.promiseMap.get(r)===b&&this.promiseMap.delete(r)});return this.promiseMap.set(r,b),b}}e.SequencerByKey=m;const A=(_,r)=>{let h=!0;const C=setTimeout(()=>{h=!1,r()},_);return{isTriggered:()=>h,dispose:()=>{clearTimeout(C),h=!1}}},i=_=>{let r=!0;return queueMicrotask(()=>{r&&(r=!1,_())}),{isTriggered:()=>r,dispose:()=>{r=!1}}};e.MicrotaskDelay=Symbol("MicrotaskDelay");class n{constructor(r){this.defaultDelay=r,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(r,h=this.defaultDelay){this.task=r,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((b,D)=>{this.doResolve=b,this.doReject=D}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const b=this.task;return this.task=null,b()}}));const C=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=h===e.MicrotaskDelay?i(C):A(h,C),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject&&this.doReject(new I.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}}e.Delayer=n;class c{constructor(r){this.delayer=new n(r),this.throttler=new u}trigger(r,h){return this.delayer.trigger(()=>this.throttler.queue(r),h)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose()}}e.ThrottledDelayer=c;class g{constructor(){this._isOpen=!1,this._promise=new Promise((r,h)=>{this._completePromise=r})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}}e.Barrier=g;class f extends g{constructor(r){super();this._timeout=setTimeout(()=>this.open(),r)}open(){clearTimeout(this._timeout),super.open()}}e.AutoOpenBarrier=f;function s(_,r){return r?new Promise((h,C)=>{const b=setTimeout(()=>{D.dispose(),h()},_),D=r.onCancellationRequested(()=>{clearTimeout(b),D.dispose(),C(new I.CancellationError)})}):O(h=>s(_,h))}e.timeout=s;function o(_,r=0){const h=setTimeout(_,r);return(0,L.toDisposable)(()=>clearTimeout(h))}e.disposableTimeout=o;function t(_){const r=[];let h=0;const C=_.length;function b(){return h<C?_[h++]():null}function D(M){M!=null&&r.push(M);const z=b();return z?z.then(D):Promise.resolve(r)}return Promise.resolve(null).then(D)}e.sequence=t;function l(_,r=C=>!!C,h=null){let C=0;const b=_.length,D=()=>{if(C>=b)return Promise.resolve(h);const M=_[C++];return Promise.resolve(M()).then(V=>r(V)?Promise.resolve(V):D())};return D()}e.first=l;function w(_,r=C=>!!C,h=null){if(_.length===0)return Promise.resolve(h);let C=_.length;const b=()=>{C=-1;for(const D of _)D.cancel?.()};return new Promise((D,M)=>{for(const z of _)z.then(V=>{--C>=0&&r(V)?(b(),D(V)):C===0&&D(h)}).catch(V=>{--C>=0&&(b(),M(V))})})}e.firstParallel=w;class v{constructor(r){this._size=0,this.maxDegreeOfParalellism=r,this.outstandingPromises=[],this.runningPromises=0,this._onFinished=new q.Emitter}get onFinished(){return this._onFinished.event}get size(){return this._size}queue(r){return this._size++,new Promise((h,C)=>{this.outstandingPromises.push({factory:r,c:h,e:C}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){const r=this.outstandingPromises.shift();this.runningPromises++;const h=r.factory();h.then(r.c,r.e),h.then(()=>this.consumed(),()=>this.consumed())}}consumed(){this._size--,this.runningPromises--,this.outstandingPromises.length>0?this.consume():this._onFinished.fire()}dispose(){this._onFinished.dispose()}}e.Limiter=v;class P extends v{constructor(){super(1)}}e.Queue=P;class R{constructor(){this.queues=new Map,this.drainers=new Set}async whenDrained(){if(this.isDrained())return;const r=new Z;return this.drainers.add(r),r.p}isDrained(){for(const[,r]of this.queues)if(r.size>0)return!1;return!0}queueFor(r,h=U.extUri){const C=h.getComparisonKey(r);let b=this.queues.get(C);return b||(b=new P,q.Event.once(b.onFinished)(()=>{b?.dispose(),this.queues.delete(C),this.onDidQueueFinish()}),this.queues.set(C,b)),b}onDidQueueFinish(){!this.isDrained()||this.releaseDrainers()}releaseDrainers(){for(const r of this.drainers)r.complete();this.drainers.clear()}dispose(){for(const[,r]of this.queues)r.dispose();this.queues.clear(),this.releaseDrainers()}}e.ResourceQueue=R;class N{constructor(r,h){this._token=-1,typeof r=="function"&&typeof h=="number"&&this.setIfNotSet(r,h)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(r,h){this.cancel(),this._token=setTimeout(()=>{this._token=-1,r()},h)}setIfNotSet(r,h){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,r()},h))}}e.TimeoutTimer=N;class W{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(r,h){this.cancel(),this._token=setInterval(()=>{r()},h)}}e.IntervalTimer=W;class Q{constructor(r,h){this.timeoutToken=-1,this.runner=r,this.timeout=h,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(r=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,r)}get delay(){return this.timeout}set delay(r){this.timeout=r}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner&&this.runner()}}e.RunOnceScheduler=Q;class J{constructor(r,h){h%1e3!=0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${h}ms is not a multiple of 1000ms.`),this.runner=r,this.timeout=h,this.counter=0,this.intervalToken=-1,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=-1)}schedule(r=this.timeout){r%1e3!=0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${r}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(r/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==-1}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=-1,this.runner&&this.runner())}}e.ProcessTimeRunOnceScheduler=J;class X extends Q{constructor(r,h){super(r,h);this.units=[]}work(r){this.units.push(r),this.isScheduled()||this.schedule()}doRun(){const r=this.units;this.units=[],this.runner&&this.runner(r)}dispose(){this.units=[],super.dispose()}}e.RunOnceWorker=X;class p extends L.Disposable{constructor(r,h){super();this.options=r,this.handler=h,this.pendingWork=[],this.throttler=this._register(new L.MutableDisposable),this.disposed=!1}get pending(){return this.pendingWork.length}work(r){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+r.length>this.options.maxBufferedWork)return!1}else if(this.pending+r.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}return this.pendingWork.push(...r),this.throttler.value||this.doWork(),!0}doWork(){this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&(this.throttler.value=new Q(()=>{this.throttler.clear(),this.doWork()},this.options.throttleDelay),this.throttler.value.schedule())}dispose(){super.dispose(),this.disposed=!0}}e.ThrottledWorker=p,function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?e.runWhenIdle=_=>{(0,S.setTimeout0)(()=>{if(r)return;const h=Date.now()+15;_(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,h-Date.now())}}))});let r=!1;return{dispose(){r||(r=!0)}}}:e.runWhenIdle=(_,r)=>{const h=requestIdleCallback(_,typeof r=="number"?{timeout:r}:void 0);let C=!1;return{dispose(){C||(C=!0,cancelIdleCallback(h))}}}}();class x{constructor(r){this._didRun=!1,this._executor=()=>{try{this._value=r()}catch(h){this._error=h}finally{this._didRun=!0}},this._handle=(0,e.runWhenIdle)(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}e.IdleValue=x;async function ee(_,r,h){let C;for(let b=0;b<h;b++)try{return await _()}catch(D){C=D,await s(r)}throw C}e.retry=ee;class te{hasPending(r){return this._pending?typeof r=="number"?this._pending.taskId===r:!!this._pending:!1}get pending(){return this._pending?this._pending.promise:void 0}cancelPending(){this._pending?.cancel()}setPending(r,h,C){return this._pending={taskId:r,cancel:()=>C?.(),promise:h},h.then(()=>this.donePending(r),()=>this.donePending(r)),h}donePending(r){this._pending&&r===this._pending.taskId&&(this._pending=void 0,this.triggerNext())}triggerNext(){if(this._next){const r=this._next;this._next=void 0,r.run().then(r.promiseResolve,r.promiseReject)}}setNext(r){if(this._next)this._next.run=r;else{let h,C;const b=new Promise((D,M)=>{h=D,C=M});this._next={run:r,promise:b,promiseResolve:h,promiseReject:C}}return this._next.promise}}e.TaskSequentializer=te;class ie{constructor(r,h=()=>Date.now()){this.interval=r,this.nowFn=h,this.lastIncrementTime=0,this.value=0}increment(){const r=this.nowFn();return r-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=r,this.value=0),this.value++,this.value}}e.IntervalCounter=ie;class Z{constructor(){this.rejected=!1,this.resolved=!1,this.p=new Promise((r,h)=>{this.completeCallback=r,this.errorCallback=h})}get isRejected(){return this.rejected}get isResolved(){return this.resolved}get isSettled(){return this.rejected||this.resolved}complete(r){return new Promise(h=>{this.completeCallback(r),this.resolved=!0,h()})}error(r){return new Promise(h=>{this.errorCallback(r),this.rejected=!0,h()})}cancel(){new Promise(r=>{this.errorCallback(new I.CancellationError),this.rejected=!0,r()})}}e.DeferredPromise=Z;var ne;(function(_){async function r(C){let b;const D=await Promise.all(C.map(M=>M.then(z=>z,z=>{b||(b=z)})));if(typeof b!="undefined")throw b;return D}_.settled=r;function h(C){return new Promise(async(b,D)=>{try{await C(b,D)}catch(M){D(M)}})}_.withAsyncBody=h})(ne=e.Promises||(e.Promises={}));var Y;(function(_){_[_.Initial=0]="Initial",_[_.DoneOK=1]="DoneOK",_[_.DoneError=2]="DoneError"})(Y||(Y={}));class H{constructor(r){this._state=0,this._results=[],this._error=null,this._onStateChanged=new q.Emitter,queueMicrotask(async()=>{const h={emitOne:C=>this.emitOne(C),emitMany:C=>this.emitMany(C),reject:C=>this.reject(C)};try{await Promise.resolve(r(h)),this.resolve()}catch(C){this.reject(C)}finally{h.emitOne=void 0,h.emitMany=void 0,h.reject=void 0}})}static fromArray(r){return new H(h=>{h.emitMany(r)})}static fromPromise(r){return new H(async h=>{h.emitMany(await r)})}static fromPromises(r){return new H(async h=>{await Promise.all(r.map(async C=>h.emitOne(await C)))})}static merge(r){return new H(async h=>{await Promise.all(r.map(async C=>{for await(const b of C)h.emitOne(b)}))})}[Symbol.asyncIterator](){let r=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(r<this._results.length)return{done:!1,value:this._results[r++]};if(this._state===1)return{done:!0,value:void 0};await q.Event.toPromise(this._onStateChanged.event)}while(!0)}}}static map(r,h){return new H(async C=>{for await(const b of r)C.emitOne(h(b))})}map(r){return H.map(this,r)}static filter(r,h){return new H(async C=>{for await(const b of r)h(b)&&C.emitOne(b)})}filter(r){return H.filter(this,r)}static coalesce(r){return H.filter(r,h=>!!h)}coalesce(){return H.coalesce(this)}static async toPromise(r){const h=[];for await(const C of r)h.push(C);return h}toPromise(){return H.toPromise(this)}emitOne(r){this._state===0&&(this._results.push(r),this._onStateChanged.fire())}emitMany(r){this._state===0&&(this._results=this._results.concat(r),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(r){this._state===0&&(this._state=2,this._error=r,this._onStateChanged.fire())}}e.AsyncIterableObject=H,H.EMPTY=H.fromArray([]);class G extends H{constructor(r,h){super(h);this._source=r}cancel(){this._source.cancel()}}e.CancelableAsyncIterableObject=G;function re(_){const r=new y.CancellationTokenSource,h=_(r.token);return new G(r,async C=>{const b=r.token.onCancellationRequested(()=>{b.dispose(),r.dispose(),C.reject(new I.CancellationError)});try{for await(const D of h){if(r.token.isCancellationRequested)return;C.emitOne(D)}b.dispose(),r.dispose()}catch(D){b.dispose(),r.dispose(),C.reject(D)}})}e.createCancelableAsyncIterable=re}),define(B[17],K([0,1,18,19,12,13,14,15,6,10,2,4,20]),function(j,e,y,I,q,L,U,S,T,O,E,$,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ExtensionHostStarter=void 0;class k extends S.Disposable{constructor(m,A){super();this.id=m,this._host=A,this._onStdout=this._register(new U.Emitter),this.onStdout=this._onStdout.event,this._onStderr=this._register(new U.Emitter),this.onStderr=this._onStderr.event,this._onMessage=this._register(new U.Emitter),this.onMessage=this._onMessage.event,this._onError=this._register(new U.Emitter),this.onError=this._onError.event,this._onExit=this._register(new U.Emitter),this.onExit=this._onExit.event,this._process=null,this._hasExited=!1}start(m){E.isCI&&this._host.logInfo("Calling fork to start extension host...");const A=F.StopWatch.create(!1);this._process=(0,y.fork)(T.FileAccess.asFileUri("bootstrap-fork",j).fsPath,["--type=extensionHost","--skipWorkspaceStorageLock"],(0,O.mixin)({cwd:(0,$.cwd)()},m));const i=A.elapsed(),n=this._process.pid;this._host.logInfo(`Starting extension host with pid ${n} (fork() took ${i} ms).`);const c=new I.StringDecoder("utf-8");this._process.stdout?.on("data",f=>{const s=typeof f=="string"?f:c.write(f);this._onStdout.fire(s)});const g=new I.StringDecoder("utf-8");return this._process.stderr?.on("data",f=>{const s=typeof f=="string"?f:g.write(f);this._onStderr.fire(s)}),this._process.on("message",f=>{this._onMessage.fire(f)}),this._process.on("error",f=>{this._onError.fire({error:(0,L.transformErrorForSerialization)(f)})}),this._process.on("exit",(f,s)=>{this._hasExited=!0,this._onExit.fire({pid:n,code:f,signal:s})}),{pid:n}}enableInspectPort(){return this._process?(this._host.logInfo(`Enabling inspect port on extension host with pid ${this._process.pid}.`),typeof process._debugProcess=="function"?(process._debugProcess(this._process.pid),!0):E.isWindows?!1:(this._process.kill("SIGUSR1"),!0)):!1}kill(){!this._process||(this._host.logInfo(`Killing extension host with pid ${this._process.pid}.`),this._process.kill())}async waitForExit(m){if(!this._process)return;const A=this._process.pid;this._host.logInfo(`Waiting for extension host with pid ${A} to exit.`),await Promise.race([U.Event.toPromise(this.onExit),(0,q.timeout)(m)]),this._hasExited||(this._host.logInfo(`Extension host with pid ${A} did not exit within ${m}ms.`),this._process.kill())}}class a{constructor(m){this._host=m,this._extHosts=new Map}dispose(){}_getExtHost(m){const A=this._extHosts.get(m);if(!A)throw new Error("Unknown extension host!");return A}onDynamicStdout(m){return this._getExtHost(m).onStdout}onDynamicStderr(m){return this._getExtHost(m).onStderr}onDynamicMessage(m){return this._getExtHost(m).onMessage}onDynamicError(m){return this._getExtHost(m).onError}onDynamicExit(m){return this._getExtHost(m).onExit}async createExtensionHost(){const m=String(++a._lastId),A=new k(m,this._host);return this._extHosts.set(m,A),A.onExit(({pid:i,code:n,signal:c})=>{this._host.logInfo(`Extension host with pid ${i} exited with code: ${n}, signal: ${c}.`),setTimeout(()=>{A.dispose(),this._extHosts.delete(m)})}),{id:m}}async start(m,A){return this._getExtHost(m).start(A)}async enableInspectPort(m){const A=this._extHosts.get(m);return A?A.enableInspectPort():!1}async kill(m){const A=this._extHosts.get(m);!A||A.kill()}async killAllNow(){for(const[,m]of this._extHosts)m.kill()}async waitForAllExit(m){const A=[];for(const[,i]of this._extHosts)A.push(i.waitForExit(m));return q.Promises.settled(A).then(()=>{})}}e.ExtensionHostStarter=a,a._lastId=0;function u(d){return new a(d)}e.create=u})}).call(this);

//# sourceMappingURL=extensionHostStarterWorker.js.map