- Ajout du système de flags pending pour gérer les fichiers en cours de traitement - Implémentation du polling automatique toutes les 5 secondes - Gestion d'erreur robuste avec nettoyage automatique des flags - Nettoyage des flags orphelins au démarrage du serveur - Correction du mapping des documents dans le store Redux - Documentation complète du système de pending Fixes: Problème de suppression des flags pending au démarrage Fixes: Problème d'affichage des documents dans le frontend
142 lines
1.1 MiB
142 lines
1.1 MiB
/*!--------------------------------------------------------
|
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
*--------------------------------------------------------*/
|
|
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="73c2bdf7-6336-5928-8073-4ad5f10cff68")}catch(e){}}();
|
|
var Jp=function(t,e){return Jp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},Jp(t,e)};export function __extends(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Jp(t,e);function i(){this.constructor=t}t.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}export var __assign=function(){return __assign=Object.assign||function(e){for(var i,r=1,s=arguments.length;r<s;r++){i=arguments[r];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},__assign.apply(this,arguments)};export function __rest(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(i[r[s]]=t[r[s]]);return i}export function __decorate(t,e,i,r){var s=arguments.length,n=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(s<3?o(n):s>3?o(e,i,n):o(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n}export function __param(t,e){return function(i,r){e(i,r,t)}}export function __esDecorate(t,e,i,r,s,n){function o(S){if(S!==void 0&&typeof S!="function")throw new TypeError("Function expected");return S}for(var a=r.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?r.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d,f=!1,p=i.length-1;p>=0;p--){var v={};for(var m in r)v[m]=m==="access"?{}:r[m];for(var m in r.access)v.access[m]=r.access[m];v.addInitializer=function(S){if(f)throw new TypeError("Cannot add initializers after decoration has completed");n.push(o(S||null))};var y=(0,i[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],v);if(a==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(d=o(y.get))&&(u.get=d),(d=o(y.set))&&(u.set=d),(d=o(y.init))&&s.unshift(d)}else(d=o(y))&&(a==="field"?s.unshift(d):u[c]=d)}l&&Object.defineProperty(l,r.name,u),f=!0}export function __runInitializers(t,e,i){for(var r=arguments.length>2,s=0;s<e.length;s++)i=r?e[s].call(t,i):e[s].call(t);return r?i:void 0}export function __propKey(t){return typeof t=="symbol"?t:"".concat(t)}export function __setFunctionName(t,e,i){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:i?"".concat(i," ",e):e})}export function __metadata(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}export function __awaiter(t,e,i,r){function s(n){return n instanceof i?n:new i(function(o){o(n)})}return new(i||(i=Promise))(function(n,o){function a(u){try{l(r.next(u))}catch(d){o(d)}}function c(u){try{l(r.throw(u))}catch(d){o(d)}}function l(u){u.done?n(u.value):s(u.value).then(a,c)}l((r=r.apply(t,e||[])).next())})}export function __generator(t,e){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},r,s,n,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(r=1,s&&(n=l[0]&2?s.return:l[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,l[1])).done)return n;switch(s=0,n&&(l=[l[0]&2,n.value]),l[0]){case 0:case 1:n=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,s=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(n=i.trys,!(n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){i.label=l[1];break}if(l[0]===6&&i.label<n[1]){i.label=n[1],n=l;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(l);break}n[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(u){l=[6,u],s=0}finally{r=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}export var __createBinding=Object.create?(function(t,e,i,r){r===void 0&&(r=i);var s=Object.getOwnPropertyDescriptor(e,i);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,s)}):(function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]});export function __exportStar(t,e){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(e,i)&&__createBinding(e,t,i)}export function __values(t){var e=typeof Symbol=="function"&&Symbol.iterator,i=e&&t[e],r=0;if(i)return i.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}export function __read(t,e){var i=typeof Symbol=="function"&&t[Symbol.iterator];if(!i)return t;var r=i.call(t),s,n=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)n.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(o)throw o.error}}return n}export function __spread(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(__read(arguments[e]));return t}export function __spreadArrays(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var r=Array(t),s=0,e=0;e<i;e++)for(var n=arguments[e],o=0,a=n.length;o<a;o++,s++)r[s]=n[o];return r}export function __spreadArray(t,e,i){if(i||arguments.length===2)for(var r=0,s=e.length,n;r<s;r++)(n||!(r in e))&&(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))}export function __await(t){return this instanceof __await?(this.v=t,this):new __await(t)}export function __asyncGenerator(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),s,n=[];return s={},a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(p){return function(v){return Promise.resolve(v).then(p,d)}}function a(p,v){r[p]&&(s[p]=function(m){return new Promise(function(y,S){n.push([p,m,y,S])>1||c(p,m)})},v&&(s[p]=v(s[p])))}function c(p,v){try{l(r[p](v))}catch(m){f(n[0][3],m)}}function l(p){p.value instanceof __await?Promise.resolve(p.value.v).then(u,d):f(n[0][2],p)}function u(p){c("next",p)}function d(p){c("throw",p)}function f(p,v){p(v),n.shift(),n.length&&c(n[0][0],n[0][1])}}export function __asyncDelegator(t){var e,i;return e={},r("next"),r("throw",function(s){throw s}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(s,n){e[s]=t[s]?function(o){return(i=!i)?{value:__await(t[s](o)),done:!1}:n?n(o):o}:n}}export function __asyncValues(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(n){i[n]=t[n]&&function(o){return new Promise(function(a,c){o=t[n](o),s(a,c,o.done,o.value)})}}function s(n,o,a,c){Promise.resolve(c).then(function(l){n({value:l,done:a})},o)}}export function __makeTemplateObject(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var $8=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e};export function __importStar(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&__createBinding(e,t,i);return $8(e,t),e}export function __importDefault(t){return t&&t.__esModule?t:{default:t}}export function __classPrivateFieldGet(t,e,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(t):r?r.value:e.get(t)}export function __classPrivateFieldSet(t,e,i,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(t,i):s?s.value=i:e.set(t,i),i}export function __classPrivateFieldIn(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}export function __addDisposableResource(t,e,i){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,s;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],i&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(n){return Promise.reject(n)}}),t.stack.push({value:e,dispose:r,async:i})}else i&&t.stack.push({async:!0});return e}var B8=typeof SuppressedError=="function"?SuppressedError:function(t,e,i){var r=new Error(i);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};export function __disposeResources(t){function e(r){t.error=t.hasError?new B8(r,t.error,"An error was suppressed during disposal."):r,t.hasError=!0}function i(){for(;t.stack.length;){var r=t.stack.pop();try{var s=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(s).then(i,function(n){return e(n),i()})}catch(n){e(n)}}if(t.hasError)throw t.error}return i()}export default{__extends,__assign,__rest,__decorate,__param,__metadata,__awaiter,__generator,__createBinding,__exportStar,__values,__read,__spread,__spreadArrays,__spreadArray,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault,__classPrivateFieldGet,__classPrivateFieldSet,__classPrivateFieldIn,__addDisposableResource,__disposeResources};var j8=Object.create,N0=Object.defineProperty,H8=Object.getOwnPropertyDescriptor,Qp=Object.getOwnPropertyNames,V8=Object.getPrototypeOf,q8=Object.prototype.hasOwnProperty,g=(t,e)=>function(){return t&&(e=(0,t[Qp(t)[0]])(t=0)),e},z8=(t,e)=>function(){return e||(0,t[Qp(t)[0]])((e={exports:{}}).exports,e),e.exports},G8=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Qp(e))!q8.call(t,s)&&s!==i&&N0(t,s,{get:()=>e[s],enumerable:!(r=H8(e,s))||r.enumerable});return t},U0=(t,e,i)=>(i=t!=null?j8(V8(t)):{},G8(e||!t||!t.__esModule?N0(i,"default",{value:t,enumerable:!0}):i,t));function Xp(t){const e=[];typeof t=="number"&&e.push("code/timeOrigin",t);function i(s,n){e.push(s,n?.startTime??Date.now())}function r(){const s=[];for(let n=0;n<e.length;n+=2)s.push({name:e[n],startTime:e[n+1]});return s}return{mark:i,getMarks:r}}function K8(){if(typeof performance=="object"&&typeof performance.mark=="function"&&!performance.nodeTiming)return typeof performance.timeOrigin!="number"&&!performance.timing?Xp():{mark(t,e){performance.mark(t,e)},getMarks(){let t=performance.timeOrigin;typeof t!="number"&&(t=performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart);const e=[{name:"code/timeOrigin",startTime:Math.round(t)}];for(const i of performance.getEntriesByType("mark"))e.push({name:i.name,startTime:Math.round(t+i.startTime)});return e}};if(typeof process=="object"){const t=performance?.timeOrigin;return Xp(t)}else return console.trace("perf-util loaded in UNKNOWN environment"),Xp()}function Y8(t){return t.MonacoPerformanceMarks||(t.MonacoPerformanceMarks=K8()),t.MonacoPerformanceMarks}var Zp,Ve,eg,ls=g({"out-build/vs/base/common/performance.js"(){"use strict";Zp=Y8(globalThis),Ve=Zp.mark,eg=Zp.getMarks}}),$0=z8({"node_modules/minimist/index.js"(t,e){e.exports=function(n,o){o||(o={});var a={bools:{},strings:{},unknownFn:null};typeof o.unknown=="function"&&(a.unknownFn=o.unknown),typeof o.boolean=="boolean"&&o.boolean?a.allBools=!0:[].concat(o.boolean).filter(Boolean).forEach(function($){a.bools[$]=!0});var c={};Object.keys(o.alias||{}).forEach(function($){c[$]=[].concat(o.alias[$]),c[$].forEach(function(ge){c[ge]=[$].concat(c[$].filter(function(Ke){return ge!==Ke}))})}),[].concat(o.string).filter(Boolean).forEach(function($){a.strings[$]=!0,c[$]&&(a.strings[c[$]]=!0)});var l=o.default||{},u={_:[]};Object.keys(a.bools).forEach(function($){p($,l[$]===void 0?!1:l[$])});var d=[];n.indexOf("--")!==-1&&(d=n.slice(n.indexOf("--")+1),n=n.slice(0,n.indexOf("--")));function f($,ge){return a.allBools&&/^--[^=]+$/.test(ge)||a.strings[$]||a.bools[$]||c[$]}function p($,ge,Ke){if(!(Ke&&a.unknownFn&&!f($,Ke)&&a.unknownFn(Ke)===!1)){var ie=!a.strings[$]&&r(ge)?Number(ge):ge;v(u,$.split("."),ie),(c[$]||[]).forEach(function(Et){v(u,Et.split("."),ie)})}}function v($,ge,Ke){for(var ie=$,Et=0;Et<ge.length-1;Et++){var W=ge[Et];if(s(ie,W))return;ie[W]===void 0&&(ie[W]={}),(ie[W]===Object.prototype||ie[W]===Number.prototype||ie[W]===String.prototype)&&(ie[W]={}),ie[W]===Array.prototype&&(ie[W]=[]),ie=ie[W]}var W=ge[ge.length-1];s(ie,W)||((ie===Object.prototype||ie===Number.prototype||ie===String.prototype)&&(ie={}),ie===Array.prototype&&(ie=[]),ie[W]===void 0||a.bools[W]||typeof ie[W]=="boolean"?ie[W]=Ke:Array.isArray(ie[W])?ie[W].push(Ke):ie[W]=[ie[W],Ke])}function m($){return c[$].some(function(ge){return a.bools[ge]})}for(var y=0;y<n.length;y++){var S=n[y];if(/^--.+=/.test(S)){var E=S.match(/^--([^=]+)=([\s\S]*)$/),k=E[1],R=E[2];a.bools[k]&&(R=R!=="false"),p(k,R,S)}else if(/^--no-.+/.test(S)){var k=S.match(/^--no-(.+)/)[1];p(k,!1,S)}else if(/^--.+/.test(S)){var k=S.match(/^--(.+)/)[1],C=n[y+1];C!==void 0&&!/^-/.test(C)&&!a.bools[k]&&!a.allBools&&(!c[k]||!m(k))?(p(k,C,S),y++):/^(true|false)$/.test(C)?(p(k,C==="true",S),y++):p(k,a.strings[k]?"":!0,S)}else if(/^-[^-]+/.test(S)){for(var M=S.slice(1,-1).split(""),J=!1,ne=0;ne<M.length;ne++){var C=S.slice(ne+2);if(C==="-"){p(M[ne],C,S);continue}if(/[A-Za-z]/.test(M[ne])&&/=/.test(C)){p(M[ne],C.split("=")[1],S),J=!0;break}if(/[A-Za-z]/.test(M[ne])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(C)){p(M[ne],C,S),J=!0;break}if(M[ne+1]&&M[ne+1].match(/\W/)){p(M[ne],S.slice(ne+2),S),J=!0;break}else p(M[ne],a.strings[M[ne]]?"":!0,S)}var k=S.slice(-1)[0];!J&&k!=="-"&&(n[y+1]&&!/^(-|--)[^-]/.test(n[y+1])&&!a.bools[k]&&(!c[k]||!m(k))?(p(k,n[y+1],S),y++):n[y+1]&&/^(true|false)$/.test(n[y+1])?(p(k,n[y+1]==="true",S),y++):p(k,a.strings[k]?"":!0,S))}else if((!a.unknownFn||a.unknownFn(S)!==!1)&&u._.push(a.strings._||!r(S)?S:Number(S)),o.stopEarly){u._.push.apply(u._,n.slice(y+1));break}}return Object.keys(l).forEach(function($){i(u,$.split("."))||(v(u,$.split("."),l[$]),(c[$]||[]).forEach(function(ge){v(u,ge.split("."),l[$])}))}),o["--"]?(u["--"]=new Array,d.forEach(function($){u["--"].push($)})):d.forEach(function($){u._.push($)}),u};function i(n,o){var a=n;o.slice(0,-1).forEach(function(l){a=a[l]||{}});var c=o[o.length-1];return c in a}function r(n){return typeof n=="number"||/^0x[0-9a-f]+$/i.test(n)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(n)}function s(n,o){return o==="constructor"&&typeof n[o]=="function"||o==="__proto__"}}});function J8(t){return t.replace(j0,function(e,i,r,s,n,o){if(s)return"";if(n){const a=n.length;return n[a-1]===`
|
|
`?n[a-2]==="\r"?`\r
|
|
`:`
|
|
`:""}else return o?e.substring(1):e})}function B0(t){const e=J8(t);try{return JSON.parse(e)}catch{const r=e.replace(/,\s*([}\]])/g,"$1");return JSON.parse(r)}}var j0,H0=g({"out-build/vs/base/common/jsonc.js"(){"use strict";j0=/("[^"\\]*(?:\\.[^"\\]*)*")|('[^'\\]*(?:\\.[^'\\]*)*')|(\/\*[^\/\*]*(?:(?:\*|\/)[^\/\*]*)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))|(,\s*[}\]])/g}});import*as V0 from"os";import*as Us from"path";function q0(t,e){const i=Q8(t,e),r=[i];return Us.isAbsolute(i)||r.unshift(z0),Us.resolve(...r)}function Q8(t,e){process.env.VSCODE_DEV&&(e="code-oss-dev");const i=process.env.VSCODE_PORTABLE;if(i)return Us.join(i,"user-data");let r=process.env.VSCODE_APPDATA;if(r)return Us.join(r,e);const s=t["user-data-dir"];if(s)return s;switch(process.platform){case"win32":if(r=process.env.APPDATA,!r){const n=process.env.USERPROFILE;if(typeof n!="string")throw new Error("Windows: Unexpected undefined %USERPROFILE% environment variable");r=Us.join(n,"AppData","Roaming")}break;case"darwin":r=Us.join(V0.homedir(),"Library","Application Support");break;case"linux":r=process.env.XDG_CONFIG_HOME||Us.join(V0.homedir(),".config");break;default:throw new Error("Platform not supported")}return Us.join(r,e)}var z0,G0=g({"out-build/vs/platform/environment/node/userDataPath.js"(){"use strict";z0=process.env.VSCODE_CWD||process.cwd()}});function X8(){const t=K0();return t?Array.from(t):[]}function K0(){return process.uncHostAllowlist}function Ya(t){if(process.platform!=="win32")return;const e=K0();if(e)if(typeof t=="string")e.add(t.toLowerCase());else for(const i of Z8(t))Ya(i)}function Z8(t){const e=new Set;if(Array.isArray(t))for(const i of t)typeof i=="string"&&e.add(i);return Array.from(e)}function Y0(t){if(typeof t!="string")return;const e=["\\\\.\\UNC\\","\\\\?\\UNC\\","\\\\"];let i;for(const r of e){if(t.indexOf(r)!==0)continue;const n=t.indexOf("\\",r.length);if(n===-1)continue;const o=t.substring(r.length,n);if(o){i=o;break}}return i}function ex(){process.platform==="win32"&&(process.restrictUNCAccess=!1)}function tx(){return process.platform!=="win32"?!0:process.restrictUNCAccess===!1}var Ja=g({"out-build/vs/base/node/unc.js"(){"use strict"}}),Qa,J0=g({"out-build/vs/platform/environment/common/buildFlags.js"(){"use strict";Qa={enableSpecialRules:!1,extensionIsDev:!1,developmentTooling:!1,enableTraceSpanCollection:!0,enableEmbeddingsModelToggle:!1,enableRCPServer:!1,enableCPPControlTokenToggle:!1,cursorPredictionOptions:!1}}});function Yt(){return globalThis._CURSOR_SENTRY}function ix(){return{send:function(e){const i=Yt().buffer;return i.length<64&&i.push(e),Promise.resolve({statusCode:200})},flush:function(e){return Promise.resolve(!0)}}}function rx(){return{send:function(t){return Yt().enabled?Yt().transport.send(t):Promise.resolve({statusCode:200})},flush:function(t){return Yt().transport.flush(t)}}}function sx(){return function(t){return 0}}function nx(){return{defaultIntegrations:[],dsn:Qa.developmentTooling?X0:Q0,parentSpanIsAlwaysRootSpan:!1,tracesSampler:sx(),transport:rx}}var Q0,X0,Xa=g({"out-build/vs/platform/tracing/common/global.js"(){"use strict";J0(),Q0="https://80ec2259ebfad12d8aa2afe6eb4f6dd5@metrics.cursor.sh/4508016051945472",X0="https://0a7b82d23ca5f4635708bc8e9957e4bd@o4504648565915648.ingest.us.sentry.io/4509635758522369",globalThis._CURSOR_SENTRY===void 0&&(globalThis._CURSOR_SENTRY={buffer:[],enabled:!0,loggerSampleRate:1,sentry:void 0,tracesSampleRate:Qa.developmentTooling?1:.01,trace2SampleRate:Qa.developmentTooling?1:.01,profilesSampleRate:0,jsonStringifySampleRate:0,transport:ix()})}});function Iu(){return globalThis._VSCODE_NLS_MESSAGES}function Za(){return globalThis._VSCODE_NLS_LANGUAGE}var Z0=g({"out-build/vs/nls.messages.js"(){"use strict"}});function Du(t,e){let i;return e.length===0?i=t:i=t.replace(/\{(\d+)\}/g,(r,s)=>{const n=s[0],o=e[n];let a=r;return typeof o=="string"?a=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(a=String(o)),a}),iy&&(i="\uFF3B"+i.replace(/[aouei]/g,"$&$&")+"\uFF3D"),i}function w(t,e,...i){return Du(typeof t=="number"?ey(t,e):e,i)}function ey(t,e){const i=Iu()?.[t];if(typeof i!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return i}function ty(t,e,...i){let r;typeof t=="number"?r=ey(t,e):r=e;const s=Du(r,i);return{value:s,original:e===r?s:Du(e,i)}}var iy,we=g({"out-build/vs/nls.js"(){"use strict";Z0(),Z0(),iy=Za()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0}});function ry(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}function ox(t){return parseFloat(t)>=20}var Sn,bo,Eo,ko,tg,ig,Au,sy,rg,sg,ny,ec,tc,ng,og,Rr,Mr,oi,ag,oy,ay,ic,B,O,Pe,cg,lg,us,cy,ly,uy,Po,yr,Zi,dy,ug,hy,fy,py,Gi,dg,gy,my,vy,ax,cx,lx,z=g({"out-build/vs/base/common/platform.js"(){"use strict";if(we(),Sn="en",bo=!1,Eo=!1,ko=!1,tg=!1,ig=!1,Au=!1,sy=!1,rg=!1,sg=!1,ny=!1,ec=void 0,tc=Sn,ng=Sn,og=void 0,Rr=void 0,Mr=globalThis,oi=void 0,typeof Mr.vscode<"u"&&typeof Mr.vscode.process<"u"?oi=Mr.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(oi=process),ag=typeof oi?.versions?.electron=="string",oy=ag&&oi?.type==="renderer",typeof oi=="object"){bo=oi.platform==="win32",Eo=oi.platform==="darwin",ko=oi.platform==="linux",tg=ko&&!!oi.env.SNAP&&!!oi.env.SNAP_REVISION,sy=ag,sg=!!oi.env.CI||!!oi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ec=Sn,tc=Sn;const t=oi.env.VSCODE_NLS_CONFIG;if(t)try{const e=JSON.parse(t);ec=e.userLocale,ng=e.osLocale,tc=e.resolvedLanguage||Sn,og=e.languagePack?.translationsConfigFile}catch{}ig=!0}else typeof navigator=="object"&&!oy?(Rr=navigator.userAgent,bo=Rr.indexOf("Windows")>=0,Eo=Rr.indexOf("Macintosh")>=0,rg=(Rr.indexOf("Macintosh")>=0||Rr.indexOf("iPad")>=0||Rr.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ko=Rr.indexOf("Linux")>=0,ny=Rr?.indexOf("Mobi")>=0,Au=!0,tc=Za()||Sn,ec=navigator.language.toLowerCase(),ng=ec):console.error("Unable to resolve platform.");(function(t){t[t.Web=0]="Web",t[t.Mac=1]="Mac",t[t.Linux=2]="Linux",t[t.Windows=3]="Windows"})(ay||(ay={})),ic=0,Eo?ic=1:bo?ic=3:ko&&(ic=2),B=bo,O=Eo,Pe=ko,cg=tg,lg=ig,us=Au,cy=Au&&typeof Mr.importScripts=="function",ly=cy?Mr.origin:void 0,uy=sg,Po=ic,yr=Rr,Zi=tc,(function(t){function e(){return Zi}t.value=e;function i(){return Zi.length===2?Zi==="en":Zi.length>=3?Zi[0]==="e"&&Zi[1]==="n"&&Zi[2]==="-":!1}t.isDefaultVariant=i;function r(){return Zi==="en"}t.isDefault=r})(dy||(dy={})),ug=og,hy=typeof Mr.postMessage=="function"&&!Mr.importScripts,fy=(()=>{if(hy){const t=[];Mr.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let r=0,s=t.length;r<s;r++){const n=t[r];if(n.id===i.data.vscodeScheduleAsyncWork){t.splice(r,1),n.callback();return}}});let e=0;return i=>{const r=++e;t.push({id:r,callback:i}),Mr.postMessage({vscodeScheduleAsyncWork:r},"*")}}return t=>setTimeout(t)})(),(function(t){t[t.Windows=1]="Windows",t[t.Macintosh=2]="Macintosh",t[t.Linux=3]="Linux"})(py||(py={})),Gi=Eo||rg?2:bo?1:3,dg=!!(yr&&yr.indexOf("Chrome")>=0),gy=!!(yr&&yr.indexOf("Firefox")>=0),my=!!(!dg&&yr&&yr.indexOf("Safari")>=0),vy=!!(yr&&yr.indexOf("Edg/")>=0),ax=!!(yr&&yr.indexOf("Android")>=0),cx=oi?.arch,lx=oi?.platform}});function ux(t,e,i=0,r=t.length){let s=i,n=r;for(;s<n;){const o=Math.floor((s+n)/2);e(t[o])?s=o+1:n=o}return s-1}function dx(t,e,i=0,r=t.length){let s=i,n=r;for(;s<n;){const o=Math.floor((s+n)/2);e(t[o])?n=o:s=o+1}return s}var hx,fx=g({"out-build/vs/base/common/arraysFind.js"(){"use strict";hx=class ZP{static{this.assertInvariants=!1}constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(ZP.assertInvariants){if(this._prevFindLastPredicate){for(const r of this._array)if(this._prevFindLastPredicate(r)&&!e(r))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}const i=ux(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,i===-1?void 0:this._array[i]}}}});function wy(t){rc.setUnexpectedErrorHandler(t)}function px(t){if(!t||typeof t!="object")return!1;const e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}function $t(t){Ru(t)||rc.onUnexpectedError(t)}function Ru(t){return t instanceof yi?!0:t instanceof Error&&t.name===sc&&t.message===sc}function xo(){const t=new Error(sc);return t.name=t.message,t}function yy(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}function $i(t){return t?t.message?t.message:t.stack?t.stack.split(`
|
|
`)[0]:String(t):"Error"}var Sy,rc,sc,yi,Mu,Tr,_y,Re=g({"out-build/vs/base/common/errors.js"(){"use strict";Sy=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Tr.isErrorNoTelemetry(t)?new Tr(t.message+`
|
|
|
|
`+t.stack):new Error(t.message+`
|
|
|
|
`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},rc=new Sy,sc="Canceled",yi=class extends Error{constructor(){super(sc),this.name=this.message}},Mu=class extends Error{constructor(){super(...arguments),this.isExpected=!0}},Tr=class k0 extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof k0)return e;const i=new k0;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},_y=class e8 extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,e8.prototype)}}}});function nc(t,e,i=(r,s)=>r===s){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let r=0,s=t.length;r<s;r++)if(!i(t[r],e[r]))return!1;return!0}function gx(t,e,i){return mx(t.length,r=>i(t[r],e))}function mx(t,e){let i=0,r=t-1;for(;i<=r;){const s=(i+r)/2|0,n=e(s);if(n<0)i=s+1;else if(n>0)r=s-1;else return s}return-(i+1)}function vx(t,e,i){if(i===0)return[];const r=t.slice(0,i).sort(e);return wx(t,e,r,i,t.length),r}function wx(t,e,i,r,s){for(const n=i.length;r<s;r++){const o=t[r];if(e(o,i[n-1])<0){i.pop();const a=dx(i,c=>e(o,c)<0);i.splice(a,0,o)}}}function Dt(t){return t.filter(e=>!!e)}function ds(t,e=i=>i){const i=new Set;return t.filter(r=>{const s=e(r);return i.has(s)?!1:(i.add(s),!0)})}function by(t,e){return t.push(e),()=>yx(t,e)}function yx(t,e){const i=t.indexOf(e);if(i>-1)return t.splice(i,1),e}function Ey(t,e){let i;if(typeof e=="number"){let r=e;i=()=>{const s=Math.sin(r++)*179426549;return s-Math.floor(s)}}else i=Math.random;for(let r=t.length-1;r>0;r-=1){const s=Math.floor(i()*(r+1)),n=t[r];t[r]=t[s],t[s]=n}}function Sx(t){return t[Math.floor(Math.random()*t.length)]}function _x(t,e){return(i,r)=>e(t(i),t(r))}var hg,ky,bx,Wt=g({"out-build/vs/base/common/arrays.js"(){"use strict";fx(),Re(),(function(t){function e(n){return n<0}t.isLessThan=e;function i(n){return n<=0}t.isLessThanOrEqual=i;function r(n){return n>0}t.isGreaterThan=r;function s(n){return n===0}t.isNeitherLessOrGreaterThan=s,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(hg||(hg={})),ky=(t,e)=>t-e,bx=class Op{static{this.empty=new Op(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(i=>(e(i),!0))}toArray(){const e=[];return this.iterate(i=>(e.push(i),!0)),e}filter(e){return new Op(i=>this.iterate(r=>e(r)?i(r):!0))}map(e){return new Op(i=>this.iterate(r=>i(e(r))))}some(e){let i=!1;return this.iterate(r=>(i=e(r),!i)),i}findFirst(e){let i;return this.iterate(r=>e(r)?(i=r,!1):!0),i}findLast(e){let i;return this.iterate(r=>(e(r)&&(i=r),!0)),i}findLastMaxBy(e){let i,r=!0;return this.iterate(s=>((r||hg.isGreaterThan(e(s,i)))&&(r=!1,i=s),!0)),i}}}});function Ex(t,e){const i=Object.create(null);for(const r of t){const s=e(r);let n=i[s];n||(n=i[s]=[]),n.push(r)}return i}var Py,kx,xy=g({"out-build/vs/base/common/collections.js"(){"use strict";kx=class{static{Py=Symbol.toStringTag}constructor(t,e){this.toKey=e,this._map=new Map,this[Py]="SetWithKey";for(const i of t)this.add(i)}get size(){return this._map.size}add(t){const e=this.toKey(t);return this._map.set(e,t),this}delete(t){return this._map.delete(this.toKey(t))}has(t){return this._map.has(this.toKey(t))}*entries(){for(const t of this._map.values())yield[t,t]}keys(){return this.values()}*values(){for(const t of this._map.values())yield t}clear(){this._map.clear()}forEach(t,e){this._map.forEach(i=>t.call(e,i,i,this))}[Symbol.iterator](){return this.values()}}}});function Tu(t,e){const i=this;let r=!1,s;return function(){if(r)return s;if(r=!0,e)try{s=t.apply(i,arguments)}finally{e()}else s=t.apply(i,arguments);return s}}var Wu=g({"out-build/vs/base/common/functional.js"(){"use strict"}});function Px(t){const e=[];return t.forEach((i,r)=>{e.push(`${r} => ${i}`)}),`Map(${t.size}) {${e.join(", ")}}`}function xx(t){const e=[];return t.forEach(i=>{e.push(i)}),`Set(${t.size}) {${e.join(", ")}}`}function Cx(t){return Array.isArray(t)}var Cy,Iy,Dy,Ay,Bt,fg,Ry,My,Ty,oc,Wy,ai=g({"out-build/vs/base/common/map.js"(){"use strict";Ay=class{constructor(t,e){this.uri=t,this.value=e}},Bt=class pu{static{this.defaultToKey=e=>e.toString()}constructor(e,i){if(this[Cy]="ResourceMap",e instanceof pu)this.map=new Map(e.map),this.toKey=i??pu.defaultToKey;else if(Cx(e)){this.map=new Map,this.toKey=i??pu.defaultToKey;for(const[r,s]of e)this.set(r,s)}else this.map=new Map,this.toKey=e??pu.defaultToKey}set(e,i){return this.map.set(this.toKey(e),new Ay(e,i)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,i){typeof i<"u"&&(e=e.bind(i));for(const[r,s]of this.map)e(s.value,s.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(Cy=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}},fg=class{constructor(t,e){this[Iy]="ResourceSet",!t||typeof t=="function"?this._map=new Bt(t):(this._map=new Bt(e),t.forEach(this.add,this))}get size(){return this._map.size}add(t){return this._map.set(t,t),this}clear(){this._map.clear()}delete(t){return this._map.delete(t)}forEach(t,e){this._map.forEach((i,r)=>t.call(e,r,r,this))}has(t){return this._map.has(t)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(Iy=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}},(function(t){t[t.None=0]="None",t[t.AsOld=1]="AsOld",t[t.AsNew=2]="AsNew"})(Ry||(Ry={})),My=class{constructor(){this[Dy]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(t){return this._map.has(t)}get(t,e=0){const i=this._map.get(t);if(i)return e!==0&&this.touch(i,e),i.value}set(t,e,i=0){let r=this._map.get(t);if(r)r.value=e,i!==0&&this.touch(r,i);else{switch(r={key:t,value:e,next:void 0,previous:void 0},i){case 0:this.addItemLast(r);break;case 1:this.addItemFirst(r);break;case 2:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(t,r),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){const e=this._map.get(t);if(e)return this._map.delete(t),this.removeItem(e),this._size--,e.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,e){const i=this._state;let r=this._head;for(;r;){if(e?t.bind(e)(r.value,r.key,this):t(r.value,r.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const t=this,e=this._state;let i=this._head;const r={[Symbol.iterator](){return r},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(i){const s={value:i.key,done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return r}values(){const t=this,e=this._state;let i=this._head;const r={[Symbol.iterator](){return r},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(i){const s={value:i.value,done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return r}entries(){const t=this,e=this._state;let i=this._head;const r={[Symbol.iterator](){return r},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(i){const s={value:[i.key,i.value],done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return r}[(Dy=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let e=this._head,i=this.size;for(;e&&i>t;)this._map.delete(e.key),e=e.next,i--;this._head=e,this._size=i,e&&(e.previous=void 0),this._state++}trimNew(t){if(t>=this.size)return;if(t===0){this.clear();return}let e=this._tail,i=this.size;for(;e&&i>t;)this._map.delete(e.key),e=e.previous,i--;this._tail=e,this._size=i,e&&(e.next=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{const e=t.next,i=t.previous;if(!e||!i)throw new Error("Invalid list");e.previous=i,i.next=e}t.next=void 0,t.previous=void 0,this._state++}touch(t,e){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(e!==1&&e!==2)){if(e===1){if(t===this._head)return;const i=t.next,r=t.previous;t===this._tail?(r.next=void 0,this._tail=r):(i.previous=r,r.next=i),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(e===2){if(t===this._tail)return;const i=t.next,r=t.previous;t===this._head?(i.previous=void 0,this._head=i):(i.previous=r,r.next=i),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){const t=[];return this.forEach((e,i)=>{t.push([i,e])}),t}fromJSON(t){this.clear();for(const[e,i]of t)this.set(e,i)}},Ty=class extends My{constructor(t,e=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,e),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,e=2){return super.get(t,e)}peek(t){return super.get(t,0)}set(t,e){return super.set(t,e,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},oc=class extends Ty{constructor(t,e=1){super(t,e)}trim(t){this.trimOld(t)}set(t,e){return super.set(t,e),this.checkTrim(),this}},Wy=class{constructor(){this.map=new Map}add(t,e){let i=this.map.get(t);i||(i=new Set,this.map.set(t,i)),i.add(e)}delete(t,e){const i=this.map.get(t);i&&(i.delete(e),i.size===0&&this.map.delete(t))}forEach(t,e){const i=this.map.get(t);i&&i.forEach(e)}get(t){const e=this.map.get(t);return e||new Set}}}});function pg(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function Ix(t,e="unexpected state"){if(!t)throw typeof e=="string"?new _y(`Assertion Failed: ${e}`):e}var Lu=g({"out-build/vs/base/common/assert.js"(){"use strict";Re()}});function At(t){return typeof t=="string"}function Lt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}function Dx(t){const e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}function Ou(t){return typeof t=="number"&&!isNaN(t)}function Ax(t){return!!t&&typeof t[Symbol.iterator]=="function"}function Ly(t){return t===!0||t===!1}function hs(t){return typeof t>"u"}function Co(t){return!ci(t)}function ci(t){return hs(t)||t===null}function Rx(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Fu(t){return Ix(t!=null,"Argument is `undefined` or `null`."),t}function Oy(t){if(!Lt(t))return!1;for(const e in t)if(Fy.call(t,e))return!1;return!0}function gg(t){return typeof t=="function"}function YB(t){return t}var Fy,xe=g({"out-build/vs/base/common/types.js"(){"use strict";Lu(),Fy=Object.prototype.hasOwnProperty}}),_n,Nu=g({"out-build/vs/base/common/iterator.js"(){"use strict";xe(),(function(t){function e(C){return C&&typeof C=="object"&&typeof C[Symbol.iterator]=="function"}t.is=e;const i=Object.freeze([]);function r(){return i}t.empty=r;function*s(C){yield C}t.single=s;function n(C){return e(C)?C:s(C)}t.wrap=n;function o(C){return C||i}t.from=o;function*a(C){for(let M=C.length-1;M>=0;M--)yield C[M]}t.reverse=a;function c(C){return!C||C[Symbol.iterator]().next().done===!0}t.isEmpty=c;function l(C){return C[Symbol.iterator]().next().value}t.first=l;function u(C,M){let J=0;for(const ne of C)if(M(ne,J++))return!0;return!1}t.some=u;function d(C,M){for(const J of C)if(M(J))return J}t.find=d;function*f(C,M){for(const J of C)M(J)&&(yield J)}t.filter=f;function*p(C,M){let J=0;for(const ne of C)yield M(ne,J++)}t.map=p;function*v(C,M){let J=0;for(const ne of C)yield*M(ne,J++)}t.flatMap=v;function*m(...C){for(const M of C)Ax(M)?yield*M:yield M}t.concat=m;function y(C,M,J){let ne=J;for(const $ of C)ne=M(ne,$);return ne}t.reduce=y;function S(C){let M=0;for(const J of C)M++;return M}t.length=S;function*E(C,M,J=C.length){for(M<-C.length&&(M=0),M<0&&(M+=C.length),J<0?J+=C.length:J>C.length&&(J=C.length);M<J;M++)yield C[M]}t.slice=E;function k(C,M=Number.POSITIVE_INFINITY){const J=[];if(M===0)return[J,C];const ne=C[Symbol.iterator]();for(let $=0;$<M;$++){const ge=ne.next();if(ge.done)return[J,t.empty()];J.push(ge.value)}return[J,{[Symbol.iterator](){return ne}}]}t.consume=k;async function R(C){const M=[];for await(const J of C)M.push(J);return Promise.resolve(M)}t.asyncToArray=R})(_n||(_n={}))}});function Mx(t){bn=t}function ac(t){return bn?.trackDisposable(t),t}function cc(t){bn?.markAsDisposed(t)}function lc(t,e){bn?.setParent(t,e)}function Tx(t,e){if(bn)for(const i of t)bn.setParent(i,e)}function Ny(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}function Rt(t){if(_n.is(t)){const e=[];for(const i of t)if(i)try{i.dispose()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function Wx(...t){const e=me(()=>Rt(t));return Tx(t,e),e}function me(t){const e=ac({dispose:Tu(()=>{cc(e),t()})});return e}var Uy,bn,Lx,ke,N,$s,mg,L=g({"out-build/vs/base/common/lifecycle.js"(){"use strict";if(Wt(),xy(),ai(),Wu(),Nu(),Uy=!1,bn=null,Lx=class t8{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let i=this.livingDisposables.get(e);return i||(i={parent:null,source:null,isSingleton:!1,value:e,idx:t8.idx++},this.livingDisposables.set(e,i)),i}trackDisposable(e){const i=this.getDisposableData(e);i.source||(i.source=new Error().stack)}setParent(e,i){const r=this.getDisposableData(e);r.parent=i}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,i){const r=i.get(e);if(r)return r;const s=e.parent?this.getRootParent(this.getDisposableData(e.parent),i):e;return i.set(e,s),s}getTrackedDisposables(){const e=new Map;return[...this.livingDisposables.entries()].filter(([,r])=>r.source!==null&&!this.getRootParent(r,e).isSingleton).flatMap(([r])=>r)}computeLeakingDisposables(e=10,i){let r;if(i)r=i;else{const c=new Map,l=[...this.livingDisposables.values()].filter(d=>d.source!==null&&!this.getRootParent(d,c).isSingleton);if(l.length===0)return;const u=new Set(l.map(d=>d.value));if(r=l.filter(d=>!(d.parent&&u.has(d.parent))),r.length===0)throw new Error("There are cyclic diposable chains!")}if(!r)return;function s(c){function l(d,f){for(;d.length>0&&f.some(p=>typeof p=="string"?p===d[0]:d[0].match(p));)d.shift()}const u=c.source.split(`
|
|
`).map(d=>d.trim().replace("at ","")).filter(d=>d!=="");return l(u,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),u.reverse()}const n=new Wy;for(const c of r){const l=s(c);for(let u=0;u<=l.length;u++)n.add(l.slice(0,u).join(`
|
|
`),c)}r.sort(_x(c=>c.idx,ky));let o="",a=0;for(const c of r.slice(0,e)){a++;const l=s(c),u=[];for(let d=0;d<l.length;d++){let f=l[d];f=`(shared with ${n.get(l.slice(0,d+1).join(`
|
|
`)).size}/${r.length} leaks) at ${f}`;const v=n.get(l.slice(0,d).join(`
|
|
`)),m=Ex([...v].map(y=>s(y)[d]),y=>y);delete m[l[d]];for(const[y,S]of Object.entries(m))u.unshift(` - stacktraces of ${S.length} other leaks continue with ${y}`);u.unshift(f)}o+=`
|
|
|
|
|
|
==================== Leaking disposable ${a}/${r.length}: ${c.value.constructor.name} ====================
|
|
${u.join(`
|
|
`)}
|
|
============================================================
|
|
|
|
`}return r.length>e&&(o+=`
|
|
|
|
|
|
... and ${r.length-e} more leaking disposables
|
|
|
|
`),{leaks:r,details:o}}},Uy){const t="__is_disposable_tracked__";Mx(new class{trackDisposable(e){const i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(i)},3e3)}setParent(e,i){if(e&&e!==N.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==N.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}ke=class i8{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,ac(this)}dispose(){this._isDisposed||(cc(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Rt(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return lc(e,this),this._isDisposed?i8.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),lc(e,null))}},N=class{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new ke,ac(this),lc(this._store,this)}dispose(){cc(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}},$s=class{constructor(){this._isDisposed=!1,ac(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),t&&lc(t,this),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,cc(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){const t=this._value;return this._value=void 0,t&&lc(t,null),t}},mg=class{constructor(){this._store=new Map,this._isDisposed=!1,ac(this)}dispose(){cc(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Rt(this._store.values())}finally{this._store.clear()}}has(t){return this._store.has(t)}get size(){return this._store.size}get(t){return this._store.get(t)}set(t,e,i=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||this._store.get(t)?.dispose(),this._store.set(t,e)}deleteAndDispose(t){this._store.get(t)?.dispose(),this._store.delete(t)}deleteAndLeak(t){const e=this._store.get(t);return this._store.delete(t),e}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}}}),ht,vg,$y=g({"out-build/vs/base/common/linkedList.js"(){"use strict";ht=class Fp{static{this.Undefined=new Fp(void 0)}constructor(e){this.element=e,this.next=Fp.Undefined,this.prev=Fp.Undefined}},vg=class{constructor(){this._first=ht.Undefined,this._last=ht.Undefined,this._size=0}get size(){return this._size}get first(){return this._first}isEmpty(){return this._first===ht.Undefined}clear(){let t=this._first;for(;t!==ht.Undefined;){const e=t.next;t.prev=ht.Undefined,t.next=ht.Undefined,t=e}this._first=ht.Undefined,this._last=ht.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){const i=new ht(t);if(this._first===ht.Undefined)this._first=i,this._last=i;else if(e){const s=this._last;this._last=i,i.prev=s,s.next=i}else{const s=this._first;this._first=i,i.next=s,s.prev=i}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(i))}}shift(){if(this._first!==ht.Undefined){const t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==ht.Undefined){const t=this._last.element;return this._remove(this._last),t}}remove(t){this._remove(t)}_remove(t){if(t.prev!==ht.Undefined&&t.next!==ht.Undefined){const e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===ht.Undefined&&t.next===ht.Undefined?(this._first=ht.Undefined,this._last=ht.Undefined):t.next===ht.Undefined?(this._last=this._last.prev,this._last.next=ht.Undefined):t.prev===ht.Undefined&&(this._first=this._first.next,this._first.prev=ht.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==ht.Undefined;)yield t.element,t=t.next}}}}),By,En,Io=g({"out-build/vs/base/common/stopwatch.js"(){"use strict";By=globalThis.performance&&typeof globalThis.performance.now=="function",En=class r8{static create(e){return new r8(e)}constructor(e){this._now=By&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}}}),wg,jy,P,Hy,yg,Vy,Uu,qy,zy,Gy,uc,Ky,Yy,D,Jy,$u,Qy,Sg,q=g({"out-build/vs/base/common/event.js"(){"use strict";xy(),Re(),Wu(),L(),$y(),Io(),wg=!1,jy=!1,(function(t){t.None=()=>N.None;function e(W){if(jy){const{onDidAddListener:F}=W,Q=Uu.create();let H=0;W.onDidAddListener=()=>{++H===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),Q.print()),F?.()}}}function i(W,F){return p(W,()=>{},0,void 0,!0,void 0,F)}t.defer=i;function r(W){return(F,Q=null,H)=>{let ee=!1,de;return de=W(Ae=>{if(!ee)return de?de.dispose():ee=!0,F.call(Q,Ae)},null,H),ee&&de.dispose(),de}}t.once=r;function s(W,F){return t.once(t.filter(W,F))}t.onceIf=s;function n(W,F,Q){return d((H,ee=null,de)=>W(Ae=>H.call(ee,F(Ae)),null,de),Q)}t.map=n;function o(W,F,Q){return d((H,ee=null,de)=>W(Ae=>{F(Ae),H.call(ee,Ae)},null,de),Q)}t.forEach=o;function a(W,F,Q){return d((H,ee=null,de)=>W(Ae=>F(Ae)&&H.call(ee,Ae),null,de),Q)}t.filter=a;function c(W){return W}t.signal=c;function l(...W){return(F,Q=null,H)=>{const ee=Wx(...W.map(de=>de(Ae=>F.call(Q,Ae))));return f(ee,H)}}t.any=l;function u(W,F,Q,H){let ee=Q;return n(W,de=>(ee=F(ee,de),ee),H)}t.reduce=u;function d(W,F){let Q;const H={onWillAddFirstListener(){Q=W(ee.fire,ee)},onDidRemoveLastListener(){Q?.dispose()}};F||e(H);const ee=new D(H);return F?.add(ee),ee.event}function f(W,F){return F instanceof Array?F.push(W):F&&F.add(W),W}function p(W,F,Q=100,H=!1,ee=!1,de,Ae){let _e,kt,os,vn=0,as;const So={leakWarningThreshold:de,onWillAddFirstListener(){_e=W(bu=>{vn++,kt=F(kt,bu),H&&!os&&(Dr.fire(kt),kt=void 0),as=()=>{const Eu=kt;kt=void 0,os=void 0,(!H||vn>1)&&Dr.fire(Eu),vn=0},typeof Q=="number"?(clearTimeout(os),os=setTimeout(as,Q)):os===void 0&&(os=0,queueMicrotask(as))})},onWillRemoveListener(){ee&&vn>0&&as?.()},onDidRemoveLastListener(){as=void 0,_e.dispose()}};Ae||e(So);const Dr=new D(So);return Ae?.add(Dr),Dr.event}t.debounce=p;function v(W,F=0,Q){return t.debounce(W,(H,ee)=>H?(H.push(ee),H):[ee],F,void 0,!0,void 0,Q)}t.accumulate=v;function m(W,F=(H,ee)=>H===ee,Q){let H=!0,ee;return a(W,de=>{const Ae=H||!F(de,ee);return H=!1,ee=de,Ae},Q)}t.latch=m;function y(W,F,Q){return[t.filter(W,F,Q),t.filter(W,H=>!F(H),Q)]}t.split=y;function S(W,F=!1,Q=[],H){let ee=Q.slice(),de=W(kt=>{ee?ee.push(kt):_e.fire(kt)});H&&H.add(de);const Ae=()=>{ee?.forEach(kt=>_e.fire(kt)),ee=null},_e=new D({onWillAddFirstListener(){de||(de=W(kt=>_e.fire(kt)),H&&H.add(de))},onDidAddFirstListener(){ee&&(F?setTimeout(Ae):Ae())},onDidRemoveLastListener(){de&&de.dispose(),de=null}});return H&&H.add(_e),_e.event}t.buffer=S;function E(W,F){return(H,ee,de)=>{const Ae=F(new R);return W(function(_e){const kt=Ae.evaluate(_e);kt!==k&&H.call(ee,kt)},void 0,de)}}t.chain=E;const k=Symbol("HaltChainable");class R{constructor(){this.steps=[]}map(F){return this.steps.push(F),this}forEach(F){return this.steps.push(Q=>(F(Q),Q)),this}filter(F){return this.steps.push(Q=>F(Q)?Q:k),this}reduce(F,Q){let H=Q;return this.steps.push(ee=>(H=F(H,ee),H)),this}latch(F=(Q,H)=>Q===H){let Q=!0,H;return this.steps.push(ee=>{const de=Q||!F(ee,H);return Q=!1,H=ee,de?ee:k}),this}evaluate(F){for(const Q of this.steps)if(F=Q(F),F===k)break;return F}}function C(W,F,Q=H=>H){const H=(..._e)=>Ae.fire(Q(..._e)),ee=()=>W.on(F,H),de=()=>W.removeListener(F,H),Ae=new D({onWillAddFirstListener:ee,onDidRemoveLastListener:de});return Ae.event}t.fromNodeEventEmitter=C;function M(W,F,Q=H=>H){const H=(..._e)=>Ae.fire(Q(..._e)),ee=()=>W.addEventListener(F,H),de=()=>W.removeEventListener(F,H),Ae=new D({onWillAddFirstListener:ee,onDidRemoveLastListener:de});return Ae.event}t.fromDOMEventEmitter=M;function J(W,F){return new Promise(Q=>r(W)(Q,null,F))}t.toPromise=J;function ne(W){const F=new D;return W.then(Q=>{F.fire(Q)},()=>{F.fire(void 0)}).finally(()=>{F.dispose()}),F.event}t.fromPromise=ne;function $(W,F){return W(Q=>F.fire(Q))}t.forward=$;function ge(W,F,Q){return F(Q),W(H=>F(H))}t.runAndSubscribe=ge;class Ke{constructor(F,Q){this._observable=F,this._counter=0,this._hasChanged=!1;const H={onWillAddFirstListener:()=>{F.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{F.removeObserver(this)}};Q||e(H),this.emitter=new D(H),Q&&Q.add(this.emitter)}beginUpdate(F){this._counter++}handlePossibleChange(F){}handleChange(F,Q){this._hasChanged=!0}endUpdate(F){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function ie(W,F){return new Ke(W,F).emitter.event}t.fromObservable=ie;function Et(W){return(F,Q,H)=>{let ee=0,de=!1;const Ae={beginUpdate(){ee++},endUpdate(){ee--,ee===0&&(W.reportChanges(),de&&(de=!1,F.call(Q)))},handlePossibleChange(){},handleChange(){de=!0}};W.addObserver(Ae),W.reportChanges();const _e={dispose(){W.removeObserver(Ae)}};return H instanceof ke?H.add(_e):Array.isArray(H)&&H.push(_e),_e}}t.fromObservableLight=Et})(P||(P={})),Hy=class P0{static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${P0._idPool++}`,P0.all.add(this)}start(e){this._stopWatch=new En,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}},yg=-1,Vy=class s8{static{this._idPool=1}constructor(e,i,r=(s8._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,i){const r=this.threshold;if(r<=0||i<r)return;this._stacks||(this._stacks=new Map);const s=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;const[n,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(n);const c=new qy(a,n);this._errorHandler(c)}return()=>{const n=this._stacks.get(e.value)||0;this._stacks.set(e.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(const[r,s]of this._stacks)(!e||i<s)&&(e=[r,s],i=s);return e}},Uu=class n8{static create(){const e=new Error;return new n8(e.stack??"")}constructor(e){this.value=e}print(){console.warn(this.value.split(`
|
|
`).slice(2).join(`
|
|
`))}},qy=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},zy=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},Gy=0,uc=class{constructor(t){this.value=t,this.id=Gy++}},Ky=2,Yy=(t,e)=>{if(t instanceof uc)e(t);else for(let i=0;i<t.length;i++){const r=t[i];r&&e(r)}},D=class{constructor(t){this._size=0,this._options=t,this._leakageMon=yg>0||this._options?.leakWarningThreshold?new Vy(t?.onListenerError??$t,this._options?.leakWarningThreshold??yg):void 0,this._perfMon=this._options?._profName?new Hy(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(wg){const t=this._listeners;queueMicrotask(()=>{Yy(t,e=>e.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(t,e,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);const c=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],l=new zy(`${a}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0]);return(this._options?.onListenerError||$t)(l),N.None}if(this._disposed)return N.None;e&&(t=t.bind(e));const r=new uc(t);let s,n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Uu.create(),s=this._leakageMon.check(r.stack,this._size+1)),wg&&(r.stack=n??Uu.create()),this._listeners?this._listeners instanceof uc?(this._deliveryQueue??=new Jy,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;const o=me(()=>{s?.(),this._removeListener(r)});return i instanceof ke?i.add(o):Array.isArray(i)&&i.push(o),o},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const e=this._listeners,i=e.indexOf(t);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[i]=void 0;const r=this._deliveryQueue.current===this;if(this._size*Ky<=e.length){let s=0;for(let n=0;n<e.length;n++)e[n]?e[s++]=e[n]:r&&s<this._deliveryQueue.end&&(this._deliveryQueue.end--,s<this._deliveryQueue.i&&this._deliveryQueue.i--);e.length=s}}_deliver(t,e){if(!t)return;const i=this._options?.onListenerError||$t;if(!i){t.value(e);return}try{t.value(e)}catch(r){i(r)}}_deliverQueue(t){const e=t.current._listeners;for(;t.i<t.end;)this._deliver(e[t.i++],t.value);t.reset()}fire(t){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof uc)this._deliver(this._listeners,t);else{const e=this._deliveryQueue;e.enqueue(this,t,this._listeners.length),this._deliverQueue(e)}this._perfMon?.stop()}hasListeners(){return this._size>0}},Jy=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},$u=class extends D{get isPaused(){return this._isPaused!==0}constructor(t){super(t),this._isPaused=0,this._eventQueue=new vg,this._mergeFn=t?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const t=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(t))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(t){this._size&&(this._isPaused!==0?this._eventQueue.push(t):super.fire(t))}},Qy=class{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new D({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(t){const e={event:t,listener:null};return this.events.push(e),this.hasListeners&&this.hook(e),me(Tu(()=>{this.hasListeners&&this.unhook(e);const r=this.events.indexOf(e);this.events.splice(r,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(t=>this.hook(t))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(t=>this.unhook(t))}hook(t){t.listener=t.event(e=>this.emitter.fire(e))}unhook(t){t.listener?.dispose(),t.listener=null}dispose(){this.emitter.dispose();for(const t of this.events)t.listener?.dispose();this.events=[]}},Sg=class{constructor(){this.listening=!1,this.inputEvent=P.None,this.inputEventListener=N.None,this.emitter=new D({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(t){this.inputEvent=t,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=t(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}}}),kn,Bu,fs,er,_g,Xy,Wr=g({"out-build/vs/base/common/process.js"(){"use strict";if(z(),Bu=globalThis.vscode,typeof Bu<"u"&&typeof Bu.process<"u"){const t=Bu.process;kn={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?kn={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:kn={get platform(){return B?"win32":O?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};fs=kn.cwd,er=kn.env,_g=kn.platform,Xy=kn.arch}});function Ox(t,e){if(t===null||typeof t!="object")throw new Eg(e,"Object",t)}function yt(t,e){if(typeof t!="string")throw new Eg(e,"string",t)}function ve(t){return t===Ot||t===Si}function bg(t){return t===Ot}function ps(t){return t>=eS&&t<=iS||t>=tS&&t<=rS}function ju(t,e,i,r){let s="",n=0,o=-1,a=0,c=0;for(let l=0;l<=t.length;++l){if(l<t.length)c=t.charCodeAt(l);else{if(r(c))break;c=Ot}if(r(c)){if(!(o===l-1||a===1))if(a===2){if(s.length<2||n!==2||s.charCodeAt(s.length-1)!==Bs||s.charCodeAt(s.length-2)!==Bs){if(s.length>2){const u=s.lastIndexOf(i);u===-1?(s="",n=0):(s=s.slice(0,u),n=s.length-1-s.lastIndexOf(i)),o=l,a=0;continue}else if(s.length!==0){s="",n=0,o=l,a=0;continue}}e&&(s+=s.length>0?`${i}..`:"..",n=2)}else s.length>0?s+=`${i}${t.slice(o+1,l)}`:s=t.slice(o+1,l),n=l-o-1;o=l,a=0}else c===Bs&&a!==-1?++a:a=-1}return s}function Fx(t){return t?`${t[0]==="."?"":"."}${t}`:""}function Zy(t,e){Ox(e,"pathObject");const i=e.dir||e.root,r=e.base||`${e.name||""}${Fx(e.ext)}`;return i?i===e.root?`${i}${r}`:`${i}${t}${r}`:r}var eS,tS,iS,rS,Bs,Ot,Si,Lr,sS,Eg,_i,nt,nS,le,bi,dc,U,Jt,oS,pt,tt,Hu,Nx,Ux,$x,Qt,kg,ye=g({"out-build/vs/base/common/path.js"(){"use strict";Wr(),eS=65,tS=97,iS=90,rS=122,Bs=46,Ot=47,Si=92,Lr=58,sS=63,Eg=class extends Error{constructor(t,e,i){let r;typeof e=="string"&&e.indexOf("not ")===0?(r="must not be",e=e.replace(/^not /,"")):r="must be";const s=t.indexOf(".")!==-1?"property":"argument";let n=`The "${t}" ${s} ${r} of type ${e}`;n+=`. Received type ${typeof i}`,super(n),this.code="ERR_INVALID_ARG_TYPE"}},_i=_g==="win32",nt={resolve(...t){let e="",i="",r=!1;for(let s=t.length-1;s>=-1;s--){let n;if(s>=0){if(n=t[s],yt(n,`paths[${s}]`),n.length===0)continue}else e.length===0?n=fs():(n=er[`=${e}`]||fs(),(n===void 0||n.slice(0,2).toLowerCase()!==e.toLowerCase()&&n.charCodeAt(2)===Si)&&(n=`${e}\\`));const o=n.length;let a=0,c="",l=!1;const u=n.charCodeAt(0);if(o===1)ve(u)&&(a=1,l=!0);else if(ve(u))if(l=!0,ve(n.charCodeAt(1))){let d=2,f=d;for(;d<o&&!ve(n.charCodeAt(d));)d++;if(d<o&&d!==f){const p=n.slice(f,d);for(f=d;d<o&&ve(n.charCodeAt(d));)d++;if(d<o&&d!==f){for(f=d;d<o&&!ve(n.charCodeAt(d));)d++;(d===o||d!==f)&&(c=`\\\\${p}\\${n.slice(f,d)}`,a=d)}}}else a=1;else ps(u)&&n.charCodeAt(1)===Lr&&(c=n.slice(0,2),a=2,o>2&&ve(n.charCodeAt(2))&&(l=!0,a=3));if(c.length>0)if(e.length>0){if(c.toLowerCase()!==e.toLowerCase())continue}else e=c;if(r){if(e.length>0)break}else if(i=`${n.slice(a)}\\${i}`,r=l,l&&e.length>0)break}return i=ju(i,!r,"\\",ve),r?`${e}\\${i}`:`${e}${i}`||"."},normalize(t){yt(t,"path");const e=t.length;if(e===0)return".";let i=0,r,s=!1;const n=t.charCodeAt(0);if(e===1)return bg(n)?"\\":t;if(ve(n))if(s=!0,ve(t.charCodeAt(1))){let a=2,c=a;for(;a<e&&!ve(t.charCodeAt(a));)a++;if(a<e&&a!==c){const l=t.slice(c,a);for(c=a;a<e&&ve(t.charCodeAt(a));)a++;if(a<e&&a!==c){for(c=a;a<e&&!ve(t.charCodeAt(a));)a++;if(a===e)return`\\\\${l}\\${t.slice(c)}\\`;a!==c&&(r=`\\\\${l}\\${t.slice(c,a)}`,i=a)}}}else i=1;else ps(n)&&t.charCodeAt(1)===Lr&&(r=t.slice(0,2),i=2,e>2&&ve(t.charCodeAt(2))&&(s=!0,i=3));let o=i<e?ju(t.slice(i),!s,"\\",ve):"";if(o.length===0&&!s&&(o="."),o.length>0&&ve(t.charCodeAt(e-1))&&(o+="\\"),!s&&r===void 0&&t.includes(":")){if(o.length>=2&&ps(o.charCodeAt(0))&&o.charCodeAt(1)===Lr)return`.\\${o}`;let a=t.indexOf(":");do if(a===e-1||ve(t.charCodeAt(a+1)))return`.\\${o}`;while((a=t.indexOf(":",a+1))!==-1)}return r===void 0?s?`\\${o}`:o:s?`${r}\\${o}`:`${r}${o}`},isAbsolute(t){yt(t,"path");const e=t.length;if(e===0)return!1;const i=t.charCodeAt(0);return ve(i)||e>2&&ps(i)&&t.charCodeAt(1)===Lr&&ve(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,i;for(let n=0;n<t.length;++n){const o=t[n];yt(o,"path"),o.length>0&&(e===void 0?e=i=o:e+=`\\${o}`)}if(e===void 0)return".";let r=!0,s=0;if(typeof i=="string"&&ve(i.charCodeAt(0))){++s;const n=i.length;n>1&&ve(i.charCodeAt(1))&&(++s,n>2&&(ve(i.charCodeAt(2))?++s:r=!1))}if(r){for(;s<e.length&&ve(e.charCodeAt(s));)s++;s>=2&&(e=`\\${e.slice(s)}`)}return nt.normalize(e)},relative(t,e){if(yt(t,"from"),yt(e,"to"),t===e)return"";const i=nt.resolve(t),r=nt.resolve(e);if(i===r||(t=i.toLowerCase(),e=r.toLowerCase(),t===e))return"";if(i.length!==t.length||r.length!==e.length){const v=i.split("\\"),m=r.split("\\");v[v.length-1]===""&&v.pop(),m[m.length-1]===""&&m.pop();const y=v.length,S=m.length,E=y<S?y:S;let k;for(k=0;k<E&&v[k].toLowerCase()===m[k].toLowerCase();k++);return k===0?r:k===E?S>E?m.slice(k).join("\\"):y>E?"..\\".repeat(y-1-k)+"..":"":"..\\".repeat(y-k)+m.slice(k).join("\\")}let s=0;for(;s<t.length&&t.charCodeAt(s)===Si;)s++;let n=t.length;for(;n-1>s&&t.charCodeAt(n-1)===Si;)n--;const o=n-s;let a=0;for(;a<e.length&&e.charCodeAt(a)===Si;)a++;let c=e.length;for(;c-1>a&&e.charCodeAt(c-1)===Si;)c--;const l=c-a,u=o<l?o:l;let d=-1,f=0;for(;f<u;f++){const v=t.charCodeAt(s+f);if(v!==e.charCodeAt(a+f))break;v===Si&&(d=f)}if(f!==u){if(d===-1)return r}else{if(l>u){if(e.charCodeAt(a+f)===Si)return r.slice(a+f+1);if(f===2)return r.slice(a+f)}o>u&&(t.charCodeAt(s+f)===Si?d=f:f===2&&(d=3)),d===-1&&(d=0)}let p="";for(f=s+d+1;f<=n;++f)(f===n||t.charCodeAt(f)===Si)&&(p+=p.length===0?"..":"\\..");return a+=d,p.length>0?`${p}${r.slice(a,c)}`:(r.charCodeAt(a)===Si&&++a,r.slice(a,c))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;const e=nt.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===Si){if(e.charCodeAt(1)===Si){const i=e.charCodeAt(2);if(i!==sS&&i!==Bs)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(ps(e.charCodeAt(0))&&e.charCodeAt(1)===Lr&&e.charCodeAt(2)===Si)return`\\\\?\\${e}`;return e},dirname(t){yt(t,"path");const e=t.length;if(e===0)return".";let i=-1,r=0;const s=t.charCodeAt(0);if(e===1)return ve(s)?t:".";if(ve(s)){if(i=r=1,ve(t.charCodeAt(1))){let a=2,c=a;for(;a<e&&!ve(t.charCodeAt(a));)a++;if(a<e&&a!==c){for(c=a;a<e&&ve(t.charCodeAt(a));)a++;if(a<e&&a!==c){for(c=a;a<e&&!ve(t.charCodeAt(a));)a++;if(a===e)return t;a!==c&&(i=r=a+1)}}}}else ps(s)&&t.charCodeAt(1)===Lr&&(i=e>2&&ve(t.charCodeAt(2))?3:2,r=i);let n=-1,o=!0;for(let a=e-1;a>=r;--a)if(ve(t.charCodeAt(a))){if(!o){n=a;break}}else o=!1;if(n===-1){if(i===-1)return".";n=i}return t.slice(0,n)},basename(t,e){e!==void 0&&yt(e,"suffix"),yt(t,"path");let i=0,r=-1,s=!0,n;if(t.length>=2&&ps(t.charCodeAt(0))&&t.charCodeAt(1)===Lr&&(i=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(n=t.length-1;n>=i;--n){const c=t.charCodeAt(n);if(ve(c)){if(!s){i=n+1;break}}else a===-1&&(s=!1,a=n+1),o>=0&&(c===e.charCodeAt(o)?--o===-1&&(r=n):(o=-1,r=a))}return i===r?r=a:r===-1&&(r=t.length),t.slice(i,r)}for(n=t.length-1;n>=i;--n)if(ve(t.charCodeAt(n))){if(!s){i=n+1;break}}else r===-1&&(s=!1,r=n+1);return r===-1?"":t.slice(i,r)},extname(t){yt(t,"path");let e=0,i=-1,r=0,s=-1,n=!0,o=0;t.length>=2&&t.charCodeAt(1)===Lr&&ps(t.charCodeAt(0))&&(e=r=2);for(let a=t.length-1;a>=e;--a){const c=t.charCodeAt(a);if(ve(c)){if(!n){r=a+1;break}continue}s===-1&&(n=!1,s=a+1),c===Bs?i===-1?i=a:o!==1&&(o=1):i!==-1&&(o=-1)}return i===-1||s===-1||o===0||o===1&&i===s-1&&i===r+1?"":t.slice(i,s)},format:Zy.bind(null,"\\"),parse(t){yt(t,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;const i=t.length;let r=0,s=t.charCodeAt(0);if(i===1)return ve(s)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(ve(s)){if(r=1,ve(t.charCodeAt(1))){let d=2,f=d;for(;d<i&&!ve(t.charCodeAt(d));)d++;if(d<i&&d!==f){for(f=d;d<i&&ve(t.charCodeAt(d));)d++;if(d<i&&d!==f){for(f=d;d<i&&!ve(t.charCodeAt(d));)d++;d===i?r=d:d!==f&&(r=d+1)}}}}else if(ps(s)&&t.charCodeAt(1)===Lr){if(i<=2)return e.root=e.dir=t,e;if(r=2,ve(t.charCodeAt(2))){if(i===3)return e.root=e.dir=t,e;r=3}}r>0&&(e.root=t.slice(0,r));let n=-1,o=r,a=-1,c=!0,l=t.length-1,u=0;for(;l>=r;--l){if(s=t.charCodeAt(l),ve(s)){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),s===Bs?n===-1?n=l:u!==1&&(u=1):n!==-1&&(u=-1)}return a!==-1&&(n===-1||u===0||u===1&&n===a-1&&n===o+1?e.base=e.name=t.slice(o,a):(e.name=t.slice(o,n),e.base=t.slice(o,a),e.ext=t.slice(n,a))),o>0&&o!==r?e.dir=t.slice(0,o-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},nS=(()=>{if(_i){const t=/\\/g;return()=>{const e=fs().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>fs()})(),le={resolve(...t){let e="",i=!1;for(let r=t.length-1;r>=0&&!i;r--){const s=t[r];yt(s,`paths[${r}]`),s.length!==0&&(e=`${s}/${e}`,i=s.charCodeAt(0)===Ot)}if(!i){const r=nS();e=`${r}/${e}`,i=r.charCodeAt(0)===Ot}return e=ju(e,!i,"/",bg),i?`/${e}`:e.length>0?e:"."},normalize(t){if(yt(t,"path"),t.length===0)return".";const e=t.charCodeAt(0)===Ot,i=t.charCodeAt(t.length-1)===Ot;return t=ju(t,!e,"/",bg),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return yt(t,"path"),t.length>0&&t.charCodeAt(0)===Ot},join(...t){if(t.length===0)return".";const e=[];for(let i=0;i<t.length;++i){const r=t[i];yt(r,"path"),r.length>0&&e.push(r)}return e.length===0?".":le.normalize(e.join("/"))},relative(t,e){if(yt(t,"from"),yt(e,"to"),t===e||(t=le.resolve(t),e=le.resolve(e),t===e))return"";const i=1,r=t.length,s=r-i,n=1,o=e.length-n,a=s<o?s:o;let c=-1,l=0;for(;l<a;l++){const d=t.charCodeAt(i+l);if(d!==e.charCodeAt(n+l))break;d===Ot&&(c=l)}if(l===a)if(o>a){if(e.charCodeAt(n+l)===Ot)return e.slice(n+l+1);if(l===0)return e.slice(n+l)}else s>a&&(t.charCodeAt(i+l)===Ot?c=l:l===0&&(c=0));let u="";for(l=i+c+1;l<=r;++l)(l===r||t.charCodeAt(l)===Ot)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(n+c)}`},toNamespacedPath(t){return t},dirname(t){if(yt(t,"path"),t.length===0)return".";const e=t.charCodeAt(0)===Ot;let i=-1,r=!0;for(let s=t.length-1;s>=1;--s)if(t.charCodeAt(s)===Ot){if(!r){i=s;break}}else r=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)},basename(t,e){e!==void 0&&yt(e,"suffix"),yt(t,"path");let i=0,r=-1,s=!0,n;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(n=t.length-1;n>=0;--n){const c=t.charCodeAt(n);if(c===Ot){if(!s){i=n+1;break}}else a===-1&&(s=!1,a=n+1),o>=0&&(c===e.charCodeAt(o)?--o===-1&&(r=n):(o=-1,r=a))}return i===r?r=a:r===-1&&(r=t.length),t.slice(i,r)}for(n=t.length-1;n>=0;--n)if(t.charCodeAt(n)===Ot){if(!s){i=n+1;break}}else r===-1&&(s=!1,r=n+1);return r===-1?"":t.slice(i,r)},extname(t){yt(t,"path");let e=-1,i=0,r=-1,s=!0,n=0;for(let o=t.length-1;o>=0;--o){const a=t[o];if(a==="/"){if(!s){i=o+1;break}continue}r===-1&&(s=!1,r=o+1),a==="."?e===-1?e=o:n!==1&&(n=1):e!==-1&&(n=-1)}return e===-1||r===-1||n===0||n===1&&e===r-1&&e===i+1?"":t.slice(e,r)},format:Zy.bind(null,"/"),parse(t){yt(t,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;const i=t.charCodeAt(0)===Ot;let r;i?(e.root="/",r=1):r=0;let s=-1,n=0,o=-1,a=!0,c=t.length-1,l=0;for(;c>=r;--c){const u=t.charCodeAt(c);if(u===Ot){if(!a){n=c+1;break}continue}o===-1&&(a=!1,o=c+1),u===Bs?s===-1?s=c:l!==1&&(l=1):s!==-1&&(l=-1)}if(o!==-1){const u=n===0&&i?1:n;s===-1||l===0||l===1&&s===o-1&&s===n+1?e.base=e.name=t.slice(u,o):(e.name=t.slice(u,s),e.base=t.slice(u,o),e.ext=t.slice(s,o))}return n>0?e.dir=t.slice(0,n-1):i&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null},le.win32=nt.win32=nt,le.posix=nt.posix=le,bi=_i?nt.normalize:le.normalize,dc=_i?nt.isAbsolute:le.isAbsolute,U=_i?nt.join:le.join,Jt=_i?nt.resolve:le.resolve,oS=_i?nt.relative:le.relative,pt=_i?nt.dirname:le.dirname,tt=_i?nt.basename:le.basename,Hu=_i?nt.extname:le.extname,Nx=_i?nt.format:le.format,Ux=_i?nt.parse:le.parse,$x=_i?nt.toNamespacedPath:le.toNamespacedPath,Qt=_i?nt.sep:le.sep,kg=_i?nt.delimiter:le.delimiter}}),Pg,Te,hc,Sr,St=g({"out-build/vs/base/common/cancellation.js"(){"use strict";q(),Pg=Object.freeze(function(t,e){const i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),(function(t){function e(i){return i===t.None||i===t.Cancelled||i instanceof hc?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:P.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Pg})})(Te||(Te={})),hc=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Pg:(this._emitter||(this._emitter=new D),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Sr=class{constructor(t){this._token=void 0,this._parentListener=void 0,this._parentListener=t&&t.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new hc),this._token}cancel(){this._token?this._token instanceof hc&&this._token.cancel():this._token=Te.Cancelled}dispose(t=!1){t&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof hc&&this._token.dispose():this._token=Te.None}}}});function Bx(t){return t}var aS,jx=g({"out-build/vs/base/common/cache.js"(){"use strict";St(),aS=class{constructor(t,e){this.lastCache=void 0,this.lastArgKey=void 0,typeof t=="function"?(this._fn=t,this._computeKey=Bx):(this._fn=e,this._computeKey=t.getCacheKey)}get(t){const e=this._computeKey(t);return this.lastArgKey!==e&&(this.lastArgKey=e,this.lastCache=this._fn(t)),this.lastCache}}}}),gs,Do=g({"out-build/vs/base/common/lazy.js"(){"use strict";gs=class{constructor(t){this.executor=t,this._didRun=!1}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(t){this._error=t}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}}});function Hx(t){return!t||typeof t!="string"?!0:t.trim().length===0}function fc(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function cS(t,e=" "){const i=lS(t,e);return Pn(i,e)}function lS(t,e){if(!t||!e)return t;const i=e.length;if(i===0||t.length===0)return t;let r=0;for(;t.indexOf(e,r)===r;)r=r+i;return t.substring(r)}function Pn(t,e){if(!t||!e)return t;const i=e.length,r=t.length;if(i===0||r===0)return t;let s=r,n=-1;for(;n=t.lastIndexOf(e,s-1),!(n===-1||n+i!==s);){if(n===0)return"";s=n}return t.substring(0,s)}function xg(t,e){return t<e?-1:t>e?1:0}function Cg(t,e,i=0,r=t.length,s=0,n=e.length){for(;i<r&&s<n;i++,s++){const c=t.charCodeAt(i),l=e.charCodeAt(s);if(c<l)return-1;if(c>l)return 1}const o=r-i,a=n-s;return o<a?-1:o>a?1:0}function Ig(t,e){return pc(t,e,0,t.length,0,e.length)}function pc(t,e,i=0,r=t.length,s=0,n=e.length){for(;i<r&&s<n;i++,s++){let c=t.charCodeAt(i),l=e.charCodeAt(s);if(c===l)continue;if(c>=128||l>=128)return Cg(t.toLowerCase(),e.toLowerCase(),i,r,s,n);uS(c)&&(c-=32),uS(l)&&(l-=32);const u=c-l;if(u!==0)return u}const o=r-i,a=n-s;return o<a?-1:o>a?1:0}function uS(t){return t>=97&&t<=122}function dS(t){return t>=65&&t<=90}function js(t,e){return t.length===e.length&&pc(t,e)===0}function Vu(t,e){const i=e.length;return e.length>t.length?!1:pc(t,e,0,i)===0}function Vx(t){return 55296<=t&&t<=56319}function hS(t){return 56320<=t&&t<=57343}function qx(t,e){return(t-55296<<10)+(e-56320)+65536}function zx(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}var fS,pS,gS,Gx,Kx,mS,Yx,vS,Jx,Qx,jt=g({"out-build/vs/base/common/strings.js"(){"use strict";jx(),Do(),fS=/(?:\x1b\[|\x9b)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,pS=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,gS=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,Gx=new RegExp("(?:"+[fS.source,pS.source,gS.source].join("|")+")","g"),Kx="\uFEFF",(function(t){t[t.Other=0]="Other",t[t.Prepend=1]="Prepend",t[t.CR=2]="CR",t[t.LF=3]="LF",t[t.Control=4]="Control",t[t.Extend=5]="Extend",t[t.Regional_Indicator=6]="Regional_Indicator",t[t.SpacingMark=7]="SpacingMark",t[t.L=8]="L",t[t.V=9]="V",t[t.T=10]="T",t[t.LV=11]="LV",t[t.LVT=12]="LVT",t[t.ZWJ=13]="ZWJ",t[t.Extended_Pictographic=14]="Extended_Pictographic"})(mS||(mS={})),Yx=class gu{static{this._INSTANCE=null}static getInstance(){return gu._INSTANCE||(gu._INSTANCE=new gu),gu._INSTANCE}constructor(){this._data=zx()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const i=this._data,r=i.length/3;let s=1;for(;s<=r;)if(e<i[3*s])s=2*s;else if(e>i[3*s+1])s=2*s+1;else return i[3*s+2];return 0}},(function(t){t[t.zwj=8205]="zwj",t[t.emojiVariantSelector=65039]="emojiVariantSelector",t[t.enclosingKeyCap=8419]="enclosingKeyCap",t[t.space=32]="space"})(vS||(vS={})),Jx=class mu{static{this.ambiguousCharacterData=new gs(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new aS({getCacheKey:JSON.stringify},e=>{function i(u){const d=new Map;for(let f=0;f<u.length;f+=2)d.set(u[f],u[f+1]);return d}function r(u,d){const f=new Map(u);for(const[p,v]of d)f.set(p,v);return f}function s(u,d){if(!u)return d;const f=new Map;for(const[p,v]of u)d.has(p)&&f.set(p,v);return f}const n=this.ambiguousCharacterData.value;let o=e.filter(u=>!u.startsWith("_")&&u in n);o.length===0&&(o=["_default"]);let a;for(const u of o){const d=i(n[u]);a=s(a,d)}const c=i(n._common),l=r(c,a);return new mu(l)})}static getInstance(e){return mu.cache.get(Array.from(e))}static{this._locales=new gs(()=>Object.keys(mu.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return mu._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let i=0;i<e.length;i++){const r=e.codePointAt(i);if(typeof r=="number"&&this.isAmbiguous(r))return!0}return!1}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}},Qx=class vu{static getRawData(){return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}')}static{this._data=void 0}static getData(){return this._data||(this._data=new Set([...Object.values(vu.getRawData())].flat())),this._data}static isInvisibleCharacter(e){return vu.getData().has(e)}static containsInvisibleCharacter(e){for(let i=0;i<e.length;i++){const r=e.codePointAt(i);if(typeof r=="number"&&(vu.isInvisibleCharacter(r)||r===32))return!0}return!1}static get codePoints(){return vu.getData()}}}});function Xx(t,e){return x.isUri(t)?js(t.scheme,e):Vu(t,e+":")}function Zx(t,...e){return e.some(i=>Xx(t,i))}function eC(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}var T,wS,yS,Dg,gc,SS,Ct,_S,bS,mc,Ie=g({"out-build/vs/base/common/network.js"(){"use strict";Re(),z(),jt(),re(),ye(),(function(t){t.inMemory="inmemory",t.vscode="vscode",t.internal="private",t.walkThrough="walkThrough",t.walkThroughSnippet="walkThroughSnippet",t.http="http",t.https="https",t.file="file",t.git="git",t.mailto="mailto",t.untitled="untitled",t.data="data",t.command="command",t.vscodeRemote="vscode-remote",t.vscodeRemoteResource="vscode-remote-resource",t.vscodeManagedRemoteResource="vscode-managed-remote-resource",t.vscodeUserData="vscode-userdata",t.vscodeCustomEditor="vscode-custom-editor",t.vscodeNotebook="vscode-notebook",t.vscodeNotebookCell="vscode-notebook-cell",t.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",t.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",t.vscodeNotebookCellOutput="vscode-notebook-cell-output",t.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",t.vscodeNotebookMetadata="vscode-notebook-metadata",t.vscodeInteractiveInput="vscode-interactive-input",t.vscodeSettings="vscode-settings",t.vscodeWorkspaceTrust="vscode-workspace-trust",t.vscodeTerminal="vscode-terminal",t.terminal="terminal",t.vscodeChatCodeBlock="vscode-chat-code-block",t.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",t.vscodeChatSesssion="vscode-chat-editor",t.webviewPanel="webview-panel",t.vscodeWebview="vscode-webview",t.extension="extension",t.aiChat="cursor.aichat",t.notepad="cursor.notepad",t.contextObject="cursor.context-object",t.composer="cursor.composer",t.aiSettings="cursor.aisettings",t.tinderDiffEditor="cursor.tinderdiffeditor",t.vscodeFileResource="vscode-file",t.tmp="tmp",t.vsls="vsls",t.vscodeSourceControl="vscode-scm",t.commentsInput="comment",t.codeSetting="code-setting",t.cursorDev="cursor-dev-utils",t.outputChannel="output",t.accessibleView="accessible-view",t.backgroundComposer="cursor.backgroundcomposer",t.personalEnvironmentJson="cursor.personalenvironmentjson",t.bugbot="cursor.bugbot",t.aiEditorBox="aiEditorBox",t.backgroundComposerPeek="background-composer-peek"})(T||(T={})),wS="tkn",yS=class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(t){this._preferredWebSchema=t}setDelegate(t){this._delegate=t}setServerRootPath(t,e){this._serverRootPath=le.join(e??"/",eC(t))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return le.join(this._serverRootPath,T.vscodeRemoteResource)}set(t,e,i){this._hosts[t]=e,this._ports[t]=i}setConnectionToken(t,e){this._connectionTokens[t]=e}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(t){if(this._delegate)try{return this._delegate(t)}catch(o){return $t(o),t}const e=t.authority;let i=this._hosts[e];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const r=this._ports[e],s=this._connectionTokens[e];let n=`path=${encodeURIComponent(t.path)}`;return typeof s=="string"&&(n+=`&${wS}=${encodeURIComponent(s)}`),x.from({scheme:us?this._preferredWebSchema:T.vscodeRemoteResource,authority:`${i}:${r}`,path:this._remoteResourcesPath,query:n})}},Dg=new yS,gc="vscode-app",SS=class Np{static{this.FALLBACK_AUTHORITY=gc}asBrowserUri(e){const i=this.toUri(e);return this.uriToBrowserUri(i)}uriToBrowserUri(e){return e.scheme===T.vscodeRemote?Dg.rewrite(e):e.scheme===T.file&&(lg||ly===`${T.vscodeFileResource}://${Np.FALLBACK_AUTHORITY}`)?e.with({scheme:T.vscodeFileResource,authority:e.authority||Np.FALLBACK_AUTHORITY,query:null,fragment:null}):e}asFileUri(e){const i=this.toUri(e);return this.uriToFileUri(i)}uriToFileUri(e){return e.scheme===T.vscodeFileResource?e.with({scheme:T.file,authority:e.authority!==Np.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(x.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){const i=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(i))return x.joinPath(x.parse(i,!0),e);const r=U(i,e);return x.file(r)}throw new Error("Cannot determine URI for module id!")}},Ct=new SS,_S=Object.freeze({"Cache-Control":"no-cache, no-store"}),bS=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports, js-profiling"}),(function(t){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);t.CoopAndCoep=Object.freeze(e.get("3"));const i="vscode-coi";function r(n){let o;typeof n=="string"?o=new URL(n).searchParams:n instanceof URL?o=n.searchParams:x.isUri(n)&&(o=new URL(n.toString(!0)).searchParams);const a=o?.get(i);if(a)return e.get(a)}t.getHeadersFromQuery=r;function s(n,o,a){if(!globalThis.crossOriginIsolated)return;const c=o&&a?"3":a?"2":"1";n instanceof URLSearchParams?n.set(i,c):n[i]=c}t.addSearchParam=s})(mc||(mc={}))}});function qu(t){const e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(i=>typeof i=="function"):!1}function Ag(t){const e=t;return e?qu(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}function zu(t,e){return new PS(t,e)}function tC(t,e){const i=[];let r;for(;(r=t.read())!==null;)i.push(r);return e(i)}function iC(t,e,i){const r=[];let s;for(;(s=t.read())!==null&&r.length<i;)r.push(s);return s===null&&r.length>0?e(r):{read:()=>{if(r.length>0)return r.shift();if(typeof s<"u"){const n=s;return s=void 0,n}return t.read()}}}function ES(t,e){return new Promise((i,r)=>{const s=[];Gu(t,{onData:n=>{e&&s.push(n)},onError:n=>{e?r(n):i(void 0)},onEnd:()=>{i(e?e(s):void 0)}})})}function Gu(t,e,i){t.on("error",r=>{i?.isCancellationRequested||e.onError(r)}),t.on("end",()=>{i?.isCancellationRequested||e.onEnd()}),t.on("data",r=>{i?.isCancellationRequested||e.onData(r)})}function rC(t,e){return new Promise((i,r)=>{const s=new ke,n=[],o=l=>{if(n.push(l),n.length>e)return s.dispose(),t.pause(),i({stream:t,buffer:n,ended:!1})},a=l=>(s.dispose(),r(l)),c=()=>(s.dispose(),i({stream:t,buffer:n,ended:!0}));s.add(me(()=>t.removeListener("error",a))),t.on("error",a),s.add(me(()=>t.removeListener("end",c))),t.on("end",c),s.add(me(()=>t.removeListener("data",o))),t.on("data",o)})}function sC(t){let e=!1;return{read:()=>e?null:(e=!0,t)}}function kS(t,e,i){const r=zu(i);return Gu(t,{onData:s=>r.write(e.data(s)),onError:s=>r.error(e.error?e.error(s):s),onEnd:()=>r.end()}),r}var PS,vc=g({"out-build/vs/base/common/stream.js"(){"use strict";Re(),L(),PS=class{constructor(t,e){this.reducer=t,this.options=e,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(t){if(!this.state.destroyed){if(this.state.flowing)this.emitData(t);else if(this.buffer.data.push(t),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(e=>this.pendingWritePromises.push(e))}}error(t){this.state.destroyed||(this.state.flowing?this.emitError(t):this.buffer.error.push(t))}end(t){this.state.destroyed||(typeof t<"u"&&this.write(t),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(t){this.listeners.data.slice(0).forEach(e=>e(t))}emitError(t){this.listeners.error.length===0?$t(t):this.listeners.error.slice(0).forEach(e=>e(t))}emitEnd(){this.listeners.end.slice(0).forEach(t=>t())}on(t,e){if(!this.state.destroyed)switch(t){case"data":this.listeners.data.push(e),this.resume();break;case"end":this.listeners.end.push(e),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(e),this.state.flowing&&this.flowErrors();break}}removeListener(t,e){if(this.state.destroyed)return;let i;switch(t){case"data":i=this.listeners.data;break;case"end":i=this.listeners.end;break;case"error":i=this.listeners.error;break}if(i){const r=i.indexOf(e);r>=0&&i.splice(r,1)}}flowData(){if(this.buffer.data.length===0)return;if(typeof this.reducer=="function"){const e=this.reducer(this.buffer.data);this.emitData(e)}else for(const e of this.buffer.data)this.emitData(e);this.buffer.data.length=0;const t=[...this.pendingWritePromises];this.pendingWritePromises.length=0,t.forEach(e=>e())}flowErrors(){if(this.listeners.error.length>0){for(const t of this.buffer.error)this.emitError(t);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}}}});function nC(t,e,i=0){const r=e.byteLength,s=t.byteLength;if(r===0)return 0;if(r===1)return t.indexOf(e[0]);if(r>s-i)return-1;const n=xS.value;n.fill(e.length);for(let l=0;l<e.length;l++)n[e[l]]=e.length-l-1;let o=i+e.length-1,a=o,c=-1;for(;o<s;)if(t[o]===e[a]){if(a===0){c=o;break}o--,a--}else o+=Math.max(e.length-a,n[t[o]]),a=e.length-1;return c}function oC(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}function aC(t,e,i){t[i+3]=e,e=e>>>8,t[i+2]=e,e=e>>>8,t[i+1]=e,e=e>>>8,t[i]=e}function cC(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}function lC(t,e,i){t[i+0]=e&255,e=e>>>8,t[i+1]=e&255,e=e>>>8,t[i+2]=e&255,e=e>>>8,t[i+3]=e&255}function uC(t,e){return t[e]}function dC(t,e,i){t[i]=e}function hC(t){return tC(t,e=>Y.concat(e))}function fC(t){return sC(t)}function wc(t){return ES(t,e=>Y.concat(e))}async function pC(t){return t.ended?Y.concat(t.buffer):Y.concat([...t.buffer,await wc(t.stream)])}function gC(t){return kS(t,{data:e=>typeof e=="string"?Y.fromString(e):Y.wrap(e)},e=>Y.concat(e))}function mC(t){return zu(e=>Y.concat(e),t)}var yc,xS,Rg,Mg,Y,it=g({"out-build/vs/base/common/buffer.js"(){"use strict";Do(),vc(),yc=typeof Buffer<"u",xS=new gs(()=>new Uint8Array(256)),Y=class vr{static alloc(e){return yc?new vr(Buffer.allocUnsafe(e)):new vr(new Uint8Array(e))}static wrap(e){return yc&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new vr(e)}static fromString(e,i){return!(i?.dontUseNodeBuffer||!1)&&yc?new vr(Buffer.from(e)):(Rg||(Rg=new TextEncoder),new vr(Rg.encode(e)))}static fromByteArray(e){const i=vr.alloc(e.length);for(let r=0,s=e.length;r<s;r++)i.buffer[r]=e[r];return i}static concat(e,i){if(typeof i>"u"){i=0;for(let n=0,o=e.length;n<o;n++)i+=e[n].byteLength}const r=vr.alloc(i);let s=0;for(let n=0,o=e.length;n<o;n++){const a=e[n];r.set(a,s),s+=a.byteLength}return r}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}clone(){const e=vr.alloc(this.byteLength);return e.set(this),e}toString(){return yc?this.buffer.toString():(Mg||(Mg=new TextDecoder),Mg.decode(this.buffer))}slice(e,i){return new vr(this.buffer.subarray(e,i))}set(e,i){if(e instanceof vr)this.buffer.set(e.buffer,i);else if(e instanceof Uint8Array)this.buffer.set(e,i);else if(e instanceof ArrayBuffer)this.buffer.set(new Uint8Array(e),i);else if(ArrayBuffer.isView(e))this.buffer.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),i);else throw new Error("Unknown argument 'array'")}readUInt32BE(e){return oC(this.buffer,e)}writeUInt32BE(e,i){aC(this.buffer,e,i)}readUInt32LE(e){return cC(this.buffer,e)}writeUInt32LE(e,i){lC(this.buffer,e,i)}readUInt8(e){return uC(this.buffer,e)}writeUInt8(e,i){dC(this.buffer,e,i)}indexOf(e,i=0){return nC(this.buffer,e instanceof vr?e.buffer:e,i)}equals(e){return this===e?!0:this.byteLength!==e.byteLength?!1:this.buffer.every((i,r)=>i===e.buffer[r])}}}});function vC(t,e){if(!t.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!DS.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!AS.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(RS.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function wC(t,e){return!t&&!e?"file":t}function yC(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==tr&&(e=tr+e):e=tr;break}return e}function CS(t,e,i){let r,s=-1;for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||e&&o===47||i&&o===91||i&&o===93||i&&o===58)s!==-1&&(r+=encodeURIComponent(t.substring(s,n)),s=-1),r!==void 0&&(r+=t.charAt(n));else{r===void 0&&(r=t.substr(0,n));const a=Lg[o];a!==void 0?(s!==-1&&(r+=encodeURIComponent(t.substring(s,n)),s=-1),r+=a):s===-1&&(s=n)}}return s!==-1&&(r+=encodeURIComponent(t.substring(s))),r!==void 0?r:t}function SC(t){let e;for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);r===35||r===63?(e===void 0&&(e=t.substr(0,i)),e+=Lg[r]):e!==void 0&&(e+=t[i])}return e!==void 0?e:t}function Ku(t,e){let i;return t.authority&&t.path.length>1&&t.scheme==="file"?i=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?i=t.path.substr(1):i=t.path[1].toLowerCase()+t.path.substr(2):i=t.path,B&&(i=i.replace(/\//g,"\\")),i}function Tg(t,e){const i=e?SC:CS;let r="",{scheme:s,authority:n,path:o,query:a,fragment:c}=t;if(s&&(r+=s,r+=":"),(n||s==="file")&&(r+=tr,r+=tr),n){let l=n.indexOf("@");if(l!==-1){const u=n.substr(0,l);n=n.substr(l+1),l=u.lastIndexOf(":"),l===-1?r+=i(u,!1,!1):(r+=i(u.substr(0,l),!1,!1),r+=":",r+=i(u.substr(l+1),!1,!0)),r+="@"}n=n.toLowerCase(),l=n.lastIndexOf(":"),l===-1?r+=i(n,!1,!0):(r+=i(n.substr(0,l),!1,!0),r+=n.substr(l))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){const l=o.charCodeAt(1);l>=65&&l<=90&&(o=`/${String.fromCharCode(l+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){const l=o.charCodeAt(0);l>=65&&l<=90&&(o=`${String.fromCharCode(l+32)}:${o.substr(2)}`)}r+=i(o,!0,!1)}return a&&(r+="?",r+=i(a,!1,!1)),c&&(r+="#",r+=e?c:CS(c,!1,!1)),r}function IS(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+IS(t.substr(3)):t}}function Yu(t){return t.match(Og)?t.replace(Og,e=>IS(e)):t}var DS,AS,RS,Je,tr,MS,x,Wg,xn,Lg,Og,re=g({"out-build/vs/base/common/uri.js"(){"use strict";ye(),z(),Ie(),it(),DS=/^\w[\w\d+.-]*$/,AS=/^\//,RS=/^\/\//,Je="",tr="/",MS=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,x=class Up{static isUri(e){return e instanceof Up?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,i,r,s,n,o=!1){typeof e=="object"?(this.scheme=e.scheme||Je,this.authority=e.authority||Je,this.path=e.path||Je,this.query=e.query||Je,this.fragment=e.fragment||Je):(this.scheme=wC(e,o),this.authority=i||Je,this.path=yC(this.scheme,r||Je),this.query=s||Je,this.fragment=n||Je,vC(this,o))}get fsPath(){return Ku(this,!1)}with(e){if(!e)return this;let{scheme:i,authority:r,path:s,query:n,fragment:o}=e;return i===void 0?i=this.scheme:i===null&&(i=Je),r===void 0?r=this.authority:r===null&&(r=Je),s===void 0?s=this.path:s===null&&(s=Je),n===void 0?n=this.query:n===null&&(n=Je),o===void 0?o=this.fragment:o===null&&(o=Je),i===this.scheme&&r===this.authority&&s===this.path&&n===this.query&&o===this.fragment?this:new xn(i,r,s,n,o)}static parse(e,i=!1){const r=MS.exec(e);return r?new xn(r[2]||Je,Yu(r[4]||Je),Yu(r[5]||Je),Yu(r[7]||Je),Yu(r[9]||Je),i):new xn(Je,Je,Je,Je,Je)}static file(e){let i=Je;if(B&&(e=e.replace(/\\/g,tr)),e[0]===tr&&e[1]===tr){const r=e.indexOf(tr,2);r===-1?(i=e.substring(2),e=tr):(i=e.substring(2,r),e=e.substring(r)||tr)}return new xn("file",i,e,Je,Je)}static from(e,i){return new xn(e.scheme,e.authority,e.path,e.query,e.fragment,i)}static joinPath(e,...i){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let r;return B&&e.scheme==="file"?r=Up.file(nt.join(Ku(e,!0),...i)).path:r=le.join(e.path,...i),e.with({path:r})}toString(e=!1){return Tg(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof Up)return e;{const i=new xn(e);return i._formatted=e.external??null,i._fsPath=e._sep===Wg?e.fsPath??null:null,i}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}},Wg=B?1:void 0,xn=class extends x{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Ku(this,!1)),this._fsPath}toString(t=!1){return t?Tg(this,!0):(this._formatted||(this._formatted=Tg(this,!1)),this._formatted)}toJSON(){const t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=Wg),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t}},Lg={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"},Og=/(%[0-9A-Za-z][0-9A-Za-z])+/g}});function _C(t,e,i){e[_r.DI_TARGET]===e?e[_r.DI_DEPENDENCIES].push({id:t,index:i}):(e[_r.DI_DEPENDENCIES]=[{id:t,index:i}],e[_r.DI_TARGET]=e)}function j(t){if(_r.serviceIds.has(t))return _r.serviceIds.get(t);const e=function(i,r,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");_C(e,i,s)};return e.toString=()=>t,_r.serviceIds.set(t,e),e}function JB(t){return t}var _r,Or,G=g({"out-build/vs/platform/instantiation/common/instantiation.js"(){"use strict";(function(t){t.serviceIds=new Map,t.DI_TARGET="$di$target",t.DI_DEPENDENCIES="$di$dependencies";function e(i){return i[t.DI_DEPENDENCIES]||[]}t.getServiceDependencies=e})(_r||(_r={})),Or=j("instantiationService")}});function Fg(t){return t&&typeof t=="object"&&(!t.overrideIdentifier||typeof t.overrideIdentifier=="string")&&(!t.resource||t.resource instanceof x)}function bC(t){return t&&typeof t=="object"&&(!t.overrideIdentifiers||Array.isArray(t.overrideIdentifiers))&&!t.overrideIdentifier&&(!t.resource||t.resource instanceof x)}function Ng(t,e){const i=Object.create(null);for(const r in t)TS(i,r,t[r],e);return i}function TS(t,e,i,r){const s=e.split("."),n=s.pop();let o=t;for(let a=0;a<s.length;a++){const c=s[a];let l=o[c];switch(typeof l){case"undefined":l=o[c]=Object.create(null);break;case"object":if(l===null){r(`Ignoring ${e} as ${s.slice(0,a+1).join(".")} is null`);return}break;default:r(`Ignoring ${e} as ${s.slice(0,a+1).join(".")} is ${JSON.stringify(l)}`);return}o=l}if(typeof o=="object"&&o!==null)try{o[n]=i}catch{r(`Ignoring ${e} as ${s.join(".")} is ${JSON.stringify(o)}`)}else r(`Ignoring ${e} as ${s.join(".")} is ${JSON.stringify(o)}`)}function EC(t,e){const i=e.split(".");WS(t,i)}function WS(t,e){if(!t)return;const i=e.shift();if(e.length===0){delete t[i];return}if(Object.keys(t).indexOf(i)!==-1){const r=t[i];typeof r=="object"&&!Array.isArray(r)&&(WS(r,e),Object.keys(r).length===0&&delete t[i])}}function Ju(t,e,i){function r(o,a){let c=o;for(const l of a){if(typeof c!="object"||c===null)return;c=c[l]}return c}const s=e.split("."),n=r(t,s);return typeof n>"u"?i:n}function kC(t){return t.replace(/[\[\]]/g,"")}var Qe,LS,Xe=g({"out-build/vs/platform/configuration/common/configuration.js"(){"use strict";Lu(),xe(),re(),G(),Qe=j("configurationService"),(function(t){t[t.APPLICATION=1]="APPLICATION",t[t.USER=2]="USER",t[t.USER_LOCAL=3]="USER_LOCAL",t[t.USER_REMOTE=4]="USER_REMOTE",t[t.WORKSPACE=5]="WORKSPACE",t[t.WORKSPACE_FOLDER=6]="WORKSPACE_FOLDER",t[t.DEFAULT=7]="DEFAULT",t[t.MEMORY=8]="MEMORY"})(LS||(LS={}))}});function PC(t){let e=!1;const i=new Map,r=new Map;if(xC(t,u=>{if(t===u)return!0;const d=JSON.stringify(u);if(d.length<30)return!0;const f=i.get(d);if(!f){const p={schemas:[u]};return i.set(d,p),r.set(u,p),!0}return f.schemas.push(u),r.set(u,f),e=!0,!1}),i.clear(),!e)return JSON.stringify(t);let n="$defs";for(;t.hasOwnProperty(n);)n+="_";const o=[];function a(u){return JSON.stringify(u,(d,f)=>{if(f!==u){const p=r.get(f);if(p&&p.schemas.length>1)return p.id||(p.id=`_${o.length}`,o.push(p.schemas[0])),{$ref:`#/${n}/${p.id}`}}return f})}const c=a(t),l=[];for(let u=0;u<o.length;u++)l.push(`"_${u}":${a(o[u])}`);return l.length?`${c.substring(0,c.length-1)},"${n}":{${l.join(",")}}}`:c}function Ao(t){return typeof t=="object"&&t!==null}function xC(t,e){if(!t||typeof t!="object")return;const i=(...c)=>{for(const l of c)Ao(l)&&o.push(l)},r=(...c)=>{for(const l of c)if(Ao(l))for(const u in l){const d=l[u];Ao(d)&&o.push(d)}},s=(...c)=>{for(const l of c)if(Array.isArray(l))for(const u of l)Ao(u)&&o.push(u)},n=c=>{if(Array.isArray(c))for(const l of c)Ao(l)&&o.push(l);else Ao(c)&&o.push(c)},o=[t];let a=o.pop();for(;a;)e(a)&&(i(a.additionalItems,a.additionalProperties,a.not,a.contains,a.propertyNames,a.if,a.then,a.else,a.unevaluatedItems,a.unevaluatedProperties),r(a.definitions,a.$defs,a.properties,a.patternProperties,a.dependencies,a.dependentSchemas),s(a.anyOf,a.allOf,a.oneOf,a.prefixItems),n(a.items)),a=o.pop()}var CC=g({"out-build/vs/base/common/jsonSchema.js"(){"use strict"}}),OS,Ei,ms=g({"out-build/vs/platform/registry/common/platform.js"(){"use strict";Lu(),xe(),OS=class{constructor(){this.data=new Map}add(t,e){pg(At(t)),pg(Lt(e)),pg(!this.data.has(t),"There is already an extension with this id"),this.data.set(t,e)}knows(t){return this.data.has(t)}as(t){return this.data.get(t)||null}dispose(){this.data.forEach(t=>{gg(t.dispose)&&t.dispose()}),this.data.clear()}},Ei=new OS}});function FS(t){return t.length>0&&t.charAt(t.length-1)==="#"?t.substring(0,t.length-1):t}var Ug,NS,US,IC=g({"out-build/vs/platform/jsonschemas/common/jsonContributionRegistry.js"(){"use strict";q(),CC(),L(),ms(),Ug={JSONContribution:"base.contributions.json"},NS=class extends N{constructor(){super(...arguments),this.schemasById={},this.schemaAssociations={},this._onDidChangeSchema=this._register(new D),this.onDidChangeSchema=this._onDidChangeSchema.event,this._onDidChangeSchemaAssociations=this._register(new D),this.onDidChangeSchemaAssociations=this._onDidChangeSchemaAssociations.event}registerSchema(t,e,i){const r=FS(t);this.schemasById[r]=e,this._onDidChangeSchema.fire(t),i&&i.add(me(()=>{delete this.schemasById[r],this._onDidChangeSchema.fire(t)}))}registerSchemaAssociation(t,e){const i=FS(t);return this.schemaAssociations[i]||(this.schemaAssociations[i]=[]),this.schemaAssociations[i].includes(e)||(this.schemaAssociations[i].push(e),this._onDidChangeSchemaAssociations.fire()),me(()=>{const r=this.schemaAssociations[i];if(r){const s=r.indexOf(e);s!==-1&&(r.splice(s,1),r.length===0&&delete this.schemaAssociations[i],this._onDidChangeSchemaAssociations.fire())}})}notifySchemaChanged(t){this._onDidChangeSchema.fire(t)}getSchemaContributions(){return{schemas:this.schemasById}}getSchemaContent(t){const e=this.schemasById[t];return e?PC(e):void 0}hasSchemaContent(t){return!!this.schemasById[t]}getSchemaAssociations(){return this.schemaAssociations}},US=new NS,Ei.add(Ug.JSONContribution,US)}});function Sc(t){const e=[];if(Fr.test(t)){let i=Bg.exec(t);for(;i?.length;){const r=i[1].trim();r&&e.push(r),i=Bg.exec(t)}}return ds(e)}function DC(t){return t.reduce((e,i)=>`${e}[${i}]`,"")}function AC(t){switch(Array.isArray(t)?t[0]:t){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}function RC(t,e){return t.trim()?Fr.test(t)?w(1808,null,t):Ic.getConfigurationProperties()[t]!==void 0?w(1809,null,t):e.policy?.name&&Ic.getPolicyConfigurations().get(e.policy?.name)!==void 0?w(1810,null,t,e.policy?.name,Ic.getPolicyConfigurations().get(e.policy?.name)):null:w(1807,null)}var $S,ir,BS,_c,bc,Ec,kc,Pc,xc,Ro,Hs,Cc,jS,$g,Bg,vs,Fr,Ic,Cn=g({"out-build/vs/platform/configuration/common/configurationRegistry.js"(){"use strict";Wt(),q(),xe(),we(),Xe(),IC(),ms(),L(),(function(t){t.Multiline="multilineText",t.Singleline="singlelineText"})($S||($S={})),ir={Configuration:"base.contributions.configuration"},(function(t){t[t.APPLICATION=1]="APPLICATION",t[t.MACHINE=2]="MACHINE",t[t.APPLICATION_MACHINE=3]="APPLICATION_MACHINE",t[t.WINDOW=4]="WINDOW",t[t.RESOURCE=5]="RESOURCE",t[t.LANGUAGE_OVERRIDABLE=6]="LANGUAGE_OVERRIDABLE",t[t.MACHINE_OVERRIDABLE=7]="MACHINE_OVERRIDABLE"})(BS||(BS={})),_c={properties:{},patternProperties:{}},bc={properties:{},patternProperties:{}},Ec={properties:{},patternProperties:{}},kc={properties:{},patternProperties:{}},Pc={properties:{},patternProperties:{}},xc={properties:{},patternProperties:{}},Ro={properties:{},patternProperties:{}},Hs="vscode://schemas/settings/resourceLanguage",Cc=Ei.as(Ug.JSONContribution),jS=class extends N{constructor(){super(),this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=this._register(new D),this.onDidSchemaChange=this._onDidSchemaChange.event,this._onDidUpdateConfiguration=this._register(new D),this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:w(1801,null),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Cc.registerSchema(Hs,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(t,e=!0){return this.registerConfigurations([t],e),t}registerConfigurations(t,e=!0){const i=new Set;this.doRegisterConfigurations(t,e,i),Cc.registerSchema(Hs,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}deregisterConfigurations(t){const e=new Set;this.doDeregisterConfigurations(t,e),Cc.registerSchema(Hs,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:e})}updateConfigurations({add:t,remove:e}){const i=new Set;this.doDeregisterConfigurations(e,i),this.doRegisterConfigurations(t,!1,i),Cc.registerSchema(Hs,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(t){const e=new Set;this.doRegisterDefaultConfigurations(t,e),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:e,defaultsOverrides:!0})}doRegisterDefaultConfigurations(t,e){this.registeredConfigurationDefaults.push(...t);const i=[];for(const{overrides:r,source:s}of t)for(const n in r){e.add(n);const o=this.configurationDefaultsOverrides.get(n)??this.configurationDefaultsOverrides.set(n,{configurationDefaultOverrides:[]}).get(n),a=r[n];if(o.configurationDefaultOverrides.push({value:a,source:s}),Fr.test(n)){const c=this.mergeDefaultConfigurationsForOverrideIdentifier(n,a,s,o.configurationDefaultOverrideValue);if(!c)continue;o.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(n,c,s),i.push(...Sc(n))}else{const c=this.mergeDefaultConfigurationsForConfigurationProperty(n,a,s,o.configurationDefaultOverrideValue);if(!c)continue;o.configurationDefaultOverrideValue=c;const l=this.configurationProperties[n];l&&(this.updatePropertyDefaultValue(n,l),this.updateSchema(n,l))}}this.doRegisterOverrideIdentifiers(i)}deregisterDefaultConfigurations(t){const e=new Set;this.doDeregisterDefaultConfigurations(t,e),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:e,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(t,e){for(const i of t){const r=this.registeredConfigurationDefaults.indexOf(i);r!==-1&&this.registeredConfigurationDefaults.splice(r,1)}for(const{overrides:i,source:r}of t)for(const s in i){const n=this.configurationDefaultsOverrides.get(s);if(!n)continue;const o=n.configurationDefaultOverrides.findIndex(a=>r?a.source?.id===r.id:a.value===i[s]);if(o!==-1){if(n.configurationDefaultOverrides.splice(o,1),n.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(s),Fr.test(s)){let a;for(const c of n.configurationDefaultOverrides)a=this.mergeDefaultConfigurationsForOverrideIdentifier(s,c.value,c.source,a);a&&!Oy(a.value)?(n.configurationDefaultOverrideValue=a,this.updateDefaultOverrideProperty(s,a,r)):(this.configurationDefaultsOverrides.delete(s),delete this.configurationProperties[s],delete this.defaultLanguageConfigurationOverridesNode.properties[s])}else{let a;for(const l of n.configurationDefaultOverrides)a=this.mergeDefaultConfigurationsForConfigurationProperty(s,l.value,l.source,a);n.configurationDefaultOverrideValue=a;const c=this.configurationProperties[s];c&&(this.updatePropertyDefaultValue(s,c),this.updateSchema(s,c))}e.add(s)}}this.updateOverridePropertyPatternKey()}updateDefaultOverrideProperty(t,e,i){const r={type:"object",default:e.value,description:w(1802,null,kC(t)),$ref:Hs,defaultDefaultValue:e.value,source:i,defaultValueSource:i};this.configurationProperties[t]=r,this.defaultLanguageConfigurationOverridesNode.properties[t]=r}mergeDefaultConfigurationsForOverrideIdentifier(t,e,i,r){const s=r?.value||{},n=r?.source??new Map;if(!(n instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(const o of Object.keys(e)){const a=e[o];if(Lt(a)&&(hs(s[o])||Lt(s[o]))){if(s[o]={...s[o]??{},...a},i)for(const l in a)n.set(`${o}.${l}`,i)}else s[o]=a,i?n.set(o,i):n.delete(o)}return{value:s,source:n}}mergeDefaultConfigurationsForConfigurationProperty(t,e,i,r){const s=this.configurationProperties[t],n=r?.value??s?.defaultDefaultValue;let o=i;if(Lt(e)&&(s!==void 0&&s.type==="object"||s===void 0&&(hs(n)||Lt(n)))){if(o=r?.source??new Map,!(o instanceof Map)){console.error("defaultValueSource is not a Map");return}for(const c in e)i&&o.set(`${t}.${c}`,i);e={...Lt(n)?n:{},...e}}return{value:e,source:o}}deltaConfiguration(t){let e=!1;const i=new Set;t.removedDefaults&&(this.doDeregisterDefaultConfigurations(t.removedDefaults,i),e=!0),t.addedDefaults&&(this.doRegisterDefaultConfigurations(t.addedDefaults,i),e=!0),t.removedConfigurations&&this.doDeregisterConfigurations(t.removedConfigurations,i),t.addedConfigurations&&this.doRegisterConfigurations(t.addedConfigurations,!1,i),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i,defaultsOverrides:e})}notifyConfigurationSchemaUpdated(...t){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(t){this.doRegisterOverrideIdentifiers(t),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(t){for(const e of t)this.overrideIdentifiers.add(e);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(t,e,i){t.forEach(r=>{this.validateAndRegisterProperties(r,e,r.extensionInfo,r.restrictedProperties,void 0,i),this.configurationContributors.push(r),this.registerJSONConfiguration(r)})}doDeregisterConfigurations(t,e){const i=r=>{if(r.properties)for(const s in r.properties){e.add(s);const n=this.configurationProperties[s];n?.policy?.name&&this.policyConfigurations.delete(n.policy.name),delete this.configurationProperties[s],this.removeFromSchema(s,r.properties[s])}r.allOf?.forEach(s=>i(s))};for(const r of t){i(r);const s=this.configurationContributors.indexOf(r);s!==-1&&this.configurationContributors.splice(s,1)}}validateAndRegisterProperties(t,e=!0,i,r,s=4,n){s=ci(t.scope)?s:t.scope;const o=t.properties;if(o)for(const c in o){const l=o[c];if(e&&RC(c,l)){delete o[c];continue}l.source=i,l.defaultDefaultValue=o[c].default,this.updatePropertyDefaultValue(c,l),Fr.test(c)?l.scope=void 0:(l.scope=ci(l.scope)?s:l.scope,l.restricted=ci(l.restricted)?!!r?.includes(c):l.restricted);const u=o[c].hasOwnProperty("included")&&!o[c].included,d=o[c].policy?.name;u?(this.excludedConfigurationProperties[c]=o[c],d&&(this.policyConfigurations.set(d,c),n.add(c)),delete o[c]):(n.add(c),d&&this.policyConfigurations.set(d,c),this.configurationProperties[c]=o[c],!o[c].deprecationMessage&&o[c].markdownDeprecationMessage&&(o[c].deprecationMessage=o[c].markdownDeprecationMessage))}const a=t.allOf;if(a)for(const c of a)this.validateAndRegisterProperties(c,e,i,r,s,n)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getRegisteredDefaultConfigurations(){return[...this.registeredConfigurationDefaults]}getConfigurationDefaultsOverrides(){const t=new Map;for(const[e,i]of this.configurationDefaultsOverrides)i.configurationDefaultOverrideValue&&t.set(e,i.configurationDefaultOverrideValue);return t}registerJSONConfiguration(t){const e=i=>{const r=i.properties;if(r)for(const n in r)this.updateSchema(n,r[n]);i.allOf?.forEach(e)};e(t)}updateSchema(t,e){switch(_c.properties[t]=e,e.scope){case 1:bc.properties[t]=e;break;case 2:kc.properties[t]=e;break;case 3:Ec.properties[t]=e;break;case 7:Pc.properties[t]=e;break;case 4:xc.properties[t]=e;break;case 5:Ro.properties[t]=e;break;case 6:Ro.properties[t]=e,this.resourceLanguageSettingsSchema.properties[t]=e;break}}removeFromSchema(t,e){switch(delete _c.properties[t],e.scope){case 1:delete bc.properties[t];break;case 2:delete kc.properties[t];break;case 3:delete Ec.properties[t];break;case 7:delete Pc.properties[t];break;case 4:delete xc.properties[t];break;case 5:case 6:delete Ro.properties[t],delete this.resourceLanguageSettingsSchema.properties[t];break}}updateOverridePropertyPatternKey(){for(const t of this.overrideIdentifiers.values()){const e=`[${t}]`,i={type:"object",description:w(1803,null),errorMessage:w(1804,null),$ref:Hs};this.updatePropertyDefaultValue(e,i),_c.properties[e]=i,bc.properties[e]=i,Ec.properties[e]=i,kc.properties[e]=i,Pc.properties[e]=i,xc.properties[e]=i,Ro.properties[e]=i}}registerOverridePropertyPatternKey(){const t={type:"object",description:w(1805,null),errorMessage:w(1806,null),$ref:Hs};_c.patternProperties[vs]=t,bc.patternProperties[vs]=t,Ec.patternProperties[vs]=t,kc.patternProperties[vs]=t,Pc.patternProperties[vs]=t,xc.patternProperties[vs]=t,Ro.patternProperties[vs]=t,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(t,e){const i=this.configurationDefaultsOverrides.get(t)?.configurationDefaultOverrideValue;let r,s;i&&(!e.disallowConfigurationDefault||!i.source)&&(r=i.value,s=i.source),hs(r)&&(r=e.defaultDefaultValue,s=void 0),hs(r)&&(r=AC(e.type)),e.default=r,e.defaultValueSource=s}},$g="\\[([^\\]]+)\\]",Bg=new RegExp($g,"g"),vs=`^(${$g})+$`,Fr=new RegExp(vs),Ic=new jS,Ei.add(ir.Configuration,Ic)}}),HS,MC=g({"out-build/vs/platform/update/common/update.config.contribution.js"(){"use strict";z(),we(),Cn(),ms(),HS=Ei.as(ir.Configuration),HS.registerConfiguration({id:"update",order:15,title:w(2593,null),type:"object",properties:{"update.mode":{type:"string",enum:["none","manual","start","default"],default:"default",scope:1,description:w(2594,null),tags:["usesOnlineServices"],enumDescriptions:[w(2595,null),w(2596,null),w(2597,null),w(2598,null)],policy:{name:"UpdateMode",minimumVersion:"1.67"}},"update.channel":{type:"string",default:"default",scope:1,description:w(2599,null),deprecationMessage:w(2600,null,"update.mode")},"update.enableWindowsBackgroundUpdates":{type:"boolean",default:!0,scope:1,title:w(2601,null),description:w(2602,null),included:B&&!us},"update.showReleaseNotes":{type:"boolean",default:!0,scope:1,description:w(2603,null),tags:["usesOnlineServices"]},"update.releaseTrack":{type:"string",default:"stable",scope:1,description:w(2604,null)}}})}});function Vs(t){return t===47||t===92}function Mo(t){return t.replace(/[\\/]/g,le.sep)}function TC(t){return t.indexOf("/")===-1&&(t=Mo(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}function VS(t,e=le.sep){if(!t)return"";const i=t.length,r=t.charCodeAt(0);if(Vs(r)){if(Vs(t.charCodeAt(1))&&!Vs(t.charCodeAt(2))){let n=3;const o=n;for(;n<i&&!Vs(t.charCodeAt(n));n++);if(o!==n&&!Vs(t.charCodeAt(n+1))){for(n+=1;n<i;n++)if(Vs(t.charCodeAt(n)))return t.slice(0,n+1).replace(/[\\/]/g,e)}}return e}else if(jg(r)&&t.charCodeAt(1)===58)return Vs(t.charCodeAt(2))?t.slice(0,2)+e:t.slice(0,2);let s=t.indexOf("://");if(s!==-1){for(s+=3;s<i;s++)if(Vs(t.charCodeAt(s)))return t.slice(0,s+1)}return""}function WC(t){if(!B||!t||t.length<5)return!1;let e=t.charCodeAt(0);if(e!==92||(e=t.charCodeAt(1),e!==92))return!1;let i=2;const r=i;for(;i<t.length&&(e=t.charCodeAt(i),e!==92);i++);return!(r===i||(e=t.charCodeAt(i+1),isNaN(e)||e===92))}function LC(t,e=B){const i=e?KS:YS;return!(!t||t.length===0||/^\s+$/.test(t)||(i.lastIndex=0,i.test(t))||e&&JS.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}function Dc(t,e,i){const r=t===e;return!i||r?r:!t||!e?!1:js(t,e)}function Ac(t,e,i,r=Qt){if(t===e)return!0;if(!t||!e||e.length>t.length)return!1;if(i){if(!Vu(t,e))return!1;if(e.length===t.length)return!0;let n=e.length;return e.charAt(e.length-1)===r&&n--,t.charAt(n)===r}return e.charAt(e.length-1)!==r&&(e+=r),t.indexOf(e)===0}function jg(t){return t>=65&&t<=90||t>=97&&t<=122}function qS(t,e){return B&&t.endsWith(":")&&(t+=Qt),dc(t)||(t=U(e,t)),t=bi(t),zS(t)}function zS(t){return B?(t=Pn(t,Qt),t.endsWith(":")&&(t+=Qt)):(t=Pn(t,Qt),t||(t=Qt)),t}function OC(t){const e=bi(t);return B?t.length>3?!1:GS(e)&&(t.length===2||e.charCodeAt(2)===92):e===le.sep}function GS(t,e=B){return e?jg(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}function Qu(t){const e=t.split(":");let i,r,s;for(const n of e){const o=Number(n);Ou(o)?r===void 0?r=o:s===void 0&&(s=o):i=i?[i,n].join(":"):n}if(!i)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:i,line:r!==void 0?r:void 0,column:s!==void 0?s:r!==void 0?1:void 0}}function Rc(t,e,i=8){let r="";for(let n=0;n<i;n++){let o;n===0&&B&&!e&&(i===3||i===4)?o=XS:o=QS,r+=o.charAt(Math.floor(Math.random()*o.length))}let s;return e?s=`${e}-${r}`:s=r,t?U(t,s):s}var KS,YS,JS,QS,XS,Bi=g({"out-build/vs/base/common/extpath.js"(){"use strict";ye(),z(),jt(),xe(),KS=/[\\/:\*\?"<>\|]/g,YS=/[/]/g,JS=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i,QS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",XS="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789"}});function ji(t){return Ku(t,!0)}var Mc,Ce,rt,Hg,Vg,qg,FC,NC,Nr,ZS,e_,pe,zg,UC,$C,t_,ki,Gg,i_,BC,r_,gt=g({"out-build/vs/base/common/resources.js"(){"use strict";Bi(),Ie(),ye(),z(),jt(),re(),Mc=class{constructor(t){this._ignorePathCasing=t}compare(t,e,i=!1){return t===e?0:xg(this.getComparisonKey(t,i),this.getComparisonKey(e,i))}isEqual(t,e,i=!1){return t===e?!0:!t||!e?!1:this.getComparisonKey(t,i)===this.getComparisonKey(e,i)}getComparisonKey(t,e=!1){return t.with({path:this._ignorePathCasing(t)?t.path.toLowerCase():void 0,fragment:e?null:void 0}).toString()}ignorePathCasing(t){return this._ignorePathCasing(t)}isEqualOrParent(t,e,i=!1){if(t.scheme===e.scheme){if(t.scheme===T.file)return Ac(ji(t),ji(e),this._ignorePathCasing(t))&&t.query===e.query&&(i||t.fragment===e.fragment);if(ki(t.authority,e.authority))return Ac(t.path,e.path,this._ignorePathCasing(t),"/")&&t.query===e.query&&(i||t.fragment===e.fragment)}return!1}joinPath(t,...e){return x.joinPath(t,...e)}basenameOrAuthority(t){return Nr(t)||t.authority}basename(t){return le.basename(t.path)}extname(t){return le.extname(t.path)}dirname(t){if(t.path.length===0)return t;let e;return t.scheme===T.file?e=x.file(pt(ji(t))).path:(e=le.dirname(t.path),t.authority&&e.length&&e.charCodeAt(0)!==47&&(console.error(`dirname("${t.toString})) resulted in a relative path`),e="/")),t.with({path:e})}normalizePath(t){if(!t.path.length)return t;let e;return t.scheme===T.file?e=x.file(bi(ji(t))).path:e=le.normalize(t.path),t.with({path:e})}relativePath(t,e){if(t.scheme!==e.scheme||!ki(t.authority,e.authority))return;if(t.scheme===T.file){const s=oS(ji(t),ji(e));return B?Mo(s):s}let i=t.path||"/";const r=e.path||"/";if(this._ignorePathCasing(t)){let s=0;for(const n=Math.min(i.length,r.length);s<n&&!(i.charCodeAt(s)!==r.charCodeAt(s)&&i.charAt(s).toLowerCase()!==r.charAt(s).toLowerCase());s++);i=r.substr(0,s)+i.substr(s)}return le.relative(i,r)}resolvePath(t,e){if(t.scheme===T.file){const i=x.file(Jt(ji(t),e));return t.with({authority:i.authority,path:i.path})}return e=TC(e),t.with({path:le.resolve(t.path,e)})}isAbsolutePath(t){return!!t.path&&t.path[0]==="/"}isEqualAuthority(t,e){return t===e||t!==void 0&&e!==void 0&&js(t,e)}hasTrailingPathSeparator(t,e=Qt){if(t.scheme===T.file){const i=ji(t);return i.length>VS(i).length&&i[i.length-1]===e}else{const i=t.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(t.fsPath)}}removeTrailingPathSeparator(t,e=Qt){return Gg(t,e)?t.with({path:t.path.substr(0,t.path.length-1)}):t}addTrailingPathSeparator(t,e=Qt){let i=!1;if(t.scheme===T.file){const r=ji(t);i=r!==void 0&&r.length===VS(r).length&&r[r.length-1]===e}else{e="/";const r=t.path;i=r.length===1&&r.charCodeAt(r.length-1)===47}return!i&&!Gg(t,e)?t.with({path:t.path+"/"}):t}},Ce=new Mc(()=>!1),rt=new Mc(t=>t.scheme===T.file?!Pe:!0),Hg=new Mc(t=>!0),Vg=Ce.isEqual.bind(Ce),qg=Ce.isEqualOrParent.bind(Ce),FC=Ce.getComparisonKey.bind(Ce),NC=Ce.basenameOrAuthority.bind(Ce),Nr=Ce.basename.bind(Ce),ZS=Ce.extname.bind(Ce),e_=Ce.dirname.bind(Ce),pe=Ce.joinPath.bind(Ce),zg=Ce.normalizePath.bind(Ce),UC=Ce.relativePath.bind(Ce),$C=Ce.resolvePath.bind(Ce),t_=Ce.isAbsolutePath.bind(Ce),ki=Ce.isEqualAuthority.bind(Ce),Gg=Ce.hasTrailingPathSeparator.bind(Ce),i_=Ce.removeTrailingPathSeparator.bind(Ce),BC=Ce.addTrailingPathSeparator.bind(Ce),(function(t){t.META_DATA_LABEL="label",t.META_DATA_DESCRIPTION="description",t.META_DATA_SIZE="size",t.META_DATA_MIME="mime";function e(i){const r=new Map;i.path.substring(i.path.indexOf(";")+1,i.path.lastIndexOf(";")).split(";").forEach(o=>{const[a,c]=o.split(":");a&&c&&r.set(a,c)});const n=i.path.substring(0,i.path.indexOf(";"));return n&&r.set(t.META_DATA_MIME,n),r}t.parseMetaData=e})(r_||(r_={}))}}),s_,jC=g({"out-build/vs/base/common/symbols.js"(){"use strict";s_=Symbol("MicrotaskDelay")}});function Kg(t){return!!t&&typeof t.then=="function"}function To(t){const e=new Sr,i=t(e.token);let r=!1;const s=new Promise((n,o)=>{const a=e.token.onCancellationRequested(()=>{r=!0,a.dispose(),o(new yi)});Promise.resolve(i).then(c=>{a.dispose(),e.dispose(),r?Ny(c)&&c.dispose():n(c)},c=>{a.dispose(),e.dispose(),o(c)})});return new class{cancel(){e.cancel(),e.dispose()}then(n,o){return s.then(n,o)}catch(n){return this.then(void 0,n)}finally(n){return s.finally(n)}}}function HC(){let t,e;return{promise:new Promise((r,s)=>{t=r,e=s}),resolve:t,reject:e}}function Pi(t,e){return e?new Promise((i,r)=>{const s=setTimeout(()=>{n.dispose(),i()},t),n=e.onCancellationRequested(()=>{clearTimeout(s),n.dispose(),r(new yi)})}):To(i=>Pi(t,i))}function VC(t,e=0,i){const r=setTimeout(()=>{t(),i&&s.dispose()},e),s=me(()=>{clearTimeout(r),i?.delete(s)});return i?.add(s),s}function qC(t,e=r=>!!r,i=null){let r=0;const s=t.length,n=()=>{if(r>=s)return Promise.resolve(i);const o=t[r++];return Promise.resolve(o()).then(c=>e(c)?Promise.resolve(c):n())};return n()}async function zC(t,e,i){let r;for(let s=0;s<i;s++)try{return await t()}catch(n){r=n,await Pi(e)}throw r}var Yg,n_,o_,Xu,ws,Tc,Jg,Wo,Qg,br,a_,Xg,Zg,Zu,c_,l_,u_,ys,Ht,d_,GC,ae=g({"out-build/vs/base/common/async.js"(){"use strict";St(),Re(),q(),L(),gt(),z(),jC(),Do(),Yg=class{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(t){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=t,!this.queuedPromise){const e=()=>{if(this.queuedPromise=null,this.isDisposed)return;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(e,e).then(i)})}return new Promise((e,i)=>{this.queuedPromise.then(e,i)})}return this.activePromise=t(),new Promise((e,i)=>{this.activePromise.then(r=>{this.activePromise=null,e(r)},r=>{this.activePromise=null,i(r)})})}dispose(){this.isDisposed=!0}},n_=(t,e)=>{let i=!0;const r=setTimeout(()=>{i=!1,e()},t);return{isTriggered:()=>i,dispose:()=>{clearTimeout(r),i=!1}}},o_=t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:()=>e,dispose:()=>{e=!1}}},Xu=class{constructor(t){this.defaultDelay=t,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(t,e=this.defaultDelay){this.task=t,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((r,s)=>{this.doResolve=r,this.doReject=s}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const r=this.task;return this.task=null,r()}}));const i=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=e===s_?o_(i):n_(e,i),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new yi),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}},ws=class{constructor(t){this.delayer=new Xu(t),this.throttler=new Yg}trigger(t,e){return this.delayer.trigger(()=>this.throttler.queue(t),e)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}},Tc=class{constructor(){this._isOpen=!1,this._promise=new Promise((t,e)=>{this._completePromise=t})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}},Jg=class{constructor(t){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=t,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new D}whenIdle(){return this.size>0?P.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(t){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((e,i)=>{this.outstandingPromises.push({factory:t,c:e,e:i}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){const t=this.outstandingPromises.shift();this.runningPromises++;const e=t.factory();e.then(t.c,t.e),e.then(()=>this.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}},Wo=class extends Jg{constructor(){super(1)}},Qg=class{constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;const t=new ys;return this.drainers.add(t),t.p}isDrained(){for(const[,t]of this.queues)if(t.size>0)return!1;return!0}queueSize(t,e=Ce){const i=e.getComparisonKey(t);return this.queues.get(i)?.size??0}queueFor(t,e,i=Ce){const r=i.getComparisonKey(t);let s=this.queues.get(r);if(!s){s=new Wo;const n=this.drainListenerCount++,o=P.once(s.onDrained)(()=>{s?.dispose(),this.queues.delete(r),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(n),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new mg),this.drainListeners.set(n,o),this.queues.set(r,s)}return s.queue(e)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(const t of this.drainers)t.complete();this.drainers.clear()}dispose(){for(const[,t]of this.queues)t.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}},br=class{constructor(t,e){this.timeoutToken=-1,this.runner=t,this.timeout=e,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(t=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,t)}get delay(){return this.timeout}set delay(t){this.timeout=t}isScheduled(){return this.timeoutToken!==-1}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner?.()}},a_=class extends br{constructor(t,e){super(t,e),this.units=[]}work(t){this.units.push(t),this.isScheduled()||this.schedule()}doRun(){const t=this.units;this.units=[],this.runner?.(t)}dispose(){this.units=[],super.dispose()}},Xg=class extends N{constructor(t,e){super(),this.options=t,this.handler=e,this.pendingWork=[],this.throttler=this._register(new $s),this.disposed=!1,this.lastExecutionTime=0}get pending(){return this.pendingWork.length}work(t){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+t.length>this.options.maxBufferedWork)return!1}else if(this.pending+t.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(const i of t)this.pendingWork.push(i);const e=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||e>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-e,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(t=this.options.throttleDelay){this.throttler.value=new br(()=>{this.throttler.clear(),this.doWork()},t),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}},(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?Zu=(t,e,i)=>{fy(()=>{if(r)return;const s=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let r=!1;return{dispose(){r||(r=!0)}}}:Zu=(t,e,i)=>{const r=t.requestIdleCallback(e,typeof i=="number"?{timeout:i}:void 0);let s=!1;return{dispose(){s||(s=!0,t.cancelIdleCallback(r))}}},Zg=(t,e)=>Zu(globalThis,t,e)})(),c_=class{constructor(t,e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(i){this._error=i}finally{this._didRun=!0}},this._handle=Zu(t,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}},l_=class extends c_{constructor(t){super(globalThis,t)}},(function(t){t[t.Resolved=0]="Resolved",t[t.Rejected=1]="Rejected"})(u_||(u_={})),ys=class{get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((t,e)=>{this.completeCallback=t,this.errorCallback=e})}complete(t){return new Promise(e=>{this.completeCallback(t),this.outcome={outcome:0,value:t},e()})}error(t){return new Promise(e=>{this.errorCallback(t),this.outcome={outcome:1,value:t},e()})}cancel(){return this.error(new yi)}},(function(t){async function e(r){let s;const n=await Promise.all(r.map(o=>o.then(a=>a,a=>{s||(s=a)})));if(typeof s<"u")throw s;return n}t.settled=e;function i(r){return new Promise(async(s,n)=>{try{await r(s,n)}catch(o){n(o)}})}t.withAsyncBody=i})(Ht||(Ht={})),(function(t){t[t.Initial=0]="Initial",t[t.DoneOK=1]="DoneOK",t[t.DoneError=2]="DoneError"})(d_||(d_={})),GC=class Qi{static fromArray(e){return new Qi(i=>{i.emitMany(e)})}static fromPromise(e){return new Qi(async i=>{i.emitMany(await e)})}static fromPromisesResolveOrder(e){return new Qi(async i=>{await Promise.all(e.map(async r=>i.emitOne(await r)))})}static merge(e){return new Qi(async i=>{await Promise.all(e.map(async r=>{for await(const s of r)i.emitOne(s)}))})}static{this.EMPTY=Qi.fromArray([])}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new D,queueMicrotask(async()=>{const r={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(e(r)),this.resolve()}catch(s){this.reject(s)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await P.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,i){return new Qi(async r=>{for await(const s of e)r.emitOne(i(s))})}map(e){return Qi.map(this,e)}static filter(e,i){return new Qi(async r=>{for await(const s of e)i(s)&&r.emitOne(s)})}filter(e){return Qi.filter(this,e)}static coalesce(e){return Qi.filter(e,i=>!!i)}coalesce(){return Qi.coalesce(this)}static async toPromise(e){const i=[];for await(const r of e)i.push(r);return i}toPromise(){return Qi.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}}});function em(t,e){return e&&(t.stack||t.stacktrace)?w(110,null,f_(t),h_(t.stack)||h_(t.stacktrace)):f_(t)}function h_(t){return Array.isArray(t)?t.join(`
|
|
`):t}function f_(t){return t.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${t.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof t.code=="string"&&typeof t.errno=="number"&&typeof t.syscall=="string"?w(111,null,t.message):t.message||w(112,null)}function rr(t=null,e=!1){if(!t)return w(113,null);if(Array.isArray(t)){const i=Dt(t),r=rr(i[0],e);return i.length>1?w(114,null,r,i.length):r}if(At(t))return t;if(t.detail){const i=t.detail;if(i.error)return em(i.error,e);if(i.exception)return em(i.exception,e)}return t.stack?em(t,e):t.message?t.message:w(115,null)}var In=g({"out-build/vs/base/common/errorMessage.js"(){"use strict";Wt(),xe(),we()}});function Lo(t,e){const{os:i,tildify:r,relative:s}=e;if(s){const a=KC(t,s,i);if(typeof a=="string")return a}let n=t.fsPath;if(i===1&&!B?n=n.replace(/\//g,"\\"):i!==1&&B&&(n=n.replace(/\\/g,"/")),i!==1&&r?.userHome){const a=r.userHome.fsPath;let c;t.scheme!==r.userHome.scheme&&t.path[0]===le.sep&&t.path[1]!==le.sep?c=r.userHome.with({path:t.path}).fsPath:c=n,n=YC(c,a,i)}return(i===1?nt:le).normalize(tm(n,i===1))}function KC(t,e,i){const r=i===1?nt:le,s=i===3?Ce:Hg,n=e.getWorkspace(),o=n.folders.at(0);if(!o)return;t.scheme!==o.uri.scheme&&t.path[0]===le.sep&&t.path[1]!==le.sep&&(t=o.uri.with({path:t.path}));const a=e.getWorkspaceFolder(t);if(!a)return;let c;if(s.isEqual(a.uri,t)?c="":c=s.relativePath(a.uri,t)??"",c&&(c=r.normalize(c)),n.folders.length>1&&!e.noPrefix){const l=a.name?a.name:s.basenameOrAuthority(a.uri);c=c?`${l} \u2022 ${c}`:l}return c}function tm(t,e=B){return GS(t,e)?t.charAt(0).toUpperCase()+t.slice(1):t}function YC(t,e,i=Gi){if(i===1||!t||!e)return t;let r=ed.original===e?ed.normalized:void 0;r||(r=e,B&&(r=Mo(r)),r=`${Pn(r,le.sep)}${le.sep}`,ed={original:e,normalized:r});let s=t;return B&&(s=Mo(s)),(i===3?s.startsWith(r):Vu(s,r))?`~/${s.substr(r.length)}`:t}function JC(t,e){return O||e?t.replace(/\(&&\w\)|&&/g,"").replace(/&/g,O?"&":"&&"):t.replace(/&&|&/g,i=>i==="&"?"&&":"&")}function p_(t,e){const i=t.replace(/\(&&\w\)|&&/g,"");if(e)return i;if(O)return{withMnemonic:i,withoutMnemonic:i};let r;return B?r=t.replace(/&&|&/g,s=>s==="&"?"&&":"&"):r=t.replace(/&&/g,"_"),{withMnemonic:r,withoutMnemonic:i}}function QC(t){if(t.endsWith("]")){const e=t.lastIndexOf(" [",t.length-2);if(e!==-1){const i=g_(t.substring(0,e)),r=t.substring(e);return{name:i.name+r,parentPath:i.parentPath}}}return g_(t)}function g_(t){const e=t.indexOf("/")!==-1?le:nt,i=e.basename(t),r=e.dirname(t);return i.length?{name:i,parentPath:r}:{name:r,parentPath:""}}var ed,m_,qs=g({"out-build/vs/base/common/labels.js"(){"use strict";Bi(),ye(),z(),gt(),jt(),ed=Object.create(null),(function(t){t[t.TEXT=0]="TEXT",t[t.VARIABLE=1]="VARIABLE",t[t.SEPARATOR=2]="SEPARATOR"})(m_||(m_={}))}});function Oo(t){return XC(t,"NFC",v_)}function XC(t,e,i){if(!t)return t;const r=i.get(t);if(r)return r;let s;return w_.test(t)?s=t.normalize(e):s=t,i.set(t,s),s}var v_,ZC,w_,td=g({"out-build/vs/base/common/normalization.js"(){"use strict";ai(),v_=new oc(1e4),ZC=new oc(1e4),w_=/[^\u0000-\u0080]/}});import*as He from"fs";import{tmpdir as eI}from"os";import{promisify as Wc}from"util";async function y_(t,e=Dn.UNLINK,i){if(OC(t))throw new Error("rimraf - will refuse to recursively delete root");return e===Dn.UNLINK?im(t):tI(t,i)}async function tI(t,e=Rc(eI())){try{try{await He.promises.rename(t,e)}catch(i){return i.code==="ENOENT"?void 0:im(t)}im(e).catch(i=>{})}catch(i){if(i.code!=="ENOENT")throw i}}async function im(t){return He.promises.rm(t,{recursive:!0,force:!0,maxRetries:3})}async function id(t,e){return rI(await(e?iI(t):He.promises.readdir(t)))}async function iI(t){try{return await He.promises.readdir(t,{withFileTypes:!0})}catch(r){console.warn("[node.js fs] readdir with filetypes failed with error: ",r)}const e=[],i=await id(t);for(const r of i){let s=!1,n=!1,o=!1;try{const a=await He.promises.lstat(U(t,r));s=a.isFile(),n=a.isDirectory(),o=a.isSymbolicLink()}catch(a){console.warn("[node.js fs] unexpected error from lstat after readdir: ",a)}e.push({name:r,isFile:()=>s,isDirectory:()=>n,isSymbolicLink:()=>o})}return e}function rI(t){return t.map(e=>typeof e=="string"?O?Oo(e):e:(e.name=O?Oo(e.name):e.name,e))}async function sI(t){const e=await id(t),i=[];for(const r of e)await Vt.existsDirectory(U(t,r))&&i.push(r);return i}function nI(t,e=1e3){return new Promise(i=>{let r=!1;const s=setInterval(()=>{r||(r=!0,He.access(t,n=>{r=!1,n&&(clearInterval(s),i(void 0))}))},e)})}function oI(t,e,i){return E_.queueFor(x.file(t),()=>{const r=lI(i);return new Promise((s,n)=>cI(t,e,r,o=>o?n(o):s()))},rt)}function aI(t){rm=t}function cI(t,e,i,r){if(!rm)return He.writeFile(t,e,{mode:i.mode,flag:i.flag},r);He.open(t,i.flag,i.mode,(s,n)=>{if(s)return r(s);He.writeFile(n,e,o=>{if(o)return He.close(n,()=>r(o));He.fdatasync(n,a=>(a&&(console.warn("[node.js fs] fdatasync is now disabled for this session because it failed: ",a),aI(!1)),He.close(n,c=>r(c))))})})}function lI(t){return t?{mode:typeof t.mode=="number"?t.mode:438,flag:typeof t.flag=="string"?t.flag:"w"}:{mode:438,flag:"w"}}async function uI(t,e,i=6e4){if(t!==e)try{B&&typeof i=="number"?await S_(t,e,Date.now(),i):await He.promises.rename(t,e)}catch(r){if(t.toLowerCase()!==e.toLowerCase()&&r.code==="EXDEV"||t.endsWith("."))await __(t,e,{preserveSymlinks:!1}),await y_(t,Dn.MOVE);else throw r}}async function S_(t,e,i,r,s=0){try{return await He.promises.rename(t,e)}catch(n){if(n.code!=="EACCES"&&n.code!=="EPERM"&&n.code!=="EBUSY")throw n;if(Date.now()-i>=r)throw console.error(`[node.js fs] rename failed after ${s} retries with error: ${n}`),n;if(s===0){let o=!1;try{const{stat:a}=await Vt.stat(e);a.isFile()||(o=!0)}catch{}if(o)throw n}return await Pi(Math.min(100,s*10)),S_(t,e,i,r,s+1)}}async function __(t,e,i){return b_(t,e,{root:{source:t,target:e},options:i,handledSourcePaths:new Set})}async function b_(t,e,i){if(i.handledSourcePaths.has(t))return;i.handledSourcePaths.add(t);const{stat:r,symbolicLink:s}=await Vt.stat(t);if(s){if(i.options.preserveSymlinks)try{return await fI(t,e,i)}catch{}if(s.dangling)return}return r.isDirectory()?dI(t,e,r.mode&sm,i):hI(t,e,r.mode&sm)}async function dI(t,e,i,r){await He.promises.mkdir(e,{recursive:!0,mode:i});const s=await id(t);for(const n of s)await b_(U(t,n),U(e,n),r)}async function hI(t,e,i){await He.promises.copyFile(t,e),await He.promises.chmod(e,i)}async function fI(t,e,i){let r=await He.promises.readlink(t);Ac(r,i.root.source,!Pe)&&(r=U(i.root.target,r.substr(i.root.source.length+1))),await He.promises.symlink(r,e)}var Dn,Vt,E_,rm,sm,te,qt=g({"out-build/vs/base/node/pfs.js"(){"use strict";ae(),Bi(),td(),ye(),z(),gt(),re(),(function(t){t[t.UNLINK=0]="UNLINK",t[t.MOVE=1]="MOVE"})(Dn||(Dn={})),(function(t){async function e(s){let n;try{if(n=await He.promises.lstat(s),!n.isSymbolicLink())return{stat:n}}catch{}try{return{stat:await He.promises.stat(s),symbolicLink:n?.isSymbolicLink()?{dangling:!1}:void 0}}catch(o){if(o.code==="ENOENT"&&n)return{stat:n,symbolicLink:{dangling:!0}};if(B&&o.code==="EACCES")try{return{stat:await He.promises.stat(await He.promises.readlink(s)),symbolicLink:{dangling:!1}}}catch(a){if(a.code==="ENOENT"&&n)return{stat:n,symbolicLink:{dangling:!0}};throw a}throw o}}t.stat=e;async function i(s){try{const{stat:n,symbolicLink:o}=await t.stat(s);return n.isFile()&&o?.dangling!==!0}catch{}return!1}t.existsFile=i;async function r(s){try{const{stat:n,symbolicLink:o}=await t.stat(s);return n.isDirectory()&&o?.dangling!==!0}catch{}return!1}t.existsDirectory=r})(Vt||(Vt={})),E_=new Qg,rm=!0,sm=511,te=new class{get read(){return(t,e,i,r,s)=>new Promise((n,o)=>{He.read(t,e,i,r,s,(a,c,l)=>a?o(a):n({bytesRead:c,buffer:l}))})}get write(){return(t,e,i,r,s)=>new Promise((n,o)=>{He.write(t,e,i,r,s,(a,c,l)=>a?o(a):n({bytesWritten:c,buffer:l}))})}get fdatasync(){return Wc(He.fdatasync)}get open(){return Wc(He.open)}get close(){return Wc(He.close)}get realpath(){return Wc(He.realpath)}get ftruncate(){return Wc(He.ftruncate)}async exists(t){try{return await He.promises.access(t),!0}catch{return!1}}get readdir(){return id}get readDirsInDir(){return sI}get writeFile(){return oI}get rm(){return y_}get rename(){return uI}get copy(){return __}}}}),pI=g({"out-build/vs/base/common/decorators/cancelPreviousCalls.js"(){"use strict";xe(),L(),St()}});function he(t,e,i){let r=null,s=null;if(typeof i.value=="function"?(r="value",s=i.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(r="get",s=i.get),!s)throw new Error("not supported");const n=`$memoize$${e}`;i[r]=function(...o){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,o)}),this[n]}}var An=g({"out-build/vs/base/common/decorators.js"(){"use strict";pI()}});function gI(t){return JSON.stringify(t,vI)}function mI(t){let e=JSON.parse(t);return e=zs(e),e}function vI(t,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function zs(t,e=0){if(!t||e>200)return t;if(typeof t=="object"){switch(t.$mid){case 1:return x.revive(t);case 2:return new RegExp(t.source,t.flags);case 17:return new Date(t.source)}if(t instanceof Y||t instanceof Uint8Array)return t;if(Array.isArray(t))for(let i=0;i<t.length;++i)t[i]=zs(t[i],e+1);else for(const i in t)Object.hasOwnProperty.call(t,i)&&(t[i]=zs(t[i],e+1))}return t}var rd=g({"out-build/vs/base/common/marshalling.js"(){"use strict";it(),re()}});function Fo(t){switch(t){case 100:return"req";case 101:return"cancel";case 102:return"subscribe";case 103:return"unsubscribe"}}function sd(t){switch(t){case 200:return"init";case 201:return"reply:";case 202:case 203:return"replyErr:";case 204:return"event:"}}function No(t){let e=0;for(let i=0;;i+=7){const r=t.read(1);if(e|=(r.buffer[0]&127)<<i,!(r.buffer[0]&128))return e}}function Uo(t,e){if(e===0){t.write(x_);return}let i=0;for(let s=e;s!==0;s=s>>>7)i++;const r=Y.alloc(i);for(let s=0;e!==0;s++)r.buffer[s]=e&127,e=e>>>7,e>0&&(r.buffer[s]|=128);t.write(r)}function Gs(t){const e=Y.alloc(1);return e.writeUInt8(t,0),e}function $o(t,e){if(typeof e>"u")t.write(Ks.Undefined);else if(typeof e=="string"){const i=Y.fromString(e);t.write(Ks.String),Uo(t,i.byteLength),t.write(i)}else if(C_&&Buffer.isBuffer(e)){const i=Y.wrap(e);t.write(Ks.Buffer),Uo(t,i.byteLength),t.write(i)}else if(e instanceof Y)t.write(Ks.VSBuffer),Uo(t,e.byteLength),t.write(e);else if(Array.isArray(e)){t.write(Ks.Array),Uo(t,e.length);for(const i of e)$o(t,i)}else if(typeof e=="number"&&(e|0)===e)t.write(Ks.Uint),Uo(t,e);else{const i=Y.fromString(JSON.stringify(e));t.write(Ks.Object),Uo(t,i.byteLength),t.write(i)}}function Bo(t){switch(t.read(1).readUInt8(0)){case li.Undefined:return;case li.String:return t.read(No(t)).toString();case li.Buffer:return t.read(No(t)).buffer;case li.VSBuffer:return t.read(No(t));case li.Array:{const i=No(t),r=[];for(let s=0;s<i;s++)r.push(Bo(t));return r}case li.Object:return JSON.parse(t.read(No(t)).toString());case li.Int:return No(t)}}function nd(t){return{call(e,i,r){return t.then(s=>s.call(e,i,r))},listen(e,i){const r=new Sg;return t.then(s=>r.input=s.listen(e,i)),r.event}}}function wI(t){let e=!1;return{call(i,r,s){return e?t.call(i,r,s):Pi(0).then(()=>e=!0).then(()=>t.call(i,r,s))},listen(i,r){if(e)return t.listen(i,r);const s=new Sg;return Pi(0).then(()=>e=!0).then(()=>s.input=t.listen(i,r)),s.event}}}var k_,P_,Rn,x_,od,ad,li,Ks,C_,nm,I_,Lc,om,am,D_,Oe,Er=g({"out-build/vs/base/parts/ipc/common/ipc.js"(){"use strict";Wt(),ae(),it(),St(),An(),Re(),q(),Wu(),L(),rd(),jt(),xe(),(function(t){t[t.Promise=100]="Promise",t[t.PromiseCancel=101]="PromiseCancel",t[t.EventListen=102]="EventListen",t[t.EventDispose=103]="EventDispose"})(k_||(k_={})),(function(t){t[t.Initialize=200]="Initialize",t[t.PromiseSuccess=201]="PromiseSuccess",t[t.PromiseError=202]="PromiseError",t[t.PromiseErrorObj=203]="PromiseErrorObj",t[t.EventFire=204]="EventFire"})(P_||(P_={})),(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Idle=1]="Idle"})(Rn||(Rn={})),x_=Gs(0),od=class{constructor(t){this.buffer=t,this.pos=0}read(t){const e=this.buffer.slice(this.pos,this.pos+t);return this.pos+=e.byteLength,e}},ad=class{constructor(){this.buffers=[]}get buffer(){return Y.concat(this.buffers)}write(t){this.buffers.push(t)}},(function(t){t[t.Undefined=0]="Undefined",t[t.String=1]="String",t[t.Buffer=2]="Buffer",t[t.VSBuffer=3]="VSBuffer",t[t.Array=4]="Array",t[t.Object=5]="Object",t[t.Int=6]="Int"})(li||(li={})),Ks={Undefined:Gs(li.Undefined),String:Gs(li.String),Buffer:Gs(li.Buffer),VSBuffer:Gs(li.VSBuffer),Array:Gs(li.Array),Object:Gs(li.Object),Uint:Gs(li.Int)},C_=typeof Buffer<"u",nm=class{constructor(t,e,i=null,r=1e3){this.protocol=t,this.ctx=e,this.logger=i,this.timeoutDelay=r,this.channels=new Map,this.activeRequests=new Map,this.pendingRequests=new Map,this.protocolListener=this.protocol.onMessage(s=>this.onRawMessage(s)),this.sendResponse({type:200})}registerChannel(t,e){this.channels.set(t,e),setTimeout(()=>this.flushPendingRequests(t),0)}sendResponse(t){switch(t.type){case 200:{const e=this.send([t.type]);this.logger?.logOutgoing(e,0,1,sd(t.type));return}case 201:case 202:case 204:case 203:{const e=this.send([t.type,t.id],t.data);this.logger?.logOutgoing(e,t.id,1,sd(t.type),t.data);return}}}send(t,e=void 0){const i=new ad;return $o(i,t),$o(i,e),this.sendBuffer(i.buffer)}sendBuffer(t){try{return this.protocol.send(t),t.byteLength}catch{return 0}}onRawMessage(t){const e=new od(t),i=Bo(e),r=Bo(e),s=i[0];switch(s){case 100:return this.logger?.logIncoming(t.byteLength,i[1],1,`${Fo(s)}: ${i[2]}.${i[3]}`,r),this.onPromise({type:s,id:i[1],channelName:i[2],name:i[3],arg:r});case 102:return this.logger?.logIncoming(t.byteLength,i[1],1,`${Fo(s)}: ${i[2]}.${i[3]}`,r),this.onEventListen({type:s,id:i[1],channelName:i[2],name:i[3],arg:r});case 101:return this.logger?.logIncoming(t.byteLength,i[1],1,`${Fo(s)}`),this.disposeActiveRequest({type:s,id:i[1]});case 103:return this.logger?.logIncoming(t.byteLength,i[1],1,`${Fo(s)}`),this.disposeActiveRequest({type:s,id:i[1]})}}onPromise(t){const e=this.channels.get(t.channelName);if(!e){this.collectPendingRequest(t);return}const i=new Sr;let r;try{r=e.call(this.ctx,t.name,t.arg,i.token)}catch(o){r=Promise.reject(o)}const s=t.id;r.then(o=>{this.sendResponse({id:s,data:o,type:201})},o=>{o instanceof Error?this.sendResponse({id:s,data:{message:o.message,name:o.name,stack:o.stack?o.stack.split(`
|
|
`):void 0},type:202}):this.sendResponse({id:s,data:o,type:203})}).finally(()=>{n.dispose(),this.activeRequests.delete(t.id)});const n=me(()=>i.cancel());this.activeRequests.set(t.id,n)}onEventListen(t){const e=this.channels.get(t.channelName);if(!e){this.collectPendingRequest(t);return}const i=t.id,s=e.listen(this.ctx,t.name,t.arg)(n=>this.sendResponse({id:i,data:n,type:204}));this.activeRequests.set(t.id,s)}disposeActiveRequest(t){const e=this.activeRequests.get(t.id);e&&(e.dispose(),this.activeRequests.delete(t.id))}collectPendingRequest(t){let e=this.pendingRequests.get(t.channelName);e||(e=[],this.pendingRequests.set(t.channelName,e));const i=setTimeout(()=>{console.error(`Unknown channel: ${t.channelName}`),t.type===100&&this.sendResponse({id:t.id,data:{name:"Unknown channel",message:`Channel name '${t.channelName}' timed out after ${this.timeoutDelay}ms`,stack:void 0},type:202})},this.timeoutDelay);e.push({request:t,timeoutTimer:i})}flushPendingRequests(t){const e=this.pendingRequests.get(t);if(e){for(const i of e)switch(clearTimeout(i.timeoutTimer),i.request.type){case 100:this.onPromise(i.request);break;case 102:this.onEventListen(i.request);break}this.pendingRequests.delete(t)}}dispose(){this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),Rt(this.activeRequests.values()),this.activeRequests.clear()}},(function(t){t[t.LocalSide=0]="LocalSide",t[t.OtherSide=1]="OtherSide"})(I_||(I_={})),Lc=class{constructor(t,e=null){this.protocol=t,this.isDisposed=!1,this.state=Rn.Uninitialized,this.activeRequests=new Set,this.handlers=new Map,this.lastRequestId=0,this._onDidInitialize=new D,this.onDidInitialize=this._onDidInitialize.event,this.protocolListener=this.protocol.onMessage(i=>this.onBuffer(i)),this.logger=e}getChannel(t){const e=this;return{call(i,r,s){return e.isDisposed?Promise.reject(new yi):e.requestPromise(t,i,r,s)},listen(i,r){return e.isDisposed?P.None:e.requestEvent(t,i,r)}}}requestPromise(t,e,i,r=Te.None){const s=this.lastRequestId++,o={id:s,type:100,channelName:t,name:e,arg:i};if(r.isCancellationRequested)return Promise.reject(new yi);let a,c;return new Promise((u,d)=>{if(r.isCancellationRequested)return d(new yi);const f=()=>{const m=y=>{switch(y.type){case 201:this.handlers.delete(s),u(y.data);break;case 202:{this.handlers.delete(s);const S=new Error(y.data.message);S.stack=Array.isArray(y.data.stack)?y.data.stack.join(`
|
|
`):y.data.stack,S.name=y.data.name,d(S);break}case 203:this.handlers.delete(s),d(y.data);break}};this.handlers.set(s,m),this.sendRequest(o)};let p=null;this.state===Rn.Idle?f():(p=To(m=>this.whenInitialized()),p.then(()=>{p=null,f()}));const v=()=>{p?(p.cancel(),p=null):this.sendRequest({id:s,type:101}),d(new yi)};a=r.onCancellationRequested(v),c={dispose:Tu(()=>{v(),a.dispose()})},this.activeRequests.add(c)}).finally(()=>{a?.dispose(),this.activeRequests.delete(c)})}requestEvent(t,e,i){const r=this.lastRequestId++,n={id:r,type:102,channelName:t,name:e,arg:i};let o=null;const a=new D({onWillAddFirstListener:()=>{const l=()=>{this.activeRequests.add(a),this.sendRequest(n)};this.state===Rn.Idle?l():(o=To(u=>this.whenInitialized()),o.then(()=>{o=null,l()}))},onDidRemoveLastListener:()=>{o?(o.cancel(),o=null):(this.activeRequests.delete(a),this.sendRequest({id:r,type:103}))}}),c=l=>a.fire(l.data);return this.handlers.set(r,c),a.event}sendRequest(t){switch(t.type){case 100:case 102:{const e=this.send([t.type,t.id,t.channelName,t.name],t.arg);this.logger?.logOutgoing(e,t.id,0,`${Fo(t.type)}: ${t.channelName}.${t.name}`,t.arg);return}case 101:case 103:{const e=this.send([t.type,t.id]);this.logger?.logOutgoing(e,t.id,0,Fo(t.type));return}}}send(t,e=void 0){const i=new ad;return $o(i,t),$o(i,e),this.sendBuffer(i.buffer)}sendBuffer(t){try{return this.protocol.send(t),t.byteLength}catch{return 0}}onBuffer(t){const e=new od(t),i=Bo(e),r=Bo(e),s=i[0];switch(s){case 200:return this.logger?.logIncoming(t.byteLength,0,0,sd(s)),this.onResponse({type:i[0]});case 201:case 202:case 204:case 203:return this.logger?.logIncoming(t.byteLength,i[1],0,sd(s),r),this.onResponse({type:i[0],id:i[1],data:r})}}onResponse(t){if(t.type===200){this.state=Rn.Idle,this._onDidInitialize.fire();return}this.handlers.get(t.id)?.(t)}get onDidInitializePromise(){return P.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===Rn.Idle?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),Rt(this.activeRequests.values()),this.activeRequests.clear()}},__decorate([he],Lc.prototype,"onDidInitializePromise",null),om=class{get connections(){const t=[];return this._connections.forEach(e=>t.push(e)),t}constructor(t,e,i){this.channels=new Map,this._connections=new Set,this._onDidAddConnection=new D,this.onDidAddConnection=this._onDidAddConnection.event,this._onDidRemoveConnection=new D,this.onDidRemoveConnection=this._onDidRemoveConnection.event,this.disposables=new ke,this.disposables.add(t(({protocol:r,onDidClientDisconnect:s})=>{const n=P.once(r.onMessage);this.disposables.add(n(o=>{const a=new od(o),c=Bo(a),l=new nm(r,c,e,i),u=new Lc(r,e);this.channels.forEach((f,p)=>l.registerChannel(p,f));const d={channelServer:l,channelClient:u,ctx:c};this._connections.add(d),this._onDidAddConnection.fire(d),this.disposables.add(s(()=>{l.dispose(),u.dispose(),this._connections.delete(d),this._onDidRemoveConnection.fire(d)}))}))}))}getChannel(t,e){const i=this;return{call(r,s,n){let o;if(gg(e)){const c=Sx(i.connections.filter(e));o=c?Promise.resolve(c):P.toPromise(P.filter(i.onDidAddConnection,e))}else o=e.routeCall(i,r,s);const a=o.then(c=>c.channelClient.getChannel(t));return nd(a).call(r,s,n)},listen(r,s){if(gg(e))return i.getMulticastEvent(t,e,r,s);const n=e.routeEvent(i,r,s).then(o=>o.channelClient.getChannel(t));return nd(n).listen(r,s)}}}getMulticastEvent(t,e,i,r){const s=this;let n;const o=new D({onWillAddFirstListener:()=>{n=new ke;const a=new Qy,c=new Map,l=d=>{const p=d.channelClient.getChannel(t).listen(i,r),v=a.add(p);c.set(d,v)},u=d=>{const f=c.get(d);f&&(f.dispose(),c.delete(d))};s.connections.filter(e).forEach(l),P.filter(s.onDidAddConnection,e)(l,void 0,n),s.onDidRemoveConnection(u,void 0,n),a.event(o.fire,o,n),n.add(a)},onDidRemoveLastListener:()=>{n?.dispose(),n=void 0}});return s.disposables.add(o),o.event}registerChannel(t,e){this.channels.set(t,e);for(const i of this._connections)i.channelServer.registerChannel(t,e)}dispose(){this.disposables.dispose();for(const t of this._connections)t.channelClient.dispose(),t.channelServer.dispose();this._connections.clear(),this.channels.clear(),this._onDidAddConnection.dispose(),this._onDidRemoveConnection.dispose()}},am=class{constructor(t,e,i=null){const r=new ad;$o(r,e),t.send(r.buffer),this.channelClient=new Lc(t,i),this.channelServer=new nm(t,e,i)}getChannel(t){return this.channelClient.getChannel(t)}registerChannel(t,e){this.channelServer.registerChannel(t,e)}dispose(){this.channelClient.dispose(),this.channelServer.dispose()}},D_=class{constructor(t){this.fn=t}routeCall(t){return this.route(t)}routeEvent(t){return this.route(t)}async route(t){for(const e of t.connections)if(await Promise.resolve(this.fn(e.ctx)))return Promise.resolve(e);return await P.toPromise(t.onDidAddConnection),await this.route(t)}},(function(t){function e(n,o,a){const c=n,l=a&&a.disableMarshalling,u=new Map;for(const d in c)r(d)&&u.set(d,P.buffer(c[d],!0,void 0,o));return new class{listen(d,f,p){const v=u.get(f);if(v)return v;const m=c[f];if(typeof m=="function"){if(s(f))return m.call(c,p);if(r(f))return u.set(f,P.buffer(c[f],!0,void 0,o)),u.get(f)}throw new Tr(`Event not found: ${f}`)}call(d,f,p){const v=c[f];if(typeof v=="function"){if(!l&&Array.isArray(p))for(let y=0;y<p.length;y++)p[y]=zs(p[y]);let m=v.apply(c,p);return m instanceof Promise||(m=Promise.resolve(m)),m}throw new Tr(`Method not found: ${f}`)}}}t.fromService=e;function i(n,o){const a=o&&o.disableMarshalling;return new Proxy({},{get(c,l){if(typeof l=="string")return o?.properties?.has(l)?o.properties.get(l):s(l)?function(u){return n.listen(l,u)}:r(l)?n.listen(l):async function(...u){let d;o&&!ci(o.context)?d=[o.context,...u]:d=u;const f=await n.call(l,d);return a?f:zs(f)};throw new Tr(`Property not found: ${String(l)}`)}})}t.toService=i;function r(n){return n[0]==="o"&&n[1]==="n"&&dS(n.charCodeAt(2))}function s(n){return/^onDynamic/.test(n)&&dS(n.charCodeAt(9))}})(Oe||(Oe={}))}});function yI(t){return A_.test(t)}var A_,ui,Hi=g({"out-build/vs/base/common/uuid.js"(){"use strict";A_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,ui=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);const t=new Uint8Array(16),e=[];for(let i=0;i<256;i++)e.push(i.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=0,s="";return s+=e[t[r++]],s+=e[t[r++]],s+=e[t[r++]],s+=e[t[r++]],s+="-",s+=e[t[r++]],s+=e[t[r++]],s+="-",s+=e[t[r++]],s+=e[t[r++]],s+="-",s+=e[t[r++]],s+=e[t[r++]],s+="-",s+=e[t[r++]],s+=e[t[r++]],s+=e[t[r++]],s+=e[t[r++]],s+=e[t[r++]],s+=e[t[r++]],s}})()}});function Ys(){return cd||(cd=Y.alloc(0)),cd}function R_(t){switch(t){case 0:return"None";case 1:return"Regular";case 2:return"Control";case 3:return"Ack";case 5:return"Disconnect";case 6:return"ReplayRequest";case 7:return"PauseWriting";case 8:return"ResumeWriting";case 9:return"KeepAlive"}}var M_,cm,T_,cd,W_,L_,O_,sr,ld,ud,lm,F_,jo,N_,U_,$_,B_,j_=g({"out-build/vs/base/parts/ipc/common/ipc.net.js"(){"use strict";it(),q(),L(),Er(),(function(t){t.Created="created",t.Read="read",t.Write="write",t.Open="open",t.Error="error",t.Close="close",t.BrowserWebSocketBlobReceived="browserWebSocketBlobReceived",t.NodeEndReceived="nodeEndReceived",t.NodeEndSent="nodeEndSent",t.NodeDrainBegin="nodeDrainBegin",t.NodeDrainEnd="nodeDrainEnd",t.zlibInflateError="zlibInflateError",t.zlibInflateData="zlibInflateData",t.zlibInflateInitialWrite="zlibInflateInitialWrite",t.zlibInflateInitialFlushFired="zlibInflateInitialFlushFired",t.zlibInflateWrite="zlibInflateWrite",t.zlibInflateFlushFired="zlibInflateFlushFired",t.zlibDeflateError="zlibDeflateError",t.zlibDeflateData="zlibDeflateData",t.zlibDeflateWrite="zlibDeflateWrite",t.zlibDeflateFlushFired="zlibDeflateFlushFired",t.WebSocketNodeSocketWrite="webSocketNodeSocketWrite",t.WebSocketNodeSocketPeekedHeader="webSocketNodeSocketPeekedHeader",t.WebSocketNodeSocketReadHeader="webSocketNodeSocketReadHeader",t.WebSocketNodeSocketReadData="webSocketNodeSocketReadData",t.WebSocketNodeSocketUnmaskedData="webSocketNodeSocketUnmaskedData",t.WebSocketNodeSocketDrainBegin="webSocketNodeSocketDrainBegin",t.WebSocketNodeSocketDrainEnd="webSocketNodeSocketDrainEnd",t.ProtocolHeaderRead="protocolHeaderRead",t.ProtocolMessageRead="protocolMessageRead",t.ProtocolHeaderWrite="protocolHeaderWrite",t.ProtocolMessageWrite="protocolMessageWrite",t.ProtocolWrite="protocolWrite"})(M_||(M_={})),(function(t){t.enableDiagnostics=!1,t.records=[];const e=new WeakMap;let i=0;function r(n,o){if(!e.has(n)){const a=String(++i);e.set(n,a)}return e.get(n)}function s(n,o,a,c){if(!t.enableDiagnostics)return;const l=r(n,o);if(c instanceof Y||c instanceof Uint8Array||c instanceof ArrayBuffer||ArrayBuffer.isView(c)){const u=Y.alloc(c.byteLength);u.set(c),t.records.push({timestamp:Date.now(),id:l,label:o,type:a,buff:u})}else t.records.push({timestamp:Date.now(),id:l,label:o,type:a,data:c})}t.traceSocketEvent=s})(cm||(cm={})),(function(t){t[t.NodeSocketCloseEvent=0]="NodeSocketCloseEvent",t[t.WebSocketCloseEvent=1]="WebSocketCloseEvent"})(T_||(T_={})),cd=null,W_=class{get byteLength(){return this._totalLength}constructor(){this._chunks=[],this._totalLength=0}acceptChunk(t){this._chunks.push(t),this._totalLength+=t.byteLength}read(t){return this._read(t,!0)}peek(t){return this._read(t,!1)}_read(t,e){if(t===0)return Ys();if(t>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===t){const n=this._chunks[0];return e&&(this._chunks.shift(),this._totalLength-=t),n}if(this._chunks[0].byteLength>t){const n=this._chunks[0].slice(0,t);return e&&(this._chunks[0]=this._chunks[0].slice(t),this._totalLength-=t),n}const i=Y.alloc(t);let r=0,s=0;for(;t>0;){const n=this._chunks[s];if(n.byteLength>t){const o=n.slice(0,t);i.set(o,r),r+=t,e&&(this._chunks[s]=n.slice(t),this._totalLength-=t),t-=t}else i.set(n,r),r+=n.byteLength,e?(this._chunks.shift(),this._totalLength-=n.byteLength):s++,t-=n.byteLength}return i}},(function(t){t[t.None=0]="None",t[t.Regular=1]="Regular",t[t.Control=2]="Control",t[t.Ack=3]="Ack",t[t.Disconnect=5]="Disconnect",t[t.ReplayRequest=6]="ReplayRequest",t[t.Pause=7]="Pause",t[t.Resume=8]="Resume",t[t.KeepAlive=9]="KeepAlive"})(L_||(L_={})),(function(t){t[t.HeaderLength=13]="HeaderLength",t[t.AcknowledgeTime=2e3]="AcknowledgeTime",t[t.TimeoutTime=2e4]="TimeoutTime",t[t.ReconnectionGraceTime=108e5]="ReconnectionGraceTime",t[t.ReconnectionShortGraceTime=3e5]="ReconnectionShortGraceTime",t[t.KeepAliveSendTime=5e3]="KeepAliveSendTime"})(O_||(O_={})),sr=class{constructor(t,e,i,r){this.type=t,this.id=e,this.ack=i,this.data=r,this.writtenTime=0}get size(){return this.data.byteLength}},ld=class extends N{constructor(t){super(),this._onMessage=this._register(new D),this.onMessage=this._onMessage.event,this._state={readHead:!0,readLen:13,messageType:0,id:0,ack:0},this._socket=t,this._isDisposed=!1,this._incomingData=new W_,this._register(this._socket.onData(e=>this.acceptChunk(e))),this.lastReadTime=Date.now()}acceptChunk(t){if(!(!t||t.byteLength===0))for(this.lastReadTime=Date.now(),this._incomingData.acceptChunk(t);this._incomingData.byteLength>=this._state.readLen;){const e=this._incomingData.read(this._state.readLen);if(this._state.readHead)this._state.readHead=!1,this._state.readLen=e.readUInt32BE(9),this._state.messageType=e.readUInt8(0),this._state.id=e.readUInt32BE(1),this._state.ack=e.readUInt32BE(5),this._socket.traceSocketEvent("protocolHeaderRead",{messageType:R_(this._state.messageType),id:this._state.id,ack:this._state.ack,messageSize:this._state.readLen});else{const i=this._state.messageType,r=this._state.id,s=this._state.ack;if(this._state.readHead=!0,this._state.readLen=13,this._state.messageType=0,this._state.id=0,this._state.ack=0,this._socket.traceSocketEvent("protocolMessageRead",e),this._onMessage.fire(new sr(i,r,s,e)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}},ud=class{constructor(t){this._writeNowTimeout=null,this._isDisposed=!1,this._isPaused=!1,this._socket=t,this._data=[],this._totalLength=0,this.lastWriteTime=0}dispose(){try{this.flush()}catch{}this._isDisposed=!0}drain(){return this.flush(),this._socket.drain()}flush(){this._writeNow()}pause(){this._isPaused=!0}resume(){this._isPaused=!1,this._scheduleWriting()}write(t){if(this._isDisposed)return;t.writtenTime=Date.now(),this.lastWriteTime=Date.now();const e=Y.alloc(13);e.writeUInt8(t.type,0),e.writeUInt32BE(t.id,1),e.writeUInt32BE(t.ack,5),e.writeUInt32BE(t.data.byteLength,9),this._socket.traceSocketEvent("protocolHeaderWrite",{messageType:R_(t.type),id:t.id,ack:t.ack,messageSize:t.data.byteLength}),this._socket.traceSocketEvent("protocolMessageWrite",t.data),this._writeSoon(e,t.data)}_bufferAdd(t,e){const i=this._totalLength===0;return this._data.push(t,e),this._totalLength+=t.byteLength+e.byteLength,i}_bufferTake(){const t=Y.concat(this._data,this._totalLength);return this._data.length=0,this._totalLength=0,t}_writeSoon(t,e){this._bufferAdd(t,e)&&this._scheduleWriting()}_scheduleWriting(){this._writeNowTimeout||(this._writeNowTimeout=setTimeout(()=>{this._writeNowTimeout=null,this._writeNow()}))}_writeNow(){if(this._totalLength===0||this._isPaused)return;const t=this._bufferTake();this._socket.traceSocketEvent("protocolWrite",{byteLength:t.byteLength}),this._socket.write(t)}},lm=class extends N{constructor(t){super(),this._onMessage=new D,this.onMessage=this._onMessage.event,this._onDidDispose=new D,this.onDidDispose=this._onDidDispose.event,this._socket=t,this._socketWriter=this._register(new ud(this._socket)),this._socketReader=this._register(new ld(this._socket)),this._register(this._socketReader.onMessage(e=>{e.type===1&&this._onMessage.fire(e.data)})),this._register(this._socket.onClose(()=>this._onDidDispose.fire()))}drain(){return this._socketWriter.drain()}getSocket(){return this._socket}sendDisconnect(){}send(t){this._socketWriter.write(new sr(1,0,0,t))}},F_=class o8 extends am{static fromSocket(e,i){return new o8(new lm(e),i)}get onDidDispose(){return this.protocol.onDidDispose}constructor(e,i,r=null){super(e,i,r),this.protocol=e}dispose(){super.dispose();const e=this.protocol.getSocket();this.protocol.sendDisconnect(),this.protocol.dispose(),e.end()}},jo=class{constructor(){this._hasListeners=!1,this._isDeliveringMessages=!1,this._bufferedMessages=[],this._emitter=new D({onWillAddFirstListener:()=>{this._hasListeners=!0,queueMicrotask(()=>this._deliverMessages())},onDidRemoveLastListener:()=>{this._hasListeners=!1}}),this.event=this._emitter.event}_deliverMessages(){if(!this._isDeliveringMessages){for(this._isDeliveringMessages=!0;this._hasListeners&&this._bufferedMessages.length>0;)this._emitter.fire(this._bufferedMessages.shift());this._isDeliveringMessages=!1}}fire(t){this._hasListeners?this._bufferedMessages.length>0?this._bufferedMessages.push(t):this._emitter.fire(t):this._bufferedMessages.push(t)}flushBuffer(){this._bufferedMessages=[]}},N_=class{constructor(t){this.data=t,this.next=null}},U_=class{constructor(){this._first=null,this._last=null}length(){let t=0,e=this._first;for(;e;)e=e.next,t++;return t}peek(){return this._first?this._first.data:null}toArray(){const t=[];let e=0,i=this._first;for(;i;)t[e++]=i.data,i=i.next;return t}pop(){if(this._first){if(this._first===this._last){this._first=null,this._last=null;return}this._first=this._first.next}}push(t){const e=new N_(t);if(!this._first){this._first=e,this._last=e;return}this._last.next=e,this._last=e}},$_=class ss{static{this._HISTORY_LENGTH=10}static{this._INSTANCE=null}static getInstance(){return ss._INSTANCE||(ss._INSTANCE=new ss),ss._INSTANCE}constructor(){this.lastRuns=[];const e=Date.now();for(let i=0;i<ss._HISTORY_LENGTH;i++)this.lastRuns[i]=e-1e3*i;setInterval(()=>{for(let i=ss._HISTORY_LENGTH;i>=1;i--)this.lastRuns[i]=this.lastRuns[i-1];this.lastRuns[0]=Date.now()},1e3)}load(){const e=Date.now(),i=(1+ss._HISTORY_LENGTH)*1e3;let r=0;for(let s=0;s<ss._HISTORY_LENGTH;s++)e-this.lastRuns[s]<=i&&r++;return 1-r/ss._HISTORY_LENGTH}hasHighLoad(){return this.load()>=.5}},B_=class{get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}constructor(t){this._onControlMessage=new jo,this.onControlMessage=this._onControlMessage.event,this._onMessage=new jo,this.onMessage=this._onMessage.event,this._onDidDispose=new jo,this.onDidDispose=this._onDidDispose.event,this._onSocketClose=new jo,this.onSocketClose=this._onSocketClose.event,this._onSocketTimeout=new jo,this.onSocketTimeout=this._onSocketTimeout.event,this._loadEstimator=t.loadEstimator??$_.getInstance(),this._shouldSendKeepAlive=t.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new U_,this._outgoingMsgId=0,this._outgoingAckId=0,this._outgoingAckTimeout=null,this._incomingMsgId=0,this._incomingAckId=0,this._incomingMsgLastTime=0,this._incomingAckTimeout=null,this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socketDisposables=new ke,this._socket=t.socket,this._socketWriter=this._socketDisposables.add(new ud(this._socket)),this._socketReader=this._socketDisposables.add(new ld(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(e=>this._receiveMessage(e))),this._socketDisposables.add(this._socket.onClose(e=>this._onSocketClose.fire(e))),t.initialChunk&&this._socketReader.acceptChunk(t.initialChunk),this._shouldSendKeepAlive?this._keepAliveInterval=setInterval(()=>{this._sendKeepAlive()},5e3):this._keepAliveInterval=null}dispose(){this._outgoingAckTimeout&&(clearTimeout(this._outgoingAckTimeout),this._outgoingAckTimeout=null),this._incomingAckTimeout&&(clearTimeout(this._incomingAckTimeout),this._incomingAckTimeout=null),this._keepAliveInterval&&(clearInterval(this._keepAliveInterval),this._keepAliveInterval=null),this._socketDisposables.dispose()}drain(){return this._socketWriter.drain()}sendDisconnect(){if(!this._didSendDisconnect){this._didSendDisconnect=!0;const t=new sr(5,0,0,Ys());this._socketWriter.write(t),this._socketWriter.flush()}}sendPause(){const t=new sr(7,0,0,Ys());this._socketWriter.write(t)}sendResume(){const t=new sr(8,0,0,Ys());this._socketWriter.write(t)}pauseSocketWriting(){this._socketWriter.pause()}getSocket(){return this._socket}getMillisSinceLastIncomingData(){return Date.now()-this._socketReader.lastReadTime}beginAcceptReconnection(t,e){this._isReconnecting=!0,this._socketDisposables.dispose(),this._socketDisposables=new ke,this._onControlMessage.flushBuffer(),this._onSocketClose.flushBuffer(),this._onSocketTimeout.flushBuffer(),this._socket.dispose(),this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socket=t,this._socketWriter=this._socketDisposables.add(new ud(this._socket)),this._socketReader=this._socketDisposables.add(new ld(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(i=>this._receiveMessage(i))),this._socketDisposables.add(this._socket.onClose(i=>this._onSocketClose.fire(i))),this._socketReader.acceptChunk(e)}endAcceptReconnection(){this._isReconnecting=!1,this._incomingAckId=this._incomingMsgId;const t=new sr(3,0,this._incomingAckId,Ys());this._socketWriter.write(t);const e=this._outgoingUnackMsg.toArray();for(let i=0,r=e.length;i<r;i++)this._socketWriter.write(e[i]);this._recvAckCheck()}acceptDisconnect(){this._onDidDispose.fire()}_receiveMessage(t){if(t.ack>this._outgoingAckId){this._outgoingAckId=t.ack;do{const e=this._outgoingUnackMsg.peek();if(e&&e.id<=t.ack)this._outgoingUnackMsg.pop();else break}while(!0)}switch(t.type){case 0:break;case 1:{if(t.id>this._incomingMsgId)if(t.id!==this._incomingMsgId+1){const e=Date.now();e-this._lastReplayRequestTime>1e4&&(this._lastReplayRequestTime=e,this._socketWriter.write(new sr(6,0,0,Ys())))}else this._incomingMsgId=t.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(t.data);break}case 2:{this._onControlMessage.fire(t.data);break}case 3:break;case 5:{this._onDidDispose.fire();break}case 6:{const e=this._outgoingUnackMsg.toArray();for(let i=0,r=e.length;i<r;i++)this._socketWriter.write(e[i]);this._recvAckCheck();break}case 7:{this._socketWriter.pause();break}case 8:{this._socketWriter.resume();break}case 9:break}}readEntireBuffer(){return this._socketReader.readEntireBuffer()}flush(){this._socketWriter.flush()}send(t){const e=++this._outgoingMsgId;this._incomingAckId=this._incomingMsgId;const i=new sr(1,e,this._incomingAckId,t);this._outgoingUnackMsg.push(i),this._isReconnecting||(this._socketWriter.write(i),this._recvAckCheck())}sendControl(t){const e=new sr(2,0,0,t);this._socketWriter.write(e)}_sendAckCheck(){if(this._incomingMsgId<=this._incomingAckId||this._incomingAckTimeout)return;const t=Date.now()-this._incomingMsgLastTime;if(t>=2e3){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},2e3-t+5)}_recvAckCheck(){if(this._outgoingMsgId<=this._outgoingAckId||this._outgoingAckTimeout||this._isReconnecting)return;const t=this._outgoingUnackMsg.peek(),e=Date.now()-t.writtenTime,i=Date.now()-this._socketReader.lastReadTime,r=Date.now()-this._lastSocketTimeoutTime;if(e>=2e4&&i>=2e4&&r>=2e4&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:e,timeSinceLastReceivedSomeData:i});return}const s=Math.max(2e4-e,2e4-i,2e4-r,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},s)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;const t=new sr(3,0,this._incomingAckId,Ys());this._socketWriter.write(t)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;const t=new sr(9,0,this._incomingAckId,Ys());this._socketWriter.write(t)}}}});import{createHash as SI}from"crypto";import{createServer as _I,createConnection as bI}from"net";import"os";import"zlib";function EI(t,e,i){const s=SI("sha256").update(t).digest("hex").substr(0,8);if(process.platform==="win32")return`\\\\.\\pipe\\${s}-${i}-${e}-sock`;const n=i.substr(0,4),o=e.substr(0,6);let a;return process.platform!=="darwin"&&dd&&!process.env.VSCODE_PORTABLE?a=U(dd,`vscode-${s}-${n}-${o}.sock`):a=U(t,`${n}-${o}.sock`),kI(a),a}function kI(t){const e=z_[Po];typeof e=="number"&&t.length>=e&&console.warn(`WARNING: IPC handle "${t}" is longer than ${e} chars, try a shorter --user-data-dir`)}function PI(t){return new Promise((e,i)=>{const r=_I();r.on("error",i),r.listen(t,()=>{r.removeListener("error",i),e(new G_(r))})})}function xI(t,e){return new Promise((i,r)=>{const s=bI(t,()=>{s.removeListener("error",r),i(F_.fromSocket(new Oc(s,`ipc-client${e}`),e))});s.once("error",r)})}var H_,Oc,V_,q_,dd,z_,G_,um=g({"out-build/vs/base/parts/ipc/node/ipc.net.js"(){"use strict";it(),Re(),q(),L(),ye(),z(),Hi(),Er(),j_(),H_=3e4,Oc=class{traceSocketEvent(t,e){cm.traceSocketEvent(this.socket,this.debugLabel,t,e)}constructor(t,e=""){this._canWrite=!0,this.debugLabel=e,this.socket=t,this.traceSocketEvent("created",{type:"NodeSocket"}),this._errorListener=r=>{if(this.traceSocketEvent("error",{code:r?.code,message:r?.message}),r){if(r.code==="EPIPE")return;$t(r)}},this.socket.on("error",this._errorListener);let i;this._closeListener=r=>{this.traceSocketEvent("close",{hadError:r}),this._canWrite=!1,i&&clearTimeout(i)},this.socket.on("close",this._closeListener),this._endListener=()=>{this.traceSocketEvent("nodeEndReceived"),this._canWrite=!1,i=setTimeout(()=>t.destroy(),H_)},this.socket.on("end",this._endListener)}dispose(){this.socket.off("error",this._errorListener),this.socket.off("close",this._closeListener),this.socket.off("end",this._endListener),this.socket.destroy()}onData(t){const e=i=>{this.traceSocketEvent("read",i),t(Y.wrap(i))};return this.socket.on("data",e),{dispose:()=>this.socket.off("data",e)}}onClose(t){const e=i=>{t({type:0,hadError:i,error:void 0})};return this.socket.on("close",e),{dispose:()=>this.socket.off("close",e)}}onEnd(t){const e=()=>{t()};return this.socket.on("end",e),{dispose:()=>this.socket.off("end",e)}}write(t){if(!(this.socket.destroyed||!this._canWrite))try{this.traceSocketEvent("write",t),this.socket.write(t.buffer,e=>{if(e){if(e.code==="EPIPE")return;$t(e)}})}catch(e){if(e.code==="EPIPE")return;$t(e)}}end(){this.traceSocketEvent("nodeEndSent"),this.socket.end()}drain(){return this.traceSocketEvent("nodeDrainBegin"),new Promise((t,e)=>{if(this.socket.bufferSize===0){this.traceSocketEvent("nodeDrainEnd"),t();return}const i=()=>{this.socket.off("close",i),this.socket.off("end",i),this.socket.off("error",i),this.socket.off("timeout",i),this.socket.off("drain",i),this.traceSocketEvent("nodeDrainEnd"),t()};this.socket.on("close",i),this.socket.on("end",i),this.socket.on("error",i),this.socket.on("timeout",i),this.socket.on("drain",i)})}},(function(t){t[t.MinHeaderByteSize=2]="MinHeaderByteSize",t[t.MaxWebSocketMessageLength=262144]="MaxWebSocketMessageLength"})(V_||(V_={})),(function(t){t[t.PeekHeader=1]="PeekHeader",t[t.ReadHeader=2]="ReadHeader",t[t.ReadBody=3]="ReadBody",t[t.Fin=4]="Fin"})(q_||(q_={})),dd=process.env.XDG_RUNTIME_DIR,z_={2:107,1:103},G_=class a8 extends om{static toClientConnectionEvent(e){const i=P.fromNodeEventEmitter(e,"connection");return P.map(i,r=>({protocol:new lm(new Oc(r,"ipc-server-connection")),onDidClientDisconnect:P.once(P.fromNodeEventEmitter(r,"close"))}))}constructor(e){super(a8.toClientConnectionEvent(e)),this.server=e}dispose(){super.dispose(),this.server&&(this.server.close(),this.server=null)}}}});import Fc from"electron";var K_,We,nr=g({"out-build/vs/base/parts/ipc/electron-main/ipcMain.js"(){"use strict";Re(),Ie(),K_=class{constructor(){this.mapListenerToWrapper=new WeakMap}on(t,e){const i=(r,...s)=>{this.validateEvent(t,r)&&e(r,...s)};return this.mapListenerToWrapper.set(e,i),Fc.ipcMain.on(t,i),this}once(t,e){return Fc.ipcMain.once(t,(i,...r)=>{this.validateEvent(t,i)&&e(i,...r)}),this}handle(t,e){return Fc.ipcMain.handle(t,(i,...r)=>this.validateEvent(t,i)?e(i,...r):Promise.reject(`Invalid channel '${t}' or sender for ipcMain.handle() usage.`)),this}removeHandler(t){return Fc.ipcMain.removeHandler(t),this}removeListener(t,e){const i=this.mapListenerToWrapper.get(e);return i&&(Fc.ipcMain.removeListener(t,i),this.mapListenerToWrapper.delete(e)),this}validateEvent(t,e){if(!t||!t.startsWith("vscode:")&&!t.startsWith("cursor:"))return $t(`Refused to handle ipcMain event for channel '${t}' because the channel is unknown.`),!1;const i=e.senderFrame,r=i?.url;if(!r||r==="about:blank")return!0;let s="unknown";try{s=new URL(r).host}catch{return $t(`Refused to handle ipcMain event for channel '${t}' because of a malformed URL '${r}'.`),!1}return s!==gc?($t(`Refused to handle ipcMain event for channel '${t}' because of a bad origin of '${s}'.`),!1):i?.parent!==null?($t(`Refused to handle ipcMain event for channel '${t}' because sender of origin '${s}' is not a main frame.`),!1):!0}},We=new K_}}),Y_,J_,CI=g({"out-build/vs/base/parts/contextmenu/common/contextmenu.js"(){"use strict";Y_="vscode:contextmenu",J_="vscode:onCloseContextMenu"}});import{Menu as II,MenuItem as dm,BrowserWindow as DI}from"electron";function AI(){We.on(Y_,(t,e,i,r,s)=>{const n=Q_(t,r,i);let o=s?s.x:void 0,a=s?s.y:void 0;if(typeof o=="number"&&typeof a=="number")try{const c=DI.fromWebContents(t.sender);if(c&&c.contentView?.children){for(const l of c.contentView.children)if(l?.webContents?.id===t.sender.id&&typeof l.getBounds=="function"){const u=l.getBounds();o+=u.x,a+=u.y;break}}}catch{}n.popup({x:o,y:a,positioningItem:s?s.positioningItem:void 0,callback:()=>{n&&t.sender.send(J_,e)}})})}function Q_(t,e,i){const r=new II;return i.forEach(s=>{let n;s.type==="separator"?n=new dm({type:s.type}):Array.isArray(s.submenu)?n=new dm({submenu:Q_(t,e,s.submenu),label:s.label}):n=new dm({label:s.label,type:s.type,accelerator:s.accelerator,checked:s.checked,enabled:s.enabled,visible:s.visible,click:(o,a,c)=>t.sender.send(e,s.id,c)}),r.append(n)}),r}var RI=g({"out-build/vs/base/parts/contextmenu/electron-main/contextmenu.js"(){"use strict";nr(),CI()}}),X_,MI=g({"out-build/vs/base/parts/ipc/common/ipc.electron.js"(){"use strict";X_=class{constructor(t,e){this.sender=t,this.onMessage=e}send(t){try{this.sender.send("vscode:message",t.buffer)}catch{}}disconnect(){this.sender.send("vscode:disconnect",null)}}}});function Z_(t,e){const i=P.fromNodeEventEmitter(We,e,(s,n)=>({event:s,message:n})),r=P.filter(i,({event:s})=>s.sender.id===t);return P.map(r,({message:s})=>s&&Y.wrap(s))}var eb,TI=g({"out-build/vs/base/parts/ipc/electron-main/ipc.electron.js"(){"use strict";nr(),it(),q(),L(),Er(),MI(),eb=class $p extends om{static{this.Clients=new Map}static getOnDidClientConnect(){const e=P.fromNodeEventEmitter(We,"vscode:hello",({sender:i})=>i);return P.map(e,i=>{const r=i.id;$p.Clients.get(r)?.dispose();const n=new D;$p.Clients.set(r,me(()=>n.fire()));const o=Z_(r,"vscode:message"),a=P.any(P.signal(Z_(r,"vscode:disconnect")),n.event);return{protocol:new X_(i,o),onDidClientDisconnect:a}})}constructor(){super($p.getOnDidClientConnect())}}}}),tb,ib,WI=g({"out-build/vs/base/parts/ipc/common/ipc.mp.js"(){"use strict";it(),q(),Er(),tb=class{constructor(t){this.port=t,this.onMessage=P.fromDOMEventEmitter(this.port,"message",e=>e.data?Y.wrap(e.data):Y.alloc(0)),t.start()}send(t){this.port.postMessage(t.buffer)}disconnect(){this.port.close()}},ib=class extends am{constructor(t,e){const i=new tb(t);super(i,e),this.protocol=i}dispose(){this.protocol.disconnect(),super.dispose()}}}}),hm,rb=g({"out-build/vs/base/parts/ipc/electron-main/ipc.mp.js"(){"use strict";nr(),q(),Hi(),WI(),hm=class extends ib{constructor(t,e){super({addEventListener:(i,r)=>t.addListener(i,r),removeEventListener:(i,r)=>t.removeListener(i,r),postMessage:i=>t.postMessage(i),start:()=>t.start(),close:()=>t.close()},e)}}}});function Ur(t){return fm(t,0)}function fm(t,e){switch(typeof t){case"object":return t===null?Ss(349,e):Array.isArray(t)?OI(t,e):FI(t,e);case"string":return sb(t,e);case"boolean":return LI(t,e);case"number":return Ss(t,e);case"undefined":return Ss(937,e);default:return Ss(617,e)}}function Ss(t,e){return(e<<5)-e+t|0}function LI(t,e){return Ss(t?433:863,e)}function sb(t,e){e=Ss(149417,e);for(let i=0,r=t.length;i<r;i++)e=Ss(t.charCodeAt(i),e);return e}function OI(t,e){return e=Ss(104579,e),t.reduce((i,r)=>fm(r,i),e)}function FI(t,e){return e=Ss(181387,e),Object.keys(t).sort().reduce((i,r)=>(i=sb(r,i),fm(t[r],i)),e)}function pm(t,e,i=32){const r=i-e,s=~((1<<r)-1);return(t<<e|(s&t)>>>r)>>>0}function Nc(t,e=32){return t instanceof ArrayBuffer?Array.from(new Uint8Array(t)).map(i=>i.toString(16).padStart(2,"0")).join(""):(t>>>0).toString(16).padStart(e/4,"0")}var nb,NI,_s=g({"out-build/vs/base/common/hash.js"(){"use strict";it(),jt(),(function(t){t[t.BLOCK_SIZE=64]="BLOCK_SIZE",t[t.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(nb||(nb={})),NI=class c8{static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const i=e.length;if(i===0)return;const r=this._buff;let s=this._buffLen,n=this._leftoverHighSurrogate,o,a;for(n!==0?(o=n,a=-1,n=0):(o=e.charCodeAt(0),a=0);;){let c=o;if(Vx(o))if(a+1<i){const l=e.charCodeAt(a+1);hS(l)?(a++,c=qx(o,l)):c=65533}else{n=o;break}else hS(o)&&(c=65533);if(s=this._push(r,s,c),a++,a<i)o=e.charCodeAt(a);else break}this._buffLen=s,this._leftoverHighSurrogate=n}_push(e,i,r){return r<128?e[i++]=r:r<2048?(e[i++]=192|(r&1984)>>>6,e[i++]=128|(r&63)>>>0):r<65536?(e[i++]=224|(r&61440)>>>12,e[i++]=128|(r&4032)>>>6,e[i++]=128|(r&63)>>>0):(e[i++]=240|(r&1835008)>>>18,e[i++]=128|(r&258048)>>>12,e[i++]=128|(r&4032)>>>6,e[i++]=128|(r&63)>>>0),i>=64&&(this._step(),i-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),i}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Nc(this._h0)+Nc(this._h1)+Nc(this._h2)+Nc(this._h3)+Nc(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=c8._bigBlock32,i=this._buffDV;for(let d=0;d<64;d+=4)e.setUint32(d,i.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)e.setUint32(d,pm(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let r=this._h0,s=this._h1,n=this._h2,o=this._h3,a=this._h4,c,l,u;for(let d=0;d<80;d++)d<20?(c=s&n|~s&o,l=1518500249):d<40?(c=s^n^o,l=1859775393):d<60?(c=s&n|s&o|n&o,l=2400959708):(c=s^n^o,l=3395469782),u=pm(r,5)+c+a+l+e.getUint32(d*4,!1)&4294967295,a=o,o=n,n=pm(s,30),s=r,r=u;this._h0=this._h0+r&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+n&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}}}}),UI,hd,ob,ab,cb=g({"out-build/vs/platform/encryption/common/encryptionService.js"(){"use strict";G(),UI=j("encryptionService"),hd=j("encryptionMainService"),(function(t){t.kwallet="kwallet",t.kwallet5="kwallet5",t.gnomeLibsecret="gnome-libsecret",t.basic="basic"})(ob||(ob={})),(function(t){t.unknown="unknown",t.basicText="basic_text",t.gnomeAny="gnome_any",t.gnomeLibsecret="gnome_libsecret",t.gnomeKeyring="gnome_keyring",t.kwallet="kwallet",t.kwallet5="kwallet5",t.kwallet6="kwallet6",t.dplib="dpapi",t.keychainAccess="keychain_access"})(ab||(ab={}))}}),or,$r,xi=g({"out-build/vs/platform/environment/common/environment.js"(){"use strict";G(),or=j("environmentService"),$r=or}});function $I(t){return t.getFullYear()+"-"+String(t.getMonth()+1).padStart(2,"0")+"-"+String(t.getDate()).padStart(2,"0")+"T"+String(t.getHours()).padStart(2,"0")+":"+String(t.getMinutes()).padStart(2,"0")+":"+String(t.getSeconds()).padStart(2,"0")+"."+(t.getMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}var lb,ub,fd,BI,jI,HI,VI=g({"out-build/vs/base/common/date.js"(){"use strict";we(),z(),lb=60,ub=lb*60,fd=ub*24,BI=fd*7,jI=fd*30,HI=fd*365}});function qI(t,e){return gm(t["inspect-extensions"],t["inspect-brk-extensions"],5870,e,t.debugId,t.extensionEnvironment)}function gm(t,e,i,r,s,n){const a=Number(e||t)||(r?null:i),c=a?!!e:!1;let l;if(n)try{l=JSON.parse(n)}catch{}return{port:a,break:c,debugId:s,env:l}}var mm,Be,zI=g({"out-build/vs/platform/environment/common/environmentService.js"(){"use strict";VI(),An(),Ie(),ye(),Wr(),gt(),re(),mm=/^([^.]+\..+)[:=](.+)$/,Be=class{get appRoot(){return pt(Ct.asFileUri("").fsPath)}get userHome(){return x.file(this.paths.homeDir)}get userDataPath(){return this.paths.userDataDir}get appSettingsHome(){return x.file(U(this.userDataPath,"User"))}get tmpDir(){return x.file(this.paths.tmpDir)}get cacheHome(){return x.file(this.userDataPath)}get stateResource(){return pe(this.appSettingsHome,"globalStorage","storage.json")}get userRoamingDataHome(){return this.appSettingsHome.with({scheme:T.vscodeUserData})}get userDataSyncHome(){return pe(this.appSettingsHome,"sync")}get logsHome(){if(!this.args.logsPath){const t=$I(new Date).replace(/-|:|\.\d+Z$/g,"");this.args.logsPath=U(this.userDataPath,"logs",t)}return x.file(this.args.logsPath)}get sync(){return this.args.sync}get machineSettingsResource(){return pe(x.file(U(this.userDataPath,"Machine")),"settings.json")}get workspaceStorageHome(){return pe(this.appSettingsHome,"workspaceStorage")}get localHistoryHome(){return pe(this.appSettingsHome,"History")}get keyboardLayoutResource(){return pe(this.userRoamingDataHome,"keyboardLayout.json")}get argvResource(){const t=er.VSCODE_PORTABLE;return t?x.file(U(t,"argv.json")):pe(this.userHome,this.productService.dataFolderName,"argv.json")}get isExtensionDevelopment(){return!!this.args.extensionDevelopmentPath}get untitledWorkspacesHome(){return x.file(U(this.userDataPath,"Workspaces"))}get builtinExtensionsPath(){const t=this.args["builtin-extensions-dir"];return t?Jt(t):bi(U(Ct.asFileUri("").fsPath,"..","extensions"))}get extensionsDownloadLocation(){const t=this.args["extensions-download-dir"];return t?x.file(Jt(t)):x.file(U(this.userDataPath,"CachedExtensionVSIXs"))}get extensionsPath(){const t=this.args["extensions-dir"];if(t)return Jt(t);const e=er.VSCODE_EXTENSIONS;if(e)return e;const i=er.VSCODE_PORTABLE;return i?U(i,"extensions"):pe(this.userHome,this.productService.dataFolderName,"extensions").fsPath}get extensionDevelopmentLocationURI(){const t=this.args.extensionDevelopmentPath;if(Array.isArray(t))return t.map(e=>/^[^:/?#]+?:\/\//.test(e)?x.parse(e):x.file(bi(e)))}get extensionDevelopmentKind(){return this.args.extensionDevelopmentKind?.map(t=>t==="ui"||t==="workspace"||t==="web"?t:"workspace")}get extensionTestsLocationURI(){const t=this.args.extensionTestsPath;if(t)return/^[^:/?#]+?:\/\//.test(t)?x.parse(t):x.file(bi(t))}get disableExtensions(){if(this.args["disable-extensions"])return!0;const t=this.args["disable-extension"];if(t){if(typeof t=="string")return[t];if(Array.isArray(t)&&t.length>0)return t}return!1}get debugExtensionHost(){return qI(this.args,this.isBuilt)}get debugRenderer(){return!!this.args.debugRenderer}get isBuilt(){return!er.VSCODE_DEV}get verbose(){return!!this.args.verbose}get logLevel(){return this.args.log?.find(t=>!mm.test(t))}get extensionLogLevel(){const t=[];for(const e of this.args.log||[]){const i=mm.exec(e);i&&i[1]&&i[2]&&t.push([i[1],i[2]])}return t.length?t:void 0}get serviceMachineIdResource(){return pe(x.file(this.userDataPath),"machineid")}get crashReporterId(){return this.args["crash-reporter-id"]}get crashReporterDirectory(){return this.args["crash-reporter-directory"]}get disableTelemetry(){return!!this.args["disable-telemetry"]}get disableWorkspaceTrust(){return!!this.args["disable-workspace-trust"]}get useInMemorySecretStorage(){return!!this.args["use-inmemory-secretstorage"]}get policyFile(){if(this.args["__enable-file-policy"]){const t=er.VSCODE_PORTABLE;return t?x.file(U(t,"policy.json")):pe(this.userHome,this.productService.dataFolderName,"policy.json")}}get editSessionId(){return this.args.editSessionId}get continueOn(){return this.args.continueOn}set continueOn(t){this.args.continueOn=t}get args(){return this._args}constructor(t,e,i){this._args=t,this.paths=e,this.productService=i}},__decorate([he],Be.prototype,"appRoot",null),__decorate([he],Be.prototype,"userHome",null),__decorate([he],Be.prototype,"userDataPath",null),__decorate([he],Be.prototype,"appSettingsHome",null),__decorate([he],Be.prototype,"tmpDir",null),__decorate([he],Be.prototype,"cacheHome",null),__decorate([he],Be.prototype,"stateResource",null),__decorate([he],Be.prototype,"userRoamingDataHome",null),__decorate([he],Be.prototype,"userDataSyncHome",null),__decorate([he],Be.prototype,"sync",null),__decorate([he],Be.prototype,"machineSettingsResource",null),__decorate([he],Be.prototype,"workspaceStorageHome",null),__decorate([he],Be.prototype,"localHistoryHome",null),__decorate([he],Be.prototype,"keyboardLayoutResource",null),__decorate([he],Be.prototype,"argvResource",null),__decorate([he],Be.prototype,"isExtensionDevelopment",null),__decorate([he],Be.prototype,"untitledWorkspacesHome",null),__decorate([he],Be.prototype,"builtinExtensionsPath",null),__decorate([he],Be.prototype,"extensionsPath",null),__decorate([he],Be.prototype,"extensionDevelopmentLocationURI",null),__decorate([he],Be.prototype,"extensionDevelopmentKind",null),__decorate([he],Be.prototype,"extensionTestsLocationURI",null),__decorate([he],Be.prototype,"debugExtensionHost",null),__decorate([he],Be.prototype,"logLevel",null),__decorate([he],Be.prototype,"extensionLogLevel",null),__decorate([he],Be.prototype,"serviceMachineIdResource",null),__decorate([he],Be.prototype,"disableTelemetry",null),__decorate([he],Be.prototype,"disableWorkspaceTrust",null),__decorate([he],Be.prototype,"useInMemorySecretStorage",null),__decorate([he],Be.prototype,"policyFile",null)}});import{homedir as GI,tmpdir as KI}from"os";function YI(t,e){return gm(t["inspect-ptyhost"],t["inspect-brk-ptyhost"],5877,e,t.extensionEnvironment)}function JI(t,e){return gm(t["inspect-sharedprocess"],t["inspect-brk-sharedprocess"],5879,e,t.extensionEnvironment)}var db,vm=g({"out-build/vs/platform/environment/node/environmentService.js"(){"use strict";zI(),G0(),db=class extends Be{constructor(t,e){super(t,{homeDir:GI(),tmpDir:KI(),userDataDir:q0(t,e.nameShort)},e)}}}}),st,bs,ct=g({"out-build/vs/platform/environment/electron-main/environmentMainService.js"(){"use strict";An(),ye(),z(),um(),xi(),vm(),G(),st=or,bs=class extends db{constructor(){super(...arguments),this._snapEnv={}}get backupHome(){return U(this.userDataPath,"Backups")}get mainIPCHandle(){return EI(this.userDataPath,"main",this.productService.version)}get mainLockfile(){return U(this.userDataPath,"code.lock")}get disableUpdates(){return!!this.args["disable-updates"]}get crossOriginIsolated(){return!!this.args["enable-coi"]}get codeCachePath(){return process.env.VSCODE_CODE_CACHE_PATH||void 0}get useCodeCache(){return!!this.codeCachePath}unsetSnapExportedVariables(){if(Pe){for(const t in process.env)if(t.endsWith("_VSCODE_SNAP_ORIG")){const e=t.slice(0,-17);if(this._snapEnv[e])continue;process.env[e]&&(this._snapEnv[e]=process.env[e]),process.env[t]?process.env[e]=process.env[t]:delete process.env[e]}}}restoreSnapExportedVariables(){if(Pe)for(const t in this._snapEnv)process.env[t]=this._snapEnv[t],delete this._snapEnv[t]}},__decorate([he],bs.prototype,"backupHome",null),__decorate([he],bs.prototype,"mainIPCHandle",null),__decorate([he],bs.prototype,"mainLockfile",null),__decorate([he],bs.prototype,"disableUpdates",null),__decorate([he],bs.prototype,"crossOriginIsolated",null),__decorate([he],bs.prototype,"codeCachePath",null),__decorate([he],bs.prototype,"useCodeCache",null)}});function wm(...t){switch(t.length){case 1:return w(1832,null,t[0]);case 2:return w(1833,null,t[0],t[1]);case 3:return w(1834,null,t[0],t[1],t[2]);default:return}}var hb,fb,pb,Ho,QI=g({"out-build/vs/platform/contextkey/common/scanner.js"(){"use strict";Re(),we(),(function(t){t[t.LParen=0]="LParen",t[t.RParen=1]="RParen",t[t.Neg=2]="Neg",t[t.Eq=3]="Eq",t[t.NotEq=4]="NotEq",t[t.Lt=5]="Lt",t[t.LtEq=6]="LtEq",t[t.Gt=7]="Gt",t[t.GtEq=8]="GtEq",t[t.RegexOp=9]="RegexOp",t[t.RegexStr=10]="RegexStr",t[t.True=11]="True",t[t.False=12]="False",t[t.In=13]="In",t[t.Not=14]="Not",t[t.And=15]="And",t[t.Or=16]="Or",t[t.Str=17]="Str",t[t.QuotedStr=18]="QuotedStr",t[t.Error=19]="Error",t[t.EOF=20]="EOF"})(hb||(hb={})),fb=w(1835,null),pb=w(1836,null),Ho=class x0{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw yy(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set(["i","g","s","m","y","u"].map(e=>e.charCodeAt(0)))}static{this._keywords=new Map([["not",14],["in",13],["false",12],["true",11]])}get errors(){return this._errors}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const i=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:i})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const i=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:i})}else this._match(126)?this._addToken(9):this._error(wm("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(wm("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(wm("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const i=this._start,r=this._input.substring(this._start,this._current),s={type:19,offset:this._start,lexeme:r};this._errors.push({offset:i,lexeme:r,additionalInfo:e}),this._tokens.push(s)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const i=this._input.substring(this._start,this._current),r=x0._keywords.get(i);r?this._addToken(r):this._tokens.push({type:17,lexeme:i,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(fb);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,i=!1,r=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(pb);return}const n=this._input.charCodeAt(e);if(i)i=!1;else if(n===47&&!r){e++;break}else n===91?r=!0:n===92?i=!0:n===93&&(r=!1);e++}for(;e<this._input.length&&x0._regexFlags.has(this._input.charCodeAt(e));)e++;this._current=e;const s=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:s,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}}}});function XI(t,e){return Vo.has(t)&&(console.warn(`A context key function with id '${t}' is already registered. Function collisions can lead to unexpected behavior.`),Vo.delete(t)),Vo.set(t,e),{dispose:()=>{Vo.delete(t)}}}function gb(t){return Vo.get(t)}function Uc(t,e){return t.cmp(e)}function pd(t,e){if(typeof t=="string"){const i=parseFloat(t);isNaN(i)||(t=i)}return typeof t=="string"||typeof t=="number"?e(t):di.INSTANCE}function mb(t){let e=null;for(let i=0,r=t.length;i<r;i++){const s=t[i].substituteConstants();if(t[i]!==s&&e===null){e=[];for(let n=0;n<i;n++)e[n]=t[n]}e!==null&&(e[i]=s)}return e===null?t:e}function ym(t,e){return t<e?-1:t>e?1:0}function Mn(t,e,i,r){return t<i?-1:t>i?1:e<r?-1:e>r?1:0}function vb(t){return t.type===9?t.expr:[t]}var Mt,Vo,wb,yb,Sb,_b,bb,Eb,Sm,kb,Pb,xb,Cb,Ib,Xt,gd,di,Ci,qo,md,_m,bm,vd,zo,$c,wd,yd,Sd,_d,Db,Em,bd,km,ZI,Ab=g({"out-build/vs/platform/contextkey/common/contextkey.js"(){"use strict";z(),jt(),QI(),G(),we(),Re(),Mt=new Map,Mt.set("false",!1),Mt.set("true",!0),Mt.set("isMac",O),Mt.set("isLinux",Pe),Mt.set("isWindows",B),Mt.set("isWeb",us),Mt.set("isMacNative",O&&!us),Mt.set("isEdge",vy),Mt.set("isFirefox",gy),Mt.set("isChrome",dg),Mt.set("isSafari",my),Vo=new Map,wb=Object.prototype.hasOwnProperty,(function(t){t[t.False=0]="False",t[t.True=1]="True",t[t.Defined=2]="Defined",t[t.Not=3]="Not",t[t.Equals=4]="Equals",t[t.NotEquals=5]="NotEquals",t[t.And=6]="And",t[t.Regex=7]="Regex",t[t.NotRegex=8]="NotRegex",t[t.Or=9]="Or",t[t.In=10]="In",t[t.NotIn=11]="NotIn",t[t.Greater=12]="Greater",t[t.GreaterEquals=13]="GreaterEquals",t[t.Smaller=14]="Smaller",t[t.SmallerEquals=15]="SmallerEquals",t[t.Function=16]="Function"})(yb||(yb={})),Sb={regexParsingWithErrorRecovery:!0},_b=w(1812,null),bb=w(1813,null),Eb=w(1814,null),Sm=w(1815,null),kb=w(1816,null),Pb=w(1817,null),xb=w(1818,null),Cb=w(1819,null),Ib=class wu{static{this._parseError=new Error}get lexingErrors(){return this._scanner.errors}get parsingErrors(){return this._parsingErrors}constructor(e=Sb){this._config=e,this._scanner=new Ho,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:_b,offset:0,lexeme:"",additionalInfo:bb});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const i=this._expr();if(!this._isAtEnd()){const r=this._peek(),s=r.type===17?Pb:void 0;throw this._parsingErrors.push({message:kb,offset:r.offset,lexeme:Ho.getLexeme(r),additionalInfo:s}),wu._parseError}return i}catch(i){if(i!==wu._parseError)throw i;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const i=this._and();e.push(i)}return e.length===1?e[0]:Xt.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const i=this._term();e.push(i)}return e.length===1?e[0]:Xt.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),di.INSTANCE;case 12:return this._advance(),Ci.INSTANCE;case 0:{this._advance();const i=this._expr();return this._consume(1,Sm),i?.negate()}case 17:return this._advance(),zo.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),Xt.true();case 12:return this._advance(),Xt.false();case 0:{this._advance();const i=this._expr();return this._consume(1,Sm),i}case 17:{if(e.lexeme.startsWith("@")){this._advance();const s=e.lexeme.substring(1);if(s.startsWith("!")){const o=s.substring(1),a=gb(o);if(a)return gd.createWithoutRegistration(s,()=>!a())}const n=gb(s)||(()=>!1);return gd.createWithoutRegistration(s,n)}const i=e.lexeme;if(this._advance(),this._matchOne(9)){const s=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),s.type!==10)throw this._errExpectedButGot("REGEX",s);const n=s.lexeme,o=n.lastIndexOf("/"),a=o===n.length-1?void 0:this._removeFlagsGY(n.substring(o+1));let c;try{c=new RegExp(n.substring(1,o),a)}catch{throw this._errExpectedButGot("REGEX",s)}return _d.create(i,c)}switch(s.type){case 10:case 19:{const n=[s.lexeme];this._advance();let o=this._peek(),a=0;for(let f=0;f<s.lexeme.length;f++)s.lexeme.charCodeAt(f)===40?a++:s.lexeme.charCodeAt(f)===41&&a--;for(;!this._isAtEnd()&&o.type!==15&&o.type!==16;){switch(o.type){case 0:a++;break;case 1:a--;break;case 10:case 18:for(let f=0;f<o.lexeme.length;f++)o.lexeme.charCodeAt(f)===40?a++:s.lexeme.charCodeAt(f)===41&&a--}if(a<0)break;n.push(Ho.getLexeme(o)),this._advance(),o=this._peek()}const c=n.join(""),l=c.lastIndexOf("/"),u=l===c.length-1?void 0:this._removeFlagsGY(c.substring(l+1));let d;try{d=new RegExp(c.substring(1,l),u)}catch{throw this._errExpectedButGot("REGEX",s)}return Xt.regex(i,d)}case 18:{const n=s.lexeme;this._advance();let o=null;if(!Hx(n)){const a=n.indexOf("/"),c=n.lastIndexOf("/");if(a!==c&&a>=0){const l=n.slice(a+1,c),u=n[c+1]==="i"?"i":"";try{o=new RegExp(l,u)}catch{throw this._errExpectedButGot("REGEX",s)}}}if(o===null)throw this._errExpectedButGot("REGEX",s);return _d.create(i,o)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Eb);const s=this._value();return Xt.notIn(i,s)}switch(this._peek().type){case 3:{this._advance();const s=this._value();if(this._previous().type===18)return Xt.equals(i,s);switch(s){case"true":return Xt.has(i);case"false":return Xt.not(i);default:return Xt.equals(i,s)}}case 4:{this._advance();const s=this._value();if(this._previous().type===18)return Xt.notEquals(i,s);switch(s){case"true":return Xt.not(i);case"false":return Xt.has(i);default:return Xt.notEquals(i,s)}}case 5:return this._advance(),yd.create(i,this._value());case 6:return this._advance(),Sd.create(i,this._value());case 7:return this._advance(),$c.create(i,this._value());case 8:return this._advance(),wd.create(i,this._value());case 13:return this._advance(),Xt.in(i,this._value());default:return Xt.has(i)}}case 20:throw this._parsingErrors.push({message:xb,offset:e.offset,lexeme:"",additionalInfo:Cb}),wu._parseError;default:throw this._errExpectedButGot(`true | false | KEY
|
|
| KEY '=~' REGEX
|
|
| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,i){if(this._check(e))return this._advance();throw this._errExpectedButGot(i,this._peek())}_errExpectedButGot(e,i,r){const s=w(1820,null,e,Ho.getLexeme(i)),n=i.offset,o=Ho.getLexeme(i);return this._parsingErrors.push({message:s,offset:n,lexeme:o,additionalInfo:r}),wu._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}},Xt=class{static false(){return di.INSTANCE}static true(){return Ci.INSTANCE}static has(t){return qo.create(t)}static equals(t,e){return md.create(t,e)}static notEquals(t,e){return vd.create(t,e)}static regex(t,e){return _d.create(t,e)}static in(t,e){return _m.create(t,e)}static notIn(t,e){return bm.create(t,e)}static not(t){return zo.create(t)}static and(...t){return Em.create(t,null,!0)}static or(...t){return bd.create(t,null,!0)}static greater(t,e){return $c.create(t,e)}static greaterEquals(t,e){return wd.create(t,e)}static smaller(t,e){return yd.create(t,e)}static smallerEquals(t,e){return Sd.create(t,e)}static function(t,e){return gd.create(t,e)}static{this._parser=new Ib({regexParsingWithErrorRecovery:!1})}static deserialize(t){return t==null?void 0:this._parser.parse(t)}},gd=class Bp{static create(e,i){return XI(e,i),new Bp(e,i)}static createWithoutRegistration(e,i){return new Bp(e,i)}constructor(e,i){this.type=16,this.id=e,this.fn=i}cmp(e){return e.type!==this.type?this.type-e.type:ym(this.id,e.id)}equals(e){return e.type===this.type&&this.id===e.id}substituteConstants(){return this}evaluate(e){return this.fn()}serialize(){return`@${this.id}`}keys(){return[]}map(e){return this}negate(){return Bp.createWithoutRegistration(`!${this.id}`,()=>!this.fn())}},di=class l8{static{this.INSTANCE=new l8}constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}map(e){return this}negate(){return Ci.INSTANCE}},Ci=class u8{static{this.INSTANCE=new u8}constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}map(e){return this}negate(){return di.INSTANCE}},qo=class d8{static create(e,i=null){const r=Mt.get(e);return typeof r=="boolean"?r?Ci.INSTANCE:di.INSTANCE:new d8(e,i)}constructor(e,i){this.key=e,this.negated=i,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:ym(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Mt.get(this.key);return typeof e=="boolean"?e?Ci.INSTANCE:di.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}map(e){return e.mapDefined(this.key)}negate(){return this.negated||(this.negated=zo.create(this.key,this)),this.negated}},md=class h8{static create(e,i,r=null){if(typeof i=="boolean")return i?qo.create(e,r):zo.create(e,r);const s=Mt.get(e);return typeof s=="boolean"?i===(s?"true":"false")?Ci.INSTANCE:di.INSTANCE:new h8(e,i,r)}constructor(e,i,r){this.key=e,this.value=i,this.negated=r,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Mn(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Mt.get(this.key);if(typeof e=="boolean"){const i=e?"true":"false";return this.value===i?Ci.INSTANCE:di.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}map(e){return e.mapEquals(this.key,this.value)}negate(){return this.negated||(this.negated=vd.create(this.key,this.value,this)),this.negated}},_m=class f8{static create(e,i){return new f8(e,i)}constructor(e,i){this.key=e,this.valueKey=i,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Mn(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const i=e.getValue(this.valueKey),r=e.getValue(this.key);return Array.isArray(i)?i.includes(r):typeof r=="string"&&typeof i=="object"&&i!==null?wb.call(i,r):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}map(e){return e.mapIn(this.key,this.valueKey)}negate(){return this.negated||(this.negated=bm.create(this.key,this.valueKey)),this.negated}},bm=class p8{static create(e,i){return new p8(e,i)}constructor(e,i){this.key=e,this.valueKey=i,this.type=11,this._negated=_m.create(e,i)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}map(e){return e.mapNotIn(this.key,this.valueKey)}negate(){return this._negated}},vd=class g8{static create(e,i,r=null){if(typeof i=="boolean")return i?zo.create(e,r):qo.create(e,r);const s=Mt.get(e);return typeof s=="boolean"?i===(s?"true":"false")?di.INSTANCE:Ci.INSTANCE:new g8(e,i,r)}constructor(e,i,r){this.key=e,this.value=i,this.negated=r,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Mn(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Mt.get(this.key);if(typeof e=="boolean"){const i=e?"true":"false";return this.value===i?di.INSTANCE:Ci.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}map(e){return e.mapNotEquals(this.key,this.value)}negate(){return this.negated||(this.negated=md.create(this.key,this.value,this)),this.negated}},zo=class m8{static create(e,i=null){const r=Mt.get(e);return typeof r=="boolean"?r?di.INSTANCE:Ci.INSTANCE:new m8(e,i)}constructor(e,i){this.key=e,this.negated=i,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:ym(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Mt.get(this.key);return typeof e=="boolean"?e?di.INSTANCE:Ci.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}map(e){return e.mapNot(this.key)}negate(){return this.negated||(this.negated=qo.create(this.key,this)),this.negated}},$c=class v8{static create(e,i,r=null){return pd(i,s=>new v8(e,s,r))}constructor(e,i,r){this.key=e,this.value=i,this.negated=r,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Mn(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}map(e){return e.mapGreater(this.key,this.value)}negate(){return this.negated||(this.negated=Sd.create(this.key,this.value,this)),this.negated}},wd=class w8{static create(e,i,r=null){return pd(i,s=>new w8(e,s,r))}constructor(e,i,r){this.key=e,this.value=i,this.negated=r,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Mn(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}map(e){return e.mapGreaterEquals(this.key,this.value)}negate(){return this.negated||(this.negated=yd.create(this.key,this.value,this)),this.negated}},yd=class y8{static create(e,i,r=null){return pd(i,s=>new y8(e,s,r))}constructor(e,i,r){this.key=e,this.value=i,this.negated=r,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Mn(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}map(e){return e.mapSmaller(this.key,this.value)}negate(){return this.negated||(this.negated=wd.create(this.key,this.value,this)),this.negated}},Sd=class S8{static create(e,i,r=null){return pd(i,s=>new S8(e,s,r))}constructor(e,i,r){this.key=e,this.value=i,this.negated=r,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Mn(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}map(e){return e.mapSmallerEquals(this.key,this.value)}negate(){return this.negated||(this.negated=$c.create(this.key,this.value,this)),this.negated}},_d=class _8{static create(e,i){return new _8(e,i)}constructor(e,i){this.key=e,this.regexp=i,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const i=this.regexp?this.regexp.source:"",r=e.regexp?e.regexp.source:"";return i<r?-1:i>r?1:0}equals(e){if(e.type===this.type){const i=this.regexp?this.regexp.source:"",r=e.regexp?e.regexp.source:"";return this.key===e.key&&i===r}return!1}substituteConstants(){return this}evaluate(e){const i=e.getValue(this.key);return this.regexp?this.regexp.test(i):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}map(e){return e.mapRegex(this.key,this.regexp)}negate(){return this.negated||(this.negated=Db.create(this)),this.negated}},Db=class C0{static create(e){return new C0(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}map(e){return new C0(this._actual.map(e))}negate(){return this._actual}},Em=class Va{static create(e,i,r){return Va._normalizeArr(e,i,r)}constructor(e,i){this.expr=e,this.negated=i,this.type=6}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let i=0,r=this.expr.length;i<r;i++){const s=Uc(this.expr[i],e.expr[i]);if(s!==0)return s}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let i=0,r=this.expr.length;i<r;i++)if(!this.expr[i].equals(e.expr[i]))return!1;return!0}return!1}substituteConstants(){const e=mb(this.expr);return e===this.expr?this:Va.create(e,this.negated,!1)}evaluate(e){for(let i=0,r=this.expr.length;i<r;i++)if(!this.expr[i].evaluate(e))return!1;return!0}static _normalizeArr(e,i,r){const s=[];let n=!1;for(const o of e)if(o){if(o.type===1){n=!0;continue}if(o.type===0)return di.INSTANCE;if(o.type===6){s.push(...o.expr);continue}s.push(o)}if(s.length===0&&n)return Ci.INSTANCE;if(s.length!==0){if(s.length===1)return s[0];s.sort(Uc);for(let o=1;o<s.length;o++)s[o-1].equals(s[o])&&(s.splice(o,1),o--);if(s.length===1)return s[0];for(;s.length>1;){const o=s[s.length-1];if(o.type!==9)break;s.pop();const a=s.pop(),c=s.length===0,l=bd.create(o.expr.map(u=>Va.create([u,a],null,r)),null,c);l&&(s.push(l),s.sort(Uc))}if(s.length===1)return s[0];if(r){for(let o=0;o<s.length;o++)for(let a=o+1;a<s.length;a++)if(s[o].negate().equals(s[a]))return di.INSTANCE;if(s.length===1)return s[0]}return new Va(s,i)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){const e=[];for(const i of this.expr)e.push(...i.keys());return e}map(e){return new Va(this.expr.map(i=>i.map(e)),null)}negate(){if(!this.negated){const e=[];for(const i of this.expr)e.push(i.negate());this.negated=bd.create(e,this,!0)}return this.negated}},bd=class mo{static create(e,i,r){return mo._normalizeArr(e,i,r)}constructor(e,i){this.expr=e,this.negated=i,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let i=0,r=this.expr.length;i<r;i++){const s=Uc(this.expr[i],e.expr[i]);if(s!==0)return s}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let i=0,r=this.expr.length;i<r;i++)if(!this.expr[i].equals(e.expr[i]))return!1;return!0}return!1}substituteConstants(){const e=mb(this.expr);return e===this.expr?this:mo.create(e,this.negated,!1)}evaluate(e){for(let i=0,r=this.expr.length;i<r;i++)if(this.expr[i].evaluate(e))return!0;return!1}static _normalizeArr(e,i,r){let s=[],n=!1;if(e){for(let o=0,a=e.length;o<a;o++){const c=e[o];if(c){if(c.type===0){n=!0;continue}if(c.type===1)return Ci.INSTANCE;if(c.type===9){s=s.concat(c.expr);continue}s.push(c)}}if(s.length===0&&n)return di.INSTANCE;s.sort(Uc)}if(s.length!==0){if(s.length===1)return s[0];for(let o=1;o<s.length;o++)s[o-1].equals(s[o])&&(s.splice(o,1),o--);if(s.length===1)return s[0];if(r){for(let o=0;o<s.length;o++)for(let a=o+1;a<s.length;a++)if(s[o].negate().equals(s[a]))return Ci.INSTANCE;if(s.length===1)return s[0]}return new mo(s,i)}}serialize(){return this.expr.map(e=>e.serialize()).join(" || ")}keys(){const e=[];for(const i of this.expr)e.push(...i.keys());return e}map(e){return new mo(this.expr.map(i=>i.map(e)),null)}negate(){if(!this.negated){const e=[];for(const i of this.expr)e.push(i.negate());for(;e.length>1;){const i=e.shift(),r=e.shift(),s=[];for(const n of vb(i))for(const o of vb(r))s.push(Em.create([n,o],null,!1));e.unshift(mo.create(s,null,!1))}this.negated=mo.create(e,this,!0)}return this.negated}},km=class jp extends qo{static{this._info=[]}static all(){return jp._info.values()}constructor(e,i,r){super(e,null),this._defaultValue=i,typeof r=="object"?jp._info.push({...r,key:e}):r!==!0&&jp._info.push({key:e,description:r,type:i!=null?typeof i:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return md.create(this.key,e)}notEqualsTo(e){return vd.create(this.key,e)}greater(e){return $c.create(this.key,e)}},ZI=j("contextKeyService")}});function Br(){return new Date().toISOString()}function Rb(t){return Ou(t)}function e3(t,e){return t!==X.Off&&t<=e}function Pm(t,e,i){switch(e){case X.Trace:t.trace(i);break;case X.Debug:t.debug(i);break;case X.Info:t.info(i);break;case X.Warning:t.warn(i);break;case X.Error:t.error(i);break;case X.Off:break;default:throw new Error(`Invalid log level ${e}`)}}function Go(t,e=!1){let i="";for(let r=0;r<t.length;r++){let s=t[r];if(s instanceof Error&&(s=rr(s,e)),typeof s=="object")try{s=JSON.stringify(s)}catch{}i+=(r>0?" ":"")+s}return i}function t3(t){if(t.verbose)return X.Trace;if(typeof t.logLevel=="string"){const e=r3(t.logLevel.toLowerCase());if(e!==void 0)return e}return jc}function i3(t){switch(t){case X.Trace:return"trace";case X.Debug:return"debug";case X.Info:return"info";case X.Warning:return"warn";case X.Error:return"error";case X.Off:return"off"}}function r3(t){switch(t){case"trace":return X.Trace;case"debug":return X.Debug;case"info":return X.Info;case"warn":return X.Warning;case"error":return X.Error;case"critical":return X.Error;case"off":return X.Off}}var V,Bc,X,jc,Ed,xm,Mb,Tb,Wb,Lb,Ob,s3,K=g({"out-build/vs/platform/log/common/log.js"(){"use strict";we(),In(),q(),_s(),L(),ai(),z(),gt(),xe(),re(),Ab(),G(),V=j("logService"),Bc=j("loggerService"),(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(X||(X={})),jc=X.Info,Ed=class extends N{constructor(){super(...arguments),this.level=jc,this._onDidChangeLogLevel=this._register(new D),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(t){this.level!==t&&(this.level=t,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(t){return e3(this.level,t)}canLog(t){return this._store.isDisposed?!1:this.checkLogLevel(t)}},xm=class extends Ed{constructor(t){super(),this.logAlways=t}checkLogLevel(t){return this.logAlways||super.checkLogLevel(t)}trace(t,...e){this.canLog(X.Trace)&&this.log(X.Trace,Go([t,...e],!0))}debug(t,...e){this.canLog(X.Debug)&&this.log(X.Debug,Go([t,...e]))}info(t,...e){this.canLog(X.Info)&&this.log(X.Info,Go([t,...e]))}warn(t,...e){this.canLog(X.Warning)&&this.log(X.Warning,Go([t,...e]))}error(t,...e){if(this.canLog(X.Error))if(t instanceof Error){const i=Array.prototype.slice.call(arguments);i[0]=t.stack,this.log(X.Error,Go(i))}else this.log(X.Error,Go([t,...e]))}flush(){}},Mb=class extends Ed{constructor(t=jc){super(),this.setLevel(t),this.useColors=!B}trace(t,...e){this.canLog(X.Trace)&&(this.useColors?console.log(`\x1B[90m[main ${Br()}]\x1B[0m`,t,...e):console.log(`[main ${Br()}]`,t,...e))}debug(t,...e){this.canLog(X.Debug)&&(this.useColors?console.log(`\x1B[90m[main ${Br()}]\x1B[0m`,t,...e):console.log(`[main ${Br()}]`,t,...e))}info(t,...e){this.canLog(X.Info)&&(this.useColors?console.log(`\x1B[90m[main ${Br()}]\x1B[0m`,t,...e):console.log(`[main ${Br()}]`,t,...e))}warn(t,...e){this.canLog(X.Warning)&&(this.useColors?console.warn(`\x1B[93m[main ${Br()}]\x1B[0m`,t,...e):console.warn(`[main ${Br()}]`,t,...e))}error(t,...e){this.canLog(X.Error)&&(this.useColors?console.error(`\x1B[91m[main ${Br()}]\x1B[0m`,t,...e):console.error(`[main ${Br()}]`,t,...e))}flush(){}},Tb=class extends Ed{constructor(t){super(),this.loggers=t,t.length&&this.setLevel(t[0].getLevel())}setLevel(t){for(const e of this.loggers)e.setLevel(t);super.setLevel(t)}trace(t,...e){for(const i of this.loggers)i.trace(t,...e)}debug(t,...e){for(const i of this.loggers)i.debug(t,...e)}info(t,...e){for(const i of this.loggers)i.info(t,...e)}warn(t,...e){for(const i of this.loggers)i.warn(t,...e)}error(t,...e){for(const i of this.loggers)i.error(t,...e)}flush(){for(const t of this.loggers)t.flush()}dispose(){for(const t of this.loggers)t.dispose();super.dispose()}},Wb=class extends N{constructor(t,e,i){if(super(),this.logLevel=t,this.logsHome=e,this._loggers=new Bt,this._onDidChangeLoggers=this._register(new D),this.onDidChangeLoggers=this._onDidChangeLoggers.event,this._onDidChangeLogLevel=this._register(new D),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event,this._onDidChangeVisibility=this._register(new D),this.onDidChangeVisibility=this._onDidChangeVisibility.event,i)for(const r of i)this._loggers.set(r.resource,{logger:void 0,info:r})}getLoggerEntry(t){return At(t)?[...this._loggers.values()].find(e=>e.info.id===t):this._loggers.get(t)}getLogger(t){return this.getLoggerEntry(t)?.logger}createLogger(t,e){const i=this.toResource(t),r=At(t)?t:e?.id??Ur(i.toString()).toString(16);let s=this._loggers.get(i)?.logger;const n=e?.logLevel==="always"?X.Trace:e?.logLevel;s||(s=this.doCreateLogger(i,n??this.getLogLevel(i)??this.logLevel,{...e,id:r}));const o={logger:s,info:{resource:i,id:r,logLevel:n,name:e?.name,hidden:e?.hidden,group:e?.group,extensionId:e?.extensionId,when:e?.when}};return this.registerLogger(o.info),this._loggers.set(i,o),s}toResource(t){return At(t)?pe(this.logsHome,`${t}.log`):t}setLogLevel(t,e){if(x.isUri(t)){const i=t,r=e,s=this._loggers.get(i);s&&r!==s.info.logLevel&&(s.info.logLevel=r===this.logLevel?void 0:r,s.logger?.setLevel(r),this._loggers.set(s.info.resource,s),this._onDidChangeLogLevel.fire([i,r]))}else{this.logLevel=t;for(const[i,r]of this._loggers.entries())this._loggers.get(i)?.info.logLevel===void 0&&r.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(t,e){const i=this.getLoggerEntry(t);i&&e!==!i.info.hidden&&(i.info.hidden=!e,this._loggers.set(i.info.resource,i),this._onDidChangeVisibility.fire([i.info.resource,e]))}getLogLevel(t){let e;return t&&(e=this._loggers.get(t)?.info.logLevel),e??this.logLevel}registerLogger(t){const e=this._loggers.get(t.resource);e?e.info.hidden!==t.hidden&&this.setVisibility(t.resource,!t.hidden):(this._loggers.set(t.resource,{info:t,logger:void 0}),this._onDidChangeLoggers.fire({added:[t],removed:[]}))}deregisterLogger(t){const e=this.toResource(t),i=this._loggers.get(e);i&&(i.logger&&i.logger.dispose(),this._loggers.delete(e),this._onDidChangeLoggers.fire({added:[],removed:[i.info]}))}*getRegisteredLoggers(){for(const t of this._loggers.values())yield t.info}getRegisteredLogger(t){return this._loggers.get(t)?.info}dispose(){this._loggers.forEach(t=>t.logger?.dispose()),this._loggers.clear(),super.dispose()}},Lb=class{constructor(){this.onDidChangeLogLevel=new D().event}setLevel(t){}getLevel(){return X.Info}trace(t,...e){}debug(t,...e){}info(t,...e){}warn(t,...e){}error(t,...e){}critical(t,...e){}dispose(){}flush(){}},Ob=class extends Lb{},s3=new km("logLevel",i3(X.Info))}}),Fb,Nb,Cm,Ub,$b,Js,Hc,Bb,Es,Tn=g({"out-build/vs/base/common/ternarySearchTree.js"(){"use strict";Wt(),jt(),Fb=class{constructor(){this._value="",this._pos=0}reset(t){return this._value=t,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(t){const e=t.charCodeAt(0),i=this._value.charCodeAt(this._pos);return e-i}value(){return this._value[this._pos]}},Nb=class{constructor(t=!0){this._caseSensitive=t}reset(t){return this._value=t,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let t=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(t)this._from++;else break;else t=!1;return this}cmp(t){return this._caseSensitive?Cg(t,this._value,0,t.length,this._from,this._to):pc(t,this._value,0,t.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},Cm=class{constructor(t=!0,e=!0){this._splitOnBackslash=t,this._caseSensitive=e}reset(t){this._from=0,this._to=0,this._value=t,this._valueLen=t.length;for(let e=t.length-1;e>=0;e--,this._valueLen--){const i=this._value.charCodeAt(e);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let t=!0;for(;this._to<this._valueLen;this._to++){const e=this._value.charCodeAt(this._to);if(e===47||this._splitOnBackslash&&e===92)if(t)this._from++;else break;else t=!1}return this}cmp(t){return this._caseSensitive?Cg(t,this._value,0,t.length,this._from,this._to):pc(t,this._value,0,t.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},(function(t){t[t.Scheme=1]="Scheme",t[t.Authority=2]="Authority",t[t.Path=3]="Path",t[t.Query=4]="Query",t[t.Fragment=5]="Fragment"})(Ub||(Ub={})),$b=class{constructor(t,e){this._ignorePathCasing=t,this._ignoreQueryAndFragment=e,this._states=[],this._stateIdx=0}reset(t){return this._value=t,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new Cm(!1,!this._ignorePathCasing(t)),this._pathIterator.reset(t.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(t)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(t){if(this._states[this._stateIdx]===1)return Ig(t,this._value.scheme);if(this._states[this._stateIdx]===2)return Ig(t,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(t);if(this._states[this._stateIdx]===4)return xg(t,this._value.query);if(this._states[this._stateIdx]===5)return xg(t,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}},Js=class I0{static{this.Val=Symbol("undefined_placeholder")}static wrap(e){return e===void 0?I0.Val:e}static unwrap(e){return e===I0.Val?void 0:e}},Hc=class{constructor(){this.height=1}isEmpty(){return!this.left&&!this.mid&&!this.right&&this.value===void 0}rotateLeft(){const t=this.right;return this.right=t.left,t.left=this,this.updateHeight(),t.updateHeight(),t}rotateRight(){const t=this.left;return this.left=t.right,t.right=this,this.updateHeight(),t.updateHeight(),t}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}},(function(t){t[t.Left=-1]="Left",t[t.Mid=0]="Mid",t[t.Right=1]="Right"})(Bb||(Bb={})),Es=class yu{static forUris(e=()=>!1,i=()=>!1){return new yu(new $b(e,i))}static forPaths(e=!1){return new yu(new Cm(void 0,!e))}static forStrings(){return new yu(new Fb)}static forConfigKeys(){return new yu(new Nb)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,i){if(i){const r=i.slice(0);Ey(r);for(const s of r)this.set(s,e)}else{const r=e.slice(0);Ey(r);for(const s of r)this.set(s[0],s[1])}}set(e,i){const r=this._iter.reset(e);let s;this._root||(this._root=new Hc,this._root.segment=r.value());const n=[];for(s=this._root;;){const a=r.cmp(s.segment);if(a>0)s.left||(s.left=new Hc,s.left.segment=r.value()),n.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new Hc,s.right.segment=r.value()),n.push([1,s]),s=s.right;else if(r.hasNext())r.next(),s.mid||(s.mid=new Hc,s.mid.segment=r.value()),n.push([0,s]),s=s.mid;else break}const o=Js.unwrap(s.value);s.value=Js.wrap(i),s.key=e;for(let a=n.length-1;a>=0;a--){const c=n[a][1];c.updateHeight();const l=c.balanceFactor();if(l<-1||l>1){const u=n[a][0],d=n[a+1][0];if(u===1&&d===1)n[a][1]=c.rotateLeft();else if(u===-1&&d===-1)n[a][1]=c.rotateRight();else if(u===1&&d===-1)c.right=n[a+1][1]=n[a+1][1].rotateRight(),n[a][1]=c.rotateLeft();else if(u===-1&&d===1)c.left=n[a+1][1]=n[a+1][1].rotateLeft(),n[a][1]=c.rotateRight();else throw new Error;if(a>0)switch(n[a-1][0]){case-1:n[a-1][1].left=n[a][1];break;case 1:n[a-1][1].right=n[a][1];break;case 0:n[a-1][1].mid=n[a][1];break}else this._root=n[0][1]}}return o}get(e){return Js.unwrap(this._getNode(e)?.value)}_getNode(e){const i=this._iter.reset(e);let r=this._root;for(;r;){const s=i.cmp(r.segment);if(s>0)r=r.left;else if(s<0)r=r.right;else if(i.hasNext())i.next(),r=r.mid;else break}return r}has(e){const i=this._getNode(e);return!(i?.value===void 0&&i?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,i){const r=this._iter.reset(e),s=[];let n=this._root;for(;n;){const o=r.cmp(n.segment);if(o>0)s.push([-1,n]),n=n.left;else if(o<0)s.push([1,n]),n=n.right;else if(r.hasNext())r.next(),s.push([0,n]),n=n.mid;else break}if(n){if(i?(n.left=void 0,n.mid=void 0,n.right=void 0,n.height=1):(n.key=void 0,n.value=void 0),!n.mid&&!n.value)if(n.left&&n.right){const o=this._min(n.right);if(o.key){const{key:a,value:c,segment:l}=o;this._delete(o.key,!1),n.key=a,n.value=c,n.segment=l}}else{const o=n.left??n.right;if(s.length>0){const[a,c]=s[s.length-1];switch(a){case-1:c.left=o;break;case 0:c.mid=o;break;case 1:c.right=o;break}}else this._root=o}for(let o=s.length-1;o>=0;o--){const a=s[o][1];a.updateHeight();const c=a.balanceFactor();if(c>1?(a.right.balanceFactor()>=0||(a.right=a.right.rotateRight()),s[o][1]=a.rotateLeft()):c<-1&&(a.left.balanceFactor()<=0||(a.left=a.left.rotateLeft()),s[o][1]=a.rotateRight()),o>0)switch(s[o-1][0]){case-1:s[o-1][1].left=s[o][1];break;case 1:s[o-1][1].right=s[o][1];break;case 0:s[o-1][1].mid=s[o][1];break}else this._root=s[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const i=this._iter.reset(e);let r=this._root,s;for(;r;){const n=i.cmp(r.segment);if(n>0)r=r.left;else if(n<0)r=r.right;else if(i.hasNext())i.next(),s=Js.unwrap(r.value)||s,r=r.mid;else break}return r&&Js.unwrap(r.value)||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,i){const r=this._iter.reset(e);let s=this._root;for(;s;){const n=r.cmp(s.segment);if(n>0)s=s.left;else if(n<0)s=s.right;else if(r.hasNext())r.next(),s=s.mid;else return s.mid?this._entries(s.mid):i?Js.unwrap(s.value):void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(const[i,r]of this)e(r,i)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const i=[];return this._dfsEntries(e,i),i[Symbol.iterator]()}_dfsEntries(e,i){e&&(e.left&&this._dfsEntries(e.left,i),e.value!==void 0&&i.push([e.key,Js.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,i),e.right&&this._dfsEntries(e.right,i))}_isBalanced(){const e=i=>{if(!i)return!0;const r=i.balanceFactor();return r<-1||r>1?!1:e(i.left)&&e(i.right)};return e(this._root)}}}});function Ko(t){return t.create===!0}function ar(t){return!!(t.capabilities&2)}function Im(t){return!!(t.capabilities&8)}function jb(t){return!!(t.capabilities&131072)}function Qs(t){return!!(t.capabilities&4)}function Dm(t){return!!(t.capabilities&16)}function Am(t){return ar(t)?!!(t.capabilities&16384):!1}function Hb(t){return ar(t)?!!(t.capabilities&32768):!1}function n3(t){return!!(t.capabilities&65536)}function kr(t,e){return Pd.create(t,e)}function Wn(t){return t||kr(w(2018,null),ce.Unknown)}function o3(t,e){return t.name=e?`${e} (FileSystemError)`:"FileSystemError",t}function kd(t){if(!t)return ce.Unknown;if(t instanceof Pd)return t.code;const e=/^(.+) \(FileSystemError\)$/.exec(t.name);if(!e)return ce.Unknown;switch(e[1]){case ce.FileExists:return ce.FileExists;case ce.FileIsADirectory:return ce.FileIsADirectory;case ce.FileNotADirectory:return ce.FileNotADirectory;case ce.FileNotFound:return ce.FileNotFound;case ce.FileTooLarge:return ce.FileTooLarge;case ce.FileWriteLocked:return ce.FileWriteLocked;case ce.NoPermissions:return ce.NoPermissions;case ce.Unavailable:return ce.Unavailable}return ce.Unknown}function jr(t){if(t instanceof Zt)return t.fileOperationResult;switch(kd(t)){case ce.FileNotFound:return 1;case ce.FileIsADirectory:return 0;case ce.FileNotADirectory:return 9;case ce.FileWriteLocked:return 5;case ce.NoPermissions:return 6;case ce.FileExists:return 4;case ce.FileTooLarge:return 7;default:return 10}}function a3(t,e,i){return!t||!e||t===e||e.length>t.length?!1:(e.charAt(e.length-1)!==Qt&&(e+=Qt),i?Vu(t,e):t.indexOf(e)===0)}function Vb(t){if(!(typeof t.size!="number"||typeof t.mtime!="number"))return t.mtime.toString(29)+t.size.toString(31)}var mt,Ft,Yo,qb,zb,ce,Pd,Gb,Ln,Kb,Yb,Zt,xd,Cd,Jb,Id,Qb,Dd,On,Ze=g({"out-build/vs/platform/files/common/files.js"(){"use strict";Tn(),ye(),jt(),xe(),re(),we(),G(),z(),Ie(),Do(),mt=j("fileService"),(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(Ft||(Ft={})),(function(t){t[t.Readonly=1]="Readonly",t[t.Locked=2]="Locked"})(Yo||(Yo={})),(function(t){t[t.UPDATED=2]="UPDATED",t[t.ADDED=4]="ADDED",t[t.DELETED=8]="DELETED"})(qb||(qb={})),(function(t){t[t.None=0]="None",t[t.FileReadWrite=2]="FileReadWrite",t[t.FileOpenReadWriteClose=4]="FileOpenReadWriteClose",t[t.FileReadStream=16]="FileReadStream",t[t.FileFolderCopy=8]="FileFolderCopy",t[t.PathCaseSensitive=1024]="PathCaseSensitive",t[t.Readonly=2048]="Readonly",t[t.Trash=4096]="Trash",t[t.FileWriteUnlock=8192]="FileWriteUnlock",t[t.FileAtomicRead=16384]="FileAtomicRead",t[t.FileAtomicWrite=32768]="FileAtomicWrite",t[t.FileAtomicDelete=65536]="FileAtomicDelete",t[t.FileClone=131072]="FileClone"})(zb||(zb={})),(function(t){t.FileExists="EntryExists",t.FileNotFound="EntryNotFound",t.FileNotADirectory="EntryNotADirectory",t.FileIsADirectory="EntryIsADirectory",t.FileExceedsStorageQuota="EntryExceedsStorageQuota",t.FileTooLarge="EntryTooLarge",t.FileWriteLocked="EntryWriteLocked",t.NoPermissions="NoPermissions",t.Unavailable="Unavailable",t.Unknown="Unknown"})(ce||(ce={})),Pd=class b8 extends Error{static create(e,i){const r=new b8(e.toString(),i);return o3(r,i),r}constructor(e,i){super(e),this.code=i}},(function(t){t[t.CREATE=0]="CREATE",t[t.DELETE=1]="DELETE",t[t.MOVE=2]="MOVE",t[t.COPY=3]="COPY",t[t.WRITE=4]="WRITE"})(Gb||(Gb={})),Ln=class{constructor(t,e,i){this.resource=t,this.operation=e,this.target=i}isOperation(t){return this.operation===t}},(function(t){t[t.UPDATED=0]="UPDATED",t[t.ADDED=1]="ADDED",t[t.DELETED=2]="DELETED"})(Kb||(Kb={})),Yb=class Hp{static{this.MIXED_CORRELATION=null}constructor(e,i){this.ignorePathCasing=i,this.correlationId=void 0,this.added=new gs(()=>{const r=Es.forUris(()=>this.ignorePathCasing);return r.fill(this.rawAdded.map(s=>[s,!0])),r}),this.updated=new gs(()=>{const r=Es.forUris(()=>this.ignorePathCasing);return r.fill(this.rawUpdated.map(s=>[s,!0])),r}),this.deleted=new gs(()=>{const r=Es.forUris(()=>this.ignorePathCasing);return r.fill(this.rawDeleted.map(s=>[s,!0])),r}),this.rawAdded=[],this.rawUpdated=[],this.rawDeleted=[];for(const r of e){switch(r.type){case 1:this.rawAdded.push(r.resource);break;case 0:this.rawUpdated.push(r.resource);break;case 2:this.rawDeleted.push(r.resource);break}this.correlationId!==Hp.MIXED_CORRELATION&&(typeof r.cId=="number"?this.correlationId===void 0?this.correlationId=r.cId:this.correlationId!==r.cId&&(this.correlationId=Hp.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=Hp.MIXED_CORRELATION))}}contains(e,...i){return this.doContains(e,{includeChildren:!1},...i)}affects(e,...i){return this.doContains(e,{includeChildren:!0},...i)}doContains(e,i,...r){if(!e)return!1;const s=r.length>0;return!!((!s||r.includes(1))&&(this.added.value.get(e)||i.includeChildren&&this.added.value.findSuperstr(e))||(!s||r.includes(0))&&(this.updated.value.get(e)||i.includeChildren&&this.updated.value.findSuperstr(e))||(!s||r.includes(2))&&(this.deleted.value.findSubstr(e)||i.includeChildren&&this.deleted.value.findSuperstr(e)))}gotAdded(){return this.rawAdded.length>0}gotDeleted(){return this.rawDeleted.length>0}gotUpdated(){return this.rawUpdated.length>0}correlates(e){return this.correlationId===e}hasCorrelation(){return typeof this.correlationId=="number"}},Zt=class extends Error{constructor(t,e,i){super(t),this.fileOperationResult=e,this.options=i}},xd=class extends Zt{constructor(t,e,i,r){super(t,e,r),this.fileOperationResult=e,this.size=i}},Cd=class extends Zt{constructor(t,e,i){super(t,2,i),this.stat=e}},(function(t){t[t.FILE_IS_DIRECTORY=0]="FILE_IS_DIRECTORY",t[t.FILE_NOT_FOUND=1]="FILE_NOT_FOUND",t[t.FILE_NOT_MODIFIED_SINCE=2]="FILE_NOT_MODIFIED_SINCE",t[t.FILE_MODIFIED_SINCE=3]="FILE_MODIFIED_SINCE",t[t.FILE_MOVE_CONFLICT=4]="FILE_MOVE_CONFLICT",t[t.FILE_WRITE_LOCKED=5]="FILE_WRITE_LOCKED",t[t.FILE_PERMISSION_DENIED=6]="FILE_PERMISSION_DENIED",t[t.FILE_TOO_LARGE=7]="FILE_TOO_LARGE",t[t.FILE_INVALID_PATH=8]="FILE_INVALID_PATH",t[t.FILE_NOT_DIRECTORY=9]="FILE_NOT_DIRECTORY",t[t.FILE_OTHER_ERROR=10]="FILE_OTHER_ERROR"})(Jb||(Jb={})),Id={OFF:"off",ON_EXIT:"onExit",ON_EXIT_AND_WINDOW_CLOSE:"onExitAndWindowClose"},(function(t){t[t.FILE=0]="FILE",t[t.FOLDER=1]="FOLDER",t[t.ROOT_FOLDER=2]="ROOT_FOLDER",t[t.PULL_REQUEST=3]="PULL_REQUEST"})(Qb||(Qb={})),Dd="",On=class Fi{static{this.KB=1024}static{this.MB=Fi.KB*Fi.KB}static{this.GB=Fi.MB*Fi.KB}static{this.TB=Fi.GB*Fi.KB}static formatSize(e){return Ou(e)||(e=0),e<Fi.KB?w(2019,null,e.toFixed(0)):e<Fi.MB?w(2020,null,(e/Fi.KB).toFixed(2)):e<Fi.GB?w(2021,null,(e/Fi.MB).toFixed(2)):e<Fi.TB?w(2022,null,(e/Fi.GB).toFixed(2)):w(2023,null,(e/Fi.TB).toFixed(2))}}}}),Rm,Ii,Vi=g({"out-build/vs/platform/state/node/state.js"(){"use strict";G(),Rm=j("stateReadService"),Ii=j("stateService")}});function Xs(t,e){const i=Math.pow(10,e);return Math.round(t*i)/i}var b,Fn,Vc,Ad,c3=g({"out-build/vs/base/common/color.js"(){"use strict";b=class{constructor(t,e,i,r=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,t))|0,this.g=Math.min(255,Math.max(0,e))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=Xs(Math.max(Math.min(1,r),0),3)}static equals(t,e){return t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a}},Fn=class Su{constructor(e,i,r,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Xs(Math.max(Math.min(1,i),0),3),this.l=Xs(Math.max(Math.min(1,r),0),3),this.a=Xs(Math.max(Math.min(1,s),0),3)}static equals(e,i){return e.h===i.h&&e.s===i.s&&e.l===i.l&&e.a===i.a}static fromRGBA(e){const i=e.r/255,r=e.g/255,s=e.b/255,n=e.a,o=Math.max(i,r,s),a=Math.min(i,r,s);let c=0,l=0;const u=(a+o)/2,d=o-a;if(d>0){switch(l=Math.min(u<=.5?d/(2*u):d/(2-2*u),1),o){case i:c=(r-s)/d+(r<s?6:0);break;case r:c=(s-i)/d+2;break;case s:c=(i-r)/d+4;break}c*=60,c=Math.round(c)}return new Su(c,l,u,n)}static _hue2rgb(e,i,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(i-e)*6*r:r<1/2?i:r<2/3?e+(i-e)*(2/3-r)*6:e}static toRGBA(e){const i=e.h/360,{s:r,l:s,a:n}=e;let o,a,c;if(r===0)o=a=c=s;else{const l=s<.5?s*(1+r):s+r-s*r,u=2*s-l;o=Su._hue2rgb(u,l,i+1/3),a=Su._hue2rgb(u,l,i),c=Su._hue2rgb(u,l,i-1/3)}return new b(Math.round(o*255),Math.round(a*255),Math.round(c*255),n)}},Vc=class E8{constructor(e,i,r,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Xs(Math.max(Math.min(1,i),0),3),this.v=Xs(Math.max(Math.min(1,r),0),3),this.a=Xs(Math.max(Math.min(1,s),0),3)}static equals(e,i){return e.h===i.h&&e.s===i.s&&e.v===i.v&&e.a===i.a}static fromRGBA(e){const i=e.r/255,r=e.g/255,s=e.b/255,n=Math.max(i,r,s),o=Math.min(i,r,s),a=n-o,c=n===0?0:a/n;let l;return a===0?l=0:n===i?l=((r-s)/a%6+6)%6:n===r?l=(s-i)/a+2:l=(i-r)/a+4,new E8(Math.round(l*60),c,n,e.a)}static toRGBA(e){const{h:i,s:r,v:s,a:n}=e,o=s*r,a=o*(1-Math.abs(i/60%2-1)),c=s-o;let[l,u,d]=[0,0,0];return i<60?(l=o,u=a):i<120?(l=a,u=o):i<180?(u=o,d=a):i<240?(u=a,d=o):i<300?(l=a,d=o):i<=360&&(l=o,d=a),l=Math.round((l+c)*255),u=Math.round((u+c)*255),d=Math.round((d+c)*255),new b(l,u,d,n)}},Ad=class Ye{static fromHex(e){return Ye.Format.CSS.parseHex(e)||Ye.red}static equals(e,i){return!e&&!i?!0:!e||!i?!1:e.equals(i)}get hsla(){return this._hsla?this._hsla:Fn.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Vc.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof b)this.rgba=e;else if(e instanceof Fn)this._hsla=e,this.rgba=Fn.toRGBA(e);else if(e instanceof Vc)this._hsva=e,this.rgba=Vc.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&b.equals(this.rgba,e.rgba)&&Fn.equals(this.hsla,e.hsla)&&Vc.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=Ye._relativeLuminanceForComponent(this.rgba.r),i=Ye._relativeLuminanceForComponent(this.rgba.g),r=Ye._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*i+.0722*r;return Xs(s,4)}reduceRelativeLuminace(e,i){let{r,g:s,b:n}=e.rgba,o=this.getContrastRatio(e);for(;o<i&&(r>0||s>0||n>0);)r-=Math.max(0,Math.ceil(r*.1)),s-=Math.max(0,Math.ceil(s*.1)),n-=Math.max(0,Math.ceil(n*.1)),o=this.getContrastRatio(new Ye(new b(r,s,n)));return new Ye(new b(r,s,n))}increaseRelativeLuminace(e,i){let{r,g:s,b:n}=e.rgba,o=this.getContrastRatio(e);for(;o<i&&(r<255||s<255||n<255);)r=Math.min(255,r+Math.ceil((255-r)*.1)),s=Math.min(255,s+Math.ceil((255-s)*.1)),n=Math.min(255,n+Math.ceil((255-n)*.1)),o=this.getContrastRatio(new Ye(new b(r,s,n)));return new Ye(new b(r,s,n))}static _relativeLuminanceForComponent(e){const i=e/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}getContrastRatio(e){const i=this.getRelativeLuminance(),r=e.getRelativeLuminance();return i>r?(i+.05)/(r+.05):(r+.05)/(i+.05)}isDarker(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3<128}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const i=this.getRelativeLuminance(),r=e.getRelativeLuminance();return i>r}isDarkerThan(e){const i=this.getRelativeLuminance(),r=e.getRelativeLuminance();return i<r}ensureConstrast(e,i){const r=this.getRelativeLuminance(),s=e.getRelativeLuminance();if(this.getContrastRatio(e)<i){if(s<r){const c=this.reduceRelativeLuminace(e,i),l=this.getContrastRatio(c);if(l<i){const u=this.increaseRelativeLuminace(e,i),d=this.getContrastRatio(u);return l>d?c:u}return c}const o=this.increaseRelativeLuminace(e,i),a=this.getContrastRatio(o);if(a<i){const c=this.reduceRelativeLuminace(e,i),l=this.getContrastRatio(c);return a>l?o:c}return o}return e}lighten(e){return new Ye(new Fn(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new Ye(new Fn(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:i,g:r,b:s,a:n}=this.rgba;return new Ye(new b(i,r,s,n*e))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new Ye(new b(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}blend(e){const i=e.rgba,r=this.rgba.a,s=i.a,n=r+s*(1-r);if(n<1e-6)return Ye.transparent;const o=this.rgba.r*r/n+i.r*s*(1-r)/n,a=this.rgba.g*r/n+i.g*s*(1-r)/n,c=this.rgba.b*r/n+i.b*s*(1-r)/n;return new Ye(new b(o,a,c,n))}makeOpaque(e){if(this.isOpaque()||e.rgba.a!==1)return this;const{r:i,g:r,b:s,a:n}=this.rgba;return new Ye(new b(e.rgba.r-n*(e.rgba.r-i),e.rgba.g-n*(e.rgba.g-r),e.rgba.b-n*(e.rgba.b-s),1))}flatten(...e){const i=e.reduceRight((r,s)=>Ye._flatten(s,r));return Ye._flatten(this,i)}static _flatten(e,i){const r=1-e.rgba.a;return new Ye(new b(r*i.rgba.r+e.rgba.a*e.rgba.r,r*i.rgba.g+e.rgba.a*e.rgba.g,r*i.rgba.b+e.rgba.a*e.rgba.b))}toString(){return this._toString||(this._toString=Ye.Format.CSS.format(this)),this._toString}toNumber32Bit(){return this._toNumber32Bit||(this._toNumber32Bit=(this.rgba.r<<24|this.rgba.g<<16|this.rgba.b<<8|this.rgba.a*255<<0)>>>0),this._toNumber32Bit}static getLighterColor(e,i,r){if(e.isLighterThan(i))return e;r=r||.5;const s=e.getRelativeLuminance(),n=i.getRelativeLuminance();return r=r*(n-s)/n,e.lighten(r)}static getDarkerColor(e,i,r){if(e.isDarkerThan(i))return e;r=r||.5;const s=e.getRelativeLuminance(),n=i.getRelativeLuminance();return r=r*(s-n)/s,e.darken(r)}static{this.white=new Ye(new b(255,255,255,1))}static{this.black=new Ye(new b(0,0,0,1))}static{this.red=new Ye(new b(255,0,0,1))}static{this.blue=new Ye(new b(0,0,255,1))}static{this.green=new Ye(new b(0,255,0,1))}static{this.cyan=new Ye(new b(0,255,255,1))}static{this.lightgrey=new Ye(new b(211,211,211,1))}static{this.transparent=new Ye(new b(0,0,0,0))}},(function(t){let e;(function(i){let r;(function(s){function n(S){return S.rgba.a===1?`rgb(${S.rgba.r}, ${S.rgba.g}, ${S.rgba.b})`:t.Format.CSS.formatRGBA(S)}s.formatRGB=n;function o(S){return`rgba(${S.rgba.r}, ${S.rgba.g}, ${S.rgba.b}, ${+S.rgba.a.toFixed(2)})`}s.formatRGBA=o;function a(S){return S.hsla.a===1?`hsl(${S.hsla.h}, ${(S.hsla.s*100).toFixed(2)}%, ${(S.hsla.l*100).toFixed(2)}%)`:t.Format.CSS.formatHSLA(S)}s.formatHSL=a;function c(S){return`hsla(${S.hsla.h}, ${(S.hsla.s*100).toFixed(2)}%, ${(S.hsla.l*100).toFixed(2)}%, ${S.hsla.a.toFixed(2)})`}s.formatHSLA=c;function l(S){const E=S.toString(16);return E.length!==2?"0"+E:E}function u(S){return`#${l(S.rgba.r)}${l(S.rgba.g)}${l(S.rgba.b)}`}s.formatHex=u;function d(S,E=!1){return E&&S.rgba.a===1?t.Format.CSS.formatHex(S):`#${l(S.rgba.r)}${l(S.rgba.g)}${l(S.rgba.b)}${l(Math.round(S.rgba.a*255))}`}s.formatHexA=d;function f(S){return S.isOpaque()?t.Format.CSS.formatHex(S):t.Format.CSS.formatRGBA(S)}s.format=f;function p(S){if(S==="transparent")return t.transparent;if(S.startsWith("#"))return m(S);if(S.startsWith("rgba(")){const E=S.match(/rgba\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+), *(?<a>(?:\+|-)?\d+(\.\d+)?)\)/);if(!E)throw new Error("Invalid color format "+S);const k=parseInt(E.groups?.r??"0"),R=parseInt(E.groups?.g??"0"),C=parseInt(E.groups?.b??"0"),M=parseFloat(E.groups?.a??"0");return new t(new b(k,R,C,M))}if(S.startsWith("rgb(")){const E=S.match(/rgb\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+)\)/);if(!E)throw new Error("Invalid color format "+S);const k=parseInt(E.groups?.r??"0"),R=parseInt(E.groups?.g??"0"),C=parseInt(E.groups?.b??"0");return new t(new b(k,R,C))}return v(S)}s.parse=p;function v(S){switch(S){case"aliceblue":return new t(new b(240,248,255,1));case"antiquewhite":return new t(new b(250,235,215,1));case"aqua":return new t(new b(0,255,255,1));case"aquamarine":return new t(new b(127,255,212,1));case"azure":return new t(new b(240,255,255,1));case"beige":return new t(new b(245,245,220,1));case"bisque":return new t(new b(255,228,196,1));case"black":return new t(new b(0,0,0,1));case"blanchedalmond":return new t(new b(255,235,205,1));case"blue":return new t(new b(0,0,255,1));case"blueviolet":return new t(new b(138,43,226,1));case"brown":return new t(new b(165,42,42,1));case"burlywood":return new t(new b(222,184,135,1));case"cadetblue":return new t(new b(95,158,160,1));case"chartreuse":return new t(new b(127,255,0,1));case"chocolate":return new t(new b(210,105,30,1));case"coral":return new t(new b(255,127,80,1));case"cornflowerblue":return new t(new b(100,149,237,1));case"cornsilk":return new t(new b(255,248,220,1));case"crimson":return new t(new b(220,20,60,1));case"cyan":return new t(new b(0,255,255,1));case"darkblue":return new t(new b(0,0,139,1));case"darkcyan":return new t(new b(0,139,139,1));case"darkgoldenrod":return new t(new b(184,134,11,1));case"darkgray":return new t(new b(169,169,169,1));case"darkgreen":return new t(new b(0,100,0,1));case"darkgrey":return new t(new b(169,169,169,1));case"darkkhaki":return new t(new b(189,183,107,1));case"darkmagenta":return new t(new b(139,0,139,1));case"darkolivegreen":return new t(new b(85,107,47,1));case"darkorange":return new t(new b(255,140,0,1));case"darkorchid":return new t(new b(153,50,204,1));case"darkred":return new t(new b(139,0,0,1));case"darksalmon":return new t(new b(233,150,122,1));case"darkseagreen":return new t(new b(143,188,143,1));case"darkslateblue":return new t(new b(72,61,139,1));case"darkslategray":return new t(new b(47,79,79,1));case"darkslategrey":return new t(new b(47,79,79,1));case"darkturquoise":return new t(new b(0,206,209,1));case"darkviolet":return new t(new b(148,0,211,1));case"deeppink":return new t(new b(255,20,147,1));case"deepskyblue":return new t(new b(0,191,255,1));case"dimgray":return new t(new b(105,105,105,1));case"dimgrey":return new t(new b(105,105,105,1));case"dodgerblue":return new t(new b(30,144,255,1));case"firebrick":return new t(new b(178,34,34,1));case"floralwhite":return new t(new b(255,250,240,1));case"forestgreen":return new t(new b(34,139,34,1));case"fuchsia":return new t(new b(255,0,255,1));case"gainsboro":return new t(new b(220,220,220,1));case"ghostwhite":return new t(new b(248,248,255,1));case"gold":return new t(new b(255,215,0,1));case"goldenrod":return new t(new b(218,165,32,1));case"gray":return new t(new b(128,128,128,1));case"green":return new t(new b(0,128,0,1));case"greenyellow":return new t(new b(173,255,47,1));case"grey":return new t(new b(128,128,128,1));case"honeydew":return new t(new b(240,255,240,1));case"hotpink":return new t(new b(255,105,180,1));case"indianred":return new t(new b(205,92,92,1));case"indigo":return new t(new b(75,0,130,1));case"ivory":return new t(new b(255,255,240,1));case"khaki":return new t(new b(240,230,140,1));case"lavender":return new t(new b(230,230,250,1));case"lavenderblush":return new t(new b(255,240,245,1));case"lawngreen":return new t(new b(124,252,0,1));case"lemonchiffon":return new t(new b(255,250,205,1));case"lightblue":return new t(new b(173,216,230,1));case"lightcoral":return new t(new b(240,128,128,1));case"lightcyan":return new t(new b(224,255,255,1));case"lightgoldenrodyellow":return new t(new b(250,250,210,1));case"lightgray":return new t(new b(211,211,211,1));case"lightgreen":return new t(new b(144,238,144,1));case"lightgrey":return new t(new b(211,211,211,1));case"lightpink":return new t(new b(255,182,193,1));case"lightsalmon":return new t(new b(255,160,122,1));case"lightseagreen":return new t(new b(32,178,170,1));case"lightskyblue":return new t(new b(135,206,250,1));case"lightslategray":return new t(new b(119,136,153,1));case"lightslategrey":return new t(new b(119,136,153,1));case"lightsteelblue":return new t(new b(176,196,222,1));case"lightyellow":return new t(new b(255,255,224,1));case"lime":return new t(new b(0,255,0,1));case"limegreen":return new t(new b(50,205,50,1));case"linen":return new t(new b(250,240,230,1));case"magenta":return new t(new b(255,0,255,1));case"maroon":return new t(new b(128,0,0,1));case"mediumaquamarine":return new t(new b(102,205,170,1));case"mediumblue":return new t(new b(0,0,205,1));case"mediumorchid":return new t(new b(186,85,211,1));case"mediumpurple":return new t(new b(147,112,219,1));case"mediumseagreen":return new t(new b(60,179,113,1));case"mediumslateblue":return new t(new b(123,104,238,1));case"mediumspringgreen":return new t(new b(0,250,154,1));case"mediumturquoise":return new t(new b(72,209,204,1));case"mediumvioletred":return new t(new b(199,21,133,1));case"midnightblue":return new t(new b(25,25,112,1));case"mintcream":return new t(new b(245,255,250,1));case"mistyrose":return new t(new b(255,228,225,1));case"moccasin":return new t(new b(255,228,181,1));case"navajowhite":return new t(new b(255,222,173,1));case"navy":return new t(new b(0,0,128,1));case"oldlace":return new t(new b(253,245,230,1));case"olive":return new t(new b(128,128,0,1));case"olivedrab":return new t(new b(107,142,35,1));case"orange":return new t(new b(255,165,0,1));case"orangered":return new t(new b(255,69,0,1));case"orchid":return new t(new b(218,112,214,1));case"palegoldenrod":return new t(new b(238,232,170,1));case"palegreen":return new t(new b(152,251,152,1));case"paleturquoise":return new t(new b(175,238,238,1));case"palevioletred":return new t(new b(219,112,147,1));case"papayawhip":return new t(new b(255,239,213,1));case"peachpuff":return new t(new b(255,218,185,1));case"peru":return new t(new b(205,133,63,1));case"pink":return new t(new b(255,192,203,1));case"plum":return new t(new b(221,160,221,1));case"powderblue":return new t(new b(176,224,230,1));case"purple":return new t(new b(128,0,128,1));case"rebeccapurple":return new t(new b(102,51,153,1));case"red":return new t(new b(255,0,0,1));case"rosybrown":return new t(new b(188,143,143,1));case"royalblue":return new t(new b(65,105,225,1));case"saddlebrown":return new t(new b(139,69,19,1));case"salmon":return new t(new b(250,128,114,1));case"sandybrown":return new t(new b(244,164,96,1));case"seagreen":return new t(new b(46,139,87,1));case"seashell":return new t(new b(255,245,238,1));case"sienna":return new t(new b(160,82,45,1));case"silver":return new t(new b(192,192,192,1));case"skyblue":return new t(new b(135,206,235,1));case"slateblue":return new t(new b(106,90,205,1));case"slategray":return new t(new b(112,128,144,1));case"slategrey":return new t(new b(112,128,144,1));case"snow":return new t(new b(255,250,250,1));case"springgreen":return new t(new b(0,255,127,1));case"steelblue":return new t(new b(70,130,180,1));case"tan":return new t(new b(210,180,140,1));case"teal":return new t(new b(0,128,128,1));case"thistle":return new t(new b(216,191,216,1));case"tomato":return new t(new b(255,99,71,1));case"turquoise":return new t(new b(64,224,208,1));case"violet":return new t(new b(238,130,238,1));case"wheat":return new t(new b(245,222,179,1));case"white":return new t(new b(255,255,255,1));case"whitesmoke":return new t(new b(245,245,245,1));case"yellow":return new t(new b(255,255,0,1));case"yellowgreen":return new t(new b(154,205,50,1));default:return null}}function m(S){const E=S.length;if(E===0||S.charCodeAt(0)!==35)return null;if(E===7){const k=16*y(S.charCodeAt(1))+y(S.charCodeAt(2)),R=16*y(S.charCodeAt(3))+y(S.charCodeAt(4)),C=16*y(S.charCodeAt(5))+y(S.charCodeAt(6));return new t(new b(k,R,C,1))}if(E===9){const k=16*y(S.charCodeAt(1))+y(S.charCodeAt(2)),R=16*y(S.charCodeAt(3))+y(S.charCodeAt(4)),C=16*y(S.charCodeAt(5))+y(S.charCodeAt(6)),M=16*y(S.charCodeAt(7))+y(S.charCodeAt(8));return new t(new b(k,R,C,M/255))}if(E===4){const k=y(S.charCodeAt(1)),R=y(S.charCodeAt(2)),C=y(S.charCodeAt(3));return new t(new b(16*k+k,16*R+R,16*C+C))}if(E===5){const k=y(S.charCodeAt(1)),R=y(S.charCodeAt(2)),C=y(S.charCodeAt(3)),M=y(S.charCodeAt(4));return new t(new b(16*k+k,16*R+R,16*C+C,(16*M+M)/255))}return null}s.parseHex=m;function y(S){switch(S){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(r=i.CSS||(i.CSS={}))})(e=t.Format||(t.Format={}))})(Ad||(Ad={}))}});function l3(t,e){return x.joinPath(t.userHome,e.dataFolderName,"shadow-workspaces")}var qe,lt=g({"out-build/vs/platform/product/common/productService.js"(){"use strict";re(),G(),qe=j("productService")}}),Xb,Nt,u3=g({"out-build/vs/platform/theme/common/theme.js"(){"use strict";(function(t){t.DARK="dark",t.LIGHT="light",t.HIGH_CONTRAST_DARK="hcDark",t.HIGH_CONTRAST_LIGHT="hcLight"})(Xb||(Xb={})),(function(t){t.VS="vs",t.VS_DARK="vs-dark",t.HC_BLACK="hc-black",t.HC_LIGHT="hc-light"})(Nt||(Nt={}))}});import Di from"electron";var Zb,e4,t4,i4,Mm,Tm,Wm,Lm,Zs,Jo,Rd,qc=g({"out-build/vs/platform/theme/electron-main/themeMainService.js"(){"use strict";q(),L(),z(),Xe(),G(),Vi(),u3(),Wt(),ut(),Zb="#FFFFFF",e4="#1F1F1F",t4="#000000",i4="#FFFFFF",Mm="theme",Tm="themeBackground",Wm="windowSplash",Lm="windowSplashWorkspaceOverride",(function(t){t.DETECT_COLOR_SCHEME="window.autoDetectColorScheme",t.DETECT_HC="window.autoDetectHighContrast",t.SYSTEM_COLOR_THEME="window.systemColorTheme"})(Zs||(Zs={})),Jo=j("themeMainService"),Rd=class extends N{constructor(e,i){super(),this.stateService=e,this.configurationService=i,this._onDidChangeColorScheme=this._register(new D),this.onDidChangeColorScheme=this._onDidChangeColorScheme.event,Pe||this._register(this.configurationService.onDidChangeConfiguration(r=>{(r.affectsConfiguration(Zs.SYSTEM_COLOR_THEME)||r.affectsConfiguration(Zs.DETECT_COLOR_SCHEME))&&this.updateSystemColorTheme()})),this.updateSystemColorTheme(),this._register(P.fromNodeEventEmitter(Di.nativeTheme,"updated")(()=>this._onDidChangeColorScheme.fire(this.getColorScheme())))}updateSystemColorTheme(){if(Pe||this.configurationService.getValue(Zs.DETECT_COLOR_SCHEME))Di.nativeTheme.themeSource="system";else switch(this.configurationService.getValue(Zs.SYSTEM_COLOR_THEME)){case"dark":Di.nativeTheme.themeSource="dark";break;case"light":Di.nativeTheme.themeSource="light";break;case"auto":switch(this.getPreferredBaseTheme()??this.getStoredBaseTheme()){case Nt.VS:Di.nativeTheme.themeSource="light";break;case Nt.VS_DARK:Di.nativeTheme.themeSource="dark";break;default:Di.nativeTheme.themeSource="system"}break;default:Di.nativeTheme.themeSource="system";break}}getColorScheme(){if(B){if(Di.nativeTheme.shouldUseHighContrastColors)return{dark:Di.nativeTheme.shouldUseInvertedColorScheme,highContrast:!0}}else if(O){if(Di.nativeTheme.shouldUseInvertedColorScheme||Di.nativeTheme.shouldUseHighContrastColors)return{dark:Di.nativeTheme.shouldUseDarkColors,highContrast:!0}}else if(Pe&&Di.nativeTheme.shouldUseHighContrastColors)return{dark:!0,highContrast:!0};return{dark:Di.nativeTheme.shouldUseDarkColors,highContrast:!1}}getPreferredBaseTheme(){const e=this.getColorScheme();if(this.configurationService.getValue(Zs.DETECT_HC)&&e.highContrast)return e.dark?Nt.HC_BLACK:Nt.HC_LIGHT;if(this.configurationService.getValue(Zs.DETECT_COLOR_SCHEME))return e.dark?Nt.VS_DARK:Nt.VS}getBackgroundColor(){const e=this.getPreferredBaseTheme(),i=this.getStoredBaseTheme();if(e===void 0||e===i){const r=this.stateService.getItem(Tm,null);if(r)return r}switch(e??i){case Nt.VS:return Zb;case Nt.HC_BLACK:return t4;case Nt.HC_LIGHT:return i4;default:return e4}}getStoredBaseTheme(){switch(this.stateService.getItem(Mm,Nt.VS_DARK).split(" ")[0]){case Nt.VS:return Nt.VS;case Nt.HC_BLACK:return Nt.HC_BLACK;case Nt.HC_LIGHT:return Nt.HC_LIGHT;default:return Nt.VS_DARK}}saveWindowSplash(e,i,r){const s=this.updateWindowSplashOverride(i,r);this.stateService.setItems(Dt([{key:Mm,data:r.baseTheme},{key:Tm,data:r.colorInfo.background},{key:Wm,data:r},s?{key:Lm,data:s}:void 0])),typeof e=="number"&&this.updateBackgroundColor(e,r),this.updateSystemColorTheme()}updateWindowSplashOverride(e,i){let r,s=!1;if(e){r={...this.getWindowSplashOverride()};const[n,o]=r.layoutInfo?.auxiliarySideBarWidth??[0,[]];if(i.layoutInfo?.auxiliarySideBarWidth)n!==i.layoutInfo.auxiliarySideBarWidth&&(typeof r.layoutInfo.auxiliarySideBarWidth>"u"?r.layoutInfo.auxiliarySideBarWidth=[i.layoutInfo.auxiliarySideBarWidth,o]:r.layoutInfo.auxiliarySideBarWidth[0]=i.layoutInfo.auxiliarySideBarWidth,s=!0),o.includes(e.id)||(o.push(e.id),s=!0);else{const a=o.indexOf(e.id);a>-1&&(o.splice(a,1),s=!0)}}return s?r:void 0}updateBackgroundColor(e,i){for(const r of Gc())if(r.id===e){r.setBackgroundColor(i.colorInfo.background);break}}getWindowSplash(e){const i=this.stateService.getItem(Wm);if(!i?.layoutInfo)return i;let r;if(e){const[s,n]=this.getWindowSplashOverride().layoutInfo.auxiliarySideBarWidth??[0,[]];n.includes(e.id)&&(r=s)}return{...i,layoutInfo:{...i.layoutInfo,auxiliarySideBarWidth:typeof r=="number"?r:0}}}getWindowSplashOverride(){return this.stateService.getItem(Lm,{layoutInfo:{auxiliarySideBarWidth:[0,[]]}})}},Rd=__decorate([__param(0,Ii),__param(1,Qe)],Rd)}});function Om(t){return!!t.workspaceUri}function r4(t){return!!t.folderUri}function s4(t){return!!t.fileUri}function d3(t){const e=Nn(t),i=t.getValue("window.menuBarVisibility");return i==="default"||e&&i==="compact"||O&&lg?"classic":i}function Nn(t,e){return e||(e=n4(t)),e==="native"}function n4(t){if(us)return"custom";const e=t.getValue("window");if(e){if(O&&e.nativeTabs===!0||O&&e.nativeFullScreen===!1)return"native";const s=e.titleBarStyle;if(s==="native"||s==="custom")return s}return"custom"}function h3(t){if(us||O||n4(t)==="native")return"native";const i=t.getValue("window")?.controlsStyle;return i==="custom"||i==="hidden"?i:"native"}function Fm(t){if(us||Nn(t))return!1;if(!O){const e=h3(t);if(e==="custom"||e==="hidden")return!1}return!0}function o4(t){const e=t.getValue("window");return!e||typeof e.nativeFullScreen!="boolean"||e.nativeTabs?!0:e.nativeFullScreen!==!1}function Nm(t=0){return Math.pow(1.2,t)}var Um,a4,c4,l4,u4,d4,$m,Bm,ks=g({"out-build/vs/platform/window/common/window.js"(){"use strict";z(),Um={WIDTH:400,WIDTH_WITH_VERTICAL_PANEL:600,HEIGHT:270},(function(t){t.TITLE_BAR_STYLE="window.titleBarStyle",t.CUSTOM_TITLE_BAR_VISIBILITY="window.customTitleBarVisibility"})(a4||(a4={})),(function(t){t.NATIVE="native",t.CUSTOM="custom"})(c4||(c4={})),(function(t){t.NATIVE="native",t.CUSTOM="custom",t.HIDDEN="hidden"})(l4||(l4={})),(function(t){t.AUTO="auto",t.WINDOWED="windowed",t.NEVER="never"})(u4||(u4={})),d4=35,$m={width:1200,height:800},Bm={width:1024,height:768}}});import f3 from"electron";var h4,f4,en,p4,g4,m4,zc=g({"out-build/vs/platform/window/electron-main/window.js"(){"use strict";ks(),(function(t){t[t.INITIAL=1]="INITIAL",t[t.LOAD=2]="LOAD",t[t.RELOAD=3]="RELOAD"})(h4||(h4={})),(function(t){t[t.CLOSE=1]="CLOSE",t[t.QUIT=2]="QUIT",t[t.RELOAD=3]="RELOAD",t[t.LOAD=4]="LOAD"})(f4||(f4={})),en=function(t=1){return{width:$m.width,height:$m.height,mode:t}},p4=function(){const t=Bm.width,e=Bm.height,i=f3.screen.getPrimaryDisplay().workArea,r=Math.max(i.x+i.width/2-t/2,0),s=Math.max(i.y+i.height/2-e/2,0);return{x:r,y:s,width:t,height:e,mode:1}},(function(t){t[t.Maximized=0]="Maximized",t[t.Normal=1]="Normal",t[t.Minimized=2]="Minimized",t[t.Fullscreen=3]="Fullscreen"})(g4||(g4={})),(function(t){t[t.UNRESPONSIVE=1]="UNRESPONSIVE",t[t.PROCESS_GONE=2]="PROCESS_GONE",t[t.LOAD=3]="LOAD",t[t.RESPONSIVE=4]="RESPONSIVE"})(m4||(m4={}))}});import jm from"electron";function Md(t,e,i,r){const s=t.get(Jo),n=t.get(qe),o=t.get(Qe),a=t.get(st),c=o.getValue("window"),l={backgroundColor:s.getBackgroundColor(),minWidth:Um.WIDTH,minHeight:Um.HEIGHT,title:n.nameLong,show:i.hideBecauseShadowWindow===!1&&e.mode!==0&&e.mode!==3,x:e.x,y:e.y,width:e.width,height:e.height,webPreferences:{...r,enableWebSQL:!1,spellcheck:!1,zoomFactor:Nm(e.zoomLevel??c?.zoomLevel),autoplayPolicy:"user-gesture-required",enableBlinkFeatures:"HighlightAPI",sandbox:!0,enableDeprecatedPaste:!0},experimentalDarkMode:!0};if(Pe?(l.icon=U(a.appRoot,"resources/linux/code.png"),l.frame=!1):B&&!a.isBuilt&&(l.icon=U(a.appRoot,"resources/win32/code_150x150.png")),O&&(l.acceptFirstMouse=!0,c?.clickThroughInactive===!1&&(l.acceptFirstMouse=!1)),i?.disableFullscreen?l.fullscreen=!1:O&&!o4(o)&&(l.fullscreenable=!1),O&&c?.nativeTabs===!0&&(l.tabbingIdentifier=n.nameShort),!Nn(o,i?.forceNativeTitlebar?"native":void 0)&&(l.titleBarStyle="hidden",O||(l.frame=!1),Fm(o)))if(O)l.titleBarOverlay=!0;else{const f=s.getWindowSplash(void 0)?.colorInfo.titleBarBackground??s.getBackgroundColor(),p=Ad.fromHex(f).isDarker()?"#FFFFFF":"#000000";l.titleBarOverlay={height:29,color:f,symbolColor:p}}return l}function v4(t){let e,i=Number.MIN_VALUE;for(const r of t)r.lastFocusTime>i&&(i=r.lastFocusTime,e=r);return e}function Gc(){return jm.BrowserWindow.getAllWindows().filter(t=>!t.webContents.isOffscreen())}var ot,w4,Td,ut=g({"out-build/vs/platform/windows/electron-main/windows.js"(){"use strict";c3(),ye(),z(),Xe(),ct(),G(),lt(),qc(),ks(),zc(),ot=j("windowsMainService"),(function(t){t[t.CLI=0]="CLI",t[t.DOCK=1]="DOCK",t[t.MENU=2]="MENU",t[t.DIALOG=3]="DIALOG",t[t.DESKTOP=4]="DESKTOP",t[t.API=5]="API",t[t.LINK=6]="LINK"})(w4||(w4={})),(function(t){function e(r,s,n=jm.screen.getAllDisplays()){if(r.trace(`window#validateWindowState: validating window state on ${n.length} display(s)`,s),typeof s.x!="number"||typeof s.y!="number"||typeof s.width!="number"||typeof s.height!="number"){r.trace("window#validateWindowState: unexpected type of state values");return}if(s.width<=0||s.height<=0){r.trace("window#validateWindowState: unexpected negative values");return}if(n.length===1){const l=i(n[0]);if(r.trace("window#validateWindowState: single monitor working area",l),l){let u=function(){!s||typeof s.x!="number"||typeof s.y!="number"||!l||(s.x<l.x&&(s.x=l.x),s.y<l.y&&(s.y=l.y))};var o=u;u(),s.width>l.width&&(s.width=l.width),s.height>l.height&&(s.height=l.height),s.x>l.x+l.width-128&&(s.x=l.x+l.width-s.width),s.y>l.y+l.height-128&&(s.y=l.y+l.height-s.height),u()}return s}if(s.display&&s.mode===3){const l=n.find(u=>u.id===s.display);if(l&&typeof l.bounds?.x=="number"&&typeof l.bounds?.y=="number"){r.trace("window#validateWindowState: restoring fullscreen to previous display");const u=en(3);return u.x=l.bounds.x,u.y=l.bounds.y,u}}let a,c;try{a=jm.screen.getDisplayMatching({x:s.x,y:s.y,width:s.width,height:s.height}),c=i(a),r.trace("window#validateWindowState: multi-monitor working area",c)}catch(l){r.error("window#validateWindowState: error finding display for window state",l)}if(a&&c&&s.x+s.width>c.x&&s.y+s.height>c.y&&s.x<c.x+c.width&&s.y<c.y+c.height)return s;r.trace("window#validateWindowState: state is outside of the multi-monitor working area")}t.validateWindowState=e;function i(r){if(r.workArea.width>0&&r.workArea.height>0)return r.workArea;if(r.bounds.width>0&&r.bounds.height>0)return r.bounds}})(Td||(Td={}))}});import cr from"electron";var Kc,ze,y4,S4,Wd,ft=g({"out-build/vs/platform/lifecycle/electron-main/lifecycleMainService.js"(){"use strict";nr(),ae(),q(),L(),z(),Wr(),xe(),G(),K(),Vi(),ct(),ut(),ze=j("lifecycleMainService"),(function(t){t[t.QUIT=1]="QUIT",t[t.KILL=2]="KILL"})(y4||(y4={})),(function(t){t[t.Starting=1]="Starting",t[t.Ready=2]="Ready",t[t.AfterWindowOpen=3]="AfterWindowOpen",t[t.Eventually=4]="Eventually"})(S4||(S4={})),Wd=class extends N{static{Kc=this}static{this.QUIT_AND_RESTART_KEY="lifecycle.quitAndRestart"}get quitRequested(){return this._quitRequested}get wasRestarted(){return this._wasRestarted}get phase(){return this._phase}constructor(e,i,r){super(),this.logService=e,this.stateService=i,this.environmentMainService=r,this._onBeforeShutdown=this._register(new D),this.onBeforeShutdown=this._onBeforeShutdown.event,this._onWillShutdown=this._register(new D),this.onWillShutdown=this._onWillShutdown.event,this._onWillLoadWindow=this._register(new D),this.onWillLoadWindow=this._onWillLoadWindow.event,this._onBeforeCloseWindow=this._register(new D),this.onBeforeCloseWindow=this._onBeforeCloseWindow.event,this._quitRequested=!1,this._wasRestarted=!1,this._phase=1,this.windowToCloseRequest=new Set,this.oneTimeListenerTokenGenerator=0,this.windowCounter=0,this.pendingQuitPromise=void 0,this.pendingQuitPromiseResolve=void 0,this.pendingWillShutdownPromise=void 0,this.mapWindowIdToPendingUnload=new Map,this.phaseWhen=new Map,this.relaunchHandler=void 0,this.resolveRestarted(),this.when(2).then(()=>this.registerListeners())}resolveRestarted(){this._wasRestarted=!!this.stateService.getItem(Kc.QUIT_AND_RESTART_KEY),this._wasRestarted&&this.stateService.removeItem(Kc.QUIT_AND_RESTART_KEY)}registerListeners(){const e=()=>{this._quitRequested||(this.trace("Lifecycle#app.on(before-quit)"),this._quitRequested=!0,this.trace("Lifecycle#onBeforeShutdown.fire()"),this._onBeforeShutdown.fire(),O&&this.windowCounter===0&&this.fireOnWillShutdown(1))};cr.app.addListener("before-quit",e);const i=()=>{this.trace("Lifecycle#app.on(window-all-closed)"),(this._quitRequested||!O)&&cr.app.quit()};cr.app.addListener("window-all-closed",i),cr.app.once("will-quit",r=>{this.trace("Lifecycle#app.on(will-quit) - begin"),r.preventDefault(),this.fireOnWillShutdown(1).finally(()=>{this.trace("Lifecycle#app.on(will-quit) - after fireOnWillShutdown"),this.resolvePendingQuitPromise(!1),cr.app.removeListener("before-quit",e),cr.app.removeListener("window-all-closed",i),this.trace("Lifecycle#app.on(will-quit) - calling app.quit()"),cr.app.quit()})})}fireOnWillShutdown(e){if(this.pendingWillShutdownPromise)return this.pendingWillShutdownPromise;const i=this.logService;this.trace("Lifecycle#onWillShutdown.fire()");const r=[];return this._onWillShutdown.fire({reason:e,join(s,n){i.trace(`Lifecycle#onWillShutdown - begin '${s}'`),r.push(n.finally(()=>{i.trace(`Lifecycle#onWillShutdown - end '${s}'`)}))}}),this.pendingWillShutdownPromise=(async()=>{try{await Ht.settled(r)}catch(s){this.logService.error(s)}try{await this.stateService.close()}catch(s){this.logService.error(s)}})(),this.pendingWillShutdownPromise}set phase(e){if(e<this.phase)throw new Error("Lifecycle cannot go backwards");if(this._phase===e)return;this.trace(`lifecycle (main): phase changed (value: ${e})`),this._phase=e;const i=this.phaseWhen.get(this._phase);i&&(i.open(),this.phaseWhen.delete(this._phase))}async when(e){if(e<=this._phase)return;let i=this.phaseWhen.get(e);i||(i=new Tc,this.phaseWhen.set(e,i)),await i.wait()}registerWindow(e){const i=new ke;this.windowCounter++,i.add(e.onWillLoad(s=>this._onWillLoadWindow.fire({window:e,workspace:s.workspace,reason:s.reason})));let r=e.win&&i.add(P.fromNodeEventEmitter(e.win,"close")(s=>{const n=e.id;if(this.windowToCloseRequest.has(n)){this.windowToCloseRequest.delete(n);return}this.trace(`Lifecycle#window.on('close') - window ID ${e.id}`),s.preventDefault(),this.unload(e,1).then(o=>{if(o){this.windowToCloseRequest.delete(n);return}this.windowToCloseRequest.add(n),this.trace(`Lifecycle#onBeforeCloseWindow.fire() - window ID ${n}`),this._onBeforeCloseWindow.fire(e),e.close()})}));i.add(e.onDidClose(()=>{this.trace(`Lifecycle#window.on('closed') - window ID ${e.id}`),this.windowCounter--,i.dispose(),this.windowCounter===0&&(!O||this._quitRequested)&&this.fireOnWillShutdown(1)}))}registerAuxWindow(e){const i=Fu(e.win),r=new ke;r.add(P.fromNodeEventEmitter(i,"close")(s=>{this.trace(`Lifecycle#auxWindow.on('close') - window ID ${e.id}`),this._quitRequested&&(this.trace("Lifecycle#auxWindow.on('close') - preventDefault() because quit requested"),s.preventDefault())})),r.add(P.fromNodeEventEmitter(i,"closed")(()=>{this.trace(`Lifecycle#auxWindow.on('closed') - window ID ${e.id}`),r.dispose()}))}async reload(e,i){await this.unload(e,3)||e.reload(i)}unload(e,i){const r=this.mapWindowIdToPendingUnload.get(e.id);if(r)return r;const s=this.doUnload(e,i).finally(()=>{this.mapWindowIdToPendingUnload.delete(e.id)});return this.mapWindowIdToPendingUnload.set(e.id,s),s}async doUnload(e,i){if(!e.isReady)return!1;this.trace(`Lifecycle#unload() - window ID ${e.id}`);const r=this._quitRequested?2:i,s=await this.onBeforeUnloadWindowInRenderer(e,r);return s?(this.trace(`Lifecycle#unload() - veto in renderer (window ID ${e.id})`),this.handleWindowUnloadVeto(s)):(await this.onWillUnloadWindowInRenderer(e,r),!1)}handleWindowUnloadVeto(e){return e?(this.resolvePendingQuitPromise(!0),this._quitRequested=!1,!0):!1}resolvePendingQuitPromise(e){this.pendingQuitPromiseResolve&&(this.pendingQuitPromiseResolve(e),this.pendingQuitPromiseResolve=void 0,this.pendingQuitPromise=void 0)}onBeforeUnloadWindowInRenderer(e,i){return new Promise(r=>{const s=this.oneTimeListenerTokenGenerator++,n=`vscode:ok${s}`,o=`vscode:cancel${s}`;We.once(n,()=>{r(!1)}),We.once(o,()=>{r(!0)}),e.send("vscode:onBeforeUnload",{okChannel:n,cancelChannel:o,reason:i})})}onWillUnloadWindowInRenderer(e,i){return new Promise(r=>{const n=`vscode:reply${this.oneTimeListenerTokenGenerator++}`;We.once(n,()=>r()),e.send("vscode:onWillUnload",{replyChannel:n,reason:i})})}quit(e){return this.doQuit(e).then(i=>{if(!i&&e)try{if(B){const r=fs();r!==process.cwd()&&process.chdir(r)}}catch(r){this.logService.error(r)}return i})}doQuit(e){return this.trace(`Lifecycle#quit() - begin (willRestart: ${e})`),this.pendingQuitPromise?(this.trace("Lifecycle#quit() - returning pending quit promise"),this.pendingQuitPromise):(e&&this.stateService.setItem(Kc.QUIT_AND_RESTART_KEY,!0),this.pendingQuitPromise=new Promise(i=>{this.pendingQuitPromiseResolve=i,this.trace("Lifecycle#quit() - calling app.quit()"),cr.app.quit()}),this.pendingQuitPromise)}trace(e){this.environmentMainService.args["enable-smoke-test-driver"]?this.logService.info(e):this.logService.trace(e)}setRelaunchHandler(e){this.relaunchHandler=e}async relaunch(e){this.trace("Lifecycle#relaunch()");const i=process.argv.slice(1);if(e?.addArgs&&i.push(...e.addArgs),e?.removeArgs)for(const n of e.removeArgs){const o=i.indexOf(n);o>=0&&i.splice(o,1)}const r=()=>{this.relaunchHandler?.handleRelaunch(e)||(this.trace("Lifecycle#relaunch() - calling app.relaunch()"),cr.app.relaunch({args:i}))};cr.app.once("quit",r),await this.quit(!0)&&cr.app.removeListener("quit",r)}async kill(e){this.trace("Lifecycle#kill()"),await this.fireOnWillShutdown(2),await Promise.race([Pi(1e3),(async()=>{for(const i of Gc())if(i&&!i.isDestroyed()){let r;i.webContents&&!i.webContents.isDestroyed()?r=new Promise(s=>i.once("closed",s)):r=Promise.resolve(),i.destroy(),await r}})()]),cr.app.exit(e)}},Wd=Kc=__decorate([__param(0,V),__param(1,Ii),__param(2,st)],Wd)}}),Hr,Ai,Yc,Hm,_4=g({"out-build/vs/base/parts/storage/common/storage.js"(){"use strict";ae(),q(),L(),rd(),xe(),(function(t){t[t.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",t[t.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(Hr||(Hr={})),(function(t){t[t.None=0]="None",t[t.Initialized=1]="Initialized",t[t.Closed=2]="Closed"})(Ai||(Ai={})),Yc=class k8 extends N{static{this.DEFAULT_FLUSH_DELAY=100}constructor(e,i=Object.create(null)){super(),this.database=e,this.options=i,this._onDidChangeStorage=this._register(new $u),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Ai.None,this.cache=new Map,this.flushDelayer=this._register(new ws(k8.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((i,r)=>this.acceptExternal(r,i)),e.deleted?.forEach(i=>this.acceptExternal(i,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,i){if(this.state===Ai.Closed)return;let r=!1;ci(i)?r=this.cache.delete(e):this.cache.get(e)!==i&&(this.cache.set(e,i),r=!0),r&&this._onDidChangeStorage.fire({key:e,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===Ai.None&&(this.state=Ai.Initialized,this.options.hint!==Hr.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}cursorDiskKVGet(e){return this.database.cursorDiskKVGet(e)}cursorDiskKVSet(e,i){return this.database.cursorDiskKVSet(e,i)}cursorDiskKVClearPrefix(e){return this.database.cursorDiskKVClearPrefix(e)}get(e,i){const r=this.cache.get(e);return ci(r)?i:r}getBoolean(e,i){const r=this.get(e);return ci(r)?i:r==="true"}getNumber(e,i){const r=this.get(e);return ci(r)?i:parseInt(r,10)}getObject(e,i){const r=this.get(e);return ci(r)?i:mI(r)}async set(e,i,r=!1){if(this.state===Ai.Closed)return;if(ci(i))return this.delete(e,r);const s=Lt(i)||Array.isArray(i)?gI(i):String(i);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:r}),this.doFlush()}async delete(e,i=!1){if(!(this.state===Ai.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async optimize(){if(this.state!==Ai.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=Ai.Closed;try{await this.doFlush(0)}catch{}await this.database.close(()=>this.cache)}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(!(this.state===Ai.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===Hr.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}isInMemory(){return this.options.hint===Hr.STORAGE_IN_MEMORY}},Hm=class{constructor(){this.onDidChangeItemsExternal=P.None,this.items=new Map}async getItems(){return this.items}async cursorDiskKVGet(t){}async cursorDiskKVSet(t,e){}async cursorDiskKVClearPrefix(t){}async updateItems(t){t.insert?.forEach((e,i)=>this.items.set(i,e)),t.delete?.forEach(e=>this.items.delete(e))}async optimize(){}async close(){}}}});function Ri(t){const e=t;return typeof e?.id=="string"&&x.isUri(e.uri)}function Ld(t,e){if(typeof t=="string"||typeof t>"u")return typeof t=="string"?{id:tt(t)}:e?k4:P4;const i=t;return i.configuration?{id:i.id,configPath:i.configuration}:i.folders.length===1?{id:i.id,uri:i.folders[0].uri}:{id:i.id}}function zt(t){const e=t;return typeof e?.id=="string"&&x.isUri(e.configPath)}function b4(t){const e=t;if(e?.uri)return{id:e.id,uri:x.revive(e.uri)};const i=t;if(i?.configPath)return{id:i.id,configPath:x.revive(i.configPath)};if(t?.id)return{id:t.id}}function E4(t,e){return rt.isEqualOrParent(t,e.untitledWorkspacesHome)}function Un(t){return(typeof t=="string"?Hu(t):ZS(t))===I4}var p3,k4,P4,x4,C4,Jc,I4,D4,Vm,hi=g({"out-build/vs/platform/workspace/common/workspace.js"(){"use strict";we(),ye(),Tn(),gt(),re(),G(),Ie(),p3=j("contextService"),k4={id:"ext-dev"},P4={id:"empty-window"},(function(t){t[t.EMPTY=1]="EMPTY",t[t.FOLDER=2]="FOLDER",t[t.WORKSPACE=3]="WORKSPACE"})(x4||(x4={})),C4=class{constructor(t,e){this.raw=e,this.uri=t.uri,this.index=t.index,this.name=t.name}toResource(t){return pe(this.uri,t)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}},Jc="code-workspace",I4=`.${Jc}`,D4=[{name:w(2652,null),extensions:[Jc]}],Vm="workspace.json"}}),Mi,Vr=g({"out-build/vs/platform/uriIdentity/common/uriIdentity.js"(){"use strict";G(),Mi=j("IUriIdentityService")}});function g3(t){const e=t;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&typeof e.isDefault=="boolean"&&typeof e.name=="string"&&x.isUri(e.location)&&x.isUri(e.globalStorageHome)&&x.isUri(e.settingsResource)&&x.isUri(e.keybindingsResource)&&x.isUri(e.tasksResource)&&x.isUri(e.snippetsHome)&&x.isUri(e.promptsHome)&&x.isUri(e.extensionsResource))}function Od(t,e,i,r,s,n){return{id:t,name:e,location:i,isDefault:!1,icon:s?.icon,globalStorageHome:n&&s?.useDefaultFlags?.globalState?n.globalStorageHome:pe(i,"globalStorage"),settingsResource:n&&s?.useDefaultFlags?.settings?n.settingsResource:pe(i,"settings.json"),keybindingsResource:n&&s?.useDefaultFlags?.keybindings?n.keybindingsResource:pe(i,"keybindings.json"),tasksResource:n&&s?.useDefaultFlags?.tasks?n.tasksResource:pe(i,"tasks.json"),snippetsHome:n&&s?.useDefaultFlags?.snippets?n.snippetsHome:pe(i,"snippets"),promptsHome:n&&s?.useDefaultFlags?.prompts?n.promptsHome:pe(i,"prompts"),extensionsResource:n&&s?.useDefaultFlags?.extensions?n.extensionsResource:pe(i,"extensions.json"),cacheHome:pe(r,t),useDefaultFlags:s?.useDefaultFlags,isTransient:s?.transient,workspaces:s?.workspaces}}var A4,qr,Fd,zr=g({"out-build/vs/platform/userDataProfile/common/userDataProfile.js"(){"use strict";_s(),q(),L(),gt(),re(),we(),xi(),Ze(),G(),K(),hi(),Vr(),ae(),Hi(),jt(),xe(),(function(t){t.Settings="settings",t.Keybindings="keybindings",t.Snippets="snippets",t.Prompts="prompts",t.Tasks="tasks",t.Extensions="extensions",t.GlobalState="globalState"})(A4||(A4={})),qr=j("IUserDataProfilesService"),Fd=class extends N{static{this.PROFILES_KEY="userDataProfiles"}static{this.PROFILE_ASSOCIATIONS_KEY="profileAssociations"}get defaultProfile(){return this.profiles[0]}get profiles(){return[...this.profilesObject.profiles,...this.transientProfilesObject.profiles]}constructor(e,i,r,s){super(),this.environmentService=e,this.fileService=i,this.uriIdentityService=r,this.logService=s,this._onDidChangeProfiles=this._register(new D),this.onDidChangeProfiles=this._onDidChangeProfiles.event,this._onWillCreateProfile=this._register(new D),this.onWillCreateProfile=this._onWillCreateProfile.event,this._onWillRemoveProfile=this._register(new D),this.onWillRemoveProfile=this._onWillRemoveProfile.event,this._onDidResetWorkspaces=this._register(new D),this.onDidResetWorkspaces=this._onDidResetWorkspaces.event,this.profileCreationPromises=new Map,this.transientProfilesObject={profiles:[],emptyWindows:new Map},this.profilesHome=pe(this.environmentService.userRoamingDataHome,"profiles"),this.profilesCacheHome=pe(this.environmentService.cacheHome,"CachedProfilesData")}init(){this._profilesObject=void 0}get profilesObject(){if(!this._profilesObject){const e=this.createDefaultProfile(),i=[e];try{for(const s of this.getStoredProfiles()){if(!s.name||!At(s.name)||!s.location){this.logService.warn("Skipping the invalid stored profile",s.location||s.name);continue}i.push(Od(Nr(s.location),s.name,s.location,this.profilesCacheHome,{icon:s.icon,useDefaultFlags:s.useDefaultFlags},e))}}catch(s){this.logService.error(s)}const r=new Map;if(i.length)try{const s=this.getStoredProfileAssociations();if(s.workspaces)for(const[n,o]of Object.entries(s.workspaces)){const a=x.parse(n),c=i.find(l=>l.id===o);if(c){const l=c.workspaces?c.workspaces.slice(0):[];l.push(a),c.workspaces=l}}if(s.emptyWindows)for(const[n,o]of Object.entries(s.emptyWindows)){const a=i.find(c=>c.id===o);a&&r.set(n,a)}}catch(s){this.logService.error(s)}this._profilesObject={profiles:i,emptyWindows:r}}return this._profilesObject}createDefaultProfile(){const e=Od("__default__profile__",w(2605,null),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){const i="Temp",r=new RegExp(`${fc(i)}\\s(\\d+)`);let s=0;for(const o of this.profiles){const a=r.exec(o.name),c=a?parseInt(a[1]):0;s=c>s?c:s}const n=`${i} ${s+1}`;return this.createProfile(Ur(ui()).toString(16),n,{transient:!0},e)}async createNamedProfile(e,i,r){return this.createProfile(Ur(ui()).toString(16),e,i,r)}async createProfile(e,i,r,s){return await this.doCreateProfile(e,i,r,s)}async doCreateProfile(e,i,r,s){if(!At(i)||!i)throw new Error("Name of the profile is mandatory and must be of type `string`");let n=this.profileCreationPromises.get(i);return n||(n=(async()=>{try{if(this.profiles.find(u=>u.id===e||!u.isTransient&&!r?.transient&&u.name===i))throw new Error(`Profile with ${i} name already exists`);const a=s?this.getWorkspace(s):void 0;x.isUri(a)&&(r={...r,workspaces:[a]});const c=Od(e,i,pe(this.profilesHome,e),this.profilesCacheHome,r,this.defaultProfile);await this.fileService.createFolder(c.location);const l=[];return this._onWillCreateProfile.fire({profile:c,join(u){l.push(u)}}),await Ht.settled(l),a&&!x.isUri(a)&&this.updateEmptyWindowAssociation(a,c,!!c.isTransient),this.updateProfiles([c],[],[]),c}finally{this.profileCreationPromises.delete(i)}})(),this.profileCreationPromises.set(i,n)),n}async updateProfile(e,i){const r=[];for(const n of this.profiles){let o;if(e.id===n.id)n.isDefault?i.workspaces&&(o=n,o.workspaces=i.workspaces):o=Od(n.id,i.name??n.name,n.location,this.profilesCacheHome,{icon:i.icon===null?void 0:i.icon??n.icon,transient:i.transient??n.isTransient,useDefaultFlags:i.useDefaultFlags??n.useDefaultFlags,workspaces:i.workspaces??n.workspaces},this.defaultProfile);else if(i.workspaces){const a=n.workspaces?.filter(c=>!i.workspaces?.some(l=>this.uriIdentityService.extUri.isEqual(c,l)));n.workspaces?.length!==a?.length&&(o=n,o.workspaces=a)}o&&r.push(o)}if(!r.length)throw e.isDefault?new Error("Cannot update default profile"):new Error(`Profile '${e.name}' does not exist`);this.updateProfiles([],[],r);const s=this.profiles.find(n=>n.id===e.id);if(!s)throw new Error(`Profile '${e.name}' was not updated`);return s}async removeProfile(e){if(e.isDefault)throw new Error("Cannot remove default profile");const i=this.profiles.find(s=>s.id===e.id);if(!i)throw new Error(`Profile '${e.name}' does not exist`);const r=[];this._onWillRemoveProfile.fire({profile:i,join(s){r.push(s)}});try{await Promise.allSettled(r)}catch(s){this.logService.error(s)}this.updateProfiles([],[i],[]);try{await this.fileService.del(i.cacheHome,{recursive:!0})}catch(s){jr(s)!==1&&this.logService.error(s)}}async setProfileForWorkspace(e,i){const r=this.profiles.find(n=>n.id===i.id);if(!r)throw new Error(`Profile '${i.name}' does not exist`);const s=this.getWorkspace(e);if(x.isUri(s)){const n=r.workspaces?[...r.workspaces]:[];n.some(o=>this.uriIdentityService.extUri.isEqual(o,s))||(n.push(s),await this.updateProfile(r,{workspaces:n}))}else this.updateEmptyWindowAssociation(s,r,!1),this.updateStoredProfiles(this.profiles)}unsetWorkspace(e,i=!1){const r=this.getWorkspace(e);if(x.isUri(r)){const s=this.getProfileForWorkspace(e);s&&this.updateProfile(s,{workspaces:s.workspaces?.filter(n=>!this.uriIdentityService.extUri.isEqual(n,r))})}else this.updateEmptyWindowAssociation(r,void 0,i),this.updateStoredProfiles(this.profiles)}async resetWorkspaces(){this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.emptyWindows.clear();for(const e of this.profiles)e.workspaces=void 0;this.updateProfiles([],[],this.profiles),this._onDidResetWorkspaces.fire()}async cleanUp(){if(await this.fileService.exists(this.profilesHome)){const e=await this.fileService.resolve(this.profilesHome);await Promise.all((e.children||[]).filter(i=>i.isDirectory&&this.profiles.every(r=>!this.uriIdentityService.extUri.isEqual(r.location,i.resource))).map(i=>this.fileService.del(i.resource,{recursive:!0})))}}async cleanUpTransientProfiles(){const e=this.transientProfilesObject.profiles.filter(i=>!this.isProfileAssociatedToWorkspace(i));await Promise.allSettled(e.map(i=>this.removeProfile(i)))}getProfileForWorkspace(e){const i=this.getWorkspace(e);return x.isUri(i)?this.profiles.find(r=>r.workspaces?.some(s=>this.uriIdentityService.extUri.isEqual(s,i))):this.profilesObject.emptyWindows.get(i)??this.transientProfilesObject.emptyWindows.get(i)}getWorkspace(e){return Ri(e)?e.uri:zt(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!(e.workspaces?.length||[...this.profilesObject.emptyWindows.values()].some(i=>this.uriIdentityService.extUri.isEqual(i.location,e.location))||[...this.transientProfilesObject.emptyWindows.values()].some(i=>this.uriIdentityService.extUri.isEqual(i.location,e.location)))}updateProfiles(e,i,r){const s=[...this.profiles,...e],n=this.transientProfilesObject.profiles;this.transientProfilesObject.profiles=[];const o=[];for(let a of s){if(i.some(c=>a.id===c.id)){for(const c of[...this.profilesObject.emptyWindows.keys()])a.id===this.profilesObject.emptyWindows.get(c)?.id&&this.profilesObject.emptyWindows.delete(c);continue}if(!a.isDefault){a=r.find(l=>a.id===l.id)??a;const c=n.find(l=>a.id===l.id);if(a.isTransient)this.transientProfilesObject.profiles.push(a);else if(c){for(const[l,u]of this.transientProfilesObject.emptyWindows.entries())if(a.id===u.id){this.transientProfilesObject.emptyWindows.delete(l),this.profilesObject.emptyWindows.set(l,a);break}}}a.workspaces?.length===0&&(a.workspaces=void 0),o.push(a)}this.updateStoredProfiles(o),this.triggerProfilesChanges(e,i,r)}triggerProfilesChanges(e,i,r){this._onDidChangeProfiles.fire({added:e,removed:i,updated:r,all:this.profiles})}updateEmptyWindowAssociation(e,i,r){r=i?.isTransient?!0:r,r?i?this.transientProfilesObject.emptyWindows.set(e,i):this.transientProfilesObject.emptyWindows.delete(e):(this.transientProfilesObject.emptyWindows.delete(e),i?this.profilesObject.emptyWindows.set(e,i):this.profilesObject.emptyWindows.delete(e))}updateStoredProfiles(e){const i=[],r={},s={};for(const n of e)if(!n.isTransient&&(n.isDefault||i.push({location:n.location,name:n.name,icon:n.icon,useDefaultFlags:n.useDefaultFlags}),n.workspaces))for(const o of n.workspaces)r[o.toString()]=n.id;for(const[n,o]of this.profilesObject.emptyWindows.entries())s[n.toString()]=o.id;this.saveStoredProfileAssociations({workspaces:r,emptyWindows:s}),this.saveStoredProfiles(i),this._profilesObject=void 0}getStoredProfiles(){return[]}saveStoredProfiles(e){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}},Fd=__decorate([__param(0,or),__param(1,mt),__param(2,Mi),__param(3,V)],Fd)}});function qm(t){const e=t.get(Ps);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}function zm(t){return t.isDefault||!!t.useDefaultFlags?.globalState}async function m3(t,e,i,r,s,n){const o=m=>{try{return JSON.parse(m)}catch{return m}},a=new Map,c=new Map;t.forEach((m,y)=>{a.set(y,m),c.set(y,o(m))});const l=new Map,u=new Map;e.forEach((m,y)=>{l.set(y,m),u.set(y,o(m))});const d=new Map,f=new Map;i.forEach((m,y)=>{d.set(y,m),f.set(y,o(m))}),console.group(r!==s?`Storage: Application (path: ${r})`:`Storage: Application & Profile (path: ${r}, default profile)`);const p=[];if(a.forEach((m,y)=>{p.push({key:y,value:m})}),console.table(p),console.groupEnd(),console.log(c),r!==s){console.group(`Storage: Profile (path: ${s}, profile specific)`);const m=[];l.forEach((y,S)=>{m.push({key:S,value:y})}),console.table(m),console.groupEnd(),console.log(u)}console.group(`Storage: Workspace (path: ${n})`);const v=[];d.forEach((m,y)=>{v.push({key:y,value:m})}),console.table(v),console.groupEnd(),console.log(f)}var Qc,Ps,v3,Qo,R4,M4,T4,Gm=g({"out-build/vs/platform/storage/common/storage.js"(){"use strict";ae(),q(),L(),ls(),xe(),_4(),G(),zr(),Qc="__$__isNewStorageMarker",Ps="__$__targetStorageMarker",v3=j("storageService"),(function(t){t[t.NONE=0]="NONE",t[t.SHUTDOWN=1]="SHUTDOWN"})(Qo||(Qo={})),(function(t){t[t.APPLICATION=-1]="APPLICATION",t[t.PROFILE=0]="PROFILE",t[t.WORKSPACE=1]="WORKSPACE"})(R4||(R4={})),(function(t){t[t.USER=0]="USER",t[t.MACHINE=1]="MACHINE"})(M4||(M4={})),T4=class P8 extends N{static{this.DEFAULT_FLUSH_INTERVAL=60*1e3}constructor(e={flushInterval:P8.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new $u),this._onDidChangeTarget=this._register(new $u),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new D),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new $s),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this.onDiskShouldSaveCallbacks=[],this.flushWhenIdleScheduler=this._register(new br(()=>this.doFlushWhenIdle(),e.flushInterval))}onDidChangeValue(e,i,r){return P.filter(this._onDidChangeValue.event,s=>s.scope===e&&(i===void 0||s.key===i),r)}doFlushWhenIdle(){this.runFlushWhenIdle.value=Zg(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){Rt([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{Ve("code/willInitStorage");try{await this.doInitialize()}finally{Ve("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,i){const{key:r,external:s}=i;if(r===Ps){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:r,target:this.getKeyTargets(e)[r],external:s})}emitWillSaveState(e){this._onWillSaveState.fire({reason:e})}get(e,i,r){return this.getStorage(i)?.get(e,r)}getBoolean(e,i,r){return this.getStorage(i)?.getBoolean(e,r)}getNumber(e,i,r){return this.getStorage(i)?.getNumber(e,r)}getObject(e,i,r){return this.getStorage(i)?.getObject(e,r)}storeAll(e,i){this.withPausedEmitters(()=>{for(const r of e)this.store(r.key,r.value,r.scope,r.target,i)})}store(e,i,r,s,n=!1){if(ci(i)){this.remove(e,r,n);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,r,s),this.getStorage(r)?.set(e,i,n)})}remove(e,i,r=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,void 0),this.getStorage(i)?.delete(e,r)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(e,i){const r=[],s=this.getKeyTargets(e);for(const n of Object.keys(s))s[n]===i&&r.push(n);return r}updateKeyTarget(e,i,r,s=!1){const n=this.getKeyTargets(i);typeof r=="number"?n[e]!==r&&(n[e]=r,this.getStorage(i)?.set(Ps,JSON.stringify(n),s)):typeof n[e]=="number"&&(delete n[e],this.getStorage(i)?.set(Ps,JSON.stringify(n),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const i=this.getStorage(e);return i?qm(i):Object.create(null)}isNew(e){return this.getBoolean(Qc,e)===!0}async cursorDiskKVGet(e){return this.getStorage(-1)?.cursorDiskKVGet(e)}async cursorDiskKVSet(e,i){return this.getStorage(-1)?.cursorDiskKVSet(e,i)}async cursorDiskKVClearPrefix(e){return this.getStorage(-1)?.cursorDiskKVClearPrefix(e)}cursorDiskKVOnShouldSave(e){return this.onDiskShouldSaveCallbacks.push(e),{dispose:()=>{this.onDiskShouldSaveCallbacks=this.onDiskShouldSaveCallbacks.filter(i=>i!==e)}}}async flush(e=Qo.NONE){this._onWillSaveState.fire({reason:e});const i=this.getStorage(-1),r=this.getStorage(0),s=this.getStorage(1);switch(e){case Qo.NONE:for(const n of this.onDiskShouldSaveCallbacks)try{n().catch(console.error)}catch{}await Ht.settled([i?.whenFlushed()??Promise.resolve(),r?.whenFlushed()??Promise.resolve(),s?.whenFlushed()??Promise.resolve()]);break;case Qo.SHUTDOWN:for(const n of this.onDiskShouldSaveCallbacks)try{await n()}catch(o){console.error(o)}await Ht.settled([i?.flush(0)??Promise.resolve(),r?.flush(0)??Promise.resolve(),s?.flush(0)??Promise.resolve()]);break}}async log(){const e=this.getStorage(-1)?.items??new Map,i=this.getStorage(0)?.items??new Map,r=this.getStorage(1)?.items??new Map;return m3(e,i,r,this.getLogDetails(-1)??"",this.getLogDetails(0)??"",this.getLogDetails(1)??"")}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,i){return this.emitWillSaveState(Qo.NONE),g3(e)?this.switchToProfile(e,i):this.switchToWorkspace(e,i)}canSwitchProfile(e,i){return!(e.id===i.id||zm(i)&&zm(e))}switchData(e,i,r){this.withPausedEmitters(()=>{const s=new Set;for(const[n,o]of e)s.add(n),i.get(n)!==o&&this.emitDidChangeValue(r,{key:n,external:!0});for(const[n]of i.items)s.has(n)||this.emitDidChangeValue(r,{key:n,external:!0})})}}}}),w3,W4,L4,O4,Km,y3,S3,F4,N4,U4,$4,B4,Nd=g({"out-build/vs/base/common/constants.js"(){"use strict";w3=Date.now(),W4=!1,L4="cursorai.action.windowInWindowDidShow",O4="cursorai.action.windowInWindowDidHide",Km="src.vs.platform.reactivestorage.browser.reactiveStorageServiceImpl.persistentStorage",y3=`${Km}.applicationUser`,S3=`${Km}.applicationUser.subscription`,F4="workbench.panel.aichat.view",N4=F4+".aichat.chatdata",U4="composer.composerData",$4="workbench.bugbot.data",(function(t){t.Agent="agent",t.Editor="editor"})(B4||(B4={}))}});import*as j4 from"fs";var Xc,H4,_3=g({"out-build/vs/base/parts/storage/node/storage.js"(){"use strict";ae(),q(),ai(),ye(),qt(),Nd(),Xc=class vo{static{this.IN_MEMORY_PATH=":memory:"}get onDidChangeItemsExternal(){return P.None}static{this.BUSY_OPEN_TIMEOUT=2e3}static{this.MAX_HOST_PARAMETERS=256}constructor(e,i=Object.create(null)){this.path=e,this.name=tt(this.path),this.logger=new H4(i.logging),this.whenConnected=this.connect(this.path)}async cursorDiskKVGet(e){const i=await this.whenConnected;try{const r=await this.getParams(i,"SELECT value FROM cursorDiskKV WHERE key = ?",[e]);if(!r)return;const s=r.value;return s==null||typeof s!="string"?void 0:s}catch(r){this.logger.error(`[storage ${this.name}] cursorDiskKVGet(${e}): ${r}`);return}}async cursorDiskKVSet(e,i){const r=await this.whenConnected;try{await this.runParams(r,"INSERT INTO cursorDiskKV (key, value) VALUES (?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value WHERE value != excluded.value",[e,i])}catch(s){throw this.logger.error(`[storage ${this.name}] cursorDiskKVSet(${e}): ${s}`),s}}async cursorDiskKVClearPrefix(e){const i=await this.whenConnected;try{await this.runParams(i,"DELETE FROM cursorDiskKV WHERE key LIKE ? || '%'",[e])}catch(r){throw this.logger.error(`[storage ${this.name}] cursorDiskKVClearPrefix(${e}): ${r}`),r}}async getItems(){const e=await this.whenConnected,i=new Map;return await Promise.allSettled([this.ensureSmallEnoughTimeout(e,N4,{timeout:1e4,maxSizeBytes:100*1024*1024}),this.ensureSmallEnoughTimeout(e,U4,{timeout:1e4,maxSizeBytes:100*1024*1024}),this.ensureSmallEnoughTimeout(e,$4,{timeout:1e4,maxSizeBytes:50*1024*1024})]),(await this.all(e,"SELECT * FROM ItemTable")).forEach(s=>i.set(s.key,s.value)),this.logger.isTracing&&this.logger.trace(`[storage ${this.name}] getItems(): ${i.size} rows`),i}async updateItems(e){const i=await this.whenConnected;return this.doUpdateItems(i,e)}doUpdateItems(e,i){return this.logger.isTracing&&this.logger.trace(`[storage ${this.name}] updateItems(): insert(${i.insert?Px(i.insert):"0"}), delete(${i.delete?xx(i.delete):"0"})`),this.transaction(e,()=>{const r=i.insert,s=i.delete;if(r&&r.size>0){const n=[];n.push([]);let o=0;r.forEach((a,c)=>{let l=n[o];l.length>vo.MAX_HOST_PARAMETERS&&(o++,l=[],n.push(l)),l.push(c,a)}),n.forEach(a=>{this.prepare(e,`INSERT INTO ItemTable VALUES ${new Array(a.length/2).fill("(?,?)").join(",")} ON CONFLICT (key) DO UPDATE SET value = excluded.value WHERE value != excluded.value`,c=>c.run(a),()=>{const c=[];let l=0;return r.forEach((u,d)=>{c.push(d),l+=u.length}),`Keys: ${c.join(", ")} Length: ${l}`})})}if(s&&s.size){const n=[];n.push([]);let o=0;s.forEach(a=>{let c=n[o];c.length>vo.MAX_HOST_PARAMETERS&&(o++,c=[],n.push(c)),c.push(a)}),n.forEach(a=>{this.prepare(e,`DELETE FROM ItemTable WHERE key IN (${new Array(a.length).fill("?").join(",")})`,c=>c.run(a),()=>{const c=[];return s.forEach(l=>{c.push(l)}),`Keys: ${c.join(", ")}`})})}})}async optimize(){this.logger.trace(`[storage ${this.name}] vacuum()`);const e=await this.whenConnected;return this.exec(e,"VACUUM")}async close(e){this.logger.trace(`[storage ${this.name}] close()`);const i=await this.whenConnected;return this.doClose(i,e)}doClose(e,i){return new Promise((r,s)=>{e.db.close(n=>(n&&this.handleSQLiteError(e,`[storage ${this.name}] close(): ${n}`),this.path===vo.IN_MEMORY_PATH?r():!e.isErroneous&&!e.isInMemory?this.backup().then(r,o=>(this.logger.error(`[storage ${this.name}] backup(): ${o}`),r())):typeof i=="function"?j4.promises.unlink(this.path).then(()=>this.doConnect(this.path).then(o=>{const a=()=>this.doClose(o,void 0);return this.doUpdateItems(o,{insert:i()}).then(()=>a(),c=>(a(),Promise.reject(c)))})).then(r,s):s(n||new Error("Database has errors or is in-memory without recovery option"))))})}backup(){const e=this.toBackupPath(this.path);return te.copy(this.path,e,{preserveSymlinks:!1})}toBackupPath(e){return`${e}.backup`}async checkIntegrity(e){this.logger.trace(`[storage ${this.name}] checkIntegrity(full: ${e})`);const i=await this.whenConnected,r=await this.get(i,e?"PRAGMA integrity_check":"PRAGMA quick_check"),s=e?r.integrity_check:r.quick_check;return i.isErroneous?`${s} (last error: ${i.lastError})`:i.isInMemory?`${s} (in-memory!)`:s}async connect(e,i=!0){this.logger.trace(`[storage ${this.name}] open(${e}, retryOnBusy: ${i})`);try{return await this.doConnect(e)}catch(r){if(this.logger.error(`[storage ${this.name}] open(): Unable to open DB due to ${r}`),r.code==="SQLITE_BUSY"&&i)return await Pi(vo.BUSY_OPEN_TIMEOUT),this.connect(e,!1);try{await j4.promises.unlink(e);try{await te.rename(this.toBackupPath(e),e,!1)}catch{}return await this.doConnect(e)}catch(s){return this.logger.error(`[storage ${this.name}] open(): Unable to use backup due to ${s}`),this.doConnect(vo.IN_MEMORY_PATH)}}}handleSQLiteError(e,i){e.isErroneous=!0,e.lastError=i,this.logger.error(i)}doConnect(e){return new Promise((i,r)=>{import("@vscode/sqlite3").then(s=>{const n=this.logger.isTracing?s.default.verbose().Database:s.default.Database,o={db:new n(e,a=>a?o.db&&a.code!=="SQLITE_CANTOPEN"?o.db.close(()=>r(a)):r(a):this.exec(o,["PRAGMA user_version = 1;","CREATE TABLE IF NOT EXISTS ItemTable (key TEXT UNIQUE ON CONFLICT REPLACE, value BLOB);","CREATE TABLE IF NOT EXISTS cursorDiskKV (key TEXT UNIQUE ON CONFLICT REPLACE, value BLOB);"].join("")).then(()=>i(o),c=>o.db.close(()=>r(c)))),isInMemory:e===vo.IN_MEMORY_PATH};o.db.on("error",a=>this.handleSQLiteError(o,`[storage ${this.name}] Error (event): ${a}`)),this.logger.isTracing&&o.db.on("trace",a=>this.logger.trace(`[storage ${this.name}] Trace (event): ${a}`))},r)})}exec(e,i){return new Promise((r,s)=>{e.db.exec(i,n=>n?(this.handleSQLiteError(e,`[storage ${this.name}] exec(): ${n}`),s(n)):r())})}get(e,i){return new Promise((r,s)=>{e.db.get(i,(n,o)=>n?(this.handleSQLiteError(e,`[storage ${this.name}] get(): ${n}`),s(n)):r(o))})}getParams(e,i,r){return new Promise((s,n)=>{e.db.get(i,r,(o,a)=>o?(this.handleSQLiteError(e,`[storage ${this.name}] getParams(): ${o}`),n(o)):s(a))})}async ensureSmallEnoughTimeout(e,i,r){await Promise.race([this.ensureSmallEnough(e,i,r.maxSizeBytes),new Promise((n,o)=>setTimeout(()=>n(!1),r.timeout))])===!1&&await this.updateItems({delete:new Set([i])})}async ensureSmallEnough(e,i,r){try{const s=await new Promise((n,o)=>{e.db.all(`SELECT LENGTH(value) as size FROM ItemTable WHERE key = '${i}'`,(a,c)=>a?(this.handleSQLiteError(e,`[storage ${this.name}] getSize(${i}): ${a}`),o(a)):c.length===0?n(0):c.length!==1?o(new Error(`Unexpected number of rows - ${c.length}`)):n(c[0].size))});this.logger.trace(`[storage ${this.name}] ${i} is ${s} bytes and can be at most ${r} bytes`),s>r&&(this.logger.error(`[storage ${this.name}] ${i} is too large (${s} > ${r}), clearing`),await this.updateItems({delete:new Set([i])}))}catch(s){this.logger.error(`[storage ${this.name}] error checking size of ${i}: ${s}`)}}all(e,i){return new Promise((r,s)=>{e.db.all(i,(n,o)=>n?(this.handleSQLiteError(e,`[storage ${this.name}] all(): ${n}`),s(n)):r(o))})}transaction(e,i){return new Promise((r,s)=>{e.db.serialize(()=>{e.db.run("BEGIN TRANSACTION"),i(),e.db.run("END TRANSACTION",n=>n?(this.handleSQLiteError(e,`[storage ${this.name}] transaction(): ${n}`),s(n)):r())})})}prepare(e,i,r,s){const n=e.db.prepare(i),o=a=>{this.handleSQLiteError(e,`[storage ${this.name}] prepare(): ${a} (${i}). Details: ${s()}`)};n.on("error",o),r(n),n.finalize(a=>{a&&o(a),n.removeListener("error",o)})}runParams(e,i,r){return new Promise((s,n)=>{e.db.run(i,r,o=>o?(this.handleSQLiteError(e,`[storage ${this.name}] runParams(): ${o}`),n(o)):s())})}},H4=class x8{static{this.VSCODE_TRACE_STORAGE="VSCODE_TRACE_STORAGE"}constructor(e){e&&typeof e.logTrace=="function"&&process.env[x8.VSCODE_TRACE_STORAGE]&&(this.logTrace=e.logTrace),e&&typeof e.logError=="function"&&(this.logError=e.logError)}get isTracing(){return!!this.logTrace}trace(e){this.logTrace?.(e)}error(e){this.logError?.(e)}}}}),ei,b3,Ym,Jm,V4,Qm,Xm,Zm,Ud,q4,Zc,e1,$d,z4,G4,E3,ti=g({"out-build/vs/platform/telemetry/common/telemetry.js"(){"use strict";G(),ei=j("telemetryService"),b3=j("customEndpointTelemetryService"),Ym="telemetry.currentSessionDate",Jm="telemetry.firstSessionDate",V4="telemetry.lastSessionDate",Qm="telemetry.machineId",Xm="telemetry.macMachineId",Zm="telemetry.sqmId",Ud="telemetry.devDeviceId",q4="crashReporting",Zc="crashReporting.enabled",e1="telemetry.enableCrashReporter",$d="telemetry.enableTelemetry",(function(t){t[t.NONE=0]="NONE",t[t.CRASH=1]="CRASH",t[t.ERROR=2]="ERROR",t[t.USAGE=3]="USAGE"})(z4||(z4={})),(function(t){t.OFF="off",t.ON="all"})(G4||(G4={})),E3=j("mainProcessPerformanceTelemetryService")}});function k3(t,e){switch(t){case 3:return e==="x64"?"win32-x64":e==="arm64"?"win32-arm64":"unknown";case 2:return e==="x64"?"linux-x64":e==="arm64"?"linux-arm64":e==="arm"?"linux-armhf":"unknown";case"alpine":return e==="x64"?"alpine-x64":e==="arm64"?"alpine-arm64":"unknown";case 1:return e==="x64"?"darwin-x64":e==="arm64"?"darwin-arm64":"unknown";case 0:return"web"}}function P3(t){return t&&typeof t=="object"&&typeof t.id=="string"&&(!t.uuid||typeof t.uuid=="string")}var K4,x3,Y4,J4,Q4,X4,Z4,e2,C3,t2,i2,t1,I3,r2,D3,A3,R3,M3,T3,Bd=g({"out-build/vs/platform/extensionManagement/common/extensionManagement.js"(){"use strict";we(),G(),K4="^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$",x3=new RegExp(K4),(function(t){t.COMMAND="command",t.SETTINGS_SYNC="settingsSync"})(Y4||(Y4={})),(function(t){t.NoneOrRelevance="NoneOrRelevance",t.LastUpdatedDate="LastUpdatedDate",t.Title="Title",t.PublisherName="PublisherName",t.InstallCount="InstallCount",t.PublishedDate="PublishedDate",t.AverageRating="AverageRating",t.WeightedRating="WeightedRating"})(J4||(J4={})),(function(t){t[t.Default=0]="Default",t[t.Ascending=1]="Ascending",t[t.Descending=2]="Descending"})(Q4||(Q4={})),(function(t){t.Category="Category",t.ExtensionId="ExtensionId",t.ExtensionName="ExtensionName",t.ExcludeWithFlags="ExcludeWithFlags",t.Featured="Featured",t.SearchText="SearchText",t.Tag="Tag",t.Target="Target"})(X4||(X4={})),(function(t){t.Install="install",t.Uninstall="uninstall"})(Z4||(Z4={})),(function(t){t[t.None=1]="None",t[t.Install=2]="Install",t[t.Update=3]="Update",t[t.Migrate=4]="Migrate"})(e2||(e2={})),C3=j("extensionGalleryService"),(function(t){t.Timeout="Timeout",t.Cancelled="Cancelled",t.Failed="Failed",t.DownloadFailedWriting="DownloadFailedWriting",t.Offline="Offline"})(t2||(t2={})),(function(t){t.NotFound="NotFound",t.Unsupported="Unsupported",t.Deprecated="Deprecated",t.Malicious="Malicious",t.Incompatible="Incompatible",t.IncompatibleApi="IncompatibleApi",t.IncompatibleTargetPlatform="IncompatibleTargetPlatform",t.ReleaseVersionNotFound="ReleaseVersionNotFound",t.Invalid="Invalid",t.Download="Download",t.DownloadSignature="DownloadSignature",t.DownloadFailedWriting="DownloadFailedWriting",t.UpdateMetadata="UpdateMetadata",t.Extract="Extract",t.Scanning="Scanning",t.ScanningExtension="ScanningExtension",t.ReadRemoved="ReadRemoved",t.UnsetRemoved="UnsetRemoved",t.Delete="Delete",t.Rename="Rename",t.IntializeDefaultProfile="IntializeDefaultProfile",t.AddToProfile="AddToProfile",t.InstalledExtensionNotFound="InstalledExtensionNotFound",t.PostInstall="PostInstall",t.CorruptZip="CorruptZip",t.IncompleteZip="IncompleteZip",t.PackageNotSigned="PackageNotSigned",t.SignatureVerificationInternal="SignatureVerificationInternal",t.SignatureVerificationFailed="SignatureVerificationFailed",t.NotAllowed="NotAllowed",t.Gallery="Gallery",t.Cancelled="Cancelled",t.Unknown="Unknown",t.Internal="Internal"})(i2||(i2={})),(function(t){t.NotSigned="NotSigned",t.Success="Success",t.RequiredArgumentMissing="RequiredArgumentMissing",t.InvalidArgument="InvalidArgument",t.PackageIsUnreadable="PackageIsUnreadable",t.UnhandledException="UnhandledException",t.SignatureManifestIsMissing="SignatureManifestIsMissing",t.SignatureManifestIsUnreadable="SignatureManifestIsUnreadable",t.SignatureIsMissing="SignatureIsMissing",t.SignatureIsUnreadable="SignatureIsUnreadable",t.CertificateIsUnreadable="CertificateIsUnreadable",t.SignatureArchiveIsUnreadable="SignatureArchiveIsUnreadable",t.FileAlreadyExists="FileAlreadyExists",t.SignatureArchiveIsInvalidZip="SignatureArchiveIsInvalidZip",t.SignatureArchiveHasSameSignatureFile="SignatureArchiveHasSameSignatureFile",t.PackageIntegrityCheckFailed="PackageIntegrityCheckFailed",t.SignatureIsInvalid="SignatureIsInvalid",t.SignatureManifestIsInvalid="SignatureManifestIsInvalid",t.SignatureIntegrityCheckFailed="SignatureIntegrityCheckFailed",t.EntryIsMissing="EntryIsMissing",t.EntryIsTampered="EntryIsTampered",t.Untrusted="Untrusted",t.CertificateRevoked="CertificateRevoked",t.SignatureIsNotValid="SignatureIsNotValid",t.UnknownError="UnknownError",t.PackageIsInvalidZip="PackageIsInvalidZip",t.SignatureArchiveHasTooManyEntries="SignatureArchiveHasTooManyEntries"})(t1||(t1={})),I3=j("extensionManagementService"),r2="extensionsIdentifiers/disabled",D3=j("IGlobalExtensionEnablementService"),A3=j("IExtensionTipsService"),R3=j("IAllowedExtensionsService"),M3=ty(1930,"Extensions"),T3=ty(1931,"Preferences")}});import*as W3 from"fs";var jd,i1,s2,n2,o2,r1,L3=g({"out-build/vs/platform/storage/electron-main/storageMain.js"(){"use strict";Wt(),ae(),q(),L(),ye(),Io(),re(),qt(),_4(),_3(),K(),Gm(),ti(),hi(),Bd(),Ie(),jd=class C8 extends N{static{this.LOG_SLOW_CLOSE_THRESHOLD=2e3}get storage(){return this._storage}constructor(e,i){super(),this.logService=e,this.fileService=i,this._onDidChangeStorage=this._register(new D),this.onDidChangeStorage=this._onDidChangeStorage.event,this._onDidCloseStorage=this._register(new D),this.onDidCloseStorage=this._onDidCloseStorage.event,this._storage=this._register(new Yc(new Hm,{hint:Hr.STORAGE_IN_MEMORY})),this.initializePromise=void 0,this.whenInitPromise=new ys,this.whenInit=this.whenInitPromise.p,this.state=Ai.None}cursorDiskKVGet(e){return this._storage.cursorDiskKVGet(e)}cursorDiskKVSet(e,i){return this._storage.cursorDiskKVSet(e,i)}cursorDiskKVClearPrefix(e){return this._storage.cursorDiskKVClearPrefix(e)}isInMemory(){return this._storage.isInMemory()}init(){return this.initializePromise||(this.initializePromise=(async()=>{if(this.state===Ai.None)try{const e=this._register(await this.doCreate());this._storage.dispose(),this._storage=e,this._register(e.onDidChangeStorage(r=>this._onDidChangeStorage.fire(r))),await this.doInit(e);const i=e.getBoolean(Qc);i===void 0?e.set(Qc,!0):i&&e.set(Qc,!1),this.copyFromVSCodeStorage(e)}catch(e){this.logService.error(`[storage main] initialize(): Unable to init storage due to ${e}`)}finally{this.state=Ai.Initialized,this.whenInitPromise.complete()}})()),this.initializePromise}copyFromVSCodeStorage(e){const i=this.vscodePath;if(!i)return;const r=[r2];try{import("@vscode/sqlite3").then(s=>{let n;try{let o=!1;if(n=new s.Database(i,a=>{o=!a}),!o)return;for(const a of r)n.get("SELECT value FROM ItemTable WHERE key = ?",[a],(c,l)=>{try{if(!c){const u=l.value;e.set(`vscode/${a}`,u)}}catch{}})}catch{}finally{try{n&&n.close()}catch{}}})}catch{}}createLoggingOptions(){return{logTrace:this.logService.getLevel()===X.Trace?e=>this.logService.trace(e):void 0,logError:e=>this.logService.error(e)}}doInit(e){return e.init()}get items(){return this._storage.items}get(e,i){return this._storage.get(e,i)}set(e,i){return this._storage.set(e,i)}delete(e){return this._storage.delete(e)}optimize(){return this._storage.optimize()}async close(){const e=new En(!1);await this.doClose(),e.stop(),e.elapsed()>C8.LOG_SLOW_CLOSE_THRESHOLD&&await this.logSlowClose(e),this._onDidCloseStorage.fire()}async logSlowClose(e){if(this.path)try{const i=vx(Array.from(this._storage.items.entries()).map(([s,n])=>({key:s,length:n.length})),(s,n)=>n.length-s.length,5).map(s=>`${s.key}:${s.length}`).join(", "),r=(await this.fileService.stat(x.file(this.path))).size;this.logService.warn(`[storage main] detected slow close() operation: Time: ${e.elapsed()}ms, DB size: ${r}b, Large Keys: ${i}`)}catch(i){this.logService.error("[storage main] figuring out stats for slow DB on close() resulted in an error",i)}}async doClose(){this.initializePromise&&await this.initializePromise,this.state=Ai.Closed,await this._storage.close()}},i1=class D0 extends jd{static{this.STORAGE_NAME="state.vscdb"}get path(){if(!this.options.useInMemoryStorage)return U(this.profile.globalStorageHome.with({scheme:T.file}).fsPath,D0.STORAGE_NAME)}get vscodePath(){try{if(!this.options.useInMemoryStorage)return U(pt(pt(pt(this.profile.globalStorageHome.fsPath))),"Code","User","globalStorage",D0.STORAGE_NAME)}catch{}}constructor(e,i,r,s){super(r,s),this.profile=e,this.options=i}async doCreate(){return new Yc(new Xc(this.path??Xc.IN_MEMORY_PATH,{logging:this.createLoggingOptions()}),this.path?void 0:{hint:Hr.STORAGE_IN_MEMORY})}},s2=class extends i1{constructor(t,e,i,r){super(t,e,i,r)}},n2=class extends i1{constructor(t,e,i,r){super(e.defaultProfile,t,i,r)}async doInit(t){await super.doInit(t),this.updateTelemetryState(t)}updateTelemetryState(t){t.get(Jm,void 0)===void 0&&t.set(Jm,new Date().toUTCString());const i=t.get(Ym,void 0),r=new Date().toUTCString();t.set(V4,typeof i>"u"?null:i),t.set(Ym,r)}},o2=class Vp extends jd{static{this.WORKSPACE_STORAGE_NAME="state.vscdb"}static{this.WORKSPACE_META_NAME="workspace.json"}get path(){if(!this.options.useInMemoryStorage)return U(this.environmentService.workspaceStorageHome.with({scheme:T.file}).fsPath,this.workspace.id,Vp.WORKSPACE_STORAGE_NAME)}get vscodePath(){}constructor(e,i,r,s,n){super(r,n),this.workspace=e,this.options=i,this.environmentService=s}async doCreate(){const{storageFilePath:e,wasCreated:i}=await this.prepareWorkspaceStorageFolder();return new Yc(new Xc(e,{logging:this.createLoggingOptions()}),{hint:this.options.useInMemoryStorage?Hr.STORAGE_IN_MEMORY:i?Hr.STORAGE_DOES_NOT_EXIST:void 0})}async prepareWorkspaceStorageFolder(){if(this.options.useInMemoryStorage)return{storageFilePath:Xc.IN_MEMORY_PATH,wasCreated:!0};const e=U(this.environmentService.workspaceStorageHome.with({scheme:T.file}).fsPath,this.workspace.id),i=U(e,Vp.WORKSPACE_STORAGE_NAME);return await te.exists(e)?{storageFilePath:i,wasCreated:!1}:(await W3.promises.mkdir(e,{recursive:!0}),this.ensureWorkspaceStorageFolderMeta(e),{storageFilePath:i,wasCreated:!0})}async ensureWorkspaceStorageFolderMeta(e){let i;if(Ri(this.workspace)?i={folder:this.workspace.uri.toString()}:zt(this.workspace)&&(i={workspace:this.workspace.configPath.toString()}),i)try{const r=U(e,Vp.WORKSPACE_META_NAME);await te.exists(r)||await te.writeFile(r,JSON.stringify(i,void 0,2))}catch(r){this.logService.error(`[storage main] ensureWorkspaceStorageFolderMeta(): Unable to create workspace storage metadata due to ${r}`)}}},r1=class extends jd{get path(){}get vscodePath(){}async doCreate(){return new Yc(new Hm,{hint:Hr.STORAGE_IN_MEMORY})}}}}),a2,c2,Hd,s1,l2=g({"out-build/vs/platform/state/node/stateService.js"(){"use strict";ae(),it(),L(),xe(),xi(),Ze(),K(),(function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DELAYED=1]="DELAYED"})(a2||(a2={})),c2=class extends N{constructor(t,e,i,r){super(),this.storagePath=t,this.logService=i,this.fileService=r,this.storage=Object.create(null),this.lastSavedStorageContents="",this.initializing=void 0,this.closing=void 0,this.flushDelayer=this._register(new ws(e===0?0:100))}init(){return this.initializing||(this.initializing=this.doInit()),this.initializing}async doInit(){try{this.lastSavedStorageContents=(await this.fileService.readFile(this.storagePath)).value.toString(),this.storage=JSON.parse(this.lastSavedStorageContents)}catch(t){t.fileOperationResult!==1&&this.logService.error(t)}}getItem(t,e){const i=this.storage[t];return ci(i)?e:i}setItem(t,e){this.setItems([{key:t,data:e}])}setItems(t){let e=!1;for(const{key:i,data:r}of t)this.storage[i]!==r&&(ci(r)?hs(this.storage[i])||(this.storage[i]=void 0,e=!0):(this.storage[i]=r,e=!0));e&&this.save()}removeItem(t){hs(this.storage[t])||(this.storage[t]=void 0,this.save())}async save(){if(!this.closing)return this.flushDelayer.trigger(()=>this.doSave())}async doSave(){if(!this.initializing)return;await this.initializing;const t=JSON.stringify(this.storage,null,4);if(t!==this.lastSavedStorageContents)try{await this.fileService.writeFile(this.storagePath,Y.fromString(t),{atomic:{postfix:".vsctmp"}}),this.lastSavedStorageContents=t}catch(e){this.logService.error(e)}}async close(){return this.closing||(this.closing=this.flushDelayer.trigger(()=>this.doSave(),0)),this.closing}},Hd=class extends N{constructor(e,i,r,s){super(),this.fileStorage=this._register(new c2(i.stateResource,e,r,s))}async init(){await this.fileStorage.init()}getItem(e,i){return this.fileStorage.getItem(e,i)}},Hd=__decorate([__param(1,or),__param(2,V),__param(3,mt)],Hd),s1=class extends Hd{setItem(t,e){this.fileStorage.setItem(t,e)}setItems(t){this.fileStorage.setItems(t)}removeItem(t){this.fileStorage.removeItem(t)}close(){return this.fileStorage.close()}}}}),Vd,Xo,qd,el,n1,O3=g({"out-build/vs/platform/userDataProfile/node/userDataProfile.js"(){"use strict";re(),xi(),Ze(),K(),Vi(),Vr(),zr(),xe(),l2(),qd=Vd=class extends Fd{constructor(e,i,r,s,n){super(r,s,i,n),this.stateReadonlyService=e,this.nativeEnvironmentService=r}getStoredProfiles(){return this.stateReadonlyService.getItem(Vd.PROFILES_KEY,[]).map(i=>({...i,location:At(i.location)?this.uriIdentityService.extUri.joinPath(this.profilesHome,i.location):x.revive(i.location)}))}getStoredProfileAssociations(){return this.stateReadonlyService.getItem(Vd.PROFILE_ASSOCIATIONS_KEY,{})}getDefaultProfileExtensionsLocation(){return this.uriIdentityService.extUri.joinPath(x.file(this.nativeEnvironmentService.extensionsPath).with({scheme:this.profilesHome.scheme}),"extensions.json")}},qd=Vd=__decorate([__param(0,Rm),__param(1,Mi),__param(2,$r),__param(3,mt),__param(4,V)],qd),el=Xo=class extends qd{constructor(e,i,r,s,n){super(e,i,r,s,n),this.stateService=e}saveStoredProfiles(e){e.length?this.stateService.setItem(Xo.PROFILES_KEY,e.map(i=>({...i,location:this.uriIdentityService.extUri.basename(i.location)}))):this.stateService.removeItem(Xo.PROFILES_KEY)}saveStoredProfileAssociations(e){e.emptyWindows||e.workspaces?this.stateService.setItem(Xo.PROFILE_ASSOCIATIONS_KEY,e):this.stateService.removeItem(Xo.PROFILE_ASSOCIATIONS_KEY)}},el=Xo=__decorate([__param(0,Ii),__param(1,Mi),__param(2,$r),__param(3,mt),__param(4,V)],el),n1=class extends el{constructor(e,i,r,s){super(new s1(0,i,s,r),e,i,r,s)}async init(){return await this.stateService.init(),super.init()}},n1=__decorate([__param(0,Mi),__param(1,$r),__param(2,mt),__param(3,V)],n1)}}),Gr,zd,$n=g({"out-build/vs/platform/userDataProfile/electron-main/userDataProfile.js"(){"use strict";xi(),Ze(),G(),K(),Vr(),zr(),O3(),Vi(),Gr=qr,zd=class extends el{constructor(e,i,r,s,n){super(e,i,r,s,n)}getAssociatedEmptyWindows(){const e=[];for(const i of this.profilesObject.emptyWindows.keys())e.push({id:i});return e}},zd=__decorate([__param(0,Ii),__param(1,Mi),__param(2,$r),__param(3,mt),__param(4,V)],zd)}}),Zo,Gd,xs,Kd,tn=g({"out-build/vs/platform/storage/electron-main/storageMainService.js"(){"use strict";re(),q(),L(),xi(),Ze(),G(),ft(),K(),Gm(),L3(),zr(),$n(),Vr(),Ie(),Zo=j("storageMainService"),Gd=class extends N{constructor(e,i,r,s,n,o){super(),this.logService=e,this.environmentService=i,this.userDataProfilesService=r,this.lifecycleMainService=s,this.fileService=n,this.uriIdentityService=o,this.shutdownReason=void 0,this._onDidChangeProfileStorage=this._register(new D),this.onDidChangeProfileStorage=this._onDidChangeProfileStorage.event,this.mapProfileToStorage=new Map,this.mapWorkspaceToStorage=new Map,this.applicationStorage=this._register(this.createApplicationStorage()),this.registerListeners()}getStorageOptions(){return{useInMemoryStorage:!!this.environmentService.extensionTestsLocationURI}}registerListeners(){(async()=>(await this.lifecycleMainService.when(3),this.applicationStorage.init()))(),this._register(this.lifecycleMainService.onWillLoadWindow(e=>{e.window.profile&&this.profileStorage(e.window.profile).init(),e.workspace&&this.workspaceStorage(e.workspace).init()})),this._register(this.lifecycleMainService.onWillShutdown(e=>{this.logService.trace("storageMainService#onWillShutdown()"),this.shutdownReason=e.reason,e.join("applicationStorage",this.applicationStorage.close());for(const[,i]of this.mapProfileToStorage)e.join("profileStorage",i.close());for(const[,i]of this.mapWorkspaceToStorage)e.join("workspaceStorage",i.close())})),this._register(this.userDataProfilesService.onWillCreateProfile(e=>{e.join((async()=>{await this.fileService.exists(e.profile.globalStorageHome)||await this.fileService.createFolder(e.profile.globalStorageHome)})())})),this._register(this.userDataProfilesService.onWillRemoveProfile(e=>{const i=this.mapProfileToStorage.get(e.profile.id);i&&e.join(i.close())}))}createApplicationStorage(){this.logService.trace("StorageMainService: creating application storage");const e=new n2(this.getStorageOptions(),this.userDataProfilesService,this.logService,this.fileService);return this._register(P.once(e.onDidCloseStorage)(()=>{this.logService.trace("StorageMainService: closed application storage")})),e}profileStorage(e){if(zm(e))return this.applicationStorage;let i=this.mapProfileToStorage.get(e.id);if(!i){this.logService.trace(`StorageMainService: creating profile storage (${e.name})`),i=this._register(this.createProfileStorage(e)),this.mapProfileToStorage.set(e.id,i);const r=this._register(i.onDidChangeStorage(s=>this._onDidChangeProfileStorage.fire({...s,storage:i,profile:e})));this._register(P.once(i.onDidCloseStorage)(()=>{this.logService.trace(`StorageMainService: closed profile storage (${e.name})`),this.mapProfileToStorage.delete(e.id),r.dispose()}))}return i}createProfileStorage(e){return this.shutdownReason===2?new r1(this.logService,this.fileService):new s2(e,this.getStorageOptions(),this.logService,this.fileService)}workspaceStorage(e){let i=this.mapWorkspaceToStorage.get(e.id);return i||(this.logService.trace(`StorageMainService: creating workspace storage (${e.id})`),i=this._register(this.createWorkspaceStorage(e)),this.mapWorkspaceToStorage.set(e.id,i),this._register(P.once(i.onDidCloseStorage)(()=>{this.logService.trace(`StorageMainService: closed workspace storage (${e.id})`),this.mapWorkspaceToStorage.delete(e.id)}))),i}createWorkspaceStorage(e){return this.shutdownReason===2?new r1(this.logService,this.fileService):new o2(e,this.getStorageOptions(),this.logService,this.environmentService,this.fileService)}isUsed(e){const i=x.file(e);for(const r of[this.applicationStorage,...this.mapProfileToStorage.values(),...this.mapWorkspaceToStorage.values()])if(r.path&&this.uriIdentityService.extUri.isEqualOrParent(x.file(r.path),i))return!0;return!1}},Gd=__decorate([__param(0,V),__param(1,or),__param(2,Gr),__param(3,ze),__param(4,mt),__param(5,Mi)],Gd),xs=j("applicationStorageMainService"),Kd=class extends T4{constructor(e,i){super(),this.userDataProfilesService=e,this.storageMainService=i,this.whenReady=this.storageMainService.applicationStorage.whenInit}doInitialize(){return this.storageMainService.applicationStorage.whenInit}getStorage(e){if(e===-1)return this.storageMainService.applicationStorage.storage}getLogDetails(e){if(e===-1)return this.userDataProfilesService.defaultProfile.globalStorageHome.with({scheme:T.file}).fsPath}shouldFlushWhenIdle(){return!1}switch(){throw new Error("Migrating storage is unsupported from main process")}switchToProfile(){throw new Error("Switching storage profile is unsupported from main process")}switchToWorkspace(){throw new Error("Switching storage workspace is unsupported from main process")}hasScope(){throw new Error("Main process is never profile or workspace scoped")}},Kd=__decorate([__param(0,qr),__param(1,Zo)],Kd)}});import{app as F3}from"electron";var Yd,Jd,u2=g({"out-build/vs/platform/native/electron-main/auth.js"(){"use strict";St(),q(),_s(),L(),re(),Hi(),Xe(),cb(),ct(),G(),K(),tn(),ut(),Yd=j("proxyAuthService"),Jd=class extends N{constructor(e,i,r,s,n,o){super(),this.logService=e,this.windowsMainService=i,this.encryptionMainService=r,this.applicationStorageMainService=s,this.configurationService=n,this.environmentMainService=o,this.PROXY_CREDENTIALS_SERVICE_KEY="proxy-credentials://",this.pendingProxyResolves=new Map,this.currentDialog=void 0,this.cancelledAuthInfoHashes=new Set,this.sessionCredentials=new Map,this.registerListeners()}registerListeners(){const e=P.fromNodeEventEmitter(F3,"login",(i,r,s,n,o)=>({event:i,authInfo:{...n,attempt:s.firstAuthAttempt?1:2},callback:o}));this._register(e(this.onLogin,this))}async lookupAuthorization(e){return this.onLogin({authInfo:e})}async onLogin({event:e,authInfo:i,callback:r}){if(!i.isProxy)return;e?.preventDefault();const s=String(Ur({scheme:i.scheme,host:i.host,port:i.port}));let n,o=this.pendingProxyResolves.get(s);if(o)this.logService.trace("auth#onLogin (proxy) - pending proxy handling found"),n=await o;else{this.logService.trace("auth#onLogin (proxy) - no pending proxy handling found, starting new"),o=this.resolveProxyCredentials(i,s),this.pendingProxyResolves.set(s,o);try{n=await o}finally{this.pendingProxyResolves.delete(s)}}return r?.(n?.username,n?.password),n}async resolveProxyCredentials(e,i){this.logService.trace("auth#resolveProxyCredentials (proxy) - enter");try{const r=await this.doResolveProxyCredentials(e,i);if(r)return this.logService.trace("auth#resolveProxyCredentials (proxy) - got credentials"),r;this.logService.trace("auth#resolveProxyCredentials (proxy) - did not get credentials")}finally{this.logService.trace("auth#resolveProxyCredentials (proxy) - exit")}}async doResolveProxyCredentials(e,i){if(this.logService.trace("auth#doResolveProxyCredentials - enter",e),this.environmentMainService.extensionTestsLocationURI){try{const l=Buffer.from(e.realm,"base64").toString("utf-8");if(l.startsWith("{"))return JSON.parse(l)}catch{}return}const r=(this.configurationService.getValue("http.proxy")||"").trim()||(process.env.https_proxy||process.env.HTTPS_PROXY||process.env.http_proxy||process.env.HTTP_PROXY||"").trim()||void 0;if(r?.indexOf("@")!==-1){const l=x.parse(r),u=l.authority.indexOf("@");if(u!==-1){if(e.attempt>1){this.logService.trace("auth#doResolveProxyCredentials (proxy) - exit - ignoring previously used config/envvar credentials");return}this.logService.trace("auth#doResolveProxyCredentials (proxy) - exit - found config/envvar credentials to use");const d=l.authority.substring(0,u),f=d.indexOf(":");return f!==-1?{username:d.substring(0,f),password:d.substring(f+1)}:{username:d,password:""}}}const s=e.attempt===1&&this.sessionCredentials.get(i);if(s){this.logService.trace("auth#doResolveProxyCredentials (proxy) - exit - found session credentials to use");const{username:l,password:u}=s;return{username:l,password:u}}let n,o;try{const l=this.applicationStorageMainService.get(this.PROXY_CREDENTIALS_SERVICE_KEY+i,-1);if(l){const u=JSON.parse(await this.encryptionMainService.decrypt(l));n=u.username,o=u.password}}catch(l){this.logService.error(l)}if(e.attempt===1&&typeof n=="string"&&typeof o=="string")return this.logService.trace("auth#doResolveProxyCredentials (proxy) - exit - found stored credentials to use"),this.sessionCredentials.set(i,{username:n,password:o}),{username:n,password:o};const a=this.currentDialog,c=this.currentDialog=(async()=>{await a;const l=await this.showProxyCredentialsDialog(e,i,n,o);return this.currentDialog===c&&(this.currentDialog=void 0),l})();return c}async showProxyCredentialsDialog(e,i,r,s){if(this.cancelledAuthInfoHashes.has(i)){this.logService.trace("auth#doResolveProxyCredentials (proxy) - exit - login dialog was cancelled before, not showing again");return}const n=this.windowsMainService.getFocusedWindow()||this.windowsMainService.getLastActiveWindow();if(!n){this.logService.trace("auth#doResolveProxyCredentials (proxy) - exit - no opened window found to show dialog in");return}this.logService.trace(`auth#doResolveProxyCredentials (proxy) - asking window ${n.id} to handle proxy login`);const o=this.sessionCredentials.get(i),a={authInfo:e,username:o?.username??r,password:o?.password??s,replyChannel:`vscode:proxyAuthResponse:${ui()}`};n.sendWhenReady("vscode:openProxyAuthenticationDialog",Te.None,a);const c=await new Promise(l=>{const u=async(d,f,p)=>{if(f===a.replyChannel)if(this.logService.trace(`auth#doResolveProxyCredentials - exit - received credentials from window ${n.id}`),n.win?.webContents.off("ipc-message",u),p){const v={username:p.username,password:p.password};try{if(p.remember){const m=await this.encryptionMainService.encrypt(JSON.stringify(v));this.applicationStorageMainService.store(this.PROXY_CREDENTIALS_SERVICE_KEY+i,m,-1,1)}else this.applicationStorageMainService.remove(this.PROXY_CREDENTIALS_SERVICE_KEY+i,-1)}catch(m){this.logService.error(m)}l({username:v.username,password:v.password})}else this.cancelledAuthInfoHashes.add(i),l(void 0)};n.win?.webContents.on("ipc-message",u)});return this.sessionCredentials.set(i,c),c}},Jd=__decorate([__param(0,V),__param(1,ot),__param(2,hd),__param(3,xs),__param(4,Qe),__param(5,st)],Jd)}}),ea,tl=g({"out-build/vs/platform/backup/electron-main/backup.js"(){"use strict";G(),ea=j("backupMainService")}});function N3(t){return typeof t?.backupFolder=="string"}function U3(t){let e=[];try{Array.isArray(t.workspaces)&&(e=t.workspaces.map(i=>({workspace:{id:i.id,configPath:x.parse(i.configURIPath)},remoteAuthority:i.remoteAuthority})))}catch{}return e}function $3(t){let e=[];try{Array.isArray(t.folders)&&(e=t.folders.map(i=>({folderUri:x.parse(i.folderUri),remoteAuthority:i.remoteAuthority})))}catch{}return e}var B3=g({"out-build/vs/platform/backup/node/backup.js"(){"use strict";re()}});function j3(t){return t&&t.hasOwnProperty("folderUri")}var H3=g({"out-build/vs/platform/backup/common/backup.js"(){"use strict"}});import{createHash as o1}from"crypto";function Bn(t){function e(){let i=t.scheme===T.file?ji(t):t.toString();return Pe||(i=i.toLowerCase()),o1("md5").update(i).digest("hex")}return{id:e(),configPath:t}}function a1(t,e){function i(){if(t.scheme!==T.file)return o1("md5").update(t.toString()).digest("hex");if(!e)return;let s;return Pe?s=e.ino:O?s=e.birthtime.getTime():B&&(typeof e.birthtimeMs=="number"?s=Math.floor(e.birthtimeMs):s=e.birthtime.getTime()),o1("md5").update(t.fsPath).update(s?String(s):"").digest("hex")}const r=i();if(typeof r=="string")return{id:r,uri:t}}function c1(){return{id:(Date.now()+Math.round(Math.random()*1e3)).toString()}}var V3,l1=g({"out-build/vs/platform/workspaces/node/workspaces.js"(){"use strict";Ie(),z(),gt(),V3=128/4}});import{createHash as q3}from"crypto";var Qd,Xd,z3=g({"out-build/vs/platform/backup/electron-main/backupMainService.js"(){"use strict";Bi(),Ie(),ye(),z(),gt(),qt(),B3(),Xe(),ct(),Vi(),Ze(),K(),H3(),hi(),l1(),lt(),Xd=class{static{Qd=this}static{this.backupWorkspacesMetadataStorageKey="backupWorkspaces"}constructor(e,i,r,s,n){this.environmentMainService=e,this.configurationService=i,this.productService=r,this.logService=s,this.stateService=n,this.workspaces=[],this.folders=[],this.emptyWindows=[],this.backupUriComparer=rt,this.backupPathComparer={isEqual:(o,a)=>Dc(o,a,!Pe)},this.backupHome=e.backupHome}async initialize(){const e=this.stateService.getItem(Qd.backupWorkspacesMetadataStorageKey)??{workspaces:[],folders:[],emptyWindows:[]};this.emptyWindows=await this.validateEmptyWorkspaces(e.emptyWindows),this.workspaces=await this.validateWorkspaces(U3(e)),this.folders=await this.validateFolders($3(e)),this.storeWorkspacesMetadata()}getWorkspaceBackups(){return this.isHotExitOnExitAndWindowClose()?[]:this.workspaces.slice(0)}getFolderBackups(){return this.isHotExitOnExitAndWindowClose()?[]:this.folders.slice(0)}isHotExitEnabled(){return this.getHotExitConfig()!==Id.OFF}isHotExitOnExitAndWindowClose(){return this.getHotExitConfig()===Id.ON_EXIT_AND_WINDOW_CLOSE}getHotExitConfig(){return this.configurationService.getValue()?.files?.hotExit||Id.ON_EXIT}getEmptyWindowBackups(){return this.emptyWindows.slice(0)}registerWorkspaceBackup(e,i){this.workspaces.some(s=>e.workspace.id===s.workspace.id)||(this.workspaces.push(e),this.storeWorkspacesMetadata());const r=U(this.backupHome,e.workspace.id);return i?this.moveBackupFolder(r,i).then(()=>r):r}async moveBackupFolder(e,i){if(await te.exists(e)&&await this.convertToEmptyWindowBackup(e),await te.exists(i))try{await te.rename(i,e,!1)}catch(r){this.logService.error(`Backup: Could not move backup folder to new location: ${r.toString()}`)}}registerFolderBackup(e){return this.folders.some(i=>this.backupUriComparer.isEqual(e.folderUri,i.folderUri))||(this.folders.push(e),this.storeWorkspacesMetadata()),U(this.backupHome,this.getFolderHash(e))}registerEmptyWindowBackup(e){return this.emptyWindows.some(i=>!!i.backupFolder&&this.backupPathComparer.isEqual(i.backupFolder,e.backupFolder))||(this.emptyWindows.push(e),this.storeWorkspacesMetadata()),U(this.backupHome,e.backupFolder)}async validateWorkspaces(e){if(!Array.isArray(e))return[];const i=new Set,r=[];for(const s of e){const n=s.workspace;if(!zt(n))return[];const o=l3(this.environmentMainService,this.productService);if(!n.configPath.fsPath.startsWith(o.fsPath)&&!i.has(n.id)){i.add(n.id);const a=U(this.backupHome,n.id);await this.doHasBackups(a)?n.configPath.scheme!==T.file||await te.exists(n.configPath.fsPath)?r.push(s):await this.convertToEmptyWindowBackup(a):await this.deleteStaleBackup(a)}}return r}async validateFolders(e){if(!Array.isArray(e))return[];const i=[],r=new Set;for(const s of e){const n=s.folderUri,o=this.backupUriComparer.getComparisonKey(n);if(!r.has(o)){r.add(o);const a=U(this.backupHome,this.getFolderHash(s));await this.doHasBackups(a)?n.scheme!==T.file||await te.exists(n.fsPath)?i.push(s):await this.convertToEmptyWindowBackup(a):await this.deleteStaleBackup(a)}}return i}async validateEmptyWorkspaces(e){if(!Array.isArray(e))return[];const i=[],r=new Set;for(const s of e){const n=s.backupFolder;if(typeof n!="string")return[];if(!r.has(n)){r.add(n);const o=U(this.backupHome,n);await this.doHasBackups(o)?i.push(s):await this.deleteStaleBackup(o)}}return i}async deleteStaleBackup(e){try{await te.rm(e,Dn.MOVE)}catch(i){this.logService.error(`Backup: Could not delete stale backup: ${i.toString()}`)}}prepareNewEmptyWindowBackup(){let e=c1();for(;this.emptyWindows.some(i=>!!i.backupFolder&&this.backupPathComparer.isEqual(i.backupFolder,e.id));)e=c1();return{backupFolder:e.id}}async convertToEmptyWindowBackup(e){const i=this.prepareNewEmptyWindowBackup(),r=U(this.backupHome,i.backupFolder);try{await te.rename(e,r,!1)}catch(s){return this.logService.error(`Backup: Could not rename backup folder: ${s.toString()}`),!1}return this.emptyWindows.push(i),!0}async getDirtyWorkspaces(){const e=[];for(const i of this.workspaces)await this.hasBackups(i)&&e.push(i);for(const i of this.folders)await this.hasBackups(i)&&e.push(i);return e}hasBackups(e){let i;return N3(e)?i=U(this.backupHome,e.backupFolder):j3(e)?i=U(this.backupHome,this.getFolderHash(e)):i=U(this.backupHome,e.workspace.id),this.doHasBackups(i)}async doHasBackups(e){try{const i=await te.readdir(e);for(const r of i)try{if((await te.readdir(U(e,r))).length>0)return!0}catch{}}catch{}return!1}storeWorkspacesMetadata(){const e={workspaces:this.workspaces.map(({workspace:i,remoteAuthority:r})=>{const s={id:i.id,configURIPath:i.configPath.toString()};return r&&(s.remoteAuthority=r),s}),folders:this.folders.map(({folderUri:i,remoteAuthority:r})=>{const s={folderUri:i.toString()};return r&&(s.remoteAuthority=r),s}),emptyWindows:this.emptyWindows.map(({backupFolder:i,remoteAuthority:r})=>{const s={backupFolder:i};return r&&(s.remoteAuthority=r),s})};this.stateService.setItem(Qd.backupWorkspacesMetadataStorageKey,e)}getFolderHash(e){const i=e.folderUri;let r;return i.scheme===T.file?r=Pe?i.fsPath:i.fsPath.toLowerCase():r=i.toString().toLowerCase(),q3("md5").update(r).digest("hex")}},Xd=Qd=__decorate([__param(0,st),__param(1,Qe),__param(2,qe),__param(3,V),__param(4,Ii)],Xd)}}),d2,G3=g({"out-build/vs/platform/debug/common/extensionHostDebugIpc.js"(){"use strict";q(),L(),d2=class{constructor(){this._onCloseEmitter=new D,this._onReloadEmitter=new D,this._onTerminateEmitter=new D,this._onAttachEmitter=new D}static{this.ChannelName="extensionhostdebugservice"}call(t,e,i){switch(e){case"close":return Promise.resolve(this._onCloseEmitter.fire({sessionId:i[0]}));case"reload":return Promise.resolve(this._onReloadEmitter.fire({sessionId:i[0]}));case"terminate":return Promise.resolve(this._onTerminateEmitter.fire({sessionId:i[0]}));case"attach":return Promise.resolve(this._onAttachEmitter.fire({sessionId:i[0],port:i[1],subId:i[2]}))}throw new Error("Method not implemented.")}listen(t,e,i){switch(e){case"close":return this._onCloseEmitter.event;case"reload":return this._onReloadEmitter.event;case"terminate":return this._onTerminateEmitter.event;case"attach":return this._onAttachEmitter.event}throw new Error("Method not implemented.")}}}});function u1(t,e,i=f2){const r=t.find(f=>f.length>0&&f[0]!=="-"),s={},n=["_"],o=[],a={};let c;for(const f in e){const p=e[f];p.type==="subcommand"?f===r&&(c=p):(p.alias&&(s[f]=p.alias),p.type==="string"||p.type==="string[]"?(n.push(f),p.deprecates&&n.push(...p.deprecates)):p.type==="boolean"&&(o.push(f),p.deprecates&&o.push(...p.deprecates)),p.global&&(a[f]=p))}if(c&&r){const f=a;for(const y in c.options)f[y]=c.options[y];const p=t.filter(y=>y!==r),v=i.getSubcommandReporter?i.getSubcommandReporter(r):void 0,m=u1(p,f,v);return{[r]:m,_:[]}}const l=(0,h2.default)(t,{string:n,boolean:o,alias:s}),u={},d=l;u._=l._.map(f=>String(f)).filter(f=>f.length>0),delete d._;for(const f in e){const p=e[f];if(p.type==="subcommand")continue;p.alias&&delete d[p.alias];let v=d[f];if(p.deprecates)for(const m of p.deprecates)d.hasOwnProperty(m)&&(v||(v=d[m],v&&i.onDeprecatedOption(m,p.deprecationMessage||w(1894,null,f))),delete d[m]);if(typeof v<"u"){if(p.type==="string[]"){if(Array.isArray(v)||(v=[v]),!p.allowEmptyValue){const m=v.filter(y=>y.length>0);m.length!==v.length&&(i.onEmptyValue(f),v=m.length>0?m:void 0)}}else p.type==="string"&&(Array.isArray(v)?(v=v.pop(),i.onMultipleValues(f,v)):!v&&!p.allowEmptyValue&&(i.onEmptyValue(f),v=void 0));u[f]=v,p.deprecationMessage&&i.onDeprecatedOption(f,p.deprecationMessage)}delete d[f]}for(const f in d)i.onUnknownOption(f);return u}var h2,K3,d1,h1,f2,p2=g({"out-build/vs/platform/environment/node/argv.js"(){"use strict";h2=U0($0(),1),z(),we(),K3={o:w(1852,null),e:w(1853,null),t:w(1854,null)},d1=["tunnel","serve-web"],h1={tunnel:{type:"subcommand",description:"Make the current machine accessible from vscode.dev or other machines through a secure tunnel",options:{"cli-data-dir":{type:"string",args:"dir",description:w(1855,null)},"disable-telemetry":{type:"boolean"},"telemetry-level":{type:"string"},user:{type:"subcommand",options:{login:{type:"subcommand",options:{provider:{type:"string"},"access-token":{type:"string"}}}}}}},"serve-web":{type:"subcommand",description:"Run a server that displays the editor UI in browsers.",options:{"cli-data-dir":{type:"string",args:"dir",description:w(1856,null)},"disable-telemetry":{type:"boolean"},"telemetry-level":{type:"string"}}},diff:{type:"boolean",cat:"o",alias:"d",args:["file","file"],description:w(1857,null)},merge:{type:"boolean",cat:"o",alias:"m",args:["path1","path2","base","result"],description:w(1858,null)},add:{type:"boolean",cat:"o",alias:"a",args:"folder",description:w(1859,null)},remove:{type:"boolean",cat:"o",args:"folder",description:w(1860,null)},goto:{type:"boolean",cat:"o",alias:"g",args:"file:line[:character]",description:w(1861,null)},"new-window":{type:"boolean",cat:"o",alias:"n",description:w(1862,null)},"reuse-window":{type:"boolean",cat:"o",alias:"r",description:w(1863,null)},wait:{type:"boolean",cat:"o",alias:"w",description:w(1864,null)},waitMarkerFilePath:{type:"string"},locale:{type:"string",cat:"o",args:"locale",description:w(1865,null)},"user-data-dir":{type:"string",cat:"o",args:"dir",description:w(1866,null)},profile:{type:"string",cat:"o",args:"profileName",description:w(1867,null)},help:{type:"boolean",cat:"o",alias:"h",description:w(1868,null)},"extensions-dir":{type:"string",deprecates:["extensionHomePath"],cat:"e",args:"dir",description:w(1869,null)},"extensions-download-dir":{type:"string"},"builtin-extensions-dir":{type:"string"},"list-extensions":{type:"boolean",cat:"e",description:w(1870,null)},"show-versions":{type:"boolean",cat:"e",description:w(1871,null)},category:{type:"string",allowEmptyValue:!0,cat:"e",description:w(1872,null),args:"category"},"install-extension":{type:"string[]",cat:"e",args:"ext-id | path",description:w(1873,null)},"pre-release":{type:"boolean",cat:"e",description:w(1874,null)},"uninstall-extension":{type:"string[]",cat:"e",args:"ext-id",description:w(1875,null)},"update-extensions":{type:"boolean",cat:"e",description:w(1876,null)},"enable-proposed-api":{type:"string[]",allowEmptyValue:!0,cat:"e",args:"ext-id",description:w(1877,null)},"add-mcp":{type:"string[]",cat:"o",args:"json",description:w(1878,null)},version:{type:"boolean",cat:"t",alias:"v",description:w(1879,null)},verbose:{type:"boolean",cat:"t",global:!0,description:w(1880,null)},log:{type:"string[]",cat:"t",args:"level",global:!0,description:w(1881,null)},status:{type:"boolean",alias:"s",cat:"t",description:w(1882,null)},"prof-startup":{type:"boolean",cat:"t",description:w(1883,null)},"prof-append-timers":{type:"string"},"prof-duration-markers":{type:"string[]"},"prof-duration-markers-file":{type:"string"},"no-cached-data":{type:"boolean"},"prof-startup-prefix":{type:"string"},"prof-v8-extensions":{type:"boolean"},"disable-extensions":{type:"boolean",deprecates:["disableExtensions"],cat:"t",description:w(1884,null)},"disable-extension":{type:"string[]",cat:"t",args:"ext-id",description:w(1885,null)},sync:{type:"string",cat:"t",description:w(1886,null),args:["on | off"]},"inspect-extensions":{type:"string",allowEmptyValue:!0,deprecates:["debugPluginHost"],args:"port",cat:"t",description:w(1887,null)},"inspect-brk-extensions":{type:"string",allowEmptyValue:!0,deprecates:["debugBrkPluginHost"],args:"port",cat:"t",description:w(1888,null)},"disable-lcd-text":{type:"boolean",cat:"t",description:w(1889,null)},"disable-gpu":{type:"boolean",cat:"t",description:w(1890,null)},"disable-chromium-sandbox":{type:"boolean",cat:"t",description:w(1891,null)},sandbox:{type:"boolean"},"locate-shell-integration-path":{type:"string",cat:"t",args:["shell"],description:w(1892,null)},telemetry:{type:"boolean",cat:"t",description:w(1893,null)},remote:{type:"string",allowEmptyValue:!0},"folder-uri":{type:"string[]",cat:"o",args:"uri"},"file-uri":{type:"string[]",cat:"o",args:"uri"},"locate-extension":{type:"string[]"},extensionDevelopmentPath:{type:"string[]"},extensionDevelopmentKind:{type:"string[]"},extensionTestsPath:{type:"string"},extensionEnvironment:{type:"string"},debugId:{type:"string"},debugRenderer:{type:"boolean"},"inspect-ptyhost":{type:"string",allowEmptyValue:!0},"inspect-brk-ptyhost":{type:"string",allowEmptyValue:!0},"inspect-search":{type:"string",deprecates:["debugSearch"],allowEmptyValue:!0},"inspect-brk-search":{type:"string",deprecates:["debugBrkSearch"],allowEmptyValue:!0},"inspect-sharedprocess":{type:"string",allowEmptyValue:!0},"inspect-brk-sharedprocess":{type:"string",allowEmptyValue:!0},"export-default-configuration":{type:"string"},"install-source":{type:"string"},"enable-smoke-test-driver":{type:"boolean"},logExtensionHostCommunication:{type:"boolean"},"skip-release-notes":{type:"boolean"},"skip-welcome":{type:"boolean"},"skip-onboarding":{type:"boolean"},"override-cursor-auth-token":{type:"string"},"disable-telemetry":{type:"boolean"},"disable-updates":{type:"boolean"},"use-inmemory-secretstorage":{type:"boolean",deprecates:["disable-keytar"]},"password-store":{type:"string"},"disable-workspace-trust":{type:"boolean"},"disable-crash-reporter":{type:"boolean"},"crash-reporter-directory":{type:"string"},"crash-reporter-id":{type:"string"},"skip-add-to-recently-opened":{type:"boolean"},"open-url":{type:"boolean"},"file-write":{type:"boolean"},"file-chmod":{type:"boolean"},"install-builtin-extension":{type:"string[]"},force:{type:"boolean"},"do-not-sync":{type:"boolean"},"do-not-include-pack-dependencies":{type:"boolean"},trace:{type:"boolean"},"trace-memory-infra":{type:"boolean"},"trace-category-filter":{type:"string"},"trace-options":{type:"string"},"preserve-env":{type:"boolean"},"force-user-env":{type:"boolean"},"force-disable-user-env":{type:"boolean"},"open-devtools":{type:"boolean"},"shadow-window-for-workspace-id":{type:"string"},"disable-gpu-sandbox":{type:"boolean"},logsPath:{type:"string"},"__enable-file-policy":{type:"boolean"},editSessionId:{type:"string"},continueOn:{type:"string"},"enable-coi":{type:"boolean"},"unresponsive-sample-interval":{type:"string"},"unresponsive-sample-period":{type:"string"},"no-proxy-server":{type:"boolean"},"no-sandbox":{type:"boolean",alias:"sandbox"},"proxy-server":{type:"string"},"proxy-bypass-list":{type:"string"},"proxy-pac-url":{type:"string"},"js-flags":{type:"string"},inspect:{type:"string",allowEmptyValue:!0},"inspect-brk":{type:"string",allowEmptyValue:!0},nolazy:{type:"boolean"},"force-device-scale-factor":{type:"string"},"force-renderer-accessibility":{type:"boolean"},"ignore-certificate-errors":{type:"boolean"},"allow-insecure-localhost":{type:"boolean"},"log-net-log":{type:"string"},vmodule:{type:"string"},_urls:{type:"string[]"},"disable-dev-shm-usage":{type:"boolean"},"profile-temp":{type:"boolean"},"ozone-platform":{type:"string"},"enable-tracing":{type:"string"},"trace-startup-format":{type:"string"},"trace-startup-file":{type:"string"},"trace-startup-duration":{type:"string"},"xdg-portal-required-version":{type:"string"},hmr:{type:"boolean"},_:{type:"string[]"}},f2={onUnknownOption:()=>{},onMultipleValues:()=>{},onEmptyValue:()=>{},onDeprecatedOption:()=>{}}}});import{createServer as Y3}from"net";var g2,J3=g({"out-build/vs/platform/debug/electron-main/extensionHostDebugIpc.js"(){"use strict";G3(),p2(),g2=class extends d2{constructor(t){super(),this.windowsMainService=t}call(t,e,i){return e==="openExtensionDevelopmentHostWindow"?this.openExtensionDevelopmentHostWindow(i[0],i[1]):super.call(t,e,i)}async openExtensionDevelopmentHostWindow(t,e){const i=u1(t,h1);i.debugRenderer=e;const r=i.extensionDevelopmentPath;if(!r)return{success:!1};const[s]=await this.windowsMainService.openExtensionDevelopmentHostWindow(r,{context:5,cli:i,forceProfile:i.profile,forceTempProfile:i["profile-temp"]});if(!e)return{success:!0};const n=s.win;if(!n)return{success:!0};const o=n.webContents.debugger;let a=o.isAttached()?1/0:0;const c=Y3(l=>{a++===0&&o.attach();let u=!1;const d=v=>{u||l.write(JSON.stringify(v)+"\0")},f=(v,m,y,S)=>d({method:m,params:y,sessionId:S});n.on("close",()=>{o.removeListener("message",f),l.end(),u=!0}),o.addListener("message",f);let p=Buffer.alloc(0);l.on("data",v=>{p=Buffer.concat([p,v]);for(let m=p.indexOf(0);m!==-1;m=p.indexOf(0)){let y;try{const S=p.slice(0,m).toString("utf8");p=p.slice(m+1),y=JSON.parse(S)}catch(S){console.error("error reading cdp line",S)}o.sendCommand(y.method,y.params,y.sessionId).then(S=>d({id:y.id,sessionId:y.sessionId,result:S})).catch(S=>d({id:y.id,sessionId:y.sessionId,error:{code:0,message:S.message}}))}}),l.on("error",v=>{console.error("error on cdp pipe:",v)}),l.on("close",()=>{u=!0,--a===0&&o.detach()})});return await new Promise(l=>c.listen(0,l)),n.on("close",()=>c.close()),{rendererDebugPort:c.address().port,success:!0}}}}});function f1(t){return!!t.hostName&&!!t.errorMessage}var m2,p1,g1=g({"out-build/vs/platform/diagnostics/common/diagnostics.js"(){"use strict";G(),m2="diagnosticsService",p1=j(m2)}});function v2(t,e=!1){let i=0;const r=t.length;let s="",n=0,o=16,a=0;function c(m){let y=0,S=0;for(;y<m;){const E=t.charCodeAt(i);if(E>=48&&E<=57)S=S*16+E-48;else if(E>=65&&E<=70)S=S*16+E-65+10;else if(E>=97&&E<=102)S=S*16+E-97+10;else break;i++,y++}return y<m&&(S=-1),S}function l(m){i=m,s="",n=0,o=16,a=0}function u(){const m=i;if(t.charCodeAt(i)===48)i++;else for(i++;i<t.length&&ta(t.charCodeAt(i));)i++;if(i<t.length&&t.charCodeAt(i)===46)if(i++,i<t.length&&ta(t.charCodeAt(i)))for(i++;i<t.length&&ta(t.charCodeAt(i));)i++;else return a=3,t.substring(m,i);let y=i;if(i<t.length&&(t.charCodeAt(i)===69||t.charCodeAt(i)===101))if(i++,(i<t.length&&t.charCodeAt(i)===43||t.charCodeAt(i)===45)&&i++,i<t.length&&ta(t.charCodeAt(i))){for(i++;i<t.length&&ta(t.charCodeAt(i));)i++;y=i}else a=3;return t.substring(m,y)}function d(){let m="",y=i;for(;;){if(i>=r){m+=t.substring(y,i),a=2;break}const S=t.charCodeAt(i);if(S===34){m+=t.substring(y,i),i++;break}if(S===92){if(m+=t.substring(y,i),i++,i>=r){a=2;break}switch(t.charCodeAt(i++)){case 34:m+='"';break;case 92:m+="\\";break;case 47:m+="/";break;case 98:m+="\b";break;case 102:m+="\f";break;case 110:m+=`
|
|
`;break;case 114:m+="\r";break;case 116:m+=" ";break;case 117:{const k=c(4);k>=0?m+=String.fromCharCode(k):a=4;break}default:a=5}y=i;continue}if(S>=0&&S<=31)if(Zd(S)){m+=t.substring(y,i),a=2;break}else a=6;i++}return m}function f(){if(s="",a=0,n=i,i>=r)return n=r,o=17;let m=t.charCodeAt(i);if(m1(m)){do i++,s+=String.fromCharCode(m),m=t.charCodeAt(i);while(m1(m));return o=15}if(Zd(m))return i++,s+=String.fromCharCode(m),m===13&&t.charCodeAt(i)===10&&(i++,s+=`
|
|
`),o=14;switch(m){case 123:return i++,o=1;case 125:return i++,o=2;case 91:return i++,o=3;case 93:return i++,o=4;case 58:return i++,o=6;case 44:return i++,o=5;case 34:return i++,s=d(),o=10;case 47:{const y=i-1;if(t.charCodeAt(i+1)===47){for(i+=2;i<r&&!Zd(t.charCodeAt(i));)i++;return s=t.substring(y,i),o=12}if(t.charCodeAt(i+1)===42){i+=2;const S=r-1;let E=!1;for(;i<S;){if(t.charCodeAt(i)===42&&t.charCodeAt(i+1)===47){i+=2,E=!0;break}i++}return E||(i++,a=1),s=t.substring(y,i),o=13}return s+=String.fromCharCode(m),i++,o=16}case 45:if(s+=String.fromCharCode(m),i++,i===r||!ta(t.charCodeAt(i)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return s+=u(),o=11;default:for(;i<r&&p(m);)i++,m=t.charCodeAt(i);if(n!==i){switch(s=t.substring(n,i),s){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return s+=String.fromCharCode(m),i++,o=16}}function p(m){if(m1(m)||Zd(m))return!1;switch(m){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let m;do m=f();while(m>=12&&m<=15);return m}return{setPosition:l,getPosition:()=>i,scan:e?v:f,getToken:()=>o,getTokenValue:()=>s,getTokenOffset:()=>n,getTokenLength:()=>i-n,getTokenError:()=>a}}function m1(t){return t===32||t===9||t===11||t===12||t===160||t===5760||t>=8192&&t<=8203||t===8239||t===8287||t===12288||t===65279}function Zd(t){return t===10||t===13||t===8232||t===8233}function ta(t){return t>=48&&t<=57}function jn(t,e=[],i=il.DEFAULT){let r=null,s=[];const n=[];function o(c){Array.isArray(s)?s.push(c):r!==null&&(s[r]=c)}return eh(t,{onObjectBegin:()=>{const c={};o(c),n.push(s),s=c,r=null},onObjectProperty:c=>{r=c},onObjectEnd:()=>{s=n.pop()},onArrayBegin:()=>{const c=[];o(c),n.push(s),s=c,r=null},onArrayEnd:()=>{s=n.pop()},onLiteralValue:o,onError:(c,l,u)=>{e.push({error:c,offset:l,length:u})}},i),s[0]}function Q3(t,e=[],i=il.DEFAULT){let r={type:"array",offset:-1,length:-1,children:[],parent:void 0};function s(c){r.type==="property"&&(r.length=c-r.offset,r=r.parent)}function n(c){return r.children.push(c),c}eh(t,{onObjectBegin:c=>{r=n({type:"object",offset:c,length:-1,parent:r,children:[]})},onObjectProperty:(c,l,u)=>{r=n({type:"property",offset:l,length:-1,parent:r,children:[]}),r.children.push({type:"string",value:c,offset:l,length:u,parent:r})},onObjectEnd:(c,l)=>{r.length=c+l-r.offset,r=r.parent,s(c+l)},onArrayBegin:(c,l)=>{r=n({type:"array",offset:c,length:-1,parent:r,children:[]})},onArrayEnd:(c,l)=>{r.length=c+l-r.offset,r=r.parent,s(c+l)},onLiteralValue:(c,l,u)=>{n({type:ia(c),offset:l,length:u,parent:r,value:c}),s(l+u)},onSeparator:(c,l,u)=>{r.type==="property"&&(c===":"?r.colonOffset=l:c===","&&s(l))},onError:(c,l,u)=>{e.push({error:c,offset:l,length:u})}},i);const a=r.children[0];return a&&delete a.parent,a}function w2(t,e){if(!t)return;let i=t;for(const r of e)if(typeof r=="string"){if(i.type!=="object"||!Array.isArray(i.children))return;let s=!1;for(const n of i.children)if(Array.isArray(n.children)&&n.children[0].value===r){i=n.children[1],s=!0;break}if(!s)return}else{const s=r;if(i.type!=="array"||s<0||!Array.isArray(i.children)||s>=i.children.length)return;i=i.children[s]}return i}function eh(t,e,i=il.DEFAULT){const r=v2(t,!1);function s($){return $?()=>$(r.getTokenOffset(),r.getTokenLength()):()=>!0}function n($){return $?ge=>$(ge,r.getTokenOffset(),r.getTokenLength()):()=>!0}const o=s(e.onObjectBegin),a=n(e.onObjectProperty),c=s(e.onObjectEnd),l=s(e.onArrayBegin),u=s(e.onArrayEnd),d=n(e.onLiteralValue),f=n(e.onSeparator),p=s(e.onComment),v=n(e.onError),m=i&&i.disallowComments,y=i&&i.allowTrailingComma;function S(){for(;;){const $=r.scan();switch(r.getTokenError()){case 4:E(14);break;case 5:E(15);break;case 3:E(13);break;case 1:m||E(11);break;case 2:E(12);break;case 6:E(16);break}switch($){case 12:case 13:m?E(10):p();break;case 16:E(1);break;case 15:case 14:break;default:return $}}}function E($,ge=[],Ke=[]){if(v($),ge.length+Ke.length>0){let ie=r.getToken();for(;ie!==17;){if(ge.indexOf(ie)!==-1){S();break}else if(Ke.indexOf(ie)!==-1)break;ie=S()}}}function k($){const ge=r.getTokenValue();return $?d(ge):a(ge),S(),!0}function R(){switch(r.getToken()){case 11:{let $=0;try{$=JSON.parse(r.getTokenValue()),typeof $!="number"&&(E(2),$=0)}catch{E(2)}d($);break}case 7:d(null);break;case 8:d(!0);break;case 9:d(!1);break;default:return!1}return S(),!0}function C(){return r.getToken()!==10?(E(3,[],[2,5]),!1):(k(!1),r.getToken()===6?(f(":"),S(),ne()||E(4,[],[2,5])):E(5,[],[2,5]),!0)}function M(){o(),S();let $=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if($||E(4,[],[]),f(","),S(),r.getToken()===2&&y)break}else $&&E(6,[],[]);C()||E(4,[],[2,5]),$=!0}return c(),r.getToken()!==2?E(7,[2],[]):S(),!0}function J(){l(),S();let $=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if($||E(4,[],[]),f(","),S(),r.getToken()===4&&y)break}else $&&E(6,[],[]);ne()||E(4,[],[4,5]),$=!0}return u(),r.getToken()!==4?E(8,[4],[]):S(),!0}function ne(){switch(r.getToken()){case 3:return J();case 1:return M();case 10:return k(!0);default:return R()}}return S(),r.getToken()===17?i.allowEmptyContent?!0:(E(4,[],[]),!1):ne()?(r.getToken()!==17&&E(9,[],[]),!0):(E(4,[],[]),!1)}function ia(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}var y2,S2,_2,il,b2,Cs=g({"out-build/vs/base/common/json.js"(){"use strict";(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(y2||(y2={})),(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(S2||(S2={})),(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(_2||(_2={})),(function(t){t.DEFAULT={allowTrailingComma:!0}})(il||(il={})),(function(t){t[t.nullCharacter=0]="nullCharacter",t[t.maxAsciiCharacter=127]="maxAsciiCharacter",t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.lineSeparator=8232]="lineSeparator",t[t.paragraphSeparator=8233]="paragraphSeparator",t[t.nextLine=133]="nextLine",t[t.space=32]="space",t[t.nonBreakingSpace=160]="nonBreakingSpace",t[t.enQuad=8192]="enQuad",t[t.emQuad=8193]="emQuad",t[t.enSpace=8194]="enSpace",t[t.emSpace=8195]="emSpace",t[t.threePerEmSpace=8196]="threePerEmSpace",t[t.fourPerEmSpace=8197]="fourPerEmSpace",t[t.sixPerEmSpace=8198]="sixPerEmSpace",t[t.figureSpace=8199]="figureSpace",t[t.punctuationSpace=8200]="punctuationSpace",t[t.thinSpace=8201]="thinSpace",t[t.hairSpace=8202]="hairSpace",t[t.zeroWidthSpace=8203]="zeroWidthSpace",t[t.narrowNoBreakSpace=8239]="narrowNoBreakSpace",t[t.ideographicSpace=12288]="ideographicSpace",t[t.mathematicalSpace=8287]="mathematicalSpace",t[t.ogham=5760]="ogham",t[t._=95]="_",t[t.$=36]="$",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.ampersand=38]="ampersand",t[t.asterisk=42]="asterisk",t[t.at=64]="at",t[t.backslash=92]="backslash",t[t.bar=124]="bar",t[t.caret=94]="caret",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.closeParen=41]="closeParen",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.equals=61]="equals",t[t.exclamation=33]="exclamation",t[t.greaterThan=62]="greaterThan",t[t.lessThan=60]="lessThan",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.openParen=40]="openParen",t[t.percent=37]="percent",t[t.plus=43]="plus",t[t.question=63]="question",t[t.semicolon=59]="semicolon",t[t.singleQuote=39]="singleQuote",t[t.slash=47]="slash",t[t.tilde=126]="tilde",t[t.backspace=8]="backspace",t[t.formFeed=12]="formFeed",t[t.byteOrderMark=65279]="byteOrderMark",t[t.tab=9]="tab",t[t.verticalTab=11]="verticalTab"})(b2||(b2={}))}}),rl,De,th=g({"out-build/vs/base/common/severity.js"(){"use strict";jt(),(function(t){t[t.Ignore=0]="Ignore",t[t.Info=1]="Info",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.AI=4]="AI"})(rl||(rl={})),(function(t){const e="error",i="warning",r="warn",s="info",n="ignore";function o(c){return c?js(e,c)?t.Error:js(i,c)||js(r,c)?t.Warning:js(s,c)?t.Info:t.Ignore:t.Ignore}t.fromValue=o;function a(c){switch(c){case t.Error:return e;case t.Warning:return i;case t.Info:return s;default:return n}}t.toString=a})(rl||(rl={})),De=rl}});function lr(t){if(!t||typeof t!="object"||t instanceof RegExp)return t;const e=Array.isArray(t)?[]:{};return Object.entries(t).forEach(([i,r])=>{e[i]=r&&typeof r=="object"?lr(r):r}),e}function X3(t){if(!t||typeof t!="object")return t;const e=[t];for(;e.length>0;){const i=e.shift();Object.freeze(i);for(const r in i)if(w1.call(i,r)){const s=i[r];typeof s=="object"&&!Object.isFrozen(s)&&!Dx(s)&&e.push(s)}}return t}function Z3(t,e){return v1(t,e,new Set)}function v1(t,e,i){if(ci(t))return t;const r=e(t);if(typeof r<"u")return r;if(Array.isArray(t)){const s=[];for(const n of t)s.push(v1(n,e,i));return s}if(Lt(t)){if(i.has(t))throw new Error("Cannot clone recursive data-structure");i.add(t);const s={};for(const n in t)w1.call(t,n)&&(s[n]=v1(t[n],e,i));return i.delete(t),s}return t}function sl(t,e,i=!0){return Lt(t)?(Lt(e)&&Object.keys(e).forEach(r=>{r in t?i&&(Lt(t[r])&&Lt(e[r])?sl(t[r],e[r],i):t[r]=e[r]):t[r]=e[r]}),t):e}function Kr(t,e){if(t===e)return!0;if(t==null||e===null||e===void 0||typeof t!=typeof e||typeof t!="object"||Array.isArray(t)!==Array.isArray(e))return!1;let i,r;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(!Kr(t[i],e[i]))return!1}else{const s=[];for(r in t)s.push(r);s.sort();const n=[];for(r in e)n.push(r);if(n.sort(),!Kr(s,n))return!1;for(i=0;i<s.length;i++)if(!Kr(t[s[i]],e[s[i]]))return!1}return!0}function eD(t){const e=new Set;return JSON.stringify(t,(i,r)=>{if(Lt(r)||Array.isArray(r)){if(e.has(r))return"[Circular]";e.add(r)}return typeof r=="bigint"?`[BigInt ${r.toString()}]`:r})}function E2(t,e){const i=e.toLowerCase(),r=Object.keys(t).find(s=>s.toLowerCase()===i);return r?t[r]:t[e]}var w1,ur=g({"out-build/vs/base/common/objects.js"(){"use strict";xe(),w1=Object.prototype.hasOwnProperty}});function k2(t,e){const i=lr(t);let r=(i.buttons??[]).map(a=>p_(a).withMnemonic),s=(t.buttons||[]).map((a,c)=>c),n=0,o=i.cancelId??r.length-1;if(r.length>1){const a=typeof o=="number"?r[o]:void 0;if(Pe||O){if(typeof a=="string"&&r.length>1&&o!==1){r.splice(o,1),r.splice(1,0,a);const c=s[o];s.splice(o,1),s.splice(1,0,c),o=1}Pe&&r.length>1&&(r=r.reverse(),s=s.reverse(),n=r.length-1,typeof a=="string"&&(o=n-1))}else if(B&&typeof a=="string"&&r.length>1&&o!==r.length-1){r.splice(o,1),r.push(a);const c=s[o];s.splice(o,1),s.push(c),o=r.length-1}}return i.buttons=r,i.defaultId=n,i.cancelId=o,i.noLink=!0,i.title=i.title||e.nameLong,{options:i,buttonIndeces:s}}var tD,P2,iD,x2,C2=g({"out-build/vs/platform/dialogs/common/dialogs.js"(){"use strict";gt(),th(),we(),G(),qs(),z(),ur(),tD=j("dialogService"),(function(t){t[t.Confirmation=1]="Confirmation",t[t.Prompt=2]="Prompt",t[t.Input=3]="Input"})(P2||(P2={})),iD=j("fileDialogService"),(function(t){t[t.SAVE=0]="SAVE",t[t.DONT_SAVE=1]="DONT_SAVE",t[t.CANCEL=2]="CANCEL"})(x2||(x2={}))}});import Hn from"electron";var Is,ih,Vn=g({"out-build/vs/platform/dialogs/electron-main/dialogMainService.js"(){"use strict";ae(),_s(),qs(),L(),td(),z(),qt(),we(),C2(),G(),K(),lt(),hi(),Is=j("dialogMainService"),ih=class{constructor(e,i){this.logService=e,this.productService=i,this.windowFileDialogLocks=new Map,this.windowDialogQueues=new Map,this.noWindowDialogueQueue=new Wo}pickFileFolder(e,i){return this.doPick({...e,pickFolders:!0,pickFiles:!0,title:w(1846,null)},i)}pickFolder(e,i){return this.doPick({...e,pickFolders:!0,title:w(1847,null)},i)}pickFile(e,i){return this.doPick({...e,pickFiles:!0,title:w(1848,null)},i)}pickWorkspace(e,i){const r=w(1849,null),s=p_(w(1850,null)).withMnemonic,n=D4;return this.doPick({...e,pickFiles:!0,title:r,filters:n,buttonLabel:s},i)}async doPick(e,i){const r={title:e.title,buttonLabel:e.buttonLabel,filters:e.filters,defaultPath:e.defaultPath};(typeof e.pickFiles=="boolean"||typeof e.pickFolders=="boolean")&&(r.properties=void 0,e.pickFiles&&e.pickFolders&&(r.properties=["multiSelections","openDirectory","openFile","createDirectory"])),r.properties||(r.properties=["multiSelections",e.pickFolders?"openDirectory":"openFile","createDirectory"]),O&&r.properties.push("treatPackageAsDirectory");const s=await this.showOpenDialog(r,(i||Hn.BrowserWindow.getFocusedWindow())??void 0);if(s&&s.filePaths&&s.filePaths.length>0)return s.filePaths}getWindowDialogQueue(e){if(e){let i=this.windowDialogQueues.get(e.id);return i||(i=new Wo,this.windowDialogQueues.set(e.id,i)),i}else return this.noWindowDialogueQueue}showMessageBox(e,i){return this.getWindowDialogQueue(i).queue(async()=>{const{options:r,buttonIndeces:s}=k2(e,this.productService);let n;return i?n=await Hn.dialog.showMessageBox(i,r):n=await Hn.dialog.showMessageBox(r),{response:s[n.response],checkboxChecked:n.checkboxChecked}})}async showSaveDialog(e,i){const r=this.acquireFileDialogLock(e,i);if(!r)return this.logService.error("[DialogMainService]: file save dialog is already or will be showing for the window with the same configuration"),{canceled:!0,filePath:""};try{return await this.getWindowDialogQueue(i).queue(async()=>{let s;return i?s=await Hn.dialog.showSaveDialog(i,e):s=await Hn.dialog.showSaveDialog(e),s.filePath=this.normalizePath(s.filePath),s})}finally{Rt(r)}}normalizePath(e){return e&&O&&(e=Oo(e)),e}normalizePaths(e){return e.map(i=>this.normalizePath(i))}async showOpenDialog(e,i){e.defaultPath&&(await te.exists(e.defaultPath)||(e.defaultPath=void 0));const r=this.acquireFileDialogLock(e,i);if(!r)return this.logService.error("[DialogMainService]: file open dialog is already or will be showing for the window with the same configuration"),{canceled:!0,filePaths:[]};try{return await this.getWindowDialogQueue(i).queue(async()=>{let s;return i?s=await Hn.dialog.showOpenDialog(i,e):s=await Hn.dialog.showOpenDialog(e),s.filePaths=this.normalizePaths(s.filePaths),s})}finally{Rt(r)}}acquireFileDialogLock(e,i){if(!i)return N.None;this.logService.trace("[DialogMainService]: request to acquire file dialog lock",e);let r=this.windowFileDialogLocks.get(i.id);r||(r=new Set,this.windowFileDialogLocks.set(i.id,r));const s=Ur(e);if(!r.has(s))return this.logService.trace("[DialogMainService]: new file dialog lock created",e),r.add(s),me(()=>{this.logService.trace("[DialogMainService]: file dialog lock disposed",e),r?.delete(s),r?.size===0&&this.windowFileDialogLocks.delete(i.id)})}},ih=__decorate([__param(0,V),__param(1,qe)],ih)}});async function rD(t,e,i){for(const s of t){const n=s.openedWorkspace;if(zt(n)){const o=await i(n);if(o){if(o.folders.some(a=>rt.isEqualOrParent(e,a.uri)))return s}else if(rt.isEqualOrParent(e,n.configPath))return s}}const r=t.filter(s=>Ri(s.openedWorkspace)&&rt.isEqualOrParent(e,s.openedWorkspace.uri));if(r.length)return r.sort((s,n)=>-(s.openedWorkspace.uri.path.length-n.openedWorkspace.uri.path.length))[0]}function rh(t,e){for(const i of t)if(zt(i.openedWorkspace)&&rt.isEqual(i.openedWorkspace.configPath,e)||Ri(i.openedWorkspace)&&rt.isEqual(i.openedWorkspace.uri,e))return i}function sD(t,e){const i=r=>e.some(s=>rt.isEqual(x.file(s),x.file(r)));for(const r of t)if(r.config?.extensionDevelopmentPath?.some(s=>i(s)))return r}var I2=g({"out-build/vs/platform/windows/electron-main/windowsFinder.js"(){"use strict";gt(),re(),hi()}});function nD(t,e,i){let r,s,n,o,a;if(e){for(o=e.offset,a=o+e.length,n=o;n>0&&!sh(t,n-1);)n--;let k=a;for(;k<t.length&&!sh(t,k);)k++;s=t.substring(n,k),r=oD(s,i)}else s=t,r=0,n=0,o=0,a=t.length;const c=aD(i,t);let l=!1,u=0,d;i.insertSpaces?d=y1(" ",i.tabSize||4):d=" ";const f=v2(s,!1);let p=!1;function v(){return c+y1(d,r+u)}function m(){let k=f.scan();for(l=!1;k===15||k===14;)l=l||k===14,k=f.scan();return p=k===16||f.getTokenError()!==0,k}const y=[];function S(k,R,C){!p&&R<a&&C>o&&t.substring(R,C)!==k&&y.push({offset:R,length:C-R,content:k})}let E=m();if(E!==17){const k=f.getTokenOffset()+n,R=y1(d,r);S(R,n,k)}for(;E!==17;){let k=f.getTokenOffset()+f.getTokenLength()+n,R=m(),C="";for(;!l&&(R===12||R===13);){const J=f.getTokenOffset()+n;S(" ",k,J),k=f.getTokenOffset()+f.getTokenLength()+n,C=R===12?v():"",R=m()}if(R===2)E!==1&&(u--,C=v());else if(R===4)E!==3&&(u--,C=v());else{switch(E){case 3:case 1:u++,C=v();break;case 5:case 12:C=v();break;case 13:l?C=v():C=" ";break;case 6:C=" ";break;case 10:if(R===6){C="";break}case 7:case 8:case 9:case 11:case 2:case 4:R===12||R===13?C=" ":R!==5&&R!==17&&(p=!0);break;case 16:p=!0;break}l&&(R===12||R===13)&&(C=v())}const M=f.getTokenOffset()+n;S(C,k,M),E=R}return y}function y1(t,e){let i="";for(let r=0;r<e;r++)i+=t;return i}function oD(t,e){let i=0,r=0;const s=e.tabSize||4;for(;i<t.length;){const n=t.charAt(i);if(n===" ")r++;else if(n===" ")r+=s;else break;i++}return Math.floor(r/s)}function aD(t,e){for(let i=0;i<e.length;i++){const r=e.charAt(i);if(r==="\r")return i+1<e.length&&e.charAt(i+1)===`
|
|
`?`\r
|
|
`:"\r";if(r===`
|
|
`)return`
|
|
`}return t&&t.eol||`
|
|
`}function sh(t,e){return`\r
|
|
`.indexOf(t.charAt(e))!==-1}var cD=g({"out-build/vs/base/common/jsonFormatter.js"(){"use strict";Cs()}});function lD(t,e,i,r,s){const n=e.slice(),a=Q3(t,[]);let c,l;for(;n.length>0&&(l=n.pop(),c=w2(a,n),c===void 0&&i!==void 0);)typeof l=="string"?i={[l]:i}:i=[i];if(c)if(c.type==="object"&&typeof l=="string"&&Array.isArray(c.children)){const u=w2(c,[l]);if(u!==void 0)if(i===void 0){if(!u.parent)throw new Error("Malformed AST");const d=c.children.indexOf(u.parent);let f,p=u.parent.offset+u.parent.length;if(d>0){const v=c.children[d-1];f=v.offset+v.length}else f=c.offset+1,c.children.length>1&&(p=c.children[1].offset);return ra(t,{offset:f,length:p-f,content:""},r)}else return ra(t,{offset:u.offset,length:u.length,content:JSON.stringify(i)},r);else{if(i===void 0)return[];const d=`${JSON.stringify(l)}: ${JSON.stringify(i)}`,f=s?s(c.children.map(v=>v.children[0].value)):c.children.length;let p;if(f>0){const v=c.children[f-1];p={offset:v.offset+v.length,length:0,content:","+d}}else c.children.length===0?p={offset:c.offset+1,length:0,content:d}:p={offset:c.offset+1,length:0,content:d+","};return ra(t,p,r)}}else if(c.type==="array"&&typeof l=="number"&&Array.isArray(c.children))if(i!==void 0){const u=`${JSON.stringify(i)}`;let d;if(c.children.length===0||l===0)d={offset:c.offset+1,length:0,content:c.children.length===0?u:u+","};else{const f=l===-1||l>c.children.length?c.children.length:l,p=c.children[f-1];d={offset:p.offset+p.length,length:0,content:","+u}}return ra(t,d,r)}else{const u=l,d=c.children[u];let f;if(c.children.length===1)f={offset:c.offset+1,length:c.length-2,content:""};else if(c.children.length-1===u){const p=c.children[u-1],v=p.offset+p.length,m=c.offset+c.length;f={offset:v,length:m-2-v,content:""}}else f={offset:d.offset,length:c.children[u+1].offset-d.offset,content:""};return ra(t,f,r)}else throw new Error(`Can not add ${typeof l!="number"?"index":"property"} to parent of type ${c.type}`);else return i===void 0?[]:ra(t,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(i)},r)}function ra(t,e,i){let r=S1(t,e),s=e.offset,n=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;s>0&&!sh(r,s-1);)s--;for(;n<r.length&&!sh(r,n);)n++}const o=nD(r,{offset:s,length:n-s},i);for(let c=o.length-1;c>=0;c--){const l=o[c];r=S1(r,l),s=Math.min(s,l.offset),n=Math.max(n,l.offset+l.length),n+=l.content.length-l.length}const a=t.length-(r.length-n)-s;return[{offset:s,length:a,content:r.substring(s,n)}]}function S1(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}function uD(t,e){const i=e.slice(0).sort((s,n)=>{const o=s.offset-n.offset;return o===0?s.length-n.length:o});let r=t.length;for(let s=i.length-1;s>=0;s--){const n=i[s];if(n.offset+n.length<=r)t=S1(t,n);else throw new Error("Overlapping edit");r=n.offset}return t}var D2=g({"out-build/vs/base/common/jsonEdit.js"(){"use strict";Cs(),cD()}});function sa(t){return t.scheme===T.vscodeRemote?t.authority:void 0}var nl=g({"out-build/vs/platform/remote/common/remoteHosts.js"(){"use strict";Ie()}});function _1(t){return t.hasOwnProperty("workspace")}function nh(t){return t.hasOwnProperty("folderUri")}function dD(t){return t.hasOwnProperty("fileUri")}function hD(t){return A2(t)||R2(t)}function A2(t){const e=t;return typeof e?.path=="string"&&(!e.name||typeof e.name=="string")}function R2(t){const e=t;return typeof e?.uri=="string"&&(!e.name||typeof e.name=="string")}function fD(t,e,i,r,s){if(t.scheme!==r.scheme)return{name:i,uri:t.toString(!0)};let n=e?void 0:s.relativePath(r,t);if(n!==void 0)n.length===0?n=".":B&&(n=M2(n));else if(t.scheme===T.file)n=t.fsPath,B&&(n=M2(n));else if(s.isEqualAuthority(t.authority,r.authority))n=t.path;else return{name:i,uri:t.toString(!0)};return{name:i,path:n}}function M2(t){return t=tm(t),WC(t)||(t=Mo(t)),t}function pD(t,e,i){const r=[],s=new Set,n=i.dirname(e);for(const o of t){let a;if(A2(o))o.path&&(a=i.resolvePath(n,o.path));else if(R2(o))try{a=x.parse(o.uri),a.path[0]!==le.sep&&(a=a.with({path:le.sep+a.path}))}catch(c){console.warn(c)}if(a){const c=i.getComparisonKey(a);if(!s.has(c)){s.add(c);const l=o.name||i.basenameOrAuthority(a);r.push(new C4({uri:a,name:l,index:r.length},o))}}}return r}function gD(t){return t.workspace&&typeof t.workspace=="object"&&typeof t.workspace.id=="string"&&typeof t.workspace.configPath=="string"}function mD(t){return typeof t.folderUri=="string"}function vD(t){return typeof t.fileUri=="string"}function wD(t,e){const i={workspaces:[],files:[]};if(t){const r=function(n,o){for(let a=0;a<n.length;a++)try{o(n[a],a)}catch(c){e.warn(`Error restoring recent entry ${JSON.stringify(n[a])}: ${c.toString()}. Skip entry.`)}},s=t;Array.isArray(s.entries)&&r(s.entries,n=>{const o=n.label,a=n.remoteAuthority;gD(n)?i.workspaces.push({label:o,remoteAuthority:a,workspace:{id:n.workspace.id,configPath:x.parse(n.workspace.configPath)}}):mD(n)?i.workspaces.push({label:o,remoteAuthority:a,folderUri:x.parse(n.folderUri)}):vD(n)&&i.files.push({label:o,remoteAuthority:a,fileUri:x.parse(n.fileUri)})})}return i}function yD(t){const e={entries:[]},i=(r,s)=>r&&r!==s.fsPath&&r!==s.path;for(const r of t.workspaces)nh(r)?e.entries.push({folderUri:r.folderUri.toString(),label:i(r.label,r.folderUri)?r.label:void 0,remoteAuthority:r.remoteAuthority}):e.entries.push({workspace:{id:r.workspace.id,configPath:r.workspace.configPath.toString()},label:i(r.label,r.workspace.configPath)?r.label:void 0,remoteAuthority:r.remoteAuthority});for(const r of t.files)e.entries.push({fileUri:r.fileUri.toString(),label:i(r.label,r.fileUri)?r.label:void 0,remoteAuthority:r.remoteAuthority});return e}var b1,E1=g({"out-build/vs/platform/workspaces/common/workspaces.js"(){"use strict";Bi(),Cs(),D2(),qs(),Ie(),ye(),z(),gt(),re(),G(),nl(),hi(),b1=j("workspacesService")}});import*as T2 from"fs";import SD from"electron";var rn,oh,qn=g({"out-build/vs/platform/workspaces/electron-main/workspacesManagementMainService.js"(){"use strict";q(),Cs(),L(),Ie(),ye(),gt(),qt(),we(),tl(),Vn(),ct(),G(),K(),$n(),I2(),hi(),E1(),l1(),rn=j("workspacesManagementMainService"),oh=class extends N{constructor(e,i,r,s,n){super(),this.environmentMainService=e,this.logService=i,this.userDataProfilesMainService=r,this.backupMainService=s,this.dialogMainService=n,this._onDidDeleteUntitledWorkspace=this._register(new D),this.onDidDeleteUntitledWorkspace=this._onDidDeleteUntitledWorkspace.event,this._onDidEnterWorkspace=this._register(new D),this.onDidEnterWorkspace=this._onDidEnterWorkspace.event,this.untitledWorkspaces=[],this.untitledWorkspacesHome=this.environmentMainService.untitledWorkspacesHome}async initialize(){this.untitledWorkspaces=[];try{const e=(await te.readdir(this.untitledWorkspacesHome.with({scheme:T.file}).fsPath)).map(i=>pe(this.untitledWorkspacesHome,i,Vm));for(const i of e){const r=Bn(i),s=await this.resolveLocalWorkspace(i);s?this.untitledWorkspaces.push({workspace:r,remoteAuthority:s.remoteAuthority}):await this.deleteUntitledWorkspace(r)}}catch(e){e.code!=="ENOENT"&&this.logService.warn(`Unable to read folders in ${this.untitledWorkspacesHome} (${e}).`)}}resolveLocalWorkspace(e){return this.doResolveLocalWorkspace(e,i=>T2.promises.readFile(i,"utf8"))}doResolveLocalWorkspace(e,i){if(this.isWorkspacePath(e)&&e.scheme===T.file)try{const r=i(e.fsPath);return r instanceof Promise?r.then(s=>this.doResolveWorkspace(e,s),s=>{}):this.doResolveWorkspace(e,r)}catch{return}}isWorkspacePath(e){return E4(e,this.environmentMainService)||Un(e)}doResolveWorkspace(e,i){try{const r=this.doParseStoredWorkspace(e,i),s=Bn(e);return{id:s.id,configPath:s.configPath,folders:pD(r.folders,s.configPath,rt),remoteAuthority:r.remoteAuthority,transient:r.transient}}catch(r){this.logService.warn(r.toString())}}doParseStoredWorkspace(e,i){const r=jn(i);if(r&&Array.isArray(r.folders))r.folders=r.folders.filter(s=>hD(s));else throw new Error(`${e.toString(!0)} looks like an invalid workspace file.`);return r}async createUntitledWorkspace(e,i){const{workspace:r,storedWorkspace:s}=this.newUntitledWorkspace(e,i),n=r.configPath.fsPath;return await T2.promises.mkdir(pt(n),{recursive:!0}),await te.writeFile(n,JSON.stringify(s,null," ")),this.untitledWorkspaces.push({workspace:r,remoteAuthority:i}),r}newUntitledWorkspace(e=[],i){const r=(Date.now()+Math.round(Math.random()*1e3)).toString(),s=pe(this.untitledWorkspacesHome,r),n=pe(s,Vm),o=[];for(const a of e)o.push(fD(a.uri,!0,a.name,s,rt));return{workspace:Bn(n),storedWorkspace:{folders:o,remoteAuthority:i}}}async getWorkspaceIdentifier(e){return Bn(e)}isUntitledWorkspace(e){return E4(e.configPath,this.environmentMainService)}async deleteUntitledWorkspace(e){this.isUntitledWorkspace(e)&&(await this.doDeleteUntitledWorkspace(e),this.userDataProfilesMainService.unsetWorkspace(e),this._onDidDeleteUntitledWorkspace.fire(e))}async doDeleteUntitledWorkspace(e){const i=ji(e.configPath);try{await te.rm(pt(i));const r=U(this.environmentMainService.workspaceStorageHome.with({scheme:T.file}).fsPath,e.id);await te.exists(r)&&await te.writeFile(U(r,"obsolete"),""),this.untitledWorkspaces=this.untitledWorkspaces.filter(s=>s.workspace.id!==e.id)}catch(r){this.logService.warn(`Unable to delete untitled workspace ${i} (${r}).`)}}getUntitledWorkspaces(){return this.untitledWorkspaces}async enterWorkspace(e,i,r){if(!e||!e.win||!e.isReady||!await this.isValidTargetWorkspacePath(e,i,r))return;const n=await this.doEnterWorkspace(e,Bn(r));if(n)return this._onDidEnterWorkspace.fire({window:e,workspace:n.workspace}),n}async isValidTargetWorkspacePath(e,i,r){return r?zt(e.openedWorkspace)&&rt.isEqual(e.openedWorkspace.configPath,r)?!1:rh(i,r)?(await this.dialogMainService.showMessageBox({type:"info",buttons:[w(2663,null)],message:w(2664,null,Nr(r)),detail:w(2665,null)},SD.BrowserWindow.getFocusedWindow()??void 0),!1):!0:!0}async doEnterWorkspace(e,i){if(!e.config)return;e.focus();let r;return e.config.extensionDevelopmentPath||(e.config.backupPath?r=await this.backupMainService.registerWorkspaceBackup({workspace:i,remoteAuthority:e.remoteAuthority},e.config.backupPath):r=this.backupMainService.registerWorkspaceBackup({workspace:i,remoteAuthority:e.remoteAuthority})),zt(e.openedWorkspace)&&this.isUntitledWorkspace(e.openedWorkspace)&&await this.deleteUntitledWorkspace(e.openedWorkspace),e.config.workspace=i,e.config.backupPath=r,{workspace:i,backupPath:r}}},oh=__decorate([__param(0,st),__param(1,V),__param(2,Gr),__param(3,ea),__param(4,Is)],oh)}});function _D(t,...e){const i=e.reduce((n,o)=>(n[o]=!0,n),{}),r=[/^ELECTRON_.+$/,/^VSCODE_(?!(PORTABLE|SHELL_LOGIN|ENV_REPLACE|ENV_APPEND|ENV_PREPEND)).+$/,/^SNAP(|_.*)$/,/^GDK_PIXBUF_.+$/];Object.keys(t).filter(n=>!i[n]).forEach(n=>{for(let o=0;o<r.length;o++)if(n.search(r[o])!==-1){delete t[n];break}})}function W2(t){t&&(delete t.DEBUG,Pe&&delete t.LD_PRELOAD)}var L2,O2,ah=g({"out-build/vs/base/common/processes.js"(){"use strict";z(),(function(t){t[t.stdout=0]="stdout",t[t.stderr=1]="stderr"})(L2||(L2={})),(function(t){t[t.Success=0]="Success",t[t.Unknown=1]="Unknown",t[t.AccessDenied=2]="AccessDenied",t[t.ProcessNotFound=3]="ProcessNotFound"})(O2||(O2={}))}});import{MessageChannelMain as bD,app as ED,utilityProcess as kD}from"electron";import{StringDecoder as F2}from"string_decoder";function PD(t){return typeof t.responseWindowId=="number"}var na,sn,ol,oa=g({"out-build/vs/platform/utilityProcess/electron-main/utilityProcess.js"(){"use strict";L(),q(),K(),ae(),Ie(),ut(),th(),ti(),ft(),ah(),ur(),z(),Ja(),sn=class extends N{static{na=this}static{this.ID_COUNTER=0}static{this.all=new Map}static getAll(){return Array.from(na.all.values())}constructor(e,i,r){super(),this.logService=e,this.telemetryService=i,this.lifecycleMainService=r,this.id=String(++na.ID_COUNTER),this._onStdout=this._register(new D),this.onStdout=this._onStdout.event,this._onStderr=this._register(new D),this.onStderr=this._onStderr.event,this._onMessage=this._register(new D),this.onMessage=this._onMessage.event,this._onSpawn=this._register(new D),this.onSpawn=this._onSpawn.event,this._onExit=this._register(new D),this.onExit=this._onExit.event,this._onCrash=this._register(new D),this.onCrash=this._onCrash.event,this.process=void 0,this.processPid=void 0,this.configuration=void 0}log(e,i){let r;switch(this.configuration?.correlationId?r=`[UtilityProcess id: ${this.configuration?.correlationId}, type: ${this.configuration?.type}, pid: ${this.processPid??"<none>"}]: ${e}`:r=`[UtilityProcess type: ${this.configuration?.type}, pid: ${this.processPid??"<none>"}]: ${e}`,i){case De.Error:this.logService.error(r);break;case De.Warning:this.logService.warn(r);break;case De.Info:this.logService.trace(r);break}}validateCanStart(){return this.process?(this.log("Cannot start utility process because it is already running...",De.Error),!1):!0}start(e){const i=this.doStart(e);return i&&e.payload&&this.postMessage(e.payload)&&this.log("payload sent via postMessage()",De.Info),i}doStart(e){if(!this.validateCanStart())return!1;this.configuration=e;const i=`${this.configuration.type}-${this.id}`,r=Ct.asFileUri("bootstrap-fork.js").fsPath,s=this.configuration.args??[],n=this.configuration.execArgv??[],o=this.configuration.allowLoadingUnsignedLibraries,a=this.configuration.respondToAuthRequestsFromMainProcess,c="pipe",l=this.createEnv(e);return this.log("creating new...",De.Info),this.process=kD.fork(r,s,{serviceName:i,env:l,execArgv:n,allowLoadingUnsignedLibraries:o,respondToAuthRequestsFromMainProcess:a,stdio:c}),this.registerListeners(this.process,this.configuration,i),!0}createEnv(e){const i=e.env?{...e.env}:{...lr(process.env)};i.VSCODE_PROCESS_TITLE=e.processTitle,i.VSCODE_ESM_ENTRYPOINT=e.entryPoint,typeof e.parentLifecycleBound=="number"&&(i.VSCODE_PARENT_PID=String(e.parentLifecycleBound)),i.VSCODE_CRASH_REPORTER_PROCESS_TYPE=e.type,B&&(tx()?i.NODE_DISABLE_UNC_ACCESS_CHECKS="1":i.NODE_UNC_HOST_ALLOWLIST=X8().join("\\")),W2(i);for(const r of Object.keys(i))i[r]=String(i[r]);return i}registerListeners(e,i,r){if(e.stdout){const s=new F2("utf-8");this._register(P.fromNodeEventEmitter(e.stdout,"data")(n=>this._onStdout.fire(typeof n=="string"?n:s.write(n))))}if(e.stderr){const s=new F2("utf-8");this._register(P.fromNodeEventEmitter(e.stderr,"data")(n=>this._onStderr.fire(typeof n=="string"?n:s.write(n))))}this._register(P.fromNodeEventEmitter(e,"message")(s=>this._onMessage.fire(s))),this._register(P.fromNodeEventEmitter(e,"spawn")(()=>{this.processPid=e.pid,typeof e.pid=="number"&&na.all.set(e.pid,{pid:e.pid,name:PD(i)?`${i.type} [${i.responseWindowId}]`:i.type}),this.log("successfully created",De.Info),this._onSpawn.fire(e.pid)})),this._register(P.fromNodeEventEmitter(e,"exit")(s=>{this.log(`received exit event with code ${s}`,De.Info),this._onExit.fire({pid:this.processPid,code:s,signal:"unknown"}),this.onDidExitOrCrashOrKill()})),this._register(P.fromNodeEventEmitter(e,"error",(s,n,o)=>({type:s,location:n,report:o}))(({type:s,location:n,report:o})=>{this.log(`crashed due to ${s} from V8 at ${n}`,De.Info);let a=[];try{a=JSON.parse(o).sharedObjects.filter(l=>l.endsWith(".node")).map(l=>{const u=l.indexOf("extensions")===-1?l.indexOf("node_modules"):l.indexOf("extensions");return l.substring(u)})}catch{}this.telemetryService.publicLog2("utilityprocessv8error",{processtype:i.type,error:s,location:n,addons:a})})),this._register(P.fromNodeEventEmitter(ED,"child-process-gone",(s,n)=>({event:s,details:n}))(({details:s})=>{s.type==="Utility"&&s.name===r&&(this.log(`crashed with code ${s.exitCode} and reason '${s.reason}'`,De.Error),this.telemetryService.publicLog2("utilityprocesscrash",{type:i.type,reason:s.reason,code:s.exitCode}),this._onCrash.fire({pid:this.processPid,code:s.exitCode,reason:s.reason}),this.onDidExitOrCrashOrKill())}))}once(e,i){const r=this._register(this._onMessage.event(s=>{s===e&&(r.dispose(),i())}))}postMessage(e,i){return this.process?(this.process.postMessage(e,i),!0):!1}connect(e){const{port1:i,port2:r}=new bD;return this.postMessage(e,[r]),i}enableInspectPort(){if(!this.process||typeof this.processPid!="number")return!1;this.log("enabling inspect port",De.Info);const e=process;return typeof e._debugProcess=="function"?(e._debugProcess(this.processPid),!0):!1}kill(){if(!this.process)return;this.log("attempting to kill the process...",De.Info),this.process.kill()?(this.log("successfully killed the process",De.Info),this.onDidExitOrCrashOrKill()):this.log("unable to kill the process",De.Warning)}onDidExitOrCrashOrKill(){typeof this.processPid=="number"&&na.all.delete(this.processPid),this.process=void 0}async waitForExit(e){this.process&&(this.log("waiting to exit...",De.Info),await Promise.race([P.toPromise(this.onExit),Pi(e)]),this.process&&(this.log(`did not exit within ${e}ms, will kill it now...`,De.Info),this.kill()))}},sn=na=__decorate([__param(0,V),__param(1,ei),__param(2,ze)],sn),ol=class extends sn{constructor(e,i,r,s){super(e,r,s),this.windowsMainService=i}start(e){const i=this.windowsMainService.getWindowById(e.responseWindowId);if(i===void 0||i.webContents===void 0||i?.win?.isDestroyed()===!0||i?.webContents?.isDestroyed()===!0)return this.log("Refusing to start utility process because requesting window cannot be found or is destroyed...",De.Error),!0;if(!super.doStart(e))return!1;i?.win&&this.registerWindowListeners(i.win,e);const s=this.connect(e.payload);return i.webContents.postMessage(e.responseChannel,e.responseNonce,[s]),!0}registerWindowListeners(e,i){i.windowLifecycleBound&&(this._register(P.filter(this.lifecycleMainService.onWillLoadWindow,r=>r.window.win===e)(()=>this.kill())),this._register(P.fromNodeEventEmitter(e,"closed")(()=>this.kill())))}},ol=__decorate([__param(0,V),__param(1,ot),__param(2,ei),__param(3,ze)],ol)}});import{app as N2}from"electron";var U2,ch,lh,$2=g({"out-build/vs/platform/diagnostics/electron-main/diagnosticsMainService.js"(){"use strict";nr(),St(),G(),ut(),hi(),qn(),xe(),K(),oa(),U2="diagnosticsMainService",ch=j(U2),lh=class{constructor(e,i,r){this.windowsMainService=e,this.workspacesManagementMainService=i,this.logService=r}async getRemoteDiagnostics(e){const i=this.windowsMainService.getWindows();return(await Promise.all(i.map(async s=>{const n=s.remoteAuthority;if(!n)return;const o=`vscode:getDiagnosticInfoResponse${s.id}`,a={includeProcesses:e.includeProcesses,folders:e.includeWorkspaceMetadata?await this.getFolderURIs(s):void 0};return new Promise(c=>{s.sendWhenReady("vscode:getDiagnosticInfo",Te.None,{replyChannel:o,args:a}),We.once(o,(l,u)=>{u||c({hostName:n,errorMessage:`Unable to resolve connection to '${n}'.`}),c(u)}),setTimeout(()=>{c({hostName:n,errorMessage:`Connection to '${n}' could not be established`})},5e3)})}))).filter(s=>!!s)}async getMainDiagnostics(){this.logService.trace("Received request for main process info from other instance.");const e=[];for(const r of Gc()){const s=this.windowsMainService.getWindowById(r.id);s?e.push(await this.codeWindowToInfo(s)):e.push(this.browserWindowToInfo(r))}const i=[];for(const{pid:r,name:s}of sn.getAll())i.push({pid:r,name:s});return{mainPID:process.pid,mainArguments:process.argv.slice(1),windows:e,pidToNames:i,screenReader:!!N2.accessibilitySupportEnabled,gpuFeatureStatus:N2.getGPUFeatureStatus()}}async codeWindowToInfo(e){const i=await this.getFolderURIs(e),r=Fu(e.win);return this.browserWindowToInfo(r,i,e.remoteAuthority)}browserWindowToInfo(e,i=[],r){return{id:e.id,pid:e.webContents.getOSProcessId(),title:e.getTitle(),folderURIs:i,remoteAuthority:r}}async getFolderURIs(e){const i=[],r=e.openedWorkspace;if(Ri(r))i.push(r.uri);else if(zt(r)){const s=await this.workspacesManagementMainService.resolveLocalWorkspace(r.configPath);s&&s.folders.forEach(o=>{i.push(o.uri)})}return i}},lh=__decorate([__param(0,ot),__param(1,rn),__param(2,V)],lh)}});import{safeStorage as xD,app as CD}from"electron";var Ds,uh,ID=g({"out-build/vs/platform/encryption/electron-main/encryptionMainService.js"(){"use strict";z(),K(),Ds=xD,uh=class{constructor(e){this.logService=e,CD.commandLine.getSwitchValue("password-store")==="basic"&&(this.logService.trace("[EncryptionMainService] setting usePlainTextEncryption to true..."),Ds.setUsePlainTextEncryption?.(!0),this.logService.trace("[EncryptionMainService] set usePlainTextEncryption to true"))}async encrypt(e){this.logService.trace("[EncryptionMainService] Encrypting value...");try{const i=JSON.stringify(Ds.encryptString(e));return this.logService.trace("[EncryptionMainService] Encrypted value."),i}catch(i){throw this.logService.error(i),i}}async decrypt(e){let i;try{if(i=JSON.parse(e),!i.data)throw new Error(`[EncryptionMainService] Invalid encrypted value: ${e}`);const r=Buffer.from(i.data);this.logService.trace("[EncryptionMainService] Decrypting value...");const s=Ds.decryptString(r);return this.logService.trace("[EncryptionMainService] Decrypted value."),s}catch(r){throw this.logService.error(r),r}}isEncryptionAvailable(){this.logService.trace("[EncryptionMainService] Checking if encryption is available...");const e=Ds.isEncryptionAvailable();return this.logService.trace("[EncryptionMainService] Encryption is available: ",e),Promise.resolve(e)}getKeyStorageProvider(){if(B)return Promise.resolve("dpapi");if(O)return Promise.resolve("keychain_access");if(Ds.getSelectedStorageBackend)try{this.logService.trace("[EncryptionMainService] Getting selected storage backend...");const e=Ds.getSelectedStorageBackend();return this.logService.trace("[EncryptionMainService] Selected storage backend: ",e),Promise.resolve(e)}catch(e){this.logService.error(e)}return Promise.resolve("unknown")}async setUsePlainTextEncryption(){if(B)throw new Error("Setting plain text encryption is not supported on Windows.");if(O)throw new Error("Setting plain text encryption is not supported on macOS.");if(!Ds.setUsePlainTextEncryption)throw new Error("Setting plain text encryption is not supported.");this.logService.trace("[EncryptionMainService] Setting usePlainTextEncryption to true..."),Ds.setUsePlainTextEncryption(!0),this.logService.trace("[EncryptionMainService] Set usePlainTextEncryption to true")}},uh=__decorate([__param(0,V)],uh)}});import DD from"assert";function AD(t,e){const i=(c,l)=>{console.warn(w(1903,null,c,l))},r=c=>{console.warn(w(1904,null,c))},s=(c,l)=>{console.warn(w(1905,null,c,l))},n=c=>({onUnknownOption:l=>{d1.includes(c)||console.warn(w(1906,null,l,c))},onMultipleValues:i,onEmptyValue:r,onDeprecatedOption:s,getSubcommandReporter:d1.includes(c)?n:void 0}),a=u1(t,h1,e?{onUnknownOption:c=>{console.warn(w(1907,null,c))},onMultipleValues:i,onEmptyValue:r,onDeprecatedOption:s,getSubcommandReporter:n}:void 0);return a.goto&&a._.forEach(c=>DD(/^(\w:)?[^:]+(:\d*){0,2}:?$/.test(c),w(1908,null))),a}function RD(t){const e=t.findIndex(i=>!/^-/.test(i));if(e>-1)return[...t.slice(0,e),...t.slice(e+1)]}function MD(t){let[,...e]=t;process.env.VSCODE_DEV&&(e=RD(e)||[]);const i=!zn(process.env);return AD(e,i)}function TD(t,...e){const i=t.indexOf("--");return i===-1?t.push(...e):t.splice(i,0,...e),t}function zn(t){return t.VSCODE_CLI==="1"}var al=g({"out-build/vs/platform/environment/node/argvHelper.js"(){"use strict";we(),p2()}});import*as B2 from"os";function WD({useAlternateBitness:t=!1}={}){return t?cl===0?process.env["ProgramFiles(x86)"]||null:aa===0&&process.env.ProgramW6432||null:process.env.ProgramFiles||null}async function dh({useAlternateBitness:t=!1,findPreview:e=!1}={}){const i=WD({useAlternateBitness:t});if(!i)return null;const r=U(i,"PowerShell");if(!await Vt.existsDirectory(r))return null;let s=-1,n=null;for(const c of await te.readdir(r)){let l=-1;if(e){const d=c.indexOf("-");if(d<0)continue;const f=c.substring(0,d);if(!k1.test(f)||c.substring(d+1)!=="preview")continue;l=parseInt(f,10)}else{if(!k1.test(c))continue;l=parseInt(c,10)}if(l<=s)continue;const u=U(r,c,"pwsh.exe");await Vt.existsFile(u)&&(n=u,s=l)}if(!n)return null;const o=i.includes("x86")?" (x86)":"",a=e?" Preview":"";return new ca(n,`PowerShell${a}${o}`,!0)}async function j2({findPreview:t}={}){if(!process.env.LOCALAPPDATA)return null;const e=U(process.env.LOCALAPPDATA,"Microsoft","WindowsApps");if(!await Vt.existsDirectory(e))return null;const{pwshMsixDirRegex:i,pwshMsixName:r}=t?{pwshMsixDirRegex:q2,pwshMsixName:"PowerShell Preview (Store)"}:{pwshMsixDirRegex:V2,pwshMsixName:"PowerShell (Store)"};for(const s of await te.readdir(e))if(i.test(s)){const n=U(e,s,"pwsh.exe");return new ca(n,r)}return null}function LD(){const t=U(B2.homedir(),".dotnet","tools","pwsh.exe");return new ca(t,".NET Core PowerShell Global Tool")}function OD(){const t=U(B2.homedir(),"scoop","apps"),e=U(t,"pwsh","current","pwsh.exe");return new ca(e,"PowerShell (Scoop)")}function FD(){const t=U(process.env.windir,cl===1&&aa!==1?"SysNative":"System32","WindowsPowerShell","v1.0","powershell.exe");return new ca(t,"Windows PowerShell",!0)}async function*ND(){let t=await dh();t&&(yield t),t=await dh({useAlternateBitness:!0}),t&&(yield t),t=await j2(),t&&(yield t),t=LD(),t&&(yield t),t=await dh({findPreview:!0}),t&&(yield t),t=await j2({findPreview:!0}),t&&(yield t),t=await dh({useAlternateBitness:!0,findPreview:!0}),t&&(yield t),t=await OD(),t&&(yield t),t=FD(),t&&(yield t)}async function*H2(){for await(const t of ND())await t.exists()&&(yield t)}async function UD(){for await(const t of H2())return t;return null}var k1,V2,q2,z2,cl,aa,ca,G2=g({"out-build/vs/base/node/powershell.js"(){"use strict";switch(ye(),qt(),k1=/^\d+$/,V2=/^Microsoft.PowerShell_.*/,q2=/^Microsoft.PowerShellPreview_.*/,(function(t){t[t.x64=0]="x64",t[t.x86=1]="x86",t[t.ARM=2]="ARM"})(z2||(z2={})),process.arch){case"ia32":cl=1;break;case"arm":case"arm64":cl=2;break;default:cl=0;break}process.env.PROCESSOR_ARCHITEW6432?aa=process.env.PROCESSOR_ARCHITEW6432==="ARM64"?2:0:process.env.PROCESSOR_ARCHITECTURE==="ARM64"?aa=2:process.env.PROCESSOR_ARCHITECTURE==="X86"?aa=1:aa=0,ca=class{constructor(t,e,i){this.exePath=t,this.displayName=e,this.knownToExist=i}async exists(){return this.knownToExist===void 0&&(this.knownToExist=await Vt.existsFile(this.exePath)),this.knownToExist}}}});import{promises as K2}from"fs";function Y2(t=er){return t.comspec||"cmd.exe"}function $D(t){let e=[],i=!1;const r=function(s){if(i){e.push(s);return}(!t.send(s,o=>{if(o&&console.error(o),i=!1,e.length>0){const a=e.slice(0);e=[],a.forEach(c=>r(c))}})||B)&&(i=!0)};return{send:r}}async function BD(t){if(await te.exists(t)){let e;try{e=await K2.stat(t)}catch(i){i.message.startsWith("EACCES")&&(e=await K2.lstat(t))}return e?!e.isDirectory():!1}return!1}async function P1(t,e,i,r=er,s=BD){if(dc(t))return await s(t)?t:void 0;if(e===void 0&&(e=fs()),pt(t)!=="."){const c=U(e,t);return await s(c)?c:void 0}const o=E2(r,"PATH");if(i===void 0&&At(o)&&(i=o.split(kg)),i===void 0||i.length===0){const c=U(e,t);return await s(c)?c:void 0}for(const c of i){let l;if(dc(c)?l=U(c,t):l=U(e,c,t),B){const d=(E2(r,"PATHEXT")||".COM;.EXE;.BAT;.CMD").split(";").map(async f=>{const p=l+f;return await s(p)?p:void 0});for(const f of d){const p=await f;if(p)return p}}if(await s(l))return l}const a=U(e,t);return await s(a)?a:void 0}var hh=g({"out-build/vs/base/node/processes.js"(){"use strict";ur(),ye(),z(),Wr(),ah(),xe(),qt()}});import{userInfo as jD}from"os";async function J2(t,e){return t===1?B?VD():Y2(e):HD(t,e)}function HD(t,e){if(Pe&&t===2||O&&t===3)return"/bin/bash";if(!fh){let i;if(B)i="/bin/bash";else{if(i=e.SHELL,!i)try{i=jD().shell}catch{}i||(i="sh"),i==="/bin/false"&&(i="/bin/bash")}fh=i}return fh}async function VD(){return ph||(ph=(await UD()).exePath),ph}var fh,ph,Q2=g({"out-build/vs/base/node/shell.js"(){"use strict";z(),G2(),hh(),fh=null,ph=null}});function qD(t,e,i){return Math.min(Math.max(t,e),i)}var zD=g({"out-build/vs/base/common/numbers.js"(){"use strict";Lu()}});import{spawn as GD}from"child_process";async function x1(t,e,i,r){return i["force-disable-user-env"]?(e.trace("resolveShellEnv(): skipped (--force-disable-user-env)"),{}):B?(e.trace("resolveShellEnv(): skipped (Windows)"),{}):zn(r)&&!i["force-user-env"]?(e.trace("resolveShellEnv(): skipped (VSCODE_CLI is set)"),{}):(zn(r)?e.trace("resolveShellEnv(): running (--force-user-env)"):e.trace("resolveShellEnv(): running (macOS/Linux)"),gh||(gh=Ht.withAsyncBody(async(s,n)=>{const o=new Sr;let a=1e4;const c=t.getValue("application.shellEnvironmentResolutionTimeout");typeof c=="number"&&(a=qD(c,1,120)*1e3);const l=setTimeout(()=>{o.dispose(!0),n(new Error(w(2227,null)))},a);try{s(await KD(e,o.token))}catch(u){!Ru(u)&&!o.token.isCancellationRequested?n(new Error(w(2228,null,rr(u)))):s({})}finally{clearTimeout(l),o.dispose()}})),gh)}async function KD(t,e){const i=process.env.ELECTRON_RUN_AS_NODE;t.trace("getUnixShellEnvironment#runAsNode",i);const r=process.env.ELECTRON_NO_ATTACH_CONSOLE;t.trace("getUnixShellEnvironment#noAttach",r);const s=ui().replace(/-/g,"").substr(0,12),n=new RegExp(s+"({.*})"+s),o={...process.env,ELECTRON_RUN_AS_NODE:"1",ELECTRON_NO_ATTACH_CONSOLE:"1",VSCODE_RESOLVING_ENVIRONMENT:"1"};t.trace("getUnixShellEnvironment#env",o);const a=await J2(Gi,o);return t.trace("getUnixShellEnvironment#shell",a),new Promise((c,l)=>{if(e.isCancellationRequested)return l(new yi);const u=tt(a);let d,f;const p="";/^(?:pwsh|powershell)(?:-preview)?$/.test(u)?(d=`& '${process.execPath}' ${p} -p '''${s}'' + JSON.stringify(process.env) + ''${s}'''`,f=["-Login","-Command"]):u==="nu"?(d=`^'${process.execPath}' ${p} -p '"${s}" + JSON.stringify(process.env) + "${s}"'`,f=["-i","-l","-c"]):u==="xonsh"?(d=`import os, json; print("${s}", json.dumps(dict(os.environ)), "${s}")`,f=["-i","-l","-c"]):(d=`'${process.execPath}' ${p} -p '"${s}" + JSON.stringify(process.env) + "${s}"'`,u==="tcsh"||u==="csh"?f=["-ic"]:f=["-i","-l","-c"]),t.trace("getUnixShellEnvironment#spawn",JSON.stringify(f),d);const v=GD(a,[...f,d],{detached:!0,stdio:["ignore","pipe","pipe"],env:o});e.onCancellationRequested(()=>(v.kill(),l(new yi))),v.on("error",S=>{t.error("getUnixShellEnvironment#errorChildProcess",rr(S)),l(S)});const m=[];v.stdout.on("data",S=>m.push(S));const y=[];v.stderr.on("data",S=>y.push(S)),v.on("close",(S,E)=>{const k=Buffer.concat(m).toString("utf8");t.trace("getUnixShellEnvironment#raw",k);const R=Buffer.concat(y).toString("utf8");if(R.trim()&&t.trace("getUnixShellEnvironment#stderr",R),S||E)return l(new Error(w(2229,null,S,E)));const C=n.exec(k),M=C?C[1]:"{}";try{const J=JSON.parse(M);i?J.ELECTRON_RUN_AS_NODE=i:delete J.ELECTRON_RUN_AS_NODE,r?J.ELECTRON_NO_ATTACH_CONSOLE=r:delete J.ELECTRON_NO_ATTACH_CONSOLE,delete J.VSCODE_RESOLVING_ENVIRONMENT,delete J.XDG_RUNTIME_DIR,t.trace("getUnixShellEnvironment#result",J),c(J)}catch(J){t.error("getUnixShellEnvironment#errorCaught",rr(J)),l(J)}})})}var gh,C1=g({"out-build/vs/platform/shell/node/shellEnv.js"(){"use strict";ye(),we(),St(),In(),Re(),z(),Hi(),Q2(),al(),ae(),zD(),gh=void 0}}),I1,X2,YD=g({"out-build/vs/platform/extensions/common/extensionHostStarter.js"(){"use strict";G(),I1=j("extensionHostStarter"),X2="extensionHostStarter"}});function JD(){return 1025+Math.floor(64510*Math.random())}var QD=g({"out-build/vs/base/common/ports.js"(){"use strict"}});import*as Z2 from"fs";async function mh(t){try{return await te.realpath(t)}catch{const i=XD(t);return await Z2.promises.access(i,Z2.constants.R_OK),i}}function XD(t){return Pn(bi(t),Qt)}var D1=g({"out-build/vs/base/node/extpath.js"(){"use strict";ye(),z(),jt(),qt()}});import{networkInterfaces as ZD}from"os";function eA(t){const e=t.replace(/\-/g,":").toLowerCase();return!e5.has(e)}function tA(){const t=ZD();for(const e in t){const i=t[e];if(i){for(const{mac:r}of i)if(eA(r))return r}}throw new Error("Unable to retrieve mac address (unexpected format)")}var e5,iA=g({"out-build/vs/base/node/macAddress.js"(){"use strict";e5=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"])}});import{networkInterfaces as rA}from"os";import{platform as A1}from"process";import{execSync as sA}from"child_process";async function nA(t){return R1||(R1=(async()=>{let e;try{e=await i5(!1)}catch(i){t(i)}return e||ui()})()),R1}async function t5(t){try{const e=await import("crypto"),i=tA();return e.createHash("sha256").update(i,"utf8").digest("hex")}catch(e){t(e);return}}function oA(){return A1!=="win32"?"notdefined":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function aA(t){switch(A1){case"darwin":return t.split("IOPlatformUUID")[1].split(`
|
|
`)[0].replace(/\=|\s+|\"/ig,"").toLowerCase();case"win32":return t.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/ig,"").toLowerCase();case"linux":return t.toString().replace(/\r+|\n+|\s+/ig,"").toLowerCase();case"freebsd":return t.toString().replace(/\r+|\n+|\s+/ig,"").toLowerCase();default:throw new Error(`Unsupported platform: ${process.platform}`)}}async function i5(t){let e=aA(sA(n5[A1],{timeout:5e3}).toString()),i;try{i=(await import("crypto")).createHash("sha256").update(e,"utf8").digest("hex")}catch{i=ui()}return t?e:i}async function cA(t){if(B){const e=await import("@vscode/windows-registry");try{return e.GetStringRegKey("HKEY_LOCAL_MACHINE",o5,"MachineId")||""}catch(i){return t(i),""}}return""}async function r5(t){try{return await(await import("@vscode/deviceid")).getDeviceId()}catch(e){return t(e),ui()}}var vh,R1,s5,n5,o5,ll=g({"out-build/vs/base/node/id.js"(){"use strict";Tn(),Hi(),iA(),z(),vh=new class{_isVirtualMachineMacAddress(t){return this._virtualMachineOUIs||(this._virtualMachineOUIs=Es.forStrings(),this._virtualMachineOUIs.set("00-50-56",!0),this._virtualMachineOUIs.set("00-0C-29",!0),this._virtualMachineOUIs.set("00-05-69",!0),this._virtualMachineOUIs.set("00-03-FF",!0),this._virtualMachineOUIs.set("00-1C-42",!0),this._virtualMachineOUIs.set("00-16-3E",!0),this._virtualMachineOUIs.set("08-00-27",!0),this._virtualMachineOUIs.set("00:50:56",!0),this._virtualMachineOUIs.set("00:0C:29",!0),this._virtualMachineOUIs.set("00:05:69",!0),this._virtualMachineOUIs.set("00:03:FF",!0),this._virtualMachineOUIs.set("00:1C:42",!0),this._virtualMachineOUIs.set("00:16:3E",!0),this._virtualMachineOUIs.set("08:00:27",!0)),!!this._virtualMachineOUIs.findSubstr(t)}value(){if(this._value===void 0){let t=0,e=0;const i=rA();for(const r in i){const s=i[r];if(s)for(const{mac:n,internal:o}of s)o||(e+=1,this._isVirtualMachineMacAddress(n.toUpperCase())&&(t+=1))}this._value=e>0?t/e:0}return this._value}},s5={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32",notdefined:""},n5={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:`${s5[oA()]}\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`,linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"},o5="Software\\Microsoft\\SQMClient"}});import*as a5 from"net";function lA(t,e,i,r=1){let s=!1;return new Promise(n=>{const o=setTimeout(()=>{if(!s)return s=!0,n(0)},i);M1(t,e,r,a=>{if(!s)return s=!0,clearTimeout(o),n(a)})})}function M1(t,e,i,r){if(e===0)return r(0);const s=new a5.Socket;s.once("connect",()=>(c5(s),M1(t+i,e-1,i,r))),s.once("data",()=>{}),s.once("error",n=>(c5(s),n.code!=="ECONNREFUSED"?M1(t+i,e-1,i,r):r(t))),s.connect(t,"127.0.0.1")}function uA(t,e,i,r="127.0.0.1"){let s=!1,n,o=1;const a=a5.createServer({pauseOnConnect:!0});function c(l,u){s||(s=!0,a.removeAllListeners(),a.close(),n&&clearTimeout(n),u(l))}return new Promise(l=>{n=setTimeout(()=>{c(0,l)},i),a.on("listening",()=>{c(t,l)}),a.on("error",u=>{u&&(u.code==="EADDRINUSE"||u.code==="EACCES")&&o<e?(t++,o++,a.listen(t,r)):c(0,l)}),a.on("close",()=>{c(0,l)}),a.listen(t,r)})}function c5(t){try{t.removeAllListeners("connect"),t.removeAllListeners("error"),t.end(),t.destroy(),t.unref()}catch(e){console.error(e)}}var T1,l5=g({"out-build/vs/base/node/ports.js"(){"use strict";T1={1:!0,7:!0,9:!0,11:!0,13:!0,15:!0,17:!0,19:!0,20:!0,21:!0,22:!0,23:!0,25:!0,37:!0,42:!0,43:!0,53:!0,69:!0,77:!0,79:!0,87:!0,95:!0,101:!0,102:!0,103:!0,104:!0,109:!0,110:!0,111:!0,113:!0,115:!0,117:!0,119:!0,123:!0,135:!0,137:!0,139:!0,143:!0,161:!0,179:!0,389:!0,427:!0,465:!0,512:!0,513:!0,514:!0,515:!0,526:!0,530:!0,531:!0,532:!0,540:!0,548:!0,554:!0,556:!0,563:!0,587:!0,601:!0,636:!0,989:!0,990:!0,993:!0,995:!0,1719:!0,1720:!0,1723:!0,2049:!0,3659:!0,4045:!0,5060:!0,5061:!0,6e3:!0,6566:!0,6665:!0,6666:!0,6667:!0,6668:!0,6669:!0,6697:!0,10080:!0}}}),la,wh=g({"out-build/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindows.js"(){"use strict";G(),la=j("auxiliaryWindowsMainService")}});import{spawn as dA}from"child_process";import{relative as u5,join as d5}from"path";import{createHash as h5}from"crypto";import{promises as f5}from"fs";var Gn,yh,ua=g({"out-build/vs/platform/cssDev/node/cssDevService.js"(){"use strict";Ie(),Io(),xi(),G(),K(),q(),L(),Ze(),re(),Gn=j("ICSSDevelopmentService"),yh=class extends N{constructor(e,i,r){super(),this.envService=e,this.logService=i,this.fileService=r,this._watchedFiles=new Set,this._onDidChangeCssModules=this._register(new D),this.onDidChangeCssModules=this._onDidChangeCssModules.event,this.isEnabled&&(this._register(this.fileService.onDidFilesChange(this.onDidFilesChange.bind(this))),this.initializeWatcher())}get isEnabled(){return!this.envService.isBuilt}getCssModules(e){return e&&(this._cssModules=void 0),this._cssModules??=this.computeCssModules(),this._cssModules}async computeCssModules(){if(!this.isEnabled)return new Map;const e=await import("@vscode/ripgrep");return await new Promise(i=>{const r=En.create(),s=[],n=Ct.asFileUri("").fsPath,o=dA(e.rgPath,["-g","**/*.css","-g","!**/fixtures/**","--files","--no-ignore",n],{});o.stdout.on("data",a=>{s.push(a)}),o.on("error",a=>{i(new Map)}),o.on("close",async()=>{const a=Buffer.concat(s).toString("utf8"),c=a.split(`
|
|
`).filter(Boolean).map(u=>u5(n,u).replace(/\\/g,"/")).filter(Boolean).sort(),l=new Map;c.some(u=>u.indexOf("vs/")!==0)&&this.logService.error(`[CSS_DEV] Detected invalid paths in css modules, raw output: ${a}`);for(const u of c)try{const d=d5(n,u),f=await f5.readFile(d),p=h5("sha256").update(f).digest("hex");l.set(u,p)}catch{l.set(u,Date.now().toString())}i(l)})})}async initializeWatcher(){const e=await this.getCssModules();for(const[i]of e){const r=x.file(d5(Ct.asFileUri("").fsPath,i));this._watchedFiles.add(i),this._register(this.fileService.watch(r))}}async onDidFilesChange(e){if(!this.isEnabled)return;const i=Ct.asFileUri("").fsPath,r=[];for(const s of e.rawUpdated){const n=u5(i,s.fsPath).replace(/\\/g,"/");if(this._watchedFiles.has(n)){let o;try{const a=await f5.readFile(s.fsPath);o=h5("sha256").update(a).digest("hex")}catch{continue}r.push({path:n,newHash:o})}}r.length>0&&(this._onDidChangeCssModules.fire(new Map(r.map(s=>[s.path,s.newHash]))),this._cssModules=void 0)}},yh=__decorate([__param(0,or),__param(1,V),__param(2,mt)],yh)}}),Sh,hA=g({"out-build/vs/platform/profiling/electron-main/windowProfiling.js"(){"use strict";ae(),K(),Sh=class{constructor(e,i,r){this._window=e,this._sessionId=i,this._logService=r}async inspect(e){await this._connect();const i=this._window.webContents.debugger;await i.sendCommand("Profiler.start"),this._logService.warn("[perf] profiling STARTED",this._sessionId),await Pi(e);const r=await i.sendCommand("Profiler.stop");return this._logService.warn("[perf] profiling DONE",this._sessionId),await this._disconnect(),r.profile}async _connect(){const e=this._window.webContents.debugger;e.attach(),await e.sendCommand("Profiler.enable")}async _disconnect(){const e=this._window.webContents.debugger;await e.sendCommand("Profiler.disable"),e.detach()}},Sh=__decorate([__param(2,V)],Sh)}});import*as fA from"fs";import*as pA from"os";import*as gA from"child_process";import*as mA from"path";async function vA(t=!1){return(W1===void 0||t)&&(W1=wA()),W1}async function wA(){const t=yA();if(t===void 0)return!1;if(t>=22e3){const e=SA();if(e)return new Promise(i=>{try{gA.execFile(e,["--status"],r=>i(!r))}catch{i(!1)}})}else{const e=_A();if(e)try{if((await fA.promises.stat(e)).isFile())return!0}catch{}}return!1}function yA(){const t=/(\d+)\.(\d+)\.(\d+)/g.exec(pA.release());if(t)return parseInt(t[3])}function p5(t){const e=process.env.SystemRoot;if(e){const i=process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432");return mA.join(e,i?"Sysnative":"System32",t)}}function SA(){return p5("wsl.exe")}function _A(){return p5("lxss\\LxssManager.dll")}var W1,bA=g({"out-build/vs/platform/remote/node/wsl.js"(){"use strict"}});function _h(t){return t.res.statusCode&&t.res.statusCode>=200&&t.res.statusCode<300||t.res.statusCode===1223}function g5(t){return t.res.statusCode===204}async function da(t){if(!_h(t))throw new Error("Server returned "+t.res.statusCode);if(g5(t))return null;const i=(await wc(t.stream)).toString();try{return JSON.parse(i)}catch(r){throw r.message+=`:
|
|
`+i,r}}function EA(t=!0,e=!0){if(L1===t&&O1===e)return;L1=t,O1=e;const i=Ei.as(ir.Configuration),r=bh;bh=[{id:"http",order:15,title:w(2209,null),type:"object",scope:2,properties:{"http.useLocalProxyConfiguration":{type:"boolean",default:e,markdownDescription:w(2210,null),restricted:!0}}},{id:"http",order:15,title:w(2211,null),type:"object",scope:1,properties:{"http.electronFetch":{type:"boolean",default:!1,description:w(2212,null),restricted:!0}}},{id:"http",order:15,title:w(2213,null),type:"object",scope:t?1:2,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:w(2214,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,markdownDescription:w(2215,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:w(2216,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.noProxy":{type:"array",items:{type:"string"},markdownDescription:w(2217,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:w(2218,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[w(2219,null),w(2220,null),w(2221,null),w(2222,null)],default:"override",markdownDescription:w(2223,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,markdownDescription:w(2224,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.experimental.systemCertificatesV2":{type:"boolean",tags:["experimental"],default:!1,markdownDescription:w(2225,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.fetchAdditionalSupport":{type:"boolean",default:!0,markdownDescription:w(2226,null,"`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0}}}],i.updateConfigurations({add:bh,remove:r})}var As,m5,v5,bh,L1,O1,Rs=g({"out-build/vs/platform/request/common/request.js"(){"use strict";it(),Re(),L(),we(),Cn(),G(),ms(),As=j("requestService"),m5=class{constructor(t){this.original=t}toJSON(){if(!this.headers){const t=Object.create(null);for(const e in this.original)e.toLowerCase()==="authorization"||e.toLowerCase()==="proxy-authorization"?t[e]="*****":t[e]=this.original[e];this.headers=t}return this.headers}},v5=class extends N{constructor(t){super(),this.logService=t,this.counter=0}async logAndRequest(t,e){const i=`#${++this.counter}: ${t.url}`;this.logService.trace(`${i} - begin`,t.type,new m5(t.headers??{}));try{const r=await e();return this.logService.trace(`${i} - end`,t.type,r.res.statusCode,r.res.headers),r}catch(r){throw this.logService.error(`${i} - error`,t.type,$i(r)),r}}},bh=[],L1=void 0,O1=void 0,EA()}});import{exec as ul}from"child_process";import{app as dl,BrowserWindow as Eh,clipboard as nn,Menu as hl,powerMonitor as kA,screen as fl,shell as Kn,webContents as PA}from"electron";import*as Yr from"fs";import{arch as xA,cpus as CA,freemem as IA,loadavg as DA,platform as AA,release as RA,totalmem as MA,type as TA}from"os";import{promisify as pl}from"util";var Jr,gl,Yn=g({"out-build/vs/platform/native/electron-main/nativeHostMainService.js"(){"use strict";it(),St(),Nd(),An(),Re(),q(),Bi(),L(),Ie(),ye(),z(),re(),D1(),ll(),qt(),l5(),we(),wh(),Xe(),ua(),Vn(),ct(),G(),ft(),K(),lt(),hA(),bA(),Rs(),qc(),zc(),ut(),hi(),qn(),u2(),Jr=j("nativeHostMainService"),gl=class extends N{constructor(e,i,r,s,n,o,a,c,l,u,d,f,p,v){super(),this.windowsMainService=e,this.auxiliaryWindowsMainService=i,this.dialogMainService=r,this.lifecycleMainService=s,this.environmentMainService=n,this.logService=o,this.productService=a,this.themeMainService=c,this.workspacesManagementMainService=l,this.configurationService=u,this.requestService=d,this.proxyAuthService=f,this.instantiationService=p,this.cssDevelopmentService=v,this._onDidChangeCssModules=this._register(new D),this.onDidChangeCssModules=this._onDidChangeCssModules.event,this._onDidChangePassword=this._register(new D),this.onDidChangePassword=this._onDidChangePassword.event,v.isEnabled&&this._register(v.onDidChangeCssModules(m=>{this._onDidChangeCssModules.fire(Object.fromEntries(m))})),this.onDidOpenMainWindow=P.map(this.windowsMainService.onDidOpenWindow,m=>m.id),this.onDidTriggerWindowSystemContextMenu=P.any(P.map(this.windowsMainService.onDidTriggerSystemContextMenu,({window:m,x:y,y:S})=>({windowId:m.id,x:y,y:S})),P.map(this.auxiliaryWindowsMainService.onDidTriggerSystemContextMenu,({window:m,x:y,y:S})=>({windowId:m.id,x:y,y:S}))),this.onDidMaximizeWindow=P.any(P.map(this.windowsMainService.onDidMaximizeWindow,m=>m.id),P.map(this.auxiliaryWindowsMainService.onDidMaximizeWindow,m=>m.id)),this.onDidUnmaximizeWindow=P.any(P.map(this.windowsMainService.onDidUnmaximizeWindow,m=>m.id),P.map(this.auxiliaryWindowsMainService.onDidUnmaximizeWindow,m=>m.id)),this.onDidChangeWindowFullScreen=P.any(P.map(this.windowsMainService.onDidChangeFullScreen,m=>({windowId:m.window.id,fullscreen:m.fullscreen})),P.map(this.auxiliaryWindowsMainService.onDidChangeFullScreen,m=>({windowId:m.window.id,fullscreen:m.fullscreen}))),this.onDidBlurMainWindow=P.filter(P.fromNodeEventEmitter(dl,"browser-window-blur",(m,y)=>y.id),m=>!!this.windowsMainService.getWindowById(m)),this.onDidFocusMainWindow=P.any(P.map(P.filter(P.map(this.windowsMainService.onDidChangeWindowsCount,()=>this.windowsMainService.getLastActiveWindow()),m=>!!m),m=>m.id),P.filter(P.fromNodeEventEmitter(dl,"browser-window-focus",(m,y)=>y.id),m=>!!this.windowsMainService.getWindowById(m))),this.onDidBlurMainOrAuxiliaryWindow=P.any(this.onDidBlurMainWindow,P.map(P.filter(P.fromNodeEventEmitter(dl,"browser-window-blur",(m,y)=>this.auxiliaryWindowsMainService.getWindowByWebContents(y.webContents)),m=>!!m),m=>m.id)),this.onDidFocusMainOrAuxiliaryWindow=P.any(this.onDidFocusMainWindow,P.map(P.filter(P.fromNodeEventEmitter(dl,"browser-window-focus",(m,y)=>this.auxiliaryWindowsMainService.getWindowByWebContents(y.webContents)),m=>!!m),m=>m.id)),this.onDidResumeOS=P.fromNodeEventEmitter(kA,"resume"),this.onDidChangeColorScheme=this.themeMainService.onDidChangeColorScheme,this.onDidChangeDisplay=P.debounce(P.any(P.filter(P.fromNodeEventEmitter(fl,"display-metrics-changed",(m,y,S)=>S),m=>!(Array.isArray(m)&&m.length===1&&m[0]==="workArea")),P.fromNodeEventEmitter(fl,"display-added"),P.fromNodeEventEmitter(fl,"display-removed")),()=>{},100)}get windowId(){throw new Error("Not implemented in electron-main")}async getWindows(e,i){const r=this.windowsMainService.getWindows().map(n=>({id:n.id,workspace:n.openedWorkspace??Ld(n.backupPath,n.isExtensionDevelopmentHost),title:n.win?.getTitle()??"",filename:n.getRepresentedFilename(),dirty:n.isDocumentEdited(),parentWindowId:n.parentWindowId,remoteAuthority:n.remoteAuthority})),s=[];return i.includeAuxiliaryWindows&&s.push(...this.auxiliaryWindowsMainService.getWindows().map(n=>({id:n.id,parentId:n.parentId,title:n.win?.getTitle()??"",filename:n.getRepresentedFilename()}))),[...r,...s]}async getWindowCount(e){return this.windowsMainService.getWindowCount()}async getActiveWindowId(e){const i=this.windowsMainService.getFocusedWindow()||this.windowsMainService.getLastActiveWindow();if(i)return i.id}async getActiveWindowPosition(){const e=this.windowsMainService.getFocusedWindow()||this.windowsMainService.getLastActiveWindow();if(e)return e.getBounds()}async getNativeWindowHandle(e,i){const r=this.windowById(i,e);if(r?.win)return Y.wrap(r.win.getNativeWindowHandle())}openWindow(e,i,r){return Array.isArray(i)?this.doOpenWindow(e,i,r):this.doOpenEmptyWindow(e,i)}async doOpenWindow(e,i,r=Object.create(null)){return i.length>0?(await this.windowsMainService.open({context:5,contextWindowId:e,urisToOpen:i,cli:this.environmentMainService.args,forceNewWindow:r.forceNewWindow,cursorForceNewWindow:r.cursorForceNewWindow,forceReuseWindow:r.forceReuseWindow,preferNewWindow:r.preferNewWindow,diffMode:r.diffMode,mergeMode:r.mergeMode,addMode:r.addMode,removeMode:r.removeMode,gotoLineMode:r.gotoLineMode,noRecentEntry:r.noRecentEntry,waitMarkerFileURI:r.waitMarkerFileURI,remoteAuthority:r.remoteAuthority||void 0,forceProfile:r.forceProfile,forceTempProfile:r.forceTempProfile,windowInWindow:r.windowInWindow?this.potentiallyGetParentWindowId(e):void 0,windowInWindowBodyClass:r.windowInWindowBodyClass,shadowWindowForWorkspaceId:r.shadowWindowForWorkspaceId,isAgentWindow:r.isAgentWindow})).map(s=>({windowId:s.id,parentWindowId:s.parentWindowId})):[]}async doOpenEmptyWindow(e,i){return(await this.windowsMainService.openEmptyWindow({context:5,contextWindowId:e},i)).map(r=>({windowId:r.id,parentWindowId:r.parentWindowId}))}async isFullScreen(e,i){return this.windowById(i?.targetWindowId,e)?.isFullScreen??!1}async toggleFullScreen(e,i){this.windowById(i?.targetWindowId,e)?.toggleFullScreen()}async getCursorScreenPoint(e){const i=fl.getCursorScreenPoint(),r=fl.getDisplayNearestPoint(i);return{point:i,display:r.bounds}}async isMaximized(e,i){return this.windowById(i?.targetWindowId,e)?.win?.isMaximized()??!1}async maximizeWindow(e,i){this.windowById(i?.targetWindowId,e)?.win?.maximize()}async unmaximizeWindow(e,i){this.windowById(i?.targetWindowId,e)?.win?.unmaximize()}async minimizeWindow(e,i){this.windowById(i?.targetWindowId,e)?.win?.minimize()}async moveWindowTop(e,i){this.windowById(i?.targetWindowId,e)?.win?.moveTop()}async positionWindow(e,i,r){const s=this.windowById(r?.targetWindowId,e);if(s?.win){if(s.win.isFullScreen()){const n=P.toPromise(P.once(P.fromNodeEventEmitter(s.win,"leave-full-screen")));s.win.setFullScreen(!1),await n}s.win.setBounds(i)}}async updateWindowControls(e,i){this.windowById(i.targetWindowId??e)?.updateWindowControls(i)}async focusWindow(e,i){const r=this.windowById(i?.targetWindowId,e);r?.focus({force:i?.force??!1}),i?.webContents&&r?.webContents?.focus()}async setMinimumSize(e,i,r){const s=this.codeWindowById(e);if(s?.win){const[n,o]=s.win.getSize(),[a,c]=s.win.getMinimumSize(),[l,u]=[i??a,r??c],[d,f]=[Math.max(n,l),Math.max(o,u)];(a!==l||c!==u)&&s.win.setMinimumSize(l,u),(n!==d||o!==f)&&s.win.setSize(d,f)}}async saveWindowSplash(e,i){const r=this.codeWindowById(e);this.themeMainService.saveWindowSplash(e,r?.openedWorkspace,i)}async getWindowInWindows(e){const i=this.codeWindowById(e),r=this.windowsMainService.getWindows(),s=i?.parentWindowId?r.find(a=>a.id===i.parentWindowId):i;if(!s)return[];const n=r.filter(a=>a.parentWindowId===s.id),o=n.some(a=>a.isBrowserViewVisible);return[{windowId:s.id,isRoot:!0,isVisible:!o,remoteAuthority:s.remoteAuthority,lastShownAtUnixMs:s.lastShownAtUnixMs},...n.map(a=>({windowId:a.id,isRoot:!1,isVisible:a.isBrowserViewVisible,remoteAuthority:a.remoteAuthority,lastShownAtUnixMs:a.lastShownAtUnixMs}))]}potentiallyGetParentWindowId(e){if(!1)return;const r=this.codeWindowById(e);return r?.parentWindowId?r.parentWindowId:e}async showWindowInWindow(e,i){const r=this.codeWindowById(i.windowId);if(r===void 0)throw new Error("Window not found");const s=r.parentWindowId;if(s!==void 0&&e!==void 0&&s!==e){const c=this.codeWindowById(e);c&&r.attachToParent(c)}const o=(await this.getWindowInWindows(i.windowId)).find(c=>c.isVisible);if(r.lastShownAtUnixMs=Date.now(),i.explicitBounds&&r.browserView&&(r.windowInWindowExplicitBounds=i.explicitBounds,r.browserView.setBounds(i.explicitBounds)),r.browserView&&r.id!==o?.windowId){if(r.parentWindowId){const c=this.codeWindowById(r.parentWindowId);if(c?.win&&c.win.contentView.addChildView(r.browserView),i.explicitBounds)r.windowInWindowExplicitBounds=i.explicitBounds,r.browserView.setBounds(i.explicitBounds);else if(r.windowInWindowExplicitBounds=void 0,c?.win){const l=c.win.contentView.getBounds();r.browserView.setBounds({x:0,y:0,width:l.width,height:l.height})}}r.isBrowserViewVisible=!0}if(o&&o.windowId!==r.id){const c=this.codeWindowById(o.windowId);if(c?.browserView){if(c.parentWindowId){const l=this.codeWindowById(c.parentWindowId);l?.win&&l.win.contentView.removeChildView(c.browserView)}c.isBrowserViewVisible=!1}if(c){const l={id:O4,from:"menu",args:[{windowId:c.id}]};c.sendWhenReady("vscode:runAction",Te.None,l)}}i.doNotFocus||r.webContents?.focus();const a={id:L4,from:"menu",args:[{windowId:i.windowId,forceZoomLevel:i.forceZoomLevel}]};r.sendWhenReady("vscode:runAction",Te.None,a)}async runActionInWindow(e,i){const r=this.codeWindowById(i.windowId);if(r){const s={id:i.actionId,from:"menu",args:[{windowId:i.windowId,...i.args}]};r.sendWhenReady("vscode:runAction",Te.None,s)}}async setIsAgentWindow(e,i){this.codeWindowById(i.windowId)?.setIsAgentWindow(i.isAgent)}async restoreShellCommand(){if(B){const e=Jt(this.environmentMainService.appRoot,"codeBin"),i=Jt(this.environmentMainService.appRoot,"restoreCode.bat"),r=await Promise.allSettled([pl(ul)(i,{shell:"cmd.exe",windowsHide:!0,env:{...process.env,codeBinDir:e}}),Yr.promises.unlink(Jt(this.environmentMainService.appRoot,"bin","code")),Yr.promises.unlink(Jt(this.environmentMainService.appRoot,"bin","code.cmd")),Yr.promises.unlink(Jt(this.environmentMainService.appRoot,"bin","code.sh")),Yr.promises.unlink(Jt(this.environmentMainService.appRoot,"bin","server-env-setup"))]);let s=!1;for(const n of r)if(n.status==="rejected"){if(n.reason instanceof Error&&"code"in n.reason&&n.reason.code==="ENOENT")continue;s=!0,this.logService.error("Error removing old code command from the path",n.reason)}if(s){const n=Jt(this.environmentMainService.appRoot,"bin","code")+"*";throw new Error(`Unable to restore the \`code\` command to the path. Please manually remove '${e}' from the PATH environment variable and delete ${n}.`)}return}throw new Error("Unable to restore the `code` command to the path. Please open the VSCode command palette and run the 'Shell Command: Install 'code' command in PATH' command.")}async replaceShellCommand(e){if(B){const n=Jt(this.environmentMainService.appRoot,"codeBin");this.logService.info(`Replacing shell command on windows. Adding ${n} to the front of the path`);const o=Jt(this.environmentMainService.appRoot,"replaceCode.bat");try{await pl(ul)(o,{shell:"cmd.exe",windowsHide:!0,env:{...process.env,codeBinDir:n}})}catch(a){throw this.logService.error("Error replacing the `code` command on the path",a),new Error(w(2150,null))}return}const i=async()=>{const n=Jt(this.environmentMainService.appRoot,"bin","code"),o="/usr/local/bin/code";if(!await te.exists(n))throw new Error(w(2151,null,n));return{source:o,target:n}},{source:r,target:s}=await i();try{const{symbolicLink:n}=await Vt.stat(r);if(n&&!n.dangling){const o=await mh(r);if(s===o)return}await Yr.promises.unlink(r)}catch(n){if(n.code!=="EACCES"&&n.code!=="ENOENT")throw n}try{await Yr.promises.symlink(s,r)}catch(n){if(n.code!=="EACCES"&&n.code!=="ENOENT"&&n.code!=="EEXIST")throw n;const{response:o}=await this.showMessageBox(e,{type:"info",message:w(2152,null,this.productService.nameShort),buttons:[w(2153,null),w(2154,null)]});if(o===0)try{const a=`osascript -e "do shell script \\"mkdir -p /usr/local/bin && ln -sf '${s}' '${r}'\\" with administrator privileges"`;await pl(ul)(a)}catch{throw new Error(w(2155,null,r))}}}async installShellCommand(e){const{source:i,target:r}=await this.getShellCommandLink();try{const{symbolicLink:s}=await Vt.stat(i);if(s&&!s.dangling){const n=await mh(i);if(r===n)return}await Yr.promises.unlink(i)}catch(s){if(s.code!=="EACCES"&&s.code!=="ENOENT")throw s}try{await Yr.promises.symlink(r,i)}catch(s){if(s.code!=="EACCES"&&s.code!=="ENOENT"&&s.code!=="EEXIST")throw s;const{response:n}=await this.showMessageBox(e,{type:"info",message:w(2156,null,this.productService.nameShort),buttons:[w(2157,null),w(2158,null)]});if(n===1)throw new yi;try{const o=`osascript -e "do shell script \\"mkdir -p /usr/local/bin && ln -sf '${r}' '${i}'\\" with administrator privileges"`;await pl(ul)(o)}catch{throw new Error(w(2159,null,i))}}}async uninstallShellCommand(e){const{source:i}=await this.getShellCommandLink();try{await Yr.promises.unlink(i)}catch(r){switch(r.code){case"EACCES":{const{response:s}=await this.showMessageBox(e,{type:"info",message:w(2160,null,this.productService.nameShort),buttons:[w(2161,null),w(2162,null)]});if(s===1)throw new yi;try{const n=`osascript -e "do shell script \\"rm '${i}'\\" with administrator privileges"`;await pl(ul)(n)}catch{throw new Error(w(2163,null,i))}break}case"ENOENT":break;default:throw r}}}async getShellCommandLink(){const e=Jt(this.environmentMainService.appRoot,"bin","code"),i=`/usr/local/bin/${this.productService.applicationName}`;if(!await te.exists(e))throw new Error(w(2164,null,e));return{source:i,target:e}}async showMessageBox(e,i){const r=this.windowById(i?.targetWindowId,e);let s=r?.win??void 0;if(r&&"browserView"in r&&r.browserView!==void 0){const n=r;if(n.isBrowserViewVisible){const o=this.codeWindowById(n.parentWindowId);o&&(s=o.win??void 0)}else throw new Error("Dialogs are skipped in hidden window-in-windows")}return this.dialogMainService.showMessageBox(i,s)}async showSaveDialog(e,i){const r=this.windowById(i?.targetWindowId,e);return this.dialogMainService.showSaveDialog(i,r?.win??void 0)}async showOpenDialog(e,i){const r=this.windowById(i?.targetWindowId,e);return this.dialogMainService.showOpenDialog(i,r?.win??void 0)}async pickFileFolderAndOpen(e,i){const r=await this.dialogMainService.pickFileFolder(i);r&&await this.doOpenPicked(await Promise.all(r.map(async s=>await Vt.existsDirectory(s)?{folderUri:x.file(s)}:{fileUri:x.file(s)})),i,e)}async pickFolderAndOpen(e,i){const r=await this.dialogMainService.pickFolder(i);r&&await this.doOpenPicked(r.map(s=>({folderUri:x.file(s)})),i,e)}async pickFolder(e,i){return await this.dialogMainService.pickFolder(i)}async pickFileAndOpen(e,i){const r=await this.dialogMainService.pickFile(i);r&&await this.doOpenPicked(r.map(s=>({fileUri:x.file(s)})),i,e)}async pickWorkspaceAndOpen(e,i){const r=await this.dialogMainService.pickWorkspace(i);r&&await this.doOpenPicked(r.map(s=>({workspaceUri:x.file(s)})),i,e)}async doOpenPicked(e,i,r){await this.windowsMainService.open({context:3,contextWindowId:r,cli:this.environmentMainService.args,urisToOpen:e,forceNewWindow:i.forceNewWindow,cursorForceNewWindow:i.cursorForceNewWindow})}async showItemInFolder(e,i){Kn.showItemInFolder(i)}async setRepresentedFilename(e,i,r){this.windowById(r?.targetWindowId,e)?.setRepresentedFilename(i)}async setDocumentEdited(e,i,r){this.windowById(r?.targetWindowId,e)?.setDocumentEdited(i)}async openExternal(e,i,r){this.environmentMainService.unsetSnapExportedVariables();try{Zx(i,T.http,T.https)?this.openExternalBrowser(i,r):Kn.openExternal(i)}finally{this.environmentMainService.restoreSnapExportedVariables()}return!0}async openExternalBrowser(e,i){const r=i??this.configurationService.getValue("workbench.externalBrowser");if(!r)return Kn.openExternal(e);if((r.includes(le.sep)||r.includes(nt.sep))&&!await te.exists(r))return this.logService.error(`Configured external browser path does not exist: ${r}`),Kn.openExternal(e);try{const{default:s}=await import("open"),n=await s(e,{app:{name:Object.hasOwn(s.apps,r)?s.apps[r]:r}});B||n.stderr?.once("data",o=>(this.logService.error(`Error openening external URL '${e}' using browser '${r}': ${o.toString()}`),Kn.openExternal(e)))}catch(s){return this.logService.error(`Unable to open external URL '${e}' using browser '${r}' due to ${s}.`),Kn.openExternal(e)}}moveItemToTrash(e,i){return Kn.trashItem(i)}async isAdmin(){let e;return B?e=(await import("native-is-elevated")).default():e=process.getuid?.()===0,e}async writeElevated(e,i,r,s){const n=await import("@vscode/sudo-prompt"),o=Rc(this.environmentMainService.userDataPath,"code-elevated");await te.writeFile(o,JSON.stringify({source:i.fsPath,target:r.fsPath}));try{await new Promise((a,c)=>{const l=[`"${this.cliPath}"`];s?.unlock&&l.push("--file-chmod"),l.push("--file-write",`"${o}"`);const u={name:this.productService.nameLong.replace("-",""),icns:O&&this.environmentMainService.isBuilt?U(pt(this.environmentMainService.appRoot),`${this.productService.nameShort}.icns`):void 0};this.logService.trace(`[sudo-prompt] running command: ${l.join(" ")}`),n.exec(l.join(" "),u,(d,f,p)=>{f&&this.logService.trace(`[sudo-prompt] received stdout: ${f}`),p&&this.logService.error(`[sudo-prompt] received stderr: ${p}`),d?c(d):a(void 0)})})}finally{await Yr.promises.unlink(o)}}async isRunningUnderARM64Translation(){return Pe||B?!1:dl.runningUnderARM64Translation}get cliPath(){return B?this.environmentMainService.isBuilt?U(pt(process.execPath),"bin",`${this.productService.applicationName}.cmd`):U(this.environmentMainService.appRoot,"scripts","code-cli.bat"):Pe?this.environmentMainService.isBuilt?U(pt(process.execPath),"bin",`${this.productService.applicationName}`):U(this.environmentMainService.appRoot,"scripts","code-cli.sh"):this.environmentMainService.isBuilt?U(this.environmentMainService.appRoot,"bin","code"):U(this.environmentMainService.appRoot,"scripts","code-cli.sh")}async getOSStatistics(){return{totalmem:MA(),freemem:IA(),loadavg:DA()}}async getOSProperties(){return{arch:xA(),platform:AA(),release:RA(),type:TA(),cpus:CA()}}async getOSVirtualMachineHint(){return vh.value()}async getOSColorScheme(){return this.themeMainService.getColorScheme()}async hasWSLFeatureInstalled(){return B&&vA()}async getScreenshot(e,i){const n=(await this.windowById(i?.targetWindowId,e)?.win?.webContents.capturePage())?.toJPEG(95);return n&&Y.wrap(n)}async getProcessId(e){return this.windowById(void 0,e)?.win?.webContents.getOSProcessId()}async killProcess(e,i,r){process.kill(i,r)}async readClipboardText(e,i){return nn.readText(i)}async readImage(){return nn.readImage().toPNG()}async writeClipboardText(e,i,r){return nn.writeText(i,r)}async readClipboardFindText(e){return nn.readFindText()}async writeClipboardFindText(e,i){return nn.writeFindText(i)}async writeClipboardBuffer(e,i,r,s){return nn.writeBuffer(i,Buffer.from(r.buffer),s)}async readClipboardBuffer(e,i){return Y.wrap(nn.readBuffer(i))}async hasClipboard(e,i,r){return nn.has(i,r)}async newWindowTab(){await this.windowsMainService.open({context:5,cli:this.environmentMainService.args,forceNewTabbedWindow:!0,forceEmpty:!0,remoteAuthority:this.environmentMainService.args.remote||void 0})}async showPreviousWindowTab(){hl.sendActionToFirstResponder("selectPreviousTab:")}async showNextWindowTab(){hl.sendActionToFirstResponder("selectNextTab:")}async moveWindowTabToNewWindow(){hl.sendActionToFirstResponder("moveTabToNewWindow:")}async mergeAllWindowTabs(){hl.sendActionToFirstResponder("mergeAllWindows:")}async toggleWindowTabsBar(){hl.sendActionToFirstResponder("toggleTabBar:")}async updateTouchBar(e,i){this.codeWindowById(e)?.updateTouchBar(i)}async notifyReady(e){this.codeWindowById(e)?.setReady()}async relaunch(e,i){return this.lifecycleMainService.relaunch(i)}async reload(e,i){const r=this.codeWindowById(e);if(r){if(zt(r.openedWorkspace)){const s=r.openedWorkspace.configPath;if(s.scheme===T.file&&(await this.workspacesManagementMainService.resolveLocalWorkspace(s))?.transient){await this.openWindow(r.id,{forceReuseWindow:!0});return}}return this.lifecycleMainService.reload(r,i?.disableExtensions!==void 0||i?.hmr!==void 0?{_:[],"disable-extensions":i.disableExtensions,hmr:i.hmr}:void 0)}}async destroyWindowNoFallback(e,i){return this.codeWindowById(i?.targetWindowId)?.win?.destroy()}async closeWindowNoFallback(e,i){return this.codeWindowById(i?.targetWindowId)?.close()}async closeWindow(e,i){return this.windowById(i?.targetWindowId,e)?.win?.close()}async quit(e){const i=this.windowsMainService.getLastActiveWindow();i?.isExtensionDevelopmentHost&&this.windowsMainService.getWindowCount()>1&&i.win?i.win.close():this.lifecycleMainService.quit()}async exit(e,i){await this.lifecycleMainService.kill(i)}async resolveProxy(e,i){return this.codeWindowById(e)?.win?.webContents?.session?.resolveProxy(i)}async lookupAuthorization(e,i){return this.proxyAuthService.lookupAuthorization(i)}async lookupKerberosAuthorization(e,i){return this.requestService.lookupKerberosAuthorization(i)}async loadCertificates(e){return this.requestService.loadCertificates()}findFreePort(e,i,r,s,n=1){return lA(i,r,s,n)}async openDevTools(e,i){this.windowById(i?.targetWindowId,e)?.webContents?.openDevTools(i?.mode?{mode:i.mode,activate:i.activate}:void 0)}async toggleDevTools(e,i){this.windowById(i?.targetWindowId,e)?.webContents?.toggleDevTools()}async openGPUInfoWindow(e){const i=this.codeWindowById(e);if(i){if(typeof this.gpuInfoWindowId!="number"){const r=this.instantiationService.invokeFunction(Md,en(),{forceNativeTitlebar:!0,hideBecauseShadowWindow:!1});r.backgroundColor=void 0;const s=new Eh(r);s.setMenuBarVisibility(!1),s.loadURL("chrome://gpu"),s.once("ready-to-show",()=>s.show()),s.once("close",()=>this.gpuInfoWindowId=void 0),i.win?.on("close",()=>{this.gpuInfoWindowId&&(Eh.fromId(this.gpuInfoWindowId)?.close(),this.gpuInfoWindowId=void 0)}),this.gpuInfoWindowId=s.id}if(typeof this.gpuInfoWindowId=="number"){const r=Eh.fromId(this.gpuInfoWindowId);r?.isMinimized()&&r?.restore(),r?.focus()}}}async openDevToolsWindow(e,i){if(!this.codeWindowById(e))return;const s=this.instantiationService.invokeFunction(Md,en(),{forceNativeTitlebar:!0,hideBecauseShadowWindow:!1});s.backgroundColor=void 0;const n=new Eh(s);n.setMenuBarVisibility(!1),n.loadURL(i),n.once("ready-to-show",()=>n.show())}async reloadWindowCSS(e){const i=this.codeWindowById(e);if(!i||!i.win)throw new Error;if(!this.cssDevelopmentService.isEnabled)throw new Error("CSS Dev is not enabled");const r=await this.cssDevelopmentService.getCssModules(!0);return i.config&&(i.config.cssModules=r),Object.fromEntries(r)}async profileRenderer(e,i,r){const s=this.codeWindowById(e);if(!s||!s.win)throw new Error;return await new Sh(s.win,i,this.logService).inspect(r)}async windowsGetStringRegKey(e,i,r,s){if(!B)return;const n=await import("@vscode/windows-registry");try{return n.GetStringRegKey(i,r,s)}catch{return}}windowById(e,i){return this.codeWindowById(e)??this.auxiliaryWindowById(e)??this.codeWindowById(i)}codeWindowById(e){if(typeof e=="number")return this.windowsMainService.getWindowById(e)}auxiliaryWindowById(e){if(typeof e!="number")return;const i=PA.fromId(e);if(i)return this.auxiliaryWindowsMainService.getWindowByWebContents(i)}},__decorate([he],gl.prototype,"cliPath",null),gl=__decorate([__param(0,ot),__param(1,la),__param(2,Is),__param(3,ze),__param(4,st),__param(5,V),__param(6,qe),__param(7,Jo),__param(8,rn),__param(9,Qe),__param(10,As),__param(11,Yd),__param(12,Or),__param(13,Gn)],gl)}}),F1,kh,WA=g({"out-build/vs/platform/extensions/electron-main/extensionHostStarter.js"(){"use strict";ae(),Re(),q(),L(),ft(),K(),ti(),oa(),ut(),Xe(),QD(),Yn(),kh=class extends N{static{F1=this}static{this._lastId=0}constructor(e,i,r,s,n,o){super(),this._logService=e,this._lifecycleMainService=i,this._windowsMainService=r,this._telemetryService=s,this._configurationService=n,this._nativeHostMainService=o,this._extHosts=new Map,this._shutdown=!1,this._register(this._lifecycleMainService.onWillShutdown(a=>{this._shutdown=!0,a.join("extHostStarter",this._waitForAllExit(6e3))}))}dispose(){super.dispose()}_getExtHost(e){const i=this._extHosts.get(e);if(!i)throw new Error("Unknown extension host!");return i}onDynamicStdout(e){return this._getExtHost(e).onStdout}onDynamicStderr(e){return this._getExtHost(e).onStderr}onDynamicMessage(e){return this._getExtHost(e).onMessage}onDynamicExit(e){return this._getExtHost(e).onExit}async createExtensionHost(){if(this._shutdown)throw xo();const e=String(++F1._lastId),i=new ol(this._logService,this._windowsMainService,this._telemetryService,this._lifecycleMainService);this._extHosts.set(e,i);const r=i.onExit(({pid:s,code:n,signal:o})=>{r.dispose(),this._logService.info(`Extension host with pid ${s} exited with code: ${n}, signal: ${o}.`),setTimeout(()=>{i.dispose(),this._extHosts.delete(e)}),setTimeout(()=>{try{process.kill(s,0),this._logService.error(`Extension host with pid ${s} still exists, forcefully killing it...`),process.kill(s)}catch{}},1e3)});return{id:e}}async start(e,i){if(this._shutdown)throw xo();let r=["--skipWorkspaceStorageLock"],s=i.execArgv;(this._configurationService.getValue("application.experimental.extensionMonitor.enabled")??!1)&&(s=await this._getPatchedExecArgv(i.execArgv??[]),r.push("--monitorExtensions"));const o=i.env.CURSOR_EXTENSION_HOST_KIND==="cursor"?"(Cursor)":"",a=this._getExtHost(e);return a.start({...i,processTitle:`extension-host ${o} [${i.responseWindowId}-${e}]`,type:"extensionHost",entryPoint:"vs/workbench/api/node/extensionHostProcess",args:r,execArgv:s,allowLoadingUnsignedLibraries:!0,respondToAuthRequestsFromMainProcess:!0,correlationId:e}),{pid:await P.toPromise(a.onSpawn)}}async enableInspectPort(e){if(this._shutdown)throw xo();const i=this._extHosts.get(e);return i?i.enableInspectPort():!1}async kill(e){if(this._shutdown)throw xo();const i=this._extHosts.get(e);i&&i.kill()}async _killAllNow(){for(const[,e]of this._extHosts)e.kill()}async _waitForAllExit(e){const i=[];for(const[,r]of this._extHosts)i.push(r.waitForExit(e));return Ht.settled(i).then(()=>{})}async _getPatchedExecArgv(e){const i=[...e];i.indexOf("--nolazy")===-1&&i.unshift("--nolazy");const r=i.findIndex(a=>a.startsWith("--inspect-brk="));if(r!==-1){const a=i[r].split("=")[1];return i[r]=`--inspect=${a}`,i}const s=i.findIndex(a=>a.startsWith("--inspect=")),n=i.findIndex(a=>a.startsWith("--inspect-port="));if(s!==-1||n!==-1)return i;const o=await this._findDebugPort();return o!==0?i.push(`--inspect=127.0.0.1:${o}`):i.push("--inspect-port=0"),i}async _findDebugPort(){return await this._nativeHostMainService.findFreePort(JD(),10,5e3,2048)}},kh=F1=__decorate([__param(0,V),__param(1,ze),__param(2,ot),__param(3,ei),__param(4,Qe),__param(5,Jr)],kh)}}),ml,LA=g({"out-build/vs/platform/externalTerminal/electron-main/externalTerminal.js"(){"use strict";G(),ml=j("externalTerminal")}}),OA,vl,FA=g({"out-build/vs/platform/externalTerminal/common/externalTerminal.js"(){"use strict";G(),OA=j("externalTerminal"),vl="Terminal.app"}});import*as ha from"child_process";function fa(t){const e={...t.env};return _D(e),e}function N1(t){return"errno"in t&&t.errno==="ENOENT"&&"path"in t&&typeof t.path=="string"?new Error(w(2009,null,t.path)):t}function NA(t){let e="";for(const i of t)i.indexOf(" ")>=0?e+='"'+i+'"':e+=i,e+=" ";return e}var U1,Ph,xh,w5,$1,UA=g({"out-build/vs/platform/externalTerminal/node/externalTerminalService.js"(){"use strict";An(),Ie(),ye(),z(),ah(),qt(),hh(),we(),FA(),U1=w(2004,null),Ph=class{async getDefaultTerminalForPlatforms(){return{windows:xh.getDefaultTerminalWindows(),linux:await $1.getDefaultTerminalLinuxReady(),osx:"xterm"}}},xh=class Fs extends Ph{static{this.CMD="cmd.exe"}openTerminal(e,i){return this.spawnTerminal(ha,e,Y2(),i)}spawnTerminal(e,i,r,s){const n=i.windowsExec||Fs.getDefaultTerminalWindows();s&&s[1]===":"&&(s=s[0].toUpperCase()+s.substr(1));const o=tt(n,".exe").toLowerCase();if(o==="cmder")return e.spawn(n,s?[s]:void 0),Promise.resolve(void 0);const a=["/c","start","/wait"];return n.indexOf(" ")>=0&&a.push(n),a.push(n),o==="wt"&&a.push("-d ."),new Promise((c,l)=>{const u=fa(process),d=e.spawn(r,a,{cwd:s,env:u,detached:!0});d.on("error",l),d.on("exit",()=>c())})}async runInTerminal(e,i,r,s,n){const o="windowsExec"in n&&n.windowsExec?n.windowsExec:Fs.getDefaultTerminalWindows(),a=await Fs.getWtExePath();return new Promise((c,l)=>{const u=`"${i} - ${U1}"`,d=`"${r.join('" "')}" & pause`,f=Object.assign({},fa(process),s);Object.keys(f).filter(S=>f[S]===null).forEach(S=>delete f[S]);const p={cwd:i,env:f,windowsVerbatimArguments:!0};let v,m;tt(o,".exe")==="wt"?(v=o,m=["-d",".",Fs.CMD,"/c",d]):a?(v=a,m=["-d",".",o,"/c",d]):(v=Fs.CMD,m=["/c","start",u,"/wait",o,"/c",`"${d}"`]),ha.spawn(v,m,p).on("error",S=>{l(N1(S))}),c(void 0)})}static getDefaultTerminalWindows(){if(!Fs._DEFAULT_TERMINAL_WINDOWS){const e=!!process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432");Fs._DEFAULT_TERMINAL_WINDOWS=`${process.env.windir?process.env.windir:"C:\\Windows"}\\${e?"Sysnative":"System32"}\\cmd.exe`}return Fs._DEFAULT_TERMINAL_WINDOWS}static async getWtExePath(){try{return await P1("wt")}catch{return}}},__decorate([he],xh,"getWtExePath",null),w5=class I8 extends Ph{static{this.OSASCRIPT="/usr/bin/osascript"}openTerminal(e,i){return this.spawnTerminal(ha,e,i)}runInTerminal(e,i,r,s,n){const o=n.osxExec||vl;return new Promise((a,c)=>{if(o===vl||o==="iTerm.app"){const l=o===vl?"TerminalHelper":"iTermHelper",d=[Ct.asFileUri(`vs/workbench/contrib/externalTerminal/node/${l}.scpt`).fsPath,"-t",e||U1,"-w",i];for(const v of r)d.push("-a"),d.push(v);if(s){const v=Object.assign({},fa(process),s);for(const m in v){const y=v[m];y===null?(d.push("-u"),d.push(m)):(d.push("-e"),d.push(`${m}=${y}`))}}let f="";const p=ha.spawn(I8.OSASCRIPT,d);p.on("error",v=>{c(N1(v))}),p.stderr.on("data",v=>{f+=v.toString()}),p.on("exit",v=>{if(v===0)a(void 0);else if(f){const m=f.split(`
|
|
`,1);c(new Error(m[0]))}else c(new Error(w(2005,null,l,v)))})}else c(new Error(w(2006,null,o)))})}spawnTerminal(e,i,r){const s=i.osxExec||vl;return new Promise((n,o)=>{const a=["-a",s];r&&a.push(r);const c=fa(process),l=e.spawn("/usr/bin/open",a,{cwd:r,env:c});l.on("error",o),l.on("exit",()=>n())})}},$1=class mn extends Ph{static{this.WAIT_MESSAGE=w(2007,null)}openTerminal(e,i){return this.spawnTerminal(ha,e,i)}runInTerminal(e,i,r,s,n){const o=n.linuxExec?Promise.resolve(n.linuxExec):mn.getDefaultTerminalLinuxReady();return new Promise((a,c)=>{const l=[];o.then(u=>{u.indexOf("gnome-terminal")>=0?l.push("-x"):l.push("-e"),l.push("bash"),l.push("-c");const d=`${NA(r)}; echo; read -p "${mn.WAIT_MESSAGE}" -n1;`;l.push(`''${d}''`);const f=Object.assign({},fa(process),s);Object.keys(f).filter(y=>f[y]===null).forEach(y=>delete f[y]);const p={cwd:i,env:f};let v="";const m=ha.spawn(u,l,p);m.on("error",y=>{c(N1(y))}),m.stderr.on("data",y=>{v+=y.toString()}),m.on("exit",y=>{if(y===0)a(void 0);else if(v){const S=v.split(`
|
|
`,1);c(new Error(S[0]))}else c(new Error(w(2008,null,u,y)))})})})}static async getDefaultTerminalLinuxReady(){if(!mn._DEFAULT_TERMINAL_LINUX_READY)if(!Pe)mn._DEFAULT_TERMINAL_LINUX_READY=Promise.resolve("xterm");else{const e=await te.exists("/etc/debian_version");mn._DEFAULT_TERMINAL_LINUX_READY=new Promise(i=>{e?i("x-terminal-emulator"):process.env.DESKTOP_SESSION==="gnome"||process.env.DESKTOP_SESSION==="gnome-classic"?i("gnome-terminal"):process.env.DESKTOP_SESSION==="kde-plasma"?i("konsole"):process.env.COLORTERM?i(process.env.COLORTERM):process.env.TERM?i(process.env.TERM):i("xterm")})}return mn._DEFAULT_TERMINAL_LINUX_READY}spawnTerminal(e,i,r){const s=i.linuxExec?Promise.resolve(i.linuxExec):mn.getDefaultTerminalLinuxReady();return new Promise((n,o)=>{s.then(a=>{const c=fa(process),l=e.spawn(a,[],{cwd:r,env:c});l.on("error",o),l.on("exit",()=>n())})})}}}});function y5(t,e){switch(t){case 0:return"";case 1:return`${yl}*?`;default:return`(?:${wl}|${yl}+${wl}${e?`|${wl}${yl}+`:""})*?`}}function S5(t,e){if(!t)return[];const i=[];let r=!1,s=!1,n="";for(const o of t){switch(o){case e:if(!r&&!s){i.push(n),n="";continue}break;case"{":r=!0;break;case"}":r=!1;break;case"[":s=!0;break;case"]":s=!1;break}n+=o}return n&&i.push(n),i}function _5(t){if(!t)return"";let e="";const i=S5(t,H1);if(i.every(r=>r===pa))e=".*";else{let r=!1;i.forEach((s,n)=>{if(s===pa){if(r)return;e+=y5(2,n===i.length-1)}else{let o=!1,a="",c=!1,l="";for(const u of s){if(u!=="}"&&o){a+=u;continue}if(c&&(u!=="]"||!l)){let d;u==="-"?d=u:(u==="^"||u==="!")&&!l?d="^":u===H1?d="":d=fc(u),l+=d;continue}switch(u){case"{":o=!0;continue;case"[":c=!0;continue;case"}":{const f=`(?:${S5(a,",").map(p=>_5(p)).join("|")})`;e+=f,o=!1,a="";break}case"]":{e+="["+l+"]",c=!1,l="";break}case"?":e+=yl;continue;case"*":e+=y5(1);continue;default:e+=fc(u)}}n<i.length-1&&(i[n+1]!==pa||n+2<i.length)&&(e+=wl)}r=s===pa})}return e}function B1(t,e){if(!t)return Pr;let i;typeof t!="string"?i=t.pattern:i=t,i=i.trim();const r=`${i}_${!!e.trimForExclusions}`;let s=V1.get(r);if(s)return b5(s,t);let n;return C5.test(i)?s=$A(i.substr(4),i):(n=I5.exec(j1(i,e)))?s=BA(n[1],i):(e.trimForExclusions?A5:D5).test(i)?s=jA(i,e):(n=R5.exec(j1(i,e)))?s=E5(n[1].substr(1),i,!0):(n=M5.exec(j1(i,e)))?s=E5(n[1],i,!1):s=HA(i),V1.set(r,s),b5(s,t)}function b5(t,e){if(typeof e=="string")return t;const i=function(r,s){return Ac(r,e.base,!Pe)?t(lS(r.substr(e.base.length),Qt),s):null};return i.allBasenames=t.allBasenames,i.allPaths=t.allPaths,i.basenames=t.basenames,i.patterns=t.patterns,i}function j1(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substr(0,t.length-2):t}function $A(t,e){return function(i,r){return typeof i=="string"&&i.endsWith(t)?e:null}}function BA(t,e){const i=`/${t}`,r=`\\${t}`,s=function(o,a){return typeof o!="string"?null:a?a===t?e:null:o===t||o.endsWith(i)||o.endsWith(r)?e:null},n=[t];return s.basenames=n,s.patterns=[e],s.allBasenames=n,s}function jA(t,e){const i=k5(t.slice(1,-1).split(",").map(a=>B1(a,e)).filter(a=>a!==Pr),t),r=i.length;if(!r)return Pr;if(r===1)return i[0];const s=function(a,c){for(let l=0,u=i.length;l<u;l++)if(i[l](a,c))return t;return null},n=i.find(a=>!!a.allBasenames);n&&(s.allBasenames=n.allBasenames);const o=i.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return o.length&&(s.allPaths=o),s}function E5(t,e,i){const r=Qt===le.sep,s=r?t:t.replace(x5,Qt),n=Qt+s,o=le.sep+t;let a;return i?a=function(c,l){return typeof c=="string"&&(c===s||c.endsWith(n)||!r&&(c===t||c.endsWith(o)))?e:null}:a=function(c,l){return typeof c=="string"&&(c===s||!r&&c===t)?e:null},a.allPaths=[(i?"*/":"./")+t],a}function HA(t){try{const e=new RegExp(`^${_5(t)}$`);return function(i){return e.lastIndex=0,typeof i=="string"&&e.test(i)?t:null}}catch{return Pr}}function VA(t,e={}){if(!t)return q1;if(typeof t=="string"||qA(t)){const i=B1(t,e);if(i===Pr)return q1;const r=function(s,n){return!!i(s,n)};return i.allBasenames&&(r.allBasenames=i.allBasenames),i.allPaths&&(r.allPaths=i.allPaths),r}return zA(t,e)}function qA(t){const e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function zA(t,e){const i=k5(Object.getOwnPropertyNames(t).map(a=>GA(a,t[a],e)).filter(a=>a!==Pr)),r=i.length;if(!r)return Pr;if(!i.some(a=>!!a.requiresSiblings)){if(r===1)return i[0];const a=function(u,d){let f;for(let p=0,v=i.length;p<v;p++){const m=i[p](u,d);if(typeof m=="string")return m;Kg(m)&&(f||(f=[]),f.push(m))}return f?(async()=>{for(const p of f){const v=await p;if(typeof v=="string")return v}return null})():null},c=i.find(u=>!!u.allBasenames);c&&(a.allBasenames=c.allBasenames);const l=i.reduce((u,d)=>d.allPaths?u.concat(d.allPaths):u,[]);return l.length&&(a.allPaths=l),a}const s=function(a,c,l){let u,d;for(let f=0,p=i.length;f<p;f++){const v=i[f];v.requiresSiblings&&l&&(c||(c=tt(a)),u||(u=c.substr(0,c.length-Hu(a).length)));const m=v(a,c,u,l);if(typeof m=="string")return m;Kg(m)&&(d||(d=[]),d.push(m))}return d?(async()=>{for(const f of d){const p=await f;if(typeof p=="string")return p}return null})():null},n=i.find(a=>!!a.allBasenames);n&&(s.allBasenames=n.allBasenames);const o=i.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return o.length&&(s.allPaths=o),s}function GA(t,e,i){if(e===!1)return Pr;const r=B1(t,i);if(r===Pr)return Pr;if(typeof e=="boolean")return r;if(e){const s=e.when;if(typeof s=="string"){const n=(o,a,c,l)=>{if(!l||!r(o,a))return null;const u=s.replace("$(basename)",()=>c),d=l(u);return Kg(d)?d.then(f=>f?t:null):d?t:null};return n.requiresSiblings=!0,n}}return r}function k5(t,e){const i=t.filter(a=>!!a.basenames);if(i.length<2)return t;const r=i.reduce((a,c)=>{const l=c.basenames;return l?a.concat(l):a},[]);let s;if(e){s=[];for(let a=0,c=r.length;a<c;a++)s.push(e)}else s=i.reduce((a,c)=>{const l=c.patterns;return l?a.concat(l):a},[]);const n=function(a,c){if(typeof a!="string")return null;if(!c){let u;for(u=a.length;u>0;u--){const d=a.charCodeAt(u-1);if(d===47||d===92)break}c=a.substr(u)}const l=r.indexOf(c);return l!==-1?s[l]:null};n.basenames=r,n.patterns=s,n.allBasenames=r;const o=t.filter(a=>!a.basenames);return o.push(n),o}function P5(t,e){return nc(t,e,(i,r)=>typeof i=="string"&&typeof r=="string"?i===r:typeof i!="string"&&typeof r!="string"?i.base===r.base&&i.pattern===r.pattern:!1)}var pa,H1,wl,yl,x5,C5,I5,D5,A5,R5,M5,V1,q1,Pr,T5=g({"out-build/vs/base/common/glob.js"(){"use strict";Wt(),ae(),Bi(),ai(),ye(),z(),jt(),pa="**",H1="/",wl="[/\\\\]",yl="[^/\\\\]",x5=/\//g,C5=/^\*\*\/\*\.[\w\.-]+$/,I5=/^\*\*\/([\w\.-]+)\/?$/,D5=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,A5=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,R5=/^\*\*((\/[\w\.-]+)+)\/?$/,M5=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,V1=new oc(1e4),q1=function(){return!1},Pr=function(){return null}}});function W5(t){return typeof t.correlationId=="number"}function KA(t){return t.recursive===!0}function L5(t){return t.map(e=>({type:e.type,resource:x.revive(e.resource),cId:e.cId}))}function YA(t){const e=new U5;for(const i of t)e.processEvent(i);return e.coalesce()}function JA(t,e){return typeof e=="string"&&!e.startsWith(pa)&&!dc(e)?{base:t,pattern:e}:e}function O5(t,e){const i=[];for(const r of e)i.push(VA(JA(t,r)));return i}function QA(t,e){if(typeof e=="number")switch(t.type){case 1:return(e&4)===0;case 2:return(e&8)===0;case 0:return(e&2)===0}return!1}function XA(t){if(typeof t=="number"){const e=[];return t&4&&e.push("Added"),t&8&&e.push("Deleted"),t&2&&e.push("Updated"),e.length===0?"<all>":`[${e.join(", ")}]`}return"<none>"}var z1,F5,N5,U5,ga=g({"out-build/vs/platform/files/common/watcher.js"(){"use strict";T5(),L(),ye(),z(),re(),Ze(),z1=class D8 extends N{static{this.MAX_RESTARTS=5}constructor(e,i,r,s){super(),this.onFileChanges=e,this.onLogMessage=i,this.verboseLogging=r,this.options=s,this.watcherDisposables=this._register(new $s),this.requests=void 0,this.restartCounter=0}init(){const e=new ke;this.watcherDisposables.value=e,this.watcher=this.createWatcher(e),this.watcher.setVerboseLogging(this.verboseLogging),e.add(this.watcher.onDidChangeFile(i=>this.onFileChanges(i))),e.add(this.watcher.onDidLogMessage(i=>this.onLogMessage(i))),e.add(this.watcher.onDidError(i=>this.onError(i.error,i.request)))}onError(e,i){this.canRestart(e,i)?this.restartCounter<D8.MAX_RESTARTS&&this.requests?(this.error(`restarting watcher after unexpected error: ${e}`),this.restart(this.requests)):this.error(`gave up attempting to restart watcher after unexpected error: ${e}`):this.error(e)}canRestart(e,i){return!(!this.options.restartOnError||i||e.indexOf("No space left on device")!==-1||e.indexOf("EMFILE")!==-1)}restart(e){this.restartCounter++,this.init(),this.watch(e)}async watch(e){this.requests=e,await this.watcher?.watch(e)}async setVerboseLogging(e){this.verboseLogging=e,await this.watcher?.setVerboseLogging(e)}error(e){this.onLogMessage({type:"error",message:`[File Watcher (${this.options.type})] ${e}`})}trace(e){this.onLogMessage({type:"trace",message:`[File Watcher (${this.options.type})] ${e}`})}dispose(){return this.watcher=void 0,super.dispose()}},F5=class extends z1{constructor(t,e,i){super(t,e,i,{type:"node.js",restartOnError:!1})}},N5=class extends z1{constructor(t,e,i){super(t,e,i,{type:"universal",restartOnError:!0})}},U5=class{constructor(){this.coalesced=new Set,this.mapPathToChange=new Map}toKey(t){return Pe?t.resource.fsPath:t.resource.fsPath.toLowerCase()}processEvent(t){const e=this.mapPathToChange.get(this.toKey(t));let i=!1;if(e){const r=e.type,s=t.type;e.resource.fsPath!==t.resource.fsPath&&(t.type===2||t.type===1)?i=!0:r===1&&s===2?(this.mapPathToChange.delete(this.toKey(t)),this.coalesced.delete(e)):r===2&&s===1?e.type=0:r===1&&s===0||(e.type=s)}else i=!0;i&&(this.coalesced.add(t),this.mapPathToChange.set(this.toKey(t),t))}coalesce(){const t=[],e=[];return Array.from(this.coalesced).filter(i=>i.type!==2?(t.push(i),!1):!0).sort((i,r)=>i.resource.fsPath.length-r.resource.fsPath.length).filter(i=>e.some(r=>a3(i.resource.fsPath,r,!Pe))?!1:(e.push(i.resource.fsPath),!0)).concat(t)}}}}),G1,ZA=g({"out-build/vs/platform/files/common/diskFileSystemProviderClient.js"(){"use strict";it(),In(),Re(),q(),L(),vc(),re(),Hi(),Ze(),ga(),G1="localFilesystem"}});async function $5(t,e,i,r,s,n){let o;try{await eR(t,e,i,r,s,n)}catch(a){o=a}finally{o&&s.errorTransformer&&(o=s.errorTransformer(o)),typeof o<"u"&&i.error(o),i.end()}}async function eR(t,e,i,r,s,n){K1(n);const o=await t.open(e,{create:!1});try{K1(n);let a=0,c=0,l=s&&typeof s.length=="number"?s.length:void 0,u=Y.alloc(Math.min(s.bufferSize,typeof l=="number"?l:s.bufferSize)),d=s&&typeof s.position=="number"?s.position:0,f=0;do c=await t.read(o,d,u.buffer,f,u.byteLength-f),d+=c,f+=c,a+=c,typeof l=="number"&&(l-=c),f===u.byteLength&&(await i.write(r(u)),u=Y.alloc(Math.min(s.bufferSize,typeof l=="number"?l:s.bufferSize)),f=0);while(c>0&&(typeof l!="number"||l>0)&&K1(n)&&tR(a,s));if(f>0){let p=f;typeof l=="number"&&(p=Math.min(f,l)),i.write(r(u.slice(0,p)))}}catch(a){throw Wn(a)}finally{await t.close(o)}}function K1(t){if(t.isCancellationRequested)throw xo();return!0}function tR(t,e){if(typeof e?.limits?.size=="number"&&t>e.limits.size)throw kr(w(2051,null),ce.FileTooLarge);return!0}var B5=g({"out-build/vs/platform/files/common/io.js"(){"use strict";it(),Re(),we(),Ze()}}),j5,iR=g({"out-build/vs/platform/files/common/diskFileSystemProvider.js"(){"use strict";Wt(),ae(),Re(),q(),Bi(),L(),ye(),ga(),K(),j5=class extends N{constructor(t,e){super(),this.logService=t,this.options=e,this._onDidChangeFile=this._register(new D),this.onDidChangeFile=this._onDidChangeFile.event,this._onDidWatchError=this._register(new D),this.onDidWatchError=this._onDidWatchError.event,this.universalWatchRequests=[],this.universalWatchRequestDelayer=this._register(new ws(this.getRefreshWatchersDelay(this.universalWatchRequests.length))),this.nonRecursiveWatchRequests=[],this.nonRecursiveWatchRequestDelayer=this._register(new ws(this.getRefreshWatchersDelay(this.nonRecursiveWatchRequests.length)))}watch(t,e){return e.recursive||this.options?.watcher?.forceUniversal?this.watchUniversal(t,e):this.watchNonRecursive(t,e)}getRefreshWatchersDelay(t){return t>200?500:0}watchUniversal(t,e){const i=this.toWatchRequest(t,e),r=by(this.universalWatchRequests,i);return this.refreshUniversalWatchers(),me(()=>{r(),this.refreshUniversalWatchers()})}toWatchRequest(t,e){const i={path:this.toWatchPath(t),excludes:e.excludes,includes:e.includes,recursive:e.recursive,filter:e.filter,correlationId:e.correlationId};if(KA(i)){const r=this.options?.watcher?.recursive?.usePolling;r===!0?i.pollingInterval=this.options?.watcher?.recursive?.pollingInterval??5e3:Array.isArray(r)&&r.includes(i.path)&&(i.pollingInterval=this.options?.watcher?.recursive?.pollingInterval??5e3)}return i}refreshUniversalWatchers(){this.universalWatchRequestDelayer.trigger(()=>this.doRefreshUniversalWatchers(),this.getRefreshWatchersDelay(this.universalWatchRequests.length)).catch(t=>$t(t))}doRefreshUniversalWatchers(){return this.universalWatcher||(this.universalWatcher=this._register(this.createUniversalWatcher(t=>this._onDidChangeFile.fire(L5(t)),t=>this.onWatcherLogMessage(t),this.logService.getLevel()===X.Trace)),this._register(this.logService.onDidChangeLogLevel(()=>{this.universalWatcher?.setVerboseLogging(this.logService.getLevel()===X.Trace)}))),this.universalWatcher.watch(this.universalWatchRequests)}watchNonRecursive(t,e){const i={path:this.toWatchPath(t),excludes:e.excludes,includes:e.includes,recursive:!1,filter:e.filter,correlationId:e.correlationId},r=by(this.nonRecursiveWatchRequests,i);return this.refreshNonRecursiveWatchers(),me(()=>{r(),this.refreshNonRecursiveWatchers()})}refreshNonRecursiveWatchers(){this.nonRecursiveWatchRequestDelayer.trigger(()=>this.doRefreshNonRecursiveWatchers(),this.getRefreshWatchersDelay(this.nonRecursiveWatchRequests.length)).catch(t=>$t(t))}doRefreshNonRecursiveWatchers(){return this.nonRecursiveWatcher||(this.nonRecursiveWatcher=this._register(this.createNonRecursiveWatcher(t=>this._onDidChangeFile.fire(L5(t)),t=>this.onWatcherLogMessage(t),this.logService.getLevel()===X.Trace)),this._register(this.logService.onDidChangeLogLevel(()=>{this.nonRecursiveWatcher?.setVerboseLogging(this.logService.getLevel()===X.Trace)}))),this.nonRecursiveWatcher.watch(this.nonRecursiveWatchRequests)}onWatcherLogMessage(t){t.type==="error"&&this._onDidWatchError.fire(t.message),this.logWatcherMessage(t)}logWatcherMessage(t){this.logService[t.type](t.message)}toFilePath(t){return bi(t.fsPath)}toWatchPath(t){const e=this.toFilePath(t);return zS(e)}}}});function rR(t){const e=t;return e&&typeof e.type=="string"&&typeof e.severity=="string"}function sR(t){const e=[];let i;try{const r=JSON.parse(t.arguments),s=r[r.length-1];s&&s.__$stack&&(r.pop(),i=s.__$stack),e.push(...r)}catch{e.push("Unable to log remote console arguments",t.arguments)}return{args:e,stack:i}}function nR(t){if(!t)return t;const e=t.indexOf(`
|
|
`);return e===-1?t:t.substring(0,e)}function oR(t,e){const{args:i,stack:r}=sR(t),s=typeof i[0]=="string"&&i.length===1;let n=nR(r);n&&(n=`(${n.trim()})`);let o=[];if(typeof i[0]=="string"?n&&s?o=[`%c[${e}] %c${i[0]} %c${n}`,ma("blue"),ma(""),ma("grey")]:o=[`%c[${e}] %c${i[0]}`,ma("blue"),ma(""),...i.slice(1)]:o=[`%c[${e}]%`,ma("blue"),...i],n&&!s&&o.push(n),typeof console[t.severity]!="function")throw new Error("Unknown console method");console[t.severity].apply(console,o)}function ma(t){return`color: ${t}`}var aR=g({"out-build/vs/base/common/console.js"(){"use strict";re()}});import{fork as cR}from"child_process";var H5,lR=g({"out-build/vs/base/parts/ipc/node/ipc.cp.js"(){"use strict";ae(),it(),St(),aR(),Re(),q(),L(),ur(),hh(),ah(),Er(),H5=class{constructor(t,e){this.modulePath=t,this.options=e,this.activeRequests=new Set,this.channels=new Map,this._onDidProcessExit=new D,this.onDidProcessExit=this._onDidProcessExit.event;const i=e&&e.timeout?e.timeout:6e4;this.disposeDelayer=new Xu(i),this.child=null,this._client=null}getChannel(t){const e=this;return{call(i,r,s){return e.requestPromise(t,i,r,s)},listen(i,r){return e.requestEvent(t,i,r)}}}requestPromise(t,e,i,r=Te.None){if(!this.disposeDelayer)return Promise.reject(new Error("disposed"));if(r.isCancellationRequested)return Promise.reject(xo());this.disposeDelayer.cancel();const s=this.getCachedChannel(t),n=To(c=>s.call(e,i,c)),o=r.onCancellationRequested(()=>n.cancel()),a=me(()=>n.cancel());return this.activeRequests.add(a),n.finally(()=>{o.dispose(),this.activeRequests.delete(a),this.activeRequests.size===0&&this.disposeDelayer&&this.disposeDelayer.trigger(()=>this.disposeClient())}),n}requestEvent(t,e,i){if(!this.disposeDelayer)return P.None;this.disposeDelayer.cancel();let r;const s=new D({onWillAddFirstListener:()=>{r=this.getCachedChannel(t).listen(e,i)(s.fire,s),this.activeRequests.add(r)},onDidRemoveLastListener:()=>{this.activeRequests.delete(r),r.dispose(),this.activeRequests.size===0&&this.disposeDelayer&&this.disposeDelayer.trigger(()=>this.disposeClient())}});return s.event}get client(){if(!this._client){const t=this.options&&this.options.args?this.options.args:[],e=Object.create(null);e.env={...lr(process.env),VSCODE_PARENT_PID:String(process.pid)},this.options&&this.options.env&&(e.env={...e.env,...this.options.env}),this.options&&this.options.freshExecArgv&&(e.execArgv=[]),this.options&&typeof this.options.debug=="number"&&(e.execArgv=["--nolazy","--inspect="+this.options.debug]),this.options&&typeof this.options.debugBrk=="number"&&(e.execArgv=["--nolazy","--inspect-brk="+this.options.debugBrk]),e.execArgv===void 0&&(e.execArgv=process.execArgv.filter(u=>!/^--inspect(-brk)?=/.test(u)).filter(u=>!u.startsWith("--vscode-"))),W2(e.env),this.child=cR(this.modulePath,t,e);const i=new D,s=P.fromNodeEventEmitter(this.child,"message",u=>u)(u=>{if(rR(u)){oR(u,`IPC Library: ${this.options.serverName}`);return}i.fire(Y.wrap(Buffer.from(u,"base64")))}),n=this.options.useQueue?$D(this.child):this.child,o=u=>this.child&&this.child.connected&&n.send(u.buffer.toString("base64")),a=i.event,c={send:o,onMessage:a};this._client=new Lc(c);const l=()=>this.disposeClient();process.once("exit",l),this.child.on("error",u=>console.warn('IPC "'+this.options.serverName+'" errored with '+u)),this.child.on("exit",(u,d)=>{process.removeListener("exit",l),s.dispose(),this.activeRequests.forEach(f=>Rt(f)),this.activeRequests.clear(),u!==0&&d!=="SIGTERM"&&console.warn('IPC "'+this.options.serverName+'" crashed with exit code '+u+" and signal "+d),this.disposeDelayer?.cancel(),this.disposeClient(),this._onDidProcessExit.fire({code:u,signal:d})})}return this._client}getCachedChannel(t){let e=this.channels.get(t);return e||(e=this.client.getChannel(t),this.channels.set(t,e)),e}disposeClient(){this._client&&(this.child&&(this.child.kill(),this.child=null),this._client=null,this.channels.clear())}dispose(){this._onDidProcessExit.dispose(),this.disposeDelayer?.cancel(),this.disposeDelayer=void 0,this.disposeClient(),this.activeRequests.clear()}}}}),V5,uR=g({"out-build/vs/platform/files/node/watcher/watcherClient.js"(){"use strict";Ie(),Er(),lR(),ga(),V5=class extends N5{constructor(t,e,i){super(t,e,i),this.init()}createWatcher(t){const e=t.add(new H5(Ct.asFileUri("bootstrap-fork").fsPath,{serverName:"File Watcher",args:["--type=fileWatcher"],env:{VSCODE_ESM_ENTRYPOINT:"vs/platform/files/node/watcher/watcherMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true"}}));return t.add(e.onDidProcessExit(({code:i,signal:r})=>this.onError(`terminated by itself with code ${i}, signal: ${r} (ETERM)`))),Oe.toService(wI(e.getChannel("watcher")))}}}});import{watchFile as dR,unwatchFile as hR}from"fs";var q5,fR=g({"out-build/vs/platform/files/node/watcher/baseWatcher.js"(){"use strict";L(),ga(),q(),re(),ae(),_s(),Re(),q5=class extends N{constructor(){super(),this._onDidChangeFile=this._register(new D),this.onDidChangeFile=this._onDidChangeFile.event,this._onDidLogMessage=this._register(new D),this.onDidLogMessage=this._onDidLogMessage.event,this._onDidWatchFail=this._register(new D),this.onDidWatchFail=this._onDidWatchFail.event,this.correlatedWatchRequests=new Map,this.nonCorrelatedWatchRequests=new Map,this.suspendedWatchRequests=this._register(new mg),this.suspendedWatchRequestsWithPolling=new Set,this.updateWatchersDelayer=this._register(new ws(this.getUpdateWatchersDelay())),this.suspendedWatchRequestPollingInterval=5007,this.joinWatch=new ys,this.verboseLogging=!1,this._register(this.onDidWatchFail(t=>this.suspendWatchRequest({id:this.computeId(t),correlationId:this.isCorrelated(t)?t.correlationId:void 0,path:t.path})))}isCorrelated(t){return W5(t)}computeId(t){return this.isCorrelated(t)?t.correlationId:Ur(t)}async watch(t){this.joinWatch.isSettled||this.joinWatch.complete(),this.joinWatch=new ys;try{this.correlatedWatchRequests.clear(),this.nonCorrelatedWatchRequests.clear();for(const e of t)this.isCorrelated(e)?this.correlatedWatchRequests.set(e.correlationId,e):this.nonCorrelatedWatchRequests.set(this.computeId(e),e);for(const[e]of this.suspendedWatchRequests)!this.nonCorrelatedWatchRequests.has(e)&&!this.correlatedWatchRequests.has(e)&&(this.suspendedWatchRequests.deleteAndDispose(e),this.suspendedWatchRequestsWithPolling.delete(e));return await this.updateWatchers(!1)}finally{this.joinWatch.complete()}}updateWatchers(t){const e=[];for(const[i,r]of[...this.nonCorrelatedWatchRequests,...this.correlatedWatchRequests])this.suspendedWatchRequests.has(i)||e.push(r);return this.updateWatchersDelayer.trigger(()=>this.doWatch(e),t?this.getUpdateWatchersDelay():0).catch(i=>$t(i))}getUpdateWatchersDelay(){return 800}isSuspended(t){const e=this.computeId(t);return this.suspendedWatchRequestsWithPolling.has(e)?"polling":this.suspendedWatchRequests.has(e)}async suspendWatchRequest(t){if(this.suspendedWatchRequests.has(t.id))return;const e=new ke;this.suspendedWatchRequests.set(t.id,e),await this.joinWatch.p,!e.isDisposed&&(this.monitorSuspendedWatchRequest(t,e),this.updateWatchers(!0))}resumeWatchRequest(t){this.suspendedWatchRequests.deleteAndDispose(t.id),this.suspendedWatchRequestsWithPolling.delete(t.id),this.updateWatchers(!1)}monitorSuspendedWatchRequest(t,e){this.doMonitorWithExistingWatcher(t,e)?(this.trace(`reusing an existing recursive watcher to monitor ${t.path}`),this.suspendedWatchRequestsWithPolling.delete(t.id)):(this.doMonitorWithNodeJS(t,e),this.suspendedWatchRequestsWithPolling.add(t.id))}doMonitorWithExistingWatcher(t,e){const i=this.recursiveWatcher?.subscribe(t.path,(r,s)=>{e.isDisposed||(r?this.monitorSuspendedWatchRequest(t,e):s?.type===1&&this.onMonitoredPathAdded(t))});return i?(e.add(i),!0):!1}doMonitorWithNodeJS(t,e){let i=!1;const r=(s,n)=>{if(e.isDisposed)return;const o=this.isPathNotFound(s),a=this.isPathNotFound(n),c=i;i=o,!o&&(a||c)&&this.onMonitoredPathAdded(t)};this.trace(`starting fs.watchFile() on ${t.path} (correlationId: ${t.correlationId})`);try{dR(t.path,{persistent:!1,interval:this.suspendedWatchRequestPollingInterval},r)}catch(s){this.warn(`fs.watchFile() failed with error ${s} on path ${t.path} (correlationId: ${t.correlationId})`)}e.add(me(()=>{this.trace(`stopping fs.watchFile() on ${t.path} (correlationId: ${t.correlationId})`);try{hR(t.path,r)}catch(s){this.warn(`fs.unwatchFile() failed with error ${s} on path ${t.path} (correlationId: ${t.correlationId})`)}}))}onMonitoredPathAdded(t){this.trace(`detected ${t.path} exists again, resuming watcher (correlationId: ${t.correlationId})`);const e={resource:x.file(t.path),type:1,cId:t.correlationId};this._onDidChangeFile.fire([e]),this.traceEvent(e,t),this.resumeWatchRequest(t)}isPathNotFound(t){return t.ctimeMs===0&&t.ino===0}async stop(){this.suspendedWatchRequests.clearAndDisposeAll(),this.suspendedWatchRequestsWithPolling.clear()}traceEvent(t,e){if(this.verboseLogging){const i=` >> normalized ${t.type===1?"[ADDED]":t.type===2?"[DELETED]":"[CHANGED]"} ${t.resource.fsPath}`;this.traceWithCorrelation(i,e)}}traceWithCorrelation(t,e){this.verboseLogging&&this.trace(`${t}${typeof e.correlationId=="number"?` <${e.correlationId}> `:""}`)}requestToString(t){return`${t.path} (excludes: ${t.excludes.length>0?t.excludes:"<none>"}, includes: ${t.includes&&t.includes.length>0?JSON.stringify(t.includes):"<all>"}, filter: ${XA(t.filter)}, correlationId: ${typeof t.correlationId=="number"?t.correlationId:"<none>"})`}async setVerboseLogging(t){this.verboseLogging=t}}}});import{watch as pR,promises as gR}from"fs";var z5,mR=g({"out-build/vs/platform/files/node/watcher/nodejs/nodejsWatcherLib.js"(){"use strict";ae(),St(),Bi(),L(),td(),ye(),z(),gt(),re(),D1(),qt(),ga(),Do(),z5=class qp extends N{static{this.FILE_DELETE_HANDLER_DELAY=100}static{this.FILE_CHANGES_HANDLER_DELAY=75}get isReusingRecursiveWatcher(){return this._isReusingRecursiveWatcher}get failed(){return this.didFail}constructor(e,i,r,s,n,o){super(),this.request=e,this.recursiveWatcher=i,this.onDidFilesChange=r,this.onDidWatchFail=s,this.onLogMessage=n,this.verboseLogging=o,this.throttledFileChangesEmitter=this._register(new Xg({maxWorkChunkSize:100,throttleDelay:200,maxBufferedWork:1e4},a=>this.onDidFilesChange(a))),this.fileChangesAggregator=this._register(new a_(a=>this.handleFileChanges(a),qp.FILE_CHANGES_HANDLER_DELAY)),this.cts=new Sr,this.realPath=new gs(async()=>{let a=this.request.path;try{a=await mh(this.request.path),this.request.path!==a&&this.trace(`correcting a path to watch that seems to be a symbolic link (original: ${this.request.path}, real: ${a})`)}catch{}return a}),this._isReusingRecursiveWatcher=!1,this.didFail=!1,this.excludes=O5(this.request.path,this.request.excludes),this.includes=this.request.includes?O5(this.request.path,this.request.includes):void 0,this.filter=W5(this.request)?this.request.filter:void 0,this.ready=this.watch()}async watch(){try{const e=await gR.stat(this.request.path);if(this.cts.token.isCancellationRequested)return;this._register(await this.doWatch(e.isDirectory()))}catch(e){e.code!=="ENOENT"?this.error(e):this.trace(`ignoring a path for watching who's stat info failed to resolve: ${this.request.path} (error: ${e})`),this.notifyWatchFailed()}}notifyWatchFailed(){this.didFail=!0,this.onDidWatchFail?.()}async doWatch(e){const i=new ke;return this.doWatchWithExistingWatcher(e,i)?(this.trace(`reusing an existing recursive watcher for ${this.request.path}`),this._isReusingRecursiveWatcher=!0):(this._isReusingRecursiveWatcher=!1,await this.doWatchWithNodeJS(e,i)),i}doWatchWithExistingWatcher(e,i){if(e)return!1;const r=x.file(this.request.path),s=this.recursiveWatcher?.subscribe(this.request.path,async(n,o)=>{if(!i.isDisposed)if(n){const a=await this.doWatch(e);i.isDisposed?a.dispose():i.add(a)}else o&&(typeof o.cId=="number"||typeof this.request.correlationId=="number")&&this.onFileChange({resource:r,type:o.type,cId:this.request.correlationId},!0)});return s?(i.add(s),!0):!1}async doWatchWithNodeJS(e,i){const r=await this.realPath.value;if(this.cts.token.isCancellationRequested)return;if(O&&Ac(r,"/Volumes/",!0)){this.error(`Refusing to watch ${r} for changes using fs.watch() for possibly being a network share where watching is unreliable and unstable.`);return}const s=new Sr(this.cts.token);i.add(me(()=>s.dispose(!0)));const n=new ke;i.add(n);try{const o=x.file(this.request.path),a=tt(r),c=pR(r);n.add(me(()=>{c.removeAllListeners(),c.close()})),this.trace(`Started watching: '${r}'`);const l=new Set;if(e)try{for(const d of await te.readdir(r))l.add(d)}catch(d){this.error(d)}if(s.token.isCancellationRequested)return;const u=new Map;n.add(me(()=>{for(const[,d]of u)d.dispose();u.clear()})),c.on("error",(d,f)=>{s.token.isCancellationRequested||(this.error(`Failed to watch ${r} for changes using fs.watch() (${d}, ${f})`),this.notifyWatchFailed())}),c.on("change",(d,f)=>{if(s.token.isCancellationRequested)return;this.verboseLogging&&this.traceWithCorrelation(`[raw] ["${d}"] ${f}`);let p="";if(f&&(p=f.toString(),O&&(p=Oo(p))),!(!p||d!=="change"&&d!=="rename"))if(e)if(d==="rename"){u.get(p)?.dispose();const v=setTimeout(async()=>{if(u.delete(p),Dc(p,a,!Pe)&&!await te.exists(r)){this.onWatchedPathDeleted(o);return}if(s.token.isCancellationRequested)return;const m=await this.existsChildStrictCase(U(r,p));if(s.token.isCancellationRequested)return;let y;m?l.has(p)?y=0:(y=1,l.add(p)):(l.delete(p),y=2),this.onFileChange({resource:pe(o,p),type:y,cId:this.request.correlationId})},qp.FILE_DELETE_HANDLER_DELAY);u.set(p,me(()=>clearTimeout(v)))}else{let v;l.has(p)?v=0:(v=1,l.add(p)),this.onFileChange({resource:pe(o,p),type:v,cId:this.request.correlationId})}else if(d==="rename"||!Dc(p,a,!Pe)){const v=setTimeout(async()=>{const m=await te.exists(r);s.token.isCancellationRequested||(m?(this.onFileChange({resource:o,type:0,cId:this.request.correlationId},!0),n.add(await this.doWatch(!1))):this.onWatchedPathDeleted(o))},qp.FILE_DELETE_HANDLER_DELAY);n.clear(),n.add(me(()=>clearTimeout(v)))}else this.onFileChange({resource:o,type:0,cId:this.request.correlationId},!0)})}catch(o){if(s.token.isCancellationRequested)return;this.error(`Failed to watch ${r} for changes using fs.watch() (${o.toString()})`),this.notifyWatchFailed()}}onWatchedPathDeleted(e){this.warn("Watcher shutdown because watched path got deleted"),this.onFileChange({resource:e,type:2,cId:this.request.correlationId},!0),this.fileChangesAggregator.flush(),this.notifyWatchFailed()}onFileChange(e,i=!1){this.cts.token.isCancellationRequested||(this.verboseLogging&&this.traceWithCorrelation(`${e.type===1?"[ADDED]":e.type===2?"[DELETED]":"[CHANGED]"} ${e.resource.fsPath}`),!i&&this.excludes.some(r=>r(e.resource.fsPath))?this.verboseLogging&&this.traceWithCorrelation(` >> ignored (excluded) ${e.resource.fsPath}`):!i&&this.includes&&this.includes.length>0&&!this.includes.some(r=>r(e.resource.fsPath))?this.verboseLogging&&this.traceWithCorrelation(` >> ignored (not included) ${e.resource.fsPath}`):this.fileChangesAggregator.work(e))}handleFileChanges(e){const i=YA(e),r=[];for(const n of i){if(QA(n,this.filter)){this.verboseLogging&&this.traceWithCorrelation(` >> ignored (filtered) ${n.resource.fsPath}`);continue}r.push(n)}if(r.length===0)return;if(this.verboseLogging)for(const n of r)this.traceWithCorrelation(` >> normalized ${n.type===1?"[ADDED]":n.type===2?"[DELETED]":"[CHANGED]"} ${n.resource.fsPath}`);this.throttledFileChangesEmitter.work(r)?this.throttledFileChangesEmitter.pending>0&&this.trace(`started throttling events due to large amount of file change events at once (pending: ${this.throttledFileChangesEmitter.pending}, most recent change: ${r[0].resource.fsPath}). Use 'files.watcherExclude' setting to exclude folders with lots of changing files (e.g. compilation output).`):this.warn(`started ignoring events due to too many file change events at once (incoming: ${r.length}, most recent change: ${r[0].resource.fsPath}). Use 'files.watcherExclude' setting to exclude folders with lots of changing files (e.g. compilation output).`)}async existsChildStrictCase(e){if(Pe)return te.exists(e);try{const i=tt(e);return(await te.readdir(pt(e))).some(s=>s===i)}catch(i){return this.trace(i),!1}}setVerboseLogging(e){this.verboseLogging=e}error(e){this.cts.token.isCancellationRequested||this.onLogMessage?.({type:"error",message:`[File Watcher (node.js)] ${e}`})}warn(e){this.cts.token.isCancellationRequested||this.onLogMessage?.({type:"warn",message:`[File Watcher (node.js)] ${e}`})}trace(e){!this.cts.token.isCancellationRequested&&this.verboseLogging&&this.onLogMessage?.({type:"trace",message:`[File Watcher (node.js)] ${e}`})}traceWithCorrelation(e){!this.cts.token.isCancellationRequested&&this.verboseLogging&&this.trace(`${e}${typeof this.request.correlationId=="number"?` <${this.request.correlationId}> `:""}`)}dispose(){this.cts.dispose(!0),super.dispose()}}}}),G5,vR=g({"out-build/vs/platform/files/node/watcher/nodejs/nodejsWatcher.js"(){"use strict";q(),T5(),fR(),z(),mR(),ae(),L(),G5=class extends q5{get watchers(){return this._watchers.values()}constructor(t){super(),this.recursiveWatcher=t,this.onDidError=P.None,this._watchers=new Map,this.worker=this._register(new $s)}async doWatch(t){t=this.removeDuplicateRequests(t);const e=[],i=new Set(Array.from(this.watchers));for(const r of t){const s=this._watchers.get(this.requestToWatcherKey(r));s&&P5(s.request.excludes,r.excludes)&&P5(s.request.includes,r.includes)?i.delete(s):e.push(r)}e.length&&this.trace(`Request to start watching: ${e.map(r=>this.requestToString(r)).join(",")}`),i.size&&this.trace(`Request to stop watching: ${Array.from(i).map(r=>this.requestToString(r.request)).join(",")}`),this.worker.clear();for(const r of i)this.stopWatching(r);this.createWatchWorker().work(e)}createWatchWorker(){return this.worker.value=new Xg({maxWorkChunkSize:100,throttleDelay:100,maxBufferedWork:Number.MAX_VALUE},t=>{for(const e of t)this.startWatching(e)}),this.worker.value}requestToWatcherKey(t){return typeof t.correlationId=="number"?t.correlationId:this.pathToWatcherKey(t.path)}pathToWatcherKey(t){return Pe?t:t.toLowerCase()}startWatching(t){const e=new z5(t,this.recursiveWatcher,r=>this._onDidChangeFile.fire(r),()=>this._onDidWatchFail.fire(t),r=>this._onDidLogMessage.fire(r),this.verboseLogging),i={request:t,instance:e};this._watchers.set(this.requestToWatcherKey(t),i)}async stop(){await super.stop();for(const t of this.watchers)this.stopWatching(t)}stopWatching(t){this.trace("stopping file watcher",t),this._watchers.delete(this.requestToWatcherKey(t.request)),t.instance.dispose()}removeDuplicateRequests(t){const e=new Map;for(const i of t){let r=e.get(i.correlationId);r||(r=new Map,e.set(i.correlationId,r));const s=this.pathToWatcherKey(i.path);r.has(s)&&this.trace(`ignoring a request for watching who's path is already watched: ${this.requestToString(i)}`),r.set(s,i)}return Array.from(e.values()).map(i=>Array.from(i.values())).flat()}async setVerboseLogging(t){super.setVerboseLogging(t);for(const e of this.watchers)e.instance.setVerboseLogging(t)}trace(t,e){this.verboseLogging&&this._onDidLogMessage.fire({type:"trace",message:this.toMessage(t,e)})}warn(t){this._onDidLogMessage.fire({type:"warn",message:this.toMessage(t)})}toMessage(t,e){return e?`[File Watcher (node.js)] ${t} (${this.requestToString(e.request)})`:`[File Watcher (node.js)] ${t}`}}}}),K5,wR=g({"out-build/vs/platform/files/node/watcher/nodejs/nodejsClient.js"(){"use strict";ga(),vR(),K5=class extends F5{constructor(t,e,i){super(t,e,i),this.init()}createWatcher(t){return t.add(new G5(void 0))}}}});import{promises as on}from"fs";var Ch,Y1=g({"out-build/vs/platform/files/node/diskFileSystemProvider.js"(){"use strict";ae(),ai(),it(),q(),Bi(),D1(),L(),ye(),z(),gt(),vc(),re(),qt(),we(),Ze(),B5(),iR(),uR(),wR(),Ch=class _u extends j5{static{this.TRACE_LOG_RESOURCE_LOCKS=!1}constructor(e,i){super(e,i),this.onDidChangeCapabilities=P.None,this.resourceLocks=new Bt(r=>rt.getComparisonKey(r)),this.mapHandleToPos=new Map,this.mapHandleToLock=new Map,this.writeHandles=new Map}get capabilities(){return this._capabilities||(this._capabilities=253982,Pe&&(this._capabilities|=1024)),this._capabilities}async stat(e){try{const{stat:i,symbolicLink:r}=await Vt.stat(this.toFilePath(e));return{type:this.toType(i,r),ctime:i.birthtime.getTime(),mtime:i.mtime.getTime(),size:i.size,permissions:(i.mode&128)===0?Yo.Locked:void 0}}catch(i){throw this.toFileSystemProviderError(i)}}async statIgnoreError(e){try{return await this.stat(e)}catch{return}}async realpath(e){try{const i=this.toFilePath(e),r=await mh(i);return x.file(r)}catch(i){throw this.toFileSystemProviderError(i)}}async readdir(e){try{const i=await te.readdir(this.toFilePath(e),{withFileTypes:!0}),r=[];return await Promise.all(i.map(async s=>{try{let n;s.isSymbolicLink()?n=(await this.stat(pe(e,s.name))).type:n=this.toType(s),r.push([s.name,n])}catch(n){this.logService.trace(n)}})),r}catch(i){throw this.toFileSystemProviderError(i)}}toType(e,i){let r;return i?.dangling?r=Ft.Unknown:e.isFile()?r=Ft.File:e.isDirectory()?r=Ft.Directory:r=Ft.Unknown,i&&(r|=Ft.SymbolicLink),r}async createResourceLock(e){const i=this.toFilePath(e);this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - request to acquire resource lock (${i})`);let r;for(;r=this.resourceLocks.get(e);)this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - waiting for resource lock to be released (${i})`),await r.wait();const s=new Tc;return this.resourceLocks.set(e,s),this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - new resource lock created (${i})`),me(()=>{this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock dispose() (${i})`),this.resourceLocks.get(e)===s&&(this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock removed from resource-lock map (${i})`),this.resourceLocks.delete(e)),this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock barrier open() (${i})`),s.open()})}async readFile(e,i){let r;try{i?.atomic&&(this.traceLock(`[Disk FileSystemProvider]: atomic read operation started (${this.toFilePath(e)})`),r=await this.createResourceLock(e));const s=this.toFilePath(e);return await on.readFile(s)}catch(s){throw this.toFileSystemProviderError(s)}finally{r?.dispose()}}traceLock(e){_u.TRACE_LOG_RESOURCE_LOCKS&&this.logService.trace(e)}readFileStream(e,i,r){const s=zu(n=>Y.concat(n.map(o=>Y.wrap(o))).buffer);return $5(this,e,s,n=>n.buffer,{...i,bufferSize:256*1024},r),s}async writeFile(e,i,r){return r?.atomic!==!1&&r?.atomic?.postfix&&await this.canWriteFileAtomic(e)?this.doWriteFileAtomic(e,pe(e_(e),`${Nr(e)}${r.atomic.postfix}`),i,r):this.doWriteFile(e,i,r)}async canWriteFileAtomic(e){try{const i=this.toFilePath(e),{symbolicLink:r}=await Vt.stat(i);if(r)return!1}catch{}return!0}async doWriteFileAtomic(e,i,r,s){const n=new ke;try{n.add(await this.createResourceLock(e)),n.add(await this.createResourceLock(i)),await this.doWriteFile(i,r,s,!0);try{await this.rename(i,e,{overwrite:!0})}catch(o){try{await this.delete(i,{recursive:!1,useTrash:!1,atomic:!1})}catch{}throw o}}finally{n.dispose()}}async doWriteFile(e,i,r,s){let n;try{const o=this.toFilePath(e);if(!r.create||!r.overwrite){if(await te.exists(o)){if(!r.overwrite)throw kr(w(2054,null),ce.FileExists)}else if(!r.create)throw kr(w(2055,null),ce.FileNotFound)}if(n=await this.open(e,{create:!0,unlock:r.unlock},s),await this.write(n,0,i,0,i.byteLength),o.endsWith(".cursor/mcp.json")&&!B)try{await on.chmod(o,384),this.logService.trace(`Set secure permissions on MCP config file: ${o}`)}catch(a){this.logService.error(`Failed to set secure permissions on MCP config file: ${o}`,a)}}catch(o){throw await this.toFileSystemProviderWriteError(e,o)}finally{typeof n=="number"&&await this.close(n)}}static{this.canFlush=!0}static configureFlushOnWrite(e){_u.canFlush=e}async open(e,i,r){const s=this.toFilePath(e);let n;Ko(i)&&!r&&(n=await this.createResourceLock(e));let o;try{if(Ko(i)&&i.unlock)try{const{stat:a}=await Vt.stat(s);a.mode&128||await on.chmod(s,a.mode|128)}catch(a){a.code!=="ENOENT"&&this.logService.trace(a)}if(B&&Ko(i))try{o=await te.open(s,"r+"),await te.ftruncate(o,0)}catch(a){if(a.code!=="ENOENT"&&this.logService.trace(a),typeof o=="number"){try{await te.close(o)}catch(c){this.logService.trace(c)}o=void 0}}typeof o!="number"&&(o=await te.open(s,Ko(i)?"w":"r"))}catch(a){throw n?.dispose(),Ko(i)?await this.toFileSystemProviderWriteError(e,a):this.toFileSystemProviderError(a)}if(this.mapHandleToPos.set(o,0),Ko(i)&&this.writeHandles.set(o,e),n){const a=this.mapHandleToLock.get(o);this.traceLock(`[Disk FileSystemProvider]: open() - storing lock for handle ${o} (${s})`),this.mapHandleToLock.set(o,n),a&&(this.traceLock(`[Disk FileSystemProvider]: open() - disposing a previous lock that was still stored on same handle ${o} (${s})`),a.dispose())}return o}async close(e){const i=this.mapHandleToLock.get(e);try{if(this.mapHandleToPos.delete(e),this.writeHandles.delete(e)&&_u.canFlush)try{await te.fdatasync(e)}catch(r){_u.configureFlushOnWrite(!1),this.logService.error(r)}return await te.close(e)}catch(r){throw this.toFileSystemProviderError(r)}finally{i&&(this.mapHandleToLock.get(e)===i&&(this.traceLock(`[Disk FileSystemProvider]: close() - resource lock removed from handle-lock map ${e}`),this.mapHandleToLock.delete(e)),this.traceLock(`[Disk FileSystemProvider]: close() - disposing lock for handle ${e}`),i.dispose())}}async read(e,i,r,s,n){const o=this.normalizePos(e,i);let a=null;try{a=(await te.read(e,r,s,n,o)).bytesRead}catch(c){throw this.toFileSystemProviderError(c)}finally{this.updatePos(e,o,a)}return a}normalizePos(e,i){return i===this.mapHandleToPos.get(e)?null:i}updatePos(e,i,r){const s=this.mapHandleToPos.get(e);typeof s=="number"&&(typeof i=="number"||(typeof r=="number"?this.mapHandleToPos.set(e,s+r):this.mapHandleToPos.delete(e)))}async write(e,i,r,s,n){return zC(()=>this.doWrite(e,i,r,s,n),100,3)}async doWrite(e,i,r,s,n){const o=this.normalizePos(e,i);let a=null;try{a=(await te.write(e,r,s,n,o)).bytesWritten}catch(c){throw await this.toFileSystemProviderWriteError(this.writeHandles.get(e),c)}finally{this.updatePos(e,o,a)}return a}async mkdir(e){try{await on.mkdir(this.toFilePath(e))}catch(i){throw this.toFileSystemProviderError(i)}}async delete(e,i){try{const r=this.toFilePath(e);if(i.recursive){let s;i?.atomic!==!1&&i.atomic.postfix&&(s=U(pt(r),`${tt(r)}${i.atomic.postfix}`)),await te.rm(r,Dn.MOVE,s)}else try{await on.unlink(r)}catch(s){if(s.code==="EPERM"||s.code==="EISDIR"){let n=!1;try{const{stat:o,symbolicLink:a}=await Vt.stat(r);n=o.isDirectory()&&!a}catch{}if(n)await on.rmdir(r);else throw s}else throw s}}catch(r){throw this.toFileSystemProviderError(r)}}async rename(e,i,r){const s=this.toFilePath(e),n=this.toFilePath(i);if(s!==n)try{await this.validateMoveCopy(e,i,"move",r.overwrite),await te.rename(s,n)}catch(o){throw(o.code==="EINVAL"||o.code==="EBUSY"||o.code==="ENAMETOOLONG")&&(o=new Error(w(2056,null,tt(s),tt(pt(n)),o.toString()))),this.toFileSystemProviderError(o)}}async copy(e,i,r){const s=this.toFilePath(e),n=this.toFilePath(i);if(s!==n)try{await this.validateMoveCopy(e,i,"copy",r.overwrite),await te.copy(s,n,{preserveSymlinks:!0})}catch(o){throw(o.code==="EINVAL"||o.code==="EBUSY"||o.code==="ENAMETOOLONG")&&(o=new Error(w(2057,null,tt(s),tt(pt(n)),o.toString()))),this.toFileSystemProviderError(o)}}async validateMoveCopy(e,i,r,s){const n=this.toFilePath(e),o=this.toFilePath(i);let a=!1;if(!!(this.capabilities&1024)||(a=Dc(n,o,!0)),a){if(r==="copy")throw kr(w(2058,null),ce.FileExists);if(r==="move")return}const l=await this.statIgnoreError(e);if(!l)throw kr(w(2059,null),ce.FileNotFound);const u=await this.statIgnoreError(i);if(u){if(!s)throw kr(w(2060,null),ce.FileExists);(l.type&Ft.File)!==0&&(u.type&Ft.File)!==0||await this.delete(i,{recursive:!0,useTrash:!1,atomic:!1})}}async cloneFile(e,i){return this.doCloneFile(e,i,!1)}async doCloneFile(e,i,r){const s=this.toFilePath(e),n=this.toFilePath(i),o=!!(this.capabilities&1024);if(Dc(s,n,!o))return;const a=new ke;try{a.add(await this.createResourceLock(e)),a.add(await this.createResourceLock(i)),r&&await on.mkdir(pt(n),{recursive:!0}),await on.copyFile(s,n)}catch(c){if(c.code==="ENOENT"&&!r)return this.doCloneFile(e,i,!0);throw this.toFileSystemProviderError(c)}finally{a.dispose()}}createUniversalWatcher(e,i,r){return new V5(s=>e(s),s=>i(s),r)}createNonRecursiveWatcher(e,i,r){return new K5(s=>e(s),s=>i(s),r)}toFileSystemProviderError(e){if(e instanceof Pd)return e;let i=e,r;switch(e.code){case"ENOENT":r=ce.FileNotFound;break;case"EISDIR":r=ce.FileIsADirectory;break;case"ENOTDIR":r=ce.FileNotADirectory;break;case"EEXIST":r=ce.FileExists;break;case"EPERM":case"EACCES":r=ce.NoPermissions;break;case"ERR_UNC_HOST_NOT_ALLOWED":i=`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`,r=ce.Unknown;break;default:r=ce.Unknown}return kr(i,r)}async toFileSystemProviderWriteError(e,i){let r=this.toFileSystemProviderError(i);if(e&&r.code===ce.NoPermissions)try{const{stat:s}=await Vt.stat(this.toFilePath(e));s.mode&128||(r=kr(i,ce.FileWriteLocked))}catch(s){this.logService.trace(s)}return r}}}}),Y5,J5,yR=g({"out-build/vs/platform/files/node/diskFileSystemProviderServer.js"(){"use strict";q(),Y1(),L(),it(),vc(),St(),Y5=class extends N{constructor(t,e){super(),this.provider=t,this.logService=e,this.sessionToWatcher=new Map,this.watchRequests=new Map}call(t,e,i){const r=this.getUriTransformer(t);switch(e){case"stat":return this.stat(r,i[0]);case"readdir":return this.readdir(r,i[0]);case"realpath":return this.realpath(r,i[0]);case"open":return this.open(r,i[0],i[1]);case"close":return this.close(i[0]);case"read":return this.read(i[0],i[1],i[2]);case"readFile":return this.readFile(r,i[0],i[1]);case"write":return this.write(i[0],i[1],i[2],i[3],i[4]);case"writeFile":return this.writeFile(r,i[0],i[1],i[2]);case"rename":return this.rename(r,i[0],i[1],i[2]);case"copy":return this.copy(r,i[0],i[1],i[2]);case"cloneFile":return this.cloneFile(r,i[0],i[1]);case"mkdir":return this.mkdir(r,i[0]);case"delete":return this.delete(r,i[0],i[1]);case"watch":return this.watch(r,i[0],i[1],i[2],i[3]);case"unwatch":return this.unwatch(i[0],i[1])}throw new Error(`IPC Command ${e} not found`)}listen(t,e,i){const r=this.getUriTransformer(t);switch(e){case"fileChange":return this.onFileChange(r,i[0]);case"readFileStream":return this.onReadFileStream(r,i[0],i[1])}throw new Error(`Unknown event ${e}`)}stat(t,e){const i=this.transformIncoming(t,e,!0);return this.provider.stat(i)}readdir(t,e){const i=this.transformIncoming(t,e);return this.provider.readdir(i)}async realpath(t,e){const i=this.transformIncoming(t,e),r=await this.provider.realpath(i);return t.transformOutgoingURI(r)}async readFile(t,e,i){const r=this.transformIncoming(t,e,!0),s=await this.provider.readFile(r,i);return Y.wrap(s)}onReadFileStream(t,e,i){const r=this.transformIncoming(t,e,!0),s=new Sr,n=new D({onDidRemoveLastListener:()=>{s.cancel()}}),o=this.provider.readFileStream(r,i,s.token);return Gu(o,{onData:a=>n.fire(Y.wrap(a)),onError:a=>n.fire(a),onEnd:()=>{n.fire("end"),n.dispose(),s.dispose()}}),n.event}writeFile(t,e,i,r){const s=this.transformIncoming(t,e);return this.provider.writeFile(s,i.buffer,r)}open(t,e,i){const r=this.transformIncoming(t,e,!0);return this.provider.open(r,i)}close(t){return this.provider.close(t)}async read(t,e,i){const r=Y.alloc(i),n=await this.provider.read(t,e,r.buffer,0,i);return[r,n]}write(t,e,i,r,s){return this.provider.write(t,e,i.buffer,r,s)}mkdir(t,e){const i=this.transformIncoming(t,e);return this.provider.mkdir(i)}delete(t,e,i){const r=this.transformIncoming(t,e);return this.provider.delete(r,i)}rename(t,e,i,r){const s=this.transformIncoming(t,e),n=this.transformIncoming(t,i);return this.provider.rename(s,n,r)}copy(t,e,i,r){const s=this.transformIncoming(t,e),n=this.transformIncoming(t,i);return this.provider.copy(s,n,r)}cloneFile(t,e,i){const r=this.transformIncoming(t,e),s=this.transformIncoming(t,i);return this.provider.cloneFile(r,s)}onFileChange(t,e){const i=new D({onWillAddFirstListener:()=>{this.sessionToWatcher.set(e,this.createSessionFileWatcher(t,i))},onDidRemoveLastListener:()=>{Rt(this.sessionToWatcher.get(e)),this.sessionToWatcher.delete(e)}});return i.event}async watch(t,e,i,r,s){const n=this.sessionToWatcher.get(e);if(n){const o=this.transformIncoming(t,r),a=n.watch(i,o,s);this.watchRequests.set(e+i,a)}}async unwatch(t,e){const i=t+e,r=this.watchRequests.get(i);r&&(Rt(r),this.watchRequests.delete(i))}dispose(){super.dispose();for(const[,t]of this.watchRequests)t.dispose();this.watchRequests.clear();for(const[,t]of this.sessionToWatcher)t.dispose();this.sessionToWatcher.clear()}},J5=class extends N{constructor(t,e,i,r){super(),this.uriTransformer=t,this.environmentService=r,this.watcherRequests=new Map,this.fileWatcher=this._register(new Ch(i)),this.registerListeners(e)}registerListeners(t){const e=this._register(new D);this._register(e.event(i=>{t.fire(i.map(r=>({resource:this.uriTransformer.transformOutgoingURI(r.resource),type:r.type,cId:r.cId})))})),this._register(this.fileWatcher.onDidChangeFile(i=>e.fire(i))),this._register(this.fileWatcher.onDidWatchError(i=>t.fire(i)))}getRecursiveWatcherOptions(t){}getExtraExcludes(t){}watch(t,e,i){const r=this.getExtraExcludes(this.environmentService);return Array.isArray(r)&&(i.excludes=[...i.excludes,...r]),this.watcherRequests.set(t,this.fileWatcher.watch(e,i)),me(()=>{Rt(this.watcherRequests.get(t)),this.watcherRequests.delete(t)})}dispose(){for(const[,t]of this.watcherRequests)t.dispose();this.watcherRequests.clear(),super.dispose()}}}}),Q5,SR=g({"out-build/vs/base/common/uriIpc.js"(){"use strict";it(),re(),Q5=new class{transformIncoming(t){return t}transformOutgoing(t){return t}transformOutgoingURI(t){return t}transformOutgoingScheme(t){return t}}}});import{shell as _R}from"electron";var X5,Z5,bR=g({"out-build/vs/platform/files/electron-main/diskFileSystemProviderServer.js"(){"use strict";we(),z(),re(),Ze(),ye(),yR(),SR(),In(),X5=class extends Y5{constructor(t,e,i){super(t,e),this.environmentService=i}getUriTransformer(t){return Q5}transformIncoming(t,e){return x.revive(e)}async delete(t,e,i){if(!i.useTrash)return super.delete(t,e,i);const r=this.transformIncoming(t,e),s=bi(r.fsPath);try{await _R.trashItem(s)}catch(n){throw kr(w(B?2052:2053,null,tt(s),rr(n)),ce.Unknown)}}createSessionFileWatcher(t,e){return new Z5(t,e,this.logService,this.environmentService)}},Z5=class extends J5{watch(t,e,i){if(i.recursive)throw kr("Recursive file watching is not supported from main process for performance reasons.",ce.Unavailable);return super.watch(t,e,i)}}}}),se,Ih=g({"out-build/vs/platform/instantiation/common/descriptors.js"(){"use strict";se=class{constructor(t,e=[],i=!1){this.ctor=t,this.staticArguments=e,this.supportsDelayedInstantiation=i}}}}),Dh,J1=g({"out-build/vs/platform/instantiation/common/serviceCollection.js"(){"use strict";Dh=class{constructor(...t){this._entries=new Map;for(const[e,i]of t)this.set(e,i)}set(t,e){const i=this._entries.get(t);return this._entries.set(t,e),i}has(t){return this._entries.has(t)}get(t){return this._entries.get(t)}}}}),eE,Q1,ER=g({"out-build/vs/platform/process/common/process.js"(){"use strict";G(),(function(t){t.VSCode="vscode",t.Extension="extension",t.Marketplace="marketplace"})(eE||(eE={})),Q1=j("processService")}});import{exec as Ah}from"child_process";function X1(t){return new Promise((e,i)=>{let r;const s=new Map;function n(c,l,u,d,f){const p=s.get(l);if(c===t||p){const v={name:o(u),cmd:u,pid:c,ppid:l,load:d,mem:f};s.set(c,v),c===t&&(r=v),p&&(p.children||(p.children=[]),p.children.push(v),p.children.length>1&&(p.children=p.children.sort((m,y)=>m.pid-y.pid)))}}function o(c){const l=/--utility-sub-type=network/i,u=/--crashes-directory/i,d=/\\pipe\\winpty-control/i,f=/conhost\.exe.+--headless/i,p=/--type=([a-zA-Z-]+)/;if(u.exec(c))return"electron-crash-reporter";if(d.exec(c))return"winpty-agent";if(f.exec(c))return"conpty-agent";let v=p.exec(c);if(v&&v.length===2)return v[1]==="renderer"?"window":v[1]==="utility"?l.exec(c)?"utility-network-service":"utility-process":v[1]==="extensionHost"?"extension-host":v[1];const m=/[a-zA-Z-]+\.js/g;let y="";do v=m.exec(c),v&&(y+=v+" ");while(v);return y&&c.indexOf("node ")<0&&c.indexOf("node.exe")<0?`electron-nodejs (${y})`:c}if(process.platform==="win32"){const c=l=>l.indexOf("\\\\?\\")===0||l.indexOf("\\??\\")===0?l.substring(4):l.indexOf('"\\\\?\\')===0||l.indexOf('"\\??\\')===0?'"'+l.substring(5):l;import("@vscode/windows-process-tree").then(l=>{l.getProcessList(t,u=>{if(!u){i(new Error(`Root process ${t} not found`));return}l.getProcessCpuUsage(u,d=>{const f=new Map;d.forEach(p=>{const v=c(p.commandLine||"");f.set(p.pid,{name:o(v),cmd:v,pid:p.pid,ppid:p.ppid,load:p.cpu||0,mem:p.memory||0})}),r=f.get(t),r?(f.forEach(p=>{const v=f.get(p.ppid);v&&(v.children||(v.children=[]),v.children.push(p))}),f.forEach(p=>{p.children&&(p.children=p.children.sort((v,m)=>v.pid-m.pid))}),e(r)):i(new Error(`Root process ${t} not found`))})},l.ProcessDataFlag.CommandLine|l.ProcessDataFlag.Memory)})}else{let c=function(){let l=[r];const u=[];for(;l.length;){const f=l.shift();f&&(u.push(f.pid),f.children&&(l=l.concat(f.children)))}let d=JSON.stringify(Ct.asFileUri("vs/base/node/cpuUsage.sh").fsPath);d+=" "+u.join(" "),Ah(d,{},(f,p,v)=>{if(f||v)i(f||new Error(v.toString()));else{const m=p.toString().split(`
|
|
`);for(let y=0;y<u.length;y++){const S=s.get(u[y]);S.load=parseFloat(m[y])}if(!r){i(new Error(`Root process ${t} not found`));return}e(r)}})};var a=c;Ah("which ps",{},(l,u,d)=>{if(l||d)if(process.platform!=="linux")i(l||new Error(d.toString()));else{const f=JSON.stringify(Ct.asFileUri("vs/base/node/ps.sh").fsPath);Ah(f,{},(p,v,m)=>{p||m?i(p||new Error(m.toString())):(tE(v,n),c())})}else{const f=u.toString().trim();Ah(`${f} -ax -o pid=,ppid=,pcpu=,pmem=,command=`,{maxBuffer:1e3*1024,env:{LC_NUMERIC:"en_US.UTF-8"}},(v,m,y)=>{v||y&&!y.includes("screen size is bogus")?i(v||new Error(y.toString())):(tE(m,n),process.platform==="linux"?c():r?e(r):i(new Error(`Root process ${t} not found`)))})}})}})}function tE(t,e){const i=/^\s*([0-9]+)\s+([0-9]+)\s+([0-9]+\.[0-9]+)\s+([0-9]+\.[0-9]+)\s+(.+)$/,r=t.toString().split(`
|
|
`);for(const s of r){const n=i.exec(s.trim());n&&n.length===6&&e(parseInt(n[1]),parseInt(n[2]),n[5],parseFloat(n[3]),parseFloat(n[4]))}}var iE=g({"out-build/vs/base/node/ps.js"(){"use strict";Ie()}}),qi,Rh,Qr,Sl=g({"out-build/vs/platform/product/common/product.js"(){"use strict";if(Wr(),Rh=globalThis.vscode,typeof Rh<"u"&&typeof Rh.context<"u"){const t=Rh.context.configuration();if(t)qi=t.product;else throw new Error("Sandbox: unable to resolve product configuration from preload script.")}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(qi=globalThis._VSCODE_PRODUCT_JSON,er.VSCODE_DEV,er.VSCODE_DEV_ONBOARDING&&Object.assign(qi,{nameShort:`${qi.nameShort} Onboarding`,nameLong:`${qi.nameLong} Onboarding`,dataFolderName:`${qi.dataFolderName}-onboarding`,serverDataFolderName:qi.serverDataFolderName?`${qi.serverDataFolderName}-onboarding`:void 0}),!qi.version){const t=globalThis._VSCODE_PACKAGE_JSON;Object.assign(qi,{version:t.version})}}else qi={},Object.keys(qi).length===0&&Object.assign(qi,{version:"1.94.0-dev",nameShort:"Cursor Dev",nameLong:"Cursor Dev",applicationName:"cursor",dataFolderName:".cursor",urlProtocol:"cursor",reportIssueUrl:"https://github.com/getcursor/cursor/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/getcursor/cursor/",serverLicenseUrl:"https://github.com/getcursor/cursor/"});Qr=qi}}),va,_l=g({"out-build/vs/platform/protocol/electron-main/protocol.js"(){"use strict";G(),va=j("protocolMainService")}});function an(t){if(!t)return;const e=t.split("+");if(e.length<2)return;const i=e[0];if(!i||i!=="background-composer")return;const r=e[1];if(r&&!(!r.startsWith("bc-")&&!r.startsWith("pod-")))return r}var Mh=g({"out-build/vs/base/common/bcIdFromAuthority.js"(){"use strict"}});import{BrowserWindow as Th,contentTracing as bl,screen as El}from"electron";function rE(t,e,i){if(!t||!e?.size)return!1;if(typeof t.pid=="number"&&e.has(t.pid))return t.children||(t.children=[]),i.name="remote agent",sE(i),t.children.push(i),!0;if(Array.isArray(t.children)){for(const r of t.children)if(rE(r,e,i))return!0}return!1}function sE(t){if(t.isRemote=!0,typeof t.mem=="number"&&(t.remoteMem=t.mem,t.mem=0),Array.isArray(t.children))for(const e of t.children)sE(e)}function kR(t){return typeof t!="object"||t===null?!1:"x"in t&&"y"in t&&"width"in t&&"height"in t}var Z1,ev,nE,Wh,PR=g({"out-build/vs/platform/process/electron-main/processMainService.js"(){"use strict";Bi(),L(),Ie(),z(),iE(),nr(),we(),g1(),$2(),Vn(),ct(),ua(),K(),Yn(),Sl(),lt(),_l(),Vi(),oa(),ks(),Mh(),ut(),ev="issue.processExplorerWindowState",nE=/bc-[a-f0-9\-]{8,}/i,Wh=class{static{Z1=this}static{this.DEFAULT_BACKGROUND_COLOR="#1E1E1E"}constructor(e,i,r,s,n,o,a,c,l,u,d,f){this.userEnv=e,this.environmentMainService=i,this.logService=r,this.diagnosticsService=s,this.diagnosticsMainService=n,this.dialogMainService=o,this.nativeHostMainService=a,this.protocolMainService=c,this.productService=l,this.stateService=u,this.cssDevelopmentService=d,this.windowsMainService=f,this.processExplorerWindow=null,this.processExplorerParentWindow=null,this.isProfiling=!1,this.registerListeners()}registerListeners(){We.on("vscode:listProcesses",async e=>{const i=[];try{i.push({name:w(2165,null),rootProcess:await X1(process.pid)});const r=await this.diagnosticsMainService.getMainDiagnostics(),s=await this.diagnosticsMainService.getRemoteDiagnostics({includeProcesses:!0}),n=new Map;for(const a of r.windows){const c=an(a.remoteAuthority);c&&(n.has(c)||n.set(c,[]),n.get(c).push(a.pid))}for(const a of this.windowsMainService.getWindows()){const c=a.browserView;if(c?.webContents&&!c.webContents.isDestroyed()){const l=c.webContents.getOSProcessId(),u=an(a.remoteAuthority);u&&(n.has(u)||n.set(u,[]),n.get(u).push(l))}}const o=i[0]?.rootProcess;s.forEach(a=>{if(f1(a)){this.logService.info(`[ProcessExplorer] Remote diagnostic error: ${a.hostName}`),i.push({name:a.hostName,rootProcess:a});return}const c=a.hostName?nE.exec(a.hostName):null;if(c&&a.processes){const l=c[0],u=n.get(l);let d=!1;o&&u?.length&&(d=rE(o,new Set(u),a.processes)),d||i.push({name:a.hostName,rootProcess:a.processes})}else a.processes&&i.push({name:a.hostName,rootProcess:a.processes})})}catch(r){this.logService.error(`Listing processes failed: ${r}`)}this.safeSend(e,"vscode:listProcessesResponse",i)}),We.on("vscode:workbenchCommand",(e,i)=>{const{id:r,from:s,args:n}=i;if(r==="workbench.action.openDevToolsForBgWindow"&&s==="processExplorer"){this.openDevToolsForPid(n[0]?.pid);return}let o;switch(s){case"processExplorer":o=this.processExplorerParentWindow;break;default:throw new Error(`Unexpected command source: ${s}`)}o?.webContents.send("vscode:runAction",{id:r,from:s,args:n})}),We.on("vscode:closeProcessExplorer",e=>{this.processExplorerWindow?.close()}),We.on("vscode:pidToNameRequest",async e=>{const i=await this.diagnosticsMainService.getMainDiagnostics(),r=[];for(const s of i.windows){const n=an(s.remoteAuthority);n?r.push([s.pid,`bg-window (${n})`]):r.push([s.pid,`window [${s.id}] (${s.title})`])}for(const s of this.windowsMainService.getWindows()){const n=s.browserView;if(n?.webContents&&!n.webContents.isDestroyed()){const o=n.webContents.getOSProcessId();if(!r.find(([a])=>a===o)){const a=an(s.remoteAuthority);r.push([o,a?`bg-window (${a})`:"bg-window"])}}}for(const{pid:s,name:n}of sn.getAll())r.push([s,n]);this.safeSend(e,"vscode:pidToNameResponse",r)})}async openProcessExplorer(e){if(!this.processExplorerWindow&&(this.processExplorerParentWindow=Th.getFocusedWindow(),this.processExplorerParentWindow)){const i=new ke,r=i.add(this.protocolMainService.createIPCObjectUrl()),s=this.stateService.getItem(ev,void 0),n=kR(s)?s:this.getWindowPosition(this.processExplorerParentWindow,800,500);this.processExplorerWindow=this.createBrowserWindow(n,r,{backgroundColor:e.styles.backgroundColor,title:w(2166,null),zoomLevel:e.zoomLevel,alwaysOnTop:!0},"process-explorer"),r.update({appRoot:this.environmentMainService.appRoot,windowId:this.processExplorerWindow.id,userEnv:this.userEnv,data:e,product:Qr,nls:{messages:Iu(),language:Za()},cssModules:this.cssDevelopmentService.isEnabled?await this.cssDevelopmentService.getCssModules():void 0}),this.processExplorerWindow.loadURL(Ct.asBrowserUri(`vs/code/electron-sandbox/processExplorer/processExplorer${this.environmentMainService.isBuilt?"":"-dev"}.html`).toString(!0)),this.processExplorerWindow.on("close",()=>{this.processExplorerWindow=null,i.dispose()}),this.processExplorerParentWindow.on("close",()=>{this.processExplorerWindow&&(this.processExplorerWindow.close(),this.processExplorerWindow=null,i.dispose())});const o=()=>{if(!this.processExplorerWindow)return;const a=this.processExplorerWindow.getSize(),c=this.processExplorerWindow.getPosition();if(!a||!c)return;const l={width:a[0],height:a[1],x:c[0],y:c[1]};this.stateService.setItem(ev,l)};this.processExplorerWindow.on("moved",o),this.processExplorerWindow.on("resized",o)}this.processExplorerWindow&&this.focusWindow(this.processExplorerWindow)}focusWindow(e){e.isMinimized()&&e.restore(),e.focus()}getWindowPosition(e,i,r){let s;const n=El.getAllDisplays();if(n.length===1)s=n[0];else{if(O){const c=El.getCursorScreenPoint();s=El.getDisplayNearestPoint(c)}!s&&e&&(s=El.getDisplayMatching(e.getBounds())),s||(s=El.getPrimaryDisplay()||n[0])}const o=s.bounds,a={width:i,height:r,x:o.x+o.width/2-i/2,y:o.y+o.height/2-r/2};return o.width>0&&o.height>0&&(a.x<o.x&&(a.x=o.x),a.y<o.y&&(a.y=o.y),a.x>o.x+o.width&&(a.x=o.x),a.y>o.y+o.height&&(a.y=o.y),a.width>o.width&&(a.width=o.width),a.height>o.height&&(a.height=o.height)),a}async isProfilerRunning(){return this.isProfiling}async startProfilerCPU(){if(this.isProfiling)return;this.isProfiling=!0;const e=this.environmentMainService.args,i={categoryFilter:e["trace-category-filter"]||"-*,disabled-by-default-v8.cpu_profile*",traceOptions:e["trace-options"]||"record-until-full,enable-sampling"};await bl.startRecording(i)}async startProfilerMemory(){if(this.isProfiling)return;this.isProfiling=!0;const i=this.environmentMainService.args["trace-category-filter"]?.split(",")||[];i.push("disabled-by-default-memory-infra","disabled-by-default-memory-infra.v8.code_stats");const r={included_categories:i,excluded_categories:["*"],memory_dump_config:{allowed_dump_modes:["light","detailed"],triggers:[{type:"periodic_interval",mode:"detailed",min_time_between_dumps_ms:1e4},{type:"periodic_interval",mode:"light",min_time_between_dumps_ms:1e3}]}};await bl.startRecording(r)}async startProfilerGC(){if(this.isProfiling)return;this.isProfiling=!0;const e=this.environmentMainService.args,i={categoryFilter:e["trace-category-filter"]||"-*,disabled-by-default-v8.gc_stats",traceOptions:e["trace-options"]||"record-until-full,enable-sampling"};await bl.startRecording(i)}async stopProfiler(){if(!this.isProfiling)return;this.isProfiling=!1;const e=`${Rc(this.environmentMainService.userHome.fsPath,this.productService.applicationName)}-${this.productService.commit??"dev"}.profile.txt`,i=await bl.stopRecording(e);this.nativeHostMainService.showItemInFolder(void 0,i)}async stopTracing(){if(!this.environmentMainService.args.trace)return;const e=await bl.stopRecording(`${Rc(this.environmentMainService.userHome.fsPath,this.productService.applicationName)}.trace.txt`);await this.dialogMainService.showMessageBox({type:"info",message:w(2167,null),detail:w(2168,null,e),buttons:[w(2169,null)]},Th.getFocusedWindow()??void 0),this.nativeHostMainService.showItemInFolder(void 0,e)}async getSystemStatus(){const[e,i]=await Promise.all([this.diagnosticsMainService.getMainDiagnostics(),this.diagnosticsMainService.getRemoteDiagnostics({includeProcesses:!1,includeWorkspaceMetadata:!1})]);return this.diagnosticsService.getDiagnostics(e,i)}async $getSystemInfo(){const[e,i]=await Promise.all([this.diagnosticsMainService.getMainDiagnostics(),this.diagnosticsMainService.getRemoteDiagnostics({includeProcesses:!1,includeWorkspaceMetadata:!1})]);return await this.diagnosticsService.getSystemInfo(e,i)}async $getPerformanceInfo(){try{const[e,i]=await Promise.all([this.diagnosticsMainService.getMainDiagnostics(),this.diagnosticsMainService.getRemoteDiagnostics({includeProcesses:!0,includeWorkspaceMetadata:!0})]);return await this.diagnosticsService.getPerformanceInfo(e,i)}catch(e){throw this.logService.warn("issueService#getPerformanceInfo ",e.message),e}}createBrowserWindow(e,i,r,s){const n={fullscreen:!1,skipTaskbar:!1,resizable:!0,width:e.width,height:e.height,minWidth:300,minHeight:200,x:e.x,y:e.y,title:r.title,backgroundColor:r.backgroundColor||Z1.DEFAULT_BACKGROUND_COLOR,webPreferences:{preload:Ct.asFileUri("vs/base/parts/sandbox/electron-sandbox/preload.js").fsPath,additionalArguments:[`--vscode-window-config=${i.resource.toString()}`],v8CacheOptions:this.environmentMainService.useCodeCache?"bypassHeatCheck":"none",enableWebSQL:!1,spellcheck:!1,zoomFactor:Nm(r.zoomLevel),sandbox:!0},alwaysOnTop:r.alwaysOnTop,experimentalDarkMode:!0},o=new Th(n);return o.setMenuBarVisibility(!1),o}safeSend(e,i,...r){e.sender.isDestroyed()||e.sender.send(i,...r)}async closeProcessExplorer(){this.processExplorerWindow?.close()}openDevToolsForPid(e){if(e){for(const i of Th.getAllWindows())if(i.webContents&&!i.webContents.isDestroyed()&&i.webContents.getOSProcessId()===e){i.webContents.openDevTools();return}for(const i of this.windowsMainService.getWindows()){const r=i.browserView;if(r?.webContents&&!r.webContents.isDestroyed()&&r.webContents.getOSProcessId()===e){r.webContents.openDevTools();return}}this.logService.warn(`[ProcessExplorer] Could not find window or view with PID ${e} to open devtools`)}}},Wh=Z1=__decorate([__param(1,st),__param(2,V),__param(3,p1),__param(4,ch),__param(5,Is),__param(6,Jr),__param(7,va),__param(8,qe),__param(9,Ii),__param(10,Gn),__param(11,ot)],Wh)}}),Lh,oE=g({"out-build/vs/platform/processExecution/common/processExecutionService.js"(){"use strict";G(),Lh=j("processExecutionService")}});function aE(t,e,i){e instanceof se||(e=new se(e,[],!!i)),cE.push([t,e])}var cE,lE,uE=g({"out-build/vs/platform/instantiation/common/extensions.js"(){"use strict";Ih(),cE=[],(function(t){t[t.Eager=0]="Eager",t[t.Delayed=1]="Delayed"})(lE||(lE={}))}});import{spawn as xR}from"child_process";var tv,CR=g({"out-build/vs/platform/processExecution/node/processExecutionMainService.js"(){"use strict";oE(),uE(),tv=class{async executeCommand(t,e,i){return new Promise((r,s)=>{const n=i?.timeout??3e4;let o="",a="";const c=xR(t,e,{cwd:i?.cwd,env:i?.env?{...process.env,...i.env}:process.env,stdio:["pipe","pipe","pipe"]}),l=setTimeout(()=>{c.kill("SIGTERM"),s(new Error(`Process timed out after ${n}ms`))},n);i?.input&&c.stdin&&(c.stdin.write(i.input),c.stdin.end()),c.stdout?.on("data",u=>{o+=u.toString()}),c.stderr?.on("data",u=>{a+=u.toString()}),c.on("error",u=>{clearTimeout(l),s(u)}),c.on("close",u=>{clearTimeout(l),r({exitCode:u,stdout:o,stderr:a})})})}},aE(Lh,tv,1)}}),dE,iv,IR=g({"out-build/vs/platform/extensions/common/extensionMonitor.js"(){"use strict";G(),(function(t){t.VSCode="vscode",t.Extension="extension",t.Marketplace="marketplace"})(dE||(dE={})),iv=j("extensionMonitorMainService")}}),rv,hE,fE,DR=g({"out-build/vs/platform/profiling/common/profilingModel.js"(){"use strict";rv=(t,e)=>{const i=e[t];if(i.aggregateTime)return i.aggregateTime;let r=i.selfTime;for(const s of i.children)r+=rv(s,e);return i.aggregateTime=r},hE=t=>{let e=0;const i=new Map,r=s=>{const n=[s.functionName,s.url,s.scriptId,s.lineNumber,s.columnNumber].join(":"),o=i.get(n);if(o)return o.id;const a=e++;return i.set(n,{id:a,callFrame:s,location:{lineNumber:s.lineNumber+1,columnNumber:s.columnNumber+1}}),a};for(const s of t.nodes)s.locationId=r(s.callFrame),s.positionTicks=s.positionTicks?.map(n=>({...n,startLocationId:r({...s.callFrame,lineNumber:n.line-1,columnNumber:0}),endLocationId:r({...s.callFrame,lineNumber:n.line,columnNumber:0})}));return[...i.values()].sort((s,n)=>s.id-n.id).map(s=>({locations:[s.location],callFrame:s.callFrame}))},fE=t=>{if(!t.timeDeltas||!t.samples)return{nodes:[],locations:[],samples:t.samples||[],timeDeltas:t.timeDeltas||[],duration:t.endTime-t.startTime};const{samples:e,timeDeltas:i}=t,s=hE(t).map((u,d)=>{const f=u.locations[0];return{id:d,selfTime:0,aggregateTime:0,ticks:0,callFrame:u.callFrame,src:f}}),n=new Map,o=u=>{let d=n.get(u);return d===void 0&&(d=n.size,n.set(u,d)),d},a=new Array(t.nodes.length);for(let u=0;u<t.nodes.length;u++){const d=t.nodes[u],f=o(d.id);a[f]={id:f,selfTime:0,aggregateTime:0,locationId:d.locationId,children:d.children?.map(o)||[]};for(const p of d.positionTicks||[])p.startLocationId&&(s[p.startLocationId].ticks+=p.ticks)}for(const u of a)for(const d of u.children)a[d].parent=u.id;const c=t.endTime-t.startTime;let l=c-i[0];for(let u=0;u<i.length-1;u++){const d=i[u+1];a[o(e[u])].selfTime+=d,l-=d}a.length&&(a[o(e[i.length-1])].selfTime+=l,i.push(l));for(let u=0;u<a.length;u++){const d=a[u],f=s[d.locationId];f.aggregateTime+=rv(u,a),f.selfTime+=d.selfTime}return{nodes:a,locations:s,samples:e.map(o),timeDeltas:i,duration:c}}}});import{WebSocket as AR}from"ws";import{cpus as RR}from"os";var sv,wa,pE=g({"out-build/vs/platform/continuousProfiling/electron-main/extHostContinuousProfilingService.js"(){"use strict";St(),xe(),K(),DR(),Rs(),wa=class{static{sv=this}static{this.WEBSOCKET_TIMEOUT_MS=5e3}constructor(e,i,r,s){this.logService=e,this.requestService=i,this._targets=r,this._getExtensionIdFromPath=s,this._cpuCoreCount=RR().length,this._extHostConnections=new Map,this._nextRequestId=1,this._pendingRequestsByExtHost=new Map,this._isProfiling=!1}async start(){this._isProfiling||(this._extHostConnections.clear(),await Promise.all(this._targets.map(async({extensionHostId:e,webSocketPort:i})=>{const r=await this._discoverDebugUrl(i);if(Co(r)){const s=new AR(r);this._extHostConnections.set(e,{webSocket:s,profilerState:{cpuProfilerRunning:!1,heapProfilerRunning:!1}}),this._registerSocketListeners(e)}})),this._isProfiling=!0)}async stop(){if(!this._isProfiling)return;const e=Array.from(this._extHostConnections.entries());await Promise.all(e.map(async([i,{webSocket:r,profilerState:s}])=>{const[n,o]=await Promise.allSettled([this._stopCPUProfiler(i),this._stopHeapProfiler(i)]);s.cpuProfilerRunning=!1,s.heapProfilerRunning=!1,n.status==="rejected"&&this.logService.error(`[ExtHostContinuousProfilingService] Error stopping CPU profiler for ${r.url}: ${n.reason}`),o.status==="rejected"&&this.logService.error(`[ExtHostContinuousProfilingService] Error stopping heap profiler for ${r.url}: ${o.reason}`)})),e.forEach(([i,{webSocket:r}])=>{r.close()}),this._isProfiling=!1}async captureMetricsForAllHosts(){if(!this._isProfiling)throw new Error("Profiling is not enabled");const i=Array.from(this._extHostConnections.entries()).map(async([n,{profilerState:o}])=>{const a=await this._captureHostMetrics(n,o);return{extensionHostId:n,metricsByExtension:a}}),r=await Promise.all(i),s={};return r.forEach(({extensionHostId:n,metricsByExtension:o})=>{s[n]=o}),s}getProfilerStatus(){const e={};return this._extHostConnections.forEach((i,r)=>{e[r]={...i.profilerState}}),e}async _registerSocketListeners(e){const i=this._extHostConnections.get(e);if(!i)throw new Error(`Connection not found for extension host ${e}`);const{webSocket:r}=i;r.addEventListener("open",s=>{this._setUpProfilers(e).catch(n=>{this.logService.error(`[ExtHostContinuousProfilingService] Failed to setup profilers for ${r.url}: ${n}`)})}),r.addEventListener("message",s=>{this._handleMessage(s)}),r.addEventListener("error",s=>{this.logService.error(`[ExtHostContinuousProfilingService] Error communicating with '${r.url}': ${s}`)}),r.addEventListener("close",s=>{this.logService.info(`[ExtHostContinuousProfilingService] WebSocket closed for ${r.url}`),this._extHostConnections.delete(e),this._cleanUpPendingRequests(e)})}async _captureHostMetrics(e,i){let r=new Map,s=new Map,n=0,o=0;if(i.cpuProfilerRunning){let c=null;try{c=await this._captureCPUProfile(e)}catch(l){this.logService.error(`[ExtHostContinuousProfilingService] Failed to capture CPU profile for ${e}: ${l}. Marking CPU profiler as broken.`),i.cpuProfilerRunning=!1}if(c){const l=this._computeCPUTimes(c,e);r=l.timeByExtension,n=l.totalExtHostTime,o=l.cpuProfileDuration}}if(i.heapProfilerRunning){let c=null;try{c=await this._captureMemoryProfile(e)}catch(l){this.logService.error(`[ExtHostContinuousProfilingService] Failed to capture memory profile for ${e}: ${l}. Marking memory profiler as broken.`),i.heapProfilerRunning=!1}c&&(s=await this._computeMemoryAllocations(c.head,e))}const a=new Set([...r.keys(),...s.keys()]);return this._buildMetricsByExtension(Array.from(a),n,o,r,s)}async _buildMetricsByExtension(e,i,r,s,n){return Object.fromEntries(e.map(o=>{let a={};const c=s.get(o);c&&i>0&&(a.pctExtHost=Math.round(c.totalTime/i*1e4)/100,r>0&&(a.pctCPU=Math.round(c.totalTime/(r*this._cpuCoreCount)*1e4)/100),a.maxBlockingTime=c.maxBlockingTime);const l=n.get(o);return l&&(a.memKB=l/1024),[o,a]}))}async _captureCPUProfile(e){const i=await this._sendCommand(e,"Profiler.stop");return await this._sendCommand(e,"Profiler.start"),fE(i.profile)}async _captureMemoryProfile(e){const i=await this._sendCommand(e,"HeapProfiler.stopSampling");return await this._sendCommand(e,"HeapProfiler.startSampling"),i.profile}_computeCPUTimes(e,i){const r=new Map;let s=null,n=0,o=0;for(let a=0;a<e.samples.length;a++){const c=e.samples[a],l=e.timeDeltas[a+1]||0,u=this._findExtensionInCallStack(c,e.nodes,e.locations,i);r.has(u)||r.set(u,{totalTime:0,maxBlockingTime:0});const d=r.get(u);if(d.totalTime+=l,o+=l,s===u)n+=l;else{if(s!==null){const f=r.get(s);f.maxBlockingTime=Math.max(f.maxBlockingTime,n)}s=u,n=l}}if(s!==null){const a=r.get(s);a.maxBlockingTime=Math.max(a.maxBlockingTime,n)}return{totalExtHostTime:o,cpuProfileDuration:e.duration,timeByExtension:r}}async _computeMemoryAllocations(e,i){const r=new Map,s=(n,o)=>{o||(o=this._getExtensionIdFromPath(n.callFrame.url,i)),o?r.set(o,(r.get(o)||0)+n.selfSize):r.set("<ext-host-runtime>",(r.get("<ext-host-runtime>")||0)+n.selfSize),n.children.forEach(a=>s(a,o))};return s(e),r}async _setUpProfilers(e){const i=this._extHostConnections.get(e);if(!i)throw new Error(`Connection not found for extension host ${e}`);const[r,s]=await Promise.allSettled([this._setUpCPUProfiler(e),this._setUpHeapProfiler(e)]),{webSocket:n,profilerState:o}=i;o.cpuProfilerRunning=r.status==="fulfilled",o.heapProfilerRunning=s.status==="fulfilled",r.status==="rejected"&&this.logService.error(`[ExtHostContinuousProfilingService] CPU profiler setup failed for ${n.url}: ${r.reason}`),s.status==="rejected"&&this.logService.error(`[ExtHostContinuousProfilingService] Heap profiler setup failed for ${n.url}: ${s.reason}`)}async _setUpCPUProfiler(e){try{await this._sendCommand(e,"Profiler.enable")}catch(i){throw new Error(`Failed to enable CPU profiler: ${i}`)}try{await this._sendCommand(e,"Profiler.start")}catch(i){try{await this._sendCommand(e,"Profiler.disable")}catch(r){this.logService.warn(`[ExtHostContinuousProfilingService] Failed to disable CPU profiler during cleanup: ${r}`)}throw new Error(`Failed to start CPU profiler: ${i}`)}}async _setUpHeapProfiler(e){try{await this._sendCommand(e,"HeapProfiler.enable")}catch(i){throw new Error(`Failed to enable heap profiler: ${i}`)}try{await this._sendCommand(e,"HeapProfiler.startSampling")}catch(i){try{await this._sendCommand(e,"HeapProfiler.disable")}catch(r){this.logService.warn(`[ExtHostContinuousProfilingService] Failed to disable heap profiler during cleanup: ${r}`)}throw new Error(`Failed to start heap profiler: ${i}`)}}async _stopCPUProfiler(e){await this._sendCommand(e,"Profiler.stop"),await this._sendCommand(e,"Profiler.disable")}async _stopHeapProfiler(e){await this._sendCommand(e,"HeapProfiler.stopSampling"),await this._sendCommand(e,"HeapProfiler.disable")}_cleanUpPendingRequests(e){const i=this._pendingRequestsByExtHost.get(e);i&&(i.forEach((r,s)=>{clearTimeout(r.timeout),r.reject(new Error("WebSocket connection closed"))}),this._pendingRequestsByExtHost.delete(e))}async _sendCommand(e,i,r){return new Promise((s,n)=>{const o=this._extHostConnections.get(e);if(!o)return n(new Error("Connection not found for extension host"));const{webSocket:a}=o,c=this._getNextRequestId(),l={id:c,method:i};r&&(l.params=r);const u=setTimeout(()=>{const d=this._pendingRequestsByExtHost.get(e);d?.get(c)&&(d?.delete(c),n(new Error(`Timeout waiting for response to ${i} (id: ${c})`)))},sv.WEBSOCKET_TIMEOUT_MS);this._pendingRequestsByExtHost.has(e)||this._pendingRequestsByExtHost.set(e,new Map),this._pendingRequestsByExtHost.get(e).set(c,{resolve:s,reject:n,timeout:u});try{a.send(JSON.stringify(l))}catch(d){this._pendingRequestsByExtHost.get(e)?.delete(c),clearTimeout(u),n(d)}})}_handleMessage(e){try{const i=JSON.parse(e.data.toString());if(i.id!==void 0){let r=!1;for(const[s,n]of this._pendingRequestsByExtHost.entries()){const o=n.get(i.id);if(o){n.delete(i.id),clearTimeout(o.timeout),i.error?o.reject(new Error(`Debugger error: ${JSON.stringify(i.error)}`)):o.resolve(i.result),r=!0;break}}r||this.logService.warn(`[ExtHostContinuousProfilingService] Received response for unknown request ID: ${i.id}`)}else this.logService.debug(`[ExtHostContinuousProfilingService] Received notification: ${JSON.stringify(i)}`)}catch(i){this.logService.error(`[ExtHostContinuousProfilingService] Error parsing message: ${i}`)}}_getNextRequestId(){const e=this._nextRequestId;return this._nextRequestId=this._nextRequestId%2147483647+1,e}_findExtensionInCallStack(e,i,r,s){let n=e;for(;n!==void 0;){const o=i[n],a=r[o.locationId],c=this._getExtensionIdFromPath(a.callFrame.url,s);if(c)return c;n=o.parent}return"<ext-host-runtime>"}async _discoverDebugUrl(e){try{const i=await this.requestService.request({url:`http://localhost:${e}/json/list`,type:"GET"},Te.None),r=await da(i);return Co(r)?r[0]?.webSocketDebuggerUrl??null:(this.logService.error(`[ExtHostContinuousProfilingService] Error parsing response from debug server via port ${e}`),null)}catch(i){return this.logService.error(`[ExtHostContinuousProfilingService] Error discovering debug URL for port ${e}: ${i}`),null}}},wa=sv=__decorate([__param(0,V),__param(1,As)],wa)}});import{BrowserWindow as nv,screen as kl}from"electron";import{exec as gE}from"child_process";function MR(t){return typeof t!="object"||t===null?!1:"x"in t&&"y"in t&&"width"in t&&"height"in t}var Pl,ov,Oh,TR=g({"out-build/vs/platform/extensions/electron-main/extensionMonitorMainService.js"(){"use strict";L(),Ie(),z(),nr(),we(),ct(),ua(),K(),Sl(),_l(),Vi(),ks(),pE(),re(),xe(),Tn(),Rs(),L(),ov="issue.extensionMonitorWindowState",Oh=class extends N{static{Pl=this}static{this.DEFAULT_BACKGROUND_COLOR="#1E1E1E"}static{this.REFRESH_INTERVAL_MS=1e3}static{this.PROCESS_SPAWN_SETTLING_TIME_MS=3e3}constructor(e,i,r,s,n,o,a){super(),this.userEnv=e,this._environmentMainService=i,this._logService=r,this.protocolMainService=s,this._stateService=n,this._cssDevelopmentService=o,this._requestService=a,this._monitorWindowByWorkbenchId=new Map,this._workbenchIdByMonitorWindowId=new Map,this._monitorWindowDisposables=new Map,this._workbenchReadyPromises=new Map,this._workbenchReadyResolvers=new Map,this._openExtensionMonitorLocks=new Map,this._pathTreeByExtHost=new Map,this._profilersByWorkbench=new Map,this._extensionDataByWorkbench=new Map,this._extensionProcessesByWorkbench=new Map,this._refreshIntervalByWorkbench=new Map,this._activeRefreshPromiseByWorkbench=new Map,this._pendingProcessSpawnTimeouts=new Map,this._registerWorkbenchHandler=(c,l)=>{const u=c.sender.id;this._registerWorkbench(u,l)},this._unregisterWorkbenchHandler=c=>{const l=c.sender.id;this._unregisterWorkbench(l)},this._closeExtensionMonitorHandler=c=>{const l=c.sender.id,u=this._workbenchIdByMonitorWindowId.get(l);if(u)try{this._closeExtensionMonitorWindow(u)}catch(d){this._logService.error("[ExtensionMonitor] Error closing specific explorer:",d)}else this._logService.warn(`[ExtensionMonitor] Could not find parent for monitor window ${l}`)},this._extensionProcessSpawnedHandler=(c,l)=>{const u=c.sender.id;this._handleProcessSpawned(l,u)},this._registerListeners()}dispose(){super.dispose();const e=Array.from(this._extensionDataByWorkbench.keys());for(const i of e)this._unregisterWorkbenchSync(i);this._monitorWindowDisposables.forEach(i=>i.dispose()),this._monitorWindowDisposables.clear(),this._pendingProcessSpawnTimeouts.forEach(i=>{i.forEach(clearTimeout),i.clear()}),this._pendingProcessSpawnTimeouts.clear()}async openExtensionMonitor(e){const i=nv.getFocusedWindow();if(!i){this._logService.warn("[ExtensionMonitor] No focused window found to use as parent");return}const r=i.id,s=this._openExtensionMonitorLocks.get(r);if(s){this._logService.info(`[ExtensionMonitor] Another openExtensionMonitor call is already in progress for workbench ${r}`),await s;const a=this._monitorWindowByWorkbenchId.get(r);if(a&&!a.isDestroyed()){this._logService.info(`[ExtensionMonitor] Extension monitor already exists for parent window ${r}, focusing it`),this._focusWindow(a);return}}let n;const o=new Promise(a=>{n=a});this._openExtensionMonitorLocks.set(r,o);try{await this._doOpenExtensionMonitor(i,e)}finally{this._openExtensionMonitorLocks.delete(r),n()}}async _doOpenExtensionMonitor(e,i){const r=e.id;await this._ensureWorkbenchReady(r);const s=this._monitorWindowByWorkbenchId.get(r);if(s&&!s.isDestroyed()){this._logService.info(`[ExtensionMonitor] Extension monitor already exists for parent window ${r}, focusing it`),this._focusWindow(s);return}const n=this._profilersByWorkbench.get(r);await n?.localProfiler?.start(),await n?.remoteProfiler?.start(),await this._startRefreshIntervals(r);const o=new ke,a=o.add(this.protocolMainService.createIPCObjectUrl()),c=this._stateService.getItem(`${ov}.${r}`,void 0),l=MR(c)?c:this._getWindowPosition(e,800,500);let u;try{u=this._createBrowserWindow(l,a,{backgroundColor:i.styles.backgroundColor,title:w(2003,null),zoomLevel:i.zoomLevel,alwaysOnTop:!0},"extension-monitor"),this._monitorWindowDisposables.set(u.id,o),u.on("close",()=>{this._cleanUpExtensionMonitor(r).catch(f=>{this._logService.error("[ExtensionMonitor] Error during monitor window cleanup:",f)})});const d=()=>{if(u.isDestroyed())return;const f=u.getSize(),p=u.getPosition();if(!f||!p)return;const v={width:f[0],height:f[1],x:p[0],y:p[1]};this._stateService.setItem(`${ov}.${r}`,v)};o.add(me(()=>{u.isDestroyed()||(u.off("moved",d),u.off("resized",d))})),u.on("moved",d),u.on("resized",d),a.update({appRoot:this._environmentMainService.appRoot,windowId:u.id,userEnv:this.userEnv,data:i,product:Qr,nls:{messages:Iu(),language:Za()},cssModules:this._cssDevelopmentService.isEnabled?await this._cssDevelopmentService.getCssModules():void 0}),u.loadURL(Ct.asBrowserUri(`vs/code/electron-sandbox/extensionMonitor/extensionMonitor${this._environmentMainService.isBuilt?"":"-dev"}.html`).toString(!0)),this._monitorWindowByWorkbenchId.set(r,u),this._workbenchIdByMonitorWindowId.set(u.id,r),this._focusWindow(u)}catch(d){throw o.dispose(),d}}_registerListeners(){const e=async i=>{const r=i.sender.id,s=this._workbenchIdByMonitorWindowId.get(r);if(!s){this._logService.warn(`[ExtensionMonitor] No parent window ID found for monitor window ${r}`),this._safeSend(i,"vscode:listAllExtensionsResponse",[]);return}const n=this._getParentWindow(s);if(n&&!n.isDestroyed())if(this._extensionDataByWorkbench.get(s)){const a=await this._getPreparedExtensionMonitorData(s);this._safeSend(i,"vscode:listAllExtensionsResponse",a)}else this._safeSend(i,"vscode:listAllExtensionsResponse",[]);else this._logService.warn("[ExtensionMonitor] No parent window available to request extension data from"),this._safeSend(i,"vscode:listAllExtensionsResponse",[])};this._register(me(()=>{We.removeListener("vscode:registerWorkbenchExtensionHosts",this._registerWorkbenchHandler),We.removeListener("vscode:unregisterWorkbenchExtensionHosts",this._unregisterWorkbenchHandler),We.removeListener("vscode:listAllExtensions",e),We.removeListener("vscode:closeExtensionMonitor",this._closeExtensionMonitorHandler),We.removeListener("vscode:extensionProcessSpawned",this._extensionProcessSpawnedHandler)})),We.on("vscode:registerWorkbenchExtensionHosts",this._registerWorkbenchHandler),We.on("vscode:unregisterWorkbenchExtensionHosts",this._unregisterWorkbenchHandler),We.on("vscode:listAllExtensions",e),We.on("vscode:closeExtensionMonitor",this._closeExtensionMonitorHandler),We.on("vscode:extensionProcessSpawned",this._extensionProcessSpawnedHandler)}_getWindowPosition(e,i,r){let s;const n=kl.getAllDisplays();if(n.length===1)s=n[0];else{if(O){const c=kl.getCursorScreenPoint();s=kl.getDisplayNearestPoint(c)}!s&&e&&(s=kl.getDisplayMatching(e.getBounds())),s||(s=kl.getPrimaryDisplay()||n[0])}const o=s.bounds,a={width:i,height:r,x:o.x+o.width/2-i/2,y:o.y+o.height/2-r/2};return o.width>0&&o.height>0&&(a.x<o.x&&(a.x=o.x),a.y<o.y&&(a.y=o.y),a.x>o.x+o.width&&(a.x=o.x),a.y>o.y+o.height&&(a.y=o.y),a.width>o.width&&(a.width=o.width),a.height>o.height&&(a.height=o.height)),a}_focusWindow(e){e.isMinimized()&&e.restore(),e.focus()}_createBrowserWindow(e,i,r,s){const n={fullscreen:!1,skipTaskbar:!1,resizable:!0,width:e.width,height:e.height,minWidth:300,minHeight:200,x:e.x,y:e.y,title:r.title,backgroundColor:r.backgroundColor||Pl.DEFAULT_BACKGROUND_COLOR,webPreferences:{preload:Ct.asFileUri("vs/base/parts/sandbox/electron-sandbox/preload.js").fsPath,additionalArguments:[`--vscode-window-config=${i.resource.toString()}`],v8CacheOptions:this._environmentMainService.useCodeCache?"bypassHeatCheck":"none",enableWebSQL:!1,spellcheck:!1,zoomFactor:Nm(r.zoomLevel),sandbox:!0},alwaysOnTop:r.alwaysOnTop,experimentalDarkMode:!0},o=new nv(n);return o.setMenuBarVisibility(!1),o}_safeSend(e,i,...r){e.sender.isDestroyed()||e.sender.send(i,...r)}_getParentWindow(e){return nv.getAllWindows().find(r=>r.id===e)||null}async _ensureWorkbenchReady(e){let i=this._workbenchReadyPromises.get(e);if(i){await i;return}i=new Promise(r=>{this._workbenchReadyResolvers.set(e,r)}),this._workbenchReadyPromises.set(e,i),await i}async _cleanUpExtensionMonitor(e){const i=this._monitorWindowByWorkbenchId.get(e)?.id;if(!i)return;this._monitorWindowByWorkbenchId.delete(e),this._workbenchIdByMonitorWindowId.delete(i),await this._stopRefreshIntervals(e);const r=this._profilersByWorkbench.get(e);r?.localProfiler?.stop(),r?.remoteProfiler?.stop();const s=this._monitorWindowDisposables.get(i);s&&(s.dispose(),this._monitorWindowDisposables.delete(i))}_cleanUpExtensionMonitorSync(e){const i=this._monitorWindowByWorkbenchId.get(e)?.id;if(!i)return;this._monitorWindowByWorkbenchId.delete(e),this._workbenchIdByMonitorWindowId.delete(i),this._stopRefreshIntervalsSync(e);const r=this._profilersByWorkbench.get(e);r&&(r.localProfiler?.stop().catch(n=>{this._logService.error("[ExtensionMonitor] Error stopping local profiler during sync disposal:",n)}),r.remoteProfiler?.stop().catch(n=>{this._logService.error("[ExtensionMonitor] Error stopping remote profiler during sync disposal:",n)}));const s=this._monitorWindowDisposables.get(i);s&&(s.dispose(),this._monitorWindowDisposables.delete(i))}async _registerWorkbench(e,i){if(!this._workbenchReadyPromises.has(e)){const s=new Promise(n=>{this._workbenchReadyResolvers.set(e,n)});this._workbenchReadyPromises.set(e,s)}await this._doRegisterWorkbench(e,i);const r=this._workbenchReadyResolvers.get(e);r&&(r(),this._workbenchReadyResolvers.delete(e))}async _doRegisterWorkbench(e,i){this._resetWindowData(e,i.localHosts,i.remoteHosts),this._logService.info(`[ExtensionMonitor] Workbench ${e} reset window data: ${i.localHosts.length} local hosts and ${i.remoteHosts.length} remote hosts`);const r=i.localHosts.map(o=>{if(o.extHostPid)return{extensionHostId:o.extHostPid.toString(),webSocketPort:o.inspectInfo.port}}).filter(Co),s=i.remoteHosts.map(o=>{if(o.inspectInfo)return{extensionHostId:`remote:${o.inspectInfo.port}`,webSocketPort:o.inspectInfo.port}}).filter(Co);this._logService.info(`[ExtensionMonitor] Workbench ${e} found ${r.length} local targets and ${s.length} remote targets`);const n={};r.length>0&&(n.localProfiler=new wa(this._logService,this._requestService,r,(o,a)=>this._getExtensionIdFromPath(o,a))),s.length>0&&(n.remoteProfiler=new wa(this._logService,this._requestService,s,(o,a)=>this._getExtensionIdFromPath(o,a))),this._profilersByWorkbench.set(e,n)}async _unregisterWorkbench(e){this._closeExtensionMonitorWindow(e),await this._cleanUpExtensionMonitor(e),this._unregisterWorkbenchCommon(e)}_unregisterWorkbenchSync(e){this._closeExtensionMonitorWindow(e),this._cleanUpExtensionMonitorSync(e),this._unregisterWorkbenchCommon(e)}_unregisterWorkbenchCommon(e){this._profilersByWorkbench.delete(e);const i=this._extensionDataByWorkbench.get(e);i&&(i.localHosts.forEach((s,n)=>{this._pathTreeByExtHost.delete(n)}),i.remoteHosts.forEach((s,n)=>{this._pathTreeByExtHost.delete(n)})),this._extensionDataByWorkbench.delete(e),this._extensionProcessesByWorkbench.delete(e),this._activeRefreshPromiseByWorkbench.delete(e);const r=this._pendingProcessSpawnTimeouts.get(e);r&&(r.forEach(clearTimeout),this._pendingProcessSpawnTimeouts.delete(e))}async _startRefreshIntervals(e){await this._stopRefreshIntervals(e);const i=()=>{if(!this._extensionDataByWorkbench.has(e))return;const r=setTimeout(async()=>{if(!this._refreshIntervalByWorkbench.has(e))return;const s=(async()=>{try{await Promise.all([this._refreshAllExtensionMetrics(e),this._refreshProcessData(e)])}catch(n){this._logService.error(`[ExtensionMonitor] Error during refresh for workbench ${e}:`,n)}})();this._activeRefreshPromiseByWorkbench.set(e,s);try{await s}finally{this._activeRefreshPromiseByWorkbench.delete(e),this._refreshIntervalByWorkbench.has(e)&&i()}},Pl.REFRESH_INTERVAL_MS);this._refreshIntervalByWorkbench.set(e,r)};i()}async _stopRefreshIntervals(e){const i=this._refreshIntervalByWorkbench.get(e);i&&(clearTimeout(i),this._refreshIntervalByWorkbench.delete(e));const r=this._activeRefreshPromiseByWorkbench.get(e);if(r)try{await r}catch(s){this._logService.error(`[ExtensionMonitor] Active refresh completed with error during cleanup: ${s}`)}}_stopRefreshIntervalsSync(e){const i=this._refreshIntervalByWorkbench.get(e);i&&(clearTimeout(i),this._refreshIntervalByWorkbench.delete(e))}_closeExtensionMonitorWindow(e){const i=this._monitorWindowByWorkbenchId.get(e);i&&!i.isDestroyed()&&i.close()}async _getPreparedExtensionMonitorData(e){const i=this._extensionDataByWorkbench.get(e);if(!i)return{hosts:[]};const r=this._getCleanExtensionData(e,i.localHosts),s=this._getCleanExtensionData(e,i.remoteHosts);return{hosts:[...r,...s]}}_getCleanExtensionData(e,i){const r=s=>!!(s.metrics?.pctCPU&&s.metrics.pctCPU>0||s.metrics?.pctExtHost&&s.metrics.pctExtHost>0||s.metrics?.memKB&&s.metrics.memKB>0||s.processes&&s.processes.length>0);return Array.from(i.entries()).map(([s,{extensions:n,hostSysMem:o,isRemote:a}])=>{const c=Array.from(n.entries()).map(([l,u])=>{const d=this._extensionProcessesByWorkbench.get(e)?.get(l);return{...u,processes:d}});return{id:s,extensions:Array.from(c).filter(r),hostSysMem:o,isRemote:a}})}_resetWindowData(e,i,r){const s=this._getMapFromHosts(i),n=this._getMapFromHosts(r);this._extensionDataByWorkbench.set(e,{localHosts:s,remoteHosts:n})}_getMapFromHosts(e){const i=new Map;for(const{extHostPid:r,extensions:s,inspectInfo:n,isRemote:o}of e){let a;if(o?a=n?`remote:${n.port}`:void 0:a=r?.toString(),!a)continue;const c=Es.forPaths(!1),l=new Map;for(const u of s){const d=x.from(u.extensionLocation);c.set(d.fsPath,u.id),l.set(u.id,{staticInfo:u})}l.set("<ext-host-runtime>",{staticInfo:{id:"<ext-host-runtime>",name:"<ext-host-runtime>",extensionLocation:x.parse(""),isBuiltin:!0}}),i.set(a,{isRemote:o,inspectUrl:`http://localhost:${n.port}`,extensions:l}),this._pathTreeByExtHost.set(a,c)}return i}async _refreshAllExtensionMetrics(e){const i=this._extensionDataByWorkbench.get(e);if(!i){this._logService.error(`[ExtensionMonitor] No extension data found for workbench ${e}`);return}const r=this._profilersByWorkbench.get(e);if(!r)return;const s=[];r.localProfiler&&s.push(this._refreshExtensionMetrics(r.localProfiler,i.localHosts)),r.remoteProfiler&&s.push(this._refreshExtensionMetrics(r.remoteProfiler,i.remoteHosts)),await Promise.all(s)}async _refreshExtensionMetrics(e,i){const r=await e.captureMetricsForAllHosts();for(const[s,n]of i.entries()){const{extensions:o,inspectUrl:a}=n,c=r[s];if(Co(c))for(const[l,u]of o.entries())if(c&&c[l]){const d=c[l];o.set(l,{staticInfo:u.staticInfo,metrics:d})}else o.set(l,{staticInfo:u.staticInfo})}}async _refreshProcessData(e){const i=this._extensionProcessesByWorkbench.get(e),r=this._extensionDataByWorkbench.get(e);if(!i||!r||process.platform!=="darwin"&&process.platform!=="linux")return;const s=Array.from(r.localHosts.keys()).map(a=>Number(a)).filter(a=>!isNaN(a));s.length!==r.localHosts.size&&this._logService.error("[ExtensionMonitor] Some local extension host IDs are not numbers and could not be used as PIDs");const n=this._getUnixProcessesInfo(s).then(a=>{a.forEach(({pid:c,memRssKB:l})=>{const u=c.toString(),d=r.localHosts.get(u);d?r.localHosts.set(u,{...d,hostSysMem:l}):this._logService.error(`[ExtensionMonitor] No extension host found for PID ${u} retrieved from 'ps'`)})}),o=Array.from(i.entries()).map(async([a,c])=>{const l=await this._getUnixProcessesInfo(c.map(u=>u.pid));i.set(a,l)});await Promise.all([...o,n])}async _handleProcessSpawned(e,i){if(process.platform!=="darwin"&&process.platform!=="linux")return;const r=setTimeout(()=>{this._extensionDataByWorkbench.has(i)&&this._getUnixProcessesInfo([e.spawnedPid]).then(n=>{if(this._extensionDataByWorkbench.has(i)&&n.length===1){const o=this._findExtensionIdFromStackTrace(e.stackTrace,e.extHostPid.toString());if(!o){this._logService.warn(`[ExtensionMonitor] No extension ID found for process ${e.spawnedPid} in stack trace: ${e.stackTrace}`);return}let a=this._extensionProcessesByWorkbench.get(i);if(a||(a=new Map,this._extensionProcessesByWorkbench.set(i,a)),!a.has(o)){a.set(o,n);return}a.get(o).push(...n)}}).catch(n=>{this._logService.error(`[ExtensionMonitor] Error getting processes info for PID ${e.spawnedPid}: ${n}`)}).finally(()=>{const n=this._pendingProcessSpawnTimeouts.get(i);n&&(n.delete(r),n.size===0&&this._pendingProcessSpawnTimeouts.delete(i))})},Pl.PROCESS_SPAWN_SETTLING_TIME_MS);let s=this._pendingProcessSpawnTimeouts.get(i);s||(s=new Set,this._pendingProcessSpawnTimeouts.set(i,s)),s.add(r)}async _getUnixProcessesInfo(e){return new Promise((i,r)=>{gE("which ps",(s,n,o)=>{if(s||o)return r(s||new Error(o.toString()));const a=n.trim();gE(`${a} -p ${e.join(",")} -o pid,%cpu,rss,command`,(c,l,u)=>{if(c)return i([]);const d=l.split(`
|
|
`).map(f=>f.trim()).filter(f=>f.length>0);if(d.length>1){const f=d[0].split(/\s+/),p=[];for(const v of d.slice(1)){const m=v.split(/\s+/),y=m.slice(0,f.length-1);if(y.length!==f.length-1)return r(new Error(`Invalid ps output line: "${v}"`));const S=m.slice(f.length-1).join(" "),E=Number(y[1]),k=Number(y[2]),R=Number(m[0]);isNaN(E)||isNaN(k)||isNaN(R)||p.push({pid:R,command:S,pctCPU:E,memRssKB:k})}i(p)}else i([])})})})}_getExtensionIdFromPath(e,i){const r=e.startsWith("file://")?x.parse(e).fsPath:x.file(e).fsPath,s=this._pathTreeByExtHost.get(i);if(s)return s.findSubstr(r)}_findExtensionIdFromStackTrace(e,i){const r=e.split(`
|
|
`);for(const s of r){let n=s.trim();if(n.startsWith("at")){n=n.slice(n.indexOf("(")+1,n.lastIndexOf(":"));const o=n.slice(0,n.lastIndexOf(":")),a=this._getExtensionIdFromPath(o,i);if(a)return a}}}},Oh=Pl=__decorate([__param(1,st),__param(2,V),__param(3,va),__param(4,Ii),__param(5,Gn),__param(6,As)],Oh)}}),mE,WR=g({"out-build/vs/platform/continuousProfiling/common/extHostContinuousProfilingService.js"(){"use strict";G(),mE=j("extHostContinuousProfilingService")}});function vE(t){const e=t.getKeyMap(),i=t.getCurrentKeyboardLayout();return{keyboardMapping:e,keyboardLayoutInfo:i}}var av,Fh,LR=g({"out-build/vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService.js"(){"use strict";z(),q(),L(),G(),ft(),av=j("keyboardLayoutMainService"),Fh=class extends N{constructor(e){super(),this._onDidChangeKeyboardLayout=this._register(new D),this.onDidChangeKeyboardLayout=this._onDidChangeKeyboardLayout.event,this._initPromise=null,this._keyboardLayoutData=null,e.when(3).then(()=>this._initialize())}_initialize(){return this._initPromise||(this._initPromise=this._doInitialize()),this._initPromise}async _doInitialize(){const e=await import("native-keymap");this._keyboardLayoutData=vE(e),uy||e.onDidChangeKeyboardLayout(()=>{this._keyboardLayoutData=vE(e),this._onDidChangeKeyboardLayout.fire(this._keyboardLayoutData)})}async getKeyboardLayoutData(){return await this._initialize(),this._keyboardLayoutData}},Fh=__decorate([__param(0,ze)],Fh)}}),xl,wE=g({"out-build/vs/platform/url/common/url.js"(){"use strict";G(),xl=j("urlService")}});import{app as OR}from"electron";var yE,cv,Nh,FR=g({"out-build/vs/platform/launch/electron-main/launchMainService.js"(){"use strict";Wt(),z(),re(),qt(),Xe(),al(),G(),K(),wE(),ut(),yE="launchMainService",cv=j(yE),Nh=class{constructor(e,i,r,s){this.logService=e,this.windowsMainService=i,this.urlService=r,this.configurationService=s}async start(e,i){this.logService.trace("Received data from other instance: ",e,i),O&&OR.focus({steal:!0});const r=this.parseOpenUrl(e);if(r.length){let s=Promise.resolve();if(this.windowsMainService.getWindowCount()===0){const n=(await this.windowsMainService.openEmptyWindow({context:4})).at(0);n&&(s=n.ready())}s.then(()=>{for(const{uri:n,originalUrl:o}of r)this.urlService.open(n,{originalUrl:o})})}else return this.startOpenWindow(e,i)}parseOpenUrl(e){return e["open-url"]&&e._urls&&e._urls.length>0?Dt(e._urls.map(i=>{try{return{uri:x.parse(i),originalUrl:i}}catch{return null}})):[]}async startOpenWindow(e,i){const r=zn(i)?0:4;let s=[];const n=e.wait&&e.waitMarkerFilePath?x.file(e.waitMarkerFilePath):void 0,o=e.remote||void 0,a={context:r,cli:e,userEnv:e["preserve-env"]||r===0?i:void 0,waitMarkerFileURI:n,remoteAuthority:o,forceProfile:e.profile,forceTempProfile:e["profile-temp"]};if(e.extensionDevelopmentPath)await this.windowsMainService.openExtensionDevelopmentHostWindow(e.extensionDevelopmentPath,a);else if(!e._.length&&!e["folder-uri"]&&!e["file-uri"]){let c=!1;if(e["new-window"]||a.forceProfile||a.forceTempProfile)c=!0;else if(e["reuse-window"])c=!1;else switch(this.configurationService.getValue("window")?.openWithoutArgumentsInNewWindow||"default"){case"on":c=!0;break;case"off":c=!1;break;default:c=!O}if(c)s=await this.windowsMainService.open({...a,forceNewWindow:!0,forceEmpty:!0});else{const l=this.windowsMainService.getLastActiveWindow();l?(this.windowsMainService.openExistingWindow(l,a),s=[l]):s=await this.windowsMainService.open({...a,forceEmpty:!0})}}else s=await this.windowsMainService.open({...a,forceNewWindow:e["new-window"],preferNewWindow:!e["reuse-window"]&&!e.wait,forceReuseWindow:e["reuse-window"],diffMode:e.diff,mergeMode:e.merge,addMode:e.add,removeMode:e.remove,noRecentEntry:!!e["skip-add-to-recently-opened"],gotoLineMode:e.goto});if(n&&s.length===1&&s[0])return Promise.race([s[0].whenClosedOrLoaded,nI(n.fsPath)]).then(()=>{},()=>{})}async getMainProcessId(){return this.logService.trace("Received request for process ID from other instance."),process.pid}},Nh=__decorate([__param(0,V),__param(1,ot),__param(2,xl),__param(3,Qe)],Nh)}});function SE(t){return t.submenu!==void 0}function _E(t){return t.id==="vscode.menubar.separator"}function bE(t){return t.uri!==void 0}function NR(t){return!SE(t)&&!_E(t)&&!bE(t)}var UR=g({"out-build/vs/platform/menubar/common/menubar.js"(){"use strict"}}),EE,kE,PE,fe,Jn,lv,cn=g({"out-build/vs/platform/update/common/update.js"(){"use strict";xe(),G(),(function(t){t.Uninitialized="uninitialized",t.Idle="idle",t.Disabled="disabled",t.CheckingForUpdates="checking for updates",t.AvailableForDownload="available for download",t.Downloading="downloading",t.Downloaded="downloaded",t.Updating="updating",t.Ready="ready"})(EE||(EE={})),(function(t){t[t.Setup=0]="Setup",t[t.Archive=1]="Archive",t[t.Snap=2]="Snap"})(kE||(kE={})),(function(t){t[t.NotBuilt=0]="NotBuilt",t[t.DisabledByEnvironment=1]="DisabledByEnvironment",t[t.ManuallyDisabled=2]="ManuallyDisabled",t[t.MissingConfiguration=3]="MissingConfiguration",t[t.InvalidConfiguration=4]="InvalidConfiguration",t[t.RunningAsAdmin=5]="RunningAsAdmin"})(PE||(PE={})),fe={Uninitialized:{type:"uninitialized"},Disabled:t=>({type:"disabled",reason:t}),Idle:(t,e)=>({type:"idle",updateType:t,error:e}),CheckingForUpdates:t=>({type:"checking for updates",explicit:t}),AvailableForDownload:t=>({type:"available for download",update:t}),Downloading:{type:"downloading"},Downloaded:t=>({type:"downloaded",update:t}),Updating:t=>({type:"updating",update:t}),Ready:t=>({type:"ready",update:t})},Jn=j("updateService"),lv="cursor.update.events"}});import{app as Qn}from"electron";var Ki,Cl,Uh,$h=g({"out-build/vs/platform/workspaces/electron-main/workspacesHistoryMainService.js"(){"use strict";Wt(),ae(),q(),qs(),L(),Ie(),z(),gt(),re(),qt(),we(),G(),ft(),K(),tn(),E1(),hi(),qn(),ai(),Vn(),Mh(),Cl=j("workspacesHistoryMainService"),Uh=class extends N{static{Ki=this}static{this.MAX_TOTAL_RECENT_ENTRIES=500}static{this.RECENTLY_OPENED_STORAGE_KEY="history.recentlyOpenedPathsList"}constructor(e,i,r,s,n){super(),this.logService=e,this.workspacesManagementMainService=i,this.lifecycleMainService=r,this.applicationStorageMainService=s,this.dialogMainService=n,this._onDidChangeRecentlyOpened=this._register(new D),this.onDidChangeRecentlyOpened=this._onDidChangeRecentlyOpened.event,this.macOSRecentDocumentsUpdater=this._register(new ws(800)),this.registerListeners()}registerListeners(){this.lifecycleMainService.when(4).then(()=>this.handleWindowsJumpList()),this._register(this.workspacesManagementMainService.onDidEnterWorkspace(e=>this.addRecentlyOpened([{workspace:e.workspace,remoteAuthority:e.window.remoteAuthority}])))}async addRecentlyOpened(e){let i=[],r=[];for(const n of e)if(an(n.remoteAuthority)===void 0)if(_1(n))!this.workspacesManagementMainService.isUntitledWorkspace(n.workspace)&&!this.containsWorkspace(i,n.workspace)&&i.push(n);else if(nh(n))this.containsFolder(i,n.folderUri)||i.push(n);else{const o=this.containsFile(r,n.fileUri),a=n.fileUri.scheme===T.file&&Ki.COMMON_FILES_FILTER.indexOf(Nr(n.fileUri))>=0;!o&&!a&&(r.push(n),B&&n.fileUri.scheme===T.file&&Qn.addRecentDocument(n.fileUri.fsPath))}const s=await this.mergeEntriesFromStorage({workspaces:i,files:r});i=s.workspaces,r=s.files,i.length>Ki.MAX_TOTAL_RECENT_ENTRIES&&(i.length=Ki.MAX_TOTAL_RECENT_ENTRIES),r.length>Ki.MAX_TOTAL_RECENT_ENTRIES&&(r.length=Ki.MAX_TOTAL_RECENT_ENTRIES),await this.saveRecentlyOpened({workspaces:i,files:r}),this._onDidChangeRecentlyOpened.fire(),O&&this.macOSRecentDocumentsUpdater.trigger(()=>this.updateMacOSRecentDocuments())}async removeRecentlyOpened(e){const i=o=>{const a=this.location(o);for(const c of e)if(rt.isEqual(c,a))return!1;return!0},r=await this.getRecentlyOpened(),s=r.workspaces.filter(i),n=r.files.filter(i);(s.length!==r.workspaces.length||n.length!==r.files.length)&&(await this.saveRecentlyOpened({files:n,workspaces:s}),this._onDidChangeRecentlyOpened.fire(),O&&this.macOSRecentDocumentsUpdater.trigger(()=>this.updateMacOSRecentDocuments()))}async clearRecentlyOpened(e){if(e?.confirm){const{response:i}=await this.dialogMainService.showMessageBox({type:"warning",buttons:[w(2653,null),w(2654,null)],message:w(2655,null),detail:w(2656,null),cancelId:1});if(i!==0)return}await this.saveRecentlyOpened({workspaces:[],files:[]}),Qn.clearRecentDocuments(),this._onDidChangeRecentlyOpened.fire()}async getRecentlyOpened(){return this.mergeEntriesFromStorage()}async mergeEntriesFromStorage(e){const i=new Bt(n=>rt.getComparisonKey(n));if(e?.workspaces)for(const n of e.workspaces)i.set(this.location(n),n);const r=new Bt(n=>rt.getComparisonKey(n));if(e?.files)for(const n of e.files)r.set(this.location(n),n);const s=await this.getRecentlyOpenedFromStorage();for(const n of s.workspaces){if(an(n.remoteAuthority)!==void 0)continue;const o=i.get(this.location(n));o?o.label=o.label??n.label:i.set(this.location(n),n)}for(const n of s.files){const o=r.get(this.location(n));o?o.label=o.label??n.label:r.set(this.location(n),n)}return{workspaces:[...i.values()],files:[...r.values()]}}async getRecentlyOpenedFromStorage(){await this.applicationStorageMainService.whenReady;let e;const i=this.applicationStorageMainService.get(Ki.RECENTLY_OPENED_STORAGE_KEY,-1);if(typeof i=="string")try{e=JSON.parse(i)}catch(r){this.logService.error("Unexpected error parsing opened paths list",r)}return wD(e,this.logService)}async saveRecentlyOpened(e){await this.applicationStorageMainService.whenReady,this.applicationStorageMainService.store(Ki.RECENTLY_OPENED_STORAGE_KEY,JSON.stringify(yD(e)),-1,1)}location(e){return nh(e)?e.folderUri:dD(e)?e.fileUri:e.workspace.configPath}containsWorkspace(e,i){return!!e.find(r=>_1(r)&&r.workspace.id===i.id)}containsFolder(e,i){return!!e.find(r=>nh(r)&&rt.isEqual(r.folderUri,i))}containsFile(e,i){return!!e.find(r=>rt.isEqual(r.fileUri,i))}static{this.MAX_MACOS_DOCK_RECENT_WORKSPACES=7}static{this.MAX_MACOS_DOCK_RECENT_ENTRIES_TOTAL=10}static{this.MAX_WINDOWS_JUMP_LIST_ENTRIES=7}static{this.COMMON_FILES_FILTER=["COMMIT_EDITMSG","MERGE_MSG","git-rebase-todo"]}async handleWindowsJumpList(){B&&(await this.updateWindowsJumpList(),this._register(this.onDidChangeRecentlyOpened(()=>this.updateWindowsJumpList())))}async updateWindowsJumpList(){if(!B)return;const e=[];if(e.push({type:"tasks",items:[{type:"task",title:w(2657,null),description:w(2658,null),program:process.execPath,args:"-n",iconPath:process.execPath,iconIndex:0}]}),(await this.getRecentlyOpened()).workspaces.length>0){const i=[];for(const n of Qn.getJumpListSettings().removedItems){const o=n.args;if(o){const a=/^--(folder|file)-uri\s+"([^"]+)"$/.exec(o);a&&i.push(x.parse(a[2]))}}await this.removeRecentlyOpened(i);let r=!1;const s=Dt((await this.getRecentlyOpened()).workspaces.slice(0,Ki.MAX_WINDOWS_JUMP_LIST_ENTRIES).map(n=>{const o=_1(n)?n.workspace:n.folderUri,{title:a,description:c}=this.getWindowsJumpListLabel(o,n.label);let l;return x.isUri(o)?l=`--folder-uri "${o.toString()}"`:(r=!0,l=`--file-uri "${o.configPath.toString()}"`),{type:"task",title:a.substr(0,255),description:c.substr(0,255),program:process.execPath,args:l,iconPath:"explorer.exe",iconIndex:0}}));s.length>0&&e.push({type:"custom",name:w(r?2659:2660,null),items:s})}e.push({type:"recent"});try{const i=Qn.setJumpList(e);i&&i!=="ok"&&this.logService.warn(`updateWindowsJumpList#setJumpList unexpected result: ${i}`)}catch(i){this.logService.warn("updateWindowsJumpList#setJumpList",i)}}getWindowsJumpListLabel(e,i){if(i)return{title:QC(i).name,description:i};if(x.isUri(e))return{title:Nr(e),description:this.renderJumpListPathDescription(e)};if(this.workspacesManagementMainService.isUntitledWorkspace(e))return{title:w(2661,null),description:""};let r=Nr(e.configPath);return r.endsWith(Jc)&&(r=r.substr(0,r.length-Jc.length-1)),{title:w(2662,null,r),description:this.renderJumpListPathDescription(e.configPath)}}renderJumpListPathDescription(e){return e.scheme==="file"?tm(e.fsPath):e.toString()}async updateMacOSRecentDocuments(){if(!O)return;Qn.clearRecentDocuments();const e=await this.getRecentlyOpened(),i=[];let r=0;for(let n=0;n<e.workspaces.length&&r<Ki.MAX_MACOS_DOCK_RECENT_WORKSPACES;n++){const o=this.location(e.workspaces[n]);if(o.scheme===T.file){const a=ji(o);await te.exists(a)&&(i.push(a),r++)}}const s=[];for(let n=0;n<e.files.length&&r<Ki.MAX_MACOS_DOCK_RECENT_ENTRIES_TOTAL;n++){const o=this.location(e.files[n]);if(o.scheme===T.file){const a=ji(o);if(Ki.COMMON_FILES_FILTER.includes(Nr(o))||i.includes(a))continue;await te.exists(a)&&(s.push(a),r++)}}s.reverse().forEach(n=>Qn.addRecentDocument(n)),i.reverse().forEach(n=>Qn.addRecentDocument(n))}},Uh=Ki=__decorate([__param(0,V),__param(1,rn),__param(2,ze),__param(3,xs),__param(4,Is)],Uh)}});import{app as $R,BrowserWindow as Bh,Menu as It,MenuItem as Fe}from"electron";function Ms(){return new Fe({type:"separator"})}var jh,Il,Hh,BR=g({"out-build/vs/platform/menubar/electron-main/menubar.js"(){"use strict";ae(),St(),qs(),z(),re(),we(),wh(),Xe(),ct(),ft(),K(),UR(),Yn(),lt(),Vi(),ti(),cn(),ks(),ut(),$h(),L(),Il="menu",Hh=class extends N{static{jh=this}static{this.lastKnownMenubarStorageKey="lastKnownMenubarData"}constructor(e,i,r,s,n,o,a,c,l,u,d,f){super(),this.updateService=e,this.configurationService=i,this.windowsMainService=r,this.environmentMainService=s,this.telemetryService=n,this.workspacesHistoryMainService=o,this.stateService=a,this.lifecycleMainService=c,this.logService=l,this.nativeHostMainService=u,this.productService=d,this.auxiliaryWindowsMainService=f,this.fallbackMenuHandlers=Object.create(null),this.menuUpdater=new br(()=>this.doUpdateMenu(),0),this.menuGC=new br(()=>{this.oldMenus=[]},1e4),this.menubarMenus=Object.create(null),this.keybindings=Object.create(null),(O||Nn(i))&&this.restoreCachedMenubarData(),this.addFallbackHandlers(),this.closedLastWindow=!1,this.noActiveMainWindow=!1,this.oldMenus=[],this.install(),this.registerListeners()}restoreCachedMenubarData(){const e=this.stateService.getItem(jh.lastKnownMenubarStorageKey);e&&(e.menus&&(this.menubarMenus=e.menus),e.keybindings&&(this.keybindings=e.keybindings))}addFallbackHandlers(){this.fallbackMenuHandlers["workbench.action.files.newUntitledFile"]=(o,a,c)=>{this.runActionInRenderer({type:"commandId",commandId:"workbench.action.files.newUntitledFile"})||this.windowsMainService.openEmptyWindow({context:2,contextWindowId:a?.id})},this.fallbackMenuHandlers["workbench.action.newWindow"]=(o,a,c)=>this.windowsMainService.openEmptyWindow({context:2,contextWindowId:a?.id}),this.fallbackMenuHandlers["workbench.action.files.openFileFolder"]=(o,a,c)=>this.nativeHostMainService.pickFileFolderAndOpen(void 0,{forceNewWindow:this.isOptionClick(c),telemetryExtraData:{from:Il}}),this.fallbackMenuHandlers["workbench.action.files.openFolder"]=(o,a,c)=>this.nativeHostMainService.pickFolderAndOpen(void 0,{forceNewWindow:this.isOptionClick(c),telemetryExtraData:{from:Il}}),this.fallbackMenuHandlers["workbench.action.openWorkspace"]=(o,a,c)=>this.nativeHostMainService.pickWorkspaceAndOpen(void 0,{forceNewWindow:this.isOptionClick(c),telemetryExtraData:{from:Il}}),this.fallbackMenuHandlers["workbench.action.clearRecentFiles"]=()=>this.workspacesHistoryMainService.clearRecentlyOpened({confirm:!0});const e=this.productService.youTubeUrl;e&&(this.fallbackMenuHandlers["workbench.action.openYouTubeUrl"]=()=>this.openUrl(e,"openYouTubeUrl"));const i=this.productService.requestFeatureUrl;i&&(this.fallbackMenuHandlers["workbench.action.openRequestFeatureUrl"]=()=>this.openUrl(i,"openUserVoiceUrl"));const r=this.productService.reportIssueUrl;r&&(this.fallbackMenuHandlers["workbench.action.openIssueReporter"]=()=>this.openUrl(r,"openReportIssues"));const s=this.productService.licenseUrl;s&&(this.fallbackMenuHandlers["workbench.action.openLicenseUrl"]=()=>{if(Zi){const o=s.indexOf("?")>0?"&":"?";this.openUrl(`${s}${o}lang=${Zi}`,"openLicenseUrl")}else this.openUrl(s,"openLicenseUrl")});const n=this.productService.privacyStatementUrl;n&&s&&(this.fallbackMenuHandlers["workbench.action.openPrivacyStatementUrl"]=()=>{this.openUrl(n,"openPrivacyStatement")})}registerListeners(){this._register(this.lifecycleMainService.onWillShutdown(()=>this.willShutdown=!0)),this._register(this.windowsMainService.onDidChangeWindowsCount(e=>this.onDidChangeWindowsCount(e))),this._register(this.nativeHostMainService.onDidBlurMainWindow(()=>this.onDidChangeWindowFocus())),this._register(this.nativeHostMainService.onDidFocusMainWindow(()=>this.onDidChangeWindowFocus()))}get currentEnableMenuBarMnemonics(){return!1}get currentEnableNativeTabs(){if(!O)return!1;const e=this.configurationService.getValue("window.nativeTabs");return typeof e!="boolean"?!1:e}updateMenu(e,i){this.menubarMenus=e.menus,this.keybindings=e.keybindings,this.stateService.setItem(jh.lastKnownMenubarStorageKey,e),this.scheduleUpdateMenu()}scheduleUpdateMenu(){this.menuUpdater.schedule()}doUpdateMenu(){this.willShutdown||setTimeout(()=>{this.willShutdown||this.install()},10)}onDidChangeWindowsCount(e){O&&(e.oldCount===0&&e.newCount>0||e.oldCount>0&&e.newCount===0)&&(this.closedLastWindow=e.newCount===0,this.scheduleUpdateMenu())}onDidChangeWindowFocus(){if(!O)return;const e=Bh.getFocusedWindow();this.noActiveMainWindow=!e||!!this.auxiliaryWindowsMainService.getWindowByWebContents(e.webContents),this.scheduleUpdateMenu()}install(){const e=It.getApplicationMenu();if(e&&this.oldMenus.push(e),Object.keys(this.menubarMenus).length===0){this.doSetApplicationMenu(O?new It:null);return}const i=new It;let r;if(O){const n=new It;r=new Fe({label:this.productService.nameShort,submenu:n}),this.setMacApplicationMenu(n),i.append(r)}if(O&&!this.appMenuInstalled){this.appMenuInstalled=!0;const n=new It;n.append(new Fe({label:this.mnemonicLabel(w(2114,null)),click:()=>this.windowsMainService.openEmptyWindow({context:1})})),$R.dock.setMenu(n)}if(this.shouldDrawMenu("File")){const n=new It,o=new Fe({label:this.mnemonicLabel(w(2115,null)),submenu:n});this.setMenuById(n,"File"),i.append(o)}if(this.shouldDrawMenu("Edit")){const n=new It,o=new Fe({label:this.mnemonicLabel(w(2116,null)),submenu:n});this.setMenuById(n,"Edit"),i.append(o)}if(this.shouldDrawMenu("Selection")){const n=new It,o=new Fe({label:this.mnemonicLabel(w(2117,null)),submenu:n});this.setMenuById(n,"Selection"),i.append(o)}if(this.shouldDrawMenu("View")){const n=new It,o=new Fe({label:this.mnemonicLabel(w(2118,null)),submenu:n});this.setMenuById(n,"View"),i.append(o)}if(this.shouldDrawMenu("Go")){const n=new It,o=new Fe({label:this.mnemonicLabel(w(2119,null)),submenu:n});this.setMenuById(n,"Go"),i.append(o)}if(this.shouldDrawMenu("Run")){const n=new It,o=new Fe({label:this.mnemonicLabel(w(2120,null)),submenu:n});this.setMenuById(n,"Run"),i.append(o)}if(this.shouldDrawMenu("Terminal")){const n=new It,o=new Fe({label:this.mnemonicLabel(w(2121,null)),submenu:n});this.setMenuById(n,"Terminal"),i.append(o)}let s;if(this.shouldDrawMenu("Window")){const n=new It;s=new Fe({label:this.mnemonicLabel(w(2122,null)),submenu:n,role:"window"}),this.setMacWindowMenu(n)}if(s&&i.append(s),this.shouldDrawMenu("Help")){const n=new It,o=new Fe({label:this.mnemonicLabel(w(2123,null)),submenu:n,role:"help"});this.setMenuById(n,"Help"),i.append(o)}i.items&&i.items.length>0?this.doSetApplicationMenu(i):this.doSetApplicationMenu(null),this.menuGC.schedule()}doSetApplicationMenu(e){if(It.setApplicationMenu(e),e)for(const i of this.auxiliaryWindowsMainService.getWindows())i.win?.setMenu(null)}setMacApplicationMenu(e){const i=this.createMenuItem(w(2124,null,this.productService.nameLong),"workbench.action.showAboutDialog"),r=this.getUpdateMenuItems();let s;if(this.shouldDrawMenu("Preferences")){const f=new It;this.setMenuById(f,"Preferences"),s=new Fe({label:this.mnemonicLabel(w(2125,null)),submenu:f})}const n=new It,o=new Fe({label:w(2126,null),role:"services",submenu:n}),a=new Fe({label:w(2127,null,this.productService.nameLong),role:"hide",accelerator:"Command+H"}),c=new Fe({label:w(2128,null),role:"hideOthers",accelerator:"Command+Alt+H"}),l=new Fe({label:w(2129,null),role:"unhide"}),u=new Fe(this.likeAction("workbench.action.quit",{label:w(2130,null,this.productService.nameLong),click:async(f,p,v)=>{const m=this.windowsMainService.getLastActiveWindow();(this.windowsMainService.getWindowCount()===0||Bh.getFocusedWindow()||m?.win?.isMinimized())&&await this.confirmBeforeQuit(v)&&this.nativeHostMainService.quit(void 0)}})),d=[i];d.push(...r),s&&d.push(Ms(),s),d.push(Ms(),o,Ms(),a,c,l,Ms(),u),d.forEach(f=>e.append(f))}async confirmBeforeQuit(e){if(this.windowsMainService.getWindowCount()===0)return!0;const i=this.configurationService.getValue("window.confirmBeforeClose");if(i==="always"||i==="keyboardOnly"&&this.isKeyboardEvent(e)){const{response:r}=await this.nativeHostMainService.showMessageBox(this.windowsMainService.getFocusedWindow()?.id,{type:"question",buttons:[w(2131,null),w(2132,null)],message:w(2133,null)});return r===0}return!0}shouldDrawMenu(e){if(!O&&!Nn(this.configurationService))return!1;switch(e){case"File":case"Help":if(O)return this.windowsMainService.getWindowCount()===0&&this.closedLastWindow||this.windowsMainService.getWindowCount()>0&&this.noActiveMainWindow||!!this.menubarMenus&&!!this.menubarMenus[e];case"Window":if(O)return this.windowsMainService.getWindowCount()===0&&this.closedLastWindow||this.windowsMainService.getWindowCount()>0&&this.noActiveMainWindow||!!this.menubarMenus;default:return this.windowsMainService.getWindowCount()>0&&!!this.menubarMenus&&!!this.menubarMenus[e]}}setMenu(e,i){i.forEach(r=>{if(_E(r))e.append(Ms());else if(SE(r)){const s=new It,n=new Fe({label:this.mnemonicLabel(r.label),submenu:s});this.setMenu(s,r.submenu.items),e.append(n)}else bE(r)?e.append(this.createOpenRecentMenuItem(r)):NR(r)&&(r.id==="workbench.action.showAboutDialog"&&this.insertCheckForUpdatesItems(e),O?this.windowsMainService.getWindowCount()===0&&this.closedLastWindow||this.windowsMainService.getWindowCount()>0&&this.noActiveMainWindow?this.fallbackMenuHandlers[r.id]?e.append(new Fe(this.likeAction(r.id,{label:this.mnemonicLabel(r.label),click:this.fallbackMenuHandlers[r.id]}))):e.append(this.createMenuItem(r.label,r.id,!1,r.checked)):e.append(this.createMenuItem(r.label,r.id,r.enabled!==!1,!!r.checked)):e.append(this.createMenuItem(r.label,r.id,r.enabled!==!1,!!r.checked)))})}setMenuById(e,i){this.menubarMenus&&this.menubarMenus[i]&&this.setMenu(e,this.menubarMenus[i].items)}insertCheckForUpdatesItems(e){const i=this.getUpdateMenuItems();i.length&&(i.forEach(r=>e.append(r)),e.append(Ms()))}createOpenRecentMenuItem(e){const i=x.revive(e.uri),r=e.id,s=r==="openRecentFile"?{fileUri:i}:r==="openRecentWorkspace"?{workspaceUri:i}:{folderUri:i};return new Fe(this.likeAction(r,{label:e.label,click:async(n,o,a)=>{const c=this.isOptionClick(a);(await this.windowsMainService.open({context:2,cli:this.environmentMainService.args,urisToOpen:[s],forceNewWindow:c,gotoLineMode:!1,remoteAuthority:e.remoteAuthority})).length>0||await this.workspacesHistoryMainService.removeRecentlyOpened([i])}},!1))}isOptionClick(e){return!!(e&&(!O&&(e.ctrlKey||e.shiftKey)||O&&(e.metaKey||e.altKey)))}isKeyboardEvent(e){return!!(e.triggeredByAccelerator||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}createRoleMenuItem(e,i,r){const s={label:this.mnemonicLabel(e),role:r,enabled:!0};return new Fe(this.withKeybinding(i,s))}setMacWindowMenu(e){const i=new Fe({label:w(2134,null),role:"minimize",accelerator:"Command+M",enabled:this.windowsMainService.getWindowCount()>0}),r=new Fe({label:w(2135,null),role:"zoom",enabled:this.windowsMainService.getWindowCount()>0}),s=new Fe({label:w(2136,null),role:"front",enabled:this.windowsMainService.getWindowCount()>0}),n=this.createMenuItem(w(2137,null),"workbench.action.switchWindow"),o=[];this.currentEnableNativeTabs&&(o.push(Ms()),o.push(this.createMenuItem(w(2138,null),"workbench.action.newWindowTab")),o.push(this.createRoleMenuItem(w(2139,null),"workbench.action.showPreviousWindowTab","selectPreviousTab")),o.push(this.createRoleMenuItem(w(2140,null),"workbench.action.showNextWindowTab","selectNextTab")),o.push(this.createRoleMenuItem(w(2141,null),"workbench.action.moveWindowTabToNewWindow","moveTabToNewWindow")),o.push(this.createRoleMenuItem(w(2142,null),"workbench.action.mergeAllWindowTabs","mergeAllWindows"))),[i,r,Ms(),n,...o,Ms(),s].forEach(a=>e.append(a))}getUpdateMenuItems(){switch(this.updateService.state.type){case"idle":return[new Fe({label:this.mnemonicLabel(w(2143,null)),click:()=>setTimeout(()=>{this.reportMenuActionTelemetry("CheckForUpdate"),this.updateService.checkForUpdates(!0)},0)})];case"checking for updates":return[new Fe({label:w(2144,null),enabled:!1})];case"available for download":return[new Fe({label:this.mnemonicLabel(w(2145,null)),click:()=>{this.updateService.downloadUpdate()}})];case"downloading":return[new Fe({label:w(2146,null),enabled:!1})];case"downloaded":return O?[]:[new Fe({label:this.mnemonicLabel(w(2147,null)),click:()=>{this.reportMenuActionTelemetry("InstallUpdate"),this.updateService.applyUpdate()}})];case"updating":return[new Fe({label:w(2148,null),enabled:!1})];case"ready":return[new Fe({label:this.mnemonicLabel(w(2149,null)),click:()=>{this.reportMenuActionTelemetry("RestartToUpdate"),this.updateService.quitAndInstall()}})];default:return[]}}createMenuItem(e,i,r,s){const n=this.mnemonicLabel(e),o=typeof i=="function"?i:(d,f,p)=>{const v=d?d.userSettingsLabel:null;let m=i;Array.isArray(i)&&(m=this.isOptionClick(p)?i[1]:i[0]),v&&p.triggeredByAccelerator?this.runActionInRenderer({type:"keybinding",userSettingsLabel:v}):this.runActionInRenderer({type:"commandId",commandId:m})},a=typeof r=="boolean"?r:this.windowsMainService.getWindowCount()>0,c=typeof s=="boolean"?s:!1,l={label:n,click:o,enabled:a};c&&(l.type="checkbox",l.checked=c);let u;return typeof i=="string"?u=i:Array.isArray(i)&&(u=i[0]),O&&(u==="editor.action.clipboardCutAction"?l.role="cut":u==="editor.action.clipboardCopyAction"?l.role="copy":u==="editor.action.clipboardPasteAction"&&(l.role="paste"),u==="undo"?l.click=this.makeContextAwareClickHandler(o,{inDevTools:d=>d.undo(),inNoWindow:()=>It.sendActionToFirstResponder("undo:")}):u==="redo"?l.click=this.makeContextAwareClickHandler(o,{inDevTools:d=>d.redo(),inNoWindow:()=>It.sendActionToFirstResponder("redo:")}):u==="editor.action.selectAll"&&(l.click=this.makeContextAwareClickHandler(o,{inDevTools:d=>d.selectAll(),inNoWindow:()=>It.sendActionToFirstResponder("selectAll:")}))),new Fe(this.withKeybinding(u,l))}makeContextAwareClickHandler(e,i){return(r,s,n)=>{const o=Bh.getFocusedWindow();if(!o)return i.inNoWindow();if(o.webContents.isDevToolsFocused()&&o.webContents.devToolsWebContents)return i.inDevTools(o.webContents.devToolsWebContents);e(r,s||o,n)}}runActionInRenderer(e){let i=Bh.getFocusedWindow();if(i){const s=this.auxiliaryWindowsMainService.getWindowByWebContents(i.webContents);s&&(i=this.windowsMainService.getWindowById(s.parentId)?.win??null)}if(!i){const s=this.windowsMainService.getLastActiveWindow();s?.win?.isMinimized()&&(i=s.win)}const r=i?this.windowsMainService.getWindowById(i.id):void 0;if(r){if(this.logService.trace("menubar#runActionInRenderer",e),O&&!this.environmentMainService.isBuilt&&!r.isReady&&(e.type==="commandId"&&e.commandId==="workbench.action.toggleDevTools"||e.type!=="commandId"&&e.userSettingsLabel==="alt+cmd+i"))return!1;if(e.type==="commandId"){const s={id:e.commandId,from:"menu"};r.sendWhenReady("vscode:runAction",Te.None,s)}else{const s={userSettingsLabel:e.userSettingsLabel};r.sendWhenReady("vscode:runKeybinding",Te.None,s)}return!0}else return this.logService.trace("menubar#runActionInRenderer: no active window found",e),!1}withKeybinding(e,i){const r=typeof e=="string"?this.keybindings[e]:void 0;if(r?.label){if(r.isNative!==!1)i.accelerator=r.label,i.userSettingsLabel=r.userSettingsLabel;else if(typeof i.label=="string"){const s=i.label.indexOf("[");s>=0?i.label=`${i.label.substr(0,s)} [${r.label}]`:i.label=`${i.label} [${r.label}]`}}else i.accelerator=void 0;return i}likeAction(e,i,r=!i.accelerator){r&&(i=this.withKeybinding(e,i));const s=i.click;return i.click=(n,o,a)=>{this.reportMenuActionTelemetry(e),s?.(n,o,a)},i}openUrl(e,i){this.nativeHostMainService.openExternal(void 0,e),this.reportMenuActionTelemetry(i)}reportMenuActionTelemetry(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e,from:Il})}mnemonicLabel(e){return JC(e,!this.currentEnableMenuBarMnemonics)}},Hh=jh=__decorate([__param(0,Jn),__param(1,Qe),__param(2,ot),__param(3,st),__param(4,ei),__param(5,Cl),__param(6,Ii),__param(7,ze),__param(8,V),__param(9,Jr),__param(10,qe),__param(11,la)],Hh)}}),uv,Vh,jR=g({"out-build/vs/platform/menubar/electron-main/menubarMainService.js"(){"use strict";G(),ft(),K(),BR(),L(),uv=j("menubarMainService"),Vh=class extends N{constructor(e,i,r){super(),this.instantiationService=e,this.lifecycleMainService=i,this.logService=r,this.menubar=this.installMenuBarAfterWindowOpen()}async installMenuBarAfterWindowOpen(){return await this.lifecycleMainService.when(3),this._register(this.instantiationService.createInstance(Hh))}async updateMenubar(e,i){this.logService.trace("menubarService#updateMenubar",e),(await this.menubar).updateMenu(i,e)}},Vh=__decorate([__param(0,Or),__param(1,ze),__param(2,V)],Vh)}}),Xn,dv,hv,Xr=g({"out-build/vs/platform/policy/common/policy.js"(){"use strict";q(),Nu(),L(),G(),Xn=j("policy"),dv=class extends N{constructor(){super(...arguments),this.policyDefinitions={},this.policies=new Map,this._onDidChange=this._register(new D),this.onDidChange=this._onDidChange.event}async updatePolicyDefinitions(t){const e=Object.keys(this.policyDefinitions).length;return this.policyDefinitions={...t,...this.policyDefinitions},e!==Object.keys(this.policyDefinitions).length&&await this._updatePolicyDefinitions(this.policyDefinitions),_n.reduce(this.policies.entries(),(i,[r,s])=>({...i,[r]:s}),{})}getPolicyValue(t){return this.policies.get(t)}serialize(){return _n.reduce(Object.entries(this.policyDefinitions),(t,[e,i])=>({...t,[e]:{definition:i,value:this.policies.get(e)}}),{})}},hv=class{constructor(){this.onDidChange=P.None,this.policyDefinitions={}}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}}});async function HR(t,e,i,r,s){try{const n=await import("@vscode/spdlog");n.setFlushOn(Ts.Trace);const o=await n.createAsyncRotatingLogger(t,e,i,r);return s?o.clearFormatters():o.setPattern("%Y-%m-%d %H:%M:%S.%e [%l] %v"),o}catch(n){console.error(n)}return null}function xE(t,e,i){switch(e){case X.Trace:t.trace(i);break;case X.Debug:t.debug(i);break;case X.Info:t.info(i);break;case X.Warning:t.warn(i);break;case X.Error:t.error(i);break;case X.Off:break;default:throw new Error(`Invalid log level ${e}`)}}function CE(t,e){switch(e){case X.Trace:t.setLevel(Ts.Trace);break;case X.Debug:t.setLevel(Ts.Debug);break;case X.Info:t.setLevel(Ts.Info);break;case X.Warning:t.setLevel(Ts.Warning);break;case X.Error:t.setLevel(Ts.Error);break;case X.Off:t.setLevel(Ts.Off);break;default:throw new Error(`Invalid log level ${e}`)}}var Ts,IE,VR=g({"out-build/vs/platform/log/node/spdlogLog.js"(){"use strict";Ze(),K(),(function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Info=2]="Info",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.Off=6]="Off"})(Ts||(Ts={})),IE=class extends xm{constructor(t,e,i,r,s){super(),this.buffer=[],this.setLevel(s),this._loggerCreationPromise=this._createSpdLogLogger(t,e,i,r),this._register(this.onDidChangeLogLevel(n=>{this._logger&&CE(this._logger,n)}))}async _createSpdLogLogger(t,e,i,r){const s=i?6:1,n=30/s*On.MB,o=await HR(t,e,n,s,r);if(o){this._logger=o,CE(this._logger,this.getLevel());for(const{level:a,message:c}of this.buffer)xE(this._logger,a,c);this.buffer=[]}}log(t,e){this._logger?xE(this._logger,t,e):this.getLevel()<=t&&this.buffer.push({level:t,message:e})}flush(){this._logger?this.flushLogger():this._loggerCreationPromise.then(()=>this.flushLogger())}dispose(){this._logger?this.disposeLogger():this._loggerCreationPromise.then(()=>this.disposeLogger()),super.dispose()}flushLogger(){this._logger&&this._logger.flush()}disposeLogger(){this._logger&&(this._logger.drop(),this._logger=void 0)}}}}),DE,qR=g({"out-build/vs/platform/log/node/loggerService.js"(){"use strict";Hi(),K(),VR(),DE=class extends Wb{doCreateLogger(t,e,i){return new IE(ui(),t.fsPath,!i?.donotRotate,!!i?.donotUseFormatters,e)}}}}),ya,AE,Dl=g({"out-build/vs/platform/log/electron-main/loggerService.js"(){"use strict";ai(),q(),G(),K(),qR(),ya=Bc,AE=class extends DE{constructor(){super(...arguments),this.loggerResourcesByWindow=new Bt}createLogger(t,e,i){i!==void 0&&this.loggerResourcesByWindow.set(this.toResource(t),i);try{return super.createLogger(t,e)}catch(r){throw this.loggerResourcesByWindow.delete(this.toResource(t)),r}}registerLogger(t,e){e!==void 0&&this.loggerResourcesByWindow.set(t.resource,e),super.registerLogger(t)}deregisterLogger(t){this.loggerResourcesByWindow.delete(t),super.deregisterLogger(t)}getGlobalLoggers(){const t=[];for(const e of super.getRegisteredLoggers())this.loggerResourcesByWindow.has(e.resource)||t.push(e);return t}getOnDidChangeLogLevelEvent(t){return P.filter(this.onDidChangeLogLevel,e=>Rb(e)||this.isInterestedLoggerResource(e[0],t))}getOnDidChangeVisibilityEvent(t){return P.filter(this.onDidChangeVisibility,([e])=>this.isInterestedLoggerResource(e,t))}getOnDidChangeLoggersEvent(t){return P.filter(P.map(this.onDidChangeLoggers,e=>({added:[...e.added].filter(r=>this.isInterestedLoggerResource(r.resource,t)),removed:[...e.removed].filter(r=>this.isInterestedLoggerResource(r.resource,t))})),e=>e.added.length>0||e.removed.length>0)}deregisterLoggers(t){for(const[e,i]of this.loggerResourcesByWindow)i===t&&this.deregisterLogger(e)}isInterestedLoggerResource(t,e){const i=this.loggerResourcesByWindow.get(t);return i===void 0||i===e}dispose(){super.dispose(),this.loggerResourcesByWindow.clear()}}}});function zR(t){if(Po===2&&/^penguin(\.|$)/i.test(t))return"chromebook"}function GR(t,e,i,r,s,n,o,a,c,l,u){const d=Object.create(null);d["common.machineId"]=n,d["common.macMachineId"]=o,d["common.sqmId"]=a,d["common.devDeviceId"]=c,d.sessionID=ui()+Date.now(),d.commitHash=r,d.version=s,d["common.platformVersion"]=(t||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),d["common.platform"]=ry(Po),d["common.nodePlatform"]=_g,d["common.nodeArch"]=i,d["common.product"]=u||"desktop",l&&(d["common.msftInternal"]=l);let f=0;const p=Date.now();Object.defineProperties(d,{timestamp:{get:()=>new Date,enumerable:!0},"common.timesincesessionstart":{get:()=>Date.now()-p,enumerable:!0},"common.sequence":{get:()=>f++,enumerable:!0}}),cg&&(d["common.snap"]="true");const v=zR(e);return v&&(d["common.platformDetail"]=v),d}function KR(t){const e=er.USERDNSDOMAIN;if(!e)return!1;const i=e.toLowerCase();return t.some(r=>i===r)}var RE=g({"out-build/vs/platform/telemetry/common/commonProperties.js"(){"use strict";z(),Wr(),Hi()}});function ME(t,e){return!e.isBuilt&&!e.disableTelemetry?!0:!(e.disableTelemetry||!t.enableTelemetry)}function fv(t){const e=t.getValue(Zc),i=t.getValue(e1);if(t.getValue($d)===!1||i===!1)return 0;switch(e??"all"){case"all":return 3;case"off":return 0}}function YR(t,e){const i=t.msftInternalDomains||[],r=e.getValue("telemetry.internalTesting");return KR(i)||r}function JR(t){return[t.appRoot,t.extensionsPath,t.userHome.fsPath,t.tmpDir.fsPath,t.userDataPath]}function QR(t,e){if(!t||!t.includes("/")&&!t.includes("\\"))return t;let i=t;const r=[];for(const a of e)for(;;){const c=a.exec(t);if(!c)break;r.push([c.index,a.lastIndex])}const s=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,n=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let o=0;for(i="";;){const a=n.exec(t);if(!a)break;const c=r.some(([l,u])=>a.index<u&&l<n.lastIndex);!s.test(a[0])&&!c&&(i+=t.substring(o,a.index)+"<REDACTED: user-file-path>",o=n.lastIndex)}return o<t.length&&(i+=t.substr(o)),i}function XR(t){if(!t)return t;const e=[{label:"Google API Key",regex:/AIza[A-Za-z0-9_\\\-]{35}/},{label:"Slack Token",regex:/xox[pbar]\-[A-Za-z0-9]/},{label:"GitHub Token",regex:/(gh[psuro]_[a-zA-Z0-9]{36}|github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59})/},{label:"Generic Secret",regex:/(key|token|sig|secret|signature|password|passwd|pwd|android:value)[^a-zA-Z0-9]/i},{label:"CLI Credentials",regex:/((login|psexec|(certutil|psexec)\.exe).{1,50}(\s-u(ser(name)?)?\s+.{3,100})?\s-(admin|user|vm|root)?p(ass(word)?)?\s+["']?[^$\-\/\s]|(^|[\s\r\n\\])net(\.exe)?.{1,5}(user\s+|share\s+\/user:| user -? secrets ? set) \s + [^ $\s \/])/},{label:"Microsoft Entra ID",regex:/eyJ(?:0eXAiOiJKV1Qi|hbGci|[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+\.)/},{label:"Email",regex:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/}];for(const i of e)if(i.regex.test(t))return`<REDACTED: ${i.label}>`;return t}function TE(t,e){return Z3(t,i=>{if(i instanceof WE||Object.hasOwnProperty.call(i,"isTrustedTelemetryValue"))return i.value;if(typeof i=="string"){let r=i.replaceAll("%20"," ");r=QR(r,e);for(const s of e)r=r.replace(s,"");return r=XR(r),r}})}var WE,LE,Al,OE,ZR,Zn=g({"out-build/vs/platform/telemetry/common/telemetryUtils.js"(){"use strict";ur(),xe(),we(),nl(),RE(),ti(),WE=class{constructor(t){this.value=t,this.isTrustedTelemetryValue=!0}},LE=class{constructor(){this.telemetryLevel=0,this.sessionId="someValue.sessionId",this.machineId="someValue.machineId",this.macMachineId="someValue.macMachineId",this.sqmId="someValue.sqmId",this.devDeviceId="someValue.devDeviceId",this.firstSessionDate="someValue.firstSessionDate",this.sendErrorTelemetry=!1}registerAuthId(){}publicLog(){}publicLog2(){}publicLogError(){}publicLogError2(){}publicLogCapture(){}setExperimentProperty(){}},Al=new LE,OE="telemetry",ZR={id:OE,name:w(2238,null)}}}),qh,pv,gv,eM=g({"out-build/vs/platform/sharedProcess/common/sharedProcess.js"(){"use strict";qh={exit:"vscode:electron-main->shared-process=exit",ipcReady:"vscode:shared-process->electron-main=ipc-ready",initDone:"vscode:shared-process->electron-main=init-done"},pv={request:"vscode:createSharedProcessChannelConnection",response:"vscode:createSharedProcessChannelConnectionResult"},gv={request:"vscode:createSharedProcessRawConnection",response:"vscode:createSharedProcessRawConnectionResult"}}}),zh,tM=g({"out-build/vs/platform/sharedProcess/electron-main/sharedProcess.js"(){"use strict";nr(),ae(),L(),ct(),ft(),K(),zr(),Xr(),Dl(),oa(),Zn(),vm(),xe(),eM(),q(),zh=class extends N{constructor(e,i,r,s,n,o,a,c,l,u){super(),this.machineId=e,this.macMachineId=i,this.sqmId=r,this.devDeviceId=s,this.environmentMainService=n,this.userDataProfilesService=o,this.lifecycleMainService=a,this.logService=c,this.loggerMainService=l,this.policyService=u,this.firstWindowConnectionBarrier=new Tc,this.utilityProcess=void 0,this.utilityProcessLogListener=void 0,this._onDidCrash=this._register(new D),this.onDidCrash=this._onDidCrash.event,this._whenReady=void 0,this._whenIpcReady=void 0,this.registerListeners()}registerListeners(){We.on(pv.request,(e,i)=>this.onWindowConnection(e,i,pv.response)),We.on(gv.request,(e,i)=>this.onWindowConnection(e,i,gv.response)),this._register(this.lifecycleMainService.onWillShutdown(()=>this.onWillShutdown()))}async onWindowConnection(e,i,r){this.logService.trace(`[SharedProcess] onWindowConnection for: ${r}`),this.firstWindowConnectionBarrier.isOpen()||this.firstWindowConnectionBarrier.open(),await this.whenReady();const s=await this.connect(r);if(e.sender.isDestroyed())return s.close();e.sender.postMessage(r,i,[s])}onWillShutdown(){this.logService.trace("[SharedProcess] onWillShutdown"),this.utilityProcess?.postMessage(qh.exit),this.utilityProcess=void 0}whenReady(){return this._whenReady||(this._whenReady=(async()=>{await this.whenIpcReady;const e=new ys;this.utilityProcess?.once(qh.initDone,()=>e.complete()),await e.p,this.utilityProcessLogListener?.dispose(),this.logService.trace("[SharedProcess] Overall ready")})()),this._whenReady}get whenIpcReady(){return this._whenIpcReady||(this._whenIpcReady=(async()=>{await this.firstWindowConnectionBarrier.wait(),this.createUtilityProcess();const e=new ys;this.utilityProcess?.once(qh.ipcReady,()=>e.complete()),await e.p,this.logService.trace("[SharedProcess] IPC ready")})()),this._whenIpcReady}createUtilityProcess(){this.utilityProcess=this._register(new sn(this.logService,Al,this.lifecycleMainService)),this.utilityProcessLogListener=this.utilityProcess.onMessage(r=>{typeof r.warning=="string"?this.logService.warn(r.warning):typeof r.error=="string"&&this.logService.error(r.error)});const e=JI(this.environmentMainService.args,this.environmentMainService.isBuilt);let i;e.port&&(i=["--nolazy"],e.break?i.push(`--inspect-brk=${e.port}`):i.push(`--inspect=${e.port}`)),this.utilityProcess.start({processTitle:"shared-process",type:"shared-process",entryPoint:"vs/code/electron-utility/sharedProcess/sharedProcessMain",payload:this.createSharedProcessConfiguration(),respondToAuthRequestsFromMainProcess:!0,execArgv:i}),this._register(this.utilityProcess.onCrash(()=>this._onDidCrash.fire()))}createSharedProcessConfiguration(){return{machineId:this.machineId,macMachineId:this.macMachineId,sqmId:this.sqmId,devDeviceId:this.devDeviceId,codeCachePath:this.environmentMainService.codeCachePath,profiles:{home:this.userDataProfilesService.profilesHome,all:this.userDataProfilesService.profiles},args:this.environmentMainService.args,logLevel:this.loggerMainService.getLogLevel(),loggers:this.loggerMainService.getGlobalLoggers(),policiesData:this.policyService.serialize()}}async connect(e){return await this.whenIpcReady,Fu(this.utilityProcess).connect(e)}},zh=__decorate([__param(4,st),__param(5,qr),__param(6,ze),__param(7,V),__param(8,ya),__param(9,Xn)],zh)}}),FE,Sa,mv=g({"out-build/vs/platform/sign/common/sign.js"(){"use strict";G(),FE="signService",Sa=j(FE)}});function iM(t){return typeof t=="object"&&t!==null&&"prefix"in t&&typeof t.prefix=="string"}var rM=g({"out-build/vs/platform/storage/common/storageIpc.js"(){"use strict";Nd(),q(),L()}}),NE,sM=g({"out-build/vs/platform/storage/electron-main/storageIpc.js"(){"use strict";q(),L(),rd(),rM(),hi(),NE=class A8 extends N{static{this.STORAGE_CHANGE_DEBOUNCE_TIME=100}constructor(e,i){super(),this.logService=e,this.storageMainService=i,this.onDidChangeApplicationStorageEmitter=this._register(new D),this.mapProfileToOnDidChangeProfileStorageEmitter=new Map,this.mapWorkspaceToOnDidChangeWorkspaceStorageEmitter=new Map,this.registerStorageChangeListeners(i.applicationStorage,this.onDidChangeApplicationStorageEmitter)}registerStorageChangeListeners(e,i){this._register(P.debounce(e.onDidChangeStorage,(r,s)=>(r?r.push(s):r=[s],r),A8.STORAGE_CHANGE_DEBOUNCE_TIME)(r=>{r.length&&i.fire(this.serializeStorageChangeEvents(r,e))}))}serializeStorageChangeEvents(e,i){const r=new Map,s=new Set;return e.forEach(n=>{const o=i.get(n.key);typeof o=="string"?r.set(n.key,o):s.add(n.key)}),{changed:Array.from(r.entries()),deleted:Array.from(s.values())}}listen(e,i,r){switch(i){case"onDidChangeStorage":{const s=r.profile?zs(r.profile):void 0,n=b4(r.workspace);if(n){let a=this.mapWorkspaceToOnDidChangeWorkspaceStorageEmitter.get(n.id);return a||(a=this._register(new D),this.registerStorageChangeListeners(this.storageMainService.workspaceStorage(n),a),this.mapWorkspaceToOnDidChangeWorkspaceStorageEmitter.set(n.id,a)),a.event}if(!s)return this.onDidChangeApplicationStorageEmitter.event;let o=this.mapProfileToOnDidChangeProfileStorageEmitter.get(s.id);return o||(o=this._register(new D),this.registerStorageChangeListeners(this.storageMainService.profileStorage(s),o),this.mapProfileToOnDidChangeProfileStorageEmitter.set(s.id,o)),o.event}}throw new Error(`Event not found: ${i}`)}async call(e,i,r){let s={profile:void 0,workspace:void 0};if(Array.isArray(r)){if(i!=="cursorDiskKVGet"&&i!=="cursorDiskKVSet")throw new Error(`Unexpected array argument for command: ${i}`);const[c,l]=r;s={profile:c,workspace:l}}else s=r;const n=s.profile?zs(s.profile):void 0,o=b4(s.workspace),a=await this.withStorageInitialized(n,o);if(Array.isArray(r))switch(i){case"cursorDiskKVGet":{const[,,c]=r;return a.cursorDiskKVGet(c)}case"cursorDiskKVSet":{const[,,c,l]=r;return a.cursorDiskKVSet(c,l)}default:throw new Error(`Call not found: ${i}`)}switch(i){case"getItems":return Array.from(a.items.entries());case"updateItems":{const c=s;if(c.insert)for(const[l,u]of c.insert)a.set(l,u);c.delete?.forEach(l=>a.delete(l));break}case"optimize":return a.optimize();case"isUsed":{const c=s.payload;if(typeof c=="string")return this.storageMainService.isUsed(c)}case"cursorDiskKVClearPrefix":{if(!iM(s))throw new Error("Invalid request for cursorDiskKVClearPrefix");const c=s;return a.cursorDiskKVClearPrefix(c.prefix)}default:throw new Error(`Call not found: ${i}`)}}async withStorageInitialized(e,i){let r;i?r=this.storageMainService.workspaceStorage(i):e?r=this.storageMainService.profileStorage(e):r=this.storageMainService.applicationStorage;try{await r.init()}catch(s){this.logService.error(`StorageIPC#init: Unable to init ${i?"workspace":e?"profile":"application"} storage due to ${s}`)}return r}}}}),UE,nM=g({"out-build/vs/platform/telemetry/common/telemetryIpc.js"(){"use strict";UE=class{constructor(t){this.channel=t}log(t,e){return this.channel.call("log",{eventName:t,data:e}).then(void 0,i=>`Failed to log telemetry: ${console.warn(i)}`),Promise.resolve(null)}flush(){return Promise.resolve()}registerAuthId(t){this.channel.call("registerAuthId",{eventName:"registerAuthId",data:t})}capture(t,e){return this.channel.call("capture",{eventName:t,data:e}).then(void 0,i=>`Failed to log telemetry: ${console.warn(i)}`),Promise.resolve(null)}}}});function oM(){const t=w(2231,null,Qr.nameLong),e=w(2232,null,"https://cursor.com/privacy","https://cursor.com/security"),i=us?"":w(2233,null);return`
|
|
${t} ${e} ${i}
|
|
`}var Gh,$E,aM=g({"out-build/vs/platform/telemetry/common/telemetryService.js"(){"use strict";L(),ur(),z(),jt(),we(),Xe(),Cn(),Sl(),lt(),ms(),ti(),Zn(),Gh=class{static{this.IDLE_START_EVENT_NAME="UserIdleStart"}static{this.IDLE_STOP_EVENT_NAME="UserIdleStop"}constructor(e,i,r){this._configurationService=i,this._productService=r,this._experimentProperties={},this._disposables=new ke,this._cleanupPatterns=[],this._appenders=e.appenders,this._commonProperties=e.commonProperties??Object.create(null),this.sessionId=this._commonProperties.sessionID,this.machineId=this._commonProperties["common.machineId"],this.macMachineId=this._commonProperties["common.macMachineId"],this.sqmId=this._commonProperties["common.sqmId"],this.devDeviceId=this._commonProperties["common.devDeviceId"],this.firstSessionDate=this._commonProperties["common.firstSessionDate"],this.msftInternal=this._commonProperties["common.msftInternal"],this._piiPaths=e.piiPaths||[],this._telemetryLevel=3,this._sendErrorTelemetry=!!e.sendErrorTelemetry,this._cleanupPatterns=[/(vscode-)?file:\/\/\/.*?\/resources\/app\//gi];for(const s of this._piiPaths)this._cleanupPatterns.push(new RegExp(fc(s),"gi")),s.indexOf("\\")>=0&&this._cleanupPatterns.push(new RegExp(fc(s.replace(/\\/g,"/")),"gi"));this._updateTelemetryLevel(),this._disposables.add(this._configurationService.onDidChangeConfiguration(s=>{(s.affectsConfiguration(Zc)||s.affectsConfiguration($d)||s.affectsConfiguration(e1))&&this._updateTelemetryLevel()}))}setExperimentProperty(e,i){this._experimentProperties[e]=i}_updateTelemetryLevel(){let e=fv(this._configurationService);const i=this._productService.enabledTelemetryLevels;if(i){this._sendErrorTelemetry=this.sendErrorTelemetry?i.error:!1;const r=i.usage?3:i.error?2:0;e=Math.min(e,r)}this._telemetryLevel=e}get sendErrorTelemetry(){return this._sendErrorTelemetry}get telemetryLevel(){return this._telemetryLevel}dispose(){this._disposables.dispose()}_log(e,i,r){this._telemetryLevel<i||(r=sl(r,this._experimentProperties),r=TE(r,this._cleanupPatterns),r=sl(r,this._commonProperties),this._appenders.forEach(s=>s.log(e,r)))}_capture(e,i,r){this._telemetryLevel<i||(r=sl(r,this._experimentProperties),r=TE(r,this._cleanupPatterns),r=sl(r,this._commonProperties),this._appenders.forEach(s=>{s.capture(e,r)}))}registerAuthId(e){this._appenders.forEach(i=>i.registerAuthId(e))}publicLog(e,i){this._log(e,3,i)}publicLog2(e,i){this.publicLog(e,i)}publicLogError(e,i){this._sendErrorTelemetry&&this._log(e,2,i)}publicLogError2(e,i){this.publicLogError(e,i)}publicLogCapture(e,i){this._capture(e,3,i)}},Gh=__decorate([__param(1,Qe),__param(2,qe)],Gh),$E=Ei.as(ir.Configuration),$E.registerConfiguration({id:q4,order:1,type:"object",title:"Crash Reporting",properties:{[Zc]:{type:"string",enum:["all","off"],enumDescriptions:["Send OS-level crash reports.","Disable crash reporting."],markdownDescription:oM(),default:"all",restricted:!0,scope:1,tags:["usesOnlineServices","telemetry"]},"telemetry.feedback.enabled":{type:"boolean",default:!1,description:w(2234,null)},[$d]:{type:"boolean",markdownDescription:Qr.privacyStatementUrl?w(2236,null,Qr.nameLong,Qr.privacyStatementUrl):w(2235,null,Qr.nameLong),default:!0,restricted:!0,markdownDeprecationMessage:w(2237,null,`\`#${Zc}#\``),scope:1,tags:["usesOnlineServices","telemetry"]}}})}}),BE,cM=g({"out-build/vs/platform/update/common/updateIpc.js"(){"use strict";q(),L(),cn(),BE=class{constructor(t){this.service=t}listen(t,e){switch(e){case"onStateChange":return this.service.onStateChange}throw new Error(`Event not found: ${e}`)}call(t,e,i){switch(e){case"checkForUpdates":return this.service.checkForUpdates(i);case"downloadUpdate":return this.service.downloadUpdate();case"applyUpdate":return this.service.applyUpdate();case"quitAndInstall":return this.service.quitAndInstall();case"_getInitialState":return Promise.resolve(this.service.state);case"isLatestVersion":return this.service.isLatestVersion();case"_applySpecificUpdate":return this.service._applySpecificUpdate(i)}throw new Error(`Call not found: ${e}`)}}}});import*as jE from"original-fs";import lM from"path";import uM from"os";function dM(t){return HE.includes(t)}var Tt,HE,_a,vv=g({"out-build/vs/platform/update/electron-main/abstractUpdateService.js"(){"use strict";ae(),St(),q(),Xe(),ct(),ft(),K(),lt(),Rs(),cn(),tn(),L(),HE=["stable","prerelease","dev"],_a=class extends N{static{Tt=this}static{this.UPDATE_RESTART_MARKER="cursor.update.restartMarker"}static{this.UPDATE_TARGET_VERSION="cursor.update.targetVersion"}static{this.UPDATE_READY_TIME="cursor.update.readyTime"}static{this.UPDATE_QUIT_TIME="cursor.update.quitTime"}static{this.UPDATE_EXPLICIT_RESTART="cursor.update.explicitRestart"}get state(){return this._state}setState(e){if(this.logService.info("update#setState",e.type),this._state=e,this._onStateChange.fire(e),e.type==="ready")try{const i=Date.now();this.applicationStorageMainService.store(Tt.UPDATE_READY_TIME,i,-1,1),this.storeEvent({type:"cursor.update.ready",data:{updateVersion:e.update.version,currentVersion:this.productService.version}})}catch(i){this.logService.error("update#setState - failed to store update ready time",i)}else if(e.type==="idle"||e.type==="checking for updates")try{const i=this.applicationStorageMainService.getBoolean(Tt.UPDATE_RESTART_MARKER,-1,!1),r=this.applicationStorageMainService.getNumber(Tt.UPDATE_READY_TIME,-1,0);i&&r&&Date.now()-r>2880*60*1e3&&(this.logService.info("update#setState - cleaning up stale update tracking data"),this.clearUpdateTrackingData())}catch(i){this.logService.error("update#setState - failed to clean up stale data",i)}}constructor(e,i,r,s,n,o,a){super(),this.lifecycleMainService=e,this.configurationService=i,this.environmentMainService=r,this.requestService=s,this.logService=n,this.productService=o,this.applicationStorageMainService=a,this._state=fe.Uninitialized,this._onStateChange=new D,this.onStateChange=this._onStateChange.event,e.when(3).finally(()=>this.initialize())}async initialize(){if(this.removeUpdateFileIfExists(),!this.environmentMainService.isBuilt){this.setState(fe.Disabled(0)),this.logService.info("update#ctor - updates are disabled by the environment");return}if(this.environmentMainService.disableUpdates){this.setState(fe.Disabled(1)),this.logService.info("update#ctor - updates are disabled by the environment");return}if(!this.productService.updateUrl||!this.productService.commit){this.setState(fe.Disabled(3)),this.logService.info("update#ctor - updates are disabled as there is no update URL");return}const e=this.configurationService.getValue("update.mode"),i=this.getProductQualityForUpdateMode(e);if(!i){this.setState(fe.Disabled(2)),this.logService.info("update#ctor - updates are disabled by user preference");return}if(await this.applicationStorageMainService.whenReady,this.checkUpdateRestartResult(),this.url=this.buildUpdateUrl(i,!1),!this.url){this.setState(fe.Disabled(4)),this.logService.info("update#ctor - updates are disabled as the update URL is badly formed");return}if(this._register(P.debounce(this.configurationService.onDidChangeConfiguration,(r,s)=>s,1e3)((r=>{r.affectsConfiguration("update.releaseTrack")&&this.onReleaseTrackChanged()}))),this.setState(fe.Idle(this.getUpdateType())),e==="manual"){this.logService.info("update#ctor - manual checks only; automatic updates are disabled by user preference");return}e==="start"?(this.logService.info("update#ctor - startup checks only; automatic updates are disabled by user preference"),setTimeout(()=>this.checkForUpdates(!1),30*1e3)):this.scheduleCheckForUpdates(30*1e3).then(void 0,r=>this.logService.error(r))}checkUpdateRestartResult(){try{const e=this.applicationStorageMainService.getBoolean(Tt.UPDATE_RESTART_MARKER,-1,!1),i=this.applicationStorageMainService.get(Tt.UPDATE_TARGET_VERSION,-1,void 0);if(e&&i){const r=this.applicationStorageMainService.getNumber(Tt.UPDATE_QUIT_TIME,-1,0),s=this.applicationStorageMainService.getNumber(Tt.UPDATE_READY_TIME,-1,0),n=this.applicationStorageMainService.getBoolean(Tt.UPDATE_EXPLICIT_RESTART,-1,!1),o=r?Date.now()-r:void 0;this.storeEvent({type:"cursor.update.restartCompleted",data:{restartTime:o?o/1e3:void 0,targetVersion:i,currentVersion:this.productService.version,updateSuccess:this.productService.version===i,waitTimeBeforeRestart:s&&r?(r-s)/1e3:void 0,isExplicitRestart:n}}),this.clearUpdateTrackingData()}}catch(e){this.logService.error("update#checkUpdateRestartResult - failed to check update restart result",e),this.clearUpdateTrackingData()}}clearUpdateTrackingData(){this.applicationStorageMainService.remove(Tt.UPDATE_RESTART_MARKER,-1),this.applicationStorageMainService.remove(Tt.UPDATE_TARGET_VERSION,-1),this.applicationStorageMainService.remove(Tt.UPDATE_READY_TIME,-1),this.applicationStorageMainService.remove(Tt.UPDATE_QUIT_TIME,-1),this.applicationStorageMainService.remove(Tt.UPDATE_EXPLICIT_RESTART,-1)}onReleaseTrackChanged(){this.logService.info("update#ctor - release track changed"),this.checkForUpdates(!0)}buildUpdateUrl(e,i){const r=this.buildUpdateFeedUrl(e,i);if(r){try{if(this.configurationService.getValue("_update.prss")){const s=new URL(r);return s.searchParams.set("prss","true"),s.toString()}}catch(s){this.logService.error("Failed to add update URL params",s)}return r}}getProductQuality(){try{const e=this.configurationService.getValue("update.mode");return this.getProductQualityForUpdateMode(e)}catch(e){this.logService.error("Failed to get product quality",e)}}getProductQualityForUpdateMode(e){return e==="none"?void 0:this.productService.quality}scheduleCheckForUpdates(e=3600*1e3){return Pi(e).then(()=>this.checkForUpdates(!1)).then(()=>this.scheduleCheckForUpdates(3600*1e3))}async scheduleCheckForOutdatedUpdate(){return Pi(300*1e3).then(()=>this.checkForOutdatedUpdate()).catch(e=>this.logService.error("update#scheduleCheckForOutdatedUpdates received error",e))}async checkForOutdatedUpdate(){const e=this.getPendingUpdateVersionIfAbortable();if(!e){this.state.type!=="idle"&&this.scheduleCheckForOutdatedUpdate();return}try{this.checkForUpdatedReleaseTrack();const i=this.getOutdatedUpdateCheckURL();if(i){this.logService.debug("update#checkForOutdatedUpdate - checking for outdated update",e);const r=await this.requestService.request({url:i},Te.None);if(_h(r)){const s=await this.getOutdatedUpdateCheckResponseVersion(r);if(s!==e&&this.getPendingUpdateVersionIfAbortable()===e){this.logService.info("update#checkForOutdatedUpdate - found outdated update",e,s),this.invalidateUpdate(e,s),s&&this.doCheckForUpdates(!1);return}}else this.logService.warn("update#checkForOutdatedUpdate - error status code when checking for outdated update",r.res.statusCode)}}catch(i){this.logService.error("update#checkForOutdatedUpdate - failed to check for outdated update",i)}this.state.type!=="idle"&&this.scheduleCheckForOutdatedUpdate()}async checkForUpdates(e){this.logService.trace("update#checkForUpdates, state = ",this.state.type),this.state.type==="idle"&&(this.checkForUpdatedReleaseTrack(),this.doCheckForUpdates(e))}checkForUpdatedReleaseTrack(){const e=this.getReleaseTrack();if(this.url&&!this.url.includes(e)&&this.productService.updateUrl){const i=this.getProductQuality();if(i){let r=this.buildUpdateUrl(i,!1);if(r){const s=new URL(r);s.searchParams.set("trackChanged","1"),r=s.toString(),this.logService.info("update#checkForUpdates - updating to release track",e,r),this.url=r}}}else if(this.url&&this.url.includes("trackChanged=1")){const i=new URL(this.url);i.searchParams.delete("trackChanged"),this.url=i.toString(),this.logService.info("update#checkForUpdates - removing trackChanged param")}}async downloadUpdate(){this.logService.trace("update#downloadUpdate, state = ",this.state.type),this.state.type==="available for download"&&await this.doDownloadUpdate(this.state)}async doDownloadUpdate(e){}async applyUpdate(){this.logService.trace("update#applyUpdate, state = ",this.state.type),this.state.type==="downloaded"&&await this.doApplyUpdate()}async doApplyUpdate(){}prepareUpdateInstallation(e){try{if(this.state.type==="ready"&&this.state.update){const i=this.applicationStorageMainService.getBoolean(Tt.UPDATE_EXPLICIT_RESTART,-1,!1),r=i||e,s=Date.now();this.applicationStorageMainService.store(Tt.UPDATE_RESTART_MARKER,!0,-1,1),this.applicationStorageMainService.store(Tt.UPDATE_TARGET_VERSION,this.state.update.version,-1,1),this.applicationStorageMainService.store(Tt.UPDATE_QUIT_TIME,s,-1,1),this.applicationStorageMainService.store(Tt.UPDATE_EXPLICIT_RESTART,r,-1,1),(!i||e)&&this.storeEvent({type:"cursor.update.installationStarted",data:{updateVersion:this.state.update.version,previousVersion:this.productService.version,isExplicitRestart:r}})}}catch(i){this.logService.error("update#prepareUpdateInstallation - failed to store update restart markers",i)}}markUpdateInstallation(){this.prepareUpdateInstallation(!1)}quitAndInstall(){return this.logService.trace("update#quitAndInstall, state = ",this.state.type),this.state.type!=="ready"||(this.prepareUpdateInstallation(!0),this.logService.trace("update#quitAndInstall(): before lifecycle quit()"),this.lifecycleMainService.quit(!0).then(e=>{this.logService.trace(`update#quitAndInstall(): after lifecycle quit() with veto: ${e}`),!e&&(this.logService.trace("update#quitAndInstall(): running raw#quitAndInstall()"),this.doQuitAndInstall())})),Promise.resolve(void 0)}async isLatestVersion(){if(!this.url)return;if(this.configurationService.getValue("update.mode")==="none")return!1;for(const i of[this.url])if(i)try{const r=await this.requestService.request({url:i,headers:{"User-Agent":`${this.productService.nameShort}/${this.productService.version}`}},Te.None);if(!_h(r))throw new Error("Server returned "+r.res.statusCode);return r.res.statusCode===204}catch(r){this.logService.error("update#isLatestVersion(): failed to check for updates"),this.logService.error(r);return}}async _applySpecificUpdate(e){}getUpdateType(){return 1}doQuitAndInstall(){}createUpdateURL(e,i,r,s=!1){const n=r.nameShort.replace(/ /g,"-").toLowerCase(),o=this.getReleaseTrack(),a=`${r.updateUrl}/api/update/${e}/${n}/${r.version}/${this.machineId}/${o}`;return this.logService.info("updateURL",a),a}getOutdatedUpdateCheckURL(){if(!this.url)return;const e=new URL(this.url);return e.searchParams.set("isOutdatedCheck","1"),e.toString()}getReinstallUpdateCheckURL(){if(!this.url)return;const e=new URL(this.url);return e.searchParams.set("forceUpdate","1"),e.toString()}isReinstallUpdateCheckURL(e){return e?new URL(e).searchParams.get("forceUpdate")==="1":!1}getReleaseTrack(){try{const e=this.configurationService.getValue("update.releaseTrack");if(dM(e))return e;this.logService.warn("unknown release track",e)}catch(e){this.logService.warn("could not fetch release track - using default",e)}return"stable"}removeUpdateFileIfExists(){try{jE.existsSync(this.updateFileLocation())&&jE.unlinkSync(this.updateFileLocation())}catch(e){this.logService.error("Failed to check for legacy shouldUpdate file",e)}}updateFileLocation(){const e=this.productService.dataFolderName??".cursor";return lM.join(uM.homedir(),e,"shouldUpdate")}storeEvent(e){const i=this.applicationStorageMainService.get(lv,-1,"[]"),r=JSON.parse(i);for(;r.length>30;)r.shift();r.push(e),this.applicationStorageMainService.store(lv,JSON.stringify(r),-1,1)}},_a=Tt=__decorate([__param(0,ze),__param(1,Qe),__param(2,st),__param(3,As),__param(4,V),__param(5,qe),__param(6,xs)],_a)}});import*as Ws from"electron";var ln,hM=g({"out-build/vs/platform/update/electron-main/updateService.darwin.js"(){"use strict";An(),q(),_s(),L(),Xe(),ct(),ft(),K(),lt(),Rs(),ti(),cn(),vv(),tn(),ln=class extends _a{get onRawError(){return P.fromNodeEventEmitter(Ws.autoUpdater,"error",(e,i)=>i)}get onRawUpdateNotAvailable(){return P.fromNodeEventEmitter(Ws.autoUpdater,"update-not-available")}get onRawUpdateAvailable(){return P.fromNodeEventEmitter(Ws.autoUpdater,"update-available")}get onRawUpdateDownloaded(){return P.fromNodeEventEmitter(Ws.autoUpdater,"update-downloaded",(e,i,r,s)=>({version:r,productVersion:r,timestamp:s}))}constructor(e,i,r,s,n,o,a,c,l){super(i,r,n,o,a,c,l),this.machineId=e,this.telemetryService=s,this.disposables=new ke,this._usingBackupUrl=!1,i.setRelaunchHandler(this)}handleRelaunch(e){return e?.addArgs||e?.removeArgs||this.state.type!=="ready"?!1:(this.logService.trace("update#handleRelaunch(): running raw#quitAndInstall()"),this.markUpdateInstallation(),this.doQuitAndInstall(),!0)}async initialize(){await super.initialize(),this.onRawError(this.onError,this,this.disposables),this.onRawUpdateAvailable(this.onUpdateAvailable,this,this.disposables),this.onRawUpdateDownloaded(this.onUpdateDownloaded,this,this.disposables),this.onRawUpdateNotAvailable(this.onUpdateNotAvailable,this,this.disposables),this.applicationStorageMainService.onDidChangeValue(-1,"cursorAuth/accessToken",this.disposables)(e=>{this.refreshFeedUrl()})}onError(e){this.logService.info("UpdateService onError()"),this._usingBackupUrl||this.telemetryService.publicLog2("update:error",{messageHash:String(Ur(String(e)))}),this.logService.error("UpdateService (using backup url: "+this._usingBackupUrl+") error:",e);const i=this.state.type==="checking for updates"&&this.state.explicit?e:void 0;this.setState(fe.Idle(1,i))}refreshFeedUrl(){if(!this.url||!this.productService.quality)return;this.logService.info("UpdateService refreshFeedUrl() - Auth token changed, refreshing feed URL");const e=this.buildUpdateFeedUrl(this.productService.quality);e&&e!==this.url&&(this.url=e,this.logService.info("UpdateService refreshFeedUrl() - Feed URL updated"))}buildUpdateFeedUrl(e,i=!1){let r;this.productService.darwinUniversalAssetId?r=this.productService.darwinUniversalAssetId:r=process.arch==="x64"?"darwin":"darwin-arm64";const s=this.createUpdateURL(r,e,this.productService,i);return i?s:this.setFeedURL(s)}setFeedURL(e){try{const i=this.applicationStorageMainService.get("cursorAuth/accessToken",-1),r=this.productService.commit??this.productService.devCommit,s={...i?{Authorization:`Bearer ${i}`}:{},...r?{"X-Cursor-Commit":r}:{},...this.productService.version?{"X-Cursor-Version":this.productService.version}:{}};return Ws.autoUpdater.setFeedURL({url:e,headers:s}),e}catch(i){this.logService.error("Failed to set update feed URL",i);return}}getPendingUpdateVersionIfAbortable(){return this.state.type==="ready"?this.state.update?.version:void 0}async getOutdatedUpdateCheckResponseVersion(e){const i=await da(e);return i?.url?i.name:void 0}invalidateUpdate(e,i){if(!i){const r=this.getReinstallUpdateCheckURL();if(r){this.setFeedURL(r),this.doCheckForUpdates(!1);return}}this.setState(fe.Idle(1))}doCheckForUpdates(e){this.setState(fe.CheckingForUpdates(e)),Ws.autoUpdater.getFeedURL()!==this.url&&this.url&&this.setFeedURL(this.url),Ws.autoUpdater.checkForUpdates()}onUpdateAvailable(){this.logService.info("UpdateService onUpdateAvailable()"),this.state.type==="checking for updates"&&this.setState(fe.Downloading)}onUpdateDownloaded(e){if(this.logService.info("UpdateService onUpdateDownloaded()"),this.state.type==="downloading"){if(this.isReinstallUpdateCheckURL(Ws.autoUpdater.getFeedURL())&&this.url){this.logService.info("update#onUpdateDownloaded() - canceled outdated update"),this.setFeedURL(this.url),this.setState(fe.Idle(1));return}this.setState(fe.Downloaded(e)),this.telemetryService.publicLog2("update:downloaded",{newVersion:e.version}),this.setState(fe.Ready(e)),this.scheduleCheckForOutdatedUpdate()}}onUpdateNotAvailable(){this.logService.info("UpdateService onUpdateNotAvailable()"),this.state.type==="checking for updates"&&this.setState(fe.Idle(1))}doQuitAndInstall(){this.logService.info("UpdateService doQuitAndInstall()"),this.logService.trace("update#quitAndInstall(): running raw#quitAndInstall()"),Ws.autoUpdater.quitAndInstall()}dispose(){this.disposables.dispose()}},__decorate([he],ln.prototype,"onRawError",null),__decorate([he],ln.prototype,"onRawUpdateNotAvailable",null),__decorate([he],ln.prototype,"onRawUpdateAvailable",null),__decorate([he],ln.prototype,"onRawUpdateDownloaded",null),ln=__decorate([__param(1,ze),__param(2,Qe),__param(3,ei),__param(4,st),__param(5,As),__param(6,V),__param(7,qe),__param(8,xs)],ln)}});import fM from"node:path";import{spawn as pM}from"node:child_process";var Kh,gM=g({"out-build/vs/platform/update/electron-main/updateService.linux.js"(){"use strict";St(),Xe(),ct(),ft(),K(),Yn(),lt(),Rs(),cn(),vv(),tn(),Kh=class extends _a{constructor(e,i,r,s,n,o,a,c,l){super(i,r,s,n,o,c,l),this.machineId=e,this.nativeHostMainService=a,i.setRelaunchHandler(this)}buildUpdateFeedUrl(e,i=!1){return this.createUpdateURL(`linux-${process.arch}`,e,this.productService,i)}isAppImage(){return process.env.APPIMAGE!==void 0}handleRelaunch(e){return e?.addArgs||e?.removeArgs||this.state.type!=="ready"?!1:(this.logService.trace("update#handleRelaunch(): running raw#quitAndInstall()"),this.isAppImage()?(this.markUpdateInstallation(),this.doQuitAndInstall(),!0):(this.logService.info("Not running in an appimage; cannot auto-update"),!1))}async linuxCheckForUpdates(e,i){try{const r=await this.requestService.request({url:i},Te.None),s=await da(r);return!s||!s.url||!s.version||!s.productVersion?(this.setState(fe.Idle(1)),!1):(this.url=i,this.scheduleCheckForOutdatedUpdate(),this.isAppImage()?this.setState(fe.Ready(s)):this.setState(fe.AvailableForDownload(s)),!0)}catch(r){this.logService.error(r);const s=e?r.message||r:void 0;return this.setState(fe.Idle(1,s)),!1}}getPendingUpdateVersionIfAbortable(){return this.state.type==="ready"?this.state.update?.version:void 0}async getOutdatedUpdateCheckResponseVersion(e){const i=await da(e);return i?.url?i.version:void 0}invalidateUpdate(e,i){this.setState(fe.Idle(1))}async doCheckForUpdates(e){this.logService.debug("UpdateService: doCheckForUpdates"),this.setState(fe.CheckingForUpdates(e));for(const i of[this.url])if(i)try{if(await this.linuxCheckForUpdates(e,i))return}catch(r){this.logService.error("Failed to check for updates:",r)}}async doDownloadUpdate(e){!this.isAppImage()&&this.productService.downloadUrl&&this.productService.downloadUrl.length>0?this.nativeHostMainService.openExternal(void 0,this.productService.downloadUrl):e.update.url&&this.nativeHostMainService.openExternal(void 0,e.update.url),this.setState(fe.Idle(1))}doQuitAndInstall(){if(this.state.type!=="ready"){this.logService.info("update#quitAndInstall(): Not ready; skippingupdate");return}else if(this.isAppImage()){if(!this.state.update?.url){this.logService.warn("update#quitAndInstall(): No update url; skipping update");return}}else{this.logService.info("update#quitAndInstall(): Unsupported installer type; skipping update");return}const e=process.env.APPIMAGE;this.logService.debug("update#quitAndInstall(): updating appImage at "+e);const r=`${fM.join(process.resourcesPath,"appimageupdatetool.AppImage")} -u "zsync|${this.state.update.url}" -O "${e}"; ${e} &`;this.logService.info("update#quitAndInstall(): starting updater with command "+r),pM(r,{detached:!0,stdio:"inherit",shell:!0})}},Kh=__decorate([__param(1,ze),__param(2,Qe),__param(3,st),__param(4,As),__param(5,V),__param(6,Jr),__param(7,qe),__param(8,xs)],Kh)}});import{spawn as mM}from"child_process";import{realpath as vM,watch as wM}from"fs";var Yh,Jh,yM=g({"out-build/vs/platform/update/electron-main/updateService.snap.js"(){"use strict";ae(),q(),ye(),ct(),ft(),K(),cn(),Yh=class{get state(){return this._state}setState(e){this.logService.info("update#setState",e.type),this._state=e,this._onStateChange.fire(e)}constructor(e,i,r){if(this.lifecycleMainService=e,this.logService=r,this._state=fe.Uninitialized,this._onStateChange=new D,this.onStateChange=this._onStateChange.event,i.disableUpdates){this.logService.info("update#ctor - updates are disabled");return}this.setState(fe.Idle(this.getUpdateType())),this.scheduleCheckForUpdates(30*1e3).then(void 0,s=>this.logService.error(s))}scheduleCheckForUpdates(e=3600*1e3){return Pi(e).then(()=>this.checkForUpdates(!1)).then(()=>this.scheduleCheckForUpdates(3600*1e3))}async checkForUpdates(e){this.logService.trace("update#checkForUpdates, state = ",this.state.type),this.state.type==="idle"&&this.doCheckForUpdates(e)}async downloadUpdate(){this.logService.trace("update#downloadUpdate, state = ",this.state.type),this.state.type==="available for download"&&await this.doDownloadUpdate(this.state)}doDownloadUpdate(e){return Promise.resolve(void 0)}async applyUpdate(){this.logService.trace("update#applyUpdate, state = ",this.state.type),this.state.type==="downloaded"&&await this.doApplyUpdate()}doApplyUpdate(){return Promise.resolve(void 0)}quitAndInstall(){return this.logService.trace("update#quitAndInstall, state = ",this.state.type),this.state.type!=="ready"||(this.logService.trace("update#quitAndInstall(): before lifecycle quit()"),this.lifecycleMainService.quit(!0).then(e=>{this.logService.trace(`update#quitAndInstall(): after lifecycle quit() with veto: ${e}`),!e&&(this.logService.trace("update#quitAndInstall(): running raw#quitAndInstall()"),this.doQuitAndInstall())})),Promise.resolve(void 0)}getUpdateType(){return 2}doQuitAndInstall(){}async _applySpecificUpdate(e){}},Yh=__decorate([__param(0,ze),__param(1,st),__param(2,V)],Yh),Jh=class extends Yh{constructor(e,i,r,s,n){super(r,s,n),this.snap=e,this.snapRevision=i;const o=wM(pt(this.snap)),a=P.fromNodeEventEmitter(o,"change",(d,f)=>f),c=P.filter(a,d=>d==="current"),u=P.debounce(c,(d,f)=>f,2e3)(()=>this.checkForUpdates(!1));r.onWillShutdown(()=>{u.dispose(),o.close()})}doCheckForUpdates(){this.setState(fe.CheckingForUpdates(!1)),this.isUpdateAvailable().then(e=>{e?this.setState(fe.Ready({version:"something"})):this.setState(fe.Idle(2))},e=>{this.logService.error(e),this.setState(fe.Idle(2,e.message||e))})}doQuitAndInstall(){this.logService.trace("update#quitAndInstall(): running raw#quitAndInstall()"),mM("sleep 3 && "+tt(process.argv[0]),{shell:!0,detached:!0,stdio:"ignore"})}async isUpdateAvailable(){const e=await new Promise((r,s)=>vM(`${pt(this.snap)}/current`,(n,o)=>n?s(n):r(o))),i=tt(e);return this.snapRevision!==i}isLatestVersion(){return this.isUpdateAvailable().then(void 0,e=>{this.logService.error("update#checkForSnapUpdate(): Could not get realpath of application.")})}},Jh=__decorate([__param(2,ze),__param(3,st),__param(4,V)],Jh)}});import*as SM from"crypto";import*as _M from"fs";async function bM(t,e){if(await new Promise((s,n)=>{const o=_M.createReadStream(t),a=SM.createHash("sha256");o.pipe(a);const c=Tu((l,u)=>{o.removeAllListeners(),a.removeAllListeners(),l?n(l):s(u)});o.once("error",c),o.once("end",c),a.once("error",c),a.once("data",l=>c(void 0,l.toString("hex")))})!==e)throw new Error("Hash mismatch")}var EM=g({"out-build/vs/base/node/crypto.js"(){"use strict";Wu()}});import{spawn as VE}from"child_process";import*as Qh from"fs";import{tmpdir as kM}from"os";async function PM(t,e=1e3){for(;!t();)await Pi(e)}function eo(){return typeof Xh>"u"&&(Xh=[U(pt(process.execPath),"unins000.exe"),U(pt(process.execPath),"Uninstall Cursor.exe"),U(pt(process.execPath),"Uninstall Cursor Nightly.exe"),U(pt(process.execPath),"Uninstall Cursor Lab.exe")].find(i=>{try{return Qh.existsSync(i)}catch{return!1}})?0:1),Xh}var Xh,Rl,xM=g({"out-build/vs/platform/update/electron-main/updateService.win32.js"(){"use strict";ae(),St(),An(),_s(),ye(),re(),EM(),qt(),Xe(),ct(),Ze(),ft(),K(),Yn(),lt(),Rs(),ti(),cn(),vv(),tn(),Xh=void 0,Rl=class extends _a{get cachePath(){const e=Math.random().toString(36).substring(2,15),i=U(kM(),`vscode-${this.productService.quality}-${this.productService.target}-${process.arch}-${e}`);return Qh.promises.mkdir(i,{recursive:!0}).then(()=>i)}constructor(e,i,r,s,n,o,a,c,l,u,d){super(i,r,n,o,a,u,d),this.machineId=e,this.telemetryService=s,this.fileService=c,this.nativeHostMainService=l,i.setRelaunchHandler(this)}handleRelaunch(e){return e?.addArgs||e?.removeArgs||this.state.type!=="ready"||!this.availableUpdate?!1:(this.logService.trace("update#handleRelaunch(): running raw#quitAndInstall()"),this.markUpdateInstallation(),this.doQuitAndInstall(),!0)}async initialize(){if(this.productService.target==="user"&&await this.nativeHostMainService.isAdmin(void 0)){this.setState(fe.Disabled(5)),this.logService.info("update#ctor - updates are disabled due to running as Admin in user setup");return}await super.initialize()}buildUpdateFeedUrl(e,i=!1){let r=`win32-${process.arch}`;return eo()===1?r+="-archive":this.productService.target==="user"&&(r+="-user"),this.createUpdateURL(r,e,this.productService,i)}getPendingUpdateVersionIfAbortable(){if(this.state.type==="ready")return this.availableUpdate?.updateFilePath?void 0:this.state.update?.version;if(this.state.type==="downloaded")return this.state.update?.version}async getOutdatedUpdateCheckResponseVersion(e){const i=await da(e);return i?.url?i.version:void 0}invalidateUpdate(e,i){this.availableUpdate=void 0,this.setState(fe.Idle(eo()))}doCheckForUpdates(e){this.url&&(this.setState(fe.CheckingForUpdates(e)),this.requestService.request({url:this.url},Te.None).then(da).then(i=>{const r=eo();return!i||!i.url||!i.version||!i.productVersion?(this.setState(fe.Idle(r)),Promise.resolve(null)):r===1?(this.setState(fe.AvailableForDownload(i)),Promise.resolve(null)):(this.setState(fe.Downloading),this.cleanup(i.version).then(()=>this.getUpdatePackagePath(i.version).then(s=>te.exists(s).then(n=>{if(n)return Promise.resolve(s);const o=`${s}.tmp`;return this.requestService.request({url:i.url},Te.None).then(a=>{if(!_h(a))throw new Error("Server returned "+a.res.statusCode);if(g5(a))throw new Error("Server returned no content");return a}).then(a=>this.fileService.writeFile(x.file(o),a.stream)).then(i.sha256hash?()=>bM(o,i.sha256hash):()=>{}).then(()=>te.rename(o,s,!1)).then(()=>s)})).then(s=>{this.availableUpdate={packagePath:s},this.setState(fe.Downloaded(i)),this.scheduleCheckForOutdatedUpdate(),this.configurationService.getValue("update.enableWindowsBackgroundUpdates")?this.productService.target==="user"&&this.doApplyUpdate():this.setState(fe.Ready(i))})))}).catch(i=>{this.telemetryService.publicLog2("update:error",{messageHash:String(Ur(String(i)))}),this.logService.error(i);const r=e?i.message||i:void 0;this.setState(fe.Idle(eo(),r))}))}async doDownloadUpdate(e){e.update.url&&this.nativeHostMainService.openExternal(void 0,e.update.url),this.setState(fe.Idle(eo()))}async getUpdatePackagePath(e){const i=await this.cachePath;return U(i,`CodeSetup-${this.productService.quality}-${e}.exe`)}async cleanup(e=null){const i=e?o=>!new RegExp(`${this.productService.quality}-${e}\\.exe$`).test(o):()=>!0,r=await this.cachePath,n=(await te.readdir(r)).filter(i).map(async o=>{try{await Qh.promises.unlink(U(r,o))}catch{}});await Promise.all(n)}async doApplyUpdate(){if(this.state.type!=="downloaded"||!this.availableUpdate)return Promise.resolve(void 0);const e=this.state.update;this.setState(fe.Updating(e));const i=await this.cachePath;this.availableUpdate.updateFilePath=U(i,`CodeSetup-${this.productService.quality}-${e.version}.flag`),await te.writeFile(this.availableUpdate.updateFilePath,"flag"),VE(this.availableUpdate.packagePath,["/verysilent","/log",`/update="${this.availableUpdate.updateFilePath}"`,"/nocloseapplications","/mergetasks=runcode,!desktopicon,!quicklaunchicon"],{detached:!0,stdio:["ignore","ignore","ignore"],windowsVerbatimArguments:!0}).once("exit",()=>{this.availableUpdate=void 0,this.setState(fe.Idle(eo()))});const s=`${this.productService.win32MutexName}-ready`,n=await import("@vscode/windows-mutex");PM(()=>n.isActive(s)).then(()=>{this.setState(fe.Ready(e)),this.productService.target!=="user"&&this.quitAndInstall()})}doQuitAndInstall(){this.state.type!=="ready"||!this.availableUpdate||(this.logService.trace("update#quitAndInstall(): running raw#quitAndInstall()"),this.availableUpdate.updateFilePath?Qh.unlinkSync(this.availableUpdate.updateFilePath):VE(this.availableUpdate.packagePath,["/silent","/log","/mergetasks=runcode,!desktopicon,!quicklaunchicon"],{detached:!0,stdio:["ignore","ignore","ignore"]}))}getUpdateType(){return eo()}async _applySpecificUpdate(e){if(this.state.type!=="idle")return;const i=this.configurationService.getValue("update.enableWindowsBackgroundUpdates"),r={version:"unknown",productVersion:"unknown"};this.setState(fe.Downloading),this.availableUpdate={packagePath:e},this.setState(fe.Downloaded(r)),i?this.productService.target==="user"&&this.doApplyUpdate():this.setState(fe.Ready(r))}},__decorate([he],Rl.prototype,"cachePath",null),Rl=__decorate([__param(1,ze),__param(2,Qe),__param(3,ei),__param(4,st),__param(5,As),__param(6,V),__param(7,mt),__param(8,Jr),__param(9,qe),__param(10,xs)],Rl)}}),qE,zE,CM=g({"out-build/vs/platform/url/common/urlIpc.js"(){"use strict";re(),qE=class{constructor(t){this.channel=t}handleURL(t,e){return this.channel.call("handleURL",[t.toJSON(),e])}},zE=class{constructor(t,e){this.next=t,this.logService=e}async routeCall(t,e,i,r){if(e!=="handleURL")throw new Error(`Call not found: ${e}`);if(Array.isArray(i)&&i.length>0){const s=x.revive(i[0]);if(this.logService.trace("URLHandlerRouter#routeCall() with URI argument",s.toString(!0)),s.query){const n=/\bwindowId=(\d+)/.exec(s.query);if(n){const o=n[1];this.logService.trace(`URLHandlerRouter#routeCall(): found windowId query parameter with value "${o}"`,s.toString(!0));const a=new RegExp(`window:${o}`),c=t.connections.find(l=>(this.logService.trace("URLHandlerRouter#routeCall(): testing connection",l.ctx),a.test(l.ctx)));if(c)return this.logService.trace("URLHandlerRouter#routeCall(): found a connection to route",s.toString(!0)),c;this.logService.trace("URLHandlerRouter#routeCall(): did not find a connection to route",s.toString(!0))}else this.logService.trace("URLHandlerRouter#routeCall(): did not find windowId query parameter",s.toString(!0))}}else this.logService.trace("URLHandlerRouter#routeCall() without URI argument");return this.next.routeCall(t,e,i,r)}routeEvent(t,e){throw new Error(`Event not found: ${e}`)}}}}),GE,Zh,IM=g({"out-build/vs/platform/url/common/urlService.js"(){"use strict";ae(),L(),re(),lt(),GE=class extends N{constructor(){super(...arguments),this.handlers=new Set}open(t,e){const i=[...this.handlers.values()];return qC(i.map(r=>()=>r.handleURL(t,e)),void 0,!1).then(r=>r||!1)}registerHandler(t){return this.handlers.add(t),me(()=>this.handlers.delete(t))}},Zh=class extends GE{constructor(e){super(),this.productService=e}create(e){let{authority:i,path:r,query:s,fragment:n}=e||{authority:void 0,path:void 0,query:void 0,fragment:void 0};return i&&r&&r.indexOf("/")!==0&&(r=`/${r}`),x.from({scheme:this.productService.urlProtocol,authority:i,path:r,query:s,fragment:n})}},Zh=__decorate([__param(0,qe)],Zh)}});import{app as KE}from"electron";var YE,DM=g({"out-build/vs/platform/url/electron-main/electronUrlListener.js"(){"use strict";ae(),q(),L(),z(),re(),YE=class extends N{constructor(t,e,i,r,s,n){if(super(),this.urlService=e,this.logService=n,this.uris=[],this.retryCount=0,t&&(n.trace("ElectronURLListener initialUrisToHandle:",t.map(c=>c.originalUrl)),this.uris=t),B){const c=r.isBuilt?[]:[`"${r.appRoot}"`];c.push("--open-url","--"),KE.setAsDefaultProtocolClient(s.urlProtocol,process.execPath,c)}const o=P.map(P.fromNodeEventEmitter(KE,"open-url",(c,l)=>({event:c,url:l})),({event:c,url:l})=>(c.preventDefault(),l));this._register(o(c=>{const l=this.uriFromRawUrl(c);l&&this.urlService.open(l,{originalUrl:c})})),i.getWindows().filter(c=>c.isReady).length>0?(n.trace("ElectronURLListener: window is ready to handle URLs"),this.flush()):(n.trace("ElectronURLListener: waiting for window to be ready to handle URLs..."),this._register(P.once(i.onDidSignalReadyWindow)(()=>this.flush())))}uriFromRawUrl(t){try{return x.parse(t)}catch{return}}async flush(){if(this.retryCount++>10){this.logService.trace("ElectronURLListener#flush(): giving up after 10 retries");return}this.logService.trace("ElectronURLListener#flush(): flushing URLs");const t=[];for(const e of this.uris)await this.urlService.open(e.uri,{originalUrl:e.originalUrl})?this.logService.trace("ElectronURLListener#flush(): URL was handled",e.originalUrl):(this.logService.trace("ElectronURLListener#flush(): URL was not yet handled",e.originalUrl),t.push(e));t.length!==0&&(this.uris=t,VC(()=>this.flush(),500,this._store))}}}}),wv,AM=g({"out-build/vs/platform/webview/common/webviewManagerService.js"(){"use strict";G(),wv=j("webviewManagerService")}});import{protocol as RM}from"electron";var JE,MM=g({"out-build/vs/platform/webview/electron-main/webviewProtocolProvider.js"(){"use strict";L(),Ie(),re(),JE=class R8 extends N{static{this.validWebviewFilePaths=new Map([["/index.html","index.html"],["/fake.html","fake.html"],["/service-worker.js","service-worker.js"]])}constructor(){super();const e=this.handleWebviewRequest.bind(this);RM.registerFileProtocol(T.vscodeWebview,e)}handleWebviewRequest(e,i){try{const r=x.parse(e.url),s=R8.validWebviewFilePaths.get(r.path);if(typeof s=="string"){const n=`vs/workbench/contrib/webview/browser/pre/${s}`,o=Ct.asFileUri(n);return i({path:o.fsPath,headers:{...mc.getHeadersFromQuery(e.url),"Cross-Origin-Resource-Policy":"cross-origin"}})}else return i({error:-10})}catch{}return i({error:-2})}}}});import{webContents as TM}from"electron";var ef,WM=g({"out-build/vs/platform/webview/electron-main/webviewMainService.js"(){"use strict";q(),L(),MM(),ut(),ef=class extends N{constructor(e){super(),this.windowsMainService=e,this._onFoundInFrame=this._register(new D),this.onFoundInFrame=this._onFoundInFrame.event,this._register(new JE)}async setIgnoreMenuShortcuts(e,i){let r;if(typeof e.windowId=="number"){const{windowId:s}=e,n=this.windowsMainService.getWindowById(s);if(!n)throw new Error(`Invalid windowId: ${s}`);if(n.win)r=n.win.webContents;else if(n.webContents)r=n.webContents;else throw new Error(`Window ${s} has no webContents`)}else{const{webContentsId:s}=e;if(r=TM.fromId(s),!r)throw new Error(`Invalid webContentsId: ${s}`)}r.isDestroyed()||r.setIgnoreMenuShortcuts(i)}async findInFrame(e,i,r,s){const o=this.getFrameByName(e,i);if(typeof o.findInFrame=="function"){o.findInFrame(r,{findNext:s.findNext,forward:s.forward});const a=(c,l)=>{l.finalUpdate&&(this._onFoundInFrame.fire(l),o.removeListener("found-in-frame",a))};o.on("found-in-frame",a)}}async stopFindInFrame(e,i,r){const n=this.getFrameByName(e,i);typeof n.stopFindInFrame=="function"&&n.stopFindInFrame(r.keepSelection?"keepSelection":"clearSelection")}getFrameByName(e,i){const r=this.windowsMainService.getWindowById(e.windowId);if(!r)throw new Error(`Invalid windowId: ${e.windowId}`);let s;if(r.win)s=r.win.webContents;else if(r.webContents)s=r.webContents;else throw new Error(`Window ${e.windowId} has no webContents`);const n=s.mainFrame.framesInSubtree.find(o=>o.name===i);if(!n)throw new Error(`Unknown frame: ${i}`);return n}},ef=__decorate([__param(0,ot)],ef)}});async function LM(t,e,i){let r=i&&i.get("storage.serviceMachineId",-1)||null;if(r)return r;try{const n=(await e.readFile(t.serviceMachineIdResource)).value.toString();r=yI(n)?n:null}catch{r=null}if(!r){r=ui();try{await e.writeFile(t.serviceMachineIdResource,Y.fromString(r))}catch{}}return i?.store("storage.serviceMachineId",r,-1,1),r}var OM=g({"out-build/vs/platform/externalServices/common/serviceMachineId.js"(){"use strict";it(),Hi()}});async function FM(t,e,i,r,s,n){const o={"X-Market-Client-Id":`VSCode ${QE(t)}`,"User-Agent":`VSCode ${QE(t)} (Code)`};if(ME(t,e)&&fv(i)===3){const a=await LM(e,r,s);o["X-Market-User-Id"]=a,o["VSCode-SessionId"]=n.machineId||a}return o}function QE(t){return t.vscodeVersion}var NM=g({"out-build/vs/platform/externalServices/common/marketplace.js"(){"use strict";OM(),Zn()}});function h(t,e){if(At(e)){const i=yv[e];if(i===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=i}return yv[t]=e,{id:t}}var yv,XE=g({"out-build/vs/base/common/codiconsUtil.js"(){"use strict";xe(),yv=Object.create(null)}}),ZE,UM=g({"out-build/vs/base/common/codiconsLibrary.js"(){"use strict";XE(),ZE={semantic:h("semantic",62e3),githubCopilot:h("github-copilot",62001),plusCircle:h("plus-circle",62002),smileySad:h("smiley-sad",62003),smileyHappy:h("smiley-happy",62004),smileyMedium:h("smiley-medium",62005),sparkleStrikethrough:h("sparkle-strikethrough",62006),keyPlusSparkle:h("key-plus-sparkle",62007),paperclip:h("paperclip",60500),atSign:h("at-sign",60501),image:h("image",60502),logo:h("logo",60503),sparkleTwo:h("sparkle-two",60504),logoSlash:h("logo-slash",60505),arrowsExpand:h("arrows-expand",60506),arrowsContract:h("arrows-contract",60507),expandDiffUp:h("expand-diff-up",60508),expandDiffDown:h("expand-diff-down",60509),add:h("add",6e4),plus:h("plus",6e4),gistNew:h("gist-new",6e4),repoCreate:h("repo-create",6e4),lightbulb:h("lightbulb",60001),lightBulb:h("light-bulb",60001),repo:h("repo",60002),repoDelete:h("repo-delete",60002),gistFork:h("gist-fork",60003),repoForked:h("repo-forked",60003),gitPullRequest:h("git-pull-request",60004),gitPullRequestAbandoned:h("git-pull-request-abandoned",60004),recordKeys:h("record-keys",60005),keyboard:h("keyboard",60005),tag:h("tag",60006),gitPullRequestLabel:h("git-pull-request-label",60006),tagAdd:h("tag-add",60006),tagRemove:h("tag-remove",60006),person:h("person",60007),personFollow:h("person-follow",60007),personOutline:h("person-outline",60007),personFilled:h("person-filled",60007),gitBranch:h("git-branch",60008),gitBranchCreate:h("git-branch-create",60008),gitBranchDelete:h("git-branch-delete",60008),sourceControl:h("source-control",60008),mirror:h("mirror",60009),mirrorPublic:h("mirror-public",60009),star:h("star",60010),starAdd:h("star-add",60010),starDelete:h("star-delete",60010),starEmpty:h("star-empty",60010),comment:h("comment",60011),commentAdd:h("comment-add",60011),alert:h("alert",60012),warning:h("warning",60012),search:h("search",60013),searchSave:h("search-save",60013),logOut:h("log-out",60014),signOut:h("sign-out",60014),logIn:h("log-in",60015),signIn:h("sign-in",60015),eye:h("eye",60016),eyeUnwatch:h("eye-unwatch",60016),eyeWatch:h("eye-watch",60016),circleFilled:h("circle-filled",60017),primitiveDot:h("primitive-dot",60017),closeDirty:h("close-dirty",60017),debugBreakpoint:h("debug-breakpoint",60017),debugBreakpointDisabled:h("debug-breakpoint-disabled",60017),debugHint:h("debug-hint",60017),terminalDecorationSuccess:h("terminal-decoration-success",60017),primitiveSquare:h("primitive-square",60018),edit:h("edit",60019),pencil:h("pencil",60019),info:h("info",60020),issueOpened:h("issue-opened",60020),gistPrivate:h("gist-private",60021),gitForkPrivate:h("git-fork-private",60021),lock:h("lock",60021),mirrorPrivate:h("mirror-private",60021),close:h("close",60022),removeClose:h("remove-close",60022),x:h("x",60022),repoSync:h("repo-sync",60023),sync:h("sync",60023),clone:h("clone",60024),desktopDownload:h("desktop-download",60024),beaker:h("beaker",60025),microscope:h("microscope",60025),vm:h("vm",60026),deviceDesktop:h("device-desktop",60026),file:h("file",60027),fileText:h("file-text",60027),more:h("more",60028),ellipsis:h("ellipsis",60028),kebabHorizontal:h("kebab-horizontal",60028),mailReply:h("mail-reply",60029),reply:h("reply",60029),organization:h("organization",60030),organizationFilled:h("organization-filled",60030),organizationOutline:h("organization-outline",60030),newFile:h("new-file",60031),fileAdd:h("file-add",60031),newFolder:h("new-folder",60032),fileDirectoryCreate:h("file-directory-create",60032),trash:h("trash",60033),trashcan:h("trashcan",60033),history:h("history",60034),clock:h("clock",60034),folder:h("folder",60035),fileDirectory:h("file-directory",60035),symbolFolder:h("symbol-folder",60035),logoGithub:h("logo-github",60036),markGithub:h("mark-github",60036),github:h("github",60036),terminal:h("terminal",60037),console:h("console",60037),repl:h("repl",60037),zap:h("zap",60038),symbolEvent:h("symbol-event",60038),error:h("error",60039),stop:h("stop",60039),variable:h("variable",60040),symbolVariable:h("symbol-variable",60040),array:h("array",60042),symbolArray:h("symbol-array",60042),symbolModule:h("symbol-module",60043),symbolPackage:h("symbol-package",60043),symbolNamespace:h("symbol-namespace",60043),symbolObject:h("symbol-object",60043),symbolMethod:h("symbol-method",60044),symbolFunction:h("symbol-function",60044),symbolConstructor:h("symbol-constructor",60044),symbolBoolean:h("symbol-boolean",60047),symbolNull:h("symbol-null",60047),symbolNumeric:h("symbol-numeric",60048),symbolNumber:h("symbol-number",60048),symbolStructure:h("symbol-structure",60049),symbolStruct:h("symbol-struct",60049),symbolParameter:h("symbol-parameter",60050),symbolTypeParameter:h("symbol-type-parameter",60050),symbolKey:h("symbol-key",60051),symbolText:h("symbol-text",60051),symbolReference:h("symbol-reference",60052),goToFile:h("go-to-file",60052),symbolEnum:h("symbol-enum",60053),symbolValue:h("symbol-value",60053),symbolRuler:h("symbol-ruler",60054),symbolUnit:h("symbol-unit",60054),activateBreakpoints:h("activate-breakpoints",60055),archive:h("archive",60056),arrowBoth:h("arrow-both",60057),arrowDown:h("arrow-down",60058),arrowLeft:h("arrow-left",60059),arrowRight:h("arrow-right",60060),arrowSmallDown:h("arrow-small-down",60061),arrowSmallLeft:h("arrow-small-left",60062),arrowSmallRight:h("arrow-small-right",60063),arrowSmallUp:h("arrow-small-up",60064),arrowUp:h("arrow-up",60065),bell:h("bell",60066),bold:h("bold",60067),book:h("book",60068),bookmark:h("bookmark",60069),debugBreakpointConditionalUnverified:h("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:h("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:h("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:h("debug-breakpoint-data-unverified",60072),debugBreakpointData:h("debug-breakpoint-data",60073),debugBreakpointDataDisabled:h("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:h("debug-breakpoint-log-unverified",60074),debugBreakpointLog:h("debug-breakpoint-log",60075),debugBreakpointLogDisabled:h("debug-breakpoint-log-disabled",60075),briefcase:h("briefcase",60076),broadcast:h("broadcast",60077),browser:h("browser",60078),bug:h("bug",60079),calendar:h("calendar",60080),caseSensitive:h("case-sensitive",60081),check:h("check",60082),checklist:h("checklist",60083),chevronDown:h("chevron-down",60084),chevronLeft:h("chevron-left",60085),chevronRight:h("chevron-right",60086),chevronUp:h("chevron-up",60087),chromeClose:h("chrome-close",60088),chromeMaximize:h("chrome-maximize",60089),chromeMinimize:h("chrome-minimize",60090),chromeRestore:h("chrome-restore",60091),circleOutline:h("circle-outline",60092),circle:h("circle",60092),debugBreakpointUnverified:h("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:h("terminal-decoration-incomplete",60092),circleSlash:h("circle-slash",60093),circuitBoard:h("circuit-board",60094),clearAll:h("clear-all",60095),clippy:h("clippy",60096),closeAll:h("close-all",60097),cloudDownload:h("cloud-download",60098),cloudUpload:h("cloud-upload",60099),code:h("code",60100),collapseAll:h("collapse-all",60101),colorMode:h("color-mode",60102),commentDiscussion:h("comment-discussion",60103),creditCard:h("credit-card",60105),dash:h("dash",60108),dashboard:h("dashboard",60109),database:h("database",60110),debugContinue:h("debug-continue",60111),debugDisconnect:h("debug-disconnect",60112),debugPause:h("debug-pause",60113),debugRestart:h("debug-restart",60114),debugStart:h("debug-start",60115),debugStepInto:h("debug-step-into",60116),debugStepOut:h("debug-step-out",60117),debugStepOver:h("debug-step-over",60118),debugStop:h("debug-stop",60119),debug:h("debug",60120),deviceCameraVideo:h("device-camera-video",60121),deviceCamera:h("device-camera",60122),deviceMobile:h("device-mobile",60123),diffAdded:h("diff-added",60124),diffIgnored:h("diff-ignored",60125),diffModified:h("diff-modified",60126),diffRemoved:h("diff-removed",60127),diffRenamed:h("diff-renamed",60128),diff:h("diff",60129),diffSidebyside:h("diff-sidebyside",60129),discard:h("discard",60130),editorLayout:h("editor-layout",60131),emptyWindow:h("empty-window",60132),exclude:h("exclude",60133),extensions:h("extensions",60134),eyeClosed:h("eye-closed",60135),fileBinary:h("file-binary",60136),fileCode:h("file-code",60137),fileMedia:h("file-media",60138),filePdf:h("file-pdf",60139),fileSubmodule:h("file-submodule",60140),fileSymlinkDirectory:h("file-symlink-directory",60141),fileSymlinkFile:h("file-symlink-file",60142),fileZip:h("file-zip",60143),files:h("files",60144),filter:h("filter",60145),flame:h("flame",60146),foldDown:h("fold-down",60147),foldUp:h("fold-up",60148),fold:h("fold",60149),folderActive:h("folder-active",60150),folderOpened:h("folder-opened",60151),gear:h("gear",60152),gift:h("gift",60153),gistSecret:h("gist-secret",60154),gist:h("gist",60155),gitCommit:h("git-commit",60156),gitCompare:h("git-compare",60157),compareChanges:h("compare-changes",60157),gitMerge:h("git-merge",60158),githubAction:h("github-action",60159),githubAlt:h("github-alt",60160),globe:h("globe",60161),grabber:h("grabber",60162),graph:h("graph",60163),gripper:h("gripper",60164),heart:h("heart",60165),home:h("home",60166),horizontalRule:h("horizontal-rule",60167),hubot:h("hubot",60168),inbox:h("inbox",60169),issueReopened:h("issue-reopened",60171),issues:h("issues",60172),italic:h("italic",60173),jersey:h("jersey",60174),json:h("json",60175),kebabVertical:h("kebab-vertical",60176),key:h("key",60177),law:h("law",60178),lightbulbAutofix:h("lightbulb-autofix",60179),linkExternal:h("link-external",60180),link:h("link",60181),listOrdered:h("list-ordered",60182),listUnordered:h("list-unordered",60183),liveShare:h("live-share",60184),loading:h("loading",60185),location:h("location",60186),mailRead:h("mail-read",60187),mail:h("mail",60188),markdown:h("markdown",60189),megaphone:h("megaphone",60190),mention:h("mention",60191),milestone:h("milestone",60192),gitPullRequestMilestone:h("git-pull-request-milestone",60192),mortarBoard:h("mortar-board",60193),move:h("move",60194),multipleWindows:h("multiple-windows",60195),mute:h("mute",60196),noNewline:h("no-newline",60197),note:h("note",60198),octoface:h("octoface",60199),openPreview:h("open-preview",60200),package:h("package",60201),paintcan:h("paintcan",60202),pin:h("pin",60203),play:h("play",60204),run:h("run",60204),plug:h("plug",60205),preserveCase:h("preserve-case",60206),preview:h("preview",60207),project:h("project",60208),pulse:h("pulse",60209),question:h("question",60210),quote:h("quote",60211),radioTower:h("radio-tower",60212),reactions:h("reactions",60213),references:h("references",60214),refresh:h("refresh",60215),regex:h("regex",60216),remoteExplorer:h("remote-explorer",60217),remote:h("remote",60218),remove:h("remove",60219),replaceAll:h("replace-all",60220),replace:h("replace",60221),repoClone:h("repo-clone",60222),repoForcePush:h("repo-force-push",60223),repoPull:h("repo-pull",60224),repoPush:h("repo-push",60225),report:h("report",60226),requestChanges:h("request-changes",60227),rocket:h("rocket",60228),rootFolderOpened:h("root-folder-opened",60229),rootFolder:h("root-folder",60230),rss:h("rss",60231),ruby:h("ruby",60232),saveAll:h("save-all",60233),saveAs:h("save-as",60234),save:h("save",60235),screenFull:h("screen-full",60236),screenNormal:h("screen-normal",60237),searchStop:h("search-stop",60238),server:h("server",60240),settingsGear:h("settings-gear",60241),settings:h("settings",60242),shield:h("shield",60243),smiley:h("smiley",60244),sortPrecedence:h("sort-precedence",60245),splitHorizontal:h("split-horizontal",60246),splitVertical:h("split-vertical",60247),squirrel:h("squirrel",60248),starFull:h("star-full",60249),starHalf:h("star-half",60250),symbolClass:h("symbol-class",60251),symbolColor:h("symbol-color",60252),symbolConstant:h("symbol-constant",60253),symbolEnumMember:h("symbol-enum-member",60254),symbolField:h("symbol-field",60255),symbolFile:h("symbol-file",60256),symbolInterface:h("symbol-interface",60257),symbolKeyword:h("symbol-keyword",60258),symbolMisc:h("symbol-misc",60259),symbolOperator:h("symbol-operator",60260),symbolProperty:h("symbol-property",60261),wrench:h("wrench",60261),wrenchSubaction:h("wrench-subaction",60261),symbolSnippet:h("symbol-snippet",60262),tasklist:h("tasklist",60263),telescope:h("telescope",60264),textSize:h("text-size",60265),threeBars:h("three-bars",60266),thumbsdown:h("thumbsdown",60267),thumbsup:h("thumbsup",60268),tools:h("tools",60269),triangleDown:h("triangle-down",60270),triangleLeft:h("triangle-left",60271),triangleRight:h("triangle-right",60272),triangleUp:h("triangle-up",60273),twitter:h("twitter",60274),unfold:h("unfold",60275),unlock:h("unlock",60276),unmute:h("unmute",60277),unverified:h("unverified",60278),verified:h("verified",60279),versions:h("versions",60280),vmActive:h("vm-active",60281),vmOutline:h("vm-outline",60282),vmRunning:h("vm-running",60283),watch:h("watch",60284),whitespace:h("whitespace",60285),wholeWord:h("whole-word",60286),window:h("window",60287),wordWrap:h("word-wrap",60288),zoomIn:h("zoom-in",60289),zoomOut:h("zoom-out",60290),listFilter:h("list-filter",60291),listFlat:h("list-flat",60292),listSelection:h("list-selection",60293),selection:h("selection",60293),listTree:h("list-tree",60294),debugBreakpointFunctionUnverified:h("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:h("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:h("debug-breakpoint-function-disabled",60296),debugStackframeActive:h("debug-stackframe-active",60297),circleSmallFilled:h("circle-small-filled",60298),debugStackframeDot:h("debug-stackframe-dot",60298),terminalDecorationMark:h("terminal-decoration-mark",60298),debugStackframe:h("debug-stackframe",60299),debugStackframeFocused:h("debug-stackframe-focused",60299),debugBreakpointUnsupported:h("debug-breakpoint-unsupported",60300),symbolString:h("symbol-string",60301),debugReverseContinue:h("debug-reverse-continue",60302),debugStepBack:h("debug-step-back",60303),debugRestartFrame:h("debug-restart-frame",60304),debugAlt:h("debug-alt",60305),callIncoming:h("call-incoming",60306),callOutgoing:h("call-outgoing",60307),menu:h("menu",60308),expandAll:h("expand-all",60309),feedback:h("feedback",60310),gitPullRequestReviewer:h("git-pull-request-reviewer",60310),groupByRefType:h("group-by-ref-type",60311),ungroupByRefType:h("ungroup-by-ref-type",60312),account:h("account",60313),gitPullRequestAssignee:h("git-pull-request-assignee",60313),bellDot:h("bell-dot",60314),debugConsole:h("debug-console",60315),library:h("library",60316),output:h("output",60317),runAll:h("run-all",60318),syncIgnored:h("sync-ignored",60319),pinned:h("pinned",60320),githubInverted:h("github-inverted",60321),serverProcess:h("server-process",60322),serverEnvironment:h("server-environment",60323),pass:h("pass",60324),issueClosed:h("issue-closed",60324),stopCircle:h("stop-circle",60325),playCircle:h("play-circle",60326),record:h("record",60327),debugAltSmall:h("debug-alt-small",60328),vmConnect:h("vm-connect",60329),cloud:h("cloud",60330),merge:h("merge",60331),export:h("export",60332),graphLeft:h("graph-left",60333),magnet:h("magnet",60334),notebook:h("notebook",60335),redo:h("redo",60336),checkAll:h("check-all",60337),pinnedDirty:h("pinned-dirty",60338),passFilled:h("pass-filled",60339),circleLargeFilled:h("circle-large-filled",60340),circleLarge:h("circle-large",60341),circleLargeOutline:h("circle-large-outline",60341),combine:h("combine",60342),gather:h("gather",60342),table:h("table",60343),variableGroup:h("variable-group",60344),typeHierarchy:h("type-hierarchy",60345),typeHierarchySub:h("type-hierarchy-sub",60346),typeHierarchySuper:h("type-hierarchy-super",60347),gitPullRequestCreate:h("git-pull-request-create",60348),runAbove:h("run-above",60349),runBelow:h("run-below",60350),notebookTemplate:h("notebook-template",60351),debugRerun:h("debug-rerun",60352),workspaceTrusted:h("workspace-trusted",60353),workspaceUntrusted:h("workspace-untrusted",60354),workspaceUnknown:h("workspace-unknown",60355),terminalCmd:h("terminal-cmd",60356),terminalDebian:h("terminal-debian",60357),terminalLinux:h("terminal-linux",60358),terminalPowershell:h("terminal-powershell",60359),terminalTmux:h("terminal-tmux",60360),terminalUbuntu:h("terminal-ubuntu",60361),terminalBash:h("terminal-bash",60362),arrowSwap:h("arrow-swap",60363),copy:h("copy",60364),personAdd:h("person-add",60365),filterFilled:h("filter-filled",60366),wand:h("wand",60367),debugLineByLine:h("debug-line-by-line",60368),inspect:h("inspect",60369),layers:h("layers",60370),layersDot:h("layers-dot",60371),layersActive:h("layers-active",60372),compass:h("compass",60373),compassDot:h("compass-dot",60374),compassActive:h("compass-active",60375),azure:h("azure",60376),issueDraft:h("issue-draft",60377),gitPullRequestClosed:h("git-pull-request-closed",60378),gitPullRequestDraft:h("git-pull-request-draft",60379),debugAll:h("debug-all",60380),debugCoverage:h("debug-coverage",60381),runErrors:h("run-errors",60382),folderLibrary:h("folder-library",60383),debugContinueSmall:h("debug-continue-small",60384),beakerStop:h("beaker-stop",60385),graphLine:h("graph-line",60386),graphScatter:h("graph-scatter",60387),pieChart:h("pie-chart",60388),bracket:h("bracket",60175),bracketDot:h("bracket-dot",60389),bracketError:h("bracket-error",60390),lockSmall:h("lock-small",60391),azureDevops:h("azure-devops",60392),verifiedFilled:h("verified-filled",60393),newline:h("newline",60394),layout:h("layout",60395),layoutActivitybarLeft:h("layout-activitybar-left",60396),layoutActivitybarRight:h("layout-activitybar-right",60397),layoutPanelLeft:h("layout-panel-left",60398),layoutPanelCenter:h("layout-panel-center",60399),layoutPanelJustify:h("layout-panel-justify",60400),layoutPanelRight:h("layout-panel-right",60401),layoutPanel:h("layout-panel",60402),layoutSidebarLeft:h("layout-sidebar-left",60403),layoutSidebarRight:h("layout-sidebar-right",60404),layoutStatusbar:h("layout-statusbar",60405),layoutMenubar:h("layout-menubar",60406),layoutCentered:h("layout-centered",60407),target:h("target",60408),indent:h("indent",60409),recordSmall:h("record-small",60410),errorSmall:h("error-small",60411),terminalDecorationError:h("terminal-decoration-error",60411),arrowCircleDown:h("arrow-circle-down",60412),arrowCircleLeft:h("arrow-circle-left",60413),arrowCircleRight:h("arrow-circle-right",60414),arrowCircleUp:h("arrow-circle-up",60415),layoutSidebarRightOff:h("layout-sidebar-right-off",60416),layoutPanelOff:h("layout-panel-off",60417),layoutSidebarLeftOff:h("layout-sidebar-left-off",60418),blank:h("blank",60419),heartFilled:h("heart-filled",60420),map:h("map",60421),mapHorizontal:h("map-horizontal",60421),foldHorizontal:h("fold-horizontal",60421),mapFilled:h("map-filled",60422),mapHorizontalFilled:h("map-horizontal-filled",60422),foldHorizontalFilled:h("fold-horizontal-filled",60422),circleSmall:h("circle-small",60423),bellSlash:h("bell-slash",60424),bellSlashDot:h("bell-slash-dot",60425),commentUnresolved:h("comment-unresolved",60426),gitPullRequestGoToChanges:h("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:h("git-pull-request-new-changes",60428),searchFuzzy:h("search-fuzzy",60429),commentDraft:h("comment-draft",60430),send:h("send",60431),sparkle:h("sparkle",60432),insert:h("insert",60433),mic:h("mic",60434),thumbsdownFilled:h("thumbsdown-filled",60435),thumbsupFilled:h("thumbsup-filled",60436),coffee:h("coffee",60437),snake:h("snake",60438),game:h("game",60439),vr:h("vr",60440),chip:h("chip",60441),piano:h("piano",60442),music:h("music",60443),micFilled:h("mic-filled",60444),repoFetch:h("repo-fetch",60445),copilot:h("copilot",60446),lightbulbSparkle:h("lightbulb-sparkle",60447),robot:h("robot",60448),sparkleFilled:h("sparkle-filled",60449),diffSingle:h("diff-single",60450),diffMultiple:h("diff-multiple",60451),surroundWith:h("surround-with",60452),share:h("share",60453),gitStash:h("git-stash",60454),gitStashApply:h("git-stash-apply",60455),gitStashPop:h("git-stash-pop",60456),vscode:h("vscode",60457),vscodeInsiders:h("vscode-insiders",60458),codeOss:h("code-oss",60459),runCoverage:h("run-coverage",60460),runAllCoverage:h("run-all-coverage",60461),coverage:h("coverage",60462),githubProject:h("github-project",60463),mapVertical:h("map-vertical",60464),foldVertical:h("fold-vertical",60464),mapVerticalFilled:h("map-vertical-filled",60465),foldVerticalFilled:h("fold-vertical-filled",60465),goToSearch:h("go-to-search",60466),percentage:h("percentage",60467),sortPercentage:h("sort-percentage",60467),attach:h("attach",60468),goToEditingSession:h("go-to-editing-session",60469),editSession:h("edit-session",60470),codeReview:h("code-review",60471),copilotWarning:h("copilot-warning",60472),python:h("python",60473),copilotLarge:h("copilot-large",60474),copilotWarningLarge:h("copilot-warning-large",60475),keyboardTab:h("keyboard-tab",60476),copilotBlocked:h("copilot-blocked",60477),copilotNotConnected:h("copilot-not-connected",60478),flag:h("flag",60479),lightbulbEmpty:h("lightbulb-empty",60480),symbolMethodArrow:h("symbol-method-arrow",60481),copilotUnavailable:h("copilot-unavailable",60482),repoPinned:h("repo-pinned",60483),keyboardTabAbove:h("keyboard-tab-above",60484),keyboardTabBelow:h("keyboard-tab-below",60485),gitPullRequestDone:h("git-pull-request-done",60486),mcp:h("mcp",60487),extensionsLarge:h("extensions-large",60488),layoutPanelDock:h("layout-panel-dock",60489),layoutSidebarLeftDock:h("layout-sidebar-left-dock",60490),layoutSidebarRightDock:h("layout-sidebar-right-dock",60491),terminalTwo:h("terminal-two",60800),checkTwo:h("check-two",60801),xTwo:h("x-two",60802),expander:h("expander",60803),restore:h("restore",60804),pinTwo:h("pin-two",60805),stopTwo:h("stop-two",60806),brain:h("brain",60807),magnifyingGlass:h("magnifying-glass",60808),imageTwo:h("image-two",60809),microphone:h("microphone",60810),submit:h("submit",60811),running:h("running",60812),fileAddTwo:h("file-add-two",60813),infinity:h("infinity",60814),editTwo:h("edit-two",60815),stopThree:h("stop-three",60816),warningTwo:h("warning-two",60817),arrowLeftTwo:h("arrow-left-two",60818),redoTwo:h("redo-two",60819),infoTwo:h("info-two",60820),chat:h("chat",60821),thumbsDown:h("thumbs-down",60822),thumbsUp:h("thumbs-up",60823),thumbsDownFilled:h("thumbs-down-filled",60824),thumbsUpFilled:h("thumbs-up-filled",60825),copyTwo:h("copy-two",60826),ellipsisTwo:h("ellipsis-two",60827),eyeTwo:h("eye-two",60828),globeTwo:h("globe-two",60829),reload:h("reload",60830),folderTwo:h("folder-two",60831),eraser:h("eraser",60832),swirlSparkle:h("swirl-sparkle",60833),sendTwo:h("send-two",60834),inboxTwo:h("inbox-two",60835),fileTwo:h("file-two",60836),list:h("list",60837),calendarTwo:h("calendar-two",60838),openNotebook:h("open-notebook",60839),paperWords:h("paper-words",60840),mortarboard:h("mortarboard",60841),lightning:h("lightning",60842),hammer:h("hammer",60843),keyboardTwo:h("keyboard-two",60844),arrowUpTwo:h("arrow-up-two",60845),import:h("import",60846),targetTwo:h("target-two",60847),tab:h("tab",60848),magic:h("magic",60849),cloneTwo:h("clone-two",60850),brush:h("brush",60851),branch:h("branch",60852),addTwo:h("add-two",60853),historyTwo:h("history-two",60854),cloudTwo:h("cloud-two",60855),review:h("review",60856),plusSquare:h("plus-square",60857),checkCircled:h("check-circled",60858),dottedCircle:h("dotted-circle",60859),warnCircle:h("warn-circle",60860),downLocalMachine:h("down-local-machine",60861),mergeUpwards:h("merge-upwards",60862),asterisk:h("asterisk",60863),time:h("time",60864),arrowUpRight:h("arrow-up-right",60865),arrowUpRightSquare:h("arrow-up-right-square",60866),bubbleAndPencil:h("bubble-and-pencil",60867),downloadOnSquare:h("download-on-square",60868),shippingBox:h("shipping-box",60869),chevronForwardDotted:h("chevron-forward-dotted",60870),cylinderSplit:h("cylinder-split",60871),cubeNodes:h("cube-nodes",60872),clipboardList:h("clipboard-list",60873),circleShine:h("circle-shine",60874),chevronUpDown:h("chevron-up-down",60875),cube:h("cube",60876),telecom:h("telecom",60877),micTwo:h("mic-two",60878),hourglass:h("hourglass",60879),todos:h("todos",60880),hourglassTwo:h("hourglass-two",60881),laptop:h("laptop",60882),grep:h("grep",60883),chevronDblLeft:h("chevron-dbl-left",60884),squareAndPencil:h("square-and-pencil",60885),doubleTerminal:h("double-terminal",60886),sidebarLeft:h("sidebar-left",60887),filesTwo:h("files-two",60888),cursor:h("cursor",60889),compose:h("compose",60894),cursorBiggest:h("cursor-biggest",60899),terminalFilled:h("terminal-filled",60900),rectangleDashed:h("rectangle-dashed",60901),squareArrow:h("square-arrow",60902),unfoldDashed:h("unfold-dashed",60904),foldDashed:h("fold-dashed",60905)}}});function e6(){return Object.values(Ti)}var t6,Ti,tf=g({"out-build/vs/base/common/codicons.js"(){"use strict";XE(),UM(),t6={dialogError:h("dialog-error","error"),dialogWarning:h("dialog-warning","warning"),dialogInfo:h("dialog-info","info"),dialogClose:h("dialog-close","close"),treeItemExpanded:h("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:h("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:h("tree-filter-on-type-off","list-selection"),treeFilterClear:h("tree-filter-clear","close"),treeItemLoading:h("tree-item-loading","loading"),menuSelection:h("menu-selection","check"),menuSubmenu:h("menu-submenu","chevron-right"),menuBarMore:h("menubar-more","more"),scrollbarButtonLeft:h("scrollbar-button-left","triangle-left"),scrollbarButtonRight:h("scrollbar-button-right","triangle-right"),scrollbarButtonUp:h("scrollbar-button-up","triangle-up"),scrollbarButtonDown:h("scrollbar-button-down","triangle-down"),toolBarMore:h("toolbar-more","more"),quickInputBack:h("quick-input-back","arrow-left"),dropDownButton:h("drop-down-button",60084),symbolCustomColor:h("symbol-customcolor",60252),exportIcon:h("export",60332),workspaceUnspecified:h("workspace-unspecified",60355),newLine:h("newline",60394),gitFetch:h("git-fetch",60445),lightbulbSparkleAutofix:h("lightbulb-sparkle-autofix",60447),debugBreakpointPending:h("debug-breakpoint-pending",60377)},Ti={...ZE,...t6}}}),Sv,Ml,i6=g({"out-build/vs/base/common/themables.js"(){"use strict";tf(),(function(t){function e(i){return i&&typeof i=="object"&&typeof i.id=="string"}t.isThemeColor=e})(Sv||(Sv={})),(function(t){t.iconNameSegment="[A-Za-z0-9]+",t.iconNameExpression="[A-Za-z0-9-]+",t.iconModifierExpression="~[A-Za-z]+",t.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${t.iconNameExpression})(${t.iconModifierExpression})?$`);function i(f){const p=e.exec(f.id);if(!p)return i(Ti.error);const[,v,m]=p,y=["codicon","codicon-"+v];return m&&y.push("codicon-modifier-"+m.substring(1)),y}t.asClassNameArray=i;function r(f){const p=e.exec(f.id);if(!p)return r(Ti.error);const[,v,m]=p;let y=`codicon codicon-${v}`;return m&&(y+=` codicon-modifier-${m.substring(1)}`),y}t.asClassName=r;function s(f){const p=e.exec(f.id);if(!p)return s(Ti.error);const[,v,m]=p;let y=`.codicon.codicon-${v}`;return m&&(y+=`.codicon-modifier-${m.substring(1)}`),y}t.asCSSSelector=s;function n(f){return f&&typeof f=="object"&&typeof f.id=="string"&&(typeof f.color>"u"||Sv.isThemeColor(f.color))}t.isThemeIcon=n;const o=new RegExp(`^\\$\\((${t.iconNameExpression}(?:${t.iconModifierExpression})?)\\)$`);function a(f){const p=o.exec(f);if(!p)return;const[,v]=p;return{id:v}}t.fromString=a;function c(f){return{id:f}}t.fromId=c;function l(f,p){let v=f.id;const m=v.lastIndexOf("~");return m!==-1&&(v=v.substring(0,m)),p&&(v=`${v}~${p}`),{id:v}}t.modify=l;function u(f){const p=f.id.lastIndexOf("~");if(p!==-1)return f.id.substring(p+1)}t.getModifier=u;function d(f,p){return f.id===p.id&&f.color?.id===p.color?.id}t.isEqual=d})(Ml||(Ml={}))}});import dr from"electron";import{release as $M}from"os";var r6,_v,Tl,s6,n6=g({"out-build/vs/platform/windows/electron-main/windowImpl.js"(){"use strict";ae(),St(),In(),q(),L(),Ie(),ls(),z(),re(),we(),tl(),Xe(),Vn(),ct(),al(),Ze(),ft(),K(),lt(),_l(),NM(),tn(),ti(),i6(),qc(),ks(),ut(),hi(),qn(),zc(),Xr(),Vi(),$n(),Dl(),G(),Nd(),it(),ua(),Re(),(function(t){t[t.NONE=0]="NONE",t[t.NAVIGATING=1]="NAVIGATING",t[t.READY=2]="READY"})(r6||(r6={})),_v=class M8 extends N{get lastFocusTime(){return this._lastFocusTime}get win(){return this._win}get webContents(){return this._webContents}setWin(e,i){this._win=e,this._register(P.fromNodeEventEmitter(e,"maximize")(()=>this._onDidMaximize.fire())),this._register(P.fromNodeEventEmitter(e,"unmaximize")(()=>this._onDidUnmaximize.fire())),this._register(P.fromNodeEventEmitter(e,"closed")(()=>{this._onDidClose.fire(),this.dispose()})),this._register(P.fromNodeEventEmitter(e,"focus")(()=>{this._lastFocusTime=Date.now()})),this._register(P.fromNodeEventEmitter(this._win,"enter-full-screen")(()=>this._onDidEnterFullScreen.fire())),this._register(P.fromNodeEventEmitter(this._win,"leave-full-screen")(()=>this._onDidLeaveFullScreen.fire()));const r=!Nn(this.configurationService,i?.titleBarStyle==="hidden"?"custom":void 0);if(O&&r&&e.setSheetOffset(ox($M())?28:22),r&&Fm(this.configurationService)){const s=this.stateService.getItem(M8.windowControlHeightStateStorageKey);s?this.updateWindowControls({height:s}):this.updateWindowControls({height:d4})}B&&r&&e.hookWindowMessage(278,()=>{const[n,o]=e.getPosition(),a=dr.screen.getCursorScreenPoint(),c=a.x-n,l=a.y-o;return!(c>30&&l>=0&&l<=Math.max(e.getBounds().height*.15,35))||(e.setEnabled(!1),e.setEnabled(!0),this._onDidTriggerSystemContextMenu.fire({x:c,y:l})),0}),this.environmentMainService.args["open-devtools"]===!0&&e.webContents.openDevTools(),O&&(this._register(this.onDidEnterFullScreen(()=>{this.joinNativeFullScreenTransition?.complete(!0)})),this._register(this.onDidLeaveFullScreen(()=>{this.joinNativeFullScreenTransition?.complete(!0)})))}constructor(e,i,r,s){super(),this.configurationService=e,this.stateService=i,this.environmentMainService=r,this.logService=s,this._onDidClose=this._register(new D),this.onDidClose=this._onDidClose.event,this._onDidMaximize=this._register(new D),this.onDidMaximize=this._onDidMaximize.event,this._onDidUnmaximize=this._register(new D),this.onDidUnmaximize=this._onDidUnmaximize.event,this._onDidTriggerSystemContextMenu=this._register(new D),this.onDidTriggerSystemContextMenu=this._onDidTriggerSystemContextMenu.event,this._onDidEnterFullScreen=this._register(new D),this.onDidEnterFullScreen=this._onDidEnterFullScreen.event,this._onDidLeaveFullScreen=this._register(new D),this.onDidLeaveFullScreen=this._onDidLeaveFullScreen.event,this._lastFocusTime=Date.now(),this._win=null,this._webContents=void 0,this.transientIsNativeFullScreen=void 0,this.joinNativeFullScreenTransition=void 0}applyState(e,i,r=dr.screen.getAllDisplays().length>0){const s=this.configurationService.getValue("window"),n=O&&s?.nativeTabs===!0;(O||B)&&r&&(!n||Gc().length===1)&&[e.width,e.height,e.x,e.y].every(o=>typeof o=="number")&&this._win?.setBounds({width:e.width,height:e.height,x:e.x,y:e.y}),(e.mode===0||e.mode===3)&&!i.hideBecauseShadowWindow&&(this._win?.maximize(),e.mode===3&&this.setFullScreen(!0,!0),this._win?.show())}setRepresentedFilename(e){O?this.win?.setRepresentedFilename(e):this.representedFilename=e}getRepresentedFilename(){return O?this.win?.getRepresentedFilename():this.representedFilename}setDocumentEdited(e){O&&this.win?.setDocumentEdited(e),this.documentEdited=e}isDocumentEdited(){return O?!!this.win?.isDocumentEdited():!!this.documentEdited}focus(e){O&&e?.force&&dr.app.focus({steal:!0});const i=this.win;i&&(i.isMinimized()&&i.restore(),i.isVisible()||i.show(),i.focus())}static{this.windowControlHeightStateStorageKey="windowControlHeight"}updateWindowControls(e){const i=this.win;if(i){if(e.height&&this.stateService.setItem(Tl.windowControlHeightStateStorageKey,e.height),!O&&Fm(this.configurationService))i.setTitleBarOverlay({color:e.backgroundColor?.trim()===""?void 0:e.backgroundColor,symbolColor:e.foregroundColor?.trim()===""?void 0:e.foregroundColor,height:e.height?e.height-1:void 0});else if(O){if(e.hideTrafficLights===!0)i.setWindowButtonPosition({x:-100,y:7});else if(e.height!==void 0){const r=Math.floor((e.height-16)/2);r?i.setWindowButtonPosition({x:r+1,y:r}):i.setWindowButtonPosition(null)}}}}toggleFullScreen(){this.setFullScreen(!this.isFullScreen,!1)}setFullScreen(e,i){o4(this.configurationService)?this.setNativeFullScreen(e,i):this.setSimpleFullScreen(e)}get isFullScreen(){if(O&&typeof this.transientIsNativeFullScreen=="boolean")return this.transientIsNativeFullScreen;const e=this.win,i=e?.isFullScreen(),r=e?.isSimpleFullScreen();return!!(i||r)}setNativeFullScreen(e,i){const r=this.win;r?.isSimpleFullScreen()&&r?.setSimpleFullScreen(!1),this.doSetNativeFullScreen(e,i)}doSetNativeFullScreen(e,i){if(O){this.transientIsNativeFullScreen=e;const s=this.joinNativeFullScreenTransition=new ys;(async()=>{const n=await Promise.race([s.p,Pi(1e4).then(()=>!1)]);this.joinNativeFullScreenTransition===s&&(this.transientIsNativeFullScreen=void 0,this.joinNativeFullScreenTransition=void 0,!n&&e&&i&&this.win&&!this.win.isFullScreen()&&(this.logService.warn("window: native macOS fullscreen transition did not happen within 10s from restoring"),this._onDidLeaveFullScreen.fire()))})()}this.win?.setFullScreen(e)}setSimpleFullScreen(e){const i=this.win;i?.isFullScreen()&&this.doSetNativeFullScreen(!1,!1),i?.setSimpleFullScreen(e),i?.webContents.focus()}dispose(){super.dispose(),this._win=null}},Tl=class extends _v{get id(){return this._id}get webContents(){return this._win?.webContents??this.browserView?.webContents}get backupPath(){return this._config?.backupPath}get openedWorkspace(){return this._config?.workspace}get profile(){if(!this.config)return;const e=this.userDataProfilesService.profiles.find(i=>i.id===this.config?.profiles.profile.id);return this.isExtensionDevelopmentHost&&e?e:this.userDataProfilesService.getProfileForWorkspace(this.config.workspace??Ld(this.backupPath,this.isExtensionDevelopmentHost))??this.userDataProfilesService.defaultProfile}get remoteAuthority(){return this._config?.remoteAuthority}get config(){return this._config}get isExtensionDevelopmentHost(){return!!this._config?.extensionDevelopmentPath}get isExtensionTestHost(){return!!this._config?.extensionTestsPath}get isExtensionDevelopmentTestFromCli(){return this.isExtensionDevelopmentHost&&this.isExtensionTestHost&&!this._config?.debugId}constructor(e,i,r,s,n,o,a,c,l,u,d,f,p,v,m,y,S,E,k,R,C,M){super(u,R,s,i),this.loggerMainService=r,this.policyService=n,this.userDataProfilesService=o,this.fileService=a,this.applicationStorageMainService=c,this.storageMainService=l,this.themeMainService=d,this.workspacesManagementMainService=f,this.backupMainService=p,this.telemetryService=v,this.dialogMainService=m,this.lifecycleMainService=y,this.productService=S,this.windowsMainService=k,this.cssDevelopmentService=M,this._onWillLoad=this._register(new D),this.onWillLoad=this._onWillLoad.event,this._onDidSignalReady=this._register(new D),this.onDidSignalReady=this._onDidSignalReady.event,this._onDidDestroy=this._register(new D),this.onDidDestroy=this._onDidDestroy.event,this._win=null,this.isBrowserViewVisible=!1,this.lastShownAtUnixMs=void 0,this.whenReadyCallbacks=[],this.touchBarGroups=[],this.currentHttpProxy=void 0,this.currentNoProxy=void 0,this.customZoomLevel=void 0,this.isAgentWindow=!1,this.wasLoaded=!1,this.readyState=0,this.parentWindowDisposableStore=new ke;{this.configObjectUrl=this._register(E.createIPCObjectUrl());const[$,ge]=this.restoreWindowState(e.state);this.windowState=$,this.logService.trace("window#ctor: using window state",$);const Ke=e.shadowWindowForWorkspaceId!==void 0&&e.shadowWindowForWorkspaceId.length>0&&!W4,ie=C.invokeFunction(Md,this.windowState,{hideBecauseShadowWindow:Ke},{preload:Ct.asFileUri("vs/base/parts/sandbox/electron-sandbox/preload.js").fsPath,additionalArguments:[`--vscode-window-config=${this.configObjectUrl.resource.toString()}`],v8CacheOptions:this.environmentMainService.useCodeCache?"bypassHeatCheck":"none"});if(Ve("code/willCreateCodeBrowserWindow"),e.windowInWindow===void 0)this._win=new dr.BrowserWindow(ie),this._id=this._win.id,this.setWin(this._win,ie);else{this.browserView=new dr.WebContentsView(ie),this.browserView.setBackgroundColor("#00000000");const Et=65534;let W=1e3+Math.round(Math.random()*(Et-1e3));for(;this.windowsMainService.getWindowById(W);)W=1e3+Math.round(Math.random()*(Et-1e3));this._id=W}Ve("code/didCreateCodeBrowserWindow"),this.applyState(this.windowState,{hideBecauseShadowWindow:Ke},ge),this._lastFocusTime=Date.now()}let J=parseInt(this.environmentMainService.args["unresponsive-sample-interval"]||"1000"),ne=parseInt(this.environmentMainService.args["unresponsive-sample-period"]||"15000");(J<=0||ne<=0||J>ne)&&(this.logService.warn(`Invalid unresponsive sample interval (${J}ms) or period (${ne}ms), using defaults.`),J=1e3,ne=15e3),this.jsCallStackMap=new Map,this.jsCallStackEffectiveSampleCount=Math.round(ne/J),this.jsCallStackCollector=this._register(new Xu(J)),this.jsCallStackCollectorStopScheduler=this._register(new br(()=>{this.stopCollectingJScallStacks()},ne)),this.onConfigurationUpdated(),this.createTouchBar(),this.registerListeners()}setReady(){for(this.logService.trace(`window#load: window reported ready (id: ${this._id})`),this.readyState=2;this.whenReadyCallbacks.length;)this.whenReadyCallbacks.pop()(this);this._onDidSignalReady.fire()}attachToParent(e){if(this.browserView&&e&&e.win){this.parentWindowId!==void 0&&this.parentWindowDisposableStore.clear(),this.parentWindowId=e.id;const i=e.win.getBounds();this.browserView.setBounds({x:0,y:0,width:i.width,height:i.height}),this.parentWindowDisposableStore.add({dispose:()=>{this.browserView&&e&&e.win&&(e.win.contentView.removeChildView(this.browserView),this.isBrowserViewVisible=!1)}}),this.parentWindowDisposableStore.add(P.fromNodeEventEmitter(e.win,"closed")(()=>{this.close()})),this.parentWindowDisposableStore.add(P.fromNodeEventEmitter(e.win,"resize")(()=>{if(!this.browserView||!e.win||this.windowInWindowExplicitBounds!==void 0)return;const r=e.win.getBounds();this.browserView.setBounds({x:0,y:0,width:r.width,height:r.height})})),this.parentWindowDisposableStore.add(P.fromNodeEventEmitter(e.win,"focus")(()=>{!this.browserView||!e.win||this.isBrowserViewVisible&&this.browserView.webContents.focus()}))}}ready(){return new Promise(e=>{if(this.isReady)return e(this);this.whenReadyCallbacks.push(e)})}get isReady(){return this.readyState===2}get whenClosedOrLoaded(){return new Promise(e=>{function i(){r.dispose(),s.dispose(),e()}const r=this.onDidClose(()=>i()),s=this.onWillLoad(()=>i())})}registerListeners(){let e=this._win&&this._register(P.fromNodeEventEmitter(this._win,"unresponsive")(()=>this.onWindowError(1)));e=this._win&&this._register(P.fromNodeEventEmitter(this._win,"responsive")(()=>this.onWindowError(4))),e=this._win?.webContents&&this._register(P.fromNodeEventEmitter(this._win.webContents,"render-process-gone",(r,s)=>s)(r=>this.onWindowError(2,{...r}))),e=this._win?.webContents&&this._register(P.fromNodeEventEmitter(this._win.webContents,"did-fail-load",(r,s,n)=>({exitCode:s,reason:n}))(({exitCode:r,reason:s})=>this.onWindowError(3,{reason:s,exitCode:r}))),e=this.webContents&&this._register(P.fromNodeEventEmitter(this.webContents,"will-prevent-unload")(r=>r.preventDefault())),e=this.webContents&&this._register(P.fromNodeEventEmitter(this.webContents,"did-finish-load")(()=>{this.pendingLoadConfig&&(this._config=this.pendingLoadConfig,this.pendingLoadConfig=void 0)})),this._register(this.onDidMaximize(()=>{this._config&&(this._config.maximized=!0)})),this._register(this.onDidUnmaximize(()=>{this._config&&(this._config.maximized=!1)})),this._register(this.onDidEnterFullScreen(()=>{this.sendWhenReady("vscode:enterFullScreen",Te.None)})),this._register(this.onDidLeaveFullScreen(()=>{this.sendWhenReady("vscode:leaveFullScreen",Te.None)})),this._register(this.configurationService.onDidChangeConfiguration(r=>this.onConfigurationUpdated(r))),this._register(this.workspacesManagementMainService.onDidDeleteUntitledWorkspace(r=>this.onDidDeleteUntitledWorkspace(r)));const i=["https://marketplace.visualstudio.com/*","https://*.vsassets.io/*","http://*.cursor.localhost:8001/*","https://staging-marketplace.cursor.sh/*","https://marketplace.cursor.sh/*","https://marketplace.cursorapi.com/*"];this.webContents?.session.webRequest.onBeforeSendHeaders({urls:i},async(r,s)=>{const n=await this.getMarketplaceHeaders();s({cancel:!1,requestHeaders:Object.assign(r.requestHeaders,n)})})}getMarketplaceHeaders(){return this.marketplaceHeadersPromise||(this.marketplaceHeadersPromise=FM(this.productService,this.environmentMainService,this.configurationService,this.fileService,this.applicationStorageMainService,this.telemetryService)),this.marketplaceHeadersPromise}async onWindowError(e,i){switch(e){case 2:this.logService.error(`CodeWindow: renderer process gone (reason: ${i?.reason||"<unknown>"}, code: ${i?.exitCode||"<unknown>"})`);break;case 1:this.logService.error("CodeWindow: detected unresponsive");break;case 4:this.logService.error("CodeWindow: recovered from unresponsive");break;case 3:this.logService.error(`CodeWindow: failed to load (reason: ${i?.reason||"<unknown>"}, code: ${i?.exitCode||"<unknown>"})`);break}switch(this.telemetryService.publicLog2("windowerror",{type:e,reason:i?.reason,code:i?.exitCode}),e){case 1:case 2:if(this.isExtensionDevelopmentTestFromCli){this.lifecycleMainService.kill(1);return}if(this.environmentMainService.args["enable-smoke-test-driver"]){await this.destroyWindow(!1,!1),this.lifecycleMainService.quit();return}if(e===1){if(this.isExtensionDevelopmentHost||this.isExtensionTestHost||this._win&&this._win.webContents&&this._win.webContents.isDevToolsOpened())return;this.jsCallStackCollector.trigger(()=>this.startCollectingJScallStacks()),this.jsCallStackCollectorStopScheduler.schedule();const{response:r,checkboxChecked:s}=await this.dialogMainService.showMessageBox({type:"warning",buttons:[w(2626,null),w(2627,null),w(2628,null)],message:w(2629,null),detail:w(2630,null),checkboxLabel:this._config?.workspace?w(2631,null):void 0},this._win??void 0);if(r!==2){const n=r===0;this.stopCollectingJScallStacks(),await this.destroyWindow(n,s)}}else if(e===2){let r;i?r=w(2633,null,i.reason,i.exitCode??"<unknown>"):r=w(2632,null);const{response:s,checkboxChecked:n}=await this.dialogMainService.showMessageBox({type:"warning",buttons:[this._config?.workspace?w(2634,null):w(2635,null),w(2636,null)],message:r,detail:this._config?.workspace?w(2637,null):w(2638,null),checkboxLabel:this._config?.workspace?w(2639,null):void 0},this._win??void 0),o=s===0;await this.destroyWindow(o,n)}break;case 4:this.stopCollectingJScallStacks();break}}async destroyWindow(e,i){const r=this._config?.workspace;if(i&&r)try{const s=this.storageMainService.workspaceStorage(r);await s.init(),s.delete("memento/workbench.parts.editor"),await s.close()}catch(s){this.logService.error(s)}this._onDidDestroy.fire();try{if(e&&this._config){let s,n;Ri(r)?s={folderUri:r.uri}:zt(r)?s={workspaceUri:r.configPath}:n=!0,(await this.windowsMainService.open({context:5,userEnv:this._config.userEnv,cli:{...this.environmentMainService.args,_:[]},urisToOpen:s?[s]:void 0,forceEmpty:n,forceNewWindow:!0,remoteAuthority:this.remoteAuthority})).at(0)?.focus()}}finally{this._win?.destroy()}}onDidDeleteUntitledWorkspace(e){this._config?.workspace?.id===e.id&&(this._config.workspace=void 0)}onConfigurationUpdated(e){if(!e||e.affectsConfiguration("window.menuBarVisibility")){const i=this.getMenuBarVisibility();i!==this.currentMenuBarVisibility&&(this.currentMenuBarVisibility=i,this.setMenuBarVisibility(i))}if(!e||e.affectsConfiguration("http.proxy")||e.affectsConfiguration("http.noProxy")){let r=(this.configurationService.inspect("http.proxy").userLocalValue||"").trim()||(process.env.https_proxy||process.env.HTTPS_PROXY||process.env.http_proxy||process.env.HTTP_PROXY||"").trim()||void 0;if(r?.indexOf("@")!==-1){const n=x.parse(r),o=n.authority.indexOf("@");o!==-1&&(r=n.with({authority:n.authority.substring(o+1)}).toString())}r?.endsWith("/")&&(r=r.substr(0,r.length-1));const s=(this.configurationService.getValue("http.noProxy")||[]).map(n=>n.trim()).join(",")||(process.env.no_proxy||process.env.NO_PROXY||"").trim()||void 0;if((r||"").indexOf("@")===-1&&(r!==this.currentHttpProxy||s!==this.currentNoProxy)){this.currentHttpProxy=r,this.currentNoProxy=s;const n=r||"",o=s?`${s},<local>`:"<local>";this.logService.trace(`Setting proxy to '${n}', bypassing '${o}'`),this.webContents?.session.setProxy({proxyRules:n,proxyBypassRules:o,pacScript:""}),dr.app.setProxy({proxyRules:n,proxyBypassRules:o,pacScript:""})}}}addTabbedWindow(e){O&&e.win&&this._win?.addTabbedWindow(e.win)}load(e,i=Object.create(null)){this.logService.trace(`window#load: attempt to load window (id: ${this._id})`),this.isDocumentEdited()&&(!i.isReload||!this.backupMainService.isHotExitEnabled())&&this.setDocumentEdited(!1),i.isReload||(this.getRepresentedFilename()&&this.setRepresentedFilename(""),this._win?.setTitle(this.productService.nameLong)),this.updateConfiguration(e,i),this.readyState===0?this._config=e:this.pendingLoadConfig=e,this.readyState=1,this.webContents?.loadURL(Ct.asBrowserUri(`vs/code/electron-sandbox/workbench/workbench${this.environmentMainService.isBuilt?"":"-dev"}.html`).toString(!0));const r=this.wasLoaded;this.wasLoaded=!0,!this.environmentMainService.isBuilt&&!this.environmentMainService.extensionTestsLocationURI&&this._register(new br(()=>{this._win&&!this._win.isVisible()&&!this._win.isMinimized()&&!e.shadowWindowForWorkspaceId&&e.windowInWindow===void 0&&(this._win.show(),this.focus({force:!0}),this.webContents?.openDevTools())},1e4)).schedule(),this._onWillLoad.fire({workspace:e.workspace,reason:i.isReload?3:r?2:1})}updateConfiguration(e,i){const r=(this._config??this.pendingLoadConfig)?.userEnv;if(r){const s=zn(r)&&!zn(e.userEnv),n=this.isExtensionDevelopmentHost;(s||n)&&(e.userEnv={...r,...e.userEnv})}process.env.CHROME_CRASHPAD_PIPE_NAME&&Object.assign(e.userEnv,{CHROME_CRASHPAD_PIPE_NAME:process.env.CHROME_CRASHPAD_PIPE_NAME}),i.disableExtensions!==void 0&&(e["disable-extensions"]=i.disableExtensions);try{this._win&&(e.handle=Y.wrap(this._win.getNativeWindowHandle()))}catch(s){this.logService.error(`Error getting native window handle: ${s}`)}e.fullscreen=this.isFullScreen,e.maximized=this._win?.isMaximized()??!1,e.partsSplash=this.themeMainService.getWindowSplash(e.workspace),e.zoomLevel=this.getZoomLevel(),e.isCustomZoomLevel=typeof this.customZoomLevel=="number",e.isCustomZoomLevel&&e.partsSplash&&(e.partsSplash.zoomLevel=e.zoomLevel),Ve("code/willOpenNewWindow"),e.perfMarks=eg(),this.configObjectUrl.update(e)}async reload(e){const i=Object.assign({},this._config);i.workspace=await this.validateWorkspaceBeforeReload(i),delete i.filesToOpenOrCreate,delete i.filesToDiff,delete i.filesToMerge,delete i.filesToWait,this.isExtensionDevelopmentHost&&e&&(i.verbose=e.verbose,i.debugId=e.debugId,i.extensionEnvironment=e.extensionEnvironment,i["inspect-extensions"]=e["inspect-extensions"],i["inspect-brk-extensions"]=e["inspect-brk-extensions"],i["extensions-dir"]=e["extensions-dir"]),i.accessibilitySupport=dr.app.isAccessibilitySupportEnabled(),i.isInitialStartup=!1,i.policiesData=this.policyService.serialize(),i.continueOn=this.environmentMainService.continueOn,i.profiles={all:this.userDataProfilesService.profiles,profile:this.profile||this.userDataProfilesService.defaultProfile,home:this.userDataProfilesService.profilesHome},i.logLevel=this.loggerMainService.getLogLevel(),i.loggers=this.loggerMainService.getGlobalLoggers(),i.cssModules=this.cssDevelopmentService.isEnabled?await this.cssDevelopmentService.getCssModules(!0):void 0,i.hmr=e?.hmr,this.load(i,{isReload:!0,disableExtensions:e?.["disable-extensions"]})}async validateWorkspaceBeforeReload(e){if(zt(e.workspace)){const i=e.workspace.configPath;if(i.scheme===T.file&&!await this.fileService.exists(i))return}else if(Ri(e.workspace)){const i=e.workspace.uri;if(i.scheme===T.file&&!await this.fileService.exists(i))return}return e.workspace}serializeWindowState(){if(!this._win)return en();if(this.isFullScreen){let r;try{r=dr.screen.getDisplayMatching(this.getBounds())}catch{}const s=en();return{mode:3,display:r?r.id:void 0,width:this.windowState.width||s.width,height:this.windowState.height||s.height,x:this.windowState.x||0,y:this.windowState.y||0,zoomLevel:this.customZoomLevel,isAgentWindow:this.isAgentWindow}}const e=Object.create(null);let i;if(!O&&this._win.isMaximized()?i=0:i=1,i===0?e.mode=0:e.mode=1,i===1||i===0){let r;i===1?r=this.getBounds():r=this._win.getNormalBounds(),e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height}return e.zoomLevel=this.customZoomLevel,e.isAgentWindow=this.isAgentWindow,e}restoreWindowState(e){Ve("code/willRestoreCodeWindowState");let i=!1;if(e){this.customZoomLevel=e.zoomLevel;try{const r=dr.screen.getAllDisplays();i=r.length>1,e=Td.validateWindowState(this.logService,e,r)}catch(r){this.logService.warn(`Unexpected error validating window state: ${r}
|
|
${r.stack}`)}}return Ve("code/didRestoreCodeWindowState"),[e||en(),i]}getBounds(){if(!this._win)return this.browserView?.getBounds()??{x:0,y:0,width:0,height:0};const[e,i]=this._win.getPosition(),[r,s]=this._win.getSize();return{x:e,y:i,width:r,height:s}}setFullScreen(e,i){super.setFullScreen(e,i),this.sendWhenReady(e?"vscode:enterFullScreen":"vscode:leaveFullScreen",Te.None),this.currentMenuBarVisibility&&this.setMenuBarVisibility(this.currentMenuBarVisibility,!1)}getMenuBarVisibility(){let e=d3(this.configurationService);return["visible","toggle","hidden"].indexOf(e)<0&&(e="classic"),e}setMenuBarVisibility(e,i=!0){O||(e==="toggle"&&i&&this.send("vscode:showInfoMessage",w(2640,null)),e==="hidden"?setTimeout(()=>{this.doSetMenuBarVisibility(e)}):this.doSetMenuBarVisibility(e))}doSetMenuBarVisibility(e){const i=this.isFullScreen;if(this._win)switch(e){case"classic":this._win.setMenuBarVisibility(!i),this._win.autoHideMenuBar=i;break;case"visible":this._win.setMenuBarVisibility(!0),this._win.autoHideMenuBar=!1;break;case"toggle":this._win.setMenuBarVisibility(!1),this._win.autoHideMenuBar=!0;break;case"hidden":this._win.setMenuBarVisibility(!1),this._win.autoHideMenuBar=!1;break}}notifyZoomLevel(e){this.customZoomLevel=e}setIsAgentWindow(e){this.isAgentWindow=e}getIsAgentWindow(){return this.isAgentWindow}getZoomLevel(){return typeof this.customZoomLevel=="number"?this.customZoomLevel:this.configurationService.getValue("window")?.zoomLevel}close(){if(this._win)this._win.close();else if(this.browserView){try{this.browserView.webContents.close({waitForBeforeUnload:!1})}catch(e){this.logService.warn(`Error closing browser view: ${rr(e)}`)}this._onDidClose.fire(),this.dispose()}}sendWhenReady(e,i,...r){this.isReady?this.send(e,...r):this.ready().then(()=>{i.isCancellationRequested||this.send(e,...r)})}send(e,...i){if(this.webContents){if(this._win?.isDestroyed()||this.webContents.isDestroyed()){this.logService.warn(`Sending IPC message to channel '${e}' for window that is destroyed`);return}try{this.webContents.send(e,...i)}catch(r){this.logService.warn(`Error sending IPC message to channel '${e}' of window ${this._id}: ${rr(r)}`)}}}updateTouchBar(e){O&&this.touchBarGroups.forEach((i,r)=>{const s=e[r];i.segments=this.createTouchBarGroupSegments(s)})}createTouchBar(){if(O){for(let e=0;e<10;e++){const i=this.createTouchBarGroup();this.touchBarGroups.push(i)}this._win&&this._win.setTouchBar(new dr.TouchBar({items:this.touchBarGroups}))}}createTouchBarGroup(e=[]){const i=this.createTouchBarGroupSegments(e),r=new dr.TouchBar.TouchBarSegmentedControl({segments:i,mode:"buttons",segmentStyle:"automatic",change:s=>{this.sendWhenReady("vscode:runAction",Te.None,{id:r.segments[s].id,from:"touchbar"})}});return r}createTouchBarGroupSegments(e=[]){return e.map(r=>{let s;r.icon&&!Ml.isThemeIcon(r.icon)&&r.icon?.dark?.scheme===T.file&&(s=dr.nativeImage.createFromPath(x.revive(r.icon.dark).fsPath),s.isEmpty()&&(s=void 0));let n;return typeof r.title=="string"?n=r.title:n=r.title.value,{id:r.id,label:s?void 0:n,icon:s}})}async startCollectingJScallStacks(){if(!this.jsCallStackCollector.isTriggered()){const e=await this._win?.webContents.mainFrame.collectJavaScriptCallStack();if(e){const i=this.jsCallStackMap.get(e)||0;this.jsCallStackMap.set(e,i+1)}this.jsCallStackCollector.trigger(()=>this.startCollectingJScallStacks())}}stopCollectingJScallStacks(){if(this.jsCallStackCollectorStopScheduler.cancel(),this.jsCallStackCollector.cancel(),this.jsCallStackMap.size){let e=`CodeWindow unresponsive samples:
|
|
`,i=0;const r=Array.from(this.jsCallStackMap.entries()).sort((s,n)=>n[1]-s[1]);for(const[s,n]of r){if(i+=n,Math.round(n*100/this.jsCallStackEffectiveSampleCount)>20){const o=new s6(s,this.id,this.win?.webContents.getOSProcessId());rc.onUnexpectedError(o)}e+=`<${n}> ${s}
|
|
`}e+=`Total Samples: ${i}
|
|
`,e+="For full overview of the unresponsive period, capture cpu profile via https://aka.ms/vscode-tracing-cpu-profile",this.logService.error(e)}this.jsCallStackMap.clear()}matches(e){return this._win?.webContents.id===e.id}dispose(){if(super.dispose(),this.parentWindowDisposableStore.dispose(),this.browserView){try{this.browserView.webContents.isDestroyed()||this.browserView.webContents.destroy()}catch(e){this.logService.warn(`Error destroying browser view: ${rr(e)}`)}this.browserView=null}this.loggerMainService.deregisterLoggers(this.id)}},Tl=__decorate([__param(1,V),__param(2,ya),__param(3,st),__param(4,Xn),__param(5,Gr),__param(6,mt),__param(7,xs),__param(8,Zo),__param(9,Qe),__param(10,Jo),__param(11,rn),__param(12,ea),__param(13,ei),__param(14,Is),__param(15,ze),__param(16,qe),__param(17,va),__param(18,ot),__param(19,Ii),__param(20,Or),__param(21,Gn)],Tl),s6=class extends Error{constructor(t,e,i=0){const r=Error.stackTraceLimit;Error.stackTraceLimit=0,super(`UnresponsiveSampleError: from window with ID ${e} belonging to process with pid ${i}`),Error.stackTraceLimit=r,this.name="UnresponsiveSampleError",this.stack=t}}}});import ba from"electron";function BM(t){const e={openedWindows:[]},i=t||{openedWindows:[]};return i.lastActiveWindow&&(e.lastActiveWindow=bv(i.lastActiveWindow)),i.lastPluginDevelopmentHostWindow&&(e.lastPluginDevelopmentHostWindow=bv(i.lastPluginDevelopmentHostWindow)),Array.isArray(i.openedWindows)&&(e.openedWindows=i.openedWindows.map(r=>bv(r))),e}function bv(t){const e={uiState:t.uiState};return t.backupPath&&(e.backupPath=t.backupPath),t.remoteAuthority&&(e.remoteAuthority=t.remoteAuthority),t.folder&&(e.folderUri=x.parse(t.folder)),t.workspaceIdentifier&&(e.workspace={id:t.workspaceIdentifier.id,configPath:x.parse(t.workspaceIdentifier.configURIPath)}),e}function jM(t){return{lastActiveWindow:t.lastActiveWindow&&Ev(t.lastActiveWindow),lastPluginDevelopmentHostWindow:t.lastPluginDevelopmentHostWindow&&Ev(t.lastPluginDevelopmentHostWindow),openedWindows:t.openedWindows.map(e=>Ev(e))}}function Ev(t){return{workspaceIdentifier:t.workspace&&{id:t.workspace.id,configURIPath:t.workspace.configPath.toString()},folder:t.folderUri&&t.folderUri.toString(),backupPath:t.backupPath,remoteAuthority:t.remoteAuthority,uiState:t.uiState}}var rf,sf,HM=g({"out-build/vs/platform/windows/electron-main/windowsStateHandler.js"(){"use strict";L(),z(),gt(),re(),Xe(),ft(),K(),Vi(),ut(),zc(),hi(),sf=class extends N{static{rf=this}static{this.windowsStateStorageKey="windowsState"}get state(){return this._state}constructor(e,i,r,s,n){super(),this.windowsMainService=e,this.stateService=i,this.lifecycleMainService=r,this.logService=s,this.configurationService=n,this.lastClosedState=void 0,this.shuttingDown=!1,this._state=BM(this.stateService.getItem(rf.windowsStateStorageKey)),this.registerListeners()}registerListeners(){ba.app.on("browser-window-blur",()=>{this.shuttingDown||this.saveWindowsState()}),this._register(this.lifecycleMainService.onBeforeCloseWindow(e=>this.onBeforeCloseWindow(e))),this._register(this.lifecycleMainService.onBeforeShutdown(()=>this.onBeforeShutdown())),this._register(this.windowsMainService.onDidChangeWindowsCount(e=>{e.newCount-e.oldCount>0&&(this.lastClosedState=void 0)})),this._register(this.windowsMainService.onDidDestroyWindow(e=>this.onBeforeCloseWindow(e)))}onBeforeShutdown(){this.shuttingDown=!0,this.saveWindowsState()}saveWindowsState(){const e=new Set,i={openedWindows:[],lastPluginDevelopmentHostWindow:this._state.lastPluginDevelopmentHostWindow,lastActiveWindow:this.lastClosedState};if(!i.lastActiveWindow){let n=this.windowsMainService.getLastActiveWindow();(!n||n.isExtensionDevelopmentHost||n.config?.shadowWindowForWorkspaceId||n.config?.windowInWindow!==void 0)&&(n=this.windowsMainService.getWindows().find(o=>!o.isExtensionDevelopmentHost&&!o.config?.shadowWindowForWorkspaceId&&o.config?.windowInWindow===void 0)),n&&(i.lastActiveWindow=this.toWindowState(n),i.lastActiveWindow.uiState.mode===3&&e.add(i.lastActiveWindow.uiState.display))}const r=this.windowsMainService.getWindows().find(n=>n.isExtensionDevelopmentHost&&!n.isExtensionTestHost);r&&(i.lastPluginDevelopmentHostWindow=this.toWindowState(r),i.lastPluginDevelopmentHostWindow.uiState.mode===3&&(e.has(i.lastPluginDevelopmentHostWindow.uiState.display)?O&&!r.win?.isSimpleFullScreen()&&(i.lastPluginDevelopmentHostWindow.uiState.mode=1):e.add(i.lastPluginDevelopmentHostWindow.uiState.display))),this.windowsMainService.getWindowCount()>1&&(i.openedWindows=this.windowsMainService.getWindows().filter(n=>!n.isExtensionDevelopmentHost&&!n.config?.shadowWindowForWorkspaceId&&n.config?.windowInWindow===void 0).map(n=>{const o=this.toWindowState(n);return o.uiState.mode===3&&(e.has(o.uiState.display)?O&&o.windowId!==i.lastActiveWindow?.windowId&&!n.win?.isSimpleFullScreen()&&(o.uiState.mode=1):e.add(o.uiState.display)),o}));const s=jM(i);this.stateService.setItem(rf.windowsStateStorageKey,s),this.shuttingDown&&this.logService.trace("[WindowsStateHandler] onBeforeShutdown",s)}onBeforeCloseWindow(e){if(this.lifecycleMainService.quitRequested)return;const i=this.toWindowState(e);e.isExtensionDevelopmentHost&&!e.isExtensionTestHost?this._state.lastPluginDevelopmentHostWindow=i:!e.isExtensionDevelopmentHost&&e.openedWorkspace&&!e.config?.shadowWindowForWorkspaceId&&e.config?.windowInWindow===void 0&&this._state.openedWindows.forEach(r=>{const s=zt(e.openedWorkspace)&&r.workspace?.id===e.openedWorkspace.id,n=Ri(e.openedWorkspace)&&r.folderUri&&rt.isEqual(r.folderUri,e.openedWorkspace.uri);(s||n)&&(r.uiState=i.uiState)}),this.windowsMainService.getWindowCount()===1&&(this.lastClosedState=i)}toWindowState(e){return{windowId:e.id,workspace:zt(e.openedWorkspace)?e.openedWorkspace:void 0,folderUri:Ri(e.openedWorkspace)?e.openedWorkspace.uri:void 0,backupPath:e.backupPath,remoteAuthority:e.remoteAuthority,uiState:e.serializeWindowState()}}getNewWindowState(e){const i=this.doGetNewWindowState(e),r=this.configurationService.getValue("window");if(i.mode===3){let s;i.hasDefaultState?s=!!(r?.newWindowDimensions&&["fullscreen","inherit","offset"].indexOf(r.newWindowDimensions)>=0):s=!!(this.lifecycleMainService.wasRestarted||r?.restoreFullscreen),s||(i.mode=1)}return i}doGetNewWindowState(e){const i=this.windowsMainService.getLastActiveWindow();if(!e.extensionTestsPath){if(e.extensionDevelopmentPath&&this.state.lastPluginDevelopmentHostWindow)return this.state.lastPluginDevelopmentHostWindow.uiState;const c=e.workspace;if(zt(c)){const u=this.state.openedWindows.filter(d=>d.workspace&&d.workspace.id===c.id).map(d=>d.uiState);if(u.length)return u[0]}if(Ri(c)){const u=this.state.openedWindows.filter(d=>d.folderUri&&rt.isEqual(d.folderUri,c.uri)).map(d=>d.uiState);if(u.length)return u[0]}else if(e.backupPath){const u=this.state.openedWindows.filter(d=>d.backupPath===e.backupPath).map(d=>d.uiState);if(u.length)return u[0]}const l=this.lastClosedState||this.state.lastActiveWindow;if(!i&&l)return l.uiState}let r;const s=ba.screen.getAllDisplays();if(s.length===1)r=s[0];else{if(O){const c=ba.screen.getCursorScreenPoint();r=ba.screen.getDisplayNearestPoint(c)}!r&&i&&(r=ba.screen.getDisplayMatching(i.getBounds())),r||(r=ba.screen.getPrimaryDisplay()||s[0])}let n=en();n.x=Math.round(r.bounds.x+r.bounds.width/2-n.width/2),n.y=Math.round(r.bounds.y+r.bounds.height/2-n.height/2);const o=this.configurationService.getValue("window");let a=!0;if(o?.newWindowDimensions){if(o.newWindowDimensions==="maximized")n.mode=0,a=!1;else if(o.newWindowDimensions==="fullscreen")n.mode=3,a=!1;else if((o.newWindowDimensions==="inherit"||o.newWindowDimensions==="offset")&&i){const c=i.serializeWindowState();c.mode===3?n.mode=3:n={...c,zoomLevel:void 0},a=n.mode!==3&&o.newWindowDimensions==="offset"}}return a&&(n=this.ensureNoOverlap(n)),n.hasDefaultState=!0,n}ensureNoOverlap(e){if(this.windowsMainService.getWindows().length===0)return e;e.x=typeof e.x=="number"?e.x:0,e.y=typeof e.y=="number"?e.y:0;const i=this.windowsMainService.getWindows().map(r=>r.getBounds());for(;i.some(r=>r.x===e.x||r.y===e.y);)e.x+=30,e.y+=30;return e}},sf=rf=__decorate([__param(0,ot),__param(1,Ii),__param(2,ze),__param(3,V),__param(4,Qe)],sf)}});import*as VM from"fs";import{app as qM,BrowserWindow as nf,shell as zM}from"electron";import{hostname as GM,release as KM,arch as YM}from"os";function Ea(t){return zt(t?.workspace)}function to(t){return Ri(t?.workspace)}var of,af,JM=g({"out-build/vs/platform/windows/electron-main/windowsMainService.js"(){"use strict";Ja(),Wt(),St(),q(),Bi(),qs(),L(),Ie(),ye(),ls(),z(),Wr(),gt(),xe(),re(),we(),tl(),Xe(),Vn(),ct(),Ze(),G(),ft(),K(),Sl(),_l(),nl(),Vi(),ks(),n6(),ut(),I2(),HM(),hi(),l1(),$h(),qn(),qc(),Xr(),$n(),Dl(),wh(),ua(),ai(),of=Object.create(null),af=class extends N{constructor(e,i,r,s,n,o,a,c,l,u,d,f,p,v,m,y,S,E,k,R,C,M,J){super(),this.machineId=e,this.macMachineId=i,this.sqmId=r,this.devDeviceId=s,this.initialUserEnv=n,this.logService=o,this.loggerService=a,this.policyService=l,this.environmentMainService=u,this.userDataProfilesMainService=d,this.lifecycleMainService=f,this.backupMainService=p,this.configurationService=v,this.workspacesHistoryMainService=m,this.workspacesManagementMainService=y,this.instantiationService=S,this.dialogMainService=E,this.fileService=k,this.protocolMainService=R,this.themeMainService=C,this.auxiliaryWindowsMainService=M,this.cssDevelopmentService=J,this._onDidOpenWindow=this._register(new D),this.onDidOpenWindow=this._onDidOpenWindow.event,this._onDidSignalReadyWindow=this._register(new D),this.onDidSignalReadyWindow=this._onDidSignalReadyWindow.event,this._onDidDestroyWindow=this._register(new D),this.onDidDestroyWindow=this._onDidDestroyWindow.event,this._onDidChangeWindowsCount=this._register(new D),this.onDidChangeWindowsCount=this._onDidChangeWindowsCount.event,this._onDidMaximizeWindow=this._register(new D),this.onDidMaximizeWindow=this._onDidMaximizeWindow.event,this._onDidUnmaximizeWindow=this._register(new D),this.onDidUnmaximizeWindow=this._onDidUnmaximizeWindow.event,this._onDidChangeFullScreen=this._register(new D),this.onDidChangeFullScreen=this._onDidChangeFullScreen.event,this._onDidTriggerSystemContextMenu=this._register(new D),this.onDidTriggerSystemContextMenu=this._onDidTriggerSystemContextMenu.event,this.windows=new Map,this.windowsStateHandler=this._register(new sf(this,c,this.lifecycleMainService,this.logService,this.configurationService)),this.registerListeners()}registerListeners(){this._register(this.workspacesManagementMainService.onDidEnterWorkspace(e=>this._onDidSignalReadyWindow.fire(e.window))),this._register(this.onDidSignalReadyWindow(e=>{if(e.config?.extensionDevelopmentPath||e.config?.extensionTestsPath){const i=new ke;if(i.add(P.any(e.onDidClose,e.onDidDestroy)(()=>i.dispose())),e.config.extensionDevelopmentPath)for(const r of e.config.extensionDevelopmentPath)i.add(this.protocolMainService.addValidFileRoot(r));e.config.extensionTestsPath&&i.add(this.protocolMainService.addValidFileRoot(e.config.extensionTestsPath))}}))}openEmptyWindow(e,i){const r=this.environmentMainService.args,s=i?.remoteAuthority||void 0,n=!0,o=i?.forceReuseWindow,a=!o,c=i?.cursorForceNewWindow;return this.open({...e,cli:r,forceEmpty:n,forceNewWindow:a,cursorForceNewWindow:c,forceReuseWindow:o,remoteAuthority:s,forceTempProfile:i?.forceTempProfile,forceProfile:i?.forceProfile})}openExistingWindow(e,i){e.focus(),this.handleWaitMarkerFile(i,[e])}async open(e){this.logService.trace("windowsManager#open"),(e.addMode||e.removeMode)&&(e.initialStartup||!this.getLastActiveWindow())&&(e.addMode=!1,e.removeMode=!1);const i=[],r=[],s=[],n=[],o=[],a=[];let c,l=!1;const u=await this.getPathsToOpen(e);this.logService.trace("windowsManager#open pathsToOpen",u);for(const m of u)to(m)?e.addMode?i.push(m):e.removeMode?r.push(m):s.push(m):Ea(m)?n.push(m):m.fileUri?(c||(c={filesToOpenOrCreate:[],filesToDiff:[],filesToMerge:[],remoteAuthority:m.remoteAuthority}),c.filesToOpenOrCreate.push(m)):m.backupPath?a.push({backupFolder:tt(m.backupPath),remoteAuthority:m.remoteAuthority}):l=!0;e.diffMode&&c&&c.filesToOpenOrCreate.length>=2&&(c.filesToDiff=c.filesToOpenOrCreate.slice(0,2),c.filesToOpenOrCreate=[]),e.mergeMode&&c&&c.filesToOpenOrCreate.length===4&&(c.filesToMerge=c.filesToOpenOrCreate.slice(0,4),c.filesToOpenOrCreate=[],c.filesToDiff=[]),c&&e.waitMarkerFileURI&&(c.filesToWait={paths:Dt([...c.filesToDiff,c.filesToMerge[3],...c.filesToOpenOrCreate]),waitMarkerFileUri:e.waitMarkerFileURI}),e.initialStartup?(o.push(...this.workspacesManagementMainService.getUntitledWorkspaces()),n.push(...o),a.push(...this.backupMainService.getEmptyWindowBackups())):a.length=0;const{windows:d,filesOpenedInWindow:f}=await this.doOpen(e,n,s,a,l,c,i,r);if(this.logService.trace(`windowsManager#open used window count ${d.length} (workspacesToOpen: ${n.length}, foldersToOpen: ${s.length}, emptyToRestore: ${a.length}, maybeOpenEmptyWindow: ${l})`),d.length>1)if(f)f.focus();else{const m=this.windowsStateHandler.state.lastActiveWindow&&!e.forceEmpty&&!e.cli._.length&&!e.cli["file-uri"]&&!e.cli["folder-uri"]&&!(e.urisToOpen&&e.urisToOpen.length);let y=!0,S=!0;if(m){const E=this.windowsStateHandler.state.lastActiveWindow,k=!!E?.uiState?.isAgentWindow;let R=d.find(C=>E&&C.backupPath===E.backupPath&&!!C.serializeWindowState().isAgentWindow===k);R||(R=d.find(C=>E&&C.backupPath===E.backupPath)),R&&(R.focus(),y=!1,S=!1)}if(y)for(let E=d.length-1;E>=0;E--){const k=d[E];if(!(k.openedWorkspace&&o.some(R=>k.openedWorkspace&&R.workspace.id===k.openedWorkspace.id)||k.backupPath&&a.some(R=>k.backupPath&&R.backupFolder===tt(k.backupPath)))){k.focus(),S=!1;break}}S&&d[d.length-1].focus()}const p=c&&c.filesToDiff.length>0,v=c&&c.filesToMerge.length>0;if(!d.some(m=>m.isExtensionDevelopmentHost)&&!p&&!v&&!e.noRecentEntry){const m=[];for(const y of u)Ea(y)&&!y.transient?m.push({label:y.label,workspace:y.workspace,remoteAuthority:y.remoteAuthority}):to(y)?m.push({label:y.label,folderUri:y.workspace.uri,remoteAuthority:y.remoteAuthority}):y.fileUri&&m.push({label:y.label,fileUri:y.fileUri,remoteAuthority:y.remoteAuthority});this.workspacesHistoryMainService.addRecentlyOpened(m)}return this.handleWaitMarkerFile(e,d),d}handleWaitMarkerFile(e,i){const r=e.waitMarkerFileURI;e.context===0&&r&&i.length===1&&i[0]&&(async()=>{await i[0].whenClosedOrLoaded;try{await this.fileService.del(r)}catch{}})()}async doOpen(e,i,r,s,n,o,a,c){const l=[];let u;function d(E,k){l.push(E),k&&(u=E,o=void 0)}let{openFolderInNewWindow:f,openFilesInNewWindow:p}=this.shouldOpenNewWindow(e);if(!e.initialStartup&&(a.length>0||c.length>0)){const E=a.at(0)?.remoteAuthority??c.at(0)?.remoteAuthority,k=this.getLastActiveWindowForAuthority(E);k&&d(this.doAddRemoveFoldersInExistingWindow(k,a.map(R=>R.workspace.uri),c.map(R=>R.workspace.uri)))}const v=r.length+i.length+s.length;if(o&&v===0){const E=o.filesToOpenOrCreate[0]||o.filesToDiff[0]||o.filesToMerge[3],k=this.getWindows().filter(C=>o&&ki(C.remoteAuthority,o.remoteAuthority));let R;E?.fileUri&&!p&&((e.context===4||e.context===0||e.context===1||e.context===6)&&(R=await rD(k,E.fileUri,async C=>C.configPath.scheme===T.file?this.workspacesManagementMainService.resolveLocalWorkspace(C.configPath):void 0)),R||(R=this.doGetLastActiveWindow(k))),R?zt(R.openedWorkspace)?i.push({workspace:R.openedWorkspace,remoteAuthority:R.remoteAuthority}):Ri(R.openedWorkspace)?r.push({workspace:R.openedWorkspace,remoteAuthority:R.remoteAuthority,isAgentWindow:R.serializeWindowState().isAgentWindow}):d(this.doOpenFilesInExistingWindow(e,R,o),!0):d(await this.openInBrowserWindow({userEnv:e.userEnv,cli:e.cli,initialStartup:e.initialStartup,shadowWindowForWorkspaceId:e.shadowWindowForWorkspaceId,windowInWindow:e.windowInWindow,windowInWindowBodyClass:e.windowInWindowBodyClass,filesToOpen:o,forceNewWindow:!0,remoteAuthority:o.remoteAuthority,forceNewTabbedWindow:e.forceNewTabbedWindow,forceProfile:e.forceProfile,forceTempProfile:e.forceTempProfile,isAgentWindow:e.isAgentWindow}),!0)}const m=[];{const E=new Map;for(const k of i){const R=k.workspace.id,C=k.isAgentWindow?1:0;let M=E.get(R);M||(M=new Set,E.set(R,M)),M.has(C)||(M.add(C),m.push(k))}}if(m.length>0){const E=e.cursorForceNewWindow?[]:Dt(m.map(k=>{const R=!!k.isAgentWindow;return this.getWindows().find(M=>zt(M.openedWorkspace)&&M.openedWorkspace.id===k.workspace.id&&!!M.serializeWindowState().isAgentWindow===R)}));if(E.length>0){const k=E[0],R=ki(o?.remoteAuthority,k.remoteAuthority)?o:void 0;d(this.doOpenFilesInExistingWindow(e,k,R),!!R),f=!0}for(const k of m){if(!e.cursorForceNewWindow&&E.some(M=>M.openedWorkspace&&M.openedWorkspace.id===k.workspace.id&&!!M.serializeWindowState().isAgentWindow==!!k.isAgentWindow))continue;const R=k.remoteAuthority,C=ki(o?.remoteAuthority,R)?o:void 0;d(await this.doOpenFolderOrWorkspace(e,k,f,C),!!C),f=!0}}const y=[];{const E=new Map;for(const k of r){const R=rt.getComparisonKey(k.workspace.uri),C=k.isAgentWindow?1:0;let M=E.get(R);M||(M=new Set,E.set(R,M)),M.has(C)||(M.add(C),y.push(k))}}if(y.length>0){const E=e.cursorForceNewWindow?[]:Dt(y.map(k=>{const R=!!k.isAgentWindow;return this.getWindows().find(M=>Ri(M.openedWorkspace)&&rt.isEqual(M.openedWorkspace.uri,k.workspace.uri)&&!!M.serializeWindowState().isAgentWindow===R)}));if(E.length>0){const k=E[0],R=ki(o?.remoteAuthority,k.remoteAuthority)?o:void 0;d(this.doOpenFilesInExistingWindow(e,k,R),!!R),f=!0}for(const k of y){if(!e.cursorForceNewWindow&&E.some(M=>Ri(M.openedWorkspace)&&rt.isEqual(M.openedWorkspace.uri,k.workspace.uri)&&!!M.serializeWindowState().isAgentWindow==!!k.isAgentWindow))continue;const R=k.remoteAuthority,C=ki(o?.remoteAuthority,R)?o:void 0;d(await this.doOpenFolderOrWorkspace(e,k,f,C),!!C),f=!0}}const S=ds(s,E=>E.backupFolder);if(S.length>0)for(const E of S){const k=E.remoteAuthority,R=ki(o?.remoteAuthority,k)?o:void 0;d(await this.doOpenEmpty(e,!0,k,R,E),!!R),f=!0}if(o||n&&(e.forceEmpty||l.length===0)){const E=o?o.remoteAuthority:e.remoteAuthority;d(await this.doOpenEmpty(e,f,E,o),!!o)}return{windows:ds(l),filesOpenedInWindow:u}}doOpenFilesInExistingWindow(e,i,r){this.logService.trace("windowsManager#doOpenFilesInExistingWindow",{filesToOpen:r}),this.focusMainOrChildWindow(i);const s={filesToOpenOrCreate:r?.filesToOpenOrCreate,filesToDiff:r?.filesToDiff,filesToMerge:r?.filesToMerge,filesToWait:r?.filesToWait,termProgram:e?.userEnv?.TERM_PROGRAM};return i.sendWhenReady("vscode:openFiles",Te.None,s),i}focusMainOrChildWindow(e){let i=e;const r=nf.getFocusedWindow();if(r&&r.id!==e.id){const s=this.auxiliaryWindowsMainService.getWindowByWebContents(r.webContents);s&&s.parentId===e.id&&(i=s)}i.focus()}doAddRemoveFoldersInExistingWindow(e,i,r){this.logService.trace("windowsManager#doAddRemoveFoldersToExistingWindow",{foldersToAdd:i,foldersToRemove:r}),e.focus();const s={foldersToAdd:i,foldersToRemove:r};return e.sendWhenReady("vscode:addRemoveFolders",Te.None,s),e}doOpenEmpty(e,i,r,s,n){this.logService.trace("windowsManager#doOpenEmpty",{restore:!!n,remoteAuthority:r,filesToOpen:s,forceNewWindow:i});let o;return!i&&typeof e.contextWindowId=="number"&&(o=this.getWindowById(e.contextWindowId)),this.openInBrowserWindow({userEnv:e.userEnv,cli:e.cli,initialStartup:e.initialStartup,remoteAuthority:r,forceNewWindow:i,forceNewTabbedWindow:e.forceNewTabbedWindow,shadowWindowForWorkspaceId:e.shadowWindowForWorkspaceId,windowInWindow:e.windowInWindow,windowInWindowBodyClass:e.windowInWindowBodyClass,filesToOpen:s,windowToUse:o,emptyWindowBackupInfo:n,forceProfile:e.forceProfile,forceTempProfile:e.forceTempProfile,isAgentWindow:e.isAgentWindow})}doOpenFolderOrWorkspace(e,i,r,s,n){return this.logService.trace("windowsManager#doOpenFolderOrWorkspace",{folderOrWorkspace:i,filesToOpen:s}),!r&&!n&&typeof e.contextWindowId=="number"&&(n=this.getWindowById(e.contextWindowId)),this.openInBrowserWindow({workspace:i.workspace,userEnv:e.userEnv,cli:e.cli,initialStartup:e.initialStartup,remoteAuthority:i.remoteAuthority,forceNewWindow:r,forceNewTabbedWindow:e.forceNewTabbedWindow,filesToOpen:s,windowToUse:n,shadowWindowForWorkspaceId:e.shadowWindowForWorkspaceId,windowInWindow:e.windowInWindow,windowInWindowBodyClass:e.windowInWindowBodyClass,forceProfile:e.forceProfile,forceTempProfile:e.forceTempProfile,isAgentWindow:e.isAgentWindow!==void 0?e.isAgentWindow:i.isAgentWindow})}async getPathsToOpen(e){let i,r=!1,s=!1;if(e.urisToOpen&&e.urisToOpen.length>0?(i=await this.doExtractPathsFromAPI(e),r=!0):e.forceEmpty?i=[of]:e.cli._.length||e.cli["folder-uri"]||e.cli["file-uri"]?(i=await this.doExtractPathsFromCLI(e.cli),i.length===0&&i.push(of),r=!0):(i=await this.doGetPathsFromLastSession(),i.length===0&&i.push(of),s=!0),!e.addMode&&!e.removeMode&&r){const n=i.filter(o=>to(o));if(n.length>1){const o=n[0].remoteAuthority;if(n.every(a=>ki(a.remoteAuthority,o))){let a;const c=await this.doGetWorkspaceMatchingFoldersFromLastSession(o,n);c?a=c:a=await this.workspacesManagementMainService.createUntitledWorkspace(n.map(l=>({uri:l.workspace.uri}))),i.push({workspace:a,remoteAuthority:o}),i=i.filter(l=>!to(l))}}}if(r&&(i=this.expandAgentVariantsFromLastSession(i)),e.initialStartup&&!s&&this.configurationService.getValue("window")?.restoreWindows==="preserve"){const n=await this.doGetPathsFromLastSession();i.unshift(...n.filter(o=>Ea(o)||to(o)||o.backupPath))}return i}expandAgentVariantsFromLastSession(e){const i=this.windowsStateHandler.state;function r(n,o){return!!n&&!!o&&rt.isEqual(n,o)}const s=[];for(const n of e)if(to(n)){if(typeof n.isAgentWindow=="boolean"){s.push(n);continue}const o=i.openedWindows.filter(u=>r(u.folderUri,n.workspace.uri)),a=new Set;for(const u of o)a.add(u.uiState?.isAgentWindow===!0?1:0);const c=i.lastActiveWindow&&r(i.lastActiveWindow.folderUri,n.workspace.uri)?i.lastActiveWindow:void 0,l=c?!!c.uiState?.isAgentWindow:void 0;if(a.size>=2){const u={...n,isAgentWindow:!1},d={...n,isAgentWindow:!0};l===!0?s.push(u,d):l===!1?s.push(d,u):s.push(u,d)}else a.size===1?s.push({...n,isAgentWindow:a.has(1)}):l!==void 0?s.push({...n,isAgentWindow:l}):s.push(n)}else if(Ea(n)){if(typeof n.isAgentWindow=="boolean"){s.push(n);continue}const o=i.openedWindows.filter(u=>u.workspace&&u.workspace.id===n.workspace.id),a=new Set;for(const u of o)a.add(u.uiState?.isAgentWindow===!0?1:0);const c=i.lastActiveWindow&&i.lastActiveWindow.workspace&&i.lastActiveWindow.workspace.id===n.workspace.id?i.lastActiveWindow:void 0,l=c?!!c.uiState?.isAgentWindow:void 0;if(a.size>=2){const u={...n,isAgentWindow:!1},d={...n,isAgentWindow:!0};l===!0?s.push(u,d):l===!1?s.push(d,u):s.push(u,d)}else a.size===1?s.push({...n,isAgentWindow:a.has(1)}):l!==void 0?s.push({...n,isAgentWindow:l}):s.push(n)}else s.push(n);return s}async doExtractPathsFromAPI(e){const i={gotoLineMode:e.gotoLineMode,remoteAuthority:e.remoteAuthority},r=await Promise.all(Dt(e.urisToOpen||[]).map(async s=>{const n=await this.resolveOpenable(s,i);if(n)return n.label=s.label,n;const o=this.resourceFromOpenable(s);this.dialogMainService.showMessageBox({type:"info",buttons:[w(2641,null)],message:o.scheme===T.file?w(2642,null):w(2643,null),detail:o.scheme===T.file?w(2644,null,Lo(o,{os:Gi,tildify:this.environmentMainService})):w(2645,null,o.toString(!0))},nf.getFocusedWindow()??void 0)}));return Dt(r)}async doExtractPathsFromCLI(e){const i=[],r={ignoreFileNotFound:!0,gotoLineMode:e.goto,remoteAuthority:e.remote||void 0,forceOpenWorkspaceAsFile:e.diff&&e._.length===2||e.merge&&e._.length===4},s=e["folder-uri"];if(s){const a=await Promise.all(s.map(c=>{const l=this.cliArgToUri(c);if(l)return this.resolveOpenable({folderUri:l},r)}));i.push(...Dt(a))}const n=e["file-uri"];if(n){const a=await Promise.all(n.map(c=>{const l=this.cliArgToUri(c);if(l)return this.resolveOpenable(Un(c)?{workspaceUri:l}:{fileUri:l},r)}));i.push(...Dt(a))}const o=await Promise.all(e._.map(a=>r.remoteAuthority?this.doResolveRemotePath(a,r):this.doResolveFilePath(a,r)));return i.push(...Dt(o)),i}cliArgToUri(e){try{const i=x.parse(e);if(!i.scheme){this.logService.error(`Invalid URI input string, scheme missing: ${e}`);return}return i.path?i:i.with({path:"/"})}catch(i){this.logService.error(`Invalid URI input string: ${e}, ${i.message}`)}}async doGetPathsFromLastSession(){const e=this.getRestoreWindowsSetting();switch(e){case"none":return[];case"one":case"all":case"preserve":case"folders":{const i=[];e!=="one"&&i.push(...this.windowsStateHandler.state.openedWindows),this.windowsStateHandler.state.lastActiveWindow&&i.push(this.windowsStateHandler.state.lastActiveWindow);const r=await Promise.all(i.map(async s=>{if(s.workspace){const n=await this.resolveOpenable({workspaceUri:s.workspace.configPath},{remoteAuthority:s.remoteAuthority,rejectTransientWorkspaces:!0});if(Ea(n))return n}else if(s.folderUri){const n=await this.resolveOpenable({folderUri:s.folderUri},{remoteAuthority:s.remoteAuthority});if(to(n))return{...n,isAgentWindow:s.uiState.isAgentWindow}}else if(e!=="folders"&&s.backupPath)return{backupPath:s.backupPath,remoteAuthority:s.remoteAuthority}}));return Dt(r)}}}getRestoreWindowsSetting(){let e;return this.lifecycleMainService.wasRestarted?e="all":(e=this.configurationService.getValue("window")?.restoreWindows||"all",["preserve","all","folders","one","none"].includes(e)||(e="all")),e}async doGetWorkspaceMatchingFoldersFromLastSession(e,i){const r=(await this.doGetPathsFromLastSession()).filter(n=>Ea(n)),s=i.map(n=>n.workspace.uri);for(const{workspace:n}of r){const o=await this.workspacesManagementMainService.resolveLocalWorkspace(n.configPath);if(!o||o.remoteAuthority!==e||o.transient||o.folders.length!==i.length)continue;const a=new fg(s,c=>rt.getComparisonKey(c));if(o.folders.every(c=>a.has(c.uri)))return o}}async resolveOpenable(e,i=Object.create(null)){const r=this.resourceFromOpenable(e);return r.scheme===T.file?(s4(e)&&(i={...i,forceOpenWorkspaceAsFile:!0}),this.doResolveFilePath(r.fsPath,i)):this.doResolveRemoteOpenable(e,i)}doResolveRemoteOpenable(e,i){let r=this.resourceFromOpenable(e);const s=sa(r)||i.remoteAuthority;if(r=i_(zg(r)),s4(e)){if(i.gotoLineMode){const{path:n,line:o,column:a}=Qu(r.path);return{fileUri:r.with({path:n}),options:{selection:o?{startLineNumber:o,startColumn:a||1}:void 0},remoteAuthority:s}}return{fileUri:r,remoteAuthority:s}}else if(Om(e))return{workspace:Bn(r),remoteAuthority:s};return{workspace:a1(r),remoteAuthority:s}}resourceFromOpenable(e){return Om(e)?e.workspaceUri:r4(e)?e.folderUri:e.fileUri}async doResolveFilePath(e,i,r){let s,n;i.gotoLineMode&&({path:e,line:s,column:n}=Qu(e)),e=qS(bi(e),fs());try{const o=await VM.promises.stat(e);if(o.isFile()){if(!i.forceOpenWorkspaceAsFile){const a=await this.workspacesManagementMainService.resolveLocalWorkspace(x.file(e));if(a)return a.transient&&i.rejectTransientWorkspaces?void 0:{workspace:{id:a.id,configPath:a.configPath},type:Ft.File,exists:!0,remoteAuthority:a.remoteAuthority,transient:a.transient}}return{fileUri:x.file(e),type:Ft.File,exists:!0,options:{selection:s?{startLineNumber:s,startColumn:n||1}:void 0}}}else{if(o.isDirectory())return{workspace:a1(x.file(e),o),type:Ft.Directory,exists:!0};if(!B&&e==="/dev/null")return{fileUri:x.file(e),type:Ft.File,exists:!0}}}catch(o){if(o.code==="ERR_UNC_HOST_NOT_ALLOWED"&&!r)return this.onUNCHostNotAllowed(e,i);const a=x.file(e);if(this.workspacesHistoryMainService.removeRecentlyOpened([a]),i.ignoreFileNotFound&&o.code==="ENOENT")return{fileUri:a,type:Ft.File,exists:!1};this.logService.error(`Invalid path provided: ${e}, ${o.message}`)}}async onUNCHostNotAllowed(e,i){const r=x.file(e),{response:s,checkboxChecked:n}=await this.dialogMainService.showMessageBox({type:"warning",buttons:[w(2646,null),w(2647,null),w(2648,null)],message:w(2649,null,r.authority),detail:w(2650,null,Lo(r,{os:Gi,tildify:this.environmentMainService})),checkboxLabel:w(2651,null,r.authority),cancelId:1});if(s===0){if(Ya(r.authority),n){const o={channel:"vscode:configureAllowedUNCHost",args:r.authority};this.sendToFocused(o.channel,o.args),this.sendToOpeningWindow(o.channel,o.args)}return this.doResolveFilePath(e,i,!0)}if(s===2)return zM.openExternal("https://aka.ms/vscode-windows-unc"),this.onUNCHostNotAllowed(e,i)}doResolveRemotePath(e,i){const r=e.charCodeAt(0),s=i.remoteAuthority;let n,o;i.gotoLineMode&&({path:e,line:n,column:o}=Qu(e)),r!==47&&(jg(r)&&e.charCodeAt(e.charCodeAt(1))===58&&(e=Mo(e)),e=`/${e}`);const a=x.from({scheme:T.vscodeRemote,authority:s,path:e});if(e.charCodeAt(e.length-1)!==47){if(Un(e))return i.forceOpenWorkspaceAsFile?{fileUri:a,options:{selection:n?{startLineNumber:n,startColumn:o||1}:void 0},remoteAuthority:i.remoteAuthority}:{workspace:Bn(a),remoteAuthority:s};if(i.gotoLineMode||le.basename(e).indexOf(".")!==-1)return{fileUri:a,options:{selection:n?{startLineNumber:n,startColumn:o||1}:void 0},remoteAuthority:s}}return{workspace:a1(a),remoteAuthority:s}}shouldOpenNewWindow(e){const i=this.configurationService.getValue("window"),r=i?.openFoldersInNewWindow||"default",s=i?.openFilesInNewWindow||"off";let n=(e.preferNewWindow||e.forceNewWindow||e.cursorForceNewWindow)&&!e.forceReuseWindow;!e.forceNewWindow&&!e.cursorForceNewWindow&&!e.forceReuseWindow&&(r==="on"||r==="off")&&(n=r==="on");let o=!1;return e.forceNewWindow||e.cursorForceNewWindow||e.forceReuseWindow?o=(!!e.forceNewWindow||!!e.cursorForceNewWindow)&&!e.forceReuseWindow:(O?e.context===1&&(o=!0):e.context!==3&&e.context!==2&&!(e.userEnv&&e.userEnv.TERM_PROGRAM==="vscode")&&(o=!0),!e.cli.extensionDevelopmentPath&&(s==="on"||s==="off")&&(o=s==="on")),{openFolderInNewWindow:!!n,openFilesInNewWindow:o}}async openExtensionDevelopmentHostWindow(e,i){const r=sD(this.getWindows(),e);if(r)return this.lifecycleMainService.reload(r,i.cli),r.focus(),[r];let s=i.cli["folder-uri"]||[],n=i.cli["file-uri"]||[],o=i.cli._;if(!o.length&&!s.length&&!n.length&&!i.cli.extensionTestsPath){const l=this.windowsStateHandler.state.lastPluginDevelopmentHostWindow,u=l?.workspace??l?.folderUri;u&&(x.isUri(u)?u.scheme===T.file?o=[u.fsPath]:s=[u.toString()]:u.configPath.scheme===T.file?o=[ji(u.configPath)]:n=[u.configPath.toString()])}let a=i.remoteAuthority;for(const l of e)if(l.match(/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/)){const u=x.parse(l),d=sa(u);d&&(a?ki(d,a)||this.logService.error("more than one extension development path authority"):a=d)}o=o.filter(l=>{const u=x.file(l);return rh(this.getWindows(),u)?!1:ki(sa(u),a)}),s=s.filter(l=>{const u=this.cliArgToUri(l);return u&&rh(this.getWindows(),u)?!1:u?ki(sa(u),a):!1}),n=n.filter(l=>{const u=this.cliArgToUri(l);return u&&rh(this.getWindows(),u)?!1:u?ki(sa(u),a):!1}),i.cli._=o,i.cli["folder-uri"]=s,i.cli["file-uri"]=n;const c={context:i.context,cli:i.cli,forceNewWindow:!0,forceEmpty:!o.length&&!s.length&&!n.length,userEnv:i.userEnv,noRecentEntry:!0,waitMarkerFileURI:i.waitMarkerFileURI,remoteAuthority:a,forceProfile:i.forceProfile,forceTempProfile:i.forceTempProfile,isAgentWindow:i.isAgentWindow};return this.open(c)}async openInBrowserWindow(e){const i=this.configurationService.getValue("window"),r=this.getLastActiveWindow(),n=(i?.newWindowProfile?this.userDataProfilesMainService.profiles.find(c=>c.name===i.newWindowProfile):void 0)??r?.profile??this.userDataProfilesMainService.defaultProfile;let o;!e.forceNewWindow&&!e.cursorForceNewWindow&&!e.forceNewTabbedWindow&&(o=e.windowToUse||r,o&&o.focus());const a={...this.environmentMainService.args,...e.cli,machineId:this.machineId,macMachineId:this.macMachineId,sqmId:this.sqmId,devDeviceId:this.devDeviceId,windowId:-1,shadowWindowForWorkspaceId:e.shadowWindowForWorkspaceId??this.environmentMainService.args["shadow-window-for-workspace-id"]??e.cli?.["shadow-window-for-workspace-id"],windowInWindow:e.windowInWindow,windowInWindowBodyClass:e.windowInWindowBodyClass,windowInWindowParentDimensions:(()=>{if(e.windowInWindow!==void 0){const c=this.getWindowById(e.windowInWindow);if(c){const l=c.win?.getBounds();if(l)return{width:l.width,height:l.height}}}})(),mainPid:process.pid,appRoot:this.environmentMainService.appRoot,execPath:process.execPath,codeCachePath:this.environmentMainService.codeCachePath,backupPath:e.emptyWindowBackupInfo?U(this.environmentMainService.backupHome,e.emptyWindowBackupInfo.backupFolder):void 0,profiles:{home:this.userDataProfilesMainService.profilesHome,all:this.userDataProfilesMainService.profiles,profile:n},homeDir:this.environmentMainService.userHome.with({scheme:T.file}).fsPath,tmpDir:this.environmentMainService.tmpDir.with({scheme:T.file}).fsPath,userDataDir:this.environmentMainService.userDataPath,remoteAuthority:e.remoteAuthority,workspace:e.workspace,userEnv:{...this.initialUserEnv,...e.userEnv},nls:{messages:Iu(),language:Za()},filesToOpenOrCreate:e.filesToOpen?.filesToOpenOrCreate,filesToDiff:e.filesToOpen?.filesToDiff,filesToMerge:e.filesToOpen?.filesToMerge,filesToWait:e.filesToOpen?.filesToWait,logLevel:this.loggerService.getLogLevel(),loggers:this.loggerService.getGlobalLoggers(),logsPath:this.environmentMainService.logsHome.with({scheme:T.file}).fsPath,product:Qr,isInitialStartup:e.initialStartup,perfMarks:eg(),os:{release:KM(),hostname:GM(),arch:YM()},autoDetectHighContrast:i?.autoDetectHighContrast??!0,autoDetectColorScheme:i?.autoDetectColorScheme??!1,accessibilitySupport:qM.accessibilitySupportEnabled,colorScheme:this.themeMainService.getColorScheme(),policiesData:this.policyService.serialize(),continueOn:this.environmentMainService.continueOn,cssModules:this.cssDevelopmentService.isEnabled?await this.cssDevelopmentService.getCssModules():void 0,isAgentWindow:e.isAgentWindow};if(o){const c=o.config;!a.extensionDevelopmentPath&&c?.extensionDevelopmentPath&&(a.extensionDevelopmentPath=c.extensionDevelopmentPath,a.extensionDevelopmentKind=c.extensionDevelopmentKind,a["enable-proposed-api"]=c["enable-proposed-api"],a.verbose=c.verbose,a["inspect-extensions"]=c["inspect-extensions"],a["inspect-brk-extensions"]=c["inspect-brk-extensions"],a.debugId=c.debugId,a.extensionEnvironment=c.extensionEnvironment,a["extensions-dir"]=c["extensions-dir"],a["disable-extensions"]=c["disable-extensions"],a["disable-extension"]=c["disable-extension"]),a.loggers=a.loggers,o.setIsAgentWindow(!!a.isAgentWindow)}else{const c=this.windowsStateHandler.getNewWindowState(a);typeof a.isAgentWindow>"u"&&(a.isAgentWindow=e.isAgentWindow??c.isAgentWindow),Ve("code/willCreateCodeWindow");const l=o=this.instantiationService.createInstance(Tl,{state:c,extensionDevelopmentPath:a.extensionDevelopmentPath,isExtensionTestHost:!!a.extensionTestsPath,shadowWindowForWorkspaceId:a.shadowWindowForWorkspaceId,windowInWindow:e.windowInWindow,isAgentWindow:e.isAgentWindow});if(Ve("code/didCreateCodeWindow"),l.setIsAgentWindow(!!a.isAgentWindow),e.forceNewTabbedWindow&&this.getLastActiveWindow()?.addTabbedWindow(l),e.windowInWindow!==void 0){const f=this.getWindowById(e.windowInWindow);f&&l.attachToParent(f)}this.windows.set(l.id,l),this._onDidOpenWindow.fire(l),this._onDidChangeWindowsCount.fire({oldCount:this.getWindowCount()-1,newCount:this.getWindowCount()});const u=new ke;u.add(l.onDidSignalReady(()=>this._onDidSignalReadyWindow.fire(l))),u.add(P.once(l.onDidClose)(()=>this.onWindowClosed(l,u))),u.add(P.once(l.onDidDestroy)(()=>this.onWindowDestroyed(l))),u.add(l.onDidMaximize(()=>this._onDidMaximizeWindow.fire(l))),u.add(l.onDidUnmaximize(()=>this._onDidUnmaximizeWindow.fire(l))),u.add(l.onDidEnterFullScreen(()=>this._onDidChangeFullScreen.fire({window:l,fullscreen:!0}))),u.add(l.onDidLeaveFullScreen(()=>this._onDidChangeFullScreen.fire({window:l,fullscreen:!1}))),u.add(l.onDidTriggerSystemContextMenu(({x:f,y:p})=>this._onDidTriggerSystemContextMenu.fire({window:l,x:f,y:p})));const d=Fu(l.webContents);d.removeAllListeners("devtools-reload-page"),u.add(P.fromNodeEventEmitter(d,"devtools-reload-page")(()=>this.lifecycleMainService.reload(l))),this.lifecycleMainService.registerWindow(l)}return a.windowId=o.id,o.isReady?this.lifecycleMainService.unload(o,4).then(async c=>{c||await this.doOpenInBrowserWindow(o,a,e,n)}):await this.doOpenInBrowserWindow(o,a,e,n),o}async doOpenInBrowserWindow(e,i,r,s){i.extensionDevelopmentPath||(zt(i.workspace)?i.backupPath=this.backupMainService.registerWorkspaceBackup({workspace:i.workspace,remoteAuthority:i.remoteAuthority}):Ri(i.workspace)?i.backupPath=this.backupMainService.registerFolderBackup({folderUri:i.workspace.uri,remoteAuthority:i.remoteAuthority}):i.backupPath=this.backupMainService.registerEmptyWindowBackup({backupFolder:r.emptyWindowBackupInfo?.backupFolder??c1().id,remoteAuthority:i.remoteAuthority}));const n=i.workspace??Ld(i.backupPath,!1),o=this.resolveProfileForBrowserWindow(r,n,s),a=o instanceof Promise?await o:o;i.profiles.profile=a,i.isAgentWindow=r.isAgentWindow,i.extensionDevelopmentPath||await this.userDataProfilesMainService.setProfileForWorkspace(n,a),e.load(i)}resolveProfileForBrowserWindow(e,i,r){return e.forceProfile?this.userDataProfilesMainService.profiles.find(s=>s.name===e.forceProfile)??this.userDataProfilesMainService.createNamedProfile(e.forceProfile):e.forceTempProfile?this.userDataProfilesMainService.createTransientProfile():this.userDataProfilesMainService.getProfileForWorkspace(i)??r}onWindowClosed(e,i){this.windows.delete(e.id),this._onDidChangeWindowsCount.fire({oldCount:this.getWindowCount()+1,newCount:this.getWindowCount()}),i.dispose()}onWindowDestroyed(e){this.windows.delete(e.id),this._onDidDestroyWindow.fire(e)}getFocusedWindow(){const e=nf.getFocusedWindow();if(e)return this.getWindowById(e.id)}getLastActiveWindow(){return this.doGetLastActiveWindow(this.getWindows().filter(e=>!e.config?.shadowWindowForWorkspaceId))}getLastActiveWindowForAuthority(e){return this.doGetLastActiveWindow(this.getWindows().filter(i=>ki(i.remoteAuthority,e)))}doGetLastActiveWindow(e){return v4(e)}sendToFocused(e,...i){(this.getFocusedWindow()||this.getLastActiveWindow())?.sendWhenReady(e,Te.None,...i)}sendToOpeningWindow(e,...i){this._register(P.once(this.onDidSignalReadyWindow)(r=>{r.sendWhenReady(e,Te.None,...i)}))}sendToAll(e,i,r){for(const s of this.getWindows())r&&r.indexOf(s.id)>=0||s.sendWhenReady(e,Te.None,i)}getWindows(){return Array.from(this.windows.values())}getWindowCount(){return this.windows.size}getWindowById(e){return this.windows.get(e)}getWindowByWebContents(e){const i=nf.fromWebContents(e);if(!i)return;const r=this.getWindowById(i.id);return r?.matches(e)?r:void 0}},af=__decorate([__param(5,V),__param(6,ya),__param(7,Ii),__param(8,Xn),__param(9,st),__param(10,Gr),__param(11,ze),__param(12,ea),__param(13,Qe),__param(14,Cl),__param(15,rn),__param(16,Or),__param(17,Is),__param(18,mt),__param(19,va),__param(20,Jo),__param(21,la),__param(22,Gn)],af)}}),o6,QM=g({"out-build/vs/platform/windows/node/windowTracker.js"(){"use strict";ae(),q(),L(),o6=class extends N{constructor({onDidOpenMainWindow:t,onDidFocusMainWindow:e,getActiveWindowId:i}){super(),this.disposables=this._register(new ke),P.latch(P.any(t,e))(this.setActiveWindow,this,this.disposables),this.firstActiveWindowIdPromise=To(()=>i()),(async()=>{try{const s=await this.firstActiveWindowIdPromise;this.activeWindowId=typeof this.activeWindowId=="number"?this.activeWindowId:s}catch{}finally{this.firstActiveWindowIdPromise=void 0}})()}setActiveWindow(t){this.firstActiveWindowIdPromise&&(this.firstActiveWindowIdPromise.cancel(),this.firstActiveWindowIdPromise=void 0),this.activeWindowId=t}async getActiveClientId(){return`window:${this.firstActiveWindowIdPromise?await this.firstActiveWindowIdPromise:this.activeWindowId}`}}}}),cf,XM=g({"out-build/vs/platform/workspaces/electron-main/workspacesMainService.js"(){"use strict";tl(),ut(),$h(),qn(),cf=class{constructor(e,i,r,s){this.workspacesManagementMainService=e,this.windowsMainService=i,this.workspacesHistoryMainService=r,this.backupMainService=s,this.onDidChangeRecentlyOpened=this.workspacesHistoryMainService.onDidChangeRecentlyOpened}async enterWorkspace(e,i){const r=this.windowsMainService.getWindowById(e);if(r)return this.workspacesManagementMainService.enterWorkspace(r,this.windowsMainService.getWindows(),i)}createUntitledWorkspace(e,i,r){return this.workspacesManagementMainService.createUntitledWorkspace(i,r)}deleteUntitledWorkspace(e,i){return this.workspacesManagementMainService.deleteUntitledWorkspace(i)}getWorkspaceIdentifier(e,i){return this.workspacesManagementMainService.getWorkspaceIdentifier(i)}getRecentlyOpened(e){return this.workspacesHistoryMainService.getRecentlyOpened()}addRecentlyOpened(e,i){return this.workspacesHistoryMainService.addRecentlyOpened(i)}removeRecentlyOpened(e,i){return this.workspacesHistoryMainService.removeRecentlyOpened(i)}clearRecentlyOpened(e){return this.workspacesHistoryMainService.clearRecentlyOpened()}async getDirtyWorkspaces(){return this.backupMainService.getDirtyWorkspaces()}},cf=__decorate([__param(0,rn),__param(1,ot),__param(2,Cl),__param(3,ea)],cf)}}),a6,ZM=g({"out-build/vs/platform/policy/common/policyIpc.js"(){"use strict";q(),L(),Xr(),a6=class{constructor(t){this.service=t,this.disposables=new ke}listen(t,e){switch(e){case"onDidChange":return P.map(this.service.onDidChange,i=>i.reduce((r,s)=>({...r,[s]:this.service.getPolicyValue(s)??null}),{}),this.disposables)}throw new Error(`Event not found: ${e}`)}call(t,e,i){switch(e){case"updatePolicyDefinitions":return this.service.updatePolicyDefinitions(i)}throw new Error(`Call not found: ${e}`)}dispose(){this.disposables.dispose()}}}});function eT(t){return t.map(e=>{const[i,r]=e.split("@");return{proposalName:i,version:r?parseInt(r):void 0}})}function tT(t){return t.map(e=>e.split("@")[0])}var c6,l6,kv,u6,d6,ka,h6,iT,Pv=g({"out-build/vs/platform/extensions/common/extensions.js"(){"use strict";jt(),G(),nl(),c6="extensions.user.cache",l6="extensions.builtin.cache",kv="undefined_publisher",(function(t){t[t.System=0]="System",t[t.User=1]="User"})(u6||(u6={})),(function(t){t.WIN32_X64="win32-x64",t.WIN32_ARM64="win32-arm64",t.LINUX_X64="linux-x64",t.LINUX_ARM64="linux-arm64",t.LINUX_ARMHF="linux-armhf",t.ALPINE_X64="alpine-x64",t.ALPINE_ARM64="alpine-arm64",t.DARWIN_X64="darwin-x64",t.DARWIN_ARM64="darwin-arm64",t.WEB="web",t.UNIVERSAL="universal",t.UNKNOWN="unknown",t.UNDEFINED="undefined"})(d6||(d6={})),ka=class{constructor(t){this.value=t,this._lower=t.toLowerCase()}static equals(t,e){if(typeof t>"u"||t===null)return typeof e>"u"||e===null;if(typeof e>"u"||e===null)return!1;if(typeof t=="string"||typeof e=="string"){const i=typeof t=="string"?t:t.value,r=typeof e=="string"?e:e.value;return js(i,r)}return t._lower===e._lower}static toKey(t){return typeof t=="string"?t.toLowerCase():t._lower}},h6=class{constructor(){this._map=new Map}clear(){this._map.clear()}delete(t){this._map.delete(ka.toKey(t))}get(t){return this._map.get(ka.toKey(t))}has(t){return this._map.has(ka.toKey(t))}set(t,e){this._map.set(ka.toKey(t),e)}values(){return this._map.values()}forEach(t){this._map.forEach(t)}[Symbol.iterator](){return this._map[Symbol.iterator]()}},iT=j("IBuiltinExtensionsScannerService")}});function Wl(t,e){return t.uuid&&e.uuid?t.uuid===e.uuid:t.id===e.id?!0:Ig(t.id,e.id)===0}function rT(t,e){return`${t}.${e}`}function sT(t){return t.toLowerCase()}function nT(t,e){return sT(rT(t??kv,e))}async function oT(t,e){if(!Pe)return!1;let i;try{i=(await t.readFile(x.file("/etc/os-release"))).value.toString()}catch{try{i=(await t.readFile(x.file("/usr/lib/os-release"))).value.toString()}catch(s){e.debug("Error while getting the os-release file.",$i(s))}}return!!i&&(i.match(/^ID=([^\u001b\r\n]*)/m)||[])[1]==="alpine"}async function aT(t,e){const i=await oT(t,e),r=k3(i?"alpine":Po,Xy);return e.debug("ComputeTargetPlatform:",r),r}var cT,f6=g({"out-build/vs/platform/extensionManagement/common/extensionManagementUtil.js"(){"use strict";jt(),Bd(),Pv(),z(),re(),Re(),Wr(),Zn(),xe(),cT=new ka("pprice.better-merge")}});function p6(t){return Lt(t)&&P3(t.identifier)&&(lT(t.location)||At(t.location)&&t.location)&&(hs(t.relativeLocation)||At(t.relativeLocation))&&t.version&&At(t.version)}function lT(t){return t?At(t.path)&&At(t.scheme):!1}var g6,Ll,Pa,lf,uf=g({"out-build/vs/platform/extensionManagement/common/extensionsProfileScannerService.js"(){"use strict";ae(),it(),L(),q(),ai(),re(),Bd(),f6(),Ze(),G(),K(),zr(),Vr(),xe(),Re(),(function(t){t.ERROR_PROFILE_NOT_FOUND="ERROR_PROFILE_NOT_FOUND",t.ERROR_INVALID_CONTENT="ERROR_INVALID_CONTENT"})(g6||(g6={})),Ll=class extends Error{constructor(t,e){super(t),this.code=e}},Pa=j("IExtensionsProfileScannerService"),lf=class extends N{constructor(e,i,r,s,n){super(),this.extensionsLocation=e,this.fileService=i,this.userDataProfilesService=r,this.uriIdentityService=s,this.logService=n,this._onAddExtensions=this._register(new D),this.onAddExtensions=this._onAddExtensions.event,this._onDidAddExtensions=this._register(new D),this.onDidAddExtensions=this._onDidAddExtensions.event,this._onRemoveExtensions=this._register(new D),this.onRemoveExtensions=this._onRemoveExtensions.event,this._onDidRemoveExtensions=this._register(new D),this.onDidRemoveExtensions=this._onDidRemoveExtensions.event,this.resourcesAccessQueueMap=new Bt}scanProfileExtensions(e,i){return this.withProfileExtensions(e,void 0,i)}async addExtensionsToProfile(e,i,r){const s=[],n=[];try{return await this.withProfileExtensions(i,o=>{const a=[];if(r)a.push(...o);else for(const c of o)e.some(([l])=>Wl(l.identifier,c.identifier)&&(l.manifest.version!==c.version||l.location.toString()!==c.location.toString()))?s.push(c):a.push(c);for(const[c,l]of e){const u=a.findIndex(f=>Wl(f.identifier,c.identifier)&&f.version===c.manifest.version&&f.location.toString()===c.location.toString()),d={identifier:c.identifier,version:c.manifest.version,location:c.location,metadata:l};u===-1?(n.push(d),a.push(d)):a.splice(u,1,d)}return n.length&&this._onAddExtensions.fire({extensions:n,profileLocation:i}),s.length&&this._onRemoveExtensions.fire({extensions:s,profileLocation:i}),a}),n.length&&this._onDidAddExtensions.fire({extensions:n,profileLocation:i}),s.length&&this._onDidRemoveExtensions.fire({extensions:s,profileLocation:i}),n}catch(o){throw n.length&&this._onDidAddExtensions.fire({extensions:n,error:o,profileLocation:i}),s.length&&this._onDidRemoveExtensions.fire({extensions:s,error:o,profileLocation:i}),o}}async updateMetadata(e,i){const r=[];return await this.withProfileExtensions(i,s=>{const n=[];for(const o of s){const a=e.find(([c])=>Wl(c.identifier,o.identifier)&&c.manifest.version===o.version);a&&(o.metadata={...o.metadata,...a[1]},r.push(o)),n.push(o)}return n}),r}async removeExtensionsFromProfile(e,i){const r=[];try{await this.withProfileExtensions(i,s=>{const n=[];for(const o of s)e.some(a=>Wl(o.identifier,a))?r.push(o):n.push(o);return r.length&&this._onRemoveExtensions.fire({extensions:r,profileLocation:i}),n}),r.length&&this._onDidRemoveExtensions.fire({extensions:r,profileLocation:i})}catch(s){throw r.length&&this._onDidRemoveExtensions.fire({extensions:r,error:s,profileLocation:i}),s}}async withProfileExtensions(e,i,r){return this.getResourceAccessQueue(e).queue(async()=>{let s=[],n;try{const o=await this.fileService.readFile(e);n=JSON.parse(o.value.toString().trim()||"[]")}catch(o){if(jr(o)!==1)throw o;if(this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)&&(n=await this.migrateFromOldDefaultProfileExtensionsLocation()),!n&&r?.bailOutWhenFileNotFound)throw new Ll($i(o),"ERROR_PROFILE_NOT_FOUND")}if(n){Array.isArray(n)||this.throwInvalidConentError(e);let o=!1;for(const a of n){p6(a)||this.throwInvalidConentError(e);let c;if(At(a.relativeLocation)&&a.relativeLocation)c=this.resolveExtensionLocation(a.relativeLocation);else if(At(a.location)){this.logService.warn(`Extensions profile: Ignoring extension with invalid location: ${a.location}`);continue}else{c=x.revive(a.location);const u=this.toRelativePath(c);u&&(o=!0,a.relativeLocation=u)}hs(a.metadata?.hasPreReleaseVersion)&&a.metadata?.preRelease&&(o=!0,a.metadata.hasPreReleaseVersion=!0);const l=a.metadata?.id??a.identifier.uuid;s.push({identifier:l?{id:a.identifier.id,uuid:l}:{id:a.identifier.id},location:c,version:a.version,metadata:a.metadata})}o&&await this.fileService.writeFile(e,Y.fromString(JSON.stringify(n)))}if(i){s=i(s);const o=s.map(a=>({identifier:a.identifier,version:a.version,location:a.location.toJSON(),relativeLocation:this.toRelativePath(a.location),metadata:a.metadata}));await this.fileService.writeFile(e,Y.fromString(JSON.stringify(o)))}return s})}throwInvalidConentError(e){throw new Ll(`Invalid extensions content in ${e.toString()}`,"ERROR_INVALID_CONTENT")}toRelativePath(e){return this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.dirname(e),this.extensionsLocation)?this.uriIdentityService.extUri.basename(e):void 0}resolveExtensionLocation(e){return this.uriIdentityService.extUri.joinPath(this.extensionsLocation,e)}async migrateFromOldDefaultProfileExtensionsLocation(){return this._migrationPromise||(this._migrationPromise=(async()=>{const e=this.uriIdentityService.extUri.joinPath(this.userDataProfilesService.defaultProfile.location,"extensions.json"),i=this.uriIdentityService.extUri.joinPath(this.extensionsLocation,".init-default-profile-extensions");let r;try{r=(await this.fileService.readFile(e)).value.toString()}catch(n){if(jr(n)===1)return;throw n}this.logService.info("Migrating extensions from old default profile location",e.toString());let s;try{const n=JSON.parse(r);Array.isArray(n)&&n.every(o=>p6(o))?s=n:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",n)}catch(n){this.logService.error(n)}if(s)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,Y.fromString(JSON.stringify(s)),{overwrite:!1}),this.logService.info("Migrated extensions from old default profile location to new location",e.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString())}catch(n){if(jr(n)===3)this.logService.info("Migration from old default profile location to new location is done by another window",e.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString());else throw n}try{await this.fileService.del(e)}catch(n){jr(n)!==1&&this.logService.error(n)}try{await this.fileService.del(i)}catch(n){jr(n)!==1&&this.logService.error(n)}return s})()),this._migrationPromise}getResourceAccessQueue(e){let i=this.resourcesAccessQueueMap.get(e);return i||(i=new Wo,this.resourcesAccessQueueMap.set(e,i)),i}},lf=__decorate([__param(1,mt),__param(2,qr),__param(3,Mi),__param(4,V)],lf)}});function xv(t){switch(t){case 1:return w(116,null);case 2:return w(117,null);case 3:return w(118,null);case 4:return w(119,null);case 5:return w(120,null);case 6:return w(121,null);case 7:return w(122,null);case 8:return w(123,null);case 9:return w(124,null);default:return""}}var uT=g({"out-build/vs/base/common/jsonErrorMessages.js"(){"use strict";we()}}),Ol,Se,dT,hT,m6,fT,pT,gT,mT,vT,wT,yT,v6,ST,_T,bT,w6,ET,kT,PT,xT,CT,IT,DT,AT,RT,MT,TT,WT,LT,OT,FT,NT,UT,$T,BT,jT,HT,VT,y6=g({"out-build/vs/base/common/semver/semver.js"(){"use strict";Ol={},Se={exports:Ol},(function(t,e){if(typeof Ol=="object"&&typeof Se=="object")Se.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var i=e();for(var r in i)(typeof Ol=="object"?Ol:t)[r]=i[r]}})(typeof self<"u"?self:void 0,(function(){return(function(t){var e={};function i(r){if(e[r])return e[r].exports;var s=e[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(r,s,n){i.o(r,s)||Object.defineProperty(r,s,{enumerable:!0,get:n})},i.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},i.t=function(r,s){if(1&s&&(r=i(r)),8&s||4&s&&typeof r=="object"&&r&&r.__esModule)return r;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&s&&typeof r!="string")for(var o in r)i.d(n,o,function(a){return r[a]}.bind(null,o));return n},i.n=function(r){var s=r&&r.__esModule?function(){return r.default}:function(){return r};return i.d(s,"a",s),s},i.o=function(r,s){return Object.prototype.hasOwnProperty.call(r,s)},i.p="",i(i.s=0)})([function(t,e,i){(function(r){var s;e=t.exports=Ue,s=typeof r=="object"&&r.env&&r.env.NODE_DEBUG&&/\bsemver\b/i.test(r.env.NODE_DEBUG)?function(){var _=Array.prototype.slice.call(arguments,0);_.unshift("SEMVER"),console.log.apply(console,_)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var n=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,a=e.re=[],c=e.src=[],l=0,u=l++;c[u]="0|[1-9]\\d*";var d=l++;c[d]="[0-9]+";var f=l++;c[f]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var p=l++;c[p]="("+c[u]+")\\.("+c[u]+")\\.("+c[u]+")";var v=l++;c[v]="("+c[d]+")\\.("+c[d]+")\\.("+c[d]+")";var m=l++;c[m]="(?:"+c[u]+"|"+c[f]+")";var y=l++;c[y]="(?:"+c[d]+"|"+c[f]+")";var S=l++;c[S]="(?:-("+c[m]+"(?:\\."+c[m]+")*))";var E=l++;c[E]="(?:-?("+c[y]+"(?:\\."+c[y]+")*))";var k=l++;c[k]="[0-9A-Za-z-]+";var R=l++;c[R]="(?:\\+("+c[k]+"(?:\\."+c[k]+")*))";var C=l++,M="v?"+c[p]+c[S]+"?"+c[R]+"?";c[C]="^"+M+"$";var J="[v=\\s]*"+c[v]+c[E]+"?"+c[R]+"?",ne=l++;c[ne]="^"+J+"$";var $=l++;c[$]="((?:<|>)?=?)";var ge=l++;c[ge]=c[d]+"|x|X|\\*";var Ke=l++;c[Ke]=c[u]+"|x|X|\\*";var ie=l++;c[ie]="[v=\\s]*("+c[Ke]+")(?:\\.("+c[Ke]+")(?:\\.("+c[Ke]+")(?:"+c[S]+")?"+c[R]+"?)?)?";var Et=l++;c[Et]="[v=\\s]*("+c[ge]+")(?:\\.("+c[ge]+")(?:\\.("+c[ge]+")(?:"+c[E]+")?"+c[R]+"?)?)?";var W=l++;c[W]="^"+c[$]+"\\s*"+c[ie]+"$";var F=l++;c[F]="^"+c[$]+"\\s*"+c[Et]+"$";var Q=l++;c[Q]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var H=l++;c[H]="(?:~>?)";var ee=l++;c[ee]="(\\s*)"+c[H]+"\\s+",a[ee]=new RegExp(c[ee],"g");var de=l++;c[de]="^"+c[H]+c[ie]+"$";var Ae=l++;c[Ae]="^"+c[H]+c[Et]+"$";var _e=l++;c[_e]="(?:\\^)";var kt=l++;c[kt]="(\\s*)"+c[_e]+"\\s+",a[kt]=new RegExp(c[kt],"g");var os=l++;c[os]="^"+c[_e]+c[ie]+"$";var vn=l++;c[vn]="^"+c[_e]+c[Et]+"$";var as=l++;c[as]="^"+c[$]+"\\s*("+J+")$|^$";var So=l++;c[So]="^"+c[$]+"\\s*("+M+")$|^$";var Dr=l++;c[Dr]="(\\s*)"+c[$]+"\\s*("+J+"|"+c[ie]+")",a[Dr]=new RegExp(c[Dr],"g");var bu=l++;c[bu]="^\\s*("+c[ie]+")\\s+-\\s+("+c[ie]+")\\s*$";var Eu=l++;c[Eu]="^\\s*("+c[Et]+")\\s+-\\s+("+c[Et]+")\\s*$";var W0=l++;c[W0]="(<|>)?=?\\s*\\*";for(var wn=0;wn<35;wn++)s(wn,c[wn]),a[wn]||(a[wn]=new RegExp(c[wn]));function yn(_,I){if(_ instanceof Ue)return _;if(typeof _!="string"||_.length>n||!(I?a[ne]:a[C]).test(_))return null;try{return new Ue(_,I)}catch{return null}}function Ue(_,I){if(_ instanceof Ue){if(_.loose===I)return _;_=_.version}else if(typeof _!="string")throw new TypeError("Invalid Version: "+_);if(_.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof Ue))return new Ue(_,I);s("SemVer",_,I),this.loose=I;var A=_.trim().match(I?a[ne]:a[C]);if(!A)throw new TypeError("Invalid Version: "+_);if(this.raw=_,this.major=+A[1],this.minor=+A[2],this.patch=+A[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");A[4]?this.prerelease=A[4].split(".").map((function(Z){if(/^[0-9]+$/.test(Z)){var oe=+Z;if(oe>=0&&oe<o)return oe}return Z})):this.prerelease=[],this.build=A[5]?A[5].split("."):[],this.format()}e.parse=yn,e.valid=function(_,I){var A=yn(_,I);return A?A.version:null},e.clean=function(_,I){var A=yn(_.trim().replace(/^[=v]+/,""),I);return A?A.version:null},e.SemVer=Ue,Ue.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},Ue.prototype.toString=function(){return this.version},Ue.prototype.compare=function(_){return s("SemVer.compare",this.version,this.loose,_),_ instanceof Ue||(_=new Ue(_,this.loose)),this.compareMain(_)||this.comparePre(_)},Ue.prototype.compareMain=function(_){return _ instanceof Ue||(_=new Ue(_,this.loose)),_o(this.major,_.major)||_o(this.minor,_.minor)||_o(this.patch,_.patch)},Ue.prototype.comparePre=function(_){if(_ instanceof Ue||(_=new Ue(_,this.loose)),this.prerelease.length&&!_.prerelease.length)return-1;if(!this.prerelease.length&&_.prerelease.length)return 1;if(!this.prerelease.length&&!_.prerelease.length)return 0;var I=0;do{var A=this.prerelease[I],Z=_.prerelease[I];if(s("prerelease compare",I,A,Z),A===void 0&&Z===void 0)return 0;if(Z===void 0)return 1;if(A===void 0)return-1;if(A!==Z)return _o(A,Z)}while(++I)},Ue.prototype.inc=function(_,I){switch(_){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",I);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",I);break;case"prepatch":this.prerelease.length=0,this.inc("patch",I),this.inc("pre",I);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",I),this.inc("pre",I);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var A=this.prerelease.length;--A>=0;)typeof this.prerelease[A]=="number"&&(this.prerelease[A]++,A=-2);A===-1&&this.prerelease.push(0)}I&&(this.prerelease[0]===I?isNaN(this.prerelease[1])&&(this.prerelease=[I,0]):this.prerelease=[I,0]);break;default:throw new Error("invalid increment argument: "+_)}return this.format(),this.raw=this.version,this},e.inc=function(_,I,A,Z){typeof A=="string"&&(Z=A,A=void 0);try{return new Ue(_,A).inc(I,Z).version}catch{return null}},e.diff=function(_,I){if(zp(_,I))return null;var A=yn(_),Z=yn(I);if(A.prerelease.length||Z.prerelease.length){for(var oe in A)if((oe==="major"||oe==="minor"||oe==="patch")&&A[oe]!==Z[oe])return"pre"+oe;return"prerelease"}for(var oe in A)if((oe==="major"||oe==="minor"||oe==="patch")&&A[oe]!==Z[oe])return oe},e.compareIdentifiers=_o;var L0=/^[0-9]+$/;function _o(_,I){var A=L0.test(_),Z=L0.test(I);return A&&Z&&(_=+_,I=+I),A&&!Z?-1:Z&&!A?1:_<I?-1:_>I?1:0}function cs(_,I,A){return new Ue(_,A).compare(new Ue(I,A))}function ku(_,I,A){return cs(_,I,A)>0}function Pu(_,I,A){return cs(_,I,A)<0}function zp(_,I,A){return cs(_,I,A)===0}function O0(_,I,A){return cs(_,I,A)!==0}function Gp(_,I,A){return cs(_,I,A)>=0}function Kp(_,I,A){return cs(_,I,A)<=0}function xu(_,I,A,Z){var oe;switch(I){case"===":typeof _=="object"&&(_=_.version),typeof A=="object"&&(A=A.version),oe=_===A;break;case"!==":typeof _=="object"&&(_=_.version),typeof A=="object"&&(A=A.version),oe=_!==A;break;case"":case"=":case"==":oe=zp(_,A,Z);break;case"!=":oe=O0(_,A,Z);break;case">":oe=ku(_,A,Z);break;case">=":oe=Gp(_,A,Z);break;case"<":oe=Pu(_,A,Z);break;case"<=":oe=Kp(_,A,Z);break;default:throw new TypeError("Invalid operator: "+I)}return oe}function Xi(_,I){if(_ instanceof Xi){if(_.loose===I)return _;_=_.value}if(!(this instanceof Xi))return new Xi(_,I);s("comparator",_,I),this.loose=I,this.parse(_),this.semver===za?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}e.rcompareIdentifiers=function(_,I){return _o(I,_)},e.major=function(_,I){return new Ue(_,I).major},e.minor=function(_,I){return new Ue(_,I).minor},e.patch=function(_,I){return new Ue(_,I).patch},e.compare=cs,e.compareLoose=function(_,I){return cs(_,I,!0)},e.rcompare=function(_,I,A){return cs(I,_,A)},e.sort=function(_,I){return _.sort((function(A,Z){return e.compare(A,Z,I)}))},e.rsort=function(_,I){return _.sort((function(A,Z){return e.rcompare(A,Z,I)}))},e.gt=ku,e.lt=Pu,e.eq=zp,e.neq=O0,e.gte=Gp,e.lte=Kp,e.cmp=xu,e.Comparator=Xi;var za={};function wt(_,I){if(_ instanceof wt)return _.loose===I?_:new wt(_.raw,I);if(_ instanceof Xi)return new wt(_.value,I);if(!(this instanceof wt))return new wt(_,I);if(this.loose=I,this.raw=_,this.set=_.split(/\s*\|\|\s*/).map((function(A){return this.parseRange(A.trim())}),this).filter((function(A){return A.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+_);this.format()}function wi(_){return!_||_.toLowerCase()==="x"||_==="*"}function N8(_,I,A,Z,oe,Ut,$e,Ni,Pt,ni,Ar,xt,Gt){return((I=wi(A)?"":wi(Z)?">="+A+".0.0":wi(oe)?">="+A+"."+Z+".0":">="+I)+" "+(Ni=wi(Pt)?"":wi(ni)?"<"+(+Pt+1)+".0.0":wi(Ar)?"<"+Pt+"."+(+ni+1)+".0":xt?"<="+Pt+"."+ni+"."+Ar+"-"+xt:"<="+Ni)).trim()}function U8(_,I){for(var A=0;A<_.length;A++)if(!_[A].test(I))return!1;if(I.prerelease.length){for(A=0;A<_.length;A++)if(s(_[A].semver),_[A].semver!==za&&_[A].semver.prerelease.length>0){var Z=_[A].semver;if(Z.major===I.major&&Z.minor===I.minor&&Z.patch===I.patch)return!0}return!1}return!0}function Cu(_,I,A){try{I=new wt(I,A)}catch{return!1}return I.test(_)}function Yp(_,I,A,Z){var oe,Ut,$e,Ni,Pt;switch(_=new Ue(_,Z),I=new wt(I,Z),A){case">":oe=ku,Ut=Kp,$e=Pu,Ni=">",Pt=">=";break;case"<":oe=Pu,Ut=Gp,$e=ku,Ni="<",Pt="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Cu(_,I,Z))return!1;for(var ni=0;ni<I.set.length;++ni){var Ar=I.set[ni],xt=null,Gt=null;if(Ar.forEach((function(Ui){Ui.semver===za&&(Ui=new Xi(">=0.0.0")),xt=xt||Ui,Gt=Gt||Ui,oe(Ui.semver,xt.semver,Z)?xt=Ui:$e(Ui.semver,Gt.semver,Z)&&(Gt=Ui)})),xt.operator===Ni||xt.operator===Pt||(!Gt.operator||Gt.operator===Ni)&&Ut(_,Gt.semver)||Gt.operator===Pt&&$e(_,Gt.semver))return!1}return!0}Xi.prototype.parse=function(_){var I=this.loose?a[as]:a[So],A=_.match(I);if(!A)throw new TypeError("Invalid comparator: "+_);this.operator=A[1],this.operator==="="&&(this.operator=""),A[2]?this.semver=new Ue(A[2],this.loose):this.semver=za},Xi.prototype.toString=function(){return this.value},Xi.prototype.test=function(_){return s("Comparator.test",_,this.loose),this.semver===za||(typeof _=="string"&&(_=new Ue(_,this.loose)),xu(_,this.operator,this.semver,this.loose))},Xi.prototype.intersects=function(_,I){if(!(_ instanceof Xi))throw new TypeError("a Comparator is required");var A;if(this.operator==="")return A=new wt(_.value,I),Cu(this.value,A,I);if(_.operator==="")return A=new wt(this.value,I),Cu(_.semver,A,I);var Z=!(this.operator!==">="&&this.operator!==">"||_.operator!==">="&&_.operator!==">"),oe=!(this.operator!=="<="&&this.operator!=="<"||_.operator!=="<="&&_.operator!=="<"),Ut=this.semver.version===_.semver.version,$e=!(this.operator!==">="&&this.operator!=="<="||_.operator!==">="&&_.operator!=="<="),Ni=xu(this.semver,"<",_.semver,I)&&(this.operator===">="||this.operator===">")&&(_.operator==="<="||_.operator==="<"),Pt=xu(this.semver,">",_.semver,I)&&(this.operator==="<="||this.operator==="<")&&(_.operator===">="||_.operator===">");return Z||oe||Ut&&$e||Ni||Pt},e.Range=wt,wt.prototype.format=function(){return this.range=this.set.map((function(_){return _.join(" ").trim()})).join("||").trim(),this.range},wt.prototype.toString=function(){return this.range},wt.prototype.parseRange=function(_){var I=this.loose;_=_.trim(),s("range",_,I);var A=I?a[Eu]:a[bu];_=_.replace(A,N8),s("hyphen replace",_),_=_.replace(a[Dr],"$1$2$3"),s("comparator trim",_,a[Dr]),_=(_=(_=_.replace(a[ee],"$1~")).replace(a[kt],"$1^")).split(/\s+/).join(" ");var Z=I?a[as]:a[So],oe=_.split(" ").map((function(Ut){return(function($e,Ni){return s("comp",$e),$e=(function(Pt,ni){return Pt.trim().split(/\s+/).map((function(Ar){return(function(xt,Gt){s("caret",xt,Gt);var Ui=Gt?a[vn]:a[os];return xt.replace(Ui,(function(wr,ue,Ee,et,dt){var Kt;return s("caret",xt,wr,ue,Ee,et,dt),wi(ue)?Kt="":wi(Ee)?Kt=">="+ue+".0.0 <"+(+ue+1)+".0.0":wi(et)?Kt=ue==="0"?">="+ue+"."+Ee+".0 <"+ue+"."+(+Ee+1)+".0":">="+ue+"."+Ee+".0 <"+(+ue+1)+".0.0":dt?(s("replaceCaret pr",dt),dt.charAt(0)!=="-"&&(dt="-"+dt),Kt=ue==="0"?Ee==="0"?">="+ue+"."+Ee+"."+et+dt+" <"+ue+"."+Ee+"."+(+et+1):">="+ue+"."+Ee+"."+et+dt+" <"+ue+"."+(+Ee+1)+".0":">="+ue+"."+Ee+"."+et+dt+" <"+(+ue+1)+".0.0"):(s("no pr"),Kt=ue==="0"?Ee==="0"?">="+ue+"."+Ee+"."+et+" <"+ue+"."+Ee+"."+(+et+1):">="+ue+"."+Ee+"."+et+" <"+ue+"."+(+Ee+1)+".0":">="+ue+"."+Ee+"."+et+" <"+(+ue+1)+".0.0"),s("caret return",Kt),Kt}))})(Ar,ni)})).join(" ")})($e,Ni),s("caret",$e),$e=(function(Pt,ni){return Pt.trim().split(/\s+/).map((function(Ar){return(function(xt,Gt){var Ui=Gt?a[Ae]:a[de];return xt.replace(Ui,(function(wr,ue,Ee,et,dt){var Kt;return s("tilde",xt,wr,ue,Ee,et,dt),wi(ue)?Kt="":wi(Ee)?Kt=">="+ue+".0.0 <"+(+ue+1)+".0.0":wi(et)?Kt=">="+ue+"."+Ee+".0 <"+ue+"."+(+Ee+1)+".0":dt?(s("replaceTilde pr",dt),dt.charAt(0)!=="-"&&(dt="-"+dt),Kt=">="+ue+"."+Ee+"."+et+dt+" <"+ue+"."+(+Ee+1)+".0"):Kt=">="+ue+"."+Ee+"."+et+" <"+ue+"."+(+Ee+1)+".0",s("tilde return",Kt),Kt}))})(Ar,ni)})).join(" ")})($e,Ni),s("tildes",$e),$e=(function(Pt,ni){return s("replaceXRanges",Pt,ni),Pt.split(/\s+/).map((function(Ar){return(function(xt,Gt){xt=xt.trim();var Ui=Gt?a[F]:a[W];return xt.replace(Ui,(function(wr,ue,Ee,et,dt,Kt){s("xRange",xt,wr,ue,Ee,et,dt,Kt);var F0=wi(Ee),Ga=F0||wi(et),Ka=Ga||wi(dt);return ue==="="&&Ka&&(ue=""),F0?wr=ue===">"||ue==="<"?"<0.0.0":"*":ue&&Ka?(Ga&&(et=0),Ka&&(dt=0),ue===">"?(ue=">=",Ga?(Ee=+Ee+1,et=0,dt=0):Ka&&(et=+et+1,dt=0)):ue==="<="&&(ue="<",Ga?Ee=+Ee+1:et=+et+1),wr=ue+Ee+"."+et+"."+dt):Ga?wr=">="+Ee+".0.0 <"+(+Ee+1)+".0.0":Ka&&(wr=">="+Ee+"."+et+".0 <"+Ee+"."+(+et+1)+".0"),s("xRange return",wr),wr}))})(Ar,ni)})).join(" ")})($e,Ni),s("xrange",$e),$e=(function(Pt,ni){return s("replaceStars",Pt,ni),Pt.trim().replace(a[W0],"")})($e,Ni),s("stars",$e),$e})(Ut,I)})).join(" ").split(/\s+/);return this.loose&&(oe=oe.filter((function(Ut){return!!Ut.match(Z)}))),oe=oe.map((function(Ut){return new Xi(Ut,I)}))},wt.prototype.intersects=function(_,I){if(!(_ instanceof wt))throw new TypeError("a Range is required");return this.set.some((function(A){return A.every((function(Z){return _.set.some((function(oe){return oe.every((function(Ut){return Z.intersects(Ut,I)}))}))}))}))},e.toComparators=function(_,I){return new wt(_,I).set.map((function(A){return A.map((function(Z){return Z.value})).join(" ").trim().split(" ")}))},wt.prototype.test=function(_){if(!_)return!1;typeof _=="string"&&(_=new Ue(_,this.loose));for(var I=0;I<this.set.length;I++)if(U8(this.set[I],_))return!0;return!1},e.satisfies=Cu,e.maxSatisfying=function(_,I,A){var Z=null,oe=null;try{var Ut=new wt(I,A)}catch{return null}return _.forEach((function($e){Ut.test($e)&&(Z&&oe.compare($e)!==-1||(oe=new Ue(Z=$e,A)))})),Z},e.minSatisfying=function(_,I,A){var Z=null,oe=null;try{var Ut=new wt(I,A)}catch{return null}return _.forEach((function($e){Ut.test($e)&&(Z&&oe.compare($e)!==1||(oe=new Ue(Z=$e,A)))})),Z},e.validRange=function(_,I){try{return new wt(_,I).range||"*"}catch{return null}},e.ltr=function(_,I,A){return Yp(_,I,"<",A)},e.gtr=function(_,I,A){return Yp(_,I,">",A)},e.outside=Yp,e.prerelease=function(_,I){var A=yn(_,I);return A&&A.prerelease.length?A.prerelease:null},e.intersects=function(_,I,A){return _=new wt(_,A),I=new wt(I,A),_.intersects(I)},e.coerce=function(_){if(_ instanceof Ue)return _;if(typeof _!="string")return null;var I=_.match(a[Q]);return I==null?null:yn((I[1]||"0")+"."+(I[2]||"0")+"."+(I[3]||"0"))}}).call(this,i(1))},function(t,e){var i,r,s=t.exports={};function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(y){if(i===setTimeout)return setTimeout(y,0);if((i===n||!i)&&setTimeout)return i=setTimeout,setTimeout(y,0);try{return i(y,0)}catch{try{return i.call(null,y,0)}catch{return i.call(this,y,0)}}}(function(){try{i=typeof setTimeout=="function"?setTimeout:n}catch{i=n}try{r=typeof clearTimeout=="function"?clearTimeout:o}catch{r=o}})();var c,l=[],u=!1,d=-1;function f(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&p())}function p(){if(!u){var y=a(f);u=!0;for(var S=l.length;S;){for(c=l,l=[];++d<S;)c&&c[d].run();d=-1,S=l.length}c=null,u=!1,(function(E){if(r===clearTimeout)return clearTimeout(E);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(E);try{r(E)}catch{try{return r.call(null,E)}catch{return r.call(this,E)}}})(y)}}function v(y,S){this.fun=y,this.array=S}function m(){}s.nextTick=function(y){var S=new Array(arguments.length-1);if(arguments.length>1)for(var E=1;E<arguments.length;E++)S[E-1]=arguments[E];l.push(new v(y,S)),l.length!==1||u||a(p)},v.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=m,s.addListener=m,s.once=m,s.off=m,s.removeListener=m,s.removeAllListeners=m,s.emit=m,s.prependListener=m,s.prependOnceListener=m,s.listeners=function(y){return[]},s.binding=function(y){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(y){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}}])})),dT=Se.exports.SEMVER_SPEC_VERSION,hT=Se.exports.parse,m6=Se.exports.valid,fT=Se.exports.coerce,pT=Se.exports.clean,gT=Se.exports.inc,mT=Se.exports.major,vT=Se.exports.minor,wT=Se.exports.patch,yT=Se.exports.prerelease,v6=Se.exports.gt,ST=Se.exports.gte,_T=Se.exports.lt,bT=Se.exports.lte,w6=Se.exports.eq,ET=Se.exports.neq,kT=Se.exports.cmp,PT=Se.exports.compare,xT=Se.exports.rcompare,CT=Se.exports.compareIdentifiers,IT=Se.exports.rcompareIdentifiers,DT=Se.exports.compareBuild,AT=Se.exports.sort,RT=Se.exports.rsort,MT=Se.exports.diff,TT=Se.exports.validRange,WT=Se.exports.satisfies,LT=Se.exports.maxSatisfying,OT=Se.exports.minSatisfying,FT=Se.exports.minVersion,NT=Se.exports.gtr,UT=Se.exports.ltr,$T=Se.exports.outside,BT=Se.exports.intersects,jT=Se.exports.SemVer,HT=Se.exports.Comparator,VT=Se.exports.Range}}),S6,_6,qT=g({"out-build/vs/platform/extensions/common/extensionsApiProposals.js"(){"use strict";S6={activeComment:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts"},aiRelatedInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts"},aiTextSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts",version:2},authLearnMore:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts"},authSession:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts"},canonicalUriProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts"},chatEditing:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatEditing.d.ts"},chatParticipantAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts"},chatParticipantPrivate:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts",version:6},chatProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts"},chatReferenceBinaryData:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatReferenceBinaryData.d.ts"},chatReferenceDiagnostic:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatReferenceDiagnostic.d.ts"},chatStatusItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatStatusItem.d.ts"},chatTab:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts"},codeActionAI:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts"},codeActionRanges:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts"},codiconDecoration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts"},commentReactor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReactor.d.ts"},commentReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReveal.d.ts"},commentThreadApplicability:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts"},commentingRangeHint:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentingRangeHint.d.ts"},commentsDraftState:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsDraftState.d.ts"},contribAccessibilityHelpContent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts"},contribChatParticipantDetection:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribChatParticipantDetection.d.ts"},contribCommentEditorActionsMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts"},contribCommentPeekContext:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts"},contribCommentThreadAdditionalMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts"},contribCommentsViewThreadMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts"},contribDebugCreateConfiguration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDebugCreateConfiguration.d.ts"},contribDiffEditorGutterToolBarMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts"},contribEditSessions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts"},contribEditorContentMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts"},contribLabelFormatterWorkspaceTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts"},contribMenuBarHome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts"},contribMergeEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts"},contribMultiDiffEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts"},contribNotebookStaticPreloads:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts"},contribRemoteHelp:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts"},contribShareMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts"},contribSourceControlHistoryItemMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts"},contribSourceControlHistoryTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryTitleMenu.d.ts"},contribSourceControlInputBoxMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts"},contribSourceControlTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts"},contribStatusBarItems:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts"},contribViewContainerTitle:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewContainerTitle.d.ts"},contribViewsRemote:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts"},contribViewsWelcome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts"},control:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.control.d.ts"},cursor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.cursor.d.ts"},cursorNoDeps:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.cursorNoDeps.d.ts"},cursorPublic:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.cursorPublic.d.ts"},cursorTracing:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.cursorTracing.d.ts"},customEditorMove:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts"},debugVisualization:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts"},defaultChatParticipant:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts",version:3},diffCommand:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts"},diffContentOptions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts"},documentFiltersExclusive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts"},editSessionIdentityProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts"},editorHoverVerbosityLevel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts"},editorInsets:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts"},embeddings:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.embeddings.d.ts"},extensionRuntime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts"},extensionsAny:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts"},externalUriOpener:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts"},fileSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts"},fileSearchProvider2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider2.d.ts"},findFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts",version:2},findTextInFiles:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts"},findTextInFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles2.d.ts"},fsChunks:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts"},idToken:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.idToken.d.ts"},inlineCompletionsAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts"},inlineEdit:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineEdit.d.ts"},interactive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts"},interactiveWindow:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts"},ipc:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts"},languageModelCapabilities:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelCapabilities.d.ts"},languageModelDataPart:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelDataPart.d.ts"},languageModelSystem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts"},languageModelToolsForAgent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelToolsForAgent.d.ts"},languageStatusText:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts"},mappedEditsProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts"},mcpConfigurationProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mcpConfigurationProvider.d.ts"},multiDocumentHighlightProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts"},nativeWindowHandle:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.nativeWindowHandle.d.ts"},newSymbolNamesProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts"},notebookCellExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecution.d.ts"},notebookCellExecutionState:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts"},notebookControllerAffinityHidden:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts"},notebookDeprecated:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts"},notebookExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts"},notebookKernelSource:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts"},notebookLiveShare:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts"},notebookMessaging:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts"},notebookMime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts"},notebookReplDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookReplDocument.d.ts"},notebookVariableProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts"},portsAttributes:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts"},profileContentHandlers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts"},quickDiffProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts"},quickInputButtonLocation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts"},quickPickItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts"},quickPickSortByLabel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts"},resolvers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts"},scmActionButton:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts"},scmHistoryProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts"},scmMultiDiffEditor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts"},scmRemotes:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmRemotes.d.ts"},scmSelectedProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts"},scmTextDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmTextDocument.d.ts"},scmValidation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts"},shareProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts"},speech:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts"},statusBarItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.statusBarItemTooltip.d.ts"},tabInputMultiDiff:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts"},tabInputTextMerge:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts"},taskPresentationGroup:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts"},taskProblemMatcherStatus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskProblemMatcherStatus.d.ts"},telemetry:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts"},terminalCompletionProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalCompletionProvider.d.ts"},terminalDataWriteEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts"},terminalDimensions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts"},terminalExecuteCommandEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts"},terminalQuickFixProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts"},terminalSelection:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts"},terminalShellEnv:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellEnv.d.ts"},testObserver:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts"},testRelatedCode:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testRelatedCode.d.ts"},textDocumentEncoding:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textDocumentEncoding.d.ts"},textEditorDiffInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textEditorDiffInformation.d.ts"},textSearchComplete2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchComplete2.d.ts"},textSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts"},textSearchProvider2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider2.d.ts"},timeline:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts"},tokenInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts"},treeViewActiveItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts"},treeViewMarkdownMessage:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts"},treeViewReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts"},tunnelFactory:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts"},tunnels:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts"},valueSelectionInQuickPick:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.valueSelectionInQuickPick.d.ts"},workspaceTrust:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"}},_6=Object.freeze(S6)}});function zT(t){return t=t.trim(),t==="*"||Dv.test(t)}function Cv(t){if(!zT(t))return null;if(t=t.trim(),t==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};const e=t.match(Dv);return e?{hasCaret:e[1]==="^",hasGreaterEquals:e[1]===">=",majorBase:e[2]==="x"?0:parseInt(e[2],10),majorMustEqual:e[2]!=="x",minorBase:e[4]==="x"?0:parseInt(e[4],10),minorMustEqual:e[4]!=="x",patchBase:e[6]==="x"?0:parseInt(e[6],10),patchMustEqual:e[6]!=="x",preRelease:e[8]||null}:null}function Iv(t){if(!t)return null;const e=t.majorBase,i=t.majorMustEqual,r=t.minorBase;let s=t.minorMustEqual;const n=t.patchBase;let o=t.patchMustEqual;t.hasCaret&&(e===0||(s=!1),o=!1);let a=0;if(t.preRelease){const c=E6.exec(t.preRelease);if(c){const[,l,u,d]=c;a=Date.UTC(Number(l),Number(u)-1,Number(d))}}return{majorBase:e,majorMustEqual:i,minorBase:r,minorMustEqual:s,patchBase:n,patchMustEqual:o,isMinimum:t.hasGreaterEquals,notBefore:a}}function GT(t,e,i){let r;typeof t=="string"?r=Iv(Cv(t)):r=t;let s;e instanceof Date?s=e.getTime():typeof e=="string"&&(s=new Date(e).getTime());let n;if(typeof i=="string"?n=Iv(Cv(i)):n=i,!r||!n)return!1;const o=r.majorBase,a=r.minorBase,c=r.patchBase;let l=n.majorBase,u=n.minorBase,d=n.patchBase;const f=n.notBefore;let p=n.majorMustEqual,v=n.minorMustEqual,m=n.patchMustEqual;return n.isMinimum?o>l?!0:o<l?!1:a>u?!0:a<u||s&&s<f?!1:c>=d:(o===1&&l===0&&(!p||!v||!m)&&(l=1,u=0,d=0,p=!0,v=!1,m=!1),o<l?!1:o>l?!p:a<u?!1:a>u?!v:c<d?!1:c>d?!m:!(s&&s<f))}function KT(t,e,i,r,s,n){const o=[];if(typeof r.publisher<"u"&&typeof r.publisher!="string")return o.push([De.Error,w(1983,null)]),o;if(typeof r.name!="string")return o.push([De.Error,w(1984,null,"name")]),o;if(typeof r.version!="string")return o.push([De.Error,w(1985,null,"version")]),o;if(!r.engines)return o.push([De.Error,w(1986,null,"engines")]),o;if(typeof r.engines.vscode!="string")return o.push([De.Error,w(1987,null,"engines.vscode")]),o;if(typeof r.extensionDependencies<"u"&&!b6(r.extensionDependencies))return o.push([De.Error,w(1988,null,"extensionDependencies")]),o;if(typeof r.activationEvents<"u"){if(!b6(r.activationEvents))return o.push([De.Error,w(1989,null,"activationEvents")]),o;if(typeof r.main>"u"&&typeof r.browser>"u")return o.push([De.Error,w(1990,null,"activationEvents","main","browser")]),o}if(typeof r.extensionKind<"u"&&typeof r.main>"u"&&o.push([De.Warning,w(1991,null,"extensionKind")]),typeof r.main<"u"){if(typeof r.main!="string")return o.push([De.Error,w(1992,null,"main")]),o;{const l=pe(i,r.main);qg(l,i)||o.push([De.Warning,w(1993,null,l.path,i.path)])}}if(typeof r.browser<"u"){if(typeof r.browser!="string")return o.push([De.Error,w(1994,null,"browser")]),o;{const l=pe(i,r.browser);qg(l,i)||o.push([De.Warning,w(1995,null,l.path,i.path)])}}if(!m6(r.version))return o.push([De.Error,w(1996,null)]),o;const a=[];if(!YT(t,e,r,s,a))for(const l of a)o.push([De.Error,l]);if(n&&r.enabledApiProposals?.length){const l=[];if(!JT([...r.enabledApiProposals],l))for(const u of l)o.push([De.Error,u])}return o}function YT(t,e,i,r,s){return r||typeof i.main>"u"&&typeof i.browser>"u"||i.publisher==="TypeScriptTeam"&&i.name==="native-preview"?!0:QT(t,e,i.engines.vscode,s)}function JT(t,e){if(t.length===0)return!0;const i=Array.isArray(e)?e:void 0,r=(i?void 0:e)??_6,s=[],n=eT(t);for(const{proposalName:o,version:a}of n){if(!a)continue;r[o]?.version!==a&&s.push(o)}return s.length?(i&&(s.length===1?i.push(w(1997,null,s[0])):i.push(w(1998,null,s.slice(0,s.length-1).map(o=>`'${o}'`).join(", "),s[s.length-1]))),!1):!0}function QT(t,e,i,r=[]){const s=Iv(Cv(i));if(!s)return r.push(w(1999,null,i)),!1;if(s.majorBase===0){if(!s.majorMustEqual||!s.minorMustEqual)return r.push(w(2e3,null,i)),!1}else if(!s.majorMustEqual)return r.push(w(2001,null,i)),!1;return GT(t,e,s)?!0:(r.push(w(2002,null,t,i)),!1)}function b6(t){if(!Array.isArray(t))return!1;for(let e=0,i=t.length;e<i;e++)if(typeof t[e]!="string")return!1;return!0}var Dv,E6,XT=g({"out-build/vs/platform/extensions/common/extensionValidator.js"(){"use strict";gt(),th(),we(),y6(),Pv(),qT(),Dv=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,E6=/^-(\d{4})(\d{2})(\d{2})$/}});function ZT(t,e,i,r){try{eW(t,e,i,r)}catch(s){t.error(s?.message??s)}return e}function eW(t,e,i,r){const s=(n,o,a)=>{const c=n[o];if(At(c)){const l=c,u=l.length;if(u>1&&l[0]==="%"&&l[u-1]==="%"){const d=l.substr(1,u-2);let f=i[d];f===void 0&&r&&(f=r[d]);const p=typeof f=="string"?f:f?.message,v=r?.[d],m=typeof v=="string"?v:v?.message;if(!p){m||t.warn(`[${e.name}]: ${w(1964,null,d)}`);return}if(a&&(o==="title"||o==="category")&&m&&m!==p){const y={value:p,original:m};n[o]=y}else n[o]=p}}else if(Lt(c))for(const l in c)c.hasOwnProperty(l)&&(l==="commands"?s(c,l,!0):s(c,l,a));else if(Array.isArray(c))for(let l=0;l<c.length;l++)s(c,l,a)};for(const n in e)e.hasOwnProperty(n)&&s(e,n)}var tW=g({"out-build/vs/platform/extensionManagement/common/extensionNls.js"(){"use strict";xe(),we()}}),Av,k6,df,xa,Fl,Nl,P6,x6=g({"out-build/vs/platform/extensionManagement/common/extensionsScannerService.js"(){"use strict";Wt(),ae(),ur(),it(),Re(),Cs(),uT(),L(),Ie(),ye(),z(),gt(),y6(),th(),re(),we(),xi(),f6(),Pv(),XT(),Ze(),G(),K(),lt(),q(),rd(),uf(),zr(),Vr(),tW(),(function(t){function e(i,r){if(i===r)return!0;const s=Object.keys(i),n=new Set;for(const o of Object.keys(r))n.add(o);if(s.length!==n.size)return!1;for(const o of s){if(i[o]!==r[o])return!1;n.delete(o)}return n.size===0}t.equals=e})(Av||(Av={})),k6=j("IExtensionsScannerService"),df=class extends N{constructor(e,i,r,s,n,o,a,c,l,u,d,f){super(),this.systemExtensionsLocation=e,this.userExtensionsLocation=i,this.extensionsControlLocation=r,this.currentProfile=s,this.userDataProfilesService=n,this.extensionsProfileScannerService=o,this.fileService=a,this.logService=c,this.environmentService=l,this.productService=u,this.uriIdentityService=d,this.instantiationService=f,this._onDidChangeCache=this._register(new D),this.onDidChangeCache=this._onDidChangeCache.event,this.systemExtensionsCachedScanner=this._register(this.instantiationService.createInstance(Nl,this.currentProfile)),this.userExtensionsCachedScanner=this._register(this.instantiationService.createInstance(Nl,this.currentProfile)),this.extensionsScanner=this._register(this.instantiationService.createInstance(Fl)),this.initializeDefaultProfileExtensionsPromise=void 0,this._register(this.systemExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(0))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(1)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=aT(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(e,i){const[r,s]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(i)]);return this.dedupExtensions(r,s,[],await this.getTargetPlatform(),!0)}async scanSystemExtensions(e){const i=[];i.push(this.scanDefaultSystemExtensions(e.language)),i.push(this.scanDevSystemExtensions(e.language,!!e.checkControlFile));const[r,s]=await Promise.all(i);return this.applyScanOptions([...r,...s],0,{pickLatest:!1})}async scanUserExtensions(e){this.logService.trace("Started scanning user extensions",e.profileLocation);const i=this.uriIdentityService.extUri.isEqual(e.profileLocation,this.userDataProfilesService.defaultProfile.extensionsResource)?{bailOutWhenFileNotFound:!0}:void 0,r=await this.createExtensionScannerInput(e.profileLocation,!0,1,e.language,!0,i,e.productVersion??this.getProductVersion()),s=e.useCache&&!r.devMode?this.userExtensionsCachedScanner:this.extensionsScanner;let n;try{n=await s.scanExtensions(r)}catch(o){if(o instanceof Ll&&o.code==="ERROR_PROFILE_NOT_FOUND")await this.doInitializeDefaultProfileExtensions(),n=await s.scanExtensions(r);else throw o}return n=await this.applyScanOptions(n,1,{includeInvalid:e.includeInvalid,pickLatest:!0}),this.logService.trace("Scanned user extensions:",n.length),n}async scanAllUserExtensions(e={includeInvalid:!0,includeAllVersions:!0}){const i=await this.createExtensionScannerInput(this.userExtensionsLocation,!1,1,void 0,!0,void 0,this.getProductVersion()),r=await this.extensionsScanner.scanExtensions(i);return this.applyScanOptions(r,1,{includeAllVersions:e.includeAllVersions,includeInvalid:e.includeInvalid})}async scanExtensionsUnderDevelopment(e,i){if(this.environmentService.isExtensionDevelopment&&this.environmentService.extensionDevelopmentLocationURI){const r=(await Promise.all(this.environmentService.extensionDevelopmentLocationURI.filter(s=>s.scheme===T.file).map(async s=>{const n=await this.createExtensionScannerInput(s,!1,1,i.language,!1,void 0,this.getProductVersion());return(await this.extensionsScanner.scanOneOrMultipleExtensions(n)).map(a=>(a.type=e.find(c=>Wl(c.identifier,a.identifier))?.type??a.type,this.extensionsScanner.validate(a,n)))}))).flat();return this.applyScanOptions(r,"development",{includeInvalid:i.includeInvalid,pickLatest:!0})}return[]}async scanExistingExtension(e,i,r){const s=await this.createExtensionScannerInput(e,!1,i,r.language,!0,void 0,this.getProductVersion()),n=await this.extensionsScanner.scanExtension(s);return!n||!r.includeInvalid&&!n.isValid?null:n}async scanOneOrMultipleExtensions(e,i,r){const s=await this.createExtensionScannerInput(e,!1,i,r.language,!0,void 0,this.getProductVersion()),n=await this.extensionsScanner.scanOneOrMultipleExtensions(s);return this.applyScanOptions(n,i,{includeInvalid:r.includeInvalid,pickLatest:!0})}async scanMultipleExtensions(e,i,r){const s=[];return await Promise.all(e.map(async n=>{const o=await this.scanOneOrMultipleExtensions(n,i,r);s.push(...o)})),this.applyScanOptions(s,i,{includeInvalid:r.includeInvalid,pickLatest:!0})}async updateManifestMetadata(e,i){const r=pe(e,"package.json"),s=(await this.fileService.readFile(r)).value.toString(),n=JSON.parse(s);n.__metadata={...n.__metadata,...i},await this.fileService.writeFile(pe(e,"package.json"),Y.fromString(JSON.stringify(n,null," ")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof Ll&&e.code==="ERROR_PROFILE_NOT_FOUND")await this.doInitializeDefaultProfileExtensions();else throw e}}async doInitializeDefaultProfileExtensions(){return this.initializeDefaultProfileExtensionsPromise||(this.initializeDefaultProfileExtensionsPromise=(async()=>{try{this.logService.info("Started initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString());const e=await this.scanAllUserExtensions({includeInvalid:!0});if(e.length)await this.extensionsProfileScannerService.addExtensionsToProfile(e.map(i=>[i,i.metadata]),this.userDataProfilesService.defaultProfile.extensionsResource);else try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,Y.fromString(JSON.stringify([])))}catch(i){jr(i)!==1&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),$i(i))}this.logService.info("Completed initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString())}catch(e){this.logService.error(e)}finally{this.initializeDefaultProfileExtensionsPromise=void 0}})()),this.initializeDefaultProfileExtensionsPromise}async applyScanOptions(e,i,r={}){return r.includeAllVersions||(e=this.dedupExtensions(i===0?e:void 0,i===1?e:void 0,i==="development"?e:void 0,await this.getTargetPlatform(),!!r.pickLatest)),r.includeInvalid||(e=e.filter(s=>s.isValid)),e.sort((s,n)=>{const o=tt(s.location.fsPath),a=tt(n.location.fsPath);return o<a?-1:o>a?1:0})}dedupExtensions(e,i,r,s,n){const o=(c,l,u)=>{if(c.isValid&&!l.isValid)return!1;if(c.isValid===l.isValid){if(n&&v6(c.manifest.version,l.manifest.version))return this.logService.debug(`Skipping extension ${l.location.path} with lower version ${l.manifest.version} in favour of ${c.location.path} with version ${c.manifest.version}`),!1;if(w6(c.manifest.version,l.manifest.version)){if(c.type===0)return this.logService.debug(`Skipping extension ${l.location.path} in favour of system extension ${c.location.path} with same version`),!1;if(c.targetPlatform===s)return this.logService.debug(`Skipping extension ${l.location.path} from different target platform ${l.targetPlatform}`),!1}}return u?this.logService.warn(`Overwriting user extension ${c.location.path} with ${l.location.path}.`):this.logService.debug(`Overwriting user extension ${c.location.path} with ${l.location.path}.`),!0},a=new h6;return e?.forEach(c=>{const l=a.get(c.identifier.id);(!l||o(l,c,!1))&&a.set(c.identifier.id,c)}),i?.forEach(c=>{const l=a.get(c.identifier.id);if(!l&&e&&c.type===0){this.logService.debug(`Skipping obsolete system extension ${c.location.path}.`);return}(!l||o(l,c,!1))&&a.set(c.identifier.id,c)}),r?.forEach(c=>{const l=a.get(c.identifier.id);(!l||o(l,c,!0))&&a.set(c.identifier.id,c),a.set(c.identifier.id,c)}),[...a.values()]}async scanDefaultSystemExtensions(e){this.logService.trace("Started scanning system extensions");const i=await this.createExtensionScannerInput(this.systemExtensionsLocation,!1,0,e,!0,void 0,this.getProductVersion()),s=await(i.devMode?this.extensionsScanner:this.systemExtensionsCachedScanner).scanExtensions(i);return this.logService.trace("Scanned system extensions:",s.length),s}async scanDevSystemExtensions(e,i){const r=this.environmentService.isBuilt?[]:this.productService.builtInExtensions;if(!r?.length)return[];this.logService.trace("Started scanning dev system extensions");const s=i?await this.getBuiltInExtensionControl():{},n=[],o=x.file(bi(U(Ct.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(const c of r){const l=s[c.name]||"marketplace";switch(l){case"disabled":break;case"marketplace":n.push(pe(o,c.name));break;default:n.push(x.file(l));break}}const a=await Promise.all(n.map(async c=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(c,!1,0,e,!0,void 0,this.getProductVersion()))));return this.logService.trace("Scanned dev system extensions:",a.length),Dt(a)}async getBuiltInExtensionControl(){try{const e=await this.fileService.readFile(this.extensionsControlLocation);return JSON.parse(e.value.toString())}catch{return{}}}async createExtensionScannerInput(e,i,r,s,n,o,a){const c=await this.getTranslations(s??Zi),l=await this.getMtime(e),u=i&&!this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)?this.userDataProfilesService.defaultProfile.extensionsResource:void 0,d=u?await this.getMtime(u):void 0;return new xa(e,l,u,d,i,o,r,n,a.vscodeVersion,a.date,this.productService.commit,!this.environmentService.isBuilt,s,c)}async getMtime(e){try{const i=await this.fileService.stat(e);if(typeof i.mtime=="number")return i.mtime}catch{}}getProductVersion(){return{vscodeVersion:this.productService.vscodeVersion,version:this.productService.version,date:this.productService.date}}},df=__decorate([__param(4,qr),__param(5,Pa),__param(6,mt),__param(7,V),__param(8,or),__param(9,qe),__param(10,Mi),__param(11,Or)],df),xa=class{constructor(t,e,i,r,s,n,o,a,c,l,u,d,f,p){this.location=t,this.mtime=e,this.applicationExtensionslocation=i,this.applicationExtensionslocationMtime=r,this.profile=s,this.profileScanOptions=n,this.type=o,this.validate=a,this.productVersion=c,this.productDate=l,this.productCommit=u,this.devMode=d,this.language=f,this.translations=p}static createNlsConfiguration(t){return{language:t.language,pseudo:t.language==="pseudo",devMode:t.devMode,translations:t.translations}}static equals(t,e){return Vg(t.location,e.location)&&t.mtime===e.mtime&&Vg(t.applicationExtensionslocation,e.applicationExtensionslocation)&&t.applicationExtensionslocationMtime===e.applicationExtensionslocationMtime&&t.profile===e.profile&&Kr(t.profileScanOptions,e.profileScanOptions)&&t.type===e.type&&t.validate===e.validate&&t.productVersion===e.productVersion&&t.productDate===e.productDate&&t.productCommit===e.productCommit&&t.devMode===e.devMode&&t.language===e.language&&Av.equals(t.translations,e.translations)}},Fl=class extends N{constructor(e,i,r,s,n,o){super(),this.extensionsProfileScannerService=e,this.uriIdentityService=i,this.fileService=r,this.environmentService=n,this.logService=o,this.extensionsEnabledWithApiProposalVersion=s.extensionsEnabledWithApiProposalVersion?.map(a=>a.toLowerCase())??[]}async scanExtensions(e){return e.profile?this.scanExtensionsFromProfile(e):this.scanExtensionsFromLocation(e)}async scanExtensionsFromLocation(e){const i=await this.fileService.resolve(e.location);if(!i.children?.length)return[];const r=await Promise.all(i.children.map(async s=>{if(!s.isDirectory||e.type===1&&Nr(s.resource).indexOf(".")===0)return null;const n=new xa(s.resource,e.mtime,e.applicationExtensionslocation,e.applicationExtensionslocationMtime,e.profile,e.profileScanOptions,e.type,e.validate,e.productVersion,e.productDate,e.productCommit,e.devMode,e.language,e.translations);return this.scanExtension(n)}));return Dt(r).sort((s,n)=>s.location.path<n.location.path?-1:1)}async scanExtensionsFromProfile(e){let i=await this.scanExtensionsFromProfileResource(e.location,()=>!0,e);if(e.applicationExtensionslocation&&!this.uriIdentityService.extUri.isEqual(e.location,e.applicationExtensionslocation)){i=i.filter(s=>!s.metadata?.isApplicationScoped);const r=await this.scanExtensionsFromProfileResource(e.applicationExtensionslocation,s=>!!s.metadata?.isBuiltin||!!s.metadata?.isApplicationScoped,e);i.push(...r)}return i}async scanExtensionsFromProfileResource(e,i,r){const s=await this.extensionsProfileScannerService.scanProfileExtensions(e,r.profileScanOptions);if(!s.length)return[];const n=await Promise.all(s.map(async o=>{if(i(o)){const a=new xa(o.location,r.mtime,r.applicationExtensionslocation,r.applicationExtensionslocationMtime,r.profile,r.profileScanOptions,r.type,r.validate,r.productVersion,r.productDate,r.productCommit,r.devMode,r.language,r.translations);return this.scanExtension(a,o)}return null}));return Dt(n)}async scanOneOrMultipleExtensions(e){try{if(await this.fileService.exists(pe(e.location,"package.json"))){const i=await this.scanExtension(e);return i?[i]:[]}else return await this.scanExtensions(e)}catch(i){return this.logService.error(`Error scanning extensions at ${e.location.path}:`,$i(i)),[]}}async scanExtension(e,i){const r=[];let s=!0,n;try{n=await this.scanExtensionManifest(e.location)}catch(f){if(i){r.push([De.Error,$i(f)]),s=!1;const[p,v]=i.identifier.id.split(".");n={name:v,publisher:p,version:i.version,engines:{vscode:""}}}else return e.type!==0&&this.logService.error(f),null}n.publisher||(n.publisher=kv);let o;i?o={...i.metadata,size:n.__metadata?.size}:n.__metadata&&(o={installedTimestamp:n.__metadata.installedTimestamp,size:n.__metadata.size,targetPlatform:n.__metadata.targetPlatform}),delete n.__metadata;const a=nT(n.publisher,n.name),c=o?.id?{id:a,uuid:o.id}:{id:a},l=o?.isSystem?0:e.type,u=l===0||!!o?.isBuiltin;try{n=await this.translateManifest(e.location,n,xa.createNlsConfiguration(e))}catch(f){this.logService.warn("Failed to translate manifest",$i(f))}let d={type:l,identifier:c,manifest:n,location:e.location,isBuiltin:u,targetPlatform:o?.targetPlatform??"undefined",publisherDisplayName:o?.publisherDisplayName,metadata:o,isValid:s,validations:r,preRelease:!!o?.preRelease};return e.validate&&(d=this.validate(d,e)),n.enabledApiProposals&&(!this.environmentService.isBuilt||this.extensionsEnabledWithApiProposalVersion.includes(a.toLowerCase()))&&(n.originalEnabledApiProposals=n.enabledApiProposals,n.enabledApiProposals=tT([...n.enabledApiProposals])),d}validate(e,i){let r=e.isValid;const s=this.environmentService.isBuilt&&this.extensionsEnabledWithApiProposalVersion.includes(e.identifier.id.toLowerCase()),n=KT(i.productVersion,i.productDate,i.location,e.manifest,e.isBuiltin,s);for(const[o,a]of n)o===De.Error&&(r=!1,this.logService.error(this.formatMessage(i.location,a)));return e.isValid=r,e.validations=[...e.validations,...n],e}async scanExtensionManifest(e){const i=pe(e,"package.json");let r;try{r=(await this.fileService.readFile(i)).value.toString()}catch(n){throw jr(n)!==1&&this.logService.error(this.formatMessage(e,w(1965,null,i.path,n.message))),n}let s;try{s=JSON.parse(r)}catch(n){const o=[];jn(r,o);for(const a of o)this.logService.error(this.formatMessage(e,w(1966,null,i.path,a.offset,a.length,xv(a.error))));throw n}if(ia(s)!=="object"){const n=this.formatMessage(e,w(1967,null,i.path));throw this.logService.error(n),new Error(n)}return s}async translateManifest(e,i,r){const s=await this.getLocalizedMessages(e,i,r);if(s)try{const n=[],o=await this.resolveOriginalMessageBundle(s.default,n);if(n.length>0)return n.forEach(c=>{this.logService.error(this.formatMessage(e,w(1968,null,s.default?.path,xv(c.error))))}),i;if(ia(s)!=="object")return this.logService.error(this.formatMessage(e,w(1969,null,s.default?.path))),i;const a=s.values||Object.create(null);return ZT(this.logService,i,a,o)}catch{}return i}async getLocalizedMessages(e,i,r){const s=pe(e,"package.nls.json"),n=(l,u)=>{u.forEach(d=>{this.logService.error(this.formatMessage(e,w(1970,null,l?.path,xv(d.error))))})},o=l=>{this.logService.error(this.formatMessage(e,w(1971,null,l?.path)))},a=`${i.publisher}.${i.name}`,c=r.translations[a];if(c)try{const l=x.file(c),u=(await this.fileService.readFile(l)).value.toString(),d=[],f=jn(u,d);return d.length>0?(n(l,d),{values:void 0,default:s}):ia(f)!=="object"?(o(l),{values:void 0,default:s}):{values:f.contents?f.contents.package:void 0,default:s}}catch{return{values:void 0,default:s}}else{if(!await this.fileService.exists(s))return;let u;try{u=await this.findMessageBundles(e,r)}catch{return}if(!u.localized)return{values:void 0,default:u.original};try{const d=(await this.fileService.readFile(u.localized)).value.toString(),f=[],p=jn(d,f);return f.length>0?(n(u.localized,f),{values:void 0,default:u.original}):ia(p)!=="object"?(o(u.localized),{values:void 0,default:u.original}):{values:p,default:u.original}}catch{return{values:void 0,default:u.original}}}}async resolveOriginalMessageBundle(e,i){if(e)try{const r=(await this.fileService.readFile(e)).value.toString();return jn(r,i)}catch{}}findMessageBundles(e,i){return new Promise((r,s)=>{const n=o=>{const a=pe(e,`package.nls.${o}.json`);this.fileService.exists(a).then(c=>{c&&r({localized:a,original:pe(e,"package.nls.json")});const l=o.lastIndexOf("-");l===-1?r({localized:pe(e,"package.nls.json"),original:null}):(o=o.substring(0,l),n(o))})};if(i.devMode||i.pseudo||!i.language)return r({localized:pe(e,"package.nls.json"),original:null});n(i.language)})}formatMessage(e,i){return`[${e.path}]: ${i}`}},Fl=__decorate([__param(0,Pa),__param(1,Mi),__param(2,mt),__param(3,qe),__param(4,or),__param(5,V)],Fl),Nl=class extends Fl{constructor(e,i,r,s,n,o,a,c){super(r,s,n,o,a,c),this.currentProfile=e,this.userDataProfilesService=i,this.cacheValidatorThrottler=this._register(new ws(3e3)),this._onDidChangeCache=this._register(new D),this.onDidChangeCache=this._onDidChangeCache.event}async scanExtensions(e){const i=this.getCacheFile(e),r=await this.readExtensionCache(i);if(this.input=e,r&&r.input&&xa.equals(r.input,this.input))return this.logService.debug("Using cached extensions scan result",e.type===0?"system":"user",e.location.toString()),this.cacheValidatorThrottler.trigger(()=>this.validateCache()),r.result.map(n=>(n.location=x.revive(n.location),n));const s=await super.scanExtensions(e);return await this.writeExtensionCache(i,{input:e,result:s}),s}async readExtensionCache(e){try{const i=await this.fileService.readFile(e),r=JSON.parse(i.value.toString());return{result:r.result,input:zs(r.input)}}catch(i){this.logService.debug("Error while reading the extension cache file:",e.path,$i(i))}return null}async writeExtensionCache(e,i){try{await this.fileService.writeFile(e,Y.fromString(JSON.stringify(i)))}catch(r){this.logService.debug("Error while writing the extension cache file:",e.path,$i(r))}}async validateCache(){if(!this.input)return;const e=this.getCacheFile(this.input),i=await this.readExtensionCache(e);if(!i)return;const r=i.result,s=JSON.parse(JSON.stringify(await super.scanExtensions(this.input)));if(!Kr(s,r))try{this.logService.info("Invalidating Cache",r,s),await this.fileService.del(e),this._onDidChangeCache.fire()}catch(n){this.logService.error(n)}}getCacheFile(e){const i=this.getProfile(e);return this.uriIdentityService.extUri.joinPath(i.cacheHome,e.type===0?l6:c6)}getProfile(e){return e.type===0?this.userDataProfilesService.defaultProfile:e.profile?this.uriIdentityService.extUri.isEqual(e.location,this.currentProfile.extensionsResource)?this.currentProfile:this.userDataProfilesService.profiles.find(i=>this.uriIdentityService.extUri.isEqual(e.location,i.extensionsResource))??this.currentProfile:this.userDataProfilesService.defaultProfile}},Nl=__decorate([__param(1,qr),__param(2,Pa),__param(3,Mi),__param(4,mt),__param(5,qe),__param(6,or),__param(7,V)],Nl),P6=class extends df{constructor(t,e,i,r,s,n,o,a,c,l,u,d){super(t,e,pe(i,".cursor-dev","extensions","control.json"),r,s,n,o,a,c,l,u,d),this.translationsPromise=(async()=>{if(ug)try{const f=await this.fileService.readFile(x.file(ug));return JSON.parse(f.value.toString())}catch{}return Object.create(null)})()}getTranslations(t){return this.translationsPromise}}}}),hf,iW=g({"out-build/vs/platform/extensionManagement/node/extensionsScannerService.js"(){"use strict";re(),xi(),uf(),x6(),Ze(),G(),K(),lt(),Vr(),zr(),hf=class extends P6{constructor(e,i,r,s,n,o,a,c){super(x.file(n.builtinExtensionsPath),x.file(n.extensionsPath),n.userHome,e.defaultProfile,e,i,r,s,n,o,a,c)}},hf=__decorate([__param(0,qr),__param(1,Pa),__param(2,mt),__param(3,V),__param(4,$r),__param(5,qe),__param(6,Mi),__param(7,Or)],hf)}}),ff,rW=g({"out-build/vs/platform/userDataProfile/electron-main/userDataProfilesHandler.js"(){"use strict";L(),ft(),$n(),hi(),ae(),ut(),ff=class extends N{constructor(e,i,r){super(),this.userDataProfilesService=i,this.windowsMainService=r,this._register(e.onWillLoadWindow(s=>{s.reason===2&&this.unsetProfileForWorkspace(s.window)})),this._register(e.onBeforeCloseWindow(s=>this.unsetProfileForWorkspace(s))),this._register(new br(()=>this.cleanUpEmptyWindowAssociations(),30*1e3)).schedule()}async unsetProfileForWorkspace(e){const i=this.getWorkspace(e),r=this.userDataProfilesService.getProfileForWorkspace(i);r?.isTransient&&(this.userDataProfilesService.unsetWorkspace(i,r.isTransient),r.isTransient&&await this.userDataProfilesService.cleanUpTransientProfiles())}getWorkspace(e){return e.openedWorkspace??Ld(e.backupPath,e.isExtensionDevelopmentHost)}cleanUpEmptyWindowAssociations(){const e=this.userDataProfilesService.getAssociatedEmptyWindows();if(e.length===0)return;const i=this.windowsMainService.getWindows().map(r=>this.getWorkspace(r));for(const r of e)i.some(s=>s.id===r.id)||this.userDataProfilesService.unsetWorkspace(r,!1)}},ff=__decorate([__param(0,ze),__param(1,Gr),__param(2,ot)],ff)}}),C6,sW=g({"out-build/vs/platform/userDataProfile/electron-main/userDataProfileStorageIpc.js"(){"use strict";q(),L(),Gm(),C6=class extends N{constructor(t,e,i){super(),this.storageMainService=t,this.userDataProfilesService=e,this.logService=i;const r=this._register(new $s);this._onDidChange=this._register(new D({onWillAddFirstListener:()=>r.value=this.registerStorageChangeListeners(),onDidRemoveLastListener:()=>r.value=void 0}))}registerStorageChangeListeners(){this.logService.debug("ProfileStorageChangesListenerChannel#registerStorageChangeListeners");const t=new ke;return t.add(P.debounce(this.storageMainService.applicationStorage.onDidChangeStorage,(e,i)=>(e?e.push(i.key):e=[i.key],e),100)(e=>this.onDidChangeApplicationStorage(e))),t.add(P.debounce(this.storageMainService.onDidChangeProfileStorage,(e,i)=>{e||(e=new Map);let r=e.get(i.profile.id);return r||e.set(i.profile.id,r={profile:i.profile,keys:[],storage:i.storage}),r.keys.push(i.key),e},100)(e=>this.onDidChangeProfileStorage(e))),t}onDidChangeApplicationStorage(t){const e=t.includes(Ps)?[this.userDataProfilesService.defaultProfile]:[],i=[];if(t=t.filter(r=>r!==Ps),t.length){const r=qm(this.storageMainService.applicationStorage.storage);i.push({profile:this.userDataProfilesService.defaultProfile,changes:t.map(s=>({key:s,scope:0,target:r[s]}))})}this.triggerEvents(e,i)}onDidChangeProfileStorage(t){const e=[],i=new Map;for(const[r,s]of t.entries()){s.keys.includes(Ps)&&e.push(s.profile);const n=s.keys.filter(o=>o!==Ps);if(n.length){const o=qm(s.storage.storage);i.set(r,{profile:s.profile,changes:n.map(a=>({key:a,scope:0,target:o[a]}))})}}this.triggerEvents(e,[...i.values()])}triggerEvents(t,e){(t.length||e.length)&&this._onDidChange.fire({valueChanges:e,targetChanges:t})}listen(t,e,i){switch(e){case"onDidChange":return this._onDidChange.event}throw new Error(`[ProfileStorageChangesListenerChannel] Event not found: ${e}`)}async call(t,e){throw new Error(`Call not found: ${e}`)}}}});async function nW(t,e){let i=t.getItem(Qm);return(typeof i!="string"||O&&i==="6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead")&&(i=await nA(e.error.bind(e))),i}async function oW(t,e){let i=t.getItem(Xm);return typeof i!="string"&&(i=await t5(e.error.bind(e))),i}async function aW(t,e){let i=t.getItem(Zm);return typeof i!="string"&&(i=await cA(e.error.bind(e))),i}async function I6(t,e){let i=t.getItem(Ud);return typeof i!="string"&&(i=await r5(e.error.bind(e))),i}var cW=g({"out-build/vs/platform/telemetry/node/telemetryUtils.js"(){"use strict";z(),ll(),ti()}});async function lW(t,e){const i=await nW(t,e);return t.setItem(Qm,i),i}async function uW(t,e){const i=await oW(t,e);return t.setItem(Xm,i),i}async function dW(t,e){const i=await aW(t,e);return t.setItem(Zm,i),i}async function hW(t,e){const i=await I6(t,e);return t.setItem(Ud,i),i}async function fW(t,e){const i=await r5(e.error.bind(e)),r=await I6(t,e);i!==r&&t.setItem(Ud,i)}var pW=g({"out-build/vs/platform/telemetry/electron-main/telemetryUtils.js"(){"use strict";ti(),cW(),ll()}}),pf,gW=g({"out-build/vs/platform/extensionManagement/node/extensionsProfileScannerService.js"(){"use strict";K(),zr(),Vr(),uf(),Ze(),xi(),re(),pf=class extends lf{constructor(e,i,r,s,n){super(x.file(e.extensionsPath),i,r,s,n)}},pf=__decorate([__param(0,$r),__param(1,mt),__param(2,qr),__param(3,Mi),__param(4,V)],pf)}}),D6,mW=g({"out-build/vs/platform/log/electron-main/logIpc.js"(){"use strict";ai(),re(),K(),D6=class{constructor(t){this.loggerService=t,this.loggers=new Bt}listen(t,e,i){switch(e){case"onDidChangeLoggers":return i?this.loggerService.getOnDidChangeLoggersEvent(i):this.loggerService.onDidChangeLoggers;case"onDidChangeLogLevel":return i?this.loggerService.getOnDidChangeLogLevelEvent(i):this.loggerService.onDidChangeLogLevel;case"onDidChangeVisibility":return i?this.loggerService.getOnDidChangeVisibilityEvent(i):this.loggerService.onDidChangeVisibility}throw new Error(`Event not found: ${e}`)}async call(t,e,i){switch(e){case"createLogger":this.createLogger(x.revive(i[0]),i[1],i[2]);return;case"log":return this.log(x.revive(i[0]),i[1]);case"consoleLog":return this.consoleLog(i[0],i[1]);case"setLogLevel":return Rb(i[0])?this.loggerService.setLogLevel(i[0]):this.loggerService.setLogLevel(x.revive(i[0]),i[1]);case"setVisibility":return this.loggerService.setVisibility(x.revive(i[0]),i[1]);case"registerLogger":return this.loggerService.registerLogger({...i[0],resource:x.revive(i[0].resource)},i[1]);case"deregisterLogger":return this.loggerService.deregisterLogger(x.revive(i[0]))}throw new Error(`Call not found: ${e}`)}createLogger(t,e,i){this.loggers.set(t,this.loggerService.createLogger(t,e,i))}consoleLog(t,e){let i=console.log;switch(t){case X.Error:i=console.error;break;case X.Warning:i=console.warn;break;case X.Info:i=console.info;break}i.call(console,...e)}log(t,e){const i=this.loggers.get(t);if(!i)throw new Error("Create the logger before logging");for(const[r,s]of e)Pm(i,r,s)}}}}),Rv,gf,mf,vW=g({"out-build/vs/platform/utilityProcess/electron-main/utilityProcessWorkerMainService.js"(){"use strict";L(),G(),K(),ut(),oa(),ti(),_s(),q(),ae(),ft(),Rv=j("utilityProcessWorker"),gf=class extends N{constructor(e,i,r,s){super(),this.logService=e,this.windowsMainService=i,this.telemetryService=r,this.lifecycleMainService=s,this.workers=new Map}async createWorker(e){const i=`window: ${e.reply.windowId}, moduleId: ${e.process.moduleId}`;this.logService.trace(`[UtilityProcessWorker]: createWorker(${i})`);const r=this.hash(e);this.workers.has(r)&&(this.logService.warn(`[UtilityProcessWorker]: createWorker() found an existing worker that will be terminated (${i})`),this.disposeWorker(e));const s=new mf(this.logService,this.windowsMainService,this.telemetryService,this.lifecycleMainService,e);if(!s.spawn())return{reason:{code:1,signal:"EINVALID"}};this.workers.set(r,s);const n=new ys;return P.once(s.onDidTerminate)(o=>{o.code===0?this.logService.trace(`[UtilityProcessWorker]: terminated normally with code ${o.code}, signal: ${o.signal}`):this.logService.error(`[UtilityProcessWorker]: terminated unexpectedly with code ${o.code}, signal: ${o.signal}`),this.workers.delete(r),n.complete({reason:o})}),n.p}hash(e){return Ur({moduleId:e.process.moduleId,windowId:e.reply.windowId})}async disposeWorker(e){const i=this.hash(e),r=this.workers.get(i);r&&(this.logService.trace(`[UtilityProcessWorker]: disposeWorker(window: ${e.reply.windowId}, moduleId: ${e.process.moduleId})`),r.kill(),r.dispose(),this.workers.delete(i))}},gf=__decorate([__param(0,V),__param(1,ot),__param(2,ei),__param(3,ze)],gf),mf=class extends N{constructor(e,i,r,s,n){super(),this.windowsMainService=i,this.configuration=n,this._onDidTerminate=this._register(new D),this.onDidTerminate=this._onDidTerminate.event,this.utilityProcess=this._register(new ol(e,i,r,s)),this.registerListeners()}registerListeners(){this._register(this.utilityProcess.onExit(e=>this._onDidTerminate.fire({code:e.code,signal:e.signal}))),this._register(this.utilityProcess.onCrash(e=>this._onDidTerminate.fire({code:e.code,signal:"ECRASH"})))}spawn(){const i=this.windowsMainService.getWindowById(this.configuration.reply.windowId)?.win?.webContents.getOSProcessId();return this.utilityProcess.start({processTitle:`${this.configuration.process.type} [${this.configuration.reply.windowId}]`,type:this.configuration.process.type,entryPoint:this.configuration.process.moduleId,parentLifecycleBound:i,windowLifecycleBound:!0,correlationId:`${this.configuration.reply.windowId}`,responseWindowId:this.configuration.reply.windowId,responseChannel:this.configuration.reply.channel,responseNonce:this.configuration.reply.nonce})}kill(){this.utilityProcess.kill()}},mf=__decorate([__param(0,V),__param(1,ot),__param(2,ei),__param(3,ze)],mf)}}),A6,wW=g({"out-build/vs/platform/utilityProcess/common/utilityProcessWorkerService.js"(){"use strict";A6="utilityProcessWorker"}}),yW,R6,M6,T6,W6,L6,O6,Ca,F6,SW,Wi,N6,U6,$6,B6,j6,H6,V6,q6,z6,Mv,_W,G6=g({"out-build/vs/platform/terminal/common/terminal.js"(){"use strict";G(),Ab(),ms(),yW=new km("terminalTabFocusMode",!1,!0),(function(t){t.AutomationProfile="terminal.integrated.automationProfile.",t.DefaultProfile="terminal.integrated.defaultProfile.",t.Profiles="terminal.integrated.profiles."})(R6||(R6={})),(function(t){t.SendKeybindingsToShell="terminal.integrated.sendKeybindingsToShell",t.AutomationProfileLinux="terminal.integrated.automationProfile.linux",t.AutomationProfileMacOs="terminal.integrated.automationProfile.osx",t.AutomationProfileWindows="terminal.integrated.automationProfile.windows",t.ProfilesWindows="terminal.integrated.profiles.windows",t.ProfilesMacOs="terminal.integrated.profiles.osx",t.ProfilesLinux="terminal.integrated.profiles.linux",t.DefaultProfileLinux="terminal.integrated.defaultProfile.linux",t.DefaultProfileMacOs="terminal.integrated.defaultProfile.osx",t.DefaultProfileWindows="terminal.integrated.defaultProfile.windows",t.UseWslProfiles="terminal.integrated.useWslProfiles",t.TabsDefaultColor="terminal.integrated.tabs.defaultColor",t.TabsDefaultIcon="terminal.integrated.tabs.defaultIcon",t.TabsEnabled="terminal.integrated.tabs.enabled",t.TabsEnableAnimation="terminal.integrated.tabs.enableAnimation",t.TabsHideCondition="terminal.integrated.tabs.hideCondition",t.TabsShowActiveTerminal="terminal.integrated.tabs.showActiveTerminal",t.TabsShowActions="terminal.integrated.tabs.showActions",t.TabsLocation="terminal.integrated.tabs.location",t.TabsFocusMode="terminal.integrated.tabs.focusMode",t.MacOptionIsMeta="terminal.integrated.macOptionIsMeta",t.MacOptionClickForcesSelection="terminal.integrated.macOptionClickForcesSelection",t.AltClickMovesCursor="terminal.integrated.altClickMovesCursor",t.CopyOnSelection="terminal.integrated.copyOnSelection",t.EnableMultiLinePasteWarning="terminal.integrated.enableMultiLinePasteWarning",t.DrawBoldTextInBrightColors="terminal.integrated.drawBoldTextInBrightColors",t.FontFamily="terminal.integrated.fontFamily",t.FontSize="terminal.integrated.fontSize",t.LetterSpacing="terminal.integrated.letterSpacing",t.LineHeight="terminal.integrated.lineHeight",t.MinimumContrastRatio="terminal.integrated.minimumContrastRatio",t.TabStopWidth="terminal.integrated.tabStopWidth",t.FastScrollSensitivity="terminal.integrated.fastScrollSensitivity",t.MouseWheelScrollSensitivity="terminal.integrated.mouseWheelScrollSensitivity",t.BellDuration="terminal.integrated.bellDuration",t.FontWeight="terminal.integrated.fontWeight",t.FontWeightBold="terminal.integrated.fontWeightBold",t.CursorBlinking="terminal.integrated.cursorBlinking",t.CursorStyle="terminal.integrated.cursorStyle",t.CursorStyleInactive="terminal.integrated.cursorStyleInactive",t.CursorWidth="terminal.integrated.cursorWidth",t.Scrollback="terminal.integrated.scrollback",t.DetectLocale="terminal.integrated.detectLocale",t.DefaultLocation="terminal.integrated.defaultLocation",t.GpuAcceleration="terminal.integrated.gpuAcceleration",t.TerminalTitleSeparator="terminal.integrated.tabs.separator",t.TerminalTitle="terminal.integrated.tabs.title",t.TerminalDescription="terminal.integrated.tabs.description",t.RightClickBehavior="terminal.integrated.rightClickBehavior",t.MiddleClickBehavior="terminal.integrated.middleClickBehavior",t.Cwd="terminal.integrated.cwd",t.ConfirmOnExit="terminal.integrated.confirmOnExit",t.ConfirmOnKill="terminal.integrated.confirmOnKill",t.EnableBell="terminal.integrated.enableBell",t.EnableVisualBell="terminal.integrated.enableVisualBell",t.CommandsToSkipShell="terminal.integrated.commandsToSkipShell",t.AllowChords="terminal.integrated.allowChords",t.AllowMnemonics="terminal.integrated.allowMnemonics",t.TabFocusMode="terminal.integrated.tabFocusMode",t.EnvMacOs="terminal.integrated.env.osx",t.EnvLinux="terminal.integrated.env.linux",t.EnvWindows="terminal.integrated.env.windows",t.EnvironmentChangesIndicator="terminal.integrated.environmentChangesIndicator",t.EnvironmentChangesRelaunch="terminal.integrated.environmentChangesRelaunch",t.ShowExitAlert="terminal.integrated.showExitAlert",t.SplitCwd="terminal.integrated.splitCwd",t.WindowsEnableConpty="terminal.integrated.windowsEnableConpty",t.WindowsUseConptyDll="terminal.integrated.windowsUseConptyDll",t.WordSeparators="terminal.integrated.wordSeparators",t.EnableFileLinks="terminal.integrated.enableFileLinks",t.AllowedLinkSchemes="terminal.integrated.allowedLinkSchemes",t.UnicodeVersion="terminal.integrated.unicodeVersion",t.EnablePersistentSessions="terminal.integrated.enablePersistentSessions",t.PersistentSessionReviveProcess="terminal.integrated.persistentSessionReviveProcess",t.HideOnStartup="terminal.integrated.hideOnStartup",t.HideOnLastClosed="terminal.integrated.hideOnLastClosed",t.CustomGlyphs="terminal.integrated.customGlyphs",t.RescaleOverlappingGlyphs="terminal.integrated.rescaleOverlappingGlyphs",t.PersistentSessionScrollback="terminal.integrated.persistentSessionScrollback",t.InheritEnv="terminal.integrated.inheritEnv",t.ShowLinkHover="terminal.integrated.showLinkHover",t.IgnoreProcessNames="terminal.integrated.ignoreProcessNames",t.ShellIntegrationEnabled="terminal.integrated.shellIntegration.enabled",t.ShellIntegrationShowWelcome="terminal.integrated.shellIntegration.showWelcome",t.ShellIntegrationDecorationsEnabled="terminal.integrated.shellIntegration.decorationsEnabled",t.ShellIntegrationEnvironmentReporting="terminal.integrated.shellIntegration.environmentReporting",t.EnableImages="terminal.integrated.enableImages",t.SmoothScrolling="terminal.integrated.smoothScrolling",t.IgnoreBracketedPasteMode="terminal.integrated.ignoreBracketedPasteMode",t.FocusAfterRun="terminal.integrated.focusAfterRun",t.FontLigaturesEnabled="terminal.integrated.fontLigatures.enabled",t.FontLigaturesFeatureSettings="terminal.integrated.fontLigatures.featureSettings",t.FontLigaturesFallbackLigatures="terminal.integrated.fontLigatures.fallbackLigatures",t.DeveloperPtyHostLatency="terminal.integrated.developer.ptyHost.latency",t.DeveloperPtyHostStartupDelay="terminal.integrated.developer.ptyHost.startupDelay",t.DevMode="terminal.integrated.developer.devMode"})(M6||(M6={})),(function(t){t.Bash="bash",t.Fish="fish",t.Sh="sh",t.Csh="csh",t.Ksh="ksh",t.Zsh="zsh"})(T6||(T6={})),(function(t){t.CommandPrompt="cmd",t.Wsl="wsl",t.GitBash="gitbash"})(W6||(W6={})),(function(t){t.PowerShell="pwsh",t.Python="python",t.Julia="julia",t.NuShell="nu",t.Node="node"})(L6||(L6={})),(function(t){t[t.Api=0]="Api",t[t.Process=1]="Process",t[t.Sequence=2]="Sequence",t[t.Config=3]="Config"})(O6||(O6={})),(function(t){t.LocalPty="localPty",t.PtyHost="ptyHost",t.PtyHostWindow="ptyHostWindow",t.Logger="logger",t.Heartbeat="heartbeat"})(Ca||(Ca={})),(function(t){t.Cwd="cwd",t.InitialCwd="initialCwd",t.FixedDimensions="fixedDimensions",t.Title="title",t.ShellType="shellType",t.HasChildProcesses="hasChildProcesses",t.ResolvedShellLaunchConfig="resolvedShellLaunchConfig",t.OverrideDimensions="overrideDimensions",t.FailedShellIntegrationActivation="failedShellIntegrationActivation",t.UsedShellIntegrationInjection="usedShellIntegrationInjection"})(F6||(F6={})),SW=j("ptyService"),(function(t){t[t.BeatInterval=5e3]="BeatInterval",t[t.ConnectingBeatInterval=2e4]="ConnectingBeatInterval",t[t.FirstWaitMultiplier=1.2]="FirstWaitMultiplier",t[t.SecondWaitMultiplier=1]="SecondWaitMultiplier",t[t.CreateProcessTimeout=5e3]="CreateProcessTimeout"})(Wi||(Wi={})),(function(t){t[t.Panel=1]="Panel",t[t.Editor=2]="Editor"})(N6||(N6={})),(function(t){t.TerminalView="view",t.Editor="editor"})(U6||(U6={})),(function(t){t[t.GraceTime=6e4]="GraceTime",t[t.ShortGraceTime=6e3]="ShortGraceTime"})($6||($6={})),(function(t){t[t.HighWatermarkChars=1e5]="HighWatermarkChars",t[t.LowWatermarkChars=5e3]="LowWatermarkChars",t[t.CharCountAckSize=5e3]="CharCountAckSize"})(B6||(B6={})),(function(t){t.GitBash="Git Bash",t.Pwsh="PowerShell"})(j6||(j6={})),(function(t){t[t.Off=0]="Off",t[t.FinalTerm=1]="FinalTerm",t[t.VSCode=2]="VSCode"})(H6||(H6={})),(function(t){t[t.Unknown=0]="Unknown",t[t.Shutdown=1]="Shutdown",t[t.Process=2]="Process",t[t.User=3]="User",t[t.Extension=4]="Extension"})(V6||(V6={})),q6={Backend:"workbench.contributions.terminal.processBackend"},z6=class{constructor(){this._backends=new Map}get backends(){return this._backends}registerTerminalBackend(t){const e=this._sanitizeRemoteAuthority(t.remoteAuthority);if(this._backends.has(e))throw new Error(`A terminal backend with remote authority '${e}' was already registered.`);this._backends.set(e,t)}getTerminalBackend(t){return this._backends.get(this._sanitizeRemoteAuthority(t))}_sanitizeRemoteAuthority(t){return t?.toLowerCase()??""}},Ei.add(q6.Backend,new z6),Mv=j("localPtyService"),_W=j("terminalLogService")}}),vf,bW=g({"out-build/vs/platform/terminal/electron-main/electronPtyHostStarter.js"(){"use strict";ct(),vm(),ft(),K(),Zn(),oa(),rb(),nr(),L(),q(),ur(),Xe(),Ie(),vf=class extends N{constructor(e,i,r,s,n){super(),this._reconnectConstants=e,this._configurationService=i,this._environmentMainService=r,this._lifecycleMainService=s,this._logService=n,this.utilityProcess=void 0,this._onRequestConnection=new D,this.onRequestConnection=this._onRequestConnection.event,this._onWillShutdown=new D,this.onWillShutdown=this._onWillShutdown.event,this._register(this._lifecycleMainService.onWillShutdown(()=>this._onWillShutdown.fire())),We.on("vscode:createPtyHostMessageChannel",(o,a)=>this._onWindowConnection(o,a)),this._register(me(()=>{We.removeHandler("vscode:createPtyHostMessageChannel")}))}start(){this.utilityProcess=new sn(this._logService,Al,this._lifecycleMainService);const e=YI(this._environmentMainService.args,this._environmentMainService.isBuilt),i=e.port?["--nolazy",`--inspect${e.break?"-brk":""}=${e.port}`]:void 0;this.utilityProcess.start({processTitle:"terminal pty-host",type:"ptyHost",entryPoint:"vs/platform/terminal/node/ptyHostMain",execArgv:i,args:["--logsPath",this._environmentMainService.logsHome.with({scheme:T.file}).fsPath],env:this._createPtyHostConfiguration()});const r=this.utilityProcess.connect(),s=new hm(r,"ptyHost"),n=new ke;return n.add(s),n.add(me(()=>{this.utilityProcess?.kill(),this.utilityProcess?.dispose(),this.utilityProcess=void 0})),{client:s,store:n,onDidProcessExit:this.utilityProcess.onExit}}_createPtyHostConfiguration(){this._environmentMainService.unsetSnapExportedVariables();const e={...lr(process.env),VSCODE_ESM_ENTRYPOINT:"vs/platform/terminal/node/ptyHostMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true",VSCODE_RECONNECT_GRACE_TIME:String(this._reconnectConstants.graceTime),VSCODE_RECONNECT_SHORT_GRACE_TIME:String(this._reconnectConstants.shortGraceTime),VSCODE_RECONNECT_SCROLLBACK:String(this._reconnectConstants.scrollback)},i=this._configurationService.getValue("terminal.integrated.developer.ptyHost.latency");i&&typeof i=="number"&&(e.VSCODE_LATENCY=String(i));const r=this._configurationService.getValue("terminal.integrated.developer.ptyHost.startupDelay");return r&&typeof r=="number"&&(e.VSCODE_STARTUP_DELAY=String(r)),this._environmentMainService.restoreSnapExportedVariables(),e}_onWindowConnection(e,i){this._onRequestConnection.fire();const r=this.utilityProcess.connect();if(e.sender.isDestroyed()){r.close();return}e.sender.postMessage("vscode:createPtyHostMessageChannelResult",i,[r])}},vf=__decorate([__param(1,Qe),__param(2,st),__param(3,ze),__param(4,V)],vf)}}),K6,EW=g({"out-build/vs/platform/log/common/logIpc.js"(){"use strict";re(),q(),K(),L(),K6=class extends N{constructor(t,e){super(),e.call("setLogLevel",[t.getLogLevel()]),this._register(t.onDidChangeLogLevel(i=>e.call("setLogLevel",[i]))),e.call("getRegisteredLoggers").then(i=>{for(const r of i)t.registerLogger({...r,resource:x.revive(r.resource)})}),this._register(e.listen("onDidChangeVisibility")(([i,r])=>t.setVisibility(x.revive(i),r))),this._register(e.listen("onDidChangeLoggers")(({added:i,removed:r})=>{for(const s of i)t.registerLogger({...s,resource:x.revive(s.resource)});for(const s of r)t.deregisterLogger(s.resource)}))}}}}),wf,kW=g({"out-build/vs/platform/terminal/common/requestStore.js"(){"use strict";ae(),St(),q(),L(),K(),wf=class extends N{constructor(e,i){super(),this._logService=i,this._lastRequestId=0,this._pendingRequests=new Map,this._pendingRequestDisposables=new Map,this._onCreateRequest=this._register(new D),this.onCreateRequest=this._onCreateRequest.event,this._timeout=e===void 0?15e3:e,this._register(me(()=>{for(const r of this._pendingRequestDisposables.values())Rt(r)}))}createRequest(e){return new Promise((i,r)=>{const s=++this._lastRequestId;this._pendingRequests.set(s,i),this._onCreateRequest.fire({requestId:s,...e});const n=new Sr;Pi(this._timeout,n.token).then(()=>r(`Request ${s} timed out (${this._timeout}ms)`)),this._pendingRequestDisposables.set(s,[me(()=>n.cancel())])})}acceptReply(e,i){const r=this._pendingRequests.get(e);r?(this._pendingRequests.delete(e),Rt(this._pendingRequestDisposables.get(e)||[]),this._pendingRequestDisposables.delete(e),r(i)):this._logService.warn(`RequestStore#acceptReply was called without receiving a matching request ${e}`)}},wf=__decorate([__param(1,V)],wf)}});function PW(t,e){const i=[{name:null,description:w(2271,null)}];return i.push(...t.map(r=>({name:r.profileName,description:xW(r)}))),e&&i.push(...e.map(r=>({name:r.title,description:CW(r)}))),{values:i.map(r=>r.name),markdownDescriptions:i.map(r=>r.description)}}function xW(t){let e=`$(${Ml.isThemeIcon(t.icon)?t.icon.id:t.icon?t.icon:Ti.terminal.id}) ${t.profileName}
|
|
- path: ${t.path}`;return t.args&&(typeof t.args=="string"?e+=`
|
|
- args: "${t.args}"`:e+=`
|
|
- args: [${t.args.length===0?"":`'${t.args.join("','")}'`}]`),t.overrideName!==void 0&&(e+=`
|
|
- overrideName: ${t.overrideName}`),t.color&&(e+=`
|
|
- color: ${t.color}`),t.env&&(e+=`
|
|
- env: ${JSON.stringify(t.env)}`),e}function CW(t){return`$(${Ml.isThemeIcon(t.icon)?t.icon.id:t.icon?t.icon:Ti.terminal.id}) ${t.title}
|
|
- extensionIdentifier: ${t.extensionIdentifier}`}var IW=g({"out-build/vs/platform/terminal/common/terminalProfiles.js"(){"use strict";tf(),re(),we(),i6()}});function Tv(t){const e=t===2?"linux":t===1?"osx":"windows";return w(2247,null,ry(t),'```json\n"terminal.integrated.profile.'+e+'": {\n "bash": null\n}\n```',"[","](https://code.visualstudio.com/docs/terminal/profiles)")}function DW(){Ei.as(ir.Configuration).registerConfiguration(Q6),AW()}function AW(t,e){const i=Ei.as(ir.Configuration);let r;t&&(r=PW(t?.profiles,e));const s=Wv;Wv={id:"terminal",order:100,title:w(2267,null),type:"object",properties:{"terminal.integrated.defaultProfile.linux":{restricted:!0,markdownDescription:w(2268,null),type:["string","null"],default:null,enum:t?.os===3?r?.values:void 0,markdownEnumDescriptions:t?.os===3?r?.markdownDescriptions:void 0},"terminal.integrated.defaultProfile.osx":{restricted:!0,markdownDescription:w(2269,null),type:["string","null"],default:null,enum:t?.os===2?r?.values:void 0,markdownEnumDescriptions:t?.os===2?r?.markdownDescriptions:void 0},"terminal.integrated.defaultProfile.windows":{restricted:!0,markdownDescription:w(2270,null),type:["string","null"],default:null,enum:t?.os===1?r?.values:void 0,markdownEnumDescriptions:t?.os===1?r?.markdownDescriptions:void 0}}},i.updateConfigurations({add:[Wv],remove:s?[s]:[]})}var Y6,J6,io,yf,Sf,Q6,Wv,RW=g({"out-build/vs/platform/terminal/common/terminalPlatformConfiguration.js"(){"use strict";tf(),z(),we(),Cn(),ms(),IW(),Y6={type:["string","null"],enum:["terminal.ansiBlack","terminal.ansiRed","terminal.ansiGreen","terminal.ansiYellow","terminal.ansiBlue","terminal.ansiMagenta","terminal.ansiCyan","terminal.ansiWhite"],default:null},J6={type:"string",enum:Array.from(e6(),t=>t.id),markdownEnumDescriptions:Array.from(e6(),t=>`$(${t.id})`)},io={args:{description:w(2240,null),type:"array",items:{type:"string"}},overrideName:{description:w(2241,null),type:"boolean"},icon:{description:w(2242,null),...J6},color:{description:w(2243,null),...Y6},env:{markdownDescription:w(2244,null),type:"object",additionalProperties:{type:["string","null"]},default:{}}},yf={type:"object",required:["path"],properties:{path:{description:w(2245,null),type:["string","array"],items:{type:"string"}},...io}},Sf={type:"object",required:["path"],properties:{path:{description:w(2246,null),type:["string"],items:{type:"string"}},...io}},Q6={id:"terminal",order:100,title:w(2248,null),type:"object",properties:{"terminal.integrated.automationProfile.linux":{restricted:!0,markdownDescription:w(2249,null),type:["object","null"],default:null,anyOf:[{type:"null"},Sf],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.automationProfile.osx":{restricted:!0,markdownDescription:w(2250,null),type:["object","null"],default:null,anyOf:[{type:"null"},Sf],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.automationProfile.windows":{restricted:!0,markdownDescription:w(2251,null,"`terminal.integrated.automationShell.windows`"),type:["object","null"],default:null,anyOf:[{type:"null"},Sf],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.profiles.windows":{restricted:!0,markdownDescription:Tv(3),type:"object",default:{PowerShell:{source:"PowerShell",icon:"terminal-powershell"},"Command Prompt":{path:["${env:windir}\\Sysnative\\cmd.exe","${env:windir}\\System32\\cmd.exe"],args:[],icon:"terminal-cmd"},"Git Bash":{source:"Git Bash"}},additionalProperties:{anyOf:[{type:"object",required:["source"],properties:{source:{description:w(2252,null),enum:["PowerShell","Git Bash"]},...io}},{type:"object",required:["extensionIdentifier","id","title"],properties:{extensionIdentifier:{description:w(2253,null),type:"string"},id:{description:w(2254,null),type:"string"},title:{description:w(2255,null),type:"string"},...io}},{type:"null"},yf]}},"terminal.integrated.profiles.osx":{restricted:!0,markdownDescription:Tv(1),type:"object",default:{bash:{path:"bash",args:["-l"],icon:"terminal-bash"},zsh:{path:"zsh",args:["-l"]},fish:{path:"fish",args:["-l"]},tmux:{path:"tmux",icon:"terminal-tmux"},pwsh:{path:"pwsh",icon:"terminal-powershell"}},additionalProperties:{anyOf:[{type:"object",required:["extensionIdentifier","id","title"],properties:{extensionIdentifier:{description:w(2256,null),type:"string"},id:{description:w(2257,null),type:"string"},title:{description:w(2258,null),type:"string"},...io}},{type:"null"},yf]}},"terminal.integrated.profiles.linux":{restricted:!0,markdownDescription:Tv(2),type:"object",default:{bash:{path:"bash",icon:"terminal-bash"},zsh:{path:"zsh"},fish:{path:"fish"},tmux:{path:"tmux",icon:"terminal-tmux"},pwsh:{path:"pwsh",icon:"terminal-powershell"}},additionalProperties:{anyOf:[{type:"object",required:["extensionIdentifier","id","title"],properties:{extensionIdentifier:{description:w(2259,null),type:"string"},id:{description:w(2260,null),type:"string"},title:{description:w(2261,null),type:"string"},...io}},{type:"null"},yf]}},"terminal.integrated.useWslProfiles":{description:w(2262,null),type:"boolean",default:!0},"terminal.integrated.inheritEnv":{scope:1,description:w(2263,null),type:"boolean",default:!0},"terminal.integrated.persistentSessionScrollback":{scope:1,markdownDescription:w(2264,null),type:"number",default:100},"terminal.integrated.showLinkHover":{scope:1,description:w(2265,null),type:"boolean",default:!0},"terminal.integrated.ignoreProcessNames":{markdownDescription:w(2266,null,"`#terminal.integrated.confirmOnKill#`"),type:"array",items:{type:"string",uniqueItems:!0},default:["starship","oh-my-posh","bash","zsh"]}}}}}),Ul,X6=g({"out-build/vs/platform/terminal/common/environmentVariable.js"(){"use strict";(function(t){t[t.Replace=1]="Replace",t[t.Append=2]="Append",t[t.Prepend=3]="Prepend"})(Ul||(Ul={}))}}),MW=g({"out-build/vs/platform/terminal/common/environmentVariableShared.js"(){"use strict"}}),TW,WW=g({"out-build/vs/platform/terminal/common/environmentVariableCollection.js"(){"use strict";z(),X6(),TW=new Map([[Ul.Append,"APPEND"],[Ul.Prepend,"PREPEND"],[Ul.Replace,"REPLACE"]])}});import*as LW from"os";import"fs";import"util";function OW(){const t=/(\d+)\.(\d+)\.(\d+)/g.exec(LW.release());let e=0;return t&&t.length===4&&(e=parseInt(t[3])),e}var xr,Zr,FW=g({"out-build/vs/platform/terminal/node/terminalEnvironment.js"(){"use strict";Ie(),ye(),z(),Wr(),jt(),X6(),MW(),WW(),(function(t){t.WindowsPwsh="windows-pwsh",t.WindowsPwshLogin="windows-pwsh-login",t.Pwsh="pwsh",t.PwshLogin="pwsh-login",t.Zsh="zsh",t.ZshLogin="zsh-login",t.Bash="bash",t.Fish="fish",t.FishLogin="fish-login"})(xr||(xr={})),Zr=new Map,Zr.set(xr.WindowsPwsh,["-noexit","-command",'try { . "{0}\\out\\vs\\workbench\\contrib\\terminal\\common\\scripts\\shellIntegration.ps1" } catch {}{1}']),Zr.set(xr.WindowsPwshLogin,["-l","-noexit","-command",'try { . "{0}\\out\\vs\\workbench\\contrib\\terminal\\common\\scripts\\shellIntegration.ps1" } catch {}{1}']),Zr.set(xr.Pwsh,["-noexit","-command",'. "{0}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration.ps1"{1}']),Zr.set(xr.PwshLogin,["-l","-noexit","-command",'. "{0}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration.ps1"']),Zr.set(xr.Zsh,["-i"]),Zr.set(xr.ZshLogin,["-il"]),Zr.set(xr.Bash,["--init-file","{0}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh"]),Zr.set(xr.Fish,["--init-command",'source "{0}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration.fish"']),Zr.set(xr.FishLogin,["-l","--init-command",'source "{0}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration.fish"'])}});import*as NW from"fs";import*as UW from"child_process";import{dirname as $W,resolve as BW}from"path";function jW(t,e,i,r,s=process.env,n,o,a,c){return n=n||{existsFile:Vt.existsFile,readFile:NW.promises.readFile},B?HW(i,n,s,o,r.getValue("terminal.integrated.useWslProfiles")!==!1,t&&typeof t=="object"?{...t}:r.getValue("terminal.integrated.profiles.windows"),typeof e=="string"?e:r.getValue("terminal.integrated.defaultProfile.windows"),c,a):JW(n,o,i,t&&typeof t=="object"?{...t}:r.getValue(Pe?"terminal.integrated.profiles.linux":"terminal.integrated.profiles.osx"),typeof e=="string"?e:r.getValue(Pe?"terminal.integrated.defaultProfile.linux":"terminal.integrated.defaultProfile.osx"),c,a,s)}async function HW(t,e,i,r,s,n,o,a,c){const l=process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432"),u=`${process.env.windir}\\${l?"Sysnative":"System32"}`;let d=!1;OW()>=16299&&(d=!0),await qW(a);const f=new Map;if(t){f.set("PowerShell",{source:"PowerShell",icon:Ti.terminalPowershell,isAutoDetected:!0}),f.set("Windows PowerShell",{path:`${u}\\WindowsPowerShell\\v1.0\\powershell.exe`,icon:Ti.terminalPowershell,isAutoDetected:!0}),f.set("Git Bash",{source:"Git Bash",isAutoDetected:!0}),f.set("Command Prompt",{path:`${u}\\cmd.exe`,icon:Ti.terminalCmd,isAutoDetected:!0}),f.set("Cygwin",{path:[{path:`${process.env.HOMEDRIVE}\\cygwin64\\bin\\bash.exe`,isUnsafe:!0},{path:`${process.env.HOMEDRIVE}\\cygwin\\bin\\bash.exe`,isUnsafe:!0}],args:["--login"],isAutoDetected:!0}),f.set("bash (MSYS2)",{path:[{path:`${process.env.HOMEDRIVE}\\msys64\\usr\\bin\\bash.exe`,isUnsafe:!0}],args:["--login","-i"],env:{CHERE_INVOKING:"1"},icon:Ti.terminalBash,isAutoDetected:!0});const v=`${process.env.CMDER_ROOT||`${process.env.HOMEDRIVE}\\cmder`}\\vendor\\bin\\vscode_init.cmd`;f.set("Cmder",{path:`${u}\\cmd.exe`,args:["/K",v],requiresPath:process.env.CMDER_ROOT?v:{path:v,isUnsafe:!0},isAutoDetected:!0})}t9(n,f);const p=await Z6(f.entries(),o,e,i,r,c);if(t&&s)try{const v=await KW(`${u}\\${d?"wsl":"bash"}.exe`,o);for(const m of v)(!n||!(m.profileName in n))&&p.push(m)}catch{Lv&&(r?.trace("WSL is not installed, so could not detect WSL profiles"),Lv=!1)}return p}async function Z6(t,e,i,r=process.env,s,n){const o=[];for(const[a,c]of t)o.push(VW(a,c,e,i,r,s,n));return(await Promise.all(o)).filter(a=>!!a)}async function VW(t,e,i,r,s=process.env,n,o){if(e===null)return;let a,c,l;if("source"in e&&!("path"in e)){const p=$l?.get(e.source);if(!p)return;a=p.paths,c=e.args||p.args,e.icon?l=e9(e.icon):p.icon&&(l=p.icon)}else a=Array.isArray(e.path)?e.path:[e.path],c=B||Array.isArray(e.args)?e.args:void 0,l=e9(e.icon);let u;if(o){const p=a.map(m=>typeof m=="string"?m:m.path),v=await o(p);u=new Array(a.length);for(let m=0;m<a.length;m++)typeof a[m]=="string"?u[m]=v[m]:u[m]={path:v[m],isUnsafe:!0}}else u=a.slice();let d;if(e.requiresPath){let p;if(At(e.requiresPath)?p=e.requiresPath:(p=e.requiresPath.path,e.requiresPath.isUnsafe&&(d=p)),!await r.existsFile(p))return}const f=await _f(t,i,u,r,s,c,e.env,e.overrideName,e.isAutoDetected,d);if(!f){n?.debug("Terminal profile not validated",t,a);return}return f.isAutoDetected=e.isAutoDetected,f.icon=l,f.color=e.color,f}function e9(t){return typeof t=="string"?{id:t}:t}async function qW(t){if($l&&!t)return;const[e,i]=await Promise.all([zW(),t||GW()]);$l=new Map,$l.set("Git Bash",{profileName:"Git Bash",paths:e,args:["--login","-i"]}),$l.set("PowerShell",{profileName:"PowerShell",paths:i,icon:Ti.terminalPowershell})}async function zW(){const t=new Set,e=await P1("git.exe");if(e){const s=$W(e);t.add(BW(s,"../.."))}function i(s,n){n&&s.add(n)}i(t,process.env.ProgramW6432),i(t,process.env.ProgramFiles),i(t,process.env["ProgramFiles(X86)"]),i(t,`${process.env.LocalAppData}\\Program`);const r=[];for(const s of t)r.push(`${s}\\Git\\bin\\bash.exe`,`${s}\\Git\\usr\\bin\\bash.exe`,`${s}\\usr\\bin\\bash.exe`);return r.push(`${process.env.UserProfile}\\scoop\\apps\\git\\current\\bin\\bash.exe`),r.push(`${process.env.UserProfile}\\scoop\\apps\\git-with-openssh\\current\\bin\\bash.exe`),r}async function GW(){const t=[];for await(const e of H2())t.push(e.exePath);return t}async function KW(t,e){const i=[],r=await new Promise((o,a)=>{UW.exec("wsl.exe -l -q",{encoding:"utf16le",timeout:1e3},(c,l)=>{if(c)return a("Problem occurred when getting wsl distros");o(l)})});if(!r)return[];const s=new RegExp(/[\r?\n]/),n=r.split(s).filter(o=>o.trim().length>0&&o!=="");for(const o of n){if(o===""||o.startsWith("docker-desktop"))continue;const a=`${o} (WSL)`,c={profileName:a,path:t,args:["-d",`${o}`],isDefault:a===e,icon:YW(o),isAutoDetected:!1};i.push(c)}return i}function YW(t){return t.includes("Ubuntu")?Ti.terminalUbuntu:t.includes("Debian")?Ti.terminalDebian:Ti.terminalLinux}async function JW(t,e,i,r,s,n,o,a){const c=new Map;if(i&&await t.existsFile("/etc/shells")){const l=(await t.readFile("/etc/shells")).toString(),u=(n||l.split(`
|
|
`)).map(f=>{const p=f.indexOf("#");return p===-1?f:f.substring(0,p)}).filter(f=>f.trim().length>0),d=new Map;for(const f of u){let p=tt(f),v=d.get(p)||0;v++,v>1&&(p=`${p} (${v})`),d.set(p,v),c.set(p,{path:f,isAutoDetected:!0})}}return t9(r,c),await Z6(c.entries(),s,t,a,e,o)}function t9(t,e){if(t)for(const[i,r]of Object.entries(t))r===null||typeof r!="object"||!("path"in r)&&!("source"in r)?e.delete(i):(r.icon=r.icon||e.get(i)?.icon,e.set(i,r))}async function _f(t,e,i,r,s,n,o,a,c,l){if(i.length===0)return Promise.resolve(void 0);const u=i.shift();if(u==="")return _f(t,e,i,r,s,n,o,a,c);const d=typeof u!="string"&&u.isUnsafe,f=typeof u=="string"?u:u.path,p={profileName:t,path:f,args:n,env:o,overrideName:a,isAutoDetected:c,isDefault:t===e,isUnsafePath:d,requiresUnsafePath:l};if(tt(f)===f){const m=s.PATH?s.PATH.split(kg):void 0,y=await P1(f,void 0,m,void 0,r.existsFile);return y?(p.path=y,p.isFromPath=!0,p):_f(t,e,i,r,s,n)}return await r.existsFile(bi(f))?p:_f(t,e,i,r,s,n,o,a,c)}var i9,$l,Lv,QW=g({"out-build/vs/platform/terminal/node/terminalProfiles.js"(){"use strict";tf(),ye(),z(),hh(),xe(),qt(),G2(),FW(),(function(t){t.UnixShellsPath="/etc/shells"})(i9||(i9={})),Lv=!0}}),Ov,bf,XW=g({"out-build/vs/platform/terminal/node/ptyHostService.js"(){"use strict";q(),L(),z(),Er(),Xe(),K(),EW(),C1(),kW(),G6(),RW(),QW(),Q2(),Io(),(function(t){t[t.MaxRestarts=5]="MaxRestarts"})(Ov||(Ov={})),bf=class extends N{get _connection(){return this._ensurePtyHost(),this.__connection}get _proxy(){return this._ensurePtyHost(),this.__proxy}get _optionalProxy(){return this.__proxy}_ensurePtyHost(){this.__connection||this._startPtyHost()}constructor(e,i,r,s){super(),this._ptyHostStarter=e,this._configurationService=i,this._logService=r,this._loggerService=s,this._wasQuitRequested=!1,this._restartCount=0,this._isResponsive=!0,this._onPtyHostExit=this._register(new D),this.onPtyHostExit=this._onPtyHostExit.event,this._onPtyHostStart=this._register(new D),this.onPtyHostStart=this._onPtyHostStart.event,this._onPtyHostUnresponsive=this._register(new D),this.onPtyHostUnresponsive=this._onPtyHostUnresponsive.event,this._onPtyHostResponsive=this._register(new D),this.onPtyHostResponsive=this._onPtyHostResponsive.event,this._onPtyHostRequestResolveVariables=this._register(new D),this.onPtyHostRequestResolveVariables=this._onPtyHostRequestResolveVariables.event,this._onProcessData=this._register(new D),this.onProcessData=this._onProcessData.event,this._onProcessReady=this._register(new D),this.onProcessReady=this._onProcessReady.event,this._onProcessReplay=this._register(new D),this.onProcessReplay=this._onProcessReplay.event,this._onProcessOrphanQuestion=this._register(new D),this.onProcessOrphanQuestion=this._onProcessOrphanQuestion.event,this._onDidRequestDetach=this._register(new D),this.onDidRequestDetach=this._onDidRequestDetach.event,this._onDidChangeProperty=this._register(new D),this.onDidChangeProperty=this._onDidChangeProperty.event,this._onProcessExit=this._register(new D),this.onProcessExit=this._onProcessExit.event,DW(),this._register(this._ptyHostStarter),this._register(me(()=>this._disposePtyHost())),this._resolveVariablesRequestStore=this._register(new wf(void 0,this._logService)),this._register(this._resolveVariablesRequestStore.onCreateRequest(this._onPtyHostRequestResolveVariables.fire,this._onPtyHostRequestResolveVariables)),this._ptyHostStarter.onRequestConnection&&this._register(P.once(this._ptyHostStarter.onRequestConnection)(()=>this._ensurePtyHost())),this._ptyHostStarter.onWillShutdown&&this._register(this._ptyHostStarter.onWillShutdown(()=>this._wasQuitRequested=!0))}get _ignoreProcessNames(){return this._configurationService.getValue("terminal.integrated.ignoreProcessNames")}async _refreshIgnoreProcessNames(){return this._optionalProxy?.refreshIgnoreProcessNames?.(this._ignoreProcessNames)}async _resolveShellEnv(){if(B)return process.env;try{return await x1(this._configurationService,this._logService,{_:[]},process.env)}catch(e){return this._logService.error("ptyHost was unable to resolve shell environment",e),{}}}_startPtyHost(){const e=this._ptyHostStarter.start(),i=e.client;this._logService.getLevel()===X.Trace&&this._logService.trace("PtyHostService#_startPtyHost",new Error().stack?.replace(/^Error/,"")),Oe.toService(i.getChannel(Ca.Heartbeat)).onBeat(()=>this._handleHeartbeat()),this._handleHeartbeat(!0),this._register(e.onDidProcessExit(n=>{this._onPtyHostExit.fire(n.code),!this._wasQuitRequested&&!this._store.isDisposed&&(this._restartCount<=Ov.MaxRestarts?(this._logService.error(`ptyHost terminated unexpectedly with code ${n.code}`),this._restartCount++,this.restartPtyHost()):this._logService.error(`ptyHost terminated unexpectedly with code ${n.code}, giving up`))}));const s=Oe.toService(i.getChannel(Ca.PtyHost));return this._register(s.onProcessData(n=>this._onProcessData.fire(n))),this._register(s.onProcessReady(n=>this._onProcessReady.fire(n))),this._register(s.onProcessExit(n=>this._onProcessExit.fire(n))),this._register(s.onDidChangeProperty(n=>this._onDidChangeProperty.fire(n))),this._register(s.onProcessReplay(n=>this._onProcessReplay.fire(n))),this._register(s.onProcessOrphanQuestion(n=>this._onProcessOrphanQuestion.fire(n))),this._register(s.onDidRequestDetach(n=>this._onDidRequestDetach.fire(n))),this._register(new K6(this._loggerService,i.getChannel(Ca.Logger))),this.__connection=e,this.__proxy=s,this._onPtyHostStart.fire(),this._register(this._configurationService.onDidChangeConfiguration(async n=>{n.affectsConfiguration("terminal.integrated.ignoreProcessNames")&&await this._refreshIgnoreProcessNames()})),this._refreshIgnoreProcessNames(),[e,s]}async createProcess(e,i,r,s,n,o,a,c,l,u,d){const f=setTimeout(()=>this._handleUnresponsiveCreateProcess(),Wi.CreateProcessTimeout),p=await this._proxy.createProcess(e,i,r,s,n,o,a,c,l,u,d);return clearTimeout(f),p}updateTitle(e,i,r){return this._proxy.updateTitle(e,i,r)}updateIcon(e,i,r,s){return this._proxy.updateIcon(e,i,r,s)}attachToProcess(e){return this._proxy.attachToProcess(e)}detachFromProcess(e,i){return this._proxy.detachFromProcess(e,i)}shutdownAll(){return this._proxy.shutdownAll()}listProcesses(){return this._proxy.listProcesses()}async getPerformanceMarks(){return this._optionalProxy?.getPerformanceMarks()??[]}async reduceConnectionGraceTime(){return this._optionalProxy?.reduceConnectionGraceTime()}start(e){return this._proxy.start(e)}shutdown(e,i){return this._proxy.shutdown(e,i)}input(e,i){return this._proxy.input(e,i)}processBinary(e,i){return this._proxy.processBinary(e,i)}resize(e,i,r){return this._proxy.resize(e,i,r)}clearBuffer(e){return this._proxy.clearBuffer(e)}acknowledgeDataEvent(e,i){return this._proxy.acknowledgeDataEvent(e,i)}setUnicodeVersion(e,i){return this._proxy.setUnicodeVersion(e,i)}getInitialCwd(e){return this._proxy.getInitialCwd(e)}getCwd(e){return this._proxy.getCwd(e)}async getLatency(){const e=new En,i=await this._proxy.getLatency();return e.stop(),[{label:"ptyhostservice<->ptyhost",latency:e.elapsed()},...i]}orphanQuestionReply(e){return this._proxy.orphanQuestionReply(e)}installAutoReply(e,i){return this._proxy.installAutoReply(e,i)}uninstallAllAutoReplies(){return this._proxy.uninstallAllAutoReplies()}getDefaultSystemShell(e){return this._optionalProxy?.getDefaultSystemShell(e)??J2(e??Gi,process.env)}async getProfiles(e,i,r,s=!1){const n=await this._resolveShellEnv();return jW(i,r,s,this._configurationService,n,void 0,this._logService,this._resolveVariables.bind(this,e))}async getEnvironment(){return this.__proxy?this._proxy.getEnvironment():{...process.env}}getWslPath(e,i){return this._proxy.getWslPath(e,i)}getRevivedPtyNewId(e,i){return this._proxy.getRevivedPtyNewId(e,i)}setTerminalLayoutInfo(e){return this._proxy.setTerminalLayoutInfo(e)}async getTerminalLayoutInfo(e){return this._optionalProxy?.getTerminalLayoutInfo(e)}async requestDetachInstance(e,i){return this._proxy.requestDetachInstance(e,i)}async acceptDetachInstanceReply(e,i){return this._proxy.acceptDetachInstanceReply(e,i)}async freePortKillProcess(e){if(!this._proxy.freePortKillProcess)throw new Error("freePortKillProcess does not exist on the pty proxy");return this._proxy.freePortKillProcess(e)}async serializeTerminalState(e){return this._proxy.serializeTerminalState(e)}async reviveTerminalProcesses(e,i,r){return this._proxy.reviveTerminalProcesses(e,i,r)}async refreshProperty(e,i){return this._proxy.refreshProperty(e,i)}async updateProperty(e,i,r){return this._proxy.updateProperty(e,i,r)}async restartPtyHost(){this._disposePtyHost(),this._isResponsive=!0,this._startPtyHost()}_disposePtyHost(){this._proxy.shutdownAll(),this._connection.store.dispose()}_handleHeartbeat(e){this._clearHeartbeatTimeouts(),this._heartbeatFirstTimeout=setTimeout(()=>this._handleHeartbeatFirstTimeout(),e?Wi.ConnectingBeatInterval:Wi.BeatInterval*Wi.FirstWaitMultiplier),this._isResponsive||(this._isResponsive=!0,this._onPtyHostResponsive.fire())}_handleHeartbeatFirstTimeout(){this._logService.warn(`No ptyHost heartbeat after ${Wi.BeatInterval*Wi.FirstWaitMultiplier/1e3} seconds`),this._heartbeatFirstTimeout=void 0,this._heartbeatSecondTimeout=setTimeout(()=>this._handleHeartbeatSecondTimeout(),Wi.BeatInterval*Wi.SecondWaitMultiplier)}_handleHeartbeatSecondTimeout(){this._logService.error(`No ptyHost heartbeat after ${(Wi.BeatInterval*Wi.FirstWaitMultiplier+Wi.BeatInterval*Wi.FirstWaitMultiplier)/1e3} seconds`),this._heartbeatSecondTimeout=void 0,this._isResponsive&&(this._isResponsive=!1,this._onPtyHostUnresponsive.fire())}_handleUnresponsiveCreateProcess(){this._clearHeartbeatTimeouts(),this._logService.error(`No ptyHost response to createProcess after ${Wi.CreateProcessTimeout/1e3} seconds`),this._isResponsive&&(this._isResponsive=!1,this._onPtyHostUnresponsive.fire())}_clearHeartbeatTimeouts(){this._heartbeatFirstTimeout&&(clearTimeout(this._heartbeatFirstTimeout),this._heartbeatFirstTimeout=void 0),this._heartbeatSecondTimeout&&(clearTimeout(this._heartbeatSecondTimeout),this._heartbeatSecondTimeout=void 0)}_resolveVariables(e,i){return this._resolveVariablesRequestStore.createRequest({workspaceId:e,originalText:i})}async acceptPtyHostResolvedVariables(e,i){this._resolveVariablesRequestStore.acceptReply(e,i)}},bf=__decorate([__param(1,Qe),__param(2,V),__param(3,Bc)],bf)}}),Fv,r9,s9,ZW=g({"out-build/vs/platform/remote/common/electronRemoteResources.js"(){"use strict";Fv="request",r9="remoteResourceHandler",s9=class{async routeCall(t,e,i){if(e!==Fv)throw new Error(`Call not found: ${e}`);const r=i[0];if(r?.authority){const s=t.connections.find(n=>n.ctx===r.authority);if(s)return s}throw new Error("Caller not found")}routeEvent(t,e){throw new Error(`Event not found: ${e}`)}}}});import{BrowserWindow as eL}from"electron";var Ef,tL=g({"out-build/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow.js"(){"use strict";z(),Xe(),ct(),ft(),K(),Vi(),ks(),n6(),Ef=class extends _v{get win(){return super.win||this.tryClaimWindow(),super.win}get webContents(){return this._webContents}constructor(e,i,r,s,n,o){super(s,n,i,r),this._webContents=e,this.lifecycleMainService=o,this.parentId=-1,this.stateApplied=!1,this.id=this.webContents.id,this.tryClaimWindow()}tryClaimWindow(e){this._store.isDisposed||this.webContents.isDestroyed()||(this.doTryClaimWindow(e),e&&!this.stateApplied&&(this.stateApplied=!0,this.applyState({x:e.x,y:e.y,width:e.width,height:e.height,mode:e.show===!1?0:1},{hideBecauseShadowWindow:!1})))}doTryClaimWindow(e){if(this._win)return;const i=eL.fromWebContents(this.webContents);i&&(this.logService.trace("[aux window] Claimed browser window instance"),this.setWin(i,e),i.setMenu(null),(B||Pe)&&Nn(this.configurationService,e?.titleBarStyle==="hidden"?"custom":void 0)&&i.setAutoHideMenuBar(!0),this.lifecycleMainService.registerAuxWindow(this))}matches(e){return this.webContents.id===e.id}},Ef=__decorate([__param(1,st),__param(2,V),__param(3,Qe),__param(4,Ii),__param(5,ze)],Ef)}});import{BrowserWindow as iL,app as rL}from"electron";var kf,sL=g({"out-build/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindowsMainService.js"(){"use strict";q(),L(),Ie(),nr(),tL(),G(),K(),zc(),ut(),kf=class extends N{constructor(e,i){super(),this.instantiationService=e,this.logService=i,this._onDidMaximizeWindow=this._register(new D),this.onDidMaximizeWindow=this._onDidMaximizeWindow.event,this._onDidUnmaximizeWindow=this._register(new D),this.onDidUnmaximizeWindow=this._onDidUnmaximizeWindow.event,this._onDidChangeFullScreen=this._register(new D),this.onDidChangeFullScreen=this._onDidChangeFullScreen.event,this._onDidTriggerSystemContextMenu=this._register(new D),this.onDidTriggerSystemContextMenu=this._onDidTriggerSystemContextMenu.event,this.windows=new Map,this.registerListeners()}registerListeners(){rL.on("browser-window-created",(e,i)=>{const r=this.getWindowByWebContents(i.webContents);if(r)this.logService.trace('[aux window] app.on("browser-window-created"): Trying to claim auxiliary window'),r.tryClaimWindow();else{const s=new ke;s.add(P.fromNodeEventEmitter(i.webContents,"did-create-window",(n,o)=>({browserWindow:n,details:o}))(({browserWindow:n,details:o})=>{const a=this.getWindowByWebContents(n.webContents);a&&(this.logService.trace('[aux window] window.on("did-create-window"): Trying to claim auxiliary window'),a.tryClaimWindow(o.options))})),s.add(P.fromNodeEventEmitter(i,"closed")(()=>s.dispose()))}}),We.handle("vscode:registerAuxiliaryWindow",async(e,i)=>{const r=this.getWindowByWebContents(e.sender);return r&&(this.logService.trace("[aux window] vscode:registerAuxiliaryWindow: Registering auxiliary window to main window"),r.parentId=i),e.sender.id})}createWindow(e){const{state:i,overrides:r}=this.computeWindowStateAndOverrides(e);return this.instantiationService.invokeFunction(Md,i,r,{preload:Ct.asFileUri("vs/base/parts/sandbox/electron-sandbox/preload-aux.js").fsPath})}computeWindowStateAndOverrides(e){const i={},r={hideBecauseShadowWindow:!1},s=e.features.split(",");for(const o of s){const[a,c]=o.split("=");switch(a){case"width":i.width=parseInt(c,10);break;case"height":i.height=parseInt(c,10);break;case"left":i.x=parseInt(c,10);break;case"top":i.y=parseInt(c,10);break;case"window-maximized":i.mode=0;break;case"window-fullscreen":i.mode=3;break;case"window-disable-fullscreen":r.disableFullscreen=!0;break;case"window-native-titlebar":r.forceNativeTitlebar=!0;break}}const n=Td.validateWindowState(this.logService,i)??p4();return this.logService.trace("[aux window] using window state",n),{state:n,overrides:r}}registerWindow(e){const i=new ke,r=this.instantiationService.createInstance(Ef,e);this.windows.set(r.id,r),i.add(me(()=>this.windows.delete(r.id))),i.add(r.onDidMaximize(()=>this._onDidMaximizeWindow.fire(r))),i.add(r.onDidUnmaximize(()=>this._onDidUnmaximizeWindow.fire(r))),i.add(r.onDidEnterFullScreen(()=>this._onDidChangeFullScreen.fire({window:r,fullscreen:!0}))),i.add(r.onDidLeaveFullScreen(()=>this._onDidChangeFullScreen.fire({window:r,fullscreen:!1}))),i.add(r.onDidTriggerSystemContextMenu(({x:s,y:n})=>this._onDidTriggerSystemContextMenu.fire({window:r,x:s,y:n}))),P.once(r.onDidClose)(()=>i.dispose())}getWindowByWebContents(e){const i=this.windows.get(e.id);return i?.matches(e)?i:void 0}getFocusedWindow(){const e=iL.getFocusedWindow();if(e)return this.getWindowByWebContents(e.webContents)}getLastActiveWindow(){return v4(Array.from(this.windows.values()))}getWindows(){return Array.from(this.windows.values())}},kf=__decorate([__param(0,Or),__param(1,V)],kf)}}),Me,je=g({"out-build/external/sentry/core/debug-build.js"(){"use strict";Me=!1}}),at,_t=g({"out-build/external/sentry/core/utils/worldwide.js"(){"use strict";at=globalThis}}),Ia,Nv=g({"out-build/external/sentry/core/utils/version.js"(){"use strict";Ia=typeof __SENTRY_SDK_VERSION__=="string"?__SENTRY_SDK_VERSION__:"9.45.0-cursor"}});function Da(){return Uv(at),at}function Uv(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Ia,e[Ia]=e[Ia]||{}}function Bl(t,e,i=at){const r=i.__SENTRY__=i.__SENTRY__||{},s=r[Ia]=r[Ia]||{};return s[t]||(s[t]=e())}var Cr=g({"out-build/external/sentry/core/carrier.js"(){"use strict";Nv(),_t()}});function Pf(t){if(!("console"in at))return t();const e=at.console,i={},r=Object.keys(Hl);r.forEach(s=>{const n=Hl[s];i[s]=e[s],e[s]=n});try{return t()}finally{r.forEach(s=>{e[s]=i[s]})}}function nL(){Bv().enabled=!0}function oL(){Bv().enabled=!1}function n9(){return Bv().enabled}function aL(...t){$v("log",...t)}function cL(...t){$v("warn",...t)}function lL(...t){$v("error",...t)}function $v(t,...e){Me&&n9()&&Pf(()=>{at.console[t](`${o9}[${t}]:`,...e)})}function Bv(){return Me?Bl("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var jl,o9,Hl,Ne,be=g({"out-build/external/sentry/core/utils/debug-logger.js"(){"use strict";Cr(),je(),_t(),jl=["debug","info","warn","error","log","assert","trace"],o9="Sentry Logger ",Hl={},Ne={enable:nL,disable:oL,isEnabled:n9,log:aL,warn:cL,error:lL}}});function a9(t){try{return!t||typeof t!="function"?xf:t.name||xf}catch{return xf}}function jv(t){const e=t.exception;if(e){const i=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&i.push(...r.stacktrace.frames)}),i}catch{return}}}var xf,ro=g({"out-build/external/sentry/core/utils/stacktrace.js"(){"use strict";xf="<anonymous>"}});function uL(t,e){Vl[t]=Vl[t]||[],Vl[t].push(e)}function dL(t,e){if(!Hv[t]){Hv[t]=!0;try{e()}catch(i){Me&&Ne.error(`Error while instrumenting ${t}`,i)}}}function hL(t,e){const i=t&&Vl[t];if(i)for(const r of i)try{r(e)}catch(s){Me&&Ne.error(`Error while triggering instrumentation handler.
|
|
Type: ${t}
|
|
Name: ${a9(r)}
|
|
Error:`,s)}}var Vl,Hv,ql=g({"out-build/external/sentry/core/instrument/handlers.js"(){"use strict";je(),be(),ro(),Vl={},Hv={}}}),c9=g({"out-build/external/sentry/core/instrument/globalError.js"(){"use strict";_t(),ql()}}),l9=g({"out-build/external/sentry/core/instrument/globalUnhandledRejection.js"(){"use strict";_t(),ql()}});function Aa(t){switch(zv.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return so(t,Error)}}function Vv(t,e){return zv.call(t)===`[object ${e}]`}function Cf(t){return Vv(t,"String")}function u9(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function fL(t){return t===null||u9(t)||typeof t!="object"&&typeof t!="function"}function If(t){return Vv(t,"Object")}function pL(t){return typeof Event<"u"&&so(t,Event)}function gL(t){return typeof Element<"u"&&so(t,Element)}function mL(t){return Vv(t,"RegExp")}function qv(t){return!!(t?.then&&typeof t.then=="function")}function vL(t){return If(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function so(t,e){try{return t instanceof e}catch{return!1}}function d9(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}var zv,vt=g({"out-build/external/sentry/core/utils/is.js"(){"use strict";zv=Object.prototype.toString}});function wL(t,e={}){if(!t)return"<unknown>";try{let i=t;const r=5,s=[];let n=0,o=0;const a=" > ",c=a.length;let l;const u=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||f9;for(;i&&n++<r&&(l=yL(i,u),!(l==="html"||n>1&&o+s.length*c+l.length>=d));)s.push(l),o+=l.length,i=i.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function yL(t,e){const i=t,r=[];if(!i?.tagName)return"";if(h9.HTMLElement&&i instanceof HTMLElement&&i.dataset){if(i.dataset.sentryComponent)return i.dataset.sentryComponent;if(i.dataset.sentryElement)return i.dataset.sentryElement}r.push(i.tagName.toLowerCase());const s=e?.length?e.filter(o=>i.getAttribute(o)).map(o=>[o,i.getAttribute(o)]):null;if(s?.length)s.forEach(o=>{r.push(`[${o[0]}="${o[1]}"]`)});else{i.id&&r.push(`#${i.id}`);const o=i.className;if(o&&Cf(o)){const a=o.split(/\s+/);for(const c of a)r.push(`.${c}`)}}const n=["aria-label","type","name","title","alt"];for(const o of n){const a=i.getAttribute(o);a&&r.push(`[${o}="${a}"]`)}return r.join("")}var h9,f9,p9=g({"out-build/external/sentry/core/utils/browser.js"(){"use strict";vt(),_t(),h9=at,f9=80}}),g9=g({"out-build/external/sentry/core/vendor/escapeStringForRegex.js"(){"use strict"}});function Gv(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function Kv(t,e){if(!Array.isArray(t))return"";const i=[];for(let r=0;r<t.length;r++){const s=t[r];try{d9(s)?i.push("[VueViewModel]"):i.push(String(s))}catch{i.push("[value cannot be serialized]")}}return i.join(e)}function SL(t,e,i=!1){return Cf(t)?mL(e)?e.test(t):Cf(e)?i?t===e:t.includes(e):!1:!1}function Df(t,e=[],i=!1){return e.some(r=>SL(t,r,i))}var es=g({"out-build/external/sentry/core/utils/string.js"(){"use strict";vt(),g9()}});function _L(t,e,i){if(!(e in t))return;const r=t[e];if(typeof r!="function")return;const s=i(r);typeof s=="function"&&bL(s,r);try{t[e]=s}catch{Me&&Ne.log(`Failed to replace method "${e}" in object`,t)}}function un(t,e,i){try{Object.defineProperty(t,e,{value:i,writable:!0,configurable:!0})}catch{Me&&Ne.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function bL(t,e){try{const i=e.prototype||{};t.prototype=e.prototype=i,un(t,"__sentry_original__",e)}catch{}}function EL(t){return t.__sentry_original__}function kL(t){if(Aa(t))return{message:t.message,name:t.name,stack:t.stack,...v9(t)};if(pL(t)){const e={type:t.type,target:m9(t.target),currentTarget:m9(t.currentTarget),...v9(t)};return typeof CustomEvent<"u"&&so(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function m9(t){try{return gL(t)?wL(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function v9(t){if(typeof t=="object"&&t!==null){const e={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}else return{}}var fi=g({"out-build/external/sentry/core/utils/object.js"(){"use strict";je(),p9(),be(),vt(),es()}});function PL(){const t=at;return t.crypto||t.msCrypto}function Ra(t=PL()){let e=()=>Math.random()*16;try{if(t?.randomUUID)return t.randomUUID().replace(/-/g,"");t?.getRandomValues&&(e=()=>{const i=new Uint8Array(1);return t.getRandomValues(i),i[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,i=>(i^(e()&15)>>i/4).toString(16))}function w9(t){return t.exception?.values?.[0]}function Ma(t){const{message:e,event_id:i}=t;if(e)return e;const r=w9(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||i||"<unknown>":i||"<unknown>"}function xL(t,e){const i=w9(t);if(!i)return;const r={type:"generic",handled:!0},s=i.mechanism;if(i.mechanism={...r,...s,...e},e&&"data"in e){const n={...s?.data,...e.data};i.mechanism.data=n}}var Yi=g({"out-build/external/sentry/core/utils/misc.js"(){"use strict";fi(),es(),_t()}});function Yv(){return Date.now()/Jv}function CL(){const{performance:t}=at;if(!t?.now||!t.timeOrigin)return Yv;const e=t.timeOrigin;return()=>(e+t.now())/Jv}function zl(){return(y9??(y9=CL()))()}var Jv,y9,hr=g({"out-build/external/sentry/core/utils/time.js"(){"use strict";_t(),Jv=1e3}});function IL(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||zl(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:Ra()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const i=t.timestamp-t.started;t.duration=i>=0?i:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}var Af=g({"out-build/external/sentry/core/session.js"(){"use strict";Yi(),hr()}});function Rf(t,e,i=2){if(!e||typeof e!="object"||i<=0)return e;if(t&&Object.keys(e).length===0)return t;const r={...t};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Rf(r[s],e[s],i-1));return r}var Qv=g({"out-build/external/sentry/core/utils/merge.js"(){"use strict"}});function Mf(){return Ra()}function Tf(){return Ra().substring(16)}var dn=g({"out-build/external/sentry/core/utils/propagationContext.js"(){"use strict";Yi()}});function Wf(t,e){e?un(t,Lf,e):delete t[Lf]}function Gl(t){return t[Lf]}var Lf,Kl=g({"out-build/external/sentry/core/utils/spanOnScope.js"(){"use strict";fi(),Lf="_sentrySpan"}}),S9,no,Yl=g({"out-build/external/sentry/core/scope.js"(){"use strict";je(),Af(),be(),vt(),Qv(),Yi(),dn(),Kl(),es(),hr(),S9=100,no=class A0{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Mf(),sampleRand:Math.random()}}clone(){const e=new A0;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,Wf(e,Gl(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&IL(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,i){return this._tags={...this._tags,[e]:i},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,i){return this._extra={...this._extra,[e]:i},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,i){return i===null?delete this._contexts[e]:this._contexts[e]=i,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const i=typeof e=="function"?e(this):e,r=i instanceof A0?i.getScopeData():If(i)?e:void 0,{tags:s,extra:n,user:o,contexts:a,level:c,fingerprint:l=[],propagationContext:u}=r||{};return this._tags={...this._tags,...s},this._extra={...this._extra,...n},this._contexts={...this._contexts,...a},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,Wf(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Mf(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,i){const r=typeof i=="number"?i:S9;if(r<=0)return this;const s={timestamp:Yv(),...e,message:e.message?Gv(e.message,2048):e.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Gl(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Rf(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,i){const r=i?.event_id||Ra();if(!this._client)return Me&&Ne.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:s,...i,event_id:r},this),r}captureMessage(e,i,r){const s=r?.event_id||Ra();if(!this._client)return Me&&Ne.warn("No client configured on scope - will not capture message!"),s;const n=new Error(e);return this._client.captureMessage(e,i,{originalException:e,syntheticException:n,...r,event_id:s},this),s}captureEvent(e,i){const r=i?.event_id||Ra();return this._client?(this._client.captureEvent(e,{...i,event_id:r},this),r):(Me&&Ne.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}}});function DL(){return Bl("defaultCurrentScope",()=>new no)}function AL(){return Bl("defaultIsolationScope",()=>new no)}var _9=g({"out-build/external/sentry/core/defaultScopes.js"(){"use strict";Cr(),Yl()}});function Ta(){const t=Da(),e=Uv(t);return e.stack=e.stack||new E9(DL(),AL())}function RL(t){return Ta().withScope(t)}function ML(t,e){const i=Ta();return i.withScope(()=>(i.getStackTop().scope=t,e(t)))}function b9(t){return Ta().withScope(()=>t(Ta().getIsolationScope()))}function TL(){return{withIsolationScope:b9,withScope:RL,withSetScope:ML,withSetIsolationScope:(t,e)=>b9(e),getCurrentScope:()=>Ta().getScope(),getIsolationScope:()=>Ta().getIsolationScope()}}var E9,WL=g({"out-build/external/sentry/core/asyncContext/stackStrategy.js"(){"use strict";_9(),Yl(),vt(),Cr(),E9=class{constructor(t,e){let i;t?i=t:i=new no;let r;e?r=e:r=new no,this._stack=[{scope:i}],this._isolationScope=r}withScope(t){const e=this._pushScope();let i;try{i=t(e)}catch(r){throw this._popScope(),r}return qv(i)?i.then(r=>(this._popScope(),r),r=>{throw this._popScope(),r}):(this._popScope(),i)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}}});function Jl(t){const e=Uv(t);return e.acs?e.acs:TL()}var Ql=g({"out-build/external/sentry/core/asyncContext/index.js"(){"use strict";Cr(),WL()}});function fr(){const t=Da();return Jl(t).getCurrentScope()}function Ir(){const t=Da();return Jl(t).getIsolationScope()}function LL(){return Bl("globalScope",()=>new no)}function Of(...t){const e=Da(),i=Jl(e);if(t.length===2){const[r,s]=t;return r?i.withSetScope(r,s):i.withScope(s)}return i.withScope(t[0])}function pi(){return fr().getClient()}function OL(t){const e=t.getPropagationContext(),{traceId:i,parentSpanId:r,propagationSpanId:s}=e,n={trace_id:i,span_id:s||Tf()};return r&&(n.parent_span_id=r),n}var Ge=g({"out-build/external/sentry/core/currentScopes.js"(){"use strict";Ql(),Cr(),Yl(),dn()}}),Xl,Xv,k9,Wa,oo,P9,x9,Zv,C9,I9,gi=g({"out-build/external/sentry/core/semanticAttributes.js"(){"use strict";Xl="sentry.source",Xv="sentry.sample_rate",k9="sentry.previous_trace_sample_rate",Wa="sentry.op",oo="sentry.origin",P9="sentry.measurement_unit",x9="sentry.measurement_value",Zv="sentry.custom_span_name",C9="sentry.profile_id",I9="sentry.exclusive_time"}});function FL(t){if(t<400&&t>=100)return{code:Ff};if(t>=400&&t<500)switch(t){case 401:return{code:ii,message:"unauthenticated"};case 403:return{code:ii,message:"permission_denied"};case 404:return{code:ii,message:"not_found"};case 409:return{code:ii,message:"already_exists"};case 413:return{code:ii,message:"failed_precondition"};case 429:return{code:ii,message:"resource_exhausted"};case 499:return{code:ii,message:"cancelled"};default:return{code:ii,message:"invalid_argument"}}if(t>=500&&t<600)switch(t){case 501:return{code:ii,message:"unimplemented"};case 503:return{code:ii,message:"unavailable"};case 504:return{code:ii,message:"deadline_exceeded"};default:return{code:ii,message:"internal_error"}}return{code:ii,message:"unknown_error"}}function D9(t,e){t.setAttribute("http.response.status_code",e);const i=FL(e);i.message!=="unknown_error"&&t.setStatus(i)}var A9,Ff,ii,La=g({"out-build/external/sentry/core/tracing/spanstatus.js"(){"use strict";A9=0,Ff=1,ii=2}});function NL(t,e,i){t&&(un(t,tw,i),un(t,ew,e))}function Nf(t){return{scope:t[ew],isolationScope:t[tw]}}var ew,tw,Zl=g({"out-build/external/sentry/core/tracing/utils.js"(){"use strict";fi(),ew="_sentryScope",tw="_sentryIsolationScope"}});function UL(t){const e=$L(t);if(!e)return;const i=Object.entries(e).reduce((r,[s,n])=>{if(s.match(T9)){const o=s.slice(M9.length);r[o]=n}return r},{});if(Object.keys(i).length>0)return i}function $L(t){if(!(!t||!Cf(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,i)=>{const r=R9(i);return Object.entries(r).forEach(([s,n])=>{e[s]=n}),e},{}):R9(t)}function R9(t){return t.split(",").map(e=>e.split("=").map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})).reduce((e,[i,r])=>(i&&r&&(e[i]=r),e),{})}var M9,T9,eu=g({"out-build/external/sentry/core/utils/baggage.js"(){"use strict";je(),be(),vt(),M9="sentry-",T9=/^sentry-/}});function W9(t){if(typeof t=="boolean")return Number(t);const e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}var tu=g({"out-build/external/sentry/core/utils/parseSampleRate.js"(){"use strict"}}),BL,Uf=g({"out-build/external/sentry/core/utils/tracing.js"(){"use strict";eu(),tu(),dn(),BL=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$")}});function jL(t){const{spanId:e,traceId:i}=t.spanContext(),{data:r,op:s,parent_span_id:n,status:o,origin:a,links:c}=pr(t);return{parent_span_id:n,span_id:e,trace_id:i,data:r,op:s,status:o,origin:a,links:c}}function HL(t){const{spanId:e,traceId:i,isRemote:r}=t.spanContext(),s=r?e:pr(t).parent_span_id,n=Nf(t).scope,o=r?n?.getPropagationContext().propagationSpanId||Tf():e;return{parent_span_id:s,span_id:o,trace_id:i}}function L9(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:i,traceFlags:r,...s},attributes:n})=>({span_id:e,trace_id:i,sampled:r===$f,attributes:n,...s}))}function Oa(t){return typeof t=="number"?O9(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?O9(t.getTime()):zl()}function O9(t){return t>9999999999?t/1e3:t}function pr(t){if(qL(t))return t.getSpanJSON();const{spanId:e,traceId:i}=t.spanContext();if(VL(t)){const{attributes:r,startTime:s,name:n,endTime:o,status:a,links:c}=t,l="parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0;return{span_id:e,trace_id:i,data:r,description:n,parent_span_id:l,start_timestamp:Oa(s),timestamp:Oa(o)||void 0,status:F9(a),op:r[Wa],origin:r[oo],links:L9(c)}}return{span_id:e,trace_id:i,start_timestamp:0,data:{}}}function VL(t){const e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function qL(t){return typeof t.getSpanJSON=="function"}function iu(t){const{traceFlags:e}=t.spanContext();return e===$f}function F9(t){if(!(!t||t.code===A9))return t.code===Ff?"ok":t.message||"unknown_error"}function N9(t,e){const i=t[Bf]||t;un(e,Bf,i),t[Fa]?t[Fa].add(e):un(t,Fa,new Set([e]))}function zL(t){const e=new Set;function i(r){if(!e.has(r)&&iu(r)){e.add(r);const s=r[Fa]?Array.from(r[Fa]):[];for(const n of s)i(n)}}return i(t),Array.from(e)}function ao(t){return t[Bf]||t}function U9(){const t=Da(),e=Jl(t);return e.getActiveSpan?e.getActiveSpan():Gl(fr())}function GL(){rw||(Pf(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),rw=!0)}var iw,$f,rw,Fa,Bf,ri=g({"out-build/external/sentry/core/utils/spanUtils.js"(){"use strict";Ql(),Cr(),Ge(),gi(),La(),Zl(),fi(),dn(),hr(),Uf(),be(),Kl(),iw=0,$f=1,rw=!1,Fa="_sentryChildSpans",Bf="_sentryRootSpan"}}),KL=g({"out-build/external/sentry/core/tracing/errors.js"(){"use strict";je(),c9(),l9(),be(),ri(),La()}});function sw(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=t||pi()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}var co=g({"out-build/external/sentry/core/utils/hasSpansEnabled.js"(){"use strict";Ge()}}),$9,jf=g({"out-build/external/sentry/core/constants.js"(){"use strict";$9="production"}});function B9(t,e=!1){const{host:i,path:r,pass:s,port:n,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${i}${n?`:${n}`:""}/${r&&`${r}/`}${o}`}function YL(t){return t.match(j9)?.[1]}var j9,Ls=g({"out-build/external/sentry/core/utils/dsn.js"(){"use strict";je(),be(),j9=/^o(\d+)\./}});function nw(t,e){un(t,ow,e)}function H9(t,e){const i=e.getOptions(),{publicKey:r,host:s}=e.getDsn()||{};let n;i.orgId?n=String(i.orgId):s&&(n=YL(s));const o={environment:i.environment||$9,release:i.release,public_key:r,trace_id:t,org_id:n};return e.emit("createDsc",o),o}function JL(t,e){const i=e.getPropagationContext();return i.dsc||H9(i.traceId,t)}function ru(t){const e=pi();if(!e)return{};const i=ao(t),r=pr(i),s=r.data,n=i.spanContext().traceState,o=n?.get("sentry.sample_rate")??s[Xv]??s[k9];function a(v){return(typeof o=="number"||typeof o=="string")&&(v.sample_rate=`${o}`),v}const c=i[ow];if(c)return a(c);const l=n?.get("sentry.dsc"),u=l&&UL(l);if(u)return a(u);const d=H9(t.spanContext().traceId,e),f=s[Xl],p=r.description;return f!=="url"&&p&&(d.transaction=p),sw()&&(d.sampled=String(iu(i)),d.sample_rand=n?.get("sentry.sample_rand")??Nf(i).scope?.getPropagationContext().sampleRand.toString()),a(d),e.emit("createDsc",d,i),d}var ow,lo=g({"out-build/external/sentry/core/tracing/dynamicSamplingContext.js"(){"use strict";jf(),Ge(),gi(),eu(),Ls(),co(),fi(),ri(),Zl(),ow="_frozenDsc"}}),Hf,Vf=g({"out-build/external/sentry/core/tracing/sentryNonRecordingSpan.js"(){"use strict";dn(),ri(),Hf=class{constructor(t={}){this._traceId=t.traceId||Mf(),this._spanId=t.spanId||Tf()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:iw}}end(t){}setAttribute(t,e){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,e,i){return this}addLink(t){return this}addLinks(t){return this}recordException(t,e){}}}});function V9(t,e=100,i=1/0){try{return aw("",t,e,i)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function aw(t,e,i=1/0,r=1/0,s=ZL()){const[n,o]=s;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const a=QL(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;const c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:i;if(c===0)return a.replace("object ","");if(n(e))return"[Circular ~]";const l=e;if(l&&typeof l.toJSON=="function")try{const p=l.toJSON();return aw("",p,c-1,r,s)}catch{}const u=Array.isArray(e)?[]:{};let d=0;const f=kL(e);for(const p in f){if(!Object.prototype.hasOwnProperty.call(f,p))continue;if(d>=r){u[p]="[MaxProperties ~]";break}const v=f[p];u[p]=aw(p,v,c-1,r,s),d++}return o(e),u}function QL(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(d9(e))return"[VueViewModel]";if(vL(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${a9(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const i=XL(e);return/^HTML(\w*)Element$/.test(i)?`[HTMLElement: ${i}]`:`[object ${i}]`}catch(i){return`**non-serializable** (${i})`}}function XL(t){const e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function ZL(){const t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function i(r){t.delete(r)}return[e,i]}var uo=g({"out-build/external/sentry/core/utils/normalize.js"(){"use strict";vt(),fi(),ro()}});function q9(t,e=[]){return[t,e]}function eO(t,e){const[i,r]=t;return[i,[...r,e]]}function cw(t,e){const i=t[1];for(const r of i){const s=r[0].type;if(e(r,s))return!0}return!1}function tO(t){return[{type:"span"},t]}var gr=g({"out-build/external/sentry/core/utils/envelope.js"(){"use strict";Cr(),Ls(),uo(),_t()}});function iO(t,e){function i(u){return!!u.trace_id&&!!u.public_key}const r=ru(t[0]),s=e?.getDsn(),n=e?.getOptions().tunnel,o={sent_at:new Date().toISOString(),...i(r)&&{trace:r},...!!n&&s&&{dsn:B9(s)}},a=e?.getOptions().beforeSendSpan,c=a?u=>{const d=pr(u),f=a(d);return f||(GL(),d)}:pr,l=[];for(const u of t){const d=c(u);d&&l.push(tO(d))}return q9(o,l)}var lw=g({"out-build/external/sentry/core/envelope.js"(){"use strict";lo(),Ls(),gr(),Yi(),ri()}});function rO(t){if(!Me)return;const{description:e="< unknown name >",op:i="< unknown op >",parent_span_id:r}=pr(t),{spanId:s}=t.spanContext(),n=iu(t),o=ao(t),a=o===t,c=`[Tracing] Starting ${n?"sampled":"unsampled"} ${a?"root ":""}span`,l=[`op: ${i}`,`name: ${e}`,`ID: ${s}`];if(r&&l.push(`parent ID: ${r}`),!a){const{op:u,description:d}=pr(o);l.push(`root ID: ${o.spanContext().spanId}`),u&&l.push(`root op: ${u}`),d&&l.push(`root description: ${d}`)}Ne.log(`${c}
|
|
${l.join(`
|
|
`)}`)}function sO(t){if(!Me)return;const{description:e="< unknown name >",op:i="< unknown op >"}=pr(t),{spanId:r}=t.spanContext(),n=ao(t)===t,o=`[Tracing] Finishing "${i}" ${n?"root ":""}span "${e}" with ID ${r}`;Ne.log(o)}var uw=g({"out-build/external/sentry/core/tracing/logSpans.js"(){"use strict";je(),be(),ri()}});function z9(t){if(!t||t.length===0)return;const e={};return t.forEach(i=>{const r=i.attributes||{},s=r[P9],n=r[x9];typeof s=="string"&&typeof n=="number"&&(e[i.name]={value:n,unit:s})}),e}var G9=g({"out-build/external/sentry/core/tracing/measurement.js"(){"use strict";je(),gi(),be(),ri()}});function K9(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function Y9(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function nO(t){return t instanceof qf&&t.isStandaloneSpan()}function oO(t){const e=pi();if(!e)return;const i=t[1];if(!i||i.length===0){e.recordDroppedEvent("before_send","span");return}e.sendEnvelope(t)}var dw,qf,hw=g({"out-build/external/sentry/core/tracing/sentrySpan.js"(){"use strict";Ge(),je(),lw(),gi(),be(),dn(),ri(),hr(),lo(),uw(),G9(),Zl(),dw=1e3,qf=class{constructor(t={}){this._traceId=t.traceId||Mf(),this._spanId=t.spanId||Tf(),this._startTime=t.startTimestamp||zl(),this._links=t.links,this._attributes={},this.setAttributes({[oo]:"manual",[Wa]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,e){}spanContext(){const{_spanId:t,_traceId:e,_sampled:i}=this;return{spanId:t,traceId:e,traceFlags:i?$f:iw}}setAttribute(t,e){return e===void 0?delete this._attributes[t]:this._attributes[t]=e,this}setAttributes(t){return Object.keys(t).forEach(e=>this.setAttribute(e,t[e])),this}updateStartTime(t){this._startTime=Oa(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(Xl,"custom"),this}end(t){this._endTime||(this._endTime=Oa(t),sO(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Wa],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:F9(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[oo],profile_id:this._attributes[C9],exclusive_time:this._attributes[I9],measurements:z9(this._events),is_segment:this._isStandaloneSpan&&ao(this)===this||void 0,segment_id:this._isStandaloneSpan?ao(this).spanContext().spanId:void 0,links:L9(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,e,i){Me&&Ne.log("[Tracing] Adding an event to span:",t);const r=K9(e)?e:i||zl(),s=K9(e)?{}:e||{},n={name:t,time:Oa(r),attributes:s};return this._events.push(n),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=pi();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===ao(this)))return;if(this._isStandaloneSpan){this._sampled?oO(iO([this],t)):(Me&&Ne.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}const i=this._convertSpanToTransaction();i&&(Nf(this).scope||fr()).captureEvent(i)}_convertSpanToTransaction(){if(!Y9(pr(this)))return;this._name||(Me&&Ne.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:e}=Nf(this),i=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const s=zL(this).filter(l=>l!==this&&!nO(l)).map(l=>pr(l)).filter(Y9),n=this._attributes[Xl];delete this._attributes[Zv],s.forEach(l=>{delete l.data[Zv]});const o={contexts:{trace:jL(this)},spans:s.length>dw?s.sort((l,u)=>l.start_timestamp-u.start_timestamp).slice(0,dw):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:e,dynamicSamplingContext:ru(this)},request:i,...n&&{transaction_info:{source:n}}},a=z9(this._events);return a&&Object.keys(a).length&&(Me&&Ne.log("[Measurements] Adding measurements to transaction event",JSON.stringify(a,void 0,2)),o.measurements=a),o}}}});function aO(t,e,i=()=>{}){let r;try{r=t()}catch(s){throw e(s),i(),s}return cO(r,e,i)}function cO(t,e,i){return qv(t)?t.then(r=>(i(),r),r=>{throw e(r),i(),r}):(i(),t)}var J9=g({"out-build/external/sentry/core/utils/handleCallbackErrors.js"(){"use strict";vt()}});function lO(t,e,i){if(!sw(t))return[!1];let r,s;typeof t.tracesSampler=="function"?(s=t.tracesSampler({...e,inheritOrSampleWith:a=>typeof e.parentSampleRate=="number"?e.parentSampleRate:typeof e.parentSampled=="boolean"?Number(e.parentSampled):a}),r=!0):e.parentSampled!==void 0?s=e.parentSampled:typeof t.tracesSampleRate<"u"&&(s=t.tracesSampleRate,r=!0);const n=W9(s);if(n===void 0)return Me&&Ne.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(s)} of type ${JSON.stringify(typeof s)}.`),[!1];if(!n)return Me&&Ne.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,n,r];const o=i<n;return o||Me&&Ne.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),[o,n,r]}var Q9=g({"out-build/external/sentry/core/tracing/sampling.js"(){"use strict";je(),be(),co(),tu()}});function X9(t,e){const i=Z9();if(i.startSpan)return i.startSpan(t,e);const r=hO(t),{forceTransaction:s,parentSpan:n,scope:o}=t,a=o?.clone();return Of(a,()=>gO(n)(()=>{const l=fr(),u=pO(l,n),f=t.onlyIfParent&&!u?new Hf:dO({parentSpan:u,spanArguments:r,forceTransaction:s,scope:l});return Wf(l,f),aO(()=>e(f),()=>{const{status:p}=pr(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:ii,message:"internal_error"})},()=>{f.end()})}))}function uO(t,e){const i=Z9();return i.withActiveSpan?i.withActiveSpan(t,e):Of(r=>(Wf(r,t||void 0),e(r)))}function dO({parentSpan:t,spanArguments:e,forceTransaction:i,scope:r}){if(!sw()){const o=new Hf;if(i||!t){const a={sampled:"false",sample_rate:"0",transaction:e.name,...ru(o)};nw(o,a)}return o}const s=Ir();let n;if(t&&!i)n=fO(t,r,e),N9(t,n);else if(t){const o=ru(t),{traceId:a,spanId:c}=t.spanContext(),l=iu(t);n=ek({traceId:a,parentSpanId:c,...e},r,l),nw(n,o)}else{const{traceId:o,dsc:a,parentSpanId:c,sampled:l}={...s.getPropagationContext(),...r.getPropagationContext()};n=ek({traceId:o,parentSpanId:c,...e},r,l),a&&nw(n,a)}return rO(n),NL(n,r,s),n}function hO(t){const i={isStandalone:(t.experimental||{}).standalone,...t};if(t.startTime){const r={...i};return r.startTimestamp=Oa(t.startTime),delete r.startTime,r}return i}function Z9(){const t=Da();return Jl(t)}function ek(t,e,i){const r=pi(),s=r?.getOptions()||{},{name:n=""}=t,o={spanAttributes:{...t.attributes},spanName:n,parentSampled:i};r?.emit("beforeSampling",o,{decision:!1});const a=o.parentSampled??i,c=o.spanAttributes,l=e.getPropagationContext(),[u,d,f]=e.getScopeData().sdkProcessingMetadata[fw]?[!1]:lO(s,{name:n,parentSampled:a,attributes:c,parentSampleRate:W9(l.dsc?.sample_rate)},l.sampleRand),p=new qf({...t,attributes:{[Xl]:"custom",[Xv]:d!==void 0&&f?d:void 0,...c},sampled:u});return!u&&r&&(Me&&Ne.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",p),p}function fO(t,e,i){const{spanId:r,traceId:s}=t.spanContext(),n=e.getScopeData().sdkProcessingMetadata[fw]?!1:iu(t),o=n?new qf({...i,parentSpanId:r,traceId:s,sampled:n}):new Hf({traceId:s});N9(t,o);const a=pi();return a&&(a.emit("spanStart",o),i.endTimestamp&&a.emit("spanEnd",o)),o}function pO(t,e){if(e)return e;if(e===null)return;const i=Gl(t);if(!i)return;const r=pi();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?ao(i):i}function gO(t){return t!==void 0?e=>uO(t,e):e=>e()}var fw,pw=g({"out-build/external/sentry/core/tracing/trace.js"(){"use strict";Ql(),Cr(),Ge(),je(),gi(),be(),J9(),co(),tu(),dn(),Kl(),ri(),Uf(),lo(),uw(),Q9(),Vf(),hw(),La(),Zl(),fw="__SENTRY_SUPPRESS_TRACING__"}}),mO=g({"out-build/external/sentry/core/tracing/idleSpan.js"(){"use strict";Ge(),je(),gi(),be(),co(),Kl(),ri(),hr(),lo(),Vf(),hw(),La(),pw()}}),ts=g({"out-build/external/sentry/core/tracing/index.js"(){"use strict";KL(),Zl(),mO(),hw(),Vf(),La(),La(),pw(),lo(),G9(),Q9(),uw()}});function vO(t){return new Gf(e=>{e(t)})}function wO(t){return new Gf((e,i)=>{i(t)})}var zf,gw,mw,Gf,Na=g({"out-build/external/sentry/core/utils/syncpromise.js"(){"use strict";vt(),zf=0,gw=1,mw=2,Gf=class R0{constructor(e){this._state=zf,this._handlers=[],this._runExecutor(e)}then(e,i){return new R0((r,s)=>{this._handlers.push([!1,n=>{if(!e)r(n);else try{r(e(n))}catch(o){s(o)}},n=>{if(!i)s(n);else try{r(i(n))}catch(o){s(o)}}]),this._executeHandlers()})}catch(e){return this.then(i=>i,e)}finally(e){return new R0((i,r)=>{let s,n;return this.then(o=>{n=!1,s=o,e&&e()},o=>{n=!0,s=o,e&&e()}).then(()=>{if(n){r(s);return}i(s)})})}_executeHandlers(){if(this._state===zf)return;const e=this._handlers.slice();this._handlers=[],e.forEach(i=>{i[0]||(this._state===gw&&i[1](this._value),this._state===mw&&i[2](this._value),i[0]=!0)})}_runExecutor(e){const i=(n,o)=>{if(this._state===zf){if(qv(o)){o.then(r,s);return}this._state=n,this._value=o,this._executeHandlers()}},r=n=>{i(gw,n)},s=n=>{i(mw,n)};try{e(r,s)}catch(n){s(n)}}}}}),tk=g({"out-build/external/sentry/core/eventProcessors.js"(){"use strict";je(),be(),vt(),Na()}});function ik(t,e){const{extra:i,tags:r,user:s,contexts:n,level:o,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:l,eventProcessors:u,attachments:d,propagationContext:f,transactionName:p,span:v}=e;Kf(t,"extra",i),Kf(t,"tags",r),Kf(t,"user",s),Kf(t,"contexts",n),t.sdkProcessingMetadata=Rf(t.sdkProcessingMetadata,a,2),o&&(t.level=o),p&&(t.transactionName=p),v&&(t.span=v),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),l.length&&(t.fingerprint=[...t.fingerprint,...l]),u.length&&(t.eventProcessors=[...t.eventProcessors,...u]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,...f}}function Kf(t,e,i){t[e]=Rf(t[e],i,1)}var vw=g({"out-build/external/sentry/core/utils/applyScopeDataToEvent.js"(){"use strict";lo(),Qv(),ri()}}),rk=g({"out-build/external/sentry/core/utils/debug-ids.js"(){"use strict";_t()}});function yO(t){if(t)return SO(t)?{captureContext:t}:_O(t)?{captureContext:t}:t}function SO(t){return t instanceof no||typeof t=="function"}function _O(t){return Object.keys(t).some(e=>sk.includes(e))}var sk,ww=g({"out-build/external/sentry/core/utils/prepareEvent.js"(){"use strict";jf(),Ge(),tk(),Yl(),vw(),rk(),Yi(),uo(),es(),hr(),sk=["user","level","extra","contexts","tags","fingerprint","propagationContext"]}});function Yf(t,e){return fr().captureException(t,yO(e))}function nk(t,e){const i=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return fr().captureMessage(t,i,r)}var hn=g({"out-build/external/sentry/core/exports.js"(){"use strict";Ge(),je(),Af(),be(),vt(),Yi(),ww(),hr(),_t()}});function bO(t){const e=t.protocol?`${t.protocol}:`:"",i=t.port?`:${t.port}`:"";return`${e}//${t.host}${i}${t.path?`/${t.path}`:""}/api/`}function EO(t){return`${bO(t)}${t.projectId}/envelope/`}function kO(t,e){const i={sentry_version:ok};return t.publicKey&&(i.sentry_key=t.publicKey),e&&(i.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(i).toString()}function PO(t,e,i){return e||`${EO(t)}?${kO(t,i)}`}var ok,yw=g({"out-build/external/sentry/core/api.js"(){"use strict";Ls(),ok="7"}});function DV(t){return t}var si=g({"out-build/external/sentry/core/integration.js"(){"use strict";Ge(),je(),be()}}),ak=g({"out-build/external/sentry/core/utils/clientreport.js"(){"use strict";gr(),hr()}});function xO(t){const e=[];t.message&&e.push(t.message);try{const i=t.exception.values[t.exception.values.length-1];i?.value&&(e.push(i.value),i.type&&e.push(`${i.type}: ${i.value}`))}catch{}return e}var ck=g({"out-build/external/sentry/core/utils/eventUtils.js"(){"use strict"}}),CO=g({"out-build/external/sentry/core/utils/transactionEvent.js"(){"use strict";gi()}});function IO(t,e){return e?Of(e,()=>{const i=U9(),r=i?HL(i):OL(e);return[i?ru(i):JL(t,e),r]}):[void 0,void 0]}var DO,AO,Sw=g({"out-build/external/sentry/core/client.js"(){"use strict";yw(),jf(),Ge(),je(),lw(),si(),Af(),lo(),ak(),be(),Ls(),gr(),ck(),vt(),Qv(),Yi(),tu(),ww(),ri(),Na(),CO(),DO=Symbol.for("SentryInternalError"),AO=Symbol.for("SentryDoNotSendEventError")}}),lk=g({"out-build/external/sentry/core/checkin.js"(){"use strict";Ls(),gr()}}),uk,RO=g({"out-build/external/sentry/core/logs/constants.js"(){"use strict";uk={trace:1,debug:5,info:9,warn:13,error:17,fatal:21}}});function MO(t){return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{items:t}]}function TO(t,e,i,r){const s={};return e?.sdk&&(s.sdk={name:e.sdk.name,version:e.sdk.version}),i&&r&&(s.dsn=B9(r)),q9(s,[MO(t)])}var WO=g({"out-build/external/sentry/core/logs/envelope.js"(){"use strict";Ls(),gr()}});function LO(t){switch(typeof t){case"number":return Number.isInteger(t)?{value:t,type:"integer"}:{value:t,type:"double"};case"boolean":return{value:t,type:"boolean"};case"string":return{value:t,type:"string"};default:{let e="";try{e=JSON.stringify(t)??""}catch{}return{value:e,type:"string"}}}}function fn(t,e,i,r=!0){i&&(!t[e]||r)&&(t[e]=i)}function OO(t,e){const i=_w(),r=hk(t);r===void 0?i.set(t,[e]):(i.set(t,[...r,e]),r.length>=fk&&FO(t,r))}function dk(t,e=pi(),i=fr(),r=OO){if(!e){Me&&Ne.warn("No client available to capture log.");return}const{release:s,environment:n,enableLogs:o,beforeSendLog:a,_experiments:c}=e.getOptions();if(!(o??c?.enableLogs)){Me&&Ne.warn("logging option not enabled, log will not be captured.");return}const u=a??c?.beforeSendLog,[,d]=IO(e,i),f={...t.attributes},{user:{id:p,email:v,username:m}}=NO(i);fn(f,"user.id",p,!1),fn(f,"user.email",v,!1),fn(f,"user.name",m,!1),fn(f,"sentry.release",s),fn(f,"sentry.environment",n);const{name:y,version:S}=e.getSdkMetadata()?.sdk??{};fn(f,"sentry.sdk.name",y),fn(f,"sentry.sdk.version",S);const E=t.message;if(u9(E)){const{__sentry_template_string__:Ke,__sentry_template_values__:ie=[]}=E;f["sentry.message.template"]=Ke,ie.forEach((Et,W)=>{f[`sentry.message.parameter.${W}`]=Et})}const k=Gl(i);fn(f,"sentry.trace.parent_span_id",k?.spanContext().spanId);const R={...t,attributes:f};e.emit("beforeCaptureLog",R);const C=u?Pf(()=>u(R)):R;if(!C){e.recordDroppedEvent("before_send","log_item",1),Me&&Ne.warn("beforeSendLog returned null, log will not be captured.");return}const{level:M,message:J,attributes:ne={},severityNumber:$}=C,ge={timestamp:zl(),level:M,body:J,trace_id:d?.trace_id,severity_number:$??uk[M],attributes:Object.keys(ne).reduce((Ke,ie)=>(Ke[ie]=LO(ne[ie]),Ke),{})};r(e,ge),e.emit("afterCaptureLog",C)}function FO(t,e){const i=e??hk(t)??[];if(i.length===0)return;const r=t.getOptions(),s=TO(i,r._metadata,r.tunnel,t.getDsn());_w().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(s)}function hk(t){return _w().get(t)}function NO(t){const e=LL().getScopeData();return ik(e,Ir().getScopeData()),ik(e,t.getScopeData()),e}function _w(){return Bl("clientToLogBufferMap",()=>new WeakMap)}var fk,bw=g({"out-build/external/sentry/core/logs/exports.js"(){"use strict";Cr(),Sw(),Ge(),je(),vw(),be(),vt(),Kl(),hr(),RO(),WO(),fk=100}});function UO(t,e){return t(e.stack||"",1)}function $O(t,e){const i={type:e.name||e.constructor.name,value:e.message},r=UO(t,e);return r.length&&(i.stacktrace={frames:r}),i}var Ew=g({"out-build/external/sentry/core/utils/eventbuilder.js"(){"use strict";vt(),Yi(),uo(),fi()}}),BO=g({"out-build/external/sentry/core/server-runtime-client.js"(){"use strict";lk(),Sw(),Ge(),je(),bw(),ts(),be(),Ew(),vt(),Yi(),Na()}}),jO=g({"out-build/external/sentry/core/sdk.js"(){"use strict";Ge(),je(),be()}});function HO(t){const e=[];function i(){return t===void 0||e.length<t}function r(o){return e.splice(e.indexOf(o),1)[0]||Promise.resolve(void 0)}function s(o){if(!i())return wO(pk);const a=o();return e.indexOf(a)===-1&&e.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function n(o){return new Gf((a,c)=>{let l=e.length;if(!l)return a(!0);const u=setTimeout(()=>{o&&o>0&&a(!1)},o);e.forEach(d=>{vO(d).then(()=>{--l||(clearTimeout(u),a(!0))},c)})})}return{$:e,add:s,drain:n}}var pk,kw=g({"out-build/external/sentry/core/utils/promisebuffer.js"(){"use strict";Na(),pk=Symbol.for("SentryBufferFullError")}}),VO,Pw=g({"out-build/external/sentry/core/utils/ratelimit.js"(){"use strict";VO=60*1e3}}),qO=g({"out-build/external/sentry/core/transports/base.js"(){"use strict";je(),be(),gr(),kw(),Pw(),Na()}}),zO=g({"out-build/external/sentry/core/transports/offline.js"(){"use strict";je(),be(),gr(),Pw()}}),GO=g({"out-build/external/sentry/core/transports/multiplexed.js"(){"use strict";yw(),Ls(),gr()}}),KO=g({"out-build/external/sentry/core/utils/isSentryRequestUrl.js"(){"use strict"}}),YO=g({"out-build/external/sentry/core/utils/parameterize.js"(){"use strict"}}),JO=g({"out-build/external/sentry/core/utils/ipAddress.js"(){"use strict"}}),QO=g({"out-build/external/sentry/core/utils/sdkMetadata.js"(){"use strict";Nv()}}),xw=g({"out-build/external/sentry/core/utils/traceData.js"(){"use strict";Ql(),Cr(),Ge(),hn(),ts(),eu(),be(),ri(),Uf()}}),XO=g({"out-build/external/sentry/core/utils/meta.js"(){"use strict";xw()}}),ZO=g({"out-build/external/sentry/core/utils/debounce.js"(){"use strict"}}),eF=g({"out-build/external/sentry/core/utils/request.js"(){"use strict"}});function gk(t,e){const i=pi(),r=Ir();if(!i)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:n=mk}=i.getOptions();if(n<=0)return;const a={timestamp:Yv(),...t},c=s?Pf(()=>s(a,e)):a;c!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",c,e),r.addBreadcrumb(c,n))}var mk,Cw=g({"out-build/external/sentry/core/breadcrumbs.js"(){"use strict";Ge(),be(),hr(),mk=100}}),vk,wk,Iw,yk,tF,iF=g({"out-build/external/sentry/core/integrations/functiontostring.js"(){"use strict";Ge(),si(),fi(),wk="FunctionToString",Iw=new WeakMap,yk=(()=>({name:wk,setupOnce(){vk=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=EL(this),i=Iw.has(pi())&&e!==void 0?e:this;return vk.apply(i,t)}}catch{}},setup(t){Iw.set(t,!0)}})),tF=yk}});function Sk(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:_k],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function rF(t,e){if(t.type){if(t.type==="transaction"&&nF(t,e.ignoreTransactions))return Me&&Ne.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
Event: ${Ma(t)}`),!0}else{if(sF(t,e.ignoreErrors))return Me&&Ne.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
Event: ${Ma(t)}`),!0;if(lF(t))return Me&&Ne.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
Event: ${Ma(t)}`),!0;if(oF(t,e.denyUrls))return Me&&Ne.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
Event: ${Ma(t)}.
|
|
Url: ${Jf(t)}`),!0;if(!aF(t,e.allowUrls))return Me&&Ne.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
Event: ${Ma(t)}.
|
|
Url: ${Jf(t)}`),!0}return!1}function sF(t,e){return e?.length?xO(t).some(i=>Df(i,e)):!1}function nF(t,e){if(!e?.length)return!1;const i=t.transaction;return i?Df(i,e):!1}function oF(t,e){if(!e?.length)return!1;const i=Jf(t);return i?Df(i,e):!1}function aF(t,e){if(!e?.length)return!0;const i=Jf(t);return i?Df(i,e):!0}function cF(t=[]){for(let e=t.length-1;e>=0;e--){const i=t[e];if(i&&i.filename!=="<anonymous>"&&i.filename!=="[native code]")return i.filename||null}return null}function Jf(t){try{const i=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return i?cF(i):null}catch{return Me&&Ne.error(`Cannot extract url for event ${Ma(t)}`),null}}function lF(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}var _k,bk,Ek,uF,kk=g({"out-build/external/sentry/core/integrations/eventFilters.js"(){"use strict";je(),si(),be(),ck(),Yi(),es(),_k=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],bk="EventFilters",Ek=(t={})=>{let e;return{name:bk,setup(i){const r=i.getOptions();e=Sk(t,r)},processEvent(i,r,s){if(!e){const n=s.getOptions();e=Sk(t,n)}return rF(i,e)?null:i}}},uF=((t={})=>({...Ek(t),name:"InboundFilters"}))}});function dF(t,e,i,r,s,n){if(!s.exception?.values||!n||!so(n.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=Dw(t,e,r,n.originalException,i,s.exception.values,o,0))}function Dw(t,e,i,r,s,n,o,a){if(n.length>=i+1)return n;let c=[...n];if(so(r[s],Error)){Pk(o,a);const l=t(e,r[s]),u=c.length;xk(l,s,u,a),c=Dw(t,e,i,r[s],s,[l,...c],l,u)}return Array.isArray(r.errors)&&r.errors.forEach((l,u)=>{if(so(l,Error)){Pk(o,a);const d=t(e,l),f=c.length;xk(d,`errors[${u}]`,f,a),c=Dw(t,e,i,l,s,[d,...c],d,f)}}),c}function Pk(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function xk(t,e,i,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:i,parent_id:r}}var Ck=g({"out-build/external/sentry/core/utils/aggregate-errors.js"(){"use strict";vt()}}),Ik,Dk,Ak,Rk,hF,fF=g({"out-build/external/sentry/core/integrations/linkederrors.js"(){"use strict";si(),Ck(),Ew(),Ik="cause",Dk=5,Ak="LinkedErrors",Rk=((t={})=>{const e=t.limit||Dk,i=t.key||Ik;return{name:Ak,preprocessEvent(r,s,n){const o=n.getOptions();dF($O,o.stackParser,i,e,r,s)}}}),hF=Rk}});function pF(t){if(at._sentryModuleMetadata)for(const e of Object.keys(at._sentryModuleMetadata)){const i=at._sentryModuleMetadata[e];if(Rw.has(e))continue;Rw.add(e);const r=t(e);for(const s of r.reverse())if(s.filename){Aw.set(s.filename,i);break}}}function gF(t,e){return pF(t),Aw.get(e)}function Mk(t,e){try{e.exception.values.forEach(i=>{if(i.stacktrace)for(const r of i.stacktrace.frames||[]){if(!r.filename||r.module_metadata)continue;const s=gF(t,r.filename);s&&(r.module_metadata=s)}})}catch{}}function Tk(t){try{t.exception.values.forEach(e=>{if(e.stacktrace)for(const i of e.stacktrace.frames||[])delete i.module_metadata})}catch{}}var Aw,Rw,Wk=g({"out-build/external/sentry/core/metadata.js"(){"use strict";_t(),Aw=new Map,Rw=new Set}}),mF,vF=g({"out-build/external/sentry/core/integrations/metadata.js"(){"use strict";si(),Wk(),gr(),mF=()=>({name:"ModuleMetadata",setup(t){t.on("beforeEnvelope",e=>{cw(e,(i,r)=>{if(r==="event"){const s=Array.isArray(i)?i[1]:void 0;s&&(Tk(s),i[1]=s)}})}),t.on("applyFrameMetadata",e=>{if(e.type)return;const i=t.getOptions().stackParser;Mk(i,e)})}})}});function wF(t){const e={};let i=0;for(;i<t.length;){const r=t.indexOf("=",i);if(r===-1)break;let s=t.indexOf(";",i);if(s===-1)s=t.length;else if(s<r){i=t.lastIndexOf(";",r-1)+1;continue}const n=t.slice(i,r).trim();if(e[n]===void 0){let o=t.slice(r+1,s).trim();o.charCodeAt(0)===34&&(o=o.slice(1,-1));try{e[n]=o.indexOf("%")!==-1?decodeURIComponent(o):o}catch{e[n]=o}}i=s+1}return e}var yF=g({"out-build/external/sentry/core/utils/cookie.js"(){"use strict"}});function SF(t){return Mw.map(s=>{const n=t[s],o=Array.isArray(n)?n.join(";"):n;return s==="Forwarded"?_F(o):o?.split(",").map(a=>a.trim())}).reduce((s,n)=>n?s.concat(n):s,[]).find(s=>s!==null&&bF(s))||null}function _F(t){if(!t)return null;for(const e of t.split(";"))if(e.startsWith("for="))return e.slice(4);return null}function bF(t){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(t)}var Mw,EF=g({"out-build/external/sentry/core/vendor/getIpAddress.js"(){"use strict";Mw=["X-Client-IP","X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP","Fastly-Client-Ip","True-Client-Ip","X-Real-IP","X-Cluster-Client-IP","X-Forwarded","Forwarded-For","Forwarded","X-Vercel-Forwarded-For"]}});function kF(t,e,i,r){if(t.request={...t.request,...PF(e,r)},r.ip){const s=e.headers&&SF(e.headers)||i.ipAddress;s&&(t.user={...t.user,ip_address:s})}}function PF(t,e){const i={},r={...t.headers};if(e.headers&&(i.headers=r,e.cookies||delete r.cookie,e.ip||Mw.forEach(s=>{delete r[s]})),i.method=t.method,e.url&&(i.url=t.url),e.cookies){const s=t.cookies||(r?.cookie?wF(r.cookie):void 0);i.cookies=s||{}}return e.query_string&&(i.query_string=t.query_string),e.data&&(i.data=t.data),i}var Lk,Ok,Fk,xF,CF=g({"out-build/external/sentry/core/integrations/requestdata.js"(){"use strict";si(),yF(),EF(),Lk={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},Ok="RequestData",Fk=((t={})=>{const e={...Lk,...t.include};return{name:Ok,processEvent(i,r,s){const{sdkProcessingMetadata:n={}}=i,{normalizedRequest:o,ipAddress:a}=n,c={...e,ip:e.ip??s.getOptions().sendDefaultPii};return o&&kF(i,o,{ipAddress:a},c),i}}}),xF=Fk}});function Tw(t){const e="console";uL(e,t),dL(e,IF)}function IF(){"console"in at&&jl.forEach(function(t){t in at.console&&_L(at.console,t,function(e){return Hl[t]=e,function(...i){hL("console",{args:i,level:t}),Hl[t]?.apply(at.console,i)}})})}var Qf=g({"out-build/external/sentry/core/instrument/console.js"(){"use strict";be(),fi(),_t(),ql()}});function Nk(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var Ww=g({"out-build/external/sentry/core/utils/severity.js"(){"use strict"}});function DF(t,e,i){const r={level:Nk(e),extra:{arguments:t}};Of(s=>{if(s.addEventProcessor(a=>(a.logger="console",xL(a,{handled:i,type:"console"}),a)),e==="assert"){if(!t[0]){const a=`Assertion failed: ${Kv(t.slice(1)," ")||"console.assert"}`;s.setExtra("arguments",t.slice(1)),nk(a,r)}return}const n=t.find(a=>a instanceof Error);if(n){Yf(n,r);return}const o=Kv(t," ");nk(o,r)})}var Uk,$k,AF,RF=g({"out-build/external/sentry/core/integrations/captureconsole.js"(){"use strict";Ge(),hn(),Qf(),si(),be(),Yi(),Ww(),es(),_t(),Uk="CaptureConsole",$k=((t={})=>{const e=t.levels||jl,i=t.handled??!0;return{name:Uk,setup(r){"console"in at&&Tw(({args:s,level:n})=>{pi()!==r||!e.includes(n)||DF(s,n,i)})}}}),AF=$k}});function MF(t,e){return e?!!(TF(t,e)||WF(t,e)):!1}function TF(t,e){const i=t.message,r=e.message;return!(!i&&!r||i&&!r||!i&&r||i!==r||!jk(t,e)||!Bk(t,e))}function WF(t,e){const i=Hk(e),r=Hk(t);return!(!i||!r||i.type!==r.type||i.value!==r.value||!jk(t,e)||!Bk(t,e))}function Bk(t,e){let i=jv(t),r=jv(e);if(!i&&!r)return!0;if(i&&!r||!i&&r||(i=i,r=r,r.length!==i.length))return!1;for(let s=0;s<r.length;s++){const n=r[s],o=i[s];if(n.filename!==o.filename||n.lineno!==o.lineno||n.colno!==o.colno||n.function!==o.function)return!1}return!0}function jk(t,e){let i=t.fingerprint,r=e.fingerprint;if(!i&&!r)return!0;if(i&&!r||!i&&r)return!1;i=i,r=r;try{return i.join("")===r.join("")}catch{return!1}}function Hk(t){return t.exception?.values?.[0]}var Vk,qk,LF,OF=g({"out-build/external/sentry/core/integrations/dedupe.js"(){"use strict";je(),si(),be(),ro(),Vk="Dedupe",qk=(()=>{let t;return{name:Vk,processEvent(e){if(e.type)return e;try{if(MF(e,t))return Me&&Ne.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}}),LF=qk}});function FF(t,e={},i,r,s){if(!e.originalException||!Aa(e.originalException))return t;const n=e.originalException.name||e.originalException.constructor.name,o=NF(e.originalException,r,s);if(o){const a={...t.contexts},c=V9(o,i);return If(c)&&(un(c,"__sentry_skip_normalization__",!0),a[n]=c),{...t,contexts:a}}return t}function NF(t,e,i){try{const r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],s={};for(const n of Object.keys(t)){if(r.indexOf(n)!==-1)continue;const o=t[n];s[n]=Aa(o)||typeof o=="string"?Gv(`${o}`,i):o}if(e&&t.cause!==void 0&&(s.cause=Aa(t.cause)?t.cause.toString():t.cause),typeof t.toJSON=="function"){const n=t.toJSON();for(const o of Object.keys(n)){const a=n[o];s[o]=Aa(a)?a.toString():a}}return s}catch(r){Me&&Ne.error("Unable to extract extra data from the Error object:",r)}return null}var zk,Gk,UF,$F=g({"out-build/external/sentry/core/integrations/extraerrordata.js"(){"use strict";je(),si(),be(),vt(),uo(),fi(),es(),zk="ExtraErrorData",Gk=((t={})=>{const{depth:e=3,captureErrorCause:i=!0}=t;return{name:zk,processEvent(r,s,n){const{maxValueLength:o=250}=n.getOptions();return FF(r,s,e,i,o)}}}),UF=Gk}});function BF(t,e){let i=0;for(let r=t.length-1;r>=0;r--){const s=t[r];s==="."?t.splice(r,1):s===".."?(t.splice(r,1),i++):i&&(t.splice(r,1),i--)}if(e)for(;i--;i)t.unshift("..");return t}function jF(t){const e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,i=Jk.exec(e);return i?i.slice(1):[]}function Kk(...t){let e="",i=!1;for(let r=t.length-1;r>=-1&&!i;r--){const s=r>=0?t[r]:"/";s&&(e=`${s}/${e}`,i=s.charAt(0)==="/")}return e=BF(e.split("/").filter(r=>!!r),!i).join("/"),(i?"/":"")+e||"."}function Yk(t){let e=0;for(;e<t.length&&t[e]==="";e++);let i=t.length-1;for(;i>=0&&t[i]==="";i--);return e>i?[]:t.slice(e,i-e+1)}function HF(t,e){t=Kk(t).slice(1),e=Kk(e).slice(1);const i=Yk(t.split("/")),r=Yk(e.split("/")),s=Math.min(i.length,r.length);let n=s;for(let a=0;a<s;a++)if(i[a]!==r[a]){n=a;break}let o=[];for(let a=n;a<i.length;a++)o.push("..");return o=o.concat(r.slice(n)),o.join("/")}function VF(t,e){let i=jF(t)[2]||"";return e&&i.slice(e.length*-1)===e&&(i=i.slice(0,i.length-e.length)),i}var Jk,Qk=g({"out-build/external/sentry/core/utils/path.js"(){"use strict";Jk=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/}});function qF({isBrowser:t,root:e,prefix:i}){return r=>{if(!r.filename)return r;const s=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),n=/^\//.test(r.filename);if(t){if(e){const o=r.filename;o.indexOf(e)===0&&(r.filename=o.replace(e,i))}}else if(s||n){const o=s?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,a=e?HF(e,o):VF(o);r.filename=`${i}${a}`}return r}}var Xk,zF,GF=g({"out-build/external/sentry/core/integrations/rewriteframes.js"(){"use strict";si(),Qk(),_t(),Xk="RewriteFrames",zF=(t={})=>{const e=t.root,i=t.prefix||"app:///",r="window"in at&&!!at.window,s=t.iteratee||qF({isBrowser:r,root:e,prefix:i});function n(a){try{return{...a,exception:{...a.exception,values:a.exception.values.map(c=>({...c,...c.stacktrace&&{stacktrace:o(c.stacktrace)}}))}}}catch{return a}}function o(a){return{...a,frames:a?.frames?.map(c=>s(c))}}return{name:Xk,processEvent(a){let c=a;return a.exception&&Array.isArray(a.exception.values)&&(c=n(c)),c}}}}});function Xf(t){try{t.__SENTRY_INSTRUMENTED__=!0}catch{}}function Zf(t){try{return t.__SENTRY_INSTRUMENTED__}catch{return!1}}function KF(t,e={}){switch(t){case"GET":return"select";case"POST":return e.Prefer?.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return"<unknown-op>"}}function YF(t,e){if(e===""||e==="*")return"select(*)";if(t==="select")return`select(${e})`;if(t==="or"||t.endsWith(".or"))return`${t}${e}`;const[i,...r]=e.split(".");let s;return i?.startsWith("fts")?s="textSearch":i?.startsWith("plfts")?s="textSearch[plain]":i?.startsWith("phfts")?s="textSearch[phrase]":i?.startsWith("wfts")?s="textSearch[websearch]":s=i&&i7[i]||"filter",`${s}(${t}, ${r.join(".")})`}function Zk(t,e=!1){return new Proxy(t,{apply(i,r,s){return X9({name:`auth ${e?"(admin) ":""}${t.name}`,attributes:{[oo]:"auto.db.supabase",[Wa]:"db","db.system":"postgresql","db.operation":`auth.${e?"admin.":""}${t.name}`}},n=>Reflect.apply(i,r,s).then(o=>(o&&typeof o=="object"&&"error"in o&&o.error?(n.setStatus({code:ii}),Yf(o.error,{mechanism:{handled:!1}})):n.setStatus({code:Ff}),n.end(),o)).catch(o=>{throw n.setStatus({code:ii}),n.end(),Yf(o,{mechanism:{handled:!1}}),o}).then(...s))}})}function JF(t){const e=t.auth;if(!(!e||Zf(t.auth))){for(const i of e7){const r=e[i];r&&typeof t.auth[i]=="function"&&(t.auth[i]=Zk(r))}for(const i of t7){const r=e.admin[i];r&&typeof t.auth.admin[i]=="function"&&(t.auth.admin[i]=Zk(r,!0))}Xf(t.auth)}}function QF(t){Zf(t.prototype.from)||(t.prototype.from=new Proxy(t.prototype.from,{apply(e,i,r){const s=Reflect.apply(e,i,r),n=s.constructor;return ZF(n),s}}),Xf(t.prototype.from))}function XF(t){Zf(t.prototype.then)||(t.prototype.then=new Proxy(t.prototype.then,{apply(e,i,r){const s=Lw,n=i,o=KF(n.method,n.headers);if(!s.includes(o)||!n?.url?.pathname||typeof n.url.pathname!="string")return Reflect.apply(e,i,r);const a=n.url.pathname.split("/"),c=a.length>0?a[a.length-1]:"",l=[];for(const[p,v]of n.url.searchParams.entries())l.push(YF(p,v));const u=Object.create(null);if(If(n.body))for(const[p,v]of Object.entries(n.body))u[p]=v;const d=`${o==="select"?"":`${o}${u?"(...) ":""}`}${l.join(" ")} from(${c})`,f={"db.table":c,"db.schema":n.schema,"db.url":n.url.origin,"db.sdk":n.headers["X-Client-Info"],"db.system":"postgresql","db.operation":o,[oo]:"auto.db.supabase",[Wa]:"db"};return l.length&&(f["db.query"]=l),Object.keys(u).length&&(f["db.body"]=u),X9({name:d,attributes:f},p=>Reflect.apply(e,i,[]).then(v=>{if(p&&(v&&typeof v=="object"&&"status"in v&&D9(p,v.status||500),p.end()),v.error){const S=new Error(v.error.message);v.error.code&&(S.code=v.error.code),v.error.details&&(S.details=v.error.details);const E={};l.length&&(E.query=l),Object.keys(u).length&&(E.body=u),Yf(S,{contexts:{supabase:E}})}const m={type:"supabase",category:`db.${o}`,message:d},y={};return l.length&&(y.query=l),Object.keys(u).length&&(y.body=u),Object.keys(y).length&&(m.data=y),gk(m),v},v=>{throw p&&(D9(p,500),p.end()),v}).then(...r))}}),Xf(t.prototype.then))}function ZF(t){for(const e of Lw)Zf(t.prototype[e])||(t.prototype[e]=new Proxy(t.prototype[e],{apply(i,r,s){const n=Reflect.apply(i,r,s),o=n.constructor;return Me&&Ne.log(`Instrumenting ${e} operation's PostgRESTFilterBuilder`),XF(o),n}}),Xf(t.prototype[e]))}var e7,t7,i7,Lw,r7,s7,n7,eN,tN=g({"out-build/external/sentry/core/integrations/supabase.js"(){"use strict";Cw(),je(),hn(),si(),gi(),ts(),be(),vt(),e7=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],t7=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],i7={eq:"eq",neq:"neq",gt:"gt",gte:"gte",lt:"lt",lte:"lte",like:"like","like(all)":"likeAllOf","like(any)":"likeAnyOf",ilike:"ilike","ilike(all)":"ilikeAllOf","ilike(any)":"ilikeAnyOf",is:"is",in:"in",cs:"contains",cd:"containedBy",sr:"rangeGt",nxl:"rangeGte",sl:"rangeLt",nxr:"rangeLte",adj:"rangeAdjacent",ov:"overlaps",fts:"",plfts:"plain",phfts:"phrase",wfts:"websearch",not:"not"},Lw=["select","insert","upsert","update","delete"],r7=t=>{if(!t){Me&&Ne.warn("Supabase integration was not installed because no Supabase client was provided.");return}const e=t.constructor===Function?t:t.constructor;QF(e),JF(t)},s7="Supabase",n7=(t=>({setupOnce(){r7(t)},name:s7})),eN=t=>n7(t.supabaseClient)}});function iN(t){return Aa(t)&&t.name==="ZodError"&&Array.isArray(t.issues)}function rN(t){return{...t,path:"path"in t&&Array.isArray(t.path)?t.path.join("."):void 0,keys:"keys"in t?JSON.stringify(t.keys):void 0,unionErrors:"unionErrors"in t?JSON.stringify(t.unionErrors):void 0}}function sN(t){return t.map(e=>typeof e=="number"?"<array>":e).join(".")}function nN(t){const e=new Set;for(const r of t.issues){const s=sN(r.path);s.length>0&&e.add(s)}const i=Array.from(e);if(i.length===0){let r="variable";if(t.issues.length>0){const s=t.issues[0];s!==void 0&&"expected"in s&&typeof s.expected=="string"&&(r=s.expected)}return`Failed to validate ${r}`}return`Failed to validate keys: ${Gv(i.join(", "),100)}`}function oN(t,e=!1,i,r){if(!i.exception?.values||!r.originalException||!iN(r.originalException)||r.originalException.issues.length===0)return i;try{const n=(e?r.originalException.issues:r.originalException.issues.slice(0,t)).map(rN);return e&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:"zod_issues.json",data:JSON.stringify({issues:n})})),{...i,exception:{...i.exception,values:[{...i.exception.values[0],value:nN(r.originalException)},...i.exception.values.slice(1)]},extra:{...i.extra,"zoderror.issues":n.slice(0,t)}}}catch(s){return{...i,extra:{...i.extra,"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:s instanceof Error?`${s.name}: ${s.message}
|
|
${s.stack}`:"unknown"}}}}}var o7,a7,c7,aN,cN=g({"out-build/external/sentry/core/integrations/zoderrors.js"(){"use strict";si(),vt(),es(),o7=10,a7="ZodErrors",c7=((t={})=>{const e=t.limit??o7;return{name:a7,processEvent(i,r){return oN(e,t.saveZodIssuesAsAttachment,i,r)}}}),aN=c7}});function lN(t){const e=jv(t);if(e)return e.filter(i=>!!i.filename).map(i=>i.module_metadata?Object.keys(i.module_metadata).filter(r=>r.startsWith(Ow)).map(r=>r.slice(Ow.length)):[])}var uN,Ow,dN=g({"out-build/external/sentry/core/integrations/third-party-errors-filter.js"(){"use strict";si(),Wk(),gr(),ro(),uN=t=>({name:"ThirdPartyErrorsFilter",setup(e){e.on("beforeEnvelope",i=>{cw(i,(r,s)=>{if(s==="event"){const n=Array.isArray(r)?r[1]:void 0;n&&(Tk(n),r[1]=n)}})}),e.on("applyFrameMetadata",i=>{if(i.type)return;const r=e.getOptions().stackParser;Mk(r,i)})},processEvent(e){const i=lN(e);if(i){const r=t.behaviour==="drop-error-if-contains-third-party-frames"||t.behaviour==="apply-tag-if-contains-third-party-frames"?"some":"every";if(i[r](n=>!n.some(o=>t.filterKeys.includes(o)))){if(t.behaviour==="drop-error-if-contains-third-party-frames"||t.behaviour==="drop-error-if-exclusively-contains-third-party-frames")return null;e.tags={...e.tags,third_party_code:!0}}}return e}}),Ow="_sentryBundlerPluginAppKey:"}});function hN(t,e){const i={category:"console",data:{arguments:e,logger:"console"},level:Nk(t),message:l7(e)};if(t==="assert")if(e[0]===!1){const r=e.slice(1);i.message=r.length>0?`Assertion failed: ${l7(r)}`:"Assertion failed",i.data.arguments=r}else return;gk(i,{input:e,level:t})}function l7(t){return"util"in at&&typeof at.util.format=="function"?at.util.format(...t):Kv(t," ")}var u7,fN,pN=g({"out-build/external/sentry/core/integrations/console.js"(){"use strict";Cw(),Ge(),Qf(),si(),be(),Ww(),es(),_t(),u7="Console",fN=(t={})=>{const e=new Set(t.levels||jl);return{name:u7,setup(i){Tw(({args:r,level:s})=>{pi()!==i||!e.has(s)||hN(s,r)})}}}}});function gN(t){const i=fr().getScopeData().contexts.flags,r=i?i.values:[];return r.length&&(t.contexts===void 0&&(t.contexts={}),t.contexts.flags={values:[...r]}),t}function mN(t,e,i=d7){const r=fr().getScopeData().contexts;r.flags||(r.flags={values:[]});const s=r.flags.values;vN(s,t,e,i)}function vN(t,e,i,r){if(typeof i!="boolean")return;if(t.length>r){Me&&Ne.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}const s=t.findIndex(n=>n.flag===e);s!==-1&&t.splice(s,1),t.length===r&&t.shift(),t.push({flag:e,result:i})}function wN(t,e,i=h7){if(typeof e!="boolean")return;const r=U9();if(!r)return;const s=pr(r).data;if(`${su}${t}`in s){r.setAttribute(`${su}${t}`,e);return}Object.keys(s).filter(o=>o.startsWith(su)).length<i&&r.setAttribute(`${su}${t}`,e)}var d7,h7,su,f7=g({"out-build/external/sentry/core/utils/featureFlags.js"(){"use strict";Ge(),je(),be(),ri(),d7=100,h7=10,su="flag.evaluation."}}),yN,SN=g({"out-build/external/sentry/core/integrations/featureFlags/featureFlagsIntegration.js"(){"use strict";si(),f7(),yN=()=>({name:"FeatureFlags",processEvent(t,e,i){return gN(t)},addFeatureFlag(t,e){mN(t,e),wN(t,e)}})}}),_N=g({"out-build/external/sentry/core/integrations/featureFlags/index.js"(){"use strict";SN()}}),bN=g({"out-build/external/sentry/core/profiling.js"(){"use strict";Ge(),je(),be()}}),Fw=g({"out-build/external/sentry/core/utils/url.js"(){"use strict";gi()}}),EN=g({"out-build/external/sentry/core/fetch.js"(){"use strict";Ge(),gi(),ts(),Vf(),eu(),co(),vt(),ri(),xw(),Fw()}}),kN=g({"out-build/external/sentry/core/trpc.js"(){"use strict";Ge(),hn(),gi(),ts(),uo(),fi()}}),p7=g({"out-build/external/sentry/core/integrations/mcp-server/errorCapture.js"(){"use strict";Ge(),hn(),ts(),ri()}}),PN=g({"out-build/external/sentry/core/integrations/mcp-server/handlers.js"(){"use strict";je(),be(),fi(),p7()}}),ep=g({"out-build/external/sentry/core/integrations/mcp-server/attributes.js"(){"use strict"}}),g7=g({"out-build/external/sentry/core/integrations/mcp-server/methodConfig.js"(){"use strict";ep()}}),m7=g({"out-build/external/sentry/core/integrations/mcp-server/sessionManagement.js"(){"use strict"}}),Nw=g({"out-build/external/sentry/core/integrations/mcp-server/attributeExtraction.js"(){"use strict";Fw(),ep(),g7(),m7()}}),v7=g({"out-build/external/sentry/core/integrations/mcp-server/piiFiltering.js"(){"use strict";ep()}}),xN=g({"out-build/external/sentry/core/integrations/mcp-server/correlation.js"(){"use strict";Ge(),ts(),Nw(),v7()}}),CN=g({"out-build/external/sentry/core/integrations/mcp-server/spans.js"(){"use strict";Ge(),gi(),ts(),Nw(),ep(),g7(),v7()}}),w7=g({"out-build/external/sentry/core/integrations/mcp-server/validation.js"(){"use strict";je(),be()}}),IN=g({"out-build/external/sentry/core/integrations/mcp-server/transport.js"(){"use strict";Ge(),ts(),fi(),Nw(),xN(),p7(),m7(),CN(),w7()}}),DN=g({"out-build/external/sentry/core/integrations/mcp-server/index.js"(){"use strict";fi(),PN(),IN(),w7()}}),AN=g({"out-build/external/sentry/core/feedback.js"(){"use strict";Ge()}});function y7(t,e,i){return"util"in at&&typeof at.util.format=="function"?at.util.format(...t):RN(t,e,i)}function RN(t,e,i){return t.map(r=>fL(r)?String(r):JSON.stringify(V9(r,e,i))).join(" ")}var S7,Uw,_7,MN,TN=g({"out-build/external/sentry/core/logs/console-integration.js"(){"use strict";Ge(),je(),Qf(),si(),gi(),be(),vt(),uo(),_t(),bw(),S7="ConsoleLogs",Uw={[oo]:"auto.console.logging"},_7=((t={})=>{const e=t.levels||jl;return{name:S7,setup(i){const{enableLogs:r,_experiments:s,normalizeDepth:n=3,normalizeMaxBreadth:o=1e3}=i.getOptions();if(!(r??s?.enableLogs)){Me&&Ne.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}Tw(({args:c,level:l})=>{if(pi()!==i||!e.includes(l))return;if(l==="assert"){if(!c[0]){const d=c.slice(1),f=d.length>0?`Assertion failed: ${y7(d,n,o)}`:"Assertion failed";dk({level:"error",message:f,attributes:Uw})}return}const u=l==="log";dk({level:u?"info":l,message:y7(c,n,o),severityNumber:u?10:void 0,attributes:Uw})})}}}),MN=_7}}),WN=g({"out-build/external/sentry/core/utils/vercel-ai-attributes.js"(){"use strict"}}),LN=g({"out-build/external/sentry/core/utils/vercel-ai.js"(){"use strict";gi(),ri(),WN()}}),b7=g({"out-build/external/sentry/core/utils/gen-ai-attributes.js"(){"use strict"}}),$w=g({"out-build/external/sentry/core/utils/openai/constants.js"(){"use strict"}}),ON=g({"out-build/external/sentry/core/utils/openai/utils.js"(){"use strict";b7(),$w()}}),FN=g({"out-build/external/sentry/core/utils/openai/index.js"(){"use strict";Ge(),hn(),pw(),b7(),$w(),ON()}}),NN=g({"out-build/external/sentry/core/utils/breadcrumb-log-level.js"(){"use strict"}}),E7,k7=g({"out-build/external/sentry/core/utils/error.js"(){"use strict";E7=class extends Error{constructor(t,e="warn"){super(t),this.message=t,this.logLevel=e}}}}),P7=g({"out-build/external/sentry/core/utils/supports.js"(){"use strict";je(),be(),_t()}}),UN=g({"out-build/external/sentry/core/instrument/fetch.js"(){"use strict";vt(),fi(),P7(),hr(),_t(),ql()}}),x7=g({"out-build/external/sentry/core/utils/env.js"(){"use strict"}}),C7=g({"out-build/external/sentry/core/utils/node.js"(){"use strict";x7()}}),$N=g({"out-build/external/sentry/core/utils/isBrowser.js"(){"use strict";C7(),_t()}}),I7=g({"out-build/external/sentry/core/utils/node-stack-trace.js"(){"use strict";ro()}}),BN=g({"out-build/external/sentry/core/utils/anr.js"(){"use strict";I7(),ro()}}),jN=g({"out-build/external/sentry/core/utils/lru.js"(){"use strict"}}),D7=g({"out-build/external/sentry/core/utils/vercelWaitUntil.js"(){"use strict";_t()}}),HN=g({"out-build/external/sentry/core/utils/flushIfServerless.js"(){"use strict";hn(),be(),D7(),_t()}}),Bw=g({"out-build/external/sentry/core/index.js"(){"use strict";ts(),gi(),lw(),hn(),Ge(),_9(),Ql(),Cr(),Af(),Yl(),tk(),yw(),Sw(),BO(),jO(),qO(),zO(),GO(),si(),vw(),ww(),lk(),co(),co(),KO(),J9(),YO(),JO(),ri(),tu(),QO(),xw(),XO(),ZO(),eF(),jf(),Cw(),iF(),kk(),kk(),fF(),vF(),CF(),RF(),OF(),$F(),GF(),tN(),cN(),dN(),pN(),_N(),bN(),EN(),kN(),DN(),AN(),bw(),TN(),LN(),FN(),$w(),f7(),Ck(),NN(),p9(),Ls(),k7(),_t(),Qf(),UN(),c9(),l9(),ql(),vt(),$N(),be(),Yi(),C7(),uo(),fi(),Qk(),kw(),Ww(),ro(),I7(),es(),P7(),Na(),hr(),Uf(),x7(),gr(),ak(),Pw(),eu(),Fw(),Ew(),BN(),jN(),dn(),D7(),HN(),Nv(),rk(),g9()}});function A7(t){let e;const i=[];let r;return cw(t,(s,n)=>{if(n==="event"||n==="transaction"||n==="feedback")e=Array.isArray(s)?s[1]:void 0;else if(n==="attachment"){const[o,a]=s;i.push({filename:o.filename,attachmentType:o.attachment_type,contentType:o.content_type,data:a})}else n==="profile"&&(r=s[1])}),e?[e,i,r]:void 0}var VN=g({"out-build/external/sentry/electron/common/envelope.js"(){"use strict";Bw()}}),jw=g({"out-build/vs/platform/tracing/common/sentry.js"(){"use strict";Bw(),gi(),VN(),Bw(),gr(),k7(),Yi(),kw()}});function qN(t,e){return e.onProcessConfigUpdate(i=>{Yt().enabled=i.enabled,Yt().loggerSampleRate=i.loggerSampleRate,Yt().tracesSampleRate=i.tracesSampleRate,Yt().profilesSampleRate=i.profilesSampleRate,Yt().jsonStringifySampleRate=i.jsonStringifySampleRate})}function zN(t,e,i=HO(64)){const r={flush:n=>i.drain(n),send:n=>i.add(()=>e.sendEnvelope(t,n)).then(()=>({statusCode:200}),o=>{if(o instanceof E7)return{};throw o})},s=Yt().buffer;for(const n of s)r.send(n);return Yt().buffer=[],Yt().transport=r,N.None}function GN(t,e){if(t==="main")return N.None;const i=r=>{const s={};r.breadcrumbs.length>0&&(s.breadcrumbs=r.breadcrumbs),Object.keys(s).length>0&&e.sendScopeUpdate(t,s)};return Ir().addScopeListener(r=>{i(r.getScopeData()),Ir().clearBreadcrumbs()}),i(Ir().getScopeData()),Ir().clearBreadcrumbs(),N.None}function KN(t,e){const i=new ke;return i.add(qN(t,e)),i.add(zN(t,e)),i.add(GN(t,e)),i}var YN=g({"out-build/vs/platform/tracing/common/register.js"(){"use strict";L(),Xa(),jw()}}),R7,JN=g({"out-build/vs/platform/tracing/node/rateLimiter.js"(){"use strict";R7=class{constructor(t){this.granularity=t,this.amounts=new Map,this.lastBucketTimestamp=this.getCurrentBucket()}increment(t,e=1){const i=this.getCurrentBucket();i!==this.lastBucketTimestamp&&(this.amounts.clear(),this.lastBucketTimestamp=i);const s=(this.amounts.get(t)??0)+e;return this.amounts.set(t,s),s}getCurrentBucket(){return Math.floor(Date.now()/this.granularity)}}}});import{app as M7,webContents as Hw,crashReporter as QN}from"electron";import mi from"fs";import XN from"node-fetch";import{tmpdir as T7}from"os";import ho from"path";var nu,tp,ZN=g({"out-build/vs/platform/tracing/electron-main/tracingService.js"(){"use strict";q(),L(),ai(),xi(),K(),lt(),ut(),Xa(),YN(),jw(),JN(),J0(),tp=class extends N{static{nu=this}static{this.DEFAULT_CLIENT_TRACING_CONFIG={errorRateLimit:10,jsonStringifySampleRate:0,loggerSampleRate:1,minidumpSampleRate:1,performanceUnitRateLimit:100,profilesSampleRate:0,tracesSampleRate:Qa.developmentTooling?1:.01,globalSampleRate:1}}static{this.MAX_STARTUP_BUFFER_SIZE=64}static{this.MAX_TRANSPORT_BUFFER_SIZE=128}constructor(e,i,r,s){super(),this.environmentService=e,this.logService=i,this.productService=r,this.windowsMainService=s,this._buffer=[],this._clientTracingConfig={...nu.DEFAULT_CLIENT_TRACING_CONFIG},this._debuggingDataUploadUrl=null,this._isPrivacyMode=null,this._transport=null,this._userEmail=null,this._userId=null,this._watchedRenderers=new Map,this._watcherDisposables=[],this._eventIdToProfile=new oc(100),this._rateLimiter=new R7(60*1e3),this._processConfigUpdateEvent=new D,this.onProcessConfigUpdate=this._processConfigUpdateEvent.event,this._initializeTransport().then(()=>this._register(KN("main",this))).catch(n=>this.logService.error("TracingService: failed to initialize transport",n)),M7.on("before-quit",()=>this.shutdownHasBegun())}async captureAndSendDebuggingData(e,i){const r=i.uploadUrl??this._debuggingDataUploadUrl;if(r===null||r===""){this.logService.warn("TracingService: no upload url found");return}const s=(await import("archiver")).default,n=T7(),o=i.rendererHeapSnapshotFile??ho.join(n,`renderer-${e}-${Date.now()}.heapsnapshot`);if(i.rendererHeapSnapshotFile===void 0&&this._isPrivacyMode===!1){const l=Hw.getAllWebContents().filter(u=>u.getOSProcessId()===e)[0];if(l!==void 0)try{this.logService.info("TracingService: taking heap snapshot"),await l.takeHeapSnapshot(o)}catch(u){this.logService.warn("TracingService: failed to take heap snapshot",u)}}const a=ho.join(n,`metadata-${Date.now()}.json`);this.logService.info("TracingService: writing metadata file");try{await mi.promises.writeFile(a,JSON.stringify({debuggerEvent:i.debuggerEvent,debuggerScripts:i.debuggerScripts,heapStatistics:i.rendererHeapStatistics,sentryTraceId:this._isPrivacyMode===!1?fr().getPropagationContext().traceId:void 0,version:this.productService.version,workspaceId:this._isPrivacyMode===!1?i.workspaceId:void 0},null,2))}catch(l){this.logService.warn("TracingService: failed to write metadata file",l)}const c=ho.join(n,`debugging-data-${Date.now()}.zip`);try{this.logService.info("TracingService: creating debugging data zip"),await new Promise((l,u)=>{const d=s("zip"),f=mi.createWriteStream(c);f.on("close",()=>l()),d.on("error",y=>u(y)),d.pipe(f),this._isPrivacyMode===!1&&mi.existsSync(o)&&d.file(o,{name:"snapshots/renderer.heapsnapshot"});const p=M7.getPath("userData"),v=ho.join(p,"logs");if(mi.existsSync(v)){const y=mi.readdirSync(v).sort().pop();y!==void 0&&d.directory(ho.join(v,y),"logs")}const m=ho.join(p,"User");this._isPrivacyMode===!1&&mi.existsSync(m)&&d.directory(m,"user"),mi.existsSync(a)&&d.file(a,{name:"metadata.json"}),d.finalize()})}catch(l){this.logService.warn("TracingService: failed to create debugging data zip",l)}try{this.logService.info("TracingService: uploading debugging data");const l=mi.createReadStream(c);(await XN(r,{method:"PUT",body:l,headers:{"Content-Length":mi.statSync(c).size.toString()}})).ok&&this.logService.info("TracingService: successfully uploaded debugging data")}catch(l){this.logService.warn("TracingService: failed to upload debugging data",l)}mi.existsSync(o)&&await mi.promises.unlink(o),mi.existsSync(c)&&await mi.promises.unlink(c),mi.existsSync(a)&&await mi.promises.unlink(a)}getIsWatchingForCrashes(){return Promise.resolve(this._watchedRenderers.size>0)}async sendEnvelope(e,i){if(this._isPrivacyMode===null){this._buffer.length<nu.MAX_STARTUP_BUFFER_SIZE&&this._buffer.push([e,i]);return}return e==="main"?this._handleEnvelopeMain(i):this._handleEnvelopeNotMain(e,i)}async sendScopeUpdate(e,i){if(e==="main"){this.logService.warn("TracingService: unexpected scope update from main");return}const r=Ir();i.breadcrumbs!==void 0&&i.breadcrumbs.forEach(s=>r?.addBreadcrumb(s))}async setClientTracingConfig(e){this._clientTracingConfig={globalSampleRate:Math.min(1,Math.max(0,e.globalSampleRate)),tracesSampleRate:Math.min(1,Math.max(0,e.tracesSampleRate)),loggerSampleRate:Math.min(1,Math.max(0,e.loggerSampleRate)),minidumpSampleRate:Math.min(1,Math.max(0,e.minidumpSampleRate)),errorRateLimit:Math.max(0,e.errorRateLimit),performanceUnitRateLimit:Math.max(0,e.performanceUnitRateLimit),profilesSampleRate:Math.min(1,Math.max(0,e.profilesSampleRate)),jsonStringifySampleRate:Math.min(1,Math.max(0,e.jsonStringifySampleRate))},this.logService.debug(`TracingService: set client tracing config to ${JSON.stringify(this._clientTracingConfig)}`),this._fireProcessConfigUpdate()}async setDebuggingDataUploadUrl(e){this._debuggingDataUploadUrl=e}async setIsPrivacyMode(e){const i=this._isPrivacyMode;this._isPrivacyMode=e,this._buffer.length>0&&(this.logService.debug(`TracingService: flushing buffer with ${this._buffer.length} items`),this._buffer.forEach(([r,s])=>this.sendEnvelope(r,s)),this._buffer=[]),i!==this._isPrivacyMode&&(this.logService.debug(`TracingService: set is privacy mode to ${e}`),this._fireProcessConfigUpdate())}async setUser(e,i){const r=this._userEmail,s=this._userId;this._userEmail=e,this._userId=i,this._userEmail!==null||this._userId!==null?Ir().setUser({email:this._userEmail??void 0,id:this._userId??void 0}):Ir().setUser(null),(r!==this._userEmail||s!==this._userId)&&this.logService.debug(`TracingService: set user to ${JSON.stringify(Ir()?.getUser())}`)}async toggleWatchForCrashes(){return this._watchedRenderers.size>0?(this._unwatchRendererProcesses(),!1):(this._watchRendererProcesses(),!0)}_fireProcessConfigUpdate(){const e={enabled:this._isPrivacyMode!==!0?this._clientTracingConfig.globalSampleRate>0:!1,loggerSampleRate:this._isPrivacyMode!==!0?this._clientTracingConfig.loggerSampleRate:0,tracesSampleRate:this._isPrivacyMode!==!0?this._clientTracingConfig.tracesSampleRate:0,profilesSampleRate:this._isPrivacyMode!==!0?this._clientTracingConfig.profilesSampleRate:0,jsonStringifySampleRate:this._isPrivacyMode!==!0?this._clientTracingConfig.jsonStringifySampleRate:0};this._processConfigUpdateEvent.fire(e),this.logService.debug(`TracingService: fired process config update ${JSON.stringify(e)}`)}async _initializeTransport(){if(this._transport!==null)return;const e=pi()?.getDsn();if(e===void 0){this.logService.warn("TracingService: no dsn found");return}const i=Yt().sentry.makeElectronOfflineTransport;if(i===void 0||typeof i!="function"){this.logService.warn("TracingService: transport constructor is not available");return}this._transport=i()({bufferSize:nu.MAX_TRANSPORT_BUFFER_SIZE,url:PO(e,pi()?.getOptions().tunnel,pi()?.getSdkMetadata()?.sdk),recordDroppedEvent:(r,s)=>{this.logService.debug(`TracingService: dropped ${s} event due to ${r}`)}}),this.logService.debug("TracingService: created transport")}_handleEnvelopeNotMain(e,i){const r=A7(i);if(r===void 0){this.logService.warn("TracingService: dropping unsupported envelope");return}const[s,n,o]=r;delete s.environment,delete s.sdk?.name,delete s.sdk?.version,delete s.sdk?.packages,s.tags={...s.tags,"event.process":e},s.event_id!==void 0&&o!==void 0&&this._eventIdToProfile.set(s.event_id,o),fr()?.captureEvent(s,{attachments:n})}_handleEnvelopeMain(e){const i=A7(e);if(i===void 0)return this._internalSendEnvelope(e);const[r,s]=i;if(this._shouldDropEvent(r,s))return;const n=r.tags?.["event.process"];if((n===void 0||n==="browser")&&(r.tags={...r.tags,"event.process":"main"}),r.event_id!==void 0){const o=this._eventIdToProfile.get(r.event_id);o!==void 0&&(this._eventIdToProfile.remove(r.event_id),e=eO(e,[{type:"profile"},o]))}this._internalSendEnvelope(e)}_shouldDropEvent(e,i){if(e.tags?.["event.process"]==="unknown"||(e.contexts?.electron?.["crashpad.exiting"]&&(e.level="error"),this._isPrivacyMode!==!1&&!i.some(r=>r.attachmentType==="event.minidump")&&this.productService.applicationName!=="cursor-nightly"))return!0;if(e.exception?.values!==void 0){for(const r of e.exception.values)if(this._shouldDropException(r))return!0}for(const r of i)if(this._shouldDropAttachment(r))return!0;return this._shouldDropEventBasedOnRateLimit(e)}_shouldDropException(e){return!1}_shouldDropAttachment(e){return e.attachmentType==="event.minidump"?Math.random()>=this._clientTracingConfig.minidumpSampleRate:!1}_shouldDropEventBasedOnRateLimit(e){const i=this._clientTracingConfig.errorRateLimit,r=this._clientTracingConfig.performanceUnitRateLimit;return e.type==="transaction"?this._rateLimiter.increment("performanceUnit",1)>r:this._rateLimiter.increment("error",1)>i}_internalSendEnvelope(e){if(this._isPrivacyMode!==!1)return;const i=this._clientTracingConfig.globalSampleRate;if(i<=0||i<1&&Math.random()>=i){this.logService.debug("TracingService: dropping envelope due to global sample rate");return}this._transport?.send(e)}async _watchRendererProcess(e){const i=Hw.fromId(e);if(i===void 0||i.getType()!=="window")return;const r=i.debugger;if(r.isAttached())return;const s=[];this._watchedRenderers.set(i.id,s),this.logService.debug(`TracingService: watching renderer process ${e}`);const n=i.getOSProcessId(),o=ho.join(T7(),`renderer-${n}-${Date.now()}.heapsnapshot`),a=[],c=f=>{if(f.reason!=="OOM"){this.logService.debug("TracingService: ignoring non-OOM debugger pause",f),i.isDevToolsOpened()||r.sendCommand("Debugger.resume").catch(()=>{});return}if(this.logService.info("TracingService: paused renderer before crash"),this._isPrivacyMode!==!1){this.captureAndSendDebuggingData(i.getOSProcessId(),{debuggerEvent:f,debuggerScripts:a}).catch(()=>{});return}this.logService.info("TracingService: taking heap snapshot"),r.sendCommand("HeapProfiler.takeHeapSnapshot").catch(()=>{}).finally(()=>{i.isDevToolsOpened()||r.sendCommand("Debugger.resume").catch(()=>{}),setTimeout(()=>{this.captureAndSendDebuggingData(i.getOSProcessId(),{debuggerEvent:f,debuggerScripts:a,rendererHeapSnapshotFile:o}).catch(()=>{})},1e3)})},l=f=>{a.push({scriptId:f?.scriptId,url:f?.url})},u=f=>{mi.appendFileSync(o,f.chunk)};r.attach(),s.push({dispose:()=>r.detach()}),this.logService.debug(`TracingService: attached to renderer process ${e}`);const d=(f,p,v)=>{switch(p){case"Debugger.paused":c(v);break;case"Debugger.scriptParsed":l(v);break;case"HeapProfiler.addHeapSnapshotChunk":u(v);break}};r.on("message",d),s.push({dispose:()=>r.removeListener("message",d)}),await r.sendCommand("Debugger.enable"),await r.sendCommand("Debugger.setPauseOnExceptions",{state:"none"}),s.push({dispose:()=>r.sendCommand("Debugger.disable").catch(()=>{})}),this.logService.debug(`TracingService: enabled debugger for renderer process ${e}`)}async _unwatchRendererProcess(e){const i=this._watchedRenderers.get(e);if(i!==void 0){for(;i.length>0;)i.pop()?.dispose();this._watchedRenderers.delete(e),this.logService.debug(`TracingService: unwatching renderer process ${e}`)}}_watchRendererProcesses(){this._watcherDisposables.push(this.windowsMainService.onDidChangeWindowsCount(()=>{const e=new Set(this.windowsMainService.getWindows().map(i=>i.id));for(const i of[...this._watchedRenderers.keys()])e.has(i)||this._unwatchRendererProcess(i).catch(()=>{});for(const i of e)this._watchedRenderers.has(i)||this._watchRendererProcess(i).catch(()=>{})})),this.windowsMainService.getWindows().forEach(e=>{this._watchRendererProcess(e.id).catch(()=>{})})}_unwatchRendererProcesses(){this._watcherDisposables.forEach(e=>e.dispose()),this._watcherDisposables=[];for(const e of[...this._watchedRenderers.keys()])this._unwatchRendererProcess(e).catch(()=>{})}async attemptGarbageCollection(e){const i=Hw.getAllWebContents().find(s=>s.getOSProcessId()===e);if(!i){this.logService.warn(`[TracingService] attemptGarbageCollection: Could not find webContents for pid ${e}`);return}const r=i.debugger;if(!r.isAttached()){this.logService.trace(`[TracingService] attemptGarbageCollection: Debugger not attached for pid ${e}, cannot trigger GC.`);return}try{this.logService.trace(`[TracingService] attemptGarbageCollection: Sending HeapProfiler.collectGarbage command to pid ${e}`),await r.sendCommand("HeapProfiler.collectGarbage"),this.logService.trace(`[TracingService] attemptGarbageCollection: Command sent successfully for pid ${e}`)}catch(s){this.logService.warn(`[TracingService] attemptGarbageCollection: Error sending command for pid ${e}:`,s)}}shutdownHasBegun(){QN.addExtraParameter("exiting","true")}},tp=nu=__decorate([__param(0,or),__param(1,V),__param(2,qe),__param(3,ot)],tp)}}),Vw,eU=g({"out-build/vs/platform/tracing/common/tracingService.js"(){"use strict";G(),Vw=j("tracingService")}}),qw,tU=g({"out-build/vs/platform/abuse/common/abuseService.js"(){"use strict";G(),qw=j("abuseService")}}),ip,iU=g({"out-build/vs/platform/abuse/node/abuseService.js"(){"use strict";ll(),ti(),ip=class{constructor(e){this._telemetryService=e,this._getTrueMachineId().then(i=>this._machineId=i).catch(()=>{}),this._getTrueMacMachineId().then(i=>this._macMachineId=i).catch(()=>{})}async getMachineId(){return this._machineId??this._telemetryService.machineId}async getMacMachineId(){return this._macMachineId??this._telemetryService.macMachineId}async _getTrueMachineId(){let e;try{e=await i5(!0)}catch{return}try{return(await import("crypto")).createHash("sha256").update(e,"utf8").digest("hex")}catch{return}}async _getTrueMacMachineId(){return t5(()=>{})}},ip=__decorate([__param(0,ei)],ip)}}),W7,rp,rU=g({"out-build/vs/platform/extensionManagement/node/extensionSignatureVerificationService.js"(){"use strict";Re(),xe(),G(),K(),ti(),Bd(),W7=j("IExtensionSignatureVerificationService"),rp=class{constructor(e,i){this.logService=e,this.telemetryService=i}vsceSign(){return this.moduleLoadingPromise||(this.moduleLoadingPromise=this.resolveVsceSign()),this.moduleLoadingPromise}async resolveVsceSign(){return import("@vscode/vsce-sign")}async verify(e,i,r,s,n){let o;try{o=await this.vsceSign()}catch(u){this.logService.error("Could not load vsce-sign module",$i(u)),this.logService.info(`Extension signature verification is not done: ${e}`);return}const a=new Date().getTime();let c;try{this.logService.trace(`Verifying extension signature for ${e}...`),c=await o.verify(r,s,this.logService.getLevel()===X.Trace)}catch(u){c={code:t1.UnknownError,didExecute:!1,output:$i(u)}}const l=new Date().getTime()-a;return this.logService.info(`Extension signature verification result for ${e}: ${c.code}. ${Co(c.internalCode)?`Internal Code: ${c.internalCode}. `:""}Executed: ${c.didExecute}. Duration: ${l}ms.`),this.logService.trace(`Extension signature verification output for ${e}:
|
|
${c.output}`),this.telemetryService.publicLog2("extensionsignature:verification",{extensionId:e,extensionVersion:i,code:c.code,internalCode:c.internalCode,duration:l,didExecute:c.didExecute,clientTargetPlatform:n}),{code:c.code}}},rp=__decorate([__param(0,V),__param(1,ei)],rp)}});import Ua from"fs";import{tmpdir as sU}from"os";import zw from"path";import{createGzip as nU}from"zlib";var L7,sp,oU=g({"out-build/vs/platform/continuousProfiling/electron-main/continuousProfilingService.js"(){"use strict";q(),L(),Hi(),xi(),K(),lt(),ut(),Mh(),L7=class{constructor(t,e,i,r,s,n){this.captureId=t,this.targetId=e,this.profileTypes=i,this.processType=r,this.startTime=Date.now(),this.duration=s,this.profileConfig=n}hasConflictWith(t,e){return this.targetId!==t?!1:e.some(i=>this.profileTypes.includes(i))}getDescription(){return`Profile ${this.captureId} (target: ${this.targetId}, types: ${this.profileTypes.join(", ")}, duration: ${this.duration}s)`}},sp=class extends N{constructor(e,i,r,s){super(),this.environmentService=e,this.logService=i,this.productService=r,this.windowsMainService=s,this._isPrivacyMode=!1,this._activeSessions=new Map,this._profileCaptureStatusChangeEvent=new D,this.onProfileCaptureStatusChange=this._profileCaptureStatusChangeEvent.event,this.logService.debug("ContinuousProfilingMainService: initialized in main process")}async captureProfile(e){if(this._isPrivacyMode)return this.logService.debug("ContinuousProfilingMainService: skipping profile capture due to privacy mode"),"";const i=this._getProfileTypes(e.profileConfig);if(i.length===0)return this.logService.warn(`ContinuousProfilingMainService: No profile types (CPU or Heap) configured for capture. (captureId: ${e.captureId})`),"";const r=e.captureId??ui();let s,n,o;try{if(e.processType==="renderer"){if(typeof e.windowId!="number")throw new Error("windowId must be provided for renderer profiling");const u=this.windowsMainService.getWindowById(e.windowId);if(!u?.win?.webContents)throw new Error(`Could not find webContents for windowId ${e.windowId}`);s=u.win.webContents,n=s.id,o=u.remoteAuthority?an(u.remoteAuthority):void 0}else throw e.processType==="main"?new Error("Main process profiling not yet implemented"):new Error(`Unknown process type: ${e.processType}`);if(!s||typeof n!="number")throw new Error("Target webContents could not be determined.");let a=!1;if(s.debugger.isAttached())this.logService.debug(`ContinuousProfilingMainService: Debugger already attached to target ${n}. Reusing existing attachment for capture ${r}.`),a=!1;else try{s.debugger.attach("1.3"),a=!0,this.logService.debug(`ContinuousProfilingMainService: Successfully attached debugger to target ${n} for capture ${r}.`)}catch(u){const d=`Failed to attach debugger to target ${n} for capture ${r}. Error: ${u.message}`;return this.logService.debug(`ContinuousProfilingMainService: ${d}`),this._profileCaptureStatusChangeEvent.fire({state:"error",captureId:r,error:d,cause:"DEBUGGER_ATTACH_FAILED"}),""}this.logService.debug(`ContinuousProfilingMainService: starting profile capture ${r} (types: ${i.join(", ")}, targetId: ${n}, duration: ${e.duration}s)`);const c=new L7(r,n,i,e.processType,e.duration,e.profileConfig);this._activeSessions.set(r,c),this.logService.debug(`ContinuousProfilingMainService: Created session for ${c.getDescription()}`);const l={state:"started",captureId:r};return this._profileCaptureStatusChangeEvent.fire(l),e._internals={didAttachDebugger:a},await this._captureAndCompressProfile(r,s,e,o),r}catch(a){this.logService.debug(`ContinuousProfilingMainService: failed to capture profile ${r}`,a);const c={state:"error",captureId:r,error:String(a)};if(this._profileCaptureStatusChangeEvent.fire(c),this._endSession(r),s?.debugger.isAttached())try{s.debugger.detach()}catch{}return r}}async setIsPrivacyMode(e){this._isPrivacyMode=e,this.logService.debug(`ContinuousProfilingMainService: set privacy mode to ${e}`)}async cancelProfile(e,i="Canceled by user or configuration change"){const r=this._activeSessions.get(e);if(!r){this.logService.debug(`ContinuousProfilingMainService: No active profile found for ID ${e} during cancellation`);return}this.logService.debug(`ContinuousProfilingMainService: Canceling ${r.getDescription()} with reason: ${i}`);let s=!1;const n=this.windowsMainService.getWindows().flatMap(c=>c.win?.webContents).find(c=>c&&!c.isDestroyed()&&c.id===r.targetId);if(n&&n.debugger.isAttached())try{n.debugger.detach(),s=!0,this.logService.debug(`ContinuousProfilingMainService: Detached debugger during cancel for session ${e}.`)}catch(c){this.logService.warn(`ContinuousProfilingMainService: Failed to detach debugger during cancel for session ${e}`,c)}else this.logService.debug(`ContinuousProfilingMainService: Target webContents ${r.targetId} not found or debugger not attached during cancel for session ${e}.`);const o=this._endSession(e);this.logService.debug(`ContinuousProfilingMainService: Session entry for ${e} removed during cancel: ${o}. Debugger detached: ${s}.`);const a={state:"canceled",captureId:e,reason:i};this._profileCaptureStatusChangeEvent.fire(a)}async cancelAllProfiles(){const e=Array.from(this._activeSessions.values());if(e.length!==0){this.logService.debug(`ContinuousProfilingMainService: Canceling all ${e.length} active profiles`);for(const i of e)await this.cancelProfile(i.captureId)}}_getProfileTypes(e){const i=[];return e.cpu&&i.push("cpu"),e.heap&&i.push("heap"),i}async _captureAndCompressProfile(e,i,r,s){const n=i.id,o=this._activeSessions.get(e),a=r._internals?.didAttachDebugger??!1;if(!o){if(this.logService.warn(`ContinuousProfilingMainService: No session found for ${e} at start of _captureAndCompressProfile. Attempting cleanup.`),a&&i.debugger.isAttached())try{i.debugger.detach()}catch(u){this.logService.warn(`Cleanup detach failed: ${u}`)}return}const c=zw.join(sU(),`vscode-profile-${e}`),l=[];try{if(await Ua.promises.mkdir(c,{recursive:!0}),o.profileConfig.cpu){const d=zw.join(c,"profile.cpuprofile");await i.debugger.sendCommand("Profiler.enable");const f=o.profileConfig.cpu.interval??1e3;await i.debugger.sendCommand("Profiler.setSamplingInterval",{interval:f}),await i.debugger.sendCommand("Profiler.start"),this.logService.debug(`ContinuousProfilingMainService: CPU Profiler started on wc ${i.id}, duration ${o.duration}s`),l.push({type:"cpu",file:d})}if(o.profileConfig.heap){const d=zw.join(c,"profile.heapprofile");await i.debugger.sendCommand("HeapProfiler.enable");const f=o.profileConfig.heap.samplingInterval??32768,p=o.profileConfig.heap.includeObjectsCollectedByMajorGC??!1,v=o.profileConfig.heap.includeObjectsCollectedByMinorGC??!1;await i.debugger.sendCommand("HeapProfiler.startSampling",{samplingInterval:f,includeObjectsCollectedByMajorGC:p,includeObjectsCollectedByMinorGC:v}),this.logService.debug(`ContinuousProfilingMainService: Heap Profiler started on wc ${i.id}, duration ${o.duration}s, samplingInterval: ${f}`),l.push({type:"heap",file:d})}if(l.length===0)throw new Error("No profile types configured for capture");if(await new Promise(d=>setTimeout(d,o.duration*1e3)),i.isDestroyed())this.logService.warn(`ContinuousProfilingMainService: Target webContents ${n} destroyed before profile ${e} could be stopped/saved.`);else for(const d of l)if(d.type==="cpu")try{const f=await i.debugger.sendCommand("Profiler.stop");await i.debugger.sendCommand("Profiler.disable"),this.logService.debug(`ContinuousProfilingMainService: CPU Profiler stopped on wc ${n}`),await Ua.promises.writeFile(d.file,JSON.stringify(f.profile)),this.logService.debug(`ContinuousProfilingMainService: CPU Profile saved to ${d.file}`)}catch(f){this.logService.error(`ContinuousProfilingMainService: Error stopping/saving CPU profile for ${e}`,f)}else if(d.type==="heap")try{const f=await i.debugger.sendCommand("HeapProfiler.stopSampling");await i.debugger.sendCommand("HeapProfiler.disable"),this.logService.debug(`ContinuousProfilingMainService: Heap Profiler stopped on wc ${n}`),await Ua.promises.writeFile(d.file,JSON.stringify(f.profile)),this.logService.debug(`ContinuousProfilingMainService: Heap Profile saved to ${d.file}`)}catch(f){this.logService.error(`ContinuousProfilingMainService: Error stopping/saving Heap profile for ${e}`,f)}const u=[];for(const d of l)try{if(await Ua.promises.stat(d.file)){const f=`${d.file}.gz`;await this._compressFile(d.file,f),this.logService.debug(`ContinuousProfilingMainService: Profile compressed to ${f}`),u.push(f)}else this.logService.warn(`ContinuousProfilingMainService: Raw profile file ${d.file} not found for compression.`)}catch(f){f.code!=="ENOENT"&&this.logService.error(`ContinuousProfilingMainService: Error compressing profile file ${d.file}`,f)}for(const d of u){const f={state:"completed",captureId:e,filePath:d,timestamp:Date.now(),duration:o.duration*1e3,profileConfig:o.profileConfig,bcId:s};this._profileCaptureStatusChangeEvent.fire(f)}}catch(u){this.logService.debug(`ContinuousProfilingMainService: Error during profile capture ${e}`,u);const d={state:"error",captureId:e,error:String(u)};this._profileCaptureStatusChangeEvent.fire(d)}finally{this.logService.debug(`ContinuousProfilingMainService: Entering finally block for capture ${e}. Attempting cleanup.`);let u=!1;if(a&&!i.isDestroyed()&&i.debugger.isAttached())try{i.debugger.detach(),u=!0,this.logService.debug(`ContinuousProfilingMainService: Detached debugger during cleanup for capture ${e}.`)}catch(d){this.logService.debug(`ContinuousProfilingMainService: Error during cleanup for capture ${e}`,d)}}}async _compressFile(e,i){return new Promise((r,s)=>{const n=nU(),o=Ua.createReadStream(e),a=Ua.createWriteStream(i);o.pipe(n).pipe(a),a.on("finish",()=>{r()}),a.on("error",c=>{s(c)})})}_endSession(e){const i=this._activeSessions.get(e);if(i){const r=this._activeSessions.delete(e);return r?this.logService.debug(`ContinuousProfilingMainService: Successfully ended session for ${i.getDescription()}`):this.logService.warn(`ContinuousProfilingMainService: Failed to delete session entry for ${e} after finding it.`),r}else return this.logService.debug(`ContinuousProfilingMainService: No active session found for ${e} during _endSession.`),!1}dispose(){this.cancelAllProfiles(),super.dispose()}},sp=__decorate([__param(0,or),__param(1,V),__param(2,qe),__param(3,ot)],sp)}});function aU(t,e,i,r){try{const s=t.get(st),n=t.get(V),o=t.get(qe),a=t.get(ot),c=new sp(s,n,o,a),l=Oe.fromService(c,r);e.registerChannel("continuousProfiling",l),i.then(u=>{u.registerChannel("continuousProfiling",l)})}catch(s){console.error("Failed to initialize continuous profiling service:",s)}}var cU=g({"out-build/vs/platform/continuousProfiling/electron-main/initializeMain.js"(){"use strict";Er(),oU(),ct(),K(),lt(),ut()}}),Gw,O7,lU=g({"out-build/vs/platform/mcp/common/nativeMcpDiscoveryHelper.js"(){"use strict";G(),Gw=j("INativeMcpDiscoveryHelperService"),O7="NativeMcpDiscoveryHelper"}});import{homedir as uU}from"os";var F7,dU=g({"out-build/vs/platform/mcp/node/nativeMcpDiscoveryHelperService.js"(){"use strict";z(),re(),F7=class{constructor(){}load(){return Promise.resolve({platform:Po,homedir:x.file(uU()),winAppData:this.uriFromEnvVariable("APPDATA"),xdgHome:this.uriFromEnvVariable("XDG_CONFIG_HOME")})}uriFromEnvVariable(t){const e=process.env[t];if(e)return x.file(e)}}}}),Kw,hU,fU=g({"out-build/vs/platform/webContentExtractor/common/webContentExtractor.js"(){"use strict";G(),Kw=j("IWebContentExtractorService"),hU=j("ISharedWebContentExtractorService")}});function pU(t){if(!t.length)return"";const e=new Map,i=new Set,r=[];for(const l of t)e.set(l.nodeId,l),(!l.parentId||!t.some(u=>u.nodeId===l.parentId))&&r.push(l);function s(l){const u=["navigation","banner","complementary","toolbar","menu","menuitem","tab","tablist"],d=["Skip to main content","Toggle navigation","Previous","Next","Copy","Direct link to","On this page","Edit this page","Search","Command+K"],f=n(l),p=l.role?.value?.toString().toLowerCase()||"";return u.includes(p)||d.some(v=>f.includes(v))||f.startsWith("Direct link to")||f.startsWith("\xAB ")||f.endsWith(" \xBB")||/^#\s*$/.test(f)||f==="\u200B"}function n(l){const u=[];return l.name?.value&&u.push(String(l.name.value)),l.value?.value&&l.value.value!==l.name?.value&&u.push(String(l.value.value)),l.description?.value&&l.description.value!==l.name?.value&&l.description.value!==l.value?.value&&u.push(String(l.description.value)),u.join(" ").trim()}function o(l){return l.role?.value==="code"||(l.properties||[]).some(u=>u.name==="code-block"||u.name==="pre")}function a(l,u=0,d={inCodeBlock:!1,codeText:[]}){if(!l||l.ignored||i.has(l.nodeId))return[];if(s(l))return[];i.add(l.nodeId);const f=[],p=n(l),v=o(l),m=v?{inCodeBlock:!0,codeText:[]}:d;if(p){const y=" ".repeat(u);v||m.inCodeBlock?m.codeText.push(p.trim()):f.push(y+p)}if(l.childIds)for(const y of l.childIds){const S=e.get(y);if(S){const E=a(S,u+1,m);f.push(...E)}}if(v&&m.codeText.length>0){const y=" ".repeat(u);f.push(y+m.codeText.join(" "))}return f}const c=[];for(const l of r){const u=a(l);u.length>0&&c.push(...u)}for(const l of t)if(!i.has(l.nodeId)){const u=a(l);u.length>0&&c.push(...u)}return c.filter((l,u,d)=>l.trim()||u>0&&d[u-1].trim()).join(`
|
|
`).trim()}var gU=g({"out-build/vs/platform/webContentExtractor/electron-main/cdpAccessibilityDomain.js"(){"use strict"}});import{BrowserWindow as mU}from"electron";var N7,vU=g({"out-build/vs/platform/webContentExtractor/electron-main/webContentExtractorService.js"(){"use strict";gU(),ae(),ai(),N7=class{constructor(){this._limiter=new Jg(3),this._webContentsCache=new Bt,this._cacheDuration=1440*60*1e3}isExpired(t){return Date.now()-t.timestamp>this._cacheDuration}extract(t){return t.length===0?Promise.resolve([]):Promise.all(t.map(e=>this._limiter.queue(()=>this.doExtract(e))))}async doExtract(t){const e=this._webContentsCache.get(t);if(e)if(this.isExpired(e))this._webContentsCache.delete(t);else return e.content;const i=new mU({width:800,height:600,show:!1,webPreferences:{javascript:!1,offscreen:!0,sandbox:!0,webgl:!1}});try{await i.loadURL(t.toString(!0)),i.webContents.debugger.attach("1.1");const r=await i.webContents.debugger.sendCommand("Accessibility.getFullAXTree"),s=pU(r.nodes);return this._webContentsCache.set(t,{content:s,timestamp:Date.now()}),s}catch(r){console.log(r)}finally{i.destroy()}return""}}}}),Yw,U7,wU=g({"out-build/vs/platform/telemetry/common/errorTelemetry.js"(){"use strict";Wt(),Re(),L(),ur(),Ze(),(function(t){function e(i,r){return i.callstack<r.callstack?-1:i.callstack>r.callstack?1:0}t.compare=e})(Yw||(Yw={})),U7=class T8{static{this.ERROR_FLUSH_TIMEOUT=5*1e3}constructor(e,i=T8.ERROR_FLUSH_TIMEOUT){this._flushHandle=-1,this._buffer=[],this._disposables=new ke,this._telemetryService=e,this._flushDelay=i;const r=rc.addListener(s=>this._onErrorEvent(s));this._disposables.add(me(r)),this.installErrorListeners()}dispose(){clearTimeout(this._flushHandle),this._flushBuffer(),this._disposables.dispose()}installErrorListeners(){}_onErrorEvent(e){if(!e||e.code||(e.detail&&e.detail.stack&&(e=e.detail),Tr.isErrorNoTelemetry(e)||e instanceof Zt||typeof e?.message=="string"&&e.message.includes("Unable to read file")))return;const i=Array.isArray(e.stack)?e.stack.join(`
|
|
`):e.stack,r=e.message?e.message:eD(e);i&&this._enqueue({msg:r,callstack:i})}_enqueue(e){const i=gx(this._buffer,e,Yw.compare);i<0?(e.count=1,this._buffer.splice(~i,0,e)):(this._buffer[i].count||(this._buffer[i].count=0),this._buffer[i].count+=1),this._flushHandle===-1&&(this._flushHandle=setTimeout(()=>{this._flushBuffer(),this._flushHandle=-1},this._flushDelay))}_flushBuffer(){for(const e of this._buffer)this._telemetryService.publicLogError2("UnhandledError",e);this._buffer.length=0}}}}),np,$7,yU=g({"out-build/vs/platform/telemetry/electron-main/errorTelemetry.js"(){"use strict";Re(),wU(),ti(),np=class extends U7{constructor(e,i){super(i),this.logService=e}installErrorListeners(){wy(e=>this.onUnexpectedError(e)),process.on("uncaughtException",e=>{px(e)||$t(e)}),process.on("unhandledRejection",e=>$t(e))}onUnexpectedError(e){this.logService.error(`[uncaught exception in main]: ${e}`,e)}},np=__decorate([__param(1,ei)],np),$7=np}});import SU from"v8";var op,_U=g({"out-build/vs/platform/telemetry/electron-main/performanceTelemetryService.js"(){"use strict";L(),ct(),K(),lt(),ut(),op=class extends N{constructor(e,i,r,s){super(),this.environmentService=e,this.logService=i,this.productService=r,this.windowsService=s}async getHeapSpaceStatistics(){return SU.getHeapSpaceStatistics().map(r=>({space_name:r.space_name,space_size:r.space_size,space_used_size:r.space_used_size,space_available_size:r.space_available_size,physical_space_size:r.physical_space_size}))}},op=__decorate([__param(0,st),__param(1,V),__param(2,qe),__param(3,ot)],op)}});function bU(t,e,i,r){try{const s=t.get(st),n=t.get(V),o=t.get(qe),a=t.get(ot),c=new op(s,n,o,a),l=Oe.fromService(c,r);e.registerChannel("performanceTelemetry",l)}catch(s){console.error("Failed to initialize performance telemetry service:",s)}}var EU=g({"out-build/vs/platform/telemetry/electron-main/initializeMain.js"(){"use strict";Er(),ct(),K(),lt(),ut(),_U()}}),ap,kU=g({"out-build/vs/platform/notification/common/systemNotification.js"(){"use strict";G(),ap=j("systemNotificationService")}});import{app as PU,Notification as Jw}from"electron";var cp,xU=g({"out-build/vs/platform/notification/electron-main/systemNotificationService.js"(){"use strict";L(),K(),z(),Yn(),cp=class extends N{constructor(e,i){super(),this.logService=e,this.nativeHostMainService=i,this.activeNotifications=new Set}async handleNotificationInteraction(e,i){let r=!1,s;try{const n=await this.nativeHostMainService.getActiveWindowId(void 0);if(typeof n<"u")await this.nativeHostMainService.focusWindow(n,{force:!0,webContents:!0}),r=!0,s=n;else{const o=await this.nativeHostMainService.getWindows(void 0,{includeAuxiliaryWindows:!1}),a=o.length>0?o[o.length-1]:void 0;a?(await this.nativeHostMainService.focusWindow(a.id,{force:!0,webContents:!0}),r=!0,s=a.id):await this.nativeHostMainService.focusWindow(void 0,{force:!0})}}catch(n){this.logService.warn(`Failed to focus window from notification ${i}:`,n)}if(e.clickAction)try{s!==void 0?await this.nativeHostMainService.runActionInWindow(void 0,{windowId:s,actionId:e.clickAction.commandId,args:e.clickAction.args??{}}):this.logService.trace(`Skipping action '${e.clickAction.commandId}' because no window is available`)}catch(n){this.logService.error(`Failed to execute notification action '${e.clickAction.commandId}' from ${i}:`,n)}}isSupported(){return Jw.isSupported()}hasPermission(){return!!this.isSupported()}async requestPermission(){if(!this.isSupported())return this.logService.warn("System notifications are not supported on this platform"),!1;if(O&&!this.hasPermission())try{return new Jw({title:"Cursor Notifications",body:"Cursor would like to send you notifications.",silent:!0}).close(),this.hasPermission()}catch(e){return this.logService.error("Failed to request notification permission:",e),!1}return this.hasPermission()}async showNotification(e){if(!this.isSupported()){this.logService.warn("System notifications are not supported on this platform");return}if(!this.hasPermission()){this.logService.warn("No permission to show system notifications");return}try{const i=new Jw({title:e.title,body:e.body,silent:e.silent,icon:e.icon,urgency:e.urgency,timeoutType:e.timeoutType,subtitle:e.subtitle,hasReply:e.hasReply,sound:e.sound});this.activeNotifications.add(i),i.once("close",()=>{this.activeNotifications.delete(i)}),i.on("click",()=>this.handleNotificationInteraction(e,"click")),i.on("action",()=>this.handleNotificationInteraction(e,"action")),i.on("reply",()=>this.handleNotificationInteraction(e,"reply")),i.show(),this.logService.trace("System notification shown:",e.title)}catch(i){this.logService.error("Failed to show system notification:",i)}}async setBadgeCount(e){try{PU.setBadgeCount(Math.max(0,Math.floor(e)))}catch(i){this.logService.error("Failed to set badge count:",i)}}},cp=__decorate([__param(0,V),__param(1,Jr)],cp)}}),B7,CU=g({"out-build/vs/platform/notification/common/systemNotificationIpc.js"(){"use strict";B7=class{constructor(t){this.service=t}listen(t,e){throw new Error(`Event not found: ${e}`)}async call(t,e,i){switch(e){case"isSupported":return this.service.isSupported();case"hasPermission":return this.service.hasPermission();case"requestPermission":return this.service.requestPermission();case"showNotification":return this.service.showNotification(i);case"setBadgeCount":return this.service.setBadgeCount(i)}throw new Error(`Method not found: ${e}`)}}}});import{app as lp,Menu as j7,nativeImage as H7,Tray as IU,nativeTheme as up,screen as DU}from"electron";import{existsSync as fo}from"fs";var Li,dp,AU=g({"out-build/vs/platform/tray/electron-main/trayMainService.js"(){"use strict";L(),z(),ye(),ft(),K(),ut(),ct(),lt(),St(),Li={MAX_MAIN_COMPOSERS:3,MAX_ADDITIONAL_COMPOSERS:5,WINDOW_READY_DELAY_MS:1e3,ICON_PATHS:{MACOS:{TEMPLATE:["trayTemplate@2x.png","trayTemplate.png"],NOTIFY_WHITE:["trayNotifyWhite@2x.png","trayNotifyWhite.png"],NOTIFY_BLACK:["trayNotifyBlack@2x.png","trayNotifyBlack.png"]},WINDOWS:{TEMPLATE:"win32/trayTemplate.ico",TEMPLATE_DARK:"win32/trayTemplateDark.ico",NOTIFY:"win32/trayNotifyWhite.ico",NOTIFY_DARK:"win32/trayNotifyDark.ico"},LINUX:{TEMPLATE:["trayTemplate.png","trayTemplate-24.png","trayTemplate-22.png","trayTemplate-16.png"],TEMPLATE_DARK:["trayTemplateDark.png","trayTemplateDark-24.png","trayTemplateDark-22.png","trayTemplateDark-16.png"],NOTIFY:["trayNotifyWhite.png","trayNotifyWhite-24.png","trayNotifyWhite-22.png","trayNotifyWhite-16.png"],NOTIFY_DARK:["trayNotifyDark.png","trayNotifyDark-24.png","trayNotifyDark-22.png","trayNotifyDark-16.png"]}}},dp=class extends N{constructor(e,i,r,s,n){super(),this.lifecycleMainService=e,this.logService=i,this.windowsMainService=r,this.environmentMainService=s,this.productService=n,this.recentComposers=[],this.hasReceivedInitialData=!1,this.hasAnyNotifications=!1,this._register(this.lifecycleMainService.onWillShutdown(()=>this.dispose())),this.registerListeners(),this.themeChangeListener=()=>{this.tray&&(B||Pe)&&this.updateIcon()},up.on("updated",this.themeChangeListener)}registerListeners(){}initialize(){if(!this.tray)try{const e=this.getIconPath(!1);if(!fo(e)){this.logService.error(`TrayMainService: Icon file does not exist at path: ${e}`);return}const i=H7.createFromPath(e);if(O&&i.setTemplateImage(!0),this.tray=new IU(i),this.tray.setToolTip(this.productService.nameShort||"Cursor"),O)this.tray.setIgnoreDoubleClickEvents(!0),this.tray.on("click",()=>{this.trackEvent("tray.menu_opened");const r=this.createContextMenu();this.tray?.popUpContextMenu(r)}),this.tray.on("right-click",()=>{this.trackEvent("tray.menu_opened");const r=this.createContextMenu();this.tray?.popUpContextMenu(r)});else{const r=this.createContextMenu();this.tray.setContextMenu(r),this.tray.on("click",()=>{this.toggleWindowVisibility()}),this.tray.on("right-click",()=>{this.trackEvent("tray.menu_opened")})}this.hasReceivedInitialData||(this.hasReceivedInitialData=!0,this.updateContextMenu())}catch(e){this.logService.error("TrayMainService: Failed to initialize tray",e)}}updateContextMenu(){if(this.tray&&!O){const e=this.createContextMenu();this.tray.setContextMenu(e)}}getResourcesRoot(){const e=lp.isPackaged?U(lp.getAppPath(),"resources"):U(this.environmentMainService.appRoot,"resources");return this.logService.trace(`[Tray] Resources root: ${e}, isPackaged: ${lp.isPackaged}`),e}findFirstExistingPath(e){for(const i of e)if(fo(i))return this.logService.trace(`[Tray] Using icon: ${i}`),i}orderLinuxIconNamesByScale(e){const i=DU.getPrimaryDisplay().scaleFactor,r=i>=1.75?[48,32,24,22,16]:i>=1.25?[32,24,22,16]:[24,22,16],s=[],n=o=>{s.includes(o)||s.push(o)};for(const o of e){const a=o.match(/^(.*?)(-(\d+))?(\.[^.]+)$/);if(a){const c=a[1],l=a[4];for(const u of r)n(`${c}-${u}${l}`)}n(o)}return s}getMacOSIconPath(e,i){const s=Li.ICON_PATHS.MACOS.TEMPLATE.map(o=>U(i,"darwin",o)),n=this.findFirstExistingPath(s);return n||(this.logService.warn(`[Tray] No macOS icon found. Tried: ${s.join(", ")}`),s[0])}getWindowsIconPath(e,i){const r=!up.shouldUseDarkColors;let s;e?s=r?Li.ICON_PATHS.WINDOWS.NOTIFY:Li.ICON_PATHS.WINDOWS.NOTIFY_DARK:s=r?Li.ICON_PATHS.WINDOWS.TEMPLATE:Li.ICON_PATHS.WINDOWS.TEMPLATE_DARK;const n=U(i,s);if(fo(n))return this.logService.trace(`[Tray] Using Windows icon: ${n} (light mode: ${r})`),n;const o=U(i,"win32","code.ico");return fo(o)?(this.logService.warn(`[Tray] Using fallback Windows icon: ${o}. Consider adding tray-specific icons.`),o):(this.logService.error(`[Tray] No Windows icon found at: ${n}`),n)}getLinuxIconPath(e,i){const r=!up.shouldUseDarkColors;let s;e?s=r?Li.ICON_PATHS.LINUX.NOTIFY:Li.ICON_PATHS.LINUX.NOTIFY_DARK:s=r?Li.ICON_PATHS.LINUX.TEMPLATE:Li.ICON_PATHS.LINUX.TEMPLATE_DARK;const o=this.orderLinuxIconNamesByScale(s).map(c=>U(i,"linux",c)),a=this.findFirstExistingPath(o);if(!a){const c=U(i,"linux","code.png");return fo(c)?(this.logService.warn(`[Tray] Using fallback Linux icon: ${c}. Consider adding tray-specific icons.`),c):(this.logService.warn(`[Tray] No Linux icon found. Tried: ${o.join(", ")} (light mode: ${r})`),o[0])}return this.logService.trace(`[Tray] Using Linux icon (light mode: ${r})`),a}getIconPath(e){const i=this.getResourcesRoot();return O?this.getMacOSIconPath(e,i):B?this.getWindowsIconPath(e,i):this.getLinuxIconPath(e,i)}async sendMessageToWindow(e,i){try{const r=this.windowsMainService.getWindows();if(r.length>0)r[0].sendWhenReady(e,Te.None,i),r[0].focus();else{const s=await this.windowsMainService.openEmptyWindow({context:2});s.length>0&&setTimeout(()=>{try{s[0].sendWhenReady(e,Te.None,i)}catch(n){this.logService.error(`TrayMainService: Failed to send message '${e}' to window`,n)}},Li.WINDOW_READY_DELAY_MS)}}catch(r){this.logService.error("TrayMainService: Error during window message handling",r)}}focusOrOpenWindow(){try{const e=this.windowsMainService.getWindows();e.length>0?e[0].focus():this.windowsMainService.openEmptyWindow({context:2})}catch(e){this.logService.error("TrayMainService: Error during window focus",e)}}trackEvent(e){try{const i=this.windowsMainService.getWindows();i.length>0&&i[0].sendWhenReady("vscode:trayAnalytics",Te.None,{eventName:e})}catch{}}createContextMenu(){const e=[];if(!this.hasReceivedInitialData)e.push({label:"Loading agents...",enabled:!1});else{const i=[...this.recentComposers].sort((n,o)=>{if(n.hasNotification&&!o.hasNotification)return-1;if(!n.hasNotification&&o.hasNotification)return 1;const a=n.lastUpdatedAt??n.createdAt??0;return(o.lastUpdatedAt??o.createdAt??0)-a}),r=i.slice(0,Li.MAX_MAIN_COMPOSERS),s=i.slice(Li.MAX_MAIN_COMPOSERS,Li.MAX_MAIN_COMPOSERS+Li.MAX_ADDITIONAL_COMPOSERS);if(r.length>0){if(e.push({label:"Recent Agents",enabled:!1}),r.forEach((n,o)=>{const a=n.name||`Agent ${o+1}`,c=n.hasNotification?"\u2022 ":"";e.push({label:`${c}${a}`,click:()=>{this.trackEvent("tray.agent_opened"),this.sendMessageToWindow("vscode:openComposer",{composerId:n.composerId})}})}),s.length>0){const n=s.map((o,a)=>{const c=o.name||`Agent ${a+4}`;return{label:`${o.hasNotification?"\u2022 ":""}${c}`,click:()=>{this.trackEvent("tray.agent_opened"),this.sendMessageToWindow("vscode:openComposer",{composerId:o.composerId})}}});e.push({label:`View More (${s.length})`,submenu:j7.buildFromTemplate(n)})}}else e.push({label:"No recent agents",enabled:!1})}return e.push({type:"separator"}),e.push({label:"New Agent",click:()=>{this.trackEvent("tray.new_agent_clicked"),this.sendMessageToWindow("vscode:createNewComposer",{})}}),e.push({type:"separator"}),e.push({label:"Open Cursor",click:()=>{this.trackEvent("tray.open_cursor_clicked"),this.focusOrOpenWindow()}}),e.push({label:"Settings",click:()=>{this.trackEvent("tray.settings_opened"),this.sendMessageToWindow("vscode:openSettings",{})}}),e.push({label:"Quit",click:()=>{lp.quit()}}),j7.buildFromTemplate(e)}toggleWindowVisibility(){const e=this.windowsMainService.getWindows();if(e.length===0)this.windowsMainService.openEmptyWindow({context:2});else{const i=e[0];i.win&&(i.win.isVisible()?i.win.hide():(i.win.show(),i.focus()))}}updateIcon(){if(this.tray)try{const e=this.getIconPath(this.hasAnyNotifications);if(!fo(e)){this.logService.error(`TrayMainService: Icon not found at path: ${e}`);const r=this.getIconPath(!1);if(!fo(r)){this.logService.error(`TrayMainService: Fallback icon also not found: ${r}`);return}}const i=H7.createFromPath(e);O&&i.setTemplateImage(!0),this.tray.setImage(i)}catch(e){this.logService.error("TrayMainService: Error updating icon",e)}}updateTooltip(e){if(this.tray)try{this.tray.setToolTip(e)}catch(i){this.logService.error("TrayMainService: Error updating tooltip",i)}}async updateSnapshot(e){const i=e;if(!Array.isArray(i)){this.logService.error("TrayMainService: Invalid composers data - expected array");return}const r=i.filter(a=>!(!a||typeof a!="object"||!a.composerId||typeof a.composerId!="string"));this.recentComposers=r,this.hasReceivedInitialData=!0;const s=this.hasAnyNotifications,n=i.reduce((a,c)=>a+(c.unreadCount||0),0);this.hasAnyNotifications=n>0,s!==this.hasAnyNotifications&&this.updateIcon();const o=this.productService.nameShort||"Cursor";this.updateTooltip(n>0?`${o} (${n})`:o),this.updateContextMenu()}async setEnabled(e){e?this.tray||this.initialize():this.dispose()}dispose(){this.tray&&(this.tray.destroy(),this.tray=void 0),this.themeChangeListener&&(up.off("updated",this.themeChangeListener),this.themeChangeListener=void 0),super.dispose()}},dp=__decorate([__param(0,ze),__param(1,V),__param(2,ot),__param(3,st),__param(4,qe)],dp)}}),hp,RU=g({"out-build/vs/platform/tray/common/tray.js"(){"use strict";G(),hp=j("trayMainService")}});import{app as po,protocol as V7,session as $a,systemPreferences as q7}from"electron";import{hostname as MU,release as TU}from"os";var Qw,fp,WU=g({"out-build/vs/code/electron-main/app.js"(){"use strict";Ja(),nr(),it(),In(),q(),H0(),qs(),L(),Ie(),ye(),z(),xe(),re(),Hi(),RI(),Er(),TI(),rb(),u2(),we(),tl(),z3(),Xe(),J3(),g1(),$2(),Vn(),cb(),ID(),ct(),al(),C1(),YD(),WA(),LA(),UA(),ZA(),Ze(),bR(),Y1(),Ih(),G(),J1(),ER(),PR(),oE(),CR(),IR(),TR(),WR(),pE(),LR(),FR(),ft(),K(),jR(),Yn(),lt(),nl(),tM(),mv(),Vi(),sM(),tn(),RE(),ti(),nM(),aM(),Zn(),cn(),cM(),hM(),gM(),yM(),xM(),wE(),CM(),IM(),DM(),AM(),WM(),ks(),ut(),JM(),QM(),hi(),E1(),$h(),XM(),qn(),Xr(),ZM(),$n(),uf(),x6(),iW(),rW(),sW(),ae(),pW(),gW(),mW(),Dl(),vW(),wW(),G6(),bW(),XW(),ZW(),Do(),wh(),sL(),td(),ua(),ZN(),eU(),tU(),iU(),rU(),cU(),lU(),dU(),fU(),vU(),yU(),EU(),kU(),xU(),CU(),AU(),RU(),fp=class extends N{static{Qw=this}static{this.SECURITY_PROTOCOL_HANDLING_CONFIRMATION_SETTING_KEY={[T.file]:"security.promptForLocalFileProtocolHandling",[T.vscodeRemote]:"security.promptForRemoteFileProtocolHandling"}}constructor(e,i,r,s,n,o,a,c,l,u,d,f){super(),this.mainProcessNodeIpcServer=e,this.userEnv=i,this.mainInstantiationService=r,this.logService=s,this.loggerService=n,this.environmentMainService=o,this.lifecycleMainService=a,this.configurationService=c,this.stateService=l,this.fileService=u,this.productService=d,this.userDataProfilesMainService=f,this.configureSession(),this.registerListeners()}configureSession(){const e=f=>f?.startsWith(`${T.vscodeFileResource}://${gc}`),i=f=>f?.startsWith(`${T.vscodeWebview}://`),r=new Set(["pointerLock"]),s=new Set([...r,"clipboard-read","clipboard-sanitized-write","deprecated-sync-clipboard-read"]),n=new Set([...r,"media","local-fonts","deprecated-sync-clipboard-read"]);$a.defaultSession.setPermissionRequestHandler((f,p,v,m)=>i(m.requestingUrl)?v(s.has(p)):e(m.requestingUrl)?v(n.has(p)):v(!1)),$a.defaultSession.setPermissionCheckHandler((f,p,v,m)=>i(m.requestingUrl)?s.has(p):e(m.requestingUrl)?n.has(p):!1);const o=new Set([T.file,T.vscodeFileResource,T.vscodeRemoteResource,T.vscodeManagedRemoteResource,"devtools"]),a=f=>{for(let p=f;p;p=p.parent)if(p.url.startsWith(`${T.vscodeWebview}://`))return!0;return!1},c=f=>f.resourceType==="xhr"||a(f.frame),l=f=>{const p=f.frame;if(!p||!this.windowsMainService)return!1;const v=Gc();for(const y of v)if(p.processId===y.webContents.mainFrame.processId)return!0;const m=this.windowsMainService.getWindows();for(const y of m){const S=y.webContents;if(S!==void 0&&p.processId===S.mainFrame.processId)return!0}return!1},u=(f,p)=>{if(f.path!=="/index.html")return!0;const v=p.frame;if(!v||!this.windowsMainService)return!1;for(const m of this.windowsMainService.getWindows())if(m.win){if(v.processId===m.win.webContents.mainFrame.processId)return!0}else if(m.webContents&&v.processId===m.webContents.mainFrame.processId)return!0;return!1};$a.defaultSession.webRequest.onBeforeRequest((f,p)=>{const v=x.parse(f.url);return v.scheme===T.vscodeWebview&&!u(v,f)?(this.logService.error("Blocked vscode-webview request",f.url),p({cancel:!0})):v.scheme===T.vscodeFileResource&&!l(f)?(this.logService.error("Blocked vscode-file request",f.url),p({cancel:!0})):v.path.endsWith(".svg")&&!o.has(v.scheme)?p({cancel:!c(f)}):p({cancel:!1})}),$a.defaultSession.webRequest.onHeadersReceived((f,p)=>{const v=f.responseHeaders,m=v["content-type"]||v["Content-Type"];if(m&&Array.isArray(m)){const y=x.parse(f.url);if(y.path.endsWith(".svg")&&o.has(y.scheme))return v["Content-Type"]=["image/svg+xml"],p({cancel:!1,responseHeaders:v});if(!y.path.endsWith(T.vscodeRemoteResource)&&m.some(S=>S.toLowerCase().includes("image/svg")))return p({cancel:!c(f)})}return p({cancel:!1})}),$a.defaultSession.webRequest.onHeadersReceived((f,p)=>{if(f.url.startsWith("https://vscode.download.prss.microsoft.com/")){const v=f.responseHeaders??Object.create(null);if(v["Access-Control-Allow-Origin"]===void 0)return v["Access-Control-Allow-Origin"]=["*"],p({cancel:!1,responseHeaders:v})}return p({cancel:!1})});const d=$a.defaultSession;typeof d.setCodeCachePath=="function"&&this.environmentMainService.codeCachePath&&d.setCodeCachePath(U(this.environmentMainService.codeCachePath,"chrome")),B&&(this.configurationService.getValue("security.restrictUNCAccess")===!1?ex():Ya(this.configurationService.getValue("security.allowedUNCHosts")))}registerListeners(){P.once(this.lifecycleMainService.onWillShutdown)(()=>this.dispose()),AI(),po.on("accessibility-support-changed",(r,s)=>{this.windowsMainService?.sendToAll("vscode:accessibilitySupportChanged",s)}),po.on("activate",async(r,s)=>{this.logService.trace("app#activate"),s||await this.windowsMainService?.openEmptyWindow({context:1})}),po.on("web-contents-created",(r,s)=>{s?.opener?.url.startsWith(`${T.vscodeFileResource}://${gc}/`)&&(this.logService.trace('[aux window] app.on("web-contents-created"): Registering auxiliary window'),this.auxiliaryWindowsMainService?.registerWindow(s)),s.on("will-navigate",n=>{this.logService.error("webContents#will-navigate: Prevented webcontent navigation"),n.preventDefault()}),s.setWindowOpenHandler(n=>n.url==="about:blank"?(this.logService.trace("[aux window] webContents#setWindowOpenHandler: Allowing auxiliary window to open on about:blank"),{action:"allow",overrideBrowserWindowOptions:this.auxiliaryWindowsMainService?.createWindow(n)}):(this.logService.trace(`webContents#setWindowOpenHandler: Prevented opening window with URL ${n.url}}`),this.nativeHostMainService?.openExternal(void 0,n.url),{action:"deny"}))});let e=[],i;po.on("open-file",(r,s)=>{s=Oo(s),this.logService.trace("app#open-file: ",s),r.preventDefault(),e.push(Un(s)?{workspaceUri:x.file(s)}:{fileUri:x.file(s)}),i!==void 0&&(clearTimeout(i),i=void 0),i=setTimeout(async()=>{await this.windowsMainService?.open({context:1,cli:this.environmentMainService.args,urisToOpen:e,gotoLineMode:!1,preferNewWindow:!0}),e=[],i=void 0},100)}),po.on("new-window-for-tab",async()=>{await this.windowsMainService?.openEmptyWindow({context:4})}),We.handle("vscode:fetchShellEnv",r=>{const s=this.windowsMainService?.getWindowByWebContents(r.sender);let n,o;return s?.config?(n=s.config,o={...process.env,...s.config.userEnv}):(n=this.environmentMainService.args,o=process.env),this.resolveShellEnvironment(n,o,!1)}),We.on("vscode:toggleDevTools",r=>r.sender.toggleDevTools()),We.on("vscode:openDevTools",r=>r.sender.openDevTools()),We.on("vscode:reloadWindow",r=>r.sender.reload()),We.handle("vscode:notifyZoomLevel",async(r,s)=>{const n=this.windowsMainService?.getWindowByWebContents(r.sender);n&&n.notifyZoomLevel(s)})}async startup(){this.logService.debug("Starting VS Code"),this.logService.debug(`from: ${this.environmentMainService.appRoot}`),this.logService.debug("args:",this.environmentMainService.args);const e=this.productService.win32AppUserModelId;B&&e&&po.setAppUserModelId(e);try{O&&this.configurationService.getValue("window.nativeTabs")===!0&&!q7.getUserDefault("NSUseImprovedLayoutPass","boolean")&&q7.setUserDefault("NSUseImprovedLayoutPass","boolean",!0)}catch(f){this.logService.error(f)}const i=new eb;P.once(this.lifecycleMainService.onWillShutdown)(f=>{f.reason===2&&i.dispose()}),this.logService.trace("Resolving machine identifier...");const[r,s,n,o]=await Promise.all([lW(this.stateService,this.logService),uW(this.stateService,this.logService),dW(this.stateService,this.logService),hW(this.stateService,this.logService)]);this.logService.trace(`Resolved machine identifier: ${r}`);const{sharedProcessReady:a,sharedProcessClient:c}=this.setupSharedProcess(r,s,n,o),l=await this.initServices(r,s,n,o,a);l.invokeFunction(f=>this._register(new $7(f.get(V),f.get(ei)))),l.invokeFunction(f=>f.get(Yd)),this._register(l.createInstance(ff)),l.invokeFunction(f=>this.initChannels(f,i,c));const u=await l.invokeFunction(f=>this.setupProtocolUrlHandlers(f,i));this.setupManagedRemoteResourceUrlHandler(i),this.lifecycleMainService.phase=2,await l.invokeFunction(f=>this.openFirstWindow(f,u)),this.lifecycleMainService.phase=3,this.afterWindowOpen(),this._register(new br(()=>{this._register(Zg(()=>{this.lifecycleMainService.phase=4,this.eventuallyAfterWindowOpen()},2500))},2500)).schedule()}async setupProtocolUrlHandlers(e,i){const r=this.windowsMainService=e.get(ot),s=e.get(xl),n=this.nativeHostMainService=e.get(Jr),o=e.get(Is),a=this;s.registerHandler({async handleURL(p,v){return a.handleProtocolUrl(r,o,s,p,v)}});const c=this._register(new o6({onDidOpenMainWindow:n.onDidOpenMainWindow,onDidFocusMainWindow:n.onDidFocusMainWindow,getActiveWindowId:()=>n.getActiveWindowId(-1)})),l=new D_(p=>c.getActiveClientId().then(v=>p===v)),u=new zE(l,this.logService),d=i.getChannel("urlHandler",u);s.registerHandler(new qE(d));const f=await this.resolveInitialProtocolUrls(r,o);return this._register(new YE(f?.urls,s,r,this.environmentMainService,this.productService,this.logService)),f}setupManagedRemoteResourceUrlHandler(e){const i=()=>({statusCode:404,data:"Not found"}),r=new gs(()=>e.getChannel(r9,new s9));V7.registerBufferProtocol(T.vscodeManagedRemoteResource,(s,n)=>{const o=x.parse(s.url);if(!o.authority.startsWith("window:"))return n(i());r.value.call(Fv,[o]).then(a=>n({...a,data:Buffer.from(a.body,"base64")}),a=>{this.logService.warn("error dispatching remote resource call",a),n({statusCode:500,data:String(a)})})})}async resolveInitialProtocolUrls(e,i){const r=this.environmentMainService.args["open-url"]?this.environmentMainService.args._urls||[]:[];r.length>0&&this.logService.trace("app#resolveInitialProtocolUrls() protocol urls from command line:",r);const s=global.getOpenUrls()||[];if(s.length>0&&this.logService.trace("app#resolveInitialProtocolUrls() protocol urls from macOS 'open-url' event:",s),r.length+s.length===0)return;const n=[...r,...s].map(c=>{try{return{uri:x.parse(c),originalUrl:c}}catch{this.logService.trace("app#resolveInitialProtocolUrls() protocol url failed to parse:",c);return}}),o=[],a=[];for(const c of n){if(!c)continue;const l=this.getWindowOpenableFromProtocolUrl(c.uri);if(l)if(await this.shouldBlockOpenable(l,e,i)){this.logService.trace("app#resolveInitialProtocolUrls() protocol url was blocked:",c.uri.toString(!0));continue}else this.logService.trace("app#resolveInitialProtocolUrls() protocol url will be handled as window to open:",c.uri.toString(!0),l),o.push(l);else this.logService.trace("app#resolveInitialProtocolUrls() protocol url will be passed to active window for handling:",c.uri.toString(!0)),a.push(c)}return{urls:a,openables:o}}async shouldBlockOpenable(e,i,r){let s,n;if(Om(e)?(s=e.workspaceUri,n=w(148,null,s.scheme===T.file?Lo(s,{os:Gi,tildify:this.environmentMainService}):s.toString(!0),this.productService.nameShort)):r4(e)?(s=e.folderUri,n=w(149,null,s.scheme===T.file?Lo(s,{os:Gi,tildify:this.environmentMainService}):s.toString(!0),this.productService.nameShort)):(s=e.fileUri,n=w(150,null,s.scheme===T.file?Lo(s,{os:Gi,tildify:this.environmentMainService}):s.toString(!0),this.productService.nameShort)),s.scheme!==T.file&&s.scheme!==T.vscodeRemote||this.configurationService.getValue(Qw.SECURITY_PROTOCOL_HANDLING_CONFIRMATION_SETTING_KEY[s.scheme])===!1)return!1;const{response:a,checkboxChecked:c}=await r.showMessageBox({type:"warning",buttons:[w(151,null),w(152,null)],message:n,detail:w(153,null),checkboxLabel:s.scheme===T.file?w(154,null):w(155,null),cancelId:1});if(a!==0)return!0;if(c){const l={channel:"vscode:disablePromptForProtocolHandling",args:s.scheme===T.file?"local":"remote"};i.sendToFocused(l.channel,l.args),i.sendToOpeningWindow(l.channel,l.args)}return!1}getWindowOpenableFromProtocolUrl(e){if(e.path){if(e.authority===T.file){const i=x.file(e.fsPath);return Un(i)?{workspaceUri:i}:{fileUri:i}}else if(e.authority===T.vscodeRemote){const i=e.path.indexOf(le.sep,1);let r,s;i!==-1?(r=e.path.substring(1,i),s=e.path.substring(i)):(r=e.path.substring(1),s="/");let n=e.query;const o=new URLSearchParams(e.query);o.get("windowId")==="_blank"&&(o.delete("windowId"),n=o.toString());const a=x.from({scheme:T.vscodeRemote,authority:r,path:s,query:n,fragment:e.fragment});return Un(s)?{workspaceUri:a}:/:[\d]+$/.test(s)?{fileUri:a}:{folderUri:a}}}}async handleProtocolUrl(e,i,r,s,n){this.logService.trace("app#handleProtocolUrl():",s.toString(!0),n),s.scheme===this.productService.urlProtocol&&s.path==="workspace"&&(s=s.with({authority:"file",path:x.parse(s.query).path,query:""}));let o=!1;const a=new URLSearchParams(s.query);a.get("windowId")==="_blank"?(this.logService.trace("app#handleProtocolUrl() found 'windowId=_blank' as parameter, setting shouldOpenInNewWindow=true:",s.toString(!0)),a.delete("windowId"),s=s.with({query:a.toString()}),o=!0):O&&e.getWindowCount()===0&&(this.logService.trace("app#handleProtocolUrl() running on macOS with no window open, setting shouldOpenInNewWindow=true:",s.toString(!0)),o=!0);const c=a.get("continueOn");c!==null&&(this.logService.trace("app#handleProtocolUrl() found 'continueOn' as parameter:",s.toString(!0)),a.delete("continueOn"),s=s.with({query:a.toString()}),this.environmentMainService.continueOn=c??void 0);const l=this.getWindowOpenableFromProtocolUrl(s);return l?await this.shouldBlockOpenable(l,e,i)?(this.logService.trace("app#handleProtocolUrl() protocol url was blocked:",s.toString(!0)),!0):(this.logService.trace("app#handleProtocolUrl() opening protocol url as window:",l,s.toString(!0)),(await e.open({context:6,cli:{...this.environmentMainService.args},urisToOpen:[l],forceNewWindow:o,gotoLineMode:!0})).at(0)?.focus(),!0):o?(this.logService.trace("app#handleProtocolUrl() opening empty window and passing in protocol url:",s.toString(!0)),await(await e.open({context:6,cli:{...this.environmentMainService.args},forceNewWindow:!0,forceEmpty:!0,gotoLineMode:!0,remoteAuthority:sa(s)})).at(0)?.ready(),r.open(s,n)):(this.logService.trace("app#handleProtocolUrl(): not handled",s.toString(!0),n),!1)}setupSharedProcess(e,i,r,s){const n=this._register(this.mainInstantiationService.createInstance(zh,e,i,r,s));this._register(n.onDidCrash(()=>this.windowsMainService?.sendToFocused("vscode:reportSharedProcessCrash")));const o=(async()=>{this.logService.trace("Main->SharedProcess#connect");const c=await n.connect();return this.logService.trace("Main->SharedProcess#connect: connection established"),new hm(c,"main")})();return{sharedProcessReady:(async()=>(await n.whenReady(),o))(),sharedProcessClient:o}}async initServices(e,i,r,s,n){const o=new Dh;switch(process.platform){case"win32":o.set(Jn,new se(Rl,[e]));break;case"linux":cg?o.set(Jn,new se(Jh,[process.env.SNAP,process.env.SNAP_REVISION])):o.set(Jn,new se(Kh,[e]));break;case"darwin":o.set(Jn,new se(ln,[e]));break}o.set(ot,new se(af,[e,i,r,s,this.userEnv],!1)),o.set(la,new se(kf,void 0,!1));const a=new ih(this.logService,this.productService);o.set(Is,a),o.set(cv,new se(Nh,void 0,!1)),o.set(ch,new se(lh,void 0,!1)),o.set(p1,Oe.toService(nd(n.then(f=>f.getChannel("diagnostics"))))),o.set(Q1,new se(Wh,[this.userEnv])),o.set(Lh,new se(tv)),o.set(iv,new se(Oh,[this.userEnv])),o.set(mE,new se(wa)),o.set(hd,new se(uh)),o.set(av,new se(Fh)),o.set(Jr,new se(gl,void 0,!1)),o.set(ap,new se(cp)),o.set(hp,new se(dp)),o.set(Kw,new se(N7,void 0,!1)),o.set(wv,new se(ef)),o.set(uv,new se(Vh)),o.set(I1,new se(kh)),o.set(Zo,new se(Gd)),o.set(xs,new se(Kd));const c=new vf({graceTime:6e4,shortGraceTime:6e3,scrollback:this.configurationService.getValue("terminal.integrated.persistentSessionScrollback")??100},this.configurationService,this.environmentMainService,this.lifecycleMainService,this.logService),l=new bf(c,this.configurationService,this.logService,this.loggerService);o.set(Mv,l),B?o.set(ml,new se(xh)):O?o.set(ml,new se(w5)):Pe&&o.set(ml,new se($1));const u=new Xd(this.environmentMainService,this.configurationService,this.productService,this.logService,this.stateService);o.set(ea,u);const d=new oh(this.environmentMainService,this.logService,this.userDataProfilesMainService,u,a);if(o.set(rn,d),o.set(b1,new se(cf,void 0,!1)),o.set(Cl,new se(Uh,void 0,!1)),o.set(xl,new se(Zh,void 0,!1)),ME(this.productService,this.environmentMainService)){const f=YR(this.productService,this.configurationService),p=nd(n.then(E=>E.getChannel("telemetryAppender"))),v=new UE(p),m=GR(TU(),MU(),process.arch,this.productService.commit,this.productService.version,e,i,r,s,f),y=JR(this.environmentMainService),S={appenders:[v],commonProperties:m,piiPaths:y,sendErrorTelemetry:!0};o.set(ei,new se(Gh,[S],!1))}else o.set(ei,Al);return o.set(Pa,new se(pf,void 0,!0)),o.set(k6,new se(hf,void 0,!0)),o.set(Rv,new se(gf,void 0,!0)),o.set(Yd,new se(Jd)),o.set(Gw,new se(F7)),o.set(Gn,new se(yh,void 0,!0)),o.set(Vw,new se(tp)),o.set(qw,new se(ip)),this.productService.quality!=="stable"&&o.set(W7,new se(rp,void 0,!0)),await Ht.settled([u.initialize(),d.initialize()]),this.mainInstantiationService.createChild(o)}initChannels(e,i,r){const s=this._register(new ke),n=Oe.fromService(e.get(cv),s,{disableMarshalling:!0});this.mainProcessNodeIpcServer.registerChannel("launch",n);const o=Oe.fromService(e.get(ch),s,{disableMarshalling:!0});this.mainProcessNodeIpcServer.registerChannel("diagnostics",o);const a=Oe.fromService(e.get(Vw),s);i.registerChannel("tracing",a),r.then(_e=>_e.registerChannel("tracing",a)),aU(e,i,r,s),bU(e,i,r,s);const c=Oe.fromService(e.get(qw),s);i.registerChannel("abuse",c);const l=s.add(new a6(e.get(Xn)));i.registerChannel("policy",l),r.then(_e=>_e.registerChannel("policy",l));const u=this.fileService.getProvider(T.file);Rx(u instanceof Ch);const d=s.add(new X5(u,this.logService,this.environmentMainService));i.registerChannel(G1,d),r.then(_e=>_e.registerChannel(G1,d));const f=Oe.fromService(e.get(Gr),s);i.registerChannel("userDataProfiles",f),r.then(_e=>_e.registerChannel("userDataProfiles",f));const p=new BE(e.get(Jn));i.registerChannel("update",p);const v=new B7(e.get(ap));i.registerChannel("systemNotification",v);const m=Oe.fromService(e.get(hp),s);i.registerChannel("tray",m);const y=Oe.fromService(e.get(Q1),s);i.registerChannel("process",y);const S=Oe.fromService(e.get(Lh),s);i.registerChannel("processExecution",S);const E=Oe.fromService(e.get(iv),s);i.registerChannel("extensionMonitor",E);const k=Oe.fromService(e.get(hd),s);i.registerChannel("encryption",k);const R=Oe.fromService(e.get(Sa),s);i.registerChannel("sign",R);const C=Oe.fromService(e.get(av),s);i.registerChannel("keyboardLayout",C),this.nativeHostMainService=e.get(Jr);const M=Oe.fromService(this.nativeHostMainService,s);i.registerChannel("nativeHost",M),r.then(_e=>_e.registerChannel("nativeHost",M));const J=Oe.fromService(e.get(Kw),s);i.registerChannel("webContentExtractor",J);const ne=Oe.fromService(e.get(b1),s);i.registerChannel("workspaces",ne);const $=Oe.fromService(e.get(uv),s);i.registerChannel("menubar",$);const ge=Oe.fromService(e.get(xl),s);i.registerChannel("url",ge);const Ke=Oe.fromService(e.get(wv),s);i.registerChannel("webview",Ke);const ie=s.add(new NE(this.logService,e.get(Zo)));i.registerChannel("storage",ie),r.then(_e=>_e.registerChannel("storage",ie));const Et=s.add(new C6(e.get(Zo),e.get(Gr),this.logService));r.then(_e=>_e.registerChannel("profileStorageListener",Et));const W=Oe.fromService(e.get(Mv),s);i.registerChannel(Ca.LocalPty,W);const F=Oe.fromService(e.get(ml),s);i.registerChannel("externalTerminal",F);const Q=Oe.fromService(e.get(Gw),s);i.registerChannel(O7,Q);const H=new D6(e.get(ya));i.registerChannel("logger",H),r.then(_e=>_e.registerChannel("logger",H));const ee=new g2(e.get(ot));i.registerChannel("extensionhostdebugservice",ee);const de=Oe.fromService(e.get(I1),s);i.registerChannel(X2,de);const Ae=Oe.fromService(e.get(Rv),s);i.registerChannel(A6,Ae)}async openFirstWindow(e,i){const r=this.windowsMainService=e.get(ot);this.auxiliaryWindowsMainService=e.get(la),this.systemNotificationService=e.get(ap),this.trayMainService=e.get(hp);const s=zn(process.env)?0:4,n=this.environmentMainService.args;if(i){if(i.openables.length>0)return r.open({context:s,cli:n,urisToOpen:i.openables,gotoLineMode:!0,initialStartup:!0});if(i.urls.length>0)for(const m of i.urls){const y=new URLSearchParams(m.uri.query);if(y.get("windowId")==="_blank")return y.delete("windowId"),m.originalUrl=m.uri.toString(!0),m.uri=m.uri.with({query:y.toString()}),r.open({context:s,cli:n,forceNewWindow:!0,forceEmpty:!0,gotoLineMode:!0,initialStartup:!0})}}const o=global.macOpenFiles,a=n._.length,c=!!n["folder-uri"],l=!!n["file-uri"],u=n["skip-add-to-recently-opened"]===!0,d=n.wait&&n.waitMarkerFilePath?x.file(n.waitMarkerFilePath):void 0,f=n.remote||void 0,p=n.profile,v=n["profile-temp"];if(!a&&!c&&!l){if(n["new-window"]||p||v)return r.open({context:s,cli:n,forceNewWindow:!0,forceEmpty:!0,noRecentEntry:u,waitMarkerFileURI:d,initialStartup:!0,remoteAuthority:f,forceProfile:p,forceTempProfile:v});if(o.length)return r.open({context:1,cli:n,urisToOpen:o.map(m=>(m=Oo(m),Un(m)?{workspaceUri:x.file(m)}:{fileUri:x.file(m)})),noRecentEntry:u,waitMarkerFileURI:d,initialStartup:!0})}return r.open({context:s,cli:n,forceNewWindow:n["new-window"],diffMode:n.diff,mergeMode:n.merge,noRecentEntry:u,waitMarkerFileURI:d,gotoLineMode:n.goto,initialStartup:!0,remoteAuthority:f,forceProfile:p,forceTempProfile:v})}afterWindowOpen(){this.installMutex(),V7.registerHttpProtocol(T.vscodeRemoteResource,(e,i)=>{i({url:e.url.replace(/^vscode-remote-resource:/,"http:"),method:e.method})}),this.resolveShellEnvironment(this.environmentMainService.args,process.env,!0),this.updateCrashReporterEnablement(),O&&po.runningUnderARM64Translation&&this.windowsMainService?.sendToFocused("vscode:showTranslatedBuildWarning"),this.requestNotificationPermissions()}async installMutex(){const e=this.productService.win32MutexName;if(B&&e)try{const i=await import("@vscode/windows-mutex"),r=new i.Mutex(e);P.once(this.lifecycleMainService.onWillShutdown)(()=>r.release())}catch(i){this.logService.error(i)}}async resolveShellEnvironment(e,i,r){try{return await x1(this.configurationService,this.logService,e,i)}catch(s){const n=rr(s);r?this.windowsMainService?.sendToFocused("vscode:showResolveShellEnvError",n):this.logService.error(n)}return{}}async updateCrashReporterEnablement(){try{const i=(await this.fileService.readFile(this.environmentMainService.argvResource)).value.toString(),r=B0(i),n=fv(this.configurationService)>=1;if(r["enable-crash-reporter"]===void 0){const o=[""," // Allows to disable crash reporting."," // Should restart the app if the value is changed.",` "enable-crash-reporter": ${n},`,""," // Unique id used for correlating crash reports sent from this instance."," // Do not edit this value.",` "crash-reporter-id": "${ui()}"`,"}"],a=i.substring(0,i.length-2).concat(`,
|
|
`,o.join(`
|
|
`));await this.fileService.writeFile(this.environmentMainService.argvResource,Y.fromString(a))}else{const o=i.replace(/"enable-crash-reporter": .*,/,`"enable-crash-reporter": ${n},`);o!==i&&await this.fileService.writeFile(this.environmentMainService.argvResource,Y.fromString(o))}}catch(e){this.logService.error(e),this.windowsMainService?.sendToFocused("vscode:showArgvParseWarning")}}eventuallyAfterWindowOpen(){fW(this.stateService,this.logService)}async requestNotificationPermissions(){this.systemNotificationService&&this.systemNotificationService.isSupported()&&!this.systemNotificationService.hasPermission()&&setTimeout(async()=>{const e=await this.systemNotificationService.requestPermission();this.logService.info(`Notification permission ${e?"granted":"denied"}`)},1e3)}},fp=Qw=__decorate([__param(2,Or),__param(3,V),__param(4,Bc),__param(5,st),__param(6,ze),__param(7,Qe),__param(8,Ii),__param(9,mt),__param(10,qe),__param(11,Gr)],fp)}});function ou(t){return Object.isFrozen(t)?t:X3(t)}function pn(t,e){const{added:i,removed:r,updated:s}=z7(e?.rawConfiguration,t?.rawConfiguration),n=[],o=t?.getAllOverrideIdentifiers()||[],a=e?.getAllOverrideIdentifiers()||[];if(e){const c=a.filter(l=>!o.includes(l));for(const l of c)n.push([l,e.getKeysForOverrideIdentifier(l)])}if(t){const c=o.filter(l=>!a.includes(l));for(const l of c)n.push([l,t.getKeysForOverrideIdentifier(l)])}if(e&&t){for(const c of o)if(a.includes(c)){const l=z7({contents:t.getOverrideValue(void 0,c)||{},keys:t.getKeysForOverrideIdentifier(c)},{contents:e.getOverrideValue(void 0,c)||{},keys:e.getKeysForOverrideIdentifier(c)});n.push([c,[...l.added,...l.removed,...l.updated]])}}return{added:i,removed:r,updated:s,overrides:n}}function z7(t,e){const i=t?e?t.keys.filter(n=>e.keys.indexOf(n)===-1):[...t.keys]:[],r=e?t?e.keys.filter(n=>t.keys.indexOf(n)===-1):[...e.keys]:[],s=[];if(t&&e){for(const n of e.keys)if(t.keys.indexOf(n)!==-1){const o=Ju(e.contents,n),a=Ju(t.contents,n);Kr(o,a)||s.push(n)}}return{added:i,removed:r,updated:s}}var bt,Xw,G7,K7,pp,Y7,J7=g({"out-build/vs/platform/configuration/common/configurationModels.js"(){"use strict";Wt(),q(),Cs(),L(),ai(),ur(),xe(),re(),Xe(),Cn(),ms(),bt=class wo{static createEmptyModel(e){return new wo({},[],[],void 0,e)}constructor(e,i,r,s,n){this._contents=e,this._keys=i,this._overrides=r,this.raw=s,this.logService=n,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw){const e=(Array.isArray(this.raw)?this.raw:[this.raw]).map(i=>{if(i instanceof wo)return i;const r=new Xw("",this.logService);return r.parseRaw(i),r.configurationModel});this._rawConfiguration=e.reduce((i,r)=>r===i?r:i.merge(r),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?Ju(this.contents,e):this.contents}inspect(e,i){const r=this;return{get value(){return ou(r.rawConfiguration.getValue(e))},get override(){return i?ou(r.rawConfiguration.getOverrideValue(e,i)):void 0},get merged(){return ou(i?r.rawConfiguration.override(i).getValue(e):r.rawConfiguration.getValue(e))},get overrides(){const s=[];for(const{contents:n,identifiers:o,keys:a}of r.rawConfiguration.overrides){const c=new wo(n,a,[],void 0,r.logService).getValue(e);c!==void 0&&s.push({identifiers:o,value:c})}return s.length?ou(s):void 0}}}getOverrideValue(e,i){const r=this.getContentsForOverrideIdentifer(i);return r?e?Ju(r,e):r:void 0}getKeysForOverrideIdentifier(e){const i=[];for(const r of this.overrides)r.identifiers.includes(e)&&i.push(...r.keys);return ds(i)}getAllOverrideIdentifiers(){const e=[];for(const i of this.overrides)e.push(...i.identifiers);return ds(e)}override(e){let i=this.overrideConfigurations.get(e);return i||(i=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,i)),i}merge(...e){const i=lr(this.contents),r=lr(this.overrides),s=[...this.keys],n=this.raw?Array.isArray(this.raw)?[...this.raw]:[this.raw]:[this];for(const o of e)if(n.push(...o.raw?Array.isArray(o.raw)?o.raw:[o.raw]:[o]),!o.isEmpty()){this.mergeContents(i,o.contents);for(const a of o.overrides){const[c]=r.filter(l=>nc(l.identifiers,a.identifiers));c?(this.mergeContents(c.contents,a.contents),c.keys.push(...a.keys),c.keys=ds(c.keys)):r.push(lr(a))}for(const a of o.keys)s.indexOf(a)===-1&&s.push(a)}return new wo(i,s,r,!n.length||n.every(o=>o instanceof wo)?void 0:n,this.logService)}createOverrideConfigurationModel(e){const i=this.getContentsForOverrideIdentifer(e);if(!i||typeof i!="object"||!Object.keys(i).length)return this;const r={};for(const s of ds([...Object.keys(this.contents),...Object.keys(i)])){let n=this.contents[s];const o=i[s];o&&(typeof n=="object"&&typeof o=="object"?(n=lr(n),this.mergeContents(n,o)):n=o),r[s]=n}return new wo(r,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,i){for(const r of Object.keys(i)){if(r in e&&Lt(e[r])&&Lt(i[r])){this.mergeContents(e[r],i[r]);continue}e[r]=lr(i[r])}}getContentsForOverrideIdentifer(e){let i=null,r=null;const s=n=>{n&&(r?this.mergeContents(r,n):r=lr(n))};for(const n of this.overrides)n.identifiers.length===1&&n.identifiers[0]===e?i=n.contents:n.identifiers.includes(e)&&s(n.contents);return s(i),r}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,i){this.updateValue(e,i,!0)}setValue(e,i){this.updateValue(e,i,!1)}removeValue(e){const i=this.keys.indexOf(e);i!==-1&&(this.keys.splice(i,1),EC(this.contents,e),Fr.test(e)&&this.overrides.splice(this.overrides.findIndex(r=>nc(r.identifiers,Sc(e))),1))}updateValue(e,i,r){if(TS(this.contents,e,i,s=>this.logService.error(s)),r=r||this.keys.indexOf(e)===-1,r&&this.keys.push(e),Fr.test(e)){const s=Sc(e),n={identifiers:s,keys:Object.keys(this.contents[e]),contents:Ng(this.contents[e],a=>this.logService.error(a))},o=this.overrides.findIndex(a=>nc(a.identifiers,s));o!==-1?this.overrides[o]=n:this.overrides.push(n)}}},Xw=class{constructor(t,e){this._name=t,this.logService=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||bt.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(t,e){if(!ci(t)){const i=this.doParseContent(t);this.parseRaw(i,e)}}reparse(t){this._raw&&this.parseRaw(this._raw,t)}parseRaw(t,e){this._raw=t;const{contents:i,keys:r,overrides:s,restricted:n,hasExcludedProperties:o}=this.doParseRaw(t,e);this._configurationModel=new bt(i,r,s,o?[t]:void 0,this.logService),this._restrictedConfigurations=n||[]}doParseContent(t){let e={},i=null,r=[];const s=[],n=[];function o(c){Array.isArray(r)?r.push(c):i!==null&&(r[i]=c)}const a={onObjectBegin:()=>{const c={};o(c),s.push(r),r=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{r=s.pop()},onArrayBegin:()=>{const c=[];o(c),s.push(r),r=c,i=null},onArrayEnd:()=>{r=s.pop()},onLiteralValue:o,onError:(c,l,u)=>{n.push({error:c,offset:l,length:u})}};if(t)try{eh(t,a),e=r[0]||{}}catch(c){this.logService.error(`Error while parsing settings file ${this._name}: ${c}`),this._parseErrors=[c]}return e}doParseRaw(t,e){const i=Ei.as(ir.Configuration).getConfigurationProperties(),r=this.filter(t,i,!0,e);t=r.raw;const s=Ng(t,a=>this.logService.error(`Conflict in settings file ${this._name}: ${a}`)),n=Object.keys(t),o=this.toOverrides(t,a=>this.logService.error(`Conflict in settings file ${this._name}: ${a}`));return{contents:s,keys:n,overrides:o,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(t,e,i,r){let s=!1;if(!r?.scopes&&!r?.skipRestricted&&!r?.exclude?.length)return{raw:t,restricted:[],hasExcludedProperties:s};const n={},o=[];for(const a in t)if(Fr.test(a)&&i){const c=this.filter(t[a],e,!1,r);n[a]=c.raw,s=s||c.hasExcludedProperties,o.push(...c.restricted)}else{const c=e[a];c?.restricted&&o.push(a),this.shouldInclude(a,c,r)?n[a]=t[a]:s=!0}return{raw:n,restricted:o,hasExcludedProperties:s}}shouldInclude(t,e,i){if(i.exclude?.includes(t))return!1;if(i.include?.includes(t))return!0;if(i.skipRestricted&&e?.restricted||i.skipUnregistered&&!e)return!1;const r=e?typeof e.scope<"u"?e.scope:4:void 0;return r===void 0||i.scopes===void 0?!0:i.scopes.includes(r)}toOverrides(t,e){const i=[];for(const r of Object.keys(t))if(Fr.test(r)){const s={};for(const n in t[r])s[n]=t[r][n];i.push({identifiers:Sc(r),keys:Object.keys(s),contents:Ng(s,e)})}return i}},G7=class extends N{constructor(t,e,i,r,s){super(),this.userSettingsResource=t,this.parseOptions=e,this.fileService=r,this.logService=s,this._onDidChange=this._register(new D),this.onDidChange=this._onDidChange.event,this.parser=new Xw(this.userSettingsResource.toString(),s),this._register(this.fileService.watch(i.dirname(this.userSettingsResource))),this._register(this.fileService.watch(this.userSettingsResource)),this._register(P.any(P.filter(this.fileService.onDidFilesChange,n=>n.contains(this.userSettingsResource)),P.filter(this.fileService.onDidRunOperation,n=>(n.isOperation(0)||n.isOperation(3)||n.isOperation(1)||n.isOperation(4))&&i.isEqual(n.resource,t)))(()=>this._onDidChange.fire()))}async loadConfiguration(){try{const t=await this.fileService.readFile(this.userSettingsResource);return this.parser.parse(t.value.toString()||"{}",this.parseOptions),this.parser.configurationModel}catch{return bt.createEmptyModel(this.logService)}}reparse(t){return t&&(this.parseOptions=t),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}},K7=class{constructor(t,e,i,r,s,n,o,a,c,l,u,d,f){this.key=t,this.overrides=e,this._value=i,this.overrideIdentifiers=r,this.defaultConfiguration=s,this.policyConfiguration=n,this.applicationConfiguration=o,this.userConfiguration=a,this.localUserConfiguration=c,this.remoteUserConfiguration=l,this.workspaceConfiguration=u,this.folderConfigurationModel=d,this.memoryConfigurationModel=f}get value(){return ou(this._value)}toInspectValue(t){return t?.value!==void 0||t?.override!==void 0||t?.overrides!==void 0?t:void 0}get defaultInspectValue(){return this._defaultInspectValue||(this._defaultInspectValue=this.defaultConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._defaultInspectValue}get defaultValue(){return this.defaultInspectValue.merged}get default(){return this.toInspectValue(this.defaultInspectValue)}get policyInspectValue(){return this._policyInspectValue===void 0&&(this._policyInspectValue=this.policyConfiguration?this.policyConfiguration.inspect(this.key):null),this._policyInspectValue}get policyValue(){return this.policyInspectValue?.merged}get policy(){return this.policyInspectValue?.value!==void 0?{value:this.policyInspectValue.value}:void 0}get applicationInspectValue(){return this._applicationInspectValue===void 0&&(this._applicationInspectValue=this.applicationConfiguration?this.applicationConfiguration.inspect(this.key):null),this._applicationInspectValue}get applicationValue(){return this.applicationInspectValue?.merged}get application(){return this.toInspectValue(this.applicationInspectValue)}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get userValue(){return this.userInspectValue.merged}get user(){return this.toInspectValue(this.userInspectValue)}get userLocalInspectValue(){return this._userLocalInspectValue||(this._userLocalInspectValue=this.localUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userLocalInspectValue}get userLocalValue(){return this.userLocalInspectValue.merged}get userLocal(){return this.toInspectValue(this.userLocalInspectValue)}get userRemoteInspectValue(){return this._userRemoteInspectValue||(this._userRemoteInspectValue=this.remoteUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userRemoteInspectValue}get userRemoteValue(){return this.userRemoteInspectValue.merged}get userRemote(){return this.toInspectValue(this.userRemoteInspectValue)}get workspaceInspectValue(){return this._workspaceInspectValue===void 0&&(this._workspaceInspectValue=this.workspaceConfiguration?this.workspaceConfiguration.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceInspectValue}get workspaceValue(){return this.workspaceInspectValue?.merged}get workspace(){return this.toInspectValue(this.workspaceInspectValue)}get workspaceFolderInspectValue(){return this._workspaceFolderInspectValue===void 0&&(this._workspaceFolderInspectValue=this.folderConfigurationModel?this.folderConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceFolderInspectValue}get workspaceFolderValue(){return this.workspaceFolderInspectValue?.merged}get workspaceFolder(){return this.toInspectValue(this.workspaceFolderInspectValue)}get memoryInspectValue(){return this._memoryInspectValue===void 0&&(this._memoryInspectValue=this.memoryConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier)),this._memoryInspectValue}get memoryValue(){return this.memoryInspectValue.merged}get memory(){return this.toInspectValue(this.memoryInspectValue)}},pp=class W8{constructor(e,i,r,s,n,o,a,c,l,u){this._defaultConfiguration=e,this._policyConfiguration=i,this._applicationConfiguration=r,this._localUserConfiguration=s,this._remoteUserConfiguration=n,this._workspaceConfiguration=o,this._folderConfigurations=a,this._memoryConfiguration=c,this._memoryConfigurationByResource=l,this.logService=u,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Bt,this._userConfiguration=null}getValue(e,i,r){return this.getConsolidatedConfigurationModel(e,i,r).getValue(e)}updateValue(e,i,r={}){let s;r.resource?(s=this._memoryConfigurationByResource.get(r.resource),s||(s=bt.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(r.resource,s))):s=this._memoryConfiguration,i===void 0?s.removeValue(e):s.setValue(e,i),r.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,i,r){const s=this.getConsolidatedConfigurationModel(e,i,r),n=this.getFolderConfigurationModelForResource(i.resource,r),o=i.resource?this._memoryConfigurationByResource.get(i.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const c of s.overrides)for(const l of c.identifiers)s.getOverrideValue(e,l)!==void 0&&a.add(l);return new K7(e,i,s.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,r?this._workspaceConfiguration:void 0,n||void 0,o)}keys(e){const i=this.getFolderConfigurationModelForResource(void 0,e);return{default:this._defaultConfiguration.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this._workspaceConfiguration.keys.slice(0),workspaceFolder:i?i.keys.slice(0):[]}}updateDefaultConfiguration(e){this._defaultConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(e){this._policyConfiguration=e}updateApplicationConfiguration(e){this._applicationConfiguration=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,i){this._folderConfigurations.set(e,i),this._foldersConsolidatedConfigurations.delete(e)}deleteFolderConfiguration(e){this.folderConfigurations.delete(e),this._foldersConsolidatedConfigurations.delete(e)}compareAndUpdateDefaultConfiguration(e,i){const r=[];if(!i){const{added:s,updated:n,removed:o}=pn(this._defaultConfiguration,e);i=[...s,...n,...o]}for(const s of i)for(const n of Sc(s)){const o=this._defaultConfiguration.getKeysForOverrideIdentifier(n),a=e.getKeysForOverrideIdentifier(n),c=[...a.filter(l=>o.indexOf(l)===-1),...o.filter(l=>a.indexOf(l)===-1),...o.filter(l=>!Kr(this._defaultConfiguration.override(n).getValue(l),e.override(n).getValue(l)))];r.push([n,c])}return this.updateDefaultConfiguration(e),{keys:i,overrides:r}}compareAndUpdatePolicyConfiguration(e){const{added:i,updated:r,removed:s}=pn(this._policyConfiguration,e),n=[...i,...r,...s];return n.length&&this.updatePolicyConfiguration(e),{keys:n,overrides:[]}}compareAndUpdateApplicationConfiguration(e){const{added:i,updated:r,removed:s,overrides:n}=pn(this.applicationConfiguration,e),o=[...i,...r,...s];return o.length&&this.updateApplicationConfiguration(e),{keys:o,overrides:n}}compareAndUpdateLocalUserConfiguration(e){const{added:i,updated:r,removed:s,overrides:n}=pn(this.localUserConfiguration,e),o=[...i,...r,...s];return o.length&&this.updateLocalUserConfiguration(e),{keys:o,overrides:n}}compareAndUpdateRemoteUserConfiguration(e){const{added:i,updated:r,removed:s,overrides:n}=pn(this.remoteUserConfiguration,e),o=[...i,...r,...s];return o.length&&this.updateRemoteUserConfiguration(e),{keys:o,overrides:n}}compareAndUpdateWorkspaceConfiguration(e){const{added:i,updated:r,removed:s,overrides:n}=pn(this.workspaceConfiguration,e),o=[...i,...r,...s];return o.length&&this.updateWorkspaceConfiguration(e),{keys:o,overrides:n}}compareAndUpdateFolderConfiguration(e,i){const r=this.folderConfigurations.get(e),{added:s,updated:n,removed:o,overrides:a}=pn(r,i),c=[...s,...n,...o];return(c.length||!r)&&this.updateFolderConfiguration(e,i),{keys:c,overrides:a}}compareAndDeleteFolderConfiguration(e){const i=this.folderConfigurations.get(e);if(!i)throw new Error("Unknown folder");this.deleteFolderConfiguration(e);const{added:r,updated:s,removed:n,overrides:o}=pn(i,void 0);return{keys:[...r,...s,...n],overrides:o}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{const e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new bt(e.contents,e.keys,e.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidatedConfigurationModel(e,i,r){let s=this.getConsolidatedConfigurationModelForResource(i,r);if(i.overrideIdentifier&&(s=s.override(i.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0){s=s.merge();for(const n of this._policyConfiguration.keys)s.setValue(n,this._policyConfiguration.getValue(n))}return s}getConsolidatedConfigurationModelForResource({resource:e},i){let r=this.getWorkspaceConsolidatedConfiguration();if(i&&e){const s=i.getFolder(e);s&&(r=this.getFolderConsolidatedConfiguration(s.uri)||r);const n=this._memoryConfigurationByResource.get(e);n&&(r=r.merge(n))}return r}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let i=this._foldersConsolidatedConfigurations.get(e);if(!i){const r=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(i=r.merge(s),this._foldersConsolidatedConfigurations.set(e,i)):i=r}return i}getFolderConfigurationModelForResource(e,i){if(i&&e){const r=i.getFolder(e);if(r)return this._folderConfigurations.get(r.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,i)=>{const{contents:r,overrides:s,keys:n}=this._folderConfigurations.get(i);return e.push([i,{contents:r,overrides:s,keys:n}]),e},[])}}allKeys(){const e=new Set;return this._defaultConfiguration.keys.forEach(i=>e.add(i)),this.userConfiguration.keys.forEach(i=>e.add(i)),this._workspaceConfiguration.keys.forEach(i=>e.add(i)),this._folderConfigurations.forEach(i=>i.keys.forEach(r=>e.add(r))),[...e.values()]}allOverrideIdentifiers(){const e=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(i=>e.add(i)),this.userConfiguration.getAllOverrideIdentifiers().forEach(i=>e.add(i)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(i=>e.add(i)),this._folderConfigurations.forEach(i=>i.getAllOverrideIdentifiers().forEach(r=>e.add(r))),[...e.values()]}getAllKeysForOverrideIdentifier(e){const i=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(e).forEach(r=>i.add(r)),this.userConfiguration.getKeysForOverrideIdentifier(e).forEach(r=>i.add(r)),this._workspaceConfiguration.getKeysForOverrideIdentifier(e).forEach(r=>i.add(r)),this._folderConfigurations.forEach(r=>r.getKeysForOverrideIdentifier(e).forEach(s=>i.add(s))),[...i.values()]}static parse(e,i){const r=this.parseConfigurationModel(e.defaults,i),s=this.parseConfigurationModel(e.policy,i),n=this.parseConfigurationModel(e.application,i),o=this.parseConfigurationModel(e.userLocal,i),a=this.parseConfigurationModel(e.userRemote,i),c=this.parseConfigurationModel(e.workspace,i),l=e.folders.reduce((u,d)=>(u.set(x.revive(d[0]),this.parseConfigurationModel(d[1],i)),u),new Bt);return new W8(r,s,n,o,a,c,l,bt.createEmptyModel(i),new Bt,i)}static parseConfigurationModel(e,i){return new bt(e.contents,e.keys,e.overrides,e.raw,i)}},Y7=class{constructor(t,e,i,r,s){this.change=t,this.previous=e,this.currentConfiguraiton=i,this.currentWorkspace=r,this.logService=s,this._marker=`
|
|
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const n of t.keys)this.affectedKeys.add(n);for(const[,n]of t.overrides)for(const o of n)this.affectedKeys.add(o);this._affectsConfigStr=this._marker;for(const n of this.affectedKeys)this._affectsConfigStr+=n+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=pp.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(t,e){const i=this._marker+t,r=this._affectsConfigStr.indexOf(i);if(r<0)return!1;const s=r+i.length;if(s>=this._affectsConfigStr.length)return!1;const n=this._affectsConfigStr.charCodeAt(s);if(n!==this._markerCode1&&n!==this._markerCode2)return!1;if(e){const o=this.previousConfiguration?this.previousConfiguration.getValue(t,e,this.previous?.workspace):void 0,a=this.currentConfiguraiton.getValue(t,e,this.currentWorkspace);return!Kr(o,a)}return!0}}}}),Q7,X7,gp,LU=g({"out-build/vs/platform/configuration/common/configurations.js"(){"use strict";Wt(),q(),L(),ur(),xe(),J7(),Cn(),K(),Xr(),ms(),Re(),Cs(),Q7=class extends N{get configurationModel(){return this._configurationModel}constructor(t){super(),this.logService=t,this._onDidChangeConfiguration=this._register(new D),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=bt.createEmptyModel(this.logService)}async initialize(){return this.resetConfigurationModel(),this._register(Ei.as(ir.Configuration).onDidUpdateConfiguration(({properties:t,defaultsOverrides:e})=>this.onDidUpdateConfiguration(Array.from(t),e))),this.configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}onDidUpdateConfiguration(t,e){this.updateConfigurationModel(t,Ei.as(ir.Configuration).getConfigurationProperties()),this._onDidChangeConfiguration.fire({defaults:this.configurationModel,properties:t})}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=bt.createEmptyModel(this.logService);const t=Ei.as(ir.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(t),t)}updateConfigurationModel(t,e){const i=this.getConfigurationDefaultOverrides();for(const r of t){const s=i[r],n=e[r];s!==void 0?this._configurationModel.setValue(r,s):n?this._configurationModel.setValue(r,lr(n.default)):this._configurationModel.removeValue(r)}}},X7=class{constructor(){this.onDidChangeConfiguration=P.None,this.configurationModel=bt.createEmptyModel(new Ob)}async initialize(){return this.configurationModel}},gp=class extends N{get configurationModel(){return this._configurationModel}constructor(e,i,r){super(),this.defaultConfiguration=e,this.policyService=i,this.logService=r,this._onDidChangeConfiguration=this._register(new D),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=bt.createEmptyModel(this.logService),this.configurationRegistry=Ei.as(ir.Configuration)}async initialize(){return this.logService.trace("PolicyConfiguration#initialize"),this.update(await this.updatePolicyDefinitions(this.defaultConfiguration.configurationModel.keys),!1),this.update(await this.updatePolicyDefinitions(Object.keys(this.configurationRegistry.getExcludedConfigurationProperties())),!1),this._register(this.policyService.onDidChange(e=>this.onDidChangePolicies(e))),this._register(this.defaultConfiguration.onDidChangeConfiguration(async({properties:e})=>this.update(await this.updatePolicyDefinitions(e),!0))),this._configurationModel}async updatePolicyDefinitions(e){this.logService.trace("PolicyConfiguration#updatePolicyDefinitions",e);const i={},r=[],s=this.configurationRegistry.getConfigurationProperties(),n=this.configurationRegistry.getExcludedConfigurationProperties();for(const o of e){const a=s[o]??n[o];if(!a){r.push(o);continue}if(a.policy){if(a.type!=="string"&&a.type!=="number"&&a.type!=="array"&&a.type!=="object"&&a.type!=="boolean"){this.logService.warn(`Policy ${a.policy.name} has unsupported type ${a.type}`);continue}const{defaultValue:c,previewFeature:l}=a.policy;r.push(o),i[a.policy.name]={type:a.type==="number"?"number":a.type==="boolean"?"boolean":"string",previewFeature:l,defaultValue:c}}}return Oy(i)||await this.policyService.updatePolicyDefinitions(i),r}onDidChangePolicies(e){this.logService.trace("PolicyConfiguration#onDidChangePolicies",e);const i=this.configurationRegistry.getPolicyConfigurations(),r=Dt(e.map(s=>i.get(s)));this.update(r,!0)}update(e,i){this.logService.trace("PolicyConfiguration#update",e);const r=this.configurationRegistry.getConfigurationProperties(),s=this.configurationRegistry.getExcludedConfigurationProperties(),n=[],o=this._configurationModel.isEmpty();for(const a of e){const c=r[a]??s[a],l=c?.policy?.name;if(l){let u=this.policyService.getPolicyValue(l);if(At(u)&&c.type!=="string")try{u=this.parse(u)}catch(d){this.logService.error(`Error parsing policy value ${l}:`,$i(d));continue}(o?u!==void 0:!Kr(this._configurationModel.getValue(a),u))&&n.push([a,u])}else this._configurationModel.getValue(a)!==void 0&&n.push([a,void 0])}if(n.length){this.logService.trace("PolicyConfiguration#changed",n);const a=this._configurationModel;this._configurationModel=bt.createEmptyModel(this.logService);for(const c of a.keys)this._configurationModel.setValue(c,a.getValue(c));for(const[c,l]of n)l===void 0?this._configurationModel.removeValue(c):this._configurationModel.setValue(c,l);i&&this._onDidChangeConfiguration.fire(this._configurationModel)}}parse(e){let i={},r=null,s=[];const n=[],o=[];function a(l){if(Array.isArray(s))s.push(l);else if(r!==null){if(s[r]!==void 0)throw new Error(`Duplicate property found: ${r}`);s[r]=l}}if(e&&(eh(e,{onObjectBegin:()=>{const l={};a(l),n.push(s),s=l,r=null},onObjectProperty:l=>{r=l},onObjectEnd:()=>{s=n.pop()},onArrayBegin:()=>{const l=[];a(l),n.push(s),s=l,r=null},onArrayEnd:()=>{s=n.pop()},onLiteralValue:a,onError:(l,u,d)=>{o.push({error:l,offset:u,length:d})}}),i=s[0]||{}),o.length>0)throw new Error(o.map(l=>$i(l.error)).join(`
|
|
`));return i}},gp=__decorate([__param(1,Xn),__param(2,V)],gp)}}),Z7,eP,OU=g({"out-build/vs/platform/configuration/common/configurationService.js"(){"use strict";Wt(),ae(),it(),q(),Cs(),D2(),L(),ai(),ur(),z(),gt(),Xe(),J7(),Cn(),LU(),Xr(),Z7=class extends N{constructor(t,e,i,r){super(),this.settingsResource=t,this.logService=r,this._onDidChangeConfiguration=this._register(new D),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.defaultConfiguration=this._register(new Q7(r)),this.policyConfiguration=i instanceof hv?new X7:this._register(new gp(this.defaultConfiguration,i,r)),this.userConfiguration=this._register(new G7(this.settingsResource,{},rt,e,r)),this.configuration=new pp(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,bt.createEmptyModel(r),bt.createEmptyModel(r),bt.createEmptyModel(r),bt.createEmptyModel(r),new Bt,bt.createEmptyModel(r),new Bt,r),this.configurationEditing=new eP(t,e,this),this.reloadConfigurationScheduler=this._register(new br(()=>this.reloadConfiguration(),50)),this._register(this.defaultConfiguration.onDidChangeConfiguration(({defaults:s,properties:n})=>this.onDidDefaultConfigurationChange(s,n))),this._register(this.policyConfiguration.onDidChangeConfiguration(s=>this.onDidPolicyConfigurationChange(s))),this._register(this.userConfiguration.onDidChange(()=>this.reloadConfigurationScheduler.schedule()))}async initialize(){const[t,e,i]=await Promise.all([this.defaultConfiguration.initialize(),this.policyConfiguration.initialize(),this.userConfiguration.loadConfiguration()]);this.configuration=new pp(t,e,bt.createEmptyModel(this.logService),i,bt.createEmptyModel(this.logService),bt.createEmptyModel(this.logService),new Bt,bt.createEmptyModel(this.logService),new Bt,this.logService)}getConfigurationData(){return this.configuration.toData()}getValue(t,e){const i=typeof t=="string"?t:void 0,r=Fg(t)?t:Fg(e)?e:{};return this.configuration.getValue(i,r,void 0)}async updateValue(t,e,i,r,s){const n=bC(i)?i:Fg(i)?{resource:i.resource,overrideIdentifiers:i.overrideIdentifier?[i.overrideIdentifier]:void 0}:void 0,o=n?r:i;if(o!==void 0&&o!==3&&o!==2)throw new Error(`Unable to write ${t} to target ${o}.`);n?.overrideIdentifiers&&(n.overrideIdentifiers=ds(n.overrideIdentifiers),n.overrideIdentifiers=n.overrideIdentifiers.length?n.overrideIdentifiers:void 0);const a=this.inspect(t,{resource:n?.resource,overrideIdentifier:n?.overrideIdentifiers?n.overrideIdentifiers[0]:void 0});if(a.policyValue!==void 0)throw new Error(`Unable to write ${t} because it is configured in system policy.`);if(Kr(e,a.defaultValue)&&(e=void 0),n?.overrideIdentifiers?.length&&n.overrideIdentifiers.length>1){const l=n.overrideIdentifiers.sort(),u=this.configuration.localUserConfiguration.overrides.find(d=>nc([...d.identifiers].sort(),l));u&&(n.overrideIdentifiers=u.identifiers)}const c=n?.overrideIdentifiers?.length?[DC(n.overrideIdentifiers),t]:[t];await this.configurationEditing.write(c,e),await this.reloadConfiguration()}inspect(t,e={}){return this.configuration.inspect(t,e,void 0)}keys(){return this.configuration.keys(void 0)}async reloadConfiguration(){const t=await this.userConfiguration.loadConfiguration();this.onDidChangeUserConfiguration(t)}onDidChangeUserConfiguration(t){const e=this.configuration.toData(),i=this.configuration.compareAndUpdateLocalUserConfiguration(t);this.trigger(i,e,2)}onDidDefaultConfigurationChange(t,e){const i=this.configuration.toData(),r=this.configuration.compareAndUpdateDefaultConfiguration(t,e);this.trigger(r,i,7)}onDidPolicyConfigurationChange(t){const e=this.configuration.toData(),i=this.configuration.compareAndUpdatePolicyConfiguration(t);this.trigger(i,e,7)}trigger(t,e,i){const r=new Y7(t,{data:e},this.configuration,void 0,this.logService);r.source=i,this._onDidChangeConfiguration.fire(r)}},eP=class{constructor(t,e,i){this.settingsResource=t,this.fileService=e,this.configurationService=i,this.queue=new Wo}write(t,e){return this.queue.queue(()=>this.doWriteConfiguration(t,e))}async doWriteConfiguration(t,e){let i;try{i=(await this.fileService.readFile(this.settingsResource)).value.toString()}catch(n){if(n.fileOperationResult===1)i="{}";else throw n}const r=[];if(jn(i,r,{allowTrailingComma:!0,allowEmptyContent:!0}),r.length>0)throw new Error("Unable to write into the settings file. Please open the file to correct errors/warnings in the file and try again.");const s=this.getEdits(i,t,e);i=uD(i,s),await this.fileService.writeFile(this.settingsResource,Y.fromString(i))}getEdits(t,e,i){const{tabSize:r,insertSpaces:s,eol:n}=this.formattingOptions;if(!e.length){const o=JSON.stringify(i,null,s?" ".repeat(r):" ");return[{content:o,length:o.length,offset:0}]}return lD(t,e,i,{tabSize:r,insertSpaces:s,eol:n})}get formattingOptions(){if(!this._formattingOptions){let t=Gi===3||Gi===2?`
|
|
`:`\r
|
|
`;const e=this.configurationService.getValue("files.eol",{overrideIdentifier:"jsonc"});e&&typeof e=="string"&&e!=="auto"&&(t=e),this._formattingOptions={eol:t,insertSpaces:!!this.configurationService.getValue("editor.insertSpaces",{overrideIdentifier:"jsonc"}),tabSize:this.configurationService.getValue("editor.tabSize",{overrideIdentifier:"jsonc"})}}return this._formattingOptions}}}});import*as FU from"fs";import*as Oi from"os";async function Zw(t,e){const i=`${t}::${e.join(":")}`,r=t0.get(i);if(r)return r;const s=[{tag:"grunt.js",filePattern:/^gruntfile\.js$/i},{tag:"gulp.js",filePattern:/^gulpfile\.js$/i},{tag:"tsconfig.json",filePattern:/^tsconfig\.json$/i},{tag:"package.json",filePattern:/^package\.json$/i},{tag:"jsconfig.json",filePattern:/^jsconfig\.json$/i},{tag:"tslint.json",filePattern:/^tslint\.json$/i},{tag:"eslint.json",filePattern:/^eslint\.json$/i},{tag:"tasks.json",filePattern:/^tasks\.json$/i},{tag:"launch.json",filePattern:/^launch\.json$/i},{tag:"mcp.json",filePattern:/^mcp\.json$/i},{tag:"settings.json",filePattern:/^settings\.json$/i},{tag:"webpack.config.js",filePattern:/^webpack\.config\.js$/i},{tag:"project.json",filePattern:/^project\.json$/i},{tag:"makefile",filePattern:/^makefile$/i},{tag:"sln",filePattern:/^.+\.sln$/i},{tag:"csproj",filePattern:/^.+\.csproj$/i},{tag:"cmake",filePattern:/^.+\.cmake$/i},{tag:"github-actions",filePattern:/^.+\.ya?ml$/i,relativePathPattern:/^\.github(?:\/|\\)workflows$/i},{tag:"devcontainer.json",filePattern:/^devcontainer\.json$/i},{tag:"dockerfile",filePattern:/^(dockerfile|docker\-compose\.ya?ml)$/i},{tag:"cursorrules",filePattern:/^\.cursorrules$/i}],n=new Map,o=new Map,a=2e4;function c(u,d,f,p){const v=d.substring(u.length+1);return Ht.withAsyncBody(async m=>{let y;p.readdirCount++;try{y=await te.readdir(d,{withFileTypes:!0})}catch{m();return}if(p.count>=a){p.count+=y.length,p.maxReached=!0,m();return}let S=y.length;if(S===0){m();return}let E=y;p.count+y.length>a&&(p.maxReached=!0,S=a-p.count,E=y.slice(0,S)),p.count+=y.length;for(const k of E)if(k.isDirectory()){if(f.includes(k.name)||await c(u,U(d,k.name),f,p),--S===0){m();return}}else{const R=k.name.lastIndexOf(".");if(R>=0){const C=k.name.substring(R+1);C&&n.set(C,(n.get(C)??0)+1)}for(const C of s)C.relativePathPattern?.test(v)!==!1&&C.filePattern.test(k.name)&&o.set(C.tag,(o.get(C.tag)??0)+1);if(--S===0){m();return}}})}const l=Ht.withAsyncBody(async u=>{const d={count:0,maxReached:!1,readdirCount:0},f=new En(!0);await c(t,t,e,d);const p=await UU(t);u({configFiles:e0(o),fileTypes:e0(n),fileCount:d.count,maxFilesReached:d.maxReached,launchConfigFiles:p,totalScanTime:f.elapsed(),totalReaddirCount:d.readdirCount})});return t0.set(i,l),l}function e0(t){return Array.from(t.entries(),([e,i])=>({name:e,count:i})).sort((e,i)=>i.count-e.count)}function NU(){const t={os:`${Oi.type()} ${Oi.arch()} ${Oi.release()}`,memory:`${(Oi.totalmem()/On.GB).toFixed(2)}GB (${(Oi.freemem()/On.GB).toFixed(2)}GB free)`,vmHint:`${Math.round(vh.value()*100)}%`},e=Oi.cpus();return e&&e.length>0&&(t.cpus=`${e[0].model} (${e.length} x ${e[0].speed})`),t}async function UU(t){try{const e=new Map,i=U(t,".vscode","launch.json"),r=await FU.promises.readFile(i),s=[],n=jn(r.toString(),s);if(s.length)return console.log(`Unable to parse ${i}`),[];if(ia(n)==="object"&&n.configurations)for(const o of n.configurations){const a=o.type;a&&(e.has(a)?e.set(a,e.get(a)+1):e.set(a,1))}return e0(e)}catch{return[]}}var t0,mp,$U=g({"out-build/vs/platform/diagnostics/node/diagnosticsService.js"(){"use strict";ae(),Cs(),Ie(),ye(),z(),Io(),re(),ll(),qt(),iE(),g1(),Ze(),lt(),ti(),t0=new Map,mp=class{constructor(e,i){this.telemetryService=e,this.productService=i}formatMachineInfo(e){const i=[];return i.push(`OS Version: ${e.os}`),i.push(`CPUs: ${e.cpus}`),i.push(`Memory (System): ${e.memory}`),i.push(`VM: ${e.vmHint}`),i.join(`
|
|
`)}formatEnvironment(e){const i=[];i.push(`Version: ${this.productService.nameShort} ${this.productService.version} (${this.productService.commit||"Commit unknown"}, ${this.productService.date||"Date unknown"})`),i.push(`OS Version: ${Oi.type()} ${Oi.arch()} ${Oi.release()}`);const r=Oi.cpus();return r&&r.length>0&&i.push(`CPUs: ${r[0].model} (${r.length} x ${r[0].speed})`),i.push(`Memory (System): ${(Oi.totalmem()/On.GB).toFixed(2)}GB (${(Oi.freemem()/On.GB).toFixed(2)}GB free)`),B||i.push(`Load (avg): ${Oi.loadavg().map(s=>Math.round(s)).join(", ")}`),i.push(`VM: ${Math.round(vh.value()*100)}%`),i.push(`Screen Reader: ${e.screenReader?"yes":"no"}`),i.push(`Process Argv: ${e.mainArguments.join(" ")}`),i.push(`GPU Status: ${this.expandGPUFeatures(e.gpuFeatureStatus)}`),i.join(`
|
|
`)}async getPerformanceInfo(e,i){return Promise.all([X1(e.mainPID),this.formatWorkspaceMetadata(e)]).then(async r=>{let[s,n]=r,o=this.formatProcessList(e,s);return i.forEach(a=>{if(f1(a))o+=`
|
|
${a.errorMessage}`,n+=`
|
|
${a.errorMessage}`;else if(o+=`
|
|
|
|
Remote: ${a.hostName}`,a.processes&&(o+=`
|
|
${this.formatProcessList(e,a.processes)}`),a.workspaceMetadata){n+=`
|
|
| Remote: ${a.hostName}`;for(const c of Object.keys(a.workspaceMetadata)){const l=a.workspaceMetadata[c];let u=`${l.fileCount} files`;l.maxFilesReached&&(u=`more than ${u}`),n+=`| Folder (${c}): ${u}`,n+=this.formatWorkspaceStats(l)}}}),{processInfo:o,workspaceInfo:n}})}async getSystemInfo(e,i){const{memory:r,vmHint:s,os:n,cpus:o}=NU(),a={os:n,memory:r,cpus:o,vmHint:s,processArgs:`${e.mainArguments.join(" ")}`,gpuStatus:e.gpuFeatureStatus,screenReader:`${e.screenReader?"yes":"no"}`,remoteData:i};return B||(a.load=`${Oi.loadavg().map(c=>Math.round(c)).join(", ")}`),Pe&&(a.linuxEnv={desktopSession:process.env.DESKTOP_SESSION,xdgSessionDesktop:process.env.XDG_SESSION_DESKTOP,xdgCurrentDesktop:process.env.XDG_CURRENT_DESKTOP,xdgSessionType:process.env.XDG_SESSION_TYPE}),Promise.resolve(a)}async getDiagnostics(e,i){const r=[];return X1(e.mainPID).then(async s=>(r.push(""),r.push(this.formatEnvironment(e)),r.push(""),r.push(this.formatProcessList(e,s)),e.windows.some(n=>n.folderURIs&&n.folderURIs.length>0&&!n.remoteAuthority)&&(r.push(""),r.push("Workspace Stats: "),r.push(await this.formatWorkspaceMetadata(e))),i.forEach(n=>{if(f1(n))r.push(`
|
|
${n.errorMessage}`);else if(r.push(`
|
|
|
|
`),r.push(`Remote: ${n.hostName}`),r.push(this.formatMachineInfo(n.machineInfo)),n.processes&&r.push(this.formatProcessList(e,n.processes)),n.workspaceMetadata)for(const o of Object.keys(n.workspaceMetadata)){const a=n.workspaceMetadata[o];let c=`${a.fileCount} files`;a.maxFilesReached&&(c=`more than ${c}`),r.push(`Folder (${o}): ${c}`),r.push(this.formatWorkspaceStats(a))}}),r.push(""),r.push(""),r.join(`
|
|
`)))}formatWorkspaceStats(e){const i=[];let s=0;const n=(l,u)=>{const d=` ${l}(${u})`;s+d.length>60?(i.push(o),o="| ",s=o.length):s+=d.length,o+=d};let o="| File types:";const a=10,c=e.fileTypes.length>a?a:e.fileTypes.length;for(let l=0;l<c;l++){const u=e.fileTypes[l];n(u.name,u.count)}if(i.push(o),e.configFiles.length>=0&&(o="| Conf files:",s=0,e.configFiles.forEach(l=>{n(l.name,l.count)}),i.push(o)),e.launchConfigFiles.length>0){let l="| Launch Configs:";e.launchConfigFiles.forEach(u=>{const d=u.count>1?` ${u.name}(${u.count})`:` ${u.name}`;l+=d}),i.push(l)}return i.join(`
|
|
`)}expandGPUFeatures(e){const i=Math.max(...Object.keys(e).map(r=>r.length));return Object.keys(e).map(r=>`${r}: ${" ".repeat(i-r.length)} ${e[r]}`).join(`
|
|
`)}formatWorkspaceMetadata(e){const i=[],r=[];return e.windows.forEach(s=>{s.folderURIs.length===0||s.remoteAuthority||(i.push(`| Window (${s.title})`),s.folderURIs.forEach(n=>{const o=x.revive(n);if(o.scheme===T.file){const a=o.fsPath;r.push(Zw(a,["node_modules",".git"]).then(c=>{let l=`${c.fileCount} files`;c.maxFilesReached&&(l=`more than ${l}`),i.push(`| Folder (${tt(a)}): ${l}`),i.push(this.formatWorkspaceStats(c))}).catch(c=>{i.push(`| Error: Unable to collect workspace stats for folder ${a} (${c.toString()})`)}))}else i.push(`| Folder (${o.toString()}): Workspace stats not available.`)}))}),Promise.all(r).then(s=>i.join(`
|
|
`)).catch(s=>`Unable to collect workspace stats: ${s}`)}formatProcessList(e,i){const r=new Map;e.windows.forEach(n=>r.set(n.pid,`window [${n.id}] (${n.title})`)),e.pidToNames.forEach(({pid:n,name:o})=>r.set(n,o));const s=[];return s.push("CPU % Mem MB PID Process"),i&&this.formatProcessItem(e.mainPID,r,s,i,0),s.join(`
|
|
`)}formatProcessItem(e,i,r,s,n){const o=n===0;let a;o?a=s.pid===e?`${this.productService.applicationName} main`:"remote agent":i.has(s.pid)?a=i.get(s.pid):a=`${" ".repeat(n)} ${s.name}`;const c=process.platform==="win32"?s.mem:Oi.totalmem()*(s.mem/100);r.push(`${s.load.toFixed(0).padStart(5," ")} ${(c/On.MB).toFixed(0).padStart(6," ")} ${s.pid.toFixed(0).padStart(6," ")} ${a}`),Array.isArray(s.children)&&s.children.forEach(l=>this.formatProcessItem(e,i,r,l,n+1))}async getWorkspaceFileExtensions(e){const i=new Set;for(const{uri:r}of e.folders){const s=x.revive(r);if(s.scheme!==T.file)continue;const n=s.fsPath;try{(await Zw(n,["node_modules",".git"])).fileTypes.forEach(a=>i.add(a.name))}catch{}}return{extensions:[...i]}}async reportWorkspaceStats(e){for(const{uri:i}of e.folders){const r=x.revive(i);if(r.scheme!==T.file)continue;const s=r.fsPath;try{const n=await Zw(s,["node_modules",".git"]);this.telemetryService.publicLog2("workspace.stats",{"workspace.id":e.telemetryId,rendererSessionId:e.rendererSessionId}),n.fileTypes.forEach(o=>{this.telemetryService.publicLog2("workspace.stats.file",{rendererSessionId:e.rendererSessionId,type:o.name,count:o.count})}),n.launchConfigFiles.forEach(o=>{this.telemetryService.publicLog2("workspace.stats.launchConfigFile",{rendererSessionId:e.rendererSessionId,type:o.name,count:o.count})}),n.configFiles.forEach(o=>{this.telemetryService.publicLog2("workspace.stats.configFiles",{rendererSessionId:e.rendererSessionId,type:o.name,count:o.count})}),this.telemetryService.publicLog2("workspace.stats.metadata",{duration:n.totalScanTime,reachedLimit:n.maxFilesReached,fileCount:n.fileCount,readdirCount:n.totalReaddirCount})}catch{}}}},mp=__decorate([__param(0,ei),__param(1,qe)],mp)}});import{writeFileSync as BU}from"fs";import{tmpdir as jU}from"os";function HU(t){const e=Rc(jU());try{return BU(e,""),t&&console.log(`Marker file for --wait created: ${e}`),e}catch(i){t&&console.error(`Failed to create marker file for --wait: ${i}`);return}}var VU=g({"out-build/vs/platform/environment/node/wait.js"(){"use strict";Bi()}});function qU(t){return(t.scheme==="file"||t.scheme==="vscode-remote")&&t.path.endsWith(".mdc")}var tP,zU=g({"out-build/vs/base/common/mdc.js"(){"use strict";Ie(),tP=`---
|
|
description:
|
|
globs:
|
|
alwaysApply: true
|
|
---
|
|
`}}),i0,vp,GU=g({"out-build/vs/platform/files/common/fileService.js"(){"use strict";Wt(),ae(),it(),St(),q(),_s(),Nu(),L(),Tn(),Ie(),ls(),gt(),vc(),we(),Ze(),B5(),K(),Re(),zU(),vp=class extends N{static{i0=this}constructor(e){super(),this.logService=e,this.BUFFER_SIZE=256*1024,this._onDidChangeFileSystemProviderRegistrations=this._register(new D),this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=this._register(new D),this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=this._register(new D),this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.provider=new Map,this._onDidRunOperation=this._register(new D),this.onDidRunOperation=this._onDidRunOperation.event,this.internalOnDidFilesChange=this._register(new D),this._onDidUncorrelatedFilesChange=this._register(new D),this.onDidFilesChange=this._onDidUncorrelatedFilesChange.event,this._onDidWatchError=this._register(new D),this.onDidWatchError=this._onDidWatchError.event,this.activeWatchers=new Map,this.writeQueue=this._register(new Qg)}registerNotebookCellChecker(e){return this.notebookCellExistsChecker=e,me(()=>{this.notebookCellExistsChecker=void 0})}registerProvider(e,i){if(this.provider.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);Ve(`code/registerFilesystem/${e}`);const r=new ke;return this.provider.set(e,i),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:e,provider:i}),r.add(i.onDidChangeFile(s=>{const n=new Yb(s,!this.isPathCaseSensitive(i));this.internalOnDidFilesChange.fire(n),n.hasCorrelation()||this._onDidUncorrelatedFilesChange.fire(n)})),typeof i.onDidWatchError=="function"&&r.add(i.onDidWatchError(s=>this._onDidWatchError.fire(new Error(s)))),r.add(i.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:i,scheme:e}))),me(()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:e,provider:i}),this.provider.delete(e),Rt(r)})}getProvider(e){return this.provider.get(e)}async activateProvider(e){const i=[];this._onWillActivateFileSystemProvider.fire({scheme:e,join(r){i.push(r)}}),!this.provider.has(e)&&await Ht.settled(i)}async canHandleResource(e){return await this.activateProvider(e.scheme),this.hasProvider(e)}hasProvider(e){return this.provider.has(e.scheme)}hasCapability(e,i){const r=this.provider.get(e.scheme);return!!(r&&r.capabilities&i)}listCapabilities(){return _n.map(this.provider,([e,i])=>({scheme:e,capabilities:i.capabilities}))}async withProvider(e){if(!t_(e))throw new Zt(w(2024,null,this.resourceForError(e)),8);await this.activateProvider(e.scheme);const i=this.provider.get(e.scheme);if(!i){const r=new Tr;throw r.message=w(2025,null,e.toString()),r}return i}async withReadProvider(e){const i=await this.withProvider(e);if(Qs(i)||ar(i)||Dm(i))return i;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite, FileReadStream nor FileOpenReadWriteClose capability which is needed for the read operation.`)}async withWriteProvider(e){const i=await this.withProvider(e);if(Qs(i)||ar(i))return i;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite nor FileOpenReadWriteClose capability which is needed for the write operation.`)}async resolve(e,i){try{return await this.doResolveFile(e,i)}catch(r){throw kd(r)===ce.FileNotFound?new Zt(w(2026,null,this.resourceForError(e)),1):Wn(r)}}async doResolveFile(e,i){const r=await this.withProvider(e),s=this.isPathCaseSensitive(r),n=i?.resolveTo,o=i?.resolveSingleChildDescendants,a=i?.resolveMetadata,c=await r.stat(e);let l;return this.toFileStat(r,e,c,void 0,!!a,(u,d)=>(l||(l=Es.forUris(()=>!s),l.set(e,!0),n&&l.fill(!0,n)),l.get(u.resource)||l.findSuperstr(u.resource.with({query:null,fragment:null}))?!0:u.isDirectory&&o?d===1:!1))}async toFileStat(e,i,r,s,n,o){const{providerExtUri:a}=this.getExtUri(e),c={resource:i,name:a.basename(i),isFile:(r.type&Ft.File)!==0,isDirectory:(r.type&Ft.Directory)!==0,isSymbolicLink:(r.type&Ft.SymbolicLink)!==0,mtime:r.mtime,ctime:r.ctime,size:r.size,readonly:!!((r.permissions??0)&Yo.Readonly)||!!(e.capabilities&2048),locked:!!((r.permissions??0)&Yo.Locked),etag:Vb({mtime:r.mtime,size:r.size}),children:void 0};if(c.isDirectory&&o(c,s)){try{const l=await e.readdir(i),u=await Ht.settled(l.map(async([d,f])=>{try{const p=a.joinPath(i,d),v=n?await e.stat(p):{type:f};return await this.toFileStat(e,p,v,l.length,n,o)}catch(p){return this.logService.trace(p),null}}));c.children=Dt(u)}catch(l){this.logService.trace(l),c.children=[]}return c}return c}async resolveAll(e){return Ht.settled(e.map(async i=>{try{return{stat:await this.doResolveFile(i.resource,i.options),success:!0}}catch(r){return this.logService.trace(r),{stat:void 0,success:!1}}}))}async stat(e){const i=await this.withProvider(e),r=await i.stat(e);return this.toFileStat(i,e,r,void 0,!0,()=>!1)}async exists(e){if(e.scheme===T.vscodeNotebookCell)return this.notebookCellExistsChecker?await this.notebookCellExistsChecker(e):(console.log(`[fileService.exists] Can't check if notebook cell exists: ${e.toString()}`),!1);const i=await this.withProvider(e);try{return!!await i.stat(e)}catch{return!1}}async canCreateFile(e,i){try{await this.doValidateCreateFile(e,i)}catch(r){return r}return!0}async doValidateCreateFile(e,i){if(!i?.overwrite&&await this.exists(e))throw new Zt(w(2027,null,this.resourceForError(e)),3,i)}async createFile(e,i=Y.fromString(""),r){qU(e)&&i.toString().trim()===""&&(i=Y.fromString(tP)),await this.doValidateCreateFile(e,r);const s=await this.writeFile(e,i);return this._onDidRunOperation.fire(new Ln(e,0,s)),s}async writeFile(e,i,r){const s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),{providerExtUri:n}=this.getExtUri(s);let o=r;if(Hb(s)&&!o?.atomic){const a=s.enforceAtomicWriteFile?.(e);a&&(o={...r,atomic:a})}try{let{stat:a,buffer:c}=await this.validateWriteFile(s,e,i,o);a||await this.mkdirp(s,n.dirname(e)),c||(c=await this.peekBufferForWriting(s,i)),!Qs(s)||ar(s)&&c instanceof Y||ar(s)&&Hb(s)&&o?.atomic?await this.doWriteUnbuffered(s,e,o,c):await this.doWriteBuffered(s,e,o,c instanceof Y?fC(c):c),this._onDidRunOperation.fire(new Ln(e,4))}catch(a){throw new Zt(w(2028,null,this.resourceForError(e),Wn(a).toString()),jr(a),o)}return this.resolve(e,{resolveMetadata:!0})}async peekBufferForWriting(e,i){let r;if(ar(e)&&!(i instanceof Y))if(qu(i)){const s=await rC(i,3);s.ended?r=Y.concat(s.buffer):r=s}else r=iC(i,s=>Y.concat(s),3);else r=i;return r}async validateWriteFile(e,i,r,s){const n=!!s?.unlock;if(n&&!(e.capabilities&8192))throw new Error(w(2029,null,this.resourceForError(i)));if(!!s?.atomic){if(!(e.capabilities&32768))throw new Error(w(2030,null,this.resourceForError(i)));if(!(e.capabilities&2))throw new Error(w(2031,null,this.resourceForError(i)));if(n)throw new Error(w(2032,null,this.resourceForError(i)))}let a;try{a=await e.stat(i)}catch{return Object.create(null)}if((a.type&Ft.Directory)!==0)throw new Zt(w(2033,null,this.resourceForError(i)),0,s);this.throwIfFileIsReadonly(i,a);let c;if(typeof s?.mtime=="number"&&typeof s.etag=="string"&&s.etag!==Dd&&typeof a.mtime=="number"&&typeof a.size=="number"&&s.mtime<a.mtime&&s.etag!==Vb({mtime:s.mtime,size:a.size})){if(c=await this.peekBufferForWriting(e,r),c instanceof Y&&c.byteLength===a.size)try{const{value:l}=await this.readFile(i,{limits:{size:a.size}});if(c.equals(l))return{stat:a,buffer:c}}catch{}throw new Zt(w(2034,null),3,s)}return{stat:a,buffer:c}}async readFile(e,i,r){const s=await this.withReadProvider(e);return i?.atomic?this.doReadFileAtomic(s,e,i,r):this.doReadFile(s,e,i,r)}async doReadFileAtomic(e,i,r,s){return new Promise((n,o)=>{this.writeQueue.queueFor(i,async()=>{try{const a=await this.doReadFile(e,i,r,s);n(a)}catch(a){o(a)}},this.getExtUri(e).providerExtUri)})}async doReadFile(e,i,r,s){const n=await this.doReadFileStream(e,i,{...r,preferUnbuffered:!0},s);return{...n,value:await wc(n.value)}}async readFileStream(e,i,r){const s=await this.withReadProvider(e);return this.doReadFileStream(s,e,i,r)}async doReadFileStream(e,i,r,s){const n=new Sr(s);let o=r;Am(e)&&e.enforceAtomicReadFile?.(i)&&(o={...r,atomic:!0});const a=this.validateReadFile(i,o).then(l=>l,l=>{throw n.dispose(!0),l});let c;try{return typeof o?.etag=="string"&&o.etag!==Dd&&await a,o?.atomic&&Am(e)||!(Qs(e)||Dm(e))||ar(e)&&o?.preferUnbuffered?c=this.readFileUnbuffered(e,i,o):Dm(e)?c=this.readFileStreamed(e,i,n.token,o):c=this.readFileBuffered(e,i,n.token,o),c.on("end",()=>n.dispose()),c.on("error",()=>n.dispose()),{...await a,value:c}}catch(l){throw c&&await ES(c),this.restoreReadError(l,i,o)}}restoreReadError(e,i,r){const s=w(2035,null,this.resourceForError(i),Wn(e).toString());return e instanceof Cd?new Cd(s,e.stat,r):e instanceof xd?new xd(s,e.fileOperationResult,e.size,e.options):new Zt(s,jr(e),r)}readFileStreamed(e,i,r,s=Object.create(null)){const n=e.readFileStream(i,s,r);return kS(n,{data:o=>o instanceof Y?o:Y.wrap(o),error:o=>this.restoreReadError(o,i,s)},o=>Y.concat(o))}readFileBuffered(e,i,r,s=Object.create(null)){const n=mC();return $5(e,i,n,o=>o,{...s,bufferSize:this.BUFFER_SIZE,errorTransformer:o=>this.restoreReadError(o,i,s)},r),n}readFileUnbuffered(e,i,r){const s=zu(n=>Y.concat(n));return(async()=>{try{let n;r?.atomic&&Am(e)?n=await e.readFile(i,{atomic:!0}):n=await e.readFile(i),typeof r?.position=="number"&&(n=n.slice(r.position)),typeof r?.length=="number"&&(n=n.slice(0,r.length)),this.validateReadFileLimits(i,n.byteLength,r),s.end(Y.wrap(n))}catch(n){s.error(n),s.end()}})(),s}async validateReadFile(e,i){const r=await this.resolve(e,{resolveMetadata:!0});if(r.isDirectory)throw new Zt(w(2036,null,this.resourceForError(e)),0,i);if(typeof i?.etag=="string"&&i.etag!==Dd&&i.etag===r.etag)throw new Cd(w(2037,null),r,i);return this.validateReadFileLimits(e,r.size,i),r}validateReadFileLimits(e,i,r){if(typeof r?.limits?.size=="number"&&i>r.limits.size)throw new xd(w(2038,null,this.resourceForError(e)),7,i,r)}async canMove(e,i,r){return this.doCanMoveCopy(e,i,"move",r)}async canCopy(e,i,r){return this.doCanMoveCopy(e,i,"copy",r)}async doCanMoveCopy(e,i,r,s){if(e.toString()!==i.toString())try{const n=r==="move"?this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e):await this.withReadProvider(e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(i),i);await this.doValidateMoveCopy(n,e,o,i,r,s)}catch(n){return n}return!0}async move(e,i,r){const s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(i),i),o=await this.doMoveCopy(s,e,n,i,"move",!!r),a=await this.resolve(i,{resolveMetadata:!0});return this._onDidRunOperation.fire(new Ln(e,o==="move"?2:3,a)),a}async copy(e,i,r){const s=await this.withReadProvider(e),n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(i),i),o=await this.doMoveCopy(s,e,n,i,"copy",!!r),a=await this.resolve(i,{resolveMetadata:!0});return this._onDidRunOperation.fire(new Ln(e,o==="copy"?3:2,a)),a}async doMoveCopy(e,i,r,s,n,o){if(i.toString()===s.toString())return n;const{exists:a,isSameResourceWithDifferentPathCase:c}=await this.doValidateMoveCopy(e,i,r,s,n,o);if(a&&!c&&o&&await this.del(s,{recursive:!0}),await this.mkdirp(r,this.getExtUri(r).providerExtUri.dirname(s)),n==="copy"){if(e===r&&Im(e))await e.copy(i,s,{overwrite:o});else{const l=await this.resolve(i);l.isDirectory?await this.doCopyFolder(e,l,r,s):await this.doCopyFile(e,i,r,s)}return n}else return e===r?(await e.rename(i,s,{overwrite:o}),n):(await this.doMoveCopy(e,i,r,s,"copy",o),await this.del(i,{recursive:!0}),"copy")}async doCopyFile(e,i,r,s){if(Qs(e)&&Qs(r))return this.doPipeBuffered(e,i,r,s);if(Qs(e)&&ar(r))return this.doPipeBufferedToUnbuffered(e,i,r,s);if(ar(e)&&Qs(r))return this.doPipeUnbufferedToBuffered(e,i,r,s);if(ar(e)&&ar(r))return this.doPipeUnbuffered(e,i,r,s)}async doCopyFolder(e,i,r,s){await r.mkdir(s),Array.isArray(i.children)&&await Ht.settled(i.children.map(async n=>{const o=this.getExtUri(r).providerExtUri.joinPath(s,n.name);return n.isDirectory?this.doCopyFolder(e,await this.resolve(n.resource),r,o):this.doCopyFile(e,n.resource,r,o)}))}async doValidateMoveCopy(e,i,r,s,n,o){let a=!1;if(e===r){const{providerExtUri:l,isPathCaseSensitive:u}=this.getExtUri(e);if(u||(a=l.isEqual(i,s)),a&&n==="copy")throw new Error(w(2039,null,this.resourceForError(i),this.resourceForError(s)));if(!a&&l.isEqualOrParent(s,i))throw new Error(w(2040,null,this.resourceForError(i),this.resourceForError(s)))}const c=await this.exists(s);if(c&&!a){if(!o)throw new Zt(w(2041,null,this.resourceForError(i),this.resourceForError(s)),4);if(e===r){const{providerExtUri:l}=this.getExtUri(e);if(l.isEqualOrParent(i,s))throw new Error(w(2042,null,this.resourceForError(i),this.resourceForError(s)))}}return{exists:c,isSameResourceWithDifferentPathCase:a}}getExtUri(e){const i=this.isPathCaseSensitive(e);return{providerExtUri:i?Ce:Hg,isPathCaseSensitive:i}}isPathCaseSensitive(e){return!!(e.capabilities&1024)}async createFolder(e){const i=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e);await this.mkdirp(i,e);const r=await this.resolve(e,{resolveMetadata:!0});return this._onDidRunOperation.fire(new Ln(e,0,r)),r}async mkdirp(e,i){const r=[],{providerExtUri:s}=this.getExtUri(e);for(;!s.isEqual(i,s.dirname(i));)try{if(((await e.stat(i)).type&Ft.Directory)===0)throw new Error(w(2043,null,this.resourceForError(i)));break}catch(n){if(kd(n)!==ce.FileNotFound)throw n;r.push(s.basename(i)),i=s.dirname(i)}for(let n=r.length-1;n>=0;n--){i=s.joinPath(i,r[n]);try{await e.mkdir(i)}catch(o){if(kd(o)!==ce.FileExists)throw o}}}async canDelete(e,i){try{await this.doValidateDelete(e,i)}catch(r){return r}return!0}async doValidateDelete(e,i){const r=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e),s=!!i?.useTrash;if(s&&!(r.capabilities&4096))throw new Error(w(2044,null,this.resourceForError(e)));const n=i?.atomic;if(n&&!(r.capabilities&65536))throw new Error(w(2045,null,this.resourceForError(e)));if(s&&n)throw new Error(w(2046,null,this.resourceForError(e)));let o;try{o=await r.stat(e)}catch{}if(o)this.throwIfFileIsReadonly(e,o);else throw new Zt(w(2047,null,this.resourceForError(e)),1);if(!!!i?.recursive){const c=await this.resolve(e);if(c.isDirectory&&Array.isArray(c.children)&&c.children.length>0)throw new Error(w(2048,null,this.resourceForError(e)))}return r}async del(e,i){const r=await this.doValidateDelete(e,i);let s=i;if(n3(r)&&!s?.atomic){const c=r.enforceAtomicDelete?.(e);c&&(s={...i,atomic:c})}const n=!!s?.useTrash,o=!!s?.recursive,a=s?.atomic??!1;await r.delete(e,{recursive:o,useTrash:n,atomic:a}),this._onDidRunOperation.fire(new Ln(e,1))}async cloneFile(e,i){const r=await this.withProvider(e),s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(i),i);if(!(r===s&&this.getExtUri(r).providerExtUri.isEqual(e,i)))return r===s&&jb(r)?r.cloneFile(e,i):(await this.mkdirp(s,this.getExtUri(s).providerExtUri.dirname(i)),r===s&&Im(r)?this.writeQueue.queueFor(e,()=>r.copy(e,i,{overwrite:!0}),this.getExtUri(r).providerExtUri):this.writeQueue.queueFor(e,()=>this.doCopyFile(r,e,s,i),this.getExtUri(r).providerExtUri))}static{this.WATCHER_CORRELATION_IDS=0}createWatcher(e,i){return this.watch(e,{...i,correlationId:i0.WATCHER_CORRELATION_IDS++})}watch(e,i={recursive:!1,excludes:[]}){const r=new ke;let s=!1,n=()=>{s=!0};r.add(me(()=>n())),(async()=>{try{const a=await this.doWatch(e,i);s?Rt(a):n=()=>Rt(a)}catch(a){this.logService.error(a)}})();const o=i.correlationId;if(typeof o=="number"){const a=r.add(new D);return r.add(this.internalOnDidFilesChange.event(l=>{l.correlates(o)&&a.fire(l)})),{onDidChange:a.event,dispose:()=>r.dispose()}}return r}async doWatch(e,i){const r=await this.withProvider(e),s=Ur([this.getExtUri(r).providerExtUri.getComparisonKey(e),i]);let n=this.activeWatchers.get(s);return n||(n={count:0,disposable:r.watch(e,i)},this.activeWatchers.set(s,n)),n.count+=1,me(()=>{n&&(n.count--,n.count===0&&(Rt(n.disposable),this.activeWatchers.delete(s)))})}dispose(){super.dispose();for(const[,e]of this.activeWatchers)Rt(e.disposable);this.activeWatchers.clear()}async doWriteBuffered(e,i,r,s){return this.writeQueue.queueFor(i,async()=>{const n=await e.open(i,{create:!0,unlock:r?.unlock??!1});try{qu(s)||Ag(s)?await this.doWriteStreamBufferedQueued(e,n,s):await this.doWriteReadableBufferedQueued(e,n,s)}catch(o){throw Wn(o)}finally{await e.close(n)}},this.getExtUri(e).providerExtUri)}async doWriteStreamBufferedQueued(e,i,r){let s=0,n;if(Ag(r)){if(r.buffer.length>0){const o=Y.concat(r.buffer);await this.doWriteBuffer(e,i,o,o.byteLength,s,0),s+=o.byteLength}if(r.ended)return;n=r.stream}else n=r;return new Promise((o,a)=>{Gu(n,{onData:async c=>{n.pause();try{await this.doWriteBuffer(e,i,c,c.byteLength,s,0)}catch(l){return a(l)}s+=c.byteLength,setTimeout(()=>n.resume())},onError:c=>a(c),onEnd:()=>o()})})}async doWriteReadableBufferedQueued(e,i,r){let s=0,n;for(;(n=r.read())!==null;)await this.doWriteBuffer(e,i,n,n.byteLength,s,0),s+=n.byteLength}async doWriteBuffer(e,i,r,s,n,o){let a=0;for(;a<s;){const c=await e.write(i,n+a,r.buffer,o+a,s-a);a+=c}}async doWriteUnbuffered(e,i,r,s){return this.writeQueue.queueFor(i,()=>this.doWriteUnbufferedQueued(e,i,r,s),this.getExtUri(e).providerExtUri)}async doWriteUnbufferedQueued(e,i,r,s){let n;s instanceof Y?n=s:qu(s)?n=await wc(s):Ag(s)?n=await pC(s):n=hC(s),await e.writeFile(i,n.buffer,{create:!0,overwrite:!0,unlock:r?.unlock??!1,atomic:r?.atomic??!1})}async doPipeBuffered(e,i,r,s){return this.writeQueue.queueFor(s,()=>this.doPipeBufferedQueued(e,i,r,s),this.getExtUri(r).providerExtUri)}async doPipeBufferedQueued(e,i,r,s){let n,o;try{n=await e.open(i,{create:!1}),o=await r.open(s,{create:!0,unlock:!1});const a=Y.alloc(this.BUFFER_SIZE);let c=0,l=0,u=0;do u=await e.read(n,c,a.buffer,l,a.byteLength-l),await this.doWriteBuffer(r,o,a,u,c,l),c+=u,l+=u,l===a.byteLength&&(l=0);while(u>0)}catch(a){throw Wn(a)}finally{await Ht.settled([typeof n=="number"?e.close(n):Promise.resolve(),typeof o=="number"?r.close(o):Promise.resolve()])}}async doPipeUnbuffered(e,i,r,s){return this.writeQueue.queueFor(s,()=>this.doPipeUnbufferedQueued(e,i,r,s),this.getExtUri(r).providerExtUri)}async doPipeUnbufferedQueued(e,i,r,s){return r.writeFile(s,await e.readFile(i),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async doPipeUnbufferedToBuffered(e,i,r,s){return this.writeQueue.queueFor(s,()=>this.doPipeUnbufferedToBufferedQueued(e,i,r,s),this.getExtUri(r).providerExtUri)}async doPipeUnbufferedToBufferedQueued(e,i,r,s){const n=await r.open(s,{create:!0,unlock:!1});try{const o=await e.readFile(i);await this.doWriteBuffer(r,n,Y.wrap(o),o.byteLength,0,0)}catch(o){throw Wn(o)}finally{await r.close(n)}}async doPipeBufferedToUnbuffered(e,i,r,s){const n=await wc(this.readFileBuffered(e,i,Te.None));await this.doWriteUnbuffered(r,s,void 0,n)}throwIfFileSystemIsReadonly(e,i){if(e.capabilities&2048)throw new Zt(w(2049,null,this.resourceForError(i)),6);return e}throwIfFileIsReadonly(e,i){if((i.permissions??0)&Yo.Readonly)throw new Zt(w(2050,null,this.resourceForError(e)),6)}resourceForError(e){return e.scheme===T.file?e.fsPath:e.toString(!0)}async realpath(e){try{const i=await this.withProvider(e);return"realpath"in i&&typeof i.realpath=="function"?i.realpath(e):e}catch{return e}}},vp=i0=__decorate([__param(0,V)],vp)}}),iP,r0,KU=g({"out-build/vs/platform/instantiation/common/graph.js"(){"use strict";iP=class{constructor(t,e){this.key=t,this.data=e,this.incoming=new Map,this.outgoing=new Map}},r0=class{constructor(t){this._hashFn=t,this._nodes=new Map}roots(){const t=[];for(const e of this._nodes.values())e.outgoing.size===0&&t.push(e);return t}insertEdge(t,e){const i=this.lookupOrInsertNode(t),r=this.lookupOrInsertNode(e);i.outgoing.set(r.key,r),r.incoming.set(i.key,i)}removeNode(t){const e=this._hashFn(t);this._nodes.delete(e);for(const i of this._nodes.values())i.outgoing.delete(e),i.incoming.delete(e)}lookupOrInsertNode(t){const e=this._hashFn(t);let i=this._nodes.get(e);return i||(i=new iP(e,t),this._nodes.set(e,i)),i}lookup(t){return this._nodes.get(this._hashFn(t))}isEmpty(){return this._nodes.size===0}toString(){const t=[];for(const[e,i]of this._nodes)t.push(`${e}
|
|
(-> incoming)[${[...i.incoming.keys()].join(", ")}]
|
|
(outgoing ->)[${[...i.outgoing.keys()].join(",")}]
|
|
`);return t.join(`
|
|
`)}findCycleSlow(){for(const[t,e]of this._nodes){const i=new Set([t]),r=this._findCycle(e,i);if(r)return r}}_findCycle(t,e){for(const[i,r]of t.outgoing){if(e.has(i))return[...e,i].join(" -> ");e.add(i);const s=this._findCycle(r,e);if(s)return s;e.delete(i)}}}}}),rP,s0,sP,nP,wp,YU=g({"out-build/vs/platform/instantiation/common/instantiationService.js"(){"use strict";ae(),Re(),L(),Ih(),KU(),G(),J1(),$y(),rP=!1,s0=class extends Error{constructor(t,e){super("cyclic dependency between services"),this.message=`REASON: ${e}
|
|
`+(t.findCycleSlow()??`UNABLE to detect cycle, dumping graph:
|
|
${t.toString()}`)}},sP=class M0{constructor(e=new Dh,i=!1,r,s=rP){this._services=e,this._strict=i,this._parent=r,this._enableTracing=s,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(Or,this),this._globalGraph=s?r?._globalGraph??new r0(n=>n):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,Rt(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)Ny(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,i){this._throwIfDisposed();const r=this,s=new class extends M0{dispose(){r._children.delete(s),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(s),i?.add(s),s}invokeFunction(e,...i){this._throwIfDisposed();const r=wp.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:o=>{if(s)throw yy("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(o,r);if(!a)throw new Error(`[invokeFunction] unknown service '${o}'`);return a}},...i)}finally{s=!0,r.stop()}}createInstance(e,...i){this._throwIfDisposed();let r,s;return e instanceof se?(r=wp.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(i),r)):(r=wp.traceCreation(this._enableTracing,e),s=this._createInstance(e,i,r)),r.stop(),s}_createInstance(e,i=[],r){const s=_r.getServiceDependencies(e).sort((a,c)=>a.index-c.index),n=[];for(const a of s){const c=this._getOrCreateServiceInstance(a.id,r);c||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),n.push(c)}const o=s.length>0?s[0].index:i.length;if(i.length!==o){console.trace(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${i.length} static arguments`);const a=o-i.length;a>0?i=i.concat(new Array(a)):i=i.slice(0,o)}return Reflect.construct(e,i.concat(n))}_setCreatedServiceInstance(e,i){if(this._services.get(e)instanceof se)this._services.set(e,i);else if(this._parent)this._parent._setCreatedServiceInstance(e,i);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const i=this._services.get(e);return!i&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):i}_getOrCreateServiceInstance(e,i){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const r=this._getServiceInstanceOrDescriptor(e);return r instanceof se?this._safeCreateAndCacheServiceInstance(e,r,i.branch(e,!0)):(i.branch(e,!1),r)}_safeCreateAndCacheServiceInstance(e,i,r){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,i,r)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,i,r){const s=new r0(c=>c.id.toString());let n=0;const o=[{id:e,desc:i,_trace:r}],a=new Set;for(;o.length;){const c=o.pop();if(!a.has(String(c.id))){if(a.add(String(c.id)),s.lookupOrInsertNode(c),n++>1e4)throw new s0(s,"cycle count more than 1000");for(const l of _r.getServiceDependencies(c.desc.ctor)){const u=this._getServiceInstanceOrDescriptor(l.id);if(u||this._throwIfStrict(`[createInstance] ${e} depends on ${l.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(c.id),String(l.id)),u instanceof se){const d={id:l.id,desc:u,_trace:c._trace.branch(l.id,!0)};s.insertEdge(c,d),o.push(d)}}}}for(;;){const c=s.roots();if(c.length===0){if(!s.isEmpty())throw new s0(s,"no more roots but still nodes in the graph");break}for(const{data:l}of c){if(this._getServiceInstanceOrDescriptor(l.id)instanceof se){const d=this._createServiceInstanceWithOwner(l.id,l.desc.ctor,l.desc.staticArguments,l.desc.supportsDelayedInstantiation,l._trace);this._setCreatedServiceInstance(l.id,d)}s.removeNode(l)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,i,r=[],s,n){if(this._services.get(e)instanceof se)return this._createServiceInstance(e,i,r,s,n,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,i,r,s,n);throw new Error(`illegalState - creating UNKNOWN service instance ${i.name}`)}_createServiceInstance(e,i,r=[],s,n,o){if(s){const a=new M0(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const c=new Map,l=new l_(()=>{const u=a._createInstance(i,r,n);for(const[d,f]of c){const p=u[d];if(typeof p=="function")for(const v of f)v.disposable=p.apply(u,v.listener)}return c.clear(),o.add(u),u});return new Proxy(Object.create(null),{get(u,d){if(!l.isInitialized&&typeof d=="string"&&(d.startsWith("onDid")||d.startsWith("onWill"))){let v=c.get(d);return v||(v=new vg,c.set(d,v)),(y,S,E)=>{if(l.isInitialized)return l.value[d](y,S,E);{const k={listener:[y,S,E],disposable:void 0},R=v.push(k);return me(()=>{R(),k.disposable?.dispose()})}}}if(d in u)return u[d];const f=l.value;let p=f[d];return typeof p!="function"||(p=p.bind(f),u[d]=p),p},set(u,d,f){return l.value[d]=f,!0},getPrototypeOf(u){return i.prototype}})}else{const a=this._createInstance(i,r,n);return o.add(a),a}}_throwIfStrict(e,i){if(i&&console.warn(e),this._strict)throw new Error(e)}},(function(t){t[t.None=0]="None",t[t.Creation=1]="Creation",t[t.Invocation=2]="Invocation",t[t.Branch=3]="Branch"})(nP||(nP={})),wp=class ns{static{this.all=new Set}static{this._None=new class extends ns{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,i){return e?new ns(2,i.name||new Error().stack.split(`
|
|
`).slice(3,4).join(`
|
|
`)):ns._None}static traceCreation(e,i){return e?new ns(1,i.name):ns._None}static{this._totals=0}constructor(e,i){this.type=e,this.name=i,this._start=Date.now(),this._dep=[]}branch(e,i){const r=new ns(3,e.toString());return this._dep.push([e,i,r]),r}stop(){const e=Date.now()-this._start;ns._totals+=e;let i=!1;function r(n,o){const a=[],c=new Array(n+1).join(" ");for(const[l,u,d]of o._dep)if(u&&d){i=!0,a.push(`${c}CREATES -> ${l}`);const f=r(n+1,d);f&&a.push(f)}else a.push(`${c}uses -> ${l}`);return a.join(`
|
|
`)}const s=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${r(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${ns._totals.toFixed(2)}ms)`];(e>2||i)&&ns.all.add(s.join(`
|
|
`))}}}}),oP,JU=g({"out-build/vs/platform/log/common/bufferLog.js"(){"use strict";L(),K(),oP=class extends xm{constructor(t=jc){super(),this.buffer=[],this._logger=void 0,this._logLevelDisposable=this._register(new $s),this.setLevel(t)}set logger(t){this._logger=t,this.setLevel(t.getLevel()),this._logLevelDisposable.value=t.onDidChangeLogLevel(this.setLevel,this);for(const{level:e,message:i}of this.buffer)Pm(t,e,i);this.buffer=[]}log(t,e){this._logger?Pm(this._logger,t,e):this.getLevel()<=t&&this.buffer.push({level:t,message:e})}dispose(){this._logger?.dispose(),super.dispose()}flush(){this._logger?.flush()}}}});import{session as QU}from"electron";var yp,XU=g({"out-build/vs/platform/protocol/electron-main/protocolMainService.js"(){"use strict";L(),Ie(),ye(),z(),Tn(),re(),Hi(),nr(),xi(),K(),zr(),yp=class extends N{constructor(e,i,r){super(),this.environmentService=e,this.logService=r,this.validRoots=Es.forPaths(!Pe),this.validExtensions=new Set([".svg",".png",".jpg",".jpeg",".gif",".bmp",".webp",".mp4",".otf",".ttf"]),this.addValidFileRoot(e.appRoot),this.addValidFileRoot(e.extensionsPath),this.addValidFileRoot(i.defaultProfile.globalStorageHome.with({scheme:T.file}).fsPath),this.addValidFileRoot(e.workspaceStorageHome.with({scheme:T.file}).fsPath),this.environmentService.isBuilt||this.addValidFileRoot(U(e.appRoot,"..","packages")),this.handleProtocols()}handleProtocols(){const{defaultSession:e}=QU;e.protocol.registerFileProtocol(T.vscodeFileResource,(i,r)=>this.handleResourceRequest(i,r)),e.protocol.interceptFileProtocol(T.file,(i,r)=>this.handleFileRequest(i,r)),this._register(me(()=>{e.protocol.unregisterProtocol(T.vscodeFileResource),e.protocol.uninterceptProtocol(T.file)}))}addValidFileRoot(e){const i=bi(e);return this.validRoots.get(i)?N.None:(this.validRoots.set(i,!0),me(()=>this.validRoots.delete(i)))}handleFileRequest(e,i){const r=x.parse(e.url);return this.logService.error(`Refused to load resource ${r.fsPath} from ${T.file}: protocol (original URL: ${e.url})`),i({error:-3})}handleResourceRequest(e,i){const r=this.requestToNormalizedFilePath(e),s=tt(r);let n;return this.environmentService.crossOriginIsolated&&(s==="workbench.html"||s==="workbench-dev.html"?n=mc.CoopAndCoep:n=mc.getHeadersFromQuery(e.url)),this.environmentService.isBuilt||(n={...n,..._S}),(s==="workbench.html"||s==="workbench-dev.html")&&(n={...n,...bS}),this.validRoots.findSubstr(r)?i({path:r,headers:n}):this.validExtensions.has(Hu(r).toLowerCase())?i({path:r,headers:n}):(this.logService.error(`${T.vscodeFileResource}: Refused to load resource ${r} from ${T.vscodeFileResource}: protocol (original URL: ${e.url})`),i({error:-3}))}requestToNormalizedFilePath(e){const i=x.parse(e.url),r=Ct.uriToFileUri(i);return bi(r.fsPath)}createIPCObjectUrl(){let e;const i=x.from({scheme:"vscode",path:ui()}),r=i.toString(),s=async()=>e;return We.handle(r,s),this.logService.trace(`IPC Object URL: Registered new channel ${r}.`),{resource:i,update:n=>e=n,dispose:()=>{this.logService.trace(`IPC Object URL: Removed channel ${r}.`),We.removeHandler(r)}}}},yp=__decorate([__param(0,$r),__param(1,qr),__param(2,V)],yp)}});function ZU(t){return!!t.forwardPort}function e$(t){if(t.scheme!=="http"&&t.scheme!=="https")return;const e=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(t.authority);if(e)return{address:e[1],port:+e[2]}}function n0(t){return _p.indexOf(t)>=0}function au(t){return bp.indexOf(t)>=0}function t$(t,e,i,r){if(i===1)return!1;if(i===2&&au(e)){const s=/(\d+)\.(\d+)\.(\d+)/g.exec(r);if(s?.length===4&&parseInt(s[1])>=18)return!1}return t<1024}var aP,i$,cP,Sp,lP,_p,bp,Ep,uP=g({"out-build/vs/platform/tunnel/common/tunnel.js"(){"use strict";q(),L(),re(),Xe(),G(),K(),aP=j("tunnelService"),i$=j("sharedTunnelsService"),(function(t){t.Http="http",t.Https="https"})(cP||(cP={})),(function(t){t.ConstantPrivate="constantPrivate",t.Private="private",t.Public="public"})(Sp||(Sp={})),(function(t){t[t.Notify=1]="Notify",t[t.OpenBrowser=2]="OpenBrowser",t[t.OpenPreview=3]="OpenPreview",t[t.Silent=4]="Silent",t[t.Ignore=5]="Ignore",t[t.OpenBrowserOnce=6]="OpenBrowserOnce"})(lP||(lP={})),_p=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"],bp=["0.0.0.0","0:0:0:0:0:0:0:0","::"],Ep=class extends N{constructor(e,i){super(),this.logService=e,this.configurationService=i,this._onTunnelOpened=new D,this.onTunnelOpened=this._onTunnelOpened.event,this._onTunnelClosed=new D,this.onTunnelClosed=this._onTunnelClosed.event,this._onAddedTunnelProvider=new D,this.onAddedTunnelProvider=this._onAddedTunnelProvider.event,this._tunnels=new Map,this._canElevate=!1,this._canChangeProtocol=!0,this._privacyOptions=[],this._factoryInProgress=new Set}get hasTunnelProvider(){return!!this._tunnelProvider}get defaultTunnelHost(){const e=this.configurationService.getValue("remote.localPortHost");return!e||e==="localhost"?"127.0.0.1":"0.0.0.0"}setTunnelProvider(e){return this._tunnelProvider=e,e?(this._onAddedTunnelProvider.fire(),{dispose:()=>{this._tunnelProvider=void 0,this._canElevate=!1,this._privacyOptions=[]}}):(this._canElevate=!1,this._privacyOptions=[],this._onAddedTunnelProvider.fire(),{dispose:()=>{}})}setTunnelFeatures(e){this._canElevate=e.elevation,this._privacyOptions=e.privacyOptions,this._canChangeProtocol=e.protocol}get canChangeProtocol(){return this._canChangeProtocol}get canElevate(){return this._canElevate}get canChangePrivacy(){return this._privacyOptions.length>0}get privacyOptions(){return this._privacyOptions}get tunnels(){return this.getTunnels()}async getTunnels(){const e=[],i=Array.from(this._tunnels.values());for(const r of i){const s=Array.from(r.values());for(const n of s){const o=await n.value;o&&typeof o!="string"&&e.push(o)}}return e}async dispose(){super.dispose();for(const e of this._tunnels.values()){for(const{value:i}of e.values())await i.then(r=>typeof r!="string"?r?.dispose():void 0);e.clear()}this._tunnels.clear()}setEnvironmentTunnel(e,i,r,s,n){this.addTunnelToMap(e,i,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:i,localAddress:r,privacy:s,protocol:n,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,i){(au(e)||n0(e))&&(e=_p[0]);const r=this.getTunnelFromMap(e,i);if(r)return++r.refcount,r.value}openTunnel(e,i,r,s,n,o=!1,a,c){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${i}:${r} on local port ${n}.`);const l=this._tunnelProvider??e;if(!l)return;if(i||(i="localhost"),s||(s=this.defaultTunnelHost),this._tunnelProvider&&this._factoryInProgress.has(r)){this.logService.debug("ForwardedPorts: (TunnelService) Another call to create a tunnel with the same address has occurred before the last one completed. This call will be ignored.");return}const u=this.retainOrCreateTunnel(l,i,r,s,n,o,a,c);return u?u.then(d=>{if(d){if(typeof d=="string")return this.logService.trace("ForwardedPorts: (TunnelService) The tunnel provider returned an error when creating the tunnel."),this.removeEmptyOrErrorTunnelFromMap(i,r),d}else{this.logService.trace("ForwardedPorts: (TunnelService) New tunnel is undefined."),this.removeEmptyOrErrorTunnelFromMap(i,r);return}this.logService.trace("ForwardedPorts: (TunnelService) New tunnel established.");const f=this.makeTunnel(d);return(d.tunnelRemoteHost!==i||d.tunnelRemotePort!==r)&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Host or port mismatch."),a&&d.privacy!==a&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Privacy mismatch."),this._onTunnelOpened.fire(f),f}):(this.logService.trace("ForwardedPorts: (TunnelService) Tunnel was not created."),u)}makeTunnel(e){return{tunnelRemotePort:e.tunnelRemotePort,tunnelRemoteHost:e.tunnelRemoteHost,tunnelLocalPort:e.tunnelLocalPort,localAddress:e.localAddress,privacy:e.privacy,protocol:e.protocol,dispose:async()=>{this.logService.trace(`ForwardedPorts: (TunnelService) dispose request for ${e.tunnelRemoteHost}:${e.tunnelRemotePort} `);const i=this._tunnels.get(e.tunnelRemoteHost);if(i){const r=i.get(e.tunnelRemotePort);r&&(r.refcount--,await this.tryDisposeTunnel(e.tunnelRemoteHost,e.tunnelRemotePort,r))}}}}async tryDisposeTunnel(e,i,r){if(r.refcount<=0){this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel is being disposed ${e}:${i}.`);const s=r.value.then(async n=>{n&&typeof n!="string"&&(await n.dispose(!0),this._onTunnelClosed.fire({host:n.tunnelRemoteHost,port:n.tunnelRemotePort}))});return this._tunnels.has(e)&&this._tunnels.get(e).delete(i),s}}async closeTunnel(e,i){this.logService.trace(`ForwardedPorts: (TunnelService) close request for ${e}:${i} `);const r=this._tunnels.get(e);if(r&&r.has(i)){const s=r.get(i);s.refcount=0,await this.tryDisposeTunnel(e,i,s)}}addTunnelToMap(e,i,r){this._tunnels.has(e)||this._tunnels.set(e,new Map),this._tunnels.get(e).set(i,{refcount:1,value:r})}async removeEmptyOrErrorTunnelFromMap(e,i){const r=this._tunnels.get(e);if(r){const s=r.get(i),n=s?await s.value:void 0;(!n||typeof n=="string")&&r.delete(i),r.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,i){const r=[e];n0(e)?(r.push(..._p),r.push(...bp)):au(e)&&r.push(...bp);const s=r.map(n=>this._tunnels.get(n));for(const n of s){const o=n?.get(i);if(o)return o}}canTunnel(e){return!!e$(e)}createWithProvider(e,i,r,s,n,o,a){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${i}:${r} on local port ${s}.`);const c=r;this._factoryInProgress.add(c);const l=s===void 0?r:s,u={elevationRequired:n?this.isPortPrivileged(l):!1},d={remoteAddress:{host:i,port:r},localAddressPort:s,privacy:o,public:o?o!==Sp.Private:void 0,protocol:a},f=e.forwardPort(d,u);return f?(this.addTunnelToMap(i,r,f),f.finally(()=>{this.logService.trace("ForwardedPorts: (TunnelService) Tunnel created by provider."),this._factoryInProgress.delete(c)})):this._factoryInProgress.delete(c),f}},Ep=__decorate([__param(0,V),__param(1,Qe)],Ep)}}),r$,dP,gn,kp,s$=g({"out-build/vs/platform/remote/common/remoteAuthorityResolver.js"(){"use strict";Re(),G(),r$=j("remoteAuthorityResolverService"),(function(t){t[t.WebSocket=0]="WebSocket",t[t.Managed=1]="Managed"})(dP||(dP={})),(function(t){t.Unknown="Unknown",t.NotAvailable="NotAvailable",t.TemporarilyNotAvailable="TemporarilyNotAvailable",t.NoResolverFound="NoResolverFound",t.InvalidAuthority="InvalidAuthority"})(gn||(gn={})),kp=class yo extends Tr{static isNotAvailable(e){return e instanceof yo&&e._code===gn.NotAvailable}static isTemporarilyNotAvailable(e){return e instanceof yo&&e._code===gn.TemporarilyNotAvailable}static isNoResolverFound(e){return e instanceof yo&&e._code===gn.NoResolverFound}static isInvalidAuthority(e){return e instanceof yo&&e._code===gn.InvalidAuthority}static isHandled(e){return e instanceof yo&&e.isHandled}constructor(e,i=gn.Unknown,r){super(e),this._message=e,this._code=i,this._detail=r,this.isHandled=i===gn.NotAvailable&&r===!0,Object.setPrototypeOf(this,yo.prototype)}}}});function o0(t){switch(t){case 1:return"Management";case 2:return"ExtensionHost";case 3:return"Tunnel"}}function hP(t){const e=new Sr;return setTimeout(()=>e.cancel(),t),e.token}function n$(t,e){if(t.isCancellationRequested||e.isCancellationRequested)return Te.Cancelled;const i=new Sr;return t.onCancellationRequested(()=>i.cancel()),e.onCancellationRequested(()=>i.cancel()),i.token}function o$(t,e){const i=new xp(e);return i.registerDisposable(t.onControlMessage(r=>{const s=JSON.parse(r.toString()),n=h$(s);n?i.reject(n):i.resolve(s)})),i.promise}function a$(t,e,i,r,s,n,o,a){const c=new xp(a),l=En.create(!1);return t.info(`Creating a socket (${o})...`),Ve(`code/willCreateSocket/${n}`),e.connect(i,r,s,o).then(u=>{c.didTimeout?(Ve(`code/didCreateSocketError/${n}`),t.info(`Creating a socket (${o}) finished after ${l.elapsed()} ms, but this is too late and has timed out already.`),u?.dispose()):(Ve(`code/didCreateSocketOK/${n}`),t.info(`Creating a socket (${o}) was successful after ${l.elapsed()} ms.`),c.resolve(u))},u=>{Ve(`code/didCreateSocketError/${n}`),t.info(`Creating a socket (${o}) returned an error after ${l.elapsed()} ms.`),t.error(u),c.reject(u)}),c.promise}function a0(t,e){const i=new xp(e);return t.then(r=>{i.didTimeout||i.resolve(r)},r=>{i.didTimeout||i.reject(r)}),i.promise}async function c$(t,e,i,r){const s=gP(t,e);t.logService.trace(`${s} 1/6. invoking socketFactory.connect().`);let n;try{n=await a$(t.logService,t.remoteSocketFactoryService,t.connectTo,Dg.getServerRootPath(),`reconnectionToken=${t.reconnectionToken}&reconnection=${t.reconnectionProtocol?"true":"false"}`,o0(e),`renderer-${o0(e)}-${t.reconnectionToken}`,r)}catch(u){throw t.logService.error(`${s} socketFactory.connect() failed or timed out. Error:`),t.logService.error(u),u}t.logService.trace(`${s} 2/6. socketFactory.connect() was successful.`);let o,a;t.reconnectionProtocol?(t.reconnectionProtocol.beginAcceptReconnection(n,null),o=t.reconnectionProtocol,a=!1):(o=new B_({socket:n}),a=!0),t.logService.trace(`${s} 3/6. sending AuthRequest control message.`);const c=await a0(t.signService.createNewMessage(ui()),r),l={type:"auth",auth:t.connectionToken||"00000000000000000000",data:c.data};o.sendControl(Y.fromString(JSON.stringify(l)));try{const u=await o$(o,n$(r,hP(1e4)));if(u.type!=="sign"||typeof u.data!="string"){const v=new Error("Unexpected handshake message");throw v.code="VSCODE_CONNECTION_ERROR",v}if(t.logService.trace(`${s} 4/6. received SignRequest control message.`),!await a0(t.signService.validate(c,u.signedData),r)){const v=new Error("Refused to connect to unsupported server");throw v.code="VSCODE_CONNECTION_ERROR",v}const f=await a0(t.signService.sign(u.data),r),p={type:"connectionType",commit:t.commit,signedData:f,desiredConnectionType:e};return i&&(p.args=i),t.logService.trace(`${s} 5/6. sending ConnectionTypeRequest control message.`),o.sendControl(Y.fromString(JSON.stringify(p))),{protocol:o,ownsProtocol:a}}catch(u){throw u&&u.code==="ETIMEDOUT"&&(t.logService.error(`${s} the handshake timed out. Error:`),t.logService.error(u)),u&&u.code==="VSCODE_CONNECTION_ERROR"&&(t.logService.error(`${s} received error control message when negotiating connection. Error:`),t.logService.error(u)),a&&pP(o),u}}async function l$(t,e,i){const r=Date.now(),s=gP(t,3),{protocol:n}=await c$(t,3,e,i);return t.logService.trace(`${s} 6/6. handshake finished, connection is up and running after ${g$(r)}!`),n}async function fP(t,e,i){const{connectTo:r,connectionToken:s}=await t.addressProvider.getAddress();return{commit:t.commit,quality:t.quality,connectTo:r,connectionToken:s,reconnectionToken:e,reconnectionProtocol:i,remoteSocketFactoryService:t.remoteSocketFactoryService,signService:t.signService,logService:t.logService}}async function u$(t,e,i){const r=await fP(t,ui(),null);return await l$(r,{host:e,port:i},Te.None)}function d$(t){return To(e=>new Promise((i,r)=>{const s=setTimeout(i,t*1e3);e.onCancellationRequested(()=>{clearTimeout(s),i()})}))}function pP(t){try{t.acceptDisconnect();const e=t.getSocket();t.dispose(),e.dispose()}catch(e){$t(e)}}function h$(t){if(t&&t.type==="error"){const e=new Error(`Connection error: ${t.reason}`);return e.code="VSCODE_CONNECTION_ERROR",e}return null}function f$(t,e){for(;t.length<e;)t+=" ";return t}function p$(t,e){return`[remote-connection][${f$(o0(t),13)}][${e.substr(0,5)}\u2026]`}function Pp(t,e,i){return`${p$(t,e)}[${i?"reconnect":"initial"}]`}function gP(t,e){return`${Pp(e,t.reconnectionToken,!!t.reconnectionProtocol)}[${t.connectTo}]`}function g$(t){return`${Date.now()-t} ms`}var mP,vP,xp,wP,yP,SP,_P,c0,bP,m$,v$=g({"out-build/vs/platform/remote/common/remoteAgentConnection.js"(){"use strict";ae(),it(),St(),Re(),q(),L(),Ie(),ls(),Io(),Hi(),j_(),s$(),Mh(),mP=30*1e3,(function(t){t[t.Management=1]="Management",t[t.ExtensionHost=2]="ExtensionHost",t[t.Tunnel=3]="Tunnel"})(vP||(vP={})),xp=class{get didTimeout(){return this._state==="timedout"}constructor(t){this._state="pending",this._disposables=new ke,{promise:this.promise,resolve:this._resolvePromise,reject:this._rejectPromise}=HC(),t.isCancellationRequested?this._timeout():this._disposables.add(t.onCancellationRequested(()=>this._timeout()))}registerDisposable(t){this._state==="pending"?this._disposables.add(t):t.dispose()}_timeout(){this._state==="pending"&&(this._disposables.dispose(),this._state="timedout",this._rejectPromise(this._createTimeoutError()))}_createTimeoutError(){const t=new Error("Time limit reached");return t.code="ETIMEDOUT",t.syscall="connect",t}resolve(t){this._state==="pending"&&(this._disposables.dispose(),this._state="resolved",this._resolvePromise(t))}reject(t){this._state==="pending"&&(this._disposables.dispose(),this._state="rejected",this._rejectPromise(t))}},(function(t){t[t.ConnectionLost=0]="ConnectionLost",t[t.ReconnectionWait=1]="ReconnectionWait",t[t.ReconnectionRunning=2]="ReconnectionRunning",t[t.ReconnectionPermanentFailure=3]="ReconnectionPermanentFailure",t[t.ConnectionGain=4]="ConnectionGain"})(wP||(wP={})),yP=class{constructor(t,e){this.reconnectionToken=t,this.millisSinceLastIncomingData=e,this.type=0}},SP=class{constructor(t,e,i,r){this.reconnectionToken=t,this.millisSinceLastIncomingData=e,this.durationSeconds=i,this.cancellableTimer=r,this.type=1}skipWait(){this.cancellableTimer.cancel()}},_P=class{constructor(t,e,i){this.reconnectionToken=t,this.millisSinceLastIncomingData=e,this.attempt=i,this.type=2}},c0=class{constructor(t,e,i){this.reconnectionToken=t,this.millisSinceLastIncomingData=e,this.attempt=i,this.type=4}},bP=class{constructor(t,e,i,r){this.reconnectionToken=t,this.millisSinceLastIncomingData=e,this.attempt=i,this.handled=r,this.type=3}},m$=class Ns extends N{static triggerPermanentFailure(e,i,r){this._permanentFailure=!0,this._permanentFailureMillisSinceLastIncomingData=e,this._permanentFailureAttempt=i,this._permanentFailureHandled=r,this._instances.forEach(s=>s._gotoPermanentFailure(this._permanentFailureMillisSinceLastIncomingData,this._permanentFailureAttempt,this._permanentFailureHandled))}static debugTriggerReconnection(){this._instances.forEach(e=>e._beginReconnecting())}static debugPauseSocketWriting(){this._instances.forEach(e=>e._pauseSocketWriting())}static{this._permanentFailure=!1}static{this._permanentFailureMillisSinceLastIncomingData=0}static{this._permanentFailureAttempt=0}static{this._permanentFailureHandled=!1}static{this._instances=[]}get _isPermanentFailure(){return this._permanentFailure||Ns._permanentFailure}constructor(e,i,r,s,n){super(),this._connectionType=e,this._options=i,this.reconnectionToken=r,this.protocol=s,this._reconnectionFailureIsFatal=n,this._onDidStateChange=this._register(new D),this.onDidStateChange=this._onDidStateChange.event,this._permanentFailure=!1,this._isReconnecting=!1,this._isDisposed=!1,this._onDidStateChange.fire(new c0(this.reconnectionToken,0,0)),this._register(s.onSocketClose(o=>{const a=Pp(this._connectionType,this.reconnectionToken,!0);o?o.type===0?(this._options.logService.info(`${a} received socket close event (hadError: ${o.hadError}).`),o.error&&this._options.logService.error(o.error)):(this._options.logService.info(`${a} received socket close event (wasClean: ${o.wasClean}, code: ${o.code}, reason: ${o.reason}).`),o.event&&this._options.logService.error(o.event)):this._options.logService.info(`${a} received socket close event.`),this._beginReconnecting()})),this._register(s.onSocketTimeout(o=>{const a=Pp(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${a} received socket timeout event (unacknowledgedMsgCount: ${o.unacknowledgedMsgCount}, timeSinceOldestUnacknowledgedMsg: ${o.timeSinceOldestUnacknowledgedMsg}, timeSinceLastReceivedSomeData: ${o.timeSinceLastReceivedSomeData}).`),this._beginReconnecting()})),Ns._instances.push(this),this._register(me(()=>{const o=Ns._instances.indexOf(this);o>=0&&Ns._instances.splice(o,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(Ns._permanentFailureMillisSinceLastIncomingData,Ns._permanentFailureAttempt,Ns._permanentFailureHandled)}dispose(){super.dispose(),this._isDisposed=!0}async _beginReconnecting(){if(!this._isReconnecting)try{this._isReconnecting=!0,await this._runReconnectingLoop()}finally{this._isReconnecting=!1}}_isBackgroundComposerConnection(){const e=this.getRemoteAuthority();return!!(e&&an(e)!==void 0)}async _runReconnectingLoop(){if(this._isPermanentFailure||this._isDisposed)return;const e=Pp(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${e} starting reconnecting loop. You can get more information with the trace log level.`),this._onDidStateChange.fire(new yP(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData()));const i=[0,5,5,10,10,10,10,10,30];let r=-1;do{r++;const s=r<i.length?i[r]:i[i.length-1];try{if(s>0){const o=d$(s);this._onDidStateChange.fire(new SP(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),s,o)),this._options.logService.info(`${e} waiting for ${s} seconds before reconnecting...`);try{await o}catch{}}if(this._isPermanentFailure){this._options.logService.error(`${e} permanent failure occurred while running the reconnecting loop.`);break}this._onDidStateChange.fire(new _P(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),r+1)),this._options.logService.info(`${e} resolving connection...`);const n=await fP(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${e} connecting to ${n.connectTo}...`),await this._reconnect(n,hP(mP)),this._options.logService.info(`${e} reconnected!`),this._onDidStateChange.fire(new c0(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),r+1));break}catch(n){const o=this._isBackgroundComposerConnection();if(n.code==="VSCODE_CONNECTION_ERROR"){this._options.logService.error(`${e} A permanent error occurred in the reconnecting loop! Will give up now! Error:`),this._options.logService.error(n),o&&this._options.logService.info(`${e} A permanent error occurred in the reconnecting loop! For background composer, we should ideally try to reconnect, but we're not doing that for now...`),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),r+1,!1);break}if(r>360&&!o){this._options.logService.error(`${e} An error occurred while reconnecting, but it will be treated as a permanent error because the reconnection grace time has expired! Will give up now! Error:`),this._options.logService.error(n),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),r+1,!1);break}if(kp.isTemporarilyNotAvailable(n)){this._options.logService.info(`${e} A temporarily not available error occurred while trying to reconnect, will try again...`),this._options.logService.trace(n);continue}if((n.code==="ETIMEDOUT"||n.code==="ENETUNREACH"||n.code==="ECONNREFUSED"||n.code==="ECONNRESET")&&n.syscall==="connect"){this._options.logService.info(`${e} A network error occurred while trying to reconnect, will try again...`),this._options.logService.trace(n);continue}if(Ru(n)){this._options.logService.info(`${e} A promise cancelation error occurred while trying to reconnect, will try again...`),this._options.logService.trace(n);continue}if(n instanceof kp){this._options.logService.error(`${e} A RemoteAuthorityResolverError occurred while trying to reconnect. Will give up now! Error:`),this._options.logService.error(n),o&&this._options.logService.info(`${e} A RemoteAuthorityResolverError occurred while trying to reconnect. For background composer, we should ideally try to reconnect, but we're not doing that for now...`),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),r+1,kp.isHandled(n));break}if(this._options.logService.error(`${e} An unknown error occurred while trying to reconnect, since this is an unknown case, it will be treated as a permanent error! Will give up now! Error:`),this._options.logService.error(n),o){if("_code"in n&&n._code==="TemporarilyNotAvailable"||"code"in n&&n.code==="TemporarilyNotAvailable"){this._options.logService.info(`${e} Temporarily not available error in background composer, will try again...`);continue}this._options.logService.info(`${e} An unknown error occurred while trying to reconnect. For background composer, we should ideally try to reconnect, but we're not doing that for now...`)}this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),r+1,!1);break}}while(!this._isPermanentFailure&&!this._isDisposed)}_onReconnectionPermanentFailure(e,i,r){this._reconnectionFailureIsFatal?Ns.triggerPermanentFailure(e,i,r):this._gotoPermanentFailure(e,i,r)}_gotoPermanentFailure(e,i,r){this._onDidStateChange.fire(new bP(this.reconnectionToken,e,i,r)),pP(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}}}}),Cp,w$=g({"out-build/vs/platform/remote/common/remoteSocketFactoryService.js"(){"use strict";L(),G(),Cp=j("remoteSocketFactoryService")}});import*as y$ from"net";import*as S$ from"os";async function _$(t,e,i,r,s){let n;for(let o=3;o&&(n?.dispose(),n=await new EP(t,e,i,r,s).waitForReady(),!(s&&T1[s]||!T1[n.tunnelLocalPort]));o--);return n}var EP,Ip,cu,l0,b$=g({"out-build/vs/platform/tunnel/node/tunnelService.js"(){"use strict";l5(),um(),ae(),L(),z(),Xe(),K(),lt(),v$(),w$(),mv(),uP(),it(),EP=class extends N{constructor(t,e,i,r,s){super(),this.defaultTunnelHost=e,this.suggestedLocalPort=s,this.privacy=Sp.Private,this._socketsDispose=new Map,this._options=t,this._server=y$.createServer(),this._barrier=new Tc,this._listeningListener=()=>this._barrier.open(),this._server.on("listening",this._listeningListener),this._connectionListener=n=>this._onConnection(n),this._server.on("connection",this._connectionListener),this._errorListener=()=>{},this._server.on("error",this._errorListener),this.tunnelRemotePort=r,this.tunnelRemoteHost=i}async dispose(){super.dispose(),this._server.removeListener("listening",this._listeningListener),this._server.removeListener("connection",this._connectionListener),this._server.removeListener("error",this._errorListener),this._server.close(),Array.from(this._socketsDispose.values()).forEach(e=>{e()})}async waitForReady(){const t=this.suggestedLocalPort??this.tunnelRemotePort,e=au(this.defaultTunnelHost)?"0.0.0.0":"127.0.0.1";let i=await uA(t,2,1e3,e),r=null;return this._server.listen(i,this.defaultTunnelHost),await this._barrier.wait(),r=this._server.address(),r||(i=0,this._server.listen(i,this.defaultTunnelHost),await this._barrier.wait(),r=this._server.address()),this.tunnelLocalPort=r.port,this.localAddress=`${this.tunnelRemoteHost==="127.0.0.1"?"127.0.0.1":"localhost"}:${r.port}`,this}async _onConnection(t){t.pause();const e=n0(this.tunnelRemoteHost)||au(this.tunnelRemoteHost)?"localhost":this.tunnelRemoteHost,i=await u$(this._options,e,this.tunnelRemotePort),r=i.getSocket(),s=i.readEntireBuffer();i.dispose(),s.byteLength>0&&t.write(s.buffer),t.on("end",()=>{t.localAddress&&this._socketsDispose.delete(t.localAddress),r.end()}),t.on("close",()=>r.end()),t.on("error",()=>{t.localAddress&&this._socketsDispose.delete(t.localAddress),r instanceof Oc?r.socket.destroy():r.end()}),r instanceof Oc?this._mirrorNodeSocket(t,r):this._mirrorGenericSocket(t,r),t.localAddress&&this._socketsDispose.set(t.localAddress,()=>{t.end(),r.end()})}_mirrorGenericSocket(t,e){e.onClose(()=>t.destroy()),e.onEnd(()=>t.end()),e.onData(i=>t.write(i.buffer)),t.on("data",i=>e.write(Y.wrap(i))),t.resume()}_mirrorNodeSocket(t,e){const i=e.socket;i.on("end",()=>t.end()),i.on("close",()=>t.end()),i.on("error",()=>{t.destroy()}),i.pipe(t),t.pipe(i)}},Ip=class extends Ep{constructor(e,i,r,s,n){super(i,n),this.remoteSocketFactoryService=e,this.signService=r,this.productService=s}isPortPrivileged(e){return t$(e,this.defaultTunnelHost,Gi,S$.release())}retainOrCreateTunnel(e,i,r,s,n,o,a,c){const l=this.getTunnelFromMap(i,r);if(l)return++l.refcount,l.value;if(ZU(e))return this.createWithProvider(e,i,r,n,o,a,c);{this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel without provider ${i}:${r} on local port ${n}.`);const u={commit:this.productService.commit,quality:this.productService.quality,addressProvider:e,remoteSocketFactoryService:this.remoteSocketFactoryService,signService:this.signService,logService:this.logService,ipcLogger:null},d=_$(u,s,i,r,n);return this.logService.trace("ForwardedPorts: (TunnelService) Tunnel created without provider."),this.addTunnelToMap(i,r,d),d}}},Ip=__decorate([__param(0,Cp),__param(1,V),__param(2,Sa),__param(3,qe),__param(4,Qe)],Ip),cu=class extends Ip{constructor(e,i,r,s,n){super(e,i,r,s,n)}},cu=__decorate([__param(0,Cp),__param(1,V),__param(2,Sa),__param(3,qe),__param(4,Qe)],cu),l0=class extends N{constructor(e,i,r,s,n){super(),this.remoteSocketFactoryService=e,this.logService=i,this.productService=r,this.signService=s,this.configurationService=n,this._tunnelServices=new Map}async openTunnel(e,i,r,s,n,o,a,c,l){if(this.logService.trace(`ForwardedPorts: (SharedTunnelService) openTunnel request for ${r}:${s} on local port ${o}.`),!this._tunnelServices.has(e)){const u=new cu(this.remoteSocketFactoryService,this.logService,this.signService,this.productService,this.configurationService);this._register(u),this._tunnelServices.set(e,u),u.onTunnelClosed(async()=>{(await u.tunnels).length===0&&(u.dispose(),this._tunnelServices.delete(e))})}return this._tunnelServices.get(e).openTunnel(i,r,s,n,o,a,c,l)}},l0=__decorate([__param(0,Cp),__param(1,V),__param(2,qe),__param(3,Sa),__param(4,Qe)],l0)}});import{parse as kP}from"url";function E$(t,e){return t.protocol==="http:"?e.HTTP_PROXY||e.http_proxy||null:t.protocol==="https:"&&(e.HTTPS_PROXY||e.https_proxy||e.HTTP_PROXY||e.http_proxy)||null}async function k$(t,e,i={}){const r=kP(t),s=i.proxyUrl||E$(r,e);if(!s)return null;const n=kP(s);if(!/^https?:$/.test(n.protocol||""))return null;const o={host:n.hostname||"",port:(n.port?+n.port:0)||(n.protocol==="https"?443:80),auth:n.auth,rejectUnauthorized:Ly(i.strictSSL)?i.strictSSL:!0};if(r.protocol==="http:"){const{default:a}=await import("http-proxy-agent");return new a.HttpProxyAgent(s,o)}else{const{default:a}=await import("https-proxy-agent");return new a.HttpsProxyAgent(s,o)}}var P$=g({"out-build/vs/platform/request/node/proxy.js"(){"use strict";xe()}});import{parse as PP}from"url";import{createGunzip as x$}from"zlib";async function C$(t,e,i,r){const s=await import("kerberos"),n=s.default||s,o=new URL(t),a=e||(process.platform==="win32"?`HTTP/${o.hostname}`:`HTTP@${o.hostname}`);return i.debug(`${r} Kerberos authentication lookup`,`proxyURL:${o}`,`spn:${a}`),(await n.initializeClient(a)).step("")}async function I$(t){return(PP(t.url).protocol==="https:"?await import("https"):await import("http")).request}async function u0(t,e){return Ht.withAsyncBody(async(i,r)=>{const s=PP(t.url),n=t.getRawRequest?t.getRawRequest(t):await I$(t),o={hostname:s.hostname,port:s.port?parseInt(s.port):s.protocol==="https:"?443:80,protocol:s.protocol,path:s.path,method:t.type||"GET",headers:t.headers,agent:t.agent,rejectUnauthorized:Ly(t.strictSSL)?t.strictSSL:!0};t.user&&t.password&&(o.auth=t.user+":"+t.password),t.disableCache&&(o.cache="no-store");const a=n(o,c=>{const l=Ou(t.followRedirects)?t.followRedirects:3;if(c.statusCode&&c.statusCode>=300&&c.statusCode<400&&l>0&&c.headers.location)c.statusCode===303?u0({...t,url:c.headers.location,type:"GET",followRedirects:l-1},e).then(i,r):u0({...t,url:c.headers.location,followRedirects:l-1},e).then(i,r);else{let u=c;!t.isChromiumNetwork&&c.headers["content-encoding"]==="gzip"&&(u=c.pipe(x$())),i({res:c,stream:gC(u)})}});if(a.on("error",r),t.timeout)if(t.isChromiumNetwork){const c=setTimeout(()=>{a.abort(),r(new Error(`Request timeout after ${t.timeout}ms`))},t.timeout);a.on("response",()=>clearTimeout(c)),a.on("error",()=>clearTimeout(c)),a.on("abort",()=>clearTimeout(c))}else a.setTimeout(t.timeout);t.isChromiumNetwork&&a.removeHeader("Content-Length"),t.data&&typeof t.data=="string"&&a.write(t.data),a.end(),e.onCancellationRequested(()=>{a.abort(),r(new yi)})})}var Dp,D$=g({"out-build/vs/platform/request/node/requestService.js"(){"use strict";ae(),it(),Re(),xe(),Xe(),xi(),C1(),K(),Rs(),P$(),Dp=class extends v5{constructor(e,i,r,s){super(s),this.machine=e,this.configurationService=i,this.environmentService=r,this.configure(),this._register(i.onDidChangeConfiguration(n=>{n.affectsConfiguration("http")&&this.configure()}))}configure(){this.proxyUrl=this.getConfigValue("http.proxy"),this.strictSSL=!!this.getConfigValue("http.proxyStrictSSL"),this.authorization=this.getConfigValue("http.proxyAuthorization")}async request(e,i){const{proxyUrl:r,strictSSL:s}=this;let n;try{n=await x1(this.configurationService,this.logService,this.environmentService.args,process.env)}catch(c){this.shellEnvErrorLogged||(this.shellEnvErrorLogged=!0,this.logService.error("resolving shell environment failed",$i(c)))}const o={...process.env,...n},a=e.agent?e.agent:await k$(e.url||"",o,{proxyUrl:r,strictSSL:s});return e.agent=a,e.strictSSL=s,this.authorization&&(e.headers={...e.headers||{},"Proxy-Authorization":this.authorization}),this.logAndRequest(e,()=>u0(e,i))}async resolveProxy(e){}async lookupAuthorization(e){}async lookupKerberosAuthorization(e){try{const i=this.getConfigValue("http.proxyKerberosServicePrincipal");return"Negotiate "+await C$(e,i,this.logService,"RequestService#lookupKerberosAuthorization")}catch(i){this.logService.debug("RequestService#lookupKerberosAuthorization Kerberos authentication failed",i);return}}async loadCertificates(){return(await import("@vscode/proxy-agent")).loadSystemCertificates({log:this.logService})}getConfigValue(e){if(this.machine==="remote")return this.configurationService.getValue(e);const i=this.configurationService.inspect(e);return i.userLocalValue||i.defaultValue}},Dp=__decorate([__param(1,Qe),__param(2,$r),__param(3,V)],Dp)}});import{net as A$}from"electron";function R$(t){return A$.request}var Ap,M$=g({"out-build/vs/platform/request/electron-utility/requestService.js"(){"use strict";D$(),Xe(),xi(),K(),Ap=class extends Dp{constructor(e,i,r){super("local",e,i,r)}request(e,i){return super.request({...e||{},getRawRequest:R$,isChromiumNetwork:!0},i)}},Ap=__decorate([__param(0,Qe),__param(1,$r),__param(2,V)],Ap)}}),xP,T$=g({"out-build/vs/platform/sign/common/abstractSignService.js"(){"use strict";xP=class L8{constructor(){this.validators=new Map}static{this._nextId=1}async createNewMessage(e){try{const i=await this.getValidator();if(i){const r=String(L8._nextId++);return this.validators.set(r,i),{id:r,data:i.createNewMessage(e)}}}catch{}return{id:"",data:e}}async validate(e,i){if(!e.id)return!0;const r=this.validators.get(e.id);if(!r)return!1;this.validators.delete(e.id);try{return r.validate(i)==="ok"}catch{return!1}finally{r.dispose?.()}}async sign(e){try{return await this.signValue(e)}catch{}return e}}}}),CP,W$=g({"out-build/vs/platform/sign/node/signService.js"(){"use strict";T$(),CP=class extends xP{getValidator(){return this.vsda().then(t=>new t.validator)}signValue(t){return this.vsda().then(e=>new e.signer().sign(t))}async vsda(){const t="vsda",{default:e}=await import(t);return e}}}}),lu,L$=g({"out-build/vs/platform/policy/node/nativePolicyService.js"(){"use strict";Xr(),ae(),L(),K(),lu=class extends dv{constructor(e,i){super(),this.logService=e,this.productName=i,this.throttler=new Yg,this.watcher=this._register(new $s)}async _updatePolicyDefinitions(e){this.logService.trace(`NativePolicyService#_updatePolicyDefinitions - Found ${Object.keys(e).length} policy definitions`);const{createWatcher:i}=await import("@vscode/policy-watcher");await this.throttler.queue(()=>new Promise((r,s)=>{try{this.watcher.value=i(this.productName,e,n=>{this._onDidPolicyChange(n),r()})}catch(n){this.logService.error("NativePolicyService#_updatePolicyDefinitions - Error creating watcher:",n),s(n)}}))}_onDidPolicyChange(e){this.logService.trace(`NativePolicyService#_onDidPolicyChange - Updated policy values: ${JSON.stringify(e)}`);for(const i in e){const r=e[i];r===void 0?this.policies.delete(i):this.policies.set(i,r)}this._onDidChange.fire(Object.keys(e))}},lu=__decorate([__param(0,V)],lu)}});function O$(t,e){const i=[];for(const r of new Set(_n.concat(t.keys(),e.keys())))t.get(r)!==e.get(r)&&i.push(r);return i}var Rp,F$=g({"out-build/vs/platform/policy/common/filePolicyService.js"(){"use strict";ae(),q(),Nu(),xe(),Ze(),K(),Xr(),Rp=class extends dv{constructor(e,i,r){super(),this.file=e,this.fileService=i,this.logService=r,this.throttledDelayer=this._register(new ws(500));const s=P.filter(i.onDidFilesChange,n=>n.affects(e));this._register(i.watch(e)),this._register(s(()=>this.throttledDelayer.trigger(()=>this.refresh())))}async _updatePolicyDefinitions(){await this.refresh()}async read(){const e=new Map;try{const i=await this.fileService.readFile(this.file),r=JSON.parse(i.value.toString());if(!Lt(r))throw new Error("Policy file isn't a JSON object");for(const s of Object.keys(r))this.policyDefinitions[s]&&e.set(s,r[s])}catch(i){i.fileOperationResult!==1&&this.logService.error("[FilePolicyService] Failed to read policies",i)}return e}async refresh(){const e=await this.read(),i=O$(this.policies,e);this.policies=e,i.length>0&&this._onDidChange.fire(i)}},Rp=__decorate([__param(1,mt),__param(2,V)],Rp)}}),IP,Mp,Ba,DP,N$=g({"out-build/vs/base/common/skipList.js"(){"use strict";Mp=class{constructor(t,e,i){this.level=t,this.key=e,this.value=i,this.forward=[]}},Ba=void 0,DP=class qa{constructor(e,i=2**16){this.comparator=e,this[IP]="SkipList",this._level=0,this._size=0,this._maxLevel=Math.max(1,Math.log2(i)|0),this._header=new Mp(this._maxLevel,Ba,Ba)}get size(){return this._size}clear(){this._header=new Mp(this._maxLevel,Ba,Ba),this._size=0}has(e){return!!qa._search(this,e,this.comparator)}get(e){return qa._search(this,e,this.comparator)?.value}set(e,i){return qa._insert(this,e,i,this.comparator)&&(this._size+=1),this}delete(e){const i=qa._delete(this,e,this.comparator);return i&&(this._size-=1),i}forEach(e,i){let r=this._header.forward[0];for(;r;)e.call(i,r.value,r.key,this),r=r.forward[0]}[(IP=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*entries(){let e=this._header.forward[0];for(;e;)yield[e.key,e.value],e=e.forward[0]}*keys(){let e=this._header.forward[0];for(;e;)yield e.key,e=e.forward[0]}*values(){let e=this._header.forward[0];for(;e;)yield e.value,e=e.forward[0]}toString(){let e="[SkipList]:",i=this._header.forward[0];for(;i;)e+=`node(${i.key}, ${i.value}, lvl:${i.level})`,i=i.forward[0];return e}static _search(e,i,r){let s=e._header;for(let n=e._level-1;n>=0;n--)for(;s.forward[n]&&r(s.forward[n].key,i)<0;)s=s.forward[n];if(s=s.forward[0],s&&r(s.key,i)===0)return s}static _insert(e,i,r,s){const n=[];let o=e._header;for(let a=e._level-1;a>=0;a--){for(;o.forward[a]&&s(o.forward[a].key,i)<0;)o=o.forward[a];n[a]=o}if(o=o.forward[0],o&&s(o.key,i)===0)return o.value=r,!1;{const a=qa._randomLevel(e);if(a>e._level){for(let c=e._level;c<a;c++)n[c]=e._header;e._level=a}o=new Mp(a,i,r);for(let c=0;c<a;c++)o.forward[c]=n[c].forward[c],n[c].forward[c]=o;return!0}}static _randomLevel(e,i=.5){let r=1;for(;Math.random()<i&&r<e._maxLevel;)r+=1;return r}static _delete(e,i,r){const s=[];let n=e._header;for(let o=e._level-1;o>=0;o--){for(;n.forward[o]&&r(n.forward[o].key,i)<0;)n=n.forward[o];s[o]=n}if(n=n.forward[0],!n||r(n.key,i)!==0)return!1;for(let o=0;o<e._level&&s[o].forward[o]===n;o++)s[o].forward[o]=n.forward[o];for(;e._level>0&&e._header.forward[e._level-1]===Ba;)e._level-=1;return!0}}}}),d0,uu,U$=g({"out-build/vs/platform/uriIdentity/common/uriIdentityService.js"(){"use strict";Vr(),uE(),Ze(),gt(),N$(),q(),L(),d0=class T0{static{this._clock=0}constructor(e){this.uri=e,this.time=T0._clock++}touch(){return this.time=T0._clock++,this}},uu=class{constructor(e){this._fileService=e,this._dispooables=new ke,this._limit=2**16;const i=new Map,r=s=>{let n=i.get(s.scheme);return n===void 0&&(n=e.hasProvider(s)&&!this._fileService.hasCapability(s,1024),i.set(s.scheme,n)),n};this._dispooables.add(P.any(e.onDidChangeFileSystemProviderRegistrations,e.onDidChangeFileSystemProviderCapabilities)(s=>{i.delete(s.scheme)})),this.extUri=new Mc(r),this._canonicalUris=new DP((s,n)=>this.extUri.compare(s,n,!0),this._limit)}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(e){this._fileService.hasProvider(e)&&(e=zg(e));const i=this._canonicalUris.get(e);return i?i.touch().uri.with({fragment:e.fragment}):(this._canonicalUris.set(e,new d0(e)),this._checkTrim(),e)}_checkTrim(){if(this._canonicalUris.size<this._limit)return;const e=[...this._canonicalUris.entries()].sort((r,s)=>r[1].time<s[1].time?1:r[1].time>s[1].time?-1:0);d0._clock=0,this._canonicalUris.clear();const i=this._limit*.5;for(let r=0;r<i;r++)this._canonicalUris.set(e[r][0],e[r][1].touch())}},uu=__decorate([__param(0,mt)],uu),aE(Mi,uu,1)}}),AP,$$=g({"out-build/vs/platform/log/common/logService.js"(){"use strict";L(),K(),AP=class extends N{constructor(t,e=[]){super(),this.logger=new Tb([t,...e]),this._register(t.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(t){this.logger.setLevel(t)}getLevel(){return this.logger.getLevel()}trace(t,...e){this.logger.trace(t,...e)}debug(t,...e){this.logger.debug(t,...e)}info(t,...e){this.logger.info(t,...e)}warn(t,...e){this.logger.warn(t,...e)}error(t,...e){this.logger.error(t,...e)}flush(){this.logger.flush()}}}}),RP,B$=g({"out-build/vs/platform/userData/common/fileUserDataProvider.js"(){"use strict";q(),L(),Ze(),Tn(),ai(),RP=class extends N{constructor(t,e,i,r,s,n){super(),this.fileSystemScheme=t,this.fileSystemProvider=e,this.userDataScheme=i,this.userDataProfilesService=r,this.uriIdentityService=s,this.logService=n,this.capabilities=this.fileSystemProvider.capabilities,this.onDidChangeCapabilities=this.fileSystemProvider.onDidChangeCapabilities,this._onDidChangeFile=this._register(new D),this.onDidChangeFile=this._onDidChangeFile.event,this.watchResources=Es.forUris(()=>!(this.capabilities&1024)),this.atomicReadWriteResources=new fg(o=>this.uriIdentityService.extUri.getComparisonKey(this.toFileSystemResource(o))),this.updateAtomicReadWritesResources(),this._register(r.onDidChangeProfiles(()=>this.updateAtomicReadWritesResources())),this._register(this.fileSystemProvider.onDidChangeFile(o=>this.handleFileChanges(o)))}updateAtomicReadWritesResources(){this.atomicReadWriteResources.clear();for(const t of this.userDataProfilesService.profiles)this.atomicReadWriteResources.add(t.settingsResource),this.atomicReadWriteResources.add(t.keybindingsResource),this.atomicReadWriteResources.add(t.tasksResource),this.atomicReadWriteResources.add(t.extensionsResource)}open(t,e){return this.fileSystemProvider.open(this.toFileSystemResource(t),e)}close(t){return this.fileSystemProvider.close(t)}read(t,e,i,r,s){return this.fileSystemProvider.read(t,e,i,r,s)}write(t,e,i,r,s){return this.fileSystemProvider.write(t,e,i,r,s)}watch(t,e){this.watchResources.set(t,t);const i=this.fileSystemProvider.watch(this.toFileSystemResource(t),e);return me(()=>{this.watchResources.delete(t),i.dispose()})}stat(t){return this.fileSystemProvider.stat(this.toFileSystemResource(t))}mkdir(t){return this.fileSystemProvider.mkdir(this.toFileSystemResource(t))}rename(t,e,i){return this.fileSystemProvider.rename(this.toFileSystemResource(t),this.toFileSystemResource(e),i)}readFile(t,e){return this.fileSystemProvider.readFile(this.toFileSystemResource(t),e)}readFileStream(t,e,i){return this.fileSystemProvider.readFileStream(this.toFileSystemResource(t),e,i)}readdir(t){return this.fileSystemProvider.readdir(this.toFileSystemResource(t))}enforceAtomicReadFile(t){return this.atomicReadWriteResources.has(t)}writeFile(t,e,i){return this.fileSystemProvider.writeFile(this.toFileSystemResource(t),e,i)}enforceAtomicWriteFile(t){return this.atomicReadWriteResources.has(t)?{postfix:".vsctmp"}:!1}delete(t,e){return this.fileSystemProvider.delete(this.toFileSystemResource(t),e)}copy(t,e,i){if(Im(this.fileSystemProvider))return this.fileSystemProvider.copy(this.toFileSystemResource(t),this.toFileSystemResource(e),i);throw new Error("copy not supported")}cloneFile(t,e){if(jb(this.fileSystemProvider))return this.fileSystemProvider.cloneFile(this.toFileSystemResource(t),this.toFileSystemResource(e));throw new Error("clone not supported")}handleFileChanges(t){const e=[];for(const i of t){if(i.resource.scheme!==this.fileSystemScheme)continue;const r=this.toUserDataResource(i.resource);this.watchResources.findSubstr(r)&&e.push({resource:r,type:i.type,cId:i.cId})}e.length&&(this.logService.debug("User data changed"),this._onDidChangeFile.fire(e))}toFileSystemResource(t){return t.with({scheme:this.fileSystemScheme})}toUserDataResource(t){return t.with({scheme:this.userDataScheme})}}}}),MP,TP,Tp,j$=g({"out-build/vs/platform/tracing/common/spanCollector.js"(){"use strict";MP=1e3,TP=class{constructor(){this._buffer=[],this._dropped=0,this._maxBuffer=MP}configure(t){t.maxBuffer!==void 0&&(this._maxBuffer=t.maxBuffer)}collect(t){if(!t)return;const e=this._convert(t);this._buffer.length<this._maxBuffer?this._buffer.push(e):this._dropped++}takeAll(){const t=this._buffer,e=this._dropped;return this._buffer=[],this._dropped=0,{spans:t,dropped:e}}_convert(t){return{traceId:t.traceId,spanId:t.spanId,parentSpanId:t.parentSpanId,name:t.name,startTime:t.startTime,endTime:t.endTime??Date.now(),attributes:t.attributes,error:t.status?.code===2,traceState:t.traceState,flags:t.traceFlags,kind:t.kind,statusCode:t.status?.code,statusMessage:t.status?.message,links:t.links.map(e=>({traceId:e.traceId,spanId:e.spanId,attributes:e.attributes,traceState:e.traceState,flags:e.flags}))}}_convertAttributes(t){const e={};for(const[i,r]of Object.entries(t))e[i]=String(r);return e}},Tp=new TP}});function WP(t){const e=new Uint8Array(t/2);return crypto.getRandomValues(e),Array.from(e,i=>i.toString(16).padStart(2,"0")).join("")}function h0(t,e){return new LP({name:t,kind:e})}function f0(t,e,i){return t.createChild(e,i)}var du,Wp,LP,H$=g({"out-build/vs/platform/tracing/common/span.js"(){"use strict";(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.INTERNAL=1]="INTERNAL",t[t.SERVER=2]="SERVER",t[t.CLIENT=3]="CLIENT",t[t.PRODUCER=4]="PRODUCER",t[t.CONSUMER=5]="CONSUMER"})(du||(du={})),(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Wp||(Wp={})),LP=class O8{constructor(e){this._attributes={},this._kind=du.INTERNAL,this._links=[],this._traceFlags=1,this._ended=!1,this._name=e.name,this._traceId=e.traceId||this._generateTraceId(),this._spanId=e.spanId||this._generateSpanId(),this._parentSpanId=e.parentSpanId,this._kind=e.kind||du.INTERNAL,this._startTime=e.startTime||Date.now()}spanContext(){return{traceId:this._traceId,spanId:this._spanId,traceFlags:this._traceFlags,traceState:this._traceState,isRemote:!1}}end(e){this._ended||(this._endTime=e||Date.now(),this._ended=!0)}setAttribute(e,i){return i===void 0?delete this._attributes[e]:this._attributes[e]=String(i),this}setAttributes(e){for(const[i,r]of Object.entries(e))this.setAttribute(i,r);return this}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this}isRecording(){return!this._ended}addLink(e){return this._links.push(e),this}createChild(e,i){return new O8({name:e,traceId:this._traceId,parentSpanId:this._spanId,kind:i||du.INTERNAL})}get name(){return this._name}get traceId(){return this._traceId}get spanId(){return this._spanId}get parentSpanId(){return this._parentSpanId}get startTime(){return this._startTime}get endTime(){return this._endTime}get attributes(){return{...this._attributes}}get status(){return this._status}get kind(){return this._kind}get links(){return[...this._links]}get traceState(){return this._traceState}get traceFlags(){return this._traceFlags}get ended(){return this._ended}_generateTraceId(){return WP(32)}_generateSpanId(){return WP(16)}addEvent(e){return this}addLinks(e){return this}recordException(e,i){}}}});function p0(){return!Yt().enabled}function OP(t,e,i){if(t.setAttribute("cursor.eventType",e),!!i)for(const[r,s]of Object.entries(i))t.setAttribute(r,s===void 0?"undefined":s)}function FP(t,e){let i;return e?i=f0(e,t):i=h0(t),new jP(i)}function NP(t){p0()||Ru(t)||Tr.isErrorNoTelemetry(t)||fr().captureException(t)}var UP,$P,g0,BP,V$,jP,q$=g({"out-build/vs/platform/tracing/common/tracing.js"(){"use strict";ae(),Re(),Xa(),jw(),j$(),H$(),typeof Symbol.dispose!="symbol"&&Object.defineProperty(Symbol,"dispose",{value:Symbol("Symbol.dispose")}),typeof Symbol.asyncDispose!="symbol"&&Object.defineProperty(Symbol,"asyncDispose",{value:Symbol("Symbol.asyncDispose")}),g0="__tracingCtx",BP=class F8{constructor(){this[UP]=!0}spanContext(){}setAttribute(e,i){}setError(e){}end(){}startSpan(e){return new F8}startSpanClosure(e,i){return i()}reportEvent(e,i){}reportException(e,i){}[(UP=g0,Symbol.dispose)](){}},V$=new BP,jP=class{constructor(t){this[$P]=!0,this._ended=!1,this._span=t}end(){this._ended||(this._span?.end(),Tp.collect(this._span),this._ended=!0)}spanContext(){const t=this._span?.spanContext();if(t)return{traceId:t.traceId,spanId:t.spanId,traceFlags:t.traceFlags}}setAttribute(t,e){this._span?.setAttribute(t,e)}setError(t){if(!this._span)return;let e="internal_error";t instanceof Error?(e=t.message||e,this._span.setAttribute("error.stack",t.stack??""),this._span.setAttribute("error.type",t.name??t.constructor?.name??"Error")):typeof t=="string"?e=t:t!=null&&(e=String(t)),this._span.setAttribute("error.message",e),this._span.setStatus({code:Wp.ERROR,message:e})}startSpan(t){return FP(t,this._span)}startSpanClosure(t,e){const i={stack:[],error:void 0,hasError:!1};try{const r=__addDisposableResource(i,FP(t,this._span),!1);return e()}catch(r){i.error=r,i.hasError=!0}finally{__disposeResources(i)}}reportEvent(t,e){if(p0())return;const i=this._span?f0(this._span,t):h0(t);OP(i,"event",e),i.end(),Tp.collect(i)}reportException(t,e){if(p0())return;const i=this._span?f0(this._span,"exception"):h0("exception");let r="internal_error",s="",n="Error";t instanceof Error?(r=t.message||r,s=t.stack??"",n=t.name??t.constructor?.name??n):(r=String(t),n="StringError"),OP(i,"error",e),i.setAttribute("error.message",r),i.setAttribute("error.stack",s),i.setAttribute("error.type",n),i.setStatus({code:Wp.ERROR,message:r}),i.end(),Tp.collect(i)}[($P=g0,Symbol.dispose)](){this.end()}}}}),HP,z$=g({"out-build/vs/platform/tracing/common/logger.js"(){"use strict";Xa(),q$(),HP=class{constructor(t){this.baseLogger=t,this.onDidChangeLogLevel=this.baseLogger.onDidChangeLogLevel}getLevel(){return this.baseLogger.getLevel()}setLevel(t){this.baseLogger.setLevel(t)}trace(t,...e){this.baseLogger.trace(t,...e)}debug(t,...e){this.baseLogger.debug(t,...e)}info(t,...e){this.baseLogger.info(t,...e)}warn(t,...e){this.baseLogger.warn(t,...e)}error(t,...e){if(this.baseLogger.error(t,...e),!(!Yt().enabled||Math.random()>=Yt().loggerSampleRate)){if(t instanceof Error){NP(t);return}for(const i of e)if(i instanceof Error){NP(i);return}}}flush(){this.baseLogger.flush()}dispose(){this.baseLogger.dispose()}}}}),G$={};import{app as K$,dialog as Y$}from"electron";import{unlinkSync as J$,promises as VP}from"fs";var qP,zP,Q$=g({"out-build/vs/code/electron-main/main.js"(){"use strict";MC(),re(),Wt(),ae(),In(),Re(),Bi(),q(),qs(),Ie(),ye(),ls(),z(),Wr(),jt(),qt(),Er(),um(),WU(),we(),Xe(),OU(),$U(),ct(),al(),VU(),Ze(),GU(),Y1(),Ih(),YU(),J1(),ft(),JU(),K(),Sl(),lt(),_l(),XU(),uP(),b$(),Rs(),M$(),mv(),W$(),Vi(),Zn(),qc(),$n(),Xr(),L$(),F$(),L(),Vr(),U$(),Dl(),$$(),C2(),l2(),B$(),Ja(),z$(),qP=class{main(){try{this.startup()}catch(t){console.error(t.message),K$.exit(1)}}async startup(){wy(c=>console.error(c));const[t,e,i,r,s,n,o,a]=this.createServices();try{try{await this.initServices(i,a,r,s,o)}catch(c){throw this.handleStartupDataDirError(i,o,c),c}await t.invokeFunction(async c=>{const l=c.get(V),u=c.get(ze),d=c.get(mt),f=c.get(Bc),p=await this.claimInstance(l,i,u,t,o,!0);te.writeFile(i.mainLockfile,String(process.pid)).catch(m=>{l.warn(`app#startup(): Error writing main lockfile: ${m.stack}`)});const v=f.createLogger("main",{name:w(156,null)});return n.logger=new HP(v),P.once(u.onWillShutdown)(m=>{d.dispose(),r.dispose(),m.join("instanceLockfile",VP.unlink(i.mainLockfile).catch(()=>{}))}),t.createInstance(fp,p,e).startup()})}catch(c){t.invokeFunction(this.quit,c)}}createServices(){const t=new Dh,e=new ke;process.once("exit",()=>e.dispose());const i={_serviceBrand:void 0,...Qr};t.set(qe,i);const r=new bs(this.resolveArgs(),i),s=this.patchEnvironment(r);t.set(st,r);const n=new AE(t3(r),r.logsHome);t.set(ya,n);const o=new oP(n.getLogLevel()),a=e.add(new AP(o,[new Mb(n.getLogLevel())]));t.set(V,a);const c=new vp(a);t.set(mt,c);const l=new Ch(a);c.registerProvider(T.file,l);const u=new uu(c);t.set(Mi,u);const d=new s1(1,r,a,c);t.set(Rm,d),t.set(Ii,d);const f=new zd(d,u,r,c,a);t.set(Gr,f),c.registerProvider(T.vscodeUserData,new RP(T.file,l,T.vscodeUserData,f,u,a));let p;B&&i.win32RegValueName?p=e.add(new lu(a,i.win32RegValueName)):O&&i.darwinBundleIdentifier?p=e.add(new lu(a,i.darwinBundleIdentifier)):r.policyFile?p=e.add(new Rp(r.policyFile,c,a)):p=new hv,t.set(Xn,p);const v=new Z7(f.defaultProfile.settingsResource,c,p,a);return t.set(Qe,v),t.set(ze,new se(Wd,void 0,!1)),t.set(As,new se(Ap,void 0,!0)),t.set(Jo,new se(Rd)),t.set(Sa,new se(CP,void 0,!1)),t.set(aP,new se(cu)),t.set(va,new yp(r,f,a)),[new sP(t,!0),s,r,v,d,o,i,f]}patchEnvironment(t){const e={VSCODE_IPC_HOOK:t.mainIPCHandle};return["VSCODE_NLS_CONFIG","VSCODE_PORTABLE"].forEach(i=>{const r=process.env[i];typeof r=="string"&&(e[i]=r)}),Object.assign(process.env,e),e}async initServices(t,e,i,r,s){await Ht.settled([Promise.all([this.allowWindowsUNCPath(t.extensionsPath),t.codeCachePath,t.logsHome.with({scheme:T.file}).fsPath,e.defaultProfile.globalStorageHome.with({scheme:T.file}).fsPath,t.workspaceStorageHome.with({scheme:T.file}).fsPath,t.localHistoryHome.with({scheme:T.file}).fsPath,t.backupHome].map(n=>n?VP.mkdir(n,{recursive:!0}):void 0)),r.init(),i.initialize()]),e.init()}allowWindowsUNCPath(t){if(B){const e=Y0(t);e&&Ya(e)}return t}async claimInstance(t,e,i,r,s,n){let o;try{Ve("code/willStartMainServer"),o=await PI(e.mainIPCHandle),Ve("code/didStartMainServer"),P.once(i.onWillShutdown)(()=>o.dispose())}catch(a){if(a.code!=="EADDRINUSE")throw this.handleStartupDataDirError(e,s,a),a;let c;try{c=await xI(e.mainIPCHandle,"main")}catch(f){if(!n||B||f.code!=="ECONNREFUSED")throw f.code==="EPERM"&&this.showStartupWarningDialog(w(157,null,s.nameShort),w(158,null),s),f;try{J$(e.mainIPCHandle)}catch(p){throw t.warn("Could not delete obsolete instance handle",p),p}return this.claimInstance(t,e,i,r,s,!1)}if(e.extensionTestsLocationURI&&!e.debugExtensionHost.break){const f=`Running extension tests from the command line is currently only supported if no other instance of ${s.nameShort} is running.`;throw t.error(f),c.dispose(),new Error(f)}let l;!e.args.wait&&!e.args.status&&(l=setTimeout(()=>{this.showStartupWarningDialog(w(159,null,s.nameShort),w(160,null),s)},1e4));const u=Oe.toService(c.getChannel("launch"),{disableMarshalling:!0}),d=Oe.toService(c.getChannel("diagnostics"),{disableMarshalling:!0});if(e.args.status)return r.invokeFunction(async()=>{const f=new mp(Al,s),p=await d.getMainDiagnostics(),v=await d.getRemoteDiagnostics({includeProcesses:!0,includeWorkspaceMetadata:!0}),m=await f.getDiagnostics(p,v);throw console.log(m),new Mu});throw B&&await this.windowsAllowSetForegroundWindow(u,t),t.trace("Sending env to running instance..."),await u.start(e.args,process.env),c.dispose(),l&&clearTimeout(l),new Mu("Sent env to running instance. Terminating...")}if(e.args.status)throw console.log(w(161,null,s.nameShort)),new Mu("Terminating...");return process.env.VSCODE_PID=String(process.pid),o}handleStartupDataDirError(t,e,i){if(i.code==="EACCES"||i.code==="EPERM"){const r=Dt([t.userDataPath,t.extensionsPath,dd]).map(s=>Lo(x.file(s),{os:Gi,tildify:t}));this.showStartupWarningDialog(w(162,null),w(163,null,rr(i),r.join(`
|
|
`)),e)}}showStartupWarningDialog(t,e,i){Y$.showMessageBoxSync(k2({type:"warning",buttons:[w(164,null)],message:t,detail:e},i).options)}async windowsAllowSetForegroundWindow(t,e){if(B){const i=await t.getMainProcessId();e.trace("Sending some foreground love to the running instance:",i);try{(await import("windows-foreground-love")).allowSetForegroundWindow(i)}catch(r){e.error(r)}}}quit(t,e){const i=t.get(V),r=t.get(ze);let s=0;e&&(e.isExpected?e.message&&i.trace(e.message):(s=1,e.stack?i.error(e.stack):i.error(`Startup error: ${e.toString()}`))),r.kill(s)}resolveArgs(){const t=this.validatePaths(MD(process.argv));if(t.wait&&!t.waitMarkerFilePath){const e=HU(t.verbose);e&&(TD(process.argv,"--waitMarkerFilePath",e),t.waitMarkerFilePath=e)}return t}validatePaths(t){if(t["open-url"]&&(t._urls=t._,t._=[]),!t.remote){const e=this.doValidatePaths(t._,t.goto);t._=e}return t}doValidatePaths(t,e){const i=fs(),r=t.map(o=>{let a=String(o),c;e&&(c=Qu(a),a=c.path),a&&(a=this.preparePath(i,a));const l=qS(a,i),u=tt(l);return u&&!LC(u)?null:e&&c?(c.path=l,this.toPath(c)):l}),s=B||O,n=ds(r,o=>o&&s?o.toLowerCase():o||"");return Dt(n)}preparePath(t,e){return B&&(e=Pn(e,'"')),e=cS(cS(e," ")," "),B&&(e=Jt(t,e),e=Pn(e,".")),e}toPath(t){const e=[t.path];return typeof t.line=="number"&&e.push(String(t.line)),typeof t.column=="number"&&e.push(String(t.column)),e.join(":")}},zP=new qP,zP.main()}});import*as Os from"path";import*as go from"original-fs";import*as X$ from"os";import{performance as Z$}from"perf_hooks";import*as mr from"path";import*as GP from"fs";import{fileURLToPath as eB}from"url";import{createRequire as tB}from"node:module";var Cq=tB(import.meta.url),iB=mr.dirname(eB(import.meta.url)),Iq=process.platform==="win32";if(Error.stackTraceLimit=100,!process.env.VSCODE_HANDLES_SIGPIPE){let t=!1;process.on("SIGPIPE",()=>{t||(t=!0,console.error(new Error("Unexpected SIGPIPE")))})}function rB(){try{typeof process.env.VSCODE_CWD!="string"&&(process.env.VSCODE_CWD=process.cwd()),process.platform==="win32"&&process.chdir(mr.dirname(process.execPath))}catch(t){console.error(t)}}rB();function sB(t){const e=mr.dirname(iB);function i(){return process.env.VSCODE_DEV?e:process.platform==="darwin"?mr.dirname(mr.dirname(mr.dirname(e))):mr.dirname(mr.dirname(e))}function r(){if(process.env.VSCODE_PORTABLE)return process.env.VSCODE_PORTABLE;if(process.platform==="win32"||process.platform==="linux")return mr.join(i(),"data");const c=t.portable||`${t.applicationName}-portable-data`;return mr.join(mr.dirname(i()),c)}const s=r(),n=!("target"in t)&&GP.existsSync(s),o=mr.join(s,"tmp"),a=n&&GP.existsSync(o);return n?process.env.VSCODE_PORTABLE=s:delete process.env.VSCODE_PORTABLE,a&&(process.platform==="win32"?(process.env.TMP=o,process.env.TEMP=o):process.env.TMPDIR=o),{portableDataPath:s,isPortable:n}}import*as nB from"path";import*as m0 from"fs";import{fileURLToPath as oB}from"url";import{createRequire as aB,register as cB}from"node:module";import{createRequire as lB}from"node:module";var v0=lB(import.meta.url),ja={BUILD_INSERT_PRODUCT_CONFIGURATION:"BUILD_INSERT_PRODUCT_CONFIGURATION"};ja.BUILD_INSERT_PRODUCT_CONFIGURATION&&(ja=v0("../product.json"));var w0={"name":"Cursor","version":"1.6.23","distro":"21c8d8ea1e46d97c5639a7cabda6c0e063cc8dd5","author":{"name":"Anysphere, Inc."},"main":"./out/main.js","type":"module","private":true,"repository":{"type":"git","url":"https://github.com/microsoft/vscode.git"},"bugs":{"url":"https://github.com/microsoft/vscode/issues"}};w0.BUILD_INSERT_PACKAGE_CONFIGURATION&&(w0=v0("../package.json"));var vi=ja,uB=w0;if(!("commit"in ja)||ja.commit===void 0)try{const{execSync:t}=v0("child_process"),e=process.cwd(),i=t("git rev-parse HEAD",{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();i&&(ja.devCommit=i)}catch{}ls();var dB=aB(import.meta.url),hB=nB.dirname(oB(import.meta.url));if((process.env.ELECTRON_RUN_AS_NODE||process.versions.electron)&&cB(`data:text/javascript;base64,${Buffer.from(`
|
|
export async function resolve(specifier, context, nextResolve) {
|
|
if (specifier === 'fs') {
|
|
return {
|
|
format: 'builtin',
|
|
shortCircuit: true,
|
|
url: 'node:original-fs'
|
|
};
|
|
}
|
|
|
|
// Defer to the next hook in the chain, which would be the
|
|
// Node.js default resolve if this is the last user-specified loader.
|
|
return nextResolve(specifier, context);
|
|
}`).toString("base64")}`,import.meta.url),globalThis._VSCODE_PRODUCT_JSON={...vi},process.env.VSCODE_DEV)try{const t=dB("../product.overrides.json");globalThis._VSCODE_PRODUCT_JSON=Object.assign(globalThis._VSCODE_PRODUCT_JSON,t)}catch{}globalThis._VSCODE_PACKAGE_JSON={...uB},globalThis._VSCODE_FILE_ROOT=hB;var y0=void 0;function fB(){return y0||(y0=pB()),y0}async function pB(){Ve("code/willLoadNls");let t,e;if(process.env.VSCODE_NLS_CONFIG)try{t=JSON.parse(process.env.VSCODE_NLS_CONFIG),t?.languagePack?.messagesFile?e=t.languagePack.messagesFile:t?.defaultMessagesFile&&(e=t.defaultMessagesFile),globalThis._VSCODE_NLS_LANGUAGE=t?.resolvedLanguage}catch(i){console.error(`Error reading VSCODE_NLS_CONFIG from environment: ${i}`)}if(!(process.env.VSCODE_DEV||!e)){try{globalThis._VSCODE_NLS_MESSAGES=JSON.parse((await m0.promises.readFile(e)).toString())}catch(i){if(console.error(`Error reading NLS messages file ${e}: ${i}`),t?.languagePack?.corruptMarkerFile)try{await m0.promises.writeFile(t.languagePack.corruptMarkerFile,"corrupted")}catch(r){console.error(`Error writing corrupted NLS marker file: ${r}`)}if(t?.defaultMessagesFile&&t.defaultMessagesFile!==e)try{globalThis._VSCODE_NLS_MESSAGES=JSON.parse((await m0.promises.readFile(t.defaultMessagesFile)).toString())}catch(r){console.error(`Error reading default NLS messages file ${t.defaultMessagesFile}: ${r}`)}}return Ve("code/didLoadNls"),t}}async function gB(){await fB()}var mB=U0($0(),1);import{fileURLToPath as vB}from"url";import{app as Le,protocol as wB,crashReporter as yB,Menu as SB,contentTracing as _B}from"electron";import{networkInterfaces as bB}from"os";import{createHash as EB,randomUUID as kB}from"crypto";import"node-fetch";var PB=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function xB(t){const e=t.replace(/\-/g,":").toLowerCase();return!PB.has(e)}function CB(){const t=bB();for(const e in t){const i=t[e];if(i){for(const{mac:r}of i)if(xB(r))return r}}throw new Error("Unable to retrieve mac address (unexpected format)")}function IB(t){try{const e=CB();return EB("sha256").update(e,"utf8").digest("hex")}catch(e){return t(e),kB()}}H0(),G0(),ls(),ls();import*as is from"path";import*as rs from"fs";async function KP({userLocale:t,osLocale:e,userDataPath:i,commit:r,nlsMetadataPath:s}){if(Ve("code/willGenerateNls"),process.env.VSCODE_DEV||t==="pseudo"||t.startsWith("en")||!r||!i)return hu(t,e,s);try{const n=await DB(i);if(!n)return hu(t,e,s);const o=AB(n,t);if(!o)return hu(t,e,s);const a=n[o],c=a?.translations?.vscode;if(!a||typeof a.hash!="string"||!a.translations||typeof c!="string"||!await S0(c))return hu(t,e,s);const l=`${a.hash}.${o}`,u=is.join(i,"clp",l),d=is.join(u,r),f=is.join(d,"nls.messages.json"),p=is.join(u,"tcf.json"),v=is.join(u,"corrupted.info");await S0(v)&&await rs.promises.rm(u,{recursive:!0,force:!0,maxRetries:3});const m={userLocale:t,osLocale:e,resolvedLanguage:o,defaultMessagesFile:is.join(s,"nls.messages.json"),languagePack:{translationsConfigFile:p,messagesFile:f,corruptMarkerFile:v},locale:t,availableLanguages:{"*":o},_languagePackId:l,_languagePackSupport:!0,_translationsConfigFile:p,_cacheRoot:u,_resolvedLanguagePackCoreLocation:d,_corruptedFile:v};if(await S0(d))return RB(d).catch(()=>{}),Ve("code/didGenerateNls"),m;const[,y,S,E]=await Promise.all([rs.promises.mkdir(d,{recursive:!0}),JSON.parse(await rs.promises.readFile(is.join(s,"nls.keys.json"),"utf-8")),JSON.parse(await rs.promises.readFile(is.join(s,"nls.messages.json"),"utf-8")),JSON.parse(await rs.promises.readFile(c,"utf-8"))]),k=[];let R=0;for(const[C,M]of y){const J=E.contents[C];for(const ne of M)k.push(J?.[ne]||S[R]),R++}return await Promise.all([rs.promises.writeFile(f,JSON.stringify(k),"utf-8"),rs.promises.writeFile(p,JSON.stringify(a.translations),"utf-8")]),Ve("code/didGenerateNls"),m}catch(n){console.error("Generating translation files failed.",n)}return hu(t,e,s)}async function DB(t){const e=is.join(t,"languagepacks.json");try{return JSON.parse(await rs.promises.readFile(e,"utf-8"))}catch{return}}function AB(t,e){try{for(;e;){if(t[e])return e;const i=e.lastIndexOf("-");if(i>0)e=e.substring(0,i);else return}}catch(i){console.error("Resolving language pack configuration failed.",i)}}function hu(t,e,i){return Ve("code/didGenerateNls"),{userLocale:t,osLocale:e,resolvedLanguage:"en",defaultMessagesFile:is.join(i,"nls.messages.json"),locale:t,availableLanguages:{}}}async function S0(t){try{return await rs.promises.access(t),!0}catch{return!1}}function RB(t){const e=new Date;return rs.promises.utimes(t,e,e)}Ja();import{createRequire as MB}from"module";Xa();import*as zi from"@sentry/electron/main";import TB from"electron";function WB(){try{zi.init({...nx(),environment:TB.app.isPackaged?globalThis._VSCODE_PRODUCT_JSON.applicationName:"development",integrations:[zi.sentryMinidumpIntegration(),zi.electronContextIntegration(),zi.normalizePathsIntegration(),zi.additionalContextIntegration(),zi.eventFiltersIntegration(),zi.functionToStringIntegration(),zi.linkedErrorsIntegration(),zi.dedupeIntegration(),zi.nodeContextIntegration({cloudResource:!1}),zi.mainProcessSessionIntegration({sendOnCreate:!0})],beforeSend:t=>(zi.startSpan({name:"error-span",attributes:{"error.message":t.message,"error.trace_id":t.contexts?.trace?.trace_id,"error.event_id":t.event_id}},()=>{}),t)}),Yt().sentry=zi,process.env.CURSOR_TRACE_ID=zi.getCurrentScope().getPropagationContext().traceId}catch(t){console.error("Failed to initialize tracing in main process",t)}}WB();var $q=MB(import.meta.url),_0=Os.dirname(vB(import.meta.url));Ve("code/didStartMain"),Ve("code/willLoadMainBundle",{startTime:Math.floor(Z$.timeOrigin)}),Ve("code/didLoadMainBundle");var YP=sB(vi),Bq=IB(console.error),jq=vi.dataFolderName??".cursor",Ji=jB(),Lp=OB(Ji);Ji.sandbox&&!Ji["disable-chromium-sandbox"]&&!Lp["disable-chromium-sandbox"]?Le.enableSandbox():Le.commandLine.hasSwitch("no-sandbox")&&!Le.commandLine.hasSwitch("disable-gpu-sandbox")?Le.commandLine.appendSwitch("disable-gpu-sandbox"):(Le.commandLine.appendSwitch("no-sandbox"),Le.commandLine.appendSwitch("disable-gpu-sandbox")),Le.commandLine.appendSwitch("force-gpu-mem-available-mb","1024");var Ha=q0(Ji,vi.nameShort??"code-oss-dev");if(process.platform==="win32"){const t=Y0(Ha);t&&Ya(t)}Le.setPath("userData",Ha);var JP=VB();SB.setApplicationMenu(null),Ve("code/willStartCrashReporter"),(Ji["crash-reporter-directory"]||Lp["enable-crash-reporter"]&&!Ji["disable-crash-reporter"])&&$B(),Ve("code/didStartCrashReporter"),YP&&YP.isPortable&&Le.setAppLogsPath(Os.join(Ha,"logs")),wB.registerSchemesAsPrivileged([{scheme:"vscode-webview",privileges:{standard:!0,secure:!0,supportFetchAPI:!0,corsEnabled:!0,allowServiceWorkers:!0,codeCache:!0}},{scheme:"vscode-file",privileges:{secure:!0,standard:!0,supportFetchAPI:!0,corsEnabled:!0,codeCache:!0}}]),HB();var b0=void 0,E0=XP((Le.getPreferredSystemLanguages()?.[0]??"en").toLowerCase()),fu=GB(Lp);if(fu&&(b0=KP({userLocale:fu,osLocale:E0,commit:vi.commit,userDataPath:Ha,nlsMetadataPath:_0})),process.platform==="win32"||process.platform==="linux"){const t=!fu||fu==="qps-ploc"?"en":fu;Le.commandLine.appendSwitch("lang",t)}Le.once("ready",function(){if(Ji.trace){let t;if(Ji["trace-memory-infra"]){const e=Ji["trace-category-filter"]?.split(",")||[];e.push("disabled-by-default-memory-infra","disabled-by-default-memory-infra.v8.code_stats"),t={included_categories:e,excluded_categories:["*"],memory_dump_config:{allowed_dump_modes:["light","detailed"],triggers:[{type:"periodic_interval",mode:"detailed",min_time_between_dumps_ms:1e4},{type:"periodic_interval",mode:"light",min_time_between_dumps_ms:1e3}]}}}else t={categoryFilter:Ji["trace-category-filter"]||"*",traceOptions:Ji["trace-options"]||"record-until-full,enable-sampling"};_B.startRecording(t).finally(()=>QP())}else QP()});async function QP(){Ve("code/mainAppReady");try{const[,t]=await Promise.all([qB(JP),zB()]);await LB(JP,t)}catch(t){console.error(t)}}async function LB(t,e){process.env.VSCODE_NLS_CONFIG=JSON.stringify(e),process.env.VSCODE_CODE_CACHE_PATH=t||"",await gB(),await Promise.resolve().then(()=>(Q$(),G$)),Ve("code/didRunMainBundle")}function OB(t){const e=["disable-hardware-acceleration","force-color-profile","disable-lcd-text","proxy-bypass-list"];process.platform==="linux"&&(e.push("force-renderer-accessibility"),e.push("password-store"));const i=["enable-proposed-api","log-level","use-inmemory-secretstorage"],r=FB();Object.keys(r).forEach(c=>{const l=r[c];if(e.indexOf(c)!==-1){if(l===!0||l==="true")c==="disable-hardware-acceleration"?Le.disableHardwareAcceleration():Le.commandLine.appendSwitch(c);else if(typeof l=="string"&&l)if(c==="password-store"){let u=l;(l==="gnome"||l==="gnome-keyring")&&(u="gnome-libsecret"),Le.commandLine.appendSwitch(c,u)}else Le.commandLine.appendSwitch(c,l)}else if(i.indexOf(c)!==-1)switch(c){case"enable-proposed-api":Array.isArray(l)?l.forEach(u=>u&&typeof u=="string"&&process.argv.push("--enable-proposed-api",u)):console.error("Unexpected value for `enable-proposed-api` in argv.json. Expected array of extension ids.");break;case"log-level":if(typeof l=="string")process.argv.push("--log",l);else if(Array.isArray(l))for(const u of l)process.argv.push("--log",u);break;case"use-inmemory-secretstorage":l&&process.argv.push("--use-inmemory-secretstorage");break}});const s=`DocumentPolicyIncludeJSCallStacksInCrashReports, ${Le.commandLine.getSwitchValue("enable-features")}`;Le.commandLine.appendSwitch("enable-features",s);const n=`CalculateNativeWinOcclusion,PlzDedicatedWorker,${Le.commandLine.getSwitchValue("disable-features")}`;Le.commandLine.appendSwitch("disable-features",n);const o=`FontMatchingCTMigration,StandardizedBrowserZoom,${Le.commandLine.getSwitchValue("disable-blink-features")}`;Le.commandLine.appendSwitch("disable-blink-features",o);const a=BB(t);return a&&Le.commandLine.appendSwitch("js-flags",a),Le.commandLine.appendSwitch("xdg-portal-required-version","4"),r}function FB(){const t=UB();let e;try{e=B0(go.readFileSync(t).toString())}catch(i){i&&i.code==="ENOENT"?NB(t):console.warn(`Unable to read argv.json configuration file in ${t}, falling back to defaults (${i})`)}return e||(e={}),e}function NB(t){try{const e=Os.dirname(t);go.existsSync(e)||go.mkdirSync(e);const i=["// This configuration file allows you to pass permanent command line arguments to VS Code.","// Only a subset of arguments is currently supported to reduce the likelihood of breaking","// the installation.","//","// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT","//","// NOTE: Changing this file requires a restart of VS Code.","{"," // Use software rendering instead of hardware accelerated rendering."," // This can help in cases where you see rendering issues in VS Code.",' // "disable-hardware-acceleration": true',"}"];go.writeFileSync(t,i.join(`
|
|
`))}catch(e){console.error(`Unable to create argv.json configuration file in ${t}, falling back to defaults (${e})`)}}function UB(){const t=process.env.VSCODE_PORTABLE;if(t)return Os.join(t,"argv.json");let e=vi.dataFolderName;return process.env.VSCODE_DEV&&(e=`${e}-dev`),Os.join(X$.homedir(),e,"argv.json")}function $B(){let t=Ji["crash-reporter-directory"],e="";if(t){if(t=Os.normalize(t),Os.isAbsolute(t)||(console.error(`The path '${t}' specified for --crash-reporter-directory must be absolute.`),Le.exit(1)),!go.existsSync(t))try{go.mkdirSync(t,{recursive:!0})}catch{console.error(`The path '${t}' specified for --crash-reporter-directory does not seem to exist or cannot be created.`),Le.exit(1)}console.log(`Found --crash-reporter-directory argument. Setting crashDumps directory to be '${t}'`),Le.setPath("crashDumps",t)}else{const s=vi.appCenter;if(s){const n=process.platform==="win32",o=process.platform==="linux",a=process.platform==="darwin",c=Lp["crash-reporter-id"];if(c&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(c)){if(n)switch(process.arch){case"x64":e=s["win32-x64"];break;case"arm64":e=s["win32-arm64"];break}else if(a)if(vi.darwinUniversalAssetId)e=s["darwin-universal"];else switch(process.arch){case"x64":e=s.darwin;break;case"arm64":e=s["darwin-arm64"];break}else o&&(e=s["linux-x64"]);e=e.concat("&uid=",c,"&iid=",c,"&sid=",c);const u=process.argv,d=u.indexOf("--");d===-1?u.push("--crash-reporter-id",c):u.splice(d,0,"--crash-reporter-id",c)}}}const i=(vi.crashReporter?vi.crashReporter.productName:void 0)||vi.nameShort,r=(vi.crashReporter?vi.crashReporter.companyName:void 0)||"Anysphere";yB.start({companyName:r,productName:process.env.VSCODE_DEV?`${i} Dev`:i,submitURL:e,uploadToServer:!1,ignoreSystemCrashHandler:!1,extra:{platform:process.platform},compress:!0})}function BB(t){const e=[];return t["js-flags"]&&e.push(t["js-flags"]),process.platform==="linux"&&e.push("--nodecommit_pooled_pages"),e.length>0?e.join(" "):null}function jB(){return(0,mB.default)(process.argv,{string:["user-data-dir","locale","js-flags","crash-reporter-directory"],boolean:["disable-chromium-sandbox"],default:{sandbox:!0},alias:{"no-sandbox":"sandbox"}})}function HB(){const t=[];globalThis.macOpenFiles=t,Le.on("open-file",function(r,s){t.push(s)});const e=[],i=function(r,s){r.preventDefault(),e.push(s)};Le.on("will-finish-launching",function(){if(process.platform==="darwin"&&process.env.VSCODE_DEV){const r=vi.urlProtocol;r?Le.isDefaultProtocolClient(r)||Le.setAsDefaultProtocolClient(r,process.execPath,[])||console.error(`Failed to register '${r}' protocol handler.`):console.warn("No urlProtocol found in product configuration for development registration.")}Le.on("open-url",i)}),globalThis.getOpenUrls=function(){return Le.removeListener("open-url",i),e}}function VB(){if(process.argv.indexOf("--no-cached-data")>0||process.env.VSCODE_DEV)return;const t=vi.commit;if(t)return Os.join(Ha,"CachedData",t)}async function qB(t){if(typeof t=="string")try{return await go.promises.mkdir(t,{recursive:!0}),t}catch{}}function XP(t){if(t.startsWith("zh")){const e=t.split("-")[1];return["hans","cn","sg","my"].includes(e)?"zh-cn":"zh-tw"}return t}async function zB(){const t=b0?await b0:void 0;if(t)return t;let e=Le.getLocale();return e?(e=XP(e.toLowerCase()),KP({userLocale:e,osLocale:E0,commit:vi.commit,userDataPath:Ha,nlsMetadataPath:_0})):{userLocale:"en",osLocale:E0,resolvedLanguage:"en",defaultMessagesFile:Os.join(_0,"nls.messages.json"),locale:"en",availableLanguages:{}}}function GB(t){const e=Ji.locale;return e?e.toLowerCase():typeof t?.locale=="string"?t.locale.toLowerCase():void 0}
|
|
|
|
//# sourceMappingURL=http://go/sourcemap/sourcemaps/9b5f3f4f2368631e3455d37672ca61b6dce85430/core/main.js.map
|
|
|
|
//# debugId=73c2bdf7-6336-5928-8073-4ad5f10cff68
|