/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
(function(){
var e=["exports","require","vs/base/common/path","vs/platform/instantiation/common/instantiation","vs/base/node/pfs","vs/platform/log/common/log","vs/base/common/types","vs/base/common/lifecycle","vs/base/common/objects","vs/base/common/event","vs/nls!vs/code/node/cliProcessMain","vs/nls","vs/platform/registry/common/platform","vs/base/common/strings","vs/platform/configuration/common/configuration","fs","vs/platform/environment/common/environment","vs/base/common/platform","vs/platform/configuration/common/configurationRegistry","vs/base/common/errors","vs/base/common/uri","vs/platform/extensionManagement/common/extensionManagementUtil","vs/platform/product/node/package","vs/base/common/network","vs/platform/extensionManagement/common/extensionManagement","vs/base/common/async","vs/platform/product/node/product","vs/platform/extensions/common/extensions","vs/base/common/arrays","os","vs/platform/telemetry/common/telemetry","vs/platform/extensions/node/extensionValidator","vs/base/common/errorMessage","vs/platform/instantiation/common/descriptors","vs/base/common/cancellation","vs/base/common/amd","vs/platform/instantiation/common/serviceCollection","vs/base/node/request","vs/platform/configuration/common/configurationModels","vs/platform/request/node/request","vs/base/common/json","vs/base/common/uuid","vs/base/node/zip","vs/platform/extensionManagement/node/extensionManagementUtil","vs/base/node/proxy","url","vs/base/common/date","vs/base/node/watcher","vs/platform/extensionManagement/node/extensionsManifestCache","vs/base/common/collections","vs/platform/instantiation/common/graph","vs/platform/download/common/download","vs/platform/request/node/requestService","vs/base/node/config","vs/base/node/paths","vs/base/common/labels","vs/platform/instantiation/common/instantiationService","vs/nls!vs/base/common/errorMessage","vs/platform/localizations/common/localizations","vs/base/node/extpath","vs/platform/log/node/spdlogService","vs/base/common/decorators","vs/base/common/assert","vs/platform/environment/node/environmentService","crypto","vs/platform/extensionManagement/node/extensionGalleryService","vs/nls!vs/base/node/zip","vs/platform/localizations/node/localizations","vs/nls!vs/platform/configuration/common/configurationRegistry","vs/platform/jsonschemas/common/jsonContributionRegistry","vs/nls!vs/platform/extensionManagement/common/extensionManagement","vs/nls!vs/platform/extensionManagement/node/extensionManagementService","vs/nls!vs/platform/extensionManagement/node/extensionManagementUtil","vs/base/common/map","vs/platform/configuration/node/configuration","vs/platform/configuration/node/configurationService","vs/nls!vs/platform/extensions/node/extensionValidator","vs/platform/state/common/state","vs/platform/state/node/stateService","vs/nls!vs/platform/request/node/request","vs/platform/telemetry/common/telemetryService","vs/platform/telemetry/common/telemetryUtils","vs/platform/telemetry/node/appInsightsAppender","semver","vs/platform/telemetry/node/commonProperties","vs/nls!vs/platform/telemetry/common/telemetryService","vs/platform/extensionManagement/common/extensionNls","vs/platform/extensionManagement/node/extensionManagementService","vs/platform/extensionManagement/node/extensionLifecycle","yazl","yauzl","applicationinsights","child_process","vs/base/common/normalization","zlib","util","vs/base/common/resources","vs/code/node/cliProcessMain"],t=function(t){
for(var n=[],i=0,r=t.length;i<r;i++)n[i]=e[t[i]];return n};define(e[62],t([1,0]),function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ok=function(e,t){if(!e)throw new Error(t?"Assertion failed ("+t+")":"Assertion Failed")}}),define(e[49],t([1,0]),function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=Object.prototype.hasOwnProperty;t.values=function(e){const t=[];for(let i in e)n.call(e,i)&&t.push(e[i]);return t},t.size=function(e){let t=0;for(let i in e)n.call(e,i)&&(t+=1);return t},t.first=function(e){for(let t in e)if(n.call(e,t))return e[t]},t.forEach=function(e,t){for(let i in e)if(n.call(e,i)&&!1===t({key:i,value:e[i]},function(){delete e[i]}))return},t.groupBy=function(e,t){const n=Object.create(null);for(const i of e){const e=t(i);let r=n[e];r||(r=n[e]=[]),r.push(i)}return n},t.fromMap=function(e){const t=Object.create(null);return e&&e.forEach((e,n)=>{t[n]=e}),t}}),define(e[61],t([1,0]),function(e,t){"use strict";function n(e){return(t,n,i)=>{
let r=null,s=null;if("function"==typeof i.value?(r="value",s=i.value):"function"==typeof i.get&&(r="get",s=i.get),!s)throw new Error("not supported");i[r]=e(s,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=n,t.memoize=function(e,t,n){let i=null,r=null;if("function"==typeof n.value?(i="value",0!==(r=n.value).length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof n.get&&(i="get",r=n.get),!r)throw new Error("not supported");const s=`$memoize$${t}`;n[i]=function(...e){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,e)}),this[s]}},t.debounce=function(e,t,i){return n((n,r)=>{const s=`$debounce$${r}`,o=`$debounce$result$${r}`;return function(...r){this[o]||(this[o]=i?i():void 0),clearTimeout(this[s]),t&&(this[o]=t(this[o],...r),r=[this[o]]),this[s]=setTimeout(()=>{n.apply(this,r),this[o]=i?i():void 0},e)}})}}),define(e[40],t([1,0]),function(e,t){"use strict"
;function n(e,t=!1){function n(t){let n=0,i=0;for(;n<t;){const t=e.charCodeAt(a);if(t>=48&&t<=57)i=16*i+t-48;else if(t>=65&&t<=70)i=16*i+t-65+10;else{if(!(t>=97&&t<=102))break;i=16*i+t-97+10}a++,n++}return n<t&&(i=-1),i}function o(){if(c="",h=0,u=a,a>=l)return u=l,d=17;let t=e.charCodeAt(a);if(i(t)){do{a++,c+=String.fromCharCode(t),t=e.charCodeAt(a)}while(i(t));return d=15}if(r(t))return a++,c+=String.fromCharCode(t),13===t&&10===e.charCodeAt(a)&&(a++,c+="\n"),d=14;switch(t){case 123:return a++,d=1;case 125:return a++,d=2;case 91:return a++,d=3;case 93:return a++,d=4;case 58:return a++,d=6;case 44:return a++,d=5;case 34:return a++,c=function(){let t="",i=a;for(;;){if(a>=l){t+=e.substring(i,a),h=2;break}let s=e.charCodeAt(a);if(34===s){t+=e.substring(i,a),a++;break}if(92!==s){if(s>=0&&s<=31){if(r(s)){t+=e.substring(i,a),h=2;break}h=6}a++}else{if(t+=e.substring(i,a),++a>=l){h=2;break}switch(i=e.charCodeAt(a++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:
t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:const i=n(4);i>=0?t+=String.fromCharCode(i):h=4;break;default:h=5}i=a}}return t}(),d=10;case 47:const o=a-1;if(47===e.charCodeAt(a+1)){for(a+=2;a<l&&!r(e.charCodeAt(a));)a++;return c=e.substring(o,a),d=12}if(42===e.charCodeAt(a+1)){a+=2;const t=l-1;let n=!1;for(;a<t;){if(42===e.charCodeAt(a)&&47===e.charCodeAt(a+1)){a+=2,n=!0;break}a++}return n||(a++,h=1),c=e.substring(o,a),d=13}return c+=String.fromCharCode(t),a++,d=16;case 45:if(c+=String.fromCharCode(t),++a===l||!s(e.charCodeAt(a)))return d=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return c+=function(){const t=a;if(48===e.charCodeAt(a))a++;else for(a++;a<e.length&&s(e.charCodeAt(a));)a++;if(a<e.length&&46===e.charCodeAt(a)){if(!(++a<e.length&&s(e.charCodeAt(a))))return h=3,e.substring(t,a);for(a++;a<e.length&&s(e.charCodeAt(a));)a++}let n=a
;if(a<e.length&&(69===e.charCodeAt(a)||101===e.charCodeAt(a)))if((++a<e.length&&43===e.charCodeAt(a)||45===e.charCodeAt(a))&&a++,a<e.length&&s(e.charCodeAt(a))){for(a++;a<e.length&&s(e.charCodeAt(a));)a++;n=a}else h=3;return e.substring(t,n)}(),d=11;default:for(;a<l&&function(e){if(i(e)||r(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}(t);)a++,t=e.charCodeAt(a);if(u!==a){switch(c=e.substring(u,a)){case"true":return d=8;case"false":return d=9;case"null":return d=7}return d=16}return c+=String.fromCharCode(t),a++,d=16}}let a=0,l=e.length,c="",u=0,d=16,h=0;return{setPosition:function(e){a=e,c="",u=0,d=16,h=0},getPosition:()=>a,scan:t?function(){let e;do{e=o()}while(e>=12&&e<=15);return e}:o,getToken:()=>d,getTokenValue:()=>c,getTokenOffset:()=>u,getTokenLength:()=>a-u,getTokenError:()=>h}}function i(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function r(e){
return 10===e||13===e||8232===e||8233===e}function s(e){return e>=48&&e<=57}function o(e){if(!e.parent||!e.parent.children)return[];const t=o(e.parent);if("property"===e.parent.type){const n=e.parent.children[0].value;t.push(n)}else if("array"===e.parent.type){const n=e.parent.children.indexOf(e);-1!==n&&t.push(n)}return t}function a(e){switch(e.type){case"array":return e.children.map(a);case"object":const t=Object.create(null);for(let n of e.children){const e=n.children[1];e&&(t[n.children[0].value]=a(e))}return t;case"null":case"string":case"number":case"boolean":return e.value;default:return}}function l(e,t,n=!1){return t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}function c(e,t,n=!1){if(l(e,t,n)){const i=e.children;if(Array.isArray(i))for(let e=0;e<i.length&&i[e].offset<=t;e++){const r=c(i[e],t,n);if(r)return r}return e}}function u(e,t,i=h.DEFAULT){function r(e){return e?()=>e(d.getTokenOffset(),d.getTokenLength()):()=>!0}function s(e){
return e?t=>e(t,d.getTokenOffset(),d.getTokenLength()):()=>!0}function o(){for(;;){const e=d.scan();switch(d.getTokenError()){case 4:a(14);break;case 5:a(15);break;case 3:a(13);break;case 1:x||a(11);break;case 2:a(12);break;case 6:a(16)}switch(e){case 12:case 13:x?a(10):E();break;case 16:a(1);break;case 15:case 14:break;default:return e}}}function a(e,t=[],n=[]){if(C(e),t.length+n.length>0){let e=d.getToken();for(;17!==e;){if(-1!==t.indexOf(e)){o();break}if(-1!==n.indexOf(e))break;e=o()}}}function l(e){const t=d.getTokenValue();return e?y(t):g(t),o(),!0}function c(){return 10!==d.getToken()?(a(3,[],[2,5]),!1):(l(!1),6===d.getToken()?(S(":"),o(),u()||a(4,[],[2,5])):a(5,[],[2,5]),!0)}function u(){switch(d.getToken()){case 3:return function(){m(),o();let e=!1;for(;4!==d.getToken()&&17!==d.getToken();){if(5===d.getToken()){if(e||a(4,[],[]),S(","),o(),4===d.getToken()&&b)break}else e&&a(6,[],[]);u()||a(4,[],[4,5]),e=!0}return v(),4!==d.getToken()?a(8,[4],[]):o(),!0}();case 1:return function(){f(),o();let e=!1
;for(;2!==d.getToken()&&17!==d.getToken();){if(5===d.getToken()){if(e||a(4,[],[]),S(","),o(),2===d.getToken()&&b)break}else e&&a(6,[],[]);c()||a(4,[],[2,5]),e=!0}return p(),2!==d.getToken()?a(7,[2],[]):o(),!0}();case 10:return l(!0);default:return function(){switch(d.getToken()){case 11:let e=0;try{"number"!=typeof(e=JSON.parse(d.getTokenValue()))&&(a(2),e=0)}catch(e){a(2)}y(e);break;case 7:y(null);break;case 8:y(!0);break;case 9:y(!1);break;default:return!1}return o(),!0}()}}const d=n(e,!1),f=r(t.onObjectBegin),g=s(t.onObjectProperty),p=r(t.onObjectEnd),m=r(t.onArrayBegin),v=r(t.onArrayEnd),y=s(t.onLiteralValue),S=s(t.onSeparator),E=r(t.onComment),C=s(t.onError),x=i&&i.disallowComments,b=i&&i.allowTrailingComma;return o(),17===d.getToken()||(u()?(17!==d.getToken()&&a(9,[],[]),!0):(a(4,[],[]),!1))}function d(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";default:return"null"}}Object.defineProperty(t,"__esModule",{value:!0});!function(e){
e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"}(t.ScanError||(t.ScanError={}));!function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"}(t.SyntaxKind||(t.SyntaxKind={}));!function(e){
e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"}(t.ParseErrorCode||(t.ParseErrorCode={}));var h;!function(e){e.DEFAULT={allowTrailingComma:!0}}(h=t.ParseOptions||(t.ParseOptions={})),t.createScanner=n;var f;!function(e){e[e.nullCharacter=0]="nullCharacter",e[e.maxAsciiCharacter=127]="maxAsciiCharacter",
e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.lineSeparator=8232]="lineSeparator",e[e.paragraphSeparator=8233]="paragraphSeparator",e[e.nextLine=133]="nextLine",e[e.space=32]="space",e[e.nonBreakingSpace=160]="nonBreakingSpace",e[e.enQuad=8192]="enQuad",e[e.emQuad=8193]="emQuad",e[e.enSpace=8194]="enSpace",e[e.emSpace=8195]="emSpace",e[e.threePerEmSpace=8196]="threePerEmSpace",e[e.fourPerEmSpace=8197]="fourPerEmSpace",e[e.sixPerEmSpace=8198]="sixPerEmSpace",e[e.figureSpace=8199]="figureSpace",e[e.punctuationSpace=8200]="punctuationSpace",e[e.thinSpace=8201]="thinSpace",e[e.hairSpace=8202]="hairSpace",e[e.zeroWidthSpace=8203]="zeroWidthSpace",e[e.narrowNoBreakSpace=8239]="narrowNoBreakSpace",e[e.ideographicSpace=12288]="ideographicSpace",e[e.mathematicalSpace=8287]="mathematicalSpace",e[e.ogham=5760]="ogham",e[e._=95]="_",e[e.$=36]="$",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",
e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.ampersand=38]="ampersand",e[e.asterisk=42]="asterisk",e[e.at=64]="at",e[e.backslash=92]="backslash",e[e.bar=124]="bar",e[e.caret=94]="caret",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.closeParen=41]="closeParen",
e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.equals=61]="equals",e[e.exclamation=33]="exclamation",e[e.greaterThan=62]="greaterThan",e[e.lessThan=60]="lessThan",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.openParen=40]="openParen",e[e.percent=37]="percent",e[e.plus=43]="plus",e[e.question=63]="question",e[e.semicolon=59]="semicolon",e[e.singleQuote=39]="singleQuote",e[e.slash=47]="slash",e[e.tilde=126]="tilde",e[e.backspace=8]="backspace",e[e.formFeed=12]="formFeed",e[e.byteOrderMark=65279]="byteOrderMark",e[e.tab=9]="tab",e[e.verticalTab=11]="verticalTab"}(f||(f={})),t.getLocation=function(e,t){function n(e,t,n,i){o.value=e,o.offset=t,o.length=n,o.type=i,o.colonOffset=void 0,s=o}const i=[],r=new Object;let s=void 0;const o={value:{},offset:0,length:0,type:"object",parent:void 0};let a=!1;try{u(e,{onObjectBegin:(e,n)=>{if(t<=e)throw r;s=void 0,a=t>e,i.push("")},onObjectProperty:(e,s,o)=>{if(t<s)throw r
;if(n(e,s,o,"property"),i[i.length-1]=e,t<=s+o)throw r},onObjectEnd:(e,n)=>{if(t<=e)throw r;s=void 0,i.pop()},onArrayBegin:(e,n)=>{if(t<=e)throw r;s=void 0,i.push(0)},onArrayEnd:(e,n)=>{if(t<=e)throw r;s=void 0,i.pop()},onLiteralValue:(e,i,s)=>{if(t<i)throw r;if(n(e,i,s,d(e)),t<=i+s)throw r},onSeparator:(e,n,o)=>{if(t<=n)throw r;if(":"===e&&s&&"property"===s.type)s.colonOffset=n,a=!1,s=void 0;else if(","===e){const e=i[i.length-1];"number"==typeof e?i[i.length-1]=e+1:(a=!0,i[i.length-1]=""),s=void 0}}})}catch(e){if(e!==r)throw e}return{path:i,previousNode:s,isAtPropertyKey:a,matches:e=>{let t=0;for(let n=0;t<e.length&&n<i.length;n++)if(e[t]===i[n]||"*"===e[t])t++;else if("**"!==e[t])return!1;return t===e.length}}},t.parse=function(e,t=[],n=h.DEFAULT){function i(e){Array.isArray(s)?s.push(e):r&&(s[r]=e)}let r=null,s=[];const o=[];return u(e,{onObjectBegin:()=>{const e={};i(e),o.push(s),s=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{s=o.pop()},onArrayBegin:()=>{const e=[];i(e),o.push(s),s=e,r=null},
onArrayEnd:()=>{s=o.pop()},onLiteralValue:i,onError:(e,n,i)=>{t.push({error:e,offset:n,length:i})}},n),s[0]},t.parseTree=function(e,t=[],n=h.DEFAULT){function i(e){"property"===s.type&&(s.length=e-s.offset,s=s.parent)}function r(e){return s.children.push(e),e}let s={type:"array",offset:-1,length:-1,children:[],parent:void 0};u(e,{onObjectBegin:e=>{s=r({type:"object",offset:e,length:-1,parent:s,children:[]})},onObjectProperty:(e,t,n)=>{(s=r({type:"property",offset:t,length:-1,parent:s,children:[]})).children.push({type:"string",value:e,offset:t,length:n,parent:s})},onObjectEnd:(e,t)=>{s.length=e+t-s.offset,s=s.parent,i(e+t)},onArrayBegin:(e,t)=>{s=r({type:"array",offset:e,length:-1,parent:s,children:[]})},onArrayEnd:(e,t)=>{s.length=e+t-s.offset,s=s.parent,i(e+t)},onLiteralValue:(e,t,n)=>{r({type:d(e),offset:t,length:n,parent:s,value:e}),i(t+n)},onSeparator:(e,t,n)=>{"property"===s.type&&(":"===e?s.colonOffset=t:","===e&&i(t))},onError:(e,n,i)=>{t.push({error:e,offset:n,length:i})}},n);const o=s.children[0]
;return o&&delete o.parent,o},t.findNodeAtLocation=function(e,t){if(!e)return;let n=e;for(let e of t)if("string"==typeof e){if("object"!==n.type||!Array.isArray(n.children))return;let t=!1;for(const i of n.children)if(Array.isArray(i.children)&&i.children[0].value===e){n=i.children[1],t=!0;break}if(!t)return}else{const t=e;if("array"!==n.type||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n},t.getNodePath=o,t.getNodeValue=a,t.contains=l,t.findNodeAtOffset=c,t.visit=u,t.stripComments=function(e,t){let i,r,s=n(e),o=[],a=0;do{switch(r=s.getPosition(),i=s.scan()){case 12:case 13:case 17:a!==r&&o.push(e.substring(a,r)),void 0!==t&&o.push(s.getTokenValue().replace(/[^\r\n]/g,t)),a=s.getPosition()}}while(17!==i);return o.join("")}}),define(e[46],t([1,0,13]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toLocalISOString=function(e){
return e.getFullYear()+"-"+n.pad(e.getMonth()+1,2)+"-"+n.pad(e.getDate(),2)+"T"+n.pad(e.getHours(),2)+":"+n.pad(e.getMinutes(),2)+":"+n.pad(e.getSeconds(),2)+"."+(e.getMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}}),define(e[55],t([1,0,20,2,13,23,17,96]),function(e,t,n,i,r,s,o,a){"use strict";function l(e){return!(!o.isWindows||!e||":"!==e[1])}function c(e){return l(e)?e.charAt(0).toUpperCase()+e.slice(1):e}function u(e,t){if(o.isWindows||!e||!t)return e;let n=d.original===t?d.normalized:void 0;return n||(n=`${r.rtrim(t,i.posix.sep)}${i.posix.sep}`,d={original:t,normalized:n}),(o.isLinux?r.startsWith(e,n):r.startsWithIgnoreCase(e,n))&&(e=`~/${e.substr(n.length)}`),e}Object.defineProperty(t,"__esModule",{value:!0}),t.getPathLabel=function(e,t,r){if("string"==typeof e&&(e=n.URI.file(e)),r){const t=r.getWorkspaceFolder(e);if(t){const n=r.getWorkspace().folders.length>1;let i;if(i=a.isEqual(t.uri,e)?"":a.relativePath(t.uri,e),n){const e=t&&t.name?t.name:a.basename(t.uri);i=i?e+" • "+i:e}return i}}
if(e.scheme!==s.Schemas.file&&e.scheme!==s.Schemas.untitled)return e.with({query:null,fragment:null}).toString(!0);if(l(e.fsPath))return i.normalize(c(e.fsPath));let d=i.normalize(e.fsPath);return!o.isWindows&&t&&(d=u(d,t.userHome)),d},t.getBaseLabel=function(e){if(!e)return;"string"==typeof e&&(e=n.URI.file(e));const t=a.basename(e)||(e.scheme===s.Schemas.file?e.fsPath:e.path);return l(t)?c(t):t},t.normalizeDriveLetter=c;let d=Object.create(null);t.tildify=u,t.untildify=function(e,t){return e.replace(/^~($|\/|\\)/,`${t}$1`)};const h="…",f="\\\\",g="~";t.shorten=function(e){const t=new Array(e.length);let n=!1;for(let s=0;s<e.length;s++){let o=e[s];if(""===o){t[s]=`.${i.sep}`;continue}if(!o){t[s]=o;continue}n=!0;let a="";0===o.indexOf(f)?(a=o.substr(0,o.indexOf(f)+f.length),o=o.substr(o.indexOf(f)+f.length)):0===o.indexOf(i.sep)?(a=o.substr(0,o.indexOf(i.sep)+i.sep.length),o=o.substr(o.indexOf(i.sep)+i.sep.length)):0===o.indexOf(g)&&(a=o.substr(0,o.indexOf(g)+g.length),o=o.substr(o.indexOf(g)+g.length))
;const l=o.split(i.sep);for(let o=1;n&&o<=l.length;o++)for(let c=l.length-o;n&&c>=0;c--){n=!1;let u=l.slice(c,c+o).join(i.sep);for(let t=0;!n&&t<e.length;t++)if(t!==s&&e[t]&&e[t].indexOf(u)>-1){const s=c+o===l.length,a=c>0&&e[t].indexOf(i.sep)>-1?i.sep+u:u,d=r.endsWith(e[t],a);n=!s||d}if(!n){let e="";(r.endsWith(l[0],":")||""!==a)&&(1===c&&(c=0,o++,u=l[0]+i.sep+u),c>0&&(e=l[0]+i.sep),e=a+e),c>0&&(e=e+h+i.sep),e+=u,c+o<l.length&&(e=e+i.sep+h),t[s]=e}}n&&(t[s]=o)}return t};var p;!function(e){e[e.TEXT=0]="TEXT",e[e.VARIABLE=1]="VARIABLE",e[e.SEPARATOR=2]="SEPARATOR"}(p||(p={})),t.template=function(e,t=Object.create(null)){const n=[];let i=!1,r="";for(const s of e)if("$"===s||i&&"{"===s)r&&n.push({value:r,type:p.TEXT}),r="",i=!0;else if("}"===s&&i){const e=t[r];if("string"==typeof e)e.length&&n.push({value:e,type:p.VARIABLE});else if(e){const t=n[n.length-1];t&&t.type===p.SEPARATOR||n.push({value:e.label,type:p.SEPARATOR})}r="",i=!1}else r+=s;return r&&!i&&n.push({value:r,type:p.TEXT}),
n.filter((e,t)=>e.type!==p.SEPARATOR||[n[t-1],n[t+1]].every(e=>e&&(e.type===p.VARIABLE||e.type===p.TEXT)&&e.value.length>0)).map(e=>e.value).join("")},t.mnemonicMenuLabel=function(e,t){return o.isMacintosh||t?e.replace(/\(&&\w\)|&&/g,"").replace(/&/g,o.isMacintosh?"&":"&&"):e.replace(/&&|&/g,e=>"&"===e?"&&":"&")},t.mnemonicButtonLabel=function(e,t){return o.isMacintosh||t?e.replace(/\(&&\w\)|&&/g,""):o.isWindows?e.replace(/&&|&/g,e=>"&"===e?"&&":"&"):e.replace(/&&/g,"_")},t.unmnemonicLabel=function(e){return e.replace(/&/g,"&&")},t.splitName=function(e){for(let t=e.length-1;t>=1;t--){const n=e.charCodeAt(t);if(47===n||92===n)return{parentPath:e.substr(0,t),name:e.substr(t+1)}}return{parentPath:"",name:e}}}),define(e[54],t([1,0,35]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n.getPathFromAmdModule(e,"paths"),r=e.__$__nodeRequire(i);t.getAppDataPath=r.getAppDataPath,t.getDefaultUserDataPath=r.getDefaultUserDataPath});var n=this&&this.__awaiter||function(e,t,n,i){
return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})};define(e[59],t([1,0,15,13,2,4,95]),function(e,t,i,r,s,o,a){"use strict";function l(e){const t=s.dirname(e);if(e===t)return e;const n=(s.basename(e)||e).toLowerCase();try{const e=o.readdirSync(t).filter(e=>e.toLowerCase()===n);if(1===e.length){const n=l(t);if(n)return s.join(n,e[0])}else if(e.length>1){const i=e.indexOf(n);if(i>=0){const n=l(t);if(n)return s.join(n,e[i])}}}catch(e){}return null}function c(e){return r.rtrim(s.normalize(e),s.sep)}Object.defineProperty(t,"__esModule",{value:!0}),t.realcaseSync=l,t.realpath=function(e){return n(this,void 0,void 0,function*(){try{return yield a.promisify(i.realpath)(e)}catch(t){const n=c(e);return yield a.promisify(i.access)(n,i.constants.R_OK),n}})},t.realpathSync=function(e){try{return i.realpathSync(e)}catch(t){const n=c(e)
;return i.accessSync(n,i.constants.R_OK),n}}}),define(e[44],t([1,0,45,6]),function(e,t,i,r){"use strict";function s(t,s={}){return n(this,void 0,void 0,function*(){const n=i.parse(t),o=s.proxyUrl||function(e){return"http:"===e.protocol?process.env.HTTP_PROXY||process.env.http_proxy||null:"https:"===e.protocol?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||null:null}(n);if(!o)return null;const a=i.parse(o);if(!/^https?:$/.test(a.protocol||""))return null;const l={host:a.hostname||"",port:Number(a.port),auth:a.auth,rejectUnauthorized:!r.isBoolean(s.strictSSL)||s.strictSSL};return new("http:"===n.protocol?yield new Promise((t,n)=>{e(["http-proxy-agent"],t,n)}):yield new Promise((t,n)=>{e(["https-proxy-agent"],t,n)}))(l)})}Object.defineProperty(t,"__esModule",{value:!0}),t.getProxyAgent=s}),define(e[47],t([1,0,2,15,17,93,7,4]),function(e,t,i,r,s,o,a,l){"use strict";function c(e,u,d){const h=i.basename(e.path),f=new Map;let g=!1,p=[a.toDisposable(()=>{
f.forEach(e=>a.dispose(e)),f.clear()})];try{const m=r.watch(e.path);p.push(a.toDisposable(()=>{m.removeAllListeners(),m.close()}));const v=new Set;e.isDirectory&&l.readdir(e.path).then(e=>e.forEach(e=>v.add(e))),m.on("error",(t,n)=>{g||d(`Failed to watch ${e.path} for changes using fs.watch() (${t}, ${n})`)}),m.on("change",(r,m)=>{if(g)return;let y="";if(m&&(y=m.toString(),s.isMacintosh&&(y=o.normalizeNFC(y))),!y||"change"!==r&&"rename"!==r)return;const S=e.isDirectory?i.join(e.path,y):e.path;if(e.isDirectory)if("rename"===r){const e=f.get(S);e&&a.dispose(e);const i=setTimeout(()=>n(this,void 0,void 0,function*(){f.delete(S);const e=yield l.exists(S);if(g)return;let t;e?v.has(y)?t="changed":(t="added",v.add(y)):(v.delete(y),t="deleted"),u(t,S)}),t.CHANGE_BUFFER_DELAY);f.set(S,a.toDisposable(()=>clearTimeout(i)))}else{let e;v.has(y)?e="changed":(e="added",v.add(y)),u(e,S)}else if("rename"===r||y!==h){const i=setTimeout(()=>n(this,void 0,void 0,function*(){const t=yield l.exists(S);g||(t?(u("changed",S),
p=[c(e,u,d)]):u("deleted",S))}),t.CHANGE_BUFFER_DELAY);a.dispose(p),p=[a.toDisposable(()=>clearTimeout(i))]}else u("changed",S)})}catch(t){l.exists(e.path).then(n=>{n&&!g&&d(`Failed to watch ${e.path} for changes using fs.watch() (${t.toString()})`)})}return a.toDisposable(()=>{g=!0,p=a.dispose(p)})}Object.defineProperty(t,"__esModule",{value:!0}),t.watchFile=function(e,t,n){return c({path:e,isDirectory:!1},t,n)},t.watchFolder=function(e,t,n){return c({path:e,isDirectory:!0},t,n)},t.CHANGE_BUFFER_DELAY=100}),define(e[53],t([1,0,15,2,8,7,9,40,4,59,47]),function(e,t,i,r,s,o,a,l,c,u,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class h{constructor(e,t={defaultConfig:Object.create(null),onError:e=>console.error(e)}){this._path=e,this.options=t,this.disposables=new o.DisposableStore,this._onDidUpdateConfiguration=new a.Emitter,this.disposables.add(this._onDidUpdateConfiguration),this.registerWatcher(),this.initAsync()}get path(){return this._path}get hasParseErrors(){
return this.parseErrors&&this.parseErrors.length>0}get onDidUpdateConfiguration(){return this._onDidUpdateConfiguration.event}initAsync(){this.loadAsync(e=>{this.loaded||this.updateCache(e),this.options.initCallback&&this.options.initCallback(this.getConfig())})}updateCache(e){this.cache=e,this.loaded=!0}loadSync(){try{return this.parse(i.readFileSync(this._path).toString())}catch(e){return this.options.defaultConfig}}loadAsync(e){i.readFile(this._path,(t,n)=>e(t?this.options.defaultConfig:this.parse(n.toString())))}parse(e){let t;try{return this.parseErrors=[],(t=this.options.parse?this.options.parse(e,this.parseErrors):l.parse(e,this.parseErrors))||this.options.defaultConfig}catch(e){return this.options.defaultConfig}}registerWatcher(){const e=r.dirname(this._path);this.watch(e,!0),this.handleSymbolicLink().then(void 0,e=>{})}handleSymbolicLink(){return n(this,void 0,void 0,function*(){const{stat:e,isSymbolicLink:t}=yield c.statLink(this._path);if(t&&!e.isDirectory()){const e=yield u.realpath(this._path)
;this.watch(e,!1)}})}watch(e,t){this.disposed||(t?this.disposables.add(d.watchFolder(e,(e,t)=>t===this._path?this.onConfigFileChange():void 0,e=>this.options.onError(e))):this.disposables.add(d.watchFile(e,(e,t)=>this.onConfigFileChange(),e=>this.options.onError(e))))}onConfigFileChange(){this.timeoutHandle&&(global.clearTimeout(this.timeoutHandle),this.timeoutHandle=null),this.timeoutHandle=global.setTimeout(()=>this.reload(),this.options.changeBufferDelay||0)}reload(e){this.loadAsync(t=>{if(s.equals(t,this.cache)||(this.updateCache(t),this._onDidUpdateConfiguration.fire({config:this.cache})),e)return e(t)})}getConfig(){return this.ensureLoaded(),this.cache}ensureLoaded(){this.loaded||this.updateCache(this.loadSync())}dispose(){this.disposed=!0,this.disposables.dispose()}}t.ConfigWatcher=h}),define(e[57],t([11,10]),function(e,t){return e.create("vs/base/common/errorMessage",t)}),define(e[32],t([1,0,57,6,28]),function(e,t,n,i,r){"use strict";function s(e,t){
return e.message?t&&(e.stack||e.stacktrace)?n.localize(0,null,o(e),e.stack||e.stacktrace):o(e):n.localize(1,null)}function o(e){return"string"==typeof e.code&&"number"==typeof e.errno&&"string"==typeof e.syscall?n.localize(2,null,e.message):e.message}function a(e=null,t=!1){if(!e)return n.localize(3,null);if(Array.isArray(e)){const i=r.coalesce(e),s=a(i[0],t);return i.length>1?n.localize(4,null,s,i.length):s}if(i.isString(e))return e;if(e.detail){const n=e.detail;if(n.error)return s(n.error,t);if(n.exception)return s(n.exception,t)}return e.stack?s(e,t):e.message?e.message:n.localize(5,null)}Object.defineProperty(t,"__esModule",{value:!0}),t.toErrorMessage=a}),define(e[66],t([11,10]),function(e,t){return e.create("vs/base/node/zip",t)}),define(e[68],t([11,10]),function(e,t){return e.create("vs/platform/configuration/common/configurationRegistry",t)}),define(e[70],t([11,10]),function(e,t){return e.create("vs/platform/extensionManagement/common/extensionManagement",t)}),define(e[71],t([11,10]),function(e,t){
return e.create("vs/platform/extensionManagement/node/extensionManagementService",t)}),define(e[72],t([11,10]),function(e,t){return e.create("vs/platform/extensionManagement/node/extensionManagementUtil",t)}),define(e[76],t([11,10]),function(e,t){return e.create("vs/platform/extensions/node/extensionValidator",t)}),define(e[79],t([11,10]),function(e,t){return e.create("vs/platform/request/node/request",t)}),define(e[85],t([11,10]),function(e,t){return e.create("vs/platform/telemetry/common/telemetryService",t)}),define(e[86],t([1,0,8]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=/^%([\w\d.-]+)%$/i;t.localizeManifest=function(e,t){return n.cloneAndChange(e,e=>{if("string"!=typeof e)return;const n=i.exec(e);return n?t[n[1]]||e:void 0})}}),define(e[88],t([1,0,7,92,32,2,25,9,23,4]),function(e,t,i,r,s,o,a,l,c,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class d extends i.Disposable{constructor(e,t){super(),this.environmentService=e,this.logService=t,
this.processesLimiter=new a.Limiter(5)}postUninstall(e){return n(this,void 0,void 0,function*(){const t=this.parseScript(e,"uninstall");return t&&(this.logService.info(e.identifier.id,e.manifest.version,"Running post uninstall script"),yield this.processesLimiter.queue(()=>this.runLifecycleHook(t.script,"uninstall",t.args,!0,e).then(()=>this.logService.info(e.identifier.id,e.manifest.version,"Finished running post uninstall script"),t=>this.logService.error(e.identifier.id,e.manifest.version,`Failed to run post uninstall script: ${t}`)))),u.rimraf(this.getExtensionStoragePath(e)).then(void 0,e=>this.logService.error("Error while removing extension storage path",e))})}parseScript(e,t){const n=`vscode:${t}`;if(e.location.scheme===c.Schemas.file&&e.manifest&&e.manifest.scripts&&"string"==typeof e.manifest.scripts[n]){const t=e.manifest.scripts[n].split(" ");return t.length<2||"node"!==t[0]||!t[1]?(this.logService.warn(e.identifier.id,e.manifest.version,`${n} should be a node script`),null):{
script:o.join(e.location.fsPath,t[1]),args:t.slice(2)||[]}}return null}runLifecycleHook(e,t,n,i,r){return new Promise((o,a)=>{const l=this.start(e,t,n,r);let c;const u=e=>{c&&(clearTimeout(c),c=null),e?a(e):o(void 0)};l.on("error",e=>{u(s.toErrorMessage(e)||"Unknown")}),l.on("exit",(e,n)=>{u(e?`post-${t} process exited with code ${e}`:void 0)}),i&&(c=setTimeout(()=>{c=null,l.kill(),a("timed out")},5e3))})}start(e,t,n,i){const s={silent:!0,execArgv:void 0},o=r.fork(e,[`--type=extension-post-${t}`,...n],s);o.stdout.setEncoding("utf8"),o.stderr.setEncoding("utf8");const a=l.Event.fromNodeEventEmitter(o.stdout,"data"),c=l.Event.fromNodeEventEmitter(o.stderr,"data");a(e=>this.logService.info(i.identifier.id,i.manifest.version,`post-${t}`,e)),c(e=>this.logService.error(i.identifier.id,i.manifest.version,`post-${t}`,e));const u=l.Event.any(l.Event.map(a,e=>({data:`%c${e}`,format:[""]})),l.Event.map(c,e=>({data:`%c${e}`,format:["color: red"]})));return l.Event.debounce(u,(e,t)=>e?{data:e.data+t.data,
format:[...e.format,...t.format]}:{data:t.data,format:t.format},100)(e=>{console.group(i.identifier.id),console.log(e.data,...e.format),console.groupEnd()}),o}getExtensionStoragePath(e){return o.join(this.environmentService.globalStorageHome,e.identifier.id.toLowerCase())}}t.ExtensionsLifecycle=d}),define(e[27],t([1,0,13]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MANIFEST_CACHE_FOLDER="CachedExtensions",t.USER_MANIFEST_CACHE_FILE="user",t.BUILTIN_MANIFEST_CACHE_FILE="builtin",t.isIExtensionIdentifier=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(!e.uuid||"string"==typeof e.uuid)};!function(e){e[e.System=0]="System",e[e.User=1]="User"}(t.ExtensionType||(t.ExtensionType={}));class i{constructor(e){this.value=e,this._lower=e.toLowerCase()}static equals(e,t){if(void 0===e||null===e)return void 0===t||null===t;if(void 0===t||null===t)return!1;if("string"==typeof e||"string"==typeof t){let i="string"==typeof e?e:e.value,r="string"==typeof t?t:t.value
;return n.equalsIgnoreCase(i,r)}return e._lower===t._lower}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}t.ExtensionIdentifier=i,t.isLanguagePackExtension=function(e){return!(!e.contributes||!e.contributes.localizations)&&e.contributes.localizations.length>0}}),define(e[21],t([1,0,13,27]),function(e,t,n,i){"use strict";function r(e,t){return e.uuid&&t.uuid?e.uuid===t.uuid:e.id===t.id||0===n.compareIgnoreCase(e.id,t.id)}Object.defineProperty(t,"__esModule",{value:!0}),t.areSameExtensions=r;class s{constructor(e,t){this.identifier=e,this.version=t}key(){return`${this.identifier.id}-${this.version}`}equals(e){return e instanceof s&&(r(this.identifier,e.identifier)&&this.version===e.version)}}t.ExtensionIdentifierWithVersion=s,t.adoptToGalleryExtensionId=function(e){return e.toLocaleLowerCase()},t.getGalleryExtensionId=function(e,t){return`${e.toLocaleLowerCase()}.${t.toLocaleLowerCase()}`},t.groupByExtension=function(e,t){const n=[],i=e=>{for(const i of n)if(i.some(n=>r(t(n),t(e))))return i
;return null};for(const t of e){const e=i(t);e?e.push(t):n.push([t])}return n},t.getLocalExtensionTelemetryData=function(e){return{id:e.identifier.id,name:e.manifest.name,galleryId:null,publisherId:e.metadata?e.metadata.publisherId:null,publisherName:e.manifest.publisher,publisherDisplayName:e.metadata?e.metadata.publisherDisplayName:null,dependencies:e.manifest.extensionDependencies&&e.manifest.extensionDependencies.length>0}},t.getGalleryExtensionTelemetryData=function(e){return Object.assign({id:e.identifier.id,name:e.name,galleryId:e.identifier.uuid,publisherId:e.publisherId,publisherName:e.publisher,publisherDisplayName:e.publisherDisplayName,dependencies:!!(e.properties.dependencies&&e.properties.dependencies.length>0)},e.telemetryData)},t.BetterMergeId=new i.ExtensionIdentifier("pprice.better-merge"),t.getMaliciousExtensionsSet=function(e){const t=new Set;for(const n of e)n.malicious&&t.add(n.id.id);return t}}),define(e[48],t([1,0,7,2,27,4]),function(e,t,n,i,r,s){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0});class o extends n.Disposable{constructor(e,t){super(),this.environmentService=e,this.extensionsManifestCache=i.join(this.environmentService.userDataPath,r.MANIFEST_CACHE_FOLDER,r.USER_MANIFEST_CACHE_FILE),this._register(t.onDidInstallExtension(e=>this.onDidInstallExtension(e))),this._register(t.onDidUninstallExtension(e=>this.onDidUnInstallExtension(e)))}onDidInstallExtension(e){e.error||this.invalidate()}onDidUnInstallExtension(e){e.error||this.invalidate()}invalidate(){s.rimraf(this.extensionsManifestCache,s.RimRafMode.MOVE).then(()=>{},()=>{})}}t.ExtensionsManifestCache=o}),define(e[33],t([1,0]),function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{constructor(e,t=[],n=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}}t.SyncDescriptor=n,t.createSyncDescriptor=((e,...t)=>new n(e,t))}),define(e[50],t([1,0,6,49]),function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{
constructor(e){this._hashFn=e,this._nodes=Object.create(null)}roots(){const e=[];return i.forEach(this._nodes,t=>{n.isEmptyObject(t.value.outgoing)&&e.push(t.value)}),e}insertEdge(e,t){const n=this.lookupOrInsertNode(e),i=this.lookupOrInsertNode(t);n.outgoing[this._hashFn(t)]=i,i.incoming[this._hashFn(e)]=n}removeNode(e){const t=this._hashFn(e);delete this._nodes[t],i.forEach(this._nodes,e=>{delete e.value.outgoing[t],delete e.value.incoming[t]})}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes[t];return n||(n=function(e){return{data:e,incoming:Object.create(null),outgoing:Object.create(null)}}(e),this._nodes[t]=n),n}lookup(e){return this._nodes[this._hashFn(e)]}isEmpty(){for(const e in this._nodes)return!1;return!0}toString(){let e=[];return i.forEach(this._nodes,t=>{e.push(`${t.key}, (incoming)[${Object.keys(t.value.incoming).join(", ")}], (outgoing)[${Object.keys(t.value.outgoing).join(",")}]`)}),e.join("\n")}}t.Graph=r}),define(e[51],t([1,0,3]),function(e,t,n){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0}),t.IDownloadService=n.createDecorator("downloadService")}),define(e[16],t([1,0,3]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IEnvironmentService=n.createDecorator("environmentService")}),define(e[24],t([1,0,70,3]),function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXTENSION_IDENTIFIER_PATTERN="^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$",t.EXTENSION_IDENTIFIER_REGEX=new RegExp(t.EXTENSION_IDENTIFIER_PATTERN),t.isIExtensionIdentifier=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(!e.uuid||"string"==typeof e.uuid)},t.IExtensionManagementService=i.createDecorator("extensionManagementService"),t.IExtensionGalleryService=i.createDecorator("extensionGalleryService");!function(e){e[e.NoneOrRelevance=0]="NoneOrRelevance",e[e.LastUpdatedDate=1]="LastUpdatedDate",e[e.Title=2]="Title",e[e.PublisherName=3]="PublisherName",e[e.InstallCount=4]="InstallCount",
e[e.PublishedDate=5]="PublishedDate",e[e.AverageRating=6]="AverageRating",e[e.WeightedRating=12]="WeightedRating"}(t.SortBy||(t.SortBy={}));!function(e){e[e.Default=0]="Default",e[e.Ascending=1]="Ascending",e[e.Descending=2]="Descending"}(t.SortOrder||(t.SortOrder={}));!function(e){e.Uninstall="uninstall"}(t.StatisticType||(t.StatisticType={}));!function(e){e[e.None=0]="None",e[e.Install=1]="Install",e[e.Update=2]="Update"}(t.InstallOperation||(t.InstallOperation={})),t.INSTALL_ERROR_MALICIOUS="malicious",t.INSTALL_ERROR_INCOMPATIBLE="incompatible",t.IExtensionManagementServerService=i.createDecorator("extensionManagementServerService");!function(e){e[e.Disabled=0]="Disabled",e[e.WorkspaceDisabled=1]="WorkspaceDisabled",e[e.Enabled=2]="Enabled",e[e.WorkspaceEnabled=3]="WorkspaceEnabled"}(t.EnablementState||(t.EnablementState={})),t.IExtensionEnablementService=i.createDecorator("extensionEnablementService"),t.IExtensionTipsService=i.createDecorator("extensionTipsService");!function(e){
e[e.Workspace=0]="Workspace",e[e.File=1]="File",e[e.Executable=2]="Executable",e[e.DynamicWorkspace=3]="DynamicWorkspace",e[e.Experimental=4]="Experimental"}(t.ExtensionRecommendationReason||(t.ExtensionRecommendationReason={})),t.ExtensionsLabel=n.localize(0,null),t.ExtensionsChannelId="extensions",t.PreferencesLabel=n.localize(1,null)}),define(e[36],t([1,0]),function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){const n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){this._entries.forEach((t,n)=>e(n,t))}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=n}),define(e[56],t([1,0,19,50,33,3,36,25]),function(e,t,n,i,r,s,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const l="function"==typeof Proxy;class c{constructor(e=new o.ServiceCollection,t=!1,n){this._services=e,this._strict=t,this._parent=n,
this._services.set(s.IInstantiationService,this)}createChild(e){return new c(e,this._strict,this)}invokeFunction(e,...t){let i=d.traceInvocation(e),r=!1;try{const o={get:(e,t)=>{if(r)throw n.illegalState("service accessor is only valid during the invocation of its target method");const o=this._getOrCreateServiceInstance(e,i);if(!o&&t!==s.optional)throw new Error(`[invokeFunction] unknown service '${e}'`);return o}};return e.apply(void 0,[o,...t])}finally{r=!0,i.stop()}}createInstance(e,...t){let n,i;return e instanceof r.SyncDescriptor?(n=d.traceCreation(e.ctor),i=this._createInstance(e.ctor,e.staticArguments.concat(t),n)):(n=d.traceCreation(e),i=this._createInstance(e,t,n)),n.stop(),i}_createInstance(e,t=[],n){let i=s._util.getServiceDependencies(e).sort((e,t)=>e.index-t.index),r=[];for(const t of i){let i=this._getOrCreateServiceInstance(t.id,n);if(!i&&this._strict&&!t.optional)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);r.push(i)}let o=i.length>0?i[0].index:t.length
;if(t.length!==o){console.warn(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);let n=o-t.length;t=n>0?t.concat(new Array(n)):t.slice(0,o)}return new e(...[...t,...r])}_setServiceInstance(e,t){if(this._services.get(e)instanceof r.SyncDescriptor)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){let n=this._getServiceInstanceOrDescriptor(e);return n instanceof r.SyncDescriptor?this._createAndCacheServiceInstance(e,n,t.branch(e,!0)):(t.branch(e,!1),n)}_createAndCacheServiceInstance(e,t,n){function o(){const e=new Error("[createInstance] cyclic dependency between services");throw e.message=a.toString(),e}const a=new i.Graph(e=>e.id.toString());let l=0;const c=[{id:e,desc:t,
_trace:n}];for(;c.length;){const t=c.pop();a.lookupOrInsertNode(t),l++>100&&o();let n=s._util.getServiceDependencies(t.desc.ctor);for(let i of n){let n=this._getServiceInstanceOrDescriptor(i.id);if(n||i.optional||console.warn(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`),n instanceof r.SyncDescriptor){const e={id:i.id,desc:n,_trace:t._trace.branch(i.id,!0)};a.insertEdge(t,e),c.push(e)}}}for(;;){let e=a.roots();if(0===e.length){a.isEmpty()||o();break}for(let{data:t}of e){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e),a.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,n=[],i,s){if(this._services.get(e)instanceof r.SyncDescriptor)return this._createServiceInstance(t,n,i,s);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,n,i,s);throw new Error("illegalState - creating UNKNOWN service instance")}
_createServiceInstance(e,t=[],n,i){if(n&&l){const n=new a.IdleValue(()=>this._createInstance(e,t,i));return new Proxy(Object.create(null),{get:(e,t)=>n.getValue()[t],set:(e,t,i)=>(n.getValue()[t]=i,!0)})}return this._createInstance(e,t,i)}}t.InstantiationService=c;var u;!function(e){e[e.Creation=0]="Creation",e[e.Invocation=1]="Invocation",e[e.Branch=2]="Branch"}(u||(u={}));class d{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return d._None}static traceCreation(e){return d._None}branch(e,t){let n=new d(2,e.toString());return this._dep.push([e,t,n]),n}stop(){function e(t,i){let r=[],s=new Array(t+1).join("\t");for(const[o,a,l]of i._dep)if(a&&l){n=!0,r.push(`${s}CREATES -> ${o}`);let i=e(t+1,l);i&&r.push(i)}else r.push(`${s}uses -> ${o}`);return r.join("\n")}let t=Date.now()-this._start;d._totals+=t;let n=!1,i=[`${0===this.type?"CREATE":"CALL"} ${this.name}`,`${e(1,this)}`,`DONE, took ${t.toFixed(2)}ms (grand total ${d._totals.toFixed(2)}ms)`]
;(t>2||n)&&console.log(i.join("\n"))}}d._None=new class extends d{constructor(){super(-1,null)}stop(){}branch(){return this}},d._totals=0}),define(e[58],t([1,0,3]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e[e.Core=1]="Core",e[e.Contributed=2]="Contributed"}(t.LanguageType||(t.LanguageType={})),t.ILocalizationsService=n.createDecorator("localizationsService"),t.isValidLocalization=function(e){if("string"!=typeof e.languageId)return!1;if(!Array.isArray(e.translations)||0===e.translations.length)return!1;for(const t of e.translations){if("string"!=typeof t.id)return!1;if("string"!=typeof t.path)return!1}return!(e.languageName&&"string"!=typeof e.languageName||e.localizedLanguageName&&"string"!=typeof e.localizedLanguageName)}}),define(e[5],t([1,0,3,7,17,9]),function(e,t,n,i,r,s){"use strict";function o(){return(new Date).toISOString()}Object.defineProperty(t,"__esModule",{value:!0}),t.ILogService=n.createDecorator("logService");var a;!function(e){
e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.Off=6]="Off"}(a=t.LogLevel||(t.LogLevel={})),t.DEFAULT_LOG_LEVEL=a.Info;class l extends i.Disposable{constructor(){super(...arguments),this.level=t.DEFAULT_LOG_LEVEL,this._onDidChangeLogLevel=this._register(new s.Emitter),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}t.AbstractLogService=l;class c extends l{constructor(e=t.DEFAULT_LOG_LEVEL){super(),this.setLevel(e),this.useColors=!r.isWindows}trace(e,...t){this.getLevel()<=a.Trace&&(this.useColors?console.log(`[90m[main ${o()}][0m`,e,...t):console.log(`[main ${o()}]`,e,...t))}debug(e,...t){this.getLevel()<=a.Debug&&(this.useColors?console.log(`[90m[main ${o()}][0m`,e,...t):console.log(`[main ${o()}]`,e,...t))}info(e,...t){
this.getLevel()<=a.Info&&(this.useColors?console.log(`[90m[main ${o()}][0m`,e,...t):console.log(`[main ${o()}]`,e,...t))}warn(e,...t){this.getLevel()<=a.Warning&&(this.useColors?console.warn(`[93m[main ${o()}][0m`,e,...t):console.warn(`[main ${o()}]`,e,...t))}error(e,...t){this.getLevel()<=a.Error&&(this.useColors?console.error(`[91m[main ${o()}][0m`,e,...t):console.error(`[main ${o()}]`,e,...t))}critical(e,...t){this.getLevel()<=a.Critical&&(this.useColors?console.error(`[90m[main ${o()}][0m`,e,...t):console.error(`[main ${o()}]`,e,...t))}dispose(){}}t.ConsoleLogMainService=c;class u extends l{constructor(e=t.DEFAULT_LOG_LEVEL){super(),this.setLevel(e)}trace(e,...t){this.getLevel()<=a.Trace&&console.log("%cTRACE","color: #888",e,...t)}debug(e,...t){this.getLevel()<=a.Debug&&console.log("%cDEBUG","background: #eee; color: #888",e,...t)}info(e,...t){this.getLevel()<=a.Info&&console.log("%c INFO","color: #33f",e,...t)}warn(e,...t){this.getLevel()<=a.Warning&&console.log("%c WARN","color: #993",e,...t)}
error(e,...t){this.getLevel()<=a.Error&&console.log("%c  ERR","color: #f33",e,...t)}critical(e,...t){this.getLevel()<=a.Critical&&console.log("%cCRITI","background: #f33; color: white",e,...t)}dispose(){}}t.ConsoleLogService=u;class d extends l{constructor(e){super(),this.logServices=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.logServices)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const n of this.logServices)n.trace(e,...t)}debug(e,...t){for(const n of this.logServices)n.debug(e,...t)}info(e,...t){for(const n of this.logServices)n.info(e,...t)}warn(e,...t){for(const n of this.logServices)n.warn(e,...t)}error(e,...t){for(const n of this.logServices)n.error(e,...t)}critical(e,...t){for(const n of this.logServices)n.critical(e,...t)}dispose(){for(const e of this.logServices)e.dispose()}}t.MultiplexLogService=d;class h extends i.Disposable{constructor(e){super(),this.logService=e,this._register(e)}get onDidChangeLogLevel(){return this.logService.onDidChangeLogLevel}
setLevel(e){this.logService.setLevel(e)}getLevel(){return this.logService.getLevel()}trace(e,...t){this.logService.trace(e,...t)}debug(e,...t){this.logService.debug(e,...t)}info(e,...t){this.logService.info(e,...t)}warn(e,...t){this.logService.warn(e,...t)}error(e,...t){this.logService.error(e,...t)}critical(e,...t){this.logService.critical(e,...t)}}t.DelegatedLogService=h;class f{constructor(){this.onDidChangeLogLevel=(new s.Emitter).event}setLevel(e){}getLevel(){return a.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}critical(e,...t){}dispose(){}}t.NullLogService=f,t.getLogLevel=function(e){if(e.verbose)return a.Trace;if("string"==typeof e.args.log)switch(e.args.log.toLowerCase()){case"trace":return a.Trace;case"debug":return a.Debug;case"info":return a.Info;case"warn":return a.Warning;case"error":return a.Error;case"critical":return a.Critical;case"off":return a.Off}return t.DEFAULT_LOG_LEVEL}}),define(e[60],t([1,0,2,5]),function(e,t,i,r){"use strict";function s(e,t,n){
switch(t){case r.LogLevel.Trace:return e.trace(n);case r.LogLevel.Debug:return e.debug(n);case r.LogLevel.Info:return e.info(n);case r.LogLevel.Warning:return e.warn(n);case r.LogLevel.Error:return e.error(n);case r.LogLevel.Critical:return e.critical(n);default:throw new Error("Invalid log level")}}Object.defineProperty(t,"__esModule",{value:!0}),t.createRotatingLogger=function(t,n,i,r){return e.__$__nodeRequire("spdlog").createRotatingLogger(t,n,i,r)};class o extends r.AbstractLogService{constructor(e,t,n){super(),this.name=e,this.logsFolder=t,this.buffer=[],this._loggerCreationPromise=void 0,this.setLevel(n),this._createSpdLogLogger(),this._register(this.onDidChangeLogLevel(e=>{this._logger&&this._logger.setLevel(e)}))}_createSpdLogLogger(){return this._loggerCreationPromise||(this._loggerCreationPromise=function(t,r){return n(this,void 0,void 0,function*(){try{const n=yield new Promise((t,n)=>{e(["spdlog"],t,n)});n.setAsyncMode(8192,500);const s=i.join(r,`${t}.log`)
;return n.createRotatingLoggerAsync(t,s,5242880,6)}catch(e){console.error(e)}return null})}(this.name,this.logsFolder).then(e=>{if(e){this._logger=e,this._logger.setLevel(this.getLevel());for(const{level:e,message:t}of this.buffer)s(this._logger,e,t);this.buffer=[]}})),this._loggerCreationPromise}_log(e,t){this._logger?s(this._logger,e,t):this.getLevel()<=e&&this.buffer.push({level:e,message:t})}trace(){this.getLevel()<=r.LogLevel.Trace&&this._log(r.LogLevel.Trace,this.format(arguments))}debug(){this.getLevel()<=r.LogLevel.Debug&&this._log(r.LogLevel.Debug,this.format(arguments))}info(){this.getLevel()<=r.LogLevel.Info&&this._log(r.LogLevel.Info,this.format(arguments))}warn(){this.getLevel()<=r.LogLevel.Warning&&this._log(r.LogLevel.Warning,this.format(arguments))}error(){if(this.getLevel()<=r.LogLevel.Error){const e=arguments[0];if(e instanceof Error){const t=Array.prototype.slice.call(arguments);t[0]=e.stack,this._log(r.LogLevel.Error,this.format(t))}else this._log(r.LogLevel.Error,this.format(arguments))}}
critical(){this.getLevel()<=r.LogLevel.Critical&&this._log(r.LogLevel.Critical,this.format(arguments))}dispose(){this._logger?this.disposeLogger():this._loggerCreationPromise&&this._loggerCreationPromise.then(()=>this.disposeLogger()),this._loggerCreationPromise=void 0}disposeLogger(){this._logger&&(this._logger.drop(),this._logger=void 0)}format(e){let t="";for(let n=0;n<e.length;n++){let i=e[n];if("object"==typeof i)try{i=JSON.stringify(i)}catch(e){}t+=(n>0?" ":"")+i}return t}}t.SpdLogService=o}),define(e[31],t([1,0,76,22]),function(e,t,n,i){"use strict";function r(e){return"*"===(e=e.trim())||c.test(e)}function s(e){if(!r(e))return null;if("*"===(e=e.trim()))return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};let t=e.match(c);return t?{hasCaret:"^"===t[1],hasGreaterEquals:">="===t[1],majorBase:"x"===t[2]?0:parseInt(t[2],10),majorMustEqual:"x"!==t[2],minorBase:"x"===t[4]?0:parseInt(t[4],10),
minorMustEqual:"x"!==t[4],patchBase:"x"===t[6]?0:parseInt(t[6],10),patchMustEqual:"x"!==t[6],preRelease:t[8]||null}:null}function o(e){if(!e)return null;let t=e.majorBase,n=e.majorMustEqual,i=e.minorBase,r=e.minorMustEqual,s=e.patchBase,o=e.patchMustEqual;return e.hasCaret&&(0===t?o=!1:(r=!1,o=!1)),{majorBase:t,majorMustEqual:n,minorBase:i,minorMustEqual:r,patchBase:s,patchMustEqual:o,isMinimum:e.hasGreaterEquals}}function a(e,t){let n;n="string"==typeof e?o(s(e)):e;let i;if(i="string"==typeof t?o(s(t)):t,!n||!i)return!1;let r=n.majorBase,a=n.minorBase,l=n.patchBase,c=i.majorBase,u=i.minorBase,d=i.patchBase,h=i.majorMustEqual,f=i.minorMustEqual,g=i.patchMustEqual;return i.isMinimum?r>c||!(r<c)&&(a>u||!(a<u)&&l>=d):(1!==r||0!==c||h&&f&&g||(c=1,u=0,d=0,h=!0,f=!1,g=!1),!(r<c)&&(r>c?!h:!(a<u)&&(a>u?!f:!(l<d)&&(!(l>d)||!g))))}function l(e,t,i=[]){let r=o(s(t));if(!r)return i.push(n.localize(0,null,t)),!1;if(0===r.majorBase){if(!r.majorMustEqual||!r.minorMustEqual)return i.push(n.localize(1,null,t)),!1
}else if(!r.majorMustEqual)return i.push(n.localize(2,null,t)),!1;return!!a(e,r)||(i.push(n.localize(3,null,e,t)),!1)}Object.defineProperty(t,"__esModule",{value:!0});const c=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/;t.isValidVersionStr=r,t.parseVersion=s,t.normalizeVersion=o,t.isValidVersion=a,t.isValidExtensionVersion=function(e,t,n){return!(!t.isBuiltin&&void 0!==t.main)||l(e,t.engines.vscode,n)},t.isEngineValid=function(e){return"*"===e||l(i.default.version,e)},t.isVersionValid=l});var i=this&&this.__decorate||function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};define(e[63],t([1,0,64,54,29,2,61,22,26,46,17,35,20]),function(e,t,n,r,s,o,a,l,c,u,d,h,f){"use strict";function g(e,t){return d.isWindows?function(e,t){
return`\\\\.\\pipe\\${n.createHash("md5").update(e).digest("hex")}-${l.default.version}-${t}-sock`}(e,t):function(e,t){const i=process.env.VSCODE_PORTABLE;if(E&&!i){const i=n.createHash("md5").update(e).digest("hex").substr(0,8);return o.join(E,`vscode-${i}-${l.default.version}-${t}.sock`)}return o.join(e,`${l.default.version}-${t}.sock`)}(e,t)}function p(e,t){return v(e["inspect-extensions"],e["inspect-brk-extensions"],5870,t,e.debugId)}function m(e,t){return v(e["inspect-search"],e["inspect-brk-search"],5876,t)}function v(e,t,n,i,r){const s=t||e,o=Number(s)||(i?null:n);return{port:o,break:!!o&&Boolean(!!t),debugId:r}}function y(e,t){if(!e)return;const n=o.resolve(e);return o.normalize(e)===n?n:o.resolve(t.env.VSCODE_CWD||t.cwd(),e)}function S(e,t){return y(e["user-data-dir"],t)||o.resolve(r.getDefaultUserDataPath(t.platform))}Object.defineProperty(t,"__esModule",{value:!0});const E=process.env.XDG_RUNTIME_DIR;class C{constructor(e,t){if(this._args=e,this._execPath=t,!process.env.VSCODE_LOGS){
const e=u.toLocalISOString(new Date).replace(/-|:|\.\d+Z$/g,"");process.env.VSCODE_LOGS=o.join(this.userDataPath,"logs",e)}this.logsPath=process.env.VSCODE_LOGS}get args(){return this._args}get appRoot(){return o.dirname(h.getPathFromAmdModule(e,""))}get execPath(){return this._execPath}get cliPath(){return function(e,t,n){return d.isWindows?n?o.join(o.dirname(e),"bin",`${c.default.applicationName}.cmd`):o.join(t,"scripts","code-cli.bat"):d.isLinux?n?o.join(o.dirname(e),"bin",`${c.default.applicationName}`):o.join(t,"scripts","code-cli.sh"):n?o.join(t,"bin","code"):o.join(t,"scripts","code-cli.sh")}(this.execPath,this.appRoot,this.isBuilt)}get userHome(){return s.homedir()}get userDataPath(){const e=process.env.VSCODE_PORTABLE;return e?o.join(e,"user-data"):S(this._args,process)}get appNameLong(){return c.default.nameLong}get appQuality(){return c.default.quality}get appSettingsHome(){return o.join(this.userDataPath,"User")}get appSettingsPath(){return o.join(this.appSettingsHome,"settings.json")}
get machineSettingsHome(){return o.join(this.userDataPath,"Machine")}get machineSettingsPath(){return o.join(this.machineSettingsHome,"settings.json")}get globalStorageHome(){return o.join(this.appSettingsHome,"globalStorage")}get workspaceStorageHome(){return o.join(this.appSettingsHome,"workspaceStorage")}get settingsSearchBuildId(){return c.default.settingsSearchBuildId}get settingsSearchUrl(){return c.default.settingsSearchUrl}get appKeybindingsPath(){return o.join(this.appSettingsHome,"keybindings.json")}get isExtensionDevelopment(){return!!this._args.extensionDevelopmentPath}get backupHome(){return o.join(this.userDataPath,"Backups")}get backupWorkspacesPath(){return o.join(this.backupHome,"workspaces.json")}get untitledWorkspacesHome(){return f.URI.file(o.join(this.userDataPath,"Workspaces"))}get installSourcePath(){return o.join(this.userDataPath,"installSource")}get builtinExtensionsPath(){const t=y(this._args["builtin-extensions-dir"],process)
;return t||o.normalize(o.join(h.getPathFromAmdModule(e,""),"..","extensions"))}get extensionsPath(){const e=y(this._args["extensions-dir"],process);if(e)return e;const t=process.env.VSCODE_EXTENSIONS;if(t)return t;const n=process.env.VSCODE_PORTABLE;return n?o.join(n,"extensions"):o.join(this.userHome,c.default.dataFolderName,"extensions")}get extensionDevelopmentLocationURI(){const e=this._args.extensionDevelopmentPath;return Array.isArray(e)?e.map(e=>/^[^:/?#]+?:\/\//.test(e)?f.URI.parse(e):f.URI.file(o.normalize(e))):e?/^[^:/?#]+?:\/\//.test(e)?[f.URI.parse(e)]:[f.URI.file(o.normalize(e))]:void 0}get extensionTestsLocationURI(){const e=this._args.extensionTestsPath;if(e)return/^[^:/?#]+?:\/\//.test(e)?f.URI.parse(e):f.URI.file(o.normalize(e))}get disableExtensions(){if(this._args["disable-extensions"])return!0;const e=this._args["disable-extension"];if(e){if("string"==typeof e)return[e];if(Array.isArray(e)&&e.length>0)return e}return!1}get skipGettingStarted(){return!!this._args["skip-getting-started"]}
get skipReleaseNotes(){return!!this._args["skip-release-notes"]}get skipAddToRecentlyOpened(){return!!this._args["skip-add-to-recently-opened"]}get debugExtensionHost(){return p(this._args,this.isBuilt)}get debugSearch(){return m(this._args,this.isBuilt)}get isBuilt(){return!process.env.VSCODE_DEV}get verbose(){return!!this._args.verbose}get log(){return this._args.log}get wait(){return!!this._args.wait}get logExtensionHostCommunication(){return!!this._args.logExtensionHostCommunication}get status(){return!!this._args.status}get mainIPCHandle(){return g(this.userDataPath,"main")}get sharedIPCHandle(){return g(this.userDataPath,"shared")}get nodeCachedDataDir(){return process.env.VSCODE_NODE_CACHED_DATA_DIR||void 0}get disableUpdates(){return!!this._args["disable-updates"]}get disableCrashReporter(){return!!this._args["disable-crash-reporter"]}get driverHandle(){return this._args.driver}get driverVerbose(){return!!this._args["driver-verbose"]}}i([a.memoize],C.prototype,"appRoot",null),
i([a.memoize],C.prototype,"cliPath",null),i([a.memoize],C.prototype,"userHome",null),i([a.memoize],C.prototype,"userDataPath",null),i([a.memoize],C.prototype,"appSettingsHome",null),i([a.memoize],C.prototype,"appSettingsPath",null),i([a.memoize],C.prototype,"machineSettingsHome",null),i([a.memoize],C.prototype,"machineSettingsPath",null),i([a.memoize],C.prototype,"globalStorageHome",null),i([a.memoize],C.prototype,"workspaceStorageHome",null),i([a.memoize],C.prototype,"settingsSearchBuildId",null),i([a.memoize],C.prototype,"settingsSearchUrl",null),i([a.memoize],C.prototype,"appKeybindingsPath",null),i([a.memoize],C.prototype,"isExtensionDevelopment",null),i([a.memoize],C.prototype,"backupHome",null),i([a.memoize],C.prototype,"backupWorkspacesPath",null),i([a.memoize],C.prototype,"untitledWorkspacesHome",null),i([a.memoize],C.prototype,"installSourcePath",null),i([a.memoize],C.prototype,"builtinExtensionsPath",null),i([a.memoize],C.prototype,"extensionsPath",null),
i([a.memoize],C.prototype,"extensionDevelopmentLocationURI",null),i([a.memoize],C.prototype,"extensionTestsLocationURI",null),i([a.memoize],C.prototype,"debugExtensionHost",null),i([a.memoize],C.prototype,"debugSearch",null),i([a.memoize],C.prototype,"mainIPCHandle",null),i([a.memoize],C.prototype,"sharedIPCHandle",null),i([a.memoize],C.prototype,"nodeCachedDataDir",null),t.EnvironmentService=C,t.parseExtensionHostPort=p,t.parseSearchPort=m,t.parseDebugPort=v,t.parseUserDataDir=S});var r=this&&this.__param||function(e,t){return function(n,i){t(n,i,e)}};define(e[67],t([1,0,4,64,24,7,16,25,21,5,58,26,28,9,23,2]),function(e,t,n,s,o,a,l,c,u,d,h,f,g,p,m,v){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const y=["de","en","en-US","es","fr","it","ja","ko","ru","zh-CN","zh-TW"];"stable"!==f.default.quality&&y.push("hu");let S=class extends a.Disposable{constructor(e,t,n){super(),this.extensionManagementService=e,this.logService=n,this._onDidLanguagesChange=this._register(new p.Emitter),
this.onDidLanguagesChange=this._onDidLanguagesChange.event,this.cache=this._register(new E(t,n)),this._register(e.onDidInstallExtension(({local:e})=>this.onDidInstallExtension(e))),this._register(e.onDidUninstallExtension(({identifier:e})=>this.onDidUninstallExtension(e)))}getLanguageIds(e){return 1===e?Promise.resolve([...y]):this.cache.getLanguagePacks().then(t=>{const n=2===e?Object.keys(t):[...y,...Object.keys(t)];return g.distinct(n)})}onDidInstallExtension(e){e&&e.manifest&&e.manifest.contributes&&e.manifest.contributes.localizations&&e.manifest.contributes.localizations.length&&(this.logService.debug("Adding language packs from the extension",e.identifier.id),this.update().then(e=>{e&&this._onDidLanguagesChange.fire()}))}onDidUninstallExtension(e){this.cache.getLanguagePacks().then(t=>{Object.keys(t).some(n=>t[n]&&t[n].extensions.some(t=>u.areSameExtensions(t.extensionIdentifier,e)))&&(this.logService.debug("Removing language packs from the extension",e.id),this.update().then(e=>{
e&&this._onDidLanguagesChange.fire()}))})}update(){return Promise.all([this.cache.getLanguagePacks(),this.extensionManagementService.getInstalled()]).then(([e,t])=>this.cache.update(t).then(t=>!g.equals(Object.keys(e),Object.keys(t))))}};S=i([r(0,o.IExtensionManagementService),r(1,l.IEnvironmentService),r(2,d.ILogService)],S),t.LocalizationsService=S;let E=class extends a.Disposable{constructor(e,t){super(),this.logService=t,this.languagePacks={},this.languagePacksFilePath=v.join(e.userDataPath,"languagepacks.json"),this.languagePacksFileLimiter=new c.Queue}getLanguagePacks(){return this.languagePacksFileLimiter.size||!this.initializedCache?this.withLanguagePacks().then(()=>this.languagePacks):Promise.resolve(this.languagePacks)}update(e){return this.withLanguagePacks(t=>{Object.keys(t).forEach(e=>delete t[e]),this.createLanguagePacksFromExtensions(t,...e)}).then(()=>this.languagePacks)}createLanguagePacksFromExtensions(e,...t){
for(const n of t)n&&n.manifest&&n.manifest.contributes&&n.manifest.contributes.localizations&&n.manifest.contributes.localizations.length&&this.createLanguagePacksFromExtension(e,n);Object.keys(e).forEach(t=>this.updateHash(e[t]))}createLanguagePacksFromExtension(e,t){const n=t.identifier,i=t.manifest.contributes&&t.manifest.contributes.localizations?t.manifest.contributes.localizations:[];for(const r of i)if(t.location.scheme===m.Schemas.file&&h.isValidLocalization(r)){let i=e[r.languageId];i||(i={hash:"",extensions:[],translations:{}},e[r.languageId]=i);let s=i.extensions.filter(e=>u.areSameExtensions(e.extensionIdentifier,n))[0];s?s.version=t.manifest.version:i.extensions.push({extensionIdentifier:n,version:t.manifest.version});for(const e of r.translations)i.translations[e.id]=v.join(t.location.fsPath,e.path)}}updateHash(e){if(e){const t=s.createHash("md5");for(const n of e.extensions)t.update(n.extensionIdentifier.uuid||n.extensionIdentifier.id).update(n.version);e.hash=t.digest("hex")}}
withLanguagePacks(e=(()=>null)){return this.languagePacksFileLimiter.queue(()=>{let t=null;return n.readFile(this.languagePacksFilePath,"utf8").then(void 0,e=>"ENOENT"===e.code?Promise.resolve("{}"):Promise.reject(e)).then(e=>{try{return JSON.parse(e)}catch(e){return{}}}).then(n=>(t=e(n),n)).then(e=>{for(const t of Object.keys(e))e[t]||delete e[t];this.languagePacks=e,this.initializedCache=!0;const t=JSON.stringify(this.languagePacks);return this.logService.debug("Writing language packs",t),n.writeFile(this.languagePacksFilePath,t)}).then(()=>t,e=>this.logService.error(e))})}};E=i([r(0,l.IEnvironmentService),r(1,d.ILogService)],E)}),define(e[12],t([1,0,6,62]),function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(){this.data={}}add(e,t){i.ok(n.isString(e)),i.ok(n.isObject(t)),i.ok(!this.data.hasOwnProperty(e),"There is already an extension with this id"),this.data[e]=t}knows(e){return this.data.hasOwnProperty(e)}as(e){return this.data[e]||null}}t.Registry=new r}),
define(e[69],t([1,0,12,9]),function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extensions={JSONContribution:"base.contributions.json"};class r{constructor(){this._onDidChangeSchema=new i.Emitter,this.onDidChangeSchema=this._onDidChangeSchema.event,this.schemasById={}}registerSchema(e,t){this.schemasById[function(e){return e.length>0&&"#"===e.charAt(e.length-1)?e.substring(0,e.length-1):e}(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}}const s=new r;n.Registry.add(t.Extensions.JSONContribution,s)}),define(e[18],t([1,0,68,9,12,6,13,69]),function(e,t,n,i,r,s,o,a){"use strict";function l(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}function c(e){
return t.OVERRIDE_PROPERTY_PATTERN.test(e)?n.localize(3,null,e):void 0!==p.getConfigurationProperties()[e]?n.localize(4,null,e):null}Object.defineProperty(t,"__esModule",{value:!0}),t.Extensions={Configuration:"base.contributions.configuration"};!function(e){e[e.APPLICATION=1]="APPLICATION",e[e.MACHINE=2]="MACHINE",e[e.WINDOW=3]="WINDOW",e[e.RESOURCE=4]="RESOURCE"}(t.ConfigurationScope||(t.ConfigurationScope={})),t.allSettings={properties:{},patternProperties:{}},t.applicationSettings={properties:{},patternProperties:{}},t.machineSettings={properties:{},patternProperties:{}},t.windowSettings={properties:{},patternProperties:{}},t.resourceSettings={properties:{},patternProperties:{}},t.editorConfigurationSchemaId="vscode://schemas/settings/editor";const u=r.Registry.as(a.Extensions.JSONContribution);class d{constructor(){this.overrideIdentifiers=[],this._onDidSchemaChange=new i.Emitter,this.onDidSchemaChange=this._onDidSchemaChange.event,this._onDidUpdateConfiguration=new i.Emitter,
this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this.defaultOverridesConfigurationNode={id:"defaultOverrides",title:n.localize(0,null),properties:{}},this.configurationContributors=[this.defaultOverridesConfigurationNode],this.editorConfigurationSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting"},this.configurationProperties={},this.excludedConfigurationProperties={},this.computeOverridePropertyPattern(),u.registerSchema(t.editorConfigurationSchemaId,this.editorConfigurationSchema)}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const n=[];e.forEach(e=>{n.push(...this.validateAndRegisterProperties(e,t)),this.configurationContributors.push(e),this.registerJSONConfiguration(e),this.updateSchemaForOverrideSettingsConfiguration(e)}),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(n)}deregisterConfigurations(e){const n=[],i=e=>{
if(e.properties)for(const i in e.properties)switch(n.push(i),delete this.configurationProperties[i],delete this.editorConfigurationSchema.properties[i],delete t.allSettings.properties[i],e.properties[i].scope){case 1:delete t.applicationSettings.properties[i];break;case 2:delete t.machineSettings.properties[i];break;case 3:delete t.windowSettings.properties[i];break;case 4:delete t.resourceSettings.properties[i]}e.allOf&&e.allOf.forEach(e=>i(e))};for(const t of e){i(t);const e=this.configurationContributors.indexOf(t);-1!==e&&this.configurationContributors.splice(e,1)}u.registerSchema(t.editorConfigurationSchemaId,this.editorConfigurationSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(n)}registerDefaultConfigurations(e){const i=[];for(const r of e)for(const e in r.defaults){const s=r.defaults[e];if(t.OVERRIDE_PROPERTY_PATTERN.test(e)&&"object"==typeof s){const r={type:"object",default:s,description:n.localize(1,null,e),$ref:t.editorConfigurationSchemaId}
;t.allSettings.properties[e]=r,this.defaultOverridesConfigurationNode.properties[e]=r,this.configurationProperties[e]=r,i.push(e)}}this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(i)}deregisterDefaultConfigurations(e){const n=[];for(const i of e)for(const e in i.defaults)n.push(e),delete t.allSettings.properties[e],delete this.defaultOverridesConfigurationNode.properties[e],delete this.configurationProperties[e];this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(n)}notifyConfigurationSchemaUpdated(...e){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(e){this.overrideIdentifiers.push(...e),this.updateOverridePropertyPatternKey()}validateAndRegisterProperties(e,n=!0,i=3,r=!1){i=s.isUndefinedOrNull(e.scope)?i:e.scope,r=e.overridable||r;let o=[],a=e.properties;if(a)for(let e in a){let u;if(n&&(u=c(e))){console.warn(u),delete a[e];continue}let d=a[e],h=d.default;s.isUndefined(h)&&(d.default=l(d.type)),r&&(d.overridable=!0),
t.OVERRIDE_PROPERTY_PATTERN.test(e)?d.scope=void 0:d.scope=s.isUndefinedOrNull(d.scope)?i:d.scope,!a[e].hasOwnProperty("included")||a[e].included?(this.configurationProperties[e]=a[e],o.push(e)):(this.excludedConfigurationProperties[e]=a[e],delete a[e])}let u=e.allOf;if(u)for(let e of u)o.push(...this.validateAndRegisterProperties(e,n,i,r));return o}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}registerJSONConfiguration(e){function n(e){let i=e.properties;if(i)for(const e in i)switch(t.allSettings.properties[e]=i[e],i[e].scope){case 1:t.applicationSettings.properties[e]=i[e];break;case 2:t.machineSettings.properties[e]=i[e];break;case 3:t.windowSettings.properties[e]=i[e];break;case 4:t.resourceSettings.properties[e]=i[e]}let r=e.allOf;r&&r.forEach(n)}n(e)}updateSchemaForOverrideSettingsConfiguration(e){e.id!==h&&(this.update(e),
u.registerSchema(t.editorConfigurationSchemaId,this.editorConfigurationSchema))}updateOverridePropertyPatternKey(){let e=t.allSettings.patternProperties[this.overridePropertyPattern];e||(e={type:"object",description:n.localize(2,null),errorMessage:"Unknown Identifier. Use language identifiers",$ref:t.editorConfigurationSchemaId}),delete t.allSettings.patternProperties[this.overridePropertyPattern],delete t.applicationSettings.patternProperties[this.overridePropertyPattern],delete t.machineSettings.patternProperties[this.overridePropertyPattern],delete t.windowSettings.patternProperties[this.overridePropertyPattern],delete t.resourceSettings.patternProperties[this.overridePropertyPattern],this.computeOverridePropertyPattern(),t.allSettings.patternProperties[this.overridePropertyPattern]=e,t.applicationSettings.patternProperties[this.overridePropertyPattern]=e,t.machineSettings.patternProperties[this.overridePropertyPattern]=e,t.windowSettings.patternProperties[this.overridePropertyPattern]=e,
t.resourceSettings.patternProperties[this.overridePropertyPattern]=e,this._onDidSchemaChange.fire()}update(e){let t=e.properties;if(t)for(let e in t)t[e].overridable&&(this.editorConfigurationSchema.properties[e]=this.getConfigurationProperties()[e]);let n=e.allOf;n&&n.forEach(e=>this.update(e))}computeOverridePropertyPattern(){this.overridePropertyPattern=this.overrideIdentifiers.length?g.replace("${0}",this.overrideIdentifiers.map(e=>o.createRegExp(e,!1).source).join("|")):f}}const h="override",f="\\[.*\\]$",g="\\[(${0})\\]$";t.OVERRIDE_PROPERTY_PATTERN=new RegExp(f),t.getDefaultValue=l;const p=new d;r.Registry.add(t.Extensions.Configuration,p),t.validateProperty=c,t.getScopes=function(){const e={},t=p.getConfigurationProperties();for(const n of Object.keys(t))e[n]=t[n].scope;return e.launch=4,e.task=4,e}}),define(e[14],t([1,0,8,6,20,12,3,18]),function(e,t,n,i,r,s,o,a){"use strict";function l(e,t){const n=Object.create(null);for(let i in e)c(n,i,e[i],t);return n}function c(e,t,n,i){
const r=t.split("."),s=r.pop();let o=e;for(let e=0;e<r.length;e++){let n=r[e],s=o[n];switch(typeof s){case"undefined":s=o[n]=Object.create(null);break;case"object":break;default:return void i(`Ignoring ${t} as ${r.slice(0,e+1).join(".")} is ${JSON.stringify(s)}`)}o=s}"object"==typeof o?o[s]=n:i(`Ignoring ${t} as ${r.join(".")} is ${JSON.stringify(o)}`)}function u(e,t){const n=t.shift();if(0!==t.length){if(-1!==Object.keys(e).indexOf(n)){const i=e[n];"object"!=typeof i||Array.isArray(i)||(u(i,t),0===Object.keys(i).length&&delete e[n])}}else delete e[n]}function d(e,t,n){const i=function(e,t){let n=e;for(const e of t){if("object"!=typeof n||null===n)return;n=n[e]}return n}(e,t.split("."));return void 0===i?n:i}function h(e,t,n){Object.keys(t).forEach(r=>{r in e?i.isObject(e[r])&&i.isObject(t[r])?h(e[r],t[r],n):n&&(e[r]=t[r]):e[r]=t[r]})}function f(e){return e.substring(1,e.length-1)}Object.defineProperty(t,"__esModule",{value:!0}),t.IConfigurationService=o.createDecorator("configurationService"),
t.isConfigurationOverrides=function(e){return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof r.URI)};!function(e){e[e.USER=1]="USER",e[e.USER_LOCAL=2]="USER_LOCAL",e[e.USER_REMOTE=3]="USER_REMOTE",e[e.WORKSPACE=4]="WORKSPACE",e[e.WORKSPACE_FOLDER=5]="WORKSPACE_FOLDER",e[e.DEFAULT=6]="DEFAULT",e[e.MEMORY=7]="MEMORY"}(t.ConfigurationTarget||(t.ConfigurationTarget={})),t.ConfigurationTargetToString=function(e){switch(e){case 1:return"USER";case 2:return"USER_LOCAL";case 3:return"USER_REMOTE";case 4:return"WORKSPACE";case 5:return"WORKSPACE_FOLDER";case 6:return"DEFAULT";case 7:return"MEMORY"}},t.compare=function(e,t){const i=t.keys.filter(t=>-1===e.keys.indexOf(t)),r=e.keys.filter(e=>-1===t.keys.indexOf(e)),s=[];for(const i of e.keys){const r=d(e.contents,i),o=d(t.contents,i);n.equals(r,o)||s.push(i)}return{added:i,removed:r,updated:s}},t.toOverrides=function(e,t){
const n=[],i=s.Registry.as(a.Extensions.Configuration).getConfigurationProperties();for(const r of Object.keys(e))if(a.OVERRIDE_PROPERTY_PATTERN.test(r)){const s={};for(const t in e[r])i[t]&&i[t].overridable&&(s[t]=e[r][t]);n.push({identifiers:[f(r).trim()],contents:l(s,t)})}return n},t.toValuesTree=l,t.addToValueTree=c,t.removeFromValueTree=function(e,t){u(e,t.split("."))},t.getConfigurationValue=d,t.merge=h,t.getConfigurationKeys=function(){const e=s.Registry.as(a.Extensions.Configuration).getConfigurationProperties();return Object.keys(e)},t.getDefaultValues=function(){const e=Object.create(null),t=s.Registry.as(a.Extensions.Configuration).getConfigurationProperties();for(let n in t)c(e,n,t[n].default,e=>console.error(`Conflict in default settings: ${e}`));return e},t.overrideIdentifierFromKey=f,t.keyFromOverrideIdentifier=function(e){return`[${e}]`},t.getMigratedSettingValue=function(e,t,n){const i=e.inspect(t),r=e.inspect(n)
;return void 0!==i.user||void 0!==i.workspace||void 0!==i.workspaceFolder?i.value:void 0!==r.user||void 0!==r.workspace||void 0!==r.workspaceFolder?r.value:i.default}}),define(e[38],t([1,0,40,73,28,6,8,18,14,12]),function(e,t,n,i,r,s,o,a,l,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class u{constructor(e={},t=[],n=[]){this._contents=e,this._keys=t,this._overrides=n,this.isFrozen=!1}get contents(){return this.checkAndFreeze(this._contents)}get overrides(){return this.checkAndFreeze(this._overrides)}get keys(){return this.checkAndFreeze(this._keys)}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?l.getConfigurationValue(this.contents,e):this.contents}override(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;let n={};for(const e of r.distinct([...Object.keys(this.contents),...Object.keys(t)])){let i=this.contents[e],r=t[e]
;r&&("object"==typeof i&&"object"==typeof r?(i=o.deepClone(i),this.mergeContents(i,r)):i=r),n[e]=i}return new u(n)}merge(...e){const t=o.deepClone(this.contents),n=o.deepClone(this.overrides),i=[...this.keys];for(const s of e){this.mergeContents(t,s.contents);for(const e of s.overrides){const[t]=n.filter(t=>r.equals(t.identifiers,e.identifiers));t?this.mergeContents(t.contents,e.contents):n.push(o.deepClone(e))}for(const e of s.keys)-1===i.indexOf(e)&&i.push(e)}return new u(t,i,n)}freeze(){return this.isFrozen=!0,this}mergeContents(e,t){for(const n of Object.keys(t))n in e&&s.isObject(e[n])&&s.isObject(t[n])?this.mergeContents(e[n],t[n]):e[n]=o.deepClone(t[n])}checkAndFreeze(e){return this.isFrozen&&!Object.isFrozen(e)?o.deepFreeze(e):e}getContentsForOverrideIdentifer(e){for(const t of this.overrides)if(-1!==t.identifiers.indexOf(e))return t.contents;return null}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.addKey(e),l.addToValueTree(this.contents,e,t,e=>{
throw new Error(e)})}removeValue(e){this.removeKey(e)&&l.removeFromValueTree(this.contents,e)}addKey(e){let t=this.keys.length;for(let n=0;n<t;n++)0===e.indexOf(this.keys[n])&&(t=n);this.keys.splice(t,1,e)}removeKey(e){let t=this.keys.indexOf(e);return-1!==t&&(this.keys.splice(t,1),!0)}}t.ConfigurationModel=u;class d extends u{constructor(){const e=l.getDefaultValues(),t=l.getConfigurationKeys(),n=[];for(const t of Object.keys(e))a.OVERRIDE_PROPERTY_PATTERN.test(t)&&n.push({identifiers:[l.overrideIdentifierFromKey(t).trim()],contents:l.toValuesTree(e[t],e=>console.error(`Conflict in default settings file: ${e}`))});super(e,t,n)}}t.DefaultConfigurationModel=d;class h{constructor(e,t){this._name=e,this._scopes=t,this._raw=null,this._configurationModel=null,this._parseErrors=[]}get configurationModel(){return this._configurationModel||new u}get errors(){return this._parseErrors}parseContent(e){if(e){const t=this.doParseContent(e);this.parseRaw(t)}}parseRaw(e){this._raw=e;const t=this.doParseRaw(e)
;this._configurationModel=new u(t.contents,t.keys,t.overrides)}parse(){this._raw&&this.parseRaw(this._raw)}doParseContent(e){function t(e){Array.isArray(s)?s.push(e):r&&(s[r]=e)}let i={},r=null,s=[],o=[],a=[],l={onObjectBegin:()=>{let e={};t(e),o.push(s),s=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{s=o.pop()},onArrayBegin:()=>{let e=[];t(e),o.push(s),s=e,r=null},onArrayEnd:()=>{s=o.pop()},onLiteralValue:t,onError:(e,t,n)=>{a.push({error:e,offset:t,length:n})}};if(e)try{n.visit(e,l),i=s[0]||{}}catch(e){console.error(`Error while parsing settings file ${this._name}: ${e}`),this._parseErrors=[e]}return i}doParseRaw(e){if(this._scopes){const t=c.Registry.as(a.Extensions.Configuration).getConfigurationProperties();e=this.filterByScope(e,t,!0,this._scopes)}return{contents:l.toValuesTree(e,e=>console.error(`Conflict in settings file ${this._name}: ${e}`)),keys:Object.keys(e),overrides:l.toOverrides(e,e=>console.error(`Conflict in settings file ${this._name}: ${e}`))}}filterByScope(e,t,n,i){const r={}
;for(let s in e)if(a.OVERRIDE_PROPERTY_PATTERN.test(s)&&n)r[s]=this.filterByScope(e[s],t,!1,i);else{const n=this.getScope(s,t);-1!==i.indexOf(n)&&(r[s]=e[s])}return r}getScope(e,t){const n=t[e];return n&&void 0!==n.scope?n.scope:3}}t.ConfigurationModelParser=h;class f{constructor(e,t,n=new u,r=new u,s=new i.ResourceMap,o=new u,a=new i.ResourceMap,l=!0){this._defaultConfiguration=e,this._localUserConfiguration=t,this._remoteUserConfiguration=n,this._workspaceConfiguration=r,this._folderConfigurations=s,this._memoryConfiguration=o,this._memoryConfigurationByResource=a,this._freeze=l,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new i.ResourceMap}getValue(e,t,n){return this.getConsolidateConfigurationModel(t,n).getValue(e)}updateValue(e,t,n={}){let i;n.resource?(i=this._memoryConfigurationByResource.get(n.resource))||(i=new u,this._memoryConfigurationByResource.set(n.resource,i)):i=this._memoryConfiguration,void 0===t?i.removeValue(e):i.setValue(e,t),
n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){const i=this.getConsolidateConfigurationModel(t,n),r=this.getFolderConfigurationModelForResource(t.resource,n),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration;return{default:t.overrideIdentifier?this._defaultConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this._defaultConfiguration.freeze().getValue(e),user:t.overrideIdentifier?this.userConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this.userConfiguration.freeze().getValue(e),userLocal:t.overrideIdentifier?this.localUserConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this.localUserConfiguration.freeze().getValue(e),userRemote:t.overrideIdentifier?this.remoteUserConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this.remoteUserConfiguration.freeze().getValue(e),
workspace:n?t.overrideIdentifier?this._workspaceConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this._workspaceConfiguration.freeze().getValue(e):void 0,workspaceFolder:r?t.overrideIdentifier?r.freeze().override(t.overrideIdentifier).getValue(e):r.freeze().getValue(e):void 0,memory:t.overrideIdentifier?s.override(t.overrideIdentifier).getValue(e):s.getValue(e),value:i.getValue(e)}}keys(e){const t=this.getFolderConfigurationModelForResource(void 0,e);return{default:this._defaultConfiguration.freeze().keys,user:this.userConfiguration.freeze().keys,workspace:this._workspaceConfiguration.freeze().keys,workspaceFolder:t?t.freeze().keys:[]}}updateDefaultConfiguration(e){this._defaultConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(e){this._localUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}
updateRemoteUserConfiguration(e){this._remoteUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(e){this._workspaceConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(e,t){this._folderConfigurations.set(e,t),this._foldersConsolidatedConfigurations.delete(e)}deleteFolderConfiguration(e){this.folderConfigurations.delete(e),this._foldersConsolidatedConfigurations.delete(e)}get defaults(){return this._defaultConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration),this._freeze&&this._userConfiguration.freeze()),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){
return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidateConfigurationModel(e,t){let n=this.getConsolidatedConfigurationModelForResource(e,t);return e.overrideIdentifier?n.override(e.overrideIdentifier):n}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const i=t.getFolder(e);i&&(n=this.getFolderConsolidatedConfiguration(i.uri)||n);const r=this._memoryConfigurationByResource.get(e);r&&(n=n.merge(r))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration),this._freeze&&(this._workspaceConfiguration=this._workspaceConfiguration.freeze())),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){
let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const n=this.getWorkspaceConsolidatedConfiguration(),i=this._folderConfigurations.get(e);i?(t=n.merge(i),this._freeze&&(t=t.freeze()),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const n=t.getFolder(e);if(n)return s.withUndefinedAsNull(this._folderConfigurations.get(n.uri))}return null}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:this._folderConfigurations.keys().reduce((e,t)=>{const{contents:n,overrides:i,keys:r}=this._folderConfigurations.get(t);return e[t.toString()]={contents:n,overrides:i,
keys:r},e},Object.create({}))}}allKeys(e){let t=this.keys(e),n=[...t.default];const i=e=>{for(const t of e)-1===n.indexOf(t)&&n.push(t)};i(t.user),i(t.workspace);for(const e of this.folderConfigurations.keys())i(this.folderConfigurations.get(e).keys);return n}}t.Configuration=f;class g{doesConfigurationContains(e,t){let n,i=e.contents,r=l.toValuesTree({[t]:!0},()=>{});for(;"object"==typeof r&&(n=Object.keys(r)[0]);){if(!(i=i[n]))return!1;r=r[n]}return!0}updateKeys(e,t,n){for(const n of t)e.setValue(n,{})}}t.AbstractConfigurationChangeEvent=g;class p extends g{constructor(e=new u,t=new i.ResourceMap){super(),this._changedConfiguration=e,this._changedConfigurationByResource=t}get changedConfiguration(){return this._changedConfiguration}get changedConfigurationByResource(){return this._changedConfigurationByResource}change(e,t){if(e instanceof p){this._changedConfiguration=this._changedConfiguration.merge(e._changedConfiguration);for(const t of e._changedConfigurationByResource.keys()){
let n=this.getOrSetChangedConfigurationForResource(t);n=n.merge(e._changedConfigurationByResource.get(t)),this._changedConfigurationByResource.set(t,n)}}else this.changeWithKeys(e,t);return this}telemetryData(e,t){return this._source=e,this._sourceConfig=t,this}get affectedKeys(){const e=[...this._changedConfiguration.keys];return this._changedConfigurationByResource.forEach(t=>e.push(...t.keys)),r.distinct(e)}get source(){return this._source}get sourceConfig(){return this._sourceConfig}affectsConfiguration(e,t){let n=[this._changedConfiguration];if(t){let e=this._changedConfigurationByResource.get(t);e&&n.push(e)}else n.push(...this._changedConfigurationByResource.values());for(const t of n)if(this.doesConfigurationContains(t,e))return!0;return!1}changeWithKeys(e,t){let n=t?this.getOrSetChangedConfigurationForResource(t):this._changedConfiguration;this.updateKeys(n,e)}getOrSetChangedConfigurationForResource(e){let t=this._changedConfigurationByResource.get(e);return t||(t=new u,
this._changedConfigurationByResource.set(e,t)),t}}t.ConfigurationChangeEvent=p}),define(e[74],t([1,0,7,19,38,53,9]),function(e,t,n,i,r,s,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class a extends n.Disposable{constructor(e){super(),this.settingsPath=e,this._onDidChangeConfiguration=this._register(new o.Emitter),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event}initialize(){return this.initializePromise||(this.initializePromise=new Promise((e,t)=>{this.userConfigModelWatcher=new s.ConfigWatcher(this.settingsPath,{changeBufferDelay:300,onError:e=>i.onUnexpectedError(e),defaultConfig:new r.ConfigurationModelParser(this.settingsPath),parse:(e,t)=>{const n=new r.ConfigurationModelParser(this.settingsPath);return n.parseContent(e),[...n.errors],n},initCallback:()=>e(void 0)}),this._register(this.userConfigModelWatcher),
this._register(this.userConfigModelWatcher.onDidUpdateConfiguration(()=>this._onDidChangeConfiguration.fire(this.userConfigModelWatcher.getConfig().configurationModel)))})),this.initializePromise.then(()=>this.userConfigModelWatcher.getConfig().configurationModel)}initializeSync(){return this.initialize(),this.userConfigModelWatcher.getConfig().configurationModel}reload(){return this.initialize().then(()=>new Promise(e=>this.userConfigModelWatcher.reload(t=>e(t.configurationModel))))}getConfigurationModel(){return this.userConfigModelWatcher.getConfig().configurationModel}}t.NodeBasedUserConfiguration=a}),define(e[75],t([1,0,12,18,7,14,38,9,74]),function(e,t,n,i,r,s,o,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class c extends r.Disposable{constructor(e){super(),this._onDidChangeConfiguration=this._register(new a.Emitter),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.userConfiguration=this._register(new l.NodeBasedUserConfiguration(e))
;const t=new o.DefaultConfigurationModel,r=this.userConfiguration.initializeSync();this._configuration=new o.Configuration(t,r),this._register(this.userConfiguration.onDidChangeConfiguration(e=>this.onDidChangeUserConfiguration(e))),this._register(n.Registry.as(i.Extensions.Configuration).onDidUpdateConfiguration(e=>this.onDidDefaultConfigurationChange(e)))}get configuration(){return this._configuration}getConfigurationData(){return this.configuration.toData()}getValue(e,t){const n="string"==typeof e?e:void 0,i=s.isConfigurationOverrides(e)?e:s.isConfigurationOverrides(t)?t:{};return this.configuration.getValue(n,i,void 0)}updateValue(e,t,n,i){return Promise.reject(new Error("not supported"))}inspect(e){return this.configuration.inspect(e,{},void 0)}keys(){return this.configuration.keys(void 0)}reloadConfiguration(e){return e?Promise.resolve(void 0):this.userConfiguration.reload().then(e=>this.onDidChangeUserConfiguration(e))}onDidChangeUserConfiguration(e){
const{added:t,updated:n,removed:i}=s.compare(this._configuration.localUserConfiguration,e),r=[...t,...n,...i];r.length&&(this._configuration.updateLocalUserConfiguration(e),this.trigger(r,1))}onDidDefaultConfigurationChange(e){this._configuration.updateDefaultConfiguration(new o.DefaultConfigurationModel),this.trigger(e,6)}trigger(e,t){this._onDidChangeConfiguration.fire((new o.ConfigurationChangeEvent).change(e).telemetryData(t,this.getTargetConfiguration(t)))}getTargetConfiguration(e){switch(e){case 6:return this._configuration.defaults.contents;case 1:return this._configuration.localUserConfiguration.contents}return{}}}t.ConfigurationService=c}),define(e[39],t([1,0,79,3,18,12]),function(e,t,n,i,r,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IRequestService=i.createDecorator("requestService"),s.Registry.as(r.Extensions.Configuration).registerConfiguration({id:"http",order:15,title:n.localize(0,null),type:"object",properties:{"http.proxy":{type:"string",
pattern:"^https?://([^:]*(:[^@]*)?@)?([^:]+)(:\\d+)?/?$|^$",description:n.localize(1,null)},"http.proxyStrictSSL":{type:"boolean",default:!0,description:n.localize(2,null)},"http.proxyAuthorization":{type:["null","string"],default:null,description:n.localize(3,null)},"http.proxySupport":{type:"string",enum:["off","on","override"],enumDescriptions:[n.localize(4,null),n.localize(5,null),n.localize(6,null)],default:"override",description:n.localize(7,null)},"http.systemCertificates":{type:"boolean",default:!0,description:n.localize(8,null)}}})}),define(e[77],t([1,0,3]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IStateService=n.createDecorator("stateService")}),define(e[78],t([1,0,2,15,16,4,6,5]),function(e,t,s,o,a,l,c,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class d{constructor(e,t){this.dbPath=e,this.onError=t,this._database=null,this.lastFlushedSerializedDatabase=null}get database(){return this._database||(this._database=this.loadSync()),
this._database}init(){return n(this,void 0,void 0,function*(){try{const e=yield l.readFile(this.dbPath);try{this.lastFlushedSerializedDatabase=e.toString(),this._database=JSON.parse(this.lastFlushedSerializedDatabase)}catch(e){this._database={}}}catch(e){"ENOENT"!==e.code&&this.onError(e),this._database={}}})}loadSync(){try{return this.lastFlushedSerializedDatabase=o.readFileSync(this.dbPath).toString(),JSON.parse(this.lastFlushedSerializedDatabase)}catch(e){return"ENOENT"!==e.code&&this.onError(e),{}}}getItem(e,t){const n=this.database[e];return c.isUndefinedOrNull(n)?t:n}setItem(e,t){if(c.isUndefinedOrNull(t))return this.removeItem(e);("string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t||this.database[e]!==t)&&(this.database[e]=t,this.saveSync())}removeItem(e){c.isUndefined(this.database[e])||(this.database[e]=void 0,this.saveSync())}saveSync(){const e=JSON.stringify(this.database,null,4);if(e!==this.lastFlushedSerializedDatabase)try{l.writeFileSync(this.dbPath,e),
this.lastFlushedSerializedDatabase=e}catch(e){this.onError(e)}}}t.FileStorage=d;let h=class e{constructor(t,n){this.fileStorage=new d(s.join(t.userDataPath,e.STATE_FILE),e=>n.error(e))}init(){return this.fileStorage.init()}getItem(e,t){return this.fileStorage.getItem(e,t)}setItem(e,t){this.fileStorage.setItem(e,t)}removeItem(e){this.fileStorage.removeItem(e)}};h.STATE_FILE="storage.json",h=i([r(0,a.IEnvironmentService),r(1,u.ILogService)],h),t.StateService=h}),define(e[30],t([1,0,3]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITelemetryService=n.createDecorator("telemetryService")}),define(e[80],t([1,0,85,13,3,14,18,7,8,12]),function(e,t,s,o,a,l,c,u,d,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let f=class{constructor(e,t){this._configurationService=t,this._disposables=[],this._cleanupPatterns=[],this._appender=e.appender,this._commonProperties=e.commonProperties||Promise.resolve({}),this._piiPaths=e.piiPaths||[],this._userOptIn=!0,this._enabled=!0,
this._cleanupPatterns=[/file:\/\/\/.*?\/resources\/app\//gi];for(let e of this._piiPaths)this._cleanupPatterns.push(new RegExp(o.escapeRegExpCharacters(e),"gi"));this._configurationService&&(this._updateUserOptIn(),this._configurationService.onDidChangeConfiguration(this._updateUserOptIn,this,this._disposables),this.publicLog("optInStatus",{optIn:this._userOptIn}),this._commonProperties.then(e=>{const t=/^[a-f0-9]+$/i.test(e["common.machineId"]);this.publicLog("machineIdFallback",{usingFallbackGuid:!t})}))}setEnabled(e){this._enabled=e}_updateUserOptIn(){const e=this._configurationService.getValue(g);this._userOptIn=e?e.enableTelemetry:this._userOptIn}get isOptedIn(){return this._userOptIn&&this._enabled}getTelemetryInfo(){return n(this,void 0,void 0,function*(){const e=yield this._commonProperties;return{sessionId:e.sessionID,instanceId:e["common.instanceId"],machineId:e["common.machineId"]}})}dispose(){this._disposables=u.dispose(this._disposables)}publicLog(e,t,n){
return this.isOptedIn?this._commonProperties.then(i=>{t=d.mixin(t,i),t=d.cloneAndChange(t,e=>{if("string"==typeof e)return this._cleanupInfo(e,n)}),this._appender.log(e,t)},e=>{console.error(e)}):Promise.resolve(void 0)}_cleanupInfo(e,t){let n=e;if(t){const t=[];for(let n of this._cleanupPatterns)for(;;){const i=n.exec(e);if(!i)break;t.push([i.index,n.lastIndex])}const i=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,r=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let s=0;for(n="";;){const o=r.exec(e);if(!o)break;!i.test(o[0])&&t.every(([e,t])=>o.index<e||o.index>=t)&&(n+=e.substring(s,o.index)+"<REDACTED: user-file-path>",s=r.lastIndex)}s<e.length&&(n+=e.substr(s))}for(let e of this._cleanupPatterns)n=n.replace(e,"");return n}};f.IDLE_START_EVENT_NAME="UserIdleStart",f.IDLE_STOP_EVENT_NAME="UserIdleStop",f=i([r(1,a.optional(l.IConfigurationService))],f),t.TelemetryService=f;const g="telemetry";h.Registry.as(c.Extensions.Configuration).registerConfiguration({id:g,
order:110,type:"object",title:s.localize(0,null),properties:{"telemetry.enableTelemetry":{type:"boolean",description:s.localize(1,null),default:!0,tags:["usesOnlineServices"]}}})}),define(e[81],t([1,0,14,5]),function(e,t,n,s){"use strict";function o(e,t){return t.onDidChangeConfiguration(t=>{6!==t.source&&(e.publicLog("updateConfiguration",{configurationSource:n.ConfigurationTargetToString(t.source),configurationKeys:function(e){if(!e)return[];const t=[];return a(t,"",e),t}(t.sourceConfig)}),e.publicLog("updateConfigurationValues",{configurationSource:n.ConfigurationTargetToString(t.source),configurationValues:function(e,t){if(!e)return[];return t.reduce((t,n)=>{const i=n.split(".").reduce((e,t)=>e&&"object"==typeof e?e[t]:void 0,e);return void 0!==i&&t.push({[n]:i}),t},[])}(t.sourceConfig,c)}))})}function a(e,t,n){n&&"object"==typeof n&&!Array.isArray(n)?Object.keys(n).forEach(i=>a(e,t?`${t}.${i}`:i,n[i])):e.push(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.NullTelemetryService=new class{
publicLog(e,t){return Promise.resolve(void 0)}setEnabled(){}getTelemetryInfo(){return Promise.resolve({instanceId:"someValue.instanceId",sessionId:"someValue.sessionId",machineId:"someValue.machineId"})}},t.combinedAppender=function(...e){return{log:(t,n)=>e.forEach(e=>e.log(t,n)),dispose:()=>Promise.all(e.map(e=>e.dispose()))}},t.NullAppender={log:()=>null,dispose:()=>Promise.resolve(null)};let l=class{constructor(e){this._logService=e,this.commonPropertiesRegex=/^sessionID$|^version$|^timestamp$|^commitHash$|^common\./}dispose(){return Promise.resolve(void 0)}log(e,t){const n={};Object.keys(t).forEach(e=>{this.commonPropertiesRegex.test(e)||(n[e]=t[e])}),this._logService.trace(`telemetry/${e}`,n)}};l=i([r(0,s.ILogService)],l),t.LogAppender=l
;const c=["editor.fontFamily","editor.fontWeight","editor.fontSize","editor.lineHeight","editor.letterSpacing","editor.lineNumbers","editor.rulers","editor.wordSeparators","editor.tabSize","editor.indentSize","editor.insertSpaces","editor.detectIndentation","editor.roundedSelection","editor.scrollBeyondLastLine","editor.minimap.enabled","editor.minimap.side","editor.minimap.renderCharacters","editor.minimap.maxColumn","editor.find.seedSearchStringFromSelection","editor.find.autoFindInSelection","editor.wordWrap","editor.wordWrapColumn","editor.wrappingIndent","editor.mouseWheelScrollSensitivity","editor.multiCursorModifier","editor.quickSuggestions","editor.quickSuggestionsDelay","editor.parameterHints.enabled","editor.parameterHints.cycle","editor.autoClosingBrackets","editor.autoClosingQuotes","editor.autoSurround","editor.autoIndent","editor.formatOnType","editor.formatOnPaste","editor.suggestOnTriggerCharacters","editor.acceptSuggestionOnEnter","editor.acceptSuggestionOnCommitCharacter","editor.snippetSuggestions","editor.emptySelectionClipboard","editor.wordBasedSuggestions","editor.suggestSelection","editor.suggestFontSize","editor.suggestLineHeight","editor.tabCompletion","editor.selectionHighlight","editor.occurrencesHighlight","editor.overviewRulerLanes","editor.overviewRulerBorder","editor.cursorBlinking","editor.cursorSmoothCaretAnimation","editor.cursorStyle","editor.mouseWheelZoom","editor.fontLigatures","editor.hideCursorInOverviewRuler","editor.renderWhitespace","editor.renderControlCharacters","editor.renderIndentGuides","editor.renderLineHighlight","editor.codeLens","editor.folding","editor.showFoldingControls","editor.matchBrackets","editor.glyphMargin","editor.useTabStops","editor.trimAutoWhitespace","editor.stablePeek","editor.dragAndDrop","editor.formatOnSave","editor.colorDecorators","breadcrumbs.enabled","breadcrumbs.filePath","breadcrumbs.symbolPath","breadcrumbs.symbolSortOrder","breadcrumbs.useQuickPick","explorer.openEditors.visible","extensions.autoUpdate","files.associations","files.autoGuessEncoding","files.autoSave","files.autoSaveDelay","files.encoding","files.eol","files.hotExit","files.trimTrailingWhitespace","git.confirmSync","git.enabled","http.proxyStrictSSL","javascript.validate.enable","php.builtInCompletions.enable","php.validate.enable","php.validate.run","terminal.integrated.fontFamily","window.openFilesInNewWindow","window.restoreWindows","window.zoomLevel","workbench.editor.enablePreview","workbench.editor.enablePreviewFromQuickOpen","workbench.editor.showTabs","workbench.editor.highlightModifiedTabs","workbench.editor.swipeToNavigate","workbench.sideBar.location","workbench.startupEditor","workbench.statusBar.visible","workbench.welcome.enabled"]
;t.configurationTelemetry=o,t.keybindingsTelemetry=function(e,t){return t.onDidUpdateKeybindings(t=>{2===t.source&&t.keybindings&&e.publicLog("updateKeybindings",{bindings:t.keybindings.map(e=>({key:e.key,command:e.command,when:e.when,args:!!e.args||void 0}))})})}}),define(e[82],t([1,0,91,6,8,5]),function(e,t,n,s,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let l=class e{constructor(e,t,i,r){this._eventPrefix=e,this._defaultData=t,this._logService=r,this._defaultData||(this._defaultData=Object.create(null)),"string"==typeof i?this._aiClient=function(e){let t;return n.defaultClient?(t=new n.TelemetryClient(e)).channel.setUseDiskRetryCaching(!0):(n.setup(e).setAutoCollectRequests(!1).setAutoCollectPerformance(!1).setAutoCollectExceptions(!1).setAutoCollectDependencies(!1).setAutoDependencyCorrelation(!1).setAutoCollectConsole(!1).setInternalLogging(!1,!1).setUseDiskRetryCaching(!0).start(),t=n.defaultClient),
0===e.indexOf("AIF-")&&(t.config.endpointUrl="https://vortex.data.microsoft.com/collect/v1"),t}(i):"function"==typeof i&&(this._aiClient=i())}static _getData(t){const n=Object.create(null),i=Object.create(null),r=Object.create(null);e._flaten(t,r);for(let e in r){const t=r[e=e.length>150?e.substr(e.length-149):e];"number"==typeof t?i[e]=t:"boolean"==typeof t?i[e]=t?1:0:"string"==typeof t?n[e]=t.substring(0,1023):void 0!==t&&null!==t&&(n[e]=t)}return{properties:n,measurements:i}}static _flaten(t,n,i=0,r){if(t)for(let a of Object.getOwnPropertyNames(t)){const l=t[a],c=r?r+a:a;Array.isArray(l)?n[c]=o.safeStringify(l):l instanceof Date?n[c]=l.toISOString():s.isObject(l)?i<2?e._flaten(l,n,i+1,c+"."):n[c]=o.safeStringify(l):n[c]=l}}log(t,n){this._aiClient&&(n=o.mixin(n,this._defaultData),n=e._getData(n),this._logService&&this._logService.trace(`telemetry/${t}`,n),this._aiClient.trackEvent({name:this._eventPrefix+"/"+t,properties:n.properties,measurements:n.measurements}))}dispose(){
if(this._aiClient)return new Promise(e=>{this._aiClient.flush({callback:()=>{this._aiClient=void 0,e(void 0)}})})}};l=i([r(3,a.ILogService)],l),t.AppInsightsAppender=l}),define(e[84],t([1,0,17,29,41,4]),function(e,t,i,r,s,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveCommonProperties=function(e,t,a,l,c){return n(this,void 0,void 0,function*(){const n=Object.create(null);n["common.machineId"]=a,n.sessionID=s.generateUuid()+Date.now(),n.commitHash=e,n.version=t,n["common.platformVersion"]=(r.release()||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),n["common.platform"]=i.PlatformToString(i.platform),n["common.nodePlatform"]=process.platform,n["common.nodeArch"]=process.arch,n["common.product"]=c||"desktop";let u=0;const d=Date.now();Object.defineProperties(n,{timestamp:{get:()=>new Date,enumerable:!0},"common.timesincesessionstart":{get:()=>Date.now()-d,enumerable:!0},"common.sequence":{get:()=>u++,enumerable:!0}}),
"linux"===process.platform&&process.env.SNAP&&process.env.SNAP_REVISION&&(n["common.snap"]="true");try{const e=yield o.readFile(l,"utf8");n["common.source"]=e.slice(0,30)}catch(e){}return n})}}),define(e[42],t([1,0,66,2,15,25,4,90,89,9]),function(e,t,n,i,r,s,o,a,l,c){"use strict";function u(e){if(e instanceof p)return e;let t=void 0;return/end of central directory record signature not found/.test(e.message)&&(t="CorruptZip"),new p(t,e)}function d(e,t,a,l){let u=s.createCancelablePromise(()=>Promise.resolve()),d=0;return c.Event.once(l.onCancellationRequested)(()=>{u.cancel(),e.close()}),new Promise((h,g)=>{const m=new s.Sequencer,v=t=>{t.isCancellationRequested||(d++,e.readEntry())};e.once("error",g),e.once("close",()=>u.then(()=>{l.isCancellationRequested||e.entryCount===d?h():g(new p("Incomplete",new Error(n.localize(1,null,d,e.entryCount))))},g)),e.readEntry(),e.on("entry",d=>{if(l.isCancellationRequested)return;if(!a.sourcePathRegex.test(d.fileName))return void v(l)
;const h=d.fileName.replace(a.sourcePathRegex,"");if(/\/$/.test(h)){const e=i.join(t,h);return void(u=s.createCancelablePromise(t=>o.mkdirp(e,void 0,t).then(()=>v(t)).then(void 0,g)))}const p=f(e,d),y=function(e){const t=e.externalFileAttributes>>16||33188;return[448,56,7].map(e=>t&e).reduce((e,t)=>e+t,61440&t)}(d);u=s.createCancelablePromise(e=>m.queue(()=>p.then(s=>(function(e,t,s,a,l,u){const d=i.dirname(t),h=i.join(a,d);if(0!==h.indexOf(a))return Promise.reject(new Error(n.localize(0,null,t)));const f=i.join(a,t);let g;return c.Event.once(u.onCancellationRequested)(()=>{g&&g.destroy()}),Promise.resolve(o.mkdirp(h,void 0,u)).then(()=>new Promise((t,n)=>{if(!u.isCancellationRequested)try{(g=r.createWriteStream(f,{mode:s})).once("close",()=>t()),g.once("error",n),e.once("error",n),e.pipe(g)}catch(e){n(e)}}))})(s,h,y,t,0,e).then(()=>v(e)))).then(null,g))})})}function h(e,t=!1){return new Promise((n,i)=>{a.open(e,t?{lazyEntries:!0}:void 0,(e,t)=>{e?i(u(e)):n(t)})})}function f(e,t){return new Promise((n,i)=>{
e.openReadStream(t,(e,t)=>{e?i(u(e)):n(t)})})}function g(e,t){return function(e,t){return h(e).then(e=>new Promise((i,r)=>{e.on("entry",n=>{n.fileName===t&&f(e,n).then(e=>i(e),e=>r(e))}),e.once("close",()=>r(new Error(n.localize(2,null,t))))}))}(e,t).then(e=>new Promise((t,n)=>{const i=[];e.once("error",n),e.on("data",e=>i.push(e)),e.on("end",()=>t(Buffer.concat(i)))}))}Object.defineProperty(t,"__esModule",{value:!0});class p extends Error{constructor(e,t){let n=t.message;switch(e){case"CorruptZip":n=`Corrupt ZIP: ${n}`}super(n),this.type=e,this.cause=t}}t.ExtractError=p,t.zip=function(e,t){return new Promise((n,i)=>{const s=new l.ZipFile;t.forEach(e=>{e.contents?s.addBuffer("string"==typeof e.contents?Buffer.from(e.contents,"utf8"):e.contents,e.path):e.localPath&&s.addFile(e.localPath,e.path)}),s.end();const o=r.createWriteStream(e);s.outputStream.pipe(o),s.outputStream.once("error",i),o.once("error",i),o.once("finish",()=>n(e))})},t.extract=function(e,t,n={},i){
const r=new RegExp(n.sourcePath?`^${n.sourcePath}`:"");let s=h(e,!0);return n.overwrite&&(s=s.then(e=>o.rimraf(t).then(()=>e))),s.then(e=>d(e,t,{sourcePathRegex:r},i))},t.buffer=g}),define(e[43],t([1,0,42,72]),function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getManifest=function(e){return n.buffer(e,"extension/package.json").then(e=>{try{return JSON.parse(e.toString("utf8"))}catch(e){throw new Error(i.localize(0,null))}})}}),define(e[87],t([1,0,71,2,4,8,7,28,42,24,21,86,16,25,9,83,20,22,17,5,48,88,32,30,31,29,41,51,3,23,34,35,43]),function(e,t,s,o,a,l,c,u,d,h,f,g,p,m,v,y,S,E,C,x,b,_,P,w,I,k,O,L,D,T,j,R,A){"use strict";function M(e){return new Promise((t,n)=>{try{const i=JSON.parse(e),r=i.__metadata||null;delete i.__metadata,t({manifest:i,metadata:r})}catch(e){n(new Error(s.localize(0,null)))}})}Object.defineProperty(t,"__esModule",{value:!0});class U extends Error{constructor(e,t){super(e),this.code=t}}t.ExtensionManagementError=U;let z=class extends c.Disposable{
constructor(e,t,n,i,r){super(),this.environmentService=e,this.galleryService=t,this.logService=n,this.downloadService=i,this.telemetryService=r,this.lastReportTimestamp=0,this.installingExtensions=new Map,this.uninstallingExtensions=new Map,this._onInstallExtension=new v.Emitter,this.onInstallExtension=this._onInstallExtension.event,this._onDidInstallExtension=new v.Emitter,this.onDidInstallExtension=this._onDidInstallExtension.event,this._onUninstallExtension=new v.Emitter,this.onUninstallExtension=this._onUninstallExtension.event,this._onDidUninstallExtension=new v.Emitter,this.onDidUninstallExtension=this._onDidUninstallExtension.event,this._devSystemExtensionsPath=null,this._devSystemExtensionsFilePath=null,this.systemExtensionsPath=e.builtinExtensionsPath,this.extensionsPath=e.extensionsPath,this.uninstalledPath=o.join(this.extensionsPath,".obsolete"),this.uninstalledFileLimiter=new m.Queue,this.manifestCache=this._register(new b.ExtensionsManifestCache(e,this)),
this.extensionLifecycle=this._register(new _.ExtensionsLifecycle(e,this.logService)),this._register(c.toDisposable(()=>{this.installingExtensions.forEach(e=>e.cancel()),this.uninstallingExtensions.forEach(e=>e.cancel()),this.installingExtensions.clear(),this.uninstallingExtensions.clear()}))}zip(e){return this.logService.trace("ExtensionManagementService#zip",e.identifier.id),this.collectFiles(e).then(e=>d.zip(o.join(k.tmpdir(),O.generateUuid()),e)).then(e=>S.URI.file(e))}unzip(e,t){return this.logService.trace("ExtensionManagementService#unzip",e.toString()),this.install(e,t)}collectFiles(e){const t=e=>n(this,void 0,void 0,function*(){let n=yield a.readdir(e);n=n.map(t=>o.join(e,t));const i=yield Promise.all(n.map(e=>a.stat(e)));let r=Promise.resolve([]);return i.forEach((e,i)=>{const s=n[i];e.isFile()&&(r=r.then(e=>[...e,s])),e.isDirectory()&&(r=r.then(e=>t(s).then(t=>[...e,...t])))}),r});return t(e.location.fsPath).then(t=>t.map(t=>({path:`extension/${o.relative(e.location.fsPath,t)}`,localPath:t})))}
install(e,t=1){return this.logService.trace("ExtensionManagementService#install",e.toString()),m.createCancelablePromise(n=>this.downloadVsix(e).then(e=>{const i=o.resolve(e.fsPath);return A.getManifest(i).then(e=>{const r={id:f.getGalleryExtensionId(e.publisher,e.name)};let o=1;if(e.engines&&e.engines.vscode&&!I.isEngineValid(e.engines.vscode))return Promise.reject(new Error(s.localize(1,null,r.id,E.default.version)));const a=new f.ExtensionIdentifierWithVersion(r,e.version);return this.getInstalled(1).then(t=>{const n=t.filter(e=>f.areSameExtensions(r,e.identifier))[0];if(n){if(o=2,a.equals(new f.ExtensionIdentifierWithVersion(n.identifier,n.manifest.version)))return this.removeExtension(n,"existing").then(null,t=>Promise.reject(new Error(s.localize(2,null,e.displayName||e.name))));if(y.gt(n.manifest.version,e.version))return this.uninstall(n,!0)}}).then(()=>(this.logService.info("Installing the extension:",r.id),this._onInstallExtension.fire({identifier:r,zipPath:i}),
this.getMetadata(f.getGalleryExtensionId(e.publisher,e.name)).then(e=>this.installFromZipPath(a,i,e,t,o,n),()=>this.installFromZipPath(a,i,null,t,o,n)).then(()=>(this.logService.info("Successfully installed the extension:",r.id),r),e=>(this.logService.error("Failed to install the extension:",r.id,e.message),Promise.reject(e)))))})}))}downloadVsix(e){if(e.scheme===T.Schemas.file)return Promise.resolve(e);if(!this.downloadService)throw new Error("Download service is not available");const t=o.join(k.tmpdir(),O.generateUuid());return this.downloadService.download(e,t).then(()=>S.URI.file(t))}installFromZipPath(e,t,n,i,r,s){return this.toNonCancellablePromise(this.installExtension({zipPath:t,identifierWithVersion:e,metadata:n},i,s).then(e=>this.installDependenciesAndPackExtensions(e,null).then(()=>e,t=>(u.isNonEmptyArray(e.manifest.extensionDependencies)&&this.logService.warn("Cannot install dependencies of extension:",e.identifier.id,t.message),
u.isNonEmptyArray(e.manifest.extensionPack)&&this.logService.warn("Cannot install packed extensions of extension:",e.identifier.id,t.message),e))).then(n=>(this._onDidInstallExtension.fire({identifier:e.identifier,zipPath:t,local:n,operation:r}),n),n=>(this._onDidInstallExtension.fire({identifier:e.identifier,zipPath:t,operation:r,error:n}),Promise.reject(n))))}installFromGallery(e){return n(this,void 0,void 0,function*(){const t=(new Date).getTime();this.logService.info("Installing extension:",e.identifier.id),this._onInstallExtension.fire({identifier:e.identifier,gallery:e});const i=(e,n,i)=>{const r=i&&i.code?i.code:"unknown";this.logService.error("Failed to install extension:",e.identifier.id,i?i.message:r),this._onDidInstallExtension.fire({identifier:e.identifier,gallery:e,operation:n,error:r}),this.reportTelemetry(this.getTelemetryEvent(n),f.getGalleryExtensionTelemetryData(e),(new Date).getTime()-t,i),i instanceof Error&&(i.name=r)};try{e=yield this.checkAndGetCompatibleVersion(e)}catch(t){
return i(e,1,t),Promise.reject(t)}const r=new f.ExtensionIdentifierWithVersion(e.identifier,e.version).key();let s=this.installingExtensions.get(r);if(!s){let o,l,c,u=1;s=m.createCancelablePromise(e=>(o=e,new Promise((e,t)=>{l=e,c=t}))),this.installingExtensions.set(r,s);try{const s=(yield this.getInstalled(1)).filter(t=>f.areSameExtensions(t.identifier,e.identifier))[0];s&&(u=2),this.downloadInstallableExtension(e,u).then(e=>this.installExtension(e,1,o).then(t=>a.rimraf(e.zipPath).finally(()=>null).then(()=>t))).then(e=>this.installDependenciesAndPackExtensions(e,s).then(()=>e,t=>this.uninstall(e,!0).then(()=>Promise.reject(t),()=>Promise.reject(t)))).then(i=>n(this,void 0,void 0,function*(){s&&y.neq(s.manifest.version,e.version)&&(yield this.setUninstalled(s)),this.installingExtensions.delete(r),((e,n,i)=>{this.logService.info("Extensions installed successfully:",e.identifier.id),this._onDidInstallExtension.fire({identifier:e.identifier,gallery:e,local:i,operation:n}),
this.reportTelemetry(this.getTelemetryEvent(n),f.getGalleryExtensionTelemetryData(e),(new Date).getTime()-t,void 0)})(e,u,i),l(null)}),t=>{this.installingExtensions.delete(r),i(e,u,t),c(t)})}catch(t){return this.installingExtensions.delete(r),i(e,u,t),Promise.reject(t)}}return s})}checkAndGetCompatibleVersion(e){return n(this,void 0,void 0,function*(){if(yield this.isMalicious(e))return Promise.reject(new U(s.localize(3,null),h.INSTALL_ERROR_MALICIOUS));const t=yield this.galleryService.getCompatibleExtension(e);return t||Promise.reject(new U(s.localize(4,null,e.identifier.id,E.default.version),h.INSTALL_ERROR_INCOMPATIBLE))})}reinstallFromGallery(e){return this.logService.trace("ExtensionManagementService#reinstallFromGallery",e.identifier.id),
this.galleryService.isEnabled()?this.findGalleryExtension(e).then(t=>t?this.setUninstalled(e).then(()=>this.removeUninstalledExtension(e).then(()=>this.installFromGallery(t),e=>Promise.reject(new Error(s.localize(6,null,P.toErrorMessage(e)))))):Promise.reject(new Error(s.localize(7,null)))):Promise.reject(new Error(s.localize(5,null)))}getTelemetryEvent(e){return 2===e?"extensionGallery:update":"extensionGallery:install"}isMalicious(e){return this.getExtensionsReport().then(t=>f.getMaliciousExtensionsSet(t).has(e.identifier.id))}downloadInstallableExtension(e,t){const n={id:e.identifier.uuid,publisherId:e.publisherId,publisherDisplayName:e.publisherDisplayName};return this.logService.trace("Started downloading extension:",e.identifier.id),this.galleryService.download(e,t).then(t=>(this.logService.info("Downloaded extension:",e.identifier.id,t),A.getManifest(t).then(i=>({zipPath:t,identifierWithVersion:new f.ExtensionIdentifierWithVersion(e.identifier,i.version),metadata:n
}),e=>Promise.reject(new U(this.joinErrors(e).message,"validating")))),e=>Promise.reject(new U(this.joinErrors(e).message,"downloading")))}installExtension(e,t,n){return this.unsetUninstalledAndGetLocal(e.identifierWithVersion).then(i=>i||this.extractAndInstall(e,t,n),e=>C.isMacintosh?Promise.reject(new U(s.localize(8,null),"unsetUninstalled")):Promise.reject(new U(s.localize(9,null),"unsetUninstalled")))}unsetUninstalledAndGetLocal(e){return this.isUninstalled(e).then(t=>t?(this.logService.trace("Removing the extension from uninstalled list:",e.identifier.id),this.unsetUninstalled(e).then(()=>(this.logService.info("Removed the extension from uninstalled list:",e.identifier.id),this.getInstalled(1))).then(t=>t.filter(t=>new f.ExtensionIdentifierWithVersion(t.identifier,t.manifest.version).equals(e))[0])):null)}extractAndInstall({zipPath:e,identifierWithVersion:t,metadata:n},i,r){const{identifier:l}=t,c=1===i?this.extensionsPath:this.systemExtensionsPath,u=t.key(),d=o.join(c,`.${u}`),h=o.join(c,u)
;return a.rimraf(h).then(()=>this.extractAndRename(l,e,d,h,r),e=>Promise.reject(new U(s.localize(10,null,h,l.id),"deleting"))).then(()=>this.scanExtension(u,c,i)).then(e=>e?(this.logService.info("Installation completed.",l.id),n?(e.metadata=n,this.saveMetadataForLocalExtension(e)):e):Promise.reject(s.localize(11,null,c)),e=>a.rimraf(h).then(()=>Promise.reject(e),()=>Promise.reject(e)))}extractAndRename(e,t,n,i,r){return this.extract(e,t,n,r).then(()=>this.rename(e,n,i,Date.now()+12e4).then(()=>this.logService.info("Renamed to",i),e=>(this.logService.info("Rename failed. Deleting from extracted location",n),a.rimraf(n).finally(()=>null).then(()=>Promise.reject(e)))))}extract(e,t,n,i){return this.logService.trace(`Started extracting the extension from ${t} to ${n}`),a.rimraf(n).then(()=>d.extract(t,n,{sourcePath:"extension",overwrite:!0
},i).then(()=>this.logService.info(`Extracted extension to ${n}:`,e.id),e=>a.rimraf(n).finally(()=>null).then(()=>Promise.reject(new U(e.message,e instanceof d.ExtractError&&e.type?e.type:"extracting")))),e=>Promise.reject(new U(this.joinErrors(e).message,"deleting")))}rename(e,t,n,i){return a.rename(t,n).then(void 0,r=>C.isWindows&&r&&"EPERM"===r.code&&Date.now()<i?(this.logService.info(`Failed renaming ${t} to ${n} with 'EPERM' error. Trying again...`,e.id),this.rename(e,t,n,i)):Promise.reject(new U(r.message||s.localize(12,null,t,n),r.code||"renaming")))}installDependenciesAndPackExtensions(e,t){return n(this,void 0,void 0,function*(){if(this.galleryService.isEnabled()){const n=e.manifest.extensionDependencies||[];if(e.manifest.extensionPack)for(const i of e.manifest.extensionPack)t&&t.manifest.extensionPack&&t.manifest.extensionPack.some(e=>f.areSameExtensions({id:e},{id:i}))||n.every(e=>!f.areSameExtensions({id:e},{id:i}))&&n.push(i);if(n.length)return this.getInstalled().then(e=>{
const t=n.filter(t=>e.every(({identifier:e})=>!f.areSameExtensions(e,{id:t})));return t.length?this.galleryService.query({names:t,pageSize:n.length},j.CancellationToken.None).then(e=>{const t=e.firstPage;return Promise.all(t.map(e=>this.installFromGallery(e))).then(()=>null,e=>this.rollback(t).then(()=>Promise.reject(e),()=>Promise.reject(e)))}):null})}return Promise.resolve(void 0)})}rollback(e){return this.getInstalled(1).then(t=>Promise.all(t.filter(t=>e.some(e=>new f.ExtensionIdentifierWithVersion(t.identifier,t.manifest.version).equals(new f.ExtensionIdentifierWithVersion(e.identifier,e.version)))).map(e=>this.uninstall(e,!0)))).then(()=>void 0,()=>void 0)}uninstall(e,t=!1){return this.logService.trace("ExtensionManagementService#uninstall",e.identifier.id),this.toNonCancellablePromise(this.getInstalled(1).then(t=>{const n=t.filter(t=>f.areSameExtensions(t.identifier,e.identifier))[0]
;return n?this.checkForDependenciesAndUninstall(n,t).then(()=>null,e=>Promise.reject(this.joinErrors(e))):Promise.reject(new Error(s.localize(13,null,e.manifest.displayName||e.manifest.name)))}))}updateMetadata(e,t){return this.logService.trace("ExtensionManagementService#updateMetadata",e.identifier.id),e.metadata=t,this.saveMetadataForLocalExtension(e).then(e=>(this.manifestCache.invalidate(),e))}saveMetadataForLocalExtension(e){if(!e.metadata)return Promise.resolve(e);const t=o.join(e.location.fsPath,"package.json");return a.readFile(t,"utf8").then(e=>M(e)).then(({manifest:t})=>l.assign(t,{__metadata:e.metadata})).then(e=>a.writeFile(t,JSON.stringify(e,null,"\t"))).then(()=>e)}getMetadata(e){return this.findGalleryExtensionByName(e).then(e=>e?{id:e.identifier.uuid,publisherDisplayName:e.publisherDisplayName,publisherId:e.publisherId}:null)}findGalleryExtension(e){
return e.identifier.uuid?this.findGalleryExtensionById(e.identifier.uuid).then(t=>t||this.findGalleryExtensionByName(e.identifier.id)):this.findGalleryExtensionByName(e.identifier.id)}findGalleryExtensionById(e){return this.galleryService.query({ids:[e],pageSize:1},j.CancellationToken.None).then(e=>e.firstPage[0])}findGalleryExtensionByName(e){return this.galleryService.query({names:[e],pageSize:1},j.CancellationToken.None).then(e=>e.firstPage[0])}joinErrors(e){const t=Array.isArray(e)?e:[e];return 1===t.length?t[0]instanceof Error?t[0]:new Error(t[0]):t.reduce((e,t)=>new Error(`${e.message}${e.message?",":""}${t instanceof Error?t.message:t}`),new Error(""))}checkForDependenciesAndUninstall(e,t){return this.preUninstallExtension(e).then(()=>{const n=this.getAllPackExtensionsToUninstall(e,t);return n.length?this.uninstallExtensions(e,n,t):this.uninstallExtensions(e,[],t)}).then(()=>this.postUninstallExtension(e),t=>(this.postUninstallExtension(e,new U(t instanceof Error?t.message:t,"local")),
Promise.reject(t)))}uninstallExtensions(e,t,n){const i=this.getDependents(e,n);if(i.length){const n=i.filter(n=>e!==n&&-1===t.indexOf(n));if(n.length)return Promise.reject(new Error(this.getDependentsErrorMessage(e,n)))}return Promise.all([this.uninstallExtension(e),...t.map(e=>this.doUninstall(e))]).then(()=>void 0)}getDependentsErrorMessage(e,t){return 1===t.length?s.localize(14,null,e.manifest.displayName||e.manifest.name,t[0].manifest.displayName||t[0].manifest.name):2===t.length?s.localize(15,null,e.manifest.displayName||e.manifest.name,t[0].manifest.displayName||t[0].manifest.name,t[1].manifest.displayName||t[1].manifest.name):s.localize(16,null,e.manifest.displayName||e.manifest.name,t[0].manifest.displayName||t[0].manifest.name,t[1].manifest.displayName||t[1].manifest.name)}getAllPackExtensionsToUninstall(e,t,n=[]){if(-1!==n.indexOf(e))return[];n.push(e);const i=e.manifest.extensionPack?e.manifest.extensionPack:[];if(i.length){const e=t.filter(e=>i.some(t=>f.areSameExtensions({id:t
},e.identifier))),r=[];for(const i of e)r.push(...this.getAllPackExtensionsToUninstall(i,t,n));return[...e,...r]}return[]}getDependents(e,t){return t.filter(t=>t.manifest.extensionDependencies&&t.manifest.extensionDependencies.some(t=>f.areSameExtensions({id:t},e.identifier)))}doUninstall(e){return this.preUninstallExtension(e).then(()=>this.uninstallExtension(e)).then(()=>this.postUninstallExtension(e),t=>(this.postUninstallExtension(e,new U(t instanceof Error?t.message:t,"local")),Promise.reject(t)))}preUninstallExtension(e){return Promise.resolve(a.exists(e.location.fsPath)).then(e=>e?null:Promise.reject(new Error(s.localize(17,null)))).then(()=>{this.logService.info("Uninstalling extension:",e.identifier.id),this._onUninstallExtension.fire(e.identifier)})}uninstallExtension(e){let t=this.uninstallingExtensions.get(e.identifier.id);return t||(t=m.createCancelablePromise(t=>this.scanUserExtensions(!1).then(t=>this.setUninstalled(...t.filter(t=>f.areSameExtensions(t.identifier,e.identifier)))).then(()=>{
this.uninstallingExtensions.delete(e.identifier.id)})),this.uninstallingExtensions.set(e.identifier.id,t)),t}postUninstallExtension(e,t){return n(this,void 0,void 0,function*(){t?this.logService.error("Failed to uninstall extension:",e.identifier.id,t.message):(this.logService.info("Successfully uninstalled extension:",e.identifier.id),e.identifier.uuid&&(yield this.galleryService.reportStatistic(e.manifest.publisher,e.manifest.name,e.manifest.version,"uninstall"))),this.reportTelemetry("extensionGallery:uninstall",f.getLocalExtensionTelemetryData(e),void 0,t);const n=t?t instanceof U?t.code:"unknown":void 0;this._onDidUninstallExtension.fire({identifier:e.identifier,error:n})})}getInstalled(e=null){const t=[];return null!==e&&0!==e||t.push(this.scanSystemExtensions().then(null,e=>Promise.reject(new U(this.joinErrors(e).message,"scanningSystem")))),null!==e&&1!==e||t.push(this.scanUserExtensions(!0).then(null,e=>Promise.reject(new U(this.joinErrors(e).message,"scanningUser")))),
Promise.all(t).then(u.flatten,e=>Promise.reject(this.joinErrors(e)))}scanSystemExtensions(){this.logService.trace("Started scanning system extensions");const e=this.scanExtensions(this.systemExtensionsPath,0).then(e=>(this.logService.info("Scanned system extensions:",e.length),e));if(this.environmentService.isBuilt)return e;const t=this.getDevSystemExtensionsList().then(e=>e.length?this.scanExtensions(this.devSystemExtensionsPath,0).then(t=>(this.logService.info("Scanned dev system extensions:",t.length),t.filter(t=>e.some(e=>f.areSameExtensions(t.identifier,{id:e}))))):[]);return Promise.all([e,t]).then(([e,t])=>[...e,...t])}scanUserExtensions(e){return this.logService.trace("Started scanning user extensions"),Promise.all([this.getUninstalledExtensions(),this.scanExtensions(this.extensionsPath,1)]).then(([t,n])=>{if(n=n.filter(e=>!t[new f.ExtensionIdentifierWithVersion(e.identifier,e.manifest.version).key()]),e){
n=f.groupByExtension(n,e=>e.identifier).map(e=>e.sort((e,t)=>y.rcompare(e.manifest.version,t.manifest.version))[0])}return this.logService.info("Scanned user extensions:",n.length),n})}scanExtensions(e,t){const n=new m.Limiter(10);return a.readdir(e).then(i=>Promise.all(i.map(i=>n.queue(()=>this.scanExtension(i,e,t))))).then(e=>e.filter(e=>e&&e.identifier))}scanExtension(e,t,n){if(1===n&&0===e.indexOf("."))return Promise.resolve(null);const i=o.join(t,e);return a.readdir(i).then(e=>(function(e){const t=[a.readFile(o.join(e,"package.json"),"utf8").then(e=>M(e)),a.readFile(o.join(e,"package.nls.json"),"utf8").then(void 0,e=>"ENOENT"!==e.code?Promise.reject(e):"{}").then(e=>JSON.parse(e))];return Promise.all(t).then(([{manifest:e,metadata:t},n])=>({manifest:g.localizeManifest(e,n),metadata:t}))})(i).then(({manifest:t,metadata:r})=>{const s=e.filter(e=>/^readme(\.txt|\.md|)$/i.test(e))[0],a=s?S.URI.file(o.join(i,s)):null,l=e.filter(e=>/^changelog(\.txt|\.md|)$/i.test(e))[0],c=l?S.URI.file(o.join(i,l)):null,u={
id:f.getGalleryExtensionId(t.publisher,t.name),uuid:r?r.id:null};return{type:n,identifier:u,manifest:t,metadata:r,location:S.URI.file(i),readmeUrl:a,changelogUrl:c}})).then(void 0,()=>null)}removeDeprecatedExtensions(){return n(this,void 0,void 0,function*(){yield this.removeUninstalledExtensions(),yield this.removeOutdatedExtensions()})}removeUninstalledExtensions(){return n(this,void 0,void 0,function*(){const e=yield this.getUninstalledExtensions(),t=yield this.scanExtensions(this.extensionsPath,1),i=new Set;for(const n of t)e[new f.ExtensionIdentifierWithVersion(n.identifier,n.manifest.version).key()]||i.add(n.identifier.id.toLowerCase());const r=f.groupByExtension(t,e=>e.identifier);yield Promise.all(r.map(e=>n(this,void 0,void 0,function*(){const t=e.sort((e,t)=>y.rcompare(e.manifest.version,t.manifest.version))[0];i.has(t.identifier.id.toLowerCase())||(yield this.extensionLifecycle.postUninstall(t))})));const s=t.filter(t=>e[new f.ExtensionIdentifierWithVersion(t.identifier,t.manifest.version).key()])
;yield Promise.all(s.map(e=>this.removeUninstalledExtension(e)))})}removeOutdatedExtensions(){return this.scanExtensions(this.extensionsPath,1).then(e=>{const t=[],n=f.groupByExtension(e,e=>e.identifier);return t.push(...u.flatten(n.map(e=>e.sort((e,t)=>y.rcompare(e.manifest.version,t.manifest.version)).slice(1)))),Promise.all(t.map(e=>this.removeExtension(e,"outdated")))}).then(()=>void 0)}removeUninstalledExtension(e){return this.removeExtension(e,"uninstalled").then(()=>this.withUninstalledExtensions(t=>delete t[new f.ExtensionIdentifierWithVersion(e.identifier,e.manifest.version).key()])).then(()=>void 0)}removeExtension(e,t){return this.logService.trace(`Deleting ${t} extension from disk`,e.identifier.id,e.location.fsPath),a.rimraf(e.location.fsPath).then(()=>this.logService.info("Deleted from disk",e.identifier.id,e.location.fsPath))}isUninstalled(e){return this.filterUninstalled(e).then(e=>1===e.length)}filterUninstalled(...e){return this.withUninstalledExtensions(t=>{const n=[]
;for(const i of e)t[i.key()]&&n.push(i.key());return n})}setUninstalled(...e){const t=e.map(e=>new f.ExtensionIdentifierWithVersion(e.identifier,e.manifest.version));return this.withUninstalledExtensions(e=>l.assign(e,t.reduce((e,t)=>(e[t.key()]=!0,e),{})))}unsetUninstalled(e){return this.withUninstalledExtensions(t=>delete t[e.key()])}getUninstalledExtensions(){return this.withUninstalledExtensions(e=>e)}withUninstalledExtensions(e){return n(this,void 0,void 0,function*(){return yield this.uninstalledFileLimiter.queue(()=>{let t=null;return a.readFile(this.uninstalledPath,"utf8").then(void 0,e=>"ENOENT"===e.code?Promise.resolve("{}"):Promise.reject(e)).then(e=>{try{return JSON.parse(e)}catch(e){return{}}}).then(n=>(t=e(n),n)).then(e=>{if(0===Object.keys(e).length)return a.rimraf(this.uninstalledPath);{const t=JSON.stringify(e);return a.writeFile(this.uninstalledPath,t)}}).then(()=>t)})})}getExtensionsReport(){const e=(new Date).getTime()
;return(!this.reportedExtensions||e-this.lastReportTimestamp>3e5)&&(this.reportedExtensions=this.updateReportCache(),this.lastReportTimestamp=e),this.reportedExtensions}updateReportCache(){return this.logService.trace("ExtensionManagementService.refreshReportedCache"),this.galleryService.getExtensionsReport().then(e=>(this.logService.trace(`ExtensionManagementService.refreshReportedCache - got ${e.length} reported extensions from service`),e),e=>(this.logService.trace("ExtensionManagementService.refreshReportedCache - failed to get extension report"),[]))}get devSystemExtensionsPath(){return this._devSystemExtensionsPath||(this._devSystemExtensionsPath=o.normalize(o.join(R.getPathFromAmdModule(e,""),"..",".build","builtInExtensions"))),this._devSystemExtensionsPath}get devSystemExtensionsFilePath(){return this._devSystemExtensionsFilePath||(this._devSystemExtensionsFilePath=o.normalize(o.join(R.getPathFromAmdModule(e,""),"..","build","builtInExtensions.json"))),this._devSystemExtensionsFilePath}
getDevSystemExtensionsList(){return a.readFile(this.devSystemExtensionsFilePath,"utf8").then(e=>{return JSON.parse(e).map(({name:e})=>e)})}toNonCancellablePromise(e){return new Promise((t,n)=>e.then(e=>t(e),e=>n(e)))}reportTelemetry(e,t,n,i){const r=i?i instanceof U?i.code:"unknown":void 0;this.telemetryService.publicLog(e,l.assign(t,{success:!i,duration:n,errorcode:r}))}};z=i([r(0,p.IEnvironmentService),r(1,h.IExtensionGalleryService),r(2,x.ILogService),r(3,D.optional(L.IDownloadService)),r(4,w.ITelemetryService)],z),t.ExtensionManagementService=z}),define(e[37],t([1,0,6,45,15,8,94,19]),function(e,t,i,r,s,o,a,l){"use strict";function c(t,s){let u;return(t.getRawRequest?Promise.resolve(t.getRawRequest(t)):Promise.resolve(function(t){return n(this,void 0,void 0,function*(){return("https:"===r.parse(t.url).protocol?yield new Promise((t,n)=>{e(["https"],t,n)}):yield new Promise((t,n)=>{e(["http"],t,n)})).request})}(t))).then(e=>new Promise((n,d)=>{const h=r.parse(t.url),f={hostname:h.hostname,
port:h.port?parseInt(h.port):"https:"===h.protocol?443:80,protocol:h.protocol,path:h.path,method:t.type||"GET",headers:t.headers,agent:t.agent,rejectUnauthorized:!i.isBoolean(t.strictSSL)||t.strictSSL};if(t.user&&t.password&&(f.auth=t.user+":"+t.password),(u=e(f,e=>{const r=i.isNumber(t.followRedirects)?t.followRedirects:3;if(e.statusCode&&e.statusCode>=300&&e.statusCode<400&&r>0&&e.headers.location)c(o.assign({},t,{url:e.headers.location,followRedirects:r-1}),s).then(n,d);else{let t=e;"gzip"===e.headers["content-encoding"]&&(t=t.pipe(a.createGunzip())),n({res:e,stream:t})}})).on("error",d),t.timeout&&u.setTimeout(t.timeout),t.data){if("string"!=typeof t.data)return void t.data.pipe(u);u.write(t.data)}u.end(),s.onCancellationRequested(()=>{u.abort(),d(l.canceled())})}))}function u(e){return e.res.statusCode&&e.res.statusCode>=200&&e.res.statusCode<300||1223===e.res.statusCode}function d(e){return 204===e.res.statusCode}Object.defineProperty(t,"__esModule",{value:!0}),t.request=c,t.download=function(e,t){
return new Promise((n,i)=>{const r=s.createWriteStream(e);r.once("finish",()=>n(void 0)),t.stream.once("error",i),t.stream.pipe(r)})},t.asText=function(e){return new Promise((t,n)=>{if(!u(e))return n("Server returned "+e.res.statusCode);if(d(e))return t(null);const i=[];e.stream.on("data",e=>i.push(e)),e.stream.on("end",()=>t(i.join(""))),e.stream.on("error",n)})},t.asJson=function(e){return new Promise((t,n)=>{if(!u(e))return n("Server returned "+e.res.statusCode);if(d(e))return t(null);const i=[];e.stream.on("data",e=>i.push(e)),e.stream.on("end",()=>{try{t(JSON.parse(i.join("")))}catch(e){n(e)}}),e.stream.on("error",n)})}}),define(e[65],t([1,0,29,2,19,24,21,8,39,30,37,22,26,31,16,4,41,73,34,5]),function(e,t,n,s,o,a,l,c,u,d,h,f,g,p,m,v,y,S,E,C){"use strict";function x(...e){return String(e.reduce((e,t)=>e|t,0))}function b(e,t){const n=(e||[]).filter(e=>e.statisticName===t)[0];return n?n.value:0}function _(e,t){return e.files.filter(e=>e.assetType===t)[0]?{uri:`${e.assetUri}/${t}`,
fallbackUri:`${e.fallbackAssetUri}/${t}`}:null}function P(e,t){const n=e.properties?e.properties.filter(e=>e.key===t):[],i=n.length>0&&n[0].value;return i?i.split(",").map(e=>l.adoptToGalleryExtensionId(e)):[]}function w(e){const t=e.properties?e.properties.filter(e=>e.key===T.Engine):[];return t.length>0&&t[0].value||""}function I(t,n,i,r,s){const o={manifest:_(n,D.Manifest),readme:_(n,D.Details),changelog:_(n,D.Changelog),license:_(n,D.License),repository:function(e){if(e.properties){const t=e.properties.filter(e=>e.key===D.Repository),n=new RegExp("((git|ssh|http(s)?)|(git@[w.]+))(:(//)?)([w.@:/-~]+)(.git)(/)?"),i=t.filter(e=>n.test(e.value))[0];return i?{uri:i.value,fallbackUri:i.value}:null}return _(e,D.Repository)}(n),download:function(e){return{uri:`${e.fallbackAssetUri}/${D.VSIX}?redirect=true`,fallbackUri:`${e.fallbackAssetUri}/${D.VSIX}`}}(n),icon:function(t){const n=_(t,D.Icon);if(n)return n;const i=e.toUrl("./media/defaultIcon.png");return{uri:i,fallbackUri:i}}(n),coreTranslations:function(e){
return e.files.filter(e=>0===e.assetType.indexOf("Microsoft.VisualStudio.Code.Translation.")).reduce((t,n)=>(t[n.assetType.substring("Microsoft.VisualStudio.Code.Translation.".length)]=_(e,n.assetType),t),{})}(n)};return{identifier:{id:l.getGalleryExtensionId(t.publisher.publisherName,t.extensionName),uuid:t.extensionId},name:t.extensionName,version:n.version,date:n.lastUpdated,displayName:t.displayName,publisherId:t.publisher.publisherId,publisher:t.publisher.publisherName,publisherDisplayName:t.publisher.displayName,description:t.shortDescription||"",installCount:b(t.statistics,"install")+b(t.statistics,"updateCount"),rating:b(t.statistics,"averagerating"),ratingCount:b(t.statistics,"ratingcount"),assets:o,properties:{dependencies:P(n,T.Dependency),extensionPack:P(n,T.ExtensionPack),engine:w(n),localizedLanguages:function(e){const t=e.properties?e.properties.filter(e=>e.key===T.LocalizedLanguages):[],n=t.length>0&&t[0].value||"";return n?n.split(","):[]}(n)},telemetryData:{
index:(r.pageNumber-1)*r.pageSize+i,searchText:r.searchText,querySource:s},preview:function(e){return-1!==e.indexOf("preview")}(t.flags)}}function k(e){const t=s.join(e.userDataPath,"machineid");return v.readFile(t,"utf8").then(e=>y.isUUID(e)?e:null,()=>null).then(e=>{if(!e){e=y.generateUuid();try{v.writeFileSync(t,e)}catch(e){}}return{"X-Market-Client-Id":`VSCode ${f.default.version}`,"User-Agent":`VSCode ${f.default.version}`,"X-Market-User-Id":e}})}Object.defineProperty(t,"__esModule",{value:!0});var O;!function(e){e[e.None=0]="None",e[e.IncludeVersions=1]="IncludeVersions",e[e.IncludeFiles=2]="IncludeFiles",e[e.IncludeCategoryAndTags=4]="IncludeCategoryAndTags",e[e.IncludeSharedAccounts=8]="IncludeSharedAccounts",e[e.IncludeVersionProperties=16]="IncludeVersionProperties",e[e.ExcludeNonValidated=32]="ExcludeNonValidated",e[e.IncludeInstallationTargets=64]="IncludeInstallationTargets",e[e.IncludeAssetUri=128]="IncludeAssetUri",e[e.IncludeStatistics=256]="IncludeStatistics",
e[e.IncludeLatestVersionOnly=512]="IncludeLatestVersionOnly",e[e.Unpublished=4096]="Unpublished"}(O||(O={}));var L;!function(e){e[e.Tag=1]="Tag",e[e.ExtensionId=4]="ExtensionId",e[e.Category=5]="Category",e[e.ExtensionName=7]="ExtensionName",e[e.Target=8]="Target",e[e.Featured=9]="Featured",e[e.SearchText=10]="SearchText",e[e.ExcludeWithFlags=12]="ExcludeWithFlags"}(L||(L={}));const D={Icon:"Microsoft.VisualStudio.Services.Icons.Default",Details:"Microsoft.VisualStudio.Services.Content.Details",Changelog:"Microsoft.VisualStudio.Services.Content.Changelog",Manifest:"Microsoft.VisualStudio.Code.Manifest",VSIX:"Microsoft.VisualStudio.Services.VSIXPackage",License:"Microsoft.VisualStudio.Services.Content.License",Repository:"Microsoft.VisualStudio.Services.Links.Source"},T={Dependency:"Microsoft.VisualStudio.Code.ExtensionDependencies",ExtensionPack:"Microsoft.VisualStudio.Code.ExtensionPack",Engine:"Microsoft.VisualStudio.Code.Engine",LocalizedLanguages:"Microsoft.VisualStudio.Code.LocalizedLanguages"},j={
pageNumber:1,pageSize:10,sortBy:0,sortOrder:0,flags:O.None,criteria:[],assetTypes:[]};class R{constructor(e=j){this.state=e}get pageNumber(){return this.state.pageNumber}get pageSize(){return this.state.pageSize}get sortBy(){return this.state.sortBy}get sortOrder(){return this.state.sortOrder}get flags(){return this.state.flags}withPage(e,t=this.state.pageSize){return new R(c.assign({},this.state,{pageNumber:e,pageSize:t}))}withFilter(e,...t){const n=[...this.state.criteria,...t.map(t=>({filterType:e,value:t}))];return new R(c.assign({},this.state,{criteria:n}))}withSortBy(e){return new R(c.assign({},this.state,{sortBy:e}))}withSortOrder(e){return new R(c.assign({},this.state,{sortOrder:e}))}withFlags(...e){return new R(c.assign({},this.state,{flags:e.reduce((e,t)=>e|t,0)}))}withAssetTypes(...e){return new R(c.assign({},this.state,{assetTypes:e}))}get raw(){const{criteria:e,pageNumber:t,pageSize:n,sortBy:i,sortOrder:r,flags:s,assetTypes:o}=this.state;return{filters:[{criteria:e,pageNumber:t,pageSize:n,
sortBy:i,sortOrder:r}],assetTypes:o,flags:s}}get searchText(){const e=this.state.criteria.filter(e=>e.filterType===L.SearchText)[0];return e&&e.value?e.value:""}}let A=class{constructor(e,t,n,i){this.requestService=e,this.logService=t,this.environmentService=n,this.telemetryService=i;const r=g.default.extensionsGallery;this.extensionsGalleryUrl=r&&r.serviceUrl,this.extensionsControlUrl=r&&r.controlUrl,this.commonHeadersPromise=k(this.environmentService)}api(e=""){return`${this.extensionsGalleryUrl}${e}`}isEnabled(){return!!this.extensionsGalleryUrl}getCompatibleExtension(e,t){const n=a.isIExtensionIdentifier(e)?null:e;if(n&&n.properties.engine&&p.isEngineValid(n.properties.engine))return Promise.resolve(n);const{id:i,uuid:r}=n?n.identifier:e;let s=(new R).withFlags(O.IncludeAssetUri,O.IncludeStatistics,O.IncludeFiles,O.IncludeVersionProperties,O.ExcludeNonValidated).withPage(1,1).withFilter(L.Target,"Microsoft.VisualStudio.Code").withFilter(L.ExcludeWithFlags,x(O.Unpublished))
;return s=r?s.withFilter(L.ExtensionId,r):s.withFilter(L.ExtensionName,i),this.queryGallery(s,E.CancellationToken.None).then(({galleryExtensions:e})=>{const[n]=e;if(!n||!n.versions.length)return null;if(t){const e=n.versions.filter(e=>e.version===t)[0];if(e){const t=I(n,e,0,s);if(t.properties.engine&&p.isEngineValid(t.properties.engine))return t}return null}return this.getLastValidExtensionVersion(n,n.versions).then(e=>e?I(n,e,0,s):null)})}query(e,t){const n=E.CancellationToken.isCancellationToken(e)?{}:e,i=E.CancellationToken.isCancellationToken(e)?e:t;if(!this.isEnabled())return Promise.reject(new Error("No extension gallery service configured."));const r=n.names?"ids":n.text?"text":"all";let s=n.text||"";const a=c.getOrDefault(n,e=>e.pageSize,50);this.telemetryService.publicLog("galleryService:query",{type:r,text:s})
;let l=(new R).withFlags(O.IncludeLatestVersionOnly,O.IncludeAssetUri,O.IncludeStatistics,O.IncludeFiles,O.IncludeVersionProperties).withPage(1,a).withFilter(L.Target,"Microsoft.VisualStudio.Code").withFilter(L.ExcludeWithFlags,x(O.Unpublished));return s?((s=(s=(s=s.replace(/\bcategory:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(e,t,n)=>(l=l.withFilter(L.Category,n||t),""))).replace(/\btag:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(e,t,n)=>(l=l.withFilter(L.Tag,n||t),""))).trim())&&(s=s.length<200?s:s.substring(0,200),l=l.withFilter(L.SearchText,s)),l=l.withSortBy(0)):l=n.ids?l.withFilter(L.ExtensionId,...n.ids):n.names?l.withFilter(L.ExtensionName,...n.names):l.withSortBy(4),"number"==typeof n.sortBy&&(l=l.withSortBy(n.sortBy)),"number"==typeof n.sortOrder&&(l=l.withSortOrder(n.sortOrder)),this.queryGallery(l,i).then(({galleryExtensions:e,total:t})=>{return{firstPage:e.map((e,t)=>I(e,e.versions[0],t,l,n.source)),total:t,pageSize:l.pageSize,getPage:(e,t)=>{if(t.isCancellationRequested)return Promise.reject(o.canceled())
;const i=l.withPage(e+1);return this.queryGallery(i,t).then(({galleryExtensions:e})=>e.map((e,t)=>I(e,e.versions[0],t,i,n.source)))}}})}queryGallery(e,t){return this.isEnabled()?this.commonHeadersPromise.then(n=>{const i=JSON.stringify(e.raw),r=c.assign({},n,{"Content-Type":"application/json",Accept:"application/json;api-version=3.0-preview.1","Accept-Encoding":"gzip","Content-Length":i.length});return this.requestService.request({type:"POST",url:this.api("/extensionquery"),data:i,headers:r},t).then(e=>e.res.statusCode&&e.res.statusCode>=400&&e.res.statusCode<500?{galleryExtensions:[],total:0}:h.asJson(e).then(e=>{if(e){const t=e.results[0],n=t.extensions,i=t.resultMetadata&&t.resultMetadata.filter(e=>"ResultCount"===e.metadataType)[0];return{galleryExtensions:n,total:i&&i.metadataItems.filter(e=>"TotalCount"===e.name)[0].count||0}}return{galleryExtensions:[],total:0}}))}):Promise.reject(new Error("No extension gallery service configured."))}reportStatistic(e,t,n,i){
return this.isEnabled()?this.commonHeadersPromise.then(r=>{const s=Object.assign({},r,{Accept:"*/*;api-version=4.0-preview.1"});return this.requestService.request({type:"POST",url:this.api(`/publishers/${e}/extensions/${t}/${n}/stats?statType=${i}`),headers:s},E.CancellationToken.None).then(void 0,()=>void 0)}):Promise.resolve(void 0)}download(e,t){this.logService.trace("ExtensionGalleryService#download",e.identifier.id);const i=s.join(n.tmpdir(),y.generateUuid()),r=l.getGalleryExtensionTelemetryData(e),o=(new Date).getTime(),a=1===t?"install":2===t?"update":"",u=a?{uri:`${e.assets.download.uri}&${a}=true`,fallbackUri:`${e.assets.download.fallbackUri}?${a}=true`}:e.assets.download;return this.getAsset(u).then(e=>h.download(i,e)).then(()=>(e=>this.telemetryService.publicLog("galleryService:downloadVSIX",c.assign(r,{duration:e})))((new Date).getTime()-o)).then(()=>i)}getReadme(e,t){return e.assets.readme?this.getAsset(e.assets.readme,{},t).then(e=>h.asText(e)).then(e=>e||""):Promise.resolve("")}
getManifest(e,t){return e.assets.manifest?this.getAsset(e.assets.manifest,{},t).then(h.asText).then(JSON.parse):Promise.resolve(null)}getCoreTranslation(e,t){const n=e.assets.coreTranslations[t.toUpperCase()];return n?this.getAsset(n).then(h.asText).then(JSON.parse):Promise.resolve(null)}getChangelog(e,t){return e.assets.changelog?this.getAsset(e.assets.changelog,{},t).then(e=>h.asText(e)).then(e=>e||""):Promise.resolve("")}getAllVersions(e,t){let n=(new R).withFlags(O.IncludeVersions,O.IncludeFiles,O.IncludeVersionProperties,O.ExcludeNonValidated).withPage(1,1).withFilter(L.Target,"Microsoft.VisualStudio.Code").withFilter(L.ExcludeWithFlags,x(O.Unpublished));return n=e.identifier.uuid?n.withFilter(L.ExtensionId,e.identifier.uuid):n.withFilter(L.ExtensionName,e.identifier.id),this.queryGallery(n,E.CancellationToken.None).then(({galleryExtensions:e})=>e.length?t?Promise.all(e[0].versions.map(e=>this.getEngine(e).then(t=>p.isEngineValid(t)?e:null))).then(e=>e.filter(e=>!!e).map(e=>({version:e.version,
date:e.lastUpdated}))):e[0].versions.map(e=>({version:e.version,date:e.lastUpdated})):[])}getAsset(e,t={},n=E.CancellationToken.None){return this.commonHeadersPromise.then(i=>{const r=c.assign({},i,t.headers||{});t=c.assign({},t,{type:"GET"},{headers:r});const s=e.uri,a=e.fallbackUri,l=c.assign({},t,{url:s});return this.requestService.request(l,n).then(e=>200===e.res.statusCode?Promise.resolve(e):h.asText(e).then(t=>Promise.reject(new Error(`Expected 200, got back ${e.res.statusCode} instead.\n\n${t}`)))).then(void 0,e=>{if(o.isPromiseCanceledError(e))return Promise.reject(e);const i=o.getErrorMessage(e);this.telemetryService.publicLog("galleryService:requestError",{url:s,cdn:!0,message:i}),this.telemetryService.publicLog("galleryService:cdnFallback",{url:s,message:i});const r=c.assign({},t,{url:a});return this.requestService.request(r,n).then(void 0,e=>{if(o.isPromiseCanceledError(e))return Promise.reject(e);const t=o.getErrorMessage(e);return this.telemetryService.publicLog("galleryService:requestError",{
url:a,cdn:!1,message:t}),Promise.reject(e)})})})}getLastValidExtensionVersion(e,t){const n=this.getLastValidExtensionVersionFromProperties(e,t);return n||this.getLastValidExtensionVersionRecursively(e,t)}getLastValidExtensionVersionFromProperties(e,t){for(const e of t){const t=w(e);if(!t)return null;if(p.isEngineValid(t))return Promise.resolve(e)}return null}getEngine(e){const t=w(e);if(t)return Promise.resolve(t);const n=_(e,D.Manifest);if(!n)return Promise.reject("Manifest was not found");return this.getAsset(n,{headers:{"Accept-Encoding":"gzip"}}).then(e=>h.asJson(e)).then(e=>e?e.engines.vscode:Promise.reject("Error while reading manifest"))}getLastValidExtensionVersionRecursively(e,t){if(!t.length)return Promise.resolve(null);const n=t[0];return this.getEngine(n).then(i=>p.isEngineValid(i)?(n.properties=n.properties||[],n.properties.push({key:T.Engine,value:i}),n):this.getLastValidExtensionVersionRecursively(e,t.slice(1)))}getExtensionsReport(){
return this.isEnabled()?this.extensionsControlUrl?this.requestService.request({type:"GET",url:this.extensionsControlUrl},E.CancellationToken.None).then(e=>200!==e.res.statusCode?Promise.reject(new Error("Could not get extensions report.")):h.asJson(e).then(e=>{const t=new Map;if(e)for(const n of e.malicious){const e=t.get(n)||{id:{id:n},malicious:!0,slow:!1};e.malicious=!0,t.set(n,e)}return Promise.resolve(S.values(t))})):Promise.resolve([]):Promise.reject(new Error("No extension gallery service configured."))}};A=i([r(0,u.IRequestService),r(1,C.ILogService),r(2,m.IEnvironmentService),r(3,d.ITelemetryService)],A),t.ExtensionGalleryService=A,t.resolveMarketplaceHeaders=k}),define(e[52],t([1,0,8,37,44,14,5]),function(e,t,n,s,o,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let c=class{constructor(e,t){this.logService=t,this.disposables=[],this.configure(e.getValue()),e.onDidChangeConfiguration(()=>this.configure(e.getValue()),this,this.disposables)}configure(e){
this.proxyUrl=e.http&&e.http.proxy,this.strictSSL=!(!e.http||!e.http.proxyStrictSSL),this.authorization=e.http&&e.http.proxyAuthorization}request(e,t,i=s.request){this.logService.trace("RequestService#request",e.url);const{proxyUrl:r,strictSSL:a}=this;return(e.agent?Promise.resolve(e.agent):Promise.resolve(o.getProxyAgent(e.url||"",{proxyUrl:r,strictSSL:a}))).then(r=>(e.agent=r,e.strictSSL=a,this.authorization&&(e.headers=n.assign(e.headers||{},{"Proxy-Authorization":this.authorization})),i(e,t)))}};c=i([r(0,a.IConfigurationService),r(1,l.ILogService)],c),t.RequestService=c}),define(e[97],t([1,0,10,26,22,2,83,36,33,3,56,16,63,24,87,65,30,81,80,84,39,52,14,75,82,4,55,77,78,5,19,21,20,43,27,34,67,23,60]),function(e,t,s,o,a,l,c,u,d,h,f,g,p,m,v,y,S,E,C,x,b,_,P,w,I,k,O,L,D,T,j,R,A,M,U,z,N,F,V){"use strict";function $(e,t){return t?`${e.publisher}.${e.name}@${e.version}`:`${e.publisher}.${e.name}`}function B(e){const t=G.exec(e)
;return t&&t[1]?[R.adoptToGalleryExtensionId(t[1]),t[2]]:[R.adoptToGalleryExtensionId(e),void 0]}Object.defineProperty(t,"__esModule",{value:!0});const W=e=>s.localize(1,null,e),q=s.localize(2,null,"ms-vscode.csharp"),G=/^([^.]+\..+)@(\d+\.\d+\.\d+(-.*)?)$/;t.getIdAndVersion=B;let H=class{constructor(e,t,n,i){this.instantiationService=e,this.environmentService=t,this.extensionManagementService=n,this.extensionGalleryService=i}run(e){return n(this,void 0,void 0,function*(){if(e["install-source"])yield this.setInstallSource(e["install-source"]);else if(e["list-extensions"])yield this.listExtensions(!!e["show-versions"]);else if(e["install-extension"]){const t=e["install-extension"],n="string"==typeof t?[t]:t;yield this.installExtensions(n,e.force)}else if(e["uninstall-extension"]){const t=e["uninstall-extension"],n="string"==typeof t?[t]:t;yield this.uninstallExtension(n)}else if(e["locate-extension"]){const t=e["locate-extension"],n="string"==typeof t?[t]:t;yield this.locateExtension(n)}})}setInstallSource(e){
return k.writeFile(this.environmentService.installSourcePath,e.slice(0,30))}listExtensions(e){return n(this,void 0,void 0,function*(){(yield this.extensionManagementService.getInstalled(1)).forEach(t=>console.log($(t.manifest,e)))})}installExtensions(e,t){return n(this,void 0,void 0,function*(){const n=[],i=[];e.length&&console.log(s.localize(3,null));for(const r of e)try{const e=yield this.installExtension(r,t);e&&i.push(e)}catch(e){console.error(e.message||e.stack||e),n.push(r)}return i.some(e=>U.isLanguagePackExtension(e))&&(yield this.updateLocalizationsCache()),n.length?Promise.reject(s.localize(4,null,n.join(", "))):Promise.resolve()})}installExtension(e,t){return n(this,void 0,void 0,function*(){if(/\.vsix$/i.test(e)){e=l.isAbsolute(e)?e:l.join(process.cwd(),e);const n=yield M.getManifest(e);return(yield this.validate(n,t))?this.extensionManagementService.install(A.URI.file(e)).then(t=>(console.log(s.localize(5,null,O.getBaseLabel(e))),
n),t=>j.isPromiseCanceledError(t)?(console.log(s.localize(6,null,O.getBaseLabel(e))),null):Promise.reject(t)):null}const[i,r]=B(e);return this.extensionManagementService.getInstalled(1).then(e=>this.extensionGalleryService.getCompatibleExtension({id:i},r).then(null,e=>{if(e.responseText)try{const t=JSON.parse(e.responseText);return Promise.reject(t.message)}catch(e){}return Promise.reject(e)}).then(o=>n(this,void 0,void 0,function*(){if(!o)return Promise.reject(new Error(`${(e=>s.localize(0,null,e))(r?`${i}@${r}`:i)}\n${q}`));const n=yield this.extensionGalleryService.getManifest(o,z.CancellationToken.None),[a]=e.filter(e=>R.areSameExtensions(e.identifier,{id:i}));if(a){if(o.version===a.manifest.version)return console.log(s.localize(7,null,r?`${i}@${r}`:i)),Promise.resolve(null);if(!r&&!t)return console.log(s.localize(8,null,i,a.manifest.version,o.version)),Promise.resolve(null);console.log(s.localize(9,null,i,o.version))}return yield this.installFromGallery(i,o),n})))})}validate(e,t){
return n(this,void 0,void 0,function*(){if(!e)throw new Error("Invalid vsix");const n={id:R.getGalleryExtensionId(e.publisher,e.name)},i=(yield this.extensionManagementService.getInstalled(1)).filter(t=>R.areSameExtensions(n,t.identifier)&&c.gt(t.manifest.version,e.version))[0];return!(i&&!t)||(console.log(s.localize(10,null,i.identifier.id,i.manifest.version,e.version)),!1)})}installFromGallery(e,t){return n(this,void 0,void 0,function*(){console.log(s.localize(11,null,e,t.version));try{yield this.extensionManagementService.installFromGallery(t),console.log(s.localize(12,null,e,t.version))}catch(t){if(!j.isPromiseCanceledError(t))throw t;console.log(s.localize(13,null,e))}})}uninstallExtension(e){return n(this,void 0,void 0,function*(){function t(e){return n(this,void 0,void 0,function*(){if(!/\.vsix$/i.test(e))return e;const t=l.isAbsolute(e)?e:l.join(process.cwd(),e);return $(yield M.getManifest(t))})}const i=[];for(const n of e){
const e=yield t(n),r=yield this.extensionManagementService.getInstalled(1),[o]=r.filter(t=>R.areSameExtensions(t.identifier,{id:e}));if(!o)return Promise.reject(new Error(`${W(e)}\n${q}`));console.log(s.localize(14,null,e)),yield this.extensionManagementService.uninstall(o,!0),i.push(o),console.log(s.localize(15,null,e))}i.some(e=>U.isLanguagePackExtension(e.manifest))&&(yield this.updateLocalizationsCache())})}locateExtension(e){return n(this,void 0,void 0,function*(){const t=yield this.extensionManagementService.getInstalled();e.forEach(e=>{t.forEach(t=>{t.identifier.id!==e||t.location.scheme!==F.Schemas.file||console.log(t.location.fsPath)})})})}updateLocalizationsCache(){return n(this,void 0,void 0,function*(){const e=this.instantiationService.createInstance(N.LocalizationsService);yield e.update(),e.dispose()})}};H=i([r(0,h.IInstantiationService),r(1,g.IEnvironmentService),r(2,m.IExtensionManagementService),r(3,m.IExtensionGalleryService)],H),t.Main=H;const K="monacoworkbench";t.main=function(e){
const t=new u.ServiceCollection,n=new p.EnvironmentService(e,process.execPath),i=new V.SpdLogService("cli",n.logsPath,T.getLogLevel(n));process.once("exit",()=>i.dispose()),i.info("main",e),t.set(g.IEnvironmentService,n),t.set(T.ILogService,i),t.set(L.IStateService,new d.SyncDescriptor(D.StateService));const r=new f.InstantiationService(t);return r.invokeFunction(t=>{const s=t.get(g.IEnvironmentService),l=t.get(L.IStateService);return Promise.all([s.appSettingsHome,s.extensionsPath].map(e=>k.mkdirp(e))).then(()=>{const{appRoot:t,extensionsPath:c,extensionDevelopmentLocationURI:h,isBuilt:f,installSourcePath:g}=s,p=new u.ServiceCollection;p.set(P.IConfigurationService,new d.SyncDescriptor(w.ConfigurationService,[n.appSettingsPath])),p.set(b.IRequestService,new d.SyncDescriptor(_.RequestService)),p.set(m.IExtensionManagementService,new d.SyncDescriptor(v.ExtensionManagementService)),p.set(m.IExtensionGalleryService,new d.SyncDescriptor(y.ExtensionGalleryService));const k=[]
;if(f&&!h&&!s.args["disable-telemetry"]&&o.default.enableTelemetry){o.default.aiConfig&&o.default.aiConfig.asimovKey&&k.push(new I.AppInsightsAppender(K,null,o.default.aiConfig.asimovKey,i));const e={appender:E.combinedAppender(...k),commonProperties:x.resolveCommonProperties(o.default.commit,a.default.version,l.getItem("telemetry.machineId"),g),piiPaths:[t,c]};p.set(S.ITelemetryService,new d.SyncDescriptor(C.TelemetryService,[e]))}else p.set(S.ITelemetryService,E.NullTelemetryService);return r.createChild(p).createInstance(H).run(e).then(()=>E.combinedAppender(...k).dispose())})})}})}).call(this);
//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/553cfb2c2205db5f15f3ee8395bbd5cf066d357d/core/vs/code/node/cliProcessMain.js.map
