/*! For license information please see extension.js.LICENSE.txt */ (()=>{var e={69145:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionActivationManager=void 0;const o=r(86700),s=r(17585),a=r(77570),c=r(84974),u=r(19735),l=r(98634),h=r(90819);let p=class{constructor(e,t,r,n,i,o){this.activationServices=e,this.singleActivationServices=t,this.documentManager=r,this.workspaceService=n,this.fileSystem=i,this.activeResourceService=o,this.activatedWorkspaces=new Set,this.isInterpreterSetForWorkspacePromises=new Map,this.disposables=[],this.workspaceService.isTrusted||(this.activationServices=this.activationServices.filter((e=>e.supportedWorkspaceTypes.untrustedWorkspace)),this.singleActivationServices=this.singleActivationServices.filter((e=>e.supportedWorkspaceTypes.untrustedWorkspace))),this.workspaceService.isVirtualWorkspace&&(this.activationServices=this.activationServices.filter((e=>e.supportedWorkspaceTypes.virtualWorkspace)),this.singleActivationServices=this.singleActivationServices.filter((e=>e.supportedWorkspaceTypes.virtualWorkspace)))}dispose(){for(;this.disposables.length>0;)this.disposables.shift().dispose();this.docOpenedHandler&&(this.docOpenedHandler.dispose(),this.docOpenedHandler=void 0)}async activate(){await this.initialize(),await Promise.all([...this.singleActivationServices.map((e=>e.activate())),this.activateWorkspace(this.activeResourceService.getActiveResource())])}async activateWorkspace(e){const t=this.getWorkspaceKey(e);this.activatedWorkspaces.has(t)||(this.activatedWorkspaces.add(t),await(0,l.sendActivationTelemetry)(this.fileSystem,this.workspaceService,e),await Promise.all(this.activationServices.map((t=>t.activate(e)))))}async initialize(){this.addHandlers(),this.addRemoveDocOpenedHandlers()}onDocOpened(e){var t;if(e.languageId!==a.PYTHON_LANGUAGE)return;const r=this.getWorkspaceKey(e.uri),n=((null===(t=this.workspaceService.workspaceFolders)||void 0===t?void 0:t.length)||0)>0;if(""===r&&n)return;if(this.activatedWorkspaces.has(r))return;const i=this.workspaceService.getWorkspaceFolder(e.uri);this.activateWorkspace(i?i.uri:void 0).ignoreErrors()}addHandlers(){this.disposables.push(this.workspaceService.onDidChangeWorkspaceFolders(this.onWorkspaceFoldersChanged,this))}addRemoveDocOpenedHandlers(){this.hasMultipleWorkspaces()?this.docOpenedHandler||(this.docOpenedHandler=this.documentManager.onDidOpenTextDocument(this.onDocOpened,this)):this.docOpenedHandler&&(this.docOpenedHandler.dispose(),this.docOpenedHandler=void 0)}onWorkspaceFoldersChanged(){const e=this.workspaceService.workspaceFolders.map((e=>this.getWorkspaceKey(e.uri))),t=Array.from(this.activatedWorkspaces.keys()).filter((t=>e.indexOf(t)<0));if(t.length>0)for(const e of t)this.activatedWorkspaces.delete(e);this.addRemoveDocOpenedHandlers()}hasMultipleWorkspaces(){var e;return((null===(e=this.workspaceService.workspaceFolders)||void 0===e?void 0:e.length)||0)>1}getWorkspaceKey(e){return this.workspaceService.getWorkspaceFolderIdentifier(e,"")}};n([(0,u.traceDecoratorError)("Failed to activate a workspace")],p.prototype,"activateWorkspace",null),p=n([(0,o.injectable)(),i(0,(0,o.multiInject)(h.IExtensionActivationService)),i(1,(0,o.multiInject)(h.IExtensionSingleActivationService)),i(2,(0,o.inject)(s.IDocumentManager)),i(3,(0,o.inject)(s.IWorkspaceService)),i(4,(0,o.inject)(c.IFileSystem)),i(5,(0,o.inject)(s.IActiveResourceService))],p),t.ExtensionActivationManager=p},76546:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const n=r(69145),i=r(90819);t.registerTypes=function(e){e.add(i.IExtensionActivationManager,n.ExtensionActivationManager)}},90819:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IExtensionSingleActivationService=t.IExtensionActivationService=t.IExtensionActivationManager=void 0,t.IExtensionActivationManager=Symbol("IExtensionActivationManager"),t.IExtensionActivationService=Symbol("IExtensionActivationService"),t.IExtensionSingleActivationService=Symbol("IExtensionSingleActivationService")},17792:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ActiveResourceService=void 0;const o=r(86700),s=r(17585);let a=class{constructor(e,t){this.documentManager=e,this.workspaceService=t}getActiveResource(){const e=this.documentManager.activeTextEditor;return e&&!e.document.isUntitled?e.document.uri:Array.isArray(this.workspaceService.workspaceFolders)&&this.workspaceService.workspaceFolders.length>0?this.workspaceService.workspaceFolders[0].uri:void 0}};a=n([(0,o.injectable)(),i(0,(0,o.inject)(s.IDocumentManager)),i(1,(0,o.inject)(s.IWorkspaceService))],a),t.ActiveResourceService=a},18718:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ApplicationEnvironment=void 0;const o=r(86700),s=r(71017),a=r(36625),c=r(66828),u=r(84974),l=r(61684),h=r(87450);let p=class{constructor(e,t,r){this.platform=e,this.pathUtils=t,this.process=r}get userSettingsFile(){const e="insiders"===this.channel?"Code - Insiders":"Code";switch(this.platform.osType){case h.OSType.OSX:return s.join(this.pathUtils.home,"Library","Application Support",e,"User","settings.json");case h.OSType.Linux:return s.join(this.pathUtils.home,".config",e,"User","settings.json");case h.OSType.Windows:return this.process.env.APPDATA?s.join(this.process.env.APPDATA,e,"User","settings.json"):void 0;default:return}}get appName(){return c.env.appName}get vscodeVersion(){return c.version}get appRoot(){return c.env.appRoot}get uiKind(){return c.env.uiKind}get language(){return c.env.language}get sessionId(){return c.env.sessionId}get machineId(){return c.env.machineId}get extensionName(){return this.packageJson.displayName}get shell(){return c.env.shell}get packageJson(){return r(4147)}get channel(){return this.appName.indexOf("Insider")>0?"insiders":"stable"}get extensionChannel(){const e=(0,a.parse)(this.packageJson.version);return!e||e.prerelease.length>0||e.minor%2==1?"insiders":"stable"}get uriScheme(){return c.env.uriScheme}};p=n([(0,o.injectable)(),i(0,(0,o.inject)(u.IPlatformService)),i(1,(0,o.inject)(l.IPathUtils)),i(2,(0,o.inject)(l.ICurrentProcess))],p),t.ApplicationEnvironment=p},13706:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ApplicationShell=void 0;const i=r(86700),o=r(66828);let s=class{get onDidChangeWindowState(){return o.window.onDidChangeWindowState}showInformationMessage(e,t,...r){return o.window.showInformationMessage(e,t,...r)}showWarningMessage(e,t,...r){return o.window.showWarningMessage(e,t,...r)}showErrorMessage(e,t,...r){return o.window.showErrorMessage(e,t,...r)}showQuickPick(e,t,r){return o.window.showQuickPick(e,t,r)}showOpenDialog(e){return o.window.showOpenDialog(e)}showSaveDialog(e){return o.window.showSaveDialog(e)}showInputBox(e,t){return o.window.showInputBox(e,t)}showTextDocument(e,t,r){return o.window.showTextDocument(e,t,r)}openUrl(e){o.env.openExternal(o.Uri.parse(e))}setStatusBarMessage(e,t){return o.window.setStatusBarMessage(e,t)}createStatusBarItem(e,t){return o.window.createStatusBarItem(e,t)}showWorkspaceFolderPick(e){return o.window.showWorkspaceFolderPick(e)}withProgress(e,t){return o.window.withProgress(e,t)}withProgressCustomIcon(e,t){const r=(new o.CancellationTokenSource).token,n=this.createStatusBarItem(o.StatusBarAlignment.Left),i={report:t=>{n.text=`${e} ${t.message}`}};return n.show(),t(i,r).then((e=>(n.dispose(),e)))}createQuickPick(){return o.window.createQuickPick()}createInputBox(){return o.window.createInputBox()}createTreeView(e,t){return o.window.createTreeView(e,t)}createOutputChannel(e){return o.window.createOutputChannel(e)}createLanguageStatusItem(e,t){return o.languages.createLanguageStatusItem(e,t)}};s=n([(0,i.injectable)()],s),t.ApplicationShell=s},77633:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ClipboardService=void 0;const i=r(86700),o=r(66828);let s=class{async readText(){return o.env.clipboard.readText()}async writeText(e){await o.env.clipboard.writeText(e)}};s=n([(0,i.injectable)()],s),t.ClipboardService=s},17381:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.CommandManager=void 0;const i=r(86700),o=r(66828);let s=class{registerCommand(e,t,r){return o.commands.registerCommand(e,t,r)}registerTextEditorCommand(e,t,r){return o.commands.registerTextEditorCommand(e,t,r)}executeCommand(e,...t){return o.commands.executeCommand(e,...t)}getCommands(e){return o.commands.getCommands(e)}};s=n([(0,i.injectable)()],s),t.CommandManager=s},54094:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContextKeyManager=void 0;const o=r(86700),s=r(17585);let a=class{constructor(e){this.commandManager=e,this.values=new Map}async setContext(e,t){return this.values.get(e)===t?Promise.resolve():(this.values.set(e,t),this.commandManager.executeCommand("setContext",e,t))}};a=n([(0,o.injectable)(),i(0,(0,o.inject)(s.ICommandManager))],a),t.ContextKeyManager=a},72874:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentManager=void 0;const i=r(86700),o=r(66828);let s=class{get textDocuments(){return o.workspace.textDocuments}get activeTextEditor(){return o.window.activeTextEditor}get visibleTextEditors(){return o.window.visibleTextEditors}get onDidChangeActiveTextEditor(){return o.window.onDidChangeActiveTextEditor}get onDidChangeTextDocument(){return o.workspace.onDidChangeTextDocument}get onDidChangeVisibleTextEditors(){return o.window.onDidChangeVisibleTextEditors}get onDidChangeTextEditorSelection(){return o.window.onDidChangeTextEditorSelection}get onDidChangeTextEditorOptions(){return o.window.onDidChangeTextEditorOptions}get onDidChangeTextEditorViewColumn(){return o.window.onDidChangeTextEditorViewColumn}get onDidOpenTextDocument(){return o.workspace.onDidOpenTextDocument}get onDidCloseTextDocument(){return o.workspace.onDidCloseTextDocument}get onDidSaveTextDocument(){return o.workspace.onDidSaveTextDocument}showTextDocument(e,t,r){return o.window.showTextDocument(e,t,r)}openTextDocument(e){return o.workspace.openTextDocument(e)}applyEdit(e){return o.workspace.applyEdit(e)}createTextEditorDecorationType(e){return o.window.createTextEditorDecorationType(e)}};s=n([(0,i.injectable)()],s),t.DocumentManager=s},13578:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.Extensions=void 0;const i=r(86700),o=r(66828);let s=class{get all(){return o.extensions.all}get onDidChange(){return o.extensions.onDidChange}getExtension(e){return o.extensions.getExtension(e)}};s=n([(0,i.injectable)()],s),t.Extensions=s},53314:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalManager=void 0;const i=r(86700),o=r(66828);let s=class{get onDidCloseTerminal(){return o.window.onDidCloseTerminal}get onDidOpenTerminal(){return o.window.onDidOpenTerminal}createTerminal(e){return o.window.createTerminal(e)}};s=n([(0,i.injectable)()],s),t.TerminalManager=s},17585:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IClipboard=t.IActiveResourceService=t.ILanguageService=t.IApplicationEnvironment=t.IDebugService=t.ITerminalManager=t.IWorkspaceService=t.IDocumentManager=t.IJupyterExtensionDependencyManager=t.IContextKeyManager=t.ICommandManager=t.IApplicationShell=void 0,t.IApplicationShell=Symbol("IApplicationShell"),t.ICommandManager=Symbol("ICommandManager"),t.IContextKeyManager=Symbol("IContextKeyManager"),t.IJupyterExtensionDependencyManager=Symbol("IJupyterExtensionDependencyManager"),t.IDocumentManager=Symbol("IDocumentManager"),t.IWorkspaceService=Symbol("IWorkspaceService"),t.ITerminalManager=Symbol("ITerminalManager"),t.IDebugService=Symbol("IDebugManager"),t.IApplicationEnvironment=Symbol("IApplicationEnvironment"),t.ILanguageService=Symbol("ILanguageService"),t.IActiveResourceService=Symbol("IActiveResourceService"),t.IClipboard=Symbol("IClipboard")},56792:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceService=void 0;const i=r(86700),o=r(71017),s=r(66828),a=r(87450);let c=class{get onDidChangeConfiguration(){return s.workspace.onDidChangeConfiguration}get rootPath(){return Array.isArray(s.workspace.workspaceFolders)&&s.workspace.workspaceFolders.length>0?s.workspace.workspaceFolders[0].uri.fsPath:void 0}get workspaceFolders(){return s.workspace.workspaceFolders}get onDidChangeWorkspaceFolders(){return s.workspace.onDidChangeWorkspaceFolders}get workspaceFile(){return s.workspace.workspaceFile}getConfiguration(e,t){return s.workspace.getConfiguration(e,t||null)}getWorkspaceFolder(e){return e?s.workspace.getWorkspaceFolder(e):void 0}asRelativePath(e,t){return s.workspace.asRelativePath(e,t)}createFileSystemWatcher(e,t,r,n){return s.workspace.createFileSystemWatcher(e,t,r,n)}findFiles(e,t,r,n){const i=void 0===t?this.searchExcludes:t;return s.workspace.findFiles(e,i,r,n)}getWorkspaceFolderIdentifier(e,t=""){const r=e?s.workspace.getWorkspaceFolder(e):void 0;return r?o.normalize((0,a.getOSType)()===a.OSType.Windows?r.uri.fsPath.toUpperCase():r.uri.fsPath):t}get isVirtualWorkspace(){return!(!s.workspace.workspaceFolders||!s.workspace.workspaceFolders.every((e=>"file"!==e.uri.scheme)))}get isTrusted(){return s.workspace.isTrusted}get onDidGrantWorkspaceTrust(){return s.workspace.onDidGrantWorkspaceTrust}openTextDocument(e){return s.workspace.openTextDocument(e)}get searchExcludes(){const e=this.getConfiguration("search.exclude");return`{${Object.keys(e).filter((t=>!0===e.get(t))).join(",")}}`}};c=n([(0,i.injectable)()],c),t.WorkspaceService=c},2512:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncDisposableRegistry=void 0;const i=r(86700),o=r(81837);let s=class{constructor(){this.disposables=new o.Disposables}push(...e){this.disposables.push(...e)}async dispose(){return this.disposables.dispose()}};s=n([(0,i.injectable)()],s),t.AsyncDisposableRegistry=s},29979:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cancellation=t.wrapCancellationTokens=t.createPromiseFromCancellation=t.CancellationError=void 0;const n=r(66828),i=r(59314),o=r(67098);class s extends Error{constructor(){super(o.Common.canceled())}}t.CancellationError=s,t.createPromiseFromCancellation=function(e){return new Promise(((t,r)=>{e.token&&e.token.onCancellationRequested((()=>{if(e.token.isCancellationRequested){if("resolve"===e.cancelAction)return t(e.defaultValue);if("reject"===e.cancelAction)return r(new s)}}))}))},t.wrapCancellationTokens=function(...e){const t=new n.CancellationTokenSource;for(const r of e)if(r){if(r.isCancellationRequested)return r;r.onCancellationRequested((()=>t.cancel()))}return t.token},function(e){function t(e){return!!e&&e.isCancellationRequested}e.race=function(e,t){if(t){const r=(0,i.createDeferred)();return t.onCancellationRequested((()=>{r.completed||r.reject(new s)})),t.isCancellationRequested?r.reject(new s):e(t).then((e=>{r.completed||r.resolve(e)})).catch((e=>{r.completed||r.reject(e)})),r.promise}return e()},e.isCanceled=t,e.throwIfCanceled=function(e){if(t(e))throw new s}}(t.Cancellation||(t.Cancellation={}))},89515:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.PythonSettings=void 0;const i=r(71017),o=r(57147),s=r(66828);r(32727);const a=r(98634),c=r(56792),u=r(77570),l=r(93666),h=r(36952),p=r(48683),d=r(87450),f=r(58967);class v{constructor(e,t,r,n){this.interpreterAutoSelectionService=t,this.interpreterPathService=n,this.downloadLanguageServer=!0,this.envFile="",this.venvPath="",this.venvFolders=[],this.condaPath="",this.pipenvPath="",this.poetryPath="",this.devOptions=[],this.disableInstallationChecks=!1,this.globalModuleInstallation=!1,this.autoUpdateLanguageServer=!0,this.languageServerIsDefault=!0,this.changed=new s.EventEmitter,this.disposables=[],this._pythonPath="python",this._defaultInterpreterPath="",this.workspace=r||new c.WorkspaceService,this.workspaceRoot=e,this.initialize()}get onDidChange(){return this.changed.event}get pythonPath(){return this._pythonPath}set pythonPath(e){if(this._pythonPath!==e)try{this._pythonPath=this.getPythonExecutable(e)}catch(t){this._pythonPath=e}}get defaultInterpreterPath(){return this._defaultInterpreterPath}set defaultInterpreterPath(e){if(this._defaultInterpreterPath!==e)try{this._defaultInterpreterPath=this.getPythonExecutable(e)}catch(t){this._defaultInterpreterPath=e}}static getInstance(e,t,r,n){r=r||new c.WorkspaceService;const i=v.getSettingsUriAndTarget(e,r).uri,o=i?i.fsPath:"";if(!v.pythonSettings.has(o)){const e=new v(i,t,r,n);v.pythonSettings.set(o,e)}return v.pythonSettings.get(o)}static getSettingsUriAndTarget(e,t){t=t||new c.WorkspaceService;const r=e?t.getWorkspaceFolder(e):void 0;let n=r?r.uri:void 0;return!n&&Array.isArray(t.workspaceFolders)&&t.workspaceFolders.length>0&&(n=t.workspaceFolders[0].uri),{uri:n,target:n?s.ConfigurationTarget.WorkspaceFolder:s.ConfigurationTarget.Global}}static dispose(){if(!(0,u.isTestExecution)())throw new Error("Dispose can only be called from unit tests");v.pythonSettings.forEach((e=>e&&e.dispose())),v.pythonSettings.clear()}static toSerializable(e){const t={};return Object.entries(e).forEach((e=>{const[r,n]=e;r.includes("Manager")||r.includes("Service")||r.includes("onDid")||(t[r]=n)})),t}dispose(){this.disposables.forEach((e=>e&&e.dispose())),this.disposables=[]}update(e){var t,r;const n=null===(t=this.workspaceRoot)||void 0===t?void 0:t.fsPath,i=new p.SystemVariables(void 0,n,this.workspace);this.pythonPath=this.getPythonPath(e,i,n);const o=i.resolveAny(e.get("defaultInterpreterPath"));if(this.defaultInterpreterPath=o||u.DEFAULT_INTERPRETER_SETTING,this.defaultInterpreterPath===u.DEFAULT_INTERPRETER_SETTING){const e=this.interpreterAutoSelectionService.getAutoSelectedInterpreter(this.workspaceRoot);this.defaultInterpreterPath=null!==(r=null==e?void 0:e.path)&&void 0!==r?r:this.defaultInterpreterPath}this.defaultInterpreterPath=y(this.defaultInterpreterPath,n),this.venvPath=i.resolveAny(e.get("venvPath")),this.venvFolders=i.resolveAny(e.get("venvFolders"));const s=i.resolveAny(e.get("condaPath"));this.condaPath=s&&s.length>0?y(s,n):s;const c=i.resolveAny(e.get("pipenvPath"));this.pipenvPath=c&&c.length>0?y(c,n):c;const l=i.resolveAny(e.get("poetryPath"));this.poetryPath=l&&l.length>0?y(l,n):l,this.downloadLanguageServer=i.resolveAny(e.get("downloadLanguageServer",!0)),this.autoUpdateLanguageServer=i.resolveAny(e.get("autoUpdateLanguageServer",!0));const h=e.get("envFile");this.envFile=i.resolveAny(h),(0,a.sendSettingTelemetry)(this.workspace,h),this.devOptions=i.resolveAny(e.get("devOptions")),this.devOptions=Array.isArray(this.devOptions)?this.devOptions:[],this.disableInstallationChecks=!0===e.get("disableInstallationCheck"),this.globalModuleInstallation=!0===e.get("globalModuleInstallation");const d=i.resolveAny(e.get("terminal"));this.terminal?Object.assign(this.terminal,d):(this.terminal=d,(0,u.isTestExecution)()&&!this.terminal&&(this.terminal={})),this.terminal=this.terminal?this.terminal:{executeInFileDir:!0,launchArgs:[],activateEnvironment:!0,activateEnvInCurrentTerminal:!1}}getPythonExecutable(e){return function(e){if("python"===(e=f(e))||-1===e.indexOf(i.sep)||i.basename(e)===i.dirname(e))return e;if(m(e))return e;const t=["python","python4","python3.6","python3.5","python3","python2.7","python2","python3.7","python3.8","python3.9"];for(let r of t)if(l.IS_WINDOWS){if(r=`${r}.exe`,m(i.join(e,r)))return i.join(e,r);if(m(i.join(e,"Scripts",r)))return i.join(e,"Scripts",r)}else{if(m(i.join(e,r)))return i.join(e,r);if(m(i.join(e,"bin",r)))return i.join(e,"bin",r)}return e}(e)}onWorkspaceFoldersChanged(){const e=this.workspace.workspaceFolders.map((e=>e.uri.fsPath)),t=Array.from(v.pythonSettings.keys()).filter((t=>e.indexOf(t)<0));if(t.length>0)for(const e of t)v.pythonSettings.delete(e)}initialize(){const e=()=>{const e=this.workspace.getConfiguration("python",this.workspaceRoot);this.update(e),this.debounceChangeNotification()};this.disposables.push(this.workspace.onDidChangeWorkspaceFolders(this.onWorkspaceFoldersChanged,this)),this.disposables.push(this.interpreterAutoSelectionService.onDidChangeAutoSelectedInterpreter(e.bind(this))),this.disposables.push(this.workspace.onDidChangeConfiguration((t=>{t.affectsConfiguration("python")&&e()}))),this.interpreterPathService&&this.disposables.push(this.interpreterPathService.onDidChange(e.bind(this)));const t=this.workspace.getConfiguration("python",this.workspaceRoot);t&&this.update(t)}debounceChangeNotification(){this.changed.fire()}getPythonPath(e,t,r){if(this.pythonPath=t.resolveAny(this.interpreterPathService?this.interpreterPathService.get(this.workspaceRoot):e.get("pythonPath")),!process.env.CI_DISABLE_AUTO_SELECTION&&(0===this.pythonPath.length||"python"===this.pythonPath)&&this.interpreterAutoSelectionService){const e=this.interpreterAutoSelectionService.getAutoSelectedInterpreter(this.workspaceRoot);e&&(this.pythonPath=e.path,this.workspaceRoot&&this.interpreterAutoSelectionService.setWorkspaceInterpreter(this.workspaceRoot,e).ignoreErrors())}return y(this.pythonPath,r)}}function y(e,t){return t||(t=__dirname),e=f(e),(0,u.isTestExecution)()&&!e?t:-1===e.indexOf(i.sep)||i.isAbsolute(e)?e:i.resolve(t,e)}function m(e){return o.existsSync(e)&&i.basename((0,d.getOSType)()===d.OSType.Windows?e.toLowerCase():e).startsWith("python")}v.pythonSettings=new Map,n([(0,h.debounceSync)(1)],v.prototype,"debounceChangeNotification",null),t.PythonSettings=v},15797:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PipEnvExecutionPath=void 0;const o=r(86700),s=r(61684);let a=class{constructor(e){this.configService=e}get executable(){return this.configService.getSettings().pipenvPath}};a=n([(0,o.injectable)(),i(0,(0,o.inject)(s.IConfigurationService))],a),t.PipEnvExecutionPath=a},30751:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationService=void 0;const o=r(86700),s=r(66828),a=r(87282),c=r(77498),u=r(17585),l=r(89515),h=r(77570),p=r(61684);let d=class{constructor(e){this.serviceContainer=e,this.workspaceService=this.serviceContainer.get(u.IWorkspaceService)}getSettings(e){const t=this.serviceContainer.get(a.IInterpreterAutoSelectionService),r=this.serviceContainer.get(p.IInterpreterPathService);return l.PythonSettings.getInstance(e,t,this.workspaceService,r)}async updateSectionSetting(e,t,r,n,i){const o=this.serviceContainer.get(p.IInterpreterPathService);let a={uri:n,target:i||s.ConfigurationTarget.WorkspaceFolder};"python"===e&&i!==s.ConfigurationTarget.Global&&(a=l.PythonSettings.getSettingsUriAndTarget(n,this.workspaceService)),i=i||a.target;const c=this.workspaceService.getConfiguration(e,a.uri),u="python"===e&&"pythonPath"===t?o.inspect(a.uri):c.inspect(t);void 0!==u&&(i===s.ConfigurationTarget.Global&&u.globalValue===r||i===s.ConfigurationTarget.Workspace&&u.workspaceValue===r||i===s.ConfigurationTarget.WorkspaceFolder&&u.workspaceFolderValue===r)||("python"===e&&"pythonPath"===t?await o.update(a.uri,i,r):(await c.update(t,r,i),await this.verifySetting(c,i,t,r)))}async updateSetting(e,t,r,n){return this.updateSectionSetting("python",e,t,r,n)}isTestExecution(){return"1"===process.env.VSC_PYTHON_CI_TEST}async verifySetting(e,t,r,n){if(this.isTestExecution()&&!(0,h.isUnitTestExecution)()){let i=0;do{const o=e.inspect(r);if(!o&&void 0===n)break;if(o&&void 0!==n){let e;if(e=t===s.ConfigurationTarget.Global?o.globalValue:t===s.ConfigurationTarget.Workspace?o.workspaceValue:o.workspaceFolderValue,e===n)break}await new Promise((e=>setTimeout(e,250))),i+=1}while(i<20)}}};d=n([(0,o.injectable)(),i(0,(0,o.inject)(c.IServiceContainer))],d),t.ConfigurationService=d},77570:function(e,t,r){"use strict";var n,i,o,s=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)};function c(){return"1"===process.env.VSC_PYTHON_UNIT_TEST}Object.defineProperty(t,"__esModule",{value:!0}),t.UseProposedApi=t.isUnitTestExecution=t.isTestExecution=t.isCI=t.STANDARD_OUTPUT_CHANNEL=t.DEFAULT_INTERPRETER_SETTING=t.Octicons=t.Commands=t.CommandSource=t.AppinsightsKey=t.JUPYTER_EXTENSION_ID=t.PYLANCE_EXTENSION_ID=t.CODE_RUNNER_EXTENSION_ID=t.PVSC_EXTENSION_ID=t.PYTHON_NOTEBOOKS=t.PYTHON=t.InteractiveScheme=t.InteractiveInputScheme=t.NotebookCellScheme=t.PYTHON_WARNINGS=t.PYTHON_LANGUAGE=void 0,t.PYTHON_LANGUAGE="python",t.PYTHON_WARNINGS="PYTHONWARNINGS",t.NotebookCellScheme="vscode-notebook-cell",t.InteractiveInputScheme="vscode-interactive-input",t.InteractiveScheme="vscode-interactive",t.PYTHON=[{scheme:"file",language:t.PYTHON_LANGUAGE},{scheme:"untitled",language:t.PYTHON_LANGUAGE},{scheme:"vscode-notebook",language:t.PYTHON_LANGUAGE},{scheme:t.NotebookCellScheme,language:t.PYTHON_LANGUAGE},{scheme:t.InteractiveInputScheme,language:t.PYTHON_LANGUAGE}],t.PYTHON_NOTEBOOKS=[{scheme:"vscode-notebook",language:t.PYTHON_LANGUAGE},{scheme:t.NotebookCellScheme,language:t.PYTHON_LANGUAGE},{scheme:t.InteractiveInputScheme,language:t.PYTHON_LANGUAGE}],t.PVSC_EXTENSION_ID="donjayamanne.python-environment-manager",t.CODE_RUNNER_EXTENSION_ID="formulahendry.code-runner",t.PYLANCE_EXTENSION_ID="ms-python.vscode-pylance",t.JUPYTER_EXTENSION_ID="ms-toolsai.jupyter",t.AppinsightsKey="_",(o=t.CommandSource||(t.CommandSource={})).ui="ui",o.commandPalette="commandpalette",(i=t.Commands||(t.Commands={})).Exec_In_Terminal="python.envManager.execInTerminal",i.Exec_In_Terminal_Icon="python.envManager.execInTerminal-icon",i.ViewOutput="python.envManager.viewOutput",i.Start_REPL="python.envManagerstartREPL",i.Create_Terminal="python.envManager.createTerminal",i.ClearStorage="python.envManager.clearPersistentStorage",(n=t.Octicons||(t.Octicons={})).Add="$(add)",n.Test_Pass="$(check)",n.Test_Fail="$(alert)",n.Test_Error="$(x)",n.Test_Skip="$(circle-slash)",n.Downloading="$(cloud-download)",n.Installing="$(desktop-download)",n.Search_Stop="$(search-stop)",n.Star="$(star-full)",n.Gear="$(gear)",t.DEFAULT_INTERPRETER_SETTING="python",t.STANDARD_OUTPUT_CHANNEL="STANDARD_OUTPUT_CHANNEL",t.isCI="true"===process.env.TRAVIS||void 0!==process.env.TF_BUILD,t.isTestExecution=function(){return"1"===process.env.VSC_PYTHON_CI_TEST||c()},t.isUnitTestExecution=c,t.UseProposedApi=Symbol("USE_VSC_PROPOSED_API"),a(r(63281),t)},94316:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextKey=void 0,t.ContextKey=class{constructor(e,t){this.name=e,this.commandManager=t}get value(){return this.lastValue}async set(e){this.lastValue!==e&&(this.lastValue=e,await this.commandManager.executeCommand("setContext",this.name,this.lastValue))}}},84911:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.EditorUtils=t.getTempFileWithDocumentContents=t.getWorkspaceEditsFromPatch=t.getTextEditsFromPatch=void 0;const i=r(65176),o=r(86700),s=r(2568),a=r(22037),c=r(71017),u=r(66828),l=r(19735),h=r(26804),p=r(3481);var d;!function(e){e[e.Delete=0]="Delete",e[e.Insert=1]="Insert",e[e.Replace=2]="Replace"}(d||(d={}));const f=a.EOL.length;class v{constructor(e,t){this.action=e,this.start=t,this.text=""}apply(){switch(this.action){case d.Insert:return u.TextEdit.insert(this.start,this.text);case d.Delete:return u.TextEdit.delete(new u.Range(this.start,this.end));case d.Replace:return u.TextEdit.replace(new u.Range(this.start,this.end),this.text);default:return new u.TextEdit(new u.Range(new u.Position(0,0),new u.Position(0,0)),"")}}}function y(e,t,n=0){let i=n,o=0;const s=e.split(/\r?\n/g);i>0&&s.filter(((e,t)=>to+=e.length+f));const a=[];let c,l=null;for(let e=0;e{t.diffs.forEach((e=>{e[1]+=a.EOL})),y(e,t.diffs,t.start1).forEach((e=>o.push(e.apply())))})),o},t.getWorkspaceEditsFromPatch=function(e,t,n){const i=new u.WorkspaceEdit;return e.forEach((e=>{const o=e.indexOf("@@");if(-1===o)return;const s=e.substring(0,o).split(/\r?\n/g).map((e=>e.trim())).filter((e=>e.length>0&&e.toLowerCase().endsWith(".py")&&e.indexOf(" a")>0));if(e.startsWith("---")&&(e=e.substring(o)),0===e.length)return;if(0===s.length)return;let l=s[0].substring(s[0].indexOf(" a")+3).trim();if(l=t&&!c.isAbsolute(l)?c.resolve(t,l):l,!n.fileExistsSync(l))return;e=e.replace(/\\ No newline at end of file[\r\n]/,"");const h=new(r(65176).diff_match_patch),p=m.call(h,e);if(!Array.isArray(p)||0===p.length)throw new Error("Unable to parse Patch string");const f=n.readFileSync(l),v=u.Uri.file(l);p.forEach((e=>{e.diffs.forEach((e=>{e[1]+=a.EOL})),y(f,e.diffs,e.start1).forEach((e=>{switch(e.action){case d.Delete:i.delete(v,new u.Range(e.start,e.end));break;case d.Insert:i.insert(v,e.start,e.text);break;case d.Replace:i.replace(v,new u.Range(e.start,e.end),e.text)}}))}))})),i},t.getTempFileWithDocumentContents=async function(e,t){let r=`${e.uri.fsPath}.${s(e.uri.fsPath+e.uri.fragment)}.tmp`;try{(0,p.isNotebookCell)(e.uri)&&!await t.fileExists(e.uri.fsPath)&&(r=(await t.createTemporaryFile(`${c.basename(e.uri.fsPath)}-${e.uri.fragment}.tmp`)).filePath),await t.writeFile(r,e.getText())}catch(e){(0,l.traceError)("Failed to create a temporary file",e);const t=e;throw new h.WrappedError(`Failed to create a temporary file, ${t.message}`,t)}return r};let g=class{getWorkspaceEditsFromPatch(e,t,n){const i=new u.WorkspaceEdit;if(t.startsWith("---")&&(t=t.substring(t.indexOf("@@"))),0===t.length)return i;t=t.replace(/\\ No newline at end of file[\r\n]/,"");const o=new(r(65176).diff_match_patch),s=m.call(o,t);if(!Array.isArray(s)||0===s.length)throw new Error("Unable to parse Patch string");return s.forEach((t=>{t.diffs.forEach((e=>{e[1]+=a.EOL})),y(e,t.diffs,t.start1).forEach((e=>{switch(e.action){case d.Delete:i.delete(n,new u.Range(e.start,e.end));break;case d.Insert:i.insert(n,e.start,e.text);break;case d.Replace:i.replace(n,new u.Range(e.start,e.end),e.text)}}))})),i}};g=n([(0,o.injectable)()],g),t.EditorUtils=g},26804:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WrappedError=t.ErrorUtils=void 0;const n=r(22037);t.ErrorUtils=class{static outputHasModuleNotInstalledError(e,t){return!(!t||!(t.indexOf(`No module named ${e}`)>0||t.indexOf(`No module named '${e}'`)>0))}};class i extends Error{constructor(e,t){super(e),this.stack=`${new Error("").stack}${n.EOL}${n.EOL}${t.stack}`}}t.WrappedError=i},97300:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModuleNotInstalledError=void 0;class r extends Error{constructor(e){super(`Module '${e}' not installed.`)}}t.ModuleNotInstalledError=r},32727:()=>{"use strict";String.prototype.splitLines=function(e={removeEmptyEntries:!0,trim:!0}){let t=this.split(/\r?\n/g);return e&&e.trim&&(t=t.map((e=>e.trim()))),e&&e.removeEmptyEntries&&(t=t.filter((e=>e.length>0))),t},String.prototype.toCommandArgumentForPythonExt=function(){return this?!(this.indexOf(" ")>=0||this.indexOf("&")>=0)||this.startsWith('"')||this.endsWith('"')?this.toString():`"${this}"`:this},String.prototype.fileToCommandArgumentForPythonExt=function(){return this?this.toCommandArgumentForPythonExt().replace(/\\/g,"/"):this},String.prototype.trimQuotes=function(){return this?this.replace(/(^['"])|(['"]$)/g,""):this},String.prototype.replaceAll=function(e,t){return this?this.replace(new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),t):this},Promise.prototype.ignoreErrors=function(){this.catch((()=>{}))},String.prototype.format||(String.prototype.format=function(){const e=arguments;return this.replace(/{(\d+)}/g,((t,r)=>void 0===e[r]?t:e[r]))})},95939:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstallationChannelManager=void 0;const o=r(86700),s=r(18639),a=r(77498),c=r(81387),u=r(17585),l=r(84974),h=r(67098),p=r(3481),d=r(92674),f=r(59747);let v=class{constructor(e){this.serviceContainer=e}async getInstallationChannel(e,t){const r=await this.getInstallationChannels(t);if(1===r.length)return r[0];const n=d.ProductNames.get(e),i=this.serviceContainer.get(u.IApplicationShell);if(0===r.length)return void await this.showNoInstallersMessage((0,p.isResource)(t)?t:void 0);const o=`Select an option to install ${n}`,s=r.map((e=>({label:`Install using ${e.displayName}`,description:"",installer:e}))),a=await i.showQuickPick(s,{matchOnDescription:!0,matchOnDetail:!0,placeHolder:o});return a?a.installer:void 0}async getInstallationChannels(e){const t=this.serviceContainer.getAll(f.IModuleInstaller),r=[];if(0===t.length)return[];t.sort(((e,t)=>t.priority-e.priority));let n=t[0].priority;for(const i of t){if(i.priority!==n){if(r.length>0)break;n=i.priority}await i.isSupported(e)&&r.push(i)}return r}async showNoInstallersMessage(e){const t=this.serviceContainer.get(s.IInterpreterService),r=await t.getActiveInterpreter(e);if(!r)return;const n=this.serviceContainer.get(u.IApplicationShell);let i;if(i=r.envType===c.EnvironmentType.Conda?await n.showErrorMessage(h.Installer.noCondaOrPipInstaller(),h.Installer.searchForHelp()):await n.showErrorMessage(h.Installer.noPipInstaller(),h.Installer.searchForHelp()),"Search for help"===i){const e=this.serviceContainer.get(l.IPlatformService),t=e.isWindows?"Windows":e.isMac?"MacOS":"Linux";n.openUrl(`https://www.bing.com/search?q=Install Pip ${t} ${r.envType===c.EnvironmentType.Conda?"Conda":""}`)}}};v=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],v),t.InstallationChannelManager=v},5181:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CondaInstaller=void 0;const o=r(86700),s=r(18639),a=r(77498),c=r(81387),u=r(61684),l=r(3481),h=r(30135),p=r(59747);let d=class extends h.ModuleInstaller{constructor(e){super(e)}get name(){return"Conda"}get displayName(){return"Conda"}get type(){return c.ModuleInstallerType.Conda}get priority(){return 0}async isSupported(e){if(!1===this._isCondaAvailable)return!1;const t=this.serviceContainer.get(s.ICondaService);return this._isCondaAvailable=await t.isCondaAvailable(),!!this._isCondaAvailable&&this.isCurrentEnvironmentACondaEnvironment(e)}async getExecutionInfo(e,t,r=0){var n;const i=this.serviceContainer.get(s.ICondaService),o=await i.getCondaFile(!0),a=(0,l.isResource)(t)?this.serviceContainer.get(u.IConfigurationService).getSettings(t).pythonPath:null!==(n=t.id)&&void 0!==n?n:"",c=this.serviceContainer.get(s.IComponentAdapter),d=await c.getCondaEnvironment(a),f=[r&p.ModuleInstallFlags.upgrade?"update":"install"];return[u.Product.tensorboard,u.Product.ipykernel,u.Product.pandas,u.Product.nbconvert,u.Product.jupyter,u.Product.notebook].map(h.translateProductToModule).includes(e)&&f.push("-c","conda-forge"),d&&d.name?(f.push("--name"),f.push(d.name.toCommandArgumentForPythonExt())):d&&d.path&&(f.push("--prefix"),f.push(d.path.fileToCommandArgumentForPythonExt())),r&p.ModuleInstallFlags.updateDependencies&&f.push("--update-deps"),r&p.ModuleInstallFlags.reInstall&&f.push("--force-reinstall"),f.push(e),f.push("-y"),{args:f,execPath:o,useShell:!0}}async isCurrentEnvironmentACondaEnvironment(e){var t;const r=this.serviceContainer.get(s.IComponentAdapter),n=(0,l.isResource)(e)?this.serviceContainer.get(u.IConfigurationService).getSettings(e).pythonPath:null!==(t=e.id)&&void 0!==t?t:"";return r.isCondaEnvironment(n)}};d=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],d),t.CondaInstaller=d},30135:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.translateProductToModule=t.ModuleInstaller=void 0;const i=r(86700),o=r(71017),s=r(66828),a=r(18639),c=r(19735),u=r(81387),l=r(54813),h=r(61522),p=r(17585),d=r(29979),f=r(77570),v=r(84974),y=r(31776),m=r(29983),g=r(58400),b=r(61684),_=r(67098),E=r(3481),S=r(92674);let w=class{constructor(e){this.serviceContainer=e}async installModule(e,t,r,n,i){const c=!(null==i?void 0:i.installAsProcess),f="string"==typeof e?e:T(e),m="string"==typeof e?f:S.ProductNames.get(e);(0,l.sendTelemetryEvent)(h.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:this.displayName,productName:m});const g=(0,E.isResource)(t)?t:void 0,w=await this.getExecutionInfo(f,t,n),P=async e=>{var r;const n=await this.processInstallArgs(w.args,t);if(w.moduleName){const i=this.serviceContainer.get(b.IConfigurationService).getSettings(g),s=this.serviceContainer.get(a.IInterpreterService),l=(0,E.isResource)(t)?await s.getActiveInterpreter(t):t,h=null!==(r=null==l?void 0:l.path)&&void 0!==r?r:i.pythonPath,p=(0,E.isResource)(t)?h:t.path,d=y.execModule(w.moduleName,n);if(l&&l.envType===u.EnvironmentType.Unknown)if(i.globalModuleInstallation){const r=this.serviceContainer.get(v.IFileSystem);await r.isDirReadonly(o.dirname(p)).catch((e=>!0))?this.elevatedInstall(p,d):await this.executeCommand(c,t,p,d,e,w.useShell)}else f===T(b.Product.pip)?await this.executeCommand(c,t,p,d,e,w.useShell):await this.executeCommand(c,t,p,d.concat(["--user"]),e,w.useShell);else await this.executeCommand(c,t,p,d,e,w.useShell)}else await this.executeCommand(c,t,w.execPath,n,e,w.useShell)};if(r){const e=this.serviceContainer.get(p.IApplicationShell),t={location:s.ProgressLocation.Notification,cancellable:!0,title:_.Products.installingModule().format(f)};await e.withProgress(t,(async(e,t)=>P((0,d.wrapCancellationTokens)(t,r))))}else await P(r)}elevatedInstall(e,t){const n=this.serviceContainer.get(b.IOutputChannel,f.STANDARD_OUTPUT_CHANNEL),i=`"${e.replace(/\\/g,"/")}" ${t.join(" ")}`;(0,c.traceLog)(`[Elevated] ${i}`),r(65425).exec(i,{name:"VS Code Python"},(async(e,t,r)=>{if(e){const t=this.serviceContainer.get(p.IApplicationShell);await t.showErrorMessage(e)}else n.show(),t&&(0,c.traceLog)(t),r&&(0,c.traceError)(`Warning: ${r}`)}))}async processInstallArgs(e,t){const r=e.findIndex((e=>"PYLINT"===e.toUpperCase()));if(-1===r)return e;const n=this.serviceContainer.get(a.IInterpreterService),i=(0,E.isResource)(t)?await n.getActiveInterpreter(t):t;if(i&&i.version&&2===i.version.major){const t=[...e];return t[r]='"pylint<2.0.0"',t}return e}async executeCommand(e,t,r,n,i,o){const s={};if((0,E.isResource)(t)?s.resource=t:s.interpreter=t,e)this.serviceContainer.get(g.ITerminalServiceFactory).getTerminalService(s).sendCommand(r,n,i);else{const e=this.serviceContainer.get(m.IProcessServiceFactory),t=await e.create(s.resource);if(o){const e=[r,...n].reduce(((e,t)=>e?`${e} ${t.toCommandArgumentForPythonExt()}`:`${t.toCommandArgumentForPythonExt()}`),"");await t.shellExec(e)}else await t.exec(r,n)}}};function T(e){switch(e){case b.Product.mypy:return"mypy";case b.Product.pylama:return"pylama";case b.Product.prospector:return"prospector";case b.Product.pylint:return"pylint";case b.Product.pytest:return"pytest";case b.Product.autopep8:return"autopep8";case b.Product.black:return"black";case b.Product.pycodestyle:return"pycodestyle";case b.Product.pydocstyle:return"pydocstyle";case b.Product.yapf:return"yapf";case b.Product.flake8:return"flake8";case b.Product.unittest:return"unittest";case b.Product.bandit:return"bandit";case b.Product.jupyter:return"jupyter";case b.Product.notebook:return"notebook";case b.Product.pandas:return"pandas";case b.Product.ipykernel:return"ipykernel";case b.Product.nbconvert:return"nbconvert";case b.Product.kernelspec:return"kernelspec";case b.Product.tensorboard:return"tensorboard";case b.Product.torchProfilerInstallName:return"torch-tb-profiler";case b.Product.torchProfilerImportName:return"torch_tb_profiler";case b.Product.pip:return"pip";case b.Product.ensurepip:return"ensurepip";case b.Product.python:return"python";default:throw new Error(`Product ${e} cannot be installed as a Python Module.`)}}w=n([(0,i.injectable)()],w),t.ModuleInstaller=w,t.translateProductToModule=T},22577:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PipEnvInstaller=t.pipenvName=void 0;const o=r(86700),s=r(18639),a=r(77498),c=r(37924),u=r(81387),l=r(17585),h=r(3481),p=r(30135),d=r(59747);t.pipenvName="pipenv";let f=class extends p.ModuleInstaller{get name(){return"pipenv"}get type(){return u.ModuleInstallerType.Pipenv}get displayName(){return t.pipenvName}get priority(){return 10}constructor(e){super(e)}async isSupported(e){if((0,h.isResource)(e)){const t=await this.serviceContainer.get(s.IInterpreterService).getActiveInterpreter(e),r=e?this.serviceContainer.get(l.IWorkspaceService).getWorkspaceFolder(e):void 0;return!(!t||!r||t.envType!==u.EnvironmentType.Pipenv)&&(0,c.isPipenvEnvironmentRelatedToFolder)(t.path,r.uri.fsPath)}return e.envType===u.EnvironmentType.Pipenv}async getExecutionInfo(e,r,n=0){const i=[n&d.ModuleInstallFlags.reInstall||n&d.ModuleInstallFlags.updateDependencies||n&d.ModuleInstallFlags.upgrade?"update":"install",e,"--dev"];return"black"===e&&i.push("--pre"),{args:i,execPath:t.pipenvName}}};f=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],f),t.PipEnvInstaller=f},36352:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PipInstaller=void 0;const o=r(86700),s=r(77498),a=r(81387),c=r(17585),u=r(29983),l=r(61684),h=r(3481),p=r(30135),d=r(59747),f=r(71017),v=r(48266),y=r(92674),m=r(54813),g=r(61522),b=r(18639),_=r(48431);let E=class extends p.ModuleInstaller{get name(){return"Pip"}get type(){return a.ModuleInstallerType.Pip}get displayName(){return"Pip"}get priority(){return 0}constructor(e){super(e)}async isSupported(e){return!1!==await async function(e,t){var r;const n=e.get(b.IInterpreterService),i=(0,h.isResource)(t)?await n.getActiveInterpreter(t):t;if(i)return!((null===(r=i.envPath)||void 0===r?void 0:r.length)&&i.envType===a.EnvironmentType.Conda&&!(0,_.isParentPath)(null==i?void 0:i.path,i.envPath))}(this.serviceContainer,e)&&this.isPipAvailable(e)}async getExecutionInfo(e,t,r=0){var n,i,o;if(e===(0,p.translateProductToModule)(l.Product.pip)){const e=(0,h.isResource)(t)?"":`${(null===(n=t.version)||void 0===n?void 0:n.major)||""}.${(null===(i=t.version)||void 0===i?void 0:i.minor)||""}.${(null===(o=t.version)||void 0===o?void 0:o.patch)||""}`,r=(0,h.isResource)(t)?void 0:t.envType;(0,m.sendTelemetryEvent)(g.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:"unavailable",requiredInstaller:a.ModuleInstallerType.Pip,productName:y.ProductNames.get(l.Product.pip),version:e,envType:r});const s=this.serviceContainer.get(l.IInstaller);if(await s.isInstalled(l.Product.ensurepip,t))return{args:[],moduleName:"ensurepip"};(0,m.sendTelemetryEvent)(g.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:"unavailable",requiredInstaller:a.ModuleInstallerType.Pip,productName:y.ProductNames.get(l.Product.ensurepip),version:e,envType:r});const c=this.serviceContainer.get(b.IInterpreterService),u=(0,h.isResource)(t)?await c.getActiveInterpreter(t):t;return{execPath:u?u.path:"python",args:[f.join(v._SCRIPTS_DIR,"get-pip.py")]}}const s=[],u=this.serviceContainer.get(c.IWorkspaceService).getConfiguration("http").get("proxy","");return u.length>0&&(s.push("--proxy"),s.push(u)),s.push("install","-U"),r&d.ModuleInstallFlags.reInstall&&s.push("--force-reinstall"),{args:[...s,e],moduleName:"pip"}}isPipAvailable(e){const t=this.serviceContainer.get(u.IPythonExecutionFactory),r=(0,h.isResource)(e)?e:void 0,n=(0,h.isResource)(e)?void 0:e.path;return t.create({resource:r,pythonPath:n}).then((e=>e.isModuleInstalled("pip"))).catch((()=>!1))}};E=n([(0,o.injectable)(),i(0,(0,o.inject)(s.IServiceContainer))],E),t.PipInstaller=E},73300:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PoetryInstaller=t.poetryName=void 0;const o=r(86700),s=r(18639),a=r(77498),c=r(13298),u=r(81387),l=r(17585),h=r(61684),p=r(3481),d=r(30135);t.poetryName="poetry";let f=class extends d.ModuleInstaller{constructor(e,t,r){super(e),this.workspaceService=t,this.configurationService=r}get name(){return"poetry"}get type(){return u.ModuleInstallerType.Poetry}get displayName(){return t.poetryName}get priority(){return 10}async isSupported(e){if(!e)return!1;if(!(0,p.isResource)(e))return!1;const t=await this.serviceContainer.get(s.IInterpreterService).getActiveInterpreter(e),r=e?this.workspaceService.getWorkspaceFolder(e):void 0;return!(!t||!r||t.envType!==u.EnvironmentType.Poetry)&&(0,c.isPoetryEnvironmentRelatedToFolder)(t.path,r.uri.fsPath,this.configurationService.getSettings(e).poetryPath)}async getExecutionInfo(e,t){const r=this.configurationService.getSettings((0,p.isResource)(t)?t:void 0).poetryPath,n=["add","--dev",e];return"black"===e&&n.push("--allow-prereleases"),{args:n,execPath:r}}};f=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer)),i(1,(0,o.inject)(l.IWorkspaceService)),i(2,(0,o.inject)(h.IConfigurationService))],f),t.PoetryInstaller=f},80819:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProductInstaller=t.PythonInstaller=t.DataScienceInstaller=t.Product=void 0;const o=r(86700),s=r(36625);r(32727);const a=r(18639),c=r(77498),u=r(81387),l=r(54813),h=r(61522),p=r(29983),d=r(61684),f=r(3481),v=r(30135),y=r(92674),m=r(59747),g=r(19735),b=r(48431),_=r(17585),E=r(67098);var S=r(61684);Object.defineProperty(t,"Product",{enumerable:!0,get:function(){return S.Product}});const w=new Map([[d.Product.torchProfilerInstallName,new Set([u.EnvironmentType.Conda])]]);class T{constructor(e){this.serviceContainer=e,this.appShell=e.get(_.IApplicationShell),this.configService=e.get(d.IConfigurationService),this.workspaceService=e.get(_.IWorkspaceService),this.productService=e.get(m.IProductService),this.persistentStateFactory=e.get(d.IPersistentStateFactory)}promptToInstall(e,t,r,n){const i=t&&(0,f.isResource)(t)?this.workspaceService.getWorkspaceFolder(t):void 0,o=`${e}${i?i.uri.fsPath:""}`;if(T.PromptPromises.has(o))return T.PromptPromises.get(o);const s=this.promptToInstallImplementation(e,t,r,n);return T.PromptPromises.set(o,s),s.then((()=>T.PromptPromises.delete(o))).ignoreErrors(),s.catch((()=>T.PromptPromises.delete(o))).ignoreErrors(),s}async install(e,t,r,n,i){if(e===d.Product.unittest)return d.InstallerResponse.Installed;const o=this.serviceContainer.get(m.IInstallationChannelManager),s=await o.getInstallationChannel(e,t);return s?(await s.installModule(e,t,r,n,i).catch((t=>(0,g.traceError)(`Error in installing the product '${y.ProductNames.get(e)}', ${t}`))),this.isInstalled(e,t).then((t=>((0,l.sendTelemetryEvent)(h.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:s.displayName,productName:y.ProductNames.get(e),isInstalled:t}),t?d.InstallerResponse.Installed:d.InstallerResponse.Ignore)))):((0,l.sendTelemetryEvent)(h.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:"unavailable",productName:y.ProductNames.get(e)}),d.InstallerResponse.Ignore)}async isProductVersionCompatible(e,t,r){const n=await this.getProductSemVer(e,r);return n?s.satisfies(n,t)?d.ProductInstallStatus.Installed:d.ProductInstallStatus.NeedsUpgrade:d.ProductInstallStatus.NotInstalled}async getProductSemVer(e,t){const r=(0,f.isResource)(t)?void 0:t,n=(0,f.isResource)(t)?t:void 0,i=this.getExecutableNameFromSettings(e,n);let o;if(this.isExecutableAModule(e,n)){const e=await this.serviceContainer.get(p.IPythonExecutionFactory).createActivatedEnvironment({resource:n,interpreter:r,allowEnvironmentFetchExceptions:!0});o=await e.getModuleVersion(i)}else{const e=await this.serviceContainer.get(p.IProcessServiceFactory).create(n);o=(await e.exec(i,["--version"],{mergeStdOutErr:!0})).stdout.trim()}if(!o)return null;try{return s.coerce(o)}catch(t){return(0,g.traceError)(`Unable to parse version ${o} for product ${e}: `,t),null}}async isInstalled(e,t){if(e===d.Product.unittest)return!0;const r=(0,f.isResource)(t)?void 0:t,n=(0,f.isResource)(t)?t:void 0,i=this.getExecutableNameFromSettings(e,n);return this.isExecutableAModule(e,n)?(await this.serviceContainer.get(p.IPythonExecutionFactory).createActivatedEnvironment({resource:n,interpreter:r,allowEnvironmentFetchExceptions:!0})).isModuleInstalled(i):(await this.serviceContainer.get(p.IProcessServiceFactory).create(n)).exec(i,["--version"],{mergeStdOutErr:!0}).then((()=>!0)).catch((()=>!1))}getExecutableNameFromSettings(e,t){const r=this.productService.getProductType(e);return this.serviceContainer.get(m.IProductPathService,r).getExecutableNameFromSettings(e,t)}isExecutableAModule(e,t){const r=this.productService.getProductType(e);return this.serviceContainer.get(m.IProductPathService,r).isExecutableAModule(e,t)}}T.PromptPromises=new Map;class P extends T{async install(e,t,r,n){var i,o,s,a;if((0,f.isResource)(t))throw new Error("All data science packages require an interpreter be passed in");const c=t;let p=await this.serviceContainer.get(m.IInstallationChannelManager).getInstallationChannels(c);const b=(0,v.translateProductToModule)(e),_=`${(null===(i=c.version)||void 0===i?void 0:i.major)||""}.${(null===(o=c.version)||void 0===o?void 0:o.minor)||""}.${(null===(s=c.version)||void 0===s?void 0:s.patch)||""}`;if(n&&n&m.ModuleInstallFlags.installPipIfRequired&&c.envType!==u.EnvironmentType.Conda&&!p.some((e=>e.type===u.ModuleInstallerType.Pip))){const e=this.serviceContainer.getAll(m.IModuleInstaller).find((e=>e.type===u.ModuleInstallerType.Pip));e?((0,g.traceInfo)(`Installing pip as its not available to install ${b}.`),await e.installModule(d.Product.pip,c,r).catch((e=>(0,g.traceError)(`Error in installing the module '${b} as Pip could not be installed', ${e}`))),await this.isInstalled(d.Product.pip,c).then((t=>{(0,l.sendTelemetryEvent)(h.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:e.displayName,requiredInstaller:u.ModuleInstallerType.Pip,version:_,envType:c.envType,isInstalled:t,productName:y.ProductNames.get(d.Product.pip)})})).catch(f.noop),p=await this.serviceContainer.get(m.IInstallationChannelManager).getInstallationChannels(c)):((0,l.sendTelemetryEvent)(h.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:"unavailable",requiredInstaller:u.ModuleInstallerType.Pip,productName:y.ProductNames.get(d.Product.pip),version:_,envType:c.envType}),(0,g.traceError)("Unable to install pip when its required."))}const S=!(null===(a=w.get(e))||void 0===a?void 0:a.has(u.EnvironmentType.Conda));let T=u.ModuleInstallerType.Unknown;if(c.envType===u.EnvironmentType.Conda&&S)T=u.ModuleInstallerType.Conda;else if(c.envType!==u.EnvironmentType.Conda||S)switch(c.envType){case u.EnvironmentType.Pipenv:T=u.ModuleInstallerType.Pipenv;break;case u.EnvironmentType.Poetry:T=u.ModuleInstallerType.Poetry;break;default:T=u.ModuleInstallerType.Pip}else(0,g.traceInfo)(`Interpreter type is conda but package ${b} is not available through conda, using pip instead.`),T=u.ModuleInstallerType.Pip;const P=p.find((e=>e.type===T));return P?(await P.installModule(e,c,r,n).catch((e=>(0,g.traceError)(`Error in installing the module '${b}', ${e}`))),this.isInstalled(e,c).then((t=>((0,l.sendTelemetryEvent)(h.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:P.displayName||"",requiredInstaller:T,version:_,envType:c.envType,isInstalled:t,productName:y.ProductNames.get(e)}),t?d.InstallerResponse.Installed:d.InstallerResponse.Ignore)))):(this.appShell.showErrorMessage(E.Installer.couldNotInstallLibrary().format(b)).then(f.noop,f.noop),(0,l.sendTelemetryEvent)(h.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:"unavailable",requiredInstaller:T,productName:y.ProductNames.get(e),version:_,envType:c.envType}),d.InstallerResponse.Ignore)}async promptToInstallImplementation(e,t,r,n){const i=y.ProductNames.get(e);return"Yes"===await this.appShell.showErrorMessage(E.Installer.dataScienceInstallPrompt().format(i),"Yes","No")?this.install(e,t,r):d.InstallerResponse.Ignore}}t.DataScienceInstaller=P;let I=class{constructor(e){this.serviceContainer=e}async isInstalled(e,t){var r;if(e!==d.Product.python)throw new Error(`${e} cannot be installed via conda python installer`);const n=this.serviceContainer.get(a.IInterpreterService),i=(0,f.isResource)(t)?await n.getActiveInterpreter(t):t;return!i||!((null===(r=i.envPath)||void 0===r?void 0:r.length)&&i.envType===u.EnvironmentType.Conda&&!(0,b.isParentPath)(null==i?void 0:i.path,i.envPath))}async install(e,t,r,n){if(e!==d.Product.python)throw new Error(`${e} cannot be installed via python installer`);const i=this.serviceContainer.getAll(m.IModuleInstaller).find((e=>e.type===u.ModuleInstallerType.Conda));if(!i||!await i.isSupported(t))return(0,g.traceError)("Conda installer not available for installing python in the given environment"),d.InstallerResponse.Ignore;const o=(0,v.translateProductToModule)(e);return await i.installModule(d.Product.python,t,void 0,void 0,{installAsProcess:!0}).catch((e=>(0,g.traceError)(`Error in installing the module '${o}', ${e}`))),this.isInstalled(e,t).then((e=>e?d.InstallerResponse.Installed:d.InstallerResponse.Ignore))}async promptToInstall(e,t,r,n){return d.InstallerResponse.Ignore}async isProductVersionCompatible(e,t,r){return d.ProductInstallStatus.Installed}};I=n([i(0,(0,o.inject)(c.IServiceContainer))],I),t.PythonInstaller=I;let O=class{constructor(e){this.serviceContainer=e,this.productService=e.get(m.IProductService),this.interpreterService=this.serviceContainer.get(a.IInterpreterService)}dispose(){}async promptToInstall(e,t,r,n){return((0,f.isResource)(t)?await this.interpreterService.getActiveInterpreter(t):t)?this.createInstaller(e).promptToInstall(e,t,r,n):d.InstallerResponse.Ignore}async isProductVersionCompatible(e,t,r){return this.createInstaller(e).isProductVersionCompatible(e,t,r)}async install(e,t,r,n,i){return this.createInstaller(e).install(e,t,r,n,i)}async isInstalled(e,t){return this.createInstaller(e).isInstalled(e,t)}translateProductToModuleName(e){return(0,v.translateProductToModule)(e)}createInstaller(e){switch(this.productService.getProductType(e)){case d.ProductType.DataScience:return new P(this.serviceContainer);case d.ProductType.Python:return new I(this.serviceContainer)}throw new Error(`Unknown product ${e}`)}};O=n([(0,o.injectable)(),i(0,(0,o.inject)(c.IServiceContainer))],O),t.ProductInstaller=O},92674:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProductNames=void 0;const n=r(61684);t.ProductNames=new Map,t.ProductNames.set(n.Product.autopep8,"autopep8"),t.ProductNames.set(n.Product.bandit,"bandit"),t.ProductNames.set(n.Product.black,"black"),t.ProductNames.set(n.Product.flake8,"flake8"),t.ProductNames.set(n.Product.mypy,"mypy"),t.ProductNames.set(n.Product.pycodestyle,"pycodestyle"),t.ProductNames.set(n.Product.pylama,"pylama"),t.ProductNames.set(n.Product.prospector,"prospector"),t.ProductNames.set(n.Product.pydocstyle,"pydocstyle"),t.ProductNames.set(n.Product.pylint,"pylint"),t.ProductNames.set(n.Product.pytest,"pytest"),t.ProductNames.set(n.Product.yapf,"yapf"),t.ProductNames.set(n.Product.tensorboard,"tensorboard"),t.ProductNames.set(n.Product.torchProfilerInstallName,"torch-tb-profiler"),t.ProductNames.set(n.Product.torchProfilerImportName,"torch_tb_profiler"),t.ProductNames.set(n.Product.jupyter,"jupyter"),t.ProductNames.set(n.Product.notebook,"notebook"),t.ProductNames.set(n.Product.ipykernel,"ipykernel"),t.ProductNames.set(n.Product.nbconvert,"nbconvert"),t.ProductNames.set(n.Product.kernelspec,"kernelspec"),t.ProductNames.set(n.Product.pandas,"pandas"),t.ProductNames.set(n.Product.pip,"pip"),t.ProductNames.set(n.Product.ensurepip,"ensurepip")},43942:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataScienceProductPathService=t.BaseProductPathsService=void 0;const o=r(86700),s=r(71017),a=r(77498),c=r(61684);let u=class{constructor(e){this.serviceContainer=e,this.configService=e.get(c.IConfigurationService),this.productInstaller=e.get(c.IInstaller)}isExecutableAModule(e,t){let r;try{r=this.productInstaller.translateProductToModuleName(e)}catch(e){}const n=this.getExecutableNameFromSettings(e,t);return"string"==typeof r&&r.length>0&&s.basename(n)===n}};u=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],u),t.BaseProductPathsService=u;let l=class extends u{constructor(e){super(e)}getExecutableNameFromSettings(e,t){return this.productInstaller.translateProductToModuleName(e)}};l=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],l),t.DataScienceProductPathService=l},23202:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ProductService=void 0;const i=r(86700),o=r(61684);let s=class{constructor(){this.ProductTypes=new Map,this.ProductTypes.set(o.Product.jupyter,o.ProductType.DataScience),this.ProductTypes.set(o.Product.notebook,o.ProductType.DataScience),this.ProductTypes.set(o.Product.ipykernel,o.ProductType.DataScience),this.ProductTypes.set(o.Product.nbconvert,o.ProductType.DataScience),this.ProductTypes.set(o.Product.kernelspec,o.ProductType.DataScience),this.ProductTypes.set(o.Product.pandas,o.ProductType.DataScience),this.ProductTypes.set(o.Product.tensorboard,o.ProductType.DataScience),this.ProductTypes.set(o.Product.torchProfilerInstallName,o.ProductType.DataScience),this.ProductTypes.set(o.Product.torchProfilerImportName,o.ProductType.DataScience),this.ProductTypes.set(o.Product.pip,o.ProductType.DataScience),this.ProductTypes.set(o.Product.ensurepip,o.ProductType.DataScience),this.ProductTypes.set(o.Product.python,o.ProductType.Python)}getProductType(e){return this.ProductTypes.get(e)}};s=n([(0,i.injectable)()],s),t.ProductService=s},34061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const n=r(61684),i=r(95939),o=r(5181),s=r(22577),a=r(36352),c=r(73300),u=r(43942),l=r(23202),h=r(59747);t.registerTypes=function(e){e.addSingleton(h.IModuleInstaller,o.CondaInstaller),e.addSingleton(h.IModuleInstaller,a.PipInstaller),e.addSingleton(h.IModuleInstaller,s.PipEnvInstaller),e.addSingleton(h.IModuleInstaller,c.PoetryInstaller),e.addSingleton(h.IInstallationChannelManager,i.InstallationChannelManager),e.addSingleton(h.IProductService,l.ProductService),e.addSingleton(h.IProductPathService,u.DataScienceProductPathService,n.ProductType.DataScience)}},59747:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ModuleInstallFlags=t.IProductPathService=t.IProductService=t.IInstallationChannelManager=t.IPythonInstallation=t.IBaseInstaller=t.IModuleInstaller=void 0,t.IModuleInstaller=Symbol("IModuleInstaller"),t.IBaseInstaller=Symbol("IBaseInstaller"),t.IPythonInstallation=Symbol("IPythonInstallation"),t.IInstallationChannelManager=Symbol("IInstallationChannelManager"),t.IProductService=Symbol("IProductService"),t.IProductPathService=Symbol("IProductPathService"),(r=t.ModuleInstallFlags||(t.ModuleInstallFlags={}))[r.upgrade=1]="upgrade",r[r.updateDependencies=2]="updateDependencies",r[r.reInstall=4]="reInstall",r[r.installPipIfRequired=8]="installPipIfRequired"},97469:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterPathService=t.defaultInterpreterPathSetting=void 0;const o=r(55674),s=r(86700),a=r(66828),c=r(19735),u=r(17585),l=r(89515),h=r(77570),p=r(48431),d=r(61684),f=r(48683);t.defaultInterpreterPathSetting="defaultInterpreterPath";const v=process.env.CI_PYTHON_PATH&&o.existsSync(process.env.CI_PYTHON_PATH)?process.env.CI_PYTHON_PATH:"python";let y=class{constructor(e,t,r){this.persistentStateFactory=e,this.workspaceService=t,this._didChangeInterpreterEmitter=new a.EventEmitter,r.push(this.workspaceService.onDidChangeConfiguration(this.onDidChangeConfiguration.bind(this))),this.fileSystemPaths=p.FileSystemPaths.withDefaults()}get onDidChange(){return this._didChangeInterpreterEmitter.event}async onDidChangeConfiguration(e){e.affectsConfiguration(`python.${t.defaultInterpreterPathSetting}`)&&this._didChangeInterpreterEmitter.fire({uri:void 0,configTarget:a.ConfigurationTarget.Global})}inspect(e){var t,r;let n,i;(e=l.PythonSettings.getSettingsUriAndTarget(e,this.workspaceService).uri)&&(n=this.persistentStateFactory.createGlobalPersistentState(this.getSettingKey(e,a.ConfigurationTarget.WorkspaceFolder),void 0),i=this.persistentStateFactory.createGlobalPersistentState(this.getSettingKey(e,a.ConfigurationTarget.Workspace),void 0));const o=null!==(r=null===(t=this.workspaceService.getConfiguration("python",e))||void 0===t?void 0:t.inspect("defaultInterpreterPath"))&&void 0!==r?r:{};return{globalValue:o.globalValue,workspaceFolderValue:(null==n?void 0:n.value)||o.workspaceFolderValue,workspaceValue:(null==i?void 0:i.value)||o.workspaceValue}}get(e){var t;const r=this.inspect(e),n=r.workspaceFolderValue||r.workspaceValue||r.globalValue||((0,h.isTestExecution)()?v:"python");return new f.SystemVariables(void 0,null===(t=this.workspaceService.getWorkspaceFolder(e))||void 0===t?void 0:t.uri.fsPath,this.workspaceService).resolveAny(n)}async update(e,t,r){if(e=l.PythonSettings.getSettingsUriAndTarget(e,this.workspaceService).uri,t===a.ConfigurationTarget.Global){const e=this.workspaceService.getConfiguration("python");return void(e.inspect("defaultInterpreterPath").globalValue!==r&&(await e.update("defaultInterpreterPath",r,!0),this._didChangeInterpreterEmitter.fire({uri:void 0,configTarget:t})))}if(!e)return void(0,c.traceError)("Cannot update workspace settings as no workspace is opened");const n=this.getSettingKey(e,t),i=this.persistentStateFactory.createGlobalPersistentState(n,void 0);i.value!==r&&(await i.updateValue(r),this._didChangeInterpreterEmitter.fire({uri:e,configTarget:t}))}getSettingKey(e,t){let r;const n=this.workspaceService.getWorkspaceFolderIdentifier(e);return r=t===a.ConfigurationTarget.WorkspaceFolder?`WORKSPACE_FOLDER_INTERPRETER_PATH_${n}`:this.workspaceService.workspaceFile?`WORKSPACE_INTERPRETER_PATH_${this.fileSystemPaths.normCase(this.workspaceService.workspaceFile.fsPath)}`:`WORKSPACE_FOLDER_INTERPRETER_PATH_${n}`,r}};y=n([(0,s.injectable)(),i(0,(0,s.inject)(d.IPersistentStateFactory)),i(1,(0,s.inject)(u.IWorkspaceService)),i(2,(0,s.inject)(d.IDisposableRegistry))],y),t.InterpreterPathService=y},21621:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserService=t.launch=void 0;const i=r(86700),o=r(66828);function s(e){o.env.openExternal(o.Uri.parse(e))}t.launch=s;let a=class{launch(e){s(e)}};a=n([(0,i.injectable)()],a),t.BrowserService=a},39425:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.FileDownloader=void 0;const o=r(86700),s=r(19735),a=r(17585),c=r(77570),u=r(84974),l=r(61684),h=r(67098),p=r(3481);let d=class{constructor(e,t,r){this.httpClient=e,this.fs=t,this.appShell=r}async downloadFile(e,t){(0,s.traceLog)(h.Http.downloadingFile().format(e));const r=await this.fs.createTemporaryFile(t.extension);return await this.downloadFileWithStatusBarProgress(e,t.progressMessagePrefix,r.filePath).then(p.noop,(e=>(r.dispose(),Promise.reject(e)))),r.filePath}async downloadFileWithStatusBarProgress(e,t,r){await this.appShell.withProgressCustomIcon(c.Octicons.Downloading,(async n=>{const i=await this.httpClient.downloadFile(e),o=this.fs.createWriteStream(r);return this.displayDownloadProgress(e,n,i,o,t)}))}async displayDownloadProgress(e,t,n,i,o){return new Promise(((s,a)=>{n.on("response",(t=>{200!==t.statusCode&&a(new Error(`Failed with status ${t.statusCode}, ${t.statusMessage}, Uri ${e}`))})),r(95095)(n).on("progress",(e=>{const r=function(e,t){const r=Math.round(t.size.transferred/1024),n=Math.round(t.size.total/1024),i=Math.round(100*t.percent);return h.Http.downloadingFileProgress().format(e,r.toString(),n.toString(),i.toString())}(o,e);t.report({message:r})})).on("error",a).pipe(i).on("error",a).on("close",s)}))}};d=n([(0,o.injectable)(),i(0,(0,o.inject)(l.IHttpClient)),i(1,(0,o.inject)(u.IFileSystem)),i(2,(0,o.inject)(a.IApplicationShell))],d),t.FileDownloader=d},90220:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpClient=void 0;const o=r(86700),s=r(60516),a=r(77498),c=r(19735),u=r(17585);let l=class{constructor(e){const t=e.get(u.IWorkspaceService);this.requestOptions={proxy:t.getConfiguration("http").get("proxy","")}}async downloadFile(e){return(await Promise.resolve().then((()=>r(48663))))(e,this.requestOptions)}async getJSON(e,t=!0){const r=await this.getContents(e);return this.parseBodyToJSON(r,t)}async parseBodyToJSON(e,t){if(t)return JSON.parse(e);{let t=[];const r=(0,s.parse)(e,t,{allowTrailingComma:!0,disallowComments:!1});return t.length>0&&(0,c.traceError)("JSONC parser returned ParseError codes",t),r}}async exists(e){const t=r(48663);return new Promise((r=>{try{t.get(e,this.requestOptions).on("response",(e=>r(200===e.statusCode))).on("error",(()=>r(!1)))}catch(e){r(!1)}}))}async getContents(e){const t=r(48663);return new Promise(((r,n)=>{t(e,this.requestOptions,((t,i,o)=>t?n(t):200!==i.statusCode?n(new Error(`Failed with status ${i.statusCode}, ${i.statusMessage}, Uri ${e}`)):void r(o)))}))}};l=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],l),t.HttpClient=l},73766:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalStorage=t.PersistentStateFactory=t.WORKSPACE_PERSISTENT_KEYS_DEPRECATED=t.GLOBAL_PERSISTENT_KEYS_DEPRECATED=t.PersistentState=void 0;const o=r(86700),s=r(19735),a=r(17585),c=r(77570),u=r(61684),l=r(36952);class h{constructor(e,t,r,n){this.storage=e,this.key=t,this.defaultValue=r,this.expiryDurationMs=n}get value(){if(this.expiryDurationMs){const e=this.storage.get(this.key,{data:this.defaultValue});return!e||!e.expiry||e.expiry0&&r.updateValue([]).ignoreErrors(),n.value.length>0&&n.updateValue([]).ignoreErrors()}createGlobalPersistentState(e,t,r){return this.addKeyToStorage("global",e,t).ignoreErrors(),new h(this.globalState,e,t,r)}createWorkspacePersistentState(e,t,r){return this.addKeyToStorage("workspace",e,t).ignoreErrors(),new h(this.workspaceState,e,t,r)}async addKeyToStorage(e,t,r){const n="global"===e?this._globalKeysStorage:this._workspaceKeysStorage;n.value.find((e=>e.key===t))||await n.updateValue([{key:t,defaultValue:r},...n.value])}async cleanAllPersistentStates(){this.cleanedOnce?(0,s.traceError)("Storage can only be cleaned once per session, reload window."):(await Promise.all(this._globalKeysStorage.value.map((async e=>{const t=this.createGlobalPersistentState(e.key);await t.updateValue(e.defaultValue)}))),await Promise.all(this._workspaceKeysStorage.value.map((async e=>{const t=this.createWorkspacePersistentState(e.key);await t.updateValue(e.defaultValue)}))),await this._globalKeysStorage.updateValue([]),await this._workspaceKeysStorage.updateValue([]),this.cleanedOnce=!0,(0,s.traceVerbose)("Finished clearing storage."))}};n([(0,l.cache)(-1,!0)],d.prototype,"addKeyToStorage",null),d=n([(0,o.injectable)(),i(0,(0,o.inject)(u.IMemento)),i(0,(0,o.named)(u.GLOBAL_MEMENTO)),i(1,(0,o.inject)(u.IMemento)),i(1,(0,o.named)(u.WORKSPACE_MEMENTO)),i(2,(0,o.inject)(a.ICommandManager))],d),t.PersistentStateFactory=d,t.getGlobalStorage=function(e,t,r){const n=new h(e.globalState,p,[]);if(!n.value.find((e=>e.key===t&&e.defaultValue===r))){const e=[{key:t,defaultValue:r},...n.value];n.updateValue(e).ignoreErrors()}const i=new h(e.globalState,t,r);return{get:()=>i.value,set:e=>i.updateValue(e)}}},93666:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IS_WINDOWS=void 0,t.IS_WINDOWS=/^win/.test(process.platform)},95311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNoPermissionsError=t.isNotDirError=t.isFileIsDirError=t.isFileExistsError=t.isFileNotFoundError=t.createDirNotEmptyError=void 0;const n=r(66828);var i;function o(e,t){const r=e.code;if(r)return r===t}!function(e){const t=n.FileSystemError.FileNotFound().name,r=n.FileSystemError.FileExists().name,i=n.FileSystemError.FileIsADirectory().name,o=n.FileSystemError.FileNotADirectory().name,s=n.FileSystemError.NoPermissions().name,a=[t,r,i,o,s];function c(e,t){if(a.includes(e.name))return e.name===t}e.isFileNotFound=function(e){return c(e,t)},e.isFileExists=function(e){return c(e,r)},e.isFileIsDir=function(e){return c(e,i)},e.isNotDir=function(e){return c(e,o)},e.isNoPermissions=function(e){return c(e,s)}}(i||(i={})),t.createDirNotEmptyError=function(e){const t=new Error(`directory "${e}" not empty`);return t.name="SystemError",t.code="ENOTEMPTY",t.path=e,t.syscall="rmdir",t},t.isFileNotFoundError=function(e){const t=e,r=i.isFileNotFound(t);return void 0!==r?r:o(t,"ENOENT")},t.isFileExistsError=function(e){const t=e,r=i.isFileExists(t);return void 0!==r?r:o(t,"EEXIST")},t.isFileIsDirError=function(e){const t=i.isFileIsDir(e);return void 0!==t?t:o(e,"EISDIR")},t.isNotDirError=function(e){const t=i.isNotDir(e);return void 0!==t?t:o(e,"ENOTDIR")},t.isNoPermissionsError=function(e){const t=e,r=i.isNoPermissions(t);return void 0!==r?r:o(t,"EACCES")}},90209:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystem=t.getHashString=t.FileSystemUtils=t.RawFileSystem=t.convertStat=void 0;const i=r(6113),o=r(55674),s=r(12884),a=r(86700),c=r(73837),u=r(66828),l=r(19735);r(32727);const h=r(56091),p=r(95311),d=r(48431),f=r(22512),v=r(84974),y="utf8";function m(e,t){return{type:t,size:e.size,ctime:Math.round(e.ctimeMs),mtime:Math.round(e.mtimeMs)}}function g(e,t){return t===v.FileType.Unknown?e.filter((([e,t])=>t===v.FileType.Unknown||t===(v.FileType.SymbolicLink&v.FileType.Unknown))):e.filter((([e,r])=>(r&t)>0))}t.convertStat=m;class b{constructor(e,t,r){this.paths=e,this.vscfs=t,this.fsExtra=r}static withDefaults(e,t,r){return new b(e||d.FileSystemPaths.withDefaults(),t||u.workspace.fs,r||o)}async pathExists(e){return this.fsExtra.pathExists(e)}async stat(e){const t=u.Uri.file(e);return this.vscfs.stat(t)}async lstat(e){const t=await this.fsExtra.lstat(e);return m(t,(0,h.convertFileType)(t))}async chmod(e,t){return this.fsExtra.chmod(e,t)}async move(e,t){const r=u.Uri.file(e),n=u.Uri.file(t);await this.vscfs.stat(u.Uri.file(this.paths.dirname(t)));const i={overwrite:!1};try{await this.vscfs.rename(r,n,i)}catch(e){if(!(0,p.isFileExistsError)(e))throw e;if((await this.vscfs.stat(n)).type===v.FileType.Directory)throw e;i.overwrite=!0,await this.vscfs.rename(r,n,i)}}async readData(e){const t=u.Uri.file(e),r=await this.vscfs.readFile(t);return Buffer.from(r)}async readText(e){const t=u.Uri.file(e),r=await this.vscfs.readFile(t);return Buffer.from(r).toString(y)}async writeText(e,t){const r=u.Uri.file(e),n=Buffer.from(t);await this.vscfs.writeFile(r,n)}async appendText(e,t){return this.fsExtra.appendFile(e,t)}async copyFile(e,t){const r=u.Uri.file(e),n=u.Uri.file(t);await this.vscfs.stat(u.Uri.file(this.paths.dirname(t))),await this.vscfs.copy(r,n,{overwrite:!0})}async rmfile(e){const t=u.Uri.file(e);return this.vscfs.delete(t,{recursive:!1,useTrash:!1})}async rmdir(e){const t=u.Uri.file(e),r=await this.vscfs.readDirectory(t);if(r&&r.length>0)throw(0,p.createDirNotEmptyError)(e);return this.vscfs.delete(t,{recursive:!0,useTrash:!1})}async rmtree(e){const t=u.Uri.file(e);return await this.vscfs.stat(t),this.vscfs.delete(t,{recursive:!0,useTrash:!1})}async mkdirp(e){const t=u.Uri.file(e);await this.vscfs.createDirectory(t)}async listdir(e){const t=u.Uri.file(e);return(await this.vscfs.readDirectory(t)).map((([t,r])=>[this.paths.join(e,t),r]))}statSync(e){let t=this.fsExtra.lstatSync(e),r=v.FileType.Unknown;return t.isSymbolicLink()&&(r=v.FileType.SymbolicLink,t=this.fsExtra.statSync(e)),r|=(0,h.convertFileType)(t),m(t,r)}readTextSync(e){return this.fsExtra.readFileSync(e,y)}createReadStream(e){return this.fsExtra.createReadStream(e)}createWriteStream(e){return this.fsExtra.createWriteStream(e)}}t.RawFileSystem=b;class _{constructor(e,t,r,n,i,o){this.raw=e,this.pathUtils=t,this.paths=r,this.tmp=n,this.getHash=i,this.globFiles=o}static withDefaults(e,t,r,n,i){return t=t||d.FileSystemPathUtils.withDefaults(),new _(e||b.withDefaults(t.paths),t,t.paths,r||f.TemporaryFileSystem.withDefaults(),n||E,i||(0,c.promisify)(s))}async createDirectory(e){return this.raw.mkdirp(e)}async deleteDirectory(e){return this.raw.rmdir(e)}async deleteFile(e){return this.raw.rmfile(e)}async pathExists(e,t){if(void 0===t)return this.raw.pathExists(e);let r;try{r=await this.raw.stat(e)}catch(t){return(0,p.isFileNotFoundError)(t)||(0,l.traceError)(`stat() failed for "${e}"`,t),!1}return t===v.FileType.Unknown?r.type===v.FileType.Unknown:(r.type&t)===t}async fileExists(e){return this.pathExists(e,v.FileType.File)}async directoryExists(e){return this.pathExists(e,v.FileType.Directory)}async listdir(e){try{return await this.raw.listdir(e)}catch(t){if(!await this.pathExists(e))return[];throw t}}async getSubDirectories(e){return g(await this.listdir(e),v.FileType.Directory).map((([e,t])=>e))}async getFiles(e){return g(await this.listdir(e),v.FileType.File).map((([e,t])=>e))}async isDirReadonly(e){const t=`${e}${this.paths.sep}___vscpTest___`;try{await this.raw.stat(e),await this.raw.writeText(t,"")}catch(e){if((0,p.isNoPermissionsError)(e))return!0;throw e}return this.raw.rmfile(t).ignoreErrors(),!1}async getFileHash(e){const t=await this.raw.lstat(e),r=`${t.ctime}-${t.mtime}`;return this.getHash(r)}async search(e,t,r){let n;t&&(n={...n,cwd:t}),r&&(n={...n,dot:r});const i=await this.globFiles(e,n);return Array.isArray(i)?i:[]}fileExistsSync(e){try{this.raw.statSync(e)}catch(e){if((0,p.isFileNotFoundError)(e))return!1;throw e}return!0}}function E(e){const t=(0,i.createHash)("sha512");return t.update(e),t.digest("hex")}t.FileSystemUtils=_,t.getHashString=E;let S=class{constructor(){this.utils=_.withDefaults()}get directorySeparatorChar(){return this.utils.paths.sep}arePathsSame(e,t){return this.utils.pathUtils.arePathsSame(e,t)}getDisplayName(e){return this.utils.pathUtils.getDisplayName(e)}async stat(e){return this.utils.raw.stat(e)}async createDirectory(e){return this.utils.createDirectory(e)}async deleteDirectory(e){return this.utils.deleteDirectory(e)}async listdir(e){return this.utils.listdir(e)}async readFile(e){return this.utils.raw.readText(e)}async readData(e){return this.utils.raw.readData(e)}async writeFile(e,t){return this.utils.raw.writeText(e,t)}async appendFile(e,t){return this.utils.raw.appendText(e,t)}async copyFile(e,t){return this.utils.raw.copyFile(e,t)}async deleteFile(e){return this.utils.deleteFile(e)}async chmod(e,t){return this.utils.raw.chmod(e,t)}async move(e,t){await this.utils.raw.move(e,t)}readFileSync(e){return this.utils.raw.readTextSync(e)}createReadStream(e){return this.utils.raw.createReadStream(e)}createWriteStream(e){return this.utils.raw.createWriteStream(e)}async fileExists(e){return this.utils.fileExists(e)}pathExists(e){return this.utils.pathExists(e)}fileExistsSync(e){return this.utils.fileExistsSync(e)}async directoryExists(e){return this.utils.directoryExists(e)}async getSubDirectories(e){return this.utils.getSubDirectories(e)}async getFiles(e){return this.utils.getFiles(e)}async getFileHash(e){return this.utils.getFileHash(e)}async search(e,t,r){return this.utils.search(e,t,r)}async createTemporaryFile(e,t){return this.utils.tmp.createFile(e,t)}async isDirReadonly(e){return this.utils.isDirReadonly(e)}};S=n([(0,a.injectable)()],S),t.FileSystem=S},88409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.watchLocationForPattern=t.FileChangeType=void 0;const n=r(66828),i=r(19735),o=r(81837);var s;!function(e){e.Changed="changed",e.Created="created",e.Deleted="deleted"}(s=t.FileChangeType||(t.FileChangeType={})),t.watchLocationForPattern=function(e,t,r){const a=new n.RelativePattern(e,t),c=new o.Disposables;(0,i.traceVerbose)(`Start watching: ${e} with pattern ${t} using VSCode API`);try{const e=n.workspace.createFileSystemWatcher(a);c.push(e.onDidCreate((e=>r(s.Created,e.fsPath)))),c.push(e.onDidChange((e=>r(s.Changed,e.fsPath)))),c.push(e.onDidDelete((e=>r(s.Deleted,e.fsPath))))}catch(r){(0,i.traceError)(`Failed to create File System watcher for patter ${t} in ${e}`,r)}return c}},48431:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arePathsSame=t.isParentPath=t.normCasePath=t.FileSystemPathUtils=t.Executables=t.FileSystemPaths=void 0;const n=r(71017),i=r(47237),o=r(87450),s=r(58967);class a{constructor(e,t){this.isCaseInsensitive=e,this.raw=t}static withDefaults(e){return void 0===e&&(e=(0,o.getOSType)()===o.OSType.Windows),new a(e,n)}get sep(){return this.raw.sep}join(...e){return this.raw.join(...e)}dirname(e){return this.raw.dirname(e)}basename(e,t){return this.raw.basename(e,t)}normalize(e){return this.raw.normalize(e)}normCase(e){return e=this.raw.normalize(e),this.isCaseInsensitive?e.toUpperCase():e}}t.FileSystemPaths=a;class c{constructor(e,t){this.delimiter=e,this.osType=t}static withDefaults(){return new c(n.delimiter,(0,o.getOSType)())}get envVar(){return(0,i.getSearchPathEnvVarNames)(this.osType)[0]}}t.Executables=c;class u{constructor(e,t,r,n){this.home=e,this.paths=t,this.executables=r,this.raw=n}static withDefaults(e){return void 0===e&&(e=a.withDefaults()),new u(s("~"),e,c.withDefaults(),n)}arePathsSame(e,t){return(e=this.paths.normCase(e))===this.paths.normCase(t)}getDisplayName(e,t){return t&&h(e,t)?`.${this.paths.sep}${this.raw.relative(t,e)}`:h(e,this.home)?`~${this.paths.sep}${this.raw.relative(this.home,e)}`:e}}function l(e){return(0,o.getOSType)()===o.OSType.Windows?n.normalize(e).toUpperCase():n.normalize(e)}function h(e,t){return t.endsWith(n.sep)||(t+=n.sep),e.endsWith(n.sep)||(e+=n.sep),l(e).startsWith(l(t))}t.FileSystemPathUtils=u,t.normCasePath=l,t.isParentPath=h,t.arePathsSame=function(e,t){return l(e)===l(t)}},22512:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TemporaryFileSystem=void 0;const n=r(36276);class i{constructor(e){this.raw=e}static withDefaults(){return new i(n)}createFile(e,t){const r={postfix:e,mode:t};return new Promise(((e,t)=>{this.raw.file(r,((r,n,i,o)=>{if(r)return t(r);e({filePath:n,dispose:o})}))}))}}t.TemporaryFileSystem=i},79434:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PathUtils=void 0;const o=r(86700),s=r(71017),a=r(61684),c=r(87450),u=r(48431),l=r(58967);let h=class{constructor(e){const t=e?c.OSType.Windows:c.OSType.Unknown;this.utils=new u.FileSystemPathUtils(l("~"),u.FileSystemPaths.withDefaults(),new u.Executables(s.delimiter,t),s)}get home(){return this.utils.home}get delimiter(){return this.utils.executables.delimiter}get separator(){return this.utils.paths.sep}getPathVariableName(){return this.utils.executables.envVar}getDisplayName(e,t){return this.utils.getDisplayName(e,t)}basename(e,t){return this.utils.paths.basename(e,t)}};h=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IsWindows))],h),t.PathUtils=h},65243:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.PlatformService=void 0;const i=r(86700),o=r(22037),s=r(36625),a=r(47237),c=r(87450),u=r(52439);let l=class{constructor(){this.osType=(0,c.getOSType)()}get pathVariableName(){return(0,a.getSearchPathEnvVarNames)(this.osType)[0]}get virtualEnvBinName(){return this.isWindows?"Scripts":"bin"}async getVersion(){if(this.version)return this.version;switch(this.osType){case c.OSType.Windows:case c.OSType.OSX:try{const e=(0,s.coerce)(o.release());if(e)return this.version=e,this.version;throw new Error("Unable to parse version")}catch(e){return(0,u.parseSemVerSafe)(o.release())}default:throw new Error("Not Supported")}}get isWindows(){return this.osType===c.OSType.Windows}get isMac(){return this.osType===c.OSType.OSX}get isLinux(){return this.osType===c.OSType.Linux}get osRelease(){return o.release()}get is64bit(){return(0,c.getArchitecture)()===c.Architecture.x64}};l=n([(0,i.injectable)()],l),t.PlatformService=l},3522:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.getArchitectureDisplayName=t.RegistryImplementation=void 0;const i=r(86700),o=r(19735),s=r(87450),a=r(84974);var c;!function(e){e.x86="x86",e.x64="x64"}(c||(c={}));let u=class{async getKeys(e,t,n){return async function(e){const t=r(1283);return new Promise((r=>{new t(e).keys(((e,t)=>{if(e||!Array.isArray(t))return r([]);r(t.filter((e=>"string"==typeof e.key)).map((e=>e.key)))}))}))}({hive:h(t),arch:l(n),key:e}).catch((e=>((0,o.traceError)("Fetching keys from windows registry resulted in an error",e),[])))}async getValue(e,t,n,i=""){return async function(e,t=""){const n=r(1283);return new Promise((r=>{new n(e).get(t,((e,t)=>{if(e||!t||"string"!=typeof t.value)return r(void 0);r(t.value)}))}))}({hive:h(t),arch:l(n),key:e},i).catch((e=>{(0,o.traceError)("Fetching key value from windows registry resulted in an error",e)}))}};function l(e){switch(e){case s.Architecture.x86:return c.x86;case s.Architecture.x64:return c.x64;default:return}}function h(e){const t=r(1283);switch(e){case a.RegistryHive.HKCU:return t.HKCU;case a.RegistryHive.HKLM:return t.HKLM;default:return}}u=n([(0,i.injectable)()],u),t.RegistryImplementation=u,t.getArchitectureDisplayName=function(e){switch(e){case s.Architecture.x64:return"64-bit";case s.Architecture.x86:return"32-bit";default:return""}}},29992:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const n=r(90209),i=r(65243),o=r(3522),s=r(84974);t.registerTypes=function(e){e.addSingleton(s.IPlatformService,i.PlatformService),e.addSingleton(s.IFileSystem,n.FileSystem),e.addSingleton(s.IRegistry,o.RegistryImplementation)}},84974:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFileSystem=t.IFileSystemPathUtils=t.IPlatformService=t.IRegistry=t.RegistryHive=t.FileType=void 0;const n=r(66828);var i;t.FileType=n.FileType,(i=t.RegistryHive||(t.RegistryHive={}))[i.HKCU=0]="HKCU",i[i.HKLM=1]="HKLM",t.IRegistry=Symbol("IRegistry"),t.IPlatformService=Symbol("IPlatformService"),t.IFileSystemPathUtils=Symbol("IFileSystemPathUtils"),t.IFileSystem=Symbol("IFileSystem")},93289:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_ENCODING=void 0,t.DEFAULT_ENCODING="utf8"},20900:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.CurrentProcess=void 0;const i=r(86700);let o=class{constructor(){this.on=(e,t)=>(process.on(e,t),process)}get env(){return process.env}get argv(){return process.argv}get stdout(){return process.stdout}get stdin(){return process.stdin}get execPath(){return process.execPath}};o=n([(0,i.injectable)()],o),t.CurrentProcess=o},73153:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecoder=void 0;const i=r(4914),o=r(86700),s=r(93289);let a=class{decode(e,t=s.DEFAULT_ENCODING){return t=i.encodingExists(t)?t:s.DEFAULT_ENCODING,i.decode(Buffer.concat(e),t)}};a=n([(0,o.injectable)()],a),t.BufferDecoder=a},31776:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getModuleVersion=t.isModuleInstalled=t.isValid=t.getUserSitePackages=t.getSitePackages=t.getExecutable=t.getSysPrefix=t.execModule=t.execCode=void 0,t.execCode=function(e){return["-c",e]},t.execModule=function(e,t){return["-m",e,...t]},t.getSysPrefix=function(){return[["-c","import sys;print(sys.prefix)"],function(e){return e.trim()}]},t.getExecutable=function(){return[["-c","import sys;print(sys.executable)"],function(e){return e.trim()}]},t.getSitePackages=function(){return[["-c","from distutils.sysconfig import get_python_lib; print(get_python_lib())"],function(e){return e.trim()}]},t.getUserSitePackages=function(){return[["site","--user-site"],function(e){return e.trim()}]},t.isValid=function(){return[["-c","print(1234)"],function(e){return e.startsWith("1234")}]},t.isModuleInstalled=function(e){return[["-c",`import ${e}`],function(e){return!0}]},t.getModuleVersion=function(e){return[["-c",`import ${e}; print(${e}.__version__)`],function(e){return e.trim()}]}},48266:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._SCRIPTS_DIR=void 0;const n=r(71017),i=r(77570);t._SCRIPTS_DIR=n.join(i.EXTENSION_ROOT_DIR,"pythonFiles")},4057:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linterScript=t.tensorboardLauncher=t.visualstudio_py_testlauncher=t.testlauncher=t.shell_exec=t.printEnvVariables=t.normalizeSelection=t.sortImports=t.interpreterInfo=t.OUTPUT_MARKER_SCRIPT=t.testingTools=void 0;const n=r(71017),i=r(48266),o=i._SCRIPTS_DIR;t.testingTools=r(81036),t.OUTPUT_MARKER_SCRIPT=n.join(i._SCRIPTS_DIR,"get_output_via_markers.py"),t.interpreterInfo=function(){const e=[n.join(o,"interpreterInfo.py")];return[e,function(t){let r;try{r=JSON.parse(t)}catch(r){throw Error(`python ${e} returned bad JSON (${t}) (${r})`)}return r}]},t.sortImports=function(e,t){const r=[n.join(o,"sortImports.py"),e,"--diff"];return t&&r.push(...t),[r,function(e){return e}]},t.normalizeSelection=function(){return[[n.join(o,"normalizeSelection.py")],function(e){return e}]},t.printEnvVariables=function(){return[[n.join(o,"printEnvVariables.py").fileToCommandArgumentForPythonExt()],function(e){return JSON.parse(e)}]},t.shell_exec=function(e,t,r){return[n.join(o,"shell_exec.py"),e.fileToCommandArgumentForPythonExt(),...r,t.fileToCommandArgumentForPythonExt()]},t.testlauncher=function(e){return[n.join(o,"testlauncher.py"),...e]},t.visualstudio_py_testlauncher=function(e){return[n.join(o,"visualstudio_py_testlauncher.py"),...e]},t.tensorboardLauncher=function(e){return[n.join(o,"tensorboard_launcher.py"),...e]},t.linterScript=function(){return n.join(o,"linter.py")}},81036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unittestDiscovery=t.runAdapter=void 0;const n=r(71017),i=r(48266),o=n.join(i._SCRIPTS_DIR,"testing_tools");t.runAdapter=function(e){return[n.join(o,"run_adapter.py"),...e]},t.unittestDiscovery=function(e){return[n.join(o,"unittest_discovery.py"),...e]}},34581:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProcessLogger=void 0;const o=r(86700),s=r(19735),a=r(17585),c=r(77570),u=r(67098),l=r(87450);let h=class{constructor(e){this.workspaceService=e}logProcess(e,t,r){if(!(0,c.isTestExecution)()&&c.isCI&&process.env.UITEST_DISABLE_PROCESS_LOGGING)return;let n=t?[e,...t].map((e=>e.trimQuotes().toCommandArgumentForPythonExt())).join(" "):e;const i=[`> ${this.getDisplayCommands(n)}`];r&&r.cwd&&i.push(`${u.Logging.currentWorkingDirectory()} ${this.getDisplayCommands(r.cwd)}`),i.forEach((e=>{(0,s.traceLog)(e)}))}getDisplayCommands(e){this.workspaceService.workspaceFolders&&1===this.workspaceService.workspaceFolders.length&&(e=p(e,this.workspaceService.workspaceFolders[0].uri.fsPath,"."));const t=(0,l.getUserHomeDir)();return t&&(e=p(e,t,"~")),e}};function p(e,t,r){const n=t.replaceAll("\\",(0,l.getOSType)()===l.OSType.Windows?"(\\\\|/)":"\\\\");let i=new RegExp(n,"ig");return e.replace(i,r)}h=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IWorkspaceService))],h),t.ProcessLogger=h},66462:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProcessService=void 0;const n=r(82361),i=r(19735),o=r(18699);class s extends n.EventEmitter{constructor(e,t){super(),this.decoder=e,this.env=t,this.processesToKill=new Set}static isAlive(e){try{return process.kill(e,0),!0}catch(e){return!1}}static kill(e){(0,o.killPid)(e)}dispose(){this.removeAllListeners(),this.processesToKill.forEach((e=>{try{e.dispose()}catch(e){}}))}execObservable(e,t,r={}){const n=(0,o.execObservable)(e,t,r,this.decoder,this.env,this.processesToKill);return this.emit("exec",e,t,r),n}exec(e,t,r={}){const n=(0,o.plainExec)(e,t,r,this.decoder,this.env,this.processesToKill);return this.emit("exec",e,t,r),n}shellExec(e,t={}){this.emit("exec",e,void 0,t);const r=new Set;return(0,o.shellExec)(e,t,this.env,r).finally((()=>{r.forEach((t=>{try{t.dispose()}catch(t){(0,i.traceError)(`Unable to kill process for ${e}`)}}))}))}}t.ProcessService=s},98065:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProcessServiceFactory=void 0;const o=r(86700),s=r(61684),a=r(19909),c=r(66462),u=r(29983);let l=class{constructor(e,t,r,n){this.envVarsService=e,this.processLogger=t,this.decoder=r,this.disposableRegistry=n}async create(e){const t=await this.envVarsService.getEnvironmentVariables(e),r=new c.ProcessService(this.decoder,t);return this.disposableRegistry.push(r),r.on("exec",this.processLogger.logProcess.bind(this.processLogger))}};l=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IEnvironmentVariablesProvider)),i(1,(0,o.inject)(u.IProcessLogger)),i(2,(0,o.inject)(u.IBufferDecoder)),i(3,(0,o.inject)(s.IDisposableRegistry))],l),t.ProcessServiceFactory=l},3672:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createWindowsStoreEnv=t.createCondaEnv=t.createPythonEnv=void 0;const n=r(71017),i=r(19735),o=r(75470),s=r(24708),a=r(93400),c=r(69554),u=r(31776);class l{constructor(e,t){this.pythonPath=e,this.deps=t,this.cachedExecutablePath=new Map,this.cachedInterpreterInformation=null}getExecutionInfo(e=[],t){const r=this.deps.getPythonArgv(this.pythonPath);return(0,s.buildPythonExecInfo)(r,e,t)}getExecutionObservableInfo(e=[],t){const r=this.deps.getObservablePythonArgv(this.pythonPath);return(0,s.buildPythonExecInfo)(r,e,t)}async getInterpreterInformation(){return null===this.cachedInterpreterInformation&&(this.cachedInterpreterInformation=await this.getInterpreterInformationImpl()),this.cachedInterpreterInformation}async getExecutablePath(){if(await this.deps.isValidExecutable(this.pythonPath))return this.pythonPath;const e=this.cachedExecutablePath.get(this.pythonPath);if(void 0!==e)return e;const t=this.getExecutionInfo(),r=(0,a.getExecutablePath)(t,this.deps.shellExec);return this.cachedExecutablePath.set(this.pythonPath,r),r}async getModuleVersion(e){const[t,r]=u.getModuleVersion(e),n=this.getExecutionInfo(t);let o;try{o=await this.deps.exec(n.command,n.args)}catch(t){return void(0,i.traceInfo)(`Error when getting version of module ${e}`,t)}return r(o.stdout)}async isModuleInstalled(e){const[t]=u.isModuleInstalled(e),r=this.getExecutionInfo(t);try{await this.deps.exec(r.command,r.args)}catch(t){return(0,i.traceInfo)(`Error when checking if module is installed ${e}`,t),!1}return!0}async getInterpreterInformationImpl(){try{const e=this.getExecutionInfo();return await(0,c.getInterpreterInfo)(e,this.deps.shellExec,{info:i.traceInfo,error:i.traceError})}catch(e){(0,i.traceError)(`Failed to get interpreter information for '${this.pythonPath}'`,e)}}}function h(e,t,r,i,o){return{getPythonArgv:e=>(n.basename(e)===e&&(t=e.split(" ")),t||[e]),getObservablePythonArgv:e=>(n.basename(e)===e&&(r=e.split(" ")),r||[e]),isValidExecutable:e,exec:async(e,t)=>i(e,t,{throwOnStdErr:!0}),shellExec:o}}t.createPythonEnv=function(e,t,r){const n=h((async e=>r.pathExists(e)),void 0,void 0,((e,r,n)=>t.exec(e,r,n)),((e,r)=>t.shellExec(e,r)));return new l(e,n)},t.createCondaEnv=async function(e,t,r){const n=await o.Conda.getConda(),i=await(null==n?void 0:n.getRunPythonArgs({name:e.name,prefix:e.path}));if(!i)return;const s=h((async e=>r.pathExists(e)),i,i,((e,r,n)=>t.exec(e,r,n)),((e,r)=>t.shellExec(e,r))),a=await(null==n?void 0:n.getInterpreterPathForEnvironment({name:e.name,prefix:e.path}));return a?new l(a,s):void 0},t.createWindowsStoreEnv=function(e,t){const r=h((async e=>!0),void 0,void 0,((e,r,n)=>t.exec(e,r,n)),((e,r)=>t.shellExec(e,r)));return new l(e,r)}},51625:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PythonExecutionFactory=void 0;const o=r(86700),s=r(80351),a=r(18639),c=r(77498),u=r(54813),l=r(61522),h=r(84974),p=r(61684),d=r(66462),f=r(3672),v=r(29672),y=r(29983),m=r(87282),g=r(59314),b=r(19735);let _=class{constructor(e,t,r,n,i,o,s,a){this.serviceContainer=e,this.activationHelper=t,this.processServiceFactory=r,this.configService=n,this.decoder=i,this.pyenvs=o,this.autoSelection=s,this.interpreterPathExpHelper=a,this.disposables=this.serviceContainer.get(p.IDisposableRegistry),this.logger=this.serviceContainer.get(y.IProcessLogger),this.fileSystem=this.serviceContainer.get(h.IFileSystem)}async create(e){let{pythonPath:t}=e;if(!t){const r=this.interpreterPathExpHelper.get(e.resource);r&&"python"!==r||await Promise.race([this.autoSelection.autoSelectInterpreter(e.resource).then((()=>!0)),(0,g.sleep)(5e4).then((()=>!1))])||(0,b.traceError)("Autoselection timeout out, this is likely a issue with how consumer called execution factory API. Using default python to execute."),t=this.configService.getSettings(e.resource).pythonPath}const r=await this.processServiceFactory.create(e.resource),n=await this.createCondaExecutionService(t,r);if(n)return n;const i=this.pyenvs.isWindowsStoreInterpreter.bind(this.pyenvs);return E(r,await i(t)?(0,f.createWindowsStoreEnv)(t,r):(0,f.createPythonEnv)(t,r,this.fileSystem))}async createActivatedEnvironment(e){const t=await this.activationHelper.getActivatedEnvironmentVariables(e.resource,e.interpreter,e.allowEnvironmentFetchExceptions),r=t&&Object.keys(t).length>0;if((0,u.sendTelemetryEvent)(l.EventName.PYTHON_INTERPRETER_ACTIVATION_ENVIRONMENT_VARIABLES,void 0,{hasEnvVars:r}),!r)return this.create({resource:e.resource,pythonPath:e.interpreter?e.interpreter.path:void 0});const n=e.interpreter?e.interpreter.path:this.configService.getSettings(e.resource).pythonPath,i=new d.ProcessService(this.decoder,{...t});i.on("exec",this.logger.logProcess.bind(this.logger)),this.disposables.push(i);const o=await this.createCondaExecutionService(n,i);return o||E(i,(0,f.createPythonEnv)(n,i,this.fileSystem))}async createCondaExecutionService(e,t){const r=this.serviceContainer.get(a.IComponentAdapter),[n]=await Promise.all([r.getCondaEnvironment(e)]);if(!n)return;const i=await(0,f.createCondaEnv)(n,t,this.fileSystem);return i?E(t,i):void 0}};function E(e,t){const r=(0,v.createPythonProcessService)(e,t);return{getInterpreterInformation:()=>t.getInterpreterInformation(),getExecutablePath:()=>t.getExecutablePath(),isModuleInstalled:e=>t.isModuleInstalled(e),getModuleVersion:e=>t.getModuleVersion(e),getExecutionInfo:e=>t.getExecutionInfo(e),execObservable:(e,t)=>r.execObservable(e,t),execModuleObservable:(e,t,n)=>r.execModuleObservable(e,t,n),exec:(e,t)=>r.exec(e,t),execModule:(e,t,n)=>r.execModule(e,t,n),execForLinter:(e,t,n)=>r.execForLinter(e,t,n)}}_=n([(0,o.injectable)(),i(0,(0,o.inject)(c.IServiceContainer)),i(1,(0,o.inject)(s.IEnvironmentActivationService)),i(2,(0,o.inject)(y.IProcessServiceFactory)),i(3,(0,o.inject)(p.IConfigurationService)),i(4,(0,o.inject)(y.IBufferDecoder)),i(5,(0,o.inject)(a.IComponentAdapter)),i(6,(0,o.inject)(m.IInterpreterAutoSelectionService)),i(7,(0,o.inject)(p.IInterpreterPathService))],_),t.PythonExecutionFactory=_},29672:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPythonProcessService=void 0;const n=r(26804),i=r(97300),o=r(31776);class s{constructor(e){this.deps=e}execObservable(e,t){const r={...t},n=this.deps.getExecutionObservableInfo(e);return this.deps.execObservable(n.command,n.args,r)}execModuleObservable(e,t,r){const n=o.execModule(e,t),i={...r},s=this.deps.getExecutionObservableInfo(n);return this.deps.execObservable(s.command,s.args,i)}async exec(e,t){const r={...t},n=this.deps.getExecutionInfo(e);return this.deps.exec(n.command,n.args,r)}async execModule(e,t,r){const s=o.execModule(e,t),a={...r},c=this.deps.getExecutionInfo(s),u=await this.deps.exec(c.command,c.args,a);if(e&&n.ErrorUtils.outputHasModuleNotInstalledError(e,u.stderr)&&!await this.deps.isModuleInstalled(e))throw new i.ModuleNotInstalledError(e);return u}async execForLinter(e,t,r){const o={...r},s=this.deps.getExecutionInfo(t),a=await this.deps.exec(s.command,s.args,o);if(e&&n.ErrorUtils.outputHasModuleNotInstalledError(e,a.stderr)&&!await this.deps.isModuleInstalled(e))throw new i.ModuleNotInstalledError(e);return a}}t.createPythonProcessService=function(e,t){return new s({isModuleInstalled:async e=>t.isModuleInstalled(e),getExecutionInfo:e=>t.getExecutionInfo(e),getExecutionObservableInfo:e=>t.getExecutionObservableInfo(e),exec:async(t,r,n)=>e.exec(t,r,n),execObservable:(t,r,n)=>e.execObservable(t,r,n)})}},91950:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PythonToolExecutionService=void 0;const o=r(86700),s=r(77498),a=r(29983);let c=class{constructor(e){this.serviceContainer=e}async execObservable(e,t,r){if(t.env)throw new Error("Environment variables are not supported");return e.moduleName&&e.moduleName.length>0?(await this.serviceContainer.get(a.IPythonExecutionFactory).create({resource:r})).execModuleObservable(e.moduleName,e.args,t):(await this.serviceContainer.get(a.IProcessServiceFactory).create(r)).execObservable(e.execPath,e.args,{...t})}async exec(e,t,r){if(t.env)throw new Error("Environment variables are not supported");return e.moduleName&&e.moduleName.length>0?(await this.serviceContainer.get(a.IPythonExecutionFactory).create({resource:r})).execModule(e.moduleName,e.args,t):(await this.serviceContainer.get(a.IProcessServiceFactory).create(r)).exec(e.execPath,e.args,{...t})}async execForLinter(e,t,r){if(t.env)throw new Error("Environment variables are not supported");const n=await this.serviceContainer.get(a.IPythonExecutionFactory).create({resource:r});return e.execPath?n.exec(e.args,t):n.execForLinter(e.moduleName,e.args,t)}};c=n([(0,o.injectable)(),i(0,(0,o.inject)(s.IServiceContainer))],c),t.PythonToolExecutionService=c},18699:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.killPid=t.execObservable=t.plainExec=t.shellExec=void 0;const n=r(32081),i=r(95100),o=r(59314),s=r(93289),a=r(29983),c=r(3481);function u(e,t){const r={...e},n=r;if(n){n.encoding="string"==typeof n.encoding&&n.encoding.length>0?n.encoding:s.DEFAULT_ENCODING;const{encoding:e}=n;delete n.encoding,n.encoding=e}if(r.env&&0!==Object.keys(r.env).length)r.env={...r.env};else{const e=t||process.env;r.env={...e}}return n&&n.extraVariables&&(r.env={...r.env,...n.extraVariables}),r.env.PYTHONUNBUFFERED="1",r.env.PYTHONIOENCODING||(r.env.PYTHONIOENCODING="utf-8"),r}function l(e){const t=e.match(/>>>PYTHON-EXEC-OUTPUT([\s\S]*)<<=2?t[1].trim():void 0;return void 0!==r?r:e}function h(e){try{"win32"===process.platform?(0,n.execSync)(`taskkill /pid ${e} /T /F`):process.kill(e)}catch(e){}}t.shellExec=function(e,t={},r,i){const o=u(t,r);return new Promise(((t,r)=>{const s=(0,n.exec)(e,o,((e,n,i)=>{e&&null!==e?r(e):o.throwOnStdErr&&i&&i.length?r(new Error(i)):(n=l(n),t({stderr:i&&i.length>0?i:void 0,stdout:n}))})),a={dispose:()=>{s.killed||s.kill()}};i&&i.add(a)}))},t.plainExec=function(e,t,r={},i,s,h){var p,d;const f=u(r,s),v=f.encoding?f.encoding:"utf8",y=(0,n.spawn)(e,t,f);null===(p=y.stdout)||void 0===p||p.on("error",c.noop),null===(d=y.stderr)||void 0===d||d.on("error",c.noop);const m=(0,o.createDeferred)(),g={dispose:()=>{y.killed||m.completed||y.kill()}};null==h||h.add(g);const b=[],_=(e,t,r)=>{null==e||e.on(t,r),b.push({dispose:()=>null==e?void 0:e.removeListener(t,r)})};r.token&&b.push(r.token.onCancellationRequested(g.dispose));const E=[];_(y.stdout,"data",(e=>E.push(e)));const S=[];return _(y.stderr,"data",(e=>{r.mergeStdOutErr?(E.push(e),S.push(e)):S.push(e)})),y.once("close",(()=>{if(m.completed)return;const e=0===S.length||null==i?void 0:i.decode(S,v);if(e&&e.length>0&&r.throwOnStdErr)m.reject(new a.StdErrError(e));else{let t=i?i.decode(E,v):"";t=l(t),m.resolve({stdout:t,stderr:e})}b.forEach((e=>e.dispose()))})),y.once("error",(e=>{m.reject(e),b.forEach((e=>e.dispose()))})),m.promise},t.execObservable=function(e,t,r={},o,s,c){const l=u(r,s),p=l.encoding?l.encoding:"utf8",d=(0,n.spawn)(e,t,l);let f=!1;const v={dispose(){!d||d.killed||f||h(d.pid),d&&d.unref()}};null==c||c.add(v);const y=new i.Observable((e=>{const t=[],n=(e,r,n)=>{null==e||e.on(r,n),t.push({dispose:()=>null==e?void 0:e.removeListener(r,n)})};r.token&&t.push(r.token.onCancellationRequested((()=>{f||d.killed||(d.kill(),f=!0)})));const i=(t,n)=>{let i=o?o.decode([n],p):"";"stderr"===t&&r.throwOnStdErr?e.error(new a.StdErrError(i)):(i=function(e){return(e=e.replace(">>>PYTHON-EXEC-OUTPUT\r\n","").replace(">>>PYTHON-EXEC-OUTPUT\n","")).replace("<<i("stdout",e))),n(d.stderr,"data",(e=>i("stderr",e))),d.once("close",(()=>{f=!0,e.complete(),t.forEach((e=>e.dispose()))})),d.once("exit",(()=>{f=!0,e.complete(),t.forEach((e=>e.dispose()))})),d.once("error",(r=>{f=!0,e.error(r),t.forEach((e=>e.dispose()))}))}));return{proc:d,out:y,dispose:v.dispose}},t.killPid=h},52615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const n=r(73153),i=r(98065),o=r(51625),s=r(91950),a=r(29983);t.registerTypes=function(e){e.addSingleton(a.IBufferDecoder,n.BufferDecoder),e.addSingleton(a.IProcessServiceFactory,i.ProcessServiceFactory),e.addSingleton(a.IPythonExecutionFactory,o.PythonExecutionFactory),e.addSingleton(a.IPythonToolExecutionService,s.PythonToolExecutionService)}},29983:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IPythonToolExecutionService=t.StdErrError=t.IPythonExecutionService=t.IPythonExecutionFactory=t.IProcessServiceFactory=t.IProcessLogger=t.IBufferDecoder=void 0,t.IBufferDecoder=Symbol("IBufferDecoder"),t.IProcessLogger=Symbol("IProcessLogger"),t.IProcessServiceFactory=Symbol("IProcessServiceFactory"),t.IPythonExecutionFactory=Symbol("IPythonExecutionFactory"),t.IPythonExecutionService=Symbol("IPythonExecutionService");class r extends Error{constructor(e){super(e)}}t.StdErrError=r,t.IPythonToolExecutionService=Symbol("IPythonToolRunnerService")},39702:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const n=r(90819),i=r(61684),o=r(17792),s=r(18718),a=r(13706),c=r(77633),u=r(17381),l=r(72874),h=r(13578),p=r(53314),d=r(17585),f=r(56792),v=r(2512),y=r(30751),m=r(15797),g=r(84911),b=r(80819),_=r(97469),E=r(21621),S=r(39425),w=r(90220),T=r(73766),P=r(93666),I=r(79434),O=r(20900),C=r(34581),A=r(29983),x=r(32237),R=r(14744),N=r(8572),k=r(78625),D=r(79152),M=r(78558),j=r(546),L=r(86678),F=r(55928),V=r(81731),B=r(67482),U=r(80656),W=r(58400),$=r(22207),H=r(10195),G=r(54094);t.registerTypes=function(e){e.addSingletonInstance(i.IsWindows,P.IS_WINDOWS),e.addSingleton(d.IActiveResourceService,o.ActiveResourceService),e.addSingleton(i.IInterpreterPathService,_.InterpreterPathService),e.addSingleton(i.IExtensions,h.Extensions),e.addSingleton(i.IRandom,H.Random),e.addSingleton(i.IPersistentStateFactory,T.PersistentStateFactory),e.addBinding(i.IPersistentStateFactory,n.IExtensionSingleActivationService),e.addSingleton(W.ITerminalServiceFactory,j.TerminalServiceFactory),e.addSingleton(i.IPathUtils,I.PathUtils),e.addSingleton(d.IApplicationShell,a.ApplicationShell),e.addSingleton(d.IClipboard,c.ClipboardService),e.addSingleton(i.ICurrentProcess,O.CurrentProcess),e.addSingleton(i.IInstaller,b.ProductInstaller),e.addSingleton(d.ICommandManager,u.CommandManager),e.addSingleton(d.IContextKeyManager,G.ContextKeyManager),e.addSingleton(i.IConfigurationService,y.ConfigurationService),e.addSingleton(d.IWorkspaceService,f.WorkspaceService),e.addSingleton(A.IProcessLogger,C.ProcessLogger),e.addSingleton(d.IDocumentManager,l.DocumentManager),e.addSingleton(d.ITerminalManager,p.TerminalManager),e.addSingleton(d.IApplicationEnvironment,s.ApplicationEnvironment),e.addSingleton(i.IBrowserService,E.BrowserService),e.addSingleton(i.IHttpClient,w.HttpClient),e.addSingleton(i.IFileDownloader,S.FileDownloader),e.addSingleton(i.IEditorUtils,g.EditorUtils),e.addSingleton(W.ITerminalActivator,x.TerminalActivator),e.addSingleton(W.ITerminalHelper,L.TerminalHelper),e.addSingleton(W.ITerminalActivationCommandProvider,R.Bash,W.TerminalActivationProviders.bashCShellFish),e.addSingleton(W.ITerminalActivationCommandProvider,N.CommandPromptAndPowerShell,W.TerminalActivationProviders.commandPromptAndPowerShell),e.addSingleton(W.ITerminalActivationCommandProvider,M.PyEnvActivationCommandProvider,W.TerminalActivationProviders.pyenv),e.addSingleton(W.ITerminalActivationCommandProvider,k.CondaActivationCommandProvider,W.TerminalActivationProviders.conda),e.addSingleton(W.ITerminalActivationCommandProvider,D.PipEnvActivationCommandProvider,W.TerminalActivationProviders.pipenv),e.addSingleton(i.IToolExecutionPath,m.PipEnvExecutionPath,i.ToolExecutionPath.pipenv),e.addSingleton(i.IAsyncDisposableRegistry,v.AsyncDisposableRegistry),e.addSingleton($.IMultiStepInputFactory,$.MultiStepInputFactory),e.addSingleton(W.IShellDetector,V.TerminalNameShellDetector),e.addSingleton(W.IShellDetector,F.SettingsShellDetector),e.addSingleton(W.IShellDetector,B.UserEnvironmentShellDetector),e.addSingleton(W.IShellDetector,U.VSCEnvironmentShellDetector)}},57563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTerminalActivator=void 0;const n=r(59314);t.BaseTerminalActivator=class{constructor(e){this.helper=e,this.activatedTerminals=new Map}async activateEnvironmentInTerminal(e,t){if(this.activatedTerminals.has(e))return this.activatedTerminals.get(e);const r=(0,n.createDeferred)();this.activatedTerminals.set(e,r.promise);const i=this.helper.identifyTerminalShell(e),o=await this.helper.getEnvironmentActivationCommands(i,null==t?void 0:t.resource,null==t?void 0:t.interpreter);let s=!1;if(o)for(const r of o)e.show(null==t?void 0:t.preserveFocus),e.sendText(r),await this.waitForCommandToProcess(i),s=!0;return r.resolve(s),s}async waitForCommandToProcess(e){await(0,n.sleep)(500)}}},32237:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalActivator=void 0;const o=r(86700),s=r(61684),a=r(58400),c=r(57563);let u=class{constructor(e,t){this.helper=e,this.configurationService=t,this.pendingActivations=new WeakMap,this.initialize()}async activateEnvironmentInTerminal(e,t){let r=this.pendingActivations.get(e);return r||(r=this.activateEnvironmentInTerminalImpl(e,t),this.pendingActivations.set(e,r),r)}async activateEnvironmentInTerminalImpl(e,t){return!(!this.configurationService.getSettings(null==t?void 0:t.resource).terminal.activateEnvironment||(null==t?void 0:t.hideFromUser))&&this.baseActivator.activateEnvironmentInTerminal(e,t)}initialize(){this.baseActivator=new c.BaseTerminalActivator(this.helper)}};u=n([(0,o.injectable)(),i(0,(0,o.inject)(a.ITerminalHelper)),i(1,(0,o.inject)(s.IConfigurationService))],u),t.TerminalActivator=u},86575:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.VenvBaseActivationCommandProvider=void 0;const o=r(86700),s=r(71017),a=r(18639),c=r(77498),u=r(84974);let l=class{constructor(e){this.serviceContainer=e}async getActivationCommands(e,t){const r=await this.serviceContainer.get(a.IInterpreterService).getActiveInterpreter(e);if(r)return this.getActivationCommandsForInterpreter(r.path,t)}};l=n([(0,o.injectable)(),i(0,(0,o.inject)(c.IServiceContainer))],l),t.VenvBaseActivationCommandProvider=class extends l{isShellSupported(e){return void 0!==this.scripts[e]}async findScriptFile(e,t){const r=this.serviceContainer.get(u.IFileSystem),n=this.scripts[t];if(n)return function(e,t,n,i){const o="string"==typeof e?[e]:e;return async e=>{const i=t(e);for(const e of o){const t=n(i,e);if(await(s=t,r.fileExists(s)))return t}var s}}(n,s.dirname,s.join)(e)}}},14744:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.Bash=t.getAllScripts=void 0;const i=r(86700);r(32727);const o=r(58400),s=r(86575),a={[o.TerminalShellType.wsl]:["activate.sh","activate"],[o.TerminalShellType.ksh]:["activate.sh","activate"],[o.TerminalShellType.zsh]:["activate.sh","activate"],[o.TerminalShellType.gitbash]:["activate.sh","activate"],[o.TerminalShellType.bash]:["activate.sh","activate"],[o.TerminalShellType.tcshell]:["activate.csh"],[o.TerminalShellType.cshell]:["activate.csh"],[o.TerminalShellType.fish]:["activate.fish"]};t.getAllScripts=function(){const e=[];for(const t of Object.keys(a)){const r=t;for(const t of a[r])e.includes(t)||e.push(t)}return e};let c=class extends s.VenvBaseActivationCommandProvider{constructor(){super(...arguments),this.scripts=a}async getActivationCommandsForInterpreter(e,t){const r=await this.findScriptFile(e,t);if(r)return[`source ${r.fileToCommandArgumentForPythonExt()}`]}};c=n([(0,i.injectable)()],c),t.Bash=c},8572:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CommandPromptAndPowerShell=t.getAllScripts=void 0;const o=r(86700),s=r(71017),a=r(77498);r(32727);const c=r(58400),u=r(86575),l={[c.TerminalShellType.commandPrompt]:["activate.bat","Activate.ps1"],[c.TerminalShellType.powershell]:["Activate.ps1","activate.bat"],[c.TerminalShellType.powershellCore]:["Activate.ps1","activate.bat"]};t.getAllScripts=function(e){const t=[];for(const r of Object.keys(l)){const n=r;for(const r of l[n])t.includes(r)||t.push(r,e("Scripts",r),e("scripts",r))}return t};let h=class extends u.VenvBaseActivationCommandProvider{constructor(e){super(e),this.scripts={};for(const e of Object.keys(l)){const t=e,r=[];for(const e of l[t])r.push(e,s.join("Scripts",e),s.join("scripts",e));this.scripts[t]=r}}async getActivationCommandsForInterpreter(e,t){const r=await this.findScriptFile(e,t);if(r)return t===c.TerminalShellType.commandPrompt&&r.endsWith("activate.bat")?[r.fileToCommandArgumentForPythonExt()]:t!==c.TerminalShellType.powershell&&t!==c.TerminalShellType.powershellCore||!r.endsWith("Activate.ps1")?t===c.TerminalShellType.commandPrompt&&r.endsWith("Activate.ps1")?[]:void 0:[`& ${r.fileToCommandArgumentForPythonExt()}`]}};h=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],h),t.CommandPromptAndPowerShell=h},78625:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t._getPowershellCommands=t.CondaActivationCommandProvider=void 0,r(32727);const o=r(86700),s=r(71017),a=r(18639),c=r(84974),u=r(61684),l=r(58400);let h=class{constructor(e,t,r,n){this.condaService=e,this.platform=t,this.configService=r,this.pyenvs=n}isShellSupported(){return!0}getActivationCommands(e,t){const{pythonPath:r}=this.configService.getSettings(e);return this.getActivationCommandsForInterpreter(r,t)}async getActivationCommandsForInterpreter(e,t){const r=await this.pyenvs.getCondaEnvironment(e);if(!r)return;const n=r.name.length>0?r.name:r.path,i=await this.condaService.getCondaVersion();if(i&&i.major>=4){if(i.minor>=6&&(t===l.TerminalShellType.powershell||t===l.TerminalShellType.powershellCore))return p(n);if(i.minor>=4){const e=await this.condaService.getInterpreterPathForEnvironment(r),t=await this.condaService.getCondaFileFromInterpreter(e,r.name);if(t){const e=s.join(s.dirname(t),"activate").fileToCommandArgumentForPythonExt();return[this.platform.isWindows?e:`source ${e}`,`conda activate ${n.toCommandArgumentForPythonExt()}`]}}}switch(t){case l.TerminalShellType.powershell:case l.TerminalShellType.powershellCore:return p(n);case l.TerminalShellType.fish:return async function(e,t){return[`${t.fileToCommandArgumentForPythonExt()} activate ${e.toCommandArgumentForPythonExt()}`]}(n,await this.condaService.getCondaFile());default:return this.platform.isWindows?this.getWindowsCommands(n):async function(e,t){const r=s.dirname(t);return[`source ${s.join(r,"activate").fileToCommandArgumentForPythonExt()} ${e.toCommandArgumentForPythonExt()}`]}(n,await this.condaService.getCondaFile())}}async getWindowsActivateCommand(){let e="activate";const t=await this.condaService.getCondaFile();if(t&&s.basename(t)!==t){const r=s.dirname(t);e=s.join(r,e),e=e.toCommandArgumentForPythonExt()}return e}async getWindowsCommands(e){return[`${await this.getWindowsActivateCommand()} ${e.toCommandArgumentForPythonExt()}`]}};async function p(e){return[`conda activate ${e.toCommandArgumentForPythonExt()}`]}h=n([(0,o.injectable)(),i(0,(0,o.inject)(a.ICondaService)),i(1,(0,o.inject)(c.IPlatformService)),i(2,(0,o.inject)(u.IConfigurationService)),i(3,(0,o.inject)(a.IComponentAdapter))],h),t.CondaActivationCommandProvider=h,t._getPowershellCommands=p},79152:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PipEnvActivationCommandProvider=void 0;const o=r(86700);r(32727);const s=r(18639),a=r(37924),c=r(81387),u=r(17585),l=r(61684);let h=class{constructor(e,t,r){this.interpreterService=e,this.pipEnvExecution=t,this.workspaceService=r}isShellSupported(){return!1}async getActivationCommands(e){const t=await this.interpreterService.getActiveInterpreter(e);if(!t||t.envType!==c.EnvironmentType.Pipenv)return;const r=e?this.workspaceService.getWorkspaceFolder(e):void 0;return!r||await(0,a.isPipenvEnvironmentRelatedToFolder)(t.path,null==r?void 0:r.uri.fsPath)?[`${this.pipEnvExecution.executable.fileToCommandArgumentForPythonExt()} shell`]:void 0}async getActivationCommandsForInterpreter(e){const t=await this.interpreterService.getInterpreterDetails(e);if(t&&t.envType===c.EnvironmentType.Pipenv)return[`${this.pipEnvExecution.executable.fileToCommandArgumentForPythonExt()} shell`]}};h=n([(0,o.injectable)(),i(0,(0,o.inject)(s.IInterpreterService)),i(1,(0,o.inject)(l.IToolExecutionPath)),i(1,(0,o.named)(l.ToolExecutionPath.pipenv)),i(2,(0,o.inject)(u.IWorkspaceService))],h),t.PipEnvActivationCommandProvider=h},78558:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PyEnvActivationCommandProvider=void 0;const o=r(86700),s=r(18639),a=r(77498),c=r(81387);let u=class{constructor(e){this.serviceContainer=e}isShellSupported(e){return!0}async getActivationCommands(e,t){const r=await this.serviceContainer.get(s.IInterpreterService).getActiveInterpreter(e);if(r&&r.envType===c.EnvironmentType.Pyenv&&r.envName)return[`pyenv shell ${r.envName.toCommandArgumentForPythonExt()}`]}async getActivationCommandsForInterpreter(e,t){const r=await this.serviceContainer.get(s.IInterpreterService).getInterpreterDetails(e);if(r&&r.envType===c.EnvironmentType.Pyenv&&r.envName)return[`pyenv shell ${r.envName.toCommandArgumentForPythonExt()}`]}};u=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],u),t.PyEnvActivationCommandProvider=u},546:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalServiceFactory=void 0;const o=r(86700),s=r(18639),a=r(77498),c=r(17585),u=r(84974),l=r(97207),h=r(88624);let p=class{constructor(e,t,r){this.serviceContainer=e,this.fs=t,this.interpreterService=r,this.terminalServices=new Map}getTerminalService(e){const t=null==e?void 0:e.resource,r=null==e?void 0:e.title,n="string"==typeof r&&r.trim().length>0?r.trim():"Python",i=null==e?void 0:e.interpreter,o=this.getTerminalId(n,t,i);if(!this.terminalServices.has(o)){const t=new l.TerminalService(this.serviceContainer,e);this.terminalServices.set(o,t)}return new h.SynchronousTerminalService(this.fs,this.interpreterService,this.terminalServices.get(o),i)}createTerminalService(e,t){return t="string"==typeof t&&t.trim().length>0?t.trim():"Python",new l.TerminalService(this.serviceContainer,{resource:e,title:t})}getTerminalId(e,t,r){if(!t&&!r)return e;const n=this.serviceContainer.get(c.IWorkspaceService).getWorkspaceFolder(t||void 0);return`${e}:${(null==n?void 0:n.uri.fsPath)||""}:${null==r?void 0:r.path}`}};p=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer)),i(1,(0,o.inject)(u.IFileSystem)),i(2,(0,o.inject)(s.IInterpreterService))],p),t.TerminalServiceFactory=p},86678:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalHelper=void 0;const o=r(86700),s=r(18639),a=r(77498),c=r(19735),u=r(81387),l=r(54813),h=r(61522),p=r(17585);r(32727);const d=r(84974),f=r(61684),v=r(87450),y=r(71791),m=r(58400);let g=class{constructor(e,t,r,n,i,o,s,a,c,u,l){this.platform=e,this.terminalManager=t,this.serviceContainer=r,this.interpreterService=n,this.configurationService=i,this.conda=o,this.bashCShellFish=s,this.commandPromptAndPowerShell=a,this.pyenv=c,this.pipenv=u,this.shellDetector=new y.ShellDetector(this.platform,l)}createTerminal(e){return this.terminalManager.createTerminal({name:e})}identifyTerminalShell(e){return this.shellDetector.identifyTerminalShell(e)}buildCommandForTerminal(e,t,r){const n=e===m.TerminalShellType.powershell||e===m.TerminalShellType.powershellCore?"& ":"",i=r.map((e=>e.toCommandArgumentForPythonExt()));return`${n}${t.fileToCommandArgumentForPythonExt()} ${i.join(" ")}`.trim()}async getEnvironmentActivationCommands(e,t,r){const n=[this.pipenv,this.pyenv,this.bashCShellFish,this.commandPromptAndPowerShell],i=this.getActivationCommands(t||void 0,r,e,n);return this.sendTelemetry(e,h.EventName.PYTHON_INTERPRETER_ACTIVATION_FOR_TERMINAL,r,i).ignoreErrors(),i}async getEnvironmentActivationShellCommands(e,t,r){if(this.platform.osType===v.OSType.Unknown)return;const n=[this.bashCShellFish,this.commandPromptAndPowerShell],i=this.getActivationCommands(e,r,t,n);return this.sendTelemetry(t,h.EventName.PYTHON_INTERPRETER_ACTIVATION_FOR_RUNNING_CODE,r,i).ignoreErrors(),i}async sendTelemetry(e,t,r,n){let i=!1,o=!1;try{const e=await n;i=Array.isArray(e)&&e.length>0}catch(e){o=!0,(0,c.traceError)("Failed to get activation commands",e)}const s=r&&r.version?r.version.raw:void 0,a={failed:o,hasCommands:i,interpreterType:r?r.envType:u.EnvironmentType.Unknown,terminal:e,pythonVersion:s};(0,l.sendTelemetryEvent)(t,void 0,a)}async getActivationCommands(e,t,r,n){const i=this.configurationService.getSettings(e),o=this.serviceContainer.get(s.IComponentAdapter);if(t?t.envType===u.EnvironmentType.Conda:await o.isCondaEnvironment(i.pythonPath)){const n=t?await this.conda.getActivationCommandsForInterpreter(t.path,r):await this.conda.getActivationCommands(e,r);if(Array.isArray(n))return n}const a=n.filter((e=>e.isShellSupported(r)));for(const n of a){const i=t?await n.getActivationCommandsForInterpreter(t.path,r):await n.getActivationCommands(e,r);if(Array.isArray(i)&&i.length>0)return i}}};n([(0,c.traceDecoratorError)("Failed to capture telemetry")],g.prototype,"sendTelemetry",null),g=n([(0,o.injectable)(),i(0,(0,o.inject)(d.IPlatformService)),i(1,(0,o.inject)(p.ITerminalManager)),i(2,(0,o.inject)(a.IServiceContainer)),i(3,(0,o.inject)(s.IInterpreterService)),i(4,(0,o.inject)(f.IConfigurationService)),i(5,(0,o.inject)(m.ITerminalActivationCommandProvider)),i(5,(0,o.named)(m.TerminalActivationProviders.conda)),i(6,(0,o.inject)(m.ITerminalActivationCommandProvider)),i(6,(0,o.named)(m.TerminalActivationProviders.bashCShellFish)),i(7,(0,o.inject)(m.ITerminalActivationCommandProvider)),i(7,(0,o.named)(m.TerminalActivationProviders.commandPromptAndPowerShell)),i(8,(0,o.inject)(m.ITerminalActivationCommandProvider)),i(8,(0,o.named)(m.TerminalActivationProviders.pyenv)),i(9,(0,o.inject)(m.ITerminalActivationCommandProvider)),i(9,(0,o.named)(m.TerminalActivationProviders.pipenv)),i(10,(0,o.multiInject)(m.IShellDetector))],g),t.TerminalHelper=g},97207:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalService=void 0;const o=r(86700),s=r(66828);r(32727);const a=r(18639),c=r(77498),u=r(54813),l=r(61522),h=r(17585),p=r(61684),d=r(58400);let f=class{constructor(e,t){this.serviceContainer=e,this.options=t,this.terminalClosed=new s.EventEmitter;const r=this.serviceContainer.get(p.IDisposableRegistry);r.push(this),this.terminalHelper=this.serviceContainer.get(d.ITerminalHelper),this.terminalManager=this.serviceContainer.get(h.ITerminalManager),this.terminalManager.onDidCloseTerminal(this.terminalCloseHandler,this,r),this.terminalActivator=this.serviceContainer.get(d.ITerminalActivator)}get onDidCloseTerminal(){return this.terminalClosed.event.bind(this.terminalClosed)}dispose(){this.terminal&&this.terminal.dispose()}async sendCommand(e,t,r){var n;await this.ensureTerminal();const i=this.terminalHelper.buildCommandForTerminal(this.terminalShellType,e,t);(null===(n=this.options)||void 0===n?void 0:n.hideFromUser)||this.terminal.show(!0),this.terminal.sendText(i,!0)}async sendText(e){var t;await this.ensureTerminal(),(null===(t=this.options)||void 0===t?void 0:t.hideFromUser)||this.terminal.show(!0),this.terminal.sendText(e)}async show(e=!0){var t;await this.ensureTerminal(e),(null===(t=this.options)||void 0===t?void 0:t.hideFromUser)||this.terminal.show(e)}async ensureTerminal(e=!0){var t,r,n,i,o,s,a;this.terminal||(this.terminalShellType=this.terminalHelper.identifyTerminalShell(this.terminal),this.terminal=this.terminalManager.createTerminal({name:(null===(t=this.options)||void 0===t?void 0:t.title)||"Python",env:null===(r=this.options)||void 0===r?void 0:r.env,hideFromUser:null===(n=this.options)||void 0===n?void 0:n.hideFromUser}),await new Promise((e=>setTimeout(e,100))),await this.terminalActivator.activateEnvironmentInTerminal(this.terminal,{resource:null===(i=this.options)||void 0===i?void 0:i.resource,preserveFocus:e,interpreter:null===(o=this.options)||void 0===o?void 0:o.interpreter,hideFromUser:null===(s=this.options)||void 0===s?void 0:s.hideFromUser}),(null===(a=this.options)||void 0===a?void 0:a.hideFromUser)||this.terminal.show(e),this.sendTelemetry().ignoreErrors())}terminalCloseHandler(e){e===this.terminal&&(this.terminalClosed.fire(),this.terminal=void 0)}async sendTelemetry(){var e,t;const r=this.serviceContainer.get(p.IConfigurationService).getSettings(null===(e=this.options)||void 0===e?void 0:e.resource).pythonPath,n=(null===(t=this.options)||void 0===t?void 0:t.interpreter)||await this.serviceContainer.get(a.IInterpreterService).getInterpreterDetails(r),i=n&&n.version?n.version.raw:void 0,o=n?n.envType:void 0;(0,u.captureTelemetry)(l.EventName.TERMINAL_CREATE,{terminal:this.terminalShellType,pythonVersion:i,interpreterType:o})}};f=n([(0,o.injectable)(),i(0,(0,o.inject)(c.IServiceContainer))],f),t.TerminalService=f},71791:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ShellDetector=void 0;const o=r(86700),s=r(19735),a=r(54813),c=r(61522);r(32727);const u=r(84974),l=r(87450),h=r(58400),p={[l.OSType.Linux]:h.TerminalShellType.bash,[l.OSType.OSX]:h.TerminalShellType.bash,[l.OSType.Windows]:h.TerminalShellType.commandPrompt,[l.OSType.Unknown]:h.TerminalShellType.other};let d=class{constructor(e,t){this.platform=e,this.shellDetectors=t}identifyTerminalShell(e){let t;const r={failed:!0,shellIdentificationSource:"default",terminalProvided:!!e,hasCustomShell:void 0,hasShellInEnv:void 0},n=this.shellDetectors.slice().sort(((e,t)=>t.priority-e.priority));for(const i of n)if(t=i.identify(r,e),(0,s.traceVerbose)(`${i}. Shell identified as ${t} ${e?`(Terminal name is ${e.name})`:""}`),t&&t!==h.TerminalShellType.other){r.failed=!1;break}return(0,a.sendTelemetryEvent)(c.EventName.TERMINAL_SHELL_IDENTIFICATION,void 0,r),(0,s.traceVerbose)(`Shell identified as '${t}'`),void 0!==t&&t!==h.TerminalShellType.other||((0,s.traceVerbose)("Using default OS shell"),t=p[this.platform.osType]),t}};d=n([(0,o.injectable)(),i(0,(0,o.inject)(u.IPlatformService)),i(1,(0,o.multiInject)(h.IShellDetector))],d),t.ShellDetector=d},89465:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseShellDetector=void 0;const o=r(86700),s=r(19735),a=r(58400),c=new Map;c.set(a.TerminalShellType.powershell,/(powershell$)/i),c.set(a.TerminalShellType.gitbash,/(gitbash$)/i),c.set(a.TerminalShellType.bash,/(bash$)/i),c.set(a.TerminalShellType.wsl,/(wsl$)/i),c.set(a.TerminalShellType.zsh,/(zsh$)/i),c.set(a.TerminalShellType.ksh,/(ksh$)/i),c.set(a.TerminalShellType.commandPrompt,/(cmd$)/i),c.set(a.TerminalShellType.fish,/(fish$)/i),c.set(a.TerminalShellType.tcshell,/(tcsh$)/i),c.set(a.TerminalShellType.cshell,/(csh$)/i),c.set(a.TerminalShellType.powershellCore,/(pwsh$)/i),c.set(a.TerminalShellType.xonsh,/(xonsh$)/i);let u=class{constructor(e){this.priority=e}identifyShellFromShellPath(e){const t=e.replace(/\.exe$/,""),r=Array.from(c.keys()).reduce(((e,r)=>{if(e===a.TerminalShellType.other){const e=c.get(r);if(e&&e.test(t))return r}return e}),a.TerminalShellType.other);return(0,s.traceVerbose)(`Shell path '${e}', base path '${t}'`),(0,s.traceVerbose)(`Shell path identified as shell '${r}'`),r}};u=n([(0,o.injectable)(),i(0,(0,o.unmanaged)())],u),t.BaseShellDetector=u},55928:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SettingsShellDetector=void 0;const o=r(86700),s=r(19735),a=r(17585),c=r(84974),u=r(87450),l=r(58400),h=r(89465);let p=class extends h.BaseShellDetector{constructor(e,t){super(2),this.workspace=e,this.platform=t}getTerminalShellPath(){const e=this.workspace.getConfiguration("terminal.integrated.shell");let t="";switch(this.platform.osType){case u.OSType.Windows:t="windows";break;case u.OSType.OSX:t="osx";break;case u.OSType.Linux:t="linux";break;default:return""}return e.get(t)}identify(e,t){const r=this.getTerminalShellPath();e.hasCustomShell=!!r;const n=r?this.identifyShellFromShellPath(r):l.TerminalShellType.other;return n!==l.TerminalShellType.other?e.shellIdentificationSource="environment":e.shellIdentificationSource="settings",(0,s.traceVerbose)(`Shell path from user settings '${r}'`),n}};p=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IWorkspaceService)),i(1,(0,o.inject)(c.IPlatformService))],p),t.SettingsShellDetector=p},81731:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalNameShellDetector=void 0;const i=r(86700),o=r(19735),s=r(58400),a=r(89465);let c=class extends a.BaseShellDetector{constructor(){super(4)}identify(e,t){if(!t)return;const r=this.identifyShellFromShellPath(t.name);return(0,o.traceVerbose)(`Terminal name '${t.name}' identified as shell '${r}'`),e.shellIdentificationSource=r===s.TerminalShellType.other?e.shellIdentificationSource:"terminalName",r}};c=n([(0,i.injectable)()],c),t.TerminalNameShellDetector=c},67482:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.UserEnvironmentShellDetector=void 0;const o=r(86700),s=r(19735),a=r(84974),c=r(61684),u=r(87450),l=r(58400),h=r(89465);let p=class extends h.BaseShellDetector{constructor(e,t){super(1),this.currentProcess=e,this.platform=t}getDefaultPlatformShell(){return e=this.platform,t=this.currentProcess,e.osType===u.OSType.Windows?function(e,t){const r=parseFloat(e.osRelease)>=10,n=t.env.hasOwnProperty("PROCESSOR_ARCHITEW6432"),i=`${t.env.windir}\\${n?"Sysnative":"System32"}\\WindowsPowerShell\\v1.0\\powershell.exe`;return r?i:function(e){return e.env.comspec||"cmd.exe"}(t)}(e,t):t.env.SHELL&&"/bin/false"!==t.env.SHELL?t.env.SHELL:"/bin/bash";var e,t}identify(e,t){const r=this.getDefaultPlatformShell();e.hasShellInEnv=!!r;const n=this.identifyShellFromShellPath(r);return n!==l.TerminalShellType.other&&(e.shellIdentificationSource="environment"),(0,s.traceVerbose)(`Shell path from user env '${r}'`),n}};p=n([(0,o.injectable)(),i(0,(0,o.inject)(c.ICurrentProcess)),i(1,(0,o.inject)(a.IPlatformService))],p),t.UserEnvironmentShellDetector=p},80656:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.VSCEnvironmentShellDetector=void 0;const o=r(86700),s=r(19735),a=r(17585),c=r(58400),u=r(89465);let l=class extends u.BaseShellDetector{constructor(e){super(3),this.appEnv=e}identify(e,t){const r=(null==t?void 0:t.creationOptions)&&"shellPath"in t.creationOptions&&t.creationOptions.shellPath?t.creationOptions.shellPath:this.appEnv.shell;if(!r)return;const n=this.identifyShellFromShellPath(r);return(0,s.traceVerbose)(`Terminal shell path '${r}' identified as shell '${n}'`),e.shellIdentificationSource=n===c.TerminalShellType.other?e.shellIdentificationSource:"vscode",e.failed=n!==c.TerminalShellType.other,n}};l=n([i(0,(0,o.inject)(a.IApplicationEnvironment))],l),t.VSCEnvironmentShellDetector=l},88624:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SynchronousTerminalService=void 0;const o=r(86700),s=r(18639),a=r(19735),c=r(29979),u=r(84974),l=r(4057),h=r(59314),p=r(3481);var d;!function(e){e[e.notStarted=0]="notStarted",e[e.started=1]="started",e[e.completed=2]="completed",e[e.errored=4]="errored"}(d||(d={}));class f{constructor(e,t,r){this.lockFile=e,this.fs=t,this.command=r,this.state=d.notStarted,this._completed=(0,h.createDeferred)(),this.registerStateUpdate(),this._completed.promise.finally((()=>this.dispose())).ignoreErrors()}get completed(){return this._completed.promise}dispose(){this.disposable&&(this.disposable.dispose(),this.disposable=void 0)}registerStateUpdate(){const e=setInterval((async()=>{const e=await this.getLockFileState(this.lockFile);if(e!==this.state&&(0,a.traceVerbose)(`Command state changed to ${e}. ${this.command.join(" ")}`),this.state=e,e&d.errored){const e=await this.fs.readFile(`${this.lockFile}.error`).catch((()=>""));this._completed.reject(new Error(`Command failed with errors, check the terminal for details. Command: ${this.command.join(" ")}\n${e}`))}else e&d.completed&&this._completed.resolve()}),100);this.disposable={dispose:()=>clearInterval(e)}}async getLockFileState(e){const t=await this.fs.readFile(e);let r=d.notStarted;return t.includes("START")&&(r|=d.started),t.includes("END")&&(r|=d.completed),t.includes("FAIL")&&(r|=d.completed|d.errored),r}}let v=class{constructor(e,t,r,n){this.fs=e,this.interpreter=t,this.terminalService=r,this.pythonInterpreter=n,this.disposables=[]}get onDidCloseTerminal(){return this.terminalService.onDidCloseTerminal}dispose(){for(this.terminalService.dispose();this.disposables.length;){const e=this.disposables.shift();if(!e)break;try{e.dispose()}catch(e){(0,p.noop)()}}}async sendCommand(e,t,r,n=!0){if(!r)return this.terminalService.sendCommand(e,t);const i=await this.createLockFile(),o=new f(i.filePath,this.fs,[e,...t]);try{const s=this.pythonInterpreter||await this.interpreter.getActiveInterpreter(void 0),a=l.shell_exec(e,i.filePath,t);await this.terminalService.sendCommand((null==s?void 0:s.path)||"python",a);const u=n?o.completed:o.completed.catch(p.noop);await c.Cancellation.race((()=>u),r)}finally{o.dispose(),i.dispose()}}sendText(e){return this.terminalService.sendText(e)}show(e){return this.terminalService.show(e)}createLockFile(){return this.fs.createTemporaryFile(".log").then((e=>(this.disposables.push(e),e)))}};v=n([i(0,(0,o.inject)(u.IFileSystem)),i(1,(0,o.inject)(s.IInterpreterService))],v),t.SynchronousTerminalService=v},58400:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.IShellDetector=t.ITerminalActivationCommandProvider=t.ITerminalActivator=t.ITerminalHelper=t.ITerminalServiceFactory=t.TerminalShellType=t.TerminalActivationProviders=void 0,(n=t.TerminalActivationProviders||(t.TerminalActivationProviders={})).bashCShellFish="bashCShellFish",n.commandPromptAndPowerShell="commandPromptAndPowerShell",n.pyenv="pyenv",n.conda="conda",n.pipenv="pipenv",(r=t.TerminalShellType||(t.TerminalShellType={})).powershell="powershell",r.powershellCore="powershellCore",r.commandPrompt="commandPrompt",r.gitbash="gitbash",r.bash="bash",r.zsh="zsh",r.ksh="ksh",r.fish="fish",r.cshell="cshell",r.tcshell="tshell",r.wsl="wsl",r.xonsh="xonsh",r.other="other",t.ITerminalServiceFactory=Symbol("ITerminalServiceFactory"),t.ITerminalHelper=Symbol("ITerminalHelper"),t.ITerminalActivator=Symbol("ITerminalActivator"),t.ITerminalActivationCommandProvider=Symbol("ITerminalActivationCommandProvider"),t.IShellDetector=Symbol("IShellDetector")},61684:(e,t)=>{"use strict";var r,n,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.IInterpreterPathService=t.IAsyncDisposableRegistry=t.IEditorUtils=t.IBrowserService=t.IExtensions=t.IExtensionContext=t.IHttpClient=t.IFileDownloader=t.ISocketServer=t.ToolExecutionPath=t.IToolExecutionPath=t.IConfigurationService=t.ICurrentProcess=t.IRandom=t.IPathUtils=t.IInstaller=t.Product=t.ProductType=t.ProductInstallStatus=t.InstallerResponse=t.IPersistentStateFactory=t.WORKSPACE_MEMENTO=t.GLOBAL_MEMENTO=t.IMemento=t.IDisposableRegistry=t.IsWindows=t.IDocumentSymbolProvider=t.IOutputChannel=void 0,t.IOutputChannel=Symbol("IOutputChannel"),t.IDocumentSymbolProvider=Symbol("IDocumentSymbolProvider"),t.IsWindows=Symbol("IS_WINDOWS"),t.IDisposableRegistry=Symbol("IDisposableRegistry"),t.IMemento=Symbol("IGlobalMemento"),t.GLOBAL_MEMENTO=Symbol("IGlobalMemento"),t.WORKSPACE_MEMENTO=Symbol("IWorkspaceMemento"),t.IPersistentStateFactory=Symbol("IPersistentStateFactory"),(o=t.InstallerResponse||(t.InstallerResponse={}))[o.Installed=0]="Installed",o[o.Disabled=1]="Disabled",o[o.Ignore=2]="Ignore",(i=t.ProductInstallStatus||(t.ProductInstallStatus={}))[i.Installed=0]="Installed",i[i.NotInstalled=1]="NotInstalled",i[i.NeedsUpgrade=2]="NeedsUpgrade",(n=t.ProductType||(t.ProductType={})).DataScience="DataScience",n.Python="Python",(r=t.Product||(t.Product={}))[r.pytest=1]="pytest",r[r.pylint=3]="pylint",r[r.flake8=4]="flake8",r[r.pycodestyle=5]="pycodestyle",r[r.pylama=6]="pylama",r[r.prospector=7]="prospector",r[r.pydocstyle=8]="pydocstyle",r[r.yapf=9]="yapf",r[r.autopep8=10]="autopep8",r[r.mypy=11]="mypy",r[r.unittest=12]="unittest",r[r.isort=15]="isort",r[r.black=16]="black",r[r.bandit=17]="bandit",r[r.jupyter=18]="jupyter",r[r.ipykernel=19]="ipykernel",r[r.notebook=20]="notebook",r[r.kernelspec=21]="kernelspec",r[r.nbconvert=22]="nbconvert",r[r.pandas=23]="pandas",r[r.tensorboard=24]="tensorboard",r[r.torchProfilerInstallName=25]="torchProfilerInstallName",r[r.torchProfilerImportName=26]="torchProfilerImportName",r[r.pip=27]="pip",r[r.ensurepip=28]="ensurepip",r[r.python=29]="python",t.IInstaller=Symbol("IInstaller"),t.IPathUtils=Symbol("IPathUtils"),t.IRandom=Symbol("IRandom"),t.ICurrentProcess=Symbol("ICurrentProcess"),t.IConfigurationService=Symbol("IConfigurationService"),t.IToolExecutionPath=Symbol("IToolExecutionPath"),(t.ToolExecutionPath||(t.ToolExecutionPath={})).pipenv="pipenv",t.ISocketServer=Symbol("ISocketServer"),t.IFileDownloader=Symbol("IFileDownloader"),t.IHttpClient=Symbol("IHttpClient"),t.IExtensionContext=Symbol("ExtensionContext"),t.IExtensions=Symbol("IExtensions"),t.IBrowserService=Symbol("IBrowserService"),t.IEditorUtils=Symbol("IEditorUtils"),t.IAsyncDisposableRegistry=Symbol("IAsyncDisposableRegistry"),t.IInterpreterPathService=Symbol("IInterpreterPathService")},99910:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asyncForEach=t.asyncFilter=void 0,t.asyncFilter=async function(e,t){const r=await Promise.all(e.map(t));return e.filter(((e,t)=>r[t]))},t.asyncForEach=async function(e,t){await Promise.all(e.map(t))}},59314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenIterator=t.iterable=t.mapToIterator=t.chain=t.iterEmpty=t.createDeferredFromPromise=t.createDeferredFrom=t.createDeferred=t.isPromise=t.isThenable=t.sleep=void 0,t.sleep=async function(e){return new Promise((t=>{setTimeout((()=>t(e)),e)}))},t.isThenable=function(e){return"function"==typeof(null==e?void 0:e.then)},t.isPromise=function(e){return"function"==typeof(null==e?void 0:e.then)&&"function"==typeof(null==e?void 0:e.catch)};class r{constructor(e=null){this.scope=e,this._resolved=!1,this._rejected=!1,this._promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}resolve(e){this._resolve.apply(this.scope?this.scope:this,[e]),this._resolved=!0}reject(e){this._reject.apply(this.scope?this.scope:this,[e]),this._rejected=!0}get promise(){return this._promise}get resolved(){return this._resolved}get rejected(){return this._rejected}get completed(){return this._rejected||this._resolved}}function n(e=null){return new r(e)}async function i(e,t){const r=void 0===t?-1:t;try{return{index:r,result:await e.next(),err:null}}catch(e){return{index:r,err:e,result:null}}}t.createDeferred=n,t.createDeferredFrom=function(...e){const t=n();return Promise.all(e).then(t.resolve.bind(t)).catch(t.reject.bind(t)),t},t.createDeferredFromPromise=function(e){const t=n();return e.then(t.resolve.bind(t)).catch(t.reject.bind(t)),t},t.iterEmpty=function(){return async function*(){}()};const o=new Promise((()=>{}));async function*s(e,t){const r=e.map(i);let n=e.length;for(;n>0;){const{index:s,result:a,err:c}=await Promise.race(r);null!==c?(r[s]=o,n-=1,void 0!==t&&await t(c,s)):a.done?(r[s]=o,n-=1,void 0!==a.value&&(yield a.value)):(r[s]=i(e[s],s),yield a.value)}}function a(e){const t=e;return void 0===t[Symbol.asyncIterator]&&(t[Symbol.asyncIterator]=()=>t),t}t.chain=s,t.mapToIterator=async function*(e,t,r=!0){if(r){const r=e.map((e=>async function*(){yield t(e)}()));yield*a(s(r))}else yield*e.map(t)},t.iterable=a,t.flattenIterator=async function(e){const t=[];for await(const r of a(e))t.push(r);return t}},35144:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryCache=t.clearCache=t.getCacheKeyFromFunctionArgs=t.getGlobalCacheStore=void 0;const r=new Map;t.getGlobalCacheStore=function(){return r},t.getCacheKeyFromFunctionArgs=function(e,t){return`KeyPrefix=${e}-Args=${t.map((e=>`${JSON.stringify(e)}`)).join("-Arg-Separator-")}`},t.clearCache=function(){r.clear()},t.InMemoryCache=class{constructor(e){this.expiryDurationMs=e}get hasData(){return!(!this.cacheData||this.hasExpired(this.cacheData.expiry))||(this.cacheData=void 0,!1)}get data(){var e;if(this.hasData)return null===(e=this.cacheData)||void 0===e?void 0:e.value}set data(e){this.cacheData=void 0!==e?{expiry:this.calculateExpiry(),value:e}:void 0}clear(){this.cacheData=void 0}hasExpired(e){return e<=Date.now()}calculateExpiry(){return Date.now()+this.expiryDurationMs}}},36952:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swallowExceptions=t.cache=t.makeDebounceAsyncDecorator=t.makeDebounceDecorator=t.debounceAsync=t.debounceSync=void 0,r(32727);const n=r(19735),i=r(77570),o=r(59314),s=r(35144),a=r(70057),c=r(23279);function u(e){return function(t,r,n){const i=n.value,o=c((function(){return i.apply(this,arguments)}),e,{});n.value=o}}function l(e){return function(t,r,n){const i=n.value,s={started:!1,deferred:void 0,timer:void 0};n.value=function(){const t=s.deferred;if(t&&s.started)return t.promise;const r=t&&t.completed,n=s.deferred=!t||r?(0,o.createDeferred)():t;return s.timer&&clearTimeout(s.timer),s.timer=setTimeout((async()=>{s.started=!0,i.apply(this).then((e=>{s.started=!1,n.resolve(e)})).catch((e=>{s.started=!1,n.reject(e)}))}),e||0),n.promise}}}t.debounceSync=function(e){return(0,i.isTestExecution)()&&(e=void 0),u(e)},t.debounceAsync=function(e){return(0,i.isTestExecution)()&&(e=void 0),l(e)},t.makeDebounceDecorator=u,t.makeDebounceAsyncDecorator=l;const h=(0,s.getGlobalCacheStore)(),p=new a.StopWatch;t.cache=function(e,t=!1,r){return function(o,a,c){const u=c.value,l=`Cache_Method_Output_${"constructor"in o&&o.constructor.name?o.constructor.name:""}.${a}`;c.value=async function(...o){if((0,i.isTestExecution)())return u.apply(this,o);let a;try{a=(0,s.getCacheKeyFromFunctionArgs)(l,o)}catch(e){return(0,n.traceError)("Error while creating key for keyPrefix:",l,e),u.apply(this,o)}const c=h.get(a);if(c&&(c.expiry>Date.now()||-1===e))return(0,n.traceVerbose)(`Cached data exists ${a}`),Promise.resolve(c.data);const d=r&&p.elapsedTime>2e5?r:e,f=u.apply(this,o);return t?h.set(a,{data:f,expiry:Date.now()+d}):f.then((e=>h.set(a,{data:e,expiry:Date.now()+d}))).ignoreErrors(),f}}},t.swallowExceptions=function(e){return function(t,r,o){const s=o.value,a=`Python Extension (Error in ${e||r}, method:${r}):`;o.value=function(...e){try{const t=s.apply(this,e);if(t&&"function"==typeof t.then&&"function"==typeof t.catch)return t.catch((e=>{(0,i.isTestExecution)()||(0,n.traceError)(a,e)}))}catch(e){if((0,i.isTestExecution)())return;(0,n.traceError)(a,e)}}}}},47237:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidAndExecutable=t.getSearchPathEntries=t.getSearchPathEnvVarNames=void 0;const n=r(57147),i=r(71017),o=r(87450);function s(e=(0,o.getOSType)()){return e===o.OSType.Windows?["Path","PATH"]:["PATH"]}t.getSearchPathEnvVarNames=s,t.getSearchPathEntries=function(){const e=s();for(const t of e){const e=(0,o.getEnvironmentVariable)(t);if(void 0!==e)return e.split(i.delimiter).map((e=>e.trim())).filter((e=>e.length>0))}return[]},t.isValidAndExecutable=async function(e){try{await n.promises.access(e,n.constants.X_OK)}catch(e){return!1}if((0,o.getOSType)()!==o.OSType.Windows)return!0}},56091:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFileFilter=t.getFileType=t.convertFileType=t.FileType=void 0;const n=r(57147),i=r(66828),o=r(19735);function s(e){return e.isFile()?t.FileType.File:e.isDirectory()?t.FileType.Directory:e.isSymbolicLink()?t.FileType.SymbolicLink:t.FileType.Unknown}async function a(e,r={ignoreErrors:!0}){let i;try{i=await n.promises.lstat(e)}catch(n){if("ENOENT"===n.code)return;if(r.ignoreErrors)return(0,o.traceError)(`lstat() failed for "${e}" (${n})`),t.FileType.Unknown;throw n}return s(i)}t.FileType=i.FileType,t.convertFileType=s,t.getFileType=a,t.getFileFilter=function(e={ignoreMissing:!0}){const r=function(e){if(void 0!==e){if(Array.isArray(e)){if(0===e.length)return;return e}return[e]}}(e.ignoreFileType);if(e.ignoreMissing||r)return async function(n){let i=await async function(e,t={}){let r;if("string"!=typeof e){if(!t.ensure){if(void 0===t.onMissing)return e;if(void 0!==await a(e.filename))return e}r=e.filename}else r=e;const n=await a(r)||t.onMissing;if(void 0!==n)return{filename:r,filetype:n}}(n,{ensure:e.ensureEntry});if(!i){if(e.ignoreMissing)return!1;i={filename:"string"==typeof n?n:n.filename,filetype:t.FileType.Unknown}}return!r||!r.includes(i.filetype)}}},67098:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SwitchToDefaultLS=t.Python27Support=t.OutdatedDebugger=t.Testing=t.DebugConfigStrings=t.Products=t.ExtensionSurveyBanner=t.Installer=t.Linters=t.Logging=t.OutputChannelNames=t.InterpreterQuickPickList=t.Interpreters=t.Experiments=t.Http=t.LanguageService=t.TensorBoard=t.Pylance=t.AttachProcess=t.CommonSurvey=t.Common=t.Diagnostics=void 0;const n=r(90209),i=r(88586);function o(e,t){return()=>function(e,t){return(0,i.shouldLoadUsingNodeFS)()&&(0,i.loadLocalizedStringsUsingNodeFS)(new n.FileSystem),(0,i.getLocalizedString)(e,t)}(e,t)}var s,a,c,u,l,h,p,d,f,v,y,m,g,b,_,E,S;(S=t.Diagnostics||(t.Diagnostics={})).warnSourceMaps=o("diagnostics.warnSourceMaps","Source map support is enabled in the Python Extension, this will adversely impact performance of the extension."),S.disableSourceMaps=o("diagnostics.disableSourceMaps","Disable Source Map Support"),S.warnBeforeEnablingSourceMaps=o("diagnostics.warnBeforeEnablingSourceMaps","Enabling source map support in the Python Extension will adversely impact performance of the extension."),S.enableSourceMapsAndReloadVSC=o("diagnostics.enableSourceMapsAndReloadVSC","Enable and reload Window."),S.lsNotSupported=o("diagnostics.lsNotSupported","Your operating system does not meet the minimum requirements of the Python Language Server. Reverting to the alternative autocompletion provider, Jedi."),S.removedPythonPathFromSettings=o("diagnostics.removedPythonPathFromSettings",'The "python.pythonPath" setting in your settings.json is no longer used by the Python extension. If you want, you can use a new setting called "python.defaultInterpreterPath" instead. Keep in mind that you need to change the value of this setting manually as the Python extension doesn\'t modify it when you change interpreters. [Learn more](https://aka.ms/AA7jfor).'),S.invalidPythonPathInDebuggerSettings=o("diagnostics.invalidPythonPathInDebuggerSettings",'You need to select a Python interpreter before you start debugging.\n\nTip: click on "Select Python Interpreter" in the status bar.'),S.invalidPythonPathInDebuggerLaunch=o("diagnostics.invalidPythonPathInDebuggerLaunch","The Python path in your debug configuration is invalid."),S.invalidDebuggerTypeDiagnostic=o("diagnostics.invalidDebuggerTypeDiagnostic",'Your launch.json file needs to be updated to change the "pythonExperimental" debug configurations to use the "python" debugger type, otherwise Python debugging may not work. Would you like to automatically update your launch.json file now?'),S.consoleTypeDiagnostic=o("diagnostics.consoleTypeDiagnostic",'Your launch.json file needs to be updated to change the console type string from "none" to "internalConsole", otherwise Python debugging may not work. Would you like to automatically update your launch.json file now?'),S.justMyCodeDiagnostic=o("diagnostics.justMyCodeDiagnostic",'Configuration "debugStdLib" in launch.json is no longer supported. It\'s recommended to replace it with "justMyCode", which is the exact opposite of using "debugStdLib". Would you like to automatically update your launch.json file to do that?'),S.yesUpdateLaunch=o("diagnostics.yesUpdateLaunch","Yes, update launch.json"),S.invalidTestSettings=o("diagnostics.invalidTestSettings",'Your settings needs to be updated to change the setting "python.unitTest." to "python.testing.", otherwise testing Python code using the extension may not work. Would you like to automatically update your settings now?'),S.updateSettings=o("diagnostics.updateSettings","Yes, update settings"),S.checkIsort5UpgradeGuide=o("diagnostics.checkIsort5UpgradeGuide","We found outdated configuration for sorting imports in this workspace. Check the [isort upgrade guide](https://aka.ms/AA9j5x4) to update your settings."),S.pylanceDefaultMessage=o("diagnostics.pylanceDefaultMessage","The Python extension now includes Pylance to improve completions, code navigation, overall performance and much more! You can learn more about the update and learn how to change your language server [here](https://aka.ms/new-python-bundle).\n\nRead Pylance's license [here](https://marketplace.visualstudio.com/items/ms-python.vscode-pylance/license)."),(E=t.Common||(t.Common={})).bannerLabelYes=o("Common.bannerLabelYes","Yes"),E.bannerLabelNo=o("Common.bannerLabelNo","No"),E.yesPlease=o("Common.yesPlease","Yes, please"),E.canceled=o("Common.canceled","Canceled"),E.cancel=o("Common.cancel","Cancel"),E.ok=o("Common.ok","Ok"),E.gotIt=o("Common.gotIt","Got it!"),E.install=o("Common.install","Install"),E.loadingExtension=o("Common.loadingPythonExtension","Python extension loading..."),E.openOutputPanel=o("Common.openOutputPanel","Show output"),E.noIWillDoItLater=o("Common.noIWillDoItLater","No, I will do it later"),E.notNow=o("Common.notNow","Not now"),E.doNotShowAgain=o("Common.doNotShowAgain","Do not show again"),E.reload=o("Common.reload","Reload"),E.moreInfo=o("Common.moreInfo","More Info"),E.learnMore=o("Common.learnMore","Learn more"),E.and=o("Common.and","and"),E.reportThisIssue=o("Common.reportThisIssue","Report this issue"),E.recommended=o("Common.recommended","Recommended"),E.clearAll=o("Common.clearAll","Clear all"),(_=t.CommonSurvey||(t.CommonSurvey={})).remindMeLaterLabel=o("CommonSurvey.remindMeLaterLabel","Remind me later"),_.yesLabel=o("CommonSurvey.yesLabel","Yes, take survey now"),_.noLabel=o("CommonSurvey.noLabel","No, thanks"),(b=t.AttachProcess||(t.AttachProcess={})).unsupportedOS=o("AttachProcess.unsupportedOS","Operating system '{0}' not supported."),b.attachTitle=o("AttachProcess.attachTitle","Attach to process"),b.selectProcessPlaceholder=o("AttachProcess.selectProcessPlaceholder","Select the process to attach to"),b.noProcessSelected=o("AttachProcess.noProcessSelected","No process selected"),b.refreshList=o("AttachProcess.refreshList","Refresh process list"),(g=t.Pylance||(t.Pylance={})).remindMeLater=o("Pylance.remindMeLater","Remind me later"),g.pylanceNotInstalledMessage=o("Pylance.pylanceNotInstalledMessage","Pylance extension is not installed."),g.pylanceInstalledReloadPromptMessage=o("Pylance.pylanceInstalledReloadPromptMessage","Pylance extension is now installed. Reload window to activate?"),g.pylanceRevertToJediPrompt=o("Pylance.pylanceRevertToJediPrompt",'The Pylance extension is not installed but the python.languageServer value is set to "Pylance". Would you like to install the Pylance extension to use Pylance, or revert back to Jedi?'),g.pylanceInstallPylance=o("Pylance.pylanceInstallPylance","Install Pylance"),g.pylanceRevertToJedi=o("Pylance.pylanceRevertToJedi","Revert to Jedi"),(m=t.TensorBoard||(t.TensorBoard={})).enterRemoteUrl=o("TensorBoard.enterRemoteUrl","Enter remote URL"),m.enterRemoteUrlDetail=o("TensorBoard.enterRemoteUrlDetail","Enter a URL pointing to a remote directory containing your TensorBoard log files"),m.useCurrentWorkingDirectoryDetail=o("TensorBoard.useCurrentWorkingDirectoryDetail","TensorBoard will search for tfevent files in all subdirectories of the current working directory"),m.useCurrentWorkingDirectory=o("TensorBoard.useCurrentWorkingDirectory","Use current working directory"),m.currentDirectory=o("TensorBoard.currentDirectory","Current: {0}"),m.logDirectoryPrompt=o("TensorBoard.logDirectoryPrompt","Select a log directory to start TensorBoard with"),m.progressMessage=o("TensorBoard.progressMessage","Starting TensorBoard session..."),m.failedToStartSessionError=o("TensorBoard.failedToStartSessionError","We failed to start a TensorBoard session due to the following error: {0}"),m.nativeTensorBoardPrompt=o("TensorBoard.nativeTensorBoardPrompt",'VS Code now has integrated TensorBoard support. Would you like to launch TensorBoard? (Tip: Launch TensorBoard anytime by opening the command palette and searching for "Launch TensorBoard".)'),m.selectAFolder=o("TensorBoard.selectAFolder","Select a folder"),m.selectAFolderDetail=o("TensorBoard.selectAFolderDetail","Select a log directory containing tfevent files"),m.selectAnotherFolder=o("TensorBoard.selectAnotherFolder","Select another folder"),m.selectAnotherFolderDetail=o("TensorBoard.selectAnotherFolderDetail","Use the file explorer to select another folder"),m.installPrompt=o("TensorBoard.installPrompt","The package TensorBoard is required to launch a TensorBoard session. Would you like to install it?"),m.installTensorBoardAndProfilerPluginPrompt=o("TensorBoard.installTensorBoardAndProfilerPluginPrompt","TensorBoard >= 2.4.1 and the PyTorch Profiler TensorBoard plugin >= 0.2.0 are required. Would you like to install these packages?"),m.installProfilerPluginPrompt=o("TensorBoard.installProfilerPluginPrompt","We recommend installing version >= 0.2.0 of the PyTorch Profiler TensorBoard plugin. Would you like to install the package?"),m.upgradePrompt=o("TensorBoard.upgradePrompt","Integrated TensorBoard support is only available for TensorBoard >= 2.4.1. Would you like to upgrade your copy of TensorBoard?"),m.launchNativeTensorBoardSessionCodeLens=o("TensorBoard.launchNativeTensorBoardSessionCodeLens","▶ Launch TensorBoard Session"),m.launchNativeTensorBoardSessionCodeAction=o("TensorBoard.launchNativeTensorBoardSessionCodeAction","Launch TensorBoard session"),m.missingSourceFile=o("TensorBoard.missingSourceFile","We could not locate the requested source file on disk. Please manually specify the file."),m.selectMissingSourceFile=o("TensorBoard.selectMissingSourceFile","Choose File"),m.selectMissingSourceFileDescription=o("TensorBoard.selectMissingSourceFileDescription","The source file's contents may not match the original contents in the trace."),(y=t.LanguageService||(t.LanguageService={})).virtualWorkspaceStatusItem={detail:o("LanguageService.virtualWorkspaceStatusItem.detail","Limited IntelliSense supported by Jedi and Pylance")},y.statusItem={name:o("LanguageService.statusItem.name","Python IntelliSense Status"),text:o("LanguageService.statusItem.text","Partial Mode"),detail:o("LanguageService.statusItem.detail","Limited IntelliSense provided by Pylance")},y.startingPylance=o("LanguageService.startingPylance","Starting Pylance language server."),y.startingJedi=o("LanguageService.startingJedi","Starting Jedi language server."),y.startingNone=o("LanguageService.startingNone","Editor support is inactive since language server is set to None."),y.untrustedWorkspaceMessage=o("LanguageService.untrustedWorkspaceMessage","Only Pylance is supported in untrusted workspaces, setting language server to None."),y.reloadAfterLanguageServerChange=o("LanguageService.reloadAfterLanguageServerChange","Please reload the window switching between language servers."),y.lsFailedToStart=o("LanguageService.lsFailedToStart","We encountered an issue starting the language server. Reverting to Jedi language engine. Check the Python output panel for details."),y.lsFailedToDownload=o("LanguageService.lsFailedToDownload","We encountered an issue downloading the language server. Reverting to Jedi language engine. Check the Python output panel for details."),y.lsFailedToExtract=o("LanguageService.lsFailedToExtract","We encountered an issue extracting the language server. Reverting to Jedi language engine. Check the Python output panel for details."),y.downloadFailedOutputMessage=o("LanguageService.downloadFailedOutputMessage","Language server download failed."),y.extractionFailedOutputMessage=o("LanguageService.extractionFailedOutputMessage","Language server extraction failed."),y.extractionCompletedOutputMessage=o("LanguageService.extractionCompletedOutputMessage","Language server download complete."),y.extractionDoneOutputMessage=o("LanguageService.extractionDoneOutputMessage","done."),y.reloadVSCodeIfSeachPathHasChanged=o("LanguageService.reloadVSCodeIfSeachPathHasChanged","Search paths have changed for this Python interpreter. Please reload the extension to ensure that the IntelliSense works correctly."),(v=t.Http||(t.Http={})).downloadingFile=o("downloading.file","Downloading {0}..."),v.downloadingFileProgress=o("downloading.file.progress","{0}{1} of {2} KB ({3}%)"),(f=t.Experiments||(t.Experiments={})).inGroup=o("Experiments.inGroup","Experiment '{0}' is active"),f.optedOutOf=o("Experiments.optedOutOf","Experiment '{0}' is inactive"),(d=t.Interpreters||(t.Interpreters={})).installingPython=o("Interpreters.installingPython","Installing Python into Environment..."),d.discovering=o("Interpreters.DiscoveringInterpreters","Discovering Python Interpreters"),d.refreshing=o("Interpreters.RefreshingInterpreters","Refreshing Python Interpreters"),d.condaInheritEnvMessage=o("Interpreters.condaInheritEnvMessage",'We noticed you\'re using a conda environment. If you are experiencing issues with this environment in the integrated terminal, we recommend that you let the Python extension change "terminal.integrated.inheritEnv" to false in your user settings.'),d.environmentPromptMessage=o("Interpreters.environmentPromptMessage","We noticed a new virtual environment has been created. Do you want to select it for the workspace folder?"),d.entireWorkspace=o("Interpreters.entireWorkspace","Select at workspace level"),d.clearAtWorkspace=o("Interpreters.clearAtWorkspace","Clear at workspace level"),d.selectInterpreterTip=o("Interpreters.selectInterpreterTip","Tip: you can change the Python interpreter used by the Python extension by clicking on the Python version in the status bar"),d.pythonInterpreterPath=o("Interpreters.pythonInterpreterPath","Python interpreter path: {0}"),(p=t.InterpreterQuickPickList||(t.InterpreterQuickPickList={})).globalGroupName=o("InterpreterQuickPickList.globalGroupName","Global"),p.workspaceGroupName=o("InterpreterQuickPickList.workspaceGroupName","Workspace"),p.quickPickListPlaceholder=o("InterpreterQuickPickList.quickPickListPlaceholder","Selected Interpreter: {0}"),p.enterPath={label:o("InterpreterQuickPickList.enterPath.label","Enter interpreter path..."),placeholder:o("InterpreterQuickPickList.enterPath.placeholder","Enter path to a Python interpreter.")},p.defaultInterpreterPath={label:o("InterpreterQuickPickList.defaultInterpreterPath.label","Use Python from `python.defaultInterpreterPath` setting")},p.browsePath={label:o("InterpreterQuickPickList.browsePath.label","Find..."),detail:o("InterpreterQuickPickList.browsePath.detail","Browse your file system to find a Python interpreter."),openButtonLabel:o("python.command.python.setInterpreter.title","Select Interpreter"),title:o("InterpreterQuickPickList.browsePath.title","Select Python interpreter")},p.refreshInterpreterList=o("InterpreterQuickPickList.refreshInterpreterList","Refresh Interpreter list"),(h=t.OutputChannelNames||(t.OutputChannelNames={})).languageServer=o("OutputChannelNames.languageServer","Python Language Server"),h.python=o("OutputChannelNames.python","Python"),h.pythonTest=o("OutputChannelNames.pythonTest","Python Test Log"),(t.Logging||(t.Logging={})).currentWorkingDirectory=o("Logging.CurrentWorkingDirectory","cwd:"),(l=t.Linters||(t.Linters={})).replaceWithSelectedLinter=o("Linter.replaceWithSelectedLinter","Multiple linters are enabled in settings. Replace with '{0}'?"),l.selectLinter=o("Linter.selectLinter","Select Linter"),(u=t.Installer||(t.Installer={})).noCondaOrPipInstaller=o("Installer.noCondaOrPipInstaller","There is no Conda or Pip installer available in the selected environment."),u.noPipInstaller=o("Installer.noPipInstaller","There is no Pip installer available in the selected environment."),u.searchForHelp=o("Installer.searchForHelp","Search for help"),u.couldNotInstallLibrary=o("Installer.couldNotInstallLibrary","Could not install {0}. If pip is not available, please use the package manager of your choice to manually install this library into your Python environment."),u.dataScienceInstallPrompt=o("Installer.dataScienceInstallPrompt","Data Science library {0} is not installed. Install?"),(c=t.ExtensionSurveyBanner||(t.ExtensionSurveyBanner={})).bannerMessage=o("ExtensionSurveyBanner.bannerMessage","Can you please take 2 minutes to tell us how the Python extension is working for you?"),c.bannerLabelYes=o("ExtensionSurveyBanner.bannerLabelYes","Yes, take survey now"),c.bannerLabelNo=o("ExtensionSurveyBanner.bannerLabelNo","No, thanks"),c.maybeLater=o("ExtensionSurveyBanner.maybeLater","Maybe later"),(a=t.Products||(t.Products={})).installingModule=o("products.installingModule","Installing {0}"),a.formatterNotInstalled=o("products.formatterNotInstalled","Formatter {0} is not installed. Install?"),a.useFormatter=o("products.useFormatter","Use {0}"),a.invalidFormatterPath=o("products.invalidFormatterPath","Path to the {0} formatter is invalid ({1})"),function(e){let t,r,n,i,s,a,c,u;e.selectConfiguration={title:o("debug.selectConfigurationTitle"),placeholder:o("debug.selectConfigurationPlaceholder")},e.launchJsonCompletions={label:o("debug.launchJsonConfigurationsCompletionLabel"),description:o("debug.launchJsonConfigurationsCompletionDescription")},function(e){e.snippet={name:o("python.snippet.launch.standard.label")},e.selectConfiguration={label:o("debug.debugFileConfigurationLabel"),description:o("debug.debugFileConfigurationDescription")}}(t=e.file||(e.file={})),function(e){e.snippet={name:o("python.snippet.launch.module.label"),default:o("python.snippet.launch.module.default")},e.selectConfiguration={label:o("debug.debugModuleConfigurationLabel"),description:o("debug.debugModuleConfigurationDescription")},e.enterModule={title:o("debug.moduleEnterModuleTitle"),prompt:o("debug.moduleEnterModulePrompt"),default:o("debug.moduleEnterModuleDefault"),invalid:o("debug.moduleEnterModuleInvalidNameError")}}(r=e.module||(e.module={})),function(e){e.snippet={name:o("python.snippet.launch.attach.label")},e.selectConfiguration={label:o("debug.remoteAttachConfigurationLabel"),description:o("debug.remoteAttachConfigurationDescription")},e.enterRemoteHost={title:o("debug.attachRemoteHostTitle"),prompt:o("debug.attachRemoteHostPrompt"),invalid:o("debug.attachRemoteHostValidationError")},e.enterRemotePort={title:o("debug.attachRemotePortTitle"),prompt:o("debug.attachRemotePortPrompt"),invalid:o("debug.attachRemotePortValidationError")}}(n=e.attach||(e.attach={})),function(e){e.snippet={name:o("python.snippet.launch.attachpid.label")},e.selectConfiguration={label:o("debug.attachPidConfigurationLabel"),description:o("debug.attachPidConfigurationDescription")}}(i=e.attachPid||(e.attachPid={})),function(e){e.snippet={name:o("python.snippet.launch.django.label")},e.selectConfiguration={label:o("debug.debugDjangoConfigurationLabel"),description:o("debug.debugDjangoConfigurationDescription")},e.enterManagePyPath={title:o("debug.djangoEnterManagePyPathTitle"),prompt:o("debug.djangoEnterManagePyPathPrompt"),invalid:o("debug.djangoEnterManagePyPathInvalidFilePathError")}}(s=e.django||(e.django={})),function(e){e.snippet={name:o("python.snippet.launch.fastapi.label")},e.selectConfiguration={label:o("debug.debugFastAPIConfigurationLabel"),description:o("debug.debugFastAPIConfigurationDescription")},e.enterAppPathOrNamePath={title:o("debug.fastapiEnterAppPathOrNamePathTitle"),prompt:o("debug.fastapiEnterAppPathOrNamePathPrompt"),invalid:o("debug.fastapiEnterAppPathOrNamePathInvalidNameError")}}(a=e.fastapi||(e.fastapi={})),function(e){e.snippet={name:o("python.snippet.launch.flask.label")},e.selectConfiguration={label:o("debug.debugFlaskConfigurationLabel"),description:o("debug.debugFlaskConfigurationDescription")},e.enterAppPathOrNamePath={title:o("debug.flaskEnterAppPathOrNamePathTitle"),prompt:o("debug.flaskEnterAppPathOrNamePathPrompt"),invalid:o("debug.flaskEnterAppPathOrNamePathInvalidNameError")}}(c=e.flask||(e.flask={})),function(e){e.snippet={name:o("python.snippet.launch.pyramid.label")},e.selectConfiguration={label:o("debug.debugPyramidConfigurationLabel"),description:o("debug.debugPyramidConfigurationDescription")},e.enterDevelopmentIniPath={title:o("debug.pyramidEnterDevelopmentIniPathTitle"),prompt:o("debug.pyramidEnterDevelopmentIniPathPrompt"),invalid:o("debug.pyramidEnterDevelopmentIniPathInvalidFilePathError")}}(u=e.pyramid||(e.pyramid={}))}(t.DebugConfigStrings||(t.DebugConfigStrings={})),(s=t.Testing||(t.Testing={})).configureTests=o("Testing.configureTests","Configure Test Framework"),s.testNotConfigured=o("Testing.testNotConfigured","No test framework configured."),(t.OutdatedDebugger||(t.OutdatedDebugger={})).outdatedDebuggerMessage=o("OutdatedDebugger.updateDebuggerMessage","We noticed you are attaching to ptvsd (Python debugger), which was deprecated on May 1st, 2020. Please switch to [debugpy](https://aka.ms/migrateToDebugpy)."),(t.Python27Support||(t.Python27Support={})).jediMessage=o("Python27Support.jediMessage","IntelliSense with Jedi for Python 2.7 is no longer supported. [Learn more](https://aka.ms/python-27-support)."),(t.SwitchToDefaultLS||(t.SwitchToDefaultLS={})).bannerMessage=o("SwitchToDefaultLS.bannerMessage","The Microsoft Python Language Server has reached end of life. Your language server has been set to the default for Python in VS Code, Pylance.\n\nIf you'd like to change your language server, you can learn about how to do so [here](https://devblogs.microsoft.com/python/python-in-visual-studio-code-may-2021-release/#configuring-your-language-server).\n\nRead Pylance's license [here](https://marketplace.visualstudio.com/items/ms-python.vscode-pylance/license)."),(0,i.loadLocalizedStringsUsingNodeFS)(new n.FileSystem)},88586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadLocalizedStringsForBrowser=t.loadLocalizedStringsUsingNodeFS=t.getLocalizedString=t.shouldLoadUsingNodeFS=t._getAskedForCollection=t._resetCollections=void 0;const n=r(66828),i=r(71017),o=r(63281);let s,a,c,u={};function l(){try{if(null===navigator||void 0===navigator?void 0:navigator.language)return navigator.language.toLowerCase()}catch(e){}const e=process.env.VSCODE_NLS_CONFIG;return e?JSON.parse(e).locale:"en-us"}async function h(e){try{const t=e?`package.nls.${e}.json`:"package.nls.json",r=n.Uri.joinPath(n.Uri.file(o.EXTENSION_ROOT_DIR),t),i=await n.workspace.fs.readFile(r),s=(new TextDecoder).decode(i);return JSON.parse(s)}catch(e){return{}}}t._resetCollections=function(){c="",s=void 0,u={}},t._getAskedForCollection=function(){return u},t.shouldLoadUsingNodeFS=function(){return!s||l()!==c},t.getLocalizedString=function(e,t){let r=a;if(s&&s.hasOwnProperty(e)&&(r=s),void 0===r)throw new Error(`Localizations haven't been loaded yet for key: ${e}`);let n=r[e];return!n&&t&&(n=t),u[e]=n,n},t.loadLocalizedStringsUsingNodeFS=function(e){c=l();const t=i.join(o.EXTENSION_ROOT_DIR,`package.nls.${c}.json`);if(e.fileExistsSync(t)){const r=e.readFileSync(t);s=JSON.parse(r)}else s={};if(!a){const t=i.join(o.EXTENSION_ROOT_DIR,"package.nls.json");if(e.fileExistsSync(t)){const r=e.readFileSync(t);a=JSON.parse(r)}else a={}}},t.loadLocalizedStringsForBrowser=async function(){c=l(),s=await h(c),a||(a=await h())}},3481:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNotebookCell=t.getURIFilter=t.isResource=t.noop=void 0;const n=r(77570),i=r(48431);t.noop=function(){},t.isResource=function(e){if(!e)return!0;const t=e;return"string"==typeof t.path&&"string"==typeof t.scheme},t.getURIFilter=function(e,t={checkParent:!0}){let r=e.path;for(;r.endsWith("/");)r=r.slice(0,-1);const n=`${r}/`;return function(o){if(o.scheme!==e.scheme)return!1;let s=o.path;for(;s.endsWith("/");)s=s.slice(0,-1);if(t.checkParent&&(0,i.isParentPath)(s,n))return!0;if(t.checkChild){const e=`${s}/`;if((0,i.isParentPath)(r,e))return!0}return!1}},t.isNotebookCell=function(e){const t=function(e){if(!e)return!1;const t=e;return"string"==typeof t.path&&"string"==typeof t.scheme}(e)?e:e.uri;return t.scheme.includes(n.NotebookCellScheme)||t.scheme.includes(n.InteractiveInputScheme)}},22207:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MultiStepInputFactory=t.IMultiStepInputFactory=t.MultiStepInput=void 0;const o=r(86700),s=r(66828),a=r(17585);class c{constructor(){}}c.back=new c,c.cancel=new c,c.resume=new c;class u{constructor(e){this.shell=e,this.steps=[]}run(e,t){return this.stepThrough(e,t)}async showQuickPick({title:e,step:t,totalSteps:r,items:n,activeItem:i,placeholder:o,customButtonSetup:a,matchOnDescription:u,matchOnDetail:l,acceptFilterBoxTextAsSelection:h,onChangeItem:p,keepScrollPosition:d,sortByLabel:f}){const v=[];try{return await new Promise(((y,m)=>{const g=this.shell.createQuickPick();g.title=e,g.step=t,g.sortByLabel=f||!1,g.totalSteps=r,g.placeholder=o,g.ignoreFocusOut=!0,g.items=n,g.matchOnDescription=u||!1,g.matchOnDetail=l||!1,g.activeItems=i?[i]:[],g.buttons=this.steps.length>1?[s.QuickInputButtons.Back]:[],a&&(g.buttons=[...g.buttons,a.button]),v.push(g.onDidTriggerButton((async e=>{e===s.QuickInputButtons.Back?m(c.back):e===(null==a?void 0:a.button)?await a.callback(g):y(e)})),g.onDidChangeSelection((e=>y(e[0]))),g.onDidHide((()=>{y(void 0)}))),h&&v.push(g.onDidAccept((()=>{y(g.value)}))),this.current&&this.current.dispose(),this.current=g,p&&v.push(p.event((e=>p.callback(e,g)))),this.current.show(),g.keepScrollPosition=d}))}finally{v.forEach((e=>e.dispose()))}}async showInputBox({title:e,step:t,totalSteps:r,value:n,prompt:i,validate:o,password:a,buttons:u}){const l=[];try{return await new Promise(((h,p)=>{const d=this.shell.createInputBox();d.title=e,d.step=t,d.totalSteps=r,d.password=!!a,d.value=n||"",d.prompt=i,d.ignoreFocusOut=!0,d.buttons=[...this.steps.length>1?[s.QuickInputButtons.Back]:[],...u||[]];let f=o("");l.push(d.onDidTriggerButton((e=>{e===s.QuickInputButtons.Back?p(c.back):h(e)})),d.onDidAccept((async()=>{const e=d.value;d.enabled=!1,d.busy=!0,await o(e)||h(e),d.enabled=!0,d.busy=!1})),d.onDidChangeValue((async e=>{const t=o(e);f=t;const r=await t;t===f&&(d.validationMessage=r)})),d.onDidHide((()=>{h(void 0)}))),this.current&&this.current.dispose(),this.current=d,this.current.show()}))}finally{l.forEach((e=>e.dispose()))}}async stepThrough(e,t){let r=e;for(;r;){this.steps.push(r),this.current&&(this.current.enabled=!1,this.current.busy=!0);try{r=await r(this,t)}catch(e){if(e===c.back)this.steps.pop(),r=this.steps.pop();else if(e===c.resume)r=this.steps.pop();else{if(e!==c.cancel)throw e;r=void 0}}}this.current&&this.current.dispose()}}t.MultiStepInput=u,t.IMultiStepInputFactory=Symbol("IMultiStepInputFactory");let l=class{constructor(e){this.shell=e}create(){return new u(this.shell)}};l=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IApplicationShell))],l),t.MultiStepInputFactory=l},87450:(e,t,r)=>{"use strict";var n,i;function o(e=process.platform){return/^win/.test(e)?i.Windows:/^darwin/.test(e)?i.OSX:/^linux/.test(e)?i.Linux:i.Unknown}Object.defineProperty(t,"__esModule",{value:!0}),t.getUserHomeDir=t.getEnvironmentVariable=t.getArchitecture=t.getOSType=t.OSType=t.Architecture=void 0,function(e){e[e.Unknown=1]="Unknown",e[e.x86=2]="x86",e[e.x64=3]="x64"}(n=t.Architecture||(t.Architecture={})),function(e){e.Unknown="Unknown",e.Windows="Windows",e.OSX="OSX",e.Linux="Linux"}(i=t.OSType||(t.OSType={})),t.getOSType=o;const s={x86:n.x86,x64:n.x64,"":n.Unknown};function a(e){return process.env[e]}t.getArchitecture=function(){const e=s[process.arch];if(void 0!==e)return e;const t=r(3901);return s[t()]||n.Unknown},t.getEnvironmentVariable=a,t.getUserHomeDir=function(){return o()===i.Windows?a("USERPROFILE"):a("HOME")||a("HOMEPATH")}},10195:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.Random=void 0;const i=r(6113),o=r(86700);let s=class{getRandomInt(e=0,t=10){return function(e=0,t=10){return e+function(){let e=0;const t=i.randomBytes(2);return e=(t.readUInt8(0)<<8)+t.readUInt8(1),e/(Math.pow(16,4)-1)}()*(t-e)}(e,t)}};s=n([(0,o.injectable)()],s),t.Random=s},45940:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verboseRegExp=void 0,t.verboseRegExp=function(e,t){return e=(e=e.replace(/(^| {2})# .*$/gm,"")).replace(/\s+?/g,""),RegExp(e,t)}},81837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Disposables=void 0;const n=r(19735);t.Disposables=class{constructor(...e){this.disposables=[],this.disposables.push(...e)}push(...e){this.disposables.push(...e)}async dispose(){const{disposables:e}=this;this.disposables=[],await async function(e){await Promise.all(e.map((async(e,t)=>{try{await e.dispose()}catch(e){(0,n.traceWarn)(`dispose() #${t} failed (${e})`)}})))}(e)}}},58479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.runAfterActivation=t.addItemsToRunAfterActivation=void 0;const r=[];let n=!1;t.addItemsToRunAfterActivation=function(e){n?e():r.push(e)},t.runAfterActivation=function(){for(n=!0;r.length>0;){const e=r.shift();e&&e()}}},70057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StopWatch=void 0,t.StopWatch=class{constructor(){this.started=(new Date).getTime()}get elapsedTime(){return(new Date).getTime()-this.started}reset(){this.started=(new Date).getTime()}}},7086:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNumber=t.isObject=t.isString=t.isArray=void 0;const r="number";t.isArray=function(e){return Array.isArray?Array.isArray(e):!(!e||typeof e.length!==r||e.constructor!==Array)},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isObject=function(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)},t.isNumber=function(e){return(typeof e===r||e instanceof Number)&&!isNaN(e)}},52439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSemVerSafe=t.areSimilarVersions=t.areIdenticalVersion=t.parseVersionInfo=t.validateVersionInfo=t.normalizeVersionInfo=t.compareVersions=t.isVersionInfoEmpty=t.parseBasicVersionInfo=t.getVersionString=t.EMPTY_VERSION=void 0;const n=r(36625),i=r(45940);function o(e){if("number"==typeof e)return Number.isNaN(e)?[-1,"missing"]:e<0?[-1,""]:[e,""];if("string"==typeof e){const t=parseInt(e,10);return Number.isNaN(t)?[-1,"string not numeric"]:t<0?[-1,""]:[t,""]}return null==e?[-1,"missing"]:[-1,"unsupported type"]}function s(e,t,r){if(!(0===t||t>0)&&r&&""!==r)throw Error(`invalid ${e} version (failed to normalize; ${r})`)}t.EMPTY_VERSION={major:-1,minor:-1,micro:-1,unnormalized:{major:void 0,minor:void 0,micro:void 0}},Object.freeze(t.EMPTY_VERSION),t.getVersionString=function(e){return e.major<0?"":e.minor<0?`${e.major}`:e.micro<0?`${e.major}.${e.minor}`:`${e.major}.${e.minor}.${e.micro}`};const a=(0,i.verboseRegExp)("\n ^\n (.*?) # \n (\\d+) # \n (?:\n [.]\n (\\d+) # \n (?:\n [.]\n (\\d+) # \n )?\n )?\n ([^\\d].*)? # \n $\n","s");function c(e){const t=e.match(a);if(!t)return;const[,r,n,i,o,s]=t;if(!r||!r.endsWith(".")){if(s&&""!==s){if("."===s)return;if(!(r&&""!==r||o&&""!==o))return}return{version:{major:parseInt(n,10),minor:i?parseInt(i,10):-1,micro:o?parseInt(o,10):-1},before:r||"",after:s||""}}}function u(e,t,r){return e.majort.major?[-1,"major"]:-1===e.major?[0,""]:e.minort.minor?[-1,"minor"]:-1===e.minor?[0,""]:e.microt.micro?[-1,"micro"]:void 0!==r?r(e,t):[0,""]}t.parseBasicVersionInfo=c,t.isVersionInfoEmpty=function(e){return!!e&&"number"==typeof e.major&&"number"==typeof e.minor&&"number"==typeof e.micro&&e.major<0&&e.minor<0&&e.micro<0},t.compareVersions=u,t.normalizeVersionInfo=function(e){const r=function(e){if(!e)return t.EMPTY_VERSION;const r=function(e){const t={major:e.major,minor:e.minor,micro:e.micro},{unnormalized:r}=e;return void 0!==r&&(t.unnormalized={major:r.major,minor:r.minor,micro:r.micro}),t}(e);return void 0===r.unnormalized&&(r.unnormalized={},[r.major,r.unnormalized.major]=o(r.major),[r.minor,r.unnormalized.minor]=o(r.minor),[r.micro,r.unnormalized.micro]=o(r.micro)),r}(e);return r.raw=e.raw,r.raw||(r.raw=""),r},t.validateVersionInfo=function(e){!function(e){var t,r,n;const i=e;if(s("major",e.major,null===(t=i.unnormalized)||void 0===t?void 0:t.major),s("minor",e.minor,null===(r=i.unnormalized)||void 0===r?void 0:r.minor),s("micro",e.micro,null===(n=i.unnormalized)||void 0===n?void 0:n.micro),e.major<0)throw Error("missing major version");if(e.minor<0&&(0===e.micro||e.micro>0))throw Error("missing minor version")}(e)},t.parseVersionInfo=function(e){const t=c(e);if(void 0!==t)return t.version.raw=e,t},t.areIdenticalVersion=function(e,t,r){const[n]=u(e,t,r);return 0===n},t.areSimilarVersions=function(e,t,r){const[n,i]=u(e,t,r);return 0===n||"major"!==i&&(n<0?-1===t[i]:-1===e[i])},t.parseSemVerSafe=function(e){e=e.replace(/\.00*(?=[1-9]|0\.)/,".");const t=n.coerce(e);return null!==t&&n.valid(t)?t:new n.SemVer("0.0.0")}},97749:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRunningWorkerPool=t.QueuePosition=void 0;const n=r(19735),i=r(59314);var o;!function(e){e[e.Back=0]="Back",e[e.Front=1]="Front"}(o=t.QueuePosition||(t.QueuePosition={}));class s{constructor(e,t,r,n){this.next=e,this.workFunc=t,this.postResult=r,this.name=n,this.stopProcessing=!1}stop(){this.stopProcessing=!0}async start(){for(;!this.stopProcessing;)try{const e=await this.next();try{const t=await this.workFunc(e);this.postResult(e,t)}catch(t){this.postResult(e,void 0,t)}}catch(e){(0,n.traceError)(`Error while running worker[${this.name}].`,e);continue}}}class a{constructor(){this.items=[],this.results=new Map}add(e,t){const r={item:e};t===o.Front?this.items.unshift(r):this.items.push(r);const n=(0,i.createDeferred)();return this.results.set(r,n),n.promise}completed(e,t,r){const n=this.results.get(e);void 0!==n&&(this.results.delete(e),void 0!==r&&n.reject(r),n.resolve(t))}next(){return this.items.shift()}clear(){this.results.forEach(((e,t,r)=>{e.reject(Error("Queue stopped processing")),r.delete(t)}))}}class c{constructor(e,t=2,r="Worker"){this.workerFunc=e,this.numWorkers=t,this.name=r,this.workers=[],this.waitingWorkersUnblockQueue=[],this.queue=new a,this.stopProcessing=!1}addToQueue(e,t){if(this.stopProcessing)throw Error("Queue is stopped");const r=this.queue.add(e,t),i=this.waitingWorkersUnblockQueue.shift();if(i){const e=this.queue.next();void 0!==e?i.unblock(e):(0,n.traceError)("Work queue was empty immediately after adding item.")}return r}start(){this.stopProcessing=!1;let e=this.numWorkers;for(;e>0;)this.workers.push(new s((()=>this.nextWorkItem()),(e=>this.workerFunc(e.item)),((e,t,r)=>this.queue.completed(e,t,r)),`${this.name} ${e}`)),e-=1;this.workers.forEach((async e=>e.start()))}stop(){this.stopProcessing=!0;let e=this.workers.shift();for(;e;)e.stop(),e=this.workers.shift();this.queue.clear();let t=this.waitingWorkersUnblockQueue.shift();for(;t;)t.stop(),t=this.waitingWorkersUnblockQueue.shift()}nextWorkItem(){const e=this.queue.next();return void 0!==e?Promise.resolve(e):new Promise(((e,t)=>{this.waitingWorkersUnblockQueue.push({unblock:r=>{this.stopProcessing&&t(),e(r)},stop:()=>{t()}})}))}}t.createRunningWorkerPool=function(e,t,r){const n=new c(e,t,r);return n.start(),n}},17197:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseEnvFile=t.EnvironmentVariablesService=void 0;const o=r(86700),s=r(71017),a=r(19735),c=r(54813),u=r(61522),l=r(84974),h=r(61684);let p=class{constructor(e,t){this.pathUtils=e,this.fs=t}async parseFile(e,t){if(!e||!await this.fs.pathExists(e))return;const r=await this.fs.readFile(e).catch((e=>{(0,a.traceError)("Custom .env is likely not pointing to a valid file",e)}));return r?d(r,t):void 0}mergeVariables(e,t,r){if(!t)return;const n=["PYTHONPATH",this.pathVariable];Object.keys(e).forEach((i=>{n.indexOf(i)>=0||(void 0===t[i]||(null==r?void 0:r.overwrite))&&(t[i]=e[i])}))}appendPythonPath(e,...t){return this.appendPaths(e,"PYTHONPATH",...t)}appendPath(e,...t){return this.appendPaths(e,this.pathVariable,...t)}get pathVariable(){return this._pathVariable||(this._pathVariable=this.pathUtils.getPathVariableName()),this._pathVariable}appendPaths(e,t,...r){const n=r.filter((e=>"string"==typeof e&&e.trim().length>0)).map((e=>e.trim())).join(s.delimiter);if(0===n.length)return e;const i=e?e[t]:void 0;return i&&"string"==typeof i&&i.length>0?e[t]=i+s.delimiter+n:e[t]=n,e}};function d(e,t){const r=t||{},n={};return e.toString().split("\n").forEach(((e,t)=>{const[i,o]=function(e){const t=e.match(/^\s*([a-zA-Z]\w*)\s*=\s*(.*?)?\s*$/);if(!t)return["",""];const r=t[1];let n=t[2];return n&&""!==n?("'"===n[0]&&"'"===n[n.length-1]||'"'===n[0]&&'"'===n[n.length-1])&&(n=n.substring(1,n.length-1),n=n.replace(/\\n/gm,"\n")):n="",[r,n]}(e);""!==i&&(n[i]=function(e,t,r,n=""){let i=!1,o=e;return o=o.replace(f,((e,o,s,a,c)=>a>0&&"\\"===c[a-1]?e:s&&""!==s||!o||""===o?(i=!0,e):t[o]||r[o]||n)),i||o===e||(e=o,(0,c.sendTelemetryEvent)(u.EventName.ENVFILE_VARIABLE_SUBSTITUTION)),e.replace(/\\\$/g,"$")}(o,n,r))})),n}p=n([(0,o.injectable)(),i(0,(0,o.inject)(h.IPathUtils)),i(1,(0,o.inject)(l.IFileSystem))],p),t.EnvironmentVariablesService=p,t.parseEnvFile=d;const f=/\${([a-zA-Z]\w*)?([^}\w].*)?}/g},88939:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentVariablesProvider=void 0;const o=r(86700),s=r(66828),a=r(19735),c=r(98634),u=r(17585),l=r(89515),h=r(84974),p=r(61684),d=r(35144),f=r(48683),v=r(19909);let y=class{constructor(e,t,r,n,i,o=36e5){this.envVarsService=e,this.platformService=r,this.workspaceService=n,this.process=i,this.cacheDuration=o,this.trackedWorkspaceFolders=new Set,this.fileWatchers=new Map,this.disposables=[],this.envVarCaches=new Map,t.push(this),this.changeEventEmitter=new s.EventEmitter;const a=this.workspaceService.onDidChangeConfiguration(this.configurationChanged,this);this.disposables.push(a)}get onDidEnvironmentVariablesChange(){return this.changeEventEmitter.event}dispose(){this.changeEventEmitter.dispose(),this.fileWatchers.forEach((e=>{e&&e.dispose()}))}async getEnvironmentVariables(e){var t,r;const n=null!==(r=null===(t=this.getWorkspaceFolderUri(e))||void 0===t?void 0:t.fsPath)&&void 0!==r?r:"";let i=this.envVarCaches.get(n);if(i){const t=i.data;if(t)return(0,a.traceVerbose)(`Cached data exists getEnvironmentVariables, ${e?e.fsPath:""}`),{...t}}else i=new d.InMemoryCache(this.cacheDuration),this.envVarCaches.set(n,i);const o=await this._getEnvironmentVariables(e);return i.data={...o},o}async _getEnvironmentVariables(e){let t=await this.getCustomEnvironmentVariables(e);t||(t={}),this.envVarsService.mergeVariables(this.process.env,t);const r=this.platformService.pathVariableName,n=this.process.env[r];return n&&this.envVarsService.appendPath(t,n),this.process.env.PYTHONPATH&&this.envVarsService.appendPythonPath(t,this.process.env.PYTHONPATH),t}async getCustomEnvironmentVariables(e){var t;const r=new f.SystemVariables(void 0,null===(t=l.PythonSettings.getSettingsUriAndTarget(e,this.workspaceService).uri)||void 0===t?void 0:t.fsPath,this.workspaceService),n=this.workspaceService.getConfiguration("python",e).get("envFile"),i=r.resolveAny(n),o=this.getWorkspaceFolderUri(e);return this.trackedWorkspaceFolders.add(o?o.fsPath:""),this.createFileWatcher(i,o),this.envVarsService.parseFile(i,this.process.env)}configurationChanged(e){this.trackedWorkspaceFolders.forEach((t=>{const r=t&&t.length>0?s.Uri.file(t):void 0;e.affectsConfiguration("python.envFile",r)&&this.onEnvironmentFileChanged(r)}))}createFileWatcher(e,t){if(!this.fileWatchers.has(e))try{const r=this.workspaceService.createFileSystemWatcher(e);this.fileWatchers.set(e,r),r&&(this.disposables.push(r.onDidChange((()=>this.onEnvironmentFileChanged(t)))),this.disposables.push(r.onDidCreate((()=>this.onEnvironmentFileCreated(t)))),this.disposables.push(r.onDidDelete((()=>this.onEnvironmentFileChanged(t)))))}catch(r){(0,a.traceError)(`Failed to create a file system watcher for ${e} in ${null==t?void 0:t.fsPath}`,r)}}getWorkspaceFolderUri(e){if(!e)return;const t=this.workspaceService.getWorkspaceFolder(e);return t?t.uri:void 0}onEnvironmentFileCreated(e){this.onEnvironmentFileChanged(e),(0,c.sendFileCreationTelemetry)()}onEnvironmentFileChanged(e){this.envVarCaches.clear(),this.changeEventEmitter.fire(e)}};y=n([(0,o.injectable)(),i(0,(0,o.inject)(v.IEnvironmentVariablesService)),i(1,(0,o.inject)(p.IDisposableRegistry)),i(2,(0,o.inject)(h.IPlatformService)),i(3,(0,o.inject)(u.IWorkspaceService)),i(4,(0,o.inject)(p.ICurrentProcess)),i(5,(0,o.optional)())],y),t.EnvironmentVariablesProvider=y},28285:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const n=r(17197),i=r(88939),o=r(19909);t.registerTypes=function(e){e.addSingleton(o.IEnvironmentVariablesService,n.EnvironmentVariablesService),e.addSingleton(o.IEnvironmentVariablesProvider,i.EnvironmentVariablesProvider)}},48683:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SystemVariables=void 0;const n=r(71017),i=r(66828),o=r(7086);t.SystemVariables=class extends class{resolve(e){return o.isString(e)?this.__resolveString(e):o.isArray(e)?this.__resolveArray(e):o.isObject(e)?this.__resolveLiteral(e):e}resolveAny(e){return o.isString(e)?this.__resolveString(e):o.isArray(e)?this.__resolveAnyArray(e):o.isObject(e)?this.__resolveAnyLiteral(e):e}__resolveString(e){return e.replace(/\$\{(.*?)\}/g,((e,t)=>{const r=this[t];return o.isString(r)?r:e&&(e.indexOf("env.")>0||e.indexOf("env:")>0)?"":e}))}__resolveLiteral(e){const t=Object.create(null);return Object.keys(e).forEach((r=>{const n=e[r];t[r]=this.resolve(n)})),t}__resolveAnyLiteral(e){const t=Object.create(null);return Object.keys(e).forEach((r=>{const n=e[r];t[r]=this.resolveAny(n)})),t}__resolveArray(e){return e.map((e=>this.__resolveString(e)))}__resolveAnyArray(e){return e.map((e=>this.resolveAny(e)))}}{constructor(e,t,r,o){super();const s=r&&e?r.getWorkspaceFolder(e):void 0;this._workspaceFolder=s?s.uri.fsPath:t||__dirname,this._workspaceFolderName=n.basename(this._workspaceFolder),this._filePath=e?e.fsPath:void 0,o&&o.activeTextEditor&&(this._lineNumber=o.activeTextEditor.selection.anchor.line+1,this._selectedText=o.activeTextEditor.document.getText(new i.Range(o.activeTextEditor.selection.start,o.activeTextEditor.selection.end))),this._execPath=process.execPath,Object.keys(process.env).forEach((e=>{this[`env:${e}`]=this[`env.${e}`]=process.env[e]}))}get cwd(){return this.workspaceFolder}get workspaceRoot(){return this._workspaceFolder}get workspaceFolder(){return this._workspaceFolder}get workspaceRootFolderName(){return this._workspaceFolderName}get workspaceFolderBasename(){return this._workspaceFolderName}get file(){return this._filePath}get relativeFile(){return this.file?n.relative(this._workspaceFolder,this.file):void 0}get relativeFileDirname(){return this.relativeFile?n.dirname(this.relativeFile):void 0}get fileBasename(){return this.file?n.basename(this.file):void 0}get fileBasenameNoExtension(){return this.file?n.parse(this.file).name:void 0}get fileDirname(){return this.file?n.dirname(this.file):void 0}get fileExtname(){return this.file?n.extname(this.file):void 0}get lineNumber(){return this._lineNumber}get selectedText(){return this._selectedText}get execPath(){return this._execPath}}},19909:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IEnvironmentVariablesProvider=t.IEnvironmentVariablesService=void 0,t.IEnvironmentVariablesService=Symbol("IEnvironmentVariablesService"),t.IEnvironmentVariablesProvider=Symbol("IEnvironmentVariablesProvider")},63281:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HiddenFilePrefix=t.EXTENSION_ROOT_DIR=void 0;const n=r(71017),i=n.basename(__dirname);t.EXTENSION_ROOT_DIR="client"===i?n.join(__dirname,"..",".."):n.join(__dirname,"..","..","..",".."),t.HiddenFilePrefix="_HiddenFile_"},20910:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activateComponents=void 0;const n=r(76546),i=r(90819),o=r(17585),s=r(77570),a=r(34061),c=r(61684),u=r(18639),l=r(19735),h=r(76687),p=r(8593),d=r(73607),f=r(43200),v=r(51863),y=r(10145),m=r(29817),g=r(14164);t.activateComponents=async function(e,t){const r=await async function(e){const{context:t,legacyIOC:r}=e,{serviceManager:m,serviceContainer:b}=r,_=m.get(o.IApplicationEnvironment),{enableProposedApi:E}=_.packageJson;m.addSingletonInstance(s.UseProposedApi,E),(0,v.registerTypes)(m),(0,a.registerTypes)(m),(0,d.registerTypes)(m),(0,l.setLoggingLevel)((0,g.getLoggingLevel)()),(0,n.registerTypes)(m),b.get(u.IInterpreterService).initialize();const S=b.get(i.IExtensionActivationManager);t.subscriptions.push(S),b.get(c.IConfigurationService).getSettings();const w=S.activate();m.get(f.ICodeExecutionManager).registerCommands(),t.subscriptions.push(new h.ReplProvider(b));const T=new p.TerminalProvider(b);return t.subscriptions.push(T),(0,y.registerTypes)(m,t),{fullyReady:w}}(e),b=[m.activate(t.pythonEnvs,e)];return Promise.all([r,...b])}},63912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeComponents=t.initializeStandard=t.initializeGlobals=void 0;const n=r(86700),i=r(66828),o=r(77570),s=r(29992),a=r(52615),c=r(39702),u=r(61684),l=r(28285),h=r(61466),p=r(37104),d=r(77498),f=r(29817),v=r(19735),y=r(4247);t.initializeGlobals=function(e){const t=new n.Container({skipBaseClassChecks:!0}),r=new p.ServiceManager(t),s=new h.ServiceContainer(t),a=e.subscriptions;r.addSingletonInstance(d.IServiceContainer,s),r.addSingletonInstance(d.IServiceManager,r),r.addSingletonInstance(u.IDisposableRegistry,a),r.addSingletonInstance(u.IMemento,e.globalState,u.GLOBAL_MEMENTO),r.addSingletonInstance(u.IMemento,e.workspaceState,u.WORKSPACE_MEMENTO),r.addSingletonInstance(u.IExtensionContext,e);const c=i.window.createOutputChannel("Python Environments");return e.subscriptions.push((0,v.registerLogger)(new y.OutputChannelLogger(c))),r.addSingletonInstance(u.IOutputChannel,c,o.STANDARD_OUTPUT_CHANNEL),{context:e,disposables:a,legacyIOC:{serviceManager:r,serviceContainer:s}}},t.initializeStandard=function(e){const{serviceManager:t}=e.legacyIOC;(0,c.registerTypes)(t),(0,l.registerTypes)(t),(0,s.registerTypes)(t),(0,a.registerTypes)(t)},t.initializeComponents=async function(e){return{pythonEnvs:await f.initialize(e)}}},94144:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentActivationService=t.EnvironmentActivationServiceCache=t.defaultShells=void 0,r(32727);const o=r(86700),s=r(17585),a=r(77570),c=r(84974),u=r(4057),l=r(29983),h=r(58400),p=r(61684),d=r(59314),f=r(35144),v=r(87450),y=r(19909),m=r(81387),g=r(54813),b=r(61522),_=r(18639),E=r(49903),S=r(19735),w=r(75470),T="e8b39361-0157-4923-80e1-22d70d46dee6";t.defaultShells={[v.OSType.Windows]:{shell:"cmd",shellType:h.TerminalShellType.commandPrompt},[v.OSType.OSX]:{shell:"bash",shellType:h.TerminalShellType.bash},[v.OSType.Linux]:{shell:"bash",shellType:h.TerminalShellType.bash},[v.OSType.Unknown]:void 0};const P=["The process cannot access the file because it is being used by another process","The directory is not empty"];class I{constructor(){this.normalMap=new Map}static forceUseStatic(){I.useStatic=!0}static forceUseNormal(){I.useStatic=!1}get(e){return I.useStatic?I.staticMap.get(e):this.normalMap.get(e)}set(e,t){I.useStatic?I.staticMap.set(e,t):this.normalMap.set(e,t)}delete(e){I.useStatic?I.staticMap.delete(e):this.normalMap.delete(e)}clear(){I.useStatic||this.normalMap.clear()}}t.EnvironmentActivationServiceCache=I,I.useStatic=!1,I.staticMap=new Map;let O=class{constructor(e,t,r,n,i,o,s){this.helper=e,this.platform=t,this.processServiceFactory=r,this.currentProcess=n,this.workspace=i,this.interpreterService=o,this.envVarsService=s,this.disposables=[],this.activatedEnvVariablesCache=new I,this.envVarsService.onDidEnvironmentVariablesChange((()=>this.activatedEnvVariablesCache.clear()),this,this.disposables),this.interpreterService.onDidChangeInterpreter((()=>this.activatedEnvVariablesCache.clear()),this,this.disposables)}dispose(){this.disposables.forEach((e=>e.dispose()))}async getActivatedEnvironmentVariables(e,t,r){var n;const i=`${this.workspace.getWorkspaceFolderIdentifier(e)}_${this.platform.isWindows?null==t?void 0:t.path.toLowerCase():null==t?void 0:t.path}`;if(null===(n=this.activatedEnvVariablesCache.get(i))||void 0===n?void 0:n.hasData)return this.activatedEnvVariablesCache.get(i).data;const o=new f.InMemoryCache(6e5);return this.getActivatedEnvironmentVariablesImpl(e,t,r).then((e=>(o.data=e,this.activatedEnvVariablesCache.set(i,o),e)))}async getEnvironmentActivationShellCommands(e,r){const n=t.defaultShells[this.platform.osType];return n?this.helper.getEnvironmentActivationShellCommands(e,n.shellType,r):[]}async getActivatedEnvironmentVariablesImpl(e,r,n){var i;const o=t.defaultShells[this.platform.osType];if(o)try{let t,[n,s]=u.printEnvVariables();if(n.forEach(((e,t)=>{n[t]=e.toCommandArgumentForPythonExt()})),(null==(r=null!=r?r:await this.interpreterService.getActiveInterpreter(e))?void 0:r.envType)===m.EnvironmentType.Conda){const e=await w.Conda.getConda(),o=await(null==e?void 0:e.getRunPythonArgs({name:r.envName,prefix:null!==(i=r.envPath)&&void 0!==i?i:""}));o&&(t=[...o,...n].map((e=>e.toCommandArgumentForPythonExt())).join(" "))}if(!t){const i=await this.helper.getEnvironmentActivationShellCommands(e,o.shellType,r);if((0,S.traceVerbose)(`Activation Commands received ${i} for shell ${o.shell}`),!i||!Array.isArray(i)||0===i.length)return;t=`${this.fixActivationCommands(i).join(" && ")} && echo '${T}' && python ${n.join(" ")}`}const c=await this.processServiceFactory.create(e),l=await this.envVarsService.getEnvironmentVariables(e),h=Object.keys(l).length,p=h?l:{...this.currentProcess.env},f=p[a.PYTHON_WARNINGS];let v;p[a.PYTHON_WARNINGS]="ignore",(0,S.traceVerbose)((h?"Has":"No")+" Custom Env Vars"),(0,S.traceVerbose)(`Activating Environment to capture Environment variables, ${t}`);let y,g=1;for(;!v;)try{v=await c.shellExec(t,{env:p,shell:o.shell,timeout:(null==r?void 0:r.envType)===m.EnvironmentType.Conda?6e4:3e4,maxBuffer:1e6,throwOnStdErr:!1});try{y=this.parseEnvironmentOutput(v.stdout,s)}catch(e){if(!v.stderr)throw e}if(v.stderr){if(!y)throw new Error(`StdErr from ShellExec, ${v.stderr} for ${t}`);(0,S.traceWarn)("Got env variables but with errors",v.stderr)}}catch(e){const t=e.toString();if(!(P.find((e=>t.includes(e)))&&g<10))throw e;(0,S.traceInfo)("Conda is busy, attempting to retry ..."),v=void 0,g+=1,await(0,d.sleep)(500)}return f&&y?y[a.PYTHON_WARNINGS]=f:y&&delete y[a.PYTHON_WARNINGS],y}catch(e){if((0,S.traceError)("getActivatedEnvironmentVariables",e),(0,g.sendTelemetryEvent)(b.EventName.ACTIVATE_ENV_TO_GET_ENV_VARS_FAILED,void 0,{isPossiblyCondaEnv:(null==r?void 0:r.envType)===m.EnvironmentType.Conda,terminal:o.shellType}),n)throw e}}fixActivationCommands(e){return e.map((e=>e.replace(/^source\s+/,". ")))}parseEnvironmentOutput(e,t){return-1===e.indexOf(T)?t(e):t((e=e.substring(e.indexOf(T)+T.length)).substring(e.indexOf("{")).trim())}};n([(0,S.traceDecoratorVerbose)("getActivatedEnvironmentVariables",E.TraceOptions.Arguments),(0,g.captureTelemetry)(b.EventName.PYTHON_INTERPRETER_ACTIVATION_ENVIRONMENT_VARIABLES,{failed:!1},!0)],O.prototype,"getActivatedEnvironmentVariables",null),n([(0,S.traceDecoratorError)("Failed to parse Environment variables"),(0,S.traceDecoratorVerbose)("parseEnvironmentOutput",E.TraceOptions.None)],O.prototype,"parseEnvironmentOutput",null),O=n([(0,o.injectable)(),i(0,(0,o.inject)(h.ITerminalHelper)),i(1,(0,o.inject)(c.IPlatformService)),i(2,(0,o.inject)(l.IProcessServiceFactory)),i(3,(0,o.inject)(p.ICurrentProcess)),i(4,(0,o.inject)(s.IWorkspaceService)),i(5,(0,o.inject)(_.IInterpreterService)),i(6,(0,o.inject)(y.IEnvironmentVariablesProvider))],O),t.EnvironmentActivationService=O},80351:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IEnvironmentActivationService=void 0,t.IEnvironmentActivationService=Symbol("IEnvironmentActivationService")},20741:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterAutoSelectionService=void 0;const o=r(86700),s=r(66828),a=r(17585);r(32727);const c=r(84974),u=r(61684),l=r(59314),h=r(95084),p=r(54813),d=r(61522),f=r(54351),v=r(18639),y=r(87282),m="preferredGlobalPyInterpreter";let g=class{constructor(e,t,r,n,i,o,a){this.workspaceService=e,this.stateFactory=t,this.fs=r,this.interpreterService=n,this.envTypeComparer=i,this.interpreterHelper=a,this.autoSelectedWorkspacePromises=new Map,this.didAutoSelectedInterpreterEmitter=new s.EventEmitter,this.autoSelectedInterpreterByWorkspace=new Map,this.globallyPreferredInterpreter=this.stateFactory.createGlobalPersistentState(m,void 0),o.registerInstance(this)}async autoSelectInterpreter(e){const t=this.getWorkspacePathKey(e),r=this.autoSelectedWorkspacePromises.has(t);if(!r){const r=(0,l.createDeferred)();this.autoSelectedWorkspacePromises.set(t,r),await this.initializeStore(e),await this.clearWorkspaceStoreIfInvalid(e),await this.autoselectInterpreterWithLocators(e),r.resolve()}return(0,p.sendTelemetryEvent)(d.EventName.PYTHON_INTERPRETER_AUTO_SELECTION,void 0,{useCachedInterpreter:r}),this.autoSelectedWorkspacePromises.get(t).promise}get onDidChangeAutoSelectedInterpreter(){return this.didAutoSelectedInterpreterEmitter.event}getAutoSelectedInterpreter(e){const t=this.getWorkspaceState(e);if(t&&t.value)return t.value;const r=this.getWorkspacePathKey(e);return this.autoSelectedInterpreterByWorkspace.has(r)?this.autoSelectedInterpreterByWorkspace.get(r):this.globallyPreferredInterpreter.value}async setWorkspaceInterpreter(e,t){await this.storeAutoSelectedInterpreter(e,t)}async setGlobalInterpreter(e){await this.storeAutoSelectedInterpreter(void 0,e)}async clearWorkspaceStoreIfInvalid(e){const t=this.getWorkspaceState(e);t&&t.value&&!await this.fs.fileExists(t.value.path)&&await t.updateValue(void 0)}async storeAutoSelectedInterpreter(e,t){const r=this.getWorkspacePathKey(e);if(""===r){if(this.globallyPreferredInterpreter.value&&this.globallyPreferredInterpreter.value.version&&t&&t.version&&(0,h.compareSemVerLikeVersions)(this.globallyPreferredInterpreter.value.version,t.version)>0)return;await this.globallyPreferredInterpreter.updateValue(t),this.autoSelectedInterpreterByWorkspace.set(r,t)}else{const n=this.getWorkspaceState(e);n&&t&&await n.updateValue(t),this.autoSelectedInterpreterByWorkspace.set(r,t)}}async initializeStore(e){const t=this.getWorkspacePathKey(e);this.autoSelectedInterpreterByWorkspace.delete(t),this.globallyPreferredInterpreter||await this.clearStoreIfFileIsInvalid()}async clearStoreIfFileIsInvalid(){this.globallyPreferredInterpreter=this.stateFactory.createGlobalPersistentState(m,void 0),this.globallyPreferredInterpreter.value&&!await this.fs.fileExists(this.globallyPreferredInterpreter.value.path)&&await this.globallyPreferredInterpreter.updateValue(void 0)}getWorkspacePathKey(e){return this.workspaceService.getWorkspaceFolderIdentifier(e,"")}getWorkspaceState(e){const t=this.interpreterHelper.getActiveWorkspaceUri(e);if(t){const e=`autoSelectedWorkspacePythonInterpreter-${t.folderUri.fsPath}`;return this.stateFactory.createWorkspacePersistentState(e,void 0)}}getAutoSelectionInterpretersQueryState(e){const t=this.interpreterHelper.getActiveWorkspaceUri(e),r=`autoSelectionInterpretersQueried-${(null==t?void 0:t.folderUri.fsPath)||"global"}`;return this.stateFactory.createWorkspacePersistentState(r,void 0)}async autoselectInterpreterWithLocators(e){const t=this.getAutoSelectionInterpretersQueryState(e);!0!==t.value&&e&&await this.interpreterService.triggerRefresh({searchLocations:{roots:[e],doNotIncludeNonRooted:!0}});const r=await this.interpreterService.getAllInterpreters(e),n=this.interpreterHelper.getActiveWorkspaceUri(e),i=this.envTypeComparer.getRecommended(r,null==n?void 0:n.folderUri);i&&(n?this.setWorkspaceInterpreter(n.folderUri,i):this.setGlobalInterpreter(i),t.updateValue(!0),this.didAutoSelectedInterpreterEmitter.fire())}};g=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IWorkspaceService)),i(1,(0,o.inject)(u.IPersistentStateFactory)),i(2,(0,o.inject)(c.IFileSystem)),i(3,(0,o.inject)(v.IInterpreterService)),i(4,(0,o.inject)(f.IInterpreterComparer)),i(5,(0,o.inject)(y.IInterpreterAutoSelectionProxyService)),i(6,(0,o.inject)(v.IInterpreterHelper))],g),t.InterpreterAutoSelectionService=g},45297:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterAutoSelectionProxyService=void 0;const o=r(86700),s=r(66828),a=r(61684);let c=class{constructor(e){this.disposables=e,this.didAutoSelectedInterpreterEmitter=new s.EventEmitter}registerInstance(e){this.instance=e,this.disposables.push(this.instance.onDidChangeAutoSelectedInterpreter((()=>this.didAutoSelectedInterpreterEmitter.fire())))}get onDidChangeAutoSelectedInterpreter(){return this.didAutoSelectedInterpreterEmitter.event}getAutoSelectedInterpreter(e){return this.instance?this.instance.getAutoSelectedInterpreter(e):void 0}async setWorkspaceInterpreter(e,t){return this.instance?this.instance.setWorkspaceInterpreter(e,t):void 0}};c=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IDisposableRegistry))],c),t.InterpreterAutoSelectionProxyService=c},87282:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AutoSelectionRule=t.IInterpreterAutoSelectionService=t.IInterpreterAutoSelectionProxyService=void 0,t.IInterpreterAutoSelectionProxyService=Symbol("IInterpreterAutoSelectionProxyService"),t.IInterpreterAutoSelectionService=Symbol("IInterpreterAutoSelectionService"),(r=t.AutoSelectionRule||(t.AutoSelectionRule={})).all="all",r.currentPath="currentPath",r.workspaceVirtualEnvs="workspaceEnvs",r.settings="settings",r.cachedInterpreters="cachedInterpreters",r.systemWide="system",r.windowsRegistry="windowsRegistry"},95356:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvLocationHeuristic=t.EnvironmentTypeComparer=t.EnvLocationHeuristic=void 0;const o=r(86700),s=r(3522),a=r(37769),c=r(81387),u=r(18639);var l;!function(e){e[e.Local=1]="Local",e[e.Global=2]="Global"}(l=t.EnvLocationHeuristic||(t.EnvLocationHeuristic={}));let h=class{constructor(e){var t,r;this.interpreterHelper=e,this.workspaceFolderPath=null!==(r=null===(t=this.interpreterHelper.getActiveWorkspaceUri(void 0))||void 0===t?void 0:t.folderUri.fsPath)&&void 0!==r?r:""}compare(e,t){const r=function(e,t,r){const n=f(e,r),i=f(t,r);return Math.sign(n-i)}(e,t,this.workspaceFolderPath);if(0!==r)return r;const n=function(e,t){const r=[c.EnvironmentType.Poetry,c.EnvironmentType.Pipenv,c.EnvironmentType.VirtualEnvWrapper,c.EnvironmentType.Venv,c.EnvironmentType.VirtualEnv,c.EnvironmentType.Conda,c.EnvironmentType.Pyenv,c.EnvironmentType.WindowsStore,c.EnvironmentType.Global,c.EnvironmentType.System,c.EnvironmentType.Unknown];return Math.sign(r.indexOf(e.envType)-r.indexOf(t.envType))}(e,t);if(0!==n)return n;const i=function(e,t){return e?t?e.raw===t.raw?0:e.major===t.major?e.minor===t.minor?e.patch===t.patch?e.build.join(" ")>t.build.join(" ")?-1:1:e.patch>t.patch?-1:1:e.minor>t.minor?-1:1:e.major>t.major?-1:1:-1:1}(e.version,t.version);if(0!==i)return i;if(d(e))return 1;if(d(t))return-1;const o=p(e,this.interpreterHelper),s=p(t,this.interpreterHelper);return o===s?0:o>s?1:-1}getRecommended(e,t){const r=this.interpreterHelper.getActiveWorkspaceUri(t),n=e.filter((e=>f(e,(null==r?void 0:r.folderUri.fsPath)||"")===l.Local||!c.virtualEnvTypes.includes(e.envType)));return n.sort(this.compare.bind(this)),n.length?n[0]:void 0}};function p(e,t){const r=[],n=[];if(e.version&&r.push(e.version.raw),e.architecture&&r.push((0,s.getArchitectureDisplayName)(e.architecture)),e.companyDisplayName&&e.companyDisplayName.length>0?r.push(e.companyDisplayName.trim()):r.push("Python"),e.envType){const r=t.getInterpreterTypeDisplayName(e.envType);r&&n.push(r)}e.envName&&e.envName.length>0&&n.push(e.envName);const i=0===n.length?"":`(${n.join(": ")})`;return`${r.join(" ")} ${i}`.trim()}function d(e){return e.envType===c.EnvironmentType.Conda&&("base"===e.envName||"miniconda"===e.envName)}function f(e,t){return t.length>0&&(e.envPath&&(0,a.isParentPath)(e.envPath,t)||e.path&&(0,a.isParentPath)(e.path,t))?l.Local:l.Global}h=n([(0,o.injectable)(),i(0,(0,o.inject)(u.IInterpreterHelper))],h),t.EnvironmentTypeComparer=h,t.getEnvLocationHeuristic=f},68618:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PythonPathUpdaterService=void 0;const o=r(86700),s=r(71017),a=r(66828),c=r(70057),u=r(48683),l=r(19735),h=r(54813),p=r(61522),d=r(18639),f=r(54351);let v=class{constructor(e,t){this.pythonPathSettingsUpdaterFactory=e,this.pyenvs=t}async updatePythonPath(e,t,r,n){const i=new c.StopWatch,o=this.getPythonUpdaterService(t,n);let u=!1;try{await o.updatePythonPath(e?s.normalize(e):void 0)}catch(e){u=!0;const t=e,r=t&&"string"==typeof t.message?t.message:"";a.window.showErrorMessage(`Failed to set interpreter path. Error: ${r}`),(0,l.traceError)(t)}this.sendTelemetry(i.elapsedTime,u,r,e,n).catch((e=>(0,l.traceError)("Python Extension: sendTelemetry",e)))}async sendTelemetry(e,t,r,n,i){var o;const s={failed:t,trigger:r};if(!t&&n){const e=new u.SystemVariables(void 0,null==i?void 0:i.fsPath),t=await this.pyenvs.getInterpreterInformation(e.resolveAny(n));t&&(s.pythonVersion=null===(o=t.version)||void 0===o?void 0:o.raw)}(0,h.sendTelemetryEvent)(p.EventName.PYTHON_INTERPRETER,e,s)}getPythonUpdaterService(e,t){switch(e){case a.ConfigurationTarget.Global:return this.pythonPathSettingsUpdaterFactory.getGlobalPythonPathConfigurationService();case a.ConfigurationTarget.Workspace:if(!t)throw new Error("Workspace Uri not defined");return this.pythonPathSettingsUpdaterFactory.getWorkspacePythonPathConfigurationService(t);default:if(!t)throw new Error("Workspace Uri not defined");return this.pythonPathSettingsUpdaterFactory.getWorkspaceFolderPythonPathConfigurationService(t)}}};v=n([(0,o.injectable)(),i(0,(0,o.inject)(f.IPythonPathUpdaterServiceFactory)),i(1,(0,o.inject)(d.IComponentAdapter))],v),t.PythonPathUpdaterService=v},79721:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PythonPathUpdaterServiceFactory=void 0;const o=r(86700),s=r(61684),a=r(77498),c=r(56798),u=r(95791),l=r(35543);let h=class{constructor(e){this.interpreterPathService=e.get(s.IInterpreterPathService)}getGlobalPythonPathConfigurationService(){return new c.GlobalPythonPathUpdaterService(this.interpreterPathService)}getWorkspacePythonPathConfigurationService(e){return new l.WorkspacePythonPathUpdaterService(e,this.interpreterPathService)}getWorkspaceFolderPythonPathConfigurationService(e){return new u.WorkspaceFolderPythonPathUpdaterService(e,this.interpreterPathService)}};h=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],h),t.PythonPathUpdaterServiceFactory=h},56798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalPythonPathUpdaterService=void 0;const n=r(66828);t.GlobalPythonPathUpdaterService=class{constructor(e){this.interpreterPathService=e}async updatePythonPath(e){const t=this.interpreterPathService.inspect(void 0);t&&t.globalValue===e||await this.interpreterPathService.update(void 0,n.ConfigurationTarget.Global,e)}}},95791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceFolderPythonPathUpdaterService=void 0;const n=r(71017),i=r(66828);t.WorkspaceFolderPythonPathUpdaterService=class{constructor(e,t){this.workspaceFolder=e,this.interpreterPathService=t}async updatePythonPath(e){const t=this.interpreterPathService.inspect(this.workspaceFolder);t&&t.workspaceFolderValue===e||(e&&e.startsWith(this.workspaceFolder.fsPath)&&(e=n.relative(this.workspaceFolder.fsPath,e)),await this.interpreterPathService.update(this.workspaceFolder,i.ConfigurationTarget.WorkspaceFolder,e))}}},35543:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspacePythonPathUpdaterService=void 0;const n=r(71017),i=r(66828);t.WorkspacePythonPathUpdaterService=class{constructor(e,t){this.workspace=e,this.interpreterPathService=t}async updatePythonPath(e){const t=this.interpreterPathService.inspect(this.workspace);t&&t.workspaceValue===e||(e&&e.startsWith(this.workspace.fsPath)&&(e=n.relative(this.workspace.fsPath,e)),await this.interpreterPathService.update(this.workspace,i.ConfigurationTarget.Workspace,e))}}},54351:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IInterpreterComparer=t.IInterpreterSelector=t.IPythonPathUpdaterServiceManager=t.IPythonPathUpdaterServiceFactory=void 0,t.IPythonPathUpdaterServiceFactory=Symbol("IPythonPathUpdaterServiceFactory"),t.IPythonPathUpdaterServiceManager=Symbol("IPythonPathUpdaterServiceManager"),t.IInterpreterSelector=Symbol("IInterpreterSelector"),t.IInterpreterComparer=Symbol("IInterpreterComparer")},18639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IInterpreterStatusbarVisibilityFilter=t.IInterpreterHelper=t.IShebangCodeLensProvider=t.IInterpreterService=t.ICondaService=t.IComponentAdapter=void 0,t.IComponentAdapter=Symbol("IComponentAdapter"),t.ICondaService=Symbol("ICondaService"),t.IInterpreterService=Symbol("IInterpreterService"),t.IShebangCodeLensProvider=Symbol("IShebangCodeLensProvider"),t.IInterpreterHelper=Symbol("IInterpreterHelper"),t.IInterpreterStatusbarVisibilityFilter=Symbol("IInterpreterStatusbarVisibilityFilter")},43490:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterHelper=t.isInterpreterLocatedInWorkspace=void 0;const o=r(86700),s=r(66828),a=r(17585),c=r(48431),u=r(77498),l=r(95084),h=r(81387),p=r(18639);function d(e){if(0===e.length)return[];if(1===e.length)return[e[0]];const t=e.slice();return t.sort(((e,t)=>e.version&&t.version?(0,l.compareSemVerLikeVersions)(e.version,t.version):0)),t}t.isInterpreterLocatedInWorkspace=function(e,t){const r=c.FileSystemPaths.withDefaults(),n=r.normCase(e.path),i=r.normCase(t.fsPath);return n.startsWith(i)};let f=class{constructor(e,t){this.serviceContainer=e,this.pyenvs=t}getActiveWorkspaceUri(e){var t;const r=this.serviceContainer.get(a.IWorkspaceService);if(!(((null===(t=r.workspaceFolders)||void 0===t?void 0:t.length)||0)>0))return;if(Array.isArray(r.workspaceFolders)&&1===r.workspaceFolders.length)return{folderUri:r.workspaceFolders[0].uri,configTarget:s.ConfigurationTarget.Workspace};if(e){const t=r.getWorkspaceFolder(e);if(t)return{configTarget:s.ConfigurationTarget.WorkspaceFolder,folderUri:t.uri}}const n=this.serviceContainer.get(a.IDocumentManager);if(n.activeTextEditor){const e=r.getWorkspaceFolder(n.activeTextEditor.document.uri);if(e)return{configTarget:s.ConfigurationTarget.WorkspaceFolder,folderUri:e.uri}}}async getInterpreterInformation(e){return this.pyenvs.getInterpreterInformation(e)}async getInterpreters({resource:e,source:t}={}){return d(await this.pyenvs.getInterpreters(e,t))}async getInterpreterPath(e){const t=await this.getInterpreterInformation(e);return t?t.path:e}async isMacDefaultPythonPath(e){return this.pyenvs.isMacDefaultPythonPath(e)}getInterpreterTypeDisplayName(e){return(0,h.getEnvironmentTypeName)(e)}getBestInterpreter(e){if(!Array.isArray(e)||0===e.length)return;const t=d(e);return t[t.length-1]}};f=n([(0,o.injectable)(),i(0,(0,o.inject)(u.IServiceContainer)),i(1,(0,o.inject)(p.IComponentAdapter))],f),t.InterpreterHelper=f},62643:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterService=void 0;const o=r(86700),s=r(71017),a=r(66828);r(32727);const c=r(61684),u=r(77498),l=r(18639),h=r(19735),p=r(65854),d=r(29983);let f=class{constructor(e,t){this.serviceContainer=e,this.pyenvs=t,this._pythonPathSetting="",this.didChangeInterpreterConfigurationEmitter=new a.EventEmitter,this.didChangeInterpreterEmitter=new a.EventEmitter,this.didChangeInterpreterInformation=new a.EventEmitter,this.configService=this.serviceContainer.get(c.IConfigurationService),this.interpreterPathService=this.serviceContainer.get(c.IInterpreterPathService),this.onDidChangeInterpreters=t.onChanged}async hasInterpreters(e=(async()=>!0)){return this.pyenvs.hasInterpreters(e)}get onRefreshStart(){return this.pyenvs.onRefreshStart}triggerRefresh(e){return this.pyenvs.triggerRefresh(e)}get refreshPromise(){return this.pyenvs.refreshPromise}get onDidChangeInterpreter(){return this.didChangeInterpreterEmitter.event}get onDidChangeInterpreterInformation(){return this.didChangeInterpreterInformation.event}get onDidChangeInterpreterConfiguration(){return this.didChangeInterpreterConfigurationEmitter.event}async refresh(e){}initialize(){const e=this.serviceContainer.get(c.IDisposableRegistry);e.push(this.onDidChangeInterpreters((e=>{var t;const r=null!==(t=e.old)&&void 0!==t?t:e.new;r&&this.didChangeInterpreterInformation.fire(r)}))),e.push(this.interpreterPathService.onDidChange((e=>this._onConfigChanged(e.uri))))}getInterpreters(e){return this.pyenvs.getInterpreters(e)}async getAllInterpreters(e){return await this.refreshPromise,this.getInterpreters(e)}dispose(){this.didChangeInterpreterEmitter.dispose(),this.didChangeInterpreterInformation.dispose()}async getActiveInterpreter(e){let t=this.configService.getSettings(e).pythonPath;if(s.basename(t)===t){const r=this.serviceContainer.tryGet(d.IPythonExecutionFactory),n=r?await r.create({resource:e}):void 0,i=n?await n.getExecutablePath().catch((e=>{(0,h.traceError)(e)})):void 0;if(!i)return;t=i}return this.getInterpreterDetails(t)}async getInterpreterDetails(e){return this.pyenvs.getInterpreterDetails(e)}async _onConfigChanged(e){this.didChangeInterpreterConfigurationEmitter.fire(e);const t=this.configService.getSettings(e);""!==this._pythonPathSetting&&this._pythonPathSetting===t.pythonPath||(this._pythonPathSetting=t.pythonPath,this.didChangeInterpreterEmitter.fire(),(0,p.reportActiveInterpreterChanged)({path:t.pythonPath,resource:e}))}};f=n([(0,o.injectable)(),i(0,(0,o.inject)(u.IServiceContainer)),i(1,(0,o.inject)(l.IComponentAdapter))],f),t.InterpreterService=f},51863:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=t.registerInterpreterTypes=void 0;const n=r(90819),i=r(94144),o=r(80351),s=r(20741),a=r(45297),c=r(87282),u=r(95356),l=r(68618),h=r(79721),p=r(54351),d=r(18639),f=r(43490),v=r(62643),y=r(45107),m=r(66950);function g(e){e.addSingleton(n.IExtensionActivationService,m.VirtualEnvironmentPrompt),e.addSingleton(d.IInterpreterService,v.InterpreterService),e.addSingleton(p.IPythonPathUpdaterServiceFactory,h.PythonPathUpdaterServiceFactory),e.addSingleton(p.IPythonPathUpdaterServiceManager,l.PythonPathUpdaterService),e.addSingleton(d.IInterpreterHelper,f.InterpreterHelper),e.addSingleton(p.IInterpreterComparer,u.EnvironmentTypeComparer),e.addSingleton(c.IInterpreterAutoSelectionService,s.InterpreterAutoSelectionService),e.addSingleton(n.IExtensionActivationService,y.CondaInheritEnvPrompt)}t.registerInterpreterTypes=g,t.registerTypes=function(e){g(e),e.addSingleton(c.IInterpreterAutoSelectionProxyService,a.InterpreterAutoSelectionProxyService),e.addSingleton(i.EnvironmentActivationService,i.EnvironmentActivationService),e.addSingleton(o.IEnvironmentActivationService,i.EnvironmentActivationService)}},45107:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CondaInheritEnvPrompt=t.condaInheritEnvPromptKey=void 0;const o=r(86700),s=r(66828),a=r(17585),c=r(84974),u=r(61684),l=r(67098),h=r(19735),p=r(81387),d=r(54813),f=r(61522),v=r(18639);t.condaInheritEnvPromptKey="CONDA_INHERIT_ENV_PROMPT_KEY";let y=class{constructor(e,t,r,n,i,o,s=!1){this.interpreterService=e,this.workspaceService=t,this.browserService=r,this.appShell=n,this.persistentStateFactory=i,this.platformService=o,this.hasPromptBeenShownInCurrentSession=s,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0}}async activate(e){this.initializeInBackground(e).ignoreErrors()}async initializeInBackground(e){await this.shouldShowPrompt(e)&&await this.promptAndUpdate()}async promptAndUpdate(){const e=this.persistentStateFactory.createGlobalPersistentState(t.condaInheritEnvPromptKey,!0);if(!e.value)return;const r=[l.Common.bannerLabelYes(),l.Common.bannerLabelNo(),l.Common.moreInfo()],n=await this.appShell.showInformationMessage(l.Interpreters.condaInheritEnvMessage(),...r);(0,d.sendTelemetryEvent)(f.EventName.CONDA_INHERIT_ENV_PROMPT,void 0,{selection:n?["Yes","No","More Info"][r.indexOf(n)]:void 0}),n&&(n===r[0]?await this.workspaceService.getConfiguration("terminal").update("integrated.inheritEnv",!1,s.ConfigurationTarget.Global):n===r[1]?await e.updateValue(!1):n===r[2]&&this.browserService.launch("https://aka.ms/AA66i8f"))}async shouldShowPrompt(e){if(this.hasPromptBeenShownInCurrentSession)return!1;if(this.platformService.isWindows)return!1;const t=await this.interpreterService.getActiveInterpreter(e);if(!t||t.envType!==p.EnvironmentType.Conda)return!1;const r=this.workspaceService.getConfiguration("terminal",e).inspect("integrated.inheritEnv");return r?void 0===r.globalValue&&void 0===r.workspaceValue&&void 0===r.workspaceFolderValue&&(this.hasPromptBeenShownInCurrentSession=!0,!0):((0,h.traceError)("WorkspaceConfiguration.inspect returns `undefined` for setting `terminal.integrated.inheritEnv`"),!1)}};n([(0,h.traceDecoratorError)("Failed to intialize conda inherit env prompt")],y.prototype,"initializeInBackground",null),n([(0,h.traceDecoratorError)("Failed to display conda inherit env prompt")],y.prototype,"promptAndUpdate",null),n([(0,h.traceDecoratorError)("Failed to check whether to display prompt for conda inherit env setting")],y.prototype,"shouldShowPrompt",null),y=n([(0,o.injectable)(),i(0,(0,o.inject)(v.IInterpreterService)),i(1,(0,o.inject)(a.IWorkspaceService)),i(2,(0,o.inject)(u.IBrowserService)),i(3,(0,o.inject)(a.IApplicationShell)),i(4,(0,o.inject)(u.IPersistentStateFactory)),i(5,(0,o.inject)(c.IPlatformService)),i(6,(0,o.optional)())],y),t.CondaInheritEnvPrompt=y},66950:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualEnvironmentPrompt=void 0;const o=r(86700),s=r(66828),a=r(17585),c=r(61684),u=r(59314),l=r(67098),h=r(19735),p=r(54813),d=r(61522),f=r(54351),v=r(18639);let y=class{constructor(e,t,r,n,i,o){this.persistentStateFactory=e,this.helper=t,this.pythonPathUpdaterService=r,this.disposableRegistry=n,this.appShell=i,this.pyenvs=o,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0}}async activate(e){const t=this.pyenvs.onDidCreate(e,(()=>this.handleNewEnvironment(e)));this.disposableRegistry.push(t)}async handleNewEnvironment(e){await(0,u.sleep)(1e3);const t=await this.pyenvs.getWorkspaceVirtualEnvInterpreters(e),r=Array.isArray(t)&&t.length>0?this.helper.getBestInterpreter(t):void 0;r&&await this.notifyUser(r,e)}async notifyUser(e,t){const r=this.persistentStateFactory.createWorkspacePersistentState("MESSAGE_KEY_FOR_VIRTUAL_ENV",!0);if(!r.value)return;const n=[l.Common.bannerLabelYes(),l.Common.bannerLabelNo(),l.Common.doNotShowAgain()],i=await this.appShell.showInformationMessage(l.Interpreters.environmentPromptMessage(),...n);(0,p.sendTelemetryEvent)(d.EventName.PYTHON_INTERPRETER_ACTIVATE_ENVIRONMENT_PROMPT,void 0,{selection:i?["Yes","No","Ignore"][n.indexOf(i)]:void 0}),i&&(i===n[0]?await this.pythonPathUpdaterService.updatePythonPath(e.path,s.ConfigurationTarget.WorkspaceFolder,"ui",t):i===n[2]&&await r.updateValue(!1))}};n([(0,h.traceDecoratorError)("Error in event handler for detection of new environment")],y.prototype,"handleNewEnvironment",null),y=n([(0,o.injectable)(),i(0,(0,o.inject)(c.IPersistentStateFactory)),i(1,(0,o.inject)(v.IInterpreterHelper)),i(2,(0,o.inject)(f.IPythonPathUpdaterServiceManager)),i(3,(0,o.inject)(c.IDisposableRegistry)),i(4,(0,o.inject)(a.IApplicationShell)),i(5,(0,o.inject)(v.IComponentAdapter))],y),t.VirtualEnvironmentPrompt=y},61466:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceContainer=void 0;const i=r(82361),o=r(86700),s=r(19735);try{(0,o.decorate)((0,o.injectable)(),i.EventEmitter)}catch(e){(0,s.traceWarn)("Failed to decorate EventEmitter for DI (possibly already decorated by another Extension)",e)}let a=class{constructor(e){this.container=e}get(e,t){return t?this.container.getNamed(e,t):this.container.get(e)}getAll(e,t){return t?this.container.getAllNamed(e,t):this.container.getAll(e)}tryGet(e,t){try{return t?this.container.getNamed(e,t):this.container.get(e)}catch(e){}}};a=n([(0,o.injectable)()],a),t.ServiceContainer=a},37104:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceManager=void 0;const i=r(86700);let o=class{constructor(e){this.container=e}add(e,t,r,n){r?this.container.bind(e).to(t).whenTargetNamed(r):this.container.bind(e).to(t),n&&n.forEach((t=>{this.addBinding(e,t)}))}addFactory(e,t){this.container.bind(e).toFactory(t)}addBinding(e,t){this.container.bind(t).toService(e)}addSingleton(e,t,r,n){r?this.container.bind(e).to(t).inSingletonScope().whenTargetNamed(r):this.container.bind(e).to(t).inSingletonScope(),n&&n.forEach((t=>{this.addBinding(e,t)}))}addSingletonInstance(e,t,r){r?this.container.bind(e).toConstantValue(t).whenTargetNamed(r):this.container.bind(e).toConstantValue(t)}get(e,t){return t?this.container.getNamed(e,t):this.container.get(e)}tryGet(e,t){try{return t?this.container.getNamed(e,t):this.container.get(e)}catch(e){}}getAll(e,t){return t?this.container.getAllNamed(e,t):this.container.getAll(e)}rebind(e,t,r){r?this.container.rebind(e).to(t).whenTargetNamed(r):this.container.rebind(e).to(t)}rebindSingleton(e,t,r){r?this.container.rebind(e).to(t).inSingletonScope().whenTargetNamed(r):this.container.rebind(e).to(t).inSingletonScope()}rebindInstance(e,t,r){r?this.container.rebind(e).toConstantValue(t).whenTargetNamed(r):this.container.rebind(e).toConstantValue(t)}dispose(){this.container.unbindAll(),this.container.unload()}};o=n([(0,i.injectable)()],o),t.ServiceManager=o},77498:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IServiceContainer=t.IServiceManager=void 0,t.IServiceManager=Symbol("IServiceManager"),t.IServiceContainer=Symbol("IServiceContainer")},42310:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileLogger=void 0;const n=r(73837),i=r(41719);function o(e,...t){return e?`[${e.toUpperCase()} ${(0,i.getTimeForLogging)()}]: ${n.format(...t)}\r\n`:`${n.format(...t)}\r\n`}t.FileLogger=class{constructor(e){this.stream=e}traceLog(...e){this.stream.write(o(void 0,...e))}traceError(...e){this.stream.write(o("error",...e))}traceWarn(...e){this.stream.write(o("warn",...e))}traceInfo(...e){this.stream.write(o("info",...e))}traceVerbose(...e){this.stream.write(o("debug",...e))}dispose(){try{this.stream.close()}catch(e){}}}},19735:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logTo=t.traceDecoratorWarn=t.traceDecoratorInfo=t.traceDecoratorError=t.traceDecoratorVerbose=t.traceVerbose=t.traceInfo=t.traceWarn=t.traceError=t.traceLog=t.initializeFileLogging=t.setLoggingLevel=t.registerLogger=void 0;const n=r(55674),i=r(25472),o=r(70057),s=r(54813),a=r(42310),c=r(49903),u=r(41719),l=c.TraceOptions.Arguments|c.TraceOptions.ReturnValue;let h=[];function p(e){return h.push(e),{dispose:()=>{h=h.filter((t=>t!==e))}}}t.registerLogger=p;const d=new Map([["error",c.LogLevel.Error],["warn",c.LogLevel.Warn],["info",c.LogLevel.Info],["debug",c.LogLevel.Debug],["none",c.LogLevel.Off],["off",c.LogLevel.Off],[void 0,c.LogLevel.Error]]);let f;function v(...e){f>=c.LogLevel.Error&&h.forEach((t=>t.traceError(...e)))}function y(...e){f>=c.LogLevel.Warn&&h.forEach((t=>t.traceWarn(...e)))}function m(...e){f>=c.LogLevel.Info&&h.forEach((t=>t.traceInfo(...e)))}function g(...e){f>=c.LogLevel.Debug&&h.forEach((t=>t.traceVerbose(...e)))}function b(e){return function(t,r,n){const s=n.value;return n.value=function(...r){const n={kind:"Class",name:t&&t.constructor?t.constructor.name:"",args:r},a=this;return function(e,t){const n=new o.StopWatch;try{const t=s.apply(a,r);return(0,i.isPromise)(t)?t.then((t=>(e({elapsed:n.elapsedTime,returnValue:t}),t))).catch((t=>{e({elapsed:n.elapsedTime,err:t})})):e({elapsed:n.elapsedTime,returnValue:t}),t}catch(t){throw e({elapsed:n.elapsedTime,err:t}),t}}((t=>e(n,t)))},n}}function _(e){return b(((t,r)=>function(e,t,r){const n=function(e,t,r){r=function(e){let{kind:t,name:r,args:n}=e;return t&&""!==t||(t="Function"),r&&""!==r||(r=""),n||(n=[]),{kind:t,name:r,args:n}}(r);const n=[e.message];return n.push(`${r.kind} name = ${r.name}`.trim(),`completed in ${t.elapsed}ms`,`has a ${t.returnValue?"truthy":"falsy"} return value`),(e.opts&c.TraceOptions.Arguments)===c.TraceOptions.Arguments&&n.push((0,u.argsToLogString)(r.args)),(e.opts&c.TraceOptions.ReturnValue)===c.TraceOptions.ReturnValue&&n.push((0,u.returnValueToLogString)(t.returnValue)),n.join(", ")}(e,t,r);void 0===t.err?(!e.level||e.level>c.LogLevel.Error)&&E(c.LogLevel.Info,[n]):(E(c.LogLevel.Error,[n,t.err]),(0,s.sendTelemetryEvent)("ERROR",void 0,void 0,t.err))}(e,r,t)))}function E(e,...t){switch(e){case c.LogLevel.Error:v(...t);break;case c.LogLevel.Warn:y(...t);break;case c.LogLevel.Info:m(...t);break;case c.LogLevel.Debug:g(...t)}}t.setLoggingLevel=function(e){var t;f=null!==(t=d.get(e))&&void 0!==t?t:c.LogLevel.Error},t.initializeFileLogging=function(e){if(process.env.VSC_PYTHON_LOG_FILE){const t=new a.FileLogger((0,n.createWriteStream)(process.env.VSC_PYTHON_LOG_FILE));e.push(t),e.push(p(t))}},t.traceLog=function(...e){h.forEach((t=>t.traceLog(...e)))},t.traceError=v,t.traceWarn=y,t.traceInfo=m,t.traceVerbose=g,t.traceDecoratorVerbose=function(e,t=l){return _({message:e,opts:t,level:c.LogLevel.Debug})},t.traceDecoratorError=function(e){return _({message:e,opts:l,level:c.LogLevel.Error})},t.traceDecoratorInfo=function(e){return _({message:e,opts:l,level:c.LogLevel.Info})},t.traceDecoratorWarn=function(e){return _({message:e,opts:l,level:c.LogLevel.Warn})},t.logTo=E},4247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OutputChannelLogger=void 0;const n=r(73837),i=r(41719);function o(e,...t){return e?`[${e.toUpperCase()} ${(0,i.getTimeForLogging)()}]: ${n.format(...t)}`:n.format(...t)}t.OutputChannelLogger=class{constructor(e){this.channel=e}traceLog(...e){this.channel.appendLine(n.format(...e))}traceError(...e){this.channel.appendLine(o("error",...e))}traceWarn(...e){this.channel.appendLine(o("warn",...e))}traceInfo(...e){this.channel.appendLine(o("info",...e))}traceVerbose(...e){this.channel.appendLine(o("debug",...e))}}},14164:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLoggingLevel=void 0;const n=r(56792);t.getLoggingLevel=function(){var e;return null!==(e=(new n.WorkspaceService).getConfiguration("python").get("logging.level"))&&void 0!==e?e:"error"}},49903:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.TraceOptions=t.LogLevel=void 0,(n=t.LogLevel||(t.LogLevel={}))[n.Off=0]="Off",n[n.Error=10]="Error",n[n.Warn=20]="Warn",n[n.Info=30]="Info",n[n.Debug=40]="Debug",(r=t.TraceOptions||(t.TraceOptions={}))[r.None=0]="None",r[r.Arguments=1]="Arguments",r[r.ReturnValue=2]="ReturnValue"},41719:(e,t)=>{"use strict";function r(e,t){if(void 0===e)return"undefined";if(null===e)return"null";try{return e&&e.fsPath?``:JSON.stringify(e)}catch(e){return`<${t} cannot be serialized for logging>`}}Object.defineProperty(t,"__esModule",{value:!0}),t.getTimeForLogging=t.returnValueToLogString=t.argsToLogString=void 0,t.argsToLogString=function(e){if(!e)return"";try{return e.map(((e,t)=>`Arg ${t+1}: ${r(e,"argument")}`)).join(", ")}catch(e){return""}},t.returnValueToLogString=function(e){return`Return Value: ${r(e,"Return value")}`},t.getTimeForLogging=function(){const e=new Date;return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()} ${e.getHours()}:${e.getMinutes()}:${e.getSeconds()}.${e.getMilliseconds()}`}},65854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildProposedApi=t.reportActiveInterpreterChanged=t.reportInterpretersChanged=void 0;const n=r(66828),i=r(48431),o=r(61684),s=r(18639),a=r(44773),c=new n.EventEmitter;t.reportInterpretersChanged=function(e){c.fire(e)};const u=new n.EventEmitter;function l(e){const t=[`${e.version.major}`,`${e.version.minor}`,`${e.version.micro}`];return e.version.release&&(t.push(`${e.version.release}`),e.version.sysVersion&&t.push(`${e.version.release}`)),t}t.reportActiveInterpreterChanged=function(e){u.fire(e)},t.buildProposedApi=function(e,t){const r=t.get(o.IInterpreterPathService),h=t.get(s.IInterpreterService);return{environment:{async getActiveEnvironmentPath(e){const t=await h.getActiveInterpreter(e);if(t)return(0,a.getEnvPath)(t.path,t.envPath)},async getEnvironmentDetails(t,r){let n;if((null==r?void 0:r.useCache)&&(n=e.getEnvs().find((e=>function(e,t){return(0,i.arePathsSame)(e,t.location)||(0,i.arePathsSame)(e,t.executable.filename)}(t,e)))),n||(n=await e.resolveEnv(t),n))return{interpreterPath:n.executable.filename,envFolderPath:n.location.length?n.location:void 0,version:l(n),environmentType:[n.kind],metadata:{sysPrefix:n.executable.sysPrefix,bitness:n.arch}}},getEnvironmentPaths(){const t=e.getEnvs().map((e=>(0,a.getEnvPath)(e.executable.filename,e.location)));return Promise.resolve(t)},setActiveEnvironment:(e,t)=>r.update(t,n.ConfigurationTarget.WorkspaceFolder,e),async refreshEnvironment(t){await e.triggerRefresh(t?{clearCache:t.clearCache}:void 0);const r=e.getEnvs().map((e=>(0,a.getEnvPath)(e.executable.filename,e.location)));return Promise.resolve(r)},getRefreshPromise:()=>e.refreshPromise,onDidEnvironmentsChanged:c.event,onDidActiveEnvironmentChanged:u.event}}}},76687:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ReplProvider=void 0;const i=r(17585),o=r(77570),s=r(54813),a=r(61522),c=r(43200);class u{constructor(e){this.serviceContainer=e,this.disposables=[],this.activeResourceService=this.serviceContainer.get(i.IActiveResourceService),this.registerCommand()}dispose(){this.disposables.forEach((e=>e.dispose()))}registerCommand(){const e=this.serviceContainer.get(i.ICommandManager).registerCommand(o.Commands.Start_REPL,this.commandHandler,this);this.disposables.push(e)}async commandHandler(){const e=this.activeResourceService.getActiveResource(),t=this.serviceContainer.get(c.ICodeExecutionService,"repl");await t.initializeRepl(e)}}n([(0,s.captureTelemetry)(a.EventName.REPL)],u.prototype,"commandHandler",null),t.ReplProvider=u},8593:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalProvider=void 0;const i=r(17585),o=r(77570),s=r(58400),a=r(61684),c=r(36952),u=r(54813),l=r(61522);class h{constructor(e){this.serviceContainer=e,this.disposables=[],this.registerCommands(),this.activeResourceService=this.serviceContainer.get(i.IActiveResourceService)}async initialize(e){const t=this.serviceContainer.get(a.IConfigurationService).getSettings(this.activeResourceService.getActiveResource());if(e&&t.terminal.activateEnvInCurrentTerminal){const t="hideFromUser"in e.creationOptions&&e.creationOptions.hideFromUser;if(!t){const t=this.serviceContainer.get(s.ITerminalActivator);await t.activateEnvironmentInTerminal(e,{preserveFocus:!0})}(0,u.sendTelemetryEvent)(l.EventName.ACTIVATE_ENV_IN_CURRENT_TERMINAL,void 0,{isTerminalVisible:!t})}}dispose(){this.disposables.forEach((e=>e.dispose()))}registerCommands(){const e=this.serviceContainer.get(i.ICommandManager).registerCommand(o.Commands.Create_Terminal,this.onCreateTerminal,this);this.disposables.push(e)}async onCreateTerminal(){const e=this.serviceContainer.get(s.ITerminalServiceFactory),t=this.activeResourceService.getActiveResource();await e.createTerminalService(t,"Python").show(!1)}}n([(0,c.swallowExceptions)("Failed to initialize terminal provider")],h.prototype,"initialize",null),n([(0,u.captureTelemetry)(l.EventName.TERMINAL_CREATE,{triggeredBy:"commandpalette"})],h.prototype,"onCreateTerminal",null),t.TerminalProvider=h},11069:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPythonEnvironments=void 0;class r{constructor(e){this.getLocator=e}async activate(){this.locator=await this.getLocator()}get onRefreshStart(){return this.locator.onRefreshStart}get refreshPromise(){return this.locator.refreshPromise}get onChanged(){return this.locator.onChanged}getEnvs(e){return this.locator.getEnvs(e)}async resolveEnv(e){return this.locator.resolveEnv(e)}async triggerRefresh(e){return this.locator.triggerRefresh(e)}}t.createPythonEnvironments=async function(e){const t=new r(e);return await t.activate(),t}},44773:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.comparePythonVersionSpecificity=t.areSameEnv=t.getEnvID=t.getEnvPath=t.setEnvDisplayString=t.copyEnvInfo=t.buildEnvInfo=void 0;const n=r(96486),i=r(71017),o=r(3522),s=r(87450),a=r(37769),c=r(24563),u=r(95084),l=r(45878);function h(e,t){void 0!==t.kind&&(e.kind=t.kind),void 0!==t.executable&&(e.executable.filename=t.executable),void 0!==t.location&&(e.location=t.location),void 0!==t.version&&(e.version=t.version),void 0!==t.searchLocation&&(e.searchLocation=t.searchLocation)}function p(e,t=!1){const r=t||e.searchLocation||l.globallyInstalledEnvKinds.includes(e.kind),n=!l.virtualEnvKinds.includes(e.kind),i=["Python"];if(e.version&&!(0,u.isVersionEmpty)(e.version)&&i.push((0,u.getVersionDisplayString)(e.version)),n){const t=(0,o.getArchitectureDisplayName)(e.arch);""!==t&&i.push(t)}const s=[];if(e.name&&""!==e.name&&s.push(`'${e.name}'`),r){const t=(0,c.getKindDisplayName)(e.kind);""!==t&&s.push(t)}const a=0===s.length?"":`(${s.join(": ")})`;return`${i.join(" ")} ${a}`.trim()}function d(e){if("string"==typeof e){if(""===e)return;return{executable:{filename:e,sysPrefix:"",ctime:-1,mtime:-1}}}return"executablePath"in e?{executable:{filename:e.executablePath,sysPrefix:"",ctime:-1,mtime:-1},location:e.envPath,kind:e.kind,source:e.source}:e}function f(e,t){let r={path:e,pathType:"interpreterPath"};return t&&!(0,a.isParentPath)(e,t)&&(r={path:t,pathType:"envFolderPath"}),r}function v(e,t){return(0,a.normCasePath)(f(e,t).path)}function y(e){var t,r;let n=0;return e.major>0&&(n+=20),e.minor>=0&&(n+=10),e.micro>=0&&(n+=5),(null===(t=e.release)||void 0===t?void 0:t.level)&&(n+=3),((null===(r=e.release)||void 0===r?void 0:r.serial)||e.sysVersion)&&(n+=1),n}t.buildEnvInfo=function(e){var t,r,n,i,o,a,c,u,p;const d={name:null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"",location:"",kind:l.PythonEnvKind.Unknown,executable:{filename:"",sysPrefix:null!==(r=null==e?void 0:e.sysPrefix)&&void 0!==r?r:"",ctime:null!==(i=null===(n=null==e?void 0:e.fileInfo)||void 0===n?void 0:n.ctime)&&void 0!==i?i:-1,mtime:null!==(a=null===(o=null==e?void 0:e.fileInfo)||void 0===o?void 0:o.mtime)&&void 0!==a?a:-1},searchLocation:void 0,display:null==e?void 0:e.display,version:{major:-1,minor:-1,micro:-1,release:{level:l.PythonReleaseLevel.Final,serial:0}},arch:null!==(c=null==e?void 0:e.arch)&&void 0!==c?c:s.Architecture.Unknown,distro:{org:null!==(u=null==e?void 0:e.org)&&void 0!==u?u:""},source:null!==(p=null==e?void 0:e.source)&&void 0!==p?p:[]};return void 0!==e&&h(d,e),d.id=v(d.executable.filename,d.location),d},t.copyEnvInfo=function(e,t){const r=(0,n.cloneDeep)(e);return void 0!==t&&h(r,t),r},t.setEnvDisplayString=function(e){e.display=p(e),e.detailedDisplayName=p(e,!0)},t.getEnvPath=f,t.getEnvID=v,t.areSameEnv=function(e,t,r=!0){const n=d(e),o=d(t);if(void 0===n||void 0===o)return;const s=n.executable.filename,c=o.executable.filename;if(v(s,n.location)===v(c,o.location))return!0;if(r&&(0,a.arePathsSame)(i.dirname(s),i.dirname(c))){const r="string"==typeof e?void 0:n.version,i="string"==typeof t?void 0:o.version;if(r&&i&&((0,u.areIdenticalVersion)(r,i)||(0,u.areSimilarVersions)(r,i)))return!0}return!1},t.comparePythonVersionSpecificity=function(e,t){return Math.sign(y(e)-y(t))}},24563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrioritizedEnvKinds=t.getKindDisplayName=void 0;const n=r(45878);t.getKindDisplayName=function(e){for(const[t,r]of[[n.PythonEnvKind.System,"system"],[n.PythonEnvKind.MacDefault,"mac default"],[n.PythonEnvKind.WindowsStore,"windows store"],[n.PythonEnvKind.Pyenv,"pyenv"],[n.PythonEnvKind.CondaBase,"conda"],[n.PythonEnvKind.Poetry,"poetry"],[n.PythonEnvKind.Custom,"custom"],[n.PythonEnvKind.Venv,"venv"],[n.PythonEnvKind.VirtualEnv,"virtualenv"],[n.PythonEnvKind.VirtualEnvWrapper,"virtualenv"],[n.PythonEnvKind.Pipenv,"pipenv"],[n.PythonEnvKind.Conda,"conda"]])if(e===t)return r;return""},t.getPrioritizedEnvKinds=function(){return[n.PythonEnvKind.Pyenv,n.PythonEnvKind.CondaBase,n.PythonEnvKind.Conda,n.PythonEnvKind.WindowsStore,n.PythonEnvKind.Pipenv,n.PythonEnvKind.Poetry,n.PythonEnvKind.Venv,n.PythonEnvKind.VirtualEnvWrapper,n.PythonEnvKind.VirtualEnv,n.PythonEnvKind.OtherVirtual,n.PythonEnvKind.OtherGlobal,n.PythonEnvKind.MacDefault,n.PythonEnvKind.System,n.PythonEnvKind.Custom,n.PythonEnvKind.Unknown]}},67931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvironmentInfoService=t.EnvironmentInfoServiceQueuePriority=void 0;const n=r(59314),i=r(97749),o=r(67029),s=r(24708),a=r(19735),c=r(75470),u=r(45878),l=r(37769),h=r(4057);var p;async function d(e){const t=[e.executable.filename,h.OUTPUT_MARKER_SCRIPT];return await(0,o.getInterpreterInfo)((0,s.buildPythonExecInfo)(t,void 0,e.executable.filename))}async function f(e){const t=await c.Conda.getConda(),r=e.location.length?e.location:e.executable.filename,n=await(null==t?void 0:t.getCondaEnvironment(r));if(!n)return;const i=await(null==t?void 0:t.getRunPythonArgs(n,!0));return i?await(0,o.getInterpreterInfo)((0,s.buildPythonExecInfo)(i,void 0,e.executable.filename),c.CONDA_ACTIVATION_TIMEOUT):void 0}!function(e){e[e.Default=0]="Default",e[e.High=1]="High"}(p=t.EnvironmentInfoServiceQueuePriority||(t.EnvironmentInfoServiceQueuePriority={}));class v{constructor(){this.cache=new Map}dispose(){void 0!==this.workerPool&&(this.workerPool.stop(),this.workerPool=void 0),void 0!==this.condaRunWorkerPool&&(this.condaRunWorkerPool.stop(),this.condaRunWorkerPool=void 0)}async getEnvironmentInfo(e,t){const r=e.executable.filename,i=this.cache.get((0,l.normCasePath)(r));if(void 0!==i)return i.promise;const o=(0,n.createDeferred)();return this.cache.set((0,l.normCasePath)(r),o),this._getEnvironmentInfo(e,t).then((e=>{o.resolve(e)})).catch((e=>{o.reject(e)})),o.promise}async _getEnvironmentInfo(e,t){let r;void 0===this.workerPool&&(this.workerPool=(0,i.createRunningWorkerPool)(d));let n=await y(this.workerPool,e,t).catch((e=>{r=e}));return void 0===n&&(e.kind===u.PythonEnvKind.Conda||await(0,c.isCondaEnvironment)(e.executable.filename)?((0,a.traceInfo)(`Validating ${e.executable.filename} normally failed with error, falling back to using conda run: (${r})`),void 0===this.condaRunWorkerPool&&(this.condaRunWorkerPool=(0,i.createRunningWorkerPool)(f)),n=await y(this.condaRunWorkerPool,e,t).catch((e=>{(0,a.traceError)(e)}))):r&&(0,a.traceError)(r)),n}}function y(e,t,r){return r===p.High?e.addToQueue(t,i.QueuePosition.Front):e.addToQueue(t,i.QueuePosition.Back)}let m;t.getEnvironmentInfoService=function(e){if(void 0===m){const t=new v;null==e||e.push({dispose:()=>{t.dispose(),m=void 0}}),m=t}return m}},82035:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseVersionFromExecutable=void 0;const n=r(71017),i=r(87450),o=r(95084),s=r(37769);t.parseVersionFromExecutable=function(e){const t=function(e){if(e=(0,s.normCasePath)(e),(0,i.getOSType)()===i.OSType.Windows){if("python.exe"===e)return(0,o.getEmptyVersion)()}else if("python"===e)return(0,o.parseVersion)("2.7");if(!e.startsWith("python"))throw Error(`not a Python executable (expected "python..", got "${e}")`);return(0,o.parseVersion)(e)}(n.basename(e));return 2===t.major&&-1===t.minor&&(t.minor=7),t}},45878:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.UNKNOWN_PYTHON_VERSION=t.PythonReleaseLevel=t.PythonEnvSource=t.globallyInstalledEnvKinds=t.virtualEnvKinds=t.PythonEnvKind=void 0,function(e){e.Unknown="unknown",e.System="global-system",e.MacDefault="global-mac-default",e.WindowsStore="global-windows-store",e.Pyenv="global-pyenv",e.CondaBase="global-conda-base",e.Poetry="global-poetry",e.Custom="global-custom",e.OtherGlobal="global-other",e.Venv="virt-venv",e.VirtualEnv="virt-virtualenv",e.VirtualEnvWrapper="virt-virtualenvwrapper",e.Pipenv="virt-pipenv",e.Conda="virt-conda",e.OtherVirtual="virt-other"}(r=t.PythonEnvKind||(t.PythonEnvKind={})),t.virtualEnvKinds=[r.Poetry,r.Pipenv,r.Venv,r.VirtualEnvWrapper,r.Conda,r.VirtualEnv],t.globallyInstalledEnvKinds=[r.OtherGlobal,r.Unknown,r.WindowsStore,r.System,r.Custom],(i=t.PythonEnvSource||(t.PythonEnvSource={})).PathEnvVar="path env var",i.WindowsRegistry="windows registry",function(e){e.Alpha="alpha",e.Beta="beta",e.Candidate="candidate",e.Final="final"}(n=t.PythonReleaseLevel||(t.PythonReleaseLevel={})),t.UNKNOWN_PYTHON_VERSION={major:-1,minor:-1,micro:-1,release:{level:n.Final,serial:-1},sysVersion:void 0},Object.freeze(t.UNKNOWN_PYTHON_VERSION)},67029:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterpreterInfo=void 0;const n=r(4057),i=r(87450),o=r(19735),s=r(37769),a=r(24708),c=r(95084);t.getInterpreterInfo=async function(e,t){const[r,u]=(0,n.interpreterInfo)(),l=(0,a.copyPythonExecInfo)(e,r),h=[l.command,...l.args],p=h.reduce(((e,t)=>e?`${e} ${t.toCommandArgumentForPythonExt()}`:`${t.toCommandArgumentForPythonExt()}`),""),d=await(0,s.shellExecute)(p,{timeout:null!=t?t:15e3});d.stderr&&(0,o.traceError)(`Stderr when executing script with ${h} stderr: ${d.stderr}, still attempting to parse output`);const f=u(d.stdout);if(f)return(0,o.traceInfo)(`Found interpreter for ${h}`),function(e,t){let r=`${t.versionInfo.slice(0,3).join(".")}`;if(void 0!==t.versionInfo[3]&&["final","alpha","beta","candidate"].includes(t.versionInfo[3])&&(r=`${r}-${t.versionInfo[3]}`,void 0!==t.versionInfo[4])){let e=-1;try{e=parseInt(`${t.versionInfo[4]}`,10)}catch(t){e=-1}r=e>=0?`${r}${e}`:r}return{arch:t.is64Bit?i.Architecture.x64:i.Architecture.x86,executable:{filename:e,sysPrefix:t.sysPrefix,mtime:-1,ctime:-1},version:{...(0,c.parseVersion)(r),sysVersion:t.sysVersion}}}(e.pythonExecutable,f)}},95084:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareSemVerLikeVersions=t.toSemverLikeVersion=t.areSimilarVersions=t.areIdenticalVersion=t.getShortVersionString=t.getVersionDisplayString=t.isVersionEmpty=t.getEmptyVersion=t.parseBasicVersion=t.parseRelease=t.parseVersion=t.getPythonVersionFromPath=void 0;const n=r(96486),i=r(71017),o=r(52439),s=r(45878),a=r(19735);function c(e){const[t,r]=l(e);if(-1===t.micro)return t;const[n]=u(r);return t.release=n,t}function u(e){let t,r,n,i,o,a,c,u=e.match(/^(?:-?final|\.final(?:\.0)?)(.*)$/);if(u)[,t]=u,o="final",a="0";else for(const o of[/^(?:(a)|(b)|(rc))([1-9]\d*)(.*)$/,/^-(?:(?:(alpha)|(beta)|(candidate))([1-9]\d*))(.*)$/,/^\.(?:(?:(alpha)|(beta)|(candidate))\.([1-9]\d*))(.*)$/])if(u=e.match(o),u){[,r,n,i,a,t]=u;break}if(o)c=s.PythonReleaseLevel.Final;else if(i)c=s.PythonReleaseLevel.Candidate;else if(n)c=s.PythonReleaseLevel.Beta;else{if(!r)return[void 0,e];c=s.PythonReleaseLevel.Alpha}return[{level:c,serial:parseInt(a,10)},t]}function l(e){const t=o.parseBasicVersionInfo(`ignored-${e}`);if(!t){if(""===e)return[h(),""];throw Error(`invalid version ${e}`)}const{version:r,after:n}=t;if(r.release=void 0,-1===r.minor&&r.major>9){const e=10**(r.major.toString().length-1);r.minor=r.major%e,r.major=Math.floor(r.major/e)}return[r,n]}function h(){return(0,n.cloneDeep)(o.EMPTY_VERSION)}function p(e){return o.isVersionInfoEmpty(e)}function d(e){let t=o.getVersionString(e);if(void 0===e.release)return t;if(e.release.level===s.PythonReleaseLevel.Final)return t;if(e.release.level===s.PythonReleaseLevel.Candidate)t=`${t}rc${e.release.serial}`;else if(e.release.level===s.PythonReleaseLevel.Beta)t=`${t}b${e.release.serial}`;else{if(e.release.level!==s.PythonReleaseLevel.Alpha)throw Error(`unsupported release level ${e.release.level}`);t=`${t}a${e.release.serial}`}return t}function f(e,t){return void 0===e.release?void 0===t.release?[0,""]:[1,"level"]:void 0===t.release?[-1,"level"]:e.release.levelt.release.level?[-1,"level"]:e.release.level===s.PythonReleaseLevel.Final?[0,""]:e.release.serialt.release.serial?[-1,"serial"]:[0,""]}t.getPythonVersionFromPath=function(e){let t=s.UNKNOWN_PYTHON_VERSION;try{t=c(i.basename(e))}catch(t){(0,a.traceError)(`Failed to parse version from path: ${e}`,t)}return t},t.parseVersion=c,t.parseRelease=u,t.parseBasicVersion=l,t.getEmptyVersion=h,t.isVersionEmpty=p,t.getVersionDisplayString=function(e){return p(e)?"":-1!==e.micro?d(e):`${d(e)}.x`},t.getShortVersionString=d,t.areIdenticalVersion=function(e,t){return o.areIdenticalVersion(e,t,f)},t.areSimilarVersions=function(e,t){return!!o.areSimilarVersions(e,t,f)&&(2===e.major||e.minor>-1&&t.minor>-1)},t.toSemverLikeVersion=function(e){const t=o.getVersionString(e);let r=[];return e.release&&(r=e.release.serial<0?[`${e.release.level}`]:[`${e.release.level}`,`${e.release.serial}`]),{raw:t,major:e.major,minor:e.minor,patch:e.micro,build:[],prerelease:r}},t.compareSemVerLikeVersions=function(e,t){return e.major===t.major?e.minor===t.minor?e.patch===t.patch?0:e.patch>t.patch?1:-1:e.minor>t.minor?1:-1:e.major>t.major?1:-1}},44538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Locator=t.NOOP_ITERATOR=void 0;const n=r(59314),i=r(34354);t.NOOP_ITERATOR=(0,n.iterEmpty)(),t.Locator=class extends class{constructor(e){this.emitter=e,this.onChanged=e.onChanged}}{constructor(){super(new i.PythonEnvsWatcher)}}},69270:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvs=t.getQueryFilter=void 0;const n=r(59314),i=r(3481),o=r(19735);t.getQueryFilter=function(e){var t;const r=void 0!==e.kinds&&e.kinds.length>0?e.kinds:void 0,n=!(null===(t=e.searchLocations)||void 0===t?void 0:t.doNotIncludeNonRooted),o=function(e){if(void 0!==e.searchLocations)return 0===e.searchLocations.roots.length?[]:e.searchLocations.roots.map((e=>(0,i.getURIFilter)(e,{checkParent:!0})))}(e);return e=>!!function(e){return void 0===r||r.includes(e.kind)}(e)&&!!function(e){if(void 0===e.searchLocation)return n;const t=e.searchLocation;return void 0===o||o.some((e=>e(t)))}(e)},t.getEnvs=async function(e){const t=[],r=(0,n.createDeferred)();if(void 0===e.onUpdated)r.resolve();else{const n=e.onUpdated((e=>{if(null===e)r.resolve(),n.dispose();else{const{index:r,update:n}=e;if(void 0===t[r]){const e=JSON.stringify(n);(0,o.traceVerbose)(`Updates sent for an env which was classified as invalid earlier, currently not expected, ${e}`)}t[r]=n}}))}let i=0;for await(const r of e)void 0===t[i]&&(t[i]=r),i+=1;return await r.promise,t.filter((e=>void 0!==e)).map((e=>e))}},2839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Locators=t.combineIterators=void 0;const n=r(59314),i=r(81837),o=r(38514);function s(e){const t=(0,n.chain)(e),r=e.map((e=>e.onUpdated)).filter((e=>e));return r&&0!==r.length?(t.onUpdated=e=>{const t=new i.Disposables;let n=r.length;return r.forEach((r=>{const i=r((t=>{null===t?(n-=1,0===n&&e(null)):e(t)}));t.push(i)})),t},t):t}t.combineIterators=s;class a extends o.PythonEnvsWatchers{constructor(e){super(e),this.locators=e}iterEnvs(e){return s(this.locators.map((t=>t.iterEnvs(e))))}}t.Locators=a},77882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LazyResourceBasedLocator=void 0;const n=r(59314),i=r(81837),o=r(44538);class s extends o.Locator{constructor(){super(...arguments),this.disposables=new i.Disposables}async dispose(){await this.disposables.dispose()}async*iterEnvs(e){await this.ensureResourcesReady(),yield*this.doIterEnvs(e),this.ensureWatchersReady().ignoreErrors()}async initResources(){}async initWatchers(){}async ensureResourcesReady(){void 0===this.resourcesReady?(this.resourcesReady=(0,n.createDeferred)(),await this.initResources(),this.resourcesReady.resolve()):await this.resourcesReady.promise}async ensureWatchersReady(){void 0===this.watchersReady?(this.watchersReady=(0,n.createDeferred)(),await this.initWatchers(),this.watchersReady.resolve()):await this.watchersReady.promise}}t.LazyResourceBasedLocator=s},97954:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCollectionCache=t.PythonEnvInfoCache=void 0;const n=r(19735),i=r(65854),o=r(37769),s=r(44773),a=r(34354);class c extends a.PythonEnvsWatcher{constructor(e){super(),this.persistentStorage=e,this.envs=[]}async validateCache(){(await Promise.all(this.envs.map((e=>(0,o.pathExists)(e.executable.filename))))).map(((e,t)=>e?-1:t)).filter((e=>-1!==e)).reverse().forEach((e=>{const t=this.envs.splice(e,1)[0];this.fire({old:t,new:void 0}),(0,i.reportInterpretersChanged)([{path:(0,s.getEnvPath)(t.executable.filename,t.location).path,type:"remove"}])}))}getAllEnvs(){return this.envs}addEnv(e,t){const r=this.envs.find((t=>(0,s.areSameEnv)(t,e)));t&&(e.hasCompleteInfo=!0),r||(this.envs.push(e),this.fire({new:e}),(0,i.reportInterpretersChanged)([{path:(0,s.getEnvPath)(e.executable.filename,e.location).path,type:"add"}]))}updateEnv(e,t){const r=this.envs.findIndex((t=>(0,s.areSameEnv)(t,e)));-1!==r&&(void 0===t?this.envs.splice(r,1):this.envs[r]=t,this.fire({old:e,new:t}),(0,i.reportInterpretersChanged)([{path:(0,s.getEnvPath)(e.executable.filename,e.location).path,type:t?"update":"remove"}]))}getCompleteInfo(e){let t=this.envs.find((t=>(0,o.arePathsSame)(t.location,e)));return(null==t?void 0:t.hasCompleteInfo)?t:(t=this.envs.find((t=>(0,s.areSameEnv)(t,e))),(null==t?void 0:t.hasCompleteInfo)?t:void 0)}async clearAndReloadFromStorage(){this.envs=await this.persistentStorage.load()}async flush(){this.envs.length&&((0,n.traceInfo)("Environments added to cache",JSON.stringify(this.envs)),this.envs.forEach((e=>{e.hasCompleteInfo=!0})),await this.persistentStorage.store(this.envs))}clearCache(){return this.envs.forEach((e=>{this.fire({old:e,new:void 0})})),(0,i.reportInterpretersChanged)([{path:void 0,type:"clear-all"}]),this.envs=[],Promise.resolve()}}t.PythonEnvInfoCache=c,t.createCollectionCache=async function(e){const t=new c(e);return await t.clearAndReloadFromStorage(),await t.validateCache(),t}},17021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnvsCollectionService=void 0;const n=r(66828);r(32727);const i=r(59314),o=r(70057),s=r(19735),a=r(54813),c=r(61522),u=r(37769),l=r(44773),h=r(69270),p=r(34354);class d extends p.PythonEnvsWatcher{constructor(e,t){super(),this.cache=e,this.locator=t,this.refreshPromises=new Map,this.scheduledRefreshes=new Map,this.refreshStarted=new n.EventEmitter,this.locator.onChanged((e=>{const t=void 0;let r=this.scheduledRefreshes.get(t);r||(r=this.scheduleNewRefresh(t)),r.then((()=>{this.fire(e)}))})),this.cache.onChanged((e=>{this.fire(e)}))}get onRefreshStart(){return this.refreshStarted.event}get refreshPromise(){return this.refreshPromises.size>0?Promise.all(Array.from(this.refreshPromises.values())).then():void 0}async resolveEnv(e){e=(0,u.normalizePath)(e);const t=this.cache.getCompleteInfo(e);if(t)return t;const r=await this.locator.resolveEnv(e).catch((t=>{(0,s.traceError)(`Failed to resolve ${e}`,t)}));return r&&this.cache.addEnv(r,!0),r}getEnvs(e){const t=this.cache.getAllEnvs();return 0===t.length&&0===this.refreshPromises.size&&((0,s.traceError)("No python is installed or a refresh has not already been triggered"),this.triggerRefresh().ignoreErrors()),e?t.filter((0,h.getQueryFilter)(e)):t}triggerRefresh(e){let t=this.getRefreshPromiseForQuery(e);return t||(t=this.startRefresh(e)),t}startRefresh(e){const t=new o.StopWatch,r=(0,i.createDeferred)();(null==e?void 0:e.clearCache)&&this.cache.clearCache(),this.refreshPromises.set(e,r.promise),this.refreshStarted.fire();const n=this.locator.iterEnvs(e);return this.addEnvsToCacheFromIterator(n).then((async()=>{this.refreshPromises.delete(e),r.resolve(),(0,a.sendTelemetryEvent)(c.EventName.PYTHON_INTERPRETER_DISCOVERY,t.elapsedTime,{interpreters:this.cache.getAllEnvs().length,environmentsWithoutPython:this.cache.getAllEnvs().filter((e=>"envFolderPath"===(0,l.getEnvPath)(e.executable.filename,e.location).pathType)).length})})).catch((e=>r.reject(e)))}async addEnvsToCacheFromIterator(e){const t=[],r={done:!1,pending:0},n=(0,i.createDeferred)();if(void 0!==e.onUpdated){const i=e.onUpdated((async e=>{null===e?(r.done=!0,i.dispose()):(r.pending+=1,this.cache.updateEnv(t[e.index],e.update),e.update&&(t[e.index]=e.update),r.pending-=1),r.done&&0===r.pending&&n.resolve()}))}else n.resolve();for await(const r of e)t.push(r),this.cache.addEnv(r);await n.promise,await this.cache.validateCache(),this.cache.flush().ignoreErrors()}getRefreshPromiseForQuery(e){var t;return null!==(t=this.refreshPromises.get(e))&&void 0!==t?t:this.refreshPromises.get(void 0)}async scheduleNewRefresh(e){const t=this.getRefreshPromiseForQuery(e);let r;return t?(r=t.then((()=>{this.scheduledRefreshes.delete(e),this.startRefresh(e)})),this.scheduledRefreshes.set(e,r)):r=this.startRefresh(e),r}}t.EnvsCollectionService=d},30752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonEnvsReducer=void 0;const n=r(96486),i=r(66828),o=r(19735),s=r(45878),a=r(44773);async function c(e,t,r,i,o){r.pending+=1;const a=o[e],c=function(e,t){var r,i;const[o]=function(...e){const t=[s.PythonEnvKind.Pyenv,s.PythonEnvKind.CondaBase,s.PythonEnvKind.Conda,s.PythonEnvKind.WindowsStore,s.PythonEnvKind.Pipenv,s.PythonEnvKind.Poetry,s.PythonEnvKind.Venv,s.PythonEnvKind.VirtualEnvWrapper,s.PythonEnvKind.VirtualEnv,s.PythonEnvKind.OtherVirtual,s.PythonEnvKind.OtherGlobal,s.PythonEnvKind.MacDefault,s.PythonEnvKind.System,s.PythonEnvKind.Custom,s.PythonEnvKind.Unknown];return e.sort(((e,r)=>t.indexOf(e.kind)-t.indexOf(r.kind)))}(e,t),a=(0,n.cloneDeep)(o);return a.source=(0,n.uniq)((null!==(r=e.source)&&void 0!==r?r:[]).concat(null!==(i=t.source)&&void 0!==i?i:[])),a}(a,t);(0,n.isEqual)(a,c)||(o[e]=c,i.fire({index:e,old:a,update:c})),r.pending-=1,u(r,i)}function u(e,t){e.done&&0===e.pending&&(t.fire(null),t.dispose())}t.PythonEnvsReducer=class{constructor(e){this.parentLocator=e}get onChanged(){return this.parentLocator.onChanged}iterEnvs(e){const t=new i.EventEmitter,r=async function*(e,t){const r={done:!1,pending:0},n=[];if(void 0!==e.onUpdated){const i=e.onUpdated((e=>{if(r.pending+=1,null===e)r.done=!0,i.dispose();else{if(void 0===e.update)throw new Error("Unsupported behavior: `undefined` environment updates are not supported from downstream locators in reducer");if(void 0!==n[e.index]){const r=n[e.index];n[e.index]=e.update,t.fire({index:e.index,old:r,update:e.update})}else(0,o.traceVerbose)(`Expected already iterated env, got ${e.old} (#${e.index})`)}r.pending-=1,u(r,t)}))}let i=await e.next();for(;!i.done;){const o=i.value,s=n.findIndex((e=>(0,a.areSameEnv)(e,o)));-1!==s?c(s,o,r,t,n).ignoreErrors():(yield o,n.push(o)),i=await e.next()}void 0===e.onUpdated&&(r.done=!0,u(r,t))}(this.parentLocator.iterEnvs(e),t);return r.onUpdated=t.event,r}}},27736:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonEnvsResolver=void 0;const n=r(96486),i=r(66828),o=r(13367),s=r(44773),a=r(80640),c=r(19735),u=r(29616),l=r(95084);function h(e,t){e.done&&0===e.pending&&(t.fire(null),t.dispose())}function p(e,t){const r=(0,n.cloneDeep)(t);r.executable.filename=e.executable.filename,r.executable.sysPrefix=e.executable.sysPrefix;const i="envFolderPath"===(0,s.getEnvPath)(r.executable.filename,r.location).pathType;return r.version=i?(0,l.getEmptyVersion)():e.version,r.arch=e.arch,(0,s.setEnvDisplayString)(r),r}t.PythonEnvsResolver=class{constructor(e,t){this.parentLocator=e,this.environmentInfoService=t}get onChanged(){return this.parentLocator.onChanged}async resolveEnv(e){const[t,r]=await async function(e){var t;let r,n;return await(0,u.isPythonExecutable)(e)?(r=e,n=(0,u.getEnvironmentDirFromPath)(r)):(n=e,r=null!==(t=await(0,u.getInterpreterPathFromDir)(n))&&void 0!==t?t:""),[r,n]}(e);e=t.length?t:r;const n=await(0,o.identifyEnvironment)(e),i=await(0,a.resolveBasicEnv)({kind:n,executablePath:t,envPath:r}),s=await this.environmentInfoService.getEnvironmentInfo(i);if(s)return p(s,i)}iterEnvs(e){const t=new i.EventEmitter,r=this.parentLocator.iterEnvs(e),n=this.iterEnvsIterator(r,t);return n.onUpdated=t.event,n}async*iterEnvsIterator(e,t){const r={done:!1,pending:0},n=[];if(void 0!==e.onUpdated){const i=e.onUpdated((async e=>{if(r.pending+=1,null===e)r.done=!0,i.dispose();else{if(void 0===e.update)throw new Error("Unsupported behavior: `undefined` environment updates are not supported from downstream locators in resolver");if(void 0!==n[e.index]){const i=n[e.index];n[e.index]=await(0,a.resolveBasicEnv)(e.update,!0),t.fire({old:i,index:e.index,update:n[e.index]}),this.resolveInBackground(e.index,r,t,n).ignoreErrors()}else(0,c.traceVerbose)(`Expected already iterated env, got ${e.old} (#${e.index})`)}r.pending-=1,h(r,t)}))}let i=await e.next();for(;!i.done;){const o=await(0,a.resolveBasicEnv)(i.value,!0);n.push(o),yield o,this.resolveInBackground(n.indexOf(o),r,t,n).ignoreErrors(),i=await e.next()}void 0===e.onUpdated&&(r.done=!0,h(r,t))}async resolveInBackground(e,t,r,n){t.pending+=1;const i=await this.environmentInfoService.getEnvironmentInfo(n[e]),o=n[e];if(i){const t=p(i,n[e]);n[e]=t,r.fire({old:o,index:e,update:t})}else r.fire({old:o,index:e,update:void 0});t.pending-=1,h(t,r)}}},80640:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveBasicEnv=void 0;const n=r(71017),i=r(66828),o=r(96486),s=r(45878),a=r(44773),c=r(29616),u=r(37769),l=r(75470),h=r(77826),p=r(87450),d=r(95084),f=r(38366),v=r(82035),y=r(19735);async function m(e){const{executablePath:t}=e;let r;try{r=(0,v.parseVersionFromExecutable)(t)}catch(e){r=s.UNKNOWN_PYTHON_VERSION}return(0,a.buildEnvInfo)({kind:e.kind,version:r,executable:t})}async function g(e){const{executablePath:t,kind:r}=e,i=(0,a.buildEnvInfo)({kind:r,version:await(0,c.getPythonVersionFromPath)(t),executable:t}),o=(0,c.getEnvironmentDirFromPath)(t);return i.location=o,i.name=n.basename(o),i}async function b(e,t){var r,n;const{executablePath:i}=e,o=await l.Conda.getConda();void 0===o&&(0,y.traceWarn)(`${i} identified as Conda environment even though Conda is not installed`);const u=null!==(r=await(null==o?void 0:o.getEnvList(t)))&&void 0!==r?r:[];for(const{name:t,prefix:r}of u){let n=await(0,c.getInterpreterPathFromDir)(r);const i={executablePath:null!=n?n:"",kind:s.PythonEnvKind.Conda,envPath:r};if((0,a.areSameEnv)(e,i)){n=e.executablePath.length>0?e.executablePath:await(null==o?void 0:o.getInterpreterPathForEnvironment({name:t,prefix:r}));const i=(0,a.buildEnvInfo)({executable:n,kind:s.PythonEnvKind.Conda,org:l.AnacondaCompanyName,location:r,source:[],version:n?await(0,c.getPythonVersionFromPath)(n):void 0});return t&&(i.name=t),i}}return(0,y.traceError)(`${null!==(n=e.envPath)&&void 0!==n?n:e.executablePath} identified as a Conda environment but is not returned via '${null==o?void 0:o.command} info' command`),e.kind=s.PythonEnvKind.Unknown,g(e)}async function _(e){const{executablePath:t}=e,r=(0,c.getEnvironmentDirFromPath)(t),i=n.basename(r),o=(0,h.parsePyenvVersion)(i),p=(0,a.buildEnvInfo)({kind:s.PythonEnvKind.Pyenv,executable:t,source:[],location:r,version:await(0,c.getPythonVersionFromPath)(t,null==o?void 0:o.pythonVer),org:o&&o.distro?o.distro:""});return await async function(e){if(!await(0,l.isCondaEnvironment)(e))return!1;const t=(0,c.getEnvironmentDirFromPath)(e),r=(0,h.getPyenvVersionsDir)();return(0,u.arePathsSame)(n.dirname(t),r)}(t)?p.name="base":p.name=i,p}async function E(e){const{executablePath:t}=e;return(0,a.buildEnvInfo)({kind:s.PythonEnvKind.WindowsStore,executable:t,version:(0,d.getPythonVersionFromPath)(t),org:"Microsoft",arch:p.Architecture.x64,source:[s.PythonEnvSource.PathEnvVar]})}t.resolveBasicEnv=async function(e,t=!1){var r;const{kind:c,source:l}=e,h=function(){const e=new Map;return Object.values(s.PythonEnvKind).forEach((t=>{e.set(t,m)})),s.virtualEnvKinds.forEach((t=>{e.set(t,g)})),e.set(s.PythonEnvKind.Conda,b),e.set(s.PythonEnvKind.WindowsStore,E),e.set(s.PythonEnvKind.Pyenv,_),e}().get(c),v=await h(e,t);return v.searchLocation=function(e){if((0,u.getWorkspaceFolders)().some((t=>(0,u.isParentPath)(e.executable.filename,t))))return i.Uri.file(n.dirname(e.location))}(v),v.source=(0,o.uniq)(v.source.concat(null!=l?l:[])),(0,p.getOSType)()===p.OSType.Windows&&(null===(r=v.source)||void 0===r?void 0:r.includes(s.PythonEnvSource.WindowsRegistry))&&await async function(e){var t,r,n;let i=(0,f.getRegistryInterpretersSync)();i||((0,y.traceError)("Expected registry interpreter cache to be initialized already"),i=await(0,f.getRegistryInterpreters)());const c=i.find((t=>(0,u.arePathsSame)(t.interpreterPath,e.executable.filename)));if(c){const i=null!==(r=null!==(t=c.versionStr)&&void 0!==t?t:c.sysVersionStr)&&void 0!==r?r:c.interpreterPath;let u;try{u=(0,d.parseVersion)(i)}catch(e){u=s.UNKNOWN_PYTHON_VERSION}e.kind=e.kind===s.PythonEnvKind.Unknown?s.PythonEnvKind.OtherGlobal:e.kind,e.version=(0,a.comparePythonVersionSpecificity)(u,e.version)>0?u:e.version,e.distro.defaultDisplayName=c.companyDisplayName,e.arch="32bit"===c.bitnessStr?p.Architecture.x86:p.Architecture.x64,e.distro.org=null!==(n=c.distroOrgName)&&void 0!==n?n:e.distro.org,e.source=(0,o.uniq)(e.source.concat(s.PythonEnvSource.WindowsRegistry))}else(0,y.traceWarn)("Expected registry to find the interpreter as source was set")}(v),(0,a.setEnvDisplayString)(v),v.id=(0,a.getEnvID)(v.executable.filename,v.location),v}},74437:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CondaEnvironmentLocator=void 0,r(32727);const n=r(45878),i=r(44538),o=r(75470),s=r(19735);class a extends i.Locator{async*iterEnvs(){const e=await o.Conda.getConda();if(void 0===e)return void(0,s.traceVerbose)("Couldn't locate the conda binary.");(0,s.traceVerbose)(`Searching for conda environments using ${e.command}`);const t=await e.getEnvList();for(const r of t){const t=await e.getInterpreterPathForEnvironment(r);if(void 0!==t){(0,s.traceVerbose)(`Found conda environment: ${t}`);try{yield{kind:n.PythonEnvKind.Conda,executablePath:t,envPath:r.prefix}}catch(e){(0,s.traceError)(`Failed to process environment: ${t}`,e)}}}}}t.CondaEnvironmentLocator=a},82399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomVirtualEnvironmentLocator=t.VENVFOLDERS_SETTING_KEY=t.VENVPATH_SETTING_KEY=void 0;const n=r(96486),i=r(71017),o=r(59314),s=r(87450),a=r(45878),c=r(65349),u=r(29616),l=r(37769),h=r(37924),p=r(64715);r(32727);const d=r(99910),f=r(19735);async function v(){var e;const r=[],o=(0,l.getPythonSetting)(t.VENVPATH_SETTING_KEY);o&&r.push((0,l.untildify)(o));const a=null!==(e=(0,l.getPythonSetting)(t.VENVFOLDERS_SETTING_KEY))&&void 0!==e?e:[],c=(0,s.getUserHomeDir)();return c&&await(0,l.pathExists)(c)&&a.map((e=>i.join(c,e))).forEach((e=>r.push(e))),(0,d.asyncFilter)((0,n.uniq)(r),l.pathExists)}async function y(e){return await(0,h.isPipenvEnvironment)(e)?a.PythonEnvKind.Pipenv:await(0,p.isVirtualenvwrapperEnvironment)(e)?a.PythonEnvKind.VirtualEnvWrapper:await(0,p.isVenvEnvironment)(e)?a.PythonEnvKind.Venv:await(0,p.isVirtualenvEnvironment)(e)?a.PythonEnvKind.VirtualEnv:a.PythonEnvKind.Unknown}t.VENVPATH_SETTING_KEY="venvPath",t.VENVFOLDERS_SETTING_KEY="venvFolders";class m extends c.FSWatchingLocator{constructor(){super(v,y,{delayOnCreated:1e3})}async initResources(){this.disposables.push((0,l.onDidChangePythonSetting)(t.VENVPATH_SETTING_KEY,(()=>this.emitter.fire({})))),this.disposables.push((0,l.onDidChangePythonSetting)(t.VENVFOLDERS_SETTING_KEY,(()=>this.emitter.fire({}))))}doIterEnvs(){return async function*(){const e=(await v()).map((e=>async function*(){(0,f.traceVerbose)(`Searching for custom virtual envs in: ${e}`);const t=(0,u.findInterpretersInDir)(e,2);for await(const e of t){const{filename:t}=e;if(await(0,u.looksLikeBasicVirtualPython)(e))try{const e=await y(t);yield{kind:e,executablePath:t},(0,f.traceVerbose)(`Custom Virtual Environment: [added] ${t}`)}catch(e){(0,f.traceError)(`Failed to process environment: ${t}`,e)}else(0,f.traceVerbose)(`Custom Virtual Environment: [skipped] ${t}`)}}()));yield*(0,o.iterable)((0,o.chain)(e))}()}}t.CustomVirtualEnvironmentLocator=m},3649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirFilesLocator=void 0;const n=r(29616),i=r(34354);async function*o(e){for await(const t of(0,n.iterPythonExecutablesInDir)(e))yield t.filename}t.DirFilesLocator=class extends class{constructor(e,t,r){this.kind=e,this.getExecutables=t,this.source=r,this.watcher=new i.PythonEnvsWatcher,this.onChanged=this.watcher.onChanged}iterEnvs(e){const t=this.getExecutables();return async function*(e,r){for await(const n of t)yield{executablePath:n,kind:e,source:r}}(this.kind,this.source)}}{constructor(e,t,r=o,n){super(t,(()=>r(e)),n)}}},65349:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FSWatchingLocator=t.FSWatcherKind=void 0;const n=r(57147),i=r(71017),o=r(66828),s=r(88409),a=r(59314),c=r(19735),u=r(29616),l=r(53476),h=r(77882);var p;!function(e){e[e.Global=0]="Global",e[e.Workspace=1]="Workspace"}(p=t.FSWatcherKind||(t.FSWatcherKind={}));class d extends h.LazyResourceBasedLocator{constructor(e,t,r={},n=p.Global){super(),this.getRoots=e,this.getKind=t,this.opts=r,this.watcherKind=n}async initWatchers(){if(this.watcherKind===p.Global)return;(0,c.traceVerbose)("Getting roots");let e=await this.getRoots();(0,c.traceVerbose)("Found roots"),"string"==typeof e&&(e=[e]);const t=e.map((async e=>{const t=await function(e){let t;try{t=n.readdirSync(e)}catch(e){const t=e;if((0,c.traceError)("Reading directory to watch failed",t),"ENOENT"===t.code)return"directory does not exist";throw e}if(t.length>200)return"too many files"}(e);if(!t)return e;(0,c.traceError)(`Dir "${e}" is not watchable (${t})`)}));(await Promise.all(t)).filter((e=>!!e)).forEach((e=>this.startWatchers(e)))}startWatchers(e){const t=async(e,t)=>{var r;e===s.FileChangeType.Created&&void 0!==this.opts.delayOnCreated&&await(0,a.sleep)(this.opts.delayOnCreated);const n=await this.getKind(t).catch((()=>{})),l=o.Uri.file(null!==(r=this.opts.searchLocation)&&void 0!==r?r:i.dirname((0,u.getEnvironmentDirFromPath)(t)));(0,c.traceVerbose)("Fired event ",JSON.stringify({type:e,kind:n,searchLocation:l}),"from locator"),this.emitter.fire({type:e,kind:n,searchLocation:l})},r=(0,l.resolvePythonExeGlobs)(this.opts.baseGlob,this.opts.envStructure);(0,c.traceVerbose)("Start watching root",e,"for globs",JSON.stringify(r));const n=r.map((r=>(0,l.watchLocationForPythonBinaries)(e,t,r)));this.disposables.push(...n)}}t.FSWatchingLocator=d},93235:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVirtualEnvironmentLocator=void 0;const n=r(96486),i=r(71017),o=r(59314),s=r(87450),a=r(45878),c=r(65349),u=r(29616),l=r(37769),h=r(37924),p=r(64715);r(32727);const d=r(99910),f=r(19735);async function v(){const e=[];let t=(0,s.getEnvironmentVariable)("WORKON_HOME");t&&(t=(0,l.untildify)(t),await(0,l.pathExists)(t)&&e.push(t));const r=(0,s.getUserHomeDir)();if(r&&await(0,l.pathExists)(r)){const t=["Envs",".direnv",".venvs",".virtualenvs",i.join(".local","share","virtualenvs")];(0,s.getOSType)()!==s.OSType.Windows&&t.push("envs"),(await(0,d.asyncFilter)(t.map((e=>i.join(r,e))),l.pathExists)).forEach((t=>e.push(t)))}return(0,n.uniq)(e)}async function y(e){return await(0,h.isPipenvEnvironment)(e)?a.PythonEnvKind.Pipenv:await(0,p.isVirtualenvwrapperEnvironment)(e)?a.PythonEnvKind.VirtualEnvWrapper:await(0,p.isVenvEnvironment)(e)?a.PythonEnvKind.Venv:await(0,p.isVirtualenvEnvironment)(e)?a.PythonEnvKind.VirtualEnv:a.PythonEnvKind.Unknown}class m extends c.FSWatchingLocator{constructor(e){super(v,y,{delayOnCreated:1e3}),this.searchDepth=e}doIterEnvs(){var e;const t=null!==(e=this.searchDepth)&&void 0!==e?e:2;return async function*(){const e=(await v()).map((e=>async function*(){(0,f.traceVerbose)(`Searching for global virtual envs in: ${e}`);const r=(0,u.findInterpretersInDir)(e,t);for await(const e of r){const{filename:t}=e;if(await(0,u.looksLikeBasicVirtualPython)(e)){const e=await y(t);try{yield{kind:e,executablePath:t},(0,f.traceVerbose)(`Global Virtual Environment: [added] ${t}`)}catch(e){(0,f.traceError)(`Failed to process environment: ${t}`,e)}}else(0,f.traceVerbose)(`Global Virtual Environment: [skipped] ${t}`)}}()));yield*(0,o.iterable)((0,o.chain)(e))}()}}t.GlobalVirtualEnvironmentLocator=m},51372:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMacDefaultPythonPath=void 0;const n=r(87450);t.isMacDefaultPythonPath=function(e){return(0,n.getOSType)()===n.OSType.OSX&&(["python","/usr/bin/python"].includes(e)||e.startsWith("/usr/bin/python2"))}},68624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PoetryLocator=void 0;const n=r(71017),i=r(59314),o=r(45878),s=r(65349),a=r(29616),c=r(37769),u=r(13298);r(32727);const l=r(99910),h=r(19735);class p extends s.FSWatchingLocator{constructor(e){super((()=>async function(e){const t=[],r=await u.Poetry.getPoetry(e),i=await(null==r?void 0:r.getEnvList());if(null==i?void 0:i.length)t.push(n.dirname(i[0]));else{const e=await(null==r?void 0:r.getVirtualenvsPathSetting());e&&t.push(e)}return t}(e)),(async()=>o.PythonEnvKind.Poetry),void 0,s.FSWatcherKind.Workspace),this.root=e}doIterEnvs(){return async function*(e){const t=await async function(e){const t=[n.join(e,u.localPoetryEnvDirName)],r=await u.Poetry.getPoetry(e),i=await(null==r?void 0:r.getEnvList());return i&&t.push(...i),(0,l.asyncFilter)(t,c.pathExists)}(e),r=t.map((e=>async function*(){(0,h.traceVerbose)(`Searching for poetry virtual envs in: ${e}`);const t=await(0,a.getInterpreterPathFromDir)(e);if(void 0!==t){const e=await async function(e){return await(0,u.isPoetryEnvironment)(e)?o.PythonEnvKind.Poetry:o.PythonEnvKind.Unknown}(t);try{yield{executablePath:t,kind:e},(0,h.traceVerbose)(`Poetry Virtual Environment: [added] ${t}`)}catch(e){(0,h.traceError)(`Failed to process environment: ${t}`,e)}}}()));yield*(0,i.iterable)((0,i.chain)(r))}(this.root)}}t.PoetryLocator=p},43160:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PosixKnownPathsLocator=void 0;const n=r(22037),i=r(36625),o=r(45878),s=r(44538),a=r(72927),c=r(77826),u=r(87450),l=r(51372),h=r(19735);class p extends s.Locator{constructor(){super(...arguments),this.kind=o.PythonEnvKind.OtherGlobal}iterEnvs(){let e=!1;return(0,u.getOSType)()===u.OSType.OSX&&(0,i.gte)(n.release(),"21.0.0")&&(e=!0),async function*(t){const r=(await(0,a.commonPosixBinPaths)()).filter((e=>!(0,c.isPyenvShimDir)(e)));let n=await(0,a.getPythonBinFromPosixPaths)(r);e&&(n=n.filter((e=>!(0,l.isMacDefaultPythonPath)(e))));for(const e of n)try{yield{executablePath:e,kind:t,source:[o.PythonEnvSource.PathEnvVar]}}catch(t){(0,h.traceError)(`Failed to process environment: ${e}`,t)}}(this.kind)}}t.PosixKnownPathsLocator=p},41770:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PyenvLocator=void 0;const n=r(45878),i=r(65349),o=r(29616),s=r(37769),a=r(77826),c=r(19735);class u extends i.FSWatchingLocator{constructor(){super(a.getPyenvVersionsDir,(async()=>n.PythonEnvKind.Pyenv))}doIterEnvs(){return async function*(){const e=(0,a.getPyenvVersionsDir)(),t=(0,s.getSubDirs)(e,{resolveSymlinks:!0});for await(const e of t){const t=await(0,o.getInterpreterPathFromDir)(e);if(t)try{yield{kind:n.PythonEnvKind.Pyenv,executablePath:t}}catch(e){(0,c.traceError)(`Failed to process environment: ${t}`,e)}}}()}}t.PyenvLocator=u},44644:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowsPathEnvVarLocator=void 0;const n=r(47237),i=r(81837),o=r(29616),s=r(77826),a=r(38327),c=r(45878),u=r(2839),l=r(69270),h=r(3649);async function*p(e){for await(const t of(0,o.iterPythonExecutablesInDir)(e))await(0,o.looksLikeBasicGlobalPython)(t)&&(yield t.filename)}t.WindowsPathEnvVarLocator=class{constructor(){this.disposables=new i.Disposables;const e=(0,n.getSearchPathEntries)().filter((e=>!(0,a.isWindowsStoreDir)(e)&&!(0,s.isPyenvShimDir)(e))).map((e=>function(e,t,r){const n=new h.DirFilesLocator(e,t,p,r);return{iterEnvs:async function*(e){yield*await(0,l.getEnvs)(n.iterEnvs(e))},dispose:async()=>{},onChanged:n.onChanged}}(e,c.PythonEnvKind.System,[c.PythonEnvSource.PathEnvVar])));this.disposables.push(...e),this.locators=new u.Locators(e),this.onChanged=this.locators.onChanged}async dispose(){this.locators.dispose(),await this.disposables.dispose()}iterEnvs(e){return this.locators.iterEnvs(e)}}},5613:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowsRegistryLocator=void 0;const n=r(45878),i=r(44538),o=r(38366),s=r(19735);class a extends i.Locator{iterEnvs(){return async function*(){const e=await(0,o.getRegistryInterpreters)();for(const t of e)try{const e={kind:n.PythonEnvKind.OtherGlobal,executablePath:t.interpreterPath,source:[n.PythonEnvSource.WindowsRegistry]};yield e}catch(e){(0,s.traceError)(`Failed to process environment: ${t}`,e)}}()}}t.WindowsRegistryLocator=a},19555:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowsStoreLocator=t.getWindowsStorePythonExes=void 0;const n=r(55674),i=r(91171),o=r(71017),s=r(45878),a=r(65349),c=r(53476),u=r(38327),l="python3.{[0-9],[0-9][0-9]}.exe";function h(e){return i(o.basename(e),l,{nocase:!0})}async function p(){if(await(0,u.isStorePythonInstalled)()){const e=(0,u.getWindowsStoreAppsRoot)();return(await n.readdir(e)).map((t=>o.join(e,t))).filter(h)}return[]}t.getWindowsStorePythonExes=p;class d extends a.FSWatchingLocator{constructor(){super(u.getWindowsStoreAppsRoot,(async()=>this.kind),{baseGlob:l,searchLocation:(0,u.getWindowsStoreAppsRoot)(),envStructure:c.PythonEnvStructure.Flat}),this.kind=s.PythonEnvKind.WindowsStore}doIterEnvs(){return async function*(e){const t=await p();yield*t.map((async t=>({kind:e,executablePath:t})))}(this.kind)}}t.WindowsStoreLocator=d},3143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceVirtualEnvironmentLocator=void 0;const n=r(71017),i=r(59314),o=r(29616),s=r(37769),a=r(37924),c=r(64715),u=r(45878),l=r(65349);r(32727);const h=r(99910),p=r(19735);function d(e){return(0,h.asyncFilter)([e,n.join(e,".direnv")],s.pathExists)}async function f(e){return await(0,a.isPipenvEnvironment)(e)?u.PythonEnvKind.Pipenv:await(0,c.isVenvEnvironment)(e)?u.PythonEnvKind.Venv:await(0,c.isVirtualenvEnvironment)(e)?u.PythonEnvKind.VirtualEnv:u.PythonEnvKind.Unknown}class v extends l.FSWatchingLocator{constructor(e){super((()=>d(this.root)),f,{delayOnCreated:1e3},l.FSWatcherKind.Workspace),this.root=e}doIterEnvs(){return async function*(e){const t=(await d(e)).map((e=>async function*(){(0,p.traceVerbose)(`Searching for workspace virtual envs in: ${e}`);const t=(0,o.findInterpretersInDir)(e,2);for await(const e of t){const{filename:t}=e;if(await(0,o.looksLikeBasicVirtualPython)(e)){const e=await f(t);yield{kind:e,executablePath:t},(0,p.traceVerbose)(`Workspace Virtual Environment: [added] ${t}`)}else(0,p.traceVerbose)(`Workspace Virtual Environment: [skipped] ${t}`)}}()));yield*(0,i.iterable)((0,i.chain)(t))}(this.root)}}t.WorkspaceVirtualEnvironmentLocator=v},14424:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceLocators=t.ExtensionLocators=void 0;const n=r(59314),i=r(3481),o=r(81837),s=r(2839),a=r(77882);class c extends s.Locators{constructor(e,t){super([...e,t]),this.nonWorkspace=e,this.workspace=t}iterEnvs(e){var t;const r=[this.workspace.iterEnvs(e)];return(null===(t=null==e?void 0:e.searchLocations)||void 0===t?void 0:t.doNotIncludeNonRooted)||r.push(...this.nonWorkspace.map((t=>t.iterEnvs(e)))),(0,s.combineIterators)(r)}}t.ExtensionLocators=c;class u extends a.LazyResourceBasedLocator{constructor(e,t){super(),this.watchRoots=e,this.factories=t,this.locators={},this.roots={}}async dispose(){await super.dispose(),Object.keys(this.roots).map((e=>this.roots[e])).forEach((e=>this.removeRoot(e)))}doIterEnvs(e){const t=Object.keys(this.locators).map((t=>{if(void 0!==(null==e?void 0:e.searchLocations)){const r=this.roots[t],o=(0,i.getURIFilter)(r,{checkParent:!0,checkChild:!0});if(!e.searchLocations.roots.some(o))return(0,n.iterEmpty)()}const[r]=this.locators[t];return r.iterEnvs(e)}));return(0,s.combineIterators)(t)}async initResources(){const e=this.watchRoots({initRoot:e=>this.addRoot(e),addRoot:e=>{this.removeRoot(e),this.addRoot(e),this.emitter.fire({searchLocation:e})},removeRoot:e=>{this.removeRoot(e),this.emitter.fire({searchLocation:e})}});this.disposables.push(e)}addRoot(e){const t=[],r=new o.Disposables;this.factories.forEach((n=>{n(e).forEach((e=>{t.push(e),void 0!==e.dispose&&r.push(e)}))}));const n=new s.Locators(t),i=e.toString();this.locators[i]=[n,r],this.roots[i]=e,r.push(n.onChanged((t=>{void 0===t.searchLocation&&(t.searchLocation=e),this.emitter.fire(t)})))}removeRoot(e){const t=e.toString(),r=this.locators[t];if(void 0===r)return;const[,n]=r;delete this.locators[t],delete this.roots[t],n.dispose()}}t.WorkspaceLocators=u},34354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonEnvsWatcher=void 0;const n=r(66828);t.PythonEnvsWatcher=class{constructor(){this.didChange=new n.EventEmitter,this.onChanged=this.didChange.event}fire(e){this.didChange.fire(e)}}},38514:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonEnvsWatchers=void 0;const n=r(81837),i=r(34354);t.PythonEnvsWatchers=class{constructor(e){this.watcher=new i.PythonEnvsWatcher,this.disposables=new n.Disposables,this.onChanged=this.watcher.onChanged,e.forEach((e=>{const t=e.onChanged((e=>this.watcher.fire(e)));this.disposables.push(t)}))}dispose(){this.disposables.dispose().ignoreErrors()}}},29616:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvironmentDirFromPath=t.getInterpreterPathFromDir=t.looksLikeBasicVirtualPython=t.looksLikeBasicGlobalPython=t.getPythonVersionFromPath=t.iterPythonExecutablesInDir=t.findInterpretersInDir=t.isPythonExecutable=void 0;const n=r(57147),i=r(71017),o=r(56091),s=r(87450),a=r(19735),c=r(45878),u=r(44773),l=r(95084),h=r(75470),p=r(64715),d=r(37769),f=r(72927),v=r(38366),y=(0,s.getOSType)()===s.OSType.Windows?v.matchPythonBinFilename:f.matchPythonBinFilename;async function*m(e,t,r,n=!0){const i=(0,s.getOSType)()===s.OSType.Windows?v.matchPythonBinFilename:f.matchPythonBinFilename,a={ignoreErrors:n,filterSubDir:r,filterFile:i,maxDepth:t||0};for await(const t of g(e,1,a)){const{filename:e,filetype:r}=t;r!==o.FileType.File&&r!==o.FileType.SymbolicLink||_(e,i,n)&&(yield t)}}async function*g(e,t,r){const n=await b(e,r);for(const e of n){yield e;const{filename:n,filetype:i}=e;i===o.FileType.Directory&&(r.maxDepth<0||t<=r.maxDepth)&&_(n,r.filterSubDir,r.ignoreErrors)&&(yield*g(n,t+1,r))}}async function b(e,t={ignoreErrors:!0}){const r=t.ignoreErrors||!1;if(t.filterFilename&&(0,s.getOSType)()===s.OSType.Windows){let s;try{s=await n.promises.readdir(e)}catch(t){if("ENOENT"===t.code)return[];if(r)return(0,a.traceError)(`readdir() failed for "${e}" (${t})`),[];throw t}const c=s.map((t=>i.join(e,t))).filter((e=>_(e,t.filterFilename,r)));return Promise.all(c.map((async e=>({filename:e,filetype:await(0,o.getFileType)(e,t)||o.FileType.Unknown}))))}let c;try{c=await n.promises.readdir(e,{withFileTypes:!0})}catch(t){if("ENOENT"===t.code)return[];if(r)return(0,a.traceError)(`readdir() failed for "${e}" (${t})`),[];throw t}const u=c.map((t=>({filename:i.join(e,t.name),filetype:(0,o.convertFileType)(t)})));return t.filterFilename?u.filter((e=>_(e.filename,t.filterFilename,r))):u}function _(e,t,r=!0){if(void 0===t)return!0;try{return t(e)}catch(t){if(r)return(0,a.traceError)(`filter failed for "${e}" (${t})`),!1;throw t}}async function E(e,t){return!(!(t.matchFilename||y)("string"==typeof e?e:e.filename)||t.filterFile&&!await t.filterFile(e))}t.isPythonExecutable=async function(e){return!(!y(e)||(0,s.getOSType)()!==s.OSType.Windows)||!!await(0,d.isFile)(e)},t.findInterpretersInDir=m,t.iterPythonExecutablesInDir=async function*(e,t={ignoreErrors:!0}){const r={...t,filterFile:y},n=await b(e,r);for(const e of n){const{filetype:t}=e;t!==o.FileType.File&&t!==o.FileType.SymbolicLink||(yield e)}},t.getPythonVersionFromPath=async function(e,t){let r;try{r=t?(0,l.parseVersion)(t):c.UNKNOWN_PYTHON_VERSION}catch(e){r=c.UNKNOWN_PYTHON_VERSION}const n=e?await async function(e){const t=i.dirname(e);let r=c.UNKNOWN_PYTHON_VERSION;for await(const e of m(t)){const{filename:t}=e;try{const e=(0,l.parseVersion)(i.basename(t));(0,u.comparePythonVersionSpecificity)(e,r)>0&&(r=e)}catch(e){}}return r}(e):c.UNKNOWN_PYTHON_VERSION,o=e?await(0,p.getPythonVersionFromPyvenvCfg)(e):c.UNKNOWN_PYTHON_VERSION,s=e?await(0,h.getPythonVersionFromConda)(e):c.UNKNOWN_PYTHON_VERSION;let a=c.UNKNOWN_PYTHON_VERSION;for(const e of[r,n,o,s])a=(0,u.comparePythonVersionSpecificity)(a,e)>0?a:e;return a};const S=(0,o.getFileFilter)({ignoreFileType:o.FileType.SymbolicLink});async function w(e){return E(e,{matchFilename:(0,s.getOSType)()===s.OSType.Windows?v.matchBasicPythonBinFilename:f.matchBasicPythonBinFilename,filterFile:S})}async function T(e){return E(e,{matchFilename:(0,s.getOSType)()===s.OSType.Windows?v.matchBasicPythonBinFilename:f.matchBasicPythonBinFilename,filterFile:void 0})}t.looksLikeBasicGlobalPython=w,t.looksLikeBasicVirtualPython=T,t.getInterpreterPathFromDir=async function(e,t={}){const r=t.global?w:T,n=m(e,2,(function(e){const t=i.basename(e).toLowerCase();return["bin","scripts"].includes(t)}),t.ignoreErrors);for await(const e of n)if(await r(e))return e.filename},t.getEnvironmentDirFromPath=function(e){const t=i.basename(i.dirname(e));return["bin","scripts"].map((e=>(0,d.normCasePath)(e))).includes((0,d.normCasePath)(t))?i.dirname(i.dirname(e)):i.dirname(e)}},13367:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identifyEnvironment=void 0;const n=r(19735),i=r(45878),o=r(24563),s=r(75470),a=r(89235),c=r(37924),u=r(13298),l=r(77826),h=r(64715),p=r(38327);t.identifyEnvironment=async function(e){const t=function(){const e=()=>Promise.resolve(!1),t=new Map;return Object.values(i.PythonEnvKind).forEach((r=>{t.set(r,e)})),t.set(i.PythonEnvKind.Conda,s.isCondaEnvironment),t.set(i.PythonEnvKind.WindowsStore,p.isWindowsStoreEnvironment),t.set(i.PythonEnvKind.Pipenv,c.isPipenvEnvironment),t.set(i.PythonEnvKind.Pyenv,l.isPyenvEnvironment),t.set(i.PythonEnvKind.Poetry,u.isPoetryEnvironment),t.set(i.PythonEnvKind.Venv,h.isVenvEnvironment),t.set(i.PythonEnvKind.VirtualEnvWrapper,h.isVirtualenvwrapperEnvironment),t.set(i.PythonEnvKind.VirtualEnv,h.isVirtualenvEnvironment),t.set(i.PythonEnvKind.Unknown,(()=>Promise.resolve(!0))),t.set(i.PythonEnvKind.OtherGlobal,a.isGloballyInstalledEnv),t}(),r=(0,o.getPrioritizedEnvKinds)();for(const i of r){const r=t.get(i);if(r&&await r(e).catch((t=>((0,n.traceWarn)(`Identifier for ${i} failed to identify ${e}`,t),!1))))return i}return i.PythonEnvKind.Unknown}},75470:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.Conda=t.CONDA_ACTIVATION_TIMEOUT=t.CONDA_RUN_VERSION=t.getPythonVersionFromConda=t.isCondaEnvironment=t.getCondaMetaPaths=t.parseCondaInfo=t.CONDAPATH_SETTING_KEY=t.AnacondaCompanyName=void 0;const i=r(55674),o=r(71017),s=r(36625),a=r(87450),c=r(37769),u=r(45878),l=r(95084),h=r(38366),p=r(81387),d=r(36952),f=r(77570),v=r(19735),y=r(4057),m=r(24708),g=r(93400);function b(e){const t="conda-meta";return[o.join(o.dirname(e),t),o.join(o.dirname(o.dirname(e)),t),o.join(e,t)]}t.AnacondaCompanyName="Anaconda, Inc.",t.CONDAPATH_SETTING_KEY="condaPath",t.parseCondaInfo=async function(e,r,n,i){const o=Array.isArray(e.envs)?e.envs:[];e.default_prefix&&e.default_prefix.length>0&&o.push(e.default_prefix);const s=o.map((async e=>{const o=r(e);if(!await n(o))return;const s=await i(o);return s?{...s,path:o,companyDisplayName:t.AnacondaCompanyName,envType:p.EnvironmentType.Conda,envPath:e}:void 0}));return Promise.all(s).then((e=>e.filter((e=>null!=e)))).then((e=>e.map((e=>e))))},t.getCondaMetaPaths=b,t.isCondaEnvironment=async function(e){const t=b(e);for(const e of t)if(await(0,c.pathExists)(e))return!0;return!1},t.getPythonVersionFromConda=async function(e){const t=b(e).map((e=>o.join(e,"history"))),r=/\:python-(([\d\.a-z]?)+)/;for(const e of t)if(await(0,c.pathExists)(e))try{const t=(await(0,c.readFile)(e)).splitLines().map((e=>{const t=r.exec(e);return t?t[1]:""})).filter((e=>e.length>0));if(t.length>0){const e=t.length-1;return(0,l.parseVersion)(t[e].trim())}}catch(e){return u.UNKNOWN_PYTHON_VERSION}return u.UNKNOWN_PYTHON_VERSION},t.CONDA_RUN_VERSION="4.9.0",t.CONDA_ACTIVATION_TIMEOUT=45e3;class _{constructor(e,r){this.command=e,this.shellCommand=null!=r?r:e,(0,c.onDidChangePythonSetting)(t.CONDAPATH_SETTING_KEY,(()=>{_.condaPromise=void 0}))}static async getConda(){return(void 0===_.condaPromise||(0,f.isTestExecution)())&&(_.condaPromise=_.locate()),_.condaPromise}static async locate(){(0,v.traceVerbose)("Searching for conda.");const e=(0,a.getUserHomeDir)(),r=(0,c.getPythonSetting)(t.CONDAPATH_SETTING_KEY),n=(0,a.getOSType)()===a.OSType.Windows?"Scripts\\conda.exe":"bin/conda";async function s(e){const t=o.dirname(e),r=o.join(t,"..","condabin","conda.bat");if(await(0,c.pathExists)(r))return r}for await(const t of async function*(){r&&"conda"!==r&&(yield r),yield"conda",(0,a.getOSType)()===a.OSType.Windows&&(yield*async function*(){const e=(await(0,h.getRegistryInterpreters)()).filter((e=>e.interpreterPath&&"ContinuumAnalytics"===e.distroOrgName)).map((e=>o.join(o.win32.dirname(e.interpreterPath),n)));yield*e}()),yield*async function*(){const t=[];if((0,a.getOSType)()===a.OSType.Windows){const r=(0,a.getEnvironmentVariable)("PROGRAMDATA")||"C:\\ProgramData";if(t.push(r),e){const r=(0,a.getEnvironmentVariable)("LOCALAPPDATA")||o.join(e,"AppData","Local");t.push(e,o.join(r,"Continuum"))}}else t.push("/usr/share","/usr/local/share","/opt"),e&&t.push(e,o.join(e,"opt"));for(const e of t){let t;try{t=await i.readdir(e)}catch(e){t=void 0}void 0!==t&&(yield*t.filter((e=>e.toLowerCase().includes("conda"))).map((t=>o.join(e,t,n))))}}(),yield*async function*(){if(!e)return;let t;try{t=await i.readFile(o.join(e,".conda","environments.txt"),"utf8")}catch(e){t=""}yield*t.split(/\r?\n/g).map((e=>e.trim())).filter((e=>""!==e&&!e.startsWith("#"))).map((e=>o.join(e,n)))}()}()){(0,v.traceVerbose)(`Probing conda binary: ${t}`);let e=new _(t);try{if(await e.getInfo(),(0,a.getOSType)()===a.OSType.Windows&&((0,f.isTestExecution)()||t!==r)){const r=await s(t);try{if(r){const n=new _(r);await n.getInfo(),e=new _(t,r)}}catch(e){(0,v.traceVerbose)("Failed to spawn conda bat file",r,e)}}return(0,v.traceVerbose)(`Found conda via filesystem probing: ${t}`),e}catch(e){(0,v.traceVerbose)("Failed to spawn conda binary",t,e)}}(0,v.traceVerbose)("Couldn't locate the conda binary.")}async getInfo(e){return e&&this.condaInfoCached||(this.condaInfoCached=this.getInfoImpl(this.command)),this.condaInfoCached}async getInfoImpl(e){const t=await(0,c.exec)(e,["info","--json"],{timeout:5e4});return(0,v.traceVerbose)(`conda info --json: ${t.stdout}`),JSON.parse(t.stdout)}async getEnvList(e){const t=await this.getInfo(e),{envs:r}=t;if(void 0===r)return[];function n(e){if(t.root_prefix&&(0,c.arePathsSame)(e,t.root_prefix))return"base";const r=o.dirname(e);if(void 0!==t.envs_dirs)for(const n of t.envs_dirs)if((0,c.arePathsSame)(r,n))return o.basename(e)}return r.map((e=>({prefix:e,name:n(e)})))}async getCondaEnvironment(e){const t=await this.getEnvList();return t.find((t=>(0,c.arePathsSame)(e,t.prefix)))||t.find((t=>(0,c.isParentPath)(e,t.prefix)))}async getInterpreterPathForEnvironment(e){return await async function(e){const t=(0,a.getOSType)()===a.OSType.Windows?"python.exe":o.join("bin","python"),r=o.join(e,t);if(await(0,c.pathExists)(r))return r}(e.prefix)||this.getInterpreterPathUsingCondaRun(e)}async getInterpreterPathUsingCondaRun(e){const r=await this.getRunPythonArgs(e);if(r)try{const e=(0,m.buildPythonExecInfo)(r);return(0,g.getExecutablePath)(e,c.shellExecute,t.CONDA_ACTIVATION_TIMEOUT)}catch(t){(0,v.traceError)(`Failed to process environment: ${JSON.stringify(e)}`,t)}}async getRunPythonArgs(e,r){const n=await this.getCondaVersion();if(n&&(0,s.lt)(n,t.CONDA_RUN_VERSION))return;const i=[];return e.name?i.push("-n",e.name):i.push("-p",e.prefix),[r?this.shellCommand:this.command,"run",...i,"--no-capture-output","--live-stream","python",y.OUTPUT_MARKER_SCRIPT]}async getCondaVersion(){const e=await this.getInfo(!0).catch((()=>{}));let t;if(e&&e.conda_version)t=e.conda_version;else{const e=await(0,c.exec)(this.command,["--version"],{timeout:5e4}).then((e=>e.stdout.trim())).catch((()=>{}));t=e&&e.startsWith("conda ")?e.substring("conda ".length).trim():e}if(!t)return;return(0,s.parse)(t,!0)||((0,v.traceError)(`Unable to parse version of Conda, ${t}`),new s.SemVer("0.0.1"))}async isCondaRunSupported(){const e=await this.getCondaVersion();return!e||!(0,s.lt)(e,t.CONDA_RUN_VERSION)}}n([(0,d.cache)(3e4,!0,1e4)],_.prototype,"getInfoImpl",null),n([(0,d.cache)(3e4,!0,1e4)],_.prototype,"getEnvList",null),n([(0,d.cache)(-1,!0)],_.prototype,"getInterpreterPathUsingCondaRun",null),n([(0,d.cache)(-1,!0)],_.prototype,"getCondaVersion",null),t.Conda=_},1132:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CondaService=void 0;const o=r(86700),s=r(71017),a=r(84974),c=r(36952),u=r(19735),l=r(75470);let h=class{constructor(e,t){this.platform=e,this.fileSystem=t}async getCondaFile(e){return l.Conda.getConda().then((t=>{const r=e?null==t?void 0:t.shellCommand:null==t?void 0:t.command;return null!=r?r:"conda"}))}async getInterpreterPathForEnvironment(e){const t=await l.Conda.getConda();return null==t?void 0:t.getInterpreterPathForEnvironment({name:e.name,prefix:e.path})}async isCondaAvailable(){return"boolean"==typeof this.isAvailable?this.isAvailable:this.getCondaVersion().then((e=>this.isAvailable=void 0!==e)).catch((()=>this.isAvailable=!1))}async getCondaVersion(){return l.Conda.getConda().then((e=>null==e?void 0:e.getCondaVersion()))}async getCondaFileFromInterpreter(e,t){const r=this.platform.isWindows?"conda.exe":"conda",n=this.platform.isWindows?"Scripts":"bin",i=e?s.dirname(e):"",o=t?i.indexOf(s.join("envs",t)):-1;if(o>0){const e=i.slice(0,o);let t=s.join(e,r);if(await this.fileSystem.fileExists(t))return t;if(t=s.join(e,n,r),await this.fileSystem.fileExists(t))return t}let a=s.join(i,r);return await this.fileSystem.fileExists(a)?a:(a=s.join(i,n,r),await this.fileSystem.fileExists(a)?a:this.getCondaFile())}async _getCondaInfo(){const e=await l.Conda.getConda();return null==e?void 0:e.getInfo()}};n([(0,u.traceDecoratorVerbose)("Get Conda File from interpreter"),(0,c.cache)(12e4)],h.prototype,"getCondaFileFromInterpreter",null),n([(0,c.cache)(6e4)],h.prototype,"_getCondaInfo",null),h=n([(0,o.injectable)(),i(0,(0,o.inject)(a.IPlatformService)),i(1,(0,o.inject)(a.IFileSystem))],h),t.CondaService=h},89235:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isGloballyInstalledEnv=void 0;const n=r(47237),i=r(87450),o=r(37769),s=r(72927),a=r(77826);t.isGloballyInstalledEnv=async function(e){return async function(e){let t=[];t=(0,i.getOSType)()===i.OSType.Windows?(0,n.getSearchPathEntries)():await(0,s.commonPosixBinPaths)(),t=t.filter((e=>!(0,a.isPyenvShimDir)(e)));for(const r of t)if((0,o.isParentPath)(e,r))return!0;return!1}(e)}},37924:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPipenvEnvironmentRelatedToFolder=t.isPipenvEnvironment=t._getAssociatedPipfile=void 0;const n=r(71017),i=r(87450),o=r(19735),s=r(37769);async function a(e,t){const r=(0,i.getEnvironmentVariable)("PIPENV_PIPFILE")||"Pipfile";let a=t.lookIntoParentDirectories?function(){const e=(0,i.getEnvironmentVariable)("PIPENV_MAX_DEPTH");if(void 0===e)return 3;const t=parseInt(e,10);return isNaN(t)?((0,o.traceError)(`PIPENV_MAX_DEPTH is incorrectly set. Converting value '${e}' to number results in NaN`),1):t}():1;for(;a>0&&!(0,s.arePathsSame)(e,n.dirname(e));){const t=n.join(e,r);if(await(0,s.pathExists)(t))return t;e=n.dirname(e),a-=1}}async function c(e){const t=n.dirname(n.dirname(e)),r=await async function(e){const t=n.join(e,".project");if(!await(0,s.pathExists)(t))return;const r=(await(0,s.readFile)(t)).trim();if(await(0,s.pathExists)(r))return r;(0,o.traceError)(`The .project file inside environment folder: ${e} doesn't contain a valid path to the project`)}(t);if(void 0!==r)return n.basename((0,s.normCasePath)(t)).startsWith(`${n.basename((0,s.normCasePath)(r))}-`)?a(r,{lookIntoParentDirectories:!1}):void 0}t._getAssociatedPipfile=a,t.isPipenvEnvironment=async function(e){return!!await async function(e){const t=n.dirname(n.dirname(e));if(".venv"===n.basename(t))return a(n.dirname(t),{lookIntoParentDirectories:!1})}(e)||!!await c(e)},t.isPipenvEnvironmentRelatedToFolder=async function(e,t){const r=await c(e);if(!r)return!1;const n=void 0===(0,i.getEnvironmentVariable)("PIPENV_NO_INHERIT"),o=await a(t,{lookIntoParentDirectories:n});return!!o&&(0,s.arePathsSame)(r,o)}},13298:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.isPoetryEnvironmentRelatedToFolder=t.Poetry=t.isPoetryEnvironment=t.localPoetryEnvDirName=void 0;const i=r(71017),o=r(87450),s=r(37769),a=r(29616),c=r(64715),u=r(70057),l=r(36952),h=r(77570),p=r(19735),d=/^(.+)-(.+)-py(\d).(\d){1,2}$/;t.localPoetryEnvDirName=".venv",t.isPoetryEnvironment=async function(e){return!!await async function(e){const t=(0,a.getEnvironmentDirFromPath)(e);return!!d.test(i.basename(t))&&(0,c.isVirtualenvEnvironment)(e)}(e)||!!await async function(e){const r=(0,a.getEnvironmentDirFromPath)(e);return i.basename(r)===t.localPoetryEnvDirName&&!!v(i.dirname(r))}(e)};class f{constructor(e,t){this.command=e,this.cwd=t,this.fixCwd()}static async getPoetry(e){if(v(e))return(void 0===f.poetryPromise.get(e)||(0,h.isTestExecution)())&&f.poetryPromise.set(e,f.locate(e)),f.poetryPromise.get(e)}static async locate(e){(0,p.traceVerbose)(`Getting poetry for cwd ${e}`);for(const t of function*(){const e=(0,s.getPythonSetting)("poetryPath");e&&"poetry"!==e&&(yield e),yield"poetry";const t=(0,o.getUserHomeDir)();if(t){const e=i.join(t,".poetry","bin","poetry");(0,s.pathExistsSync)(e)&&(yield e)}}()){(0,p.traceVerbose)(`Probing poetry binary for ${e}: ${t}`);const r=new f(t,e);if(void 0!==await r.getEnvList())return(0,p.traceVerbose)(`Found poetry via filesystem probing for ${e}: ${t}`),r;(0,p.traceVerbose)(`Failed to find poetry for ${e}: ${t}`)}(0,p.traceVerbose)(`No poetry binary found for ${e}`)}async getEnvList(){return this.getEnvListCached(this.cwd)}async getEnvListCached(e){const t=await this.safeShellExecute(`${this.command} env list --full-path`);if(!t)return;const r="(Activated)";return(await Promise.all(t.stdout.splitLines().map((async e=>{e.endsWith(r)&&(e=e.slice(0,-r.length));const t=e.trim();return await(0,s.pathExists)(t)?t:void 0})))).filter((e=>void 0!==e)).map((e=>e))}async getActiveEnvPath(){return this.getActiveEnvPathCached(this.cwd)}async getActiveEnvPathCached(e){const t=await this.safeShellExecute(`${this.command} env info -p`,!0);if(t)return t.stdout.trim()}async getVirtualenvsPathSetting(){const e=await this.safeShellExecute(`${this.command} config virtualenvs.path`);if(e)return e.stdout.trim()}fixCwd(){if((0,o.getOSType)()===o.OSType.Windows&&/^[a-z]:/.test(this.cwd)){const e=this.cwd.split(":");e[0]=e[0].toUpperCase(),this.cwd=e.join(":")}}async safeShellExecute(e,t=!1){const r=new u.StopWatch,n=await(0,s.shellExecute)(e,{cwd:this.cwd,throwOnStdErr:!0,timeout:5e4}).catch((e=>{t?(0,p.traceVerbose)(e):(0,p.traceError)(e)}));return(0,p.traceVerbose)(`Time taken to run ${e} in ms`,r.elapsedTime),n}}function v(e){const t=i.join(e,"pyproject.toml");return!!(0,s.pathExistsSync)(t)&&!!(0,s.readFileSync)(t).includes("[tool.poetry]")}f.poetryPromise=new Map,n([(0,l.cache)(3e4,!0,1e4)],f.prototype,"getEnvListCached",null),n([(0,l.cache)(2e4,!0,1e4)],f.prototype,"getActiveEnvPathCached",null),t.Poetry=f,t.isPoetryEnvironmentRelatedToFolder=async function(e,t,r){const n=r?new f(r,t):await f.getPoetry(t),i=await(null==n?void 0:n.getActiveEnvPath());return!!i&&(0,s.isParentPath)(e,i)}},77826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePyenvVersion=t.isPyenvEnvironment=t.isPyenvShimDir=t.getPyenvVersionsDir=t.getPyenvDir=void 0;const n=r(71017),i=r(87450),o=r(37769);function s(){var e;let t=null!==(e=(0,i.getEnvironmentVariable)("PYENV_ROOT"))&&void 0!==e?e:(0,i.getEnvironmentVariable)("PYENV");if(!t){const e=(0,i.getUserHomeDir)()||"";t=(0,i.getOSType)()===i.OSType.Windows?n.join(e,".pyenv","pyenv-win"):n.join(e,".pyenv")}return t}t.getPyenvDir=s,t.getPyenvVersionsDir=function(){return n.join(s(),"versions")},t.isPyenvShimDir=function(e){const t=n.join(s(),"shims");return(0,o.arePathsSame)(t,e)||(0,o.arePathsSame)(`${t}${n.sep}`,e)},t.isPyenvEnvironment=async function(e){const t=e,r=s();return!!await(0,o.pathExists)(r)&&(0,o.isParentPath)(t,r)},t.parsePyenvVersion=function(e){const t=function(){function e(e){return{pythonVer:e,distro:void 0,distroVer:void 0}}function t(e){const t=e.split("-");return 3===t.length?{pythonVer:void 0,distroVer:`${t[1]}-${t[2]}`,distro:t[0]}:2===t.length?{pythonVer:void 0,distroVer:t[1],distro:t[0]}:{pythonVer:void 0,distroVer:void 0,distro:e}}const r=new Map;return r.set("activepython",t),r.set("anaconda",t),r.set("graalpython",t),r.set("ironpython",t),r.set("jython",t),r.set("micropython",t),r.set("miniconda",t),r.set("miniforge",t),r.set("pypy",(function(e){const t=e.split("-"),r=t[0].search(/[0-9\.]+/)>0?t[0].substr("pypy".length):void 0;return 2===t.length?{pythonVer:r,distroVer:t[1],distro:"pypy"}:3===t.length&&(t[2].startsWith("src")||t[2].startsWith("beta")||t[2].startsWith("alpha")||t[2].startsWith("win64"))?{pythonVer:r,distroVer:`${t[1].startsWith("v")?t[1].substr(1):t[1]}-${t[2]}`,distro:"pypy"}:3===t.length&&"stm"===t[1]?{pythonVer:r,distroVer:t[2],distro:`${t[0]}-${t[1]}`}:4===t.length&&"c"===t[1]?{pythonVer:r,distroVer:t[3],distro:`pypy-${t[1]}-${t[2]}`}:4===t.length&&t[3].startsWith("src")?{pythonVer:r,distroVer:`${t[1]}-${t[2]}-${t[3]}`,distro:"pypy"}:{pythonVer:r,distroVer:void 0,distro:"pypy"}})),r.set("pyston",t),r.set("stackless",t),r.set("3",e),r.set("2",e),r}(),r=Array.from(t.keys()).filter((t=>e.startsWith(t))).map((e=>t.get(e))).filter((e=>void 0!==e));if(r.length>0&&r[0])return r[0](e)}},64715:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPythonVersionFromPyvenvCfg=t.isVirtualenvwrapperEnvironment=t.isVirtualenvEnvironment=t.isVenvEnvironment=void 0;const n=r(55674),i=r(71017);r(32727);const o=r(87450),s=r(45878),a=r(44773),c=r(95084),u=r(37769);function l(e){const t="pyvenv.cfg";return[i.join(i.dirname(i.dirname(e)),t),i.join(i.dirname(e),t)]}async function h(e){const t=i.dirname(e),r=await n.readdir(t),o=/^activate(\.([A-z]|\d)+)?$/i;return void 0!==r.find((e=>o.test(e)))}function p(e){let t,r;try{[t,r]=(0,c.parseBasicVersion)(e)}catch(e){return s.UNKNOWN_PYTHON_VERSION}return-1!==t.micro&&r.startsWith(".")&&([t.release]=(0,c.parseRelease)(r)),t}t.isVenvEnvironment=async function(e){const t=l(e);for(const e of t)if(await(0,u.pathExists)(e))return!0;return!1},t.isVirtualenvEnvironment=h,t.isVirtualenvwrapperEnvironment=async function(e){const t=await function(){const e=(0,o.getEnvironmentVariable)("WORKON_HOME");return e?Promise.resolve(e):async function(){const e=(0,o.getUserHomeDir)()||"";if((0,o.getOSType)()===o.OSType.Windows){const t=i.join(e,"Envs");if(await(0,u.pathExists)(t))return t}return i.join(e,".virtualenvs")}()}();return await(0,u.pathExists)(t)&&(0,u.isParentPath)(e,t)&&h(e)},t.getPythonVersionFromPyvenvCfg=async function(e){const t=l(e);let r=s.UNKNOWN_PYTHON_VERSION;for(const e of t)if(await(0,u.pathExists)(e))try{const t=(await(0,u.readFile)(e)).splitLines().map((e=>{const t=e.split("=");if(2===t.length){const e=t[0].toLowerCase().trim(),r=t[1].trim();if("version"===e)try{return(0,c.parseVersion)(r)}catch(e){return}else if("version_info"===e)try{return p(r)}catch(e){return}}})).filter((e=>void 0!==e)).map((e=>e));if(t.length>0)for(const e of t)(0,a.comparePythonVersionSpecificity)(e,r)>0&&(r=e)}catch(e){return s.UNKNOWN_PYTHON_VERSION}return r}},38327:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWindowsStoreEnvironment=t.isStorePythonInstalled=t.isWindowsStoreDir=t.getWindowsStoreAppsRoot=void 0;const n=r(71017),i=r(87450),o=r(19735),s=r(37769);function a(){const e=(0,i.getEnvironmentVariable)("LOCALAPPDATA")||"";return n.join(e,"Microsoft","WindowsApps")}function c(e){const t=n.join((0,i.getEnvironmentVariable)("ProgramFiles")||"Program Files","WindowsApps").normalize().toUpperCase();return n.normalize(e).toUpperCase().includes(t)}async function u(e){let t=await Promise.all([(0,s.pathExists)(n.join(a(),"idle.exe")),(0,s.pathExists)(n.join(a(),"pip.exe"))]);return!!t.includes(!0)||!!e&&(t=await Promise.all([(0,s.pathExists)(n.join(n.dirname(e),"idle.exe")),(0,s.pathExists)(n.join(n.dirname(e),"pip.exe"))]),t.includes(!0))}t.getWindowsStoreAppsRoot=a,t.isWindowsStoreDir=function(e){const t=n.normalize(a()).toUpperCase();return n.normalize(e).toUpperCase().includes(t)||c(e)},t.isStorePythonInstalled=u,t.isWindowsStoreEnvironment=async function(e){if(await u(e)){const t=n.normalize(e).toUpperCase(),r=n.normalize(a()).toUpperCase();if(t.includes(r))return!0;if(c(t))return(0,o.traceWarn)("isWindowsStoreEnvironment called with Program Files store path."),!0}return!1}},37769:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onDidChangePythonSetting=t.getPythonSetting=t.getSubDirs=t.isFile=t.resolveSymbolicLink=t.getWorkspaceFolders=t.arePathsSame=t.normCasePath=t.resolvePath=t.normalizePath=t.isDirectory=t.isParentPath=t.untildify=t.readFileSync=t.readFile=t.pathExistsSync=t.pathExists=t.exec=t.shellExecute=t.initializeExternalDependencies=void 0;const n=r(55674),i=r(71017),o=r(66828),s=r(29983),a=r(61684),c=r(59314),u=r(87450);let l;function h(e){return(0,u.getOSType)()===u.OSType.Windows?i.normalize(e).toUpperCase():i.normalize(e)}async function p(e,t){if((t=null!=t?t:await n.lstat(e)).isSymbolicLink()){const t=await n.readlink(e);return p(i.isAbsolute(t)?t:i.resolve(i.dirname(e),t))}return e}t.initializeExternalDependencies=function(e){l=e},t.shellExecute=async function(e,t={}){return(await l.get(s.IProcessServiceFactory).create()).shellExec(e,t)},t.exec=async function(e,t,r={}){return(await l.get(s.IProcessServiceFactory).create()).exec(e,t,r)},t.pathExists=function(e){return n.pathExists(e)},t.pathExistsSync=function(e){return n.pathExistsSync(e)},t.readFile=function(e){return n.readFile(e,"utf-8")},t.readFileSync=function(e){return n.readFileSync(e,"utf-8")},t.untildify=r(58967),t.isParentPath=function(e,t){return t.endsWith(i.sep)||(t+=i.sep),e.endsWith(i.sep)||(e+=i.sep),h(e).startsWith(h(t))},t.isDirectory=async function(e){return(await n.lstat(e)).isDirectory()},t.normalizePath=function(e){return i.normalize(e)},t.resolvePath=function(e){return i.resolve(e)},t.normCasePath=h,t.arePathsSame=function(e,t){return h(e)===h(t)},t.getWorkspaceFolders=function(){var e,t;return null!==(t=null===(e=o.workspace.workspaceFolders)||void 0===e?void 0:e.map((e=>e.uri.fsPath)))&&void 0!==t?t:[]},t.resolveSymbolicLink=p,t.isFile=async function(e){const t=await n.lstat(e);if(t.isSymbolicLink()){const r=await p(e,t);return(await n.lstat(r)).isFile()}return t.isFile()},t.getSubDirs=async function*(e,t){const r=(await n.promises.readdir(e,{withFileTypes:!0})).map((r=>async function*(){const o=i.join(e,r.name);if(r.isDirectory())yield o;else if((null==t?void 0:t.resolveSymlinks)&&r.isSymbolicLink()){const e=await p(o);(await n.lstat(e)).isDirectory()&&(yield e)}}()));yield*(0,c.iterable)((0,c.chain)(r))},t.getPythonSetting=function(e){return l.get(a.IConfigurationService).getSettings()[e]},t.onDidChangePythonSetting=function(e,t){return o.workspace.onDidChangeConfiguration((r=>{r.affectsConfiguration(`python.${e}`)&&t()}))}},72927:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPythonBinFromPosixPaths=t.commonPosixBinPaths=t.matchPythonBinFilename=t.matchBasicPythonBinFilename=void 0;const n=r(57147),i=r(55674),o=r(71017),s=r(96486),a=r(47237),c=r(37769),u=r(19735);function l(e){return/^python(\d+(\.\d+)?)?$/.test(o.basename(e))}async function h(e){return(await n.promises.readdir(e,{withFileTypes:!0})).filter((e=>!e.isDirectory())).map((t=>o.join(e,t.name))).filter(l)}t.matchBasicPythonBinFilename=function(e){return"python"===o.basename(e)},t.matchPythonBinFilename=l,t.commonPosixBinPaths=async function(){const e=(0,a.getSearchPathEntries)(),t=Array.from(new Set(["/bin","/etc","/lib","/lib/x86_64-linux-gnu","/lib64","/sbin","/snap/bin","/usr/bin","/usr/games","/usr/include","/usr/lib","/usr/lib/x86_64-linux-gnu","/usr/lib64","/usr/libexec","/usr/local","/usr/local/bin","/usr/local/etc","/usr/local/games","/usr/local/lib","/usr/local/sbin","/usr/sbin","/usr/share","~/.local/bin"].concat(e))),r=await Promise.all(t.map((e=>i.pathExists(e))));return t.filter(((e,t)=>r[t]))},t.getPythonBinFromPosixPaths=async function(e){var t;const r=new Map;for(const n of e){const e=await h(n);for(const n of e)try{const e=await(0,c.resolveSymbolicLink)(n);r.has(e)?null===(t=r.get(e))||void 0===t||t.push(n):r.set(e,[n]),(0,u.traceInfo)(`Found: ${n} --\x3e ${e}`)}catch(e){(0,u.traceError)("Failed to resolve symbolic link: ",e)}}const n=Array.from(r.keys()).map((e=>{var t;return function(e){let t=e[0].length,r=e[0];for(const n of e)n.length<=t&&(t=n.length,r=n);return r}([e,...null!==(t=r.get(e))&&void 0!==t?t:[]])}));return(0,s.uniq)(n)}},53476:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolvePythonExeGlobs=t.PythonEnvStructure=t.watchLocationForPythonBinaries=void 0;const n=r(91171),i=r(71017),o=r(88409),s=r(87450),a=r(19735),[c,u]=(0,s.getOSType)()===s.OSType.Windows?["python.exe","Scripts"]:["python","bin"];var l;t.watchLocationForPythonBinaries=function(e,t,r=c){const u=i.posix.normalize(r),[l]=u.split("/").slice(-1);return(0,o.watchLocationForPattern)(e,u,(function(e,r){(0,a.traceVerbose)("Received event",e,JSON.stringify(r),"for baseglob",l),n(i.basename(r),l,{nocase:(0,s.getOSType)()===s.OSType.Windows})&&t(e,r)}))},function(e){e.Standard="standard",e.Flat="flat"}(l=t.PythonEnvStructure||(t.PythonEnvStructure={})),t.resolvePythonExeGlobs=function(e=c,t=l.Standard){if(i.posix.normalize(e).includes("/"))throw Error(`invalid basename glob "${e}"`);const r=[];return t===l.Standard?r.push(e,`*/${e}`,`*/${u}/${e}`):t===l.Flat&&r.push(e),r}},91057:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readRegistryKeys=t.readRegistryValues=t.REG_SZ=t.HKLM=t.HKCU=void 0;const n=r(1283);Object.defineProperty(t,"HKCU",{enumerable:!0,get:function(){return n.HKCU}}),Object.defineProperty(t,"HKLM",{enumerable:!0,get:function(){return n.HKLM}}),Object.defineProperty(t,"REG_SZ",{enumerable:!0,get:function(){return n.REG_SZ}});const i=r(59314);t.readRegistryValues=async function(e){const t=new(r(1283))(e),n=(0,i.createDeferred)();return t.values(((e,t)=>{e&&n.reject(e),n.resolve(t)})),n.promise},t.readRegistryKeys=async function(e){const t=new(r(1283))(e),n=(0,i.createDeferred)();return t.keys(((e,t)=>{e&&n.reject(e),n.resolve(t)})),n.promise}},38366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRegistryInterpreters=t.getRegistryInterpretersSync=t.getInterpreterDataFromRegistry=t.matchPythonBinFilename=t.matchBasicPythonBinFilename=void 0;const n=r(96486),i=r(71017),o=r(77570),s=r(19735),a=r(91057);async function c(e,t,r){const n=await(0,a.readRegistryKeys)({arch:e,hive:t,key:r}),i=r.substr(r.lastIndexOf("\\")+1),o=await Promise.all(n.map((e=>async function({arch:e,hive:t,key:r},n){const i={interpreterPath:"",distroOrgName:n},o=await(0,a.readRegistryValues)({arch:e,hive:t,key:r});for(const e of o)switch(e.name){case"SysArchitecture":i.bitnessStr=e.value;break;case"SysVersion":i.sysVersionStr=e.value;break;case"Version":i.versionStr=e.value;break;case"DisplayName":i.companyDisplayName=e.value}const c=(await(0,a.readRegistryKeys)({arch:e,hive:t,key:r})).map((e=>e.key)).find((e=>e.endsWith("InstallPath")));if(c){const r=(await(0,a.readRegistryValues)({arch:e,hive:t,key:c})).find((e=>"ExecutablePath"===e.name));r&&(i.interpreterPath=r.value,r.type!==a.REG_SZ&&(0,s.traceVerbose)(`Registry interpreter path type [${r.type}]: ${r.value}`))}if(i.interpreterPath.length>0)return i}(e,i))));return o.filter((e=>void 0!==e))||[]}let u,l;t.matchBasicPythonBinFilename=function(e){return"python.exe"===i.basename(e).toLowerCase()},t.matchPythonBinFilename=function(e){return/^python(\d+(.\d+)?)?\.exe$/.test(i.basename(e))},t.getInterpreterDataFromRegistry=c,t.getRegistryInterpretersSync=function(){return(0,o.isTestExecution)()?void 0:u},t.getRegistryInterpreters=async function(){return(0,o.isTestExecution)()||void 0===l?(l=async function(){let e=[];for(const t of["x64","x86"])for(const r of[a.HKLM,a.HKCU]){const n="\\SOFTWARE\\Python";let i=[];try{i=(await(0,a.readRegistryKeys)({arch:t,hive:r,key:n})).map((e=>e.key))}catch(e){(0,s.traceError)(`Failed to access Registry: ${t}\\${r}\\${n}`,e)}for(const n of i)e=e.concat(await c(t,r,n))}return u=(0,n.uniqBy)(e,(e=>e.interpreterPath)),u}(),l):l}},24708:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.copyPythonExecInfo=t.buildPythonExecInfo=void 0,t.buildPythonExecInfo=function(e,t,r){if(Array.isArray(e)){const n=e.slice(1);return t&&n.push(...t),{args:n,command:e[0],python:[...e],pythonExecutable:null!=r?r:e[e.length-1]}}return{command:e,args:t||[],python:[e],pythonExecutable:e}},t.copyPythonExecInfo=function(e,t){const r={command:e.command,args:[...e.args],python:[...e.python],pythonExecutable:e.pythonExecutable};return t&&r.args.push(...t),void 0===r.pythonExecutable&&(r.pythonExecutable=r.python[r.python.length-1]),r}},29817:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activate=t.initialize=void 0;const n=r(66828),i=r(73766),o=r(87450),s=r(30752),a=r(27736),c=r(44644),u=r(3143),l=r(37769),h=r(14424),p=r(82399),d=r(74437),f=r(93235),v=r(43160),y=r(41770),m=r(5613),g=r(19555),b=r(67931),_=r(22544),E=r(68624),S=r(11069),w=r(97954),T=r(17021);function P(e){const{initRoot:t,addRoot:r,removeRoot:i}=e,o=n.workspace.workspaceFolders;return o&&o.map((e=>e.uri)).forEach(t),n.workspace.onDidChangeWorkspaceFolders((e=>{for(const t of e.removed)i(t.uri);for(const t of e.added)r(t.uri)}))}t.initialize=async function(e){const t=await(0,S.createPythonEnvironments)((()=>async function(e){let t=new h.ExtensionLocators(function(e){const t=[];t.push(new y.PyenvLocator,new d.CondaEnvironmentLocator,new f.GlobalVirtualEnvironmentLocator,new p.CustomVirtualEnvironmentLocator),(0,o.getOSType)()===o.OSType.Windows?t.push(new m.WindowsRegistryLocator,new g.WindowsStoreLocator,new c.WindowsPathEnvVarLocator):t.push(new v.PosixKnownPathsLocator);const r=t.filter((e=>void 0!==e.dispose));return e.disposables.push(...r),t}(e),function(e){const t=new h.WorkspaceLocators(P,[e=>[new u.WorkspaceVirtualEnvironmentLocator(e.fsPath),new E.PoetryLocator(e.fsPath)]]);return e.disposables.push(t),t}(e));const r=(0,b.getEnvironmentInfoService)(e.disposables);t=new s.PythonEnvsReducer(t);const n=new a.PythonEnvsResolver(t,r);return new T.EnvsCollectionService(await async function(e){const t=(0,i.getGlobalStorage)(e.context,"PYTHON_ENV_INFO_CACHE",[]);return await(0,w.createCollectionCache)({load:async()=>t.get(),store:async e=>t.set(e)})}(e),n)}(e)));return(0,l.initializeExternalDependencies)(e.legacyIOC.serviceContainer),(0,_.registerNewDiscoveryForIOC)(e.legacyIOC.serviceManager,t),t},t.activate=async function(e,t){return e.triggerRefresh().ignoreErrors(),{fullyReady:Promise.resolve()}}},93400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExecutablePath=void 0;const n=r(31776),i=r(24708);t.getExecutablePath=async function(e,t,r){const[o,s]=(0,n.getExecutable)(),a=(0,i.copyPythonExecInfo)(e,o),c=[a.command,...a.args].reduce(((e,t)=>e?`${e} ${t.toCommandArgumentForPythonExt()}`:`${t.toCommandArgumentForPythonExt()}`),""),u=s((await t(c,{timeout:null!=r?r:15e3})).stdout.trim());if(""===u)throw new Error(`${c} resulted in empty stdout`);return u}},81387:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvironmentTypeName=t.ModuleInstallerType=t.virtualEnvTypes=t.EnvironmentType=void 0,function(e){e.Unknown="Unknown",e.Conda="Conda",e.VirtualEnv="VirtualEnv",e.Pipenv="PipEnv",e.Pyenv="Pyenv",e.Venv="Venv",e.WindowsStore="WindowsStore",e.Poetry="Poetry",e.VirtualEnvWrapper="VirtualEnvWrapper",e.Global="Global",e.System="System"}(r=t.EnvironmentType||(t.EnvironmentType={})),t.virtualEnvTypes=[r.Poetry,r.Pipenv,r.Venv,r.VirtualEnvWrapper,r.Conda,r.VirtualEnv],(n=t.ModuleInstallerType||(t.ModuleInstallerType={})).Unknown="Unknown",n.Conda="Conda",n.Pip="Pip",n.Poetry="Poetry",n.Pipenv="Pipenv",t.getEnvironmentTypeName=function(e){switch(e){case r.Conda:return"conda";case r.Pipenv:return"pipenv";case r.Pyenv:return"pyenv";case r.Venv:return"venv";case r.VirtualEnv:return"virtualenv";case r.WindowsStore:return"windows store";case r.Poetry:return"poetry";case r.VirtualEnvWrapper:return"virtualenvwrapper";default:return""}}},69554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterpreterInfo=void 0;const n=r(36625),i=r(4057),o=r(87450),s=r(24708);t.getInterpreterInfo=async function(e,t,r){const[a,c]=(0,i.interpreterInfo)(),u=(0,s.copyPythonExecInfo)(e,a),l=[u.command,...u.args],h=l.reduce(((e,t)=>e?`${e} "${t}"`:`"${t.replaceAll("\\","\\\\")}"`),""),p=await t(h,{timeout:15e3});p.stderr&&r&&r.error(`Failed to parse interpreter information for ${l} stderr: ${p.stderr}`);const d=c(p.stdout);if(r&&r.info(`Found interpreter for ${l}`),d)return function(e,t){let r=`${t.versionInfo.slice(0,3).join(".")}`;if(void 0!==t.versionInfo[3]&&["alpha","beta","candidate"].includes(t.versionInfo[3])&&(r=`${r}-${t.versionInfo[3]}`,void 0!==t.versionInfo[4])){let e=-1;try{e=parseInt(`${t.versionInfo[4]}`,10)}catch(t){e=-1}r=e>=0?`${r}${e}`:r}return{architecture:t.is64Bit?o.Architecture.x64:o.Architecture.x86,path:e,version:new n.SemVer(r),sysVersion:t.sysVersion,sysPrefix:t.sysPrefix}}(e.pythonExecutable,d)}},22544:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.registerNewDiscoveryForIOC=void 0;const i=r(86700),o=r(96486),s=r(66828),a=r(88409),c=r(18639),u=r(45878),l=r(51372),h=r(37769),p=r(81387),d=r(95084),f=r(67931),v=r(59314),y=r(99910),m=r(75470),g=r(38327),b=r(1132),_=r(19735),E=new Map(Object.entries({[u.PythonEnvKind.OtherGlobal]:p.EnvironmentType.Global,[u.PythonEnvKind.System]:p.EnvironmentType.System,[u.PythonEnvKind.MacDefault]:p.EnvironmentType.System,[u.PythonEnvKind.WindowsStore]:p.EnvironmentType.WindowsStore,[u.PythonEnvKind.Pyenv]:p.EnvironmentType.Pyenv,[u.PythonEnvKind.Conda]:p.EnvironmentType.Conda,[u.PythonEnvKind.CondaBase]:p.EnvironmentType.Conda,[u.PythonEnvKind.VirtualEnv]:p.EnvironmentType.VirtualEnv,[u.PythonEnvKind.Pipenv]:p.EnvironmentType.Pipenv,[u.PythonEnvKind.Poetry]:p.EnvironmentType.Poetry,[u.PythonEnvKind.Venv]:p.EnvironmentType.Venv,[u.PythonEnvKind.VirtualEnvWrapper]:p.EnvironmentType.VirtualEnvWrapper}));function S(e){const{name:t,location:r,executable:n,arch:i,kind:o,version:s,distro:a,id:c}=e,{filename:u,sysPrefix:l}=n,h={id:c,sysPrefix:l,envType:p.EnvironmentType.Unknown,envName:t,envPath:r,path:u,architecture:i},f=E.get(o);if(void 0!==f&&(h.envType=f),void 0!==s){const{release:e,sysVersion:t}=s;h.sysVersion=void 0===e?"":t;const r=(0,d.toSemverLikeVersion)(s);h.version=r}return void 0!==a&&""!==a.org&&(h.companyDisplayName=a.org),h.displayName=e.display,h.detailedDisplayName=e.detailedDisplayName,h}let w=class{constructor(e){this.api=e,this.refreshing=new s.EventEmitter,this.refreshed=new s.EventEmitter,this.changed=new s.EventEmitter,this.api.onChanged((e=>{this.changed.fire({type:e.type,new:e.new?S(e.new):void 0,old:e.old?S(e.old):void 0,resource:e.searchLocation})}))}triggerRefresh(e){return this.api.triggerRefresh(e)}get refreshPromise(){return this.api.refreshPromise}get onRefreshStart(){return this.api.onRefreshStart}get onChanged(){return this.changed.event}onDidCreate(e,t){const r=e?s.workspace.getWorkspaceFolder(e):void 0;return this.api.onChanged((e=>{r&&e.searchLocation&&((0,_.traceVerbose)(`Received event ${JSON.stringify(e)} file change event`),e.type===a.FileChangeType.Created&&(0,h.isParentPath)(e.searchLocation.fsPath,r.uri.fsPath)&&t())}))}get onRefreshing(){return this.refreshing.event}get onRefreshed(){return this.refreshed.event}async getInterpreterInformation(e){const t=await this.api.resolveEnv(e);return t?S(t):void 0}async isMacDefaultPythonPath(e){return(0,l.isMacDefaultPythonPath)(e)}async getInterpreterDetails(e){const t=await this.api.resolveEnv(e);if(t){if(null==t?void 0:t.executable.sysPrefix){const e=(0,f.getEnvironmentInfoService)(),r=await e.getEnvironmentInfo(t,f.EnvironmentInfoServiceQueuePriority.High);r&&(t.executable.sysPrefix=r.executable.sysPrefix,t.version=r.version)}return S(t)}}async isCondaEnvironment(e){return(0,m.isCondaEnvironment)(e)}async getCondaEnvironment(e){if(!await(0,m.isCondaEnvironment)(e))return;const t=await this.api.resolveEnv(e);return t?{name:t.name,path:t.location}:void 0}async isWindowsStoreInterpreter(e){return(0,g.isWindowsStoreEnvironment)(e)}async hasInterpreters(e=(async()=>!0)){const t=(0,v.createDeferred)();return this.api.onChanged((async r=>{r.new&&await e(S(r.new))&&t.resolve()})),this.api.getEnvs().length>0||(await Promise.race([t.promise,this.api.refreshPromise]),(await(0,y.asyncFilter)(this.api.getEnvs(),(t=>e(S(t))))).length>0)}getInterpreters(e,t){this.refreshing.fire();const r={};let n;void 0!==e&&(n=s.workspace.getWorkspaceFolder(e)),!n&&s.workspace.workspaceFolders&&s.workspace.workspaceFolders.length>0&&(!e||"untitled"===e.scheme)&&([n]=s.workspace.workspaceFolders),r.searchLocations=void 0!==n?{roots:[n.uri]}:{roots:[]};let i=this.api.getEnvs(r);t&&(i=i.filter((e=>(0,o.intersection)(t,e.source).length>0)));const a=i.map(S);return this.refreshed.fire(),a}async getWorkspaceVirtualEnvInterpreters(e,t){const r=s.workspace.getWorkspaceFolder(e);if(!r)return[];const n={searchLocations:{roots:[r.uri],doNotIncludeNonRooted:!0}};return(null==t?void 0:t.ignoreCache)&&await this.api.triggerRefresh(n),await this.api.refreshPromise,this.api.getEnvs(n).map(S)}};w=n([(0,i.injectable)()],w),t.registerNewDiscoveryForIOC=function(e,t){e.addSingleton(c.ICondaService,b.CondaService),e.addSingletonInstance(c.IComponentAdapter,new w(t))}},69284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialize=t.SourceMapSupport=void 0;const n=r(71017);r(32727);const i=r(90209),o=r(63281),s=r(19735),a="sourceMapsEnabled";class c{constructor(e){this.vscode=e,this.config=this.vscode.workspace.getConfiguration("python.diagnostics",null)}async initialize(){if(!this.enabled)return;await this.enableSourceMaps(!0),r(75913).install();const e=r(67098),t=e.Diagnostics.disableSourceMaps();this.vscode.window.showWarningMessage(e.Diagnostics.warnSourceMaps(),t).then((e=>{e===t&&this.disable().ignoreErrors()}))}get enabled(){return this.config.get(a,!1)}async disable(){this.enabled&&await this.config.update(a,!1,this.vscode.ConfigurationTarget.Global),await this.enableSourceMaps(!1)}async enableSourceMaps(e){const t=n.join(o.EXTENSION_ROOT_DIR,"out","client","extension.js"),r=n.join(o.EXTENSION_ROOT_DIR,"out","client","debugger","debugAdapter","main.js");await Promise.all([this.enableSourceMap(e,t),this.enableSourceMap(e,r)])}async enableSourceMap(e,t){const r=`${t}.map`,n=`${t}.map.disabled`;e?await this.rename(n,r):await this.rename(r,n)}async rename(e,t){const r=new i.FileSystem;await r.fileExists(t)||await r.move(e,t)}}t.SourceMapSupport=c,t.initialize=function(e=r(66828)){e.workspace.getConfiguration("python.diagnostics",null).get("sourceMapsEnabled",!1)?new c(e).initialize().catch((e=>{(0,s.traceError)("Failed to initialize source map support in extension")})):new c(e).disable().ignoreErrors()}},13825:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasUserDefinedPythonPath=t.sendErrorTelemetry=t.sendStartupTelemetry=void 0;const n=r(17585),i=r(77570),o=r(58400),s=r(61684),a=r(87282),c=r(18639),u=r(19735),l=r(81387),h=r(54813),p=r(61522);function d(e,t){let r;return t.get(n.IWorkspaceService),r=t.get(s.IInterpreterPathService).inspect(e),!!(r.workspaceFolderValue&&"python"!==r.workspaceFolderValue||r.workspaceValue&&"python"!==r.workspaceValue||r.globalValue&&"python"!==r.globalValue)}async function f(e){var t;const r=e.get(n.IWorkspaceService),i=(null===(t=r.workspaceFolders)||void 0===t?void 0:t.length)||0,s=e.get(o.ITerminalHelper).identifyTerminalShell();if(!r.isTrusted)return{workspaceFolderCount:i,terminal:s};const h=e.get(c.ICondaService),p=e.get(c.IInterpreterService),f=r.workspaceFolders?r.workspaceFolders[0].uri:void 0,[v,y]=await Promise.all([h.getCondaVersion().then((e=>e?e.raw:"")).catch((()=>"")),p.hasInterpreters((async e=>{var t;return 3===(null===(t=e.version)||void 0===t?void 0:t.major)}))]);await p.refreshPromise;const m=await p.getActiveInterpreter().catch((()=>{})),g=m&&m.version?m.version.raw:void 0,b=m?m.envType:void 0;b===l.EnvironmentType.Unknown&&(0,u.traceError)("Active interpreter type is detected as Unknown",JSON.stringify(m));const _=d(f,e),E=!!m&&function(e,t){const r=t.get(a.IInterpreterAutoSelectionService).getAutoSelectedInterpreter(void 0);return!!r&&e===r.path}(m.path,e);return{condaVersion:v,terminal:s,pythonVersion:g,interpreterType:b,workspaceFolderCount:i,hasPythonThree:y,usingUserDefinedInterpreter:_,usingGlobalInterpreter:E}}t.sendStartupTelemetry=async function(e,t,r,n){if(!(0,i.isTestExecution)())try{await e,t.totalNonBlockingActivateTime=r.elapsedTime-t.startActivateTime;const i=await f(n);(0,h.sendTelemetryEvent)(p.EventName.EDITOR_LOAD,t,i)}catch(e){(0,u.traceError)("sendStartupTelemetry() failed.",e)}},t.sendErrorTelemetry=async function(e,t,r){try{let n={};if(r)try{n=await f(r)}catch(e){(0,u.traceError)("getActivationTelemetryProps() failed.",e)}(0,h.sendTelemetryEvent)(p.EventName.EDITOR_LOAD,t,n,e)}catch(e){(0,u.traceError)("sendErrorTelemetry() failed.",e)}},t.hasUserDefinedPythonPath=d},61522:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.PlatformErrors=t.EventName=void 0,(n=t.EventName||(t.EventName={})).EDITOR_LOAD="EDITOR.LOAD",n.REPL="REPL",n.SELECT_INTERPRETER="SELECT_INTERPRETER",n.PYTHON_INTERPRETER="PYTHON_INTERPRETER",n.PYTHON_INSTALL_PACKAGE="PYTHON_INSTALL_PACKAGE",n.ENVIRONMENT_WITHOUT_PYTHON_SELECTED="ENVIRONMENT_WITHOUT_PYTHON_SELECTED",n.PYTHON_INTERPRETER_DISCOVERY="PYTHON_INTERPRETER_DISCOVERY",n.PYTHON_INTERPRETER_AUTO_SELECTION="PYTHON_INTERPRETER_AUTO_SELECTION",n.PYTHON_INTERPRETER_ACTIVATION_ENVIRONMENT_VARIABLES="PYTHON_INTERPRETER_ACTIVATION_ENVIRONMENT_VARIABLES",n.PYTHON_INTERPRETER_ACTIVATION_FOR_RUNNING_CODE="PYTHON_INTERPRETER_ACTIVATION_FOR_RUNNING_CODE",n.PYTHON_INTERPRETER_ACTIVATION_FOR_TERMINAL="PYTHON_INTERPRETER_ACTIVATION_FOR_TERMINAL",n.PIPENV_INTERPRETER_DISCOVERY="PIPENV_INTERPRETER_DISCOVERY",n.TERMINAL_SHELL_IDENTIFICATION="TERMINAL_SHELL_IDENTIFICATION",n.PYTHON_INTERPRETER_ACTIVATE_ENVIRONMENT_PROMPT="PYTHON_INTERPRETER_ACTIVATE_ENVIRONMENT_PROMPT",n.PYTHON_NOT_INSTALLED_PROMPT="PYTHON_NOT_INSTALLED_PROMPT",n.CONDA_INHERIT_ENV_PROMPT="CONDA_INHERIT_ENV_PROMPT",n.ENVFILE_VARIABLE_SUBSTITUTION="ENVFILE_VARIABLE_SUBSTITUTION",n.ENVFILE_WORKSPACE="ENVFILE_WORKSPACE",n.EXECUTION_CODE="EXECUTION_CODE",n.TERMINAL_CREATE="TERMINAL.CREATE",n.ACTIVATE_ENV_IN_CURRENT_TERMINAL="ACTIVATE_ENV_IN_CURRENT_TERMINAL",n.ACTIVATE_ENV_TO_GET_ENV_VARS_FAILED="ACTIVATE_ENV_TO_GET_ENV_VARS_FAILED",n.DIAGNOSTICS_ACTION="DIAGNOSTICS.ACTION",n.PLATFORM_INFO="PLATFORM.INFO",n.HASHED_PACKAGE_NAME="HASHED_PACKAGE_NAME",(r=t.PlatformErrors||(t.PlatformErrors={})).FailedToParseVersion="FailedToParseVersion",r.FailedToDetermineOS="FailedToDetermineOS"},98634:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnvFileTelemetryTests=t.sendActivationTelemetry=t.sendFileCreationTelemetry=t.sendSettingTelemetry=void 0;const n=r(48683),i=r(54813),o=r(61522);let s,a=!1;function c(e=!1){(0,i.sendTelemetryEvent)(o.EventName.ENVFILE_WORKSPACE,void 0,{hasCustomEnvPath:e}),a=!0}function u(){return!a}function l(e){var t;if(!s){const r=e.getConfiguration("python");s=(null===(t=r.inspect("envFile"))||void 0===t?void 0:t.defaultValue)||""}return s}t.sendSettingTelemetry=function(e,t){u()&&t!==l(e)&&c(!0)},t.sendFileCreationTelemetry=function(){u()&&c()},t.sendActivationTelemetry=async function(e,t,r){if(u()){const i=new n.SystemVariables(r,void 0,t).resolveAny(l(t));await e.fileExists(i)&&c()}},t.EnvFileTelemetryTests={setState:({telemetrySent:e,defaultSetting:t})=>{void 0!==e&&(a=e),void 0!==l&&(s=t)},resetState:()=>{s=void 0,a=!1}}},54813:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendTelemetryWhenDone=t.captureTelemetry=t.sendTelemetryEvent=t.clearTelemetryReporter=t._resetSharedProperties=t.setSharedProperty=t.isTelemetryDisabled=void 0;const n=r(77570),i=r(70057),o=r(59314);r(61522),t.isTelemetryDisabled=function(e){return!1===e.getConfiguration("telemetry").inspect("enableTelemetry").globalValue};const s={};let a;function c(e,t,i,o){var c;if((0,n.isTestExecution)()||!function(){try{return!1}catch(e){return!1}}())return;const u=function(){if(!(0,n.isTestExecution)()&&a)return a;const e=n.PVSC_EXTENSION_ID,{extensions:t}=r(66828),i=t.getExtension(e).packageJSON.version,o=r(88361).default;return a=new o(e,i,n.AppinsightsKey,!0),a}(),l="number"==typeof t?{duration:t}:t||void 0,h={},p=e;if(i){const t=i;Object.getOwnPropertyNames(t).forEach((r=>{if(void 0!==t[r]&&null!==t[r])try{switch(typeof t[r]){case"string":h[r]=t[r];break;case"object":h[r]="object";break;default:h[r]=t[r].toString()}}catch(t){console.error(`Failed to serialize ${r} for ${e}`,t)}}))}if(Object.assign(h,s),o){const e={errorName:o.name,errorMessage:o.message,errorStack:null!==(c=o.stack)&&void 0!==c?c:""};Object.assign(h,e);const t=Object.getOwnPropertyNames(e);u.sendTelemetryErrorEvent(p,h,l,t)}else u.sendTelemetryEvent(p,h,l);process.env&&process.env.VSC_PYTHON_LOG_TELEMETRY&&console.info(`Telemetry Event : ${p} Measures: ${JSON.stringify(l)} Props: ${JSON.stringify(h)} `)}t.setSharedProperty=function(e,t){const r=e;(0,n.isUnitTestExecution)()&&r.startsWith("ds_")||(void 0===t?delete s[r]:s[r]=t)},t._resetSharedProperties=function(){for(const e of Object.keys(s))delete s[e]},t.clearTelemetryReporter=function(){a=void 0},t.sendTelemetryEvent=c,t.captureTelemetry=function(e,t,r=!0,n,s,a){return function(u,l,h){const p=h.value;return h.value=function(...u){if(!r&&!s&&!a)return c(e,void 0,t),p.apply(this,u);const l=e=>s?{...t,...s(this,e)}:t,h=r?new i.StopWatch:void 0,d=e=>{const t=h?{duration:h.elapsedTime}:void 0;return a?{...t,...a(this,e)}:t},f=p.apply(this,u);return f&&(0,o.isPromise)(f)?f.then((t=>(c(e,d(t),l(t)),t))).catch((t=>{const r={...l(),failed:!0};c(n||e,d(),r,t)})):c(e,d(f),l(f)),f},h}},t.sendTelemetryWhenDone=function(e,t,r,n){if(r=r||new i.StopWatch,"function"!=typeof t.then)throw new Error("Method is neither a Promise nor a Theneable");t.then((t=>(c(e,r.elapsedTime,n),t)),(t=>(c(e,r.elapsedTime,n,t),Promise.reject(t))))}},19645:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CodeExecutionManager=void 0;const o=r(86700),s=r(66828),a=r(17585),c=r(77570);r(32727);const u=r(84974),l=r(61684),h=r(3481),p=r(77498),d=r(19735),f=r(54813),v=r(61522),y=r(43200);let m=class{constructor(e,t,r,n){this.commandManager=e,this.disposableRegistry=t,this.fileSystem=r,this.serviceContainer=n,this.eventEmitter=new s.EventEmitter}get onExecutedCode(){return this.eventEmitter.event}registerCommands(){[c.Commands.Exec_In_Terminal,c.Commands.Exec_In_Terminal_Icon].forEach((e=>{this.disposableRegistry.push(this.commandManager.registerCommand(e,(async t=>{const r=e===c.Commands.Exec_In_Terminal?"command":"icon";await this.executeFileInTerminal(t,r).catch((e=>(0,d.traceError)("Failed to execute file in terminal",e)))})))}))}async executeFileInTerminal(e,t){(0,f.sendTelemetryEvent)(v.EventName.EXECUTION_CODE,void 0,{scope:"file",trigger:t});const r=this.serviceContainer.get(y.ICodeExecutionHelper),n=(e=e instanceof s.Uri?e:void 0)||await r.getFileToExecute();if(!n)return;await r.saveFileIfDirty(n);try{const e=await this.fileSystem.readFile(n.fsPath);this.eventEmitter.fire(e)}catch(e){(0,h.noop)()}const i=this.serviceContainer.get(y.ICodeExecutionService,"standard");await i.executeFile(n)}};m=n([(0,o.injectable)(),i(0,(0,o.inject)(a.ICommandManager)),i(1,(0,o.inject)(l.IDisposableRegistry)),i(2,(0,o.inject)(u.IFileSystem)),i(3,(0,o.inject)(p.IServiceContainer))],m),t.CodeExecutionManager=m},20130:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.DjangoContextInitializer=void 0;const i=r(86700),o=r(71017),s=r(94316),a=r(19735);let c=class{constructor(e,t,r,n){this.documentManager=e,this.workpaceService=t,this.fileSystem=r,this.monitoringActiveTextEditor=!1,this.workspaceContextKeyValues=new Map,this.lastCheckedWorkspace="",this.disposables=[],this.isDjangoProject=new s.ContextKey("python.isDjangoProject",n),this.ensureContextStateIsSet().catch((e=>(0,a.traceError)("Python Extension: ensureState",e))),this.disposables.push(this.workpaceService.onDidChangeWorkspaceFolders((()=>this.updateContextKeyBasedOnActiveWorkspace())))}dispose(){this.disposables.forEach((e=>e.dispose()))}updateContextKeyBasedOnActiveWorkspace(){this.monitoringActiveTextEditor||(this.monitoringActiveTextEditor=!0,this.disposables.push(this.documentManager.onDidChangeActiveTextEditor((()=>this.ensureContextStateIsSet()))))}getActiveWorkspace(){if(!Array.isArray(this.workpaceService.workspaceFolders)||0===this.workpaceService.workspaceFolders.length)return;if(1===this.workpaceService.workspaceFolders.length)return this.workpaceService.workspaceFolders[0].uri.fsPath;const e=this.documentManager.activeTextEditor;if(!e)return;const t=this.workpaceService.getWorkspaceFolder(e.document.uri);return t?t.uri.fsPath:void 0}async ensureContextStateIsSet(){const e=this.getActiveWorkspace();if(!e)return this.isDjangoProject.set(!1);if(this.lastCheckedWorkspace!==e)if(this.workspaceContextKeyValues.has(e))await this.isDjangoProject.set(this.workspaceContextKeyValues.get(e));else{const t=await this.fileSystem.fileExists(o.join(e,"manage.py"));await this.isDjangoProject.set(t),this.workspaceContextKeyValues.set(e,t),this.lastCheckedWorkspace=e}}};c=n([(0,i.injectable)()],c),t.DjangoContextInitializer=c},80710:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DjangoShellCodeExecutionProvider=void 0;const o=r(86700),s=r(71017),a=r(17585);r(32727);const c=r(84974),u=r(58400),l=r(61684),h=r(18639),p=r(24708),d=r(20130),f=r(96524);let v=class extends f.TerminalCodeExecutionProvider{constructor(e,t,r,n,i,o,s,a,c){super(e,t,r,a,i,c),this.terminalTitle="Django Shell",a.push(new d.DjangoContextInitializer(n,r,s,o))}async getExecutableInfo(e,t=[]){const r=await super.getExecutableInfo(e,t),n=e?this.workspace.getWorkspaceFolder(e):void 0,i=Array.isArray(this.workspace.workspaceFolders)&&this.workspace.workspaceFolders.length>0?this.workspace.workspaceFolders[0].uri.fsPath:"",o=n?n.uri.fsPath:i,a=0===o.length?"manage.py":s.join(o,"manage.py");return(0,p.copyPythonExecInfo)(r,[a.fileToCommandArgumentForPythonExt(),"shell"])}async getExecuteFileArgs(e,t=[]){const r=await super.getExecutableInfo(e);return(0,p.copyPythonExecInfo)(r,t)}};v=n([(0,o.injectable)(),i(0,(0,o.inject)(u.ITerminalServiceFactory)),i(1,(0,o.inject)(l.IConfigurationService)),i(2,(0,o.inject)(a.IWorkspaceService)),i(3,(0,o.inject)(a.IDocumentManager)),i(4,(0,o.inject)(c.IPlatformService)),i(5,(0,o.inject)(a.ICommandManager)),i(6,(0,o.inject)(c.IFileSystem)),i(7,(0,o.inject)(l.IDisposableRegistry)),i(8,(0,o.inject)(h.IInterpreterService))],v),t.DjangoShellCodeExecutionProvider=v},50773:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CodeExecutionHelper=void 0,r(32727);const o=r(86700),s=r(66828),a=r(17585),c=r(77570),u=r(4057),l=r(29983),h=r(59314),p=r(18639),d=r(77498),f=r(19735);let v=class{constructor(e){this.documentManager=e.get(a.IDocumentManager),this.applicationShell=e.get(a.IApplicationShell),this.processServiceFactory=e.get(l.IProcessServiceFactory),this.interpreterService=e.get(p.IInterpreterService)}async normalizeLines(e,t){var r,n,i,o;try{if(0===e.trim().length)return"";e=e.replace(new RegExp("\\r","g"),"");const s=await this.interpreterService.getActiveInterpreter(t),a=await this.processServiceFactory.create(t),[c,l]=u.normalizeSelection(),p=a.execObservable((null==s?void 0:s.path)||"python",c,{throwOnStdErr:!0}),d=(0,h.createDeferred)();let f="";p.out.subscribe({next:e=>{"stdout"===e.source&&(f+=e.out)},complete:()=>{d.resolve(f)}});const v=JSON.stringify({code:e});null===(n=null===(r=p.proc)||void 0===r?void 0:r.stdin)||void 0===n||n.write(v),null===(o=null===(i=p.proc)||void 0===i?void 0:i.stdin)||void 0===o||o.end();const y=await d.promise;return l(JSON.parse(y).normalized)}catch(t){return(0,f.traceError)(t,"Python: Failed to normalize code for execution in terminal"),e}}async getFileToExecute(){const e=this.documentManager.activeTextEditor;if(e)if(e.document.isUntitled)this.applicationShell.showErrorMessage("The active file needs to be saved before it can be run");else{if(e.document.languageId===c.PYTHON_LANGUAGE)return e.document.isDirty&&await e.document.save(),e.document.uri;this.applicationShell.showErrorMessage("The active file is not a Python source file")}else this.applicationShell.showErrorMessage("No open file to run in terminal")}async getSelectedTextToExecute(e){if(!e)return;const{selection:t}=e;let r;return r=t.isEmpty?e.document.lineAt(t.start.line).text:t.isSingleLine?function(e){const{selection:t}=e,r=new s.Range(t.start,t.end),n=e.document.getText(r),i=e.document.lineAt(t.start.line).text;return n.trim()===i.trim()?i:n}(e):function(e){const{selection:t}=e,r=new s.Range(t.start,t.end),n=e.document.getText(r),i=new s.Range(new s.Position(t.start.line,0),new s.Position(t.end.line,e.document.lineAt(t.end.line).text.length)),o=e.document.getText(i);if(n.trim()===o.trim())return o;const a=e.document.lineAt(t.start.line).text,c=new s.Range(t.start,new s.Position(t.start.line,a.length)),u=e.document.getText(c);return u.trimLeft()===a.trimLeft()?a+n.substr(u.length):n}(e),r}async saveFileIfDirty(e){const t=this.documentManager.textDocuments.filter((t=>t.uri.path===e.path));1===t.length&&t[0].isDirty&&await t[0].save()}};v=n([(0,o.injectable)(),i(0,(0,o.inject)(d.IServiceContainer))],v),t.CodeExecutionHelper=v},80055:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReplProvider=void 0;const o=r(86700),s=r(17585),a=r(84974),c=r(58400),u=r(61684),l=r(18639),h=r(96524);let p=class extends h.TerminalCodeExecutionProvider{constructor(e,t,r,n,i,o){super(e,t,r,n,i,o),this.terminalTitle="REPL"}};p=n([(0,o.injectable)(),i(0,(0,o.inject)(c.ITerminalServiceFactory)),i(1,(0,o.inject)(u.IConfigurationService)),i(2,(0,o.inject)(s.IWorkspaceService)),i(3,(0,o.inject)(u.IDisposableRegistry)),i(4,(0,o.inject)(a.IPlatformService)),i(5,(0,o.inject)(l.IInterpreterService))],p),t.ReplProvider=p},96524:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},i=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalCodeExecutionProvider=void 0;const o=r(86700),s=r(71017),a=r(17585);r(32727);const c=r(84974),u=r(58400),l=r(61684),h=r(18639),p=r(24708);let d=class{constructor(e,t,r,n,i,o){this.terminalServiceFactory=e,this.configurationService=t,this.workspace=r,this.disposables=n,this.platformService=i,this.interpreterService=o,this.hasRanOutsideCurrentDrive=!1}async executeFile(e){await this.setCwdForFileExecution(e);const t=e.fsPath.fileToCommandArgumentForPythonExt(),{command:r,args:n}=await this.getExecuteFileArgs(e,[t]);await this.getTerminalService(e).sendCommand(r,n)}async execute(e,t){e&&0!==e.trim().length&&(await this.initializeRepl(),await this.getTerminalService(t).sendText(e))}async initializeRepl(e){this.replActive&&await this.replActive?await this._terminalService.show():(this.replActive=new Promise((async t=>{const r=await this.getExecutableInfo(e);await this.getTerminalService(e).sendCommand(r.command,r.args),setTimeout((()=>t(!0)),1e3)})),await this.replActive)}async getExecutableInfo(e,t=[]){var r;const n=this.configurationService.getSettings(e),i=await this.interpreterService.getActiveInterpreter(e),o=null!==(r=null==i?void 0:i.path)&&void 0!==r?r:n.pythonPath,s=this.platformService.isWindows?o.replace(/\\/g,"/"):o,a=n.terminal.launchArgs;return(0,p.buildPythonExecInfo)(s,[...a,...t])}async getExecuteFileArgs(e,t=[]){return this.getExecutableInfo(e,t)}getTerminalService(e){return this._terminalService||(this._terminalService=this.terminalServiceFactory.getTerminalService({resource:e,title:this.terminalTitle}),this.disposables.push(this._terminalService.onDidCloseTerminal((()=>{this.replActive=void 0})))),this._terminalService}async setCwdForFileExecution(e){if(!this.configurationService.getSettings(e).terminal.executeInFileDir)return;const t=s.dirname(e.fsPath);if(t.length>0){if(this.platformService.isWindows&&/[a-z]\:/i.test(t)){const r="string"==typeof this.workspace.rootPath?this.workspace.rootPath.replace(/\:.*/g,""):void 0,n=t.replace(/\:.*/g,"");(n!==r||this.hasRanOutsideCurrentDrive)&&(this.hasRanOutsideCurrentDrive=!0,await this.getTerminalService(e).sendText(`${n}:`))}await this.getTerminalService(e).sendText(`cd ${t.fileToCommandArgumentForPythonExt()}`)}}};d=n([(0,o.injectable)(),i(0,(0,o.inject)(u.ITerminalServiceFactory)),i(1,(0,o.inject)(l.IConfigurationService)),i(2,(0,o.inject)(a.IWorkspaceService)),i(3,(0,o.inject)(l.IDisposableRegistry)),i(4,(0,o.inject)(c.IPlatformService)),i(5,(0,o.inject)(h.IInterpreterService))],d),t.TerminalCodeExecutionProvider=d},73607:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const n=r(19645),i=r(80710),o=r(50773),s=r(80055),a=r(96524),c=r(43200);t.registerTypes=function(e){e.addSingleton(c.ICodeExecutionHelper,o.CodeExecutionHelper),e.addSingleton(c.ICodeExecutionManager,n.CodeExecutionManager),e.addSingleton(c.ICodeExecutionService,i.DjangoShellCodeExecutionProvider,"djangoShell"),e.addSingleton(c.ICodeExecutionService,a.TerminalCodeExecutionProvider,"standard"),e.addSingleton(c.ICodeExecutionService,s.ReplProvider,"repl")}},43200:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ICodeExecutionManager=t.ICodeExecutionHelper=t.ICodeExecutionService=void 0,t.ICodeExecutionService=Symbol("ICodeExecutionService"),t.ICodeExecutionHelper=Symbol("ICodeExecutionHelper"),t.ICodeExecutionManager=Symbol("ICodeExecutionManager")},80075:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canChangeActiveInterpreter=t.activate=void 0;const n=r(66828);function i(){return n.extensions.getExtension("ms-python.python")}t.activate=function(e){e.subscriptions.push(n.commands.registerCommand("python.envManager.setAsActiveInterpreter",(async({env:e})=>{if(!Array.isArray(n.workspace.workspaceFolders)||0===n.workspace.workspaceFolders.length)return;const t=i();(null==t?void 0:t.isActive)||await(null==t?void 0:t.activate());const r=1===n.workspace.workspaceFolders.length?n.workspace.workspaceFolders[0]:await n.window.showWorkspaceFolderPick({placeHolder:"Select folder to change active Python Environment"});r&&(null==t||t.exports.environment.setActiveEnvironment(e.path,r.uri))})))},t.canChangeActiveInterpreter=function(){return i()&&Array.isArray(n.workspace.workspaceFolders)&&n.workspace.workspaceFolders.length>0}},9526:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearCacheIfNewVersionInstalled=t.EnvironmentsCacheMementoKey=void 0;const n=r(66828),i="LAST_EXTENSION_VERSION";t.EnvironmentsCacheMementoKey="PYTHON:PACKAGE_MANAGER:ENVS_CACHE";let o=!1;t.clearCacheIfNewVersionInstalled=async function(e,r=!1){var s,a;if(e.extensionMode!==n.ExtensionMode.Development&&(o||e.globalState.get(i,"")===(null===(a=null===(s=e.extension)||void 0===s?void 0:s.packageJSON)||void 0===a?void 0:a.version)))return;o=!0;let c=[];r||(c=e.globalState.get(t.EnvironmentsCacheMementoKey,[])),await Promise.all([n.commands.executeCommand("python.envManager.clearPersistentStorage"),e.globalState.keys().filter((e=>e!==i)).map((t=>e.globalState.update(t,void 0))),e.workspaceState.keys().map((t=>e.workspaceState.update(t,void 0)))]),await e.globalState.update(i,e.extension.packageJSON.version),!r&&Array.isArray(c)&&await e.globalState.update(t.EnvironmentsCacheMementoKey,c)}},86905:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateEnvironmentsTxt=t.createEnv=t.getPyEnvVersion=t.getCondaVersion=t.deleteEnv=t.getCondaPackages=t.getPipPackages=t.getPackages=void 0;const n=r(55674),i=r(71017),o=r(22037),s=r(66828),a=r(13706),c=r(18699),u=r(22207),l=r(87450),h=r(19735),p=r(75470),d=r(77826),f=r(37769),v=r(81387),y=r(96645),m=r(92230);async function g(e){if(e.envType===v.EnvironmentType.Conda)return;const t=await(0,f.exec)(e.path,["-m","pip","list","--format","json"],{timeout:6e4});return(0,h.traceVerbose)(`python -m pip list --format --json: ${t.stdout}`),t.stdout.trim()?JSON.parse(t.stdout):[]}async function b(e){if(e.envType!==v.EnvironmentType.Conda||!e.envName&&!e.envPath)return;const t=await p.Conda.getConda();if(!t)return;const r=e.envName?["list","-n",e.envName]:["list","-p",e.envPath],n=await(0,f.exec)(t.command,r.concat(["--json"]),{timeout:6e4}),i=n.stdout.trim();return(0,h.traceVerbose)(`conda info --json: ${n.stdout}`),i?JSON.parse(n.stdout):[]}async function _(e){const t=i.join((0,l.getUserHomeDir)()||y.home,".conda","environments.txt"),r=await n.readFile(t,"utf-8");r.includes(e)||await n.writeFile(t,`${r.trim()}${o.EOL}${e}${o.EOL}`)}t.getPackages=async function(e){try{const[t,r]=await Promise.all([g(e),b(e)]),n=new Map;return(t||[]).forEach((e=>n.set(e.name,e))),(r||[]).forEach((e=>n.set(e.name,e))),Array.from(n.values()).sort(((e,t)=>e.name.toLocaleLowerCase().localeCompare(t.name.toLocaleLowerCase())))}catch(t){return(0,h.traceError)(`Failed to get package information for ${e.displayName})`,t),[]}},t.getPipPackages=g,t.getCondaPackages=b,t.deleteEnv=async function(e,t){if(e.envType!==v.EnvironmentType.Conda||!e.envName&&!e.envPath)return void(0,h.traceError)(`Cannot delete as its not a conda environment or no name/path for ${(0,y.getEnvLoggingInfo)(e)}`);const r=await p.Conda.getConda();if(!r)return;const i=e.envName?["-n",e.envName]:["-p",e.envPath],o=`Deleting conda environment ${(0,y.getEnvLoggingInfo)(e)} with command ${[r.command,"env","remove"].concat(i).join(" ")}`;(0,h.traceVerbose)(o),t.report({message:o});const s=await(0,c.execObservable)(r.command,["env","remove"].concat(i),{timeout:6e4});if(await new Promise((e=>{s.out.subscribe({next:e=>t.report({message:e.out}),complete:()=>e()})})),e.envName&&e.path&&await n.pathExists(e.envPath||e.path))throw new Error(`Failed to delete conda environment ${(0,y.getEnvDisplayInfo)(e)}, folder still exists ${(0,y.getDisplayPath)(e.envPath||e.path)} `)},t.getCondaVersion=async function(){const e=await p.Conda.getConda();if(e)return e.getInfo().catch((e=>(0,h.traceError)("Failed to get conda info",e)))},t.getPyEnvVersion=async function(){const e=(0,d.getPyenvDir)(),t=i.join(e,"CHANGELOG.md");try{if(await n.pathExists(t)){const e=await n.readFile(t,"utf-8"),r=e.indexOf("## Release ");if(-1===r)return void(0,h.traceError)(`Failed to identify pyenv version from ${t}, with text ${e.substring(0,100)} `);const i=r+"## Release ".length,o=e.substring(i,i+20).splitLines().map((e=>e.trim())).filter((e=>e.length));return 0===o.length?"":o[0]}}catch(e){(0,h.traceError)("Failed to get pyenv version",e)}},t.createEnv=async function(e,t){const r=await p.Conda.getConda();if(!r)return void(0,h.traceError)("Conda not found");const n={name:""},o=function(e){let t=3,r=9;return e.filter((e=>e.envType===v.EnvironmentType.Conda)).forEach((e=>{var n,i,o,s,a,c,u;!(null===(n=e.version)||void 0===n?void 0:n.major)||(null===(i=e.version)||void 0===i?void 0:i.major)t?(t=null===(s=e.version)||void 0===s?void 0:s.major,r=null===(a=e.version)||void 0===a?void 0:a.minor):(null===(c=e.version)||void 0===c?void 0:c.minor)>r&&(r=null===(u=e.version)||void 0===u?void 0:u.minor))})),`${t}.${r}`}(e),l=new u.MultiStepInput(new a.ApplicationShell);await l.run((async(e,t)=>{const r=await e.showInputBox({title:"Enter the name of the virtual environment",value:".venv",step:1,totalSteps:3,prompt:"Name",validate:async e=>{if(!e)return"Enter a name"}});if(r)return t.name=r.trim(),(async(e,t)=>{const r=await e.showInputBox({title:"Select Python Version",validate:async e=>{if(!e.trim().length)return"Enter a Python version such as 3.9"},placeholder:"3.7, 3.8, 3.9, 3.10, etc",prompt:"Python Version",value:o});t.pythonVersion=null==r?void 0:r.trim()})(e,t)}),n),n.name.trim()&&n.pythonVersion&&await s.window.withProgress({location:s.ProgressLocation.Notification,cancellable:!0,title:`Creating environment '${n.name.trim()}'`},(async(e,o)=>{await async function(e,t,r,n,o,a="3.9"){var u;try{const s=n.includes(".micromamba");e.report({message:`Creating environment ${r}`}),(0,h.traceInfo)(`Creating conda environment ${r} with python version ${a}`);const l=s?["-c","conda-forge"]:[],p=["create","-n",`${r.trim()}`,`python=${a||"3.9"}`].concat(l).concat(["-y"]);(0,h.traceInfo)([n].concat(p).join(" "));const d=await(0,c.execObservable)(n,p,{timeout:12e4,token:t});null===(u=d.proc)||void 0===u||u.on("error",(e=>console.error("Conda create exited with an error",e))),await new Promise(((t,r)=>{d.out.subscribe({next:t=>{t.out.trim().length&&e.report({message:t.out}),(0,h.traceInfo)(t.out)},complete:()=>t(),error:e=>r(e)})})),s&&await _(i.join(m.MICROMAMBA_ROOTPREFIX,r.trim())).catch((e=>(0,h.traceError)("Failed to update environments.txt",e))),e.report({message:"Waiting for environment to be detected"}),await o({name:r,type:v.EnvironmentType.Conda})}catch(e){(0,h.traceError)("Failed to create environment",e),s.window.showErrorMessage(`Failed to create environment ${r}, ${e.toString()}`)}}(e,o,n.name.trim(),r.command,t,n.pythonVersion)}))},t.updateEnvironmentsTxt=_},74533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activate=void 0;const n=r(66828),i=r(19735),o=r(81387),s=r(96645),a=r(12832),c=r(86905),u=r(5976);t.activate=function(e){e.subscriptions.push(n.commands.registerCommand("python.envManager.create",(async e=>{if((0,s.canEnvBeCreated)(e))switch(e){case o.EnvironmentType.Conda:return(0,c.createEnv)(u.PythonEnvironmentTreeDataProvider.environments,u.refreshUntilNewEnvIsAvailable);case o.EnvironmentType.Venv:return(0,a.createEnv)(u.PythonEnvironmentTreeDataProvider.environments)}else(0,i.traceError)(`Environment '${e}' cannot be created`)})))}},49489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activate=void 0;const n=r(66828),i=r(19735),o=r(81387),s=r(96645),a=r(86905),c=r(12832);t.activate=function(e){e.subscriptions.push(n.commands.registerCommand("python.envManager.delete",(async({env:e})=>{if(!(0,s.canEnvBeDeleted)(e.envType))return void(0,i.traceError)(`Environment '${(0,s.getEnvLoggingInfo)(e)}' cannot be deleted`);const t=`Are you sure you want to delete the environment '${(0,s.getEnvDisplayInfo)(e)}'?`,r=`This will result in deleting the folder '${(0,s.getDisplayPath)(e.envPath||e.path)}'.`;if("Yes"===await n.window.showInformationMessage(t,{modal:!0,detail:r},"Yes"))try{await n.window.withProgress({location:n.ProgressLocation.Notification,title:`Deleting environment ${(0,s.getEnvDisplayInfo)(e)}`},(async(t,r)=>e.envType===o.EnvironmentType.Conda?(0,a.deleteEnv)(e,t):(0,c.deleteEnv)(e))),n.commands.executeCommand("python.envManager.refresh")}catch(t){(0,i.traceError)(`Failed to delete environment ${(0,s.getEnvLoggingInfo)(e)}`,t),n.window.showErrorMessage(`Failed to delete environment ${(0,s.getEnvDisplayInfo)(e)}, ${t.toString()}`)}})))}},96645:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvDisplayInfo=t.getEnvLoggingInfo=t.canEnvBeCreated=t.canEnvBeDeleted=t.createTempFile=t.getEnvironmentTypeName=t.getDisplayPath=t.getEnvironmentId=t.home=void 0;const n=r(66828),i=r(71017),o=r(36276),s=r(81387),a=r(58967);function c(e){return e?(e=n.workspace.asRelativePath(e,!1)).startsWith(t.home)?`~${i.sep}${i.relative(t.home,e)}`:e:""}t.home=a("~"),t.getEnvironmentId=function(e){return e.envType===s.EnvironmentType.Conda?`${e.envPath}:${e.path}`:`${e.envName}:${e.path}`},t.getDisplayPath=c,t.getEnvironmentTypeName=function(e){return e.toString()},t.createTempFile=function(e=".txt"){return new Promise(((t,r)=>{o.file({postfix:e},((e,n,i,o)=>{if(e)return r(e);t({filePath:n,dispose:o})}))}))},t.canEnvBeDeleted=function(e){switch(e){case s.EnvironmentType.Conda:case s.EnvironmentType.Venv:case s.EnvironmentType.VirtualEnv:case s.EnvironmentType.VirtualEnvWrapper:return!0;case s.EnvironmentType.Pipenv:case s.EnvironmentType.Poetry:case s.EnvironmentType.Pyenv:case s.EnvironmentType.System:case s.EnvironmentType.Unknown:case s.EnvironmentType.WindowsStore:default:return!1}},t.canEnvBeCreated=function(e){switch(e){case s.EnvironmentType.Conda:case s.EnvironmentType.Venv:return!0;case s.EnvironmentType.VirtualEnv:case s.EnvironmentType.VirtualEnvWrapper:case s.EnvironmentType.Pipenv:case s.EnvironmentType.Poetry:case s.EnvironmentType.Pyenv:case s.EnvironmentType.System:case s.EnvironmentType.Unknown:case s.EnvironmentType.WindowsStore:default:return!1}},t.getEnvLoggingInfo=function(e){return`${e.envType}:(${e.displayName||e.envName},${c(e.envPath||e.path)})`},t.getEnvDisplayInfo=function(e){return e.displayName||e.envName||c(e.envPath)||c(e.path)}},40078:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activate=void 0;const n=r(55674),i=r(66828),o=r(3481),s=r(86905),a=r(96645),c=r(92230),u=r(83916),l=r(5976);async function h(){const[e,t]=await Promise.all([(0,s.getCondaVersion)().catch(o.noop),n.pathExists(c.MICROMAMBA_EXE)]);i.commands.executeCommand("setContext","python.envManager.pythonIsNotInstalled",!t&&!e)}t.activate=function(e){e.subscriptions.push(i.commands.registerCommand("python.envManager.installPython",(async()=>{if(await n.pathExists(c.MICROMAMBA_EXE)){const e=[`Python is already setup via Micromamba. Please use Micromamba found here ${(0,a.getDisplayPath)(c.MICROMAMBA_EXE)}.`,`If it does not worker, then initialize your shell using the command '${(0,a.getDisplayPath)(c.MICROMAMBA_EXE)} shell init -s bash|zsh|cmd.exe|powershell|fish|xonsh -p ~/micromamba'.`];return void i.window.showInformationMessage(e.join(" \n"))}const e="More info",t=`Micromamba will downloaded into ${(0,a.getDisplayPath)(c.MICROMAMBA_DIR)} \n& Shell scripts will be updated to put Micromamba into the current path.`;switch(await i.window.showInformationMessage("Do you want to download and setup Python via Micromamba?",{modal:!0,detail:t},"Yes",e)){case e:i.env.openExternal(i.Uri.parse("https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html"));break;case"Yes":await(0,u.installMicromamba)(l.refreshUntilNewEnvIsAvailable),await h()}}))),h()}},21511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBaseEnv=void 0;const n=r(55674),i=r(66828),o=r(18699),s=r(19735),a=r(81387),c=r(86905),u=r(92230);t.createBaseEnv=async function(e,t,r,l="3.9"){var h;try{e.report({message:`Creating Python ${l} environment`}),(0,s.traceInfo)(`Creating environment with Python ${l}`);const i=["install",`python=${l||"3.9"}`,"conda","-c","conda-forge","-y","-p",u.MICROMAMBA_ROOTPREFIX];(0,s.traceInfo)([u.MICROMAMBA_EXE].concat(i).join(" "));const p=await(0,o.execObservable)(u.MICROMAMBA_EXE,i,{timeout:12e4,token:t,shell:!0,env:{...process.env,TARGET_PREFIX:u.MICROMAMBA_ROOTPREFIX,ROOT_PREFIX:u.MICROMAMBA_ROOTPREFIX,MAMBA_ROOT_PREFIX:u.MICROMAMBA_ROOTPREFIX,MAMBA_EXE:u.MICROMAMBA_EXE}});if(null===(h=p.proc)||void 0===h||h.on("error",(e=>console.error("Conda create exited with an error",e))),await new Promise(((t,r)=>{p.out.subscribe({next:t=>{t.out.trim().length&&e.report({message:t.out}),(0,s.traceInfo)(t.out)},complete:()=>t(),error:e=>r(e)})})),!await n.pathExists(u.BASE_MICROMAMBA_PYTHON_EXE))throw new Error(`Please try running the following command in the terminal "${[u.MICROMAMBA_EXE].concat(i).join(" ")}"`);await(0,c.updateEnvironmentsTxt)(u.MICROMAMBA_ROOTPREFIX).catch((e=>(0,s.traceError)("Failed to update environments.txt",e))),e.report({message:"Waiting for environment to be detected"}),await r({path:u.BASE_MICROMAMBA_PYTHON_EXE,type:a.EnvironmentType.Conda})}catch(e){(0,s.traceError)("Failed to create environment",e),i.window.showErrorMessage(`Failed to create environment ${u.MICROMAMBA_ROOTPREFIX}, ${e.toString()}`)}}},92230:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BASE_MICROMAMBA_PYTHON_EXE=t.MICROMAMBA_EXE=t.CONDA_EXE=t.MICROMAMBA_BASE_ENV_NAME=t.MICROMAMBA_DIR=t.MICROMAMBA_ROOTPREFIX=void 0;const n=r(71017),i=r(87450),o=r(96645);t.MICROMAMBA_ROOTPREFIX=n.join((0,i.getUserHomeDir)()||o.home,"micromamba"),t.MICROMAMBA_DIR=n.join((0,i.getUserHomeDir)()||o.home,".micromamba"),t.MICROMAMBA_BASE_ENV_NAME="micromambaBase",t.CONDA_EXE=n.join(t.MICROMAMBA_ROOTPREFIX,"condabin",(0,i.getOSType)()===i.OSType.Windows?"conda.exe":"conda"),t.MICROMAMBA_EXE=n.join(t.MICROMAMBA_DIR,"bin",(0,i.getOSType)()===i.OSType.Windows?"micromamba.exe":"micromamba"),t.BASE_MICROMAMBA_PYTHON_EXE=n.join(t.MICROMAMBA_ROOTPREFIX,(0,i.getOSType)()===i.OSType.Windows?"Scripts":"bin",(0,i.getOSType)()===i.OSType.Windows?"python.exe":"python")},64091:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMicroMambaInstalled=t.downloadMamba=t.activate=void 0;const n=r(55674),i=r(97998),o=r(48663),s=r(87450),a=r(92230),c=r(38218),u=r(95095);function l(){switch((0,s.getOSType)()){case s.OSType.Windows:return"https://micro.mamba.pm/api/micromamba/win-64/latest";case s.OSType.OSX:return"arm64"===process.arch?"https://micro.mamba.pm/api/micromamba/osx-arm64/latest":"https://micro.mamba.pm/api/micromamba/osx-64/latest";case s.OSType.Linux:default:return"https://micro.mamba.pm/api/micromamba/linux-64/latest"}}async function h(){return await n.ensureDir(a.MICROMAMBA_DIR),a.MICROMAMBA_DIR}t.activate=function(e){};const p=1048576;t.downloadMamba=async function(e,t){const[r,n]=await Promise.all([l(),h()]);return await new Promise(((s,a)=>{const l=o(r);t.onCancellationRequested((()=>{l.abort()})),u(l,{}).on("progress",(t=>{var r;const n=`Downloading Micromamba ${(100*t.percent).toFixed(0)}% (${(t.size.transferred/p).toFixed(2)} of ${(t.size.total/p).toFixed(2)}MB).`,i=(null===(r=t.time)||void 0===r?void 0:r.remaining)?` \nRemaining ${t.time.remaining.toFixed(0)}s`:"";e.report({message:`${n}${i}`}),console.log("progress",t)})).on("error",(e=>a(e))).pipe(c()).pipe(i.extract({cwd:n})).on("error",(e=>a(e))).on("end",(()=>s()))})),n},t.isMicroMambaInstalled=async function(){return n.pathExists(a.MICROMAMBA_EXE)}},83916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.installMicromamba=void 0;const n=r(55674),i=r(66828),o=r(19735),s=r(92230),a=r(21511),c=r(30675),u=r(64091);t.installMicromamba=async function(e){await n.pathExists(s.MICROMAMBA_EXE)||await i.window.withProgress({location:i.ProgressLocation.Notification,cancellable:!0,title:"Setting up Python"},(async(t,r)=>{try{await(0,u.downloadMamba)(t,r),t.report({message:"Configuring Micromamba Shells"}),await(0,c.initializeMicromambaShells)(),await(0,a.createBaseEnv)(t,r,e),t.report({message:"Configuring Conda Shells"}),await(0,c.initializeCondaShells)(),t.report({message:"Updating user .vscode settings"}),await async function(){var e,t;const r=i.workspace.getConfiguration("python",void 0);(null===(e=r.inspect("condaPath"))||void 0===e?void 0:e.globalValue)||(null===(t=r.inspect("condaPath"))||void 0===t?void 0:t.globalValue)||r.update("condaPath",s.CONDA_EXE,i.ConfigurationTarget.Global)}()}catch(e){(0,o.traceError)("Failed to create Python environment"),i.window.showErrorMessage(`Failed to setup Python, see logs for more information. \n ${e.toString()}`)}})),(0,o.traceInfo)(`Mamba file loaded at ${s.MICROMAMBA_EXE}`)}},30675:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeCondaShells=t.initializeMicromambaShells=void 0;const n=r(87450),i=r(37769);r(32727);const o=r(92230);t.initializeMicromambaShells=async function(){if((0,n.getOSType)()===n.OSType.Windows)await Promise.all([(0,i.exec)(o.MICROMAMBA_EXE,["shell","init","-s","cmd.exe","-p",o.MICROMAMBA_ROOTPREFIX.fileToCommandArgumentForPythonExt()]),(0,i.exec)(o.MICROMAMBA_EXE,["shell","init","-s","powershell","-p",o.MICROMAMBA_ROOTPREFIX.fileToCommandArgumentForPythonExt()])]);else{const e=await Promise.all([(0,i.exec)(o.MICROMAMBA_EXE,["shell","init","-s","bash","-p",o.MICROMAMBA_ROOTPREFIX.fileToCommandArgumentForPythonExt()]),(0,i.exec)(o.MICROMAMBA_EXE,["shell","init","-s","fish","-p",o.MICROMAMBA_ROOTPREFIX.fileToCommandArgumentForPythonExt()]),(0,i.exec)(o.MICROMAMBA_EXE,["shell","init","-s","xonsh","-p",o.MICROMAMBA_ROOTPREFIX.fileToCommandArgumentForPythonExt()]),(0,i.exec)(o.MICROMAMBA_EXE,["shell","init","-s","zsh","-p",o.MICROMAMBA_ROOTPREFIX.fileToCommandArgumentForPythonExt()])]);console.log(e)}},t.initializeCondaShells=async function(){const e=await(0,i.exec)(o.CONDA_EXE,["init","--all"],{shell:!0});console.log(e)}},10145:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const n=r(66828),i=r(6184),o=r(64091),s=r(40078),a=r(49489),c=r(74533),u=r(80075),l=r(11599),h=r(5976),p=r(18639);t.registerTypes=function(e,t){const r=new h.PythonEnvironmentTreeDataProvider(e.get(p.IInterpreterService),t);t.subscriptions.push(r),t.subscriptions.push(n.commands.registerCommand("python.envManager.refresh",(()=>r.refresh(!0)))),n.window.createTreeView("pythonEnvironments",{treeDataProvider:r}),l.PackagesViewProvider.register(t),(0,i.activate)(t,e),(0,o.activate)(t),(0,s.activate)(t),(0,c.activate)(t),(0,a.activate)(t),(0,u.activate)(t)}},6184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getActivatedEnvVariables=t.activate=void 0;const n=r(66828),i=r(71017),o=r(55674),s=r(82818),a=r(58400),c=r(59314),u=r(48266),l=r(70057),h=r(90209),p=r(96645),d=r(19735),f=new Map;async function v(e,t,r=""){if(f.has(r))return f.get(r);const n=await(0,p.createTempFile)(),i=function(e,t){switch(e){case a.TerminalShellType.commandPrompt:return{command:`set > "${t}"`,parser:e=>{const t={};return e.split(/\r?\n/).forEach((e=>{if(-1===e.indexOf("="))return;const r=e.substring(0,e.indexOf("=")).trim(),n=e.substring(e.indexOf("=")+1).trim();t[r]=n})),t}};case a.TerminalShellType.powershell:case a.TerminalShellType.powershellCore:return{command:`Get-ChildItem env: | Out-File "${t}"`,parser:e=>{const t={};let r=!1;return e.split(/\r?\n/).forEach((e=>{if(e.startsWith("----"))return void(r=!0);if(!r)return;const n=e.substring(0,e.indexOf(" ")).trim(),i=e.substring(e.indexOf(" ")+1).trim();t[n]=i})),t}};default:{const e=e=>{const t={};return e.split(/\r?\n/).forEach((e=>{if(-1===e.indexOf("="))return;const r=e.substring(0,e.indexOf("=")).trim(),n=e.substring(e.indexOf("=")+1).trim();t[r]=n})),t};return{command:`printenv > "${t.replace(/\\/g,"/")}"`,parser:e}}}}(t,n.filePath);try{e.sendText(i.command);const t=new l.StopWatch;for(;t.elapsedTime<5e3&&!await o.pathExists(n.filePath);)await(0,c.sleep)(100);if(await o.pathExists(n.filePath)){const e=await o.readFile(n.filePath,"utf8"),t=i.parser(e);return f.set(r,t),t}return void(0,d.traceError)(`Env vars file not created command ${i.command}`)}catch(e){return void(0,d.traceError)(`Env vars file not created command ${i.command}`,e)}finally{n.dispose()}}async function y(e,t,r){const n=(0,h.getHashString)(t),s=function(e,t){switch(e){case a.TerminalShellType.commandPrompt:case a.TerminalShellType.powershell:case a.TerminalShellType.powershellCore:return{python:`\n@ECHO off\n"${t}" %*\n`,pip:`\n@ECHO off\n"${t}" -m pip %*\n`,extension:".cmd"};default:return{python:`#!/usr/bin/env bash\n"${t}" "$@"\nret=$?\nexit $ret\n`,pip:`#!/usr/bin/env bash\n"${t}" -m pip "$@"\nret=$?\nexit $ret\n`,extension:""}}}(e,t),c=i.join(r.globalStorageUri.fsPath,"symlinksV1",`python_${n}`),u=i.join(c,`python${s.extension}`),l=i.join(c,`pip${s.extension}`);return await o.pathExists(u)||(await o.ensureDir(c),await Promise.all([o.writeFile(u,s.python),o.writeFile(l,s.pip)]),await Promise.all([o.chmod(u,511),o.chmod(l,511)])),c}t.activate=function(e,t){n.workspace.onDidChangeConfiguration((()=>{f.clear()}),void 0,e.subscriptions),e.subscriptions.push(n.commands.registerCommand("python.envManager.openInTerminal",(async r=>{const o=t.get(a.ITerminalHelper),u=await async function(){if(n.workspace.workspaceFolders&&0!==n.workspace.workspaceFolders.length)return 1===n.workspace.workspaceFolders.length?n.workspace.workspaceFolders[0].uri:n.window.showWorkspaceFolderPick({placeHolder:"Select cwd for terminal"}).then((e=>null==e?void 0:e.uri))}(),l=r.env.envName?`Python ${r.env.envName}`:r.env.displayName;let h=n.window.createTerminal({hideFromUser:!0,name:l,cwd:u});const p=o.identifyTerminalShell(h),d=await o.getEnvironmentActivationCommands(p,u,r.env);if(Array.isArray(d)&&d.length>0){h.show(!1);for(const e of d||[])h.sendText(e),d.length>1&&await(0,c.sleep)(1e3)}else{if(s){const t=await async function(e,t,r){const n=await y(e,t,r);switch(e){case a.TerminalShellType.commandPrompt:case a.TerminalShellType.powershell:case a.TerminalShellType.powershellCore:return;default:return`export "PATH=${n}${i.delimiter}$PATH" && clear`}}(p,r.env.path,e);return h.dispose(),h=n.window.createTerminal({hideFromUser:!0,name:l,cwd:u}),t&&(h.sendText(t),await(0,c.sleep)(1e3)),void h.show(!1)}try{const[t,o]=await Promise.all([v(h,p,null==u?void 0:u.fsPath),y(p,r.env.path,e)]);h.dispose();const s={...t};["Path","PATH"].forEach((e=>{"string"==typeof s[e]&&(s[e]=`${o}${i.delimiter}${s[e]}`)})),n.window.createTerminal({hideFromUser:!1,name:l,cwd:u,env:s,strictEnv:!0}).show(!1)}catch(e){console.error(`Failed to create terminal for ${r.env.envType}:${r.env.path}`,e)}}})))};const m=new Map;t.getActivatedEnvVariables=async function(e,t,r,n){if(m.has(n))return m.get(n);const s=(async()=>{const s=await(0,p.createTempFile)();s.dispose();const a=e.buildCommandForTerminal(t,n,[i.join(u._SCRIPTS_DIR,"printEnvVariablesToFile.py"),s.filePath]);r.sendText(a);const h=new l.StopWatch;for(;h.elapsedTime<5e3&&!await o.pathExists(s.filePath);)await(0,c.sleep)(100);if(!await o.pathExists(s.filePath))throw new Error(`Failed to generate env vars for ${n}, with command ${a}`);try{return JSON.parse(await o.readFile(s.filePath,"utf8"))}catch(e){throw console.error(`Failed to parse activated env vars for ${n}, with command ${a}`,e),new Error(`Failed to parse activated env vars for ${n}, with command ${a}`)}})();return m.set(n,s),s.finally((()=>m.delete(n))),s}},12832:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEnv=t.canCreateVirtualEnv=t.deleteEnv=void 0;const n=r(55674),i=r(71017),o=r(66828),s=r(13706),a=r(18699),c=r(22207),u=r(19735),l=r(81387),h=r(96645);function p(e){return e.filter((e=>{switch(e.envType){case l.EnvironmentType.Global:case l.EnvironmentType.System:case l.EnvironmentType.Venv:case l.EnvironmentType.VirtualEnv:case l.EnvironmentType.VirtualEnvWrapper:case l.EnvironmentType.WindowsStore:return!0;default:return!1}})).sort(((e,t)=>{const r=e.version,n=t.version;return r&&n?r.major===n.major?r.minor===n.minor?r.patch===n.patch?0:r.patch>n.patch?-1:1:r.minor>n.minor?-1:1:r.major>n.major?-1:1:r&&!n?1:!r&&n?-1:0}))}t.deleteEnv=async function(e){if(e.envType!==l.EnvironmentType.Venv&&e.envType!==l.EnvironmentType.VirtualEnv&&e.envType!==l.EnvironmentType.VirtualEnvWrapper)return void(0,u.traceError)(`Cannot delete as its not a virtual environment ${(0,h.getEnvLoggingInfo)(e)}`);const t=i.dirname(e.path);if(!t.toLowerCase().endsWith("scripts")&&!t.toLowerCase().endsWith("bin"))return void(0,u.traceError)(`Cannot delete as its not a virtual environment with script/bin directory ${(0,h.getEnvLoggingInfo)(e)}`);const r=e.envPath||i.dirname(i.dirname(e.path));(0,u.traceVerbose)(`Deleting virtual environment ${(0,h.getEnvLoggingInfo)(e)}`),await n.remove(r)},t.canCreateVirtualEnv=function(e){return p(e).length},t.createEnv=async function(e){var t;const r=p(e);if(0===r.length)return void(0,u.traceError)("Cannot create a venv without an existing Python environment");const d=r.filter((e=>e.envType===l.EnvironmentType.Global)),f=(null===(t=o.workspace.workspaceFolders)||void 0===t?void 0:t.length)?o.workspace.workspaceFolders[0].uri:void 0,v=d.length?d[0]:r[0],y={dir:"",name:"",templateEnvironment:void 0},m=async(e,t)=>{const n=r.map((e=>({label:(0,h.getEnvDisplayInfo)(e),pythonEnvironment:e,picked:e===v,description:(0,h.getDisplayPath)(e.envPath||e.path)}))),i=await e.showQuickPick({title:"Select Python Environment to be used as a template for Virtual Environment",placeholder:"Select Python Environment",acceptFilterBoxTextAsSelection:!1,canGoBack:!1,matchOnDescription:!0,matchOnDetail:!0,sortByLabel:!1,step:3,totalSteps:3,items:n});t.templateEnvironment=null==i?void 0:i.pythonEnvironment},g=new c.MultiStepInput(new s.ApplicationShell);if(await g.run((async(e,t)=>{const r=await e.showInputBox({title:"Enter the name of the virtual environment",value:".venv",step:1,totalSteps:3,prompt:"Name",validate:async e=>{if(!e)return"Enter a name"}});if(r)return t.name=r.trim(),(async(e,t)=>{const r={iconPath:new o.ThemeIcon("folder"),tooltip:"Select a folder"};let s=!0;for(;s;){const a=()=>e.showInputBox({title:"Enter fully qualified path to where the venv would be created",value:(null==f?void 0:f.fsPath)||"",step:2,totalSteps:3,prompt:"Directory",validate:async e=>{if(!e&&!f)return"Please specify a directory or click the browse button";if(!e)return"Enter a name";if(!await n.pathExists(e))return"Invalid directory";const r=i.join(e,t.name);return await n.pathExists(r)?`Virtual folder '${(0,h.getDisplayPath)(r)}' already exists`:void 0},buttons:[r]}),c=await a();if(c===r){const r=await o.window.showOpenDialog({canSelectFiles:!1,canSelectFolders:!0,canSelectMany:!1,defaultUri:f,openLabel:"Select Folder",title:"Select destination for Virtual Environment"});if(Array.isArray(r)&&r.length){const a=i.join(r[0].fsPath,t.name);if(!await n.pathExists(a))return t.dir=r[0].fsPath,s=!1,m(e,t);o.window.showErrorMessage("A folder with the same name already exists",{modal:!0,detail:a})}}else if("string"==typeof c){s=!1;const r=i.join(c.trim(),t.name);if(await n.pathExists(c.trim())){if(!await n.pathExists(r))return t.dir=c.trim(),s=!1,m(e,t);o.window.showErrorMessage("A folder with the same name already exists",{modal:!0,detail:r})}else o.window.showErrorMessage("Invalid target directory for a Virtual Environment",{modal:!0,detail:c})}else s=!1}})(e,t)}),y),y.dir.trim()&&y.name.trim()&&y.templateEnvironment&&await n.pathExists(y.dir)&&!await n.pathExists(i.join(y.dir,y.name)))try{await o.window.withProgress({location:o.ProgressLocation.Notification,title:`Creating environment ${y.name}`,cancellable:!0},(async(e,t)=>{(0,u.traceInfo)(`Creating environment ${y.name}`),(0,u.traceInfo)([y.templateEnvironment.path,"-m","venv",y.name].join(" "));const r=await(0,a.execObservable)(y.templateEnvironment.path,["-m","venv",y.name],{timeout:6e4,cwd:y.dir,token:t});await new Promise((t=>{r.out.subscribe({next:t=>{(0,u.traceInfo)(t.out),e.report({message:t.out})},complete:()=>t()})}))})),o.commands.executeCommand("python.envManager.refresh")}catch(e){(0,u.traceError)("Failed to create environment",e),o.window.showErrorMessage(`Failed to create environment ${y.name}, ${e.toString()}`)}}},11599:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PackagesViewProvider=void 0;const n=r(66828);class i{constructor(e){this._extensionUri=e,i.instance=this}static register(e){const t=new i(e.extensionUri);e.subscriptions.push(n.window.registerWebviewViewProvider(i.viewType,t))}resolveWebviewView(e,t,r){this._view=e,e.webview.options={enableScripts:!0,localResourceRoots:[this._extensionUri]},e.webview.html=this._getHtmlForWebview(e.webview),e.webview.onDidReceiveMessage((e=>{var t;"colorSelected"===e.type&&(null===(t=n.window.activeTextEditor)||void 0===t||t.insertSnippet(new n.SnippetString(`#${e.value}`)))}))}addColor(){var e,t;this._view&&(null===(t=(e=this._view).show)||void 0===t||t.call(e,!0),this._view.webview.postMessage({type:"addColor"}))}clearColors(){this._view&&this._view.webview.postMessage({type:"clearColors"})}_getHtmlForWebview(e){const t=e.asWebviewUri(n.Uri.joinPath(this._extensionUri,"media","main.js")),r=e.asWebviewUri(n.Uri.joinPath(this._extensionUri,"media","reset.css")),i=e.asWebviewUri(n.Uri.joinPath(this._extensionUri,"media","vscode.css")),o=e.asWebviewUri(n.Uri.joinPath(this._extensionUri,"media","main.css")),s=function(){let e="";const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let r=0;r<32;r++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}();return`\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\x3c!--\n\t\t\t\t\tUse a content security policy to only allow loading images from https or from our extension directory,\n\t\t\t\t\tand only allow scripts that have a specific nonce.\n\t\t\t\t--\x3e\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tCat Colors\n\t\t\t\n\t\t\t\n\t\t\t\t
    \n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t