/*! For license information please see extension.js.LICENSE.txt */ (()=>{var __webpack_modules__={69145:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionActivationManager=void 0;const o=n(86700),s=n(77651),a=n(17585),c=n(77570),l=n(84974),u=n(61684),d=n(87282),p=n(19735),h=n(98634),f=n(90819);let g=class{constructor(e,t,n,r,i,o,s,a,c){this.activationServices=e,this.singleActivationServices=t,this.documentManager=n,this.autoSelection=r,this.appDiagnostics=i,this.workspaceService=o,this.fileSystem=s,this.activeResourceService=a,this.interpreterPathService=c,this.activatedWorkspaces=new Set,this.isInterpreterSetForWorkspacePromises=new Map,this.disposables=[]}filterServices(){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(e){this.filterServices(),await this.initialize(),await Promise.all([...this.singleActivationServices.map((e=>e.activate())),this.activateWorkspace(this.activeResourceService.getActiveResource(),e)])}async activateWorkspace(e,t){const n=this.workspaceService.getWorkspaceFolder(e);e=n?n.uri:void 0;const r=this.getWorkspaceKey(e);this.activatedWorkspaces.has(r)||(this.activatedWorkspaces.add(r),this.workspaceService.isTrusted&&(await this.autoSelection.autoSelectInterpreter(e),await this.interpreterPathService.copyOldInterpreterStorageValuesToNew(e)),await(0,h.sendActivationTelemetry)(this.fileSystem,this.workspaceService,e),await Promise.all(this.activationServices.map((n=>n.activate(e,t)))),await this.appDiagnostics.performPreStartupHealthCheck(e))}async initialize(){this.addHandlers(),this.addRemoveDocOpenedHandlers()}onDocOpened(e){var t;if(e.languageId!==c.PYTHON_LANGUAGE)return;const n=this.getWorkspaceKey(e.uri),r=((null===(t=this.workspaceService.workspaceFolders)||void 0===t?void 0:t.length)||0)>0;""===n&&r||this.activatedWorkspaces.has(n)||this.activateWorkspace(e.uri).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,"")}};r([(0,p.traceDecoratorError)("Failed to activate a workspace")],g.prototype,"activateWorkspace",null),g=r([(0,o.injectable)(),i(0,(0,o.multiInject)(f.IExtensionActivationService)),i(1,(0,o.multiInject)(f.IExtensionSingleActivationService)),i(2,(0,o.inject)(a.IDocumentManager)),i(3,(0,o.inject)(d.IInterpreterAutoSelectionService)),i(4,(0,o.inject)(s.IApplicationDiagnostics)),i(5,(0,o.inject)(a.IWorkspaceService)),i(6,(0,o.inject)(l.IFileSystem)),i(7,(0,o.inject)(a.IActiveResourceService)),i(8,(0,o.inject)(u.IInterpreterPathService))],g),t.ExtensionActivationManager=g},23826:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Commands=void 0,(t.Commands||(t.Commands={})).RestartLS="python.analysis.restartLanguageServer"},10464:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageServerAnalysisOptionsWithEnv=t.LanguageServerAnalysisOptionsBase=void 0;const i=n(66828),o=n(52847),s=n(77570),a=n(36952),c=n(19735);class l{constructor(e,t){this.workspace=t,this.didChange=new i.EventEmitter,this.output=e.channel}async initialize(e,t){}get onDidChange(){return this.didChange.event}dispose(){this.didChange.dispose()}async getAnalysisOptions(){const e=this.getWorkspaceFolder();return{documentSelector:this.getDocumentFilters(e),workspaceFolder:e,synchronize:{configurationSection:this.getConfigSectionsToSynchronize()},outputChannel:this.output,revealOutputChannelOn:o.RevealOutputChannelOn.Never,initializationOptions:await this.getInitializationOptions()}}getWorkspaceFolder(){}getDocumentFilters(e){return this.workspace.isVirtualWorkspace?[{language:s.PYTHON_LANGUAGE}]:s.PYTHON}getConfigSectionsToSynchronize(){return[s.PYTHON_LANGUAGE]}async getInitializationOptions(){}}r([(0,c.traceDecoratorError)("Failed to get analysis options")],l.prototype,"getAnalysisOptions",null),t.LanguageServerAnalysisOptionsBase=l;class u extends l{constructor(e,t,n){super(t,n),this.envVarsProvider=e,this.disposables=[],this.envPythonPath=""}async initialize(e,t){const n=this.envVarsProvider.onDidEnvironmentVariablesChange(this.onEnvVarChange,this);this.disposables.push(n)}dispose(){super.dispose(),this.disposables.forEach((e=>e.dispose()))}async getEnvPythonPath(){const e=await this.envVarsProvider.getEnvironmentVariables();return this.envPythonPath=e.PYTHONPATH||"",this.envPythonPath}onEnvVarChange(){this.notifyifEnvPythonPathChanged().ignoreErrors()}async notifyifEnvPythonPathChanged(){const e=(await this.envVarsProvider.getEnvironmentVariables()).PYTHONPATH||"";this.envPythonPath!==e&&this.didChange.fire()}}r([(0,a.debounceSync)(1e3)],u.prototype,"onEnvVarChange",null),t.LanguageServerAnalysisOptionsWithEnv=u},17347:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileBasedCancellationStrategy=void 0;const r=n(6113),i=n(57147),o=n(22037),s=n(71017),a=n(52847);function c(e){return s.join(o.tmpdir(),"python-languageserver-cancellation",e)}function l(e,t){return s.join(c(e),`cancellation-${String(t)}.tmp`)}function u(e){try{e()}catch(e){}}class d{constructor(e){this.folderName=e;const t=c(e);u((()=>i.mkdirSync(t,{recursive:!0})))}async sendCancellation(e,t){const n=l(this.folderName,t);u((()=>i.writeFileSync(n,"",{flag:"w"})))}cleanup(e){u((()=>i.unlinkSync(l(this.folderName,e))))}dispose(){const e=c(this.folderName);function t(e){const n=i.lstatSync(e);if(n)if(n.isDirectory()&&!n.isSymbolicLink()){for(const n of i.readdirSync(e))t(s.join(e,n));i.rmdirSync(e)}else i.unlinkSync(e)}u((()=>t(e)))}}t.FileBasedCancellationStrategy=class{constructor(){const e=(0,r.randomBytes)(21).toString("hex");this._sender=new d(e)}get receiver(){return a.CancellationReceiverStrategy.Message}get sender(){return this._sender}getCommandLineArguments(){return[`--cancellationReceive=file:${this._sender.folderName}`]}dispose(){this._sender.dispose()}}},14306:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.setDefaultLanguageServer=void 0;const i=n(86700),o=n(77570),s=n(61684),a=n(90819);let c=class{constructor(e){this.defaultLSType=e}};c=r([(0,i.injectable)()],c),t.setDefaultLanguageServer=async function(e,t){const n=await async function(e){return e.getExtension(o.PYLANCE_EXTENSION_ID)?a.LanguageServerType.Node:a.LanguageServerType.Jedi}(e);t.addSingletonInstance(s.IDefaultLanguageServer,new c(n))}},65188:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageServerChangeHandler=t.promptForPylanceInstall=void 0;const r=n(66828),i=n(77570),o=n(59314),s=n(67098),a=n(90819);async function c(e,t,n,o){const c=await e.showWarningMessage(s.Pylance.pylanceRevertToJediPrompt,s.Pylance.pylanceInstallPylance,s.Pylance.pylanceRevertToJedi,s.Pylance.remindMeLater);if(c===s.Pylance.pylanceInstallPylance)t.executeCommand("extension.open",i.PYLANCE_EXTENSION_ID);else if(c===s.Pylance.pylanceRevertToJedi){const e=n.getConfiguration("python").inspect("languageServer");let t;(null==e?void 0:e.workspaceValue)?t=r.ConfigurationTarget.Workspace:(null==e?void 0:e.globalValue)&&(t=r.ConfigurationTarget.Global),t&&await o.updateSetting("languageServer",a.LanguageServerType.Jedi,void 0,t)}}t.promptForPylanceInstall=c,t.LanguageServerChangeHandler=class{constructor(e,t,n,r,i,s){this.currentLsType=e,this.extensions=t,this.appShell=n,this.commands=r,this.workspace=i,this.configService=s,this.pylanceInstallCompletedDeferred=(0,o.createDeferred)(),this.disposables=[],this.pylanceInstalled=!1,this.pylanceInstalled=this.isPylanceInstalled(),this.disposables.push(t.onDidChange((async()=>{await this.extensionsChangeHandler()})))}dispose(){for(var e;this.disposables.length;)null===(e=this.disposables.pop())||void 0===e||e.dispose()}get pylanceInstallCompleted(){return this.pylanceInstallCompletedDeferred.promise}async handleLanguageServerChange(e){this.currentLsType!==e&&e!==a.LanguageServerType.Microsoft&&(e!==a.LanguageServerType.Node||this.isPylanceInstalled()||await c(this.appShell,this.commands,this.workspace,this.configService),this.currentLsType=e)}async extensionsChangeHandler(){const e=this.pylanceInstalled;this.pylanceInstalled=this.isPylanceInstalled(),e===this.pylanceInstalled&&this.pylanceInstallCompletedDeferred.resolve()}isPylanceInstalled(){return!!this.extensions.getExtension(i.PYLANCE_EXTENSION_ID)}}},52228:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LoadLanguageServerExtension=void 0;const o=n(86700),s=n(17585),a=n(61684);let c=class{constructor(e,t){this.commandManager=e,this.disposables=t,this.supportedWorkspaceTypes={untrustedWorkspace:!0,virtualWorkspace:!0}}activate(){const e=this.commandManager.registerCommand("python._loadLanguageServerExtension",(()=>{}));return this.disposables.push(e),Promise.resolve()}};c=r([(0,o.injectable)(),i(0,(0,o.inject)(s.ICommandManager)),i(1,(0,o.inject)(a.IDisposableRegistry))],c),t.LoadLanguageServerExtension=c},63265:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageServerOutputChannel=void 0;const o=n(86700),s=n(17585);n(32727);const a=n(61684),c=n(67098);let l=class{constructor(e,t,n){this.appShell=e,this.commandManager=t,this.disposable=n,this.registered=!1}get channel(){return this.output||(this.output=this.appShell.createOutputChannel(c.OutputChannelNames.languageServer),this.disposable.push(this.output),this.registerCommand().ignoreErrors()),this.output}async registerCommand(){this.registered||(this.registered=!0,await this.commandManager.executeCommand("setContext","python.hasLanguageServerOutputChannel",!0),this.disposable.push(this.commandManager.registerCommand("python.viewLanguageServerOutput",(()=>{var e;return null===(e=this.output)||void 0===e?void 0:e.show(!0)}))),this.disposable.push({dispose:()=>{this.registered=!1}}))}};l=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IApplicationShell)),i(1,(0,o.inject)(s.ICommandManager)),i(2,(0,o.inject)(a.IDisposableRegistry))],l),t.LanguageServerOutputChannel=l},61702:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionSurveyPrompt=t.extensionSurveyStateKeys=void 0;const o=n(86700),s=n(63477),a=n(66828),c=n(17585),l=n(60717);n(32727);const u=n(84974),d=n(61684),p=n(67098),h=n(19735),f=n(54813),g=n(61522);var m;!function(e){e.doNotShowAgain="doNotShowExtensionSurveyAgain",e.disableSurveyForTime="doNotShowExtensionSurveyUntilTime"}(m=t.extensionSurveyStateKeys||(t.extensionSurveyStateKeys={}));const v=72576e5;let y=class{constructor(e,t,n,r,i,o,s,a=10,c=108e5){this.appShell=e,this.browserService=t,this.persistentState=n,this.random=r,this.experiments=i,this.appEnvironment=o,this.platformService=s,this.sampleSizePerOneHundredUsers=a,this.waitTimeToShowSurvey=c,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0}}async activate(){await this.experiments.inExperiment(l.ShowExtensionSurveyPrompt.experiment)&&this.shouldShowBanner()&&setTimeout((()=>this.showSurvey().ignoreErrors()),this.waitTimeToShowSurvey)}shouldShowBanner(){return a.env.uiKind!==(null===a.UIKind||void 0===a.UIKind?void 0:a.UIKind.Web)&&(!this.persistentState.createGlobalPersistentState(m.doNotShowAgain,!1).value&&(!this.persistentState.createGlobalPersistentState(m.disableSurveyForTime,!1,v).value&&!(this.random.getRandomInt(0,100)>=this.sampleSizePerOneHundredUsers)))}async showSurvey(){const e=[p.ExtensionSurveyBanner.bannerLabelYes,p.ExtensionSurveyBanner.maybeLater,p.Common.doNotShowAgain],t=await this.appShell.showInformationMessage(p.ExtensionSurveyBanner.bannerMessage,...e);(0,f.sendTelemetryEvent)(g.EventName.EXTENSION_SURVEY_PROMPT,void 0,{selection:t?["Yes","Maybe later","Don't show again"][e.indexOf(t)]:void 0}),t&&(t===p.ExtensionSurveyBanner.bannerLabelYes?(this.launchSurvey(),await this.persistentState.createGlobalPersistentState(m.disableSurveyForTime,!1,v).updateValue(!0)):t===p.Common.doNotShowAgain&&await this.persistentState.createGlobalPersistentState(m.doNotShowAgain,!1).updateValue(!0))}launchSurvey(){const e=`https://aka.ms/AA5rjx5?${s.stringify({o:encodeURIComponent(this.platformService.osType),v:encodeURIComponent(this.appEnvironment.vscodeVersion),e:encodeURIComponent(this.appEnvironment.packageJson.version),m:encodeURIComponent(this.appEnvironment.sessionId)})}`;this.browserService.launch(e)}};r([(0,h.traceDecoratorError)("Failed to check whether to display prompt for extension survey")],y.prototype,"shouldShowBanner",null),r([(0,h.traceDecoratorError)("Failed to display prompt for extension survey")],y.prototype,"showSurvey",null),y=r([(0,o.injectable)(),i(0,(0,o.inject)(c.IApplicationShell)),i(1,(0,o.inject)(d.IBrowserService)),i(2,(0,o.inject)(d.IPersistentStateFactory)),i(3,(0,o.inject)(d.IRandom)),i(4,(0,o.inject)(d.IExperimentService)),i(5,(0,o.inject)(c.IApplicationEnvironment)),i(6,(0,o.inject)(u.IPlatformService)),i(7,(0,o.optional)()),i(8,(0,o.optional)())],y),t.ExtensionSurveyPrompt=y},67220:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JediLanguageServerAnalysisOptions=void 0;const r=n(71017),i=n(10464);class o extends i.LanguageServerAnalysisOptionsWithEnv{constructor(e,t,n,r){super(e,t,r),this.configurationService=n,this.resource=void 0}async initialize(e,t){return this.resource=e,this.interpreter=t,super.initialize(e,t)}getWorkspaceFolder(){return this.workspace.getWorkspaceFolder(this.resource)}async getInitializationOptions(){var e,t;const n=this.configurationService.getSettings(this.resource),i=null===(e=this.getWorkspaceFolder())||void 0===e?void 0:e.uri.fsPath,o=n.autoComplete?n.autoComplete.extraPaths.map((e=>r.isAbsolute(e)?e:i?r.join(i,e):"")):[];return i&&o.unshift(i),{markupKindPreferred:"markdown",completion:{resolveEagerly:!1,disableSnippets:!0},diagnostics:{enable:!0,didOpen:!0,didSave:!0,didChange:!0},hover:{disable:{keyword:{all:!0}}},workspace:{extraPaths:o.filter((e=>e.length>0)).filter(((e,t,n)=>n.indexOf(e)===t)),environmentPath:null===(t=this.interpreter)||void 0===t?void 0:t.path,symbols:{maxSymbols:0}}}}}t.JediLanguageServerAnalysisOptions=o},49532:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JediLanguageClientFactory=void 0;const r=n(71017),i=n(52847),o=n(77570);t.JediLanguageClientFactory=class{constructor(e){this.interpreterService=e}async createLanguageClient(e,t,n){const s=r.join(o.EXTENSION_ROOT_DIR,"python_files","run-jedi-language-server.py"),a=await this.interpreterService.getActiveInterpreter(e),c={command:a?a.path:"python",args:[s]};return new i.LanguageClient(o.PYTHON_LANGUAGE,"Python Jedi",c,n)}}},74381:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JediLanguageClientMiddleware=void 0;const r=n(1158),i=n(90819);class o extends r.LanguageClientMiddleware{constructor(e,t){super(e,i.LanguageServerType.Jedi,t),this.setupHidingMiddleware(e)}}t.JediLanguageClientMiddleware=o},17192:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.JediLanguageServerProxy=void 0,n(32727);const i=n(54813),o=n(61522),s=n(12133),a=n(18699),c=n(19735);class l{constructor(e){this.factory=e,this.disposables=[]}static versionTelemetryProps(e){return{lsVersion:e.lsVersion}}dispose(){this.stop().ignoreErrors()}async start(e,t,n){var r;this.lsVersion=null!==(r=n.middleware?n.middleware.serverVersion:void 0)&&void 0!==r?r:"0.19.3";try{const r=await this.factory.createLanguageClient(e,t,n);this.registerHandlers(r),await r.start(),this.languageClient=r}catch(e){throw(0,c.traceError)("Failed to start language server:",e),new Error("Launching Jedi language server using python failed, see output.")}}async stop(){for(var e;this.disposables.length>0;)this.disposables.shift().dispose();if(this.languageClient){const t=this.languageClient;this.languageClient=void 0;const n=null===(e=t._serverProcess)||void 0===e?void 0:e.pid,r=()=>{n&&(0,a.killPid)(n)};try{await t.stop(),await t.dispose(),r()}catch(e){(0,c.traceError)("Stopping language client failed",e),r()}}}loadExtension(){}registerHandlers(e){const t=new s.ProgressReporting(e);this.disposables.push(t)}}r([(0,c.traceDecoratorVerbose)("Disposing language server")],l.prototype,"dispose",null),r([(0,c.traceDecoratorError)("Failed to start language server"),(0,i.captureTelemetry)(o.EventName.JEDI_LANGUAGE_SERVER_ENABLED,void 0,!0,void 0,l.versionTelemetryProps)],l.prototype,"start",null),r([(0,c.traceDecoratorVerbose)("Stopping language server")],l.prototype,"stop",null),r([(0,i.captureTelemetry)(o.EventName.JEDI_LANGUAGE_SERVER_READY,void 0,!0,void 0,l.versionTelemetryProps)],l.prototype,"registerHandlers",null),t.JediLanguageServerProxy=l},73461:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.JediLanguageServerManager=void 0;const i=n(55674),o=n(71017);n(32727);const s=n(36952),a=n(63281),c=n(54813),l=n(61522),u=n(23826),d=n(74381),p=n(19735);class h{constructor(e,t,n,r){this.serviceContainer=e,this.analysisOptions=t,this.languageServerProxy=n,this.disposables=[],this.connected=!1,h.commandDispose&&h.commandDispose.dispose(),h.commandDispose=r.registerCommand(u.Commands.RestartLS,(()=>{this.restartLanguageServer().ignoreErrors()}))}static versionTelemetryProps(e){return{lsVersion:e.lsVersion}}dispose(){this.stopLanguageServer().ignoreErrors(),h.commandDispose.dispose(),this.disposables.forEach((e=>e.dispose()))}async start(e,t){this.resource=e,this.interpreter=t,this.analysisOptions.onDidChange(this.restartLanguageServerDebounced,this,this.disposables);try{const e=await i.readFile(o.join(a.EXTENSION_ROOT_DIR,"python_files","jedilsp_requirements","requirements.txt"),"utf-8"),t=/jedi-language-server==([0-9\.]*)/.exec(e);t&&2===t.length&&([,this.lsVersion]=t)}catch(e){(0,p.traceVerbose)("Failed to get jedi-language-server version: ",e)}await this.analysisOptions.initialize(e,t),await this.startLanguageServer()}connect(){var e;this.connected||(this.connected=!0,null===(e=this.middleware)||void 0===e||e.connect())}disconnect(){var e;this.connected&&(this.connected=!1,null===(e=this.middleware)||void 0===e||e.disconnect())}restartLanguageServerDebounced(){this.restartLanguageServer().ignoreErrors()}async restartLanguageServer(){await this.stopLanguageServer(),await this.startLanguageServer()}async startLanguageServer(){const e=await this.analysisOptions.getAnalysisOptions();this.middleware=new d.JediLanguageClientMiddleware(this.serviceContainer,this.lsVersion),e.middleware=this.middleware,this.connected&&this.middleware.connect(),await this.languageServerProxy.start(this.resource,this.interpreter,e)}async stopLanguageServer(){this.languageServerProxy&&await this.languageServerProxy.stop()}}r([(0,p.traceDecoratorError)("Failed to start language server")],h.prototype,"start",null),r([(0,s.debounceSync)(1e3)],h.prototype,"restartLanguageServerDebounced",null),r([(0,p.traceDecoratorError)("Failed to restart language server"),(0,p.traceDecoratorVerbose)("Restarting language server")],h.prototype,"restartLanguageServer",null),r([(0,c.captureTelemetry)(l.EventName.JEDI_LANGUAGE_SERVER_STARTUP,void 0,!0,void 0,h.versionTelemetryProps),(0,p.traceDecoratorVerbose)("Starting language server")],h.prototype,"startLanguageServer",null),r([(0,p.traceDecoratorVerbose)("Stopping language server")],h.prototype,"stopLanguageServer",null),t.JediLanguageServerManager=h},1158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageClientMiddleware=void 0;const r=n(17585),i=n(61684),o=n(54813),s=n(42857),a=n(1730);class c extends s.LanguageClientMiddlewareBase{constructor(e,t,n){super(e,t,o.sendTelemetryEvent,n)}setupHidingMiddleware(e){const t=e.get(r.IJupyterExtensionDependencyManager),n=e.get(i.IDisposableRegistry)||[],o=e.get(i.IExtensions);this.shouldCreateHidingMiddleware(t)&&(this.notebookAddon=(0,a.createHidingMiddleware)()),n.push(null==o?void 0:o.onDidChange((async()=>{await this.onExtensionChange(t)})))}shouldCreateHidingMiddleware(e){return e&&e.isJupyterExtensionInstalled}async onExtensionChange(e){e&&(this.notebookAddon&&!this.shouldCreateHidingMiddleware(e)?this.notebookAddon=void 0:!this.notebookAddon&&this.shouldCreateHidingMiddleware(e)&&(this.notebookAddon=(0,a.createHidingMiddleware)()))}}t.LanguageClientMiddleware=c},42857:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageClientMiddlewareBase=void 0;const r=n(71017),i=n(66828),o=n(92850),s=n(77570),a=n(59314),c=n(70057),l=n(19909),u=n(18639),d=n(61522),p=n(90819),h=3e5,f=6e4;t.LanguageClientMiddlewareBase=class{constructor(e,t,n,r){this.serviceContainer=e,this.sendTelemetryEventFunc=n,this.serverVersion=r,this.lastCaptured=new Map,this.nextWindow=0,this.eventCount=0,this.workspace={configuration:async(e,t,n)=>{var r,s;if(!this.serviceContainer)return n(e,t);const c=this.serviceContainer.get(u.IInterpreterService),d=this.serviceContainer.get(l.IEnvironmentVariablesProvider);let p=n(e,t);if((0,a.isThenable)(p)&&(p=await p),p instanceof o.ResponseError)return p;for(const[t,n]of e.items.entries()){if("python"===n.section){const e=n.scopeUri?i.Uri.parse(n.scopeUri):void 0,o=p[t];o.pythonPath=null!==(s=null===(r=await c.getActiveInterpreter(e))||void 0===r?void 0:r.path)&&void 0!==s?s:"python";const a=(await d.getEnvironmentVariables(e)).PYTHONPATH;a&&(o._envPYTHONPATH=a)}this.configurationHook(n,p[t])}return p}},this.connectedPromise=(0,a.createDeferred)(),this.notebooks={didOpen:this.didOpenNotebook.bind(this),didSave:this.didSaveNotebook.bind(this),didChange:this.didChangeNotebook.bind(this),didClose:this.didCloseNotebook.bind(this)},this.handleDiagnostics=this.handleDiagnostics.bind(this),this.didOpen=this.didOpen.bind(this),this.didSave=this.didSave.bind(this),this.didChange=this.didChange.bind(this),this.didClose=this.didClose.bind(this),this.willSave=this.willSave.bind(this),this.willSaveWaitUntil=this.willSaveWaitUntil.bind(this),t===p.LanguageServerType.Node?this.eventName=d.EventName.LANGUAGE_SERVER_REQUEST:t===p.LanguageServerType.Jedi&&(this.eventName=d.EventName.JEDI_LANGUAGE_SERVER_REQUEST)}configurationHook(e,t){}get connected(){return this.connectedPromise.promise}connect(){this.connectedPromise.resolve(!0)}disconnect(){this.connectedPromise=(0,a.createDeferred)(),this.connectedPromise.resolve(!1)}didChange(){return this.callNext("didChange",arguments)}didOpen(){return this.callNext("didOpen",arguments)}didClose(){return this.callNext("didClose",arguments)}didSave(){return this.callNext("didSave",arguments)}willSave(){return this.callNext("willSave",arguments)}willSaveWaitUntil(){return this.callNext("willSaveWaitUntil",arguments)}async didOpenNotebook(){return this.callNotebooksNext("didOpen",arguments)}async didSaveNotebook(){return this.callNotebooksNext("didSave",arguments)}async didChangeNotebook(){return this.callNotebooksNext("didChange",arguments)}async didCloseNotebook(){return this.callNotebooksNext("didClose",arguments)}async provideCompletionItem(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/completion",h,"provideCompletionItem",arguments,((e,t)=>t?{resultLength:Array.isArray(t)?t.length:t.items.length}:{resultLength:0}))}async provideHover(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/hover",h,"provideHover",arguments)}async handleDiagnostics(e,t,n){if(await this.connected){const t=e.fsPath,n=t?r.basename(t):void 0;if(!n||!n.startsWith(s.HiddenFilePrefix))return this.callNext("handleDiagnostics",arguments)}}async resolveCompletionItem(){if(await this.connected)return this.callNextAndSendTelemetry("completionItem/resolve",h,"resolveCompletionItem",arguments)}async provideSignatureHelp(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/signatureHelp",h,"provideSignatureHelp",arguments)}async provideDefinition(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/definition",f,"provideDefinition",arguments)}async provideReferences(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/references",f,"provideReferences",arguments)}async provideDocumentHighlights(){if(await this.connected)return this.callNext("provideDocumentHighlights",arguments)}async provideDocumentSymbols(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/documentSymbol",h,"provideDocumentSymbols",arguments)}async provideWorkspaceSymbols(){if(await this.connected)return this.callNextAndSendTelemetry("workspace/symbol",f,"provideWorkspaceSymbols",arguments)}async provideCodeActions(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/codeAction",h,"provideCodeActions",arguments)}async provideCodeLenses(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/codeLens",h,"provideCodeLenses",arguments)}async resolveCodeLens(){if(await this.connected)return this.callNextAndSendTelemetry("codeLens/resolve",h,"resolveCodeLens",arguments)}async provideDocumentFormattingEdits(){if(await this.connected)return this.callNext("provideDocumentFormattingEdits",arguments)}async provideDocumentRangeFormattingEdits(){if(await this.connected)return this.callNext("provideDocumentRangeFormattingEdits",arguments)}async provideOnTypeFormattingEdits(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/onTypeFormatting",h,"provideOnTypeFormattingEdits",arguments)}async provideRenameEdits(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/rename",f,"provideRenameEdits",arguments)}async prepareRename(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/prepareRename",f,"prepareRename",arguments)}async provideDocumentLinks(){if(await this.connected)return this.callNext("provideDocumentLinks",arguments)}async resolveDocumentLink(){if(await this.connected)return this.callNext("resolveDocumentLink",arguments)}async provideDeclaration(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/declaration",f,"provideDeclaration",arguments)}async provideTypeDefinition(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/typeDefinition",f,"provideTypeDefinition",arguments)}async provideImplementation(){if(await this.connected)return this.callNext("provideImplementation",arguments)}async provideDocumentColors(){if(await this.connected)return this.callNext("provideDocumentColors",arguments)}async provideColorPresentations(){if(await this.connected)return this.callNext("provideColorPresentations",arguments)}async provideFoldingRanges(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/foldingRange",h,"provideFoldingRanges",arguments)}async provideSelectionRanges(){if(await this.connected)return this.callNextAndSendTelemetry("textDocument/selectionRange",f,"provideSelectionRanges",arguments)}async prepareCallHierarchy(){if(await this.connected)return this.callNext("prepareCallHierarchy",arguments)}async provideCallHierarchyIncomingCalls(){if(await this.connected)return this.callNext("provideCallHierarchyIncomingCalls",arguments)}async provideCallHierarchyOutgoingCalls(){if(await this.connected)return this.callNext("provideCallHierarchyOutgoingCalls",arguments)}async provideDocumentSemanticTokens(){if(await this.connected)return this.callNext("provideDocumentSemanticTokens",arguments)}async provideDocumentSemanticTokensEdits(){if(await this.connected)return this.callNext("provideDocumentSemanticTokensEdits",arguments)}async provideDocumentRangeSemanticTokens(){if(await this.connected)return this.callNext("provideDocumentRangeSemanticTokens",arguments)}async provideLinkedEditingRange(){if(await this.connected)return this.callNext("provideLinkedEditingRange",arguments)}callNext(e,t){return this.notebookAddon&&this.notebookAddon[e]?this.notebookAddon[e](...t):t[t.length-1](...t)}callNotebooksNext(e,t){var n;return(null===(n=this.notebookAddon)||void 0===n?void 0:n.notebooks)&&this.notebookAddon.notebooks[e]?this.notebookAddon.notebooks[e](...t):t[t.length-1](...t)}callNextAndSendTelemetry(e,t,n,r,i){const o=Date.now(),s=new c.StopWatch;let l=!1;const u=[...r];u[u.length-1]=(...e)=>(l=!0,r[r.length-1](...e)),o>this.nextWindow&&(this.nextWindow=o+36e5,this.eventCount=0);const d=this.lastCaptured.get(e),p=n=>{if(this.eventName&&l&&this.eventCount<100&&(!d||o-d>t)){this.lastCaptured.set(e,o),this.eventCount+=1;const t=e.replace(/\//g,"."),r={lsVersion:this.serverVersion||"unknown",method:t};let a=s.elapsedTime;i&&(a={duration:a,...i(this,n)}),this.sendTelemetryEventFunc(this.eventName,a,r)}return n},h=this.callNext(n,u);return(0,a.isThenable)(h)?h.then(p):p(h)}}},22473:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeLanguageServerAnalysisOptions=void 0;const r=n(10464);class i extends r.LanguageServerAnalysisOptionsBase{constructor(e,t){super(e,t)}getConfigSectionsToSynchronize(){return[...super.getConfigSectionsToSynchronize(),"jupyter.runStartupCommands"]}async getInitializationOptions(){return{experimentationSupport:!0,trustedWorkspaceSupport:!0}}}t.NodeLanguageServerAnalysisOptions=i},46888:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeLanguageClientFactory=t.PYLANCE_NAME=void 0;const r=n(71017),i=n(52847),o=n(77570);t.PYLANCE_NAME="Pylance",t.NodeLanguageClientFactory=class{constructor(e,t){this.fs=e,this.extensions=t}async createLanguageClient(e,n,s){var a;const c=(null===(a=s.connectionOptions)||void 0===a?void 0:a.cancellationStrategy).getCommandLineArguments(),l=this.extensions.getExtension(o.PYLANCE_EXTENSION_ID),u=l?l.extensionPath:"",d=r.join(u,"dist","server.bundle.js"),p=r.join(u,"dist","server.js"),h=await this.fs.fileExists(p)?p:d,f={run:{module:d,transport:i.TransportKind.ipc,args:c},debug:{module:h,transport:i.TransportKind.ipc,options:{execArgv:["--nolazy","--inspect=6600"]},args:c}};return new i.LanguageClient(o.PYTHON_LANGUAGE,t.PYLANCE_NAME,f,s)}}},95479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeLanguageClientMiddleware=void 0;const r=n(1158),i=n(90819);class o extends r.LanguageClientMiddleware{constructor(e,t){super(e,i.LanguageServerType.Node,t),this.setupHidingMiddleware(e)}shouldCreateHidingMiddleware(e){return!1}}t.NodeLanguageClientMiddleware=o},82602:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeLanguageServerProxy=void 0,n(32727);const i=n(52847),o=n(54813),s=n(61522),a=n(17347),c=n(12133),l=n(19735),u=n(77570);var d,p;!function(e){e.Method="python/inExperiment"}(d||(d={})),function(e){e.Method="python/getExperimentValue"}(p||(p={}));class h{constructor(e,t,n,r,i,o){this.factory=e,this.experimentService=t,this.interpreterPathService=n,this.environmentService=r,this.workspace=i,this.extensions=o,this.disposables=[]}static versionTelemetryProps(e){return{lsVersion:e.lsVersion}}dispose(){this.stop().ignoreErrors()}async start(e,t,n){const r=await this.getPylanceExtension();this.lsVersion=(null==r?void 0:r.packageJSON.version)||"0";const i=null==r?void 0:r.exports;if(i&&i.client&&i.client.isEnabled())return this.pylanceApi=i,void await i.client.start();this.cancellationStrategy=new a.FileBasedCancellationStrategy,n.connectionOptions={cancellationStrategy:this.cancellationStrategy};const o=await this.factory.createLanguageClient(e,t,n);this.registerHandlers(o,e),this.disposables.push(this.workspace.onDidGrantWorkspaceTrust((()=>{o.sendNotification("python/workspaceTrusted",{isTrusted:!0})}))),await o.start(),this.languageClient=o}async stop(){if(this.pylanceApi){const e=this.pylanceApi;this.pylanceApi=void 0,await e.client.stop()}for(;this.disposables.length>0;)this.disposables.shift().dispose();if(this.languageClient){const e=this.languageClient;this.languageClient=void 0;try{await e.stop(),await e.dispose()}catch(e){(0,l.traceError)("Stopping language client failed",e)}}this.cancellationStrategy&&(this.cancellationStrategy.dispose(),this.cancellationStrategy=void 0)}loadExtension(){}registerHandlers(e,t){const n=new c.ProgressReporting(e);this.disposables.push(n),this.disposables.push(this.interpreterPathService.onDidChange((()=>{e.sendNotification(i.DidChangeConfigurationNotification.type,{settings:null})}))),this.disposables.push(this.environmentService.onDidEnvironmentVariablesChange((()=>{e.sendNotification(i.DidChangeConfigurationNotification.type,{settings:null})}))),e.onTelemetry((e=>{var t;const n=e.EventName||s.EventName.LANGUAGE_SERVER_TELEMETRY,r={...e.Properties,method:null===(t=e.Properties.method)||void 0===t?void 0:t.replace(/\//g,".")};(0,o.sendTelemetryEvent)(n,e.Measurements,r,e.Exception)})),e.onRequest(d.Method,(async e=>({inExperiment:await this.experimentService.inExperiment(e.experimentName)}))),e.onRequest(p.Method,(async e=>({value:await this.experimentService.getExperimentValue(e.experimentName)}))),this.disposables.push(e.onRequest("python/isTrustedWorkspace",(async()=>({isTrusted:this.workspace.isTrusted}))))}async getPylanceExtension(){const e=this.extensions.getExtension(u.PYLANCE_EXTENSION_ID);if(e)return e.isActive||await e.activate(),e}}r([(0,l.traceDecoratorVerbose)("Disposing language server")],h.prototype,"dispose",null),r([(0,l.traceDecoratorError)("Failed to start language server"),(0,o.captureTelemetry)(s.EventName.LANGUAGE_SERVER_ENABLED,void 0,!0,void 0,h.versionTelemetryProps)],h.prototype,"start",null),r([(0,l.traceDecoratorVerbose)("Disposing language server")],h.prototype,"stop",null),r([(0,o.captureTelemetry)(s.EventName.LANGUAGE_SERVER_READY,void 0,!0,void 0,h.versionTelemetryProps)],h.prototype,"registerHandlers",null),t.NodeLanguageServerProxy=h},57582:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeLanguageServerManager=void 0,n(32727);const i=n(36952),o=n(54813),s=n(61522),a=n(23826),c=n(95479),l=n(19735),u=n(77570);class d{constructor(e,t,n,r,i){this.serviceContainer=e,this.analysisOptions=t,this.languageServerProxy=n,this.extensions=i,this.disposables=[],this.connected=!1,this.started=!1,d.commandDispose&&d.commandDispose.dispose(),d.commandDispose=r.registerCommand(a.Commands.RestartLS,(()=>{(0,o.sendTelemetryEvent)(s.EventName.LANGUAGE_SERVER_RESTART,void 0,{reason:"command"}),this.restartLanguageServer().ignoreErrors()}))}static versionTelemetryProps(e){return{lsVersion:e.lsVersion}}dispose(){this.stopLanguageServer().ignoreErrors(),d.commandDispose.dispose(),this.disposables.forEach((e=>e.dispose()))}async start(e,t){if(this.started)throw new Error("Language server already started");this.resource=e,this.interpreter=t,this.analysisOptions.onDidChange(this.restartLanguageServerDebounced,this,this.disposables);const n=this.extensions.getExtension(u.PYLANCE_EXTENSION_ID);this.lsVersion=(null==n?void 0:n.packageJSON.version)||"0",await this.analysisOptions.initialize(e,t),await this.startLanguageServer(),this.started=!0}connect(){var e;this.connected||(this.connected=!0,null===(e=this.middleware)||void 0===e||e.connect())}disconnect(){var e;this.connected&&(this.connected=!1,null===(e=this.middleware)||void 0===e||e.disconnect())}restartLanguageServerDebounced(){(0,o.sendTelemetryEvent)(s.EventName.LANGUAGE_SERVER_RESTART,void 0,{reason:"settings"}),this.restartLanguageServer().ignoreErrors()}async restartLanguageServer(){await this.stopLanguageServer(),await this.startLanguageServer()}async startLanguageServer(){const e=await this.analysisOptions.getAnalysisOptions();this.middleware=new c.NodeLanguageClientMiddleware(this.serviceContainer,this.lsVersion),e.middleware=this.middleware,this.connected&&this.middleware.connect(),await this.languageServerProxy.start(this.resource,this.interpreter,e)}async stopLanguageServer(){this.languageServerProxy&&await this.languageServerProxy.stop()}}r([(0,l.traceDecoratorError)("Failed to start language server")],d.prototype,"start",null),r([(0,i.debounceSync)(1e3)],d.prototype,"restartLanguageServerDebounced",null),r([(0,l.traceDecoratorError)("Failed to restart language server"),(0,l.traceDecoratorVerbose)("Restarting language server")],d.prototype,"restartLanguageServer",null),r([(0,o.captureTelemetry)(s.EventName.LANGUAGE_SERVER_STARTUP,void 0,!0,void 0,d.versionTelemetryProps),(0,l.traceDecoratorVerbose)("Starting language server")],d.prototype,"startLanguageServer",null),r([(0,l.traceDecoratorVerbose)("Stopping language server")],d.prototype,"stopLanguageServer",null),t.NodeLanguageServerManager=d},22430:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PartialModeStatusItem=void 0;const o=n(86700),s=n(17585),a=n(61684),c=n(67098);let l=class{constructor(e,t){this.workspace=e,this.disposables=t,this.supportedWorkspaceTypes={untrustedWorkspace:!0,virtualWorkspace:!0}}async activate(){const{isTrusted:e,isVirtualWorkspace:t}=this.workspace;if(e&&!t)return;const n=this.createStatusItem();n&&this.disposables.push(n)}createStatusItem(){const e=n(66828);if("createLanguageStatusItem"in e.languages){const t=e.languages.createLanguageStatusItem("python.projectStatus",{language:"python"});return t.name=c.LanguageService.statusItem.name,t.severity=e.LanguageStatusSeverity.Warning,t.text=c.LanguageService.statusItem.text,t.detail=this.workspace.isTrusted?c.LanguageService.virtualWorkspaceStatusItem.detail:c.LanguageService.statusItem.detail,t.command={title:c.Common.learnMore,command:"vscode.open",arguments:[e.Uri.parse("https://aka.ms/AAdzyh4")]},t}}};l=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IWorkspaceService)),i(1,(0,o.inject)(a.IDisposableRegistry))],l),t.PartialModeStatusItem=l},12133:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressReporting=void 0;const r=n(66828),i=n(59314);t.ProgressReporting=class{constructor(e){this.languageClient=e,this.languageClient.onNotification("python/setStatusBarMessage",(e=>{this.statusBarMessage&&this.statusBarMessage.dispose(),this.statusBarMessage=r.window.setStatusBarMessage(e)})),this.languageClient.onNotification("python/beginProgress",(e=>{this.progressDeferred||this.beginProgress()})),this.languageClient.onNotification("python/reportProgress",(e=>{this.progress||this.beginProgress(),this.progress.report({message:e})})),this.languageClient.onNotification("python/endProgress",(e=>{this.progressDeferred&&(this.progressDeferred.resolve(),this.progressDeferred=void 0,this.progress=void 0)}))}dispose(){this.statusBarMessage&&this.statusBarMessage.dispose()}beginProgress(){this.progressDeferred=(0,i.createDeferred)(),r.window.withProgress({location:r.ProgressLocation.Window,title:""},(e=>(this.progress=e,this.progressDeferred.promise)))}}},83796:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.RequirementsTxtLinkActivator=t.generatePyPiLink=void 0;const i=n(86700),o=n(66828);function s(e){const t=e.match(/^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*)($|=| |;|\[)/i);return t?`https://pypi.org/project/${t[1]}/`:null}t.generatePyPiLink=s;let a=class{constructor(){this.supportedWorkspaceTypes={untrustedWorkspace:!0,virtualWorkspace:!0}}async activate(){o.languages.registerHoverProvider([{pattern:"**/*requirement*.txt"},{pattern:"**/requirements/*.txt"}],{provideHover(e,t){const n=s(e.lineAt(t.line).text);return n?new o.Hover(n):null}})}};a=r([(0,i.injectable)()],a),t.RequirementsTxtLinkActivator=a},76546:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const r=n(69145),i=n(61702),o=n(63265),s=n(90819),a=n(52228),c=n(22430),l=n(72391),u=n(8335),d=n(83796);t.registerTypes=function(e){e.addSingleton(s.IExtensionActivationService,c.PartialModeStatusItem),e.add(s.IExtensionActivationManager,r.ExtensionActivationManager),e.addSingleton(s.ILanguageServerOutputChannel,o.LanguageServerOutputChannel),e.addSingleton(s.IExtensionSingleActivationService,i.ExtensionSurveyPrompt),e.addSingleton(s.IExtensionSingleActivationService,a.LoadLanguageServerExtension),e.addSingleton(l.ILanguageServerWatcher,u.LanguageServerWatcher),e.addBinding(l.ILanguageServerWatcher,s.IExtensionActivationService),e.addSingleton(s.IExtensionSingleActivationService,d.RequirementsTxtLinkActivator)}},90819:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.IExtensionSingleActivationService=t.ILanguageServerOutputChannel=t.ILanguageServerProxy=t.ILanguageServerManager=t.ILanguageServerAnalysisOptions=t.ILanguageClientFactory=t.ILanguageServerActivator=t.LanguageServerType=t.IExtensionActivationService=t.IExtensionActivationManager=void 0,t.IExtensionActivationManager=Symbol("IExtensionActivationManager"),t.IExtensionActivationService=Symbol("IExtensionActivationService"),(n=t.LanguageServerType||(t.LanguageServerType={})).Jedi="Jedi",n.JediLSP="JediLSP",n.Microsoft="Microsoft",n.Node="Pylance",n.None="None",t.ILanguageServerActivator=Symbol("ILanguageServerActivator"),t.ILanguageClientFactory=Symbol("ILanguageClientFactory"),t.ILanguageServerAnalysisOptions=Symbol("ILanguageServerAnalysisOptions"),t.ILanguageServerManager=Symbol("ILanguageServerManager"),t.ILanguageServerProxy=Symbol("ILanguageServerProxy"),t.ILanguageServerOutputChannel=Symbol("ILanguageServerOutputChannel"),t.IExtensionSingleActivationService=Symbol("IExtensionSingleActivationService")},10063:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildApi=void 0;const r=n(52847),i=n(46888),o=n(90819),s=n(77570),a=n(61684),c=n(12187),l=n(18639),u=n(66259),d=n(19735),p=n(12304),h=n(54813),f=n(8028),g=n(49575);t.buildApi=function(e,t,n,m){const v=n.get(a.IConfigurationService),y=n.get(l.IInterpreterService);t.addSingleton(u.JupyterExtensionIntegration,u.JupyterExtensionIntegration),t.addSingleton(f.TensorboardExtensionIntegration,f.TensorboardExtensionIntegration);const b=n.get(u.JupyterExtensionIntegration),S=n.get(f.TensorboardExtensionIntegration),_=n.get(o.ILanguageServerOutputChannel),E={ready:e.catch((e=>((0,d.traceError)("Failure during activation.",e),Promise.reject(e)))),jupyter:{registerHooks:()=>b.integrateWithJupyterExtension()},tensorboard:{registerHooks:()=>S.integrateWithTensorboardExtension()},debug:{getRemoteLauncherCommand:async(e,t,n=!0)=>(0,c.getDebugpyLauncherArgs)({host:e,port:t,waitUntilDebuggerAttaches:n}),getDebuggerPackagePath:async()=>(0,g.getDebugpyPath)()},settings:{onDidChangeExecutionDetails:y.onDidChangeInterpreterConfiguration,getExecutionDetails(e){const{pythonPath:t}=v.getSettings(e);return{execCommand:""===t?void 0:[t]}}},pylance:{createClient:(...e)=>{var t;const n=e[1];return n.outputChannel=null!==(t=n.outputChannel)&&void 0!==t?t:_.channel,new r.LanguageClient(s.PYTHON_LANGUAGE,i.PYLANCE_NAME,e[0],n)},start:e=>e.start(),stop:e=>e.stop(),getTelemetryReporter:()=>(0,h.getTelemetryReporter)()},environments:(0,p.buildEnvironmentApi)(m,n)};return(0,s.isTestExecution)()&&(E.serviceContainer=n,E.serviceManager=t),E}},5899:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonExtension=t.PVSC_EXTENSION_ID=void 0;const r=n(66828);t.PVSC_EXTENSION_ID="ms-python.python",(t.PythonExtension||(t.PythonExtension={})).api=async function(){const e=r.extensions.getExtension(t.PVSC_EXTENSION_ID);if(void 0===e)throw new Error("Python extension is not installed or is disabled");return e.isActive||await e.activate(),e.exports}},19897:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ApplicationDiagnostics=void 0;const o=n(86700),s=n(66828),a=n(17585),c=n(77570),l=n(77498),u=n(19735),d=n(93971);async function p(e,t){await Promise.all(e.map((async e=>{const n=await e.diagnose(t);n.length>0&&(function(e){e.forEach((e=>{const t=`Diagnostic Code: ${e.code}, Message: ${e.message}`;switch(e.severity){case s.DiagnosticSeverity.Error:case s.DiagnosticSeverity.Warning:(0,u.traceLog)(t);break;default:(0,u.traceVerbose)(t)}}))}(n),await e.handle(n))})))}let h=class{constructor(e){this.serviceContainer=e}register(){this.serviceContainer.get(d.ISourceMapSupportService).register()}async performPreStartupHealthCheck(e){if((0,c.isTestExecution)())return;let t=this.serviceContainer.getAll(d.IDiagnosticsService);this.serviceContainer.get(a.IWorkspaceService).isTrusted||(t=t.filter((e=>e.runInUntrustedWorkspace))),await p(t.filter((e=>!e.runInBackground)),e),p(t.filter((e=>e.runInBackground)),e).ignoreErrors()}};h=r([(0,o.injectable)(),i(0,(0,o.inject)(l.IServiceContainer))],h),t.ApplicationDiagnostics=h},66674:function(e,t,n){"use strict";var r,i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseDiagnosticsService=t.BaseDiagnostic=void 0;const s=n(86700),a=n(17585),c=n(99910),l=n(54813),u=n(61522),d=n(93971);let p=class{constructor(e,t,n,r,i,o=!0,s="default"){this.code=e,this.message=t,this.severity=n,this.scope=r,this.resource=i,this.shouldShowPrompt=o,this.invokeHandler=s}};p=i([(0,s.injectable)()],p),t.BaseDiagnostic=p;let h=r=class{constructor(e,t,n,r=!1,i=!1){this.supportedDiagnosticCodes=e,this.serviceContainer=t,this.disposableRegistry=n,this.runInBackground=r,this.runInUntrustedWorkspace=i,this.filterService=t.get(d.IDiagnosticFilterService),n.push(this)}dispose(){}async handle(e){if(0===e.length)return;const t=await(0,c.asyncFilter)(e,(async e=>{if(!await this.canHandle(e))return!1;if(e.invokeHandler&&"always"===e.invokeHandler)return!0;const t=this.getDiagnosticsKey(e);return-1===r.handledDiagnosticCodeKeys.indexOf(t)&&(r.handledDiagnosticCodeKeys.push(t),!0)}));await this.onHandle(t)}async canHandle(e){return(0,l.sendTelemetryEvent)(u.EventName.DIAGNOSTICS_MESSAGE,void 0,{code:e.code}),this.supportedDiagnosticCodes.filter((t=>t===e.code)).length>0}getDiagnosticsKey(e){if(e.scope===d.DiagnosticScope.Global)return e.code;const t=this.serviceContainer.get(a.IWorkspaceService),n=e.resource?t.getWorkspaceFolder(e.resource):void 0;return`${e.code}dbe75733-0407-4124-a1b2-ca769dc30523${n?n.uri.fsPath:""}`}};h.handledDiagnosticCodeKeys=[],h=r=i([(0,s.injectable)(),o(0,(0,s.unmanaged)()),o(1,(0,s.unmanaged)()),o(2,(0,s.unmanaged)()),o(3,(0,s.unmanaged)()),o(4,(0,s.unmanaged)())],h),t.BaseDiagnosticsService=h},60474:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentPathVariableDiagnosticsService=t.EnvironmentPathVariableDiagnosticsServiceId=void 0;const o=n(86700),s=n(66828),a=n(17585);n(32727);const c=n(84974),l=n(61684),u=n(67098),d=n(77498),p=n(66674),h=n(16356),f=n(7587),g=n(51475),m=n(93971);class v extends p.BaseDiagnostic{constructor(e,t){super(f.DiagnosticCodes.InvalidEnvironmentPathVariableDiagnostic,e,s.DiagnosticSeverity.Warning,m.DiagnosticScope.Global,t)}}t.EnvironmentPathVariableDiagnosticsServiceId="EnvironmentPathVariableDiagnosticsServiceId";let y=class extends p.BaseDiagnosticsService{constructor(e,t){super([f.DiagnosticCodes.InvalidEnvironmentPathVariableDiagnostic],e,t,!0,!0),this.platform=this.serviceContainer.get(c.IPlatformService),this.messageService=e.get(m.IDiagnosticHandlerService,g.DiagnosticCommandPromptHandlerServiceId)}async diagnose(e){if(this.platform.isWindows&&this.doesPathVariableHaveInvalidEntries()){const t=this.serviceContainer.get(a.IApplicationEnvironment),n="The environment variable '{0}' seems to have some paths containing the '\"' character. The existence of such a character is known to have caused the {1} extension to not load. If the extension fails to load please modify your paths to remove this '\"' character.".format(this.platform.pathVariableName,t.extensionName);return[new v(n,e)]}return[]}async onHandle(e){if(0===e.length||!this.canHandle(e[0]))return;const t=e[0];if(await this.filterService.shouldIgnoreDiagnostic(t.code))return;const n=this.serviceContainer.get(h.IDiagnosticsCommandFactory),r=[{prompt:u.Common.ignore},{prompt:u.Common.alwaysIgnore,command:n.createCommand(t,{type:"ignore",options:m.DiagnosticScope.Global})},{prompt:u.Common.moreInfo,command:n.createCommand(t,{type:"launch",options:"https://aka.ms/Niq35h"})}];await this.messageService.handle(t,{commandPrompts:r})}doesPathVariableHaveInvalidEntries(){const e=this.serviceContainer.get(l.ICurrentProcess).env[this.platform.pathVariableName],t=this.serviceContainer.get(l.IPathUtils).delimiter;return(e||"").split(t).filter((e=>e.indexOf('"')>=0)).length>0}};y=r([(0,o.injectable)(),i(0,(0,o.inject)(d.IServiceContainer)),i(1,(0,o.inject)(l.IDisposableRegistry))],y),t.EnvironmentPathVariableDiagnosticsService=y},42655:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidPythonPathInDebuggerService=t.InvalidPythonPathInDebuggerServiceId=void 0;const o=n(86700),s=n(71017),a=n(66828),c=n(17585);n(32727);const l=n(61684),u=n(67098),d=n(48683),p=n(41691),h=n(18639),f=n(77498),g=n(19735),m=n(66674),v=n(16356),y=n(7587),b=n(51475),S=n(93971),_={[y.DiagnosticCodes.InvalidPythonPathInDebuggerSettingsDiagnostic]:u.Diagnostics.invalidPythonPathInDebuggerSettings,[y.DiagnosticCodes.InvalidPythonPathInDebuggerLaunchDiagnostic]:u.Diagnostics.invalidPythonPathInDebuggerLaunch};class E extends m.BaseDiagnostic{constructor(e,t){super(e,_[e],a.DiagnosticSeverity.Error,S.DiagnosticScope.WorkspaceFolder,t,void 0,"always")}}t.InvalidPythonPathInDebuggerServiceId="InvalidPythonPathInDebuggerServiceId";let w=class extends m.BaseDiagnosticsService{constructor(e,t,n,r,i,o,s,a){super([y.DiagnosticCodes.InvalidPythonPathInDebuggerSettingsDiagnostic,y.DiagnosticCodes.InvalidPythonPathInDebuggerLaunchDiagnostic],e,s,!0),this.workspace=t,this.commandFactory=n,this.interpreterHelper=r,this.documentManager=i,this.configService=o,this.messageService=a}async diagnose(){return[]}async validatePythonPath(e,t,n){return"${command:python.interpreterPath}"!==(e=e?this.resolveVariables(e,n):void 0)&&e||(e=this.configService.getSettings(n).pythonPath),!!await this.interpreterHelper.getInterpreterInformation(e).catch((()=>{}))||((0,g.traceError)(`Invalid Python Path '${e}'`),t===p.PythonPathSource.launchJson?this.handle([new E(y.DiagnosticCodes.InvalidPythonPathInDebuggerLaunchDiagnostic,n)]).catch((e=>(0,g.traceError)("Failed to handle invalid python path in launch.json debugger",e))).ignoreErrors():this.handle([new E(y.DiagnosticCodes.InvalidPythonPathInDebuggerSettingsDiagnostic,n)]).catch((e=>(0,g.traceError)("Failed to handle invalid python path in settings.json debugger",e))).ignoreErrors(),!1)}async onHandle(e){if(0===e.length||!this.canHandle(e[0]))return;const t=e[0],n=this.getCommandPrompts(t);await this.messageService.handle(t,{commandPrompts:n})}resolveVariables(e,t){return new d.SystemVariables(t,void 0,this.workspace).resolveAny(e)}getCommandPrompts(e){switch(e.code){case y.DiagnosticCodes.InvalidPythonPathInDebuggerSettingsDiagnostic:return[{prompt:u.Common.selectPythonInterpreter,command:this.commandFactory.createCommand(e,{type:"executeVSCCommand",options:"python.setInterpreter"})}];case y.DiagnosticCodes.InvalidPythonPathInDebuggerLaunchDiagnostic:return[{prompt:u.Common.openLaunch,command:{diagnostic:e,invoke:async()=>{const e=(t=a.workspace.workspaceFolders[0],s.join(t.uri.fsPath,".vscode","launch.json"));var t;const n=await this.documentManager.openTextDocument(e);await this.documentManager.showTextDocument(n)}}}];default:throw new Error("Invalid diagnostic for 'InvalidPythonPathInDebuggerService'")}}};w=r([(0,o.injectable)(),i(0,(0,o.inject)(f.IServiceContainer)),i(1,(0,o.inject)(c.IWorkspaceService)),i(2,(0,o.inject)(v.IDiagnosticsCommandFactory)),i(3,(0,o.inject)(h.IInterpreterHelper)),i(4,(0,o.inject)(c.IDocumentManager)),i(5,(0,o.inject)(l.IConfigurationService)),i(6,(0,o.inject)(l.IDisposableRegistry)),i(7,(0,o.inject)(S.IDiagnosticHandlerService)),i(7,(0,o.named)(b.DiagnosticCommandPromptHandlerServiceId))],w),t.InvalidPythonPathInDebuggerService=w},94117:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.JediPython27NotSupportedDiagnosticService=t.JediPython27NotSupportedDiagnosticServiceId=t.JediPython27NotSupportedDiagnostic=void 0;const o=n(86700),s=n(66828),a=n(90819),c=n(17585),l=n(61684),u=n(67098),d=n(18639),p=n(77498),h=n(66674),f=n(16356),g=n(7587),m=n(51475),v=n(93971);class y extends h.BaseDiagnostic{constructor(e,t){super(g.DiagnosticCodes.JediPython27NotSupportedDiagnostic,e,s.DiagnosticSeverity.Warning,v.DiagnosticScope.Global,t)}}t.JediPython27NotSupportedDiagnostic=y,t.JediPython27NotSupportedDiagnosticServiceId="JediPython27NotSupportedDiagnosticServiceId";let b=class extends h.BaseDiagnosticsService{constructor(e,t,n,r,i,o){super([g.DiagnosticCodes.JediPython27NotSupportedDiagnostic],e,o,!0),this.interpreterService=t,this.workspaceService=n,this.configurationService=r,this.messageService=i}async diagnose(e){var t,n;const r=await this.interpreterService.getActiveInterpreter(e),{languageServer:i}=this.configurationService.getSettings(e);return await this.updateLanguageServerSetting(e),r&&(null!==(n=null===(t=r.version)||void 0===t?void 0:t.major)&&void 0!==n?n:0)<3&&i===a.LanguageServerType.Jedi?[new y(u.Python27Support.jediMessage,e)]:[]}async onHandle(e){if(0===e.length||!this.canHandle(e[0]))return;const t=e[0];if(await this.filterService.shouldIgnoreDiagnostic(t.code))return;const n=this.serviceContainer.get(f.IDiagnosticsCommandFactory),r=[{prompt:u.Common.gotIt},{prompt:u.Common.doNotShowAgain,command:n.createCommand(t,{type:"ignore",options:v.DiagnosticScope.Global})}];await this.messageService.handle(t,{commandPrompts:r})}async updateLanguageServerSetting(e){const t=this.workspaceService.getConfiguration("python",e).inspect("languageServer");let n;if((null==t?void 0:t.workspaceValue)===a.LanguageServerType.JediLSP)n=s.ConfigurationTarget.Workspace;else{if((null==t?void 0:t.globalValue)!==a.LanguageServerType.JediLSP)return;n=s.ConfigurationTarget.Global}await this.configurationService.updateSetting("languageServer",a.LanguageServerType.Jedi,e,n)}};b=r([i(0,(0,o.inject)(p.IServiceContainer)),i(1,(0,o.inject)(d.IInterpreterService)),i(2,(0,o.inject)(c.IWorkspaceService)),i(3,(0,o.inject)(l.IConfigurationService)),i(4,(0,o.inject)(v.IDiagnosticHandlerService)),i(4,(0,o.named)(m.DiagnosticCommandPromptHandlerServiceId)),i(5,(0,o.inject)(l.IDisposableRegistry))],b),t.JediPython27NotSupportedDiagnosticService=b},21513:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidMacPythonInterpreterService=t.InvalidMacPythonInterpreterServiceId=t.InvalidMacPythonInterpreterDiagnostic=void 0;const o=n(86700),s=n(66828);n(32727);const a=n(84974),c=n(61684),l=n(18639),u=n(77498),d=n(66674),p=n(16356),h=n(7587),f=n(51475),g=n(93971),m=n(67098),v={[h.DiagnosticCodes.MacInterpreterSelected]:s.l10n.t("The selected macOS system install of Python is not recommended, some functionality in the extension will be limited. [Install another version of Python](https://www.python.org/downloads) or select a different interpreter for the best experience. [Learn more](https://aka.ms/AA7jfor).")};class y extends d.BaseDiagnostic{constructor(e,t){super(e,v[e],s.DiagnosticSeverity.Error,g.DiagnosticScope.WorkspaceFolder,t)}}t.InvalidMacPythonInterpreterDiagnostic=y,t.InvalidMacPythonInterpreterServiceId="InvalidMacPythonInterpreterServiceId";let b=class extends d.BaseDiagnosticsService{constructor(e,t,n,r){super([h.DiagnosticCodes.MacInterpreterSelected],e,t,!0),this.platform=n,this.helper=r,this.changeThrottleTimeout=1e3,this.addPythonPathChangedHandler()}dispose(){this.timeOut&&"number"!=typeof this.timeOut&&(clearTimeout(this.timeOut),this.timeOut=void 0)}async diagnose(e){if(!this.platform.isMac)return[];const t=this.serviceContainer.get(c.IConfigurationService).getSettings(e);return await this.helper.isMacDefaultPythonPath(t.pythonPath)?[new y(h.DiagnosticCodes.MacInterpreterSelected,e)]:[]}async onHandle(e){if(0===e.length)return;const t=this.serviceContainer.get(g.IDiagnosticHandlerService,f.DiagnosticCommandPromptHandlerServiceId);await Promise.all(e.map((async e=>{const n=await this.canHandle(e),r=await this.filterService.shouldIgnoreDiagnostic(e.code);if(!n||r)return;const i=this.getCommandPrompts(e);await t.handle(e,{commandPrompts:i,message:e.message})})))}addPythonPathChangedHandler(){const e=this.serviceContainer.get(c.IDisposableRegistry),t=this.serviceContainer.get(c.IInterpreterPathService);e.push(t.onDidChange((e=>this.onDidChangeConfiguration(e))))}async onDidChangeConfiguration(e){const t=e.uri;this.timeOut&&"number"!=typeof this.timeOut&&(clearTimeout(this.timeOut),this.timeOut=void 0),this.timeOut=setTimeout((()=>{this.timeOut=void 0,this.diagnose(t).then((e=>this.handle(e))).ignoreErrors()}),this.changeThrottleTimeout)}getCommandPrompts(e){const t=this.serviceContainer.get(p.IDiagnosticsCommandFactory);if(e.code===h.DiagnosticCodes.MacInterpreterSelected)return[{prompt:m.Common.selectPythonInterpreter,command:t.createCommand(e,{type:"executeVSCCommand",options:"python.setInterpreter"})},{prompt:m.Common.doNotShowAgain,command:t.createCommand(e,{type:"ignore",options:g.DiagnosticScope.Global})}];throw new Error("Invalid diagnostic for 'InvalidMacPythonInterpreterService'")}};b=r([(0,o.injectable)(),i(0,(0,o.inject)(u.IServiceContainer)),i(1,(0,o.inject)(c.IDisposableRegistry)),i(2,(0,o.inject)(a.IPlatformService)),i(3,(0,o.inject)(l.IInterpreterHelper))],b),t.InvalidMacPythonInterpreterService=b},54205:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PowerShellActivationHackDiagnosticsService=t.PowerShellActivationHackDiagnosticsServiceId=t.PowershellActivationNotAvailableDiagnostic=void 0;const o=n(86700),s=n(66828);n(32727);const a=n(87688),c=n(61684),l=n(67098),u=n(77498),d=n(19735),p=n(54813),h=n(61522),f=n(66674),g=n(16356),m=n(7587),v=n(51475),y=n(93971),b=s.l10n.t("Activation of the selected Python environment is not supported in PowerShell. Consider changing your shell to Command Prompt.");class S extends f.BaseDiagnostic{constructor(e){super(m.DiagnosticCodes.EnvironmentActivationInPowerShellWithBatchFilesNotSupportedDiagnostic,b,s.DiagnosticSeverity.Warning,y.DiagnosticScope.Global,e,void 0,"always")}}t.PowershellActivationNotAvailableDiagnostic=S,t.PowerShellActivationHackDiagnosticsServiceId="EnvironmentActivationInPowerShellWithBatchFilesNotSupportedDiagnostic";let _=class extends f.BaseDiagnosticsService{constructor(e,t){super([m.DiagnosticCodes.EnvironmentActivationInPowerShellWithBatchFilesNotSupportedDiagnostic],e,t,!0),this.messageService=e.get(y.IDiagnosticHandlerService,v.DiagnosticCommandPromptHandlerServiceId)}async diagnose(){return[]}async onHandle(e){if(0===e.length||!this.canHandle(e[0]))return;const t=e[0];if(await this.filterService.shouldIgnoreDiagnostic(t.code))return;const n=this.serviceContainer.get(g.IDiagnosticsCommandFactory),r=this.serviceContainer.get(c.ICurrentProcess),i=this.serviceContainer.get(c.IConfigurationService),o=[{prompt:l.Common.useCommandPrompt,command:{diagnostic:t,invoke:async()=>{(0,p.sendTelemetryEvent)(h.EventName.DIAGNOSTICS_ACTION,void 0,{action:"switchToCommandPrompt"}),(0,a.useCommandPromptAsDefaultShell)(r,i).catch((e=>(0,d.traceError)("Use Command Prompt as default shell",e)))}}},{prompt:l.Common.ignore},{prompt:l.Common.alwaysIgnore,command:n.createCommand(t,{type:"ignore",options:y.DiagnosticScope.Global})},{prompt:l.Common.moreInfo,command:n.createCommand(t,{type:"launch",options:"https://aka.ms/CondaPwsh"})}];await this.messageService.handle(t,{commandPrompts:o})}};_=r([(0,o.injectable)(),i(0,(0,o.inject)(u.IServiceContainer)),i(1,(0,o.inject)(c.IDisposableRegistry))],_),t.PowerShellActivationHackDiagnosticsService=_},9798:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PylanceDefaultDiagnosticService=t.PylanceDefaultDiagnosticServiceId=t.PylanceDefaultDiagnostic=t.PYLANCE_PROMPT_MEMENTO=void 0;const o=n(86700),s=n(66828),a=n(61684),c=n(67098),l=n(77498),u=n(66674),d=n(7587),p=n(51475),h=n(93971);t.PYLANCE_PROMPT_MEMENTO="pylanceDefaultPromptMemento";class f extends u.BaseDiagnostic{constructor(e,t){super(d.DiagnosticCodes.PylanceDefaultDiagnostic,e,s.DiagnosticSeverity.Information,h.DiagnosticScope.Global,t)}}t.PylanceDefaultDiagnostic=f,t.PylanceDefaultDiagnosticServiceId="PylanceDefaultDiagnosticServiceId";let g=class extends u.BaseDiagnosticsService{constructor(e,t,n,r){super([d.DiagnosticCodes.PylanceDefaultDiagnostic],e,r,!0,!0),this.context=t,this.messageService=n,this.initialMementoValue=void 0,this.initialMementoValue=this.context.globalState.get("extensionVersion")}async diagnose(e){return await this.shouldShowPrompt()?[new f(c.Diagnostics.pylanceDefaultMessage,e)]:[]}async onHandle(e){if(0===e.length||!this.canHandle(e[0]))return;const t=e[0];if(await this.filterService.shouldIgnoreDiagnostic(t.code))return;const n=[{prompt:c.Common.ok}];await this.messageService.handle(t,{commandPrompts:n,onClose:this.updateMemento.bind(this)})}async updateMemento(){await this.context.globalState.update(t.PYLANCE_PROMPT_MEMENTO,!0)}async shouldShowPrompt(){const e=this.initialMementoValue,n=this.context.globalState.get(t.PYLANCE_PROMPT_MEMENTO);return void 0===e?(await this.updateMemento(),!1):void 0===n}};g=r([i(0,(0,o.inject)(l.IServiceContainer)),i(1,(0,o.inject)(a.IExtensionContext)),i(2,(0,o.inject)(h.IDiagnosticHandlerService)),i(2,(0,o.named)(p.DiagnosticCommandPromptHandlerServiceId)),i(3,(0,o.inject)(a.IDisposableRegistry))],g),t.PylanceDefaultDiagnosticService=g},81613:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidPythonInterpreterService=t.InvalidPythonInterpreterServiceId=t.DefaultShellDiagnostic=t.InvalidPythonInterpreterDiagnostic=void 0;const o=n(86700),s=n(66828);n(32727);const a=n(71017),c=n(61684),l=n(18639),u=n(77498),d=n(66674),p=n(16356),h=n(7587),f=n(51475),g=n(93971),m=n(67098),v=n(77570),y=n(17585),b=n(54813),S=n(61522),_=n(36952),E=n(3481),w=n(87450),T=n(84974),C=n(19735),P=n(31776),x=n(47237),I=n(29983),R=n(48431),D={[h.DiagnosticCodes.NoPythonInterpretersDiagnostic]:s.l10n.t("No Python interpreter is selected. Please select a Python interpreter to enable features such as IntelliSense, linting, and debugging."),[h.DiagnosticCodes.InvalidPythonInterpreterDiagnostic]:s.l10n.t("An Invalid Python interpreter is selected{0}, please try changing it to enable features such as IntelliSense, linting, and debugging. See output for more details regarding why the interpreter is invalid."),[h.DiagnosticCodes.InvalidComspecDiagnostic]:s.l10n.t('We detected an issue with one of your environment variables that breaks features such as IntelliSense, linting and debugging. Try setting the "ComSpec" variable to a valid Command Prompt path in your system to fix it.'),[h.DiagnosticCodes.IncompletePathVarDiagnostic]:s.l10n.t('We detected an issue with "Path" environment variable that breaks features such as IntelliSense, linting and debugging. Please edit it to make sure it contains the "System32" subdirectories.'),[h.DiagnosticCodes.DefaultShellErrorDiagnostic]:s.l10n.t('We detected an issue with your default shell that breaks features such as IntelliSense, linting and debugging. Try resetting "ComSpec" and "Path" environment variables to fix it.')};class O extends d.BaseDiagnostic{constructor(e,t,n,r=g.DiagnosticScope.WorkspaceFolder){var i;let o="";if(n.workspaceFile&&n.workspaceFolders&&(null===(i=n.workspaceFolders)||void 0===i?void 0:i.length)>1){const e=n.getWorkspaceFolder(t);e&&(o=` ${s.l10n.t("for workspace")} ${a.basename(e.uri.fsPath)}`)}super(e,D[e].format(o),s.DiagnosticSeverity.Error,r,t,void 0,"always")}}t.InvalidPythonInterpreterDiagnostic=O;class k extends d.BaseDiagnostic{constructor(e,t,n=g.DiagnosticScope.Global){super(e,D[e],s.DiagnosticSeverity.Error,n,t,void 0,"always")}}t.DefaultShellDiagnostic=k,t.InvalidPythonInterpreterServiceId="InvalidPythonInterpreterServiceId";let A=class extends d.BaseDiagnosticsService{constructor(e,t){super([h.DiagnosticCodes.NoPythonInterpretersDiagnostic,h.DiagnosticCodes.InvalidPythonInterpreterDiagnostic,h.DiagnosticCodes.InvalidComspecDiagnostic,h.DiagnosticCodes.IncompletePathVarDiagnostic,h.DiagnosticCodes.DefaultShellErrorDiagnostic],e,t,!1),this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0}}async activate(){const e=this.serviceContainer.get(y.ICommandManager);this.disposableRegistry.push(e.registerCommand(v.Commands.TriggerEnvironmentSelection,(e=>this.triggerEnvSelectionIfNecessary(e))));const t=this.serviceContainer.get(l.IInterpreterService);this.disposableRegistry.push(t.onDidChangeInterpreterConfiguration((t=>e.executeCommand(v.Commands.TriggerEnvironmentSelection,t).then(E.noop,E.noop))))}async diagnose(e){return this.diagnoseDefaultShell(e)}async _manualDiagnose(e){const t=this.serviceContainer.get(y.IWorkspaceService),n=this.serviceContainer.get(l.IInterpreterService),r=await this.diagnoseDefaultShell(e);if(r.length>0)return r;const i=await n.hasInterpreters(),o="python"===this.serviceContainer.get(c.IInterpreterPathService).get(e);return!i&&o?[new O(h.DiagnosticCodes.NoPythonInterpretersDiagnostic,e,t,g.DiagnosticScope.Global)]:await n.getActiveInterpreter(e)?[]:[new O(h.DiagnosticCodes.InvalidPythonInterpreterDiagnostic,e,t)]}async triggerEnvSelectionIfNecessary(e){const t=await this._manualDiagnose(e);return!t.length||(this.handle(t).ignoreErrors(),!1)}async diagnoseDefaultShell(e){if((0,w.getOSType)()!==w.OSType.Windows)return[];const t=this.serviceContainer.get(l.IInterpreterService);if(await t.getActiveInterpreter(e))return[];try{await this.shellExecPython()}catch(t){if(-4058===t.errno)return(0,C.traceError)("ComSpec is likely set to an invalid value",(0,w.getEnvironmentVariable)("ComSpec")),await this.isComspecInvalid()?[new k(h.DiagnosticCodes.InvalidComspecDiagnostic,e)]:this.isPathVarIncomplete()?((0,C.traceError)("PATH env var appears to be incomplete",process.env.Path,process.env.PATH),[new k(h.DiagnosticCodes.IncompletePathVarDiagnostic,e)]):[new k(h.DiagnosticCodes.DefaultShellErrorDiagnostic,e)]}return[]}async isComspecInvalid(){var e;const t=null!==(e=(0,w.getEnvironmentVariable)("ComSpec"))&&void 0!==e?e:"";return this.serviceContainer.get(T.IFileSystem).fileExists(t).then((e=>!e))}isPathVarIncomplete(){var e;const t=(0,x.getSearchPathEnvVarNames)(),n=null!==(e=(0,w.getEnvironmentVariable)("SystemRoot"))&&void 0!==e?e:"C:\\WINDOWS",r=a.join(n,"system32");for(const e of t){const t=(0,w.getEnvironmentVariable)(e);if(t&&(0,R.normCasePath)(t).includes((0,R.normCasePath)(r)))return!1}return!0}async shellExecPython(){const e=this.serviceContainer.get(c.IConfigurationService),{pythonPath:t}=e.getSettings(),[n]=(0,P.getExecutable)(),r=[t,...n].reduce(((e,t)=>e?`${e} ${t.toCommandArgumentForPythonExt()}`:`${t.toCommandArgumentForPythonExt()}`),""),i=this.serviceContainer.get(I.IProcessServiceFactory);return(await i.create()).shellExec(r,{timeout:15e3})}async onHandle(e){if(0===e.length)return;const t=this.serviceContainer.get(g.IDiagnosticHandlerService,f.DiagnosticCommandPromptHandlerServiceId);await Promise.all(e.map((async e=>{if(!this.canHandle(e))return;const n=this.getCommandPrompts(e),r=function(e){if(e.code===h.DiagnosticCodes.NoPythonInterpretersDiagnostic)return e=>{(0,b.sendTelemetryEvent)(S.EventName.PYTHON_NOT_INSTALLED_PROMPT,void 0,{selection:e?"Download":"Ignore"})}}(e);await t.handle(e,{commandPrompts:n,message:e.message,onClose:r})})))}getCommandPrompts(e){const t=this.serviceContainer.get(p.IDiagnosticsCommandFactory);if(e.code===h.DiagnosticCodes.InvalidComspecDiagnostic||e.code===h.DiagnosticCodes.IncompletePathVarDiagnostic||e.code===h.DiagnosticCodes.DefaultShellErrorDiagnostic){const n={InvalidComspecDiagnostic:"https://aka.ms/AAk3djo",IncompletePathVarDiagnostic:"https://aka.ms/AAk744c",DefaultShellErrorDiagnostic:"https://aka.ms/AAk7qix"};return[{prompt:m.Common.seeInstructions,command:t.createCommand(e,{type:"launch",options:n[e.code]})}]}const n=[{prompt:m.Common.selectPythonInterpreter,command:t.createCommand(e,{type:"executeVSCCommand",options:v.Commands.Set_Interpreter})}];return e.code===h.DiagnosticCodes.InvalidPythonInterpreterDiagnostic&&n.push({prompt:m.Common.openOutputPanel,command:t.createCommand(e,{type:"executeVSCCommand",options:v.Commands.ViewOutput})}),n}};r([(0,_.cache)(-1,!0)],A.prototype,"shellExecPython",null),r([(0,_.cache)(1e3,!0)],A.prototype,"onHandle",null),A=r([(0,o.injectable)(),i(0,(0,o.inject)(u.IServiceContainer)),i(1,(0,o.inject)(c.IDisposableRegistry))],A),t.InvalidPythonInterpreterService=A},49264:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SwitchToDefaultLanguageServerDiagnosticService=t.SwitchToDefaultLanguageServerDiagnosticServiceId=t.SwitchToDefaultLanguageServerDiagnostic=void 0;const o=n(86700),s=n(66828),a=n(90819),c=n(17585),l=n(61684),u=n(67098),d=n(77498),p=n(66674),h=n(7587),f=n(51475),g=n(93971);class m extends p.BaseDiagnostic{constructor(e,t){super(h.DiagnosticCodes.SwitchToDefaultLanguageServerDiagnostic,e,s.DiagnosticSeverity.Warning,g.DiagnosticScope.Global,t)}}t.SwitchToDefaultLanguageServerDiagnostic=m,t.SwitchToDefaultLanguageServerDiagnosticServiceId="SwitchToDefaultLanguageServerDiagnosticServiceId";let v=class extends p.BaseDiagnosticsService{constructor(e,t,n,r){super([h.DiagnosticCodes.JediPython27NotSupportedDiagnostic],e,r,!0,!0),this.workspaceService=t,this.messageService=n}diagnose(e){let t=!1;const n=this.workspaceService.getConfiguration("python"),r=n.inspect("languageServer");return(null==r?void 0:r.workspaceValue)===a.LanguageServerType.Microsoft&&(n.update("languageServer","Default",s.ConfigurationTarget.Workspace),t=!0),(null==r?void 0:r.globalValue)===a.LanguageServerType.Microsoft&&(n.update("languageServer","Default",s.ConfigurationTarget.Global),t=!0),Promise.resolve(t?[new m(u.SwitchToDefaultLS.bannerMessage,e)]:[])}async onHandle(e){if(0===e.length||!this.canHandle(e[0]))return;const t=e[0];await this.filterService.shouldIgnoreDiagnostic(t.code)||await this.messageService.handle(t,{commandPrompts:[{prompt:u.Common.gotIt}]})}};v=r([(0,o.injectable)(),i(0,(0,o.inject)(d.IServiceContainer)),i(1,(0,o.inject)(c.IWorkspaceService)),i(2,(0,o.inject)(g.IDiagnosticHandlerService)),i(2,(0,o.named)(f.DiagnosticCommandPromptHandlerServiceId)),i(3,(0,o.inject)(l.IDisposableRegistry))],v),t.SwitchToDefaultLanguageServerDiagnosticService=v},69686:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseDiagnosticCommand=void 0,t.BaseDiagnosticCommand=class{constructor(e){this.diagnostic=e}}},2852:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExecuteVSCCommand=void 0;const r=n(17585),i=n(54813),o=n(61522),s=n(69686);class a extends s.BaseDiagnosticCommand{constructor(e,t,n){super(e),this.serviceContainer=t,this.commandName=n}async invoke(){return(0,i.sendTelemetryEvent)(o.EventName.DIAGNOSTICS_ACTION,void 0,{commandName:this.commandName}),this.serviceContainer.get(r.ICommandManager).executeCommand(this.commandName).then((()=>{}))}}t.ExecuteVSCCommand=a},23185:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticsCommandFactory=void 0;const o=n(86700),s=n(77498),a=n(2852),c=n(28634),l=n(33690);let u=class{constructor(e){this.serviceContainer=e}createCommand(e,t){const n=t.type;switch(t.type){case"ignore":return new c.IgnoreDiagnosticCommand(e,this.serviceContainer,t.options);case"launch":return new l.LaunchBrowserCommand(e,this.serviceContainer,t.options);case"executeVSCCommand":return new a.ExecuteVSCCommand(e,this.serviceContainer,t.options);default:throw new Error(`Unknown Diagnostic command commandType '${n}'`)}}};u=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IServiceContainer))],u),t.DiagnosticsCommandFactory=u},28634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IgnoreDiagnosticCommand=void 0;const r=n(54813),i=n(61522),o=n(93971),s=n(69686);class a extends s.BaseDiagnosticCommand{constructor(e,t,n){super(e),this.serviceContainer=t,this.scope=n}invoke(){return(0,r.sendTelemetryEvent)(i.EventName.DIAGNOSTICS_ACTION,void 0,{ignoreCode:this.diagnostic.code}),this.serviceContainer.get(o.IDiagnosticFilterService).ignoreDiagnostic(this.diagnostic.code,this.scope)}}t.IgnoreDiagnosticCommand=a},33690:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchBrowserCommand=void 0;const r=n(61684),i=n(54813),o=n(61522),s=n(69686);class a extends s.BaseDiagnosticCommand{constructor(e,t,n){super(e),this.serviceContainer=t,this.url=n}async invoke(){return(0,i.sendTelemetryEvent)(o.EventName.DIAGNOSTICS_ACTION,void 0,{url:this.url}),this.serviceContainer.get(r.IBrowserService).launch(this.url)}}t.LaunchBrowserCommand=a},16356:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IDiagnosticsCommandFactory=void 0,t.IDiagnosticsCommandFactory=Symbol("IDiagnosticsCommandFactory")},7587:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticCodes=void 0,(n=t.DiagnosticCodes||(t.DiagnosticCodes={})).InvalidEnvironmentPathVariableDiagnostic="InvalidEnvironmentPathVariableDiagnostic",n.InvalidDebuggerTypeDiagnostic="InvalidDebuggerTypeDiagnostic",n.NoPythonInterpretersDiagnostic="NoPythonInterpretersDiagnostic",n.MacInterpreterSelected="MacInterpreterSelected",n.InvalidPythonPathInDebuggerSettingsDiagnostic="InvalidPythonPathInDebuggerSettingsDiagnostic",n.InvalidPythonPathInDebuggerLaunchDiagnostic="InvalidPythonPathInDebuggerLaunchDiagnostic",n.EnvironmentActivationInPowerShellWithBatchFilesNotSupportedDiagnostic="EnvironmentActivationInPowerShellWithBatchFilesNotSupportedDiagnostic",n.InvalidPythonInterpreterDiagnostic="InvalidPythonInterpreterDiagnostic",n.InvalidComspecDiagnostic="InvalidComspecDiagnostic",n.IncompletePathVarDiagnostic="IncompletePathVarDiagnostic",n.DefaultShellErrorDiagnostic="DefaultShellErrorDiagnostic",n.LSNotSupportedDiagnostic="LSNotSupportedDiagnostic",n.PythonPathDeprecatedDiagnostic="PythonPathDeprecatedDiagnostic",n.JustMyCodeDiagnostic="JustMyCodeDiagnostic",n.ConsoleTypeDiagnostic="ConsoleTypeDiagnostic",n.ConfigPythonPathDiagnostic="ConfigPythonPathDiagnostic",n.PylanceDefaultDiagnostic="PylanceDefaultDiagnostic",n.JediPython27NotSupportedDiagnostic="JediPython27NotSupportedDiagnostic",n.SwitchToDefaultLanguageServerDiagnostic="SwitchToDefaultLanguageServerDiagnostic",n.SwitchToPreReleaseExtensionDiagnostic="SwitchToPreReleaseExtensionDiagnostic"},70263:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticFilterService=t.FilterKeys=void 0;const o=n(86700),s=n(61684),a=n(77498),c=n(93971);var l;!function(e){e.GlobalDiagnosticFilter="GLOBAL_DIAGNOSTICS_FILTER",e.WorkspaceDiagnosticFilter="WORKSPACE_DIAGNOSTICS_FILTER"}(l=t.FilterKeys||(t.FilterKeys={}));let u=class{constructor(e){this.serviceContainer=e}async shouldIgnoreDiagnostic(e){const t=this.serviceContainer.get(s.IPersistentStateFactory),n=t.createGlobalPersistentState(l.GlobalDiagnosticFilter,[]),r=t.createWorkspacePersistentState(l.WorkspaceDiagnosticFilter,[]);return n.value.indexOf(e)>=0||r.value.indexOf(e)>=0}async ignoreDiagnostic(e,t){const n=this.serviceContainer.get(s.IPersistentStateFactory),r=t===c.DiagnosticScope.Global?n.createGlobalPersistentState(l.GlobalDiagnosticFilter,[]):n.createWorkspacePersistentState(l.WorkspaceDiagnosticFilter,[]),i=r.value.slice();await r.updateValue(i.concat(e))}};u=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],u),t.DiagnosticFilterService=u},51475:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticCommandPromptHandlerService=t.DiagnosticCommandPromptHandlerServiceId=void 0;const o=n(86700),s=n(66828),a=n(17585),c=n(77498);t.DiagnosticCommandPromptHandlerServiceId="DiagnosticCommandPromptHandlerServiceId";let l=class{constructor(e){this.appShell=e.get(a.IApplicationShell)}async handle(e,t={commandPrompts:[]}){const n=t.commandPrompts.map((e=>e.prompt)),r=await this.displayMessage(t.message?t.message:e.message,e.severity,n);if(t.onClose&&t.onClose(r),!r)return;const i=t.commandPrompts.find((e=>e.prompt===r));i&&i.command&&await i.command.invoke()}async displayMessage(e,t,n){switch(t){case s.DiagnosticSeverity.Error:return this.appShell.showErrorMessage(e,...n);case s.DiagnosticSeverity.Warning:return this.appShell.showWarningMessage(e,...n);default:return this.appShell.showInformationMessage(e,...n)}}};l=r([(0,o.injectable)(),i(0,(0,o.inject)(c.IServiceContainer))],l),t.DiagnosticCommandPromptHandlerService=l},47066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const r=n(90819),i=n(77651),o=n(19897),s=n(60474),a=n(42655),c=n(94117),l=n(21513),u=n(54205),d=n(9798),p=n(81613),h=n(49264),f=n(23185),g=n(16356),m=n(70263),v=n(51475),y=n(93971);t.registerTypes=function(e){e.addSingleton(y.IDiagnosticFilterService,m.DiagnosticFilterService),e.addSingleton(y.IDiagnosticHandlerService,v.DiagnosticCommandPromptHandlerService,v.DiagnosticCommandPromptHandlerServiceId),e.addSingleton(y.IDiagnosticsService,s.EnvironmentPathVariableDiagnosticsService,s.EnvironmentPathVariableDiagnosticsServiceId),e.addSingleton(y.IDiagnosticsService,p.InvalidPythonInterpreterService,p.InvalidPythonInterpreterServiceId),e.addSingleton(r.IExtensionSingleActivationService,p.InvalidPythonInterpreterService),e.addSingleton(y.IDiagnosticsService,a.InvalidPythonPathInDebuggerService,a.InvalidPythonPathInDebuggerServiceId),e.addSingleton(y.IDiagnosticsService,u.PowerShellActivationHackDiagnosticsService,u.PowerShellActivationHackDiagnosticsServiceId),e.addSingleton(y.IDiagnosticsService,l.InvalidMacPythonInterpreterService,l.InvalidMacPythonInterpreterServiceId),e.addSingleton(y.IDiagnosticsService,d.PylanceDefaultDiagnosticService,d.PylanceDefaultDiagnosticServiceId),e.addSingleton(y.IDiagnosticsService,c.JediPython27NotSupportedDiagnosticService,c.JediPython27NotSupportedDiagnosticServiceId),e.addSingleton(y.IDiagnosticsService,h.SwitchToDefaultLanguageServerDiagnosticService,h.SwitchToDefaultLanguageServerDiagnosticServiceId),e.addSingleton(g.IDiagnosticsCommandFactory,f.DiagnosticsCommandFactory),e.addSingleton(i.IApplicationDiagnostics,o.ApplicationDiagnostics)}},62867:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SourceMapSupportService=void 0;const o=n(86700),s=n(66828),a=n(17585),c=n(77570),l=n(61684),u=n(67098);let d=class{constructor(e,t,n,r){this.commandManager=e,this.disposables=t,this.configurationService=n,this.shell=r}register(){this.disposables.push(this.commandManager.registerCommand(c.Commands.Enable_SourceMap_Support,this.onEnable,this))}async enable(){await this.configurationService.updateSetting("diagnostics.sourceMapsEnabled",!0,void 0,s.ConfigurationTarget.Global),await this.commandManager.executeCommand("workbench.action.reloadWindow")}async onEnable(){const e=u.Diagnostics.enableSourceMapsAndReloadVSC;await this.shell.showWarningMessage(u.Diagnostics.warnBeforeEnablingSourceMaps,e)===e&&await this.enable()}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(a.ICommandManager)),i(1,(0,o.inject)(l.IDisposableRegistry)),i(2,(0,o.inject)(l.IConfigurationService)),i(3,(0,o.inject)(a.IApplicationShell))],d),t.SourceMapSupportService=d},93971:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ISourceMapSupportService=t.IInvalidPythonPathInDebuggerService=t.IInvalidPythonPathInSettings=t.IDiagnosticHandlerService=t.IDiagnosticFilterService=t.IDiagnosticsService=t.DiagnosticScope=void 0,(n=t.DiagnosticScope||(t.DiagnosticScope={})).Global="Global",n.WorkspaceFolder="WorkspaceFolder",t.IDiagnosticsService=Symbol("IDiagnosticsService"),t.IDiagnosticFilterService=Symbol("IDiagnosticFilterService"),t.IDiagnosticHandlerService=Symbol("IDiagnosticHandlerService"),t.IInvalidPythonPathInSettings=Symbol("IInvalidPythonPathInSettings"),t.IInvalidPythonPathInDebuggerService=Symbol("IInvalidPythonPathInDebuggerService"),t.ISourceMapSupportService=Symbol("ISourceMapSupportService")},30086:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const r=n(47066),i=n(62867),o=n(93971);t.registerTypes=function(e){e.addSingleton(o.ISourceMapSupportService,i.SourceMapSupportService),(0,r.registerTypes)(e)}},77651:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IApplicationDiagnostics=void 0,t.IApplicationDiagnostics=Symbol("IApplicationDiagnostics")},17792:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ActiveResourceService=void 0;const o=n(86700),s=n(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=r([(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,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ApplicationEnvironment=void 0;const o=n(86700),s=n(71017),a=n(81249),c=n(66828),l=n(19735),u=n(84974),d=n(61684),p=n(87450);let h=class{constructor(e,t,n){this.platform=e,this.pathUtils=t,this.process=n}get userSettingsFile(){const e="insiders"===this.channel?"Code - Insiders":"Code";switch(this.platform.osType){case p.OSType.OSX:return s.join(this.pathUtils.home,"Library","Application Support",e,"User","settings.json");case p.OSType.Linux:return s.join(this.pathUtils.home,".config",e,"User","settings.json");case p.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 remoteName(){return c.env.remoteName}get extensionName(){return this.packageJson.displayName}get shell(){return c.env.shell}get onDidChangeShell(){try{return c.env.onDidChangeShell}catch(e){return(0,l.traceError)("Failed to get onDidChangeShell API",e),(new c.EventEmitter).event}}get packageJson(){return n(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}};h=r([(0,o.injectable)(),i(0,(0,o.inject)(u.IPlatformService)),i(1,(0,o.inject)(d.IPathUtils)),i(2,(0,o.inject)(d.ICurrentProcess))],h),t.ApplicationEnvironment=h},13706:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ApplicationShell=void 0;const i=n(86700),o=n(66828),s=n(19735);let a=class{get onDidChangeWindowState(){return o.window.onDidChangeWindowState}showInformationMessage(e,t,...n){return o.window.showInformationMessage(e,t,...n)}showWarningMessage(e,t,...n){return o.window.showWarningMessage(e,t,...n)}showErrorMessage(e,t,...n){return o.window.showErrorMessage(e,t,...n)}showQuickPick(e,t,n){return o.window.showQuickPick(e,t,n)}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,n){return o.window.showTextDocument(e,t,n)}openUrl(e){o.env.openExternal(o.Uri.parse(e))}setStatusBarMessage(e,t){return o.window.setStatusBarMessage(e,t)}createStatusBarItem(e,t,n){return n?o.window.createStatusBarItem(n,e,t):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 n=(new o.CancellationTokenSource).token,r=this.createStatusBarItem(o.StatusBarAlignment.Left),i={report:t=>{r.text=`${e} ${t.message}`}};return r.show(),t(i,n).then((e=>(r.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,{log:!0})}createLanguageStatusItem(e,t){return o.languages.createLanguageStatusItem(e,t)}get onDidWriteTerminalData(){try{return o.window.onDidWriteTerminalData}catch(e){return(0,s.traceError)("Failed to get proposed API onDidWriteTerminalData",e),(new o.EventEmitter).event}}get onDidExecuteTerminalCommand(){try{return o.window.onDidExecuteTerminalCommand}catch(e){return void(0,s.traceError)("Failed to get proposed API TerminalExecutedCommand",e)}}};a=r([(0,i.injectable)()],a),t.ApplicationShell=a},77633:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ClipboardService=void 0;const i=n(86700),o=n(66828);let s=class{async readText(){return o.env.clipboard.readText()}async writeText(e){await o.env.clipboard.writeText(e)}};s=r([(0,i.injectable)()],s),t.ClipboardService=s},17381:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.CommandManager=void 0;const i=n(86700),o=n(66828);let s=class{registerCommand(e,t,n){return o.commands.registerCommand(e,t,n)}registerTextEditorCommand(e,t,n){return o.commands.registerTextEditorCommand(e,t,n)}executeCommand(e,...t){return o.commands.executeCommand(e,...t)}getCommands(e){return o.commands.getCommands(e)}};s=r([(0,i.injectable)()],s),t.CommandManager=s},32907:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CreatePythonFileCommandHandler=void 0;const o=n(86700),s=n(77570),a=n(17585),c=n(54813),l=n(61522),u=n(61684);let d=class{constructor(e,t,n,r){this.commandManager=e,this.workspaceService=t,this.appShell=n,this.disposables=r,this.supportedWorkspaceTypes={untrustedWorkspace:!0,virtualWorkspace:!0}}async activate(){this.disposables.push(this.commandManager.registerCommand(s.Commands.CreateNewFile,this.createPythonFile,this))}async createPythonFile(){const e=await this.workspaceService.openTextDocument({language:"python"});this.appShell.showTextDocument(e),(0,c.sendTelemetryEvent)(l.EventName.CREATE_NEW_FILE_COMMAND)}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(a.ICommandManager)),i(1,(0,o.inject)(a.IWorkspaceService)),i(2,(0,o.inject)(a.IApplicationShell)),i(3,(0,o.inject)(u.IDisposableRegistry))],d),t.CreatePythonFileCommandHandler=d},30651:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReloadVSCodeCommandHandler=void 0;const o=n(86700),s=n(67098),a=n(3481),c=n(17585);let l=class{constructor(e,t){this.commandManager=e,this.appShell=t,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0}}async activate(){this.commandManager.registerCommand("python.reloadVSCode",this.onReloadVSCode,this)}async onReloadVSCode(e){await this.appShell.showInformationMessage(e,s.Common.reload)===s.Common.reload&&this.commandManager.executeCommand("workbench.action.reloadWindow").then(a.noop,a.noop)}};l=r([(0,o.injectable)(),i(0,(0,o.inject)(c.ICommandManager)),i(1,(0,o.inject)(c.IApplicationShell))],l),t.ReloadVSCodeCommandHandler=l},5869:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReportIssueCommandHandler=void 0;const o=n(55674),s=n(22037),a=n(71017),c=n(86700),l=n(96486),u=n(17585),d=n(63281),p=n(18639),h=n(77570),f=n(61684),g=n(54813),m=n(61522),v=n(81387),y=n(89515),b=n(48683),S=n(50189);let _=class{constructor(e,t,n,r,i){var o,s,c;this.commandManager=e,this.workspaceService=t,this.interpreterService=n,this.configurationService=r,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0},this.argSettingsPath=a.join(d.EXTENSION_ROOT_DIR,"resources","report_issue_user_settings.json"),this.templatePath=a.join(d.EXTENSION_ROOT_DIR,"resources","report_issue_template.md"),this.userDataTemplatePath=a.join(d.EXTENSION_ROOT_DIR,"resources","report_issue_user_data_template.md"),this.packageJSONSettings=null===(c=null===(s=null===(o=i.packageJson)||void 0===o?void 0:o.contributes)||void 0===s?void 0:s.configuration)||void 0===c?void 0:c.properties}async activate(){this.commandManager.registerCommand(h.Commands.ReportIssue,this.openReportIssue,this)}async openReportIssue(){var e,t,n,r;const i=this.configurationService.getSettings(),a=JSON.parse(await o.readFile(this.argSettingsPath,"utf8"));let c="";Object.keys(i).forEach((e=>{const t=a[e];if(t)if("object"==typeof t){let n=!1;const r=i[e];"object"==typeof r&&Object.keys(t).forEach((i=>{const o=t[i];if(o){const t=this.getDefaultValue(`${e}.${i}`);if(void 0===t||!(0,l.isEqual)(t,r[i])){n||(c=c.concat(s.EOL,e,s.EOL),n=!0);const t=!0===o?JSON.stringify(r[i]):'""';c=c.concat("• ",i,": ",t,s.EOL)}}}))}else{const n=this.getDefaultValue(e);if(void 0===n||!(0,l.isEqual)(n,i[e])){const n=!0===t?JSON.stringify(i[e]):'""';c=c.concat(s.EOL,e,": ",n,s.EOL)}}}));const u=await o.readFile(this.templatePath,"utf8"),d=await o.readFile(this.userDataTemplatePath,"utf8"),p=await this.interpreterService.getActiveInterpreter(),h=null!==(t=null===(e=null==p?void 0:p.version)||void 0===e?void 0:e.raw)&&void 0!==t?t:"",f=this.workspaceService.getConfiguration("python").get("languageServer")||"Not Found",y=(null==p?void 0:p.envType)||v.EnvironmentType.Unknown,b=(null!==(r=null===(n=this.workspaceService.workspaceFolders)||void 0===n?void 0:n.length)&&void 0!==r?r:0)>1&&""!==c?`Multiroot scenario, following user settings may not apply:${s.EOL}`:"",_=(0,S.getExtensions)().filter((e=>!e.id.startsWith("vscode."))).sort(((e,t)=>e.packageJSON.displayName.localeCompare(t.packageJSON.displayName))).map((e=>`|${e.packageJSON.displayName}|${e.id}|${e.packageJSON.version}|`));await this.commandManager.executeCommand("workbench.action.openIssueReporter",{extensionId:"ms-python.python",issueBody:u,data:d.format(h,y,f,b,c,_.join("\n"))}),(0,g.sendTelemetryEvent)(m.EventName.USE_REPORT_ISSUE_COMMAND,void 0,{})}getDefaultValue(e){var t;if(!this.packageJSONSettings)return;const n=y.PythonSettings.getSettingsUriAndTarget(void 0,this.workspaceService).uri;return new b.SystemVariables(n,void 0,this.workspaceService).resolveAny(null===(t=this.packageJSONSettings[`python.${e}`])||void 0===t?void 0:t.default)}};_=r([(0,c.injectable)(),i(0,(0,c.inject)(u.ICommandManager)),i(1,(0,c.inject)(u.IWorkspaceService)),i(2,(0,c.inject)(p.IInterpreterService)),i(3,(0,c.inject)(f.IConfigurationService)),i(4,(0,c.inject)(u.IApplicationEnvironment))],_),t.ReportIssueCommandHandler=_},54094:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContextKeyManager=void 0;const o=n(86700),s=n(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=r([(0,o.injectable)(),i(0,(0,o.inject)(s.ICommandManager))],a),t.ContextKeyManager=a},56994:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionContextKey=void 0,(n=t.ExtensionContextKey||(t.ExtensionContextKey={})).showInstallPythonTile="showInstallPythonTile",n.HasFailedTests="hasFailedTests",n.RefreshingTests="refreshingTests",n.IsJupyterInstalled="isJupyterInstalled"},54144:function(e,t,n){"use strict";var r,i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.DebugService=void 0;const o=n(86700),s=n(66828);let a=r=class{get activeDebugConsole(){return s.debug.activeDebugConsole}get activeDebugSession(){return s.debug.activeDebugSession}get breakpoints(){return s.debug.breakpoints}get onDidChangeActiveDebugSession(){return s.debug.onDidChangeActiveDebugSession}get onDidStartDebugSession(){return s.debug.onDidStartDebugSession}get onDidReceiveDebugSessionCustomEvent(){return s.debug.onDidReceiveDebugSessionCustomEvent}get onDidTerminateDebugSession(){return s.debug.onDidTerminateDebugSession}get onDidChangeBreakpoints(){return s.debug.onDidChangeBreakpoints}registerDebugConfigurationProvider(e,t){return s.debug.registerDebugConfigurationProvider(e,t)}registerDebugAdapterTrackerFactory(e,t){return s.debug.registerDebugAdapterTrackerFactory(e,t)}startDebugging(e,t,n){return s.debug.startDebugging(e,t,n)}addBreakpoints(e){s.debug.addBreakpoints(e)}removeBreakpoints(e){s.debug.removeBreakpoints(e)}registerDebugAdapterDescriptorFactory(e,t){return s.debug.registerDebugAdapterDescriptorFactory(e,t)}};a.instance=new r,a=r=i([(0,o.injectable)()],a),t.DebugService=a},67808:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionTelemetry=void 0;const o=n(86700),s=n(54813),a=n(61522),c=n(61684),l=n(70057),u=n(17585);class d{constructor(e){this.timer=new l.StopWatch,this.trigger="launch",this.trigger=e.configuration.request;const t=e.configuration;this.console=t.console}onWillStartSession(){this.sendTelemetry(a.EventName.DEBUG_SESSION_START)}onDidSendMessage(e){"response"===e.type&&"configurationDone"===e.command&&this.sendTelemetry(a.EventName.DEBUG_SESSION_USER_CODE_RUNNING)}onWillStopSession(){this.sendTelemetry(a.EventName.DEBUG_SESSION_STOP)}onError(e){this.sendTelemetry(a.EventName.DEBUG_SESSION_ERROR)}sendTelemetry(e){e===a.EventName.DEBUG_SESSION_START&&this.timer.reset();const t={trigger:this.trigger,console:this.console};(0,s.sendTelemetryEvent)(e,this.timer.elapsedTime,t)}}let p=class{constructor(e,t){this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0},e.push(t.registerDebugAdapterTrackerFactory("python",this))}async activate(){}createDebugAdapterTracker(e){return new d(e)}};p=r([(0,o.injectable)(),i(0,(0,o.inject)(c.IDisposableRegistry)),i(1,(0,o.inject)(u.IDebugService))],p),t.DebugSessionTelemetry=p},72874:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentManager=void 0;const i=n(86700),o=n(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,n){return o.window.showTextDocument(e,t,n)}openTextDocument(e){return o.workspace.openTextDocument(e)}applyEdit(e){return o.workspace.applyEdit(e)}createTextEditorDecorationType(e){return o.window.createTextEditorDecorationType(e)}};s=r([(0,i.injectable)()],s),t.DocumentManager=s},13578:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Extensions=void 0;const o=n(86700),s=n(66828),a=n(77911),c=n(71017),l=n(84974),u=n(77570);let d=class{constructor(e){this.fs=e}get all(){return s.extensions.all}get onDidChange(){return s.extensions.onDidChange}getExtension(e){return s.extensions.getExtension(e)}get cachedExtensions(){return this._cachedExtensions||(this._cachedExtensions=s.extensions.all,s.extensions.onDidChange((()=>{this._cachedExtensions=s.extensions.all}))),this._cachedExtensions}async determineExtensionFromCallStack(){const{stack:e}=new Error;if(e){const t=c.join(u.EXTENSION_ROOT_DIR.toLowerCase(),c.sep),n=e.split("\n").map((e=>{const t=/\((.*)\)/.exec(e);if(t)return t[1]})).filter((e=>e&&!e.toLowerCase().startsWith(t))).filter((e=>this.cachedExtensions.some((t=>e.includes(t.extensionUri.path)||e.includes(t.extensionUri.fsPath)))));a.parse(new Error("Ex")).forEach((e=>{const r=e.getFileName();r&&!r.toLowerCase().startsWith(t)&&n.push(r)}));for(const e of n){let t=c.dirname(e),n=e;for(;t&&t.length=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageService=void 0;const i=n(86700),o=n(66828);let s=class{registerCompletionItemProvider(e,t,...n){return o.languages.registerCompletionItemProvider(e,t,...n)}};s=r([(0,i.injectable)()],s),t.LanguageService=s},17597:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressService=void 0;const r=n(59314);t.ProgressService=class{constructor(e){this.shell=e}showProgress(e){this.deferred||this.createProgress(e)}hideProgress(){this.deferred&&(this.deferred.resolve(),this.deferred=void 0)}createProgress(e){this.shell.withProgress(e,(()=>(this.deferred=(0,r.createDeferred)(),this.deferred.promise)))}}},53314:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalManager=void 0;const i=n(86700),o=n(66828),s=n(19735);let a=class{constructor(){this.didOpenTerminal=new o.EventEmitter,o.window.onDidOpenTerminal((e=>{this.didOpenTerminal.fire(c(e))}))}get onDidCloseTerminal(){return o.window.onDidCloseTerminal}get onDidOpenTerminal(){return this.didOpenTerminal.event}createTerminal(e){return c(o.window.createTerminal(e))}};function c(e){if(!e.isPatched){const t=e.sendText.bind(e);e.sendText=(e,n=!0)=>((0,s.traceLog)(`Send text to terminal: ${e}`),t(e,n)),e.isPatched=!0}return e}a=r([(0,i.injectable)()],a),t.TerminalManager=a},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")},91932:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PythonWelcome=void 0,(n=t.PythonWelcome||(t.PythonWelcome={})).name="pythonWelcome",n.windowsInstallId="python.installPythonWin8",n.linuxInstallId="python.installPythonLinux",n.macOSInstallId="python.installPythonMac"},56792:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceService=void 0;const i=n(86700),o=n(71017),s=n(66828),a=n(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,n=!1){return n?s.workspace.getConfiguration(e,{uri:t,languageId:"python"}):s.workspace.getConfiguration(e,t)}getWorkspaceFolder(e){return e?s.workspace.getWorkspaceFolder(e):void 0}asRelativePath(e,t){return s.workspace.asRelativePath(e,t)}createFileSystemWatcher(e,t,n,r){return s.workspace.createFileSystemWatcher(e,t,n,r)}findFiles(e,t,n,r){const i=void 0===t?this.searchExcludes:t;return s.workspace.findFiles(e,i,n,r)}getWorkspaceFolderIdentifier(e,t=""){const n=e?s.workspace.getWorkspaceFolder(e):void 0;return n?o.normalize((0,a.getOSType)()===a.OSType.Windows?n.uri.fsPath.toUpperCase():n.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(",")}}`}async save(e){try{return await s.workspace.save(e)}catch(e){return}}};c=r([(0,i.injectable)()],c),t.WorkspaceService=c},29979:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cancellation=t.wrapCancellationTokens=t.createPromiseFromCancellation=t.CancellationError=void 0;const r=n(66828),i=n(59314),o=n(67098);class s extends Error{constructor(){super(o.Common.canceled)}}t.CancellationError=s,t.createPromiseFromCancellation=function(e){return new Promise(((t,n)=>{e.token&&e.token.onCancellationRequested((()=>{if(e.token.isCancellationRequested){if("resolve"===e.cancelAction)return t(e.defaultValue);if("reject"===e.cancelAction)return n(new s)}}))}))},t.wrapCancellationTokens=function(...e){const t=new r.CancellationTokenSource;for(const n of e)if(n){if(n.isCancellationRequested)return n;n.onCancellationRequested((()=>t.cancel()))}return t.token},function(e){function t(e){return!!e&&e.isCancellationRequested}e.race=function(e,t){if(t){const n=(0,i.createDeferred)();return t.onCancellationRequested((()=>{n.completed||n.reject(new s)})),t.isCancellationRequested?n.reject(new s):e(t).then((e=>{n.completed||n.resolve(e)})).catch((e=>{n.completed||n.reject(e)})),n.promise}return e()},e.isCanceled=t,e.throwIfCanceled=function(e){if(t(e))throw new s}}(t.Cancellation||(t.Cancellation={}))},89515:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.PythonSettings=void 0;const i=n(71017),o=n(57147),s=n(66828),a=n(90819);n(32727);const c=n(54813),l=n(61522),u=n(98634),d=n(56792),p=n(77570),h=n(36952),f=n(48683),g=n(87450),m=n(65243),v=n(58967);class y{constructor(e,t,n,r,i){this.interpreterAutoSelectionService=t,this.interpreterPathService=r,this.defaultLS=i,this.envFile="",this.venvPath="",this.venvFolders=[],this.activeStateToolPath="",this.condaPath="",this.pipenvPath="",this.poetryPath="",this.devOptions=[],this.globalModuleInstallation=!1,this.languageServer=a.LanguageServerType.Node,this.languageServerIsDefault=!0,this.changed=new s.EventEmitter,this.disposables=[],this._pythonPath="python",this._defaultInterpreterPath="",this.workspace=n||new d.WorkspaceService,this.workspaceRoot=e,this.initialize()}get onDidChange(){return this.changed.event}static onConfigChange(){return y.configChanged.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,n,r,i){n=n||new d.WorkspaceService;const o=y.getSettingsUriAndTarget(e,n).uri,s=o?o.fsPath:"";if(!y.pythonSettings.has(s)){const a=new y(o,t,n,r,i);y.pythonSettings.set(s,a),a.onDidChange((e=>y.debounceConfigChangeNotification(e)));const u=n.getConfiguration("editor",e||null),d=!!u&&u.get("formatOnType",!1);(0,c.sendTelemetryEvent)(l.EventName.FORMAT_ON_TYPE,void 0,{enabled:d})}return y.pythonSettings.get(s)}static debounceConfigChangeNotification(e){y.configChanged.fire(e)}static getSettingsUriAndTarget(e,t){t=t||new d.WorkspaceService;const n=e?t.getWorkspaceFolder(e):void 0;let r=n?n.uri:void 0;return!r&&Array.isArray(t.workspaceFolders)&&t.workspaceFolders.length>0&&(r=t.workspaceFolders[0].uri),{uri:r,target:r?s.ConfigurationTarget.WorkspaceFolder:s.ConfigurationTarget.Global}}static dispose(){if(!(0,p.isTestExecution)())throw new Error("Dispose can only be called from unit tests");y.pythonSettings.forEach((e=>e&&e.dispose())),y.pythonSettings.clear()}static toSerializable(e){const t={};return Object.entries(e).forEach((e=>{const[n,r]=e;n.includes("Manager")||n.includes("Service")||n.includes("onDid")||(t[n]=r)})),t}dispose(){this.disposables.forEach((e=>e&&e.dispose())),this.disposables=[]}update(e){var t,n,r,i,o;const s=null===(t=this.workspaceRoot)||void 0===t?void 0:t.fsPath,c=new f.SystemVariables(void 0,s,this.workspace);this.pythonPath=this.getPythonPath(c,s);const l=c.resolveAny(e.get("defaultInterpreterPath"));if(this.defaultInterpreterPath=l||p.DEFAULT_INTERPRETER_SETTING,this.defaultInterpreterPath===p.DEFAULT_INTERPRETER_SETTING){const e=this.interpreterAutoSelectionService.getAutoSelectedInterpreter(this.workspaceRoot);this.defaultInterpreterPath=null!==(n=null==e?void 0:e.path)&&void 0!==n?n:this.defaultInterpreterPath}this.defaultInterpreterPath=b(this.defaultInterpreterPath,s),this.venvPath=c.resolveAny(e.get("venvPath")),this.venvFolders=c.resolveAny(e.get("venvFolders"));const d=c.resolveAny(e.get("activeStateToolPath"));this.activeStateToolPath=d&&d.length>0?b(d,s):d;const h=c.resolveAny(e.get("condaPath"));this.condaPath=h&&h.length>0?b(h,s):h;const g=c.resolveAny(e.get("pipenvPath"));this.pipenvPath=g&&g.length>0?b(g,s):g;const m=c.resolveAny(e.get("poetryPath"));this.poetryPath=m&&m.length>0?b(m,s):m,this.interpreter=null!==(r=e.get("interpreter"))&&void 0!==r?r:{infoVisibility:"onPythonRelated"};let v=e.get("languageServer");v=c.resolveAny(v),v&&"Default"!==v&&"Microsoft"!==v&&Object.values(a.LanguageServerType).includes(v)?"JediLSP"===v?(this.languageServer=a.LanguageServerType.Jedi,this.languageServerIsDefault=!1):(this.languageServer=v,this.languageServerIsDefault=!1):(this.languageServer=null!==(o=null===(i=this.defaultLS)||void 0===i?void 0:i.defaultLSType)&&void 0!==o?o:a.LanguageServerType.None,this.languageServerIsDefault=!0);const y=c.resolveAny(e.get("autoComplete"));this.autoComplete?Object.assign(this.autoComplete,y):this.autoComplete=y;const S=e.get("envFile");this.envFile=c.resolveAny(S),(0,u.sendSettingTelemetry)(this.workspace,S),this.devOptions=c.resolveAny(e.get("devOptions")),this.devOptions=Array.isArray(this.devOptions)?this.devOptions:[],this.globalModuleInstallation=!0===e.get("globalModuleInstallation");const _=c.resolveAny(e.get("testing"));this.testing?Object.assign(this.testing,_):(this.testing=_,(0,p.isTestExecution)()&&!this.testing&&(this.testing={pytestArgs:[],unittestArgs:[],promptToConfigure:!0,debugPort:3e3,pytestEnabled:!1,unittestEnabled:!1,pytestPath:"pytest",autoTestDiscoverOnSaveEnabled:!0})),this.testing=this.testing?this.testing:{promptToConfigure:!0,debugPort:3e3,pytestArgs:[],pytestEnabled:!1,pytestPath:"pytest",unittestArgs:[],unittestEnabled:!1,autoTestDiscoverOnSaveEnabled:!0},this.testing.pytestPath=b(c.resolveAny(this.testing.pytestPath),s),this.testing.cwd&&(this.testing.cwd=b(c.resolveAny(this.testing.cwd),s)),this.testing.pytestArgs=this.testing.pytestArgs.map((e=>c.resolveAny(e))),this.testing.unittestArgs=this.testing.unittestArgs.map((e=>c.resolveAny(e)));const E=c.resolveAny(e.get("terminal"));this.terminal?Object.assign(this.terminal,E):(this.terminal=E,(0,p.isTestExecution)()&&!this.terminal&&(this.terminal={})),this.terminal=this.terminal?this.terminal:{executeInFileDir:!0,focusAfterLaunch:!1,launchArgs:[],activateEnvironment:!0,activateEnvInCurrentTerminal:!1},this.REPL=e.get("REPL");const w=e.get("experiments");this.experiments?Object.assign(this.experiments,w):this.experiments=w,this.experiments=this.experiments?this.experiments:{enabled:!0,optInto:[],optOutFrom:[]};const T=c.resolveAny(e.get("tensorBoard"));this.tensorBoard=T||{logDirectory:""},this.tensorBoard.logDirectory&&(this.tensorBoard.logDirectory=b(this.tensorBoard.logDirectory,s))}getPythonExecutable(e){return function(e){if("python"===(e=v(e))||-1===e.indexOf(i.sep)||i.basename(e)===i.dirname(e))return e;if(S(e))return e;const t=["python","python4","python3.6","python3.5","python3","python2.7","python2","python3.7","python3.8","python3.9"];for(let n of t)if((0,m.isWindows)()){if(n=`${n}.exe`,S(i.join(e,n)))return i.join(e,n);if(S(i.join(e,"Scripts",n)))return i.join(e,"Scripts",n)}else{if(S(i.join(e,n)))return i.join(e,n);if(S(i.join(e,"bin",n)))return i.join(e,"bin",n)}return e}(e)}onWorkspaceFoldersChanged(){const e=this.workspace.workspaceFolders.map((e=>e.uri.fsPath)),t=Array.from(y.pythonSettings.keys()).filter((t=>e.indexOf(t)<0));if(t.length>0)for(const e of t)y.pythonSettings.delete(e)}register(){y.pythonSettings=new Map,this.initialize()}onDidChanged(e){const t=this.workspace.getConfiguration("python",this.workspaceRoot);this.update(t),this.debounceChangeNotification(e)}initialize(){this.disposables.push(this.workspace.onDidChangeWorkspaceFolders(this.onWorkspaceFoldersChanged,this)),this.disposables.push(this.interpreterAutoSelectionService.onDidChangeAutoSelectedInterpreter((()=>{this.onDidChanged()}))),this.disposables.push(this.workspace.onDidChangeConfiguration((e=>{e.affectsConfiguration("python")&&this.onDidChanged(e)}))),this.interpreterPathService&&this.disposables.push(this.interpreterPathService.onDidChange((()=>{this.onDidChanged()})));const e=this.workspace.getConfiguration("python",this.workspaceRoot);e&&this.update(e)}debounceChangeNotification(e){this.changed.fire(e)}getPythonPath(e,t){if(this.pythonPath=e.resolveAny(this.interpreterPathService.get(this.workspaceRoot)),!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 b(this.pythonPath,t)}}function b(e,t){return t||(t=__dirname),e=v(e),(0,p.isTestExecution)()&&!e?t:-1===e.indexOf(i.sep)||i.isAbsolute(e)?e:i.resolve(t,e)}function S(e){return o.existsSync(e)&&i.basename((0,g.getOSType)()===g.OSType.Windows?e.toLowerCase():e).startsWith("python")}y.pythonSettings=new Map,y.configChanged=new s.EventEmitter,r([(0,h.debounceSync)(1)],y.prototype,"debounceChangeNotification",null),r([(0,h.debounceSync)(1)],y,"debounceConfigChangeNotification",null),t.PythonSettings=y},15797:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PipEnvExecutionPath=void 0;const o=n(86700),s=n(61684);let a=class{constructor(e){this.configService=e}get executable(){return this.configService.getSettings().pipenvPath}};a=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IConfigurationService))],a),t.PipEnvExecutionPath=a},30751:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationService=void 0;const o=n(86700),s=n(66828),a=n(87282),c=n(77498),l=n(17585),u=n(89515),d=n(77570),p=n(61684);let h=class{constructor(e){this.serviceContainer=e,this.workspaceService=this.serviceContainer.get(l.IWorkspaceService)}get onDidChange(){return u.PythonSettings.onConfigChange()}getSettings(e){const t=this.serviceContainer.get(a.IInterpreterAutoSelectionService),n=this.serviceContainer.get(p.IInterpreterPathService),r=this.serviceContainer.tryGet(p.IDefaultLanguageServer);return u.PythonSettings.getInstance(e,t,this.workspaceService,n,r)}async updateSectionSetting(e,t,n,r,i){let o={uri:r,target:i||s.ConfigurationTarget.WorkspaceFolder};"python"===e&&i!==s.ConfigurationTarget.Global&&(o=u.PythonSettings.getSettingsUriAndTarget(r,this.workspaceService)),i=i||o.target;const a=this.workspaceService.getConfiguration(e,o.uri),c=a.inspect(t);void 0!==c&&(i===s.ConfigurationTarget.Global&&c.globalValue===n||i===s.ConfigurationTarget.Workspace&&c.workspaceValue===n||i===s.ConfigurationTarget.WorkspaceFolder&&c.workspaceFolderValue===n)||(await a.update(t,n,i),await this.verifySetting(a,i,t,n))}async updateSetting(e,t,n,r){return this.updateSectionSetting("python",e,t,n,r)}isTestExecution(){return"1"===process.env.VSC_PYTHON_CI_TEST}async verifySetting(e,t,n,r){if(this.isTestExecution()&&!(0,d.isUnitTestExecution)()){let i=0;do{const o=e.inspect(n);if(!o&&void 0===r)break;if(o&&void 0!==r){let e;if(e=t===s.ConfigurationTarget.Global?o.globalValue:t===s.ConfigurationTarget.Workspace?o.workspaceValue:o.workspaceFolderValue,e===r)break}await new Promise((e=>setTimeout(e,250))),i+=1}while(i<20)}}};h=r([(0,o.injectable)(),i(0,(0,o.inject)(c.IServiceContainer))],h),t.ConfigurationService=h},77570:function(e,t,n){"use strict";var r,i,o,s,a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),c=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};function l(){return"1"===process.env.VSC_PYTHON_UNIT_TEST}Object.defineProperty(t,"__esModule",{value:!0}),t.UseProposedApi=t.isUnitTestExecution=t.isTestExecution=t.isCI=t.DEFAULT_INTERPRETER_SETTING=t.ThemeIcons=t.Octicons=t.Commands=t.CommandSource=t.AppinsightsKey=t.TENSORBOARD_EXTENSION_ID=t.JUPYTER_EXTENSION_ID=t.PYLANCE_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="ms-python.python",t.PYLANCE_EXTENSION_ID="ms-python.vscode-pylance",t.JUPYTER_EXTENSION_ID="ms-toolsai.jupyter",t.TENSORBOARD_EXTENSION_ID="ms-toolsai.tensorboard",t.AppinsightsKey="0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",(s=t.CommandSource||(t.CommandSource={})).ui="ui",s.commandPalette="commandpalette",(o=t.Commands||(t.Commands={})).ClearStorage="python.clearCacheAndReload",o.CreateNewFile="python.createNewFile",o.ClearWorkspaceInterpreter="python.clearWorkspaceInterpreter",o.Create_Environment="python.createEnvironment",o.Create_Environment_Button="python.createEnvironment-button",o.Create_Environment_Check="python.createEnvironmentCheck",o.Create_Terminal="python.createTerminal",o.Debug_In_Terminal="python.debugInTerminal",o.Enable_SourceMap_Support="python.enableSourceMapSupport",o.Exec_In_Terminal="python.execInTerminal",o.Exec_In_Terminal_Icon="python.execInTerminal-icon",o.Exec_In_Separate_Terminal="python.execInDedicatedTerminal",o.Exec_In_REPL="python.execInREPL",o.Exec_Selection_In_Django_Shell="python.execSelectionInDjangoShell",o.Exec_In_REPL_Enter="python.execInREPLEnter",o.Exec_Selection_In_Terminal="python.execSelectionInTerminal",o.GetSelectedInterpreterPath="python.interpreterPath",o.InstallJupyter="python.installJupyter",o.InstallPython="python.installPython",o.InstallPythonOnLinux="python.installPythonOnLinux",o.InstallPythonOnMac="python.installPythonOnMac",o.LaunchTensorBoard="python.launchTensorBoard",o.PickLocalProcess="python.pickLocalProcess",o.RefreshTensorBoard="python.refreshTensorBoard",o.ReportIssue="python.reportIssue",o.Set_Interpreter="python.setInterpreter",o.Set_ShebangInterpreter="python.setShebangInterpreter",o.Start_REPL="python.startREPL",o.Tests_Configure="python.configureTests",o.TriggerEnvironmentSelection="python.triggerEnvSelection",o.ViewOutput="python.viewOutput",(i=t.Octicons||(t.Octicons={})).Add="$(add)",i.Test_Pass="$(check)",i.Test_Fail="$(alert)",i.Test_Error="$(x)",i.Test_Skip="$(circle-slash)",i.Downloading="$(cloud-download)",i.Installing="$(desktop-download)",i.Search="$(search)",i.Search_Stop="$(search-stop)",i.Star="$(star-full)",i.Gear="$(gear)",i.Warning="$(warning)",i.Error="$(error)",i.Lightbulb="$(lightbulb)",i.Folder="$(folder)",(r=t.ThemeIcons||(t.ThemeIcons={})).Refresh="refresh",r.SpinningLoader="loading~spin",t.DEFAULT_INTERPRETER_SETTING="python",t.isCI="true"===process.env.TRAVIS||void 0!==process.env.TF_BUILD||"true"===process.env.GITHUB_ACTIONS,t.isTestExecution=function(){return"1"===process.env.VSC_PYTHON_CI_TEST||l()},t.isUnitTestExecution=l,t.UseProposedApi=Symbol("USE_VSC_PROPOSED_API"),c(n(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))}}},26804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WrappedError=t.ErrorUtils=void 0;const r=n(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}${r.EOL}${r.EOL}${t.stack}`}}t.WrappedError=i},97300:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModuleNotInstalledError=void 0;class n extends Error{constructor(e){super(`Module '${e}' not installed.`)}}t.ModuleNotInstalledError=n},60717:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateEnvOnPipInstallTrigger=t.RecommendTensobardExtension=t.EnableTestAdapterRewrite=t.DiscoveryUsingWorkers=t.TerminalEnvVarActivation=t.ShowToolsExtensionPrompt=t.ShowExtensionSurveyPrompt=void 0,(t.ShowExtensionSurveyPrompt||(t.ShowExtensionSurveyPrompt={})).experiment="pythonSurveyNotification",(t.ShowToolsExtensionPrompt||(t.ShowToolsExtensionPrompt={})).experiment="pythonPromptNewToolsExt",(t.TerminalEnvVarActivation||(t.TerminalEnvVarActivation={})).experiment="pythonTerminalEnvVarActivation",(t.DiscoveryUsingWorkers||(t.DiscoveryUsingWorkers={})).experiment="pythonDiscoveryUsingWorkers",(t.EnableTestAdapterRewrite||(t.EnableTestAdapterRewrite={})).experiment="pythonTestAdapter",(t.RecommendTensobardExtension||(t.RecommendTensobardExtension={})).experiment="pythonRecommendTensorboardExt",(t.CreateEnvOnPipInstallTrigger||(t.CreateEnvOnPipInstallTrigger={})).experiment="pythonCreateEnvOnPipInstall"},46747:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inTerminalEnvVarExperiment=void 0;const r=n(66828),i=n(60717),o=n(77570),s=n(19735);t.inTerminalEnvVarExperiment=function(e){return!(0,o.isTestExecution)()&&r.env.remoteName&&r.workspace.workspaceFolders&&r.workspace.workspaceFolders.length>1?((0,s.traceInfo)("Not enabling terminal env var experiment in multiroot remote workspaces"),!1):!!e.inExperimentSync(i.TerminalEnvVarActivation.experiment)}},12474:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExperimentService=t.TargetPopulation=void 0;const o=n(86700),s=n(66828),a=n(59035),c=n(19735),l=n(54813),u=n(61522),d=n(17585),p=n(77570),h=n(61684),f=n(31373),g="vscode";var m;!function(e){e.Insiders="python-insider",e.Public="python-public"}(m=t.TargetPopulation||(t.TargetPopulation={}));let v=class{constructor(e,t,n){this.workspaceService=e,this.appEnvironment=t,this.persistentState=n,this._optInto=[],this._optOutFrom=[],this.experiments=this.persistentState.createGlobalPersistentState("VSCode.ABExp.FeatureData",{features:[]});const r=this.workspaceService.getConfiguration("python"),i=r.get("experiments.optInto")||[],o=r.get("experiments.optOutFrom")||[];if(this._optInto=i.filter((e=>!e.endsWith("control"))),this._optOutFrom=o.filter((e=>!e.endsWith("control"))),this._optOutFrom.includes("All")||!1===r.get("experiments.enabled")?this.enabled=!1:this.enabled=!0,!this.enabled)return;let s;s="insiders"===this.appEnvironment.extensionChannel?m.Insiders:m.Public;const c=new f.ExperimentationTelemetry;this.experimentationService=(0,a.getExperimentationService)(p.PVSC_EXTENSION_ID,this.appEnvironment.packageJson.version,s,c,this.experiments.storage)}async activate(){if(this.experimentationService){const e=Date.now();await this.experimentationService.initializePromise,0===this.experiments.value.features.length&&(await this.experimentationService.initialFetch,(0,l.sendTelemetryEvent)(u.EventName.PYTHON_EXPERIMENTS_INIT_PERFORMANCE,Date.now()-e)),this.logExperiments()}!function(e,t,n){const r=y("python.experiments.optInto",n),i=y("python.experiments.optOutFrom",n),o=e.filter((e=>r.includes(e))),s=t.filter((e=>i.includes(e)));JSON.stringify(o.sort()),(0,l.sendTelemetryEvent)(u.EventName.PYTHON_EXPERIMENTS_OPT_IN_OPT_OUT_SETTINGS,void 0,{optedInto:JSON.stringify(o.sort()),optedOutFrom:JSON.stringify(s.sort())})}(this._optInto,this._optOutFrom,this.appEnvironment.packageJson)}async inExperiment(e){return this.inExperimentSync(e)}inExperimentSync(e){return!!this.experimentationService&&(!this._optOutFrom.includes("All")&&!this._optOutFrom.includes(e)&&(this._optInto.includes("All")||this._optInto.includes(e)?(this.experimentationService.getTreatmentVariable(g,e),!0):!0===this.experimentationService.getTreatmentVariable(g,e)))}async getExperimentValue(e){if(this.experimentationService&&!this._optOutFrom.includes("All")&&!this._optOutFrom.includes(e))return this.experimentationService.getTreatmentVariable(g,e)}logExperiments(){const e=this.workspaceService.getConfiguration("telemetry");let t=!1;e&&!1===e.get("enableTelemetry")&&((0,c.traceLog)("Telemetry is disabled"),t=!0),e&&"off"===e.get("telemetryLevel")&&((0,c.traceLog)("Telemetry level is off"),t=!0),t&&(0,c.traceLog)("Experiments are disabled, only manually opted experiments are active."),this._optOutFrom.includes("All")?(0,c.traceLog)(s.l10n.t("Experiment '{0}' is inactive","All")):this._optInto.includes("All")?(0,c.traceLog)(s.l10n.t("Experiment '{0}' is active","All")):(this._optOutFrom.filter((e=>"All"!==e&&e.toLowerCase().startsWith("python"))).forEach((e=>{(0,c.traceLog)(s.l10n.t("Experiment '{0}' is inactive",e))})),this._optInto.filter((e=>"All"!==e&&e.toLowerCase().startsWith("python"))).forEach((e=>{(0,c.traceLog)(s.l10n.t("Experiment '{0}' is active",e))})),t||this.experiments.value.features.forEach((e=>{!e.toLowerCase().startsWith("python")||this._optOutFrom.includes(e)||this._optInto.includes(e)||(0,c.traceLog)(s.l10n.t("Experiment '{0}' is active",e))})))}};function y(e,t){var n;const r=t.contributes.configuration.properties[e];return r&&null!==(n=r.items.enum)&&void 0!==n?n:[]}v=r([(0,o.injectable)(),i(0,(0,o.inject)(d.IWorkspaceService)),i(1,(0,o.inject)(d.IApplicationEnvironment)),i(2,(0,o.inject)(h.IPersistentStateFactory))],v),t.ExperimentService=v},31373:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExperimentationTelemetry=void 0;const r=n(54813);t.ExperimentationTelemetry=class{setSharedProperty(e,t){(0,r.setSharedProperty)(e,t)}postEvent(e,t){const n={};t.forEach(((e,t)=>{n[t]=e})),(0,r.sendTelemetryEvent)(e,void 0,n)}}},32727:()=>{"use strict";String.prototype.toCommandArgumentForPythonExt=function(){return this?!(this.indexOf(" ")>=0||this.indexOf("&")>=0||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},Promise.prototype.ignoreErrors=function(){return this.catch((()=>{}))},String.prototype.format||(String.prototype.format=function(){const e=arguments;return this.replace(/{(\d+)}/g,((t,n)=>void 0===e[n]?t:e[n]))})},95939:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstallationChannelManager=void 0;const o=n(86700),s=n(18639),a=n(77498),c=n(81387),l=n(17585),u=n(84974),d=n(67098),p=n(3481),h=n(92674),f=n(59747);let g=class{constructor(e){this.serviceContainer=e}async getInstallationChannel(e,t){const n=await this.getInstallationChannels(t);if(1===n.length)return n[0];const r=h.ProductNames.get(e),i=this.serviceContainer.get(l.IApplicationShell);if(0===n.length)return void await this.showNoInstallersMessage((0,p.isResource)(t)?t:void 0);const o=`Select an option to install ${r}`,s=n.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),n=[];if(0===t.length)return[];t.sort(((e,t)=>t.priority-e.priority));let r=t[0].priority;for(const i of t){if(i.priority!==r){if(n.length>0)break;r=i.priority}await i.isSupported(e)&&n.push(i)}return n}async showNoInstallersMessage(e){const t=this.serviceContainer.get(s.IInterpreterService),n=await t.getActiveInterpreter(e);if(!n)return;const r=this.serviceContainer.get(l.IApplicationShell);let i;if(i=n.envType===c.EnvironmentType.Conda?await r.showErrorMessage(d.Installer.noCondaOrPipInstaller,d.Installer.searchForHelp):await r.showErrorMessage(d.Installer.noPipInstaller,d.Installer.searchForHelp),"Search for help"===i){const e=this.serviceContainer.get(u.IPlatformService),t=e.isWindows?"Windows":e.isMac?"MacOS":"Linux";r.openUrl(`https://www.bing.com/search?q=Install Pip ${t} ${n.envType===c.EnvironmentType.Conda?"Conda":""}`)}}};g=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],g),t.InstallationChannelManager=g},5181:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CondaInstaller=void 0;const o=n(86700),s=n(18639),a=n(77498),c=n(44773),l=n(81387),u=n(61684),d=n(3481),p=n(30135),h=n(59747);let f=class extends p.ModuleInstaller{constructor(e){super(e)}get name(){return"Conda"}get displayName(){return"Conda"}get type(){return l.ModuleInstallerType.Conda}get priority(){return 10}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,n=0){var r;const i=this.serviceContainer.get(s.ICondaService),o=await i.getCondaFile(!0),a=(0,d.isResource)(t)?this.serviceContainer.get(u.IConfigurationService).getSettings(t).pythonPath:null!==(r=(0,c.getEnvPath)(t.path,t.envPath).path)&&void 0!==r?r:"",l=this.serviceContainer.get(s.IComponentAdapter),f=await l.getCondaEnvironment(a),g=[n&h.ModuleInstallFlags.upgrade?"update":"install"];return[u.Product.tensorboard].map(p.translateProductToModule).includes(e)&&g.push("-c","conda-forge"),f&&f.name?(g.push("--name"),g.push(f.name.toCommandArgumentForPythonExt())):f&&f.path&&(g.push("--prefix"),g.push(f.path.fileToCommandArgumentForPythonExt())),n&h.ModuleInstallFlags.updateDependencies&&g.push("--update-deps"),n&h.ModuleInstallFlags.reInstall&&g.push("--force-reinstall"),g.push(e),g.push("-y"),{args:g,execPath:o,useShell:!0}}async isCurrentEnvironmentACondaEnvironment(e){var t;const n=this.serviceContainer.get(s.IComponentAdapter),r=(0,d.isResource)(e)?this.serviceContainer.get(u.IConfigurationService).getSettings(e).pythonPath:null!==(t=(0,c.getEnvPath)(e.path,e.envPath).path)&&void 0!==t?t:"";return n.isCondaEnvironment(r)}};f=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],f),t.CondaInstaller=f},30135:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.translateProductToModule=t.ModuleInstaller=void 0;const i=n(86700),o=n(71017),s=n(66828),a=n(18639),c=n(19735),l=n(81387),u=n(54813),d=n(61522),p=n(17585),h=n(29979),f=n(84974),g=n(31776),m=n(29983),v=n(58400),y=n(61684),b=n(3481),S=n(92674);let _=class{constructor(e){this.serviceContainer=e}async installModule(e,t,n,r,i){const c=!(null==i?void 0:i.installAsProcess),m="string"==typeof e?e:E(e),v="string"==typeof e?m:S.ProductNames.get(e);(0,u.sendTelemetryEvent)(d.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:this.displayName,productName:v});const _=(0,b.isResource)(t)?t:void 0,w=await this.getExecutionInfo(m,t,r),T=async e=>{var n;const r=await this.processInstallArgs(w.args,t);if(w.moduleName){const i=this.serviceContainer.get(y.IConfigurationService).getSettings(_),s=this.serviceContainer.get(a.IInterpreterService),u=(0,b.isResource)(t)?await s.getActiveInterpreter(t):t,d=null!==(n=null==u?void 0:u.path)&&void 0!==n?n:i.pythonPath,p=(0,b.isResource)(t)?d:t.path,h=g.execModule(w.moduleName,r);if(u&&u.envType===l.EnvironmentType.Unknown)if(i.globalModuleInstallation){const n=this.serviceContainer.get(f.IFileSystem);await n.isDirReadonly(o.dirname(p)).catch((e=>!0))?this.elevatedInstall(p,h):await this.executeCommand(c,t,p,h,e,w.useShell)}else m===E(y.Product.pip)||l.virtualEnvTypes.includes(u.envType)?await this.executeCommand(c,t,p,h,e,w.useShell):await this.executeCommand(c,t,p,h.concat(["--user"]),e,w.useShell);else await this.executeCommand(c,t,p,h,e,w.useShell)}else await this.executeCommand(c,t,w.execPath,r,e,w.useShell)};if(n){const e=this.serviceContainer.get(p.IApplicationShell),t={location:s.ProgressLocation.Notification,cancellable:!0,title:s.l10n.t("Installing {0}",m)};await e.withProgress(t,(async(e,t)=>T((0,h.wrapCancellationTokens)(t,n))))}else await T(n)}elevatedInstall(e,t){const r=this.serviceContainer.get(y.ILogOutputChannel),i=`"${e.replace(/\\/g,"/")}" ${t.join(" ")}`;(0,c.traceLog)(`[Elevated] ${i}`),n(65425).exec(i,{name:"VS Code Python"},(async(e,t,n)=>{if(e){const t=this.serviceContainer.get(p.IApplicationShell);await t.showErrorMessage(e)}else r.show(),t&&(0,c.traceLog)(t),n&&(0,c.traceError)(`Warning: ${n}`)}))}async processInstallArgs(e,t){const n=e.findIndex((e=>"PYLINT"===e.toUpperCase()));if(-1===n)return e;const r=this.serviceContainer.get(a.IInterpreterService),i=(0,b.isResource)(t)?await r.getActiveInterpreter(t):t;if(i&&i.version&&2===i.version.major){const t=[...e];return t[n]='"pylint<2.0.0"',t}return e}async executeCommand(e,t,n,r,i,o){const s={};if((0,b.isResource)(t)?s.resource=t:s.interpreter=t,e)this.serviceContainer.get(v.ITerminalServiceFactory).getTerminalService(s).sendCommand(n,r,i);else{const e=this.serviceContainer.get(m.IProcessServiceFactory),t=await e.create(s.resource);if(o){const e=[n,...r].reduce(((e,t)=>e?`${e} ${t.toCommandArgumentForPythonExt()}`:`${t.toCommandArgumentForPythonExt()}`),"");await t.shellExec(e)}else await t.exec(n,r)}}};function E(e){switch(e){case y.Product.pytest:return"pytest";case y.Product.unittest:return"unittest";case y.Product.tensorboard:return"tensorboard";case y.Product.torchProfilerInstallName:return"torch-tb-profiler";case y.Product.torchProfilerImportName:return"torch_tb_profiler";case y.Product.pip:return"pip";case y.Product.ensurepip:return"ensurepip";case y.Product.python:return"python";default:throw new Error(`Product ${e} cannot be installed as a Python Module.`)}}_=r([(0,i.injectable)()],_),t.ModuleInstaller=_,t.translateProductToModule=E},22577:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PipEnvInstaller=t.pipenvName=void 0;const o=n(86700),s=n(18639),a=n(77498),c=n(37924),l=n(81387),u=n(17585),d=n(3481),p=n(30135),h=n(59747);t.pipenvName="pipenv";let f=class extends p.ModuleInstaller{get name(){return"pipenv"}get type(){return l.ModuleInstallerType.Pipenv}get displayName(){return t.pipenvName}get priority(){return 10}constructor(e){super(e)}async isSupported(e){if((0,d.isResource)(e)){const t=await this.serviceContainer.get(s.IInterpreterService).getActiveInterpreter(e),n=e?this.serviceContainer.get(u.IWorkspaceService).getWorkspaceFolder(e):void 0;return!(!t||!n||t.envType!==l.EnvironmentType.Pipenv)&&(0,c.isPipenvEnvironmentRelatedToFolder)(t.path,n.uri.fsPath)}return e.envType===l.EnvironmentType.Pipenv}async getExecutionInfo(e,n,r=0){return{args:[r&h.ModuleInstallFlags.reInstall||r&h.ModuleInstallFlags.updateDependencies||r&h.ModuleInstallFlags.upgrade?"update":"install",e,"--dev"],execPath:t.pipenvName}}};f=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],f),t.PipEnvInstaller=f},36352:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PipInstaller=void 0;const o=n(86700),s=n(77498),a=n(81387),c=n(17585),l=n(29983),u=n(61684),d=n(3481),p=n(30135),h=n(59747),f=n(71017),g=n(48266),m=n(92674),v=n(54813),y=n(61522),b=n(18639),S=n(48431);let _=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 n;const r=e.get(b.IInterpreterService),i=(0,d.isResource)(t)?await r.getActiveInterpreter(t):t;if(i)return!((null===(n=i.envPath)||void 0===n?void 0:n.length)&&i.envType===a.EnvironmentType.Conda&&!(0,S.isParentPath)(null==i?void 0:i.path,i.envPath))}(this.serviceContainer,e)&&this.isPipAvailable(e)}async getExecutionInfo(e,t,n=0){var r,i,o;if(e===(0,p.translateProductToModule)(u.Product.pip)){const e=(0,d.isResource)(t)?"":`${(null===(r=t.version)||void 0===r?void 0:r.major)||""}.${(null===(i=t.version)||void 0===i?void 0:i.minor)||""}.${(null===(o=t.version)||void 0===o?void 0:o.patch)||""}`,n=(0,d.isResource)(t)?void 0:t.envType;(0,v.sendTelemetryEvent)(y.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:"unavailable",requiredInstaller:a.ModuleInstallerType.Pip,productName:m.ProductNames.get(u.Product.pip),version:e,envType:n});const s=this.serviceContainer.get(u.IInstaller);if(await s.isInstalled(u.Product.ensurepip,t))return{args:[],moduleName:"ensurepip"};(0,v.sendTelemetryEvent)(y.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:"unavailable",requiredInstaller:a.ModuleInstallerType.Pip,productName:m.ProductNames.get(u.Product.ensurepip),version:e,envType:n});const c=this.serviceContainer.get(b.IInterpreterService),l=(0,d.isResource)(t)?await c.getActiveInterpreter(t):t;return{execPath:l?l.path:"python",args:[f.join(g._SCRIPTS_DIR,"get-pip.py")]}}const s=[],l=this.serviceContainer.get(c.IWorkspaceService).getConfiguration("http").get("proxy","");return l.length>0&&(s.push("--proxy"),s.push(l)),s.push("install","-U"),n&h.ModuleInstallFlags.reInstall&&s.push("--force-reinstall"),{args:[...s,e],moduleName:"pip"}}isPipAvailable(e){const t=this.serviceContainer.get(l.IPythonExecutionFactory),n=(0,d.isResource)(e)?e:void 0,r=(0,d.isResource)(e)?void 0:e.path;return t.create({resource:n,pythonPath:r}).then((e=>e.isModuleInstalled("pip"))).catch((()=>!1))}};_=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IServiceContainer))],_),t.PipInstaller=_},73300:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PoetryInstaller=t.poetryName=void 0;const o=n(86700),s=n(18639),a=n(77498),c=n(13298),l=n(81387),u=n(17585),d=n(61684),p=n(3481),h=n(30135);t.poetryName="poetry";let f=class extends h.ModuleInstaller{constructor(e,t,n){super(e),this.workspaceService=t,this.configurationService=n}get name(){return"poetry"}get type(){return l.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),n=e?this.workspaceService.getWorkspaceFolder(e):void 0;return!(!t||!n||t.envType!==l.EnvironmentType.Poetry)&&(0,c.isPoetryEnvironmentRelatedToFolder)(t.path,n.uri.fsPath,this.configurationService.getSettings(e).poetryPath)}async getExecutionInfo(e,t){return{args:["add","--group","dev",e],execPath:this.configurationService.getSettings((0,p.isResource)(t)?t:void 0).poetryPath}}};f=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer)),i(1,(0,o.inject)(u.IWorkspaceService)),i(2,(0,o.inject)(d.IConfigurationService))],f),t.PoetryInstaller=f},80819:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProductInstaller=t.PythonInstaller=t.DataScienceInstaller=t.TestFrameworkInstaller=t.Product=void 0;const o=n(86700),s=n(81249),a=n(66828);n(32727);const c=n(18639),l=n(77498),u=n(81387),d=n(54813),p=n(61522),h=n(17585),f=n(29983),g=n(61684),m=n(67098),v=n(3481),y=n(30135),b=n(92674),S=n(59747),_=n(19735),E=n(48431);var w=n(61684);Object.defineProperty(t,"Product",{enumerable:!0,get:function(){return w.Product}});const T=new Map([[g.Product.torchProfilerInstallName,new Set([u.EnvironmentType.Conda])]]);class C{constructor(e){this.serviceContainer=e,this.appShell=e.get(h.IApplicationShell),this.configService=e.get(g.IConfigurationService),this.workspaceService=e.get(h.IWorkspaceService),this.productService=e.get(S.IProductService),this.persistentStateFactory=e.get(g.IPersistentStateFactory)}promptToInstall(e,t,n,r){const i=t&&(0,v.isResource)(t)?this.workspaceService.getWorkspaceFolder(t):void 0,o=`${e}${i?i.uri.fsPath:""}`;if(C.PromptPromises.has(o))return C.PromptPromises.get(o);const s=this.promptToInstallImplementation(e,t,n,r);return C.PromptPromises.set(o,s),s.then((()=>C.PromptPromises.delete(o))).ignoreErrors(),s.catch((()=>C.PromptPromises.delete(o))).ignoreErrors(),s}async install(e,t,n,r,i){if(e===g.Product.unittest)return g.InstallerResponse.Installed;const o=this.serviceContainer.get(S.IInstallationChannelManager),s=await o.getInstallationChannel(e,t);return s?(await s.installModule(e,t,n,r,i).catch((t=>(0,_.traceError)(`Error in installing the product '${b.ProductNames.get(e)}', ${t}`))),this.isInstalled(e,t).then((t=>((0,d.sendTelemetryEvent)(p.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:s.displayName,productName:b.ProductNames.get(e),isInstalled:t}),t?g.InstallerResponse.Installed:g.InstallerResponse.Ignore)))):((0,d.sendTelemetryEvent)(p.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:"unavailable",productName:b.ProductNames.get(e)}),g.InstallerResponse.Ignore)}async isProductVersionCompatible(e,t,n){const r=await this.getProductSemVer(e,n);return r?s.satisfies(r,t)?g.ProductInstallStatus.Installed:g.ProductInstallStatus.NeedsUpgrade:g.ProductInstallStatus.NotInstalled}async getProductSemVer(e,t){const n=(0,v.isResource)(t)?void 0:t,r=(0,v.isResource)(t)?t:void 0,i=this.getExecutableNameFromSettings(e,r);let o;if(this.isExecutableAModule(e,r)){const e=await this.serviceContainer.get(f.IPythonExecutionFactory).createActivatedEnvironment({resource:r,interpreter:n,allowEnvironmentFetchExceptions:!0});o=await e.getModuleVersion(i)}else{const e=await this.serviceContainer.get(f.IProcessServiceFactory).create(r);o=(await e.exec(i,["--version"],{mergeStdOutErr:!0})).stdout.trim()}if(!o)return null;try{return s.coerce(o)}catch(t){return(0,_.traceError)(`Unable to parse version ${o} for product ${e}: `,t),null}}async isInstalled(e,t){if(e===g.Product.unittest)return!0;const n=(0,v.isResource)(t)?void 0:t,r=(0,v.isResource)(t)?t:void 0,i=this.getExecutableNameFromSettings(e,r);return this.isExecutableAModule(e,r)?(await this.serviceContainer.get(f.IPythonExecutionFactory).createActivatedEnvironment({resource:r,interpreter:n,allowEnvironmentFetchExceptions:!0})).isModuleInstalled(i):(await this.serviceContainer.get(f.IProcessServiceFactory).create(r)).exec(i,["--version"],{mergeStdOutErr:!0}).then((()=>!0)).catch((()=>!1))}getExecutableNameFromSettings(e,t){const n=this.productService.getProductType(e);return this.serviceContainer.get(S.IProductPathService,n).getExecutableNameFromSettings(e,t)}isExecutableAModule(e,t){const n=this.productService.getProductType(e);return this.serviceContainer.get(S.IProductPathService,n).isExecutableAModule(e,t)}}C.PromptPromises=new Map;class P extends C{async promptToInstallImplementation(e,t,n,r){const i=b.ProductNames.get(e),o=[];let s=a.l10n.t("Test framework {0} is not installed. Install?",i);if(this.isExecutableAModule(e,t))o.push(m.Common.bannerLabelYes,m.Common.bannerLabelNo);else{const n=this.getExecutableNameFromSettings(e,t);s=a.l10n.t("Path to the {0} test framework is invalid ({1})",i,n)}return await this.appShell.showErrorMessage(s,...o)===m.Common.bannerLabelYes?this.install(e,t,n):g.InstallerResponse.Ignore}}t.TestFrameworkInstaller=P;class x extends C{async install(e,t,n,r){var i,o,s,c;if((0,v.isResource)(t))throw new Error("All data science packages require an interpreter be passed in");const l=t;let h=await this.serviceContainer.get(S.IInstallationChannelManager).getInstallationChannels(l);const f=(0,y.translateProductToModule)(e),m=`${(null===(i=l.version)||void 0===i?void 0:i.major)||""}.${(null===(o=l.version)||void 0===o?void 0:o.minor)||""}.${(null===(s=l.version)||void 0===s?void 0:s.patch)||""}`;if(r&&r&S.ModuleInstallFlags.installPipIfRequired&&l.envType!==u.EnvironmentType.Conda&&!h.some((e=>e.type===u.ModuleInstallerType.Pip))){const e=this.serviceContainer.getAll(S.IModuleInstaller).find((e=>e.type===u.ModuleInstallerType.Pip));e?((0,_.traceInfo)(`Installing pip as its not available to install ${f}.`),await e.installModule(g.Product.pip,l,n).catch((e=>(0,_.traceError)(`Error in installing the module '${f} as Pip could not be installed', ${e}`))),await this.isInstalled(g.Product.pip,l).then((t=>{(0,d.sendTelemetryEvent)(p.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:e.displayName,requiredInstaller:u.ModuleInstallerType.Pip,version:m,envType:l.envType,isInstalled:t,productName:b.ProductNames.get(g.Product.pip)})})).catch(v.noop),h=await this.serviceContainer.get(S.IInstallationChannelManager).getInstallationChannels(l)):((0,d.sendTelemetryEvent)(p.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:"unavailable",requiredInstaller:u.ModuleInstallerType.Pip,productName:b.ProductNames.get(g.Product.pip),version:m,envType:l.envType}),(0,_.traceError)("Unable to install pip when its required."))}const E=!(null===(c=T.get(e))||void 0===c?void 0:c.has(u.EnvironmentType.Conda));let w=u.ModuleInstallerType.Unknown;if(l.envType===u.EnvironmentType.Conda&&E)w=u.ModuleInstallerType.Conda;else if(l.envType!==u.EnvironmentType.Conda||E)switch(l.envType){case u.EnvironmentType.Pipenv:w=u.ModuleInstallerType.Pipenv;break;case u.EnvironmentType.Poetry:w=u.ModuleInstallerType.Poetry;break;default:w=u.ModuleInstallerType.Pip}else(0,_.traceInfo)(`Interpreter type is conda but package ${f} is not available through conda, using pip instead.`),w=u.ModuleInstallerType.Pip;const C=h.find((e=>e.type===w));return C?(await C.installModule(e,l,n,r).catch((e=>(0,_.traceError)(`Error in installing the module '${f}', ${e}`))),this.isInstalled(e,l).then((t=>((0,d.sendTelemetryEvent)(p.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:C.displayName||"",requiredInstaller:w,version:m,envType:l.envType,isInstalled:t,productName:b.ProductNames.get(e)}),t?g.InstallerResponse.Installed:g.InstallerResponse.Ignore)))):(this.appShell.showErrorMessage(a.l10n.t("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.",f)).then(v.noop,v.noop),(0,d.sendTelemetryEvent)(p.EventName.PYTHON_INSTALL_PACKAGE,void 0,{installer:"unavailable",requiredInstaller:w,productName:b.ProductNames.get(e),version:m,envType:l.envType}),g.InstallerResponse.Ignore)}async promptToInstallImplementation(e,t,n,r){const i=b.ProductNames.get(e);return await this.appShell.showErrorMessage(a.l10n.t("Data Science library {0} is not installed. Install?",i),m.Common.bannerLabelYes,m.Common.bannerLabelNo)===m.Common.bannerLabelYes?this.install(e,t,n):g.InstallerResponse.Ignore}}t.DataScienceInstaller=x;let I=class{constructor(e){this.serviceContainer=e}async isInstalled(e,t){var n;if(e!==g.Product.python)throw new Error(`${e} cannot be installed via conda python installer`);const r=this.serviceContainer.get(c.IInterpreterService),i=(0,v.isResource)(t)?await r.getActiveInterpreter(t):t;return!i||!((null===(n=i.envPath)||void 0===n?void 0:n.length)&&i.envType===u.EnvironmentType.Conda&&!(0,E.isParentPath)(null==i?void 0:i.path,i.envPath))}async install(e,t,n,r){if(e!==g.Product.python)throw new Error(`${e} cannot be installed via python installer`);const i=this.serviceContainer.getAll(S.IModuleInstaller).find((e=>e.type===u.ModuleInstallerType.Conda));if(!i||!await i.isSupported(t))return(0,_.traceError)("Conda installer not available for installing python in the given environment"),g.InstallerResponse.Ignore;const o=(0,y.translateProductToModule)(e);return await i.installModule(g.Product.python,t,void 0,void 0,{installAsProcess:!0}).catch((e=>(0,_.traceError)(`Error in installing the module '${o}', ${e}`))),this.isInstalled(e,t).then((e=>e?g.InstallerResponse.Installed:g.InstallerResponse.Ignore))}async promptToInstall(e,t,n,r){return g.InstallerResponse.Ignore}async isProductVersionCompatible(e,t,n){return g.ProductInstallStatus.Installed}};I=r([i(0,(0,o.inject)(l.IServiceContainer))],I),t.PythonInstaller=I;let R=class{constructor(e){this.serviceContainer=e,this.productService=e.get(S.IProductService),this.interpreterService=this.serviceContainer.get(c.IInterpreterService)}dispose(){}async promptToInstall(e,t,n,r){return((0,v.isResource)(t)?await this.interpreterService.getActiveInterpreter(t):t)?this.createInstaller(e).promptToInstall(e,t,n,r):g.InstallerResponse.Ignore}async isProductVersionCompatible(e,t,n){return this.createInstaller(e).isProductVersionCompatible(e,t,n)}async install(e,t,n,r,i){return this.createInstaller(e).install(e,t,n,r,i)}async isInstalled(e,t){return this.createInstaller(e).isInstalled(e,t)}translateProductToModuleName(e){return(0,y.translateProductToModule)(e)}createInstaller(e){switch(this.productService.getProductType(e)){case g.ProductType.TestFramework:return new P(this.serviceContainer);case g.ProductType.DataScience:return new x(this.serviceContainer);case g.ProductType.Python:return new I(this.serviceContainer)}throw new Error(`Unknown product ${e}`)}};R=r([(0,o.injectable)(),i(0,(0,o.inject)(l.IServiceContainer))],R),t.ProductInstaller=R},92674:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProductNames=void 0;const r=n(61684);t.ProductNames=new Map,t.ProductNames.set(r.Product.pytest,"pytest"),t.ProductNames.set(r.Product.tensorboard,"tensorboard"),t.ProductNames.set(r.Product.torchProfilerInstallName,"torch-tb-profiler"),t.ProductNames.set(r.Product.torchProfilerImportName,"torch_tb_profiler"),t.ProductNames.set(r.Product.pip,"pip"),t.ProductNames.set(r.Product.ensurepip,"ensurepip")},43942:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataScienceProductPathService=t.TestFrameworkProductPathService=t.BaseProductPathsService=void 0;const o=n(86700),s=n(71017),a=n(77498),c=n(40704),l=n(61684);let u=class{constructor(e){this.serviceContainer=e,this.configService=e.get(l.IConfigurationService),this.productInstaller=e.get(l.IInstaller)}isExecutableAModule(e,t){let n;try{n=this.productInstaller.translateProductToModuleName(e)}catch(e){}const r=this.getExecutableNameFromSettings(e,t);return"string"==typeof n&&n.length>0&&s.basename(r)===r}};u=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],u),t.BaseProductPathsService=u;let d=class extends u{constructor(e){super(e)}getExecutableNameFromSettings(e,t){const n=this.serviceContainer.get(c.ITestingService).getSettingsPropertyNames(e);return n.pathName?this.configService.getSettings(t).testing[n.pathName]:this.productInstaller.translateProductToModuleName(e)}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],d),t.TestFrameworkProductPathService=d;let p=class extends u{constructor(e){super(e)}getExecutableNameFromSettings(e,t){return this.productInstaller.translateProductToModuleName(e)}};p=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],p),t.DataScienceProductPathService=p},23202:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ProductService=void 0;const i=n(86700),o=n(61684);let s=class{constructor(){this.ProductTypes=new Map,this.ProductTypes.set(o.Product.pytest,o.ProductType.TestFramework),this.ProductTypes.set(o.Product.unittest,o.ProductType.TestFramework),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=r([(0,i.injectable)()],s),t.ProductService=s},34061:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const r=n(61684),i=n(95939),o=n(5181),s=n(22577),a=n(36352),c=n(73300),l=n(43942),u=n(23202),d=n(59747);t.registerTypes=function(e){e.addSingleton(d.IModuleInstaller,o.CondaInstaller),e.addSingleton(d.IModuleInstaller,a.PipInstaller),e.addSingleton(d.IModuleInstaller,s.PipEnvInstaller),e.addSingleton(d.IModuleInstaller,c.PoetryInstaller),e.addSingleton(d.IInstallationChannelManager,i.InstallationChannelManager),e.addSingleton(d.IProductService,u.ProductService),e.addSingleton(d.IProductPathService,l.TestFrameworkProductPathService,r.ProductType.TestFramework),e.addSingleton(d.IProductPathService,l.DataScienceProductPathService,r.ProductType.DataScience)}},59747:(e,t)=>{"use strict";var n;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"),(n=t.ModuleInstallFlags||(t.ModuleInstallFlags={}))[n.upgrade=1]="upgrade",n[n.updateDependencies=2]="updateDependencies",n[n.reInstall=4]="reInstall",n[n.installPipIfRequired=8]="installPipIfRequired"},97469:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterPathService=t.getCIPythonPath=t.defaultInterpreterPathSetting=t.isRemoteGlobalSettingCopiedKey=t.remoteWorkspaceFolderKeysForWhichTheCopyIsDone_Key=t.remoteWorkspaceKeysForWhichTheCopyIsDone_Key=void 0;const o=n(55674),s=n(86700),a=n(66828),c=n(19735),l=n(17585),u=n(89515),d=n(77570),p=n(48431),h=n(61684),f=n(48683);t.remoteWorkspaceKeysForWhichTheCopyIsDone_Key="remoteWorkspaceKeysForWhichTheCopyIsDone_Key",t.remoteWorkspaceFolderKeysForWhichTheCopyIsDone_Key="remoteWorkspaceFolderKeysForWhichTheCopyIsDone_Key",t.isRemoteGlobalSettingCopiedKey="isRemoteGlobalSettingCopiedKey",t.defaultInterpreterPathSetting="defaultInterpreterPath";const g=m();function m(){return process.env.CI_PYTHON_PATH&&o.existsSync(process.env.CI_PYTHON_PATH)?process.env.CI_PYTHON_PATH:"python"}t.getCIPythonPath=m;let v=class{constructor(e,t,n,r){this.persistentStateFactory=e,this.workspaceService=t,this.appEnvironment=r,this._didChangeInterpreterEmitter=new a.EventEmitter,n.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}),(0,c.traceVerbose)("Interpreter Path updated",`python.${t.defaultInterpreterPathSetting}`))}inspect(e,t=!1){var n,r;let i,o;(e=u.PythonSettings.getSettingsUriAndTarget(e,this.workspaceService).uri)&&(i=this.persistentStateFactory.createGlobalPersistentState(this.getSettingKey(e,a.ConfigurationTarget.WorkspaceFolder,t),void 0),o=this.persistentStateFactory.createGlobalPersistentState(this.getSettingKey(e,a.ConfigurationTarget.Workspace,t),void 0));const s=null!==(r=null===(n=this.workspaceService.getConfiguration("python",e))||void 0===n?void 0:n.inspect("defaultInterpreterPath"))&&void 0!==r?r:{};return{globalValue:s.globalValue,workspaceFolderValue:(null==i?void 0:i.value)&&"python"!==(null==i?void 0:i.value)?i.value:s.workspaceFolderValue,workspaceValue:(null==o?void 0:o.value)&&"python"!==(null==o?void 0:o.value)?o.value:s.workspaceValue}}get(e){var t;const n=this.inspect(e),r=n.workspaceFolderValue||n.workspaceValue||n.globalValue||((0,d.isTestExecution)()?g:"python");return new f.SystemVariables(void 0,null===(t=this.workspaceService.getWorkspaceFolder(e))||void 0===t?void 0:t.uri.fsPath,this.workspaceService).resolveAny(r)}async update(e,t,n){if(e=u.PythonSettings.getSettingsUriAndTarget(e,this.workspaceService).uri,t===a.ConfigurationTarget.Global){const e=this.workspaceService.getConfiguration("python");return void(e.inspect("defaultInterpreterPath").globalValue!==n&&await e.update("defaultInterpreterPath",n,!0))}if(!e)return void(0,c.traceError)("Cannot update workspace settings as no workspace is opened");const r=this.getSettingKey(e,t),i=this.persistentStateFactory.createGlobalPersistentState(r,void 0);i.value!==n&&(await i.updateValue(n),this._didChangeInterpreterEmitter.fire({uri:e,configTarget:t}),(0,c.traceVerbose)("Interpreter Path updated",r,n))}getSettingKey(e,t,n=!1){let r;const i=this.workspaceService.getWorkspaceFolderIdentifier(e);return r=t===a.ConfigurationTarget.WorkspaceFolder?`WORKSPACE_FOLDER_INTERPRETER_PATH_${i}`:this.workspaceService.workspaceFile?`WORKSPACE_INTERPRETER_PATH_${this.fileSystemPaths.normCase(this.workspaceService.workspaceFile.fsPath)}`:`WORKSPACE_FOLDER_INTERPRETER_PATH_${i}`,!n&&this.appEnvironment.remoteName?`${this.appEnvironment.remoteName}_${r}`:r}async copyOldInterpreterStorageValuesToNew(e){e=u.PythonSettings.getSettingsUriAndTarget(e,this.workspaceService).uri;const t=this.inspect(e,!0);await Promise.all([this._copyWorkspaceFolderValueToNewStorage(e,t.workspaceFolderValue),this._copyWorkspaceValueToNewStorage(e,t.workspaceValue),this._moveGlobalSettingValueToNewStorage(t.globalValue)])}async _copyWorkspaceFolderValueToNewStorage(e,n){const r=this.workspaceService.getWorkspaceFolderIdentifier(e,"");if(""===r)return;const i=this.persistentStateFactory.createGlobalPersistentState(t.remoteWorkspaceFolderKeysForWhichTheCopyIsDone_Key,[]),o=i.value;!o.includes(r)&&(await this.update(e,a.ConfigurationTarget.WorkspaceFolder,n),await i.updateValue([r,...o]))}async _copyWorkspaceValueToNewStorage(e,n){const r=this.workspaceService.workspaceFile?this.fileSystemPaths.normCase(this.workspaceService.workspaceFile.fsPath):void 0;if(!r)return;const i=this.persistentStateFactory.createGlobalPersistentState(t.remoteWorkspaceKeysForWhichTheCopyIsDone_Key,[]),o=i.value;!o.includes(r)&&(await this.update(e,a.ConfigurationTarget.Workspace,n),await i.updateValue([r,...o]))}async _moveGlobalSettingValueToNewStorage(e){const n=this.persistentStateFactory.createGlobalPersistentState(t.isRemoteGlobalSettingCopiedKey,!1);!n.value&&(await this.update(void 0,a.ConfigurationTarget.Global,e),await n.updateValue(!0))}};v=r([(0,s.injectable)(),i(0,(0,s.inject)(h.IPersistentStateFactory)),i(1,(0,s.inject)(l.IWorkspaceService)),i(2,(0,s.inject)(h.IDisposableRegistry)),i(3,(0,s.inject)(l.IApplicationEnvironment))],v),t.InterpreterPathService=v},21621:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserService=t.launch=void 0;const i=n(86700),o=n(66828);function s(e){o.env.openExternal(o.Uri.parse(e))}t.launch=s;let a=class{launch(e){s(e)}};a=r([(0,i.injectable)()],a),t.BrowserService=a},73766:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalStorage=t.PersistentStateFactory=t.GLOBAL_PERSISTENT_KEYS=t.WORKSPACE_PERSISTENT_KEYS_DEPRECATED=t.GLOBAL_PERSISTENT_KEYS_DEPRECATED=t.PersistentState=t.updateWorkspaceStateValue=t.getWorkspaceStateValue=t.initializePersistentStateForTriggers=void 0;const o=n(86700),s=n(19735),a=n(17585),c=n(77570),l=n(61684),u=n(36952),d=n(3481);let p;const h=[];function f(e,t){if(!p)throw new Error("Workspace state not initialized");return void 0===t?p.get(e):p.get(e,t)}async function g(e,t){if(!p)throw new Error("Workspace state not initialized");try{h.push(e),await p.update(e,t);const n=f(e);JSON.stringify(n)!==JSON.stringify(t)&&(await p.update(e,void 0),await p.update(e,t),(0,s.traceError)("Error while updating workspace state for key:",e))}catch(t){(0,s.traceError)(`Error while updating workspace state for key [${e}]:`,t)}}t.initializePersistentStateForTriggers=function(e){p=e.workspaceState},t.getWorkspaceStateValue=f,t.updateWorkspaceStateValue=g;class m{constructor(e,t,n,r){this.storage=e,this.key=t,this.defaultValue=n,this.expiryDurationMs=r}get value(){if(this.expiryDurationMs){const e=this.storage.get(this.key,{data:this.defaultValue});return!e||!e.expiry||e.expiry{await async function(){void 0!==p&&await Promise.all(h.map((e=>g(e,void 0))))}(),await this.cleanAllPersistentStates()}));const n=this.createGlobalPersistentState(t.GLOBAL_PERSISTENT_KEYS_DEPRECATED,[]),r=this.createWorkspacePersistentState(t.WORKSPACE_PERSISTENT_KEYS_DEPRECATED,[]);n.value.length>0&&n.updateValue([]).ignoreErrors(),r.value.length>0&&r.updateValue([]).ignoreErrors()}createGlobalPersistentState(e,t,n){return this.addKeyToStorage("global",e,t).ignoreErrors(),new m(this.globalState,e,t,n)}createWorkspacePersistentState(e,t,n){return this.addKeyToStorage("workspace",e,t).ignoreErrors(),new m(this.workspaceState,e,t,n)}async addKeyToStorage(e,t,n){const r="global"===e?this._globalKeysStorage:this._workspaceKeysStorage;r.value.find((e=>e.key===t))||await r.updateValue([{key:t,defaultValue:n},...r.value])}async cleanAllPersistentStates(){var e;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([]),null===(e=this.cmdManager)||void 0===e||e.executeCommand("workbench.action.reloadWindow").then(d.noop)}};r([(0,u.cache)(-1,!0)],v.prototype,"addKeyToStorage",null),v=r([(0,o.injectable)(),i(0,(0,o.inject)(l.IMemento)),i(0,(0,o.named)(l.GLOBAL_MEMENTO)),i(1,(0,o.inject)(l.IMemento)),i(1,(0,o.named)(l.WORKSPACE_MEMENTO)),i(2,(0,o.inject)(a.ICommandManager))],v),t.PersistentStateFactory=v,t.getGlobalStorage=function(e,n,r){const i=new m(e.globalState,t.GLOBAL_PERSISTENT_KEYS,[]);if(!i.value.find((e=>e.key===n))){const e=[{key:n,defaultValue:r},...i.value];i.updateValue(e).ignoreErrors()}const o=new m(e.globalState,n,r);return{get:()=>o.value,set:e=>o.updateValue(e)}}},91291:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.namedPipeClient=t.generateRandomPipeName=t.createNamedPipeServer=void 0;const r=n(6113),i=n(41808),o=n(22037),s=n(71017),a=n(95028),c=n(19735);t.createNamedPipeServer=function(e,t){(0,c.traceVerbose)(`Creating named pipe server on ${e}`);let n=0;return new Promise(((r,o)=>{const s=i.createServer((r=>{n+=1,(0,c.traceVerbose)("new client is connected to the socket, connectionCount: ",n,e),r.on("close",(()=>{n-=1,(0,c.traceVerbose)("client emitted close event, connectionCount: ",n),n<=0&&((0,c.traceVerbose)("connection count is <= 0, closing the server: ",e),s.close())})),t([new a.SocketMessageReader(r,"utf-8"),new a.SocketMessageWriter(r,"utf-8")])})),l=new Promise((e=>{s.on("close",e)}));s.on("error",o),s.listen(e,(()=>{s.removeListener("error",o),r({serverOnClosePromise:()=>l})}))}))};const{XDG_RUNTIME_DIR:l}=process.env;t.generateRandomPipeName=function(e){const t=r.randomBytes(10).toString("hex");if(0===e.length&&(e="python-ext-rpc"),"win32"===process.platform)return`\\\\.\\pipe\\${e}-${t}-sock`;let n;return n=l?s.join(l,`${e}-${t}.sock`):s.join(o.tmpdir(),`${e}-${t}.sock`),n},t.namedPipeClient=function(e){const t=i.connect(e);return[new a.SocketMessageReader(t,"utf-8"),new a.SocketMessageWriter(t,"utf-8")]}},95311:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNoPermissionsError=t.isNotDirError=t.isFileIsDirError=t.isFileExistsError=t.isFileNotFoundError=t.createDirNotEmptyError=void 0;const r=n(66828);var i;function o(e,t){const n=e.code;if(n)return n===t}!function(e){const t=r.FileSystemError.FileNotFound().name,n=r.FileSystemError.FileExists().name,i=r.FileSystemError.FileIsADirectory().name,o=r.FileSystemError.FileNotADirectory().name,s=r.FileSystemError.NoPermissions().name,a=[t,n,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,n)},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,n=i.isFileNotFound(t);return void 0!==n?n:o(t,"ENOENT")},t.isFileExistsError=function(e){const t=e,n=i.isFileExists(t);return void 0!==n?n: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,n=i.isNoPermissions(t);return void 0!==n?n:o(t,"EACCES")}},90209:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystem=t.getHashString=t.FileSystemUtils=t.RawFileSystem=t.convertStat=void 0;const i=n(6113),o=n(55674),s=n(12884),a=n(86700),c=n(73837),l=n(66828),u=n(19735);n(32727);const d=n(56091),p=n(95311),h=n(48431),f=n(22512),g=n(84974),m="utf8";function v(e,t){return{type:t,size:e.size,ctime:Math.round(e.ctimeMs),mtime:Math.round(e.mtimeMs)}}function y(e,t){return t===g.FileType.Unknown?e.filter((([e,t])=>t===g.FileType.Unknown||t===(g.FileType.SymbolicLink&g.FileType.Unknown))):e.filter((([e,n])=>(n&t)>0))}t.convertStat=v;class b{constructor(e,t,n){this.paths=e,this.vscfs=t,this.fsExtra=n}static withDefaults(e,t,n){return new b(e||h.FileSystemPaths.withDefaults(),t||l.workspace.fs,n||o)}async pathExists(e){return this.fsExtra.pathExists(e)}async stat(e){const t=l.Uri.file(e);return this.vscfs.stat(t)}async lstat(e){const t=await this.fsExtra.lstat(e);return v(t,(0,d.convertFileType)(t))}async chmod(e,t){return this.fsExtra.chmod(e,t)}async move(e,t){const n=l.Uri.file(e),r=l.Uri.file(t);await this.vscfs.stat(l.Uri.file(this.paths.dirname(t)));const i={overwrite:!1};try{await this.vscfs.rename(n,r,i)}catch(e){if(!(0,p.isFileExistsError)(e))throw e;if((await this.vscfs.stat(r)).type===g.FileType.Directory)throw e;i.overwrite=!0,await this.vscfs.rename(n,r,i)}}async readData(e){const t=l.Uri.file(e),n=await this.vscfs.readFile(t);return Buffer.from(n)}async readText(e){const t=l.Uri.file(e),n=await this.vscfs.readFile(t);return Buffer.from(n).toString(m)}async writeText(e,t){const n=l.Uri.file(e),r=Buffer.from(t);await this.vscfs.writeFile(n,r)}async appendText(e,t){return this.fsExtra.appendFile(e,t)}async copyFile(e,t){const n=l.Uri.file(e),r=l.Uri.file(t);await this.vscfs.stat(l.Uri.file(this.paths.dirname(t))),await this.vscfs.copy(n,r,{overwrite:!0})}async rmfile(e){const t=l.Uri.file(e);return this.vscfs.delete(t,{recursive:!1,useTrash:!1})}async rmdir(e){const t=l.Uri.file(e),n=await this.vscfs.readDirectory(t);if(n&&n.length>0)throw(0,p.createDirNotEmptyError)(e);return this.vscfs.delete(t,{recursive:!0,useTrash:!1})}async rmtree(e){const t=l.Uri.file(e);return await this.vscfs.stat(t),this.vscfs.delete(t,{recursive:!0,useTrash:!1})}async mkdirp(e){const t=l.Uri.file(e);await this.vscfs.createDirectory(t)}async listdir(e){const t=l.Uri.file(e);return(await this.vscfs.readDirectory(t)).map((([t,n])=>[this.paths.join(e,t),n]))}statSync(e){let t=this.fsExtra.lstatSync(e),n=g.FileType.Unknown;return t.isSymbolicLink()&&(n=g.FileType.SymbolicLink,t=this.fsExtra.statSync(e)),n|=(0,d.convertFileType)(t),v(t,n)}readTextSync(e){return this.fsExtra.readFileSync(e,m)}createReadStream(e){return this.fsExtra.createReadStream(e)}createWriteStream(e){return this.fsExtra.createWriteStream(e)}}t.RawFileSystem=b;class S{constructor(e,t,n,r,i,o){this.raw=e,this.pathUtils=t,this.paths=n,this.tmp=r,this.getHash=i,this.globFiles=o}static withDefaults(e,t,n,r,i){return t=t||h.FileSystemPathUtils.withDefaults(),new S(e||b.withDefaults(t.paths),t,t.paths,n||f.TemporaryFileSystem.withDefaults(),r||_,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 n;try{n=await this.raw.stat(e)}catch(t){return(0,p.isFileNotFoundError)(t)||(0,u.traceError)(`stat() failed for "${e}"`,t),!1}return t===g.FileType.Unknown?n.type===g.FileType.Unknown:(n.type&t)===t}async fileExists(e){return this.pathExists(e,g.FileType.File)}async directoryExists(e){return this.pathExists(e,g.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 y(await this.listdir(e),g.FileType.Directory).map((([e,t])=>e))}async getFiles(e){return y(await this.listdir(e),g.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),n=`${t.ctime}-${t.mtime}`;return this.getHash(n)}async search(e,t,n){let r;t&&(r={...r,cwd:t}),n&&(r={...r,dot:n});const i=await this.globFiles(e,r);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){const t=(0,i.createHash)("sha512");return t.update(e),t.digest("hex")}t.FileSystemUtils=S,t.getHashString=_;let E=class{constructor(){this.utils=S.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,n){return this.utils.search(e,t,n)}async createTemporaryFile(e,t){return this.utils.tmp.createFile(e,t)}async isDirReadonly(e){return this.utils.isDirReadonly(e)}};E=r([(0,a.injectable)()],E),t.FileSystem=E},88409:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.watchLocationForPattern=t.FileChangeType=void 0;const r=n(66828),i=n(19735),o=n(81837);var s;!function(e){e.Changed="changed",e.Created="created",e.Deleted="deleted"}(s=t.FileChangeType||(t.FileChangeType={})),t.watchLocationForPattern=function(e,t,n){const a=new r.RelativePattern(e,t),c=new o.Disposables;(0,i.traceVerbose)(`Start watching: ${e} with pattern ${t} using VSCode API`);const l=r.workspace.createFileSystemWatcher(a);return c.push(l.onDidCreate((e=>n(s.Created,e.fsPath)))),c.push(l.onDidChange((e=>n(s.Changed,e.fsPath)))),c.push(l.onDidDelete((e=>n(s.Deleted,e.fsPath)))),c}},48431:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFile=t.pathExists=t.copyFile=t.arePathsSame=t.isParentPath=t.normCase=t.normCasePath=t.FileSystemPathUtils=t.Executables=t.FileSystemPaths=void 0;const r=n(71017),i=n(47237),o=n(55674),s=n(87450),a=n(58967);class c{constructor(e,t){this.isCaseInsensitive=e,this.raw=t}static withDefaults(e){return void 0===e&&(e=(0,s.getOSType)()===s.OSType.Windows),new c(e,r)}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=c;class l{constructor(e,t){this.delimiter=e,this.osType=t}static withDefaults(){return new l(r.delimiter,(0,s.getOSType)())}get envVar(){return(0,i.getSearchPathEnvVarNames)(this.osType)[0]}}t.Executables=l;class u{constructor(e,t,n,r){this.home=e,this.paths=t,this.executables=n,this.raw=r}static withDefaults(e){return void 0===e&&(e=c.withDefaults()),new u(a("~"),e,l.withDefaults(),r)}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 d(e){return p(r.normalize(e))}function p(e){return(0,s.getOSType)()===s.OSType.Windows?e.toUpperCase():e}function h(e,t){return t.endsWith(r.sep)||(t+=r.sep),e.endsWith(r.sep)||(e+=r.sep),d(e).startsWith(d(t))}t.FileSystemPathUtils=u,t.normCasePath=d,t.normCase=p,t.isParentPath=h,t.arePathsSame=function(e,t){return d(e)===d(t)},t.copyFile=async function(e,t){const n=r.dirname(t);await o.pathExists(n)||await o.mkdirp(n),await o.copy(e,t,{overwrite:!0})},t.pathExists=function(e){return o.pathExists(e)},t.createFile=function(e){return o.createFile(e)}},22512:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TemporaryFileSystem=void 0;const r=n(36276);class i{constructor(e){this.raw=e}static withDefaults(){return new i(r)}createFile(e,t){const n={postfix:e,mode:t};return new Promise(((e,t)=>{this.raw.file(n,((n,r,i,o)=>{if(n)return t(n);e({filePath:r,dispose:o})}))}))}}t.TemporaryFileSystem=i},79434:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PathUtils=void 0;const o=n(86700),s=n(71017),a=n(61684),c=n(87450),l=n(48431),u=n(58967);let d=class{constructor(e){const t=e?c.OSType.Windows:c.OSType.Unknown;this.utils=new l.FileSystemPathUtils(u("~"),l.FileSystemPaths.withDefaults(),new l.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)}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IsWindows))],d),t.PathUtils=d},65243:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.isWindows=t.PlatformService=void 0;const i=n(86700),o=n(22037),s=n(81249),a=n(47237),c=n(87450),l=n(52439);let u=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,l.parseSemVerSafe)(o.release())}default:throw new Error("Not Supported")}}get isWindows(){return d()}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}};function d(){return(0,c.getOSType)()===c.OSType.Windows}u=r([(0,i.injectable)()],u),t.PlatformService=u,t.isWindows=d},3522:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.getArchitectureDisplayName=t.RegistryImplementation=void 0;const i=n(86700),o=n(19735),s=n(87450),a=n(84974);var c;!function(e){e.x86="x86",e.x64="x64"}(c||(c={}));let l=class{async getKeys(e,t,r){return async function(e){const t=n(1283);return new Promise((n=>{new t(e).keys(((e,t)=>{if(e||!Array.isArray(t))return n([]);n(t.filter((e=>"string"==typeof e.key)).map((e=>e.key)))}))}))}({hive:d(t),arch:u(r),key:e}).catch((e=>((0,o.traceError)("Fetching keys from windows registry resulted in an error",e),[])))}async getValue(e,t,r,i=""){return async function(e,t=""){const r=n(1283);return new Promise((n=>{new r(e).get(t,((e,t)=>{if(e||!t||"string"!=typeof t.value)return n(void 0);n(t.value)}))}))}({hive:d(t),arch:u(r),key:e},i).catch((e=>{(0,o.traceError)("Fetching key value from windows registry resulted in an error",e)}))}};function u(e){switch(e){case s.Architecture.x86:return c.x86;case s.Architecture.x64:return c.x64;default:return}}function d(e){const t=n(1283);switch(e){case a.RegistryHive.HKCU:return t.HKCU;case a.RegistryHive.HKLM:return t.HKLM;default:return}}l=r([(0,i.injectable)()],l),t.RegistryImplementation=l,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,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const r=n(90209),i=n(65243),o=n(3522),s=n(84974);t.registerTypes=function(e){e.addSingleton(s.IPlatformService,i.PlatformService),e.addSingleton(s.IFileSystem,r.FileSystem),e.addSingleton(s.IRegistry,o.RegistryImplementation)}},84974:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFileSystem=t.IFileSystemPathUtils=t.IPlatformService=t.IRegistry=t.RegistryHive=t.FileType=void 0;const r=n(66828);var i;t.FileType=r.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,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.CurrentProcess=void 0;const i=n(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=r([(0,i.injectable)()],o),t.CurrentProcess=o},73153:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBuffer=void 0;const r=n(4914),i=n(93289);t.decodeBuffer=function(e,t=i.DEFAULT_ENCODING){return t=r.encodingExists(t)?t:i.DEFAULT_ENCODING,r.decode(Buffer.concat(e),t)}},31776:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getModuleVersion=t.isModuleInstalled=t.isValid=t.getUserSitePackages=t.getSitePackages=t.getExecutable=t.execModule=t.execCode=void 0,t.execCode=function(e){return["-c",e]},t.execModule=function(e,t){return["-m",e,...t]},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,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._SCRIPTS_DIR=void 0;const r=n(71017),i=n(77570);t._SCRIPTS_DIR=r.join(i.EXTENSION_ROOT_DIR,"python_files")},4057:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.installedCheckScript=t.createCondaScript=t.createVenvScript=t.linterScript=t.tensorboardLauncher=t.execution_py_testlauncher=t.visualstudio_py_testlauncher=t.pytestlauncher=t.testlauncher=t.shell_exec=t.printEnvVariables=t.normalizeSelection=t.interpreterInfo=t.OUTPUT_MARKER_SCRIPT=t.testingTools=void 0;const r=n(71017),i=n(48266),o=i._SCRIPTS_DIR;t.testingTools=n(81036),t.OUTPUT_MARKER_SCRIPT=r.join(i._SCRIPTS_DIR,"get_output_via_markers.py"),t.interpreterInfo=function(){const e=[r.join(o,"interpreterInfo.py")];return[e,function(t){try{return JSON.parse(t)}catch(n){throw Error(`python ${e} returned bad JSON (${t}) (${n})`)}}]},t.normalizeSelection=function(){return[[r.join(o,"normalizeSelection.py")],function(e){return e}]},t.printEnvVariables=function(){return[[r.join(o,"printEnvVariables.py").fileToCommandArgumentForPythonExt()],function(e){return JSON.parse(e)}]},t.shell_exec=function(e,t,n){return[r.join(o,"shell_exec.py"),e.fileToCommandArgumentForPythonExt(),...n,t.fileToCommandArgumentForPythonExt()]},t.testlauncher=function(e){return[r.join(o,"testlauncher.py"),...e]},t.pytestlauncher=function(e){return[r.join(o,"vscode_pytest","run_pytest_script.py"),...e]},t.visualstudio_py_testlauncher=function(e){return[r.join(o,"visualstudio_py_testlauncher.py"),...e]},t.execution_py_testlauncher=function(e){return[r.join(o,"unittestadapter","execution.py"),...e]},t.tensorboardLauncher=function(e){return[r.join(o,"tensorboard_launcher.py"),...e]},t.linterScript=function(){return r.join(o,"linter.py")},t.createVenvScript=function(){return r.join(o,"create_venv.py")},t.createCondaScript=function(){return r.join(o,"create_conda.py")},t.installedCheckScript=function(){return r.join(o,"installed_check.py")}},81036:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unittestDiscovery=t.runAdapter=void 0;const r=n(71017),i=n(48266),o=r.join(i._SCRIPTS_DIR,"testing_tools");t.runAdapter=function(e){return[r.join(o,"run_adapter.py"),...e]},t.unittestDiscovery=function(e){return[r.join(o,"unittest_discovery.py"),...e]}},34581:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProcessLogger=void 0;const o=n(86700),s=n(19735),a=n(17585),c=n(77570),l=n(87450),u=n(96486),d=n(94146),p=n(89465);let h=class{constructor(e){this.workspaceService=e}logProcess(e,t,n){var r;if(!(0,c.isTestExecution)()&&c.isCI&&process.env.UITEST_DISABLE_PROCESS_LOGGING)return;let i=t?[e,...t].map((e=>e.trimQuotes().toCommandArgumentForPythonExt())).join(" "):e;const o=[`> ${this.getDisplayCommands(i)}`];if(null==n?void 0:n.cwd){const e="string"==typeof(null==n?void 0:n.cwd)?null==n?void 0:n.cwd:null===(r=null==n?void 0:n.cwd)||void 0===r?void 0:r.toString();o.push(`cwd: ${this.getDisplayCommands(e)}`)}"string"==typeof(null==n?void 0:n.shell)&&o.push(`shell: ${(0,p.identifyShellFromShellPath)(null==n?void 0:n.shell)}`),o.forEach((e=>{(0,s.traceLog)(e)}))}getDisplayCommands(e){this.workspaceService.workspaceFolders&&1===this.workspaceService.workspaceFolders.length&&(e=f(e,this.workspaceService.workspaceFolders[0].uri.fsPath,"."));const t=(0,l.getUserHomeDir)();return t&&(e=f(e,t,"~")),e}};function f(e,t,n){function r(e){let t=(0,u.escapeRegExp)(e);return(0,l.getOSType)()===l.OSType.Windows&&(t=(0,d.replaceAll)(t,"\\\\","(\\\\|/)")),new RegExp(t,"ig")}let i=e.split(" ");for(let e=0;e0&&i[e][a-1].match(/[a-z]/)&&(o=r(t.substring(1))),i[e]=i[e].replace(o,n)}}return i.join(" ")}h=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IWorkspaceService))],h),t.ProcessLogger=h},66462:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProcessService=void 0;const r=n(82361),i=n(19735),o=n(18699),s=n(76239);class a extends r.EventEmitter{constructor(e){super(),this.env=e,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,n={}){const r={...n,doNotLog:!0},i=(0,o.execObservable)(e,t,r,this.env,this.processesToKill);return this.emit("exec",e,t,n),i}exec(e,t,n={}){if(this.emit("exec",e,t,n),n.useWorker)return(0,s.workerPlainExec)(e,t,n);const r={...n,doNotLog:!0};return(0,o.plainExec)(e,t,r,this.env,this.processesToKill)}shellExec(e,t={}){if(this.emit("exec",e,void 0,t),t.useWorker)return(0,s.workerShellExec)(e,t);const n=new Set,r={...t,doNotLog:!0};return(0,o.shellExec)(e,r,this.env,n).finally((()=>{n.forEach((t=>{try{t.dispose()}catch(t){(0,i.traceError)(`Unable to kill process for ${e}`)}}))}))}}t.ProcessService=a},98065:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProcessServiceFactory=void 0;const o=n(86700),s=n(61684),a=n(19909),c=n(66462),l=n(29983);let u=class{constructor(e,t,n){this.envVarsService=e,this.processLogger=t,this.disposableRegistry=n}async create(e,t){const n=(null==t?void 0:t.doNotUseCustomEnvs)?void 0:await this.envVarsService.getEnvironmentVariables(e),r=new c.ProcessService(n);return this.disposableRegistry.push(r),r.on("exec",this.processLogger.logProcess.bind(this.processLogger))}};u=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IEnvironmentVariablesProvider)),i(1,(0,o.inject)(l.IProcessLogger)),i(2,(0,o.inject)(s.IDisposableRegistry))],u),t.ProcessServiceFactory=u},3672:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMicrosoftStoreEnv=t.createCondaEnv=t.createPythonEnv=void 0;const r=n(71017),i=n(19735),o=n(75470),s=n(24708),a=n(93400),c=n(69554),l=n(77570),u=n(31776),d=new Map;class p{constructor(e,t){this.pythonPath=e,this.deps=t,this.cachedInterpreterInformation=null}getExecutionInfo(e=[],t){const n=this.deps.getPythonArgv(this.pythonPath);return(0,s.buildPythonExecInfo)(n,e,t)}getExecutionObservableInfo(e=[],t){const n=this.deps.getObservablePythonArgv(this.pythonPath);return(0,s.buildPythonExecInfo)(n,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=d.get(this.pythonPath);if(void 0!==e&&!(0,l.isTestExecution)())return e;const t=this.getExecutionInfo(),n=(0,a.getExecutablePath)(t,this.deps.shellExec);return d.set(this.pythonPath,n),n}async getModuleVersion(e){const[t,n]=u.getModuleVersion(e),r=this.getExecutionInfo(t);let o;try{o=await this.deps.exec(r.command,r.args)}catch(t){return void(0,i.traceVerbose)(`Error when getting version of module ${e}`,t)}return n(o.stdout)}async isModuleInstalled(e){const[t]=u.isModuleInstalled(e),n=this.getExecutionInfo(t);try{await this.deps.exec(n.command,n.args)}catch(t){return(0,i.traceVerbose)(`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,{verbose:i.traceVerbose,error:i.traceError})}catch(e){(0,i.traceError)(`Failed to get interpreter information for '${this.pythonPath}'`,e)}}}function h(e,t,n,i,o){return{getPythonArgv:e=>(r.basename(e)===e&&(t=e.split(" ")),t||[e]),getObservablePythonArgv:e=>(r.basename(e)===e&&(n=e.split(" ")),n||[e]),isValidExecutable:e,exec:async(e,t)=>i(e,t,{throwOnStdErr:!0}),shellExec:o}}t.createPythonEnv=function(e,t,n){const r=h((async e=>n.pathExists(e)),void 0,void 0,((e,n,r)=>t.exec(e,n,r)),((e,n)=>t.shellExec(e,n)));return new p(e,r)},t.createCondaEnv=async function(e,t,n){const r=await o.Conda.getConda(),i=await(null==r?void 0:r.getRunPythonArgs({name:e.name,prefix:e.path}));if(!i)return;const s=h((async e=>n.pathExists(e)),i,i,((e,n,r)=>t.exec(e,n,r)),((e,n)=>t.shellExec(e,n))),a=await(null==r?void 0:r.getInterpreterPathForEnvironment({name:e.name,prefix:e.path}));return a?new p(a,s):void 0},t.createMicrosoftStoreEnv=function(e,t){const n=h((async e=>!0),void 0,void 0,((e,n,r)=>t.exec(e,n,r)),((e,n)=>t.shellExec(e,n)));return new p(e,n)}},51625:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PythonExecutionFactory=void 0;const o=n(86700),s=n(80351),a=n(18639),c=n(77498),l=n(54813),u=n(61522),d=n(84974),p=n(61684),h=n(66462),f=n(3672),g=n(29672),m=n(29983),v=n(87282),y=n(59314),b=n(19735);let S=class{constructor(e,t,n,r,i,o,s){this.serviceContainer=e,this.activationHelper=t,this.processServiceFactory=n,this.configService=r,this.pyenvs=i,this.autoSelection=o,this.interpreterPathExpHelper=s,this.disposables=this.serviceContainer.get(p.IDisposableRegistry),this.logger=this.serviceContainer.get(m.IProcessLogger),this.fileSystem=this.serviceContainer.get(d.IFileSystem)}async create(e){let{pythonPath:t}=e;if(!t||"python"===t){const n=this.serviceContainer.get(a.IActivatedEnvironmentLaunch);await n.selectIfLaunchedViaActivatedEnv();const r=this.interpreterPathExpHelper.get(e.resource);r&&"python"!==r||await Promise.race([this.autoSelection.autoSelectInterpreter(e.resource).then((()=>!0)),(0,y.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 n=await this.processServiceFactory.create(e.resource),r=await this.createCondaExecutionService(t,n);if(r)return r;const i=this.pyenvs.isMicrosoftStoreInterpreter.bind(this.pyenvs);return _(n,await i(t)?(0,f.createMicrosoftStoreEnv)(t,n):(0,f.createPythonEnv)(t,n,this.fileSystem))}async createActivatedEnvironment(e){const t=await this.activationHelper.getActivatedEnvironmentVariables(e.resource,e.interpreter,e.allowEnvironmentFetchExceptions),n=t&&Object.keys(t).length>0;if((0,l.sendTelemetryEvent)(u.EventName.PYTHON_INTERPRETER_ACTIVATION_ENVIRONMENT_VARIABLES,void 0,{hasEnvVars:n}),!n)return this.create({resource:e.resource,pythonPath:e.interpreter?e.interpreter.path:void 0});const r=e.interpreter?e.interpreter.path:this.configService.getSettings(e.resource).pythonPath,i=new h.ProcessService({...t});i.on("exec",this.logger.logProcess.bind(this.logger)),this.disposables.push(i);const o=await this.createCondaExecutionService(r,i);return o||_(i,(0,f.createPythonEnv)(r,i,this.fileSystem))}async createCondaExecutionService(e,t){const n=this.serviceContainer.get(a.IComponentAdapter),[r]=await Promise.all([n.getCondaEnvironment(e)]);if(!r)return;const i=await(0,f.createCondaEnv)(r,t,this.fileSystem);return i?_(t,i):void 0}};function _(e,t){const n=(0,g.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)=>n.execObservable(e,t),execModuleObservable:(e,t,r)=>n.execModuleObservable(e,t,r),exec:(e,t)=>n.exec(e,t),execModule:(e,t,r)=>n.execModule(e,t,r),execForLinter:(e,t,r)=>n.execForLinter(e,t,r)}}S=r([(0,o.injectable)(),i(0,(0,o.inject)(c.IServiceContainer)),i(1,(0,o.inject)(s.IEnvironmentActivationService)),i(2,(0,o.inject)(m.IProcessServiceFactory)),i(3,(0,o.inject)(p.IConfigurationService)),i(4,(0,o.inject)(a.IComponentAdapter)),i(5,(0,o.inject)(v.IInterpreterAutoSelectionService)),i(6,(0,o.inject)(p.IInterpreterPathService))],S),t.PythonExecutionFactory=S},29672:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPythonProcessService=void 0;const r=n(26804),i=n(97300),o=n(31776);class s{constructor(e){this.deps=e}execObservable(e,t){const n={...t},r=this.deps.getExecutionObservableInfo(e);return this.deps.execObservable(r.command,r.args,n)}execModuleObservable(e,t,n){const r=o.execModule(e,t),i={...n},s=this.deps.getExecutionObservableInfo(r);return this.deps.execObservable(s.command,s.args,i)}async exec(e,t){const n={...t},r=this.deps.getExecutionInfo(e);return this.deps.exec(r.command,r.args,n)}async execModule(e,t,n){const s=o.execModule(e,t),a={...n},c=this.deps.getExecutionInfo(s),l=await this.deps.exec(c.command,c.args,a);if(e&&r.ErrorUtils.outputHasModuleNotInstalledError(e,l.stderr)&&!await this.deps.isModuleInstalled(e))throw new i.ModuleNotInstalledError(e);return l}async execForLinter(e,t,n){const o={...n},s=this.deps.getExecutionInfo(t),a=await this.deps.exec(s.command,s.args,o);if(e&&r.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,n,r)=>e.exec(t,n,r),execObservable:(t,n,r)=>e.execObservable(t,n,r)})}},91950:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PythonToolExecutionService=void 0;const o=n(86700),s=n(77498),a=n(29983);let c=class{constructor(e){this.serviceContainer=e}async execObservable(e,t,n){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:n})).execModuleObservable(e.moduleName,e.args,t):(await this.serviceContainer.get(a.IProcessServiceFactory).create(n)).execObservable(e.execPath,e.args,{...t})}async exec(e,t,n){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:n})).execModule(e.moduleName,e.args,t):(await this.serviceContainer.get(a.IProcessServiceFactory).create(n)).exec(e.execPath,e.args,{...t})}async execForLinter(e,t,n){if(t.env)throw new Error("Environment variables are not supported");const r=await this.serviceContainer.get(a.IPythonExecutionFactory).create({resource:n});return e.execPath?r.exec(e.args,t):r.execForLinter(e.moduleName,e.args,t)}};c=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IServiceContainer))],c),t.PythonToolExecutionService=c},18699:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.killPid=t.execObservable=t.plainExec=t.shellExec=void 0;const r=n(32081),i=n(95100),o=n(59314),s=n(93289),a=n(29983),c=n(3481),l=n(73153),u=n(19735),d=n(56792),p=n(34581),h=/your [0-9]+x[0-9]+ screen size is bogus\. expect trouble/;function f(e,t){const n={...e},r=n;if(r){r.encoding="string"==typeof r.encoding&&r.encoding.length>0?r.encoding:s.DEFAULT_ENCODING;const{encoding:e}=r;delete r.encoding,r.encoding=e}if(n.env&&0!==Object.keys(n.env).length)n.env={...n.env};else{const e=t||process.env;n.env={...e}}return r&&r.extraVariables&&(n.env={...n.env,...r.extraVariables}),n.env.PYTHONUNBUFFERED="1",n.env.PYTHONIOENCODING||(n.env.PYTHONIOENCODING="utf-8"),n}function g(e){const t=e.match(/>>>PYTHON-EXEC-OUTPUT([\s\S]*)<<=2?t[1].trim():void 0;return void 0!==n?n:e}function m(e){try{"win32"===process.platform?(0,r.execSync)(`taskkill /pid ${e} /T /F`):process.kill(e)}catch(t){(0,u.traceVerbose)("Unable to kill process with pid",e)}}t.shellExec=function(e,t={},n,i){const o=f(t,n);return t.doNotLog||new p.ProcessLogger(new d.WorkspaceService).logProcess(e,void 0,o),new Promise(((t,n)=>{let s=!1;const a=(0,r.exec)(e,o,((e,r,i)=>{e&&null!==e?n(e):o.throwOnStdErr&&i&&i.length?n(new Error(i)):(r=g(r),t({stderr:i&&i.length>0?i:void 0,stdout:r}))}));a.once("close",(()=>{s=!0})),a.once("exit",(()=>{s=!0})),a.once("error",(()=>{s=!0}));const c={dispose:()=>{s||a.killed||(a.pid?m(a.pid):a.kill())}};i&&i.add(c)}))},t.plainExec=function(e,t,n={},i,s){var u,v;const y=f(n,i),b=y.encoding?y.encoding:"utf8";n.doNotLog||new p.ProcessLogger(new d.WorkspaceService).logProcess(e,t,n);const S=(0,r.spawn)(e,t,y);null===(u=S.stdout)||void 0===u||u.on("error",c.noop),null===(v=S.stderr)||void 0===v||v.on("error",c.noop);const _=(0,o.createDeferred)(),E={dispose:()=>{S.killed||_.completed||(S.pid?m(S.pid):S.kill())}};null==s||s.add(E);const w=[],T=(e,t,n)=>{null==e||e.on(t,n),w.push({dispose:()=>null==e?void 0:e.removeListener(t,n)})};n.token&&w.push(n.token.onCancellationRequested(E.dispose));const C=[];T(S.stdout,"data",(e=>{var t;C.push(e),null===(t=n.outputChannel)||void 0===t||t.append(e.toString())}));const P=[];return T(S.stderr,"data",(e=>{var t;n.mergeStdOutErr?(C.push(e),P.push(e)):P.push(e),null===(t=n.outputChannel)||void 0===t||t.append(e.toString())})),S.once("close",(()=>{if(_.completed)return;const e=0===P.length?void 0:(0,l.decodeBuffer)(P,b);if(e&&e.length>0&&n.throwOnStdErr&&(!h.test(e)||0!==e.replace(h,"").trim().length))_.reject(new a.StdErrError(e));else{let t=(0,l.decodeBuffer)(C,b);t=g(t),_.resolve({stdout:t,stderr:e})}w.forEach((e=>e.dispose())),E.dispose()})),S.once("error",(e=>{_.reject(e),w.forEach((e=>e.dispose())),E.dispose()})),_.promise},t.execObservable=function(e,t,n={},o,s){const c=f(n,o),u=c.encoding?c.encoding:"utf8";n.doNotLog||new p.ProcessLogger(new d.WorkspaceService).logProcess(e,t,n);const h=(0,r.spawn)(e,t,c);let g=!1;const v={dispose(){h&&h.pid&&!h.killed&&!g&&m(h.pid),h&&h.unref()}};null==s||s.add(v);const y=new i.Observable((e=>{var t,r;const i=[],o=(e,t,n)=>{null==e||e.on(t,n),i.push({dispose:()=>null==e?void 0:e.removeListener(t,n)})};n.token&&i.push(n.token.onCancellationRequested((()=>{g||h.killed||(h.pid?m(h.pid):h.kill(),g=!0)})));const s=(t,r)=>{let i=(0,l.decodeBuffer)([r],u);"stderr"===t&&n.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("<<s("stdout",e))),o(h.stderr,"data",(e=>s("stderr",e))),h.once("close",(()=>{g=!0,e.complete(),i.forEach((e=>e.dispose()))})),h.once("exit",(()=>{g=!0,e.complete(),i.forEach((e=>e.dispose()))})),h.once("error",(t=>{g=!0,e.error(t),i.forEach((e=>e.dispose()))})),void 0!==n.stdinStr&&(null===(t=h.stdin)||void 0===t||t.write(n.stdinStr),null===(r=h.stdin)||void 0===r||r.end())}));return{proc:h,out:y,dispose:v.dispose}},t.killPid=m},52615:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const r=n(98065),i=n(51625),o=n(91950),s=n(29983);t.registerTypes=function(e){e.addSingleton(s.IProcessServiceFactory,r.ProcessServiceFactory),e.addSingleton(s.IPythonExecutionFactory,i.PythonExecutionFactory),e.addSingleton(s.IPythonToolExecutionService,o.PythonToolExecutionService)}},29983:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IPythonToolExecutionService=t.StdErrError=t.IPythonExecutionService=t.IPythonExecutionFactory=t.IProcessServiceFactory=t.IProcessLogger=void 0,t.IProcessLogger=Symbol("IProcessLogger"),t.IProcessServiceFactory=Symbol("IProcessServiceFactory"),t.IPythonExecutionFactory=Symbol("IPythonExecutionFactory"),t.IPythonExecutionService=Symbol("IPythonExecutionService");class n extends Error{constructor(e){super(e)}}t.StdErrError=n,t.IPythonToolExecutionService=Symbol("IPythonToolRunnerService")},13018:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeWorkerFile=void 0;const r=n(71267),i=n(71017),o=n(19735);t.executeWorkerFile=async function(e,t){if(!e.endsWith(".worker.js"))throw new Error('Worker file must end with ".worker.js" for webpack to bundle webworkers');return new Promise(((n,s)=>{const a=new r.Worker(e,{workerData:t}),c=a.threadId;(0,o.traceVerbose)(`Worker id ${c} for file ${i.basename(e)} with data ${JSON.stringify(t)}`),a.on("message",(e=>{e.err&&s(e.err),n(e.res)})),a.on("error",(t=>{(0,o.traceError)(`Error in worker ${e}`,t),s(t)})),a.on("exit",(t=>{(0,o.traceVerbose)(`Worker id ${c} exited with code ${t}`),0!==t&&s(new Error(`Worker ${e} stopped with exit code ${t}`))}))}))}},76239:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.workerPlainExec=t.workerShellExec=void 0;const r=n(71017),i=n(13018);t.workerShellExec=function(e,t){return(0,i.executeWorkerFile)(r.join(__dirname,"shellExec.worker.js"),{command:e,options:t})},t.workerPlainExec=function(e,t,n={}){return(0,i.executeWorkerFile)(r.join(__dirname,"plainExec.worker.js"),{file:e,args:t,options:n})}},39702:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const r=n(90819),i=n(61684),o=n(11272),s=n(15036),a=n(78838),c=n(17792),l=n(18718),u=n(13706),d=n(77633),p=n(17381),h=n(30651),f=n(5869),g=n(54144),m=n(67808),v=n(72874),y=n(13578),b=n(64991),S=n(53314),_=n(17585),E=n(56792),w=n(30751),T=n(15797),C=n(12474),P=n(80819),x=n(97469),I=n(21621),R=n(73766),D=n(79434),O=n(20900),k=n(34581),A=n(29983),N=n(32237),M=n(80484),L=n(14744),j=n(92298),F=n(8572),U=n(78625),q=n(79152),V=n(78558),H=n(546),W=n(86678),B=n(55928),$=n(81731),K=n(67482),G=n(80656),z=n(58400),Y=n(22207),J=n(10195),Q=n(54094),X=n(32907),Z=n(35657),ee=n(65243);t.registerTypes=function(e){e.addSingletonInstance(i.IsWindows,(0,ee.isWindows)()),e.addSingleton(_.IActiveResourceService,c.ActiveResourceService),e.addSingleton(i.IInterpreterPathService,x.InterpreterPathService),e.addSingleton(i.IExtensions,y.Extensions),e.addSingleton(i.IRandom,J.Random),e.addSingleton(i.IPersistentStateFactory,R.PersistentStateFactory),e.addBinding(i.IPersistentStateFactory,r.IExtensionSingleActivationService),e.addSingleton(z.ITerminalServiceFactory,H.TerminalServiceFactory),e.addSingleton(i.IPathUtils,D.PathUtils),e.addSingleton(_.IApplicationShell,u.ApplicationShell),e.addSingleton(_.IClipboard,d.ClipboardService),e.addSingleton(i.ICurrentProcess,O.CurrentProcess),e.addSingleton(i.IInstaller,P.ProductInstaller),e.addSingleton(_.IJupyterExtensionDependencyManager,o.JupyterExtensionDependencyManager),e.addSingleton(r.IExtensionSingleActivationService,Z.RequireJupyterPrompt),e.addSingleton(r.IExtensionSingleActivationService,X.CreatePythonFileCommandHandler),e.addSingleton(_.ICommandManager,p.CommandManager),e.addSingleton(_.IContextKeyManager,Q.ContextKeyManager),e.addSingleton(i.IConfigurationService,w.ConfigurationService),e.addSingleton(_.IWorkspaceService,E.WorkspaceService),e.addSingleton(A.IProcessLogger,k.ProcessLogger),e.addSingleton(_.IDocumentManager,v.DocumentManager),e.addSingleton(_.ITerminalManager,S.TerminalManager),e.addSingleton(_.IDebugService,g.DebugService),e.addSingleton(_.IApplicationEnvironment,l.ApplicationEnvironment),e.addSingleton(_.ILanguageService,b.LanguageService),e.addSingleton(i.IBrowserService,I.BrowserService),e.addSingleton(z.ITerminalActivator,N.TerminalActivator),e.addSingleton(z.ITerminalActivationHandler,M.PowershellTerminalActivationFailedHandler),e.addSingleton(i.IExperimentService,C.ExperimentService),e.addSingleton(z.ITerminalHelper,W.TerminalHelper),e.addSingleton(z.ITerminalActivationCommandProvider,L.Bash,z.TerminalActivationProviders.bashCShellFish),e.addSingleton(z.ITerminalActivationCommandProvider,F.CommandPromptAndPowerShell,z.TerminalActivationProviders.commandPromptAndPowerShell),e.addSingleton(z.ITerminalActivationCommandProvider,j.Nushell,z.TerminalActivationProviders.nushell),e.addSingleton(z.ITerminalActivationCommandProvider,V.PyEnvActivationCommandProvider,z.TerminalActivationProviders.pyenv),e.addSingleton(z.ITerminalActivationCommandProvider,U.CondaActivationCommandProvider,z.TerminalActivationProviders.conda),e.addSingleton(z.ITerminalActivationCommandProvider,q.PipEnvActivationCommandProvider,z.TerminalActivationProviders.pipenv),e.addSingleton(i.IToolExecutionPath,T.PipEnvExecutionPath,i.ToolExecutionPath.pipenv),e.addSingleton(Y.IMultiStepInputFactory,Y.MultiStepInputFactory),e.addSingleton(a.IImportTracker,s.ImportTracker),e.addBinding(a.IImportTracker,r.IExtensionSingleActivationService),e.addSingleton(z.IShellDetector,$.TerminalNameShellDetector),e.addSingleton(z.IShellDetector,B.SettingsShellDetector),e.addSingleton(z.IShellDetector,K.UserEnvironmentShellDetector),e.addSingleton(z.IShellDetector,G.VSCEnvironmentShellDetector),e.addSingleton(r.IExtensionSingleActivationService,h.ReloadVSCodeCommandHandler),e.addSingleton(r.IExtensionSingleActivationService,f.ReportIssueCommandHandler),e.addSingleton(r.IExtensionSingleActivationService,m.DebugSessionTelemetry)}},94146:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.replaceAll=t.splitLines=void 0,t.splitLines=function(e,t={removeEmptyEntries:!0,trim:!0}){let n=e.split(/\r?\n/g);return(null==t?void 0:t.trim)&&(n=n.map((e=>e.trim()))),(null==t?void 0:t.removeEmptyEntries)&&(n=n.filter((e=>e.length>0))),n},t.replaceAll=function(e,t,n){return e?e.replace(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),n):e}},57563:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTerminalActivator=void 0;const r=n(19735),i=n(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 n=(0,i.createDeferred)();this.activatedTerminals.set(e,n.promise);const o=this.helper.identifyTerminalShell(e),s=await this.helper.getEnvironmentActivationCommands(o,null==t?void 0:t.resource,null==t?void 0:t.interpreter);let a=!1;if(s)for(const n of s)e.show(null==t?void 0:t.preserveFocus),(0,r.traceVerbose)(`Command sent to terminal: ${n}`),e.sendText(n),await this.waitForCommandToProcess(o),a=!0;return n.resolve(a),a}async waitForCommandToProcess(e){await(0,i.sleep)(500)}}},32237:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalActivator=void 0;const o=n(86700),s=n(61684),a=n(58400),c=n(57563),l=n(46747);let u=class{constructor(e,t,n,r){this.helper=e,this.handlers=t,this.configurationService=n,this.experimentService=r,this.pendingActivations=new WeakMap,this.initialize()}async activateEnvironmentInTerminal(e,t){let n=this.pendingActivations.get(e);return n||(n=this.activateEnvironmentInTerminalImpl(e,t),this.pendingActivations.set(e,n),n)}async activateEnvironmentInTerminalImpl(e,t){if(!this.configurationService.getSettings(null==t?void 0:t.resource).terminal.activateEnvironment||(0,l.inTerminalEnvVarExperiment)(this.experimentService)||(null==t?void 0:t.hideFromUser))return!1;const n=await this.baseActivator.activateEnvironmentInTerminal(e,t);return this.handlers.forEach((r=>r.handleActivation(e,null==t?void 0:t.resource,!0===(null==t?void 0:t.preserveFocus),n).ignoreErrors())),n}initialize(){this.baseActivator=new c.BaseTerminalActivator(this.helper)}};u=r([(0,o.injectable)(),i(0,(0,o.inject)(a.ITerminalHelper)),i(1,(0,o.multiInject)(a.ITerminalActivationHandler)),i(2,(0,o.inject)(s.IConfigurationService)),i(3,(0,o.inject)(s.IExperimentService))],u),t.TerminalActivator=u},80484:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PowershellTerminalActivationFailedHandler=void 0;const o=n(86700),s=n(54205),a=n(93971),c=n(84974),l=n(58400);let u=class{constructor(e,t,n){this.helper=e,this.platformService=t,this.diagnosticService=n}async handleActivation(e,t,n,r){if(r||!this.platformService.isWindows)return;const i=this.helper.identifyTerminalShell(e);if(i!==l.TerminalShellType.powershell&&i!==l.TerminalShellType.powershellCore)return;const o=await this.helper.getEnvironmentActivationCommands(l.TerminalShellType.commandPrompt,t);o&&Array.isArray(o)&&0!==o.length&&this.diagnosticService.handle([new s.PowershellActivationNotAvailableDiagnostic(t)]).ignoreErrors()}};u=r([(0,o.injectable)(),i(0,(0,o.inject)(l.ITerminalHelper)),i(1,(0,o.inject)(c.IPlatformService)),i(2,(0,o.inject)(a.IDiagnosticsService)),i(2,(0,o.named)(s.PowerShellActivationHackDiagnosticsServiceId))],u),t.PowershellTerminalActivationFailedHandler=u},87688:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useCommandPromptAsDefaultShell=t.getCommandPromptLocation=void 0;const r=n(71017),i=n(66828);function o(e){const t=e.env.hasOwnProperty("PROCESSOR_ARCHITEW6432"),n=r.join(e.env.windir,t?"Sysnative":"System32");return r.join(n,"cmd.exe")}t.getCommandPromptLocation=o,t.useCommandPromptAsDefaultShell=async function(e,t){const n=o(e);await t.updateSectionSetting("terminal","integrated.shell.windows",n,void 0,i.ConfigurationTarget.Global)}},86575:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.VenvBaseActivationCommandProvider=void 0;const o=n(86700),s=n(71017),a=n(18639),c=n(77498),l=n(84974);let u=class{constructor(e){this.serviceContainer=e}async getActivationCommands(e,t){const n=await this.serviceContainer.get(a.IInterpreterService).getActiveInterpreter(e);if(n)return this.getActivationCommandsForInterpreter(n.path,t)}};u=r([(0,o.injectable)(),i(0,(0,o.inject)(c.IServiceContainer))],u),t.VenvBaseActivationCommandProvider=class extends u{isShellSupported(e){return void 0!==this.scripts[e]}async findScriptFile(e,t){const n=this.serviceContainer.get(l.IFileSystem),r=this.scripts[t];if(r)return function(e,t,r,i){const o="string"==typeof e?[e]:e;return async e=>{const i=t(e);for(const e of o){const t=r(i,e);if(await(s=t,n.fileExists(s)))return t}var s}}(r,s.dirname,s.join)(e)}}},14744:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.Bash=t.getAllScripts=void 0;const i=n(86700);n(32727);const o=n(58400),s=n(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.values(a))for(const n of t)e.includes(n)||e.push(n);return e};let c=class extends s.VenvBaseActivationCommandProvider{constructor(){super(...arguments),this.scripts=a}async getActivationCommandsForInterpreter(e,t){const n=await this.findScriptFile(e,t);if(n)return[`source ${n.fileToCommandArgumentForPythonExt()}`]}};c=r([(0,i.injectable)()],c),t.Bash=c},8572:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CommandPromptAndPowerShell=t.getAllScripts=void 0;const o=n(86700),s=n(71017),a=n(77498);n(32727);const c=n(58400),l=n(86575),u={[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 n of Object.values(u))for(const r of n)t.includes(r)||t.push(r,e("Scripts",r),e("scripts",r));return t};let d=class extends l.VenvBaseActivationCommandProvider{constructor(e){super(e),this.scripts={};for(const[e,t]of Object.entries(u)){const n=e,r=[];for(const e of t)r.push(e,s.join("Scripts",e),s.join("scripts",e));this.scripts[n]=r}}async getActivationCommandsForInterpreter(e,t){const n=await this.findScriptFile(e,t);if(n)return t===c.TerminalShellType.commandPrompt&&n.endsWith("activate.bat")?[n.fileToCommandArgumentForPythonExt()]:t!==c.TerminalShellType.powershell&&t!==c.TerminalShellType.powershellCore||!n.endsWith("Activate.ps1")?t===c.TerminalShellType.commandPrompt&&n.endsWith("Activate.ps1")?[]:void 0:[`& ${n.fileToCommandArgumentForPythonExt()}`]}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],d),t.CommandPromptAndPowerShell=d},78625:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t._getPowershellCommands=t.CondaActivationCommandProvider=void 0,n(32727);const o=n(86700),s=n(71017),a=n(18639),c=n(84974),l=n(61684),u=n(58400);let d=class{constructor(e,t,n,r){this.condaService=e,this.platform=t,this.configService=n,this.pyenvs=r}isShellSupported(){return!0}getActivationCommands(e,t){const{pythonPath:n}=this.configService.getSettings(e);return this.getActivationCommandsForInterpreter(n,t)}async getActivationCommandsForInterpreter(e,t){const n=await this.pyenvs.getCondaEnvironment(e);if(!n)return;const r=n.name.length>0?n.name:n.path,i=await this.condaService.getInterpreterPathForEnvironment(n),o=await this.condaService.getActivationScriptFromInterpreter(i,n.name);if(null==o?void 0:o.path){if(this.platform.isWindows&&t!==u.TerminalShellType.bash&&t!==u.TerminalShellType.gitbash)return[o.path,`conda activate ${r.toCommandArgumentForPythonExt()}`];const e=await this.condaService.getCondaInfo();return"global"!==o.type||void 0===(null==e?void 0:e.conda_shlvl)||-1===e.conda_shlvl?"activate"===o.path?[`source ${o.path}`,`conda activate ${r.toCommandArgumentForPythonExt()}`]:[`source ${o.path} ${r.toCommandArgumentForPythonExt()}`]:[`conda activate ${r.toCommandArgumentForPythonExt()}`]}switch(t){case u.TerminalShellType.powershell:case u.TerminalShellType.powershellCore:return p(r);case u.TerminalShellType.fish:return async function(e,t){return[`${t.fileToCommandArgumentForPythonExt()} activate ${e.toCommandArgumentForPythonExt()}`]}(r,await this.condaService.getCondaFile());default:return this.platform.isWindows?this.getWindowsCommands(r):async function(e,t){const n=s.dirname(t);return[`source ${s.join(n,"activate").fileToCommandArgumentForPythonExt()} ${e.toCommandArgumentForPythonExt()}`]}(r,await this.condaService.getCondaFile())}}async getWindowsActivateCommand(){let e="activate";const t=await this.condaService.getCondaFile();if(t&&s.basename(t)!==t){const n=s.dirname(t);e=s.join(n,e),e=e.toCommandArgumentForPythonExt()}return e}async getWindowsCommands(e){return[`${await this.getWindowsActivateCommand()} ${e.toCommandArgumentForPythonExt()}`]}};async function p(e){return[`conda activate ${e.toCommandArgumentForPythonExt()}`]}d=r([(0,o.injectable)(),i(0,(0,o.inject)(a.ICondaService)),i(1,(0,o.inject)(c.IPlatformService)),i(2,(0,o.inject)(l.IConfigurationService)),i(3,(0,o.inject)(a.IComponentAdapter))],d),t.CondaActivationCommandProvider=d,t._getPowershellCommands=p},92298:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.Nushell=t.getAllScripts=void 0;const i=n(86700);n(32727);const o=n(58400),s=n(86575),a={[o.TerminalShellType.nushell]:["activate.nu"]};t.getAllScripts=function(){const e=[];for(const t of Object.values(a))for(const n of t)e.includes(n)||e.push(n);return e};let c=class extends s.VenvBaseActivationCommandProvider{constructor(){super(...arguments),this.scripts=a}async getActivationCommandsForInterpreter(e,t){const n=await this.findScriptFile(e,t);if(n)return[`overlay use ${n.fileToCommandArgumentForPythonExt()}`]}};c=r([(0,i.injectable)()],c),t.Nushell=c},79152:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PipEnvActivationCommandProvider=void 0;const o=n(86700);n(32727);const s=n(18639),a=n(37924),c=n(81387),l=n(17585),u=n(61684);let d=class{constructor(e,t,n){this.interpreterService=e,this.pipEnvExecution=t,this.workspaceService=n}isShellSupported(){return!1}async getActivationCommands(e){const t=await this.interpreterService.getActiveInterpreter(e);if(!t||t.envType!==c.EnvironmentType.Pipenv)return;const n=e?this.workspaceService.getWorkspaceFolder(e):void 0;return!n||await(0,a.isPipenvEnvironmentRelatedToFolder)(t.path,null==n?void 0:n.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`]}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IInterpreterService)),i(1,(0,o.inject)(u.IToolExecutionPath)),i(1,(0,o.named)(u.ToolExecutionPath.pipenv)),i(2,(0,o.inject)(l.IWorkspaceService))],d),t.PipEnvActivationCommandProvider=d},78558:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PyEnvActivationCommandProvider=void 0;const o=n(86700),s=n(18639),a=n(77498),c=n(81387);let l=class{constructor(e){this.serviceContainer=e}isShellSupported(e){return!0}async getActivationCommands(e,t){const n=await this.serviceContainer.get(s.IInterpreterService).getActiveInterpreter(e);if(n&&n.envType===c.EnvironmentType.Pyenv&&n.envName)return[`pyenv shell ${n.envName.toCommandArgumentForPythonExt()}`]}async getActivationCommandsForInterpreter(e,t){const n=await this.serviceContainer.get(s.IInterpreterService).getInterpreterDetails(e);if(n&&n.envType===c.EnvironmentType.Pyenv&&n.envName)return[`pyenv shell ${n.envName.toCommandArgumentForPythonExt()}`]}};l=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],l),t.PyEnvActivationCommandProvider=l},546:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalServiceFactory=void 0;const o=n(86700),s=n(71017),a=n(18639),c=n(77498),l=n(17585),u=n(84974),d=n(97207),p=n(88624);let h=class{constructor(e,t,n){this.serviceContainer=e,this.fs=t,this.interpreterService=n,this.terminalServices=new Map}getTerminalService(e){const t=null==e?void 0:e.resource,n=null==e?void 0:e.title;let r="string"==typeof n&&n.trim().length>0?n.trim():"Python";const i=null==e?void 0:e.interpreter,o=this.getTerminalId(r,t,i,e.newTerminalPerFile);if(!this.terminalServices.has(o)){t&&e.newTerminalPerFile&&(r=`${r}: ${s.basename(t.fsPath).replace(".py","")}`),e.title=r;const n=new d.TerminalService(this.serviceContainer,e);this.terminalServices.set(o,n)}return new p.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 d.TerminalService(this.serviceContainer,{resource:e,title:t})}getTerminalId(e,t,n,r){if(!t&&!n)return e;const i=this.serviceContainer.get(l.IWorkspaceService).getWorkspaceFolder(t||void 0),o=t&&r?t.fsPath:"";return`${e}:${(null==i?void 0:i.uri.fsPath)||""}:${null==n?void 0:n.path}:${o}`}};h=r([(0,o.injectable)(),i(0,(0,o.inject)(c.IServiceContainer)),i(1,(0,o.inject)(u.IFileSystem)),i(2,(0,o.inject)(a.IInterpreterService))],h),t.TerminalServiceFactory=h},86678:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalHelper=void 0;const o=n(86700),s=n(18639),a=n(77498),c=n(19735),l=n(81387),u=n(54813),d=n(61522),p=n(17585);n(32727);const h=n(84974),f=n(61684),g=n(87450),m=n(71791),v=n(58400);let y=class{constructor(e,t,n,r,i,o,s,a,c,l,u,d){this.platform=e,this.terminalManager=t,this.serviceContainer=n,this.interpreterService=r,this.configurationService=i,this.conda=o,this.bashCShellFish=s,this.commandPromptAndPowerShell=a,this.nushell=c,this.pyenv=l,this.pipenv=u,this.shellDetector=new m.ShellDetector(this.platform,d)}createTerminal(e){return this.terminalManager.createTerminal({name:e})}identifyTerminalShell(e){return this.shellDetector.identifyTerminalShell(e)}buildCommandForTerminal(e,t,n){const r=e===v.TerminalShellType.powershell||e===v.TerminalShellType.powershellCore?"& ":"",i=n.map((e=>e.toCommandArgumentForPythonExt()));return`${r}${t.fileToCommandArgumentForPythonExt()} ${i.join(" ")}`.trim()}async getEnvironmentActivationCommands(e,t,n){const r=[this.pipenv,this.pyenv,this.bashCShellFish,this.commandPromptAndPowerShell,this.nushell],i=this.getActivationCommands(t||void 0,n,e,r);return this.sendTelemetry(e,d.EventName.PYTHON_INTERPRETER_ACTIVATION_FOR_TERMINAL,n,i).ignoreErrors(),i}async getEnvironmentActivationShellCommands(e,t,n){if(this.platform.osType===g.OSType.Unknown)return;const r=[this.bashCShellFish,this.commandPromptAndPowerShell,this.nushell],i=this.getActivationCommands(e,n,t,r);return this.sendTelemetry(t,d.EventName.PYTHON_INTERPRETER_ACTIVATION_FOR_RUNNING_CODE,n,i).ignoreErrors(),i}async sendTelemetry(e,t,n,r){let i=!1,o=!1;try{const e=await r;i=Array.isArray(e)&&e.length>0}catch(e){o=!0,(0,c.traceError)("Failed to get activation commands",e)}const s=n&&n.version?n.version.raw:void 0,a={failed:o,hasCommands:i,interpreterType:n?n.envType:l.EnvironmentType.Unknown,terminal:e,pythonVersion:s};(0,u.sendTelemetryEvent)(t,void 0,a)}async getActivationCommands(e,t,n,r){const i=this.configurationService.getSettings(e),o=this.serviceContainer.get(s.IComponentAdapter);if(t?t.envType===l.EnvironmentType.Conda:await o.isCondaEnvironment(i.pythonPath)){const r=t?await this.conda.getActivationCommandsForInterpreter(t.path,n):await this.conda.getActivationCommands(e,n);if(Array.isArray(r))return r}const a=r.filter((e=>e.isShellSupported(n)));for(const r of a){const i=t?await r.getActivationCommandsForInterpreter(t.path,n):await r.getActivationCommands(e,n);if(Array.isArray(i)&&i.length>0)return i}}};r([(0,c.traceDecoratorError)("Failed to capture telemetry")],y.prototype,"sendTelemetry",null),y=r([(0,o.injectable)(),i(0,(0,o.inject)(h.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)(v.ITerminalActivationCommandProvider)),i(5,(0,o.named)(v.TerminalActivationProviders.conda)),i(6,(0,o.inject)(v.ITerminalActivationCommandProvider)),i(6,(0,o.named)(v.TerminalActivationProviders.bashCShellFish)),i(7,(0,o.inject)(v.ITerminalActivationCommandProvider)),i(7,(0,o.named)(v.TerminalActivationProviders.commandPromptAndPowerShell)),i(8,(0,o.inject)(v.ITerminalActivationCommandProvider)),i(8,(0,o.named)(v.TerminalActivationProviders.nushell)),i(9,(0,o.inject)(v.ITerminalActivationCommandProvider)),i(9,(0,o.named)(v.TerminalActivationProviders.pyenv)),i(10,(0,o.inject)(v.ITerminalActivationCommandProvider)),i(10,(0,o.named)(v.TerminalActivationProviders.pipenv)),i(11,(0,o.multiInject)(v.IShellDetector))],y),t.TerminalHelper=y},97207:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalService=void 0;const o=n(86700),s=n(71017),a=n(66828);n(32727);const c=n(18639),l=n(77498),u=n(54813),d=n(61522),p=n(43200),h=n(17585),f=n(77570),g=n(61684),m=n(58400);let v=class{constructor(e,t){this.serviceContainer=e,this.options=t,this.terminalClosed=new a.EventEmitter,this.envVarScript=s.join(f.EXTENSION_ROOT_DIR,"python_files","pythonrc.py");const n=this.serviceContainer.get(g.IDisposableRegistry);n.push(this),this.terminalHelper=this.serviceContainer.get(m.ITerminalHelper),this.terminalManager=this.serviceContainer.get(h.ITerminalManager),this.terminalAutoActivator=this.serviceContainer.get(p.ITerminalAutoActivation),this.terminalManager.onDidCloseTerminal(this.terminalCloseHandler,this,n),this.terminalActivator=this.serviceContainer.get(m.ITerminalActivator)}get onDidCloseTerminal(){return this.terminalClosed.event.bind(this.terminalClosed)}dispose(){this.terminal&&this.terminal.dispose()}async sendCommand(e,t,n){var r;await this.ensureTerminal();const i=this.terminalHelper.buildCommandForTerminal(this.terminalShellType,e,t);(null===(r=this.options)||void 0===r?void 0:r.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,n,r,i,o,s;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:{PYTHONSTARTUP:this.envVarScript},hideFromUser:null===(n=this.options)||void 0===n?void 0:n.hideFromUser}),this.terminalAutoActivator.disableAutoActivation(this.terminal),await new Promise((e=>setTimeout(e,100))),await this.terminalActivator.activateEnvironmentInTerminal(this.terminal,{resource:null===(r=this.options)||void 0===r?void 0:r.resource,preserveFocus:e,interpreter:null===(i=this.options)||void 0===i?void 0:i.interpreter,hideFromUser:null===(o=this.options)||void 0===o?void 0:o.hideFromUser}),(null===(s=this.options)||void 0===s?void 0:s.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 n=this.serviceContainer.get(g.IConfigurationService).getSettings(null===(e=this.options)||void 0===e?void 0:e.resource).pythonPath,r=(null===(t=this.options)||void 0===t?void 0:t.interpreter)||await this.serviceContainer.get(c.IInterpreterService).getInterpreterDetails(n),i=r&&r.version?r.version.raw:void 0,o=r?r.envType:void 0;(0,u.captureTelemetry)(d.EventName.TERMINAL_CREATE,{terminal:this.terminalShellType,pythonVersion:i,interpreterType:o})}};v=r([(0,o.injectable)(),i(0,(0,o.inject)(l.IServiceContainer))],v),t.TerminalService=v},71791:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ShellDetector=void 0;const o=n(86700),s=n(66828),a=n(19735),c=n(54813),l=n(61522);n(32727);const u=n(84974),d=n(87450),p=n(58400),h={[d.OSType.Linux]:p.TerminalShellType.bash,[d.OSType.OSX]:p.TerminalShellType.bash,[d.OSType.Windows]:p.TerminalShellType.commandPrompt,[d.OSType.Unknown]:p.TerminalShellType.other};let f=class{constructor(e,t){this.platform=e,this.shellDetectors=t}identifyTerminalShell(e){let t;const n={failed:!0,shellIdentificationSource:"default",terminalProvided:!!e,hasCustomShell:void 0,hasShellInEnv:void 0},r=this.shellDetectors.slice().sort(((e,t)=>t.priority-e.priority));for(const i of r)if(t=i.identify(n,e),t&&t!==p.TerminalShellType.other){n.failed=!1;break}return(0,c.sendTelemetryEvent)(l.EventName.TERMINAL_SHELL_IDENTIFICATION,void 0,n),(0,a.traceVerbose)(`Shell identified as ${t} ${e?`(Terminal name is ${e.name})`:""}`),void 0!==t&&t!==p.TerminalShellType.other||((0,a.traceError)("Unable to identify shell",s.env.shell," for OS ",this.platform.osType),(0,a.traceVerbose)("Using default OS shell"),t=h[this.platform.osType]),t}};f=r([(0,o.injectable)(),i(0,(0,o.inject)(u.IPlatformService)),i(1,(0,o.multiInject)(p.IShellDetector))],f),t.ShellDetector=f},89465:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.identifyShellFromShellPath=t.BaseShellDetector=void 0;const o=n(86700),s=n(58400),a=new Map;a.set(s.TerminalShellType.powershell,/(powershell$)/i),a.set(s.TerminalShellType.gitbash,/(gitbash$)/i),a.set(s.TerminalShellType.bash,/(bash$)/i),a.set(s.TerminalShellType.wsl,/(wsl$)/i),a.set(s.TerminalShellType.zsh,/(zsh$)/i),a.set(s.TerminalShellType.ksh,/(ksh$)/i),a.set(s.TerminalShellType.commandPrompt,/(cmd$)/i),a.set(s.TerminalShellType.fish,/(fish$)/i),a.set(s.TerminalShellType.tcshell,/(tcsh$)/i),a.set(s.TerminalShellType.cshell,/(csh$)/i),a.set(s.TerminalShellType.nushell,/(nu$)/i),a.set(s.TerminalShellType.powershellCore,/(pwsh$)/i),a.set(s.TerminalShellType.xonsh,/(xonsh$)/i);let c=class{constructor(e){this.priority=e}identifyShellFromShellPath(e){return l(e)}};function l(e){const t=e.replace(/\.exe$/i,"");return Array.from(a.keys()).reduce(((e,n)=>{if(e===s.TerminalShellType.other){const e=a.get(n);if(e&&e.test(t))return n}return e}),s.TerminalShellType.other)}c=r([(0,o.injectable)(),i(0,(0,o.unmanaged)())],c),t.BaseShellDetector=c,t.identifyShellFromShellPath=l},55928:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SettingsShellDetector=void 0;const o=n(86700),s=n(17585),a=n(84974),c=n(87450),l=n(58400),u=n(89465);let d=class extends u.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 c.OSType.Windows:t="windows";break;case c.OSType.OSX:t="osx";break;case c.OSType.Linux:t="linux";break;default:return""}return e.get(t)}identify(e,t){const n=this.getTerminalShellPath();e.hasCustomShell=!!n;const r=n?this.identifyShellFromShellPath(n):l.TerminalShellType.other;return r!==l.TerminalShellType.other?e.shellIdentificationSource="environment":e.shellIdentificationSource="settings",r}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IWorkspaceService)),i(1,(0,o.inject)(a.IPlatformService))],d),t.SettingsShellDetector=d},81731:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalNameShellDetector=void 0;const i=n(86700),o=n(19735),s=n(58400),a=n(89465);let c=class extends a.BaseShellDetector{constructor(){super(4)}identify(e,t){if(!t)return;const n=this.identifyShellFromShellPath(t.name);return(0,o.traceVerbose)(`Terminal name '${t.name}' identified as shell '${n}'`),e.shellIdentificationSource=n===s.TerminalShellType.other?e.shellIdentificationSource:"terminalName",n}};c=r([(0,i.injectable)()],c),t.TerminalNameShellDetector=c},67482:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.UserEnvironmentShellDetector=void 0;const o=n(86700),s=n(84974),a=n(61684),c=n(87450),l=n(58400),u=n(89465);let d=class extends u.BaseShellDetector{constructor(e,t){super(1),this.currentProcess=e,this.platform=t}getDefaultPlatformShell(){return e=this.platform,t=this.currentProcess,e.osType===c.OSType.Windows?function(e,t){const n=parseFloat(e.osRelease)>=10,r=t.env.hasOwnProperty("PROCESSOR_ARCHITEW6432"),i=`${t.env.windir}\\${r?"Sysnative":"System32"}\\WindowsPowerShell\\v1.0\\powershell.exe`;return n?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 n=this.getDefaultPlatformShell();e.hasShellInEnv=!!n;const r=this.identifyShellFromShellPath(n);return r!==l.TerminalShellType.other&&(e.shellIdentificationSource="environment"),r}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(a.ICurrentProcess)),i(1,(0,o.inject)(s.IPlatformService))],d),t.UserEnvironmentShellDetector=d},80656:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.VSCEnvironmentShellDetector=void 0;const o=n(86700),s=n(19735),a=n(17585),c=n(58400),l=n(89465);let u=class extends l.BaseShellDetector{constructor(e){super(3),this.appEnv=e}identify(e,t){const n=(null==t?void 0:t.creationOptions)&&"shellPath"in t.creationOptions&&t.creationOptions.shellPath?t.creationOptions.shellPath:this.appEnv.shell;if(!n)return;const r=this.identifyShellFromShellPath(n);return(0,s.traceVerbose)(`Terminal shell path '${n}' identified as shell '${r}'`),e.shellIdentificationSource=r===c.TerminalShellType.other?e.shellIdentificationSource:"vscode",e.failed=r!==c.TerminalShellType.other,r}};u=r([i(0,(0,o.inject)(a.IApplicationEnvironment))],u),t.VSCEnvironmentShellDetector=u},88624:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SynchronousTerminalService=void 0;const o=n(86700),s=n(18639),a=n(19735),c=n(29979),l=n(84974),u=n(4057),d=n(59314),p=n(3481);var h;!function(e){e[e.notStarted=0]="notStarted",e[e.started=1]="started",e[e.completed=2]="completed",e[e.errored=4]="errored"}(h||(h={}));class f{constructor(e,t,n){this.lockFile=e,this.fs=t,this.command=n,this.state=h.notStarted,this._completed=(0,d.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&h.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&h.completed&&this._completed.resolve()}),100);this.disposable={dispose:()=>clearInterval(e)}}async getLockFileState(e){const t=await this.fs.readFile(e);let n=h.notStarted;return t.includes("START")&&(n|=h.started),t.includes("END")&&(n|=h.completed),t.includes("FAIL")&&(n|=h.completed|h.errored),n}}let g=class{constructor(e,t,n,r){this.fs=e,this.interpreter=t,this.terminalService=n,this.pythonInterpreter=r,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,n,r=!0){if(!n)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=u.shell_exec(e,i.filePath,t);await this.terminalService.sendCommand((null==s?void 0:s.path)||"python",a);const l=r?o.completed:o.completed.catch(p.noop);await c.Cancellation.race((()=>l),n)}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)))}};g=r([i(0,(0,o.inject)(l.IFileSystem)),i(1,(0,o.inject)(s.IInterpreterService))],g),t.SynchronousTerminalService=g},58400:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.IShellDetector=t.ITerminalActivationHandler=t.ITerminalActivationCommandProvider=t.ITerminalActivator=t.ITerminalHelper=t.ITerminalServiceFactory=t.TerminalShellType=t.TerminalActivationProviders=void 0,(r=t.TerminalActivationProviders||(t.TerminalActivationProviders={})).bashCShellFish="bashCShellFish",r.commandPromptAndPowerShell="commandPromptAndPowerShell",r.nushell="nushell",r.pyenv="pyenv",r.conda="conda",r.pipenv="pipenv",(n=t.TerminalShellType||(t.TerminalShellType={})).powershell="powershell",n.powershellCore="powershellCore",n.commandPrompt="commandPrompt",n.gitbash="gitbash",n.bash="bash",n.zsh="zsh",n.ksh="ksh",n.fish="fish",n.cshell="cshell",n.tcshell="tshell",n.nushell="nushell",n.wsl="wsl",n.xonsh="xonsh",n.other="other",t.ITerminalServiceFactory=Symbol("ITerminalServiceFactory"),t.ITerminalHelper=Symbol("ITerminalHelper"),t.ITerminalActivator=Symbol("ITerminalActivator"),t.ITerminalActivationCommandProvider=Symbol("ITerminalActivationCommandProvider"),t.ITerminalActivationHandler=Symbol("ITerminalActivationHandler"),t.IShellDetector=Symbol("IShellDetector")},61684:(e,t)=>{"use strict";var n,r,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.IDefaultLanguageServer=t.IInterpreterPathService=t.IExperimentService=t.IBrowserService=t.IExtensions=t.IExtensionContext=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.ITestOutputChannel=t.ILogOutputChannel=void 0,t.ILogOutputChannel=Symbol("ILogOutputChannel"),t.ITestOutputChannel=Symbol("ITestOutputChannel"),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",(r=t.ProductType||(t.ProductType={})).TestFramework="TestFramework",r.DataScience="DataScience",r.Python="Python",(n=t.Product||(t.Product={}))[n.pytest=1]="pytest",n[n.unittest=12]="unittest",n[n.tensorboard=24]="tensorboard",n[n.torchProfilerInstallName=25]="torchProfilerInstallName",n[n.torchProfilerImportName=26]="torchProfilerImportName",n[n.pip=27]="pip",n[n.ensurepip=28]="ensurepip",n[n.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.IExtensionContext=Symbol("ExtensionContext"),t.IExtensions=Symbol("IExtensions"),t.IBrowserService=Symbol("IBrowserService"),t.IExperimentService=Symbol("IExperimentService"),t.IInterpreterPathService=Symbol("IInterpreterPathService"),t.IDefaultLanguageServer=Symbol("IDefaultLanguageServer")},99910:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asyncForEach=t.asyncFilter=void 0,t.asyncFilter=async function(e,t){const n=await Promise.all(e.map(t));return e.filter(((e,t)=>n[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.waitForCondition=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 n{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.completed||(this._resolve.apply(this.scope?this.scope:this,[e]),this._resolved=!0)}reject(e){this.completed||(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 r(e=null){return new n(e)}async function i(e,t){const n=void 0===t?-1:t;try{return{index:n,result:await e.next(),err:null}}catch(e){return{index:n,err:e,result:null}}}t.createDeferred=r,t.createDeferredFrom=function(...e){const t=r();return Promise.all(e).then(t.resolve.bind(t)).catch(t.reject.bind(t)),t},t.createDeferredFromPromise=function(e){const t=r();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 n=e.map(i);let r=e.length;for(;r>0;){const{index:s,result:a,err:c}=await Promise.race(n);null!==c?(n[s]=o,r-=1,void 0!==t&&await t(c,s)):a.done?(n[s]=o,r-=1,void 0!==a.value&&(yield a.value)):(n[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,n=!0){if(n){const n=e.map((e=>async function*(){yield t(e)}()));yield*a(s(n))}else yield*e.map(t)},t.iterable=a,t.flattenIterator=async function(e){const t=[];for await(const n of a(e))t.push(n);return t},t.waitForCondition=async function(e,t,n){return new Promise((async(r,i)=>{const o=setTimeout((()=>{clearTimeout(o),clearTimeout(s),i(new Error(n))}),t),s=setInterval((async()=>{await e().catch((()=>!1))&&(clearTimeout(o),clearTimeout(s),r())}),10)}))}},35144:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryCache=t.clearCache=t.getCacheKeyFromFunctionArgs=t.getGlobalCacheStore=void 0;const n=new Map;t.getGlobalCacheStore=function(){return n},t.getCacheKeyFromFunctionArgs=function(e,t){return`KeyPrefix=${e}-Args=${t.map((e=>`${JSON.stringify(e)}`)).join("-Arg-Separator-")}`},t.clearCache=function(){n.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,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swallowExceptions=t.cache=t.makeDebounceAsyncDecorator=t.makeDebounceDecorator=t.debounceAsync=t.debounceSync=void 0,n(32727);const r=n(19735),i=n(77570),o=n(59314),s=n(35144),a=n(70057),c=n(23279);function l(e){return function(t,n,r){const i=r.value,o=c((function(){return i.apply(this,arguments)}),e,{});r.value=o}}function u(e){return function(t,n,r){const i=r.value,s={started:!1,deferred:void 0,timer:void 0};r.value=function(){const t=s.deferred;if(t&&s.started)return t.promise;const n=t&&t.completed,r=s.deferred=!t||n?(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,r.resolve(e)})).catch((e=>{s.started=!1,r.reject(e)}))}),e||0),r.promise}}}t.debounceSync=function(e){return(0,i.isTestExecution)()&&(e=void 0),l(e)},t.debounceAsync=function(e){return(0,i.isTestExecution)()&&(e=void 0),u(e)},t.makeDebounceDecorator=l,t.makeDebounceAsyncDecorator=u;const d=(0,s.getGlobalCacheStore)(),p=new a.StopWatch;t.cache=function(e,t=!1,n){return function(o,a,c){const l=c.value,u=`Cache_Method_Output_${"constructor"in o&&o.constructor.name?o.constructor.name:""}.${a}`;c.value=async function(...o){if((0,i.isTestExecution)())return l.apply(this,o);let a;try{a=(0,s.getCacheKeyFromFunctionArgs)(u,o)}catch(e){return(0,r.traceError)("Error while creating key for keyPrefix:",u,e),l.apply(this,o)}const c=d.get(a);if(c&&(c.expiry>Date.now()||-1===e))return Promise.resolve(c.data);const h=n&&p.elapsedTime>2e5?n:e,f=l.apply(this,o);return t?d.set(a,{data:f,expiry:Date.now()+h}):f.then((e=>d.set(a,{data:e,expiry:Date.now()+h}))).ignoreErrors(),f}}},t.swallowExceptions=function(e){return function(t,n,o){const s=o.value,a=`Python Extension (Error in ${e||n}, method:${n}):`;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,r.traceError)(a,e)}))}catch(e){if((0,i.isTestExecution)())return;(0,r.traceError)(a,e)}}}}},4100:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelayedTrigger=void 0;const r=n(39512),i=n(19735);t.DelayedTrigger=class{constructor(e,t,n){this.callback=e,this.ms=t,this.name=n,this.triggeredCounter=0,this.calledCounter=0}trigger(...e){this.triggeredCounter+=1,this.timerId&&(0,r.clearTimeout)(this.timerId),this.timerId=(0,r.setTimeout)((()=>{this.calledCounter+=1,(0,i.traceVerbose)(`Delay Trigger[${this.name}]: triggered=${this.triggeredCounter}, called=${this.calledCounter}`),this.callback(...e)}),this.ms)}dispose(){this.timerId&&(0,r.clearTimeout)(this.timerId)}}},47237:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidAndExecutable=t.getSearchPathEntries=t.getSearchPathEnvVarNames=void 0;const r=n(57147),i=n(71017),o=n(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 r.promises.access(e,r.constants.X_OK)}catch(e){return!1}if((0,o.getOSType)()!==o.OSType.Windows)return!0}},56091:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFileFilter=t.getFileType=t.convertFileType=t.FileType=void 0;const r=n(57147),i=n(66828),o=n(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,n={ignoreErrors:!0}){let i;try{i=await r.promises.lstat(e)}catch(r){if("ENOENT"===r.code)return;if(n.ignoreErrors)return(0,o.traceError)(`lstat() failed for "${e}" (${r})`),t.FileType.Unknown;throw r}return s(i)}t.FileType=i.FileType,t.convertFileType=s,t.getFileType=a,t.getFileFilter=function(e={ignoreMissing:!0}){const n=function(e){if(void 0!==e){if(Array.isArray(e)){if(0===e.length)return;return e}return[e]}}(e.ignoreFileType);if(e.ignoreMissing||n)return async function(r){let i=await async function(e,t={}){let n;if("string"!=typeof e){if(!t.ensure){if(void 0===t.onMissing)return e;if(void 0!==await a(e.filename))return e}n=e.filename}else n=e;const r=await a(n)||t.onMissing;if(void 0!==r)return{filename:n,filetype:r}}(r,{ensure:e.ensureEntry});if(!i){if(e.ignoreMissing)return!1;i={filename:"string"==typeof r?r:r.filename,filetype:t.FileType.Unknown}}return!n||!n.includes(i.filetype)}}},1040:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIcon=void 0;const r=n(71017),i=n(66828),o=n(63281),s=r.join(o.EXTENSION_ROOT_DIR,"resources","dark"),a=r.join(o.EXTENSION_ROOT_DIR,"resources","light");t.getIcon=function(e){return{dark:i.Uri.file(r.join(s,e)),light:i.Uri.file(r.join(a,e))}}},67098:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateEnv=t.SwitchToDefaultLS=t.Python27Support=t.OutdatedDebugger=t.Testing=t.DebugConfigStrings=t.ExtensionSurveyBanner=t.Installer=t.Linters=t.OutputChannelNames=t.InterpreterQuickPickList=t.Interpreters=t.LanguageService=t.TensorBoard=t.Pylance=t.Repl=t.AttachProcess=t.CommonSurvey=t.Common=t.Diagnostics=void 0;const r=n(66828),i=n(77570);var o,s,a,c,l,u,d,p,h,f,g,m,v;(v=t.Diagnostics||(t.Diagnostics={})).warnSourceMaps=r.l10n.t("Source map support is enabled in the Python Extension, this will adversely impact performance of the extension."),v.disableSourceMaps=r.l10n.t("Disable Source Map Support"),v.warnBeforeEnablingSourceMaps=r.l10n.t("Enabling source map support in the Python Extension will adversely impact performance of the extension."),v.enableSourceMapsAndReloadVSC=r.l10n.t("Enable and reload Window."),v.lsNotSupported=r.l10n.t("Your operating system does not meet the minimum requirements of the Python Language Server. Reverting to the alternative autocompletion provider, Jedi."),v.invalidPythonPathInDebuggerSettings=r.l10n.t('You need to select a Python interpreter before you start debugging.\n\nTip: click on "Select Interpreter" in the status bar.'),v.invalidPythonPathInDebuggerLaunch=r.l10n.t("The Python path in your debug configuration is invalid."),v.invalidDebuggerTypeDiagnostic=r.l10n.t('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?'),v.consoleTypeDiagnostic=r.l10n.t('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?'),v.justMyCodeDiagnostic=r.l10n.t('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?'),v.yesUpdateLaunch=r.l10n.t("Yes, update launch.json"),v.invalidTestSettings=r.l10n.t('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?'),v.updateSettings=r.l10n.t("Yes, update settings"),v.pylanceDefaultMessage=r.l10n.t("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)."),v.invalidSmartSendMessage=r.l10n.t("Python is unable to parse the code provided. Please\n turn off Smart Send if you wish to always run line by line or explicitly select code\n to force run. See [logs](command:{0}) for more details",i.Commands.ViewOutput),(m=t.Common||(t.Common={})).allow=r.l10n.t("Allow"),m.seeInstructions=r.l10n.t("See Instructions"),m.close=r.l10n.t("Close"),m.bannerLabelYes=r.l10n.t("Yes"),m.bannerLabelNo=r.l10n.t("No"),m.canceled=r.l10n.t("Canceled"),m.cancel=r.l10n.t("Cancel"),m.ok=r.l10n.t("Ok"),m.error=r.l10n.t("Error"),m.gotIt=r.l10n.t("Got it!"),m.install=r.l10n.t("Install"),m.loadingExtension=r.l10n.t("Python extension loading..."),m.openOutputPanel=r.l10n.t("Show output"),m.noIWillDoItLater=r.l10n.t("No, I will do it later"),m.notNow=r.l10n.t("Not now"),m.doNotShowAgain=r.l10n.t("Don't show again"),m.editSomething=r.l10n.t("Edit {0}"),m.reload=r.l10n.t("Reload"),m.moreInfo=r.l10n.t("More Info"),m.learnMore=r.l10n.t("Learn more"),m.and=r.l10n.t("and"),m.reportThisIssue=r.l10n.t("Report this issue"),m.recommended=r.l10n.t("Recommended"),m.clearAll=r.l10n.t("Clear all"),m.alwaysIgnore=r.l10n.t("Always Ignore"),m.ignore=r.l10n.t("Ignore"),m.selectPythonInterpreter=r.l10n.t("Select Python Interpreter"),m.openLaunch=r.l10n.t("Open launch.json"),m.useCommandPrompt=r.l10n.t("Use Command Prompt"),m.download=r.l10n.t("Download"),m.showLogs=r.l10n.t("Show logs"),m.openFolder=r.l10n.t("Open Folder..."),(g=t.CommonSurvey||(t.CommonSurvey={})).remindMeLaterLabel=r.l10n.t("Remind me later"),g.yesLabel=r.l10n.t("Yes, take survey now"),g.noLabel=r.l10n.t("No, thanks"),(f=t.AttachProcess||(t.AttachProcess={})).attachTitle=r.l10n.t("Attach to process"),f.selectProcessPlaceholder=r.l10n.t("Select the process to attach to"),f.noProcessSelected=r.l10n.t("No process selected"),f.refreshList=r.l10n.t("Refresh process list"),(t.Repl||(t.Repl={})).disableSmartSend=r.l10n.t("Disable Smart Send"),(h=t.Pylance||(t.Pylance={})).remindMeLater=r.l10n.t("Remind me later"),h.pylanceNotInstalledMessage=r.l10n.t("Pylance extension is not installed."),h.pylanceInstalledReloadPromptMessage=r.l10n.t("Pylance extension is now installed. Reload window to activate?"),h.pylanceRevertToJediPrompt=r.l10n.t('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?'),h.pylanceInstallPylance=r.l10n.t("Install Pylance"),h.pylanceRevertToJedi=r.l10n.t("Revert to Jedi"),(p=t.TensorBoard||(t.TensorBoard={})).enterRemoteUrl=r.l10n.t("Enter remote URL"),p.enterRemoteUrlDetail=r.l10n.t("Enter a URL pointing to a remote directory containing your TensorBoard log files"),p.useCurrentWorkingDirectoryDetail=r.l10n.t("TensorBoard will search for tfevent files in all subdirectories of the current working directory"),p.useCurrentWorkingDirectory=r.l10n.t("Use current working directory"),p.logDirectoryPrompt=r.l10n.t("Select a log directory to start TensorBoard with"),p.progressMessage=r.l10n.t("Starting TensorBoard session..."),p.nativeTensorBoardPrompt=r.l10n.t('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".)'),p.selectAFolder=r.l10n.t("Select a folder"),p.selectAFolderDetail=r.l10n.t("Select a log directory containing tfevent files"),p.selectAnotherFolder=r.l10n.t("Select another folder"),p.selectAnotherFolderDetail=r.l10n.t("Use the file explorer to select another folder"),p.installPrompt=r.l10n.t("The package TensorBoard is required to launch a TensorBoard session. Would you like to install it?"),p.installTensorBoardAndProfilerPluginPrompt=r.l10n.t("TensorBoard >= 2.4.1 and the PyTorch Profiler TensorBoard plugin >= 0.2.0 are required. Would you like to install these packages?"),p.installProfilerPluginPrompt=r.l10n.t("We recommend installing version >= 0.2.0 of the PyTorch Profiler TensorBoard plugin. Would you like to install the package?"),p.upgradePrompt=r.l10n.t("Integrated TensorBoard support is only available for TensorBoard >= 2.4.1. Would you like to upgrade your copy of TensorBoard?"),p.launchNativeTensorBoardSessionCodeLens=r.l10n.t("▶ Launch TensorBoard Session"),p.launchNativeTensorBoardSessionCodeAction=r.l10n.t("Launch TensorBoard session"),p.missingSourceFile=r.l10n.t("The Python extension could not locate the requested source file on disk. Please manually specify the file."),p.selectMissingSourceFile=r.l10n.t("Choose File"),p.selectMissingSourceFileDescription=r.l10n.t("The source file's contents may not match the original contents in the trace."),(d=t.LanguageService||(t.LanguageService={})).virtualWorkspaceStatusItem={detail:r.l10n.t("Limited IntelliSense supported by Jedi and Pylance")},d.statusItem={name:r.l10n.t("Python IntelliSense Status"),text:r.l10n.t("Partial Mode"),detail:r.l10n.t("Limited IntelliSense provided by Pylance")},d.startingPylance=r.l10n.t("Starting Pylance language server."),d.startingNone=r.l10n.t("Editor support is inactive since language server is set to None."),d.untrustedWorkspaceMessage=r.l10n.t("Only Pylance is supported in untrusted workspaces, setting language server to None."),d.reloadAfterLanguageServerChange=r.l10n.t("Reload the window after switching between language servers."),d.lsFailedToStart=r.l10n.t("We encountered an issue starting the language server. Reverting to Jedi language engine. Check the Python output panel for details."),d.lsFailedToDownload=r.l10n.t("We encountered an issue downloading the language server. Reverting to Jedi language engine. Check the Python output panel for details."),d.lsFailedToExtract=r.l10n.t("We encountered an issue extracting the language server. Reverting to Jedi language engine. Check the Python output panel for details."),d.downloadFailedOutputMessage=r.l10n.t("Language server download failed."),d.extractionFailedOutputMessage=r.l10n.t("Language server extraction failed."),d.extractionCompletedOutputMessage=r.l10n.t("Language server download complete."),d.extractionDoneOutputMessage=r.l10n.t("done."),d.reloadVSCodeIfSeachPathHasChanged=r.l10n.t("Search paths have changed for this Python interpreter. Reload the extension to ensure that the IntelliSense works correctly."),(u=t.Interpreters||(t.Interpreters={})).requireJupyter=r.l10n.t("Running in Interactive window requires Jupyter Extension. Would you like to install it? [Learn more](https://aka.ms/pythonJupyterSupport)."),u.installingPython=r.l10n.t("Installing Python into Environment..."),u.discovering=r.l10n.t("Discovering Python Interpreters"),u.refreshing=r.l10n.t("Refreshing Python Interpreters"),u.condaInheritEnvMessage=r.l10n.t('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. [Learn more](https://aka.ms/AA66i8f).'),u.activatingTerminals=r.l10n.t("Reactivating terminals..."),u.activateTerminalDescription=r.l10n.t("Activated environment for"),u.terminalEnvVarCollectionPrompt=r.l10n.t("{0} environment was successfully activated, even though {1} indicator may not be present in the terminal prompt. [Learn more](https://aka.ms/vscodePythonTerminalActivation)."),u.terminalDeactivateProgress=r.l10n.t("Editing {0}..."),u.restartingTerminal=r.l10n.t("Restarting terminal and deactivating..."),u.terminalDeactivatePrompt=r.l10n.t('Deactivating virtual environments may not work by default. To make it work, edit your "{0}" and then restart your shell. [Learn more](https://aka.ms/AAmx2ft).'),u.activatedCondaEnvLaunch=r.l10n.t("We noticed VS Code was launched from an activated conda environment, would you like to select it?"),u.environmentPromptMessage=r.l10n.t("We noticed a new environment has been created. Do you want to select it for the workspace folder?"),u.entireWorkspace=r.l10n.t("Select at workspace level"),u.clearAtWorkspace=r.l10n.t("Clear at workspace level"),u.selectInterpreterTip=r.l10n.t("Tip: you can change the Python interpreter used by the Python extension by clicking on the Python version in the status bar"),u.installPythonTerminalMessageLinux=r.l10n.t("💡 Try installing the Python package using your package manager. Alternatively you can also download it from https://www.python.org/downloads"),u.installPythonTerminalMacMessage=r.l10n.t("💡 Brew does not seem to be available. You can download Python from https://www.python.org/downloads. Alternatively, you can install the Python package using some other available package manager."),u.changePythonInterpreter=r.l10n.t("Change Python Interpreter"),u.selectedPythonInterpreter=r.l10n.t("Selected Python Interpreter"),(l=t.InterpreterQuickPickList||(t.InterpreterQuickPickList={})).condaEnvWithoutPythonTooltip=r.l10n.t("Python is not available in this environment, it will automatically be installed upon selecting it"),l.noPythonInstalled=r.l10n.t("Python is not installed"),l.clickForInstructions=r.l10n.t("Click for instructions..."),l.globalGroupName=r.l10n.t("Global"),l.workspaceGroupName=r.l10n.t("Workspace"),l.enterPath={label:r.l10n.t("Enter interpreter path..."),placeholder:r.l10n.t("Enter path to a Python interpreter.")},l.defaultInterpreterPath={label:r.l10n.t("Use Python from `python.defaultInterpreterPath` setting")},l.browsePath={label:r.l10n.t("Find..."),detail:r.l10n.t("Browse your file system to find a Python interpreter."),openButtonLabel:r.l10n.t("Select Interpreter"),title:r.l10n.t("Select Python interpreter")},l.refreshInterpreterList=r.l10n.t("Refresh Interpreter list"),l.refreshingInterpreterList=r.l10n.t("Refreshing Interpreter list..."),l.create={label:r.l10n.t("Create Virtual Environment...")},(c=t.OutputChannelNames||(t.OutputChannelNames={})).languageServer=r.l10n.t("Python Language Server"),c.python=r.l10n.t("Python"),c.pythonTest=r.l10n.t("Python Test Log"),(t.Linters||(t.Linters={})).selectLinter=r.l10n.t("Select Linter"),(a=t.Installer||(t.Installer={})).noCondaOrPipInstaller=r.l10n.t("There is no Conda or Pip installer available in the selected environment."),a.noPipInstaller=r.l10n.t("There is no Pip installer available in the selected environment."),a.searchForHelp=r.l10n.t("Search for help"),(s=t.ExtensionSurveyBanner||(t.ExtensionSurveyBanner={})).bannerMessage=r.l10n.t("Can you take 2 minutes to tell us how the Python extension is working for you?"),s.bannerLabelYes=r.l10n.t("Yes, take survey now"),s.bannerLabelNo=r.l10n.t("No, thanks"),s.maybeLater=r.l10n.t("Maybe later"),function(e){let t,n,i,o,s,a,c,l;e.selectConfiguration={title:r.l10n.t("Select a debug configuration"),placeholder:r.l10n.t("Debug Configuration")},e.launchJsonCompletions={label:r.l10n.t("Python"),description:r.l10n.t("Select a Python debug configuration")},function(e){e.snippet={name:r.l10n.t("Python: Current File")},e.selectConfiguration={label:r.l10n.t("Python File"),description:r.l10n.t("Debug the currently active Python file")}}(t=e.file||(e.file={})),function(e){e.snippet={name:r.l10n.t("Python: Module"),default:r.l10n.t("enter-your-module-name")},e.selectConfiguration={label:r.l10n.t("Module"),description:r.l10n.t("Debug a Python module by invoking it with '-m'")},e.enterModule={title:r.l10n.t("Debug Module"),prompt:r.l10n.t("Enter a Python module/package name"),default:r.l10n.t("enter-your-module-name"),invalid:r.l10n.t("Enter a valid module name")}}(n=e.module||(e.module={})),function(e){e.snippet={name:r.l10n.t("Python: Remote Attach")},e.selectConfiguration={label:r.l10n.t("Remote Attach"),description:r.l10n.t("Attach to a remote debug server")},e.enterRemoteHost={title:r.l10n.t("Remote Debugging"),prompt:r.l10n.t("Enter a valid host name or IP address"),invalid:r.l10n.t("Enter a valid host name or IP address")},e.enterRemotePort={title:r.l10n.t("Remote Debugging"),prompt:r.l10n.t("Enter the port number that the debug server is listening on"),invalid:r.l10n.t("Enter a valid port number")}}(i=e.attach||(e.attach={})),function(e){e.snippet={name:r.l10n.t("Python: Attach using Process Id")},e.selectConfiguration={label:r.l10n.t("Attach using Process ID"),description:r.l10n.t("Attach to a local process")}}(o=e.attachPid||(e.attachPid={})),function(e){e.snippet={name:r.l10n.t("Python: Django")},e.selectConfiguration={label:r.l10n.t("Django"),description:r.l10n.t("Launch and debug a Django web application")},e.enterManagePyPath={title:r.l10n.t("Debug Django"),prompt:r.l10n.t("Enter the path to manage.py ('${workspaceFolder}' points to the root of the current workspace folder)"),invalid:r.l10n.t("Enter a valid Python file path")}}(s=e.django||(e.django={})),function(e){e.snippet={name:r.l10n.t("Python: FastAPI")},e.selectConfiguration={label:r.l10n.t("FastAPI"),description:r.l10n.t("Launch and debug a FastAPI web application")},e.enterAppPathOrNamePath={title:r.l10n.t("Debug FastAPI"),prompt:r.l10n.t("Enter the path to the application, e.g. 'main.py' or 'main'"),invalid:r.l10n.t("Enter a valid name")}}(a=e.fastapi||(e.fastapi={})),function(e){e.snippet={name:r.l10n.t("Python: Flask")},e.selectConfiguration={label:r.l10n.t("Flask"),description:r.l10n.t("Launch and debug a Flask web application")},e.enterAppPathOrNamePath={title:r.l10n.t("Debug Flask"),prompt:r.l10n.t("Python: Flask"),invalid:r.l10n.t("Enter a valid name")}}(c=e.flask||(e.flask={})),function(e){e.snippet={name:r.l10n.t("Python: Pyramid Application")},e.selectConfiguration={label:r.l10n.t("Pyramid"),description:r.l10n.t("Launch and debug a Pyramid web application")},e.enterDevelopmentIniPath={title:r.l10n.t("Debug Pyramid"),invalid:r.l10n.t("Enter a valid file path")}}(l=e.pyramid||(e.pyramid={}))}(t.DebugConfigStrings||(t.DebugConfigStrings={})),(o=t.Testing||(t.Testing={})).configureTests=r.l10n.t("Configure Test Framework"),o.testNotConfigured=r.l10n.t("No test framework configured."),o.cancelUnittestDiscovery=r.l10n.t("Canceled unittest test discovery"),o.errorUnittestDiscovery=r.l10n.t("Unittest test discovery error"),o.cancelPytestDiscovery=r.l10n.t("Canceled pytest test discovery"),o.errorPytestDiscovery=r.l10n.t("pytest test discovery error"),o.seePythonOutput=r.l10n.t("(see Output > Python)"),o.cancelUnittestExecution=r.l10n.t("Canceled unittest test execution"),o.errorUnittestExecution=r.l10n.t("Unittest test execution error"),o.cancelPytestExecution=r.l10n.t("Canceled pytest test execution"),o.errorPytestExecution=r.l10n.t("pytest test execution error"),(t.OutdatedDebugger||(t.OutdatedDebugger={})).outdatedDebuggerMessage=r.l10n.t("We noticed you are attaching to ptvsd (Python debugger), which was deprecated on May 1st, 2020. Use [debugpy](https://aka.ms/migrateToDebugpy) instead."),(t.Python27Support||(t.Python27Support={})).jediMessage=r.l10n.t("IntelliSense with Jedi for Python 2.7 is no longer supported. [Learn more](https://aka.ms/python-27-support)."),(t.SwitchToDefaultLS||(t.SwitchToDefaultLS={})).bannerMessage=r.l10n.t("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)."),function(e){let t,n,i;e.informEnvCreation=r.l10n.t("The following environment is selected:"),e.statusTitle=r.l10n.t("Creating environment"),e.statusStarting=r.l10n.t("Starting..."),e.hasVirtualEnv=r.l10n.t("Workspace folder contains a virtual environment"),e.noWorkspace=r.l10n.t("A workspace is required when creating an environment using venv."),e.pickWorkspacePlaceholder=r.l10n.t("Select a workspace to create environment"),e.providersQuickPickPlaceholder=r.l10n.t("Select an environment type"),function(e){e.creating=r.l10n.t("Creating venv..."),e.creatingMicrovenv=r.l10n.t("Creating microvenv..."),e.created=r.l10n.t("Environment created..."),e.existing=r.l10n.t("Using existing environment..."),e.downloadingPip=r.l10n.t("Downloading pip..."),e.installingPip=r.l10n.t("Installing pip..."),e.upgradingPip=r.l10n.t("Upgrading pip..."),e.installingPackages=r.l10n.t("Installing packages..."),e.errorCreatingEnvironment=r.l10n.t("Error while creating virtual environment."),e.selectPythonPlaceHolder=r.l10n.t("Select a Python installation to create the virtual environment"),e.providerDescription=r.l10n.t("Creates a `.venv` virtual environment in the current workspace"),e.error=r.l10n.t("Creating virtual environment failed with error."),e.tomlExtrasQuickPickTitle=r.l10n.t("Select optional dependencies to install from pyproject.toml"),e.requirementsQuickPickTitle=r.l10n.t("Select dependencies to install"),e.recreate=r.l10n.t("Delete and Recreate"),e.recreateDescription=r.l10n.t('Delete existing ".venv" directory and create a new ".venv" environment'),e.useExisting=r.l10n.t("Use Existing"),e.useExistingDescription=r.l10n.t('Use existing ".venv" environment with no changes to it'),e.existingVenvQuickPickPlaceholder=r.l10n.t('Choose an option to handle the existing ".venv" environment'),e.deletingEnvironmentProgress=r.l10n.t('Deleting existing ".venv" environment...'),e.errorDeletingEnvironment=r.l10n.t('Error while deleting existing ".venv" environment.'),e.openRequirementsFile=r.l10n.t("Open requirements file")}(t=e.Venv||(e.Venv={})),function(e){e.condaMissing=r.l10n.t("Install `conda` to create conda environments."),e.created=r.l10n.t("Environment created..."),e.installingPackages=r.l10n.t("Installing packages..."),e.errorCreatingEnvironment=r.l10n.t("Error while creating conda environment."),e.selectPythonQuickPickPlaceholder=r.l10n.t("Select the version of Python to install in the environment"),e.creating=r.l10n.t("Creating conda environment..."),e.providerDescription=r.l10n.t("Creates a `.conda` Conda environment in the current workspace"),e.recreate=r.l10n.t("Delete and Recreate"),e.recreateDescription=r.l10n.t('Delete existing ".conda" environment and create a new one'),e.useExisting=r.l10n.t("Use Existing"),e.useExistingDescription=r.l10n.t('Use existing ".conda" environment with no changes to it'),e.existingCondaQuickPickPlaceholder=r.l10n.t('Choose an option to handle the existing ".conda" environment'),e.deletingEnvironmentProgress=r.l10n.t('Deleting existing ".conda" environment...'),e.errorDeletingEnvironment=r.l10n.t('Error while deleting existing ".conda" environment.')}(n=e.Conda||(e.Conda={})),function(e){e.workspaceTriggerMessage=r.l10n.t("A virtual environment is not currently selected for your Python interpreter. Would you like to create a virtual environment?"),e.createEnvironment=r.l10n.t("Create"),e.globalPipInstallTriggerMessage=r.l10n.t("You may have installed Python packages into your global environment, which can cause conflicts between package versions. Would you like to create a virtual environment with these packages to isolate your dependencies?")}(i=e.Trigger||(e.Trigger={}))}(t.CreateEnv||(t.CreateEnv={}))},3481:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNotebookCell=t.getURIFilter=t.isResource=t.noop=void 0;const r=n(77570),i=n(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 n=e.path;for(;n.endsWith("/");)n=n.slice(0,-1);const r=`${n}/`;return function(e){let o=e.path;for(;o.endsWith("/");)o=o.slice(0,-1);if(t.checkParent&&(0,i.isParentPath)(o,r))return!0;if(t.checkChild){const e=`${o}/`;if((0,i.isParentPath)(n,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(r.NotebookCellScheme)||t.scheme.includes(r.InteractiveInputScheme)}},22207:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MultiStepInputFactory=t.IMultiStepInputFactory=t.MultiStepInput=t.InputFlowAction=void 0;const o=n(86700),s=n(66828),a=n(17585),c=n(59314);class l{constructor(){}}t.InputFlowAction=l,l.back=new l,l.cancel=new l,l.resume=new l;class u{constructor(e){this.shell=e,this.steps=[]}run(e,t){return this.stepThrough(e,t)}async showQuickPick({title:e,step:t,totalSteps:n,items:r,activeItem:i,placeholder:o,customButtonSetups:a,matchOnDescription:u,matchOnDetail:d,acceptFilterBoxTextAsSelection:p,onChangeItem:h,keepScrollPosition:f,sortByLabel:g,initialize:m}){const v=[],y=this.shell.createQuickPick();if(y.title=e,y.step=t,y.sortByLabel=g||!1,y.totalSteps=n,y.placeholder=o,y.ignoreFocusOut=!0,y.items=r,y.matchOnDescription=u||!1,y.matchOnDetail=d||!1,y.buttons=this.steps.length>1?[s.QuickInputButtons.Back]:[],a)for(const e of a)y.buttons=[...y.buttons,e.button];this.current&&this.current.dispose(),this.current=y,h&&v.push(h.event((e=>h.callback(e,y)))),m&&m(y),i?"function"==typeof i&&i(y).then((e=>{0===y.activeItems.length&&(y.activeItems=[e])})):y.activeItems=[],this.current.show(),y.keepScrollPosition=f;const b=(0,c.createDeferred)();v.push(y.onDidTriggerButton((async e=>{if(e===s.QuickInputButtons.Back&&(b.reject(l.back),y.hide()),a)for(const t of a)JSON.stringify(e)===JSON.stringify(null==t?void 0:t.button)&&await(null==t?void 0:t.callback(y))})),y.onDidChangeSelection((e=>b.resolve(e[0]))),y.onDidHide((()=>{b.completed||b.resolve(void 0)}))),p&&v.push(y.onDidAccept((()=>{b.resolve(y.value)})));try{return await b.promise}finally{v.forEach((e=>e.dispose()))}}async showInputBox({title:e,step:t,totalSteps:n,value:r,prompt:i,validate:o,password:a,buttons:c}){const u=[];try{return await new Promise(((d,p)=>{const h=this.shell.createInputBox();h.title=e,h.step=t,h.totalSteps=n,h.password=!!a,h.value=r||"",h.prompt=i,h.ignoreFocusOut=!0,h.buttons=[...this.steps.length>1?[s.QuickInputButtons.Back]:[],...c||[]];let f=o("");u.push(h.onDidTriggerButton((e=>{e===s.QuickInputButtons.Back?p(l.back):d(e)})),h.onDidAccept((async()=>{const e=h.value;h.enabled=!1,h.busy=!0,await o(e)||d(e),h.enabled=!0,h.busy=!1})),h.onDidChangeValue((async e=>{const t=o(e);f=t;const n=await t;t===f&&(h.validationMessage=n)})),h.onDidHide((()=>{d(void 0)}))),this.current&&this.current.dispose(),this.current=h,this.current.show()}))}finally{u.forEach((e=>e.dispose()))}}async stepThrough(e,t){let n=e;for(;n;){this.steps.push(n),this.current&&(this.current.enabled=!1,this.current.busy=!0);try{n=await n(this,t)}catch(e){if(e===l.back){if(this.steps.pop(),n=this.steps.pop(),void 0===n)throw e}else if(e===l.resume)n=this.steps.pop();else{if(e!==l.cancel)throw e;n=void 0}}}this.current&&this.current.dispose()}}t.MultiStepInput=u,t.IMultiStepInputFactory=Symbol("IMultiStepInputFactory");let d=class{constructor(e){this.shell=e}create(){return new u(this.shell)}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IApplicationShell))],d),t.MultiStepInputFactory=d},87450:(e,t,n)=>{"use strict";var r,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"}(r=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:r.x86,x64:r.x64,"":r.Unknown};function a(e){return process.env[e]}t.getArchitecture=function(){const e=s[process.arch];if(void 0!==e)return e;const t=n(3901);return s[t()]||r.Unknown},t.getEnvironmentVariable=a,t.getUserHomeDir=function(){return o()===i.Windows?a("USERPROFILE"):a("HOME")||a("HOMEPATH")}},10195:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.Random=void 0;const i=n(6113),o=n(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=r([(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)=>{"use strict";async function n(e){await Promise.all(e.map((async e=>{try{return Promise.resolve(e.dispose())}catch(e){}return Promise.resolve()})))}Object.defineProperty(t,"__esModule",{value:!0}),t.Disposables=t.disposeAll=void 0,t.disposeAll=n,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 n(e)}}},58479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.runAfterActivation=t.addItemsToRunAfterActivation=void 0;const n=[];let r=!1;t.addItemsToRunAfterActivation=function(e){r?e():n.push(e)},t.runAfterActivation=function(){for(r=!0;n.length>0;){const e=n.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 n="number";t.isArray=function(e){return Array.isArray?Array.isArray(e):!(!e||typeof e.length!==n||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===n||e instanceof Number)&&!isNaN(e)}},52439:(e,t,n)=>{"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 r=n(81249),i=n(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,n){if(!(0===t||t>0)&&n&&""!==n)throw Error(`invalid ${e} version (failed to normalize; ${n})`)}t.EMPTY_VERSION={major:-1,minor:-1,micro:-1},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[,n,r,i,o,s]=t;if(!n||!n.endsWith(".")){if(s&&""!==s){if("."===s)return;if(!(n&&""!==n||o&&""!==o))return}return{version:{major:parseInt(r,10),minor:i?parseInt(i,10):-1,micro:o?parseInt(o,10):-1},before:n||"",after:s||""}}}function l(e,t,n){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!==n?n(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=l,t.normalizeVersionInfo=function(e){const n=function(e){if(!e)return t.EMPTY_VERSION;const n=function(e){const t={major:e.major,minor:e.minor,micro:e.micro},{unnormalized:n}=e;return void 0!==n&&(t.unnormalized={major:n.major,minor:n.minor,micro:n.micro}),t}(e);return void 0===n.unnormalized&&(n.unnormalized={},[n.major,n.unnormalized.major]=o(n.major),[n.minor,n.unnormalized.minor]=o(n.minor),[n.micro,n.unnormalized.micro]=o(n.micro)),n}(e);return n.raw=e.raw,n.raw||(n.raw=""),n},t.validateVersionInfo=function(e){!function(e){var t,n,r;const i=e;if(s("major",e.major,null===(t=i.unnormalized)||void 0===t?void 0:t.major),s("minor",e.minor,null===(n=i.unnormalized)||void 0===n?void 0:n.minor),s("micro",e.micro,null===(r=i.unnormalized)||void 0===r?void 0:r.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,n){const[r]=l(e,t,n);return 0===r},t.areSimilarVersions=function(e,t,n){const[r,i]=l(e,t,n);return 0===r||"major"!==i&&(r<0?-1===t[i]:-1===e[i])},t.parseSemVerSafe=function(e){e=e.replace(/\.00*(?=[1-9]|0\.)/,".");const t=r.coerce(e);return null!==t&&r.valid(t)?t:new r.SemVer("0.0.0")}},97749:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRunningWorkerPool=t.QueuePosition=void 0;const r=n(19735),i=n(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,n,r){this.next=e,this.workFunc=t,this.postResult=n,this.name=r,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,r.traceError)(`Error while running worker[${this.name}].`,e);continue}}}class a{constructor(){this.items=[],this.results=new Map}add(e,t){const n={item:e};t===o.Front?this.items.unshift(n):this.items.push(n);const r=(0,i.createDeferred)();return this.results.set(n,r),r.promise}completed(e,t,n){const r=this.results.get(e);void 0!==r&&(this.results.delete(e),void 0!==n&&r.reject(n),r.resolve(t))}next(){return this.items.shift()}clear(){this.results.forEach(((e,t,n)=>{e.reject(Error("Queue stopped processing")),n.delete(t)}))}}class c{constructor(e,t=2,n="Worker"){this.workerFunc=e,this.numWorkers=t,this.name=n,this.workers=[],this.waitingWorkersUnblockQueue=[],this.queue=new a,this.stopProcessing=!1}addToQueue(e,t){if(this.stopProcessing)throw Error("Queue is stopped");const n=this.queue.add(e,t),i=this.waitingWorkersUnblockQueue.shift();if(i){const e=this.queue.next();void 0!==e?i.unblock(e):(0,r.traceError)("Work queue was empty immediately after adding item.")}return n}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,n)=>this.queue.completed(e,t,n)),`${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:n=>{this.stopProcessing&&t(),e(n)},stop:()=>{t()}})}))}}t.createRunningWorkerPool=function(e,t,n){const r=new c(e,t,n);return r.start(),r}},17197:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.matchTarget=t.restoreKeys=t.normCaseKeys=t.parseEnvFile=t.EnvironmentVariablesService=void 0;const o=n(55674),s=n(86700),a=n(71017),c=n(19735),l=n(54813),u=n(61522),d=n(84974),p=n(61684),h=n(48431);let f=class{constructor(e,t){this.pathUtils=e,this.fs=t}async parseFile(e,t){if(!e||!await this.fs.pathExists(e))return;const n=await this.fs.readFile(e).catch((e=>{(0,c.traceError)("Custom .env is likely not pointing to a valid file",e)}));return n?g(n,t):void 0}parseFileSync(e,t){if(!e||!(0,o.pathExistsSync)(e))return;let n;try{n=(0,o.readFileSync)(e,{encoding:"utf8"})}catch(e){(0,c.traceError)("Custom .env is likely not pointing to a valid file",e)}return n?g(n,t):void 0}mergeVariables(e,t,n){if(!t)return;const r=t;t=v(t),e=v(e);const i=["PYTHONPATH",this.pathVariable];Object.keys(e).forEach((r=>{!(null==n?void 0:n.mergeAll)&&i.indexOf(r)>=0||(void 0===t[r]||(null==n?void 0:n.overwrite))&&(t[r]=e[r])})),y(t),b(r,t)}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()),(0,h.normCase)(this._pathVariable)}appendPaths(e,t,...n){const r=e;return e=v(e),t=(0,h.normCase)(t),y(e=this._appendPaths(e,t,...n)),b(r,e),e}_appendPaths(e,t,...n){const r=n.filter((e=>"string"==typeof e&&e.trim().length>0)).map((e=>e.trim())).join(a.delimiter);if(0===r.length)return e;const i=e?e[t]:void 0;return i&&"string"==typeof i&&i.length>0?e[t]=i+a.delimiter+r:e[t]=r,e}};function g(e,t){const n=t||{},r={};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 n=t[1];let r=t[2];return r&&""!==r?("'"===r[0]&&"'"===r[r.length-1]||'"'===r[0]&&'"'===r[r.length-1])&&(r=r.substring(1,r.length-1),r=r.replace(/\\n/gm,"\n")):r="",[n,r]}(e);""!==i&&(r[i]=function(e,t,n,r=""){let i=!1,o=e;return o=o.replace(m,((e,o,s,a,c)=>a>0&&"\\"===c[a-1]?e:s&&""!==s||!o||""===o?(i=!0,e):t[o]||n[o]||r)),i||o===e||(e=o,(0,l.sendTelemetryEvent)(u.EventName.ENVFILE_VARIABLE_SUBSTITUTION)),e.replace(/\\\$/g,"$")}(o,r,n))})),r}f=r([(0,s.injectable)(),i(0,(0,s.inject)(p.IPathUtils)),i(1,(0,s.inject)(d.IFileSystem))],f),t.EnvironmentVariablesService=f,t.parseEnvFile=g;const m=/\${([a-zA-Z]\w*)?([^}\w].*)?}/g;function v(e){const t={};return Object.keys(e).forEach((n=>{const r=(0,h.normCase)(n);t[r]=e[n]})),t}function y(e){Object.keys(process.env).forEach((t=>{const n=(0,h.normCase)(t);n!==t&&void 0!==e[n]&&(e[t]=e[n],delete e[n])}))}function b(e,t){Object.keys(e).forEach((n=>{t.hasOwnProperty(n)?e[n]=t[n]:delete e[n]})),Object.keys(t).forEach((n=>{e.hasOwnProperty(n)||(e[n]=t[n])}))}t.normCaseKeys=v,t.restoreKeys=y,t.matchTarget=b},88939:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentVariablesProvider=void 0;const o=n(86700),s=n(71017),a=n(66828),c=n(19735),l=n(98634),u=n(17585),d=n(89515),p=n(84974),h=n(61684),f=n(35144),g=n(48683),m=n(19909);let v=class{constructor(e,t,n,r,i,o=36e5){this.envVarsService=e,this.platformService=n,this.workspaceService=r,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 a.EventEmitter;const s=this.workspaceService.onDidChangeConfiguration(this.configurationChanged,this);this.disposables.push(s)}get onDidEnvironmentVariablesChange(){return this.changeEventEmitter.event}dispose(){this.changeEventEmitter.dispose(),this.fileWatchers.forEach((e=>{e&&e.dispose()}))}async getEnvironmentVariables(e){const t=this.getCachedEnvironmentVariables(e);if(t)return t;const n=await this._getEnvironmentVariables(e);return this.setCachedEnvironmentVariables(e,n),(0,c.traceVerbose)("Dump environment variables",JSON.stringify(n,null,4)),n}getEnvironmentVariablesSync(e){const t=this.getCachedEnvironmentVariables(e);if(t)return t;const n=this._getEnvironmentVariablesSync(e);return this.setCachedEnvironmentVariables(e,n),n}getCachedEnvironmentVariables(e){var t,n;const r=null!==(n=null===(t=this.getWorkspaceFolderUri(e))||void 0===t?void 0:t.fsPath)&&void 0!==n?n:"",i=this.envVarCaches.get(r);if(i){const e=i.data;if(e)return{...e}}}setCachedEnvironmentVariables(e,t){var n,r;const i=null!==(r=null===(n=this.getWorkspaceFolderUri(e))||void 0===n?void 0:n.fsPath)&&void 0!==r?r:"",o=new f.InMemoryCache(this.cacheDuration);this.envVarCaches.set(i,o),o.data={...t}}async _getEnvironmentVariables(e){const t=await this.getCustomEnvironmentVariables(e);return this.getMergedEnvironmentVariables(t)}_getEnvironmentVariablesSync(e){const t=this.getCustomEnvironmentVariablesSync(e);return this.getMergedEnvironmentVariables(t)}getMergedEnvironmentVariables(e){e||(e={}),this.envVarsService.mergeVariables(this.process.env,e);const t=this.platformService.pathVariableName,n=this.process.env[t];return n&&this.envVarsService.appendPath(e,n),this.process.env.PYTHONPATH&&this.envVarsService.appendPythonPath(e,this.process.env.PYTHONPATH),e}async getCustomEnvironmentVariables(e){return this.envVarsService.parseFile(this.getEnvFile(e),this.process.env)}getCustomEnvironmentVariablesSync(e){return this.envVarsService.parseFileSync(this.getEnvFile(e),this.process.env)}getEnvFile(e){var t;const n=new g.SystemVariables(void 0,null===(t=d.PythonSettings.getSettingsUriAndTarget(e,this.workspaceService).uri)||void 0===t?void 0:t.fsPath,this.workspaceService),r=this.getWorkspaceFolderUri(e),i=this.workspaceService.getConfiguration("python",e).get("envFile"),o=n.resolveAny(i);return void 0===o?((0,c.traceError)("Unable to read `python.envFile` setting for resource",JSON.stringify(e)),(null==r?void 0:r.fsPath)?s.join(null==r?void 0:r.fsPath,".env"):""):(this.trackedWorkspaceFolders.add(r?r.fsPath:""),this.createFileWatcher(o,r),o)}configurationChanged(e){this.trackedWorkspaceFolders.forEach((t=>{const n=t&&t.length>0?a.Uri.file(t):void 0;e.affectsConfiguration("python.envFile",n)&&this.onEnvironmentFileChanged(n)}))}createFileWatcher(e,t){if(this.fileWatchers.has(e))return;const n=this.workspaceService.createFileSystemWatcher(e);this.fileWatchers.set(e,n),n&&(this.disposables.push(n.onDidChange((()=>this.onEnvironmentFileChanged(t)))),this.disposables.push(n.onDidCreate((()=>this.onEnvironmentFileCreated(t)))),this.disposables.push(n.onDidDelete((()=>this.onEnvironmentFileChanged(t)))))}getWorkspaceFolderUri(e){if(!e)return;const t=this.workspaceService.getWorkspaceFolder(e);return t?t.uri:void 0}onEnvironmentFileCreated(e){this.onEnvironmentFileChanged(e),(0,l.sendFileCreationTelemetry)()}onEnvironmentFileChanged(e){this.envVarCaches.clear(),this.changeEventEmitter.fire(e)}};v=r([(0,o.injectable)(),i(0,(0,o.inject)(m.IEnvironmentVariablesService)),i(1,(0,o.inject)(h.IDisposableRegistry)),i(2,(0,o.inject)(p.IPlatformService)),i(3,(0,o.inject)(u.IWorkspaceService)),i(4,(0,o.inject)(h.ICurrentProcess)),i(5,(0,o.optional)())],v),t.EnvironmentVariablesProvider=v},28285:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const r=n(17197),i=n(88939),o=n(19909);t.registerTypes=function(e){e.addSingleton(o.IEnvironmentVariablesService,r.EnvironmentVariablesService),e.addSingleton(o.IEnvironmentVariablesProvider,i.EnvironmentVariablesProvider)}},48683:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SystemVariables=void 0;const r=n(71017),i=n(66828),o=n(56792),s=n(7086);t.SystemVariables=class extends class{resolve(e){return s.isString(e)?this.__resolveString(e):s.isArray(e)?this.__resolveArray(e):s.isObject(e)?this.__resolveLiteral(e):e}resolveAny(e){return s.isString(e)?this.__resolveString(e):s.isArray(e)?this.__resolveAnyArray(e):s.isObject(e)?this.__resolveAnyLiteral(e):e}__resolveString(e){return e.replace(/\$\{(.*?)\}/g,((e,t)=>{const n=this[t];return s.isString(n)?n:e&&(e.indexOf("env.")>0||e.indexOf("env:")>0)?"":e}))}__resolveLiteral(e){const t=Object.create(null);return Object.keys(e).forEach((n=>{const r=e[n];t[n]=this.resolve(r)})),t}__resolveAnyLiteral(e){const t=Object.create(null);return Object.keys(e).forEach((n=>{const r=e[n];t[n]=this.resolveAny(r)})),t}__resolveArray(e){return e.map((e=>this.__resolveString(e)))}__resolveAnyArray(e){return e.map((e=>this.resolveAny(e)))}}{constructor(e,t,n,s){var a;super();const c=n&&e?n.getWorkspaceFolder(e):void 0;this._workspaceFolder=c?c.uri.fsPath:t||__dirname,this._workspaceFolderName=r.basename(this._workspaceFolder),this._filePath=e?e.fsPath:void 0,s&&s.activeTextEditor&&(this._lineNumber=s.activeTextEditor.selection.anchor.line+1,this._selectedText=s.activeTextEditor.document.getText(new i.Range(s.activeTextEditor.selection.start,s.activeTextEditor.selection.end))),this._execPath=process.execPath,Object.keys(process.env).forEach((e=>{this[`env:${e}`]=this[`env.${e}`]=process.env[e]})),n=null!=n?n:new o.WorkspaceService;try{null===(a=n.workspaceFolders)||void 0===a||a.forEach((e=>{this[`workspaceFolder:${r.basename(e.uri.fsPath)}`]=e.uri.fsPath,this[`workspaceFolder:${e.name}`]=e.uri.fsPath}))}catch(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?r.relative(this._workspaceFolder,this.file):void 0}get relativeFileDirname(){return this.relativeFile?r.dirname(this.relativeFile):void 0}get fileBasename(){return this.file?r.basename(this.file):void 0}get fileBasenameNoExtension(){return this.file?r.parse(this.file).name:void 0}get fileDirname(){return this.file?r.dirname(this.file):void 0}get fileExtname(){return this.file?r.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")},12524:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launch=void 0;const r=n(66828);t.launch=function(e){r.env.openExternal(r.Uri.parse(e))}},98638:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeCommand=t.registerCommand=void 0;const r=n(66828);t.registerCommand=function(e,t,n){return r.commands.registerCommand(e,t,n)},t.executeCommand=function(e,...t){return r.commands.executeCommand(e,...t)}},50189:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExtensions=t.isInsider=t.isExtensionDisabled=t.isExtensionEnabled=t.getExtension=void 0;const r=n(71017),i=n(55674),o=n(66828),s=n(77570);function a(e){return o.extensions.getExtension(e)}t.getExtension=a,t.isExtensionEnabled=function(e){return void 0!==o.extensions.getExtension(e)},t.isExtensionDisabled=function(e){const t=a(s.PVSC_EXTENSION_ID);if(t){let n=!1;return i.readdirSync(r.dirname(t.extensionPath),{withFileTypes:!1}).forEach((t=>{t.toString().startsWith(e)&&(n=!0)})),n}return!1},t.isInsider=function(){return o.env.appName.includes("Insider")},t.getExtensions=function(){return o.extensions.all}},64061:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onDidChangeDiagnostics=t.createDiagnosticCollection=void 0;const r=n(66828);t.createDiagnosticCollection=function(e){return r.languages.createDiagnosticCollection(e)},t.onDidChangeDiagnostics=function(e){return r.languages.onDidChangeDiagnostics(e)}},56693:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getActiveResource=t.createStepForwardEndNode=t.createStepBackEndNode=t.MultiStepNode=t.showQuickPickWithBack=t.MultiStepAction=t.onDidStartTerminalShellExecution=t.onDidChangeActiveTextEditor=t.getActiveTextEditor=t.withProgress=t.showInformationMessage=t.showWarningMessage=t.showErrorMessage=t.createQuickPick=t.showQuickPick=t.showTextDocument=void 0;const r=n(66828),i=n(59314),o=n(85261);var s;t.showTextDocument=function(e){return r.window.showTextDocument(e)},t.showQuickPick=function(e,t,n){return r.window.showQuickPick(e,t,n)},t.createQuickPick=function(){return r.window.createQuickPick()},t.showErrorMessage=function(e,...t){return r.window.showErrorMessage(e,...t)},t.showWarningMessage=function(e,...t){return r.window.showWarningMessage(e,...t)},t.showInformationMessage=function(e,...t){return r.window.showInformationMessage(e,...t)},t.withProgress=function(e,t){return r.window.withProgress(e,t)},t.getActiveTextEditor=function(){const{activeTextEditor:e}=r.window;return e},t.onDidChangeActiveTextEditor=function(e){return r.window.onDidChangeActiveTextEditor(e)},t.onDidStartTerminalShellExecution=function(e){return r.window.onDidStartTerminalShellExecution(e)},function(e){e.Back="Back",e.Cancel="Cancel",e.Continue="Continue"}(s=t.MultiStepAction||(t.MultiStepAction={})),t.showQuickPickWithBack=async function(e,t,n,o){var a,c,l,u;const d=r.window.createQuickPick(),p=[d];d.items=e,d.buttons=[r.QuickInputButtons.Back],d.canSelectMany=null!==(a=null==t?void 0:t.canPickMany)&&void 0!==a&&a,d.ignoreFocusOut=null!==(c=null==t?void 0:t.ignoreFocusOut)&&void 0!==c&&c,d.matchOnDescription=null!==(l=null==t?void 0:t.matchOnDescription)&&void 0!==l&&l,d.matchOnDetail=null!==(u=null==t?void 0:t.matchOnDetail)&&void 0!==u&&u,d.placeholder=null==t?void 0:t.placeHolder,d.title=null==t?void 0:t.title;const h=(0,i.createDeferred)();p.push(d,d.onDidTriggerButton((e=>{e===r.QuickInputButtons.Back&&(h.reject(s.Back),d.hide())})),d.onDidAccept((()=>{h.completed||(d.canSelectMany?h.resolve(d.selectedItems.map((e=>e))):h.resolve(d.selectedItems[0]),d.hide())})),d.onDidHide((()=>{h.completed||h.resolve(void 0)})),d.onDidTriggerItemButton((e=>{o&&o(e)}))),n&&p.push(n.onCancellationRequested((()=>{d.hide()}))),d.show();try{return await h.promise}finally{p.forEach((e=>e.dispose()))}};class a{constructor(e,t,n){this.previous=e,this.current=t,this.next=n}static async run(e,t){let n=e,r=await n.current(t);for(;void 0!==n;){if(r===s.Cancel)return r;r===s.Back&&(n=null==n?void 0:n.previous),r===s.Continue&&(n=null==n?void 0:n.next),n&&(r=await(null==n?void 0:n.current(r)))}return r}}t.MultiStepNode=a,t.createStepBackEndNode=function(e){return new a(void 0,(async()=>(e&&e.reject(s.Back),Promise.resolve(s.Back))),void 0)},t.createStepForwardEndNode=function(e,t){return new a(void 0,(async()=>(e&&e.resolve(t),Promise.resolve(s.Back))),void 0)},t.getActiveResource=function(){const e=r.window.activeTextEditor;if(e&&!e.document.isUntitled)return e.document.uri;const t=(0,o.getWorkspaceFolders)();return Array.isArray(t)&&t.length>0?t[0].uri:void 0}},85261:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onDidChangeConfiguration=t.onDidChangeTextDocument=t.onDidOpenTextDocument=t.getOpenTextDocuments=t.onDidSaveTextDocument=t.onDidCloseTextDocument=t.findFiles=t.applyEdit=t.getConfiguration=t.getWorkspaceFolderPaths=t.getWorkspaceFolder=t.getWorkspaceFolders=void 0;const r=n(66828);t.getWorkspaceFolders=function(){return r.workspace.workspaceFolders},t.getWorkspaceFolder=function(e){return e?r.workspace.getWorkspaceFolder(e):void 0},t.getWorkspaceFolderPaths=function(){var e,t;return null!==(t=null===(e=r.workspace.workspaceFolders)||void 0===e?void 0:e.map((e=>e.uri.fsPath)))&&void 0!==t?t:[]},t.getConfiguration=function(e,t){return r.workspace.getConfiguration(e,t)},t.applyEdit=function(e){return r.workspace.applyEdit(e)},t.findFiles=function(e,t,n,i){return r.workspace.findFiles(e,t,n,i)},t.onDidCloseTextDocument=function(e){return r.workspace.onDidCloseTextDocument(e)},t.onDidSaveTextDocument=function(e){return r.workspace.onDidSaveTextDocument(e)},t.getOpenTextDocuments=function(){return r.workspace.textDocuments},t.onDidOpenTextDocument=function(e){return r.workspace.onDidOpenTextDocument(e)},t.onDidChangeTextDocument=function(e){return r.workspace.onDidChangeTextDocument(e)},t.onDidChangeConfiguration=function(e){return r.workspace.onDidChangeConfiguration(e)}},63281:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HiddenFilePrefix=t.EXTENSION_ROOT_DIR=void 0;const r=n(71017),i=r.basename(__dirname);t.EXTENSION_ROOT_DIR="client"===i?r.join(__dirname,"..",".."):r.join(__dirname,"..","..","..",".."),t.HiddenFilePrefix="_HiddenFile_"},51097:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonDebuggerTypeName=t.DebuggerTypeName=void 0,t.DebuggerTypeName="python",t.PythonDebuggerTypeName="debugpy"},11393:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DebugAdapterActivator=void 0;const o=n(86700),s=n(17585),a=n(61684),c=n(17585),l=n(51097),u=n(75791),d=n(41691);let p=class{constructor(e,t,n,r,i,o,s,a){this.debugService=e,this.configSettings=t,this.commandManager=n,this.descriptorFactory=r,this.debugSessionLoggingFactory=i,this.debuggerPromptFactory=o,this.disposables=s,this.attachProcessProviderFactory=a,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!1}}async activate(){this.attachProcessProviderFactory.registerCommands(),this.disposables.push(this.debugService.registerDebugAdapterTrackerFactory(l.DebuggerTypeName,this.debugSessionLoggingFactory)),this.disposables.push(this.debugService.registerDebugAdapterTrackerFactory(l.DebuggerTypeName,this.debuggerPromptFactory)),this.disposables.push(this.debugService.registerDebugAdapterDescriptorFactory(l.DebuggerTypeName,this.descriptorFactory)),this.disposables.push(this.debugService.onDidStartDebugSession((e=>{var t;this.shouldTerminalFocusOnStart(null===(t=e.workspaceFolder)||void 0===t?void 0:t.uri)&&this.commandManager.executeCommand("workbench.action.terminal.focus")})))}shouldTerminalFocusOnStart(e){var t;return null===(t=this.configSettings.getSettings(e))||void 0===t?void 0:t.terminal.focusAfterLaunch}};p=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IDebugService)),i(1,(0,o.inject)(a.IConfigurationService)),i(2,(0,o.inject)(c.ICommandManager)),i(3,(0,o.inject)(d.IDebugAdapterDescriptorFactory)),i(4,(0,o.inject)(d.IDebugSessionLoggingFactory)),i(5,(0,o.inject)(d.IOutdatedDebuggerPromptFactory)),i(6,(0,o.inject)(a.IDisposableRegistry)),i(7,(0,o.inject)(u.IAttachProcessProviderFactory))],p),t.DebugAdapterActivator=p},44673:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DebugAdapterDescriptorFactory=t.debugStateKeys=void 0;const o=n(86700),s=n(71017),a=n(66828),c=n(63281),l=n(18639),u=n(19735),d=n(54813),p=n(61522),h=n(56693),f=n(67098),g=n(61684),m=n(77570),v=n(17585),y=n(49575);var b;!function(e){e.doNotShowAgain="doNotShowPython36DebugDeprecatedAgain"}(b=t.debugStateKeys||(t.debugStateKeys={}));let S=class{constructor(e,t,n){this.commandManager=e,this.interpreterService=t,this.persistentState=n}async createDebugAdapterDescriptor(e,t){var n,r,i,o,l;const h=e.configuration;if("attach"===h.request){if(void 0!==h.connect)return(0,u.traceLog)(`Connecting to DAP Server at: ${null!==(n=h.connect.host)&&void 0!==n?n:"127.0.0.1"}:${h.connect.port}`),new a.DebugAdapterServer(h.connect.port,null!==(r=h.connect.host)&&void 0!==r?r:"127.0.0.1");if(void 0!==h.port)return(0,u.traceLog)(`Connecting to DAP Server at: ${null!==(i=h.host)&&void 0!==i?i:"127.0.0.1"}:${h.port}`),new a.DebugAdapterServer(h.port,null!==(o=h.host)&&void 0!==o?o:"127.0.0.1");if(void 0===h.listen&&void 0===h.processId)throw new Error('"request":"attach" requires either "connect", "listen", or "processId"')}const f=await this.getDebugAdapterPython(h,e.workspaceFolder);if(0!==f.length){"attach"===h.request&&void 0!==h.processId&&(0,d.sendTelemetryEvent)(p.EventName.DEBUGGER_ATTACH_TO_LOCAL_PROCESS);const e=null!==(l=f.shift())&&void 0!==l?l:"python",t=h.logToFile?["--log-dir",c.EXTENSION_ROOT_DIR]:[];if(void 0!==h.debugAdapterPath){const n=f.concat([h.debugAdapterPath,...t]);return(0,u.traceLog)(`DAP Server launched with command: ${e} ${n.join(" ")}`),new a.DebugAdapterExecutable(e,n)}const n=await(0,y.getDebugpyPath)();if(!n)throw(0,u.traceError)("Could not find debugpy path."),new Error("Could not find debugpy path.");const r=s.join(n,"adapter"),i=f.concat([r,...t]);return(0,u.traceLog)(`DAP Server launched with command: ${e} ${i.join(" ")}`),(0,d.sendTelemetryEvent)(p.EventName.DEBUG_ADAPTER_USING_WHEELS_PATH,void 0,{usingWheels:!0}),new a.DebugAdapterExecutable(e,i)}throw new Error("Debug Adapter Executable not provided")}async getDebugAdapterPython(e,t){if(void 0!==e.debugAdapterPython)return this.getExecutableCommand(await this.interpreterService.getInterpreterDetails(e.debugAdapterPython));if(e.pythonPath)return this.getExecutableCommand(await this.interpreterService.getInterpreterDetails(e.pythonPath));const n=t?t.uri:void 0,r=await this.interpreterService.getActiveInterpreter(n);if(r)return(0,u.traceVerbose)(`Selecting active interpreter as Python Executable for DA '${r.path}'`),this.getExecutableCommand(r);await this.interpreterService.hasInterpreters();const i=this.interpreterService.getInterpreters(n);return 0===i.length?(this.notifySelectInterpreter().ignoreErrors(),[]):((0,u.traceVerbose)(`Picking first available interpreter to launch the DA '${i[0].path}'`),this.getExecutableCommand(i[0]))}async showDeprecatedPythonMessage(){if(this.persistentState.createGlobalPersistentState(b.doNotShowAgain,!1).value)return;const e=[f.Interpreters.changePythonInterpreter,f.Common.doNotShowAgain],t=await(0,h.showErrorMessage)(a.l10n.t("The debugger in the python extension no longer supports python versions minor than 3.7."),{modal:!0},...e);t&&(t==f.Interpreters.changePythonInterpreter&&await this.commandManager.executeCommand(m.Commands.Set_Interpreter),t==f.Common.doNotShowAgain&&await this.persistentState.createGlobalPersistentState(b.doNotShowAgain,!1).updateValue(!0))}async getExecutableCommand(e){var t,n,r,i,o,s;return e?(((null!==(n=null===(t=e.version)||void 0===t?void 0:t.major)&&void 0!==n?n:0)<3||(null!==(i=null===(r=e.version)||void 0===r?void 0:r.major)&&void 0!==i?i:0)<=3&&(null!==(s=null===(o=e.version)||void 0===o?void 0:o.minor)&&void 0!==s?s:0)<=6)&&this.showDeprecatedPythonMessage(),e.path.length>0?[e.path]:[]):[]}async notifySelectInterpreter(){await(0,h.showErrorMessage)(a.l10n.t("Install Python or select a Python Interpreter to use the debugger."))}};S=r([(0,o.injectable)(),i(0,(0,o.inject)(v.ICommandManager)),i(1,(0,o.inject)(l.IInterpreterService)),i(2,(0,o.inject)(g.IPersistentStateFactory))],S),t.DebugAdapterDescriptorFactory=S},2493:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionLoggingFactory=void 0;const o=n(86700),s=n(71017),a=n(84974),c=n(70057),l=n(63281);class u{constructor(e,t){if(this.session=e,this.enabled=!1,this.timer=new c.StopWatch,this.enabled=this.session.configuration.logToFile,this.enabled){const e=`debugger.vscode_${this.session.id}.log`;this.stream=t.createWriteStream(s.join(l.EXTENSION_ROOT_DIR,e))}}onWillStartSession(){this.timer.reset(),this.log(`Starting Session:\n${this.stringify(this.session.configuration)}\n`)}onWillReceiveMessage(e){this.log(`Client --\x3e Adapter:\n${this.stringify(e)}\n`)}onDidSendMessage(e){this.log(`Client <-- Adapter:\n${this.stringify(e)}\n`)}onWillStopSession(){this.log("Stopping Session\n")}onError(e){this.log(`Error:\n${this.stringify(e)}\n`)}onExit(e,t){var n;this.log(`Exit:\nExit-Code: ${e||0}\nSignal: ${t||"none"}\n`),null===(n=this.stream)||void 0===n||n.close()}log(e){this.enabled&&this.stream.write(`${this.timer.elapsedTime} ${e}`)}stringify(e){return JSON.stringify(e,null,4)}}let d=class{constructor(e){this.fileSystem=e}createDebugAdapterTracker(e){return new u(e,this.fileSystem)}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IFileSystem))],d),t.DebugSessionLoggingFactory=d},93951:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.OutdatedDebuggerPromptFactory=void 0;const i=n(86700),o=n(67098),s=n(12524),a=n(56693);class c{constructor(e){this.promptCheck=e}onDidSendMessage(e){if(this.promptCheck.shouldShowPrompt()&&this.isPtvsd(e)){const e=[o.Common.moreInfo];(0,a.showInformationMessage)(o.OutdatedDebugger.outdatedDebuggerMessage,...e).then((t=>{t===e[0]&&(0,s.launch)("https://aka.ms/migrateToDebugpy")}))}}isPtvsd(e){if("event"===e.type){const t=e;if("output"===t.event){const e=t;if("telemetry"===e.body.category){if("ptvsd"===e.body.output&&!e.body.data.packageVersion.startsWith("1"))return this.promptCheck.setShowPrompt(!1),!0;"debugpy"===e.body.output&&this.promptCheck.setShowPrompt(!1)}}}return!1}}class l{constructor(){this.shouldShow=!0}shouldShowPrompt(){return this.shouldShow}setShowPrompt(e){this.shouldShow=e}}let u=class{constructor(){this.promptCheck=new l}createDebugAdapterTracker(e){return new c(this.promptCheck)}};u=r([(0,i.injectable)()],u),t.OutdatedDebuggerPromptFactory=u},12187:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDebugpyLauncherArgs=void 0,n(32727);const r=n(49575);t.getDebugpyLauncherArgs=async function(e,t){t||(t=await(0,r.getDebugpyPath)());const n=e.waitUntilDebuggerAttaches?["--wait-for-client"]:[];return[t.fileToCommandArgumentForPythonExt(),"--listen",`${e.host}:${e.port}`,...n]}},56471:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AttachProcessProviderFactory=void 0;const o=n(86700),s=n(17585),a=n(77570),c=n(84974),l=n(29983),u=n(61684),d=n(52285),p=n(95868);let h=class{constructor(e,t,n,r,i){this.applicationShell=e,this.commandManager=t,this.platformService=n,this.processServiceFactory=r,this.disposableRegistry=i}registerCommands(){const e=new p.AttachProcessProvider(this.platformService,this.processServiceFactory),t=new d.AttachPicker(this.applicationShell,e),n=this.commandManager.registerCommand(a.Commands.PickLocalProcess,(()=>t.showQuickPick()),this);this.disposableRegistry.push(n)}};h=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IApplicationShell)),i(1,(0,o.inject)(s.ICommandManager)),i(2,(0,o.inject)(c.IPlatformService)),i(3,(0,o.inject)(l.IProcessServiceFactory)),i(4,(0,o.inject)(u.IDisposableRegistry))],h),t.AttachProcessProviderFactory=h},52285:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AttachPicker=void 0;const o=n(86700),s=n(17585),a=n(1040),c=n(67098),l=n(75791);let u=class{constructor(e,t){this.applicationShell=e,this.attachItemsProvider=t}showQuickPick(){return new Promise((async(e,t)=>{const n=await this.attachItemsProvider.getAttachItems(),r={iconPath:(0,a.getIcon)(l.REFRESH_BUTTON_ICON),tooltip:c.AttachProcess.refreshList},i=this.applicationShell.createQuickPick();i.title=c.AttachProcess.attachTitle,i.placeholder=c.AttachProcess.selectProcessPlaceholder,i.canSelectMany=!1,i.matchOnDescription=!0,i.matchOnDetail=!0,i.items=n,i.buttons=[r];const o=[];i.onDidTriggerButton((async()=>{i.busy=!0;const e=await this.attachItemsProvider.getAttachItems();i.items=e,i.busy=!1}),this,o),i.onDidAccept((()=>{1!==i.selectedItems.length&&t(new Error(c.AttachProcess.noProcessSelected));const n=i.selectedItems[0].id;o.forEach((e=>e.dispose())),i.dispose(),e(n)}),void 0,o),i.onDidHide((()=>{o.forEach((e=>e.dispose())),i.dispose(),t(new Error(c.AttachProcess.noProcessSelected))}),void 0,o),i.show()}))}};u=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IApplicationShell))],u),t.AttachPicker=u},95868:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AttachProcessProvider=void 0;const o=n(86700),s=n(66828),a=n(84974),c=n(29983),l=n(26942),u=n(20557);let d=class{constructor(e,t){this.platformService=e,this.processServiceFactory=t}getAttachItems(){return this._getInternalProcessEntries().then((e=>(e.sort((({processName:e,commandLine:t},{processName:n,commandLine:r})=>{const i=(e,t)=>{const n=e.toLowerCase(),r=t.toLowerCase();return n===r?0:n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PsProcessParser=void 0,function(e){const t="".padStart(50,"a");function n(e){const t=new RegExp("^\\s*([0-9]+)\\s+(.{49})\\s+(.*)$").exec(e);if(4===(null==t?void 0:t.length)){const e=t[1].trim(),n=t[2].trim(),r=t[3].trim();return{label:n,description:e,detail:r,id:e,processName:n,commandLine:r}}}e.psLinuxCommand={command:"ps",args:["axww","-o",`pid=,comm=${t},args=`]},e.psDarwinCommand={command:"ps",args:["axww","-o",`pid=,comm=${t},args=`,"-c"]},e.parseProcesses=function(e){return function(e){const t=[];for(let r=1;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REFRESH_BUTTON_ICON=t.IAttachProcessProviderFactory=void 0,t.IAttachProcessProviderFactory=Symbol("IAttachProcessProviderFactory"),t.REFRESH_BUTTON_ICON="refresh.svg"},20557:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WmicProcessParser=void 0,function(e){const t="ProcessId",n={label:"",description:"",detail:"",id:"",processName:"",commandLine:""};function r(e,n){const r=e.indexOf("="),i=n;if(r>0){const n=e.slice(0,r).trim();let o=e.slice(r+1).trim();if("Name"===n)i.label=o,i.processName=o;else if(n===t)i.description=o,i.id=o;else if("CommandLine"===n){const e="\\??\\";0===o.lastIndexOf(e,0)&&(o=o.slice(e.length)),i.detail=o,i.commandLine=o}}return i}e.wmicCommand={command:"wmic",args:["process","get","Name,ProcessId,CommandLine","/FORMAT:list"]},e.parseProcesses=function(e){const i=e.split("\r\n"),o=[];let s={...n};for(const e of i)e.length&&(r(e,s),0===e.lastIndexOf(t,0)&&(o.push(s),s={...n}));return o}}(t.WmicProcessParser||(t.WmicProcessParser={}))},23728:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PythonDebugConfigurationService=void 0;const o=n(86700),s=n(45093);let a=class{constructor(e,t){this.attachResolver=e,this.launchResolver=t}async resolveDebugConfiguration(e,t,n){if("attach"===t.request)return this.attachResolver.resolveDebugConfiguration(e,t,n);if("test"===t.request)throw Error('This configuration can only be used by the test debugging commands. `"request": "test"` is deprecated, please keep as `"request": "launch"` and add `"purpose": ["debug-test"]` instead.');return 0!==Object.keys(t).length?this.launchResolver.resolveDebugConfiguration(e,t,n):void 0}async resolveDebugConfigurationWithSubstitutedVariables(e,t,n){function r(r){return r.resolveDebugConfigurationWithSubstitutedVariables(e,t,n)}return"attach"===t.request?r(this.attachResolver):r(this.launchResolver)}};a=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IDebugConfigurationResolver)),i(0,(0,o.named)("attach")),i(1,(0,o.inject)(s.IDebugConfigurationResolver)),i(1,(0,o.named)("launch"))],a),t.PythonDebugConfigurationService=a},40169:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getConfigurationsByUri=t.getConfigurationsForWorkspace=void 0;const r=n(71017),i=n(55674),o=n(60516),s=n(85261),a=n(19735);async function c(e){const t=r.join(e.uri.fsPath,".vscode","launch.json");if(!await i.pathExists(t)){const e=(0,s.getConfiguration)("launch");return e.configurations&&Array.isArray(e.configurations)?((0,a.traceLog)("Using launch configuration in workspace folder."),e.configurations):[]}const n=await i.readFile(t,"utf-8"),c=(0,o.parse)(n,[],{allowTrailingComma:!0,disallowComments:!1});if(!c.configurations||!Array.isArray(c.configurations))throw Error("Missing field in launch.json: configurations");if(!c.version)throw Error("Missing field in launch.json: version");return(0,a.traceLog)("Using launch configuration in launch.json file."),c.configurations}t.getConfigurationsForWorkspace=c,t.getConfigurationsByUri=async function(e){if(e){const t=(0,s.getWorkspaceFolder)(e);if(t)return c(t)}return[]}},91922:function(e,t,n){"use strict";var r,i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.AttachConfigurationResolver=void 0;const o=n(86700),s=n(87450),a=n(7317),c=n(52062);let l=r=class extends c.BaseConfigurationResolver{async resolveDebugConfigurationWithSubstitutedVariables(e,t,n){const i=r.getWorkspaceFolder(e);await this.provideAttachDefaults(i,t);const o=t;return Array.isArray(o.debugOptions)&&(o.debugOptions=o.debugOptions.filter(((e,t)=>o.debugOptions.indexOf(e)===t))),void 0===t.clientOS&&(t.clientOS=(0,s.getOSType)()===s.OSType.Windows?"windows":"unix"),t}async provideAttachDefaults(e,t){Array.isArray(t.debugOptions)||(t.debugOptions=[]),t.connect||t.listen||t.host||(t.host="localhost"),void 0===t.justMyCode&&(t.justMyCode=!t.debugStdLib),t.showReturnValue=!1!==t.showReturnValue,t.workspaceFolder=e?e.fsPath:void 0;const n=t.debugOptions;t.justMyCode||r.debugOption(n,a.DebugOptions.DebugStdLib),t.django&&r.debugOption(n,a.DebugOptions.Django),t.jinja&&r.debugOption(n,a.DebugOptions.Jinja),!0===t.subProcess&&r.debugOption(n,a.DebugOptions.SubProcess),t.pyramid&&-1===n.indexOf(a.DebugOptions.Jinja)&&!1!==t.jinja&&r.debugOption(n,a.DebugOptions.Jinja),(t.redirectOutput||void 0===t.redirectOutput)&&r.debugOption(n,a.DebugOptions.RedirectOutput);const i=r.isLocalHost(t.host);(0,s.getOSType)()===s.OSType.Windows&&i&&r.debugOption(n,a.DebugOptions.FixFilePathCase),void 0===t.clientOS&&(t.clientOS=(0,s.getOSType)()===s.OSType.Windows?"windows":"unix"),t.showReturnValue&&r.debugOption(n,a.DebugOptions.ShowReturnValue),t.pathMappings=this.resolvePathMappings(t.pathMappings||[],t.host,t.localRoot,t.remoteRoot,e),r.sendTelemetry("attach",t)}resolvePathMappings(e,t,n,i,o){return n&&i&&e.push({localRoot:n,remoteRoot:i}),r.isLocalHost(t)&&(e=r.fixUpPathMappings(e,o?o.fsPath:"")),e.length>0?e:void 0}};l=r=i([(0,o.injectable)()],l),t.AttachConfigurationResolver=l},52062:function(e,t,n){"use strict";var r,i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseConfigurationResolver=void 0;const o=n(86700),s=n(71017),a=n(66828),c=n(87450),l=n(85261),u=n(54813),d=n(61522),p=n(41691),h=n(64551),f=n(29741);let g=r=class{constructor(e,t){this.configurationService=e,this.interpreterService=t,this.pythonPathSource=p.PythonPathSource.launchJson}async resolveDebugConfiguration(e,t,n){return void 0===t.clientOS&&(t.clientOS=(0,c.getOSType)()===c.OSType.Windows?"windows":"unix"),t}static getWorkspaceFolder(e){if(e)return e.uri;const t=(0,f.getProgram)(),n=(0,l.getWorkspaceFolders)();if(!Array.isArray(n)||0===n.length)return t?a.Uri.file(s.dirname(t)):void 0;if(1===n.length)return n[0].uri;if(t){const e=(0,l.getWorkspaceFolder)(a.Uri.file(t));if(e)return e.uri}}async resolveAndUpdatePaths(e,t){r.resolveAndUpdateEnvFilePath(e,t),await this.resolveAndUpdatePythonPath(e,t)}static resolveAndUpdateEnvFilePath(e,t){t&&t.envFile&&(e||t.cwd)&&(t.envFile=(0,h.resolveVariables)(t.envFile,(e?e.fsPath:void 0)||t.cwd,void 0))}async resolveAndUpdatePythonPath(e,t){var n,r,i,o,s,a,c;if(t){if("${command:python.interpreterPath}"!==t.pythonPath&&t.pythonPath)t.pythonPath=(0,h.resolveVariables)(t.pythonPath?t.pythonPath:void 0,null==e?void 0:e.fsPath,void 0);else{const i=null!==(r=null===(n=await this.interpreterService.getActiveInterpreter(e))||void 0===n?void 0:n.path)&&void 0!==r?r:this.configurationService.getSettings(e).pythonPath;t.pythonPath=i}if("${command:python.interpreterPath}"===t.python){this.pythonPathSource=p.PythonPathSource.settingsJson;const n=null!==(o=null===(i=await this.interpreterService.getActiveInterpreter(e))||void 0===i?void 0:i.path)&&void 0!==o?o:this.configurationService.getSettings(e).pythonPath;t.python=n}else void 0===t.python?(this.pythonPathSource=p.PythonPathSource.settingsJson,t.python=t.pythonPath):(this.pythonPathSource=p.PythonPathSource.launchJson,t.python=(0,h.resolveVariables)(null!==(s=t.python)&&void 0!==s?s:t.pythonPath,null==e?void 0:e.fsPath,void 0));"${command:python.interpreterPath}"!==t.debugAdapterPython&&void 0!==t.debugAdapterPython||(t.debugAdapterPython=null!==(a=t.pythonPath)&&void 0!==a?a:t.python),"${command:python.interpreterPath}"!==t.debugLauncherPython&&void 0!==t.debugLauncherPython||(t.debugLauncherPython=null!==(c=t.pythonPath)&&void 0!==c?c:t.python),delete t.pythonPath}}static debugOption(e,t){e.indexOf(t)>=0||e.push(t)}static isLocalHost(e){return!!(e&&["localhost","127.0.0.1","::1"].indexOf(e.toLowerCase())>=0)}static fixUpPathMappings(e,t,n){return t?(n||(n=t),e=0===e.length?[{localRoot:t,remoteRoot:n}]:e.map((({localRoot:e,remoteRoot:n})=>({localRoot:(0,h.resolveVariables)(e,t,void 0)||"",remoteRoot:n}))),(0,c.getOSType)()===c.OSType.Windows&&(e=e.map((({localRoot:e,remoteRoot:t})=>{let n=e;return e.match(/^[A-Z]:/)&&(n=`${e[0].toLowerCase()}${e.substr(1)}`),{localRoot:n,remoteRoot:t}}))),e):[]}static isDebuggingFastAPI(e){return!(!e.module||"FASTAPI"!==e.module.toUpperCase())}static isDebuggingFlask(e){return!(!e.module||"FLASK"!==e.module.toUpperCase())}static sendTelemetry(e,t){const n=t.name||"",i=t.module||"",o={trigger:e,console:t.console,hasEnvVars:"object"==typeof t.env&&Object.keys(t.env).length>0,django:!!t.django,fastapi:r.isDebuggingFastAPI(t),flask:r.isDebuggingFlask(t),hasArgs:Array.isArray(t.args)&&t.args.length>0,isLocalhost:r.isLocalHost(t.host),isModule:i.length>0,isSudo:!!t.sudo,jinja:!!t.jinja,pyramid:!!t.pyramid,stopOnEntry:!!t.stopOnEntry,showReturnValue:!!t.showReturnValue,subProcess:!!t.subProcess,watson:n.toLowerCase().indexOf("watson")>=0,pyspark:n.toLowerCase().indexOf("pyspark")>=0,gevent:n.toLowerCase().indexOf("gevent")>=0,scrapy:"scrapy"===i.toLowerCase()};(0,u.sendTelemetryEvent)(d.EventName.DEBUGGER,void 0,o)}};g=r=i([(0,o.injectable)()],g),t.BaseConfigurationResolver=g},29741:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.getProgram=t.DebugEnvironmentVariablesHelper=t.IDebugEnvironmentVariablesService=void 0;const o=n(86700),s=n(61684),a=n(19909),c=n(77570),l=n(56693),u=n(47237);t.IDebugEnvironmentVariablesService=Symbol("IDebugEnvironmentVariablesService");let d=class{constructor(e,t){this.envParser=e,this.process=t}async getEnvironmentVariables(e,t){var n;const r=(0,u.getSearchPathEnvVarNames)()[0],i=e.env&&Object.keys(e.env).length>0?{...e.env}:{},o=await this.envParser.parseFile(e.envFile,i),s=o?{...o}:{};return this.envParser.mergeVariables(i,s,{overwrite:!0}),t&&this.envParser.mergeVariables(t,s,{mergeAll:!0}),this.envParser.appendPath(s,null!==(n=i[r])&&void 0!==n?n:i[r.toUpperCase()]),this.envParser.appendPythonPath(s,i.PYTHONPATH),"string"==typeof s[r]&&s[r].length>0&&this.envParser.appendPath(s,this.process.env[r]),"string"==typeof s.PYTHONPATH&&s.PYTHONPATH.length>0&&this.envParser.appendPythonPath(s,this.process.env.PYTHONPATH),"internalConsole"===e.console&&(this.envParser.mergeVariables(this.process.env,s),void 0===s[r]&&"string"==typeof this.process.env[r]&&(s[r]=this.process.env[r]),void 0===s.PYTHONPATH&&"string"==typeof this.process.env.PYTHONPATH&&(s.PYTHONPATH=this.process.env.PYTHONPATH)),s.hasOwnProperty("PYTHONIOENCODING")||(s.PYTHONIOENCODING="UTF-8"),s.hasOwnProperty("PYTHONUNBUFFERED")||(s.PYTHONUNBUFFERED="1"),e.gevent&&(s.GEVENT_SUPPORT="True"),s}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IEnvironmentVariablesService)),i(1,(0,o.inject)(s.ICurrentProcess))],d),t.DebugEnvironmentVariablesHelper=d,t.getProgram=function(){const e=(0,l.getActiveTextEditor)();if(e&&e.document.languageId===c.PYTHON_LANGUAGE)return e.document.fileName}},18512:function(e,t,n){"use strict";var r,i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchConfigurationResolver=void 0;const s=n(86700),a=n(42655),c=n(93971),l=n(61684),u=n(87450),d=n(80351),p=n(18639),h=n(51097),f=n(7317),g=n(52062),m=n(29741),v=n(5793),y=n(54813),b=n(61522);let S=r=class extends g.BaseConfigurationResolver{constructor(e,t,n,r,i){super(t,r),this.invalidPythonPathInDebuggerService=e,this.debugEnvHelper=n,this.environmentActivationService=i,this.isCustomPythonSet=!1}async resolveDebugConfiguration(e,t,n){if(this.isCustomPythonSet=void 0!==t.python,void 0===t.name&&void 0===t.type&&void 0===t.request&&void 0===t.program&&void 0===t.env){const e=(0,m.getProgram)();t.name="Launch",t.type=h.DebuggerTypeName,t.request="launch",t.program=null!=e?e:"",t.env={}}const i=r.getWorkspaceFolder(e);return t.workspaceFolder=null==i?void 0:i.fsPath,await this.resolveAndUpdatePaths(i,t),void 0===t.clientOS&&(t.clientOS=(0,u.getOSType)()===u.OSType.Windows?"windows":"unix"),t}async resolveDebugConfigurationWithSubstitutedVariables(e,t,n){const i=r.getWorkspaceFolder(e);if(await this.provideLaunchDefaults(i,t),await this.validateLaunchConfiguration(e,t))return Array.isArray(t.debugOptions)&&(t.debugOptions=t.debugOptions.filter(((e,n)=>t.debugOptions.indexOf(e)===n))),(0,y.sendTelemetryEvent)(b.EventName.ENVIRONMENT_CHECK_TRIGGER,void 0,{trigger:"debug"}),(0,v.triggerCreateEnvironmentCheckNonBlocking)(v.CreateEnvironmentCheckKind.Workspace,i),t}async provideLaunchDefaults(e,t){var n,i;if(void 0===t.python&&(t.python=t.pythonPath),void 0===t.debugAdapterPython&&(t.debugAdapterPython=t.pythonPath),void 0===t.debugLauncherPython&&(t.debugLauncherPython=t.pythonPath),delete t.pythonPath,"string"!=typeof t.cwd&&e&&(t.cwd=e.fsPath),"string"!=typeof t.envFile&&e){const n=this.configurationService.getSettings(e);t.envFile=n.envFile}let o;(this.isCustomPythonSet||"integratedTerminal"!==t.console)&&(o=await this.environmentActivationService.getActivatedEnvironmentVariables(e,await this.interpreterService.getInterpreterDetails(null!==(n=t.python)&&void 0!==n?n:""))),t.env=await this.debugEnvHelper.getEnvironmentVariables(t,o),"boolean"!=typeof t.stopOnEntry&&(t.stopOnEntry=!1),t.showReturnValue=!1!==t.showReturnValue,t.console||(t.console="integratedTerminal"),"internalConsole"===t.console||t.internalConsoleOptions||(t.internalConsoleOptions="neverOpen"),Array.isArray(t.debugOptions)||(t.debugOptions=[]),void 0===t.justMyCode&&(t.justMyCode=!t.debugStdLib);const s=t.debugOptions;t.justMyCode||r.debugOption(s,f.DebugOptions.DebugStdLib),t.stopOnEntry&&r.debugOption(s,f.DebugOptions.StopOnEntry),t.showReturnValue&&r.debugOption(s,f.DebugOptions.ShowReturnValue),t.django&&r.debugOption(s,f.DebugOptions.Django),t.jinja&&r.debugOption(s,f.DebugOptions.Jinja),void 0===t.redirectOutput&&"internalConsole"===t.console&&(t.redirectOutput=!0),t.redirectOutput&&r.debugOption(s,f.DebugOptions.RedirectOutput),t.sudo&&r.debugOption(s,f.DebugOptions.Sudo),!0===t.subProcess&&r.debugOption(s,f.DebugOptions.SubProcess),(0,u.getOSType)()===u.OSType.Windows&&r.debugOption(s,f.DebugOptions.FixFilePathCase);const a=r.isDebuggingFastAPI(t),c=r.isDebuggingFlask(t);if((t.pyramid||c||a)&&-1===s.indexOf(f.DebugOptions.Jinja)&&!1!==t.jinja&&r.debugOption(s,f.DebugOptions.Jinja),t.pathMappings){let{pathMappings:n}=t;n.length>0&&(n=r.fixUpPathMappings(n||[],e?e.fsPath:"")),t.pathMappings=n.length>0?n:void 0}const l=(null===(i=t.purpose)||void 0===i?void 0:i.includes(f.DebugPurpose.DebugTest))||"test"===t.request?"test":"launch";r.sendTelemetry(l,t)}async validateLaunchConfiguration(e,t){const n=this.invalidPythonPathInDebuggerService;for(const r of[t.python,t.debugAdapterPython,t.debugLauncherPython])if(!await n.validatePythonPath(r,this.pythonPathSource,null==e?void 0:e.uri))return!1;return!0}};S=r=i([(0,s.injectable)(),o(0,(0,s.inject)(c.IDiagnosticsService)),o(0,(0,s.named)(a.InvalidPythonPathInDebuggerServiceId)),o(1,(0,s.inject)(l.IConfigurationService)),o(2,(0,s.inject)(m.IDebugEnvironmentVariablesService)),o(3,(0,s.inject)(p.IInterpreterService)),o(4,(0,s.inject)(d.IEnvironmentActivationService))],S),t.LaunchConfigurationResolver=S},45093:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IDebugConfigurationResolver=void 0,t.IDebugConfigurationResolver=Symbol("IDebugConfigurationResolver")},64551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveVariables=void 0;const r=n(85261);t.resolveVariables=function(e,t,n){if(e){const i=n?(0,r.getWorkspaceFolder)(n.uri):void 0,o={};o.workspaceFolder=i?i.uri.fsPath:t;const s=/\$\{(.*?)\}/g;return e.replace(s,((e,t)=>{const n=o[t];return"string"==typeof(r=n)||r instanceof String?n:e&&(e.indexOf("env.")>0||e.indexOf("env:")>0)?"":e;var r}))}return e}},98730:function(e,t,n){"use strict";var r,i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DebugCommands=void 0;const s=n(71017),a=n(86700),c=n(17585),l=n(77570),u=n(61684),d=n(54813),p=n(61522),h=n(7317),f=n(18639),g=n(3481),m=n(40169),v=n(5793);let y=r=class{constructor(e,t,n,r){this.commandManager=e,this.debugService=t,this.disposables=n,this.interpreterService=r,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!1}}activate(){return this.disposables.push(this.commandManager.registerCommand(l.Commands.Debug_In_Terminal,(async e=>{if((0,d.sendTelemetryEvent)(p.EventName.DEBUG_IN_TERMINAL_BUTTON),!await this.interpreterService.getActiveInterpreter(e))return void this.commandManager.executeCommand(l.Commands.TriggerEnvironmentSelection,e).then(g.noop,g.noop);(0,d.sendTelemetryEvent)(p.EventName.ENVIRONMENT_CHECK_TRIGGER,void 0,{trigger:"debug-in-terminal"}),(0,v.triggerCreateEnvironmentCheckNonBlocking)(v.CreateEnvironmentCheckKind.File,e);const t=await r.getDebugConfiguration(e);this.debugService.startDebugging(void 0,t)}))),Promise.resolve()}static async getDebugConfiguration(e){var t,n,r;const i=(await(0,m.getConfigurationsByUri)(e)).filter((e=>"launch"===e.request));for(const r of i)if(null===(t=r.purpose)||void 0===t?void 0:t.includes(h.DebugPurpose.DebugInTerminal))return r.program||r.module||r.code||(r.program=null!==(n=null==e?void 0:e.fsPath)&&void 0!==n?n:"${file}"),r.purpose=[],r;return{name:`Debug ${e?s.basename(e.fsPath):"File"}`,type:"python",request:"launch",program:null!==(r=null==e?void 0:e.fsPath)&&void 0!==r?r:"${file}",console:"integratedTerminal"}}};y=r=i([(0,a.injectable)(),o(0,(0,a.inject)(c.ICommandManager)),o(1,(0,a.inject)(c.IDebugService)),o(2,(0,a.inject)(u.IDisposableRegistry)),o(3,(0,a.inject)(f.IInterpreterService))],y),t.DebugCommands=y},53964:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ChildProcessAttachEventHandler=void 0;const o=n(86700),s=n(36952),a=n(27620),c=n(92378),l=n(51097);let u=class{constructor(e){this.childProcessAttachService=e}async handleCustomEvent(e){if(!e||e.session.configuration.type!==l.DebuggerTypeName)return;let t;e.event!==a.DebuggerEvents.PtvsdAttachToSubprocess&&e.event!==a.DebuggerEvents.DebugpyAttachToSubprocess||(t=e.body,Object.keys(t).length>0&&await this.childProcessAttachService.attach(t,e.session))}};r([(0,s.swallowExceptions)("Handle child process launch")],u.prototype,"handleCustomEvent",null),u=r([(0,o.injectable)(),i(0,(0,o.inject)(c.IChildProcessAttachService))],u),t.ChildProcessAttachEventHandler=u},47282:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ChildProcessAttachService=void 0;const o=n(86700),s=n(17585),a=n(66828),c=n(3481),l=n(54813),u=n(61522),d=n(56693),p=n(85261);let h=class{constructor(e){this.debugService=e}async attach(e,t){const n=e,r=this.getRelatedWorkspaceFolder(n),i={parentSession:t,lifecycleManagedByParent:!0};await this.debugService.startDebugging(r,n,i)||(0,d.showErrorMessage)(a.l10n.t("Failed to launch debugger for child process {0}",n.subProcessId)).then(c.noop,c.noop)}getRelatedWorkspaceFolder(e){var t;const n=e.workspaceFolder;if(((null===(t=(0,p.getWorkspaceFolders)())||void 0===t?void 0:t.length)||0)>0&&n)return(0,p.getWorkspaceFolders)().find((e=>e.uri.fsPath===n))}};r([(0,l.captureTelemetry)(u.EventName.DEBUGGER_ATTACH_TO_CHILD_PROCESS)],h.prototype,"attach",null),h=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IDebugService))],h),t.ChildProcessAttachService=h},27620:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerEvents=void 0,(n=t.DebuggerEvents||(t.DebuggerEvents={})).PtvsdAttachToSubprocess="ptvsd_attach",n.DebugpyAttachToSubprocess="debugpyAttach"},43397:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionEventDispatcher=void 0;const o=n(86700),s=n(17585),a=n(61684),c=n(92378);let l=class{constructor(e,t,n){this.eventHandlers=e,this.debugService=t,this.disposables=n}registerEventHandlers(){this.disposables.push(this.debugService.onDidReceiveDebugSessionCustomEvent((e=>{this.eventHandlers.forEach((t=>t.handleCustomEvent?t.handleCustomEvent(e).ignoreErrors():void 0))}))),this.disposables.push(this.debugService.onDidTerminateDebugSession((e=>{this.eventHandlers.forEach((t=>t.handleTerminateEvent?t.handleTerminateEvent(e).ignoreErrors():void 0))})))}};l=r([i(0,(0,o.multiInject)(c.IDebugSessionEventHandlers)),i(1,(0,o.inject)(s.IDebugService)),i(2,(0,o.inject)(a.IDisposableRegistry))],l),t.DebugSessionEventDispatcher=l},92378:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IChildProcessAttachService=t.IDebugSessionEventHandlers=void 0,t.IDebugSessionEventHandlers=Symbol("IDebugSessionEventHandlers"),t.IChildProcessAttachService=Symbol("IChildProcessAttachService")},3509:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const r=n(90819),i=n(11393),o=n(44673),s=n(2493),a=n(93951),c=n(56471),l=n(75791),u=n(23728),d=n(91922),p=n(29741),h=n(18512),f=n(45093),g=n(98730),m=n(53964),v=n(47282),y=n(92378),b=n(41691);t.registerTypes=function(e){e.addSingleton(b.IDebugConfigurationService,u.PythonDebugConfigurationService),e.addSingleton(y.IChildProcessAttachService,v.ChildProcessAttachService),e.addSingleton(y.IDebugSessionEventHandlers,m.ChildProcessAttachEventHandler),e.addSingleton(f.IDebugConfigurationResolver,h.LaunchConfigurationResolver,"launch"),e.addSingleton(f.IDebugConfigurationResolver,d.AttachConfigurationResolver,"attach"),e.addSingleton(p.IDebugEnvironmentVariablesService,p.DebugEnvironmentVariablesHelper),e.addSingleton(r.IExtensionSingleActivationService,i.DebugAdapterActivator),e.addSingleton(b.IDebugAdapterDescriptorFactory,o.DebugAdapterDescriptorFactory),e.addSingleton(b.IDebugSessionLoggingFactory,s.DebugSessionLoggingFactory),e.addSingleton(b.IOutdatedDebuggerPromptFactory,a.OutdatedDebuggerPromptFactory),e.addSingleton(l.IAttachProcessProviderFactory,c.AttachProcessProviderFactory),e.addSingleton(r.IExtensionSingleActivationService,g.DebugCommands)}},41691:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PythonPathSource=t.IOutdatedDebuggerPromptFactory=t.IDebugSessionLoggingFactory=t.IDebugAdapterDescriptorFactory=t.IDebugConfigurationService=void 0,t.IDebugConfigurationService=Symbol("IDebugConfigurationService"),t.IDebugAdapterDescriptorFactory=Symbol("IDebugAdapterDescriptorFactory"),t.IDebugSessionLoggingFactory=Symbol("IDebugSessionLoggingFactory"),t.IOutdatedDebuggerPromptFactory=Symbol("IOutdatedDebuggerPromptFactory"),(n=t.PythonPathSource||(t.PythonPathSource={})).launchJson="launch.json",n.settingsJson="settings.json"},49575:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDebugpyPath=void 0;const r=n(66828);t.getDebugpyPath=async function(){var e;const t=await async function(){const e=await async function(){const e=r.extensions.getExtension("ms-python.debugpy");return e&&(e.isActive||await e.activate()),e}();return null==e?void 0:e.exports}();return null!==(e=null==t?void 0:t.debug.getDebuggerPackagePath())&&void 0!==e?e:""}},7317:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugPurpose=t.DebugOptions=void 0,(r=t.DebugOptions||(t.DebugOptions={})).RedirectOutput="RedirectOutput",r.Django="Django",r.Jinja="Jinja",r.DebugStdLib="DebugStdLib",r.Sudo="Sudo",r.Pyramid="Pyramid",r.FixFilePathCase="FixFilePathCase",r.WindowsClient="WindowsClient",r.UnixClient="UnixClient",r.StopOnEntry="StopOnEntry",r.ShowReturnValue="ShowReturnValue",r.SubProcess="Multiprocess",(n=t.DebugPurpose||(t.DebugPurpose={})).DebugTest="debug-test",n.DebugInTerminal="debug-in-terminal"},70301:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildDeprecatedProposedApi=t.reportActiveInterpreterChangedDeprecated=t.reportInterpretersChanged=void 0;const r=n(66828),i=n(48431),o=n(61684),s=n(18639),a=n(19735),c=n(44773),l=n(54813),u=n(61522),d=new r.EventEmitter;t.reportInterpretersChanged=function(e){d.fire(e)};const p=new r.EventEmitter;function h(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.reportActiveInterpreterChangedDeprecated=function(e){p.fire(e)},t.buildDeprecatedProposedApi=function(e,t){const n=t.get(o.IInterpreterPathService),f=t.get(s.IInterpreterService),g=t.get(o.IExtensions),m=new Set;function v(e,t=!0){g.determineExtensionFromCallStack().then((n=>{(0,l.sendTelemetryEvent)(u.EventName.PYTHON_ENVIRONMENTS_API,void 0,{apiName:e,extensionId:n.extensionId}),(0,a.traceVerbose)(`Extension ${n.extensionId} accessed ${e}`),t&&!m.has(n.extensionId)&&(console.warn(`${n.extensionId} extension is using deprecated python APIs which will be removed soon.`),m.add(n.extensionId))})).ignoreErrors()}return{environment:{async getExecutionDetails(e){v("deprecated.getExecutionDetails");const t=await f.getActiveInterpreter(e);return t?{execCommand:[t.path]}:{execCommand:void 0}},async getActiveEnvironmentPath(e){v("deprecated.getActiveEnvironmentPath");const t=await f.getActiveInterpreter(e);if(t)return(0,c.getEnvPath)(t.path,t.envPath)},async getEnvironmentDetails(t,n){let r;if(v("deprecated.getEnvironmentDetails"),(null==n?void 0:n.useCache)&&(r=e.getEnvs().find((e=>function(e,t){return(0,i.arePathsSame)(e,t.location)||(0,i.arePathsSame)(e,t.executable.filename)}(t,e)))),r||(r=await e.resolveEnv(t),r))return{interpreterPath:r.executable.filename,envFolderPath:r.location.length?r.location:void 0,version:h(r),environmentType:[r.kind],metadata:{sysPrefix:r.executable.sysPrefix,bitness:r.arch,project:r.searchLocation}}},getEnvironmentPaths(){v("deprecated.getEnvironmentPaths");const t=e.getEnvs().map((e=>(0,c.getEnvPath)(e.executable.filename,e.location)));return Promise.resolve(t)},setActiveEnvironment:(e,t)=>(v("deprecated.setActiveEnvironment"),n.update(t,r.ConfigurationTarget.WorkspaceFolder,e)),async refreshEnvironment(){v("deprecated.refreshEnvironment"),await e.triggerRefresh();const t=e.getEnvs().map((e=>(0,c.getEnvPath)(e.executable.filename,e.location)));return Promise.resolve(t)},getRefreshPromise:t=>(v("deprecated.getRefreshPromise"),e.getRefreshPromise(t)),get onDidChangeExecutionDetails(){return v("deprecated.onDidChangeExecutionDetails",!1),f.onDidChangeInterpreterConfiguration},get onDidEnvironmentsChanged(){return v("deprecated.onDidEnvironmentsChanged",!1),d.event},get onDidActiveEnvironmentChanged(){return v("deprecated.onDidActiveEnvironmentChanged",!1),p.event},get onRefreshProgress(){return v("deprecated.onRefreshProgress",!1),e.onProgress}}}}},12304:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertEnvInfo=t.convertCompleteEnvInfo=t.buildEnvironmentApi=t.EnvironmentReference=t.reportActiveInterpreterChanged=void 0;const r=n(66828),i=n(71017),o=n(61684),s=n(87450),a=n(45878),c=n(44773),l=n(29983),u=n(19735),d=n(48431),p=n(54813),h=n(61522),f=n(70301),g=n(19909),m=n(85261),v=n(85949),y=n(87377),b=new r.EventEmitter;t.reportActiveInterpreterChanged=function(e){var t;b.fire({id:D(e.path),path:e.path,resource:e.resource}),(0,f.reportActiveInterpreterChangedDeprecated)({path:e.path,resource:null===(t=e.resource)||void 0===t?void 0:t.uri})};const S=new r.EventEmitter,_=new r.EventEmitter,E=new Map;class w{constructor(e){this.internal=e,this.id=e.id}get executable(){return Object.freeze(this.internal.executable)}get environment(){return Object.freeze(this.internal.environment)}get version(){return Object.freeze(this.internal.version)}get tools(){return Object.freeze(this.internal.tools)}get path(){return Object.freeze(this.internal.path)}updateEnv(e){this.internal=e}}function T(e){let t=E.get(e.id);return t?t.updateEnv(e):t=new w(e),E.set(e.id,t),t}function C(e){const t=(0,m.getWorkspaceFolders)();if(e.searchLocation){const n=e.searchLocation;return!!t&&t.some((e=>(0,d.isParentPath)(n.fsPath,e.uri.fsPath)))}return!0}function P(e){const t={...e.version,sysVersion:e.version.sysVersion};let n=function(e){switch(e){case a.PythonEnvKind.Venv:return"Venv";case a.PythonEnvKind.Pipenv:return"Pipenv";case a.PythonEnvKind.Poetry:return"Poetry";case a.PythonEnvKind.Hatch:return"Hatch";case a.PythonEnvKind.VirtualEnvWrapper:return"VirtualEnvWrapper";case a.PythonEnvKind.VirtualEnv:return"VirtualEnv";case a.PythonEnvKind.Conda:return"Conda";case a.PythonEnvKind.Pyenv:return"Pyenv";default:return}}(e.kind);e.type&&!n&&(n="Unknown");const{path:i}=(0,c.getEnvPath)(e.executable.filename,e.location);return{path:i,id:e.id,executable:{uri:"python"===e.executable.filename?void 0:r.Uri.file(e.executable.filename),bitness:R(e.arch),sysPrefix:e.executable.sysPrefix},environment:e.type?{type:(o=e.type,o===a.PythonEnvType.Conda?"Conda":o===a.PythonEnvType.Virtual?"VirtualEnvironment":"Unknown"),name:""===e.name?void 0:e.name,folderUri:r.Uri.file(e.location),workspaceFolder:(0,m.getWorkspaceFolder)(e.searchLocation)}:void 0,version:"python"===e.executable.filename?void 0:t,tools:n?[n]:[]};var o}function x(e){var t,n,r,i;const o=P(e);return""===o.executable.sysPrefix&&(o.executable.sysPrefix=void 0),""===(null===(t=o.version)||void 0===t?void 0:t.sysVersion)&&(o.version.sysVersion=void 0),-1===(null===(n=o.version)||void 0===n?void 0:n.major)&&(o.version.major=void 0),-1===(null===(r=o.version)||void 0===r?void 0:r.micro)&&(o.version.micro=void 0),-1===(null===(i=o.version)||void 0===i?void 0:i.minor)&&(o.version.minor=void 0),o}function I(e){return T(x(e))}function R(e){switch(e){case s.Architecture.x64:return"64-bit";case s.Architecture.x86:return"32-bit";default:return"Unknown"}}function D(e){return(0,d.normCasePath)(e)}t.EnvironmentReference=w,t.buildEnvironmentApi=function(e,t){const n=t.get(o.IInterpreterPathService),s=t.get(o.IConfigurationService),a=t.get(o.IDisposableRegistry),d=t.get(o.IExtensions),E=t.get(g.IEnvironmentVariablesProvider);let w;function R(){const t=e.getEnvs().filter((e=>C(e))).map((e=>I(e)));return new y.EnvironmentKnownCache(t)}function O(e,t){d.determineExtensionFromCallStack().then((n=>{Math.random()<=.001&&(0,p.sendTelemetryEvent)(h.EventName.PYTHON_ENVIRONMENTS_API,void 0,{apiName:e,extensionId:n.extensionId}),(0,u.traceVerbose)(`Extension ${n.extensionId} accessed ${e} with args: ${JSON.stringify(t)}`)})).ignoreErrors()}a.push(e.onChanged((e=>{var t;const n=null!==(t=e.new)&&void 0!==t?t:e.old;if(n&&C(n))if(w||(w=R()),e.old)if(e.new){const t=I(e.new);w.updateEnv(x(e.old),t),(0,u.traceVerbose)("Python API env change detected",n.id,"update"),S.fire({type:"update",env:t}),(0,f.reportInterpretersChanged)([{path:(0,c.getEnvPath)(e.new.executable.filename,e.new.location).path,type:"update"}])}else{const t=I(e.old);w.updateEnv(t,void 0),(0,u.traceVerbose)("Python API env change detected",n.id,"remove"),S.fire({type:"remove",env:t}),(0,f.reportInterpretersChanged)([{path:(0,c.getEnvPath)(e.old.executable.filename,e.old.location).path,type:"remove"}])}else if(e.new){const t=I(e.new);w.addEnv(t),(0,u.traceVerbose)("Python API env change detected",n.id,"add"),S.fire({type:"add",env:t}),(0,f.reportInterpretersChanged)([{path:(0,c.getEnvPath)(e.new.executable.filename,e.new.location).path,type:"add"}])}})),E.onDidEnvironmentVariablesChange((e=>{_.fire({resource:(0,m.getWorkspaceFolder)(e),env:E.getEnvironmentVariablesSync(e)})})),S,_),w||(w=R());const k={getEnvironmentVariables:e=>(O("getEnvironmentVariables"),e=e&&"uri"in e?e.uri:e,E.getEnvironmentVariablesSync(e)),get onDidEnvironmentVariablesChange(){return O("onDidEnvironmentVariablesChange"),_.event},getActiveEnvironmentPath(e){O("getActiveEnvironmentPath"),e=e&&"uri"in e?e.uri:e;const t=s.getSettings(e).pythonPath;return{id:"python"===t?"DEFAULT_PYTHON":D(t),path:t}},updateActiveEnvironmentPath(e,t){O("updateActiveEnvironmentPath");const i="string"!=typeof e?e.path:e;return t=t&&"uri"in t?t.uri:t,n.update(t,r.ConfigurationTarget.WorkspaceFolder,i)},get onDidChangeActiveEnvironmentPath(){return O("onDidChangeActiveEnvironmentPath"),b.event},resolveEnvironment:async n=>{if(!r.workspace.isTrusted)throw new Error("Not allowed to resolve environment in an untrusted workspace");let o="string"!=typeof n?n.path:n;if(i.basename(o)===o){const e=t.get(l.IPythonExecutionFactory),n=await e.create({pythonPath:o}),r=await n.getExecutablePath().catch((e=>{(0,u.traceError)("Cannot resolve full path",e)}));if(!r)return;o=r}return O("resolveEnvironment",n),async function(e,t){var n,r,i;const o=await t.resolveEnv(e);if(!o)return;const s=T(P(o));return-1!==(null===(n=s.version)||void 0===n?void 0:n.major)&&-1!==(null===(r=s.version)||void 0===r?void 0:r.minor)&&-1!==(null===(i=s.version)||void 0===i?void 0:i.micro)||(0,u.traceError)(`Invalid version for ${e}: ${JSON.stringify(o)}`),s}(o,e)},get known(){return w.envs},async refreshEnvironments(t){r.workspace.isTrusted?(await e.triggerRefresh(void 0,{ifNotTriggerredAlready:!(null==t?void 0:t.forceRefresh)}),O("refreshEnvironments")):(0,u.traceError)("Not allowed to refresh environments in an untrusted workspace")},get onDidChangeEnvironments(){return O("onDidChangeEnvironments"),S.event},...(0,v.buildEnvironmentCreationApi)()};return k},t.convertCompleteEnvInfo=P,t.convertEnvInfo=x},87377:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentKnownCache=void 0,t.EnvironmentKnownCache=class{constructor(e){this._envs=[],this._envs=e}get envs(){return this._envs}addEnv(e){this._envs.find((t=>e.id===t.id))||this._envs.push(e)}updateEnv(e,t){const n=this._envs.findIndex((t=>e.id===t.id));-1!==n&&(void 0===t?this._envs.splice(n,1):this._envs[n]=t)}}},20910:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activateFeatures=t.activateComponents=void 0;const r=n(66828),i=n(76546),o=n(90819),s=n(30086),a=n(77651),c=n(17585),l=n(77570),u=n(34061),d=n(84974),p=n(61684),h=n(3481),f=n(3509),g=n(41691),m=n(18639),v=n(29917),y=n(76687),b=n(43768),S=n(8593),_=n(72392),E=n(94611),w=n(73607),T=n(43200),C=n(59857),P=n(29817),x=n(14306),I=n(54144),R=n(43397),D=n(92378),O=n(56792),k=n(54351),A=n(63369),N=n(5793),M=n(73766),L=n(4867),j=n(51097),F=n(45346);t.activateComponents=async function(e,t,n){const k=await async function(e,t){const{legacyIOC:n}=e,{serviceManager:P,serviceContainer:O}=n,k=P.get(d.IFileSystem);await(0,_.setExtensionInstallTelemetryProperties)(k);const A=P.get(c.IApplicationEnvironment),{enableProposedApi:F}=A.packageJson;P.addSingletonInstance(l.UseProposedApi,F),(0,C.registerTypes)(P),(0,u.registerTypes)(P),(0,w.registerTypes)(P),(0,f.registerTypes)(P),(0,E.registerTypes)(P);const U=O.get(p.IExtensions);await(0,x.setDefaultLanguageServer)(U,P),O.get(p.IConfigurationService).getSettings().register(),(0,s.registerTypes)(P),(0,b.registerTypes)(P),(0,i.registerTypes)(P);const q=P.get(p.IDisposableRegistry),V=O.get(c.IWorkspaceService),H=O.get(c.ICommandManager);if(r.languages.setLanguageConfiguration(l.PYTHON_LANGUAGE,(0,v.getLanguageConfiguration)()),V.isTrusted&&(O.get(m.IInterpreterService).initialize(),!V.isVirtualWorkspace)){const t=P.getAll(D.IDebugSessionEventHandlers);new R.DebugSessionEventDispatcher(t,I.DebugService.instance,q).registerEventHandlers();const n=P.get(p.ILogOutputChannel);q.push(H.registerCommand(l.Commands.ViewOutput,(()=>n.show()))),H.executeCommand("setContext","python.vscode.channel",A.channel).then(h.noop,h.noop),O.get(a.IApplicationDiagnostics).register(),P.get(T.ITerminalAutoActivation).register(),P.get(T.ICodeExecutionManager).registerCommands(),q.push(new y.ReplProvider(O));const i=new S.TerminalProvider(O);i.initialize(r.window.activeTerminal).ignoreErrors(),O.getAll(g.IDebugConfigurationService).forEach((e=>{q.push(r.debug.registerDebugConfigurationProvider(j.DebuggerTypeName,e))})),q.push(i),(0,L.logAndNotifyOnLegacySettings)(),(0,N.registerCreateEnvironmentTriggers)(q),(0,M.initializePersistentStateForTriggers)(e.context)}const W=O.get(o.IExtensionActivationManager);return q.push(W),{fullyReady:W.activate(t)}}(e,n);if(!(new O.WorkspaceService).isTrusted)return[k];const A=[P.activate(t.pythonEnvs,e)];return Promise.all([k,...A])},t.activateFeatures=function(e,t){const n=e.legacyIOC.serviceContainer.get(k.IInterpreterQuickPick),r=e.legacyIOC.serviceContainer.get(p.IInterpreterPathService),i=e.legacyIOC.serviceContainer.get(m.IInterpreterService),o=e.legacyIOC.serviceContainer.get(p.IPathUtils);(0,A.registerAllCreateEnvironmentFeatures)(e.disposables,n,r,i,o),(0,F.registerReplCommands)(e.disposables,i),(0,F.registerReplExecuteOnEnter)(e.disposables,i)}},63912:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeComponents=t.initializeStandard=t.initializeGlobals=void 0;const r=n(86700),i=n(66828),o=n(74351),s=n(29992),a=n(52615),c=n(39702),l=n(51863),u=n(61684),d=n(28285),p=n(67098),h=n(61466),f=n(37104),g=n(77498),m=n(29817),v=n(19735),y=n(4247),b=n(56792);t.initializeGlobals=function(e){const t=e.subscriptions,n=new r.Container({skipBaseClassChecks:!0}),s=new f.ServiceManager(n),a=new h.ServiceContainer(n);s.addSingletonInstance(g.IServiceContainer,a),s.addSingletonInstance(g.IServiceManager,s),s.addSingletonInstance(u.IDisposableRegistry,t),s.addSingletonInstance(u.IMemento,e.globalState,u.GLOBAL_MEMENTO),s.addSingletonInstance(u.IMemento,e.workspaceState,u.WORKSPACE_MEMENTO),s.addSingletonInstance(u.IExtensionContext,e);const c=i.window.createOutputChannel(p.OutputChannelNames.python,{log:!0});t.push(c),t.push((0,v.registerLogger)(new y.OutputChannelLogger(c)));const l=new b.WorkspaceService,d=l.isVirtualWorkspace||!l.isTrusted?(0,o.instance)((0,o.mock)()):i.window.createOutputChannel(p.OutputChannelNames.pythonTest);return t.push(d),s.addSingletonInstance(u.ILogOutputChannel,c),s.addSingletonInstance(u.ITestOutputChannel,d),{context:e,disposables:t,legacyIOC:{serviceManager:s,serviceContainer:a}}},t.initializeStandard=function(e){const{serviceManager:t}=e.legacyIOC;(0,c.registerTypes)(t),(0,d.registerTypes)(t),(0,s.registerTypes)(t),(0,a.registerTypes)(t),(0,l.registerTypes)(t)},t.initializeComponents=async function(e){return{pythonEnvs:await m.initialize(e)}}},94144:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentActivationService=t.EnvironmentActivationServiceCache=t.defaultShells=void 0,n(32727);const o=n(71017),s=n(86700),a=n(17585),c=n(77570),l=n(84974),u=n(4057),d=n(29983),p=n(58400),h=n(61684),f=n(59314),g=n(35144),m=n(87450),v=n(19909),y=n(81387),b=n(54813),S=n(61522),_=n(18639),E=n(49903),w=n(19735),T=n(75470),C=n(70057),P=n(89465),x=n(47237),I=n(36952),R="e8b39361-0157-4923-80e1-22d70d46dee6";t.defaultShells={[m.OSType.Windows]:{shell:"cmd",shellType:p.TerminalShellType.commandPrompt},[m.OSType.OSX]:{shell:"bash",shellType:p.TerminalShellType.bash},[m.OSType.Linux]:{shell:"bash",shellType:p.TerminalShellType.bash},[m.OSType.Unknown]:void 0};const D=["The process cannot access the file because it is being used by another process","The directory is not empty"];class O{constructor(){this.normalMap=new Map}static forceUseStatic(){O.useStatic=!0}static forceUseNormal(){O.useStatic=!1}get(e){return O.useStatic?O.staticMap.get(e):this.normalMap.get(e)}set(e,t){O.useStatic?O.staticMap.set(e,t):this.normalMap.set(e,t)}delete(e){O.useStatic?O.staticMap.delete(e):this.normalMap.delete(e)}clear(){O.useStatic||this.normalMap.clear()}}t.EnvironmentActivationServiceCache=O,O.useStatic=!1,O.staticMap=new Map;let k=class{constructor(e,t,n,r,i,o,s){this.helper=e,this.platform=t,this.processServiceFactory=n,this.currentProcess=r,this.workspace=i,this.interpreterService=o,this.envVarsService=s,this.disposables=[],this.activatedEnvVariablesCache=new O,this.envVarsService.onDidEnvironmentVariablesChange((()=>this.activatedEnvVariablesCache.clear()),this,this.disposables)}dispose(){this.disposables.forEach((e=>e.dispose()))}async getActivatedEnvironmentVariables(e,t,n,r){var i;const o=new C.StopWatch,s=this.workspace.getWorkspaceFolderIdentifier(e);t=null!=t?t:await this.interpreterService.getActiveInterpreter(e);const a=`${s}_${this.platform.isWindows?null==t?void 0:t.path.toLowerCase():null==t?void 0:t.path}_${r}`;if(null===(i=this.activatedEnvVariablesCache.get(a))||void 0===i?void 0:i.hasData)return this.activatedEnvVariablesCache.get(a).data;const c=new g.InMemoryCache(6e5);return this.getActivatedEnvironmentVariablesImpl(e,t,n,r).then((e=>(c.data=e,this.activatedEnvVariablesCache.set(a,c),(0,b.sendTelemetryEvent)(S.EventName.PYTHON_INTERPRETER_ACTIVATION_ENVIRONMENT_VARIABLES,o.elapsedTime,{failed:!1}),e))).catch((e=>{throw(0,b.sendTelemetryEvent)(S.EventName.PYTHON_INTERPRETER_ACTIVATION_ENVIRONMENT_VARIABLES,o.elapsedTime,{failed:!0}),e}))}async getProcessEnvironmentVariables(e,t){const n=this.interpreterService.getInterpreters().filter((e=>!y.virtualEnvTypes.includes(e.envType))),r=n.length>0&&n[0]?n[0].path:"python";try{const[n,i]=u.printEnvVariables();n.forEach(((e,t)=>{n[t]=e.toCommandArgumentForPythonExt()}));const o=`${r} ${n.join(" ")}`,s=await this.processServiceFactory.create(e,{doNotUseCustomEnvs:!0}),a=await s.shellExec(o,{shell:t,timeout:3e4,maxBuffer:1e6,throwOnStdErr:!1}),c=this.parseEnvironmentOutput(a.stdout,i);return null!=c?c:process.env}catch(e){return process.env}}async getEnvironmentActivationShellCommands(e,n){const r=t.defaultShells[this.platform.osType];return r?this.helper.getEnvironmentActivationShellCommands(e,r.shellType,n):[]}async getActivatedEnvironmentVariablesImpl(e,n,r,i){var s,a;let l=t.defaultShells[this.platform.osType];if(l){i&&(l={shellType:(0,P.identifyShellFromShellPath)(i),shell:i});try{const t=await this.processServiceFactory.create(e),r=null!==(s=await this.envVarsService.getEnvironmentVariables(e))&&void 0!==s?s:{},h=Object.keys(r).length?r:{...this.currentProcess.env};let g;const[m,v]=u.printEnvVariables();if(m.forEach(((e,t)=>{m[t]=e.toCommandArgumentForPythonExt()})),(null==n?void 0:n.envType)===y.EnvironmentType.Conda){const e=await T.Conda.getConda(i),t=await(null==e?void 0:e.getRunPythonArgs({name:n.envName,prefix:null!==(a=n.envPath)&&void 0!==a?a:""}));t&&(g=[...t,...m].map((e=>e.toCommandArgumentForPythonExt())).join(" "))}if(!g){const t=await this.helper.getEnvironmentActivationShellCommands(e,l.shellType,n);if((0,w.traceVerbose)(`Activation Commands received ${t} for shell ${l.shell}, resource ${null==e?void 0:e.fsPath} and interpreter ${null==n?void 0:n.path}`),!t||!Array.isArray(t)||0===t.length){if(n&&[y.EnvironmentType.Venv,y.EnvironmentType.Pyenv].includes(null==n?void 0:n.envType)){const e=(0,x.getSearchPathEnvVarNames)()[0];return h[e]?h[e]=`${o.dirname(n.path)}${o.delimiter}${h[e]}`:h[e]=`${o.dirname(n.path)}`,h}return}const r=[p.TerminalShellType.powershell,p.TerminalShellType.powershellCore].includes(l.shellType)?";":"&&";g=`${(d=t,d.map((e=>e.replace(/^source\s+/,". ")))).join(` ${r} `)} ${r} echo '${R}' ${r} python ${m.join(" ")}`}const b=h[c.PYTHON_WARNINGS];let S;h[c.PYTHON_WARNINGS]="ignore",(0,w.traceVerbose)(`Activating Environment to capture Environment variables, ${g}`);let _,E=1;for(;!S;)try{S=await t.shellExec(g,{env:h,shell:l.shell,timeout:(null==n?void 0:n.envType)===y.EnvironmentType.Conda?6e4:3e4,maxBuffer:1e6,throwOnStdErr:!1});try{_=this.parseEnvironmentOutput(S.stdout,v)}catch(e){if(!S.stderr)throw e}if(S.stderr){if(!_)throw new Error(`StdErr from ShellExec, ${S.stderr} for ${g}`);if((0,w.traceWarn)("Got env variables but with errors",S.stderr,_),S.stderr.includes("running scripts is disabled")||S.stderr.includes("FullyQualifiedErrorId : UnauthorizedAccess"))throw new Error(`Skipping returned result when powershell execution is disabled, stderr ${S.stderr} for ${g}`)}}catch(e){const t=e.toString();if(!(D.find((e=>t.includes(e)))&&E<10))throw e;(0,w.traceInfo)("Conda is busy, attempting to retry ..."),S=void 0,E+=1,await(0,f.sleep)(500)}return b&&_?_[c.PYTHON_WARNINGS]=b:_&&delete _[c.PYTHON_WARNINGS],_}catch(e){if((0,w.traceError)("getActivatedEnvironmentVariables",e),(0,b.sendTelemetryEvent)(S.EventName.ACTIVATE_ENV_TO_GET_ENV_VARS_FAILED,void 0,{isPossiblyCondaEnv:(null==n?void 0:n.envType)===y.EnvironmentType.Conda,terminal:l.shellType}),r)throw e}var d}}parseEnvironmentOutput(e,t){return-1===e.indexOf(R)?t(e):t((e=e.substring(e.indexOf(R)+R.length)).substring(e.indexOf("{")).trim())}};r([(0,w.traceDecoratorVerbose)("getActivatedEnvironmentVariables",E.TraceOptions.Arguments)],k.prototype,"getActivatedEnvironmentVariables",null),r([(0,I.cache)(-1,!0)],k.prototype,"getProcessEnvironmentVariables",null),r([(0,w.traceDecoratorError)("Failed to parse Environment variables"),(0,w.traceDecoratorVerbose)("parseEnvironmentOutput",E.TraceOptions.None)],k.prototype,"parseEnvironmentOutput",null),k=r([(0,s.injectable)(),i(0,(0,s.inject)(p.ITerminalHelper)),i(1,(0,s.inject)(l.IPlatformService)),i(2,(0,s.inject)(d.IProcessServiceFactory)),i(3,(0,s.inject)(h.ICurrentProcess)),i(4,(0,s.inject)(a.IWorkspaceService)),i(5,(0,s.inject)(_.IInterpreterService)),i(6,(0,s.inject)(v.IEnvironmentVariablesProvider))],k),t.EnvironmentActivationService=k},80351:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IEnvironmentActivationService=void 0,t.IEnvironmentActivationService=Symbol("IEnvironmentActivationService")},20741:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterAutoSelectionService=void 0;const o=n(86700),s=n(66828),a=n(17585),c=n(60717);n(32727);const l=n(84974),u=n(61684),d=n(59314),p=n(95084),h=n(44538),f=n(54813),g=n(61522),m=n(54351),v=n(18639),y=n(87282),b="preferredGlobalPyInterpreter";let S=class{constructor(e,t,n,r,i,o,a,c){this.workspaceService=e,this.stateFactory=t,this.fs=n,this.interpreterService=r,this.envTypeComparer=i,this.interpreterHelper=a,this.experimentService=c,this.autoSelectedWorkspacePromises=new Map,this.didAutoSelectedInterpreterEmitter=new s.EventEmitter,this.autoSelectedInterpreterByWorkspace=new Map,this.globallyPreferredInterpreter=this.stateFactory.createGlobalPersistentState(b,void 0),o.registerInstance(this)}async autoSelectInterpreter(e){const t=this.getWorkspacePathKey(e),n=this.autoSelectedWorkspacePromises.has(t);if(!n){const n=(0,d.createDeferred)();this.autoSelectedWorkspacePromises.set(t,n),await this.initializeStore(e),await this.clearWorkspaceStoreIfInvalid(e),await this.autoselectInterpreterWithLocators(e),n.resolve()}return(0,f.sendTelemetryEvent)(g.EventName.PYTHON_INTERPRETER_AUTO_SELECTION,void 0,{useCachedInterpreter:n}),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 n=this.getWorkspacePathKey(e);return this.autoSelectedInterpreterByWorkspace.has(n)?this.autoSelectedInterpreterByWorkspace.get(n):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 n=this.getWorkspacePathKey(e);if(""===n){if(this.globallyPreferredInterpreter.value&&this.globallyPreferredInterpreter.value.version&&t&&t.version&&(0,p.compareSemVerLikeVersions)(this.globallyPreferredInterpreter.value.version,t.version)>0)return;await this.globallyPreferredInterpreter.updateValue(t),this.autoSelectedInterpreterByWorkspace.set(n,t)}else{const r=this.getWorkspaceState(e);r&&t&&await r.updateValue(t),this.autoSelectedInterpreterByWorkspace.set(n,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(b,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),n=`autoSelectionInterpretersQueried-${(null==t?void 0:t.folderUri.fsPath)||"global"}`;return this.stateFactory.createWorkspacePersistentState(n,void 0)}getAutoSelectionQueriedOnceState(){return this.stateFactory.createGlobalPersistentState("autoSelectionInterpretersQueriedOnce",void 0)}async autoselectInterpreterWithLocators(e){const t=this.getAutoSelectionInterpretersQueryState(e),n=this.getAutoSelectionQueriedOnceState();n.value&&!0!==t.value&&e&&await this.interpreterService.triggerRefresh({searchLocations:{roots:[e],doNotIncludeNonRooted:!0}}),await this.envTypeComparer.initialize(e);const r=this.experimentService.inExperimentSync(c.DiscoveryUsingWorkers.experiment),i=this.interpreterHelper.getActiveWorkspaceUri(e);let o;if(r){n.value||await this.interpreterService.getRefreshPromise({stage:h.ProgressReportStage.allPathsDiscovered});let t=this.interpreterService.getInterpreters(e);o=this.envTypeComparer.getRecommended(t,null==i?void 0:i.folderUri),(o?await this.interpreterService.getInterpreterDetails(o.path):void 0)&&o||(await this.interpreterService.refreshPromise,t=this.interpreterService.getInterpreters(e),o=this.envTypeComparer.getRecommended(t,null==i?void 0:i.folderUri))}else{n.value||await this.interpreterService.refreshPromise;const t=this.interpreterService.getInterpreters(e);o=this.envTypeComparer.getRecommended(t,null==i?void 0:i.folderUri)}o&&(i?this.setWorkspaceInterpreter(i.folderUri,o):this.setGlobalInterpreter(o),t.updateValue(!0),n.updateValue(!0),this.didAutoSelectedInterpreterEmitter.fire())}};S=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IWorkspaceService)),i(1,(0,o.inject)(u.IPersistentStateFactory)),i(2,(0,o.inject)(l.IFileSystem)),i(3,(0,o.inject)(v.IInterpreterService)),i(4,(0,o.inject)(m.IInterpreterComparer)),i(5,(0,o.inject)(y.IInterpreterAutoSelectionProxyService)),i(6,(0,o.inject)(v.IInterpreterHelper)),i(7,(0,o.inject)(u.IExperimentService))],S),t.InterpreterAutoSelectionService=S},45297:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterAutoSelectionProxyService=void 0;const o=n(86700),s=n(66828),a=n(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=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IDisposableRegistry))],c),t.InterpreterAutoSelectionProxyService=c},87282:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AutoSelectionRule=t.IInterpreterAutoSelectionService=t.IInterpreterAutoSelectionProxyService=void 0,t.IInterpreterAutoSelectionProxyService=Symbol("IInterpreterAutoSelectionProxyService"),t.IInterpreterAutoSelectionService=Symbol("IInterpreterAutoSelectionService"),(n=t.AutoSelectionRule||(t.AutoSelectionRule={})).all="all",n.currentPath="currentPath",n.workspaceVirtualEnvs="workspaceEnvs",n.settings="settings",n.cachedInterpreters="cachedInterpreters",n.systemWide="system",n.windowsRegistry="windowsRegistry"},95356:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvLocationHeuristic=t.isProblematicCondaEnvironment=t.EnvironmentTypeComparer=t.EnvLocationHeuristic=void 0;const o=n(86700),s=n(87450),a=n(42694),c=n(37769),l=n(81387),u=n(18639),d=n(77826),p=n(48431);var h;!function(e){e[e.Local=1]="Local",e[e.Global=2]="Global"}(h=t.EnvLocationHeuristic||(t.EnvLocationHeuristic={}));let f=class{constructor(e){var t,n;this.interpreterHelper=e,this.preferredPyenvInterpreterPath=new Map,this.workspaceFolderPath=null!==(n=null===(t=this.interpreterHelper.getActiveWorkspaceUri(void 0))||void 0===t?void 0:t.folderUri.fsPath)&&void 0!==n?n:""}compare(e,t){if(v(e))return 1;if(v(t))return-1;const n=function(e,t,n){const r=y(e,n),i=y(t,n);return Math.sign(r-i)}(e,t,this.workspaceFolderPath);if(0!==n)return n;if(e.envType===l.EnvironmentType.Pyenv&&t.envType===l.EnvironmentType.Pyenv){const n=this.preferredPyenvInterpreterPath.get(this.workspaceFolderPath);if(n){if((0,p.arePathsSame)(n,t.path))return 1;if((0,p.arePathsSame)(n,e.path))return-1}}const r=function(e,t){if(!e.type&&!t.type)return e.envType===l.EnvironmentType.Pyenv&&t.envType!==l.EnvironmentType.Pyenv?-1:e.envType!==l.EnvironmentType.Pyenv&&t.envType===l.EnvironmentType.Pyenv?1:0;const n=[l.EnvironmentType.Poetry,l.EnvironmentType.Pipenv,l.EnvironmentType.VirtualEnvWrapper,l.EnvironmentType.Hatch,l.EnvironmentType.Venv,l.EnvironmentType.VirtualEnv,l.EnvironmentType.ActiveState,l.EnvironmentType.Conda,l.EnvironmentType.Pyenv,l.EnvironmentType.MicrosoftStore,l.EnvironmentType.Global,l.EnvironmentType.System,l.EnvironmentType.Unknown];return Math.sign(n.indexOf(e.envType)-n.indexOf(t.envType))}(e,t);if(0!==r)return r;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(m(e))return 1;if(m(t))return-1;const o=g(e,this.interpreterHelper),s=g(t,this.interpreterHelper);return o===s?0:o>s?1:-1}async initialize(e){const t=this.interpreterHelper.getActiveWorkspaceUri(e),n=null==t?void 0:t.folderUri.fsPath;if(!n)return;const r=await(0,d.getActivePyenvForDirectory)(n);this.preferredPyenvInterpreterPath.set(n,r)}getRecommended(e,t){const n=this.interpreterHelper.getActiveWorkspaceUri(t),r=e.filter((e=>{var t;return!(v(e)||!(e.envType!==l.EnvironmentType.ActiveState||e.path&&n&&(0,a.isActiveStateEnvironmentForWorkspace)(e.path,n.folderUri.fsPath))||y(e,(null==n?void 0:n.folderUri.fsPath)||"")!==h.Local&&(!l.workspaceVirtualEnvTypes.includes(e.envType)&&l.virtualEnvTypes.includes(e.envType)||2===(null===(t=e.version)||void 0===t?void 0:t.major)))}));return r.sort(this.compare.bind(this)),r.length?r[0]:void 0}};function g(e,t){const n=[],r=[];if(e.version&&n.push(e.version.raw),e.architecture&&n.push(function(e){switch(e){case s.Architecture.x64:return"x64";case s.Architecture.x86:return"x86";default:return""}}(e.architecture)),e.companyDisplayName&&e.companyDisplayName.length>0?n.push(e.companyDisplayName.trim()):n.push("Python"),e.envType){const n=t.getInterpreterTypeDisplayName(e.envType);n&&r.push(n)}e.envName&&e.envName.length>0&&r.push(e.envName);const i=0===r.length?"":`(${r.join(": ")})`;return`${n.join(" ")} ${i}`.trim()}function m(e){return e.envType===l.EnvironmentType.Conda&&("base"===e.envName||"miniconda"===e.envName)}function v(e){return e.envType===l.EnvironmentType.Conda&&"python"===e.path}function y(e,t){return t.length>0&&(e.envPath&&(0,c.isParentPath)(e.envPath,t)||e.path&&(0,c.isParentPath)(e.path,t))?h.Local:h.Global}f=r([(0,o.injectable)(),i(0,(0,o.inject)(u.IInterpreterHelper))],f),t.EnvironmentTypeComparer=f,t.isProblematicCondaEnvironment=v,t.getEnvLocationHeuristic=y},74326:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseInterpreterSelectorCommand=void 0;const o=n(86700),s=n(71017),a=n(66828),c=n(67098);let l=class{constructor(e,t,n,r,i,o){this.pythonPathUpdaterService=e,this.commandManager=t,this.applicationShell=n,this.workspaceService=r,this.pathUtils=i,this.configurationService=o,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0},this.disposables=[],this.disposables.push(this)}dispose(){this.disposables.forEach((e=>e.dispose()))}async getConfigTargets(e){const t=this.workspaceService.workspaceFolders;if(void 0===t||0===t.length)return[{folderUri:void 0,configTarget:a.ConfigurationTarget.Global}];if(1===t.length)return[{folderUri:t[0].uri,configTarget:a.ConfigurationTarget.WorkspaceFolder}];let n=(null==e?void 0:e.resetTarget)?[{label:c.Common.clearAll}]:[];n.push(...t.map((e=>{const t=this.pathUtils.getDisplayName(this.configurationService.getSettings(e.uri).pythonPath,e.uri.fsPath);return{label:e.name,description:this.pathUtils.getDisplayName(s.dirname(e.uri.fsPath)),uri:e.uri,detail:t}})),{label:(null==e?void 0:e.resetTarget)?c.Interpreters.clearAtWorkspace:c.Interpreters.entireWorkspace,uri:t[0].uri});const r=await this.applicationShell.showQuickPick(n,{placeHolder:(null==e?void 0:e.resetTarget)?"Select the workspace folder to clear the interpreter for":"Select the workspace folder to set the interpreter"});return(null==r?void 0:r.label)===c.Common.clearAll?[...t.map((e=>({folderUri:e.uri,configTarget:a.ConfigurationTarget.WorkspaceFolder}))),{folderUri:t[0].uri,configTarget:a.ConfigurationTarget.Workspace}]:r?r.label===c.Interpreters.entireWorkspace||r.label===c.Interpreters.clearAtWorkspace?[{folderUri:r.uri,configTarget:a.ConfigurationTarget.Workspace}]:[{folderUri:r.uri,configTarget:a.ConfigurationTarget.WorkspaceFolder}]:void 0}};l=r([(0,o.injectable)(),i(0,(0,o.unmanaged)()),i(1,(0,o.unmanaged)()),i(2,(0,o.unmanaged)()),i(3,(0,o.unmanaged)()),i(4,(0,o.unmanaged)()),i(5,(0,o.unmanaged)())],l),t.BaseInterpreterSelectorCommand=l},89294:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstallPythonCommand=void 0;const o=n(86700),s=n(56994),a=n(17585),c=n(91932),l=n(77570),u=n(61684),d=n(84974);let p=class{constructor(e,t,n,r,i){this.commandManager=e,this.contextManager=t,this.browserService=n,this.platformService=r,this.disposables=i,this.supportedWorkspaceTypes={untrustedWorkspace:!0,virtualWorkspace:!1}}async activate(){this.disposables.push(this.commandManager.registerCommand(l.Commands.InstallPython,(()=>this._installPython())))}async _installPython(){this.platformService.isWindows&&(await this.platformService.getVersion()).major>8?this.browserService.launch("ms-windows-store://pdp/?ProductId=9NRWMJP3717K"):this.showInstallPythonTile()}showInstallPythonTile(){let e;this.contextManager.setContext(s.ExtensionContextKey.showInstallPythonTile,!0),e=this.platformService.isWindows?c.PythonWelcome.windowsInstallId:this.platformService.isLinux?c.PythonWelcome.linuxInstallId:c.PythonWelcome.macOSInstallId,this.commandManager.executeCommand("workbench.action.openWalkthrough",{category:`${l.PVSC_EXTENSION_ID}#${c.PythonWelcome.name}`,step:`${l.PVSC_EXTENSION_ID}#${c.PythonWelcome.name}#${e}`},!1)}};p=r([(0,o.injectable)(),i(0,(0,o.inject)(a.ICommandManager)),i(1,(0,o.inject)(a.IContextKeyManager)),i(2,(0,o.inject)(u.IBrowserService)),i(3,(0,o.inject)(d.IPlatformService)),i(4,(0,o.inject)(u.IDisposableRegistry))],p),t.InstallPythonCommand=p},65313:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstallPythonViaTerminal=void 0;const o=n(86700),s=n(77570),a=n(61684),c=n(17585),l=n(59314),u=n(87450),d=n(19735),p=n(67098);var h;!function(e){e.brew="brew",e.apt="apt",e.dnf="dnf"}(h||(h={}));let f=class{constructor(e,t,n){this.commandManager=e,this.terminalManager=t,this.disposables=n,this.supportedWorkspaceTypes={untrustedWorkspace:!0,virtualWorkspace:!1},this.packageManagerCommands={brew:["brew install python3"],dnf:["sudo dnf install python3"],apt:["sudo apt-get update","sudo apt-get install python3 python3-venv python3-pip"]}}async activate(){this.disposables.push(this.commandManager.registerCommand(s.Commands.InstallPythonOnMac,(()=>this._installPythonOnUnix(u.OSType.OSX)))),this.disposables.push(this.commandManager.registerCommand(s.Commands.InstallPythonOnLinux,(()=>this._installPythonOnUnix(u.OSType.Linux))))}async _installPythonOnUnix(e){const t=await this.getCommands(e),n=e===u.OSType.OSX?p.Interpreters.installPythonTerminalMacMessage:p.Interpreters.installPythonTerminalMessageLinux,r=this.terminalManager.createTerminal({name:"Python",message:t.length?void 0:n});r.show(!0),await async function(){await(0,l.sleep)(100)}();for(const e of t)r.sendText(e),await m()}async getCommands(e){if(e===u.OSType.OSX)return this.getCommandsForPackageManagers([h.brew]);if(e===u.OSType.Linux)return this.getCommandsForPackageManagers([h.apt,h.dnf]);throw new Error("OS not supported")}async getCommandsForPackageManagers(e){for(const t of e)if(await g(t))return this.packageManagerCommands[t];return[]}};async function g(e){try{const t=n(22806),r=await t(e);return(0,d.traceVerbose)(`Resolved path to ${e} module:`,r),r.trim().length>0}catch(t){return(0,d.traceVerbose)(`${e} not found`,t),!1}}async function m(){await(0,l.sleep)(500)}f=r([(0,o.injectable)(),i(0,(0,o.inject)(c.ICommandManager)),i(1,(0,o.inject)(c.ITerminalManager)),i(2,(0,o.inject)(a.IDisposableRegistry))],f),t.InstallPythonViaTerminal=f},90780:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ResetInterpreterCommand=void 0;const o=n(86700),s=n(17585),a=n(77570),c=n(61684),l=n(54351),u=n(74326);let d=class extends u.BaseInterpreterSelectorCommand{constructor(e,t,n,r,i,o){super(e,t,n,r,i,o)}async activate(){this.disposables.push(this.commandManager.registerCommand(a.Commands.ClearWorkspaceInterpreter,this.resetInterpreter.bind(this)))}async resetInterpreter(){const e=await this.getConfigTargets({resetTarget:!0});e&&await Promise.all(e.map((async e=>{const t=e.configTarget,n=e.folderUri;await this.pythonPathUpdaterService.updatePythonPath(void 0,t,"ui",n)})))}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(l.IPythonPathUpdaterServiceManager)),i(1,(0,o.inject)(s.ICommandManager)),i(2,(0,o.inject)(s.IApplicationShell)),i(3,(0,o.inject)(s.IWorkspaceService)),i(4,(0,o.inject)(c.IPathUtils)),i(5,(0,o.inject)(c.IConfigurationService))],d),t.ResetInterpreterCommand=d},50902:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SetInterpreterCommand=t.EnvGroups=void 0;const o=n(86700),s=n(96486),a=n(71017),c=n(66828),l=n(17585),u=n(77570),d=n(48431),p=n(84974),h=n(61684),f=n(67098),g=n(3481),m=n(22207),v=n(48683),y=n(81387),b=n(54813),S=n(61522),_=n(18639),E=n(95356),w=n(54351),T=n(74326),C=n(58967);function P(e){return"interpreter"in e}function x(e){return"alwaysShow"in e}function I(e){return"kind"in e&&e.kind===c.QuickPickItemKind.Separator}var R;!function(e){e.Workspace=f.InterpreterQuickPickList.workspaceGroupName,e.Conda="Conda",e.Global=f.InterpreterQuickPickList.globalGroupName,e.VirtualEnv="VirtualEnv",e.PipEnv="PipEnv",e.Pyenv="Pyenv",e.Venv="Venv",e.Poetry="Poetry",e.Hatch="Hatch",e.VirtualEnvWrapper="VirtualEnvWrapper",e.ActiveState="ActiveState",e.Recommended=f.Common.recommended}(R=t.EnvGroups||(t.EnvGroups={}));let D=class extends T.BaseInterpreterSelectorCommand{constructor(e,t,n,r,i,o,s,a,l,d){super(n,i,e,l,t,r),this.multiStepFactory=o,this.platformService=s,this.interpreterSelector=a,this.interpreterService=d,this.createEnvironmentSuggestion={label:`${u.Octicons.Add} ${f.InterpreterQuickPickList.create.label}`,alwaysShow:!0},this.manualEntrySuggestion={label:`${u.Octicons.Folder} ${f.InterpreterQuickPickList.enterPath.label}`,alwaysShow:!0},this.refreshButton={iconPath:new c.ThemeIcon(u.ThemeIcons.Refresh),tooltip:f.InterpreterQuickPickList.refreshInterpreterList},this.noPythonInstalled={label:`${u.Octicons.Error} ${f.InterpreterQuickPickList.noPythonInstalled}`,detail:f.InterpreterQuickPickList.clickForInstructions,alwaysShow:!0},this.wasNoPythonInstalledItemClicked=!1,this.tipToReloadWindow={label:`${u.Octicons.Lightbulb} Reload the window if you installed Python but don't see it`,detail:"Click to run `Developer: Reload Window` command",alwaysShow:!0}}async activate(){this.disposables.push(this.commandManager.registerCommand(u.Commands.Set_Interpreter,this.setInterpreter.bind(this)))}async _pickInterpreter(e,t,n,r){var i,o;const s=!!this.interpreterService.refreshPromise,a=this._getItems(t.workspace,n,r);t.path=void 0;const l=this.pathUtils.getDisplayName(this.configurationService.getSettings(t.workspace).pythonPath,t.workspace?t.workspace.fsPath:void 0),d=null===(null==r?void 0:r.placeholder)?void 0:null!==(i=null==r?void 0:r.placeholder)&&void 0!==i?i:c.l10n.t("Selected Interpreter: {0}",l),p=null===(null==r?void 0:r.title)?void 0:null!==(o=null==r?void 0:r.title)&&void 0!==o?o:f.InterpreterQuickPickList.browsePath.openButtonLabel,h=[{button:this.refreshButton,callback:e=>{this.refreshCallback(e,{isButton:!0,showBackButton:null==r?void 0:r.showBackButton})}}];(null==r?void 0:r.showBackButton)&&h.push({button:c.QuickInputButtons.Back,callback:()=>{}});const m=await e.showQuickPick({placeholder:d,items:a,sortByLabel:!s,keepScrollPosition:!0,activeItem:e=>this.getActiveItem(t.workspace,e),matchOnDetail:!0,matchOnDescription:!0,title:p,customButtonSetups:h,initialize:e=>{0===this.interpreterService.getInterpreters().length?this.refreshCallback(e,{showBackButton:null==r?void 0:r.showBackButton}):this.refreshCallback(e,{ifNotTriggerredAlready:!0,showBackButton:null==r?void 0:r.showBackButton})},onChangeItem:{event:this.interpreterService.onDidChangeInterpreters,callback:(e,i)=>{this.interpreterService.refreshPromise&&(i.busy=!0,this.interpreterService.refreshPromise.then((()=>{i.busy=!1,this.updateQuickPickItems(i,{},t.workspace,n,r)}))),this.updateQuickPickItems(i,e,t.workspace,n,r)}}});if(void 0===m)(0,b.sendTelemetryEvent)(S.EventName.SELECT_INTERPRETER_SELECTED,void 0,{action:"escape"});else{if(m.label===this.manualEntrySuggestion.label)return(0,b.sendTelemetryEvent)(S.EventName.SELECT_INTERPRETER_ENTER_OR_FIND),this._enterOrBrowseInterpreterPath.bind(this);m.label===this.createEnvironmentSuggestion.label?this.commandManager.executeCommand(u.Commands.Create_Environment,{showBackButton:!1,selectEnvironment:!0}).then(g.noop,g.noop):m.label===this.noPythonInstalled.label?(this.commandManager.executeCommand(u.Commands.InstallPython).then(g.noop,g.noop),this.wasNoPythonInstalledItemClicked=!0):m.label===this.tipToReloadWindow.label?this.commandManager.executeCommand("workbench.action.reloadWindow").then(g.noop,g.noop):((0,b.sendTelemetryEvent)(S.EventName.SELECT_INTERPRETER_SELECTED,void 0,{action:"selected"}),t.path=m.path)}}_getItems(e,t,n){const r=[];(null==n?void 0:n.showCreateEnvironment)&&r.push(this.createEnvironmentSuggestion,{label:"",kind:c.QuickPickItemKind.Separator}),r.push(this.manualEntrySuggestion,{label:"",kind:c.QuickPickItemKind.Separator});const i=this.getDefaultInterpreterPathSuggestion(e);i&&r.push(i);const o=this.getSuggestions(e,t,n);return this.finalizeItems(o,e,n),r.push(...o),r}getSuggestions(e,t,n){var r;const i=this.workspaceService.getWorkspaceFolder(e),o=this.interpreterSelector.getSuggestions(e,!!this.interpreterService.refreshPromise).filter((e=>!t||t(e.interpreter)));if(this.interpreterService.refreshPromise)return o;const s=this.interpreterSelector.getSuggestions(e,!0).filter((e=>!t||t(e.interpreter)));let a;return(null==n?void 0:n.skipRecommended)||(a=this.interpreterSelector.getRecommendedSuggestion(s,null===(r=this.workspaceService.getWorkspaceFolder(e))||void 0===r?void 0:r.uri)),a&&o[0].interpreter.id===a.interpreter.id&&o.shift(),function(e,t,n){const r=[];t&&r.push({label:R.Recommended,kind:c.QuickPickItemKind.Separator},t);let i=R.Recommended;for(const t of e)i=O(r,t,n,i),r.push(t);return r}(o,a,null==i?void 0:i.uri.fsPath)}async getActiveItem(e,t){const n=await this.interpreterService.getActiveInterpreter(e),r=t.items,i=r.find((e=>P(e)&&e.interpreter.id===(null==n?void 0:n.id)));if(i)return i;const o=r.find((e=>P(e)));if(o)return o;const s=r.find((e=>x(e)&&e.label===this.noPythonInstalled.label));return null!=s?s:r[0]}getDefaultInterpreterPathSuggestion(e){const t=this.workspaceService.getConfiguration("python",e),n=new v.SystemVariables(e,void 0,this.workspaceService).resolveAny(t.get("defaultInterpreterPath"));if(n&&"python"!==n)return{label:`${u.Octicons.Gear} ${f.InterpreterQuickPickList.defaultInterpreterPath.label}`,description:this.pathUtils.getDisplayName(n,e?e.fsPath:void 0),path:n,alwaysShow:!0}}updateQuickPickItems(e,t,n,r,i){const o=e.activeItems.length>0?e.activeItems[0]:void 0;e.items=this.getUpdatedItems(e.items,t,n,r,i);const s=o?e.items.find((e=>P(e)&&P(o)?e.interpreter.id===o.interpreter.id:!(!x(e)||!x(o))&&e.label===o.label)):void 0;s&&(e.activeItems=[s])}getUpdatedItems(e,t,n,r,i){var o,s;const a=[...e.values()],c=e.find((e=>I(e))),l=null!==(o=t.old)&&void 0!==o?o:t.new;r&&t.new&&!r(t.new)&&(t.new=void 0);let u=-1;if(l&&(u=a.findIndex((e=>P(e)&&e.interpreter.id===l.id))),t.new){const e=this.interpreterSelector.suggestionToQuickPickItem(t.new,n,!c);if(-1===u){const t=a.findIndex((e=>x(e)&&e.label===this.noPythonInstalled.label));-1!==t&&a.splice(t,1);const r=a.findIndex((e=>x(e)&&e.label===this.tipToReloadWindow.label));-1!==r&&a.splice(r,1),c&&O(a,e,null===(s=this.workspaceService.getWorkspaceFolder(n))||void 0===s?void 0:s.uri.fsPath),a.push(e)}else a[u]=e}return-1!==u&&void 0===t.new&&a.splice(u,1),this.finalizeItems(a,n,i),a}finalizeItems(e,t,n){const r=this.interpreterSelector.getSuggestions(t,!0);this.interpreterService.refreshPromise||(r.length?((null==n?void 0:n.skipRecommended)||this.setRecommendedItem(r,e,t),e.forEach(((t,n)=>{P(t)&&(0,E.isProblematicCondaEnvironment)(t.interpreter)&&(e[n].label.includes(u.Octicons.Warning)||(e[n].label=`${u.Octicons.Warning} ${e[n].label}`,e[n].tooltip=f.InterpreterQuickPickList.condaEnvWithoutPythonTooltip))}))):(e.some((e=>x(e)&&e.label===this.noPythonInstalled.label))||e.push(this.noPythonInstalled),this.wasNoPythonInstalledItemClicked&&!e.some((e=>x(e)&&e.label===this.tipToReloadWindow.label))&&e.push(this.tipToReloadWindow)))}setRecommendedItem(e,t,n){var r,i;const o=this.interpreterSelector.getRecommendedSuggestion(e,null===(r=this.workspaceService.getWorkspaceFolder(n))||void 0===r?void 0:r.uri);if(!o)return;const a=t.find((e=>I(e)&&e.label===R.Recommended)),c=(0,s.cloneDeep)(o);c.description=a?c.description:`${null!==(i=c.description)&&void 0!==i?i:""} - ${f.Common.recommended}`;const l=t.findIndex((e=>P(e)&&e.interpreter.id===c.interpreter.id));-1!==l&&(t[l]=c)}refreshCallback(e,t){e.buttons=this.getButtons(t),this.interpreterService.triggerRefresh(void 0,t).finally((()=>{e.buttons=this.getButtons({isButton:!1,showBackButton:null==t?void 0:t.showBackButton})})).ignoreErrors(),this.interpreterService.refreshPromise&&(e.busy=!0,this.interpreterService.refreshPromise.then((()=>{e.busy=!1})))}getButtons(e){const t=[];return(null==e?void 0:e.showBackButton)&&t.push(c.QuickInputButtons.Back),(null==e?void 0:e.isButton)?t.push({iconPath:new c.ThemeIcon(u.ThemeIcons.SpinningLoader),tooltip:f.InterpreterQuickPickList.refreshingInterpreterList}):t.push(this.refreshButton),t}async _enterOrBrowseInterpreterPath(e,t){const n=[{label:f.InterpreterQuickPickList.browsePath.label,detail:f.InterpreterQuickPickList.browsePath.detail}],r=await e.showQuickPick({placeholder:f.InterpreterQuickPickList.enterPath.placeholder,items:n,acceptFilterBoxTextAsSelection:!0});if("string"==typeof r)(0,b.sendTelemetryEvent)(S.EventName.SELECT_INTERPRETER_ENTER_CHOICE,void 0,{choice:"enter"}),t.path=r,this.sendInterpreterEntryTelemetry(r,t.workspace);else if(r&&r.label===f.InterpreterQuickPickList.browsePath.label){(0,b.sendTelemetryEvent)(S.EventName.SELECT_INTERPRETER_ENTER_CHOICE,void 0,{choice:"browse"});const e={Executables:["exe"]},n=await this.applicationShell.showOpenDialog({filters:this.platformService.isWindows?e:void 0,openLabel:f.InterpreterQuickPickList.browsePath.openButtonLabel,canSelectMany:!1,title:f.InterpreterQuickPickList.browsePath.title});if(!(n&&n.length>0))return Promise.reject(m.InputFlowAction.resume);t.path=n[0].fsPath,this.sendInterpreterEntryTelemetry(t.path,t.workspace)}return Promise.resolve()}async setInterpreter(){const e=await this.getConfigTargets();if(!e)return;const{configTarget:t}=e[0],n=e[0].folderUri,r={path:void 0,workspace:n},i=this.multiStepFactory.create();await i.run(((e,t)=>this._pickInterpreter(e,t,void 0,{showCreateEnvironment:!0})),r),void 0!==r.path&&await this.pythonPathUpdaterService.updatePythonPath(r.path,t,"ui",n)}async getInterpreterViaQuickPick(e,t,n){const r={path:void 0,workspace:e},i=this.multiStepFactory.create();return await i.run(((e,r)=>this._pickInterpreter(e,r,t,n)),r),r.path}sendInterpreterEntryTelemetry(e,t){const n=this._getItems(t,void 0);let r=a.normalize(C(e));a.isAbsolute(r)||(r=a.resolve((null==t?void 0:t.fsPath)||"",e));const i=n.map((e=>{const n=P(e)?e.interpreter.path:"";let r=a.normalize(C(n));return a.isAbsolute(n)||(r=a.resolve((null==t?void 0:t.fsPath)||"",n)),r})).includes(r);(0,b.sendTelemetryEvent)(S.EventName.SELECT_INTERPRETER_ENTERED_EXISTS,void 0,{discovered:i})}};function O(e,t,n,r){if(!r){const t=e.length?e[e.length-1]:void 0;r=t&&P(t)?k(t,n):void 0}const i=k(t,n);if(!r||i!==r){const t={label:i,kind:c.QuickPickItemKind.Separator};e.push(t),r=i}return r}function k(e,t){if(t&&(0,d.isParentPath)(e.path,t))return R.Workspace;switch(e.interpreter.envType){case y.EnvironmentType.Global:case y.EnvironmentType.System:case y.EnvironmentType.Unknown:case y.EnvironmentType.MicrosoftStore:return R.Global;default:return R[e.interpreter.envType]}}r([(0,b.captureTelemetry)(S.EventName.SELECT_INTERPRETER_ENTER_BUTTON)],D.prototype,"_enterOrBrowseInterpreterPath",null),r([(0,b.captureTelemetry)(S.EventName.SELECT_INTERPRETER)],D.prototype,"setInterpreter",null),D=r([(0,o.injectable)(),i(0,(0,o.inject)(l.IApplicationShell)),i(1,(0,o.inject)(h.IPathUtils)),i(2,(0,o.inject)(w.IPythonPathUpdaterServiceManager)),i(3,(0,o.inject)(h.IConfigurationService)),i(4,(0,o.inject)(l.ICommandManager)),i(5,(0,o.inject)(m.IMultiStepInputFactory)),i(6,(0,o.inject)(p.IPlatformService)),i(7,(0,o.inject)(w.IInterpreterSelector)),i(8,(0,o.inject)(l.IWorkspaceService)),i(9,(0,o.inject)(_.IInterpreterService))],D),t.SetInterpreterCommand=D},49071:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterSelector=void 0;const o=n(86700),s=n(48431),a=n(61684),c=n(44773),l=n(18639),u=n(54351);let d=class{constructor(e,t,n){this.interpreterManager=e,this.envTypeComparer=t,this.pathUtils=n,this.disposables=[]}dispose(){this.disposables.forEach((e=>e.dispose()))}getSuggestions(e,t=!1){const n=this.interpreterManager.getInterpreters(e);return n.sort(this.envTypeComparer.compare.bind(this.envTypeComparer)),n.map((n=>this.suggestionToQuickPickItem(n,e,t)))}async getAllSuggestions(e){const t=await this.interpreterManager.getAllInterpreters(e);return t.sort(this.envTypeComparer.compare.bind(this.envTypeComparer)),Promise.all(t.map((t=>this.suggestionToQuickPickItem(t,e))))}suggestionToQuickPickItem(e,t,n=!1){if(!n){const r=null==t?void 0:t.fsPath;r&&(0,s.isParentPath)(e.path,r)&&(n=!0)}const r=e.envPath&&"envFolderPath"===(0,c.getEnvPath)(e.path,e.envPath).pathType?e.envPath:e.path,i=this.pathUtils.getDisplayName(r,t?t.fsPath:void 0),o=e.cachedEntry?"(cached) ":"";return{label:(n?e.detailedDisplayName:e.displayName)||"Python",description:`${o}${i}`,path:r,interpreter:e}}getRecommendedSuggestion(e,t){const n=this.interpreterManager.getInterpreters(t),r=this.envTypeComparer.getRecommended(n,t);if(r)return e.find((e=>(0,s.arePathsSame)(e.interpreter.path,r.path)))}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(l.IInterpreterService)),i(1,(0,o.inject)(u.IInterpreterComparer)),i(2,(0,o.inject)(a.IPathUtils))],d),t.InterpreterSelector=d},68618:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PythonPathUpdaterService=void 0;const o=n(86700),s=n(66828),a=n(70057),c=n(48683),l=n(19735),u=n(54813),d=n(61522),p=n(18639),h=n(54351);let f=class{constructor(e,t){this.pythonPathSettingsUpdaterFactory=e,this.pyenvs=t}async updatePythonPath(e,t,n,r){const i=new a.StopWatch,o=this.getPythonUpdaterService(t,r);let c=!1;try{await o.updatePythonPath(e)}catch(e){c=!0;const t=e,n=t&&"string"==typeof t.message?t.message:"";s.window.showErrorMessage(s.l10n.t("Failed to set interpreter path. Error: {0}",n)),(0,l.traceError)(t)}this.sendTelemetry(i.elapsedTime,c,n,e,r).catch((e=>(0,l.traceError)("Python Extension: sendTelemetry",e)))}async sendTelemetry(e,t,n,r,i){var o;const s={failed:t,trigger:n};if(!t&&r){const e=new c.SystemVariables(void 0,null==i?void 0:i.fsPath),t=await this.pyenvs.getInterpreterInformation(e.resolveAny(r));t&&(s.pythonVersion=null===(o=t.version)||void 0===o?void 0:o.raw)}(0,u.sendTelemetryEvent)(d.EventName.PYTHON_INTERPRETER,e,s)}getPythonUpdaterService(e,t){switch(e){case s.ConfigurationTarget.Global:return this.pythonPathSettingsUpdaterFactory.getGlobalPythonPathConfigurationService();case s.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)}}};f=r([(0,o.injectable)(),i(0,(0,o.inject)(h.IPythonPathUpdaterServiceFactory)),i(1,(0,o.inject)(p.IComponentAdapter))],f),t.PythonPathUpdaterService=f},79721:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.PythonPathUpdaterServiceFactory=void 0;const o=n(86700),s=n(61684),a=n(77498),c=n(56798),l=n(95791),u=n(35543);let d=class{constructor(e){this.interpreterPathService=e.get(s.IInterpreterPathService)}getGlobalPythonPathConfigurationService(){return new c.GlobalPythonPathUpdaterService(this.interpreterPathService)}getWorkspacePythonPathConfigurationService(e){return new u.WorkspacePythonPathUpdaterService(e,this.interpreterPathService)}getWorkspaceFolderPythonPathConfigurationService(e){return new l.WorkspaceFolderPythonPathUpdaterService(e,this.interpreterPathService)}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IServiceContainer))],d),t.PythonPathUpdaterServiceFactory=d},56798:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalPythonPathUpdaterService=void 0;const r=n(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,r.ConfigurationTarget.Global,e)}}},95791:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceFolderPythonPathUpdaterService=void 0;const r=n(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||await this.interpreterPathService.update(this.workspaceFolder,r.ConfigurationTarget.WorkspaceFolder,e)}}},35543:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspacePythonPathUpdaterService=void 0;const r=n(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||await this.interpreterPathService.update(this.workspace,r.ConfigurationTarget.Workspace,e)}}},54351:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IInterpreterQuickPick=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"),t.IInterpreterQuickPick=Symbol("IInterpreterQuickPick")},18639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IActivatedEnvironmentLaunch=t.IInterpreterStatusbarVisibilityFilter=t.IInterpreterHelper=t.IInterpreterDisplay=t.IInterpreterService=t.ICondaService=t.IComponentAdapter=void 0,t.IComponentAdapter=Symbol("IComponentAdapter"),t.ICondaService=Symbol("ICondaService"),t.IInterpreterService=Symbol("IInterpreterService"),t.IInterpreterDisplay=Symbol("IInterpreterDisplay"),t.IInterpreterHelper=Symbol("IInterpreterHelper"),t.IInterpreterStatusbarVisibilityFilter=Symbol("IInterpreterStatusbarVisibilityFilter"),t.IActivatedEnvironmentLaunch=Symbol("IActivatedEnvironmentLaunch")},36543:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterDisplay=void 0;const o=n(86700),s=n(66828),a=n(17585),c=n(77570);n(32727);const l=n(61684),u=n(67098),d=n(77498),p=n(19735),h=n(18639);let f=class{constructor(e){this.serviceContainer=e,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0},this.useLanguageStatus=!1,this.visibilityFilters=[],this.helper=e.get(h.IInterpreterHelper),this.workspaceService=e.get(a.IWorkspaceService),this.pathUtils=e.get(l.IPathUtils),this.interpreterService=e.get(h.IInterpreterService),this.disposableRegistry=e.get(l.IDisposableRegistry),this.interpreterService.onDidChangeInterpreterInformation(this.onDidChangeInterpreterInformation,this,this.disposableRegistry)}async activate(){const e=this.serviceContainer.get(a.IApplicationShell);if(this.useLanguageStatus)this.languageStatus=e.createLanguageStatusItem("python.selectedInterpreter",{language:c.PYTHON_LANGUAGE}),this.languageStatus.severity=s.LanguageStatusSeverity.Information,this.languageStatus.command={title:u.InterpreterQuickPickList.browsePath.openButtonLabel,command:c.Commands.Set_Interpreter},this.disposableRegistry.push(this.languageStatus);else{const[t,n]=[s.StatusBarAlignment.Right,100.09999];this.statusBar=e.createStatusBarItem(t,n,"python.selectedInterpreterDisplay"),this.statusBar.command=c.Commands.Set_Interpreter,this.disposableRegistry.push(this.statusBar),this.statusBar.name=u.Interpreters.selectedPythonInterpreter}}async refresh(e){if(e&&this.workspaceService.getWorkspaceFolder(e)&&(e=this.workspaceService.getWorkspaceFolder(e).uri),!e){const t=this.helper.getActiveWorkspaceUri(e);e=t?t.folderUri:void 0}await this.updateDisplay(e)}registerVisibilityFilter(e){const t=this.serviceContainer.get(l.IDisposableRegistry);this.visibilityFilters.push(e),e.changed&&e.changed(this.updateVisibility,this,t)}onDidChangeInterpreterInformation(e){this.currentlySelectedInterpreterPath===e.path&&this.updateDisplay(this.currentlySelectedWorkspaceFolder).ignoreErrors()}async updateDisplay(e){var t;const n=await this.interpreterService.getActiveInterpreter(e);if(!this.currentlySelectedInterpreterDisplay||this.currentlySelectedInterpreterDisplay!==(null==n?void 0:n.detailedDisplayName)||this.currentlySelectedInterpreterPath!==n.path){if(this.currentlySelectedWorkspaceFolder=e,this.statusBar)if(n){this.statusBar.color="",this.statusBar.tooltip=this.pathUtils.getDisplayName(n.path,null==e?void 0:e.fsPath),this.currentlySelectedInterpreterPath!==n.path&&((0,p.traceLog)(s.l10n.t("Python interpreter path: {0}",this.pathUtils.getDisplayName(n.path,null==e?void 0:e.fsPath))),this.currentlySelectedInterpreterPath=n.path);let r=n.detailedDisplayName;r=(null==r?void 0:r.startsWith("Python"))?null===(t=null==r?void 0:r.substring("Python".length))||void 0===t?void 0:t.trim():r,this.statusBar.text=null!=r?r:"",this.statusBar.backgroundColor=void 0,this.currentlySelectedInterpreterDisplay=n.detailedDisplayName}else this.statusBar.tooltip="",this.statusBar.color="",this.statusBar.backgroundColor=new s.ThemeColor("statusBarItem.warningBackground"),this.statusBar.text=`$(alert) ${u.InterpreterQuickPickList.browsePath.openButtonLabel}`,this.currentlySelectedInterpreterDisplay=void 0;else if(this.languageStatus)if(n){this.languageStatus.detail=this.pathUtils.getDisplayName(n.path,null==e?void 0:e.fsPath),this.currentlySelectedInterpreterPath!==n.path&&((0,p.traceLog)(s.l10n.t("Python interpreter path: {0}",this.pathUtils.getDisplayName(n.path,null==e?void 0:e.fsPath))),this.currentlySelectedInterpreterPath=n.path);let t=n.detailedDisplayName;t=t.startsWith("Python")?t.substring("Python".length).trim():t,this.languageStatus.text=t,this.currentlySelectedInterpreterDisplay=n.detailedDisplayName,this.languageStatus.severity=s.LanguageStatusSeverity.Information}else this.languageStatus.severity=s.LanguageStatusSeverity.Warning,this.languageStatus.text=`$(alert) ${u.InterpreterQuickPickList.browsePath.openButtonLabel}`,this.languageStatus.detail=void 0,this.currentlySelectedInterpreterDisplay=void 0;this.statusBarCanBeDisplayed=!0,this.updateVisibility()}}updateVisibility(){this.statusBar&&this.statusBarCanBeDisplayed&&(0===this.visibilityFilters.length||this.visibilityFilters.every((e=>!e.hidden))?this.statusBar.show():this.statusBar.hide())}};f=r([(0,o.injectable)(),i(0,(0,o.inject)(d.IServiceContainer))],f),t.InterpreterDisplay=f},24001:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterLocatorProgressStatubarHandler=void 0;const o=n(86700),s=n(66828),a=n(17585),c=n(77570),l=n(61684),u=n(59314),d=n(67098),p=n(19735),h=n(44538),f=n(18639);let g=class{constructor(e,t,n){this.shell=e,this.disposables=t,this.pyenvs=n,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0},this.isFirstTimeLoadingInterpreters=!0}async activate(){this.pyenvs.onProgress((e=>{if(e.stage===h.ProgressReportStage.discoveryStarted){this.showProgress();const e=this.pyenvs.getRefreshPromise();e&&e.then((()=>this.hideProgress()))}}),this,this.disposables)}showProgress(){this.deferred||this.createProgress()}hideProgress(){this.deferred&&(this.deferred.resolve(),this.deferred=void 0)}createProgress(){const e={location:s.ProgressLocation.Window,title:`[${this.isFirstTimeLoadingInterpreters?d.Interpreters.discovering:d.Interpreters.refreshing}](command:${c.Commands.Set_Interpreter})`};this.isFirstTimeLoadingInterpreters=!1,this.shell.withProgress(e,(()=>(this.deferred=(0,u.createDeferred)(),this.deferred.promise)))}};r([(0,p.traceDecoratorVerbose)("Display locator refreshing progress")],g.prototype,"showProgress",null),r([(0,p.traceDecoratorVerbose)("Hide locator refreshing progress")],g.prototype,"hideProgress",null),g=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IApplicationShell)),i(1,(0,o.inject)(l.IDisposableRegistry)),i(2,(0,o.inject)(f.IComponentAdapter))],g),t.InterpreterLocatorProgressStatubarHandler=g},43490:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterHelper=t.isInterpreterLocatedInWorkspace=void 0;const o=n(86700),s=n(66828),a=n(17585),c=n(48431),l=n(77498),u=n(95084),d=n(81387),p=n(18639);function h(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,u.compareSemVerLikeVersions)(e.version,t.version):0)),t}t.isInterpreterLocatedInWorkspace=function(e,t){const n=c.FileSystemPaths.withDefaults(),r=n.normCase(e.path),i=n.normCase(t.fsPath);return r.startsWith(i)};let f=class{constructor(e,t){this.serviceContainer=e,this.pyenvs=t}getActiveWorkspaceUri(e){var t;const n=this.serviceContainer.get(a.IWorkspaceService);if(!(((null===(t=n.workspaceFolders)||void 0===t?void 0:t.length)||0)>0))return;if(Array.isArray(n.workspaceFolders)&&1===n.workspaceFolders.length)return{folderUri:n.workspaceFolders[0].uri,configTarget:s.ConfigurationTarget.Workspace};if(e){const t=n.getWorkspaceFolder(e);if(t)return{configTarget:s.ConfigurationTarget.WorkspaceFolder,folderUri:t.uri}}const r=this.serviceContainer.get(a.IDocumentManager);if(r.activeTextEditor){const e=n.getWorkspaceFolder(r.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 h(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,d.getEnvironmentTypeName)(e)}getBestInterpreter(e){if(!Array.isArray(e)||0===e.length)return;const t=h(e);return t[t.length-1]}};f=r([(0,o.injectable)(),i(0,(0,o.inject)(l.IServiceContainer)),i(1,(0,o.inject)(p.IComponentAdapter))],f),t.InterpreterHelper=f},41089:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterPathCommand=void 0;const o=n(86700),s=n(66828),a=n(77570),c=n(61684),l=n(98638),u=n(18639);let d=class{constructor(e,t){this.interpreterService=e,this.disposables=t,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!1}}async activate(){this.disposables.push((0,l.registerCommand)(a.Commands.GetSelectedInterpreterPath,(e=>this._getSelectedInterpreterPath(e))))}async _getSelectedInterpreterPath(e){var t,n;let r,i;if("workspaceFolder"in e)r=e.workspaceFolder;else if(e[1]){const[,t]=e;r=t}else r=void 0;try{i=r?s.Uri.file(r):void 0}catch(e){i=void 0}return(null!==(n=null===(t=await this.interpreterService.getActiveInterpreter(i))||void 0===t?void 0:t.path)&&void 0!==n?n:"python").toCommandArgumentForPythonExt()}};d=r([(0,o.injectable)(),i(0,(0,o.inject)(u.IInterpreterService)),i(1,(0,o.inject)(c.IDisposableRegistry))],d),t.InterpreterPathCommand=d},62643:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpreterService=void 0;const o=n(86700),s=n(71017),a=n(66828);n(32727);const c=n(17585),l=n(61684),u=n(77498),d=n(18639),p=n(19735),h=n(77570),f=n(12304),g=n(29983),m=n(67098),v=n(54813),y=n(61522),b=n(36952),S=n(59314);let _=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.activeInterpreterPaths=new Map,this.configService=this.serviceContainer.get(l.IConfigurationService),this.interpreterPathService=this.serviceContainer.get(l.IInterpreterPathService),this.onDidChangeInterpreters=t.onChanged}async hasInterpreters(e=(async()=>!0)){return this.pyenvs.hasInterpreters(e)}triggerRefresh(e,t){return this.pyenvs.triggerRefresh(e,t)}get refreshPromise(){return this.pyenvs.getRefreshPromise()}getRefreshPromise(e){return this.pyenvs.getRefreshPromise(e)}get onDidChangeInterpreter(){return this.didChangeInterpreterEmitter.event}get onDidChangeInterpreterInformation(){return this.didChangeInterpreterInformation.event}get onDidChangeInterpreterConfiguration(){return this.didChangeInterpreterConfigurationEmitter.event}async refresh(e){const t=this.serviceContainer.get(d.IInterpreterDisplay);await t.refresh(e);const n=this.serviceContainer.get(c.IWorkspaceService).getWorkspaceFolder(e),r=this.configService.getSettings(e).pythonPath,i=this.serviceContainer.get(c.IWorkspaceService).getWorkspaceFolderIdentifier(e);this.activeInterpreterPaths.set(i,{path:r,workspaceFolder:n}),this.ensureEnvironmentContainsPython(r,n).ignoreErrors()}initialize(){const e=this.serviceContainer.get(l.IDisposableRegistry),t=this.serviceContainer.get(c.IDocumentManager),n=this.serviceContainer.get(d.IInterpreterDisplay),r=new class{constructor(e,t,n){this.docManager=e,this.configService=t,this.disposablesReg=n,this.interpreterVisibilityEmitter=new a.EventEmitter,this.changed=this.interpreterVisibilityEmitter.event,this.disposablesReg.push(this.configService.onDidChange((async e=>{(null==e?void 0:e.affectsConfiguration("python.interpreter.infoVisibility"))&&this.interpreterVisibilityEmitter.fire()})))}get hidden(){var e;const t=this.configService.getSettings().interpreter.infoVisibility;if("never"===t)return!0;if("always"===t)return!1;const n=null===(e=this.docManager.activeTextEditor)||void 0===e?void 0:e.document,r=h.PVSC_EXTENSION_ID.split(".")[0];return!(null==n?void 0:n.fileName.endsWith("settings.json"))&&!(null==n?void 0:n.fileName.includes(r))&&(null==n?void 0:n.languageId)!==h.PYTHON_LANGUAGE}}(t,this.configService,e);n.registerVisibilityFilter(r),e.push(this.onDidChangeInterpreters((e=>{var t;const n=null!==(t=e.old)&&void 0!==t?t:e.new;if(n){this.didChangeInterpreterInformation.fire(n);for(const{path:t,workspaceFolder:r}of this.activeInterpreterPaths.values())t!==n.path||e.new||(this.didChangeInterpreterEmitter.fire(null==r?void 0:r.uri),(0,f.reportActiveInterpreterChanged)({path:t,resource:r}))}}))),e.push(t.onDidOpenTextDocument((()=>{r.interpreterVisibilityEmitter.fire()})),t.onDidChangeActiveTextEditor((e=>{r.interpreterVisibilityEmitter.fire(),e&&e.document&&this.refresh(e.document.uri)}))),e.push(this.interpreterPathService.onDidChange((e=>this._onConfigChanged(e.uri))))}getInterpreters(e){return this.pyenvs.getInterpreters(e)}async getAllInterpreters(e){return this.triggerRefresh(void 0,{ifNotTriggerredAlready:!0}).ignoreErrors(),await this.refreshPromise,this.getInterpreters(e)}dispose(){this.didChangeInterpreterEmitter.dispose(),this.didChangeInterpreterInformation.dispose()}async getActiveInterpreter(e){const t=this.serviceContainer.get(d.IActivatedEnvironmentLaunch);let n=await t.selectIfLaunchedViaActivatedEnv(!0);if(!n&&(n=this.configService.getSettings(e).pythonPath,s.basename(n)===n)){const t=this.serviceContainer.tryGet(g.IPythonExecutionFactory),r=t?await t.create({resource:e}):void 0,i=r?await r.getExecutablePath().catch((e=>{(0,p.traceError)(e)})):void 0;if(!i)return;n=i}return this.getInterpreterDetails(n)}async getInterpreterDetails(e){return this.pyenvs.getInterpreterDetails(e)}async _onConfigChanged(e){await(0,S.sleep)(1);const t=this.configService.getSettings(e);if(this.didChangeInterpreterConfigurationEmitter.fire(e),""===this._pythonPathSetting||this._pythonPathSetting!==t.pythonPath){this._pythonPathSetting=t.pythonPath,this.didChangeInterpreterEmitter.fire(e);const n=this.serviceContainer.get(c.IWorkspaceService).getWorkspaceFolder(e);(0,f.reportActiveInterpreterChanged)({path:t.pythonPath,resource:n});const r=this.serviceContainer.get(c.IWorkspaceService).getWorkspaceFolderIdentifier(e);this.activeInterpreterPaths.set(r,{path:t.pythonPath,workspaceFolder:n}),this.serviceContainer.get(d.IInterpreterDisplay).refresh().catch((e=>(0,p.traceError)("Python Extension: display.refresh",e))),await this.ensureEnvironmentContainsPython(this._pythonPathSetting,n)}}async ensureEnvironmentContainsPython(e,t){const n=this.serviceContainer.get(l.IInstaller);if(!await n.isInstalled(l.Product.python)){(0,v.sendTelemetryEvent)(y.EventName.ENVIRONMENT_WITHOUT_PYTHON_SELECTED);const r=this.serviceContainer.get(c.IApplicationShell),i={location:a.ProgressLocation.Window,title:`[${m.Interpreters.installingPython}](command:${h.Commands.ViewOutput})`};(0,p.traceLog)("Conda envs without Python are known to not work well; fixing conda environment...");const o=n.install(l.Product.python,await this.getInterpreterDetails(e));r.withProgress(i,(()=>o)),o.then((async()=>{await this.getInterpreterDetails(e),this.didChangeInterpreterEmitter.fire(null==t?void 0:t.uri),(0,f.reportActiveInterpreterChanged)({path:e,resource:t})})).ignoreErrors()}}};r([(0,b.cache)(-1,!0)],_.prototype,"ensureEnvironmentContainsPython",null),_=r([(0,o.injectable)(),i(0,(0,o.inject)(u.IServiceContainer)),i(1,(0,o.inject)(d.IComponentAdapter))],_),t.InterpreterService=_},51863:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=t.registerInterpreterTypes=void 0;const r=n(90819),i=n(94144),o=n(80351),s=n(20741),a=n(45297),c=n(87282),l=n(95356),u=n(89294),d=n(65313),p=n(90780),h=n(50902),f=n(49071),g=n(68618),m=n(79721),v=n(54351),y=n(18639),b=n(36543),S=n(24001),_=n(43490),E=n(41089),w=n(62643),T=n(40906),C=n(45107),P=n(66950);function x(e){e.addSingleton(r.IExtensionSingleActivationService,u.InstallPythonCommand),e.addSingleton(r.IExtensionSingleActivationService,d.InstallPythonViaTerminal),e.addSingleton(r.IExtensionSingleActivationService,h.SetInterpreterCommand),e.addSingleton(r.IExtensionSingleActivationService,p.ResetInterpreterCommand),e.addSingleton(v.IInterpreterQuickPick,h.SetInterpreterCommand),e.addSingleton(r.IExtensionActivationService,P.VirtualEnvironmentPrompt),e.addSingleton(y.IInterpreterService,w.InterpreterService),e.addSingleton(y.IInterpreterDisplay,b.InterpreterDisplay),e.addBinding(y.IInterpreterDisplay,r.IExtensionSingleActivationService),e.addSingleton(v.IPythonPathUpdaterServiceFactory,m.PythonPathUpdaterServiceFactory),e.addSingleton(v.IPythonPathUpdaterServiceManager,g.PythonPathUpdaterService),e.addSingleton(v.IInterpreterSelector,f.InterpreterSelector),e.addSingleton(y.IInterpreterHelper,_.InterpreterHelper),e.addSingleton(v.IInterpreterComparer,l.EnvironmentTypeComparer),e.addSingleton(r.IExtensionSingleActivationService,S.InterpreterLocatorProgressStatubarHandler),e.addSingleton(c.IInterpreterAutoSelectionService,s.InterpreterAutoSelectionService),e.addSingleton(r.IExtensionActivationService,C.CondaInheritEnvPrompt),e.addSingleton(y.IActivatedEnvironmentLaunch,T.ActivatedEnvironmentLaunch)}t.registerInterpreterTypes=x,t.registerTypes=function(e){x(e),e.addSingleton(c.IInterpreterAutoSelectionProxyService,a.InterpreterAutoSelectionProxyService),e.addSingleton(i.EnvironmentActivationService,i.EnvironmentActivationService),e.addSingleton(o.IEnvironmentActivationService,i.EnvironmentActivationService),e.addSingleton(r.IExtensionSingleActivationService,E.InterpreterPathCommand)}},40906:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ActivatedEnvironmentLaunch=void 0;const o=n(86700),s=n(66828),a=n(71017),c=n(17585),l=n(29983),u=n(59314),d=n(36952),p=n(67098),h=n(19735),f=n(75470),g=n(54813),m=n(61522),v=n(54351),y=n(18639);let b=class{constructor(e,t,n,r,i,o=!1){this.workspaceService=e,this.appShell=t,this.pythonPathUpdaterService=n,this.interpreterService=r,this.processServiceFactory=i,this.wasSelected=o,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0}}async _promptIfApplicable(){const e=S();if(!e)return;const t=await this.interpreterService.getInterpreterDetails(e);if("base"!==(null==t?void 0:t.envName))return;const n=await f.Conda.getConda();if(!n)return void(0,h.traceWarn)("Conda not found even though activated environment vars are set");const r=await this.processServiceFactory.create();(await r.shellExec(`${n.shellCommand} config --get auto_activate_base`).catch((e=>((0,h.traceError)(e),{stdout:""})))).stdout.trim().toLowerCase().endsWith("false")&&await this.promptAndUpdate(e)}async promptAndUpdate(e){this.wasSelected=!0;const t=[p.Common.bannerLabelYes,p.Common.bannerLabelNo],n=await this.appShell.showInformationMessage(p.Interpreters.activatedCondaEnvLaunch,...t);(0,g.sendTelemetryEvent)(m.EventName.ACTIVATED_CONDA_ENV_LAUNCH,void 0,{selection:n?["Yes","No"][t.indexOf(n)]:void 0}),n&&n===t[0]&&await this.setInterpeterInStorage(e)}async selectIfLaunchedViaActivatedEnv(e=!1){return this.wasSelected?this.inMemorySelection:this._selectIfLaunchedViaActivatedEnv(e)}async _selectIfLaunchedViaActivatedEnv(e=!1){if(this.workspaceService.workspaceFile)return;if("1"!==process.env.VSCODE_CLI)return;(0,h.traceVerbose)("VS Code was not launched from the command line");const t=await this.getPrefixOfSelectedActivatedEnv();if(t)return this.wasSelected=!0,this.inMemorySelection=t,(0,h.traceLog)(`VS Code was launched from an activated environment: '${a.basename(t)}', selecting it as the interpreter for workspace.`),e?this.setInterpeterInStorage(t).ignoreErrors():(await this.setInterpeterInStorage(t),await(0,u.sleep)(1)),this.inMemorySelection=void 0,t;this._promptIfApplicable().ignoreErrors()}async setInterpeterInStorage(e){const{workspaceFolders:t}=this.workspaceService;t&&0!==t.length?await this.pythonPathUpdaterService.updatePythonPath(e,s.ConfigurationTarget.WorkspaceFolder,"load",t[0].uri):await this.pythonPathUpdaterService.updatePythonPath(e,s.ConfigurationTarget.Global,"load")}async getPrefixOfSelectedActivatedEnv(){const e=process.env.VIRTUAL_ENV;if(void 0!==e&&e.length>0)return e;const t=S();if(!t)return;const n=await this.interpreterService.getInterpreterDetails(t);return"base"!==(null==n?void 0:n.envName)||void 0!==process.env.CONDA_AUTO_ACTIVATE_BASE&&"false"===process.env.CONDA_AUTO_ACTIVATE_BASE.toLowerCase()?t:void 0}};function S(){const e=process.env.CONDA_PREFIX;if(e&&e.length>0){const t=process.env.CONDA_SHLVL;if(void 0!==t&&t.length>0&&t>"0")return e}}r([(0,d.cache)(-1,!0)],b.prototype,"_promptIfApplicable",null),r([(0,d.cache)(-1,!0)],b.prototype,"_selectIfLaunchedViaActivatedEnv",null),b=r([(0,o.injectable)(),i(0,(0,o.inject)(c.IWorkspaceService)),i(1,(0,o.inject)(c.IApplicationShell)),i(2,(0,o.inject)(v.IPythonPathUpdaterServiceManager)),i(3,(0,o.inject)(y.IInterpreterService)),i(4,(0,o.inject)(l.IProcessServiceFactory)),i(5,(0,o.optional)())],b),t.ActivatedEnvironmentLaunch=b},45107:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CondaInheritEnvPrompt=t.condaInheritEnvPromptKey=void 0;const o=n(86700),s=n(66828),a=n(17585),c=n(84974),l=n(61684),u=n(67098),d=n(19735),p=n(81387),h=n(54813),f=n(61522),g=n(18639);t.condaInheritEnvPromptKey="CONDA_INHERIT_ENV_PROMPT_KEY";let m=class{constructor(e,t,n,r,i,o,s=!1){this.interpreterService=e,this.workspaceService=t,this.appShell=n,this.persistentStateFactory=r,this.platformService=i,this.appEnvironment=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 n=[u.Common.allow,u.Common.close],r=await this.appShell.showInformationMessage(u.Interpreters.condaInheritEnvMessage,...n);(0,h.sendTelemetryEvent)(f.EventName.CONDA_INHERIT_ENV_PROMPT,void 0,{selection:r?["Allow","Close"][n.indexOf(r)]:void 0}),r&&(r===n[0]?await this.workspaceService.getConfiguration("terminal").update("integrated.inheritEnv",!1,s.ConfigurationTarget.Global):r===n[1]&&await e.updateValue(!1))}async shouldShowPrompt(e){if(this.hasPromptBeenShownInCurrentSession)return!1;if(this.appEnvironment.remoteName)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 n=this.workspaceService.getConfiguration("terminal",e).inspect("integrated.inheritEnv");return n?void 0===n.globalValue&&void 0===n.workspaceValue&&void 0===n.workspaceFolderValue&&(this.hasPromptBeenShownInCurrentSession=!0,!0):((0,d.traceError)("WorkspaceConfiguration.inspect returns `undefined` for setting `terminal.integrated.inheritEnv`"),!1)}};r([(0,d.traceDecoratorError)("Failed to intialize conda inherit env prompt")],m.prototype,"initializeInBackground",null),r([(0,d.traceDecoratorError)("Failed to display conda inherit env prompt")],m.prototype,"promptAndUpdate",null),r([(0,d.traceDecoratorError)("Failed to check whether to display prompt for conda inherit env setting")],m.prototype,"shouldShowPrompt",null),m=r([(0,o.injectable)(),i(0,(0,o.inject)(g.IInterpreterService)),i(1,(0,o.inject)(a.IWorkspaceService)),i(2,(0,o.inject)(a.IApplicationShell)),i(3,(0,o.inject)(l.IPersistentStateFactory)),i(4,(0,o.inject)(c.IPlatformService)),i(5,(0,o.inject)(a.IApplicationEnvironment)),i(6,(0,o.optional)())],m),t.CondaInheritEnvPrompt=m},66950:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualEnvironmentPrompt=void 0;const o=n(86700),s=n(66828),a=n(17585),c=n(61684),l=n(67098),u=n(19735),d=n(85949),p=n(54813),h=n(61522),f=n(54351),g=n(18639);let m=class{constructor(e,t,n,r,i,o,s){this.persistentStateFactory=e,this.helper=t,this.pythonPathUpdaterService=n,this.disposableRegistry=r,this.appShell=i,this.pyenvs=o,this.interpreterService=s,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){if((0,d.isCreatingEnvironment)())return;const t=await this.pyenvs.getWorkspaceVirtualEnvInterpreters(e),n=Array.isArray(t)&&t.length>0?this.helper.getBestInterpreter(t):void 0;if(!n)return;const r=await this.interpreterService.getActiveInterpreter(e);(null==r?void 0:r.id)!==n.id?await this.notifyUser(n,e):(0,u.traceVerbose)("New environment has already been selected")}async notifyUser(e,t){const n=this.persistentStateFactory.createWorkspacePersistentState("MESSAGE_KEY_FOR_VIRTUAL_ENV",!0);if(!n.value)return;const r=[l.Common.bannerLabelYes,l.Common.bannerLabelNo,l.Common.doNotShowAgain],i=await this.appShell.showInformationMessage(l.Interpreters.environmentPromptMessage,...r);(0,p.sendTelemetryEvent)(h.EventName.PYTHON_INTERPRETER_ACTIVATE_ENVIRONMENT_PROMPT,void 0,{selection:i?["Yes","No","Ignore"][r.indexOf(i)]:void 0}),i&&(i===r[0]?await this.pythonPathUpdaterService.updatePythonPath(e.path,s.ConfigurationTarget.WorkspaceFolder,"ui",t):i===r[2]&&await n.updateValue(!1))}};r([(0,u.traceDecoratorError)("Error in event handler for detection of new environment")],m.prototype,"handleNewEnvironment",null),m=r([(0,o.injectable)(),i(0,(0,o.inject)(c.IPersistentStateFactory)),i(1,(0,o.inject)(g.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)(g.IComponentAdapter)),i(6,(0,o.inject)(g.IInterpreterService))],m),t.VirtualEnvironmentPrompt=m},61466:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceContainer=void 0;const i=n(82361),o=n(86700),s=n(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=r([(0,o.injectable)()],a),t.ServiceContainer=a},37104:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceManager=void 0;const i=n(86700);let o=class{constructor(e){this.container=e}add(e,t,n,r){n?this.container.bind(e).to(t).whenTargetNamed(n):this.container.bind(e).to(t),r&&r.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,n,r){n?this.container.bind(e).to(t).inSingletonScope().whenTargetNamed(n):this.container.bind(e).to(t).inSingletonScope(),r&&r.forEach((t=>{this.addBinding(e,t)}))}addSingletonInstance(e,t,n){n?this.container.bind(e).toConstantValue(t).whenTargetNamed(n):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,n){n?this.container.rebind(e).to(t).whenTargetNamed(n):this.container.rebind(e).to(t)}rebindSingleton(e,t,n){n?this.container.rebind(e).to(t).inSingletonScope().whenTargetNamed(n):this.container.rebind(e).to(t).inSingletonScope()}rebindInstance(e,t,n){n?this.container.rebind(e).toConstantValue(t).whenTargetNamed(n):this.container.rebind(e).toConstantValue(t)}dispose(){this.container.unbindAll(),this.container.unload()}};o=r([(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")},11272:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.JupyterExtensionDependencyManager=void 0;const o=n(86700),s=n(77570),a=n(61684);let c=class{constructor(e){this.extensions=e}get isJupyterExtensionInstalled(){return void 0!==this.extensions.getExtension(s.JUPYTER_EXTENSION_ID)}};c=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IExtensions))],c),t.JupyterExtensionDependencyManager=c},66259:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.JupyterExtensionIntegration=void 0;const o=n(86700),s=n(71017),a=n(17585),c=n(77570),l=n(61684),u=n(80351),d=n(54351),p=n(18639),h=n(56994),f=n(49575);let g=class{constructor(e,t,n,r,i,o,s,a,c){this.extensions=e,this.interpreterSelector=t,this.envActivation=n,this.globalState=r,this.interpreterDisplay=i,this.workspaceService=o,this.condaService=s,this.contextManager=a,this.interpreterService=c}registerApi(e){this.contextManager.setContext(h.ExtensionContextKey.IsJupyterInstalled,!0),this.workspaceService.isTrusted?e.registerPythonApi({getActivatedEnvironmentVariables:async(e,t,n)=>{const r=await this.interpreterService.getInterpreterDetails(t.path);return this.envActivation.getActivatedEnvironmentVariables(e,r,n)},getSuggestions:async e=>this.interpreterSelector.getAllSuggestions(e),getKnownSuggestions:e=>this.interpreterSelector.getSuggestions(e),getDebuggerPath:async()=>(0,s.dirname)(await(0,f.getDebugpyPath)()),getInterpreterPathSelectedForJupyterServer:()=>this.globalState.get("INTERPRETER_PATH_SELECTED_FOR_JUPYTER_SERVER"),registerInterpreterStatusFilter:this.interpreterDisplay.registerVisibilityFilter.bind(this.interpreterDisplay),getCondaFile:()=>this.condaService.getCondaFile(),getCondaVersion:()=>this.condaService.getCondaVersion(),registerJupyterPythonPathFunction:e=>this.registerJupyterPythonPathFunction(e)}):this.workspaceService.onDidGrantWorkspaceTrust((()=>this.registerApi(e)))}async integrateWithJupyterExtension(){const e=await this.getExtensionApi();e&&this.registerApi(e)}async getExtensionApi(){if(!this.pylanceExtension){const e=this.extensions.getExtension(c.PYLANCE_EXTENSION_ID);e&&!e.isActive&&await e.activate(),this.pylanceExtension=e}if(this.jupyterExtension)return this.jupyterExtension.exports;{const e=this.extensions.getExtension(c.JUPYTER_EXTENSION_ID);if(!e)return;if(await e.activate(),e.isActive)return this.jupyterExtension=e,this.jupyterExtension.exports}}getPylanceApi(){var e;const t=null===(e=this.pylanceExtension)||void 0===e?void 0:e.exports;return t&&t.notebook&&t.client&&t.client.isEnabled()?t:void 0}registerJupyterPythonPathFunction(e){const t=this.getPylanceApi();t&&t.notebook.registerJupyterPythonPathFunction(e)}};g=r([(0,o.injectable)(),i(0,(0,o.inject)(l.IExtensions)),i(1,(0,o.inject)(d.IInterpreterSelector)),i(2,(0,o.inject)(u.IEnvironmentActivationService)),i(3,(0,o.inject)(l.IMemento)),i(3,(0,o.named)(l.GLOBAL_MEMENTO)),i(4,(0,o.inject)(p.IInterpreterDisplay)),i(5,(0,o.inject)(a.IWorkspaceService)),i(6,(0,o.inject)(p.ICondaService)),i(7,(0,o.inject)(a.IContextKeyManager)),i(8,(0,o.inject)(p.IInterpreterService))],g),t.JupyterExtensionIntegration=g},35657:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RequireJupyterPrompt=void 0;const o=n(86700),s=n(17585),a=n(67098),c=n(77570),l=n(61684),u=n(54813),d=n(61522);let p=class{constructor(e,t,n){this.appShell=e,this.commandManager=t,this.disposables=n,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0}}async activate(){this.disposables.push(this.commandManager.registerCommand(c.Commands.InstallJupyter,(()=>this._showPrompt())))}async _showPrompt(){const e=[a.Common.bannerLabelYes,a.Common.bannerLabelNo],t=await this.appShell.showInformationMessage(a.Interpreters.requireJupyter,...e);(0,u.sendTelemetryEvent)(d.EventName.REQUIRE_JUPYTER_PROMPT,void 0,{selection:t?["Yes","No"][e.indexOf(t)]:void 0}),t&&t===e[0]&&await this.commandManager.executeCommand("workbench.extensions.installExtension",c.JUPYTER_EXTENSION_ID,void 0)}};p=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IApplicationShell)),i(1,(0,o.inject)(s.ICommandManager)),i(2,(0,o.inject)(l.IDisposableRegistry))],p),t.RequireJupyterPrompt=p},29917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLanguageConfiguration=void 0;const r=n(66828),i=n(45940);t.getLanguageConfiguration=function(){return{onEnterRules:[{beforeText:(0,i.verboseRegExp)("\n ^\n (?! \\s+ \\\\ )\n [^#\n]+\n \\\\\n $\n "),action:{indentAction:r.IndentAction.Indent}},{beforeText:/^\s*#.*/,afterText:/.+$/,action:{indentAction:r.IndentAction.None,appendText:"# "}},{beforeText:(0,i.verboseRegExp)("\n ^\n \\s*\n (?:\n (?:\n (?:\n class |\n def |\n async \\s+ def |\n except |\n for |\n async \\s+ for |\n if |\n elif |\n while |\n with |\n async \\s+ with |\n match |\n case\n )\n \\b .*\n ) |\n else |\n try |\n finally\n )\n \\s*\n [:]\n \\s*\n (?: [#] .* )?\n $\n "),action:{indentAction:r.IndentAction.Indent}},{beforeText:(0,i.verboseRegExp)("\n ^\n (?:\n (?:\n \\s*\n (?:\n pass\n )\n ) |\n (?:\n \\s+\n (?:\n raise |\n break |\n continue\n )\n )\n )\n \\s*\n (?: [#] .* )?\n $\n "),action:{indentAction:r.IndentAction.Outdent}}]}}},75715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JediLSExtensionManager=void 0;const r=n(67220),i=n(49532),o=n(17192),s=n(73461),a=n(19735);t.JediLSExtensionManager=class{constructor(e,t,n,a,c,l,u,d,p){this.analysisOptions=new r.JediLanguageServerAnalysisOptions(d,t,c,a),this.clientFactory=new i.JediLanguageClientFactory(u),this.serverProxy=new o.JediLanguageServerProxy(this.clientFactory),this.serverManager=new s.JediLanguageServerManager(e,this.analysisOptions,this.serverProxy,p)}dispose(){this.serverManager.disconnect(),this.serverManager.dispose(),this.serverProxy.dispose(),this.analysisOptions.dispose()}async startLanguageServer(e,t){await this.serverManager.start(e,t),this.serverManager.connect()}async stopLanguageServer(){this.serverManager.disconnect(),await this.serverProxy.stop()}canStartLanguageServer(e){return!!e||((0,a.traceError)("Unable to start Jedi language server as a valid interpreter is not selected"),!1)}languageServerNotAvailable(){return Promise.resolve()}}},34181:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoneLSExtensionManager=void 0,t.NoneLSExtensionManager=class{dispose(){}startLanguageServer(){return Promise.resolve()}stopLanguageServer(){return Promise.resolve()}canStartLanguageServer(){return!0}languageServerNotAvailable(){return Promise.resolve()}}},30588:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PylanceLSExtensionManager=void 0;const r=n(65188),i=n(22473),o=n(46888),s=n(82602),a=n(57582),c=n(77570),l=n(67098),u=n(19735);t.PylanceLSExtensionManager=class{constructor(e,t,n,r,c,l,u,d,p,h,f,g){this.workspaceService=r,this.configurationService=c,this.commandManager=p,this.extensions=f,this.applicationShell=g,this.analysisOptions=new i.NodeLanguageServerAnalysisOptions(t,r),this.clientFactory=new o.NodeLanguageClientFactory(h,f),this.serverProxy=new s.NodeLanguageServerProxy(this.clientFactory,n,l,d,r,f),this.serverManager=new a.NodeLanguageServerManager(e,this.analysisOptions,this.serverProxy,p,f)}dispose(){this.serverManager.disconnect(),this.serverManager.dispose(),this.serverProxy.dispose(),this.analysisOptions.dispose()}async startLanguageServer(e,t){await this.serverManager.start(e,t),this.serverManager.connect()}async stopLanguageServer(){this.serverManager.disconnect(),await this.serverProxy.stop()}canStartLanguageServer(){return!!this.extensions.getExtension(c.PYLANCE_EXTENSION_ID)}async languageServerNotAvailable(){await(0,r.promptForPylanceInstall)(this.applicationShell,this.commandManager,this.workspaceService,this.configurationService),(0,u.traceLog)(l.Pylance.pylanceNotInstalledMessage)}}},72391:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ILanguageServerWatcher=void 0,t.ILanguageServerWatcher=Symbol("ILanguageServerWatcher")},8335:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageServerWatcher=void 0;const o=n(71017),s=n(86700),a=n(66828),c=n(65188),l=n(90819),u=n(17585),d=n(84974),p=n(61684),h=n(67098),f=n(19909),g=n(18639),m=n(77498),v=n(19735),y=n(75715),b=n(34181),S=n(30588),_=n(54813),E=n(61522);let w=class{constructor(e,t,n,r,i,o,s,a,c,l,u,d,p,h){this.serviceContainer=e,this.lsOutputChannel=t,this.configurationService=n,this.experimentService=r,this.interpreterHelper=i,this.interpreterPathService=o,this.interpreterService=s,this.environmentService=a,this.workspaceService=c,this.commandManager=l,this.fileSystem=u,this.extensions=d,this.applicationShell=p,this.disposables=h,this.supportedWorkspaceTypes={untrustedWorkspace:!0,virtualWorkspace:!0},this.registered=!1,this.workspaceInterpreters=new Map,this.workspaceLanguageServers=new Map,this.languageServerType=this.configurationService.getSettings().languageServer}async activate(e,t){this.register(),await this.startLanguageServer(this.languageServerType,e,t)}async startLanguageServer(e,t,n){await this.startAndGetLanguageServer(e,t,n)}register(){this.registered||(this.registered=!0,this.disposables.push(this.workspaceService.onDidChangeConfiguration(this.onDidChangeConfiguration.bind(this))),this.disposables.push(this.workspaceService.onDidChangeWorkspaceFolders(this.onDidChangeWorkspaceFolders.bind(this))),this.disposables.push(this.interpreterService.onDidChangeInterpreterInformation(this.onDidChangeInterpreterInformation,this)),this.workspaceService.isTrusted&&this.disposables.push(this.interpreterPathService.onDidChange(this.onDidChangeInterpreter.bind(this))),this.disposables.push(this.extensions.onDidChange((async()=>{await this.extensionsChangeHandler()}))),this.disposables.push(new c.LanguageServerChangeHandler(this.languageServerType,this.extensions,this.applicationShell,this.commandManager,this.workspaceService,this.configurationService)))}async startAndGetLanguageServer(e,t,n){var r,i,o;const s=this.getWorkspaceUri(t),a=this.workspaceInterpreters.get(s.fsPath),c=await(null===(r=this.interpreterService)||void 0===r?void 0:r.getActiveInterpreter(t));a&&c!==a&&await this.stopLanguageServer(s);let u=e;c&&(null!==(o=null===(i=c.version)||void 0===i?void 0:i.major)&&void 0!==o?o:0)<3&&(u===l.LanguageServerType.Jedi?u=l.LanguageServerType.None:this.getCurrentLanguageServerTypeIsDefault()&&(u=l.LanguageServerType.Node)),this.workspaceService.isTrusted||u===l.LanguageServerType.Node||u===l.LanguageServerType.None||((0,v.traceLog)(h.LanguageService.untrustedWorkspaceMessage),u=l.LanguageServerType.None);const d=this.getWorkspaceKey(t,u),p=this.workspaceLanguageServers.get(d);if((u===l.LanguageServerType.Node||u===l.LanguageServerType.None)&&p)return T(u,s),p;const f=this.createLanguageServer(u);return this.workspaceLanguageServers.set(d,f),f.canStartLanguageServer(c)?(n&&(0,_.sendTelemetryEvent)(E.EventName.LANGUAGE_SERVER_TRIGGER_TIME,n.elapsedTime,{triggerTime:n.elapsedTime}),await f.startLanguageServer(s,c),T(e,s),this.languageServerType=e,this.workspaceInterpreters.set(s.fsPath,c)):await f.languageServerNotAvailable(),f}async restartLanguageServers(){this.workspaceLanguageServers.forEach((async(e,t)=>{(0,_.sendTelemetryEvent)(E.EventName.LANGUAGE_SERVER_RESTART,void 0,{reason:"notebooksExperiment"});const n=a.Uri.parse(t);await this.stopLanguageServer(n),await this.startLanguageServer(this.languageServerType,n)}))}async get(e){const t=this.getWorkspaceKey(e,this.languageServerType);let n=this.workspaceLanguageServers.get(t);return n||(n=await this.startAndGetLanguageServer(this.languageServerType,e)),Promise.resolve(n)}async stopLanguageServer(e){const t=this.getWorkspaceKey(e,this.languageServerType),n=this.workspaceLanguageServers.get(t);n&&(await n.stopLanguageServer(),n.dispose(),this.workspaceLanguageServers.delete(t))}createLanguageServer(e){let t;switch(e){case l.LanguageServerType.Jedi:t=new y.JediLSExtensionManager(this.serviceContainer,this.lsOutputChannel,this.experimentService,this.workspaceService,this.configurationService,this.interpreterPathService,this.interpreterService,this.environmentService,this.commandManager);break;case l.LanguageServerType.Node:t=new S.PylanceLSExtensionManager(this.serviceContainer,this.lsOutputChannel,this.experimentService,this.workspaceService,this.configurationService,this.interpreterPathService,this.interpreterService,this.environmentService,this.commandManager,this.fileSystem,this.extensions,this.applicationShell);break;case l.LanguageServerType.None:default:t=new b.NoneLSExtensionManager}return this.disposables.push({dispose:async()=>{await t.stopLanguageServer(),t.dispose()}}),t}async refreshLanguageServer(e,t){const n=this.getWorkspaceUri(e),r=this.configurationService.getSettings(n).languageServer;(r!==this.languageServerType||t)&&(await this.stopLanguageServer(e),await this.startLanguageServer(r,n))}getCurrentLanguageServerTypeIsDefault(){return this.configurationService.getSettings().languageServerIsDefault}async onDidChangeConfiguration(e){var t,n;(null!==(n=null===(t=this.workspaceService.workspaceFolders)||void 0===t?void 0:t.map((e=>e.uri)))&&void 0!==n?n:[]).forEach((async t=>{e.affectsConfiguration("python.languageServer",t)?await this.refreshLanguageServer(t):e.affectsConfiguration("python.analysis.pylanceLspClientEnabled",t)&&await this.refreshLanguageServer(t,!0)}))}async onDidChangeInterpreter(e){return this.languageServerType===l.LanguageServerType.Node?Promise.resolve():this.activate(e.uri)}async onDidChangeInterpreterInformation(e){if(!e.envPath||""===e.envPath)return;const t=this.workspaceInterpreters.entries();let n=t.next(),r=n.done||!1;for(;!r;){const[i,o]=n.value,s=a.Uri.parse(i);e.envPath===(null==o?void 0:o.envPath)&&e.path!==(null==o?void 0:o.path)?(await this.activate(s),r=!0):(n=t.next(),r=n.done||!1)}}async extensionsChangeHandler(){this.configurationService.getSettings().languageServer!==this.languageServerType&&await this.refreshLanguageServer()}async onDidChangeWorkspaceFolders(e){if(e.removed.length&&this.languageServerType===l.LanguageServerType.Jedi)for(const t of e.removed)await this.stopLanguageServer(t.uri)}getWorkspaceUri(e){var t,n;let r;return r=e?null===(t=this.workspaceService.getWorkspaceFolder(e))||void 0===t?void 0:t.uri:null===(n=this.interpreterHelper.getActiveWorkspaceUri(e))||void 0===n?void 0:n.folderUri,null!=r?r:a.Uri.parse("default")}getWorkspaceKey(e,t){switch(t){case l.LanguageServerType.Node:return"Pylance";case l.LanguageServerType.None:return"None";default:return this.getWorkspaceUri(e).fsPath}}};function T(e,t){let n;const r=o.basename(t.fsPath);switch(e){case l.LanguageServerType.Jedi:n=a.l10n.t("Starting Jedi language server for {0}.",r);break;case l.LanguageServerType.Node:n=h.LanguageService.startingPylance;break;case l.LanguageServerType.None:n=h.LanguageService.startingNone;break;default:throw new Error(`Unknown language server type: ${e}`)}(0,v.traceLog)(n)}w=r([(0,s.injectable)(),i(0,(0,s.inject)(m.IServiceContainer)),i(1,(0,s.inject)(l.ILanguageServerOutputChannel)),i(2,(0,s.inject)(p.IConfigurationService)),i(3,(0,s.inject)(p.IExperimentService)),i(4,(0,s.inject)(g.IInterpreterHelper)),i(5,(0,s.inject)(p.IInterpreterPathService)),i(6,(0,s.inject)(g.IInterpreterService)),i(7,(0,s.inject)(f.IEnvironmentVariablesProvider)),i(8,(0,s.inject)(u.IWorkspaceService)),i(9,(0,s.inject)(u.ICommandManager)),i(10,(0,s.inject)(d.IFileSystem)),i(11,(0,s.inject)(p.IExtensions)),i(12,(0,s.inject)(u.IApplicationShell)),i(13,(0,s.inject)(p.IDisposableRegistry))],w),t.LanguageServerWatcher=w},42310:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileLogger=void 0;const r=n(73837),i=n(41719);function o(e,...t){return e?`[${e.toUpperCase()} ${(0,i.getTimeForLogging)()}]: ${r.format(...t)}\r\n`:`${r.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,n)=>{"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.registerLogger=void 0;const r=n(55674),i=n(25472),o=n(70057),s=n(54813),a=n(42310),c=n(49903),l=n(41719),u=c.TraceOptions.Arguments|c.TraceOptions.ReturnValue;let d=[];function p(e){return d.push(e),{dispose:()=>{d=d.filter((t=>t!==e))}}}function h(...e){d.forEach((t=>t.traceError(...e)))}function f(...e){d.forEach((t=>t.traceWarn(...e)))}function g(...e){d.forEach((t=>t.traceInfo(...e)))}function m(...e){d.forEach((t=>t.traceVerbose(...e)))}function v(e){return function(t,n,r){const s=r.value;return r.value=function(...n){const r={kind:"Class",name:t&&t.constructor?t.constructor.name:"",args:n},a=this;return function(e,t){const r=new o.StopWatch;try{const t=s.apply(a,n);return(0,i.isPromise)(t)?t.then((t=>(e({elapsed:r.elapsedTime,returnValue:t}),t))).catch((t=>{e({elapsed:r.elapsedTime,err:t})})):e({elapsed:r.elapsedTime,returnValue:t}),t}catch(t){throw e({elapsed:r.elapsedTime,err:t}),t}}((t=>e(r,t)))},r}}function y(e){return v(((t,n)=>function(e,t,n){const r=function(e,t,n){n=function(e){let{kind:t,name:n,args:r}=e;return t&&""!==t||(t="Function"),n&&""!==n||(n=""),r||(r=[]),{kind:t,name:n,args:r}}(n);const r=[e.message];return r.push(`${n.kind} name = ${n.name}`.trim(),`completed in ${t.elapsed}ms`,`has a ${t.returnValue?"truthy":"falsy"} return value`),(e.opts&c.TraceOptions.Arguments)===c.TraceOptions.Arguments&&r.push((0,l.argsToLogString)(n.args)),(e.opts&c.TraceOptions.ReturnValue)===c.TraceOptions.ReturnValue&&r.push((0,l.returnValueToLogString)(t.returnValue)),r.join(", ")}(e,t,n);void 0===t.err?(!e.level||e.level>c.LogLevel.Error)&&b(c.LogLevel.Info,[r]):(b(c.LogLevel.Error,[r,t.err]),(0,s.sendTelemetryEvent)("ERROR",void 0,void 0,t.err))}(e,n,t)))}function b(e,...t){switch(e){case c.LogLevel.Error:h(...t);break;case c.LogLevel.Warning:f(...t);break;case c.LogLevel.Info:g(...t);break;case c.LogLevel.Debug:m(...t)}}t.registerLogger=p,t.initializeFileLogging=function(e){if(process.env.VSC_PYTHON_LOG_FILE){const t=new a.FileLogger((0,r.createWriteStream)(process.env.VSC_PYTHON_LOG_FILE));e.push(t),e.push(p(t))}},t.traceLog=function(...e){d.forEach((t=>t.traceLog(...e)))},t.traceError=h,t.traceWarn=f,t.traceInfo=g,t.traceVerbose=m,t.traceDecoratorVerbose=function(e,t=u){return y({message:e,opts:t,level:c.LogLevel.Debug})},t.traceDecoratorError=function(e){return y({message:e,opts:u,level:c.LogLevel.Error})},t.traceDecoratorInfo=function(e){return y({message:e,opts:u,level:c.LogLevel.Info})},t.traceDecoratorWarn=function(e){return y({message:e,opts:u,level:c.LogLevel.Warning})},t.logTo=b},4247:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OutputChannelLogger=void 0;const r=n(73837);t.OutputChannelLogger=class{constructor(e){this.channel=e}traceLog(...e){this.channel.appendLine(r.format(...e))}traceError(...e){this.channel.error(r.format(...e))}traceWarn(...e){this.channel.warn(r.format(...e))}traceInfo(...e){this.channel.info(r.format(...e))}traceVerbose(...e){this.channel.debug(r.format(...e))}}},4867:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logAndNotifyOnLegacySettings=void 0;const r=n(66828),i=n(19735),o=n(77570),s=n(56693),a=n(85261),c=n(67098),l=n(98638);let u=!1;t.logAndNotifyOnLegacySettings=function(){const e=function(){var e;let t=!1;return null===(e=(0,a.getWorkspaceFolders)())||void 0===e||e.forEach((async e=>{let n=(0,a.getConfiguration)("editor",{uri:e.uri,languageId:"python"});n||(n=(0,a.getConfiguration)("editor",e.uri),n||(0,i.traceError)("Unable to get editor configuration"));const r=n.get("defaultFormatter","");(0,i.traceInfo)(`Default formatter is set to ${r} for workspace ${e.uri.fsPath}`),r===o.PVSC_EXTENSION_ID&&(t=!0,(0,i.traceError)('The setting "editor.defaultFormatter" for Python is set to "ms-python.python" which is deprecated.'),(0,i.traceError)("Formatting features have been moved to separate formatter extensions."),(0,i.traceError)("See here for more information: https://code.visualstudio.com/docs/python/formatting"),(0,i.traceError)("Please install the formatter extension you prefer and set it as the default formatter."),(0,i.traceError)("For `autopep8` use: https://marketplace.visualstudio.com/items?itemName=ms-python.autopep8"),(0,i.traceError)("For `black` use: https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter"),(0,i.traceError)("For `yapf` use: https://marketplace.visualstudio.com/items?itemName=eeyore.yapf"))})),t}(),t=function(){var e;let t=!1;return null===(e=(0,a.getWorkspaceFolders)())||void 0===e||e.forEach((async e=>{let n=(0,a.getConfiguration)("python",{uri:e.uri,languageId:"python"});n||(n=(0,a.getConfiguration)("python",e.uri),n||(0,i.traceError)("Unable to get editor configuration")),["pylint","flake8","mypy","pydocstyle","pylama","pycodestyle","bandit","prospector"].forEach((e=>{n.get(`linting.${e}Enabled`,!1)&&(t=!0,(0,i.traceError)(`Following setting is deprecated: "python.linting.${e}Enabled"`),(0,i.traceError)('All settings starting with "python.linting." are deprecated and can be removed from settings.'),(0,i.traceError)("Linting features have been moved to separate linter extensions."),(0,i.traceError)("See here for more information: https://code.visualstudio.com/docs/python/linting"),"pylint"===e||"flake8"===e?(0,i.traceError)(`Please install "${e}" extension: https://marketplace.visualstudio.com/items?itemName=ms-python.${e}`):"mypy"===e?(0,i.traceError)(`Please install "${e}" extension: https://marketplace.visualstudio.com/items?itemName=ms-python.mypy-type-checker`):["pydocstyle","pylama","pycodestyle","bandit"].includes(e)&&(0,i.traceError)(`Selected linter "${e}" may be supported by extensions like "Ruff", which include several linter rules: https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff`))}))})),t}();(e||t)&&setImmediate((()=>async function(){u||(u=!0,await(0,s.showWarningMessage)(r.l10n.t("You have deprecated linting or formatting settings for Python. Please see the [logs](command:{0}) for more details.",o.Commands.ViewOutput),c.Common.learnMore)===c.Common.learnMore&&(0,l.executeCommand)("vscode.open","https://aka.ms/AAlgvkb"))}().ignoreErrors()))}},49903:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.TraceOptions=t.LogLevel=void 0,(r=t.LogLevel||(t.LogLevel={}))[r.Off=0]="Off",r[r.Trace=1]="Trace",r[r.Debug=2]="Debug",r[r.Info=3]="Info",r[r.Warning=4]="Warning",r[r.Error=5]="Error",(n=t.TraceOptions||(t.TraceOptions={}))[n.None=0]="None",n[n.Arguments=1]="Arguments",n[n.ReturnValue=2]="ReturnValue"},41719:(e,t)=>{"use strict";function n(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}: ${n(e,"argument")}`)).join(", ")}catch(e){return""}},t.returnValueToLogString=function(e){return`Return Value: ${n(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,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildProposedApi=void 0;const r=n(70301);t.buildProposedApi=function(e,t){let n;try{n={...(0,r.buildDeprecatedProposedApi)(e,t)}}catch(e){n={}}return{...n}}},61673:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchJsonCodeActionProvider=void 0;const r=n(66828);t.LaunchJsonCodeActionProvider=class{provideCodeActions(e,t,n){return n.diagnostics.filter((e=>'Incorrect type. Expected "string".'===e.message)).map((t=>this.createFix(e,t)))}createFix(e,t){const n=`"${e.getText(t.range)}"`,i=new r.CodeAction(`Convert to ${n}`,r.CodeActionKind.QuickFix);return i.edit=new r.WorkspaceEdit,i.edit.replace(e.uri,t.range,n),i}}},76530:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CodeActionProviderService=void 0;const o=n(86700),s=n(61684),a=n(61673);let c=class{constructor(e){this.disposableRegistry=e,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!1}}async activate(){const e=n(66828);this.disposableRegistry.push(e.languages.registerCodeActionsProvider({scheme:"file",language:"jsonc",pattern:"**/launch.json"},new a.LaunchJsonCodeActionProvider,{providedCodeActionKinds:[e.CodeActionKind.QuickFix]}))}};c=r([(0,o.injectable)(),i(0,(0,o.inject)(s.IDisposableRegistry))],c),t.CodeActionProviderService=c},76687:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ReplProvider=void 0;const i=n(17585),o=n(77570),s=n(3481),a=n(18639),c=n(54813),l=n(61522),u=n(43200);class d{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(a.IInterpreterService);if(!await t.getActiveInterpreter(e))return void this.serviceContainer.get(i.ICommandManager).executeCommand(o.Commands.TriggerEnvironmentSelection,e).then(s.noop,s.noop);const n=this.serviceContainer.get(u.ICodeExecutionService,"repl");await n.initializeRepl(e)}}r([(0,c.captureTelemetry)(l.EventName.REPL)],d.prototype,"commandHandler",null),t.ReplProvider=d},43768:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const r=n(90819),i=n(76530);t.registerTypes=function(e){e.addSingleton(r.IExtensionSingleActivationService,i.CodeActionProviderService)}},8593:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalProvider=void 0;const i=n(17585),o=n(77570),s=n(46747),a=n(58400),c=n(61684),l=n(36952),u=n(54813),d=n(61522);class p{constructor(e){this.serviceContainer=e,this.disposables=[],this.registerCommands(),this.activeResourceService=this.serviceContainer.get(i.IActiveResourceService)}async initialize(e){const t=this.serviceContainer.get(c.IConfigurationService),n=this.serviceContainer.get(c.IExperimentService),r=t.getSettings(this.activeResourceService.getActiveResource());if(e&&r.terminal.activateEnvInCurrentTerminal&&!(0,s.inTerminalEnvVarExperiment)(n)){const t="hideFromUser"in e.creationOptions&&e.creationOptions.hideFromUser;if(!t){const t=this.serviceContainer.get(a.ITerminalActivator);await t.activateEnvironmentInTerminal(e,{preserveFocus:!0})}(0,u.sendTelemetryEvent)(d.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(a.ITerminalServiceFactory),t=this.activeResourceService.getActiveResource();await e.createTerminalService(t,"Python").show(!1)}}r([(0,l.swallowExceptions)("Failed to initialize terminal provider")],p.prototype,"initialize",null),r([(0,u.captureTelemetry)(d.EventName.TERMINAL_CREATE,{triggeredBy:"commandpalette"})],p.prototype,"onCreateTerminal",null),t.TerminalProvider=p},11069:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPythonEnvironments=void 0;class n{constructor(e){this.getLocator=e}async activate(){this.locator=await this.getLocator()}get onProgress(){return this.locator.onProgress}get refreshState(){return this.locator.refreshState}getRefreshPromise(e){return this.locator.getRefreshPromise(e)}get onChanged(){return this.locator.onChanged}getEnvs(e){return this.locator.getEnvs(e)}async resolveEnv(e){return this.locator.resolveEnv(e)}async triggerRefresh(e,t){return this.locator.triggerRefresh(e,t)}}t.createPythonEnvironments=async function(e){const t=new n(e);return await t.activate(),t}},44773:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.comparePythonVersionSpecificity=t.areSameEnv=t.getEnvID=t.getEnvPath=t.setEnvDisplayString=t.copyEnvInfo=t.areEnvsDeepEqual=t.buildEnvInfo=void 0;const r=n(96486),i=n(71017),o=n(3522),s=n(87450),a=n(37769),c=n(24563),l=n(95084),u=n(45878);function d(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),void 0!==t.type&&(e.type=t.type)}function p(e,t=!1){const n=t||u.globallyInstalledEnvKinds.includes(e.kind),r=!u.virtualEnvKinds.includes(e.kind),s=["Python"];if(e.version&&!(0,l.isVersionEmpty)(e.version)&&s.push((0,l.getVersionDisplayString)(e.version)),r){const t=(0,o.getArchitectureDisplayName)(e.arch);""!==t&&s.push(t)}const a=[];if(e.name&&""!==e.name)a.push(`'${e.name}'`);else if(e.location&&""!==e.location&&e.kind===u.PythonEnvKind.Conda){const t=i.basename(e.location);a.push(`'${t}'`)}if(n){const t=(0,c.getKindDisplayName)(e.kind);""!==t&&a.push(t)}const d=0===a.length?"":`(${a.join(": ")})`;return`${s.join(" ")} ${d}`.trim()}function h(e){if("string"==typeof e){if(""===e)return;return{id:"",executable:{filename:e,sysPrefix:"",ctime:-1,mtime:-1}}}return"executablePath"in e?{id:"",executable:{filename:e.executablePath,sysPrefix:"",ctime:-1,mtime:-1},location:e.envPath,kind:e.kind,source:e.source}:e}function f(e,t){let n={path:e,pathType:"interpreterPath"};return t&&!(0,a.isParentPath)(e,t)&&(n={path:t,pathType:"envFolderPath"}),n}function g(e,t){return(0,a.normCasePath)(f(e,t).path)}function m(e){var t,n;let r=0;return e.major>0&&(r+=20),e.minor>=0&&(r+=10),e.micro>=0&&(r+=5),(null===(t=e.release)||void 0===t?void 0:t.level)&&(r+=3),((null===(n=e.release)||void 0===n?void 0:n.serial)||e.sysVersion)&&(r+=1),r}t.buildEnvInfo=function(e){var t,n,r,i,o,a,c,l,p;const h={name:null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"",location:"",kind:u.PythonEnvKind.Unknown,executable:{filename:"",sysPrefix:null!==(n=null==e?void 0:e.sysPrefix)&&void 0!==n?n:"",ctime:null!==(i=null===(r=null==e?void 0:e.fileInfo)||void 0===r?void 0:r.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:u.PythonReleaseLevel.Final,serial:0}},arch:null!==(c=null==e?void 0:e.arch)&&void 0!==c?c:s.Architecture.Unknown,distro:{org:null!==(l=null==e?void 0:e.org)&&void 0!==l?l:""},source:null!==(p=null==e?void 0:e.source)&&void 0!==p?p:[],pythonRunCommand:null==e?void 0:e.pythonRunCommand,identifiedUsingNativeLocator:null==e?void 0:e.identifiedUsingNativeLocator};return void 0!==e&&d(h,e),h.id=g(h.executable.filename,h.location),h},t.areEnvsDeepEqual=function(e,t){var n,i,o,s,c,l,u,d;const p=(0,r.cloneDeep)(e),h=(0,r.cloneDeep)(t);delete p.searchLocation,delete h.searchLocation,p.source=p.source.sort(),h.source=h.source.sort();const f=null!==(i=null===(n=e.searchLocation)||void 0===n?void 0:n.fsPath)&&void 0!==i?i:"",g=null!==(s=null===(o=t.searchLocation)||void 0===o?void 0:o.fsPath)&&void 0!==s?s:"",m=null!==(l=null===(c=e.searchLocation)||void 0===c?void 0:c.scheme)&&void 0!==l?l:"",v=null!==(d=null===(u=t.searchLocation)||void 0===u?void 0:u.scheme)&&void 0!==d?d:"";return(0,r.isEqual)(p,h)&&(0,a.arePathsSame)(f,g)&&m===v},t.copyEnvInfo=function(e,t){const n=(0,r.cloneDeep)(e);return void 0!==t&&d(n,t),n},t.setEnvDisplayString=function(e){e.display=p(e),e.detailedDisplayName=p(e,!0)},t.getEnvPath=f,t.getEnvID=g,t.areSameEnv=function(e,t,n=!0){var r,o,s,c;const u=h(e),d=h(t);if(void 0===u||void 0===d)return;if((null===(r=u.executable)||void 0===r?void 0:r.filename)&&!(null===(o=d.executable)||void 0===o?void 0:o.filename)||!(null===(s=u.executable)||void 0===s?void 0:s.filename)&&(null===(c=d.executable)||void 0===c?void 0:c.filename))return!1;if(u.id&&u.id===d.id)return!0;const p=u.executable.filename,f=d.executable.filename;if(g(p,u.location)===g(f,d.location))return!0;if(n&&"python"!==p&&"python"!==f&&(0,a.arePathsSame)(i.dirname(p),i.dirname(f))){const n="string"==typeof e?void 0:u.version,r="string"==typeof t?void 0:d.version;if(n&&r&&((0,l.areIdenticalVersion)(n,r)||(0,l.areSimilarVersions)(n,r)))return!0}return!1},t.comparePythonVersionSpecificity=function(e,t){return Math.sign(m(e)-m(t))}},24563:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrioritizedEnvKinds=t.getKindDisplayName=void 0;const r=n(45878);t.getKindDisplayName=function(e){for(const[t,n]of[[r.PythonEnvKind.System,"system"],[r.PythonEnvKind.MicrosoftStore,"Microsoft Store"],[r.PythonEnvKind.Pyenv,"pyenv"],[r.PythonEnvKind.Poetry,"Poetry"],[r.PythonEnvKind.Hatch,"Hatch"],[r.PythonEnvKind.Custom,"custom"],[r.PythonEnvKind.Venv,"venv"],[r.PythonEnvKind.VirtualEnv,"virtualenv"],[r.PythonEnvKind.VirtualEnvWrapper,"virtualenv"],[r.PythonEnvKind.Pipenv,"Pipenv"],[r.PythonEnvKind.Conda,"conda"],[r.PythonEnvKind.ActiveState,"ActiveState"]])if(e===t)return n;return""},t.getPrioritizedEnvKinds=function(){return[r.PythonEnvKind.Pyenv,r.PythonEnvKind.Conda,r.PythonEnvKind.MicrosoftStore,r.PythonEnvKind.Pipenv,r.PythonEnvKind.Poetry,r.PythonEnvKind.Hatch,r.PythonEnvKind.Venv,r.PythonEnvKind.VirtualEnvWrapper,r.PythonEnvKind.VirtualEnv,r.PythonEnvKind.ActiveState,r.PythonEnvKind.OtherVirtual,r.PythonEnvKind.OtherGlobal,r.PythonEnvKind.System,r.PythonEnvKind.Custom,r.PythonEnvKind.Unknown]}},67931:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvironmentInfoService=t.EnvironmentInfoServiceQueuePriority=void 0;const r=n(59314),i=n(97749),o=n(67029),s=n(24708),a=n(19735),c=n(75470),l=n(45878),u=n(37769),d=n(4057),p=n(87450),h=n(95084);var f;async function g(e,t=!0){const n=[e.executable.filename];return t?n.push("-I",d.OUTPUT_MARKER_SCRIPT):n.push(d.OUTPUT_MARKER_SCRIPT),await(0,o.getInterpreterInfo)((0,s.buildPythonExecInfo)(n,void 0,e.executable.filename))}async function m(e){const t=await c.Conda.getConda(),n=e.location.length?e.location:e.executable.filename,r=await(null==t?void 0:t.getCondaEnvironment(n));if(!r)return;const i=await(null==t?void 0:t.getRunPythonArgs(r,!0,!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"}(f=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 n=e.executable.filename,i=this.cache.get((0,u.normCasePath)(n));if(void 0!==i)return i.promise;const o=(0,r.createDeferred)(),s=v.getInterpreterInfo(e);return void 0!==s?(this.cache.set((0,u.normCasePath)(n),o),o.resolve(s),s):(this.cache.set((0,u.normCasePath)(n),o),this._getEnvironmentInfo(e,t).then((e=>{o.resolve(e)})).catch((e=>{o.reject(e)})),o.promise)}async getMandatoryEnvironmentInfo(e,t){const n=e.executable.filename,i=this.cache.get((0,u.normCasePath)(n));if(void 0!==i)return i.promise;const o=(0,r.createDeferred)(),s=v.getInterpreterInfo(e,!0);return void 0!==s?(this.cache.set((0,u.normCasePath)(n),o),o.resolve(s),s):(this.cache.set((0,u.normCasePath)(n),o),this._getEnvironmentInfo(e,t).then((e=>{o.resolve(e)})).catch((e=>{o.reject(e)})),o.promise)}async _getEnvironmentInfo(e,t,n=!0){if(e.kind===l.PythonEnvKind.Conda&&"python"===e.executable.filename)return{arch:p.Architecture.Unknown,executable:{filename:"python",ctime:-1,mtime:-1,sysPrefix:""},version:(0,h.getEmptyVersion)()};let o;void 0===this.workerPool&&(this.workerPool=(0,i.createRunningWorkerPool)(g));let s=await y(this.workerPool,e,t).catch((e=>{o=e}));if(void 0===s)if(e.kind===l.PythonEnvKind.Conda||await(0,c.isCondaEnvironment)(e.executable.filename))(0,a.traceVerbose)(`Validating ${e.executable.filename} normally failed with error, falling back to using conda run: (${o})`),void 0===this.condaRunWorkerPool&&(this.condaRunWorkerPool=(0,i.createRunningWorkerPool)(m)),s=await y(this.condaRunWorkerPool,e,t).catch((e=>{(0,a.traceError)(e)}));else if(o){if(o.message.includes("Unknown option: -I")||o.message.includes("ModuleNotFoundError: No module named 'encodings'"))return(0,a.traceWarn)(o),o.message.includes("Unknown option: -I")&&(0,a.traceError)("Support for Python 2.7 has been dropped by the Python extension so certain features may not work, upgrade to using Python 3."),g(e,!1).catch((e=>{(0,a.traceError)(e)}));(0,a.traceError)(o)}return void 0===s&&n?(0,r.sleep)(2e3).then((()=>this._getEnvironmentInfo(e,t,!1))):s}resetInfo(e){const t=e.fsPath;Array.from(this.cache.keys()).forEach((e=>{e.startsWith((0,u.normCasePath)(t))&&this.cache.delete(e)}))}static getInterpreterInfo(e,t){return t&&e.version.major>-1&&e.version.minor>-1&&e.location||e.version.major>-1&&e.version.minor>-1&&e.version.micro>-1&&e.location?{arch:e.arch,executable:{filename:e.executable.filename,ctime:-1,mtime:-1,sysPrefix:e.location},version:e.version}:void 0}}function y(e,t,n){return n===f.High?e.addToQueue(t,i.QueuePosition.Front):e.addToQueue(t,i.QueuePosition.Back)}let b;t.getEnvironmentInfoService=function(e){if(void 0===b){const t=new v;null==e||e.push({dispose:()=>{t.dispose(),b=void 0}}),b=t}return b}},82035:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseVersionFromExecutable=void 0;const r=n(71017),i=n(87450),o=n(95084),s=n(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)}(r.basename(e));return 2===t.major&&-1===t.minor&&(t.minor=7),t}},45878:(e,t)=>{"use strict";var n,r,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.UNKNOWN_PYTHON_VERSION=t.PythonReleaseLevel=t.PythonEnvSource=t.globallyInstalledEnvKinds=t.virtualEnvKinds=t.PythonEnvType=t.PythonEnvKind=void 0,function(e){e.Unknown="unknown",e.System="global-system",e.MicrosoftStore="global-microsoft-store",e.Pyenv="global-pyenv",e.Poetry="poetry",e.Hatch="hatch",e.ActiveState="activestate",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"}(n=t.PythonEnvKind||(t.PythonEnvKind={})),(o=t.PythonEnvType||(t.PythonEnvType={})).Conda="Conda",o.Virtual="Virtual",t.virtualEnvKinds=[n.Poetry,n.Hatch,n.Pipenv,n.Venv,n.VirtualEnvWrapper,n.Conda,n.VirtualEnv],t.globallyInstalledEnvKinds=[n.OtherGlobal,n.Unknown,n.MicrosoftStore,n.System,n.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"}(r=t.PythonReleaseLevel||(t.PythonReleaseLevel={})),t.UNKNOWN_PYTHON_VERSION={major:-1,minor:-1,micro:-1,release:{level:r.Final,serial:-1},sysVersion:void 0},Object.freeze(t.UNKNOWN_PYTHON_VERSION)},67029:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterpreterInfo=void 0;const r=n(77570),i=n(4057),o=n(87450),s=n(19735),a=n(37769),c=n(24708),l=n(95084);t.getInterpreterInfo=async function(e,t){const[n,u]=(0,i.interpreterInfo)(),d=(0,c.copyPythonExecInfo)(e,n),p=[d.command,...d.args].reduce(((e,t)=>e?`${e} ${t.toCommandArgumentForPythonExt()}`:`${t.toCommandArgumentForPythonExt()}`),""),h=r.isCI?3e4:15e3,f=await(0,a.shellExecute)(p,{timeout:null!=t?t:h});let g;f.stderr&&(0,s.traceError)(`Stderr when executing script with >> ${p} << stderr: ${f.stderr}, still attempting to parse output`);try{g=u(f.stdout)}catch(e){return void(0,s.traceError)(`Failed to parse interpreter information for >> ${p} << with ${e}`)}return(0,s.traceVerbose)(`Found interpreter for >> ${p} <<: ${JSON.stringify(g)}`),function(e,t){let n=`${t.versionInfo.slice(0,3).join(".")}`;if(void 0!==t.versionInfo[3]&&["final","alpha","beta","candidate"].includes(t.versionInfo[3])&&(n=`${n}-${t.versionInfo[3]}`,void 0!==t.versionInfo[4])){let e=-1;try{e=parseInt(`${t.versionInfo[4]}`,10)}catch(t){e=-1}n=e>=0?`${n}${e}`:n}return{arch:t.is64Bit?o.Architecture.x64:o.Architecture.x86,executable:{filename:e,sysPrefix:t.sysPrefix,mtime:-1,ctime:-1},version:{...(0,l.parseVersion)(n),sysVersion:t.sysVersion}}}(e.pythonExecutable,g)}},95084:(e,t,n)=>{"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 r=n(96486),i=n(71017),o=n(52439),s=n(45878),a=n(19735);function c(e){const[t,n]=u(e);if(-1===t.micro)return t;const[r]=l(n);return t.release=r,t}function l(e){let t,n,r,i,o,a,c,l=e.match(/^(?:-?final|\.final(?:\.0)?)(.*)$/);if(l)[,t]=l,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(l=e.match(o),l){[,n,r,i,a,t]=l;break}if(o)c=s.PythonReleaseLevel.Final;else if(i)c=s.PythonReleaseLevel.Candidate;else if(r)c=s.PythonReleaseLevel.Beta;else{if(!n)return[void 0,e];c=s.PythonReleaseLevel.Alpha}return[{level:c,serial:parseInt(a,10)},t]}function u(e){const t=o.parseBasicVersionInfo(`ignored-${e}`);if(!t){if(""===e)return[d(),""];throw Error(`invalid version ${e}`)}const{version:n,after:r}=t;if(n.release=void 0,-1===n.minor&&n.major>9){const e=10**(n.major.toString().length-1);n.minor=n.major%e,n.major=Math.floor(n.major/e)}return[n,r]}function d(){return(0,r.cloneDeep)(o.EMPTY_VERSION)}function p(e){return o.isVersionInfoEmpty(e)}function h(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=l,t.parseBasicVersion=u,t.getEmptyVersion=d,t.isVersionEmpty=p,t.getVersionDisplayString=function(e){return p(e)?"":-1!==e.micro?h(e):`${h(e)}.x`},t.getShortVersionString=h,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 n=[];return e.release&&(n=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:n}},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,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Locator=t.NOOP_ITERATOR=t.isProgressEvent=t.ProgressReportStage=void 0;const r=n(59314),i=n(34354);var o;(o=t.ProgressReportStage||(t.ProgressReportStage={})).discoveryStarted="discoveryStarted",o.allPathsDiscovered="allPathsDiscovered",o.discoveryFinished="discoveryFinished",t.isProgressEvent=function(e){return"stage"in e},t.NOOP_ITERATOR=(0,r.iterEmpty)(),t.Locator=class extends class{constructor(e){this.emitter=e,this.onChanged=e.onChanged}}{constructor(){super(new i.PythonEnvsWatcher)}}},69270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvs=t.getQueryFilter=void 0;const r=n(59314),i=n(3481),o=n(19735),s=n(44538);t.getQueryFilter=function(e){var t;const n=void 0!==e.kinds&&e.kinds.length>0?e.kinds:void 0,r=!(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===n||n.includes(e.kind)}(e)&&!!function(e){if(void 0===e.searchLocation)return r;const t=e.searchLocation;return void 0===o||o.some((e=>e(t)))}(e)},t.getEnvs=async function(e){const t=[],n=(0,r.createDeferred)();if(void 0===e.onUpdated)n.resolve();else{const r=e.onUpdated((e=>{if((0,s.isProgressEvent)(e)){if(e.stage!==s.ProgressReportStage.discoveryFinished)return;n.resolve(),r.dispose()}else if(void 0!==e.index){const{index:n,update:r}=e;if(void 0===t[n]){const e=JSON.stringify(r);(0,o.traceVerbose)(`Updates sent for an env which was classified as invalid earlier, currently not expected, ${e}`)}t[n]=r}}))}let i=0;for await(const n of e)void 0===t[i]&&(t[i]=n),i+=1;return await n.promise,t.filter((e=>void 0!==e)).map((e=>e))}},2839:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Locators=t.combineIterators=void 0;const r=n(59314),i=n(81837),o=n(44538),s=n(38514);function a(e){const t=(0,r.chain)(e),n=e.map((e=>e.onUpdated)).filter((e=>e));return n&&0!==n.length?(t.onUpdated=e=>{const t=new i.Disposables;let r=n.length;return n.forEach((n=>{const i=n((t=>{(0,o.isProgressEvent)(t)?t.stage===o.ProgressReportStage.discoveryFinished?(r-=1,0===r&&e({stage:o.ProgressReportStage.discoveryFinished})):e({stage:t.stage}):e(t)}));t.push(i)})),t},t):t}t.combineIterators=a;class c extends s.PythonEnvsWatchers{constructor(e){super(e),this.locators=e,this.providerId=e.map((e=>e.providerId)).join("+")}iterEnvs(e){return a(this.locators.map((t=>t.iterEnvs(e))))}}t.Locators=c},40471:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNativeGlobalPythonFinder=void 0;const r=n(66828),i=n(32081),o=n(71017),s=n(95028),a=n(12781),c=n(65243),l=n(63281),u=n(19735),d=n(59314),p=(0,c.isWindows)()?o.join(l.EXTENSION_ROOT_DIR,"native_locator","bin","python-finder.exe"):o.join(l.EXTENSION_ROOT_DIR,"native_locator","bin","python-finder");class h{constructor(){this._onDidFindPythonEnvironment=new r.EventEmitter,this._onDidFindEnvironmentManager=new r.EventEmitter,this.onDidFindPythonEnvironment=this._onDidFindPythonEnvironment.event,this.onDidFindEnvironmentManager=this._onDidFindEnvironmentManager.event}startSearch(e){const t=(0,d.createDeferred)(),n=i.spawn(p,[],{env:process.env}),o=[],c=new a.PassThrough;n.stdout.pipe(c,{end:!1});const l=new a.PassThrough;l.pipe(n.stdin,{end:!1});const h=new r.Disposable((()=>{c.end(),l.end()})),f=s.createMessageConnection(new s.StreamMessageReader(c),new s.StreamMessageWriter(l));return o.push(f,h,f.onError((e=>{h.dispose(),(0,u.traceError)("Error in Native Python Finder",e)})),f.onNotification("pythonEnvironment",(e=>{this._onDidFindPythonEnvironment.fire(e)})),f.onNotification("envManager",(e=>{this._onDidFindEnvironmentManager.fire(e)})),f.onNotification("exit",(()=>{(0,u.traceInfo)("Native Python Finder exited"),h.dispose()})),f.onNotification("log",(e=>{switch(e.level){case"info":(0,u.traceInfo)(`Native Python Finder: ${e.message}`);break;case"warning":(0,u.traceWarn)(`Native Python Finder: ${e.message}`);break;case"error":(0,u.traceError)(`Native Python Finder: ${e.message}`);break;case"debug":(0,u.traceVerbose)(`Native Python Finder: ${e.message}`);break;default:(0,u.traceLog)(`Native Python Finder: ${e.message}`)}})),f.onClose((()=>{t.resolve(),o.forEach((e=>e.dispose()))})),{dispose:()=>{try{null===n.exitCode&&n.kill()}catch(e){(0,u.traceVerbose)("Error while disposing Native Python Finder",e)}}}),e&&o.push(e.onCancellationRequested((()=>{t.resolve();try{n.kill()}catch(e){(0,u.traceVerbose)("Error while handling cancellation request for Native Python Finder",e)}}))),f.listen(),t.promise}dispose(){this._onDidFindPythonEnvironment.dispose(),this._onDidFindEnvironmentManager.dispose()}}t.createNativeGlobalPythonFinder=function(){return new h}},77882:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LazyResourceBasedLocator=void 0;const r=n(59314),i=n(81837),o=n(19735),s=n(37769),a=n(44773),c=n(44538);class l extends c.Locator{constructor(){super(...arguments),this.disposables=new i.Disposables}async activate(){await this.ensureResourcesReady(),this.ensureWatchersReady().ignoreErrors()}async dispose(){await this.disposables.dispose()}async*iterEnvs(e){await this.activate();const t=this.doIterEnvs(e);if(null==e?void 0:e.envPath){let n=await t.next();for(;!n.done;){const r=n.value,{path:i}=(0,a.getEnvPath)(r.executablePath,r.envPath);if((0,s.arePathsSame)(i,e.envPath)){yield r;break}n=await t.next()}}else yield*t}async initResources(){}async initWatchers(){}async ensureResourcesReady(){void 0===this.resourcesReady?(this.resourcesReady=(0,r.createDeferred)(),await this.initResources().catch((e=>{var t;(0,o.traceError)(e),null===(t=this.resourcesReady)||void 0===t||t.reject(e)})),this.resourcesReady.resolve()):await this.resourcesReady.promise}async ensureWatchersReady(){void 0===this.watchersReady?(this.watchersReady=(0,r.createDeferred)(),(0,s.isVirtualWorkspace)()||await this.initWatchers().catch((e=>{var t;(0,o.traceError)(e),null===(t=this.watchersReady)||void 0===t||t.reject(e)})),this.watchersReady.resolve()):await this.watchersReady.promise}}t.LazyResourceBasedLocator=l},97954:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCollectionCache=t.PythonEnvInfoCache=void 0;const r=n(77570),i=n(19735),o=n(37769),s=n(45878),a=n(44773),c=n(34354),l=n(75470);class u extends c.PythonEnvsWatcher{constructor(e){super(),this.persistentStorage=e,this.envs=[],this.validatedEnvs=new Set,this.flushedEnvs=new Set}async validateCache(e,t){(await Promise.all(this.envs.map((async n=>{const{path:r}=(0,a.getEnvPath)(n.executable.filename,n.location);if(await(0,o.pathExists)(r)){if(!e||!t)return!0;if(n.searchLocation)return!0;if(e.some((e=>n.id===e.id)))return!0;if(Array.from(this.validatedEnvs.keys()).some((e=>n.id===e)))return!0}return!1})))).map(((e,t)=>e?-1:t)).filter((e=>-1!==e)).reverse().forEach((e=>{const t=this.envs.splice(e,1)[0];(0,i.traceVerbose)(`Removing invalid env from cache ${t.id}`),this.fire({old:t,new:void 0})})),e&&e.forEach((e=>{const t=this.envs.find((t=>t.id===e.id));t&&!(0,a.areEnvsDeepEqual)(t,e)&&this.updateEnv(t,e,!0)}))}getAllEnvs(){return this.envs}addEnv(e,t){const n=this.envs.find((t=>(0,a.areSameEnv)(t,e)));n?t&&!this.validatedEnvs.has(e.id)&&this.updateEnv(n,e,!0):(this.envs.push(e),this.fire({new:e})),t&&((0,i.traceVerbose)(`Flushing env to cache ${e.id}`),this.validatedEnvs.add(e.id),this.flush(e).ignoreErrors())}updateEnv(e,t,n=!1){if(this.flushedEnvs.has(e.id)&&!n)return;const r=this.envs.findIndex((t=>(0,a.areSameEnv)(t,e)));-1!==r&&(void 0===t?this.envs.splice(r,1):this.envs[r]=t,this.fire({old:e,new:t}))}async getLatestInfo(e){var t;const n=null!==(t=this.envs.find((t=>(0,o.arePathsSame)(t.location,e))))&&void 0!==t?t:this.envs.find((t=>(0,a.areSameEnv)(t,e)));if((null==n?void 0:n.kind)===s.PythonEnvKind.Conda&&"envFolderPath"===(0,a.getEnvPath)(n.executable.filename,n.location).pathType)return await(0,o.pathExists)((0,l.getCondaInterpreterPath)(n.location))?void this.validatedEnvs.delete(n.id):(this.validatedEnvs.add(n.id),n);if(n){if(this.validatedEnvs.has(n.id))return(0,i.traceVerbose)(`Found cached env for ${e}`),n;if(await this.validateInfo(n))return(0,i.traceVerbose)(`Needed to validate ${e} with latest info`),this.validatedEnvs.add(n.id),n}(0,i.traceVerbose)(`No cached env found for ${e}`)}clearAndReloadFromStorage(){this.envs=this.persistentStorage.get(),this.markAllEnvsAsFlushed()}async flush(e){if(e){const t=this.persistentStorage.get(),n=t.findIndex((t=>t.id===e.id));return t[n]=e,this.flushedEnvs.add(e.id),void await this.persistentStorage.store(t)}(0,i.traceVerbose)("Environments added to cache",JSON.stringify(this.envs)),this.markAllEnvsAsFlushed(),await this.persistentStorage.store(this.envs)}markAllEnvsAsFlushed(){this.envs.forEach((e=>{this.flushedEnvs.add(e.id)}))}async validateInfo(e){if(!this.flushedEnvs.has(e.id))return!1;if(-1===e.version.micro||-1===e.version.major||-1===e.version.minor)return!1;const{ctime:t,mtime:n}=await(0,o.getFileInfo)(e.executable.filename);return-1!==t&&-1!==n&&t===e.executable.ctime&&n===e.executable.mtime||(e.executable.ctime=t,e.executable.mtime=n,!1)}}t.PythonEnvInfoCache=u,t.createCollectionCache=async function(e){const t=new u(e);return t.clearAndReloadFromStorage(),await async function(e){return(0,r.isTestExecution)()?e.validateCache():e.validateCache().ignoreErrors()}(t),t}},17021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnvsCollectionService=void 0;const r=n(66828);n(32727);const i=n(59314),o=n(70057),s=n(19735),a=n(54813),c=n(61522),l=n(37769),u=n(45878),d=n(44773),p=n(44538),h=n(69270),f=n(34354);class g extends f.PythonEnvsWatcher{constructor(e,t,n){super(),this.cache=e,this.locator=t,this.usingNativeLocator=n,this.refreshesPerQuery=new Map,this.scheduledRefreshesPerQuery=new Map,this.progressPromises=new Map,this.hasRefreshFinishedForQuery=new Map,this.progress=new r.EventEmitter,this.refreshState=p.ProgressReportStage.discoveryFinished,this.locator.onChanged((e=>{const t=e.providerId?{providerId:e.providerId,envPath:e.envPath}:void 0;let n=this.scheduledRefreshesPerQuery.get(t);n||(n=this.scheduleNewRefresh(t)),n.then((()=>{this.fire(e)}))})),this.cache.onChanged((e=>{this.fire(e)})),this.onProgress((e=>{var t;this.refreshState=e.stage,null===(t=this.progressPromises.get(e.stage))||void 0===t||t.resolve(),this.progressPromises.delete(e.stage)}))}get onProgress(){return this.progress.event}getRefreshPromise(e){var t,n;const r=null!==(t=null==e?void 0:e.stage)&&void 0!==t?t:p.ProgressReportStage.discoveryFinished;return null===(n=this.progressPromises.get(r))||void 0===n?void 0:n.promise}async resolveEnv(e){e=(0,l.normalizePath)(e);const t=await this.cache.getLatestInfo(e);if(t)return t;const n=await this.locator.resolveEnv(e).catch((t=>{(0,s.traceError)(`Failed to resolve ${e}`,t)}));return(0,s.traceVerbose)(`Resolved ${e} using downstream locator`),n&&this.cache.addEnv(n,!0),n}getEnvs(e){const t=this.cache.getAllEnvs();return e?t.filter((0,h.getQueryFilter)(e)):t}triggerRefresh(e,t){let n=this.getRefreshPromiseForQuery(e);if(!n){if((null==t?void 0:t.ifNotTriggerredAlready)&&this.hasRefreshFinished(e))return Promise.resolve();const r=new o.StopWatch;(0,s.traceInfo)("Starting Environment refresh"),n=this.startRefresh(e).then((()=>{this.sendTelemetry(e,r),(0,s.traceInfo)(`Environment refresh took ${r.elapsedTime} milliseconds`)}))}return n}startRefresh(e){return this.createProgressStates(e),this.addEnvsToCacheForQuery(e).then((async()=>{this.resolveProgressStates(e)})).catch((t=>{this.rejectProgressStates(e,t)}))}async addEnvsToCacheForQuery(e){const t=this.locator.iterEnvs(e),n=[],r={done:!1,pending:0},a=(0,i.createDeferred)(),c=new o.StopWatch;if(void 0!==t.onUpdated){const i=t.onUpdated((async t=>{if((0,p.isProgressEvent)(t))switch(t.stage){case p.ProgressReportStage.discoveryFinished:r.done=!0,i.dispose(),(0,s.traceInfo)(`Environments refresh finished (event): ${c.elapsedTime} milliseconds`);break;case p.ProgressReportStage.allPathsDiscovered:e||((0,s.traceInfo)(`Environments refresh paths discovered (event): ${c.elapsedTime} milliseconds`),this.progress.fire(t));break;default:this.progress.fire(t)}else void 0!==t.index&&(r.pending+=1,this.cache.updateEnv(n[t.index],t.update),t.update&&(n[t.index]=t.update),r.pending-=1);r.done&&0===r.pending&&a.resolve()}))}else this.progress.fire({stage:p.ProgressReportStage.discoveryStarted}),a.resolve();for await(const e of t)n.push(e),this.cache.addEnv(e);(0,s.traceInfo)(`Environments refresh paths discovered: ${c.elapsedTime} milliseconds`),await a.promise,await this.cache.validateCache(n,void 0===e),this.cache.flush().ignoreErrors()}getRefreshPromiseForQuery(e){var t,n,r;return null!==(n=null===(t=this.refreshesPerQuery.get(e))||void 0===t?void 0:t.promise)&&void 0!==n?n:null===(r=this.refreshesPerQuery.get(void 0))||void 0===r?void 0:r.promise}hasRefreshFinished(e){var t;return null!==(t=this.hasRefreshFinishedForQuery.get(e))&&void 0!==t?t:this.hasRefreshFinishedForQuery.get(void 0)}async scheduleNewRefresh(e){const t=this.getRefreshPromiseForQuery(e);let n;return t?(n=t.then((()=>{this.scheduledRefreshesPerQuery.delete(e),this.startRefresh(e)})),this.scheduledRefreshesPerQuery.set(e,n)):n=this.startRefresh(e),n}createProgressStates(e){this.refreshesPerQuery.set(e,(0,i.createDeferred)()),Object.values(p.ProgressReportStage).forEach((e=>{this.progressPromises.set(e,(0,i.createDeferred)())})),p.ProgressReportStage.allPathsDiscovered&&e&&this.progressPromises.delete(p.ProgressReportStage.allPathsDiscovered)}rejectProgressStates(e,t){var n;null===(n=this.refreshesPerQuery.get(e))||void 0===n||n.reject(t),this.refreshesPerQuery.delete(e),Object.values(p.ProgressReportStage).forEach((e=>{var n;null===(n=this.progressPromises.get(e))||void 0===n||n.reject(t),this.progressPromises.delete(e)}))}resolveProgressStates(e){var t;null===(t=this.refreshesPerQuery.get(e))||void 0===t||t.resolve(),this.refreshesPerQuery.delete(e),Array.from(this.refreshesPerQuery.values()).every((e=>e.completed))&&this.progress.fire({stage:p.ProgressReportStage.discoveryFinished})}sendTelemetry(e,t){if(!e&&!this.hasRefreshFinished(e)){const e=this.cache.getAllEnvs(),n=e.filter((e=>"envFolderPath"===(0,d.getEnvPath)(e.executable.filename,e.location).pathType)).length,r=e.filter((e=>e.kind===u.PythonEnvKind.ActiveState)).length,i=e.filter((e=>e.kind===u.PythonEnvKind.Conda)).length,o=e.filter((e=>e.kind===u.PythonEnvKind.Custom)).length,s=e.filter((e=>e.kind===u.PythonEnvKind.Hatch)).length,l=e.filter((e=>e.kind===u.PythonEnvKind.MicrosoftStore)).length,p=e.filter((e=>e.kind===u.PythonEnvKind.OtherGlobal)).length,h=e.filter((e=>e.kind===u.PythonEnvKind.OtherVirtual)).length,f=e.filter((e=>e.kind===u.PythonEnvKind.Pipenv)).length,g=e.filter((e=>e.kind===u.PythonEnvKind.Poetry)).length,m=e.filter((e=>e.kind===u.PythonEnvKind.Pyenv)).length,v=e.filter((e=>e.kind===u.PythonEnvKind.System)).length,y=e.filter((e=>e.kind===u.PythonEnvKind.Unknown)).length,b=e.filter((e=>e.kind===u.PythonEnvKind.Venv)).length,S=e.filter((e=>e.kind===u.PythonEnvKind.VirtualEnv)).length,_=e.filter((e=>e.kind===u.PythonEnvKind.VirtualEnvWrapper)).length;(0,a.sendTelemetryEvent)(c.EventName.PYTHON_INTERPRETER_DISCOVERY,t.elapsedTime,{interpreters:this.cache.getAllEnvs().length,usingNativeLocator:this.usingNativeLocator,environmentsWithoutPython:n,activeStateEnvs:r,condaEnvs:i,customEnvs:o,hatchEnvs:s,microsoftStoreEnvs:l,otherGlobalEnvs:p,otherVirtualEnvs:h,pipEnvEnvs:f,poetryEnvs:g,pyenvEnvs:m,systemEnvs:v,unknownEnvs:y,venvEnvs:b,virtualEnvEnvs:S,virtualEnvWrapperEnvs:_})}this.hasRefreshFinishedForQuery.set(e,!0)}}t.EnvsCollectionService=g},30752:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonEnvsReducer=void 0;const r=n(96486),i=n(66828),o=n(19735),s=n(37769),a=n(44773),c=n(24563),l=n(44538);async function u(e,t,n,i,o){n.pending+=1;const a=o[e],l=function(e,t){var n,i;const[o]=function(...e){const t=(0,c.getPrioritizedEnvKinds)();return e.sort(((e,n)=>t.indexOf(e.kind)-t.indexOf(n.kind)))}(e,t),a=(0,r.cloneDeep)(o);return a.source=(0,r.uniq)((null!==(n=e.source)&&void 0!==n?n:[]).concat(null!==(i=t.source)&&void 0!==i?i:[])),a.searchLocation=function(e,t){var n;if(e.searchLocation&&t.searchLocation){if((0,s.isParentPath)(e.searchLocation.fsPath,t.searchLocation.fsPath))return e.searchLocation;if((0,s.isParentPath)(t.searchLocation.fsPath,e.searchLocation.fsPath))return t.searchLocation}return null!==(n=e.searchLocation)&&void 0!==n?n:t.searchLocation}(e,t),a}(a,t);(0,r.isEqual)(a,l)||(o[e]=l,i.fire({index:e,old:a,update:l})),n.pending-=1,d(n,i)}function d(e,t){e.done&&0===e.pending&&(t.fire({stage:l.ProgressReportStage.discoveryFinished}),t.dispose(),(0,o.traceVerbose)("Finished with environment reducer"))}t.PythonEnvsReducer=class{constructor(e){this.parentLocator=e}get onChanged(){return this.parentLocator.onChanged}iterEnvs(e){const t=new i.EventEmitter,n=async function*(e,t){const n={done:!1,pending:0},r=[];if(void 0!==e.onUpdated){const i=e.onUpdated((e=>{if((0,l.isProgressEvent)(e))e.stage===l.ProgressReportStage.discoveryFinished?(n.done=!0,i.dispose()):t.fire(e);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!==e.index&&void 0!==r[e.index]){const n=r[e.index];r[e.index]=e.update,t.fire({index:e.index,old:n,update:e.update})}else(0,o.traceVerbose)(`Expected already iterated env, got ${e.old} (#${e.index})`)}n.pending-=1,d(n,t)}))}else t.fire({stage:l.ProgressReportStage.discoveryStarted});let i=await e.next();for(;!i.done;){const o=i.value,s=r.findIndex((e=>(0,a.areSameEnv)(e,o)));-1!==s?u(s,o,n,t,r).ignoreErrors():(yield o,r.push(o)),i=await e.next()}void 0===e.onUpdated&&(n.done=!0,d(n,t))}(this.parentLocator.iterEnvs(e),t);return n.onUpdated=t.event,n}}},27736:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonEnvsResolver=void 0;const r=n(96486),i=n(66828),o=n(13367),s=n(45878),a=n(44773),c=n(44538),l=n(80640),u=n(19735),d=n(29616),p=n(95084);async function h(e,t){const{path:n}=(0,a.getEnvPath)(e.executablePath,e.envPath);if(e.identifiedUsingNativeLocator)return void t.set(n,e.kind);let r=t.get(n);if(!r){if(!(0,o.isIdentifierRegistered)(e.kind))return;r=await(0,o.identifyEnvironment)(n),t.set(n,r)}e.kind=r}function f(e,t){e.done&&0===e.pending&&(t.fire({stage:c.ProgressReportStage.discoveryFinished}),t.dispose(),(0,u.traceVerbose)("Finished with environment resolver"))}function g(e,t){const n=(0,r.cloneDeep)(t);return n.executable.sysPrefix=e.executable.sysPrefix,"envFolderPath"===(0,a.getEnvPath)(n.executable.filename,n.location).pathType&&t.kind!==s.PythonEnvKind.MicrosoftStore?n.version=(0,p.getEmptyVersion)():n.version=e.version,n.arch=e.arch,(0,a.setEnvDisplayString)(n),n}t.PythonEnvsResolver=class{constructor(e,t){this.parentLocator=e,this.environmentInfoService=t,this.parentLocator.onChanged((e=>{e.type&&void 0!==e.searchLocation&&this.environmentInfoService.resetInfo(e.searchLocation)}))}get onChanged(){return this.parentLocator.onChanged}async resolveEnv(e){const[t,n]=await async function(e){var t;let n,r;return await(0,d.isPythonExecutable)(e).catch((t=>((0,u.traceWarn)("Failed to check if",e,"is an executable",t),!0)))?(n=e,r=(0,d.getEnvironmentDirFromPath)(n)):(r=e,n=null!==(t=await(0,d.getInterpreterPathFromDir)(r))&&void 0!==t?t:""),[n,r]}(e);e=t.length?t:n;const r=await(0,o.identifyEnvironment)(e),i=await(0,l.resolveBasicEnv)({kind:r,executablePath:t,envPath:n}),s=await this.environmentInfoService.getEnvironmentInfo(i);if((0,u.traceVerbose)(`Environment resolver resolved ${e} for ${JSON.stringify(i)} to ${JSON.stringify(s)}`),s)return g(s,i)}iterEnvs(e){const t=new i.EventEmitter,n=this.parentLocator.iterEnvs(e),r=this.iterEnvsIterator(n,t);return r.onUpdated=t.event,r}async*iterEnvsIterator(e,t){const n=new Map,r={done:!1,pending:0},i=[];if(void 0!==e.onUpdated){const o=e.onUpdated((async e=>{if(r.pending+=1,(0,c.isProgressEvent)(e))e.stage===c.ProgressReportStage.discoveryFinished?(t.fire({stage:c.ProgressReportStage.allPathsDiscovered}),r.done=!0,o.dispose()):t.fire(e);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!==e.index&&void 0!==i[e.index]){const o=i[e.index];await h(e.update,n),i[e.index]=await(0,l.resolveBasicEnv)(e.update),t.fire({old:o,index:e.index,update:i[e.index]}),this.resolveInBackground(e.index,r,t,i).ignoreErrors()}else(0,u.traceVerbose)(`Expected already iterated env, got ${e.old} (#${e.index})`)}r.pending-=1,f(r,t)}))}else t.fire({stage:c.ProgressReportStage.discoveryStarted});let o=await e.next();for(;!o.done;){await h(o.value,n);const s=await(0,l.resolveBasicEnv)(o.value);i.push(s),yield s,this.resolveInBackground(i.indexOf(s),r,t,i).ignoreErrors(),o=await e.next()}void 0===e.onUpdated&&(r.done=!0,f(r,t))}async resolveInBackground(e,t,n,r){t.pending+=1;const i=await this.environmentInfoService.getMandatoryEnvironmentInfo(r[e]),o=r[e];if(i){const t=g(i,r[e]);r[e]=t,n.fire({old:o,index:e,update:t})}else n.fire({old:o,index:e,update:void 0});t.pending-=1,f(t,n)}}},80640:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveBasicEnv=void 0;const r=n(71017),i=n(66828),o=n(96486),s=n(45878),a=n(44773),c=n(29616),l=n(37769),u=n(75470),d=n(77826),p=n(87450),h=n(95084),f=n(38366),g=n(82035),m=n(19735),v=n(64715),y=n(85261),b=n(42694);async function S(e){var t;const{executablePath:n}=e;let r;try{r=null!==(t=e.version)&&void 0!==t?t:(0,g.parseVersionFromExecutable)(n)}catch(e){r=s.UNKNOWN_PYTHON_VERSION}return(0,a.buildEnvInfo)({kind:e.kind,name:e.name,display:e.displayName,sysPrefix:e.envPath,location:e.envPath,searchLocation:e.searchLocation,version:r,executable:n,pythonRunCommand:e.pythonRunCommand,identifiedUsingNativeLocator:e.identifiedUsingNativeLocator})}async function _(e){var t,n;const{executablePath:i,kind:o}=e,l=(0,a.buildEnvInfo)({kind:o,version:null!==(t=e.version)&&void 0!==t?t:await(0,c.getPythonVersionFromPath)(i),executable:i,sysPrefix:e.envPath,location:e.envPath,display:e.displayName,searchLocation:e.searchLocation,pythonRunCommand:e.pythonRunCommand,identifiedUsingNativeLocator:e.identifiedUsingNativeLocator,name:e.name,type:s.PythonEnvType.Virtual}),u=null!==(n=e.envPath)&&void 0!==n?n:(0,c.getEnvironmentDirFromPath)(i);return l.location=u,l.name=r.basename(u),l}async function E(e){var t,n,i,o,l;if(e.identifiedUsingNativeLocator){const i=e.executablePath,o=null!==(t=e.envPath)&&void 0!==t?t:(0,c.getEnvironmentDirFromPath)(i),l=null!==(n=e.version)&&void 0!==n?n:i?await(0,c.getPythonVersionFromPath)(i):void 0,d=(0,a.buildEnvInfo)({executable:i,kind:s.PythonEnvKind.Conda,org:u.AnacondaCompanyName,location:o,sysPrefix:o,display:e.displayName,pythonRunCommand:e.pythonRunCommand,identifiedUsingNativeLocator:e.identifiedUsingNativeLocator,searchLocation:e.searchLocation,source:[],version:l,type:s.PythonEnvType.Conda,name:e.name});if(e.envPath&&i&&r.basename(i)===i){const t=(0,u.getCondaInterpreterPath)(e.envPath);d.id=(0,a.getEnvID)(t,e.envPath)}return d}const{executablePath:d}=e,p=await u.Conda.getConda();if(void 0===p){(0,m.traceWarn)(`${d} identified as Conda environment even though Conda is not found`),e.kind=s.PythonEnvKind.Unknown;const t=await _(e);return t.type=s.PythonEnvType.Conda,t.name="",t}const h=null!==(i=e.envPath)&&void 0!==i?i:(0,c.getEnvironmentDirFromPath)(e.executablePath);let f;f=e.executablePath.length>0?e.executablePath:await p.getInterpreterPathForEnvironment({prefix:h});const g=null!==(o=e.version)&&void 0!==o?o:f?await(0,c.getPythonVersionFromPath)(f):void 0,v=(0,a.buildEnvInfo)({executable:f,kind:s.PythonEnvKind.Conda,org:u.AnacondaCompanyName,location:h,source:[],version:g,type:s.PythonEnvType.Conda,name:null!==(l=e.name)&&void 0!==l?l:await(null==p?void 0:p.getName(h))});if(e.envPath&&r.basename(f)===f){const t=(0,u.getCondaInterpreterPath)(e.envPath);v.id=(0,a.getEnvID)(t,e.envPath)}return v}async function w(e){var t,n;const{executablePath:i}=e,o=null!==(t=e.envPath)&&void 0!==t?t:(0,c.getEnvironmentDirFromPath)(i),p=r.basename(o),h=(0,d.parsePyenvVersion)(p),f=(0,a.buildEnvInfo)({kind:e.identifiedUsingNativeLocator&&e.kind?e.kind:s.PythonEnvKind.Pyenv,executable:i,source:[],location:o,searchLocation:e.searchLocation,sysPrefix:e.envPath,display:e.displayName,name:e.name,pythonRunCommand:e.pythonRunCommand,identifiedUsingNativeLocator:e.identifiedUsingNativeLocator,version:null!==(n=e.version)&&void 0!==n?n:await(0,c.getPythonVersionFromPath)(i,null==h?void 0:h.pythonVer),org:h&&h.distro?h.distro:""});return e.identifiedUsingNativeLocator||(await async function(e){if(!await(0,u.isCondaEnvironment)(e))return!1;const t=(0,c.getEnvironmentDirFromPath)(e),n=(0,d.getPyenvVersionsDir)();return(0,l.arePathsSame)(r.dirname(t),n)}(i)?f.name="base":f.name=p),f}async function T(e){const t=(0,a.buildEnvInfo)({kind:e.kind,executable:e.executablePath,display:e.displayName,version:e.version,identifiedUsingNativeLocator:e.identifiedUsingNativeLocator,location:e.envPath,name:e.name,pythonRunCommand:e.pythonRunCommand,searchLocation:e.searchLocation,sysPrefix:e.envPath}),n=await b.ActiveState.getState().then((e=>null==e?void 0:e.getProjects()));if(n)for(const i of n)for(const n of i.executables)if((0,l.arePathsSame)(n,r.dirname(e.executablePath)))return t.name=`${i.organization}/${i.name}`,t;return t}async function C(e){var t;const{executablePath:n}=e;return(0,a.buildEnvInfo)({kind:s.PythonEnvKind.MicrosoftStore,executable:n,version:null!==(t=e.version)&&void 0!==t?t:(0,h.getPythonVersionFromPath)(n),org:"Microsoft",display:e.displayName,location:e.envPath,sysPrefix:e.envPath,searchLocation:e.searchLocation,name:e.name,pythonRunCommand:e.pythonRunCommand,identifiedUsingNativeLocator:e.identifiedUsingNativeLocator,arch:p.Architecture.x64,source:[s.PythonEnvSource.PathEnvVar]})}t.resolveBasicEnv=async function(e){var t;const{kind:n,source:r,searchLocation:c}=e,d=function(){const e=new Map;return Object.values(s.PythonEnvKind).forEach((t=>{e.set(t,S)})),s.virtualEnvKinds.forEach((t=>{e.set(t,_)})),e.set(s.PythonEnvKind.Conda,E),e.set(s.PythonEnvKind.MicrosoftStore,C),e.set(s.PythonEnvKind.Pyenv,w),e.set(s.PythonEnvKind.ActiveState,T),e}().get(n),g=await d(e);if(g.searchLocation=function(e,t){if(t)return t;return(0,y.getWorkspaceFolderPaths)().some((t=>(0,l.isParentPath)(e.executable.filename,t)||(0,l.isParentPath)(e.location,t)))?i.Uri.file(e.location):void 0}(g,c),g.source=(0,o.uniq)(g.source.concat(null!=r?r:[])),(0,p.getOSType)()===p.OSType.Windows&&(null===(t=g.source)||void 0===t?void 0:t.includes(s.PythonEnvSource.WindowsRegistry))&&await async function(e){var t,n,r;let i=(0,f.getRegistryInterpretersSync)();i||((0,m.traceError)("Expected registry interpreter cache to be initialized already"),i=await(0,f.getRegistryInterpreters)());const c=i.find((t=>(0,l.arePathsSame)(t.interpreterPath,e.executable.filename)));if(c){const i=null!==(n=null!==(t=c.versionStr)&&void 0!==t?t:c.sysVersionStr)&&void 0!==n?n:c.interpreterPath;let l;try{l=(0,h.parseVersion)(i)}catch(e){l=s.UNKNOWN_PYTHON_VERSION}e.kind=e.kind===s.PythonEnvKind.Unknown?s.PythonEnvKind.OtherGlobal:e.kind,e.version=(0,a.comparePythonVersionSpecificity)(l,e.version)>0?l:e.version,e.distro.defaultDisplayName=c.companyDisplayName,e.arch="32bit"===c.bitnessStr?p.Architecture.x86:p.Architecture.x64,e.distro.org=null!==(r=c.distroOrgName)&&void 0!==r?r:e.distro.org,e.source=(0,o.uniq)(e.source.concat(s.PythonEnvSource.WindowsRegistry))}else(0,m.traceWarn)("Expected registry to find the interpreter as source was set")}(g),(0,a.setEnvDisplayString)(g),e.arch&&!g.arch&&(g.arch=e.arch),e.ctime&&e.mtime)g.executable.ctime=e.ctime,g.executable.mtime=e.mtime;else{const{ctime:e,mtime:t}=await(0,l.getFileInfo)(g.executable.filename);g.executable.ctime=e,g.executable.mtime=t}const b=await async function(e){return e.type?e.type:await(0,v.isVirtualEnvironment)(e.executable.filename)?s.PythonEnvType.Virtual:await(0,u.isCondaEnvironment)(e.executable.filename)?s.PythonEnvType.Conda:void 0}(g);return b&&(g.type=b),g}},96255:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActiveStateLocator=void 0;const r=n(42694),i=n(45878),o=n(19735),s=n(77882),a=n(29616),c=n(70057);class l extends s.LazyResourceBasedLocator{constructor(){super(...arguments),this.providerId="activestate"}async*doIterEnvs(){const e=new c.StopWatch,t=await r.ActiveState.getState();if(void 0===t)return void(0,o.traceVerbose)("Couldn't locate the state binary.");(0,o.traceInfo)("Searching for active state environments");const n=await t.getProjects();if(void 0!==n){for(const e of n)if(e.executables)for(const t of e.executables)try{(0,o.traceVerbose)(`Looking for Python in: ${e.name}`);for await(const e of(0,a.findInterpretersInDir)(t))(0,o.traceVerbose)(`Found Python executable: ${e.filename}`),yield{kind:i.PythonEnvKind.ActiveState,executablePath:e.filename}}catch(t){(0,o.traceError)(`Failed to process State Tool project: ${JSON.stringify(e)}`,t)}(0,o.traceInfo)(`Finished searching for active state environments: ${e.elapsedTime} milliseconds`)}else(0,o.traceVerbose)("Couldn't fetch State Tool projects.")}}t.ActiveStateLocator=l},74437:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CondaEnvironmentLocator=void 0,n(32727);const r=n(45878),i=n(75470),o=n(19735),s=n(65349),a=n(70057);class c extends s.FSWatchingLocator{constructor(){super((()=>(0,i.getCondaEnvironmentsTxt)()),(async()=>r.PythonEnvKind.Conda),{isFile:!0}),this.providerId="conda-envs"}async*doIterEnvs(e){const t=new a.StopWatch;(0,o.traceInfo)("Searching for conda environments");const n=await i.Conda.getConda();if(void 0===n)return void(0,o.traceVerbose)("Couldn't locate the conda binary.");(0,o.traceVerbose)(`Searching for conda environments using ${n.command}`);const s=await n.getEnvList();for(const e of s)try{(0,o.traceVerbose)(`Looking into conda env for executable: ${JSON.stringify(e)}`);const t=await n.getInterpreterPathForEnvironment(e);(0,o.traceVerbose)(`Found conda executable: ${t}`),yield{kind:r.PythonEnvKind.Conda,executablePath:t,envPath:e.prefix}}catch(t){(0,o.traceError)(`Failed to process conda env: ${JSON.stringify(e)}`,t)}(0,o.traceInfo)(`Finished searching for conda environments: ${t.elapsedTime} milliseconds`)}}t.CondaEnvironmentLocator=c},82399:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomVirtualEnvironmentLocator=t.VENVFOLDERS_SETTING_KEY=t.VENVPATH_SETTING_KEY=void 0;const r=n(96486),i=n(71017),o=n(59314),s=n(87450),a=n(45878),c=n(65349),l=n(29616),u=n(37769),d=n(37924),p=n(64715);n(32727);const h=n(99910),f=n(19735),g=n(70057);async function m(){var e;const n=[],o=(0,u.getPythonSetting)(t.VENVPATH_SETTING_KEY);o&&n.push((0,u.untildify)(o));const a=null!==(e=(0,u.getPythonSetting)(t.VENVFOLDERS_SETTING_KEY))&&void 0!==e?e:[],c=(0,s.getUserHomeDir)();return c&&await(0,u.pathExists)(c)&&a.map((e=>i.join(c,e))).forEach((e=>n.push(e))),(0,h.asyncFilter)((0,r.uniq)(n),u.pathExists)}async function v(e){return await(0,d.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 y extends c.FSWatchingLocator{constructor(){super(m,v,{delayOnCreated:1e3}),this.providerId="custom-virtual-envs"}async initResources(){this.disposables.push((0,u.onDidChangePythonSetting)(t.VENVPATH_SETTING_KEY,(()=>this.fire()))),this.disposables.push((0,u.onDidChangePythonSetting)(t.VENVFOLDERS_SETTING_KEY,(()=>this.fire())))}doIterEnvs(){return async function*(){const e=new g.StopWatch;(0,f.traceInfo)("Searching for custom virtual environments");const t=(await m()).map((e=>async function*(){(0,f.traceVerbose)(`Searching for custom virtual envs in: ${e}`);const t=(0,l.findInterpretersInDir)(e,2);for await(const e of t){const{filename:t}=e;if(await(0,l.looksLikeBasicVirtualPython)(e))try{const e=await v(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)(t)),(0,f.traceInfo)(`Finished searching for custom virtual envs: ${e.elapsedTime} milliseconds`)}()}}t.CustomVirtualEnvironmentLocator=y},39805:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomWorkspaceLocator=t.DEFAULT_INTERPRETER_PATH_SETTING_KEY=void 0;const r=n(45878),i=n(65349),o=n(37769);n(32727);const s=n(19735),a=n(77570);t.DEFAULT_INTERPRETER_PATH_SETTING_KEY="defaultInterpreterPath";class c extends i.FSWatchingLocator{constructor(e){super((()=>[]),(async()=>r.PythonEnvKind.Unknown)),this.root=e,this.providerId="custom-workspace-locator"}async initResources(){this.disposables.push((0,o.onDidChangePythonSetting)(t.DEFAULT_INTERPRETER_PATH_SETTING_KEY,(()=>this.fire()),this.root))}doIterEnvs(){return async function*(e){(0,s.traceVerbose)("Searching for custom workspace envs");const n=(0,o.getPythonSetting)(t.DEFAULT_INTERPRETER_PATH_SETTING_KEY,e);n&&n!==a.DEFAULT_INTERPRETER_SETTING&&(yield{kind:r.PythonEnvKind.Unknown,executablePath:n},(0,s.traceVerbose)("Finished searching for custom workspace envs"))}(this.root)}}t.CustomWorkspaceLocator=c},3649:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirFilesLocator=void 0;const r=n(29616),i=n(34354);async function*o(e){for await(const t of(0,r.iterPythonExecutablesInDir)(e))yield t.filename}t.DirFilesLocator=class extends class{constructor(e,t,n){this.kind=e,this.getExecutables=t,this.source=n,this.watcher=new i.PythonEnvsWatcher,this.onChanged=this.watcher.onChanged}iterEnvs(e){const t=this.getExecutables();return async function*(e,n){for await(const r of t)yield{executablePath:r,kind:e,source:n}}(this.kind,this.source)}}{constructor(e,t,n=o,r){super(t,(()=>n(e)),r),this.providerId=`dir-files-${e}`}}},65349:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FSWatchingLocator=t.FSWatcherKind=void 0;const r=n(57147),i=n(71017),o=n(66828),s=n(88409),a=n(59314),c=n(19735),l=n(29616),u=n(53476),d=n(77882);var p;!function(e){e[e.Global=0]="Global",e[e.Workspace=1]="Workspace"}(p=t.FSWatcherKind||(t.FSWatcherKind={}));class h extends d.LazyResourceBasedLocator{constructor(e,t,n={},r=p.Global){super(),this.getRoots=e,this.getKind=t,this.creationOptions=n,this.watcherKind=r,this.activate().ignoreErrors()}async initWatchers(){if(this.watcherKind===p.Global&&!f(this.creationOptions))return;let e=await this.getRoots();"string"==typeof e&&(e=[e]);const t=e.map((async e=>{if(f(this.creationOptions))return e;const t=await function(e){let t;try{t=r.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)))}fire(e={}){this.emitter.fire({...e,providerId:this.providerId})}startWatchers(e){const t=this.creationOptions;if(f(t))return(0,c.traceVerbose)("Start watching file for changes",e),void this.disposables.push((0,s.watchLocationForPattern)(i.dirname(e),i.basename(e),(()=>{(0,c.traceVerbose)("Detected change in file: ",e,"initiating a refresh"),this.emitter.fire({providerId:this.providerId})})));const n=async(e,n)=>{var r;e===s.FileChangeType.Created&&void 0!==t.delayOnCreated&&await(0,a.sleep)(t.delayOnCreated);const u=await this.getKind(n).catch((()=>{})),d=o.Uri.file(null!==(r=t.searchLocation)&&void 0!==r?r:i.dirname((0,l.getEnvironmentDirFromPath)(n)));(0,c.traceVerbose)("Fired event ",JSON.stringify({type:e,kind:u,searchLocation:d}),"from locator"),this.emitter.fire({type:e,kind:u,searchLocation:d,providerId:this.providerId,envPath:n})},r=(0,u.resolvePythonExeGlobs)(t.baseGlob,t.envStructure);(0,c.traceVerbose)("Start watching root",e,"for globs",JSON.stringify(r));const d=r.map((t=>(0,u.watchLocationForPythonBinaries)(e,n,t)));this.disposables.push(...d)}}function f(e){return"isFile"in e&&e.isFile}t.FSWatchingLocator=h},93235:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVirtualEnvironmentLocator=void 0;const r=n(96486),i=n(71017),o=n(66828),s=n(59314),a=n(87450),c=n(45878),l=n(65349),u=n(29616),d=n(37769),p=n(37924),h=n(64715);n(32727);const f=n(99910),g=n(19735),m=n(70057);async function v(){const e=[];let t=(0,a.getEnvironmentVariable)("WORKON_HOME");t&&(t=(0,d.untildify)(t),await(0,d.pathExists)(t)&&e.push(t));const n=(0,a.getUserHomeDir)();if(n&&await(0,d.pathExists)(n)){const t=["envs","Envs",".direnv",".venvs",".virtualenvs",i.join(".local","share","virtualenvs")];(await(0,f.asyncFilter)(t.map((e=>i.join(n,e))),d.pathExists)).forEach((t=>e.push(t)))}return[a.OSType.Windows,a.OSType.OSX].includes((0,a.getOSType)())?(0,r.uniqBy)(e,r.toLower):(0,r.uniq)(e)}async function y(e){if(e.kind===c.PythonEnvKind.Pipenv){const t=await(0,p.getProjectDir)(i.dirname(i.dirname(e.executablePath)));if(t)return o.Uri.file(t)}}async function b(e){return await(0,p.isPipenvEnvironment)(e)?c.PythonEnvKind.Pipenv:await(0,h.isVirtualenvwrapperEnvironment)(e)?c.PythonEnvKind.VirtualEnvWrapper:await(0,h.isVenvEnvironment)(e)?c.PythonEnvKind.Venv:await(0,h.isVirtualenvEnvironment)(e)?c.PythonEnvKind.VirtualEnv:c.PythonEnvKind.Unknown}class S extends l.FSWatchingLocator{constructor(e){super(v,b,{delayOnCreated:1e3}),this.searchDepth=e,this.providerId="global-virtual-env"}doIterEnvs(){var e;const t=null!==(e=this.searchDepth)&&void 0!==e?e:2;return async function*(){const e=new m.StopWatch;(0,g.traceInfo)("Searching for global virtual environments");const n=(await v()).map((e=>async function*(){(0,g.traceVerbose)(`Searching for global virtual envs in: ${e}`);const n=(0,u.findInterpretersInDir)(e,t);for await(const e of n){const{filename:t}=e;if(await(0,u.looksLikeBasicVirtualPython)(e)){const e=await b(t),n=await y({kind:e,executablePath:t});try{yield{kind:e,executablePath:t,searchLocation:n},(0,g.traceVerbose)(`Global Virtual Environment: [added] ${t}`)}catch(e){(0,g.traceError)(`Failed to process environment: ${t}`,e)}}else(0,g.traceVerbose)(`Global Virtual Environment: [skipped] ${t}`)}}()));yield*(0,s.iterable)((0,s.chain)(n)),(0,g.traceInfo)(`Finished searching for global virtual envs: ${e.elapsedTime} milliseconds`)}()}}t.GlobalVirtualEnvironmentLocator=S},1092:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HatchLocator=void 0;const r=n(45878),i=n(77882),o=n(25150),s=n(99910),a=n(37769),c=n(19735),l=n(59314),u=n(29616);class d extends i.LazyResourceBasedLocator{constructor(e){super(),this.root=e,this.providerId="hatch"}doIterEnvs(){return async function*(e){const t=await async function(e){var t;const n=await o.Hatch.getHatch(e),r=null!==(t=await(null==n?void 0:n.getEnvList()))&&void 0!==t?t:[];return(0,s.asyncFilter)(r,a.pathExists)}(e),n=t.map((e=>async function*(){(0,c.traceVerbose)(`Searching for Hatch virtual envs in: ${e}`);const t=await(0,u.getInterpreterPathFromDir)(e);if(void 0!==t)try{yield{executablePath:t,kind:r.PythonEnvKind.Hatch},(0,c.traceVerbose)(`Hatch Virtual Environment: [added] ${t}`)}catch(e){(0,c.traceError)(`Failed to process environment: ${t}`,e)}}()));yield*(0,l.iterable)((0,l.chain)(n)),(0,c.traceVerbose)("Finished searching for Hatch envs")}(this.root)}}t.HatchLocator=d},39046:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MicrosoftStoreLocator=t.getMicrosoftStorePythonExes=void 0;const r=n(55674),i=n(91171),o=n(71017),s=n(45878),a=n(65349),c=n(53476),l=n(10423),u=n(19735),d=n(70057),p="python3.{[0-9],[0-9][0-9]}.exe";function h(e){return i(o.basename(e),p,{nocase:!0})}async function f(){if(await(0,l.isStorePythonInstalled)()){const e=(0,l.getMicrosoftStoreAppsRoot)();return(await r.readdir(e)).map((t=>o.join(e,t))).filter(h)}return[]}t.getMicrosoftStorePythonExes=f;class g extends a.FSWatchingLocator{constructor(){super(l.getMicrosoftStoreAppsRoot,(async()=>this.kind),{baseGlob:p,searchLocation:(0,l.getMicrosoftStoreAppsRoot)(),envStructure:c.PythonEnvStructure.Flat}),this.providerId="microsoft-store",this.kind=s.PythonEnvKind.MicrosoftStore}doIterEnvs(){return async function*(e){const t=new d.StopWatch;(0,u.traceInfo)("Searching for windows store envs");const n=await f();yield*n.map((async t=>({kind:e,executablePath:t}))),(0,u.traceInfo)(`Finished searching for windows store envs: ${t.elapsedTime} milliseconds`)}(this.kind)}}t.MicrosoftStoreLocator=g},80981:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NativeLocator=void 0;const r=n(66828),i=n(45878),o=n(75470),s=n(19735),a=n(77826),c=n(40471),l=n(81837),u=n(70057),d=n(87450),p=n(54813),h=n(61522);function f(e){switch(e.toLowerCase()){case"conda":return i.PythonEnvKind.Conda;case"system":case"homebrew":case"windowsregistry":return i.PythonEnvKind.System;case"pyenv":return i.PythonEnvKind.Pyenv;case"pipenv":return i.PythonEnvKind.Pipenv;case"pyenvvirtualenv":return i.PythonEnvKind.VirtualEnv;case"virtualenvwrapper":return i.PythonEnvKind.VirtualEnvWrapper;case"windowsstore":return i.PythonEnvKind.MicrosoftStore;default:return(0,s.traceError)(`Unknown Python Environment category '${e}' from Native Locator.`),i.PythonEnvKind.Unknown}}function g(e){if(e)try{const[t,n,r]=e.split(".").map((e=>parseInt(e,10)));return{major:"number"==typeof t?t:-1,minor:"number"==typeof n?n:-1,micro:"number"==typeof r?r:-1,sysVersion:e}}catch(e){return}}t.NativeLocator=class{constructor(){this.providerId="native-locator",this.onChangedEmitter=new r.EventEmitter,this.disposables=[],this.onChanged=this.onChangedEmitter.event,this.finder=(0,c.createNativeGlobalPythonFinder)(),this.disposables.push(this.onChangedEmitter,this.finder)}async dispose(){return this.disposables.forEach((e=>e.dispose())),Promise.resolve()}iterEnvs(){const e=new u.StopWatch;(0,s.traceInfo)("Searching for Python environments using Native Locator");const t=this.finder.startSearch(),n=[],c=[],m=new r.Disposable((()=>(0,l.disposeAll)(c)));this.disposables.push(m),t.finally((()=>m.dispose()));let v=0;return c.push(this.finder.onDidFindPythonEnvironment((e=>{if(e.pythonExecutablePath){const t=(e.arch||"").toLowerCase();n.push({kind:f(e.category),executablePath:e.pythonExecutablePath,envPath:e.envPath,version:g(e.version),name:""===e.name?void 0:e.name,displayName:e.displayName,pythonRunCommand:e.pythonRunCommand,searchLocation:e.projectPath?r.Uri.file(e.projectPath):void 0,identifiedUsingNativeLocator:!0,arch:"x64"===t?d.Architecture.x64:"x86"===t?d.Architecture.x86:void 0,ctime:e.creationTime,mtime:e.modifiedTime})}else v+=1})),this.finder.onDidFindEnvironmentManager((e=>{switch(function(e){switch(e.toLowerCase()){case"conda":return"Conda";case"pyenv":return"Pyenv";default:return(0,s.traceError)(`Unknown Python Tool '${e}' from Native Locator.`),"Unknown"}}(e.tool)){case"Conda":o.Conda.setConda(e.executablePath);break;case"Pyenv":(0,a.setPyEnvBinary)(e.executablePath)}}))),async function*(){await t,(0,s.traceInfo)(`Finished searching for Python environments using Native Locator: ${e.elapsedTime} milliseconds`),yield*n,function(e,t,n){const r=e.filter((e=>e.kind===i.PythonEnvKind.ActiveState)).length,o=e.filter((e=>e.kind===i.PythonEnvKind.Conda)).length,s=e.filter((e=>e.kind===i.PythonEnvKind.Custom)).length,a=e.filter((e=>e.kind===i.PythonEnvKind.Hatch)).length,c=e.filter((e=>e.kind===i.PythonEnvKind.MicrosoftStore)).length,l=e.filter((e=>e.kind===i.PythonEnvKind.OtherGlobal)).length,u=e.filter((e=>e.kind===i.PythonEnvKind.OtherVirtual)).length,d=e.filter((e=>e.kind===i.PythonEnvKind.Pipenv)).length,f=e.filter((e=>e.kind===i.PythonEnvKind.Poetry)).length,g=e.filter((e=>e.kind===i.PythonEnvKind.Pyenv)).length,m=e.filter((e=>e.kind===i.PythonEnvKind.System)).length,v=e.filter((e=>e.kind===i.PythonEnvKind.Unknown)).length,y=e.filter((e=>e.kind===i.PythonEnvKind.Venv)).length,b=e.filter((e=>e.kind===i.PythonEnvKind.VirtualEnv)).length,S=e.filter((e=>e.kind===i.PythonEnvKind.VirtualEnvWrapper)).length;(0,p.sendTelemetryEvent)(h.EventName.PYTHON_INTERPRETER_DISCOVERY,n.elapsedTime,{interpreters:e.length,environmentsWithoutPython:t,activeStateEnvs:r,condaEnvs:o,customEnvs:s,hatchEnvs:a,microsoftStoreEnvs:c,otherGlobalEnvs:l,otherVirtualEnvs:u,pipEnvEnvs:d,poetryEnvs:f,pyenvEnvs:g,systemEnvs:m,unknownEnvs:v,venvEnvs:y,virtualEnvEnvs:b,virtualEnvWrapperEnvs:S})}(n,v,e),(0,s.traceInfo)(`Finished yielding Python environments using Native Locator: ${e.elapsedTime} milliseconds`)}()}}},68624:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PoetryLocator=void 0;const r=n(71017),i=n(66828),o=n(59314),s=n(45878),a=n(29616),c=n(37769),l=n(13298);n(32727);const u=n(99910),d=n(19735),p=n(77882);class h extends p.LazyResourceBasedLocator{constructor(e){super(),this.root=e,this.providerId="poetry"}doIterEnvs(){return async function*(e){const t=await async function(e){const t=[r.join(e,l.localPoetryEnvDirName)],n=await l.Poetry.getPoetry(e),i=await(null==n?void 0:n.getEnvList());return i&&t.push(...i),(0,u.asyncFilter)(t,c.pathExists)}(e),n=t.map((t=>async function*(){(0,d.traceVerbose)(`Searching for poetry virtual envs in: ${t}`);const n=await(0,a.getInterpreterPathFromDir)(t);if(void 0!==n){const t=await async function(e){return await(0,l.isPoetryEnvironment)(e)?s.PythonEnvKind.Poetry:s.PythonEnvKind.Unknown}(n);try{yield{executablePath:n,kind:t,searchLocation:i.Uri.file(e)},(0,d.traceVerbose)(`Poetry Virtual Environment: [added] ${n}`)}catch(e){(0,d.traceError)(`Failed to process environment: ${n}`,e)}}}()));yield*(0,o.iterable)((0,o.chain)(n)),(0,d.traceVerbose)("Finished searching for poetry envs")}(this.root)}}t.PoetryLocator=h},43160:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PosixKnownPathsLocator=void 0;const r=n(22037),i=n(81249),o=n(45878),s=n(44538),a=n(72927),c=n(77826),l=n(87450),u=n(35271),d=n(19735),p=n(70057);class h extends s.Locator{constructor(){super(...arguments),this.providerId="posixKnownPaths",this.kind=o.PythonEnvKind.OtherGlobal}iterEnvs(){let e=!1;return(0,l.getOSType)()===l.OSType.OSX&&(0,i.gte)(r.release(),"21.0.0")&&(e=!0),async function*(t){const n=new p.StopWatch;(0,d.traceInfo)("Searching for interpreters in posix paths locator");try{const n=(await(0,a.commonPosixBinPaths)()).filter((e=>!(0,c.isPyenvShimDir)(e)));let r=await(0,a.getPythonBinFromPosixPaths)(n);(0,d.traceVerbose)(`Found ${r.length} python binaries in posix paths`),e&&(r=r.filter((e=>!(0,u.isMacDefaultPythonPath)(e))));for(const e of r)try{yield{executablePath:e,kind:t,source:[o.PythonEnvSource.PathEnvVar]}}catch(t){(0,d.traceError)(`Failed to process environment: ${e}`,t)}}catch(e){(0,d.traceError)("Failed to process posix paths",e)}(0,d.traceInfo)(`Finished searching for interpreters in posix paths locator: ${n.elapsedTime} milliseconds`)}(this.kind)}}t.PosixKnownPathsLocator=h},41770:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PyenvLocator=void 0;const r=n(45878),i=n(65349),o=n(29616),s=n(37769),a=n(77826),c=n(19735),l=n(70057);class u extends i.FSWatchingLocator{constructor(){super(a.getPyenvVersionsDir,(async()=>r.PythonEnvKind.Pyenv)),this.providerId="pyenv"}doIterEnvs(){return async function*(){const e=new l.StopWatch;(0,c.traceInfo)("Searching for pyenv environments");try{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:r.PythonEnvKind.Pyenv,executablePath:t}}catch(e){(0,c.traceError)(`Failed to process environment: ${t}`,e)}}}catch(e){(0,c.traceInfo)("pyenv is not installed")}(0,c.traceInfo)(`Finished searching for pyenv environments: ${e.elapsedTime} milliseconds`)}()}}t.PyenvLocator=u},44644:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowsPathEnvVarLocator=void 0;const r=n(71017),i=n(47237),o=n(81837),s=n(77826),a=n(10423),c=n(45878),l=n(2839),u=n(69270),d=n(3649),p=n(19735),h=n(37769),f=n(60717),g=n(29616),m=n(70057);async function*v(e){for await(const t of(0,g.iterPythonExecutablesInDir)(e))await(0,g.looksLikeBasicGlobalPython)(t)&&(yield t.filename)}async function*y(e){const t=r.join(e,"python.exe");await(0,h.pathExists)(t)&&(yield t)}t.WindowsPathEnvVarLocator=class{constructor(){this.providerId="windows-path-env-var-locator",this.disposables=new o.Disposables;const e=(0,h.inExperiment)(f.DiscoveryUsingWorkers.experiment),t=(0,i.getSearchPathEntries)().filter((e=>!(0,a.isMicrosoftStoreDir)(e)&&!(0,s.isPyenvShimDir)(e))).map((t=>function(e,t,n,r){const i=r?y:v,o=new d.DirFilesLocator(e,t,i,n);return{providerId:o.providerId,iterEnvs:async function*(e){yield*await(0,u.getEnvs)(o.iterEnvs(e)).then((e=>e))},dispose:async()=>{},onChanged:o.onChanged}}(t,c.PythonEnvKind.System,[c.PythonEnvSource.PathEnvVar],e)));this.disposables.push(...t),this.locators=new l.Locators(t),this.onChanged=this.locators.onChanged}async dispose(){this.locators.dispose(),await this.disposables.dispose()}iterEnvs(e){return async function*(e){const t=new m.StopWatch;(0,p.traceInfo)("Searching windows known paths locator");for await(const t of e)yield t;(0,p.traceInfo)(`Finished searching windows known paths locator: ${t.elapsedTime} milliseconds`)}(this.locators.iterEnvs(e))}}},5613:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowsRegistryLocator=t.WINDOWS_REG_PROVIDER_ID=void 0;const r=n(45878),i=n(44538),o=n(38366),s=n(19735),a=n(10423),c=n(60717),l=n(37769),u=n(70057);t.WINDOWS_REG_PROVIDER_ID="windows-registry";class d extends i.Locator{constructor(){super(...arguments),this.providerId=t.WINDOWS_REG_PROVIDER_ID}iterEnvs(e,n=(0,l.inExperiment)(c.DiscoveryUsingWorkers.experiment)){return n?(null==e?void 0:e.providerId)===this.providerId?p():async function*(e){(async function(e){const n=new u.StopWatch;(0,s.traceInfo)("Searching for windows registry interpreters"),e.fire({providerId:t.WINDOWS_REG_PROVIDER_ID}),(0,s.traceInfo)(`Finished searching for windows registry interpreters: ${n.elapsedTime} milliseconds`)})(e).ignoreErrors()}(this.emitter):p()}}async function*p(){const e=new u.StopWatch;(0,s.traceInfo)("Searching for windows registry interpreters");const t=await(0,o.getRegistryInterpreters)();for(const e of t)try{if((0,a.isMicrosoftStoreDir)(e.interpreterPath))continue;const t={kind:r.PythonEnvKind.OtherGlobal,executablePath:e.interpreterPath,source:[r.PythonEnvSource.WindowsRegistry]};yield t}catch(t){(0,s.traceError)(`Failed to process environment: ${e}`,t)}(0,s.traceInfo)(`Finished searching for windows registry interpreters: ${e.elapsedTime} milliseconds`)}t.WindowsRegistryLocator=d},3143:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceVirtualEnvironmentLocator=void 0;const r=n(71017),i=n(59314),o=n(29616),s=n(37769),a=n(37924),c=n(64715),l=n(45878),u=n(65349);n(32727);const d=n(99910),p=n(19735);function h(e){return(0,d.asyncFilter)([e,r.join(e,".direnv")],s.pathExists)}async function f(e){return await(0,a.isPipenvEnvironment)(e)?l.PythonEnvKind.Pipenv:await(0,c.isVenvEnvironment)(e)?l.PythonEnvKind.Venv:await(0,c.isVirtualenvEnvironment)(e)?l.PythonEnvKind.VirtualEnv:l.PythonEnvKind.Unknown}class g extends u.FSWatchingLocator{constructor(e){super((()=>h(this.root)),f,{delayOnCreated:1e3},u.FSWatcherKind.Workspace),this.root=e,this.providerId="workspaceVirtualEnvLocator"}doIterEnvs(){return async function*(e){const t=(await h(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)),(0,p.traceVerbose)("Finished searching for workspace virtual envs")}(this.root)}}t.WorkspaceVirtualEnvironmentLocator=g},14424:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceLocators=t.ExtensionLocators=void 0;const r=n(59314),i=n(3481),o=n(81837),s=n(2839),a=n(77882);class c extends s.Locators{constructor(e,t){super([...e,t]),this.nonWorkspace=e,this.workspace=t}iterEnvs(e){var t;const n=[this.workspace.iterEnvs(e)];if(!(null===(t=null==e?void 0:e.searchLocations)||void 0===t?void 0:t.doNotIncludeNonRooted)){const t=(null==e?void 0:e.providerId)?this.nonWorkspace.filter((t=>e.providerId===t.providerId)):this.nonWorkspace;n.push(...t.map((t=>t.iterEnvs(e))))}return(0,s.combineIterators)(n)}}t.ExtensionLocators=c;class l extends a.LazyResourceBasedLocator{constructor(e,t){super(),this.watchRoots=e,this.factories=t,this.providerId="workspace-locators",this.locators={},this.roots={},this.activate().ignoreErrors()}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 n=this.roots[t],o=(0,i.getURIFilter)(n,{checkParent:!0,checkChild:!0});if(!e.searchLocations.roots.some(o))return(0,r.iterEmpty)();if(e.providerId&&e.providerId!==this.providerId)return(0,r.iterEmpty)()}const[n]=this.locators[t];return n.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=[],n=new o.Disposables;this.factories.forEach((r=>{r(e).forEach((e=>{t.push(e),void 0!==e.dispose&&n.push(e)}))}));const r=new s.Locators(t),i=e.toString();this.locators[i]=[r,n],this.roots[i]=e,n.push(r.onChanged((t=>{void 0===t.searchLocation&&(t.searchLocation=e),this.emitter.fire(t)})))}removeRoot(e){const t=e.toString(),n=this.locators[t];if(void 0===n)return;const[,r]=n;delete this.locators[t],delete this.roots[t],r.dispose()}}t.WorkspaceLocators=l},34354:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonEnvsWatcher=void 0;const r=n(66828);t.PythonEnvsWatcher=class{constructor(){this.didChange=new r.EventEmitter,this.onChanged=this.didChange.event}fire(e){this.didChange.fire(e)}}},38514:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonEnvsWatchers=void 0;const r=n(81837),i=n(34354);t.PythonEnvsWatchers=class{constructor(e){this.watcher=new i.PythonEnvsWatcher,this.disposables=new r.Disposables,this.onChanged=this.watcher.onChanged,e.forEach((e=>{const t=e.onChanged((e=>this.watcher.fire(e)));this.disposables.push(t)}))}async dispose(){await this.disposables.dispose()}}},29616:(e,t,n)=>{"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 r=n(57147),i=n(71017),o=n(56091),s=n(87450),a=n(19735),c=n(45878),l=n(44773),u=n(95084),d=n(75470),p=n(64715),h=n(37769),f=n(72927),g=n(38366),m=(0,s.getOSType)()===s.OSType.Windows?g.matchPythonBinFilename:f.matchPythonBinFilename;async function*v(e,t,n,r=!0){const i=(0,s.getOSType)()===s.OSType.Windows?g.matchPythonBinFilename:f.matchPythonBinFilename,a={ignoreErrors:r,filterSubDir:n,filterFile:i,maxDepth:t||0};for await(const t of y(e,1,a)){const{filename:e,filetype:n}=t;n!==o.FileType.File&&n!==o.FileType.SymbolicLink||S(e,i,r)&&(yield t)}}async function*y(e,t,n){const r=await b(e,n);for(const e of r){yield e;const{filename:r,filetype:i}=e;i===o.FileType.Directory&&(n.maxDepth<0||t<=n.maxDepth)&&S(r,n.filterSubDir,n.ignoreErrors)&&(yield*y(r,t+1,n))}}async function b(e,t={ignoreErrors:!0}){const n=t.ignoreErrors||!1;if(t.filterFilename&&(0,s.getOSType)()===s.OSType.Windows){let s;try{s=await r.promises.readdir(e)}catch(t){if("ENOENT"===t.code)return[];if(n)return(0,a.traceError)(`readdir() failed for "${e}" (${t})`),[];throw t}const c=s.map((t=>i.join(e,t))).filter((e=>S(e,t.filterFilename,n)));return Promise.all(c.map((async e=>({filename:e,filetype:await(0,o.getFileType)(e,t)||o.FileType.Unknown}))))}let c;try{c=await r.promises.readdir(e,{withFileTypes:!0})}catch(t){if("ENOENT"===t.code)return[];if(n)return(0,a.traceError)(`readdir() failed for "${e}" (${t})`),[];throw t}const l=c.map((t=>({filename:i.join(e,t.name),filetype:(0,o.convertFileType)(t)})));return t.filterFilename?l.filter((e=>S(e.filename,t.filterFilename,n))):l}function S(e,t,n=!0){if(void 0===t)return!0;try{return t(e)}catch(t){if(n)return(0,a.traceError)(`filter failed for "${e}" (${t})`),!1;throw t}}async function _(e,t){return!(!(t.matchFilename||m)("string"==typeof e?e:e.filename)||t.filterFile&&!await t.filterFile(e))}t.isPythonExecutable=async function(e){return!(!m(e)||(0,s.getOSType)()!==s.OSType.Windows)||!!await(0,h.isFile)(e)},t.findInterpretersInDir=v,t.iterPythonExecutablesInDir=async function*(e,t={ignoreErrors:!0}){const n={...t,filterFile:m},r=await b(e,n);for(const e of r){const{filetype:t}=e;t!==o.FileType.File&&t!==o.FileType.SymbolicLink||(yield e)}},t.getPythonVersionFromPath=async function(e,t){let n;try{n=t?(0,u.parseVersion)(t):c.UNKNOWN_PYTHON_VERSION}catch(e){n=c.UNKNOWN_PYTHON_VERSION}const r=e?await async function(e){const t=i.dirname(e);let n=c.UNKNOWN_PYTHON_VERSION;for await(const e of v(t)){const{filename:t}=e;try{const e=(0,u.parseVersion)(i.basename(t));(0,l.comparePythonVersionSpecificity)(e,n)>0&&(n=e)}catch(e){}}return n}(e):c.UNKNOWN_PYTHON_VERSION;(0,a.traceVerbose)("Best effort version B for",e,JSON.stringify(r));const o=e?await(0,p.getPythonVersionFromPyvenvCfg)(e):c.UNKNOWN_PYTHON_VERSION;(0,a.traceVerbose)("Best effort version C for",e,JSON.stringify(o));const s=e?await(0,d.getPythonVersionFromConda)(e):c.UNKNOWN_PYTHON_VERSION;(0,a.traceVerbose)("Best effort version D for",e,JSON.stringify(s));let h=c.UNKNOWN_PYTHON_VERSION;for(const e of[n,r,o,s])h=(0,l.comparePythonVersionSpecificity)(h,e)>0?h:e;return h};const E=(0,o.getFileFilter)({ignoreFileType:o.FileType.SymbolicLink});async function w(e){return _(e,{matchFilename:(0,s.getOSType)()===s.OSType.Windows?g.matchBasicPythonBinFilename:f.matchBasicPythonBinFilename,filterFile:E})}async function T(e){return _(e,{matchFilename:(0,s.getOSType)()===s.OSType.Windows?g.matchBasicPythonBinFilename:f.matchBasicPythonBinFilename,filterFile:void 0})}t.looksLikeBasicGlobalPython=w,t.looksLikeBasicVirtualPython=T,t.getInterpreterPathFromDir=async function(e,t={}){const n=t.global?w:T,r=v(e,2,(function(e){const t=i.basename(e).toLowerCase();return["bin","scripts"].includes(t)}),t.ignoreErrors);for await(const e of r)if(await n(e))return e.filename},t.getEnvironmentDirFromPath=function(e){const t=i.basename(i.dirname(e));return["bin","scripts"].map((e=>(0,h.normCasePath)(e))).includes((0,h.normCasePath)(t))?i.dirname(i.dirname(e)):i.dirname(e)}},13367:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identifyEnvironment=t.isIdentifierRegistered=void 0;const r=n(19735),i=n(45878),o=n(24563),s=n(75470),a=n(89235),c=n(37924),l=n(13298),u=n(77826),d=n(64715),p=n(10423),h=n(42694),f=()=>Promise.resolve(!1);function g(){const e=new Map;return Object.values(i.PythonEnvKind).forEach((t=>{e.set(t,f)})),e.set(i.PythonEnvKind.Conda,s.isCondaEnvironment),e.set(i.PythonEnvKind.MicrosoftStore,p.isMicrosoftStoreEnvironment),e.set(i.PythonEnvKind.Pipenv,c.isPipenvEnvironment),e.set(i.PythonEnvKind.Pyenv,u.isPyenvEnvironment),e.set(i.PythonEnvKind.Poetry,l.isPoetryEnvironment),e.set(i.PythonEnvKind.Venv,d.isVenvEnvironment),e.set(i.PythonEnvKind.VirtualEnvWrapper,d.isVirtualenvwrapperEnvironment),e.set(i.PythonEnvKind.VirtualEnv,d.isVirtualenvEnvironment),e.set(i.PythonEnvKind.ActiveState,h.isActiveStateEnvironment),e.set(i.PythonEnvKind.Unknown,(()=>Promise.resolve(!0))),e.set(i.PythonEnvKind.OtherGlobal,a.isGloballyInstalledEnv),e}t.isIdentifierRegistered=function(e){return g().get(e)!==f},t.identifyEnvironment=async function(e){const t=g(),n=(0,o.getPrioritizedEnvKinds)();for(const i of n){const n=t.get(i);if(n&&await n(e).catch((t=>((0,r.traceWarn)(`Identifier for ${i} failed to identify ${e}`,t),!1))))return i}return i.PythonEnvKind.Unknown}},42694:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.isActiveStateEnvironmentForWorkspace=t.ActiveState=t.isActiveStateEnvironment=t.ACTIVESTATETOOLPATH_SETTING_KEY=void 0;const i=n(71017),o=n(71017),s=n(37769),a=n(36952),c=n(19735),l=n(87450);t.ACTIVESTATETOOLPATH_SETTING_KEY="activeStateToolPath",t.isActiveStateEnvironment=async function(e){const t=i.dirname(e),n=i.dirname(t);return(0,s.pathExists)(i.join(n,"_runtime_store"))};class u{constructor(){(0,s.onDidChangePythonSetting)(t.ACTIVESTATETOOLPATH_SETTING_KEY,(()=>{u.statePromise=void 0}))}static async getState(){return void 0===u.statePromise&&(u.statePromise=u.locate()),u.statePromise}static getStateToolDir(){const e=(0,l.getUserHomeDir)();if(e)return(0,l.getOSType)()===l.OSType.Windows?i.join(e,"AppData","Local","ActiveState","StateTool"):i.join(e,".local","ActiveState","StateTool")}static async locate(){var e;const n=this.getStateToolDir(),r=null!==(e=(0,s.getPythonSetting)(t.ACTIVESTATETOOLPATH_SETTING_KEY))&&void 0!==e?e:u.defaultStateCommand;if(n&&(await(0,s.pathExists)(n)||r!==this.defaultStateCommand))return new u}async getProjects(){return this.getProjectsCached()}async getProjectsCached(){var e;try{const n=null!==(e=(0,s.getPythonSetting)(t.ACTIVESTATETOOLPATH_SETTING_KEY))&&void 0!==e?e:u.defaultStateCommand,r=await(0,s.shellExecute)(`${n} projects -o editor`,{timeout:5e3});if(!r)return;let i=r.stdout.trimEnd();"\0"===i[i.length-1]&&(i=i.substring(0,i.length-1)),(0,c.traceVerbose)(`${n} projects -o editor: ${i}`);const o=JSON.parse(i);return u.setCachedProjectInfo(o),o}catch(e){return void(0,c.traceError)(e)}}static getCachedProjectInfo(){return this.cachedProjectInfo}static setCachedProjectInfo(e){this.cachedProjectInfo=e}}u.defaultStateCommand="state",u.cachedProjectInfo=[],r([(0,a.cache)(3e4,!0,1e4)],u.prototype,"getProjectsCached",null),t.ActiveState=u,t.isActiveStateEnvironmentForWorkspace=function(e,t){const n=(0,o.dirname)(e);for(const e of u.getCachedProjectInfo())if(e.executables)for(const[r,i]of e.executables.entries())if((0,s.arePathsSame)(i,n)&&(0,s.arePathsSame)(t,e.local_checkouts[r]))return!0;return!1}},75470:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.Conda=t.CONDA_ACTIVATION_TIMEOUT=t.CONDA_RUN_VERSION=t.getCondaInterpreterPath=t.getPythonVersionFromConda=t.getCondaEnvironmentsTxt=t.isCondaEnvironment=t.getCondaMetaPaths=t.parseCondaInfo=t.CONDAPATH_SETTING_KEY=t.AnacondaCompanyName=void 0;const i=n(55674),o=n(71017),s=n(81249),a=n(87450),c=n(37769),l=n(45878),u=n(95084),d=n(38366),p=n(81387),h=n(36952),f=n(77570),g=n(19735),m=n(4057),v=n(94146),y=n(59314);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)]}function S(e){const t=(0,a.getOSType)()===a.OSType.Windows?"python.exe":o.join("bin","python");return o.join(e,t)}t.AnacondaCompanyName="Anaconda, Inc.",t.CONDAPATH_SETTING_KEY="condaPath",t.parseCondaInfo=async function(e,n,r,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=n(e);if(!await r(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.getCondaEnvironmentsTxt=async function(){const e=(0,a.getUserHomeDir)();return e?[o.join(e,".conda","environments.txt")]:[]},t.getPythonVersionFromConda=async function(e){const t=b(e).map((e=>o.join(e,"history"))),n=/\:python-(([\d\.a-z]?)+)/;for(const e of t)if(await(0,c.pathExists)(e))try{const t=(0,v.splitLines)(await(0,c.readFile)(e)).map((e=>{const t=n.exec(e);return t?t[1]:""})).filter((e=>e.length>0));if(t.length>0){const e=t.length-1;return(0,u.parseVersion)(t[e].trim())}}catch(e){return l.UNKNOWN_PYTHON_VERSION}return l.UNKNOWN_PYTHON_VERSION},t.getCondaInterpreterPath=S,t.CONDA_RUN_VERSION="4.9.0",t.CONDA_ACTIVATION_TIMEOUT=45e3;class _{constructor(e,n,r,i){this.command=e,this.shellPath=r,this.useWorkerThreads=i,this.condaInfoCached=new Map,void 0===this.useWorkerThreads&&(this.useWorkerThreads=!1),this.shellCommand=null!=n?n:e,(0,c.onDidChangePythonSetting)(t.CONDAPATH_SETTING_KEY,(()=>{_.condaPromise=new Map}))}static async getConda(e){return(void 0===_.condaPromise.get(e)||(0,f.isTestExecution)())&&_.condaPromise.set(e,_.locate(e)),_.condaPromise.get(e)}static setConda(e){_.condaPromise.set(void 0,Promise.resolve(new _(e)))}static async locate(e){(0,g.traceVerbose)("Searching for conda.");const n=(0,a.getUserHomeDir)();let r="conda";try{r=(0,c.getPythonSetting)(t.CONDAPATH_SETTING_KEY)}catch(e){(0,g.traceError)(`Failed to get conda path setting, ${e}`)}const s=(0,a.getOSType)()===a.OSType.Windows?"Scripts\\conda.exe":"bin/conda";async function l(e){const t=o.dirname(e),n=o.join(t,"..","condabin","conda.bat");if(await(0,c.pathExists)(n))return n}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,d.getRegistryInterpreters)()).filter((e=>e.interpreterPath&&"ContinuumAnalytics"===e.distroOrgName)).map((e=>o.join(o.win32.dirname(e.interpreterPath),s)));yield*e}()),yield*async function*(){const e=[];if((0,a.getOSType)()===a.OSType.Windows){const t=(0,a.getEnvironmentVariable)("PROGRAMDATA")||"C:\\ProgramData";if(e.push(t),n){const t=(0,a.getEnvironmentVariable)("LOCALAPPDATA")||o.join(n,"AppData","Local");e.push(n,o.join(t,"Continuum"))}}else e.push("/usr/share","/usr/local/share","/opt","/opt/homebrew/bin"),n&&e.push(n,o.join(n,"opt"));for(const t of e){let e;try{e=await i.readdir(t)}catch(t){e=void 0}void 0!==e&&(yield*e.filter((e=>e.toLowerCase().includes("conda"))).map((e=>o.join(t,e,s))))}}(),yield*async function*(){if(!n)return;let e;try{e=await i.readFile(o.join(n,".conda","environments.txt"),"utf8")}catch(t){e=""}yield*e.split(/\r?\n/g).map((e=>e.trim())).filter((e=>""!==e&&!e.startsWith("#"))).map((e=>o.join(e,s)))}()}()){(0,g.traceVerbose)(`Probing conda binary: ${t}`);let n=new _(t,void 0,e);try{if(await n.getInfo(),(0,a.getOSType)()===a.OSType.Windows&&((0,f.isTestExecution)()||t!==r)){const r=await l(t);try{if(r){const i=new _(r,void 0,e);await i.getInfo(),n=new _(t,r,e)}}catch(e){(0,g.traceVerbose)("Failed to spawn conda bat file",r,e)}}return(0,g.traceVerbose)(`Found conda via filesystem probing: ${t}`),n}catch(e){(0,g.traceVerbose)("Failed to spawn conda binary",t,e)}}(0,g.traceVerbose)("Couldn't locate the conda binary.")}async getInfo(e){let t=this.condaInfoCached.get(this.shellPath);return e&&t||(t=this.getInfoImpl(this.command,this.shellPath),this.condaInfoCached.set(this.shellPath,t)),t}async getInfoImpl(e,t){const n={timeout:45e3};t&&(n.shell=t);const r=(0,c.exec)(e,["info","--json"],n,this.useWorkerThreads);if(await Promise.race([r.then((()=>!0)),(0,y.sleep)(48e3).then((()=>!1))])){const t=await r;return(0,g.traceVerbose)(`${e} info --json: ${t.stdout}`),JSON.parse(t.stdout)}throw new Error(`Launching '${e} info --json' timed out`)}async getEnvList(){const e=await this.getInfo(),{envs:t}=e;return void 0===t?[]:Promise.all(t.map((async t=>({prefix:t,name:await this.getName(t,e)}))))}async getName(e,t){if((t=null!=t?t:await this.getInfo(!0)).root_prefix&&(0,c.arePathsSame)(e,t.root_prefix))return"base";const n=o.dirname(e);if(void 0!==t.envs_dirs)for(const r of t.envs_dirs)if((0,c.arePathsSame)(n,r))return o.basename(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){const t=S(e.prefix);return await(0,c.pathExists)(t)?((0,g.traceVerbose)("Found executable within conda env",JSON.stringify(e)),t):((0,g.traceVerbose)("Executable does not exist within conda env, assume the executable to be `python`",JSON.stringify(e)),"python")}async getRunPythonArgs(e,n,r=!1){const i=await this.getCondaVersion();if(i&&(0,s.lt)(i,t.CONDA_RUN_VERSION))return void(0,g.traceError)("`conda run` is not supported for conda version",i.raw);const o=[];e.name?o.push("-n",e.name):o.push("-p",e.prefix);const a=[n?this.shellCommand:this.command,"run",...o,"--no-capture-output","python"];return r&&a.push("-I"),[...a,m.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:45e3}).then((e=>e.stdout.trim())).catch((()=>{}));t=e&&e.startsWith("conda ")?e.substring("conda ".length).trim():e}if(!t)return;const n=t.match(/(?\d+)\.(?\d+)\.(?\d+)(?:.*)?/);if(n&&n.groups){const e=n.groups.major.concat(".",n.groups.minor,".",n.groups.micro),t=new s.SemVer(e);if(t)return t}return(0,g.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)}}_.condaPromise=new Map,r([(0,h.cache)(3e4,!0,1e4)],_.prototype,"getInfoImpl",null),r([(0,h.cache)(3e4,!0,1e4)],_.prototype,"getEnvList",null),r([(0,h.cache)(-1,!0)],_.prototype,"getCondaVersion",null),t.Conda=_},1132:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CondaService=void 0;const o=n(86700),s=n(71017),a=n(84974),c=n(36952),l=n(19735),u=n(75470);let d=class{constructor(e,t){this.platform=e,this.fileSystem=t}async getActivationScriptFromInterpreter(e,t){const n=await this.getCondaFileFromInterpreter(e,t),r=(n?s.join(s.dirname(n),"activate"):"activate").fileToCommandArgumentForPythonExt();if(this.platform.isLinux||this.platform.isMac){const e=await this.getCondaInfo();if(null==e?void 0:e.root_prefix){const t=s.join(e.root_prefix,this.platform.virtualEnvBinName,"activate").fileToCommandArgumentForPythonExt();if(r===t||!await this.fileSystem.fileExists(r))return{path:t,type:"global"}}}return{path:r,type:"local"}}async getCondaFile(e){return u.Conda.getConda().then((t=>{const n=e?null==t?void 0:t.shellCommand:null==t?void 0:t.command;return null!=n?n:"conda"}))}async getInterpreterPathForEnvironment(e){const t=await u.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 u.Conda.getConda().then((e=>null==e?void 0:e.getCondaVersion()))}async getCondaFileFromInterpreter(e,t){const n=this.platform.isWindows?"conda.exe":"conda",r=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,n);if(await this.fileSystem.fileExists(t))return t;if(t=s.join(e,r,n),await this.fileSystem.fileExists(t))return t}let a=s.join(i,n);return await this.fileSystem.fileExists(a)?a:(a=s.join(i,r,n),await this.fileSystem.fileExists(a)?a:this.getCondaFile())}async getCondaInfo(){const e=await u.Conda.getConda();return null==e?void 0:e.getInfo()}};r([(0,l.traceDecoratorVerbose)("Get Conda File from interpreter"),(0,c.cache)(12e4)],d.prototype,"getCondaFileFromInterpreter",null),r([(0,c.cache)(6e4)],d.prototype,"getCondaInfo",null),d=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IPlatformService)),i(1,(0,o.inject)(a.IFileSystem))],d),t.CondaService=d},89235:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isGloballyInstalledEnv=void 0;const r=n(47237),i=n(87450),o=n(37769),s=n(72927),a=n(77826);t.isGloballyInstalledEnv=async function(e){return async function(e){let t=[];t=(0,i.getOSType)()===i.OSType.Windows?(0,r.getSearchPathEntries)():await(0,s.commonPosixBinPaths)(),t=t.filter((e=>!(0,a.isPyenvShimDir)(e)));for(const n of t)if((0,o.isParentPath)(e,n))return!0;return!1}(e)}},25150:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.Hatch=void 0;const i=n(77570),o=n(37769),s=n(19735),a=n(36952),c=n(87450);class l{constructor(e,t){this.command=e,this.cwd=t,this.fixCwd()}static async getHatch(e){return(void 0===l.hatchPromise.get(e)||(0,i.isTestExecution)())&&l.hatchPromise.set(e,l.locate(e)),l.hatchPromise.get(e)}static async locate(e){(0,s.traceVerbose)("Probing Hatch binary hatch");const t=new l("hatch",e);if(void 0!==await t.getEnvList())return(0,s.traceVerbose)("Found hatch binary hatch"),t;(0,s.traceVerbose)("Failed to find Hatch binary hatch"),(0,s.traceVerbose)("No Hatch binary found")}async getEnvList(){return this.getEnvListCached(this.cwd)}async getEnvListCached(e){const t=await(0,o.exec)(this.command,["env","show","--json"],{cwd:this.cwd,throwOnStdErr:!0}).catch(s.traceVerbose);if(t)return(await Promise.all(Object.keys(JSON.parse(t.stdout)).map((async e=>{const t=await(0,o.exec)(this.command,["env","find",e],{cwd:this.cwd,throwOnStdErr:!0}).catch(s.traceVerbose);if(!t)return;const n=t.stdout.trim();return await(0,o.pathExists)(n)?n:void 0})))).flatMap((e=>e?[e]:[]))}fixCwd(){if((0,c.getOSType)()===c.OSType.Windows&&/^[a-z]:/.test(this.cwd)){const e=this.cwd.split(":");e[0]=e[0].toUpperCase(),this.cwd=e.join(":")}}}l.hatchPromise=new Map,r([(0,a.cache)(3e4,!0,1e4)],l.prototype,"getEnvListCached",null),t.Hatch=l},35271:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMacDefaultPythonPath=void 0;const r=n(87450);t.isMacDefaultPythonPath=function(e){return(0,r.getOSType)()===r.OSType.OSX&&(["/usr/bin/python"].includes(e)||e.startsWith("/usr/bin/python2"))}},10423:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMicrosoftStoreEnvironment=t.isStorePythonInstalled=t.isMicrosoftStoreDir=t.getMicrosoftStoreAppsRoot=void 0;const r=n(71017),i=n(87450),o=n(19735),s=n(37769);function a(){const e=(0,i.getEnvironmentVariable)("LOCALAPPDATA")||"";return r.join(e,"Microsoft","WindowsApps")}function c(e){const t=r.join((0,i.getEnvironmentVariable)("ProgramFiles")||"Program Files","WindowsApps").normalize().toUpperCase();return r.normalize(e).toUpperCase().includes(t)}async function l(e){let t=await Promise.all([(0,s.pathExists)(r.join(a(),"idle.exe")),(0,s.pathExists)(r.join(a(),"pip.exe"))]);return!!t.includes(!0)||!!e&&(t=await Promise.all([(0,s.pathExists)(r.join(r.dirname(e),"idle.exe")),(0,s.pathExists)(r.join(r.dirname(e),"pip.exe"))]),t.includes(!0))}t.getMicrosoftStoreAppsRoot=a,t.isMicrosoftStoreDir=function(e){const t=r.normalize(a()).toUpperCase();return r.normalize(e).toUpperCase().includes(t)||c(e)},t.isStorePythonInstalled=l,t.isMicrosoftStoreEnvironment=async function(e){if(await l(e)){const t=r.normalize(e).toUpperCase(),n=r.normalize(a()).toUpperCase();if(t.includes(n))return!0;if(c(t))return(0,o.traceWarn)("isMicrosoftStoreEnvironment called with Program Files store path."),!0}return!1}},37924:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPipenvEnvironmentRelatedToFolder=t.isPipenvEnvironment=t.getProjectDir=t._getAssociatedPipfile=void 0;const r=n(71017),i=n(87450),o=n(19735),s=n(37769);async function a(e,t){const n=(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,r.dirname(e));){const t=r.join(e,n);if(await(0,s.pathExists)(t))return t;e=r.dirname(e),a-=1}}async function c(e){const t=r.join(e,".project");if(!await(0,s.pathExists)(t))return;const n=(await(0,s.readFile)(t)).trim();if(await(0,s.pathExists)(n))return n;(0,o.traceVerbose)(`The .project file inside environment folder: ${e} doesn't contain a valid path to the project`)}async function l(e){const t=r.dirname(r.dirname(e)),n=await c(t);if(void 0!==n)return r.basename((0,s.normCasePath)(t)).startsWith(`${r.basename((0,s.normCasePath)(n))}-`)?a(n,{lookIntoParentDirectories:!1}):void 0}t._getAssociatedPipfile=a,t.getProjectDir=c,t.isPipenvEnvironment=async function(e){return!!await async function(e){const t=r.dirname(r.dirname(e));if(".venv"===r.basename(t))return a(r.dirname(t),{lookIntoParentDirectories:!1})}(e)||!!await l(e)},t.isPipenvEnvironmentRelatedToFolder=async function(e,t){const n=await l(e);if(!n)return!1;const r=void 0===(0,i.getEnvironmentVariable)("PIPENV_NO_INHERIT"),o=await a(t,{lookIntoParentDirectories:r});return!!o&&(0,s.arePathsSame)(n,o)}},13298:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.isPoetryEnvironmentRelatedToFolder=t.Poetry=t.isPoetryEnvironment=t.localPoetryEnvDirName=void 0;const i=n(71017),o=n(87450),s=n(37769),a=n(29616),c=n(64715),l=n(70057),u=n(36952),d=n(77570),p=n(19735),h=n(94146),f=/^(.+)-(.+)-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!!f.test(i.basename(t))&&(0,c.isVirtualenvEnvironment)(e)}(e)||!!await async function(e){const n=(0,a.getEnvironmentDirFromPath)(e);if(i.basename(n)!==t.localPoetryEnvDirName)return!1;const r=i.dirname(n);return!!await m(r)}(e)};class g{constructor(e,t){this.command=e,this.cwd=t,this.fixCwd()}static async getPoetry(e){if(await m(e))return(void 0===g.poetryPromise.get(e)||(0,d.isTestExecution)())&&g.poetryPromise.set(e,g.locate(e)),g.poetryPromise.get(e)}static async locate(e){(0,p.traceVerbose)(`Getting poetry for cwd ${e}`);for(const t of function*(){try{const e=(0,s.getPythonSetting)("poetryPath");e&&"poetry"!==e&&(yield e)}catch(e){(0,p.traceError)("Failed to get poetry setting",e)}yield"poetry";const e=(0,o.getUserHomeDir)();if(e){const t=i.join(e,".poetry","bin","poetry");(0,s.pathExistsSync)(t)&&(yield t)}}()){(0,p.traceVerbose)(`Probing poetry binary for ${e}: ${t}`);const n=new g(t,e);if(void 0!==await n.getEnvList())return(0,p.traceVerbose)(`Found poetry via filesystem probing for ${e}: ${t}`),n;(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 n="(Activated)";return(await Promise.all((0,h.splitLines)(t.stdout).map((async e=>{e.endsWith(n)&&(e=e.slice(0,-n.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 n=new l.StopWatch,r=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`,n.elapsedTime),r}}async function m(e){const t=i.join(e,"pyproject.toml");return!!(0,s.pathExistsSync)(t)&&!!(await(0,s.readFile)(t)).includes("[tool.poetry]")}g.poetryPromise=new Map,r([(0,u.cache)(3e4,!0,1e4)],g.prototype,"getEnvListCached",null),r([(0,u.cache)(2e4,!0,1e4)],g.prototype,"getActiveEnvPathCached",null),t.Poetry=g,t.isPoetryEnvironmentRelatedToFolder=async function(e,t,n){const r=n?new g(n,t):await g.getPoetry(t),i=await(null==r?void 0:r.getActiveEnvPath());return!!i&&(0,s.isParentPath)(e,i)}},77826:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePyenvVersion=t.isPyenvEnvironment=t.isPyenvShimDir=t.getPyenvVersionsDir=t.getActivePyenvForDirectory=t.setPyEnvBinary=t.getPyenvDir=void 0;const r=n(71017),i=n(87450),o=n(37769),s=n(19735);function a(){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?r.join(e,".pyenv","pyenv-win"):r.join(e,".pyenv")}return t}let c;t.getPyenvDir=a,t.setPyEnvBinary=function(e){c=e},t.getActivePyenvForDirectory=async function(e){const t=await async function(){if(c&&await(0,o.pathExists)(c))return c;const e=a(),t=r.join(e,"bin","pyenv");return await(0,o.pathExists)(t)?t:"pyenv"}();try{return(await(0,o.shellExecute)(`${t} which python`,{cwd:e})).stdout.trim()}catch(e){return void(0,s.traceVerbose)(e)}},t.getPyenvVersionsDir=function(){return r.join(a(),"versions")},t.isPyenvShimDir=function(e){const t=r.join(a(),"shims");return(0,o.arePathsSame)(t,e)||(0,o.arePathsSame)(`${t}${r.sep}`,e)},t.isPyenvEnvironment=async function(e){const t=e,n=a();return!!await(0,o.pathExists)(n)&&(0,o.isParentPath)(t,n)},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 n=new Map;return n.set("activepython",t),n.set("anaconda",t),n.set("graalpython",t),n.set("ironpython",t),n.set("jython",t),n.set("micropython",t),n.set("miniconda",t),n.set("miniforge",t),n.set("pypy",(function(e){const t=e.split("-"),n=t[0].search(/[0-9\.]+/)>0?t[0].substr("pypy".length):void 0;return 2===t.length?{pythonVer:n,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:n,distroVer:`${t[1].startsWith("v")?t[1].substr(1):t[1]}-${t[2]}`,distro:"pypy"}:3===t.length&&"stm"===t[1]?{pythonVer:n,distroVer:t[2],distro:`${t[0]}-${t[1]}`}:4===t.length&&"c"===t[1]?{pythonVer:n,distroVer:t[3],distro:`pypy-${t[1]}-${t[2]}`}:4===t.length&&t[3].startsWith("src")?{pythonVer:n,distroVer:`${t[1]}-${t[2]}-${t[3]}`,distro:"pypy"}:{pythonVer:n,distroVer:void 0,distro:"pypy"}})),n.set("pyston",t),n.set("stackless",t),n.set("3",e),n.set("2",e),n}(),n=Array.from(t.keys()).filter((t=>e.startsWith(t))).map((e=>t.get(e))).filter((e=>void 0!==e));if(n.length>0&&n[0])return n[0](e)}},64715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPythonVersionFromPyvenvCfg=t.isVirtualenvwrapperEnvironment=t.isVirtualenvEnvironment=t.isVenvEnvironment=t.isVirtualEnvironment=void 0;const r=n(55674),i=n(71017);n(32727);const o=n(94146),s=n(87450),a=n(45878),c=n(44773),l=n(95084),u=n(37769);function d(e){const t="pyvenv.cfg";return[i.join(i.dirname(i.dirname(e)),t),i.join(i.dirname(e),t)]}async function p(e){const t=d(e);for(const e of t)if(await(0,u.pathExists)(e))return!0;return!1}async function h(e){const t=i.dirname(e),n=await r.readdir(t),o=/^activate(\.([A-z]|\d)+)?$/i;return void 0!==n.find((e=>o.test(e)))}function f(e){let t,n;try{[t,n]=(0,l.parseBasicVersion)(e)}catch(e){return a.UNKNOWN_PYTHON_VERSION}return-1!==t.micro&&n.startsWith(".")&&([t.release]=(0,l.parseRelease)(n)),t}t.isVirtualEnvironment=async function(e){return p(e)},t.isVenvEnvironment=p,t.isVirtualenvEnvironment=h,t.isVirtualenvwrapperEnvironment=async function(e){const t=await function(){const e=(0,s.getEnvironmentVariable)("WORKON_HOME");return e?Promise.resolve(e):async function(){const e=(0,s.getUserHomeDir)()||"";if((0,s.getOSType)()===s.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=d(e);let n=a.UNKNOWN_PYTHON_VERSION;for(const e of t)if(await(0,u.pathExists)(e))try{const t=(0,o.splitLines)(await(0,u.readFile)(e)).map((e=>{const t=e.split("=");if(2===t.length){const e=t[0].toLowerCase().trim(),n=t[1].trim();if("version"===e)try{return(0,l.parseVersion)(n)}catch(e){return}else if("version_info"===e)try{return f(n)}catch(e){return}}})).filter((e=>void 0!==e)).map((e=>e));if(t.length>0)for(const e of t)(0,c.comparePythonVersionSpecificity)(e,n)>0&&(n=e)}catch(e){return a.UNKNOWN_PYTHON_VERSION}return n}},37769:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onDidChangePythonSetting=t.getPythonSetting=t.getSubDirs=t.isFile=t.getFileInfo=t.resolveSymbolicLink=t.arePathsSame=t.normCasePath=t.resolvePath=t.normalizePath=t.isDirectory=t.isParentPath=t.untildify=t.readFileSync=t.readFile=t.pathExistsSync=t.pathExists=t.isVirtualWorkspace=t.inExperiment=t.exec=t.shellExecute=t.initializeExternalDependencies=void 0;const r=n(55674),i=n(71017),o=n(66828),s=n(17585),a=n(29983),c=n(61684),l=n(59314),u=n(87450),d=n(19735);let p;function h(e){return(0,u.getOSType)()===u.OSType.Windows?i.normalize(e).toUpperCase():i.normalize(e)}async function f(e,t,n){if((t=null!=t?t:await r.lstat(e)).isSymbolicLink()){if(n&&n>5)return(0,d.traceError)(`Detected a potential symbolic link loop at ${e}, terminating resolution.`),e;const t=await r.readlink(e);return f(i.isAbsolute(t)?t:i.resolve(i.dirname(e),t),void 0,n=n?n+1:1)}return e}t.initializeExternalDependencies=function(e){p=e},t.shellExecute=async function(e,t={}){const n=await p.get(a.IProcessServiceFactory).create();return t={...t,useWorker:!1},n.shellExec(e,t)},t.exec=async function(e,t,n={},r=!1){const i=await p.get(a.IProcessServiceFactory).create();return n={...n,useWorker:r},i.exec(e,t,n)},t.inExperiment=function(e){return p.get(c.IExperimentService).inExperimentSync(e)},t.isVirtualWorkspace=function(){return p.get(s.IWorkspaceService).isVirtualWorkspace},t.pathExists=function(e){return r.pathExists(e)},t.pathExistsSync=function(e){return r.pathExistsSync(e)},t.readFile=function(e){return r.readFile(e,"utf-8")},t.readFileSync=function(e){return r.readFileSync(e,"utf-8")},t.untildify=n(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 r.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.resolveSymbolicLink=f,t.getFileInfo=async function(e){try{const t=await r.lstat(e);return{ctime:t.ctime.valueOf(),mtime:t.mtime.valueOf()}}catch(t){return(0,d.traceVerbose)(`Failed to get file info for ${e}`,t),{ctime:-1,mtime:-1}}},t.isFile=async function(e){const t=await r.lstat(e);if(t.isSymbolicLink()){const n=await f(e,t);return(await r.lstat(n)).isFile()}return t.isFile()},t.getSubDirs=async function*(e,t){const n=(await r.promises.readdir(e,{withFileTypes:!0})).map((n=>async function*(){const o=i.join(e,n.name);if(n.isDirectory())yield o;else if((null==t?void 0:t.resolveSymlinks)&&n.isSymbolicLink()){const e=await f(o);(await r.lstat(e)).isDirectory()&&(yield e)}}()));yield*(0,l.iterable)((0,l.chain)(n))},t.getPythonSetting=function(e,t){const n=t?o.Uri.file(t):void 0;return p.get(c.IConfigurationService).getSettings(n)[e]},t.onDidChangePythonSetting=function(e,t,n){return o.workspace.onDidChangeConfiguration((r=>{const i=n?o.Uri.file(n):void 0;r.affectsConfiguration(`python.${e}`,i)&&t()}))}},72927:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPythonBinFromPosixPaths=t.commonPosixBinPaths=t.matchPythonBinFilename=t.matchBasicPythonBinFilename=void 0;const r=n(57147),i=n(55674),o=n(71017),s=n(96486),a=n(47237),c=n(37769),l=n(19735);function u(e){return/^python(\d+(\.\d+)?)?$/.test(o.basename(e))}async function d(e){return(await r.promises.readdir(e,{withFileTypes:!0})).filter((e=>!e.isDirectory())).map((t=>o.join(e,t.name))).filter(u)}t.matchBasicPythonBinFilename=function(e){return"python"===o.basename(e)},t.matchPythonBinFilename=u,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))),n=await Promise.all(t.map((e=>i.pathExists(e))));return t.filter(((e,t)=>n[t]))},t.getPythonBinFromPosixPaths=async function(e){var t;const n=new Map;for(const r of e){const e=await d(r).catch((e=>((0,l.traceWarn)("Looking for python binaries within",r,"failed with",e),[])));for(const r of e)try{(0,l.traceVerbose)(`Attempting to resolve symbolic link: ${r}`);const e=await(0,c.resolveSymbolicLink)(r);n.has(e)?null===(t=n.get(e))||void 0===t||t.push(r):n.set(e,[r]),(0,l.traceInfo)(`Found: ${r} --\x3e ${e}`)}catch(e){(0,l.traceError)("Failed to resolve symbolic link: ",e)}}const r=Array.from(n.keys()).map((e=>{var t;return function(e){let t=e[0].length,n=e[0];for(const r of e)r.length<=t&&(t=r.length,n=r);return n}([e,...null!==(t=n.get(e))&&void 0!==t?t:[]])}));return(0,s.uniq)(r)}},53476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolvePythonExeGlobs=t.PythonEnvStructure=t.watchLocationForPythonBinaries=void 0;const r=n(91171),i=n(71017),o=n(88409),s=n(87450),a=n(19735),[c,l]=(0,s.getOSType)()===s.OSType.Windows?["python.exe","Scripts"]:["python","bin"];var u;t.watchLocationForPythonBinaries=function(e,t,n=c){const l=i.posix.normalize(n),[u]=l.split("/").slice(-1);return(0,o.watchLocationForPattern)(e,l,(function(e,n){(0,a.traceVerbose)("Received event",e,JSON.stringify(n),"for baseglob",u),r(i.basename(n),u,{nocase:(0,s.getOSType)()===s.OSType.Windows})&&t(e,n)}))},function(e){e.Standard="standard",e.Flat="flat"}(u=t.PythonEnvStructure||(t.PythonEnvStructure={})),t.resolvePythonExeGlobs=function(e=c,t=u.Standard){if(i.posix.normalize(e).includes("/"))throw Error(`invalid basename glob "${e}"`);const n=[];return t===u.Standard?n.push(e,`*/${e}`,`*/${l}/${e}`):t===u.Flat&&n.push(e),n}},91057:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readRegistryKeys=t.readRegistryValues=t.REG_SZ=t.HKLM=t.HKCU=void 0;const r=n(1283);Object.defineProperty(t,"HKCU",{enumerable:!0,get:function(){return r.HKCU}}),Object.defineProperty(t,"HKLM",{enumerable:!0,get:function(){return r.HKLM}}),Object.defineProperty(t,"REG_SZ",{enumerable:!0,get:function(){return r.REG_SZ}});const i=n(71017),o=n(59314),s=n(13018);t.readRegistryValues=async function(e,t){if(!t){const t=new(n(1283))(e),r=(0,o.createDeferred)();return t.values(((e,t)=>{e&&r.reject(e),r.resolve(t)})),r.promise}return(0,s.executeWorkerFile)(i.join(__dirname,"registryValues.worker.js"),e)},t.readRegistryKeys=async function(e,t){if(!t){const t=new(n(1283))(e),r=(0,o.createDeferred)();return t.keys(((e,t)=>{e&&r.reject(e),r.resolve(t)})),r.promise}return(0,s.executeWorkerFile)(i.join(__dirname,"registryKeys.worker.js"),e)}},38366:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRegistryInterpreters=t.getRegistryInterpretersSync=t.getInterpreterDataFromRegistry=t.matchPythonBinFilename=t.matchBasicPythonBinFilename=void 0;const r=n(96486),i=n(71017),o=n(77570),s=n(19735),a=n(91057);async function c(e,t,n,r){const i=await(0,a.readRegistryKeys)({arch:e,hive:t,key:n},r),o=n.substr(n.lastIndexOf("\\")+1),c=await Promise.all(i.map((e=>async function({arch:e,hive:t,key:n},r,i){const o={interpreterPath:"",distroOrgName:r},c=await(0,a.readRegistryValues)({arch:e,hive:t,key:n},i);for(const e of c)switch(e.name){case"SysArchitecture":o.bitnessStr=e.value;break;case"SysVersion":o.sysVersionStr=e.value;break;case"Version":o.versionStr=e.value;break;case"DisplayName":o.companyDisplayName=e.value}const l=(await(0,a.readRegistryKeys)({arch:e,hive:t,key:n},i)).map((e=>e.key)).find((e=>e.endsWith("InstallPath")));if(l){const n=(await(0,a.readRegistryValues)({arch:e,hive:t,key:l},i)).find((e=>"ExecutablePath"===e.name));n&&(o.interpreterPath=n.value,n.type!==a.REG_SZ&&(0,s.traceVerbose)(`Registry interpreter path type [${n.type}]: ${n.value}`))}if(o.interpreterPath.length>0)return o}(e,o,r))));return c.filter((e=>void 0!==e))||[]}let l,u;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:l},t.getRegistryInterpreters=async function(){return(0,o.isTestExecution)()||void 0===u?(u=async function(e=!1){let t=[];for(const n of["x64","x86"])for(const r of[a.HKLM,a.HKCU]){const i="\\SOFTWARE\\Python";let o=[];try{o=(await(0,a.readRegistryKeys)({arch:n,hive:r,key:i},e)).map((e=>e.key))}catch(e){(0,s.traceError)(`Failed to access Registry: ${n}\\${r}\\${i}`,e)}for(const i of o)t=t.concat(await c(n,r,i,e))}return l=(0,r.uniqBy)(t,(e=>e.interpreterPath)),l}(),u):u}},83606:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasPrefixCondaEnv=t.getPrefixCondaEnvPath=t.getVenvExecutable=t.hasVenv=t.getVenvPath=t.showErrorMessageWithLogs=void 0;const r=n(55674),i=n(71017),o=n(77570),s=n(67098),a=n(98638),c=n(56693),l=n(65243);function u(e){return i.join(e.uri.fsPath,".venv")}function d(e){return i.join(e.uri.fsPath,".conda")}t.showErrorMessageWithLogs=async function(e){const t=await(0,c.showErrorMessage)(e,s.Common.openOutputPanel,s.Common.selectPythonInterpreter);t===s.Common.openOutputPanel?await(0,a.executeCommand)(o.Commands.ViewOutput):t===s.Common.selectPythonInterpreter&&await(0,a.executeCommand)(o.Commands.Set_Interpreter)},t.getVenvPath=u,t.hasVenv=async function(e){return r.pathExists(i.join(u(e),"pyvenv.cfg"))},t.getVenvExecutable=function(e){return(0,l.isWindows)()?i.join(u(e),"Scripts","python.exe"):i.join(u(e),"bin","python")},t.getPrefixCondaEnvPath=d,t.hasPrefixCondaEnv=async function(e){return r.pathExists(d(e))}},18419:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCreateEnvWorkspaceCheckNotRun=t.disableCreateEnvironmentTrigger=t.shouldPromptToCreateEnv=t.isGlobalPythonSelected=t.hasKnownFiles=t.hasRequirementFiles=t.fileContainsInlineDependencies=t.CREATE_ENV_TRIGGER_SETTING=t.CREATE_ENV_TRIGGER_SETTING_PART=void 0;const r=n(71017),i=n(55674),o=n(66828),s=n(12771),a=n(50189),c=n(77570),l=n(19735),u=n(85261),d=n(73766);t.CREATE_ENV_TRIGGER_SETTING_PART="createEnvironment.trigger",t.CREATE_ENV_TRIGGER_SETTING=`python.${t.CREATE_ENV_TRIGGER_SETTING_PART}`,t.fileContainsInlineDependencies=async function(e){return!1},t.hasRequirementFiles=async function(e){var t;const n=await(0,s.getPipRequirementsFiles)(e),r=(null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0)>0;return r&&(0,l.traceVerbose)(`Found requirement files: ${e.uri.fsPath}`),r},t.hasKnownFiles=async function(e){const t=["poetry.lock","conda.yaml","environment.yaml","conda.yml","environment.yml","Pipfile","Pipfile.lock"].map((t=>r.join(e.uri.fsPath,t))),n=(await Promise.all(t.map((e=>i.pathExists(e))))).some((e=>e));return n&&(0,l.traceVerbose)(`Found known files: ${e.uri.fsPath}`),n},t.isGlobalPythonSelected=async function(e){const t=(0,a.getExtension)(c.PVSC_EXTENSION_ID);if(!t)return!1;const n=t.exports,r=n.environments.getActiveEnvironmentPath(e.uri),i=await n.environments.resolveEnvironment(r),o=void 0===(null==i?void 0:i.environment);return o&&(0,l.traceVerbose)(`Selected python for [${e.uri.fsPath}] is [global] type: ${r.path}`),o},t.shouldPromptToCreateEnv=function(){const e=(0,u.getConfiguration)("python");return e?"off"!==e.get(t.CREATE_ENV_TRIGGER_SETTING_PART,"off"):"off"!==(0,d.getWorkspaceStateValue)(t.CREATE_ENV_TRIGGER_SETTING,"off")},t.disableCreateEnvironmentTrigger=function(){const e=(0,u.getConfiguration)("python");e&&e.update("createEnvironment.trigger","off",o.ConfigurationTarget.Global)};let p=!1;t.isCreateEnvWorkspaceCheckNotRun=function(){return!p&&(p=!0,!0)}},83624:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInstalledPackagesDiagnostics=t.INSTALL_CHECKER_SOURCE=void 0;const r=n(66828),i=n(4057),o=n(18699),s=n(19735),a=n(85261);function c(e){const t=(0,a.getConfiguration)("python",e.uri).get("missingPackage.severity","Hint");return"Error"===t?r.DiagnosticSeverity.Error:"Warning"===t?r.DiagnosticSeverity.Warning:"Information"===t?r.DiagnosticSeverity.Information:r.DiagnosticSeverity.Hint}t.INSTALL_CHECKER_SOURCE="Python-InstalledPackagesChecker",t.getInstalledPackagesDiagnostics=async function(e,n){const a=await e.getActiveInterpreter(n.uri);if(!a)return[];const l=(0,i.installedCheckScript)();try{(0,s.traceInfo)("Running installed packages checker: ",a,l,n.uri.fsPath);const e={...process.env,VSCODE_MISSING_PGK_SEVERITY:`${c(n)}`},i=await(0,o.plainExec)(a.path,[l,n.uri.fsPath],{env:e});return(0,s.traceVerbose)("Installed packages check result:\n",i.stdout),i.stderr&&(0,s.traceError)("Installed packages check error:\n",i.stderr),function(e){let n=[];try{n=JSON.parse(e).map((e=>{const n=new r.Diagnostic(new r.Range(e.line,e.character,e.endLine,e.endCharacter),r.l10n.t("Package `{0}` is not installed in the selected environment.",e.package),e.severity);return n.code={value:e.code,target:r.Uri.parse(`https://pypi.org/p/${e.package}`)},n.source=t.INSTALL_CHECKER_SOURCE,n}))}catch(e){n=[]}return n}(i.stdout)}catch(e){(0,s.traceError)("Error while getting installed packages check result:\n",e)}return[]}},67995:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickWorkspaceFolder=void 0;const r=n(55674),i=n(71017),o=n(56693),s=n(85261),a=n(67098),c=n(98638);function l(e){return Promise.race([r.pathExists(i.join(e.uri.fsPath,".venv")),r.pathExists(i.join(e.uri.fsPath,".conda"))])}t.pickWorkspaceFolder=async function(e,t){const n=(0,s.getWorkspaceFolders)();if(!n||0===n.length){if(t===o.MultiStepAction.Back)throw o.MultiStepAction.Back;return void(await(0,o.showErrorMessage)(a.CreateEnv.noWorkspace,a.Common.openFolder)===a.Common.openFolder&&await(0,c.executeCommand)("vscode.openFolder"))}if(null==e?void 0:e.preSelectedWorkspace){if(t===o.MultiStepAction.Back)throw o.MultiStepAction.Back;return e.preSelectedWorkspace}if(1===n.length){if(t===o.MultiStepAction.Back)throw o.MultiStepAction.Back;return n[0]}const r=await(0,o.showQuickPickWithBack)(await async function(e){const t=[];for(const n of e)t.push({label:n.name,detail:n.uri.fsPath,description:await l(n)?a.CreateEnv.hasVirtualEnv:void 0});return t}(n),{placeHolder:a.CreateEnv.pickWorkspacePlaceholder,ignoreFocusOut:!0,canPickMany:null==e?void 0:e.allowMultiSelect,matchOnDescription:!0,matchOnDetail:!0},null==e?void 0:e.token);if(r){if(Array.isArray(r)){const e=r.map((e=>e.detail)).filter((e=>void 0!==e));return n.filter((t=>e.includes(t.uri.fsPath)))}return n.filter((e=>e.uri.fsPath===r.detail))[0]}}},85949:(e,t,n)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.buildEnvironmentCreationApi=t.registerCreateEnvironmentFeatures=t.isCreatingEnvironment=t.onCreateEnvironmentExited=t.onCreateEnvironmentStarted=t.registerCreateEnvironmentProvider=void 0;const i=n(66828),o=n(77570),s=n(98638),a=n(83720),c=n(31867),l=n(15739),u=n(56693),d=n(67098),p=n(54813),h=n(61522),f=new class{constructor(){this._createEnvProviders=[],this._createEnvProviders=[]}add(e){if(this._createEnvProviders.filter((t=>t.id===e.id)).length>0)throw new Error(`Create Environment provider with id ${e.id} already registered`);this._createEnvProviders.push(e)}remove(e){this._createEnvProviders=this._createEnvProviders.filter((t=>t!==e))}getAll(){return this._createEnvProviders}};function g(e){return f.add(e),new i.Disposable((()=>{f.remove(e)}))}t.registerCreateEnvironmentProvider=g,r=(0,a.getCreationEvents)(),t.onCreateEnvironmentStarted=r.onCreateEnvironmentStarted,t.onCreateEnvironmentExited=r.onCreateEnvironmentExited,t.isCreatingEnvironment=r.isCreatingEnvironment,t.registerCreateEnvironmentFeatures=function(e,n,r,m){e.push((0,s.registerCommand)(o.Commands.Create_Environment,(e=>{const t=f.getAll();return(0,a.handleCreateEnvironmentCommand)(t,e)})),(0,s.registerCommand)(o.Commands.Create_Environment_Button,(async()=>{(0,p.sendTelemetryEvent)(h.EventName.ENVIRONMENT_BUTTON,void 0,void 0),await(0,s.executeCommand)(o.Commands.Create_Environment)})),g(new l.VenvCreationProvider(n)),g((0,c.condaCreationProvider)()),(0,t.onCreateEnvironmentExited)((async e=>{var t,n;e.path&&(null===(t=e.options)||void 0===t?void 0:t.selectEnvironment)&&(await r.update(null===(n=e.workspaceFolder)||void 0===n?void 0:n.uri,i.ConfigurationTarget.WorkspaceFolder,e.path),(0,u.showInformationMessage)(`${d.CreateEnv.informEnvCreation} ${m.getDisplayName(e.path)}`))})))},t.buildEnvironmentCreationApi=function(){return{onWillCreateEnvironment:t.onCreateEnvironmentStarted,onDidCreateEnvironment:t.onCreateEnvironmentExited,createEnvironment:async e=>{const t=f.getAll();try{return await(0,a.handleCreateEnvironmentCommand)(t,e)}catch(e){return{path:void 0,workspaceFolder:void 0,action:void 0,error:e}}},registerCreateEnvironmentProvider:e=>g(e)}}},61267:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerCreateEnvironmentButtonFeatures=void 0;const r=n(98638),i=n(85261);async function o(){const e="show"===(0,i.getConfiguration)("python").get("createEnvironment.contentButton","show");await(0,r.executeCommand)("setContext","showCreateEnvButton",e)}t.registerCreateEnvironmentButtonFeatures=function(e){e.push((0,i.onDidChangeConfiguration)((async()=>{await o()}))),o()}},83720:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleCreateEnvironmentCommand=t.getCreationEvents=void 0;const r=n(66828),i=n(67098),o=n(56693),s=n(19735),a=new r.EventEmitter,c=new r.EventEmitter;let l=0;function u(){return l>0}t.getCreationEvents=function(){return{onCreateEnvironmentStarted:a.event,onCreateEnvironmentExited:c.event,isCreatingEnvironment:u}},t.handleCreateEnvironmentCommand=async function(e,t){const n=function(e){return{installPackages:!0,ignoreSourceControl:!0,showBackButton:!1,selectEnvironment:!0,...e}}(t);let u;const d=new o.MultiStepNode(void 0,(async t=>{if(e.length>0){try{u=await async function(e,t){const n=e.map((e=>({label:e.name,description:e.description,id:e.id})));if(null==t?void 0:t.providerId){const n=e.find((e=>e.id===t.providerId));if(n)return n}let r;if(r=(null==t?void 0:t.showBackButton)?await(0,o.showQuickPickWithBack)(n,{placeHolder:i.CreateEnv.providersQuickPickPlaceholder,matchOnDescription:!0,ignoreFocusOut:!0}):await(0,o.showQuickPick)(n,{placeHolder:i.CreateEnv.providersQuickPickPlaceholder,matchOnDescription:!0,ignoreFocusOut:!0}),r){const t=Array.isArray(r)?r[0]:r;if(t){const n=e.filter((e=>e.id===t.id));if(n.length>0)return n[0]}}}(e,n)}catch(e){if(e===o.MultiStepAction.Back||e===o.MultiStepAction.Cancel)return e;throw e}if(!u)return o.MultiStepAction.Cancel}else if((0,s.traceError)("No Environment Creation providers were registered."),t===o.MultiStepAction.Back)return o.MultiStepAction.Back;return o.MultiStepAction.Continue}),void 0);let p;const h=new o.MultiStepNode(d,(async e=>{if(e===o.MultiStepAction.Back)return o.MultiStepAction.Back;if(u)try{p=await async function(e,t){let n,i;try{!function(e){a.fire({options:e}),l+=1}(t),n=await e.createEnvironment(t)}catch(e){if(e===r.QuickInputButtons.Back&&((0,s.traceVerbose)("Create Env: User clicked back button during environment creation"),!t.showBackButton))return;throw i=e,i}finally{!function(e,t,n){l-=1,e?c.fire({options:t,...e}):n&&c.fire({options:t,error:n})}(n,t,i)}return n}(u,n)}catch(e){if(e===o.MultiStepAction.Back||e===o.MultiStepAction.Cancel)return e;throw e}return o.MultiStepAction.Continue}),void 0);d.next=h;const f=await o.MultiStepNode.run(d);if((null==t?void 0:t.showBackButton)&&(f!==o.MultiStepAction.Back&&f!==o.MultiStepAction.Cancel||(p={action:f,workspaceFolder:void 0,path:void 0,error:void 0})),p)return Object.freeze(p)}},5793:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerCreateEnvironmentTriggers=t.triggerCreateEnvironmentCheckNonBlocking=t.triggerCreateEnvironmentCheck=t.CreateEnvironmentCheckKind=void 0;const r=n(18419),i=n(85261),o=n(19735),s=n(83606),a=n(56693),c=n(67098),l=n(98638),u=n(77570),d=n(54813),p=n(61522);var h;function f(e,t={}){return(0,r.isCreateEnvWorkspaceCheckNotRun)()||(null==t?void 0:t.force)?async function(e){const t=(0,i.getWorkspaceFolder)(e);if(!t)return void(0,o.traceInfo)(`CreateEnv Trigger - Workspace not found for ${e.fsPath}`);if((await Promise.all([(0,s.hasVenv)(t),(0,s.hasPrefixCondaEnv)(t),(async e=>!await(0,r.hasRequirementFiles)(e))(t),(0,r.hasKnownFiles)(t),(async e=>!await(0,r.isGlobalPythonSelected)(e))(t)])).some((e=>e)))return(0,d.sendTelemetryEvent)(p.EventName.ENVIRONMENT_CHECK_RESULT,void 0,{result:"criteria-not-met"}),void(0,o.traceInfo)(`CreateEnv Trigger - Skipping for ${e.fsPath}`);(0,d.sendTelemetryEvent)(p.EventName.ENVIRONMENT_CHECK_RESULT,void 0,{result:"criteria-met"});const n=await(0,a.showInformationMessage)(c.CreateEnv.Trigger.workspaceTriggerMessage,c.CreateEnv.Trigger.createEnvironment,c.Common.doNotShowAgain);if(n===c.CreateEnv.Trigger.createEnvironment)try{await(0,l.executeCommand)(u.Commands.Create_Environment)}catch(e){(0,o.traceError)("CreateEnv Trigger - Error while creating environment: ",e)}else n===c.Common.doNotShowAgain&&(0,r.disableCreateEnvironmentTrigger)()}(e):((0,d.sendTelemetryEvent)(p.EventName.ENVIRONMENT_CHECK_RESULT,void 0,{result:"already-ran"}),(0,o.traceVerbose)("CreateEnv Trigger - skipping this because it was already run"),Promise.resolve())}async function g(e,t,n){if(!t)return(0,d.sendTelemetryEvent)(p.EventName.ENVIRONMENT_CHECK_RESULT,void 0,{result:"no-uri"}),void(0,o.traceVerbose)("CreateEnv Trigger - Skipping No URI provided");(0,r.shouldPromptToCreateEnv)()?e===h.File?await async function(e,t){await(0,r.fileContainsInlineDependencies)(e)&&await f(e,t),await f(e,t)}(t,n):await f(t,n):((0,d.sendTelemetryEvent)(p.EventName.ENVIRONMENT_CHECK_RESULT,void 0,{result:"turned-off"}),(0,o.traceVerbose)("CreateEnv Trigger - turned off in settings"))}function m(e,t,n){setTimeout((()=>g(e,t,n).ignoreErrors()),0)}!function(e){e.File="file",e.Workspace="workspace"}(h=t.CreateEnvironmentCheckKind||(t.CreateEnvironmentCheckKind={})),t.triggerCreateEnvironmentCheck=g,t.triggerCreateEnvironmentCheckNonBlocking=m,t.registerCreateEnvironmentTriggers=function(e){e.push((0,l.registerCommand)(u.Commands.Create_Environment_Check,(e=>{(0,d.sendTelemetryEvent)(p.EventName.ENVIRONMENT_CHECK_TRIGGER,void 0,{trigger:"as-command"}),m(h.File,e,{force:!0})})))}},44049:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTriggerForPipInTerminal=void 0;const r=n(60717),i=n(37769),o=n(18419),s=n(85261),a=n(67098),c=n(19735),l=n(98638),u=n(77570),d=n(56693),p=n(54813),h=n(61522);t.registerTriggerForPipInTerminal=function(e){if(!(0,o.shouldPromptToCreateEnv)()||!(0,i.inExperiment)(r.CreateEnvOnPipInstallTrigger.experiment))return;const t=(0,s.getWorkspaceFolders)();if(!t||0===t.length)return;const n=new Map;t.forEach((e=>{n.set(e.uri.fsPath,!1)})),e.push((0,d.onDidStartTerminalShellExecution)((async e=>{const t=(0,s.getWorkspaceFolder)(e.shellIntegration.cwd);if(t&&!n.get(t.uri.fsPath)&&await(0,o.isGlobalPythonSelected)(t)&&e.execution.commandLine.isTrusted&&function(e){const t=e.toLowerCase();return t.startsWith("pip install")||t.startsWith("pip3 install")||t.startsWith("python -m pip install")||t.startsWith("python3 -m pip install")}(e.execution.commandLine.value)){n.set(t.uri.fsPath,!0),(0,p.sendTelemetryEvent)(h.EventName.ENVIRONMENT_TERMINAL_GLOBAL_PIP);const r=await(0,d.showWarningMessage)(a.CreateEnv.Trigger.globalPipInstallTriggerMessage,a.CreateEnv.Trigger.createEnvironment,a.Common.doNotShowAgain);if(r===a.CreateEnv.Trigger.createEnvironment)try{const n=await(0,l.executeCommand)(u.Commands.Create_Environment,{workspaceFolder:t,providerId:`${u.PVSC_EXTENSION_ID}:venv`});n.path&&((0,c.traceInfo)("CreateEnv Trigger - Environment created: ",n.path),(0,c.traceInfo)(`CreateEnv Trigger - Running: ${n.path} -m ${e.execution.commandLine.value.trim()}`),e.shellIntegration.executeCommand(`${n.path} -m ${e.execution.commandLine.value}`.trim()))}catch(e){(0,c.traceError)("CreateEnv Trigger - Error while creating environment: ",e)}else r===a.Common.doNotShowAgain&&(0,o.disableCreateEnvironmentTrigger)()}})))}},50939:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerInstalledPackagesDiagnosticsProvider=t.DEPS_NOT_INSTALLED_KEY=void 0;const r=n(98638),i=n(64061),o=n(56693),s=n(85261),a=n(19735),c=n(83624);async function l(e){var n;const i=null===(n=(0,o.getActiveTextEditor)())||void 0===n?void 0:n.document;if(i&&("pip-requirements"===i.languageId||i.fileName.endsWith("pyproject.toml"))){const n=e.get(i.uri);if(n&&n.length>0)return(0,a.traceVerbose)(`Setting context for python dependencies not installed: ${i.uri.fsPath}`),void await(0,r.executeCommand)("setContext",t.DEPS_NOT_INSTALLED_KEY,!0)}await(0,r.executeCommand)("setContext",t.DEPS_NOT_INSTALLED_KEY,!1)}t.DEPS_NOT_INSTALLED_KEY="pythonDepsNotInstalled",t.registerInstalledPackagesDiagnosticsProvider=function(e,t){const n=(0,i.createDiagnosticCollection)(c.INSTALL_CHECKER_SOURCE),r=(e,t)=>{t.length>0?n.set(e,t):n.has(e)&&n.delete(e)};e.push(n),e.push((0,s.onDidOpenTextDocument)((async e=>{if("pip-requirements"===e.languageId||e.fileName.endsWith("pyproject.toml")){const n=await(0,c.getInstalledPackagesDiagnostics)(t,e);r(e.uri,n)}})),(0,s.onDidSaveTextDocument)((async e=>{if("pip-requirements"===e.languageId||e.fileName.endsWith("pyproject.toml")){const n=await(0,c.getInstalledPackagesDiagnostics)(t,e);r(e.uri,n)}})),(0,s.onDidCloseTextDocument)((e=>{r(e.uri,[])})),(0,i.onDidChangeDiagnostics)((async()=>{await l(n)})),(0,o.onDidChangeActiveTextEditor)((async()=>{await l(n)})),t.onDidChangeInterpreter((()=>{(0,s.getOpenTextDocuments)().forEach((async e=>{if("pip-requirements"===e.languageId||e.fileName.endsWith("pyproject.toml")){const n=await(0,c.getInstalledPackagesDiagnostics)(t,e);r(e.uri,n)}}))}))),(0,s.getOpenTextDocuments)().forEach((async e=>{if("pip-requirements"===e.languageId||e.fileName.endsWith("pyproject.toml")){const n=await(0,c.getInstalledPackagesDiagnostics)(t,e);r(e.uri,n)}}))}},31867:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.condaCreationProvider=void 0;const r=n(66828),i=n(71017),o=n(77570),s=n(19735),a=n(67995),c=n(18699),l=n(59314),u=n(87450),d=n(4057),p=n(67098),h=n(83741),f=n(83606),g=n(56693),m=n(61522),v=n(54813),y=n(22180),b=n(94146);function S(e){return(0,u.getOSType)()===u.OSType.Windows?i.join(e,"python.exe"):i.join(e,"bin","python")}async function _(e){const t=await(0,h.getCondaBaseEnv)();if(!t)return;let n;const i=new g.MultiStepNode(void 0,(async e=>{try{n=await(0,a.pickWorkspaceFolder)(void 0,e)}catch(e){if(e===g.MultiStepAction.Back||e===g.MultiStepAction.Cancel)return e;throw e}return void 0===n?((0,s.traceError)("Workspace was not selected or found for creating conda environment."),g.MultiStepAction.Cancel):((0,s.traceInfo)(`Selected workspace ${n.uri.fsPath} for creating conda environment.`),g.MultiStepAction.Continue)}),void 0);let u;const _=new g.MultiStepNode(i,(async e=>{if(n&&e===g.MultiStepAction.Continue)try{return u=await(0,h.pickExistingCondaAction)(n),g.MultiStepAction.Continue}catch(e){if(e===g.MultiStepAction.Back||e===g.MultiStepAction.Cancel)return e;throw e}else if(e===g.MultiStepAction.Back)return g.MultiStepAction.Back;return g.MultiStepAction.Continue}),void 0);let E;i.next=_;const w=new g.MultiStepNode(i,(async e=>{if(u===h.ExistingCondaAction.Recreate||u===h.ExistingCondaAction.Create){try{E=await(0,h.pickPythonVersion)()}catch(e){if(e===g.MultiStepAction.Back||e===g.MultiStepAction.Cancel)return e;throw e}if(void 0===E)return(0,s.traceError)("Python version was not selected for creating conda environment."),g.MultiStepAction.Cancel;(0,s.traceInfo)(`Selected Python version ${E} for creating conda environment.`)}else if(u===h.ExistingCondaAction.UseExisting&&e===g.MultiStepAction.Back)return g.MultiStepAction.Back;return g.MultiStepAction.Continue}),void 0);_.next=w;const T=await g.MultiStepNode.run(i);if(T===g.MultiStepAction.Back||T===g.MultiStepAction.Cancel)throw T;if(n)if(u===h.ExistingCondaAction.Recreate){if((0,v.sendTelemetryEvent)(m.EventName.ENVIRONMENT_DELETE,void 0,{environmentType:"conda",status:"triggered"}),!await(0,h.deleteEnvironment)(n,S(t)))throw(0,v.sendTelemetryEvent)(m.EventName.ENVIRONMENT_DELETE,void 0,{environmentType:"conda",status:"failed"}),g.MultiStepAction.Cancel;(0,v.sendTelemetryEvent)(m.EventName.ENVIRONMENT_DELETE,void 0,{environmentType:"conda",status:"deleted"})}else if(u===h.ExistingCondaAction.UseExisting)return(0,v.sendTelemetryEvent)(m.EventName.ENVIRONMENT_REUSE,void 0,{environmentType:"conda"}),{path:(0,f.getPrefixCondaEnvPath)(n),workspaceFolder:n};return(0,g.withProgress)({location:r.ProgressLocation.Notification,title:`${p.CreateEnv.statusTitle} ([${p.Common.showLogs}](command:${o.Commands.ViewOutput}))`,cancellable:!0},(async(r,i)=>{let o;r.report({message:p.CreateEnv.statusStarting});try{if((0,v.sendTelemetryEvent)(m.EventName.ENVIRONMENT_CREATING,void 0,{environmentType:"conda",pythonVersion:E}),n){if(o=await async function(e,t,n,r,i){r.report({message:p.CreateEnv.Conda.creating});const o=(0,l.createDeferred)(),a=(0,h.getPathEnvVariableForConda)(t);(0,s.traceLog)("Running Conda Env creation script: ",[t,...n]);const{proc:u,out:d,dispose:f}=(0,c.execObservable)(t,n,{mergeStdOutErr:!0,token:i,cwd:e.uri.fsPath,env:{PATH:a}}),g=new y.CondaProgressAndTelemetry(r);let m;return d.subscribe((e=>{const t=(0,b.splitLines)(e.out).join("\r\n");(0,s.traceLog)(t.trimEnd()),(t.includes(y.CONDA_ENV_CREATED_MARKER)||t.includes(y.CONDA_ENV_EXISTING_MARKER))&&(m=function(e){try{const t=e.split(/\r?\n/g).map((e=>e.trim())).filter((e=>e.startsWith(y.CONDA_ENV_CREATED_MARKER)||e.startsWith(y.CONDA_ENV_EXISTING_MARKER)))[0];return t.includes(y.CONDA_ENV_CREATED_MARKER)?t.substring(y.CONDA_ENV_CREATED_MARKER.length):t.substring(y.CONDA_ENV_EXISTING_MARKER.length)}catch(e){return void(0,s.traceError)("Parsing out environment path failed.")}}(t)),g.process(t)}),(async e=>{(0,s.traceError)("Error while running conda env creation script: ",e),o.reject(e)}),(()=>{f(),0!==(null==u?void 0:u.exitCode)?((0,s.traceError)("Error while running venv creation script: ",g.getLastError()),o.reject(g.getLastError()||`Conda env creation failed with exitCode: ${null==u?void 0:u.exitCode}`)):o.resolve(m)})),o.promise}(n,S(t),function(e,t){let n=!0,r=!0;t&&(n=void 0===(null==t?void 0:t.ignoreSourceControl)||t.ignoreSourceControl,r=void 0===(null==t?void 0:t.installPackages)||t.installPackages);const i=[(0,d.createCondaScript)()];return n&&i.push("--git-ignore"),r&&i.push("--install"),e&&(i.push("--python"),i.push(e)),i}(E,e),r,i),o)return{path:o,workspaceFolder:n};throw new Error("Failed to create conda environment. See Output > Python for more info.")}throw new Error("A workspace is needed to create conda environment")}catch(e){return(0,s.traceError)(e),(0,f.showErrorMessageWithLogs)(p.CreateEnv.Conda.errorCreatingEnvironment),{error:e}}}))}t.condaCreationProvider=function(){return{createEnvironment:_,name:"Conda",description:p.CreateEnv.Conda.providerDescription,id:`${o.PVSC_EXTENSION_ID}:conda`,tools:["Conda"]}}},99620:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteCondaEnvironment=void 0;const r=n(18699),i=n(67098),o=n(19735),s=n(83606);t.deleteCondaEnvironment=async function(e,t,n){const a=(0,s.getPrefixCondaEnvPath)(e),c=t,l=["-m","conda","env","remove","--prefix",a,"--yes"];try{(0,o.traceInfo)(`Deleting conda environment: ${a}`),(0,o.traceInfo)(`Running command: ${c} ${l.join(" ")}`);const t=await(0,r.plainExec)(c,l,{mergeStdOutErr:!0},{...process.env,PATH:n});if((0,o.traceInfo)(t.stdout),await(0,s.hasPrefixCondaEnv)(e))return(0,o.traceError)(`Conda environment ${a} could not be deleted.`),(0,o.traceError)(`Please delete the environment manually: ${a}`),(0,s.showErrorMessageWithLogs)(i.CreateEnv.Conda.errorDeletingEnvironment),!1}catch(e){return(0,s.showErrorMessageWithLogs)(i.CreateEnv.Conda.errorDeletingEnvironment),(0,o.traceError)(`Deleting conda environment ${a} Failed with error: `,e),!1}return!0}},22180:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CondaProgressAndTelemetry=t.CREATE_FAILED_INSTALL_YML=t.CREATE_CONDA_INSTALLED_YML=t.CREATE_CONDA_FAILED_MARKER=t.CONDA_INSTALLING_YML=t.CONDA_ENV_EXISTING_MARKER=t.CONDA_ENV_CREATED_MARKER=void 0;const r=n(67098),i=n(54813),o=n(61522);t.CONDA_ENV_CREATED_MARKER="CREATED_CONDA_ENV:",t.CONDA_ENV_EXISTING_MARKER="EXISTING_CONDA_ENV:",t.CONDA_INSTALLING_YML="CONDA_INSTALLING_YML:",t.CREATE_CONDA_FAILED_MARKER="CREATE_CONDA.ENV_FAILED_CREATION",t.CREATE_CONDA_INSTALLED_YML="CREATE_CONDA.INSTALLED_YML",t.CREATE_FAILED_INSTALL_YML="CREATE_CONDA.FAILED_INSTALL_YML",t.CondaProgressAndTelemetry=class{constructor(e){this.progress=e,this.condaCreatedReported=!1,this.condaFailedReported=!1,this.condaInstallingPackagesReported=!1,this.condaInstallingPackagesFailedReported=!1,this.condaInstalledPackagesReported=!1,this.lastError=void 0}process(e){!this.condaCreatedReported&&e.includes(t.CONDA_ENV_CREATED_MARKER)?(this.condaCreatedReported=!0,this.progress.report({message:r.CreateEnv.Conda.created}),(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_CREATED,void 0,{environmentType:"conda",reason:"created"})):!this.condaCreatedReported&&e.includes(t.CONDA_ENV_EXISTING_MARKER)?(this.condaCreatedReported=!0,this.progress.report({message:r.CreateEnv.Conda.created}),(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_CREATED,void 0,{environmentType:"conda",reason:"existing"})):!this.condaFailedReported&&e.includes(t.CREATE_CONDA_FAILED_MARKER)?(this.condaFailedReported=!0,(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_FAILED,void 0,{environmentType:"conda",reason:"other"}),this.lastError=t.CREATE_CONDA_FAILED_MARKER):!this.condaInstallingPackagesReported&&e.includes(t.CONDA_INSTALLING_YML)?(this.condaInstallingPackagesReported=!0,this.progress.report({message:r.CreateEnv.Conda.installingPackages}),(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLING_PACKAGES,void 0,{environmentType:"conda",using:"environment.yml"})):!this.condaInstallingPackagesFailedReported&&e.includes(t.CREATE_FAILED_INSTALL_YML)?(this.condaInstallingPackagesFailedReported=!0,(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLING_PACKAGES_FAILED,void 0,{environmentType:"conda",using:"environment.yml"}),this.lastError=t.CREATE_FAILED_INSTALL_YML):!this.condaInstalledPackagesReported&&e.includes(t.CREATE_CONDA_INSTALLED_YML)&&(this.condaInstalledPackagesReported=!0,(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLED_PACKAGES,void 0,{environmentType:"conda",using:"environment.yml"}))}getLastError(){return this.lastError}}},83741:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickExistingCondaAction=t.ExistingCondaAction=t.deleteEnvironment=t.getPathEnvVariableForConda=t.pickPythonVersion=t.getCondaBaseEnv=void 0;const r=n(71017),i=n(66828),o=n(77570),s=n(67098),a=n(98638),c=n(56693),l=n(19735),u=n(75470),d=n(83606),p=n(87450),h=n(99620);function f(e){const t=(0,p.getEnvironmentVariable)("PATH")||(0,p.getEnvironmentVariable)("Path")||"";if((0,p.getOSType)()===p.OSType.Windows){const n=r.dirname(e);return`${[r.join(n,"Library","bin"),r.join(n,"Library","mingw-w64","bin"),r.join(n,"Library","usr","bin"),r.join(n,"bin"),r.join(n,"Scripts")].join(r.delimiter)}${r.delimiter}${t}`}return t}var g;t.getCondaBaseEnv=async function(){const e=await u.Conda.getConda();if(!e)return void(await(0,c.showErrorMessage)(s.CreateEnv.Conda.condaMissing,s.Common.learnMore)===s.Common.learnMore&&await(0,a.executeCommand)("vscode.open",i.Uri.parse("https://docs.anaconda.com/anaconda/install/")));const t=(await e.getEnvList()).filter((e=>"base"===e.name));if(1===t.length)return t[0].prefix;t.length>1&&(0,l.traceLog)("Multiple conda base envs detected: ",t.map((e=>e.prefix)))},t.pickPythonVersion=async function(e){const t=["3.11","3.12","3.10","3.9","3.8"].map((e=>({label:"3.11"===e?`${o.Octicons.Star} Python`:"Python",description:e}))),n=await(0,c.showQuickPickWithBack)(t,{placeHolder:s.CreateEnv.Conda.selectPythonQuickPickPlaceholder,matchOnDescription:!0,ignoreFocusOut:!0},e);if(n)return n.description},t.getPathEnvVariableForConda=f,t.deleteEnvironment=async function(e,t){const n=(0,d.getPrefixCondaEnvPath)(e);return(0,c.withProgress)({location:i.ProgressLocation.Notification,title:`${s.CreateEnv.Conda.deletingEnvironmentProgress} ([${s.Common.showLogs}](command:${o.Commands.ViewOutput})): ${n}`,cancellable:!1},(async()=>(0,h.deleteCondaEnvironment)(e,t,f(t))))},function(e){e[e.Recreate=0]="Recreate",e[e.UseExisting=1]="UseExisting",e[e.Create=2]="Create"}(g=t.ExistingCondaAction||(t.ExistingCondaAction={})),t.pickExistingCondaAction=async function(e){if(e){if(!await(0,d.hasPrefixCondaEnv)(e))return g.Create;{const e=[{label:s.CreateEnv.Conda.recreate,description:s.CreateEnv.Conda.recreateDescription},{label:s.CreateEnv.Conda.useExisting,description:s.CreateEnv.Conda.useExistingDescription}],t=await(0,c.showQuickPickWithBack)(e,{placeHolder:s.CreateEnv.Conda.existingCondaQuickPickPlaceholder,ignoreFocusOut:!0},void 0);if((null==t?void 0:t.label)===s.CreateEnv.Conda.recreate)return g.Recreate;if((null==t?void 0:t.label)===s.CreateEnv.Conda.useExisting)return g.UseExisting}}throw c.MultiStepAction.Cancel}},15739:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VenvCreationProvider=void 0;const r=n(22037),i=n(66828),o=n(77570),s=n(4057),a=n(18699),c=n(59314),l=n(67098),u=n(19735),d=n(67995),p=n(81387),h=n(56693),f=n(54813),g=n(61522),m=n(78970),v=n(83606),y=n(12771),b=n(22207);t.VenvCreationProvider=class{constructor(e){this.interpreterQuickPick=e,this.name="Venv",this.description=l.CreateEnv.Venv.providerDescription,this.id=`${o.PVSC_EXTENSION_ID}:venv`,this.tools=["Venv"]}async createEnvironment(e){let t;const n=new h.MultiStepNode(void 0,(async n=>{try{t=await(0,d.pickWorkspaceFolder)({preSelectedWorkspace:null==e?void 0:e.workspaceFolder},n)}catch(e){if(e===h.MultiStepAction.Back||e===h.MultiStepAction.Cancel)return e;throw e}return void 0===t?((0,u.traceError)("Workspace was not selected or found for creating virtual environment."),h.MultiStepAction.Cancel):((0,u.traceInfo)(`Selected workspace ${t.uri.fsPath} for creating virtual environment.`),h.MultiStepAction.Continue)}),void 0);let S;const _=new h.MultiStepNode(n,(async e=>{if(t&&e===h.MultiStepAction.Continue)try{return S=await(0,y.pickExistingVenvAction)(t),h.MultiStepAction.Continue}catch(e){if(e===h.MultiStepAction.Back||e===h.MultiStepAction.Cancel)return e;throw e}else if(e===h.MultiStepAction.Back)return h.MultiStepAction.Back;return h.MultiStepAction.Continue}),void 0);let E;n.next=_;const w=new h.MultiStepNode(_,(async e=>{if(t)if(S===y.ExistingVenvAction.Recreate||S===y.ExistingVenvAction.Create)try{E=await this.interpreterQuickPick.getInterpreterViaQuickPick(t.uri,(e=>[p.EnvironmentType.System,p.EnvironmentType.MicrosoftStore,p.EnvironmentType.Global,p.EnvironmentType.Pyenv].includes(e.envType)&&void 0===e.type),{skipRecommended:!0,showBackButton:!0,placeholder:l.CreateEnv.Venv.selectPythonPlaceHolder,title:null})}catch(e){if(e===b.InputFlowAction.back)return h.MultiStepAction.Back;E=void 0}else if(S===y.ExistingVenvAction.UseExisting){if(e===h.MultiStepAction.Back)return h.MultiStepAction.Back;E=(0,v.getVenvExecutable)(t)}return E?((0,u.traceInfo)(`Selected interpreter ${E} for creating virtual environment.`),h.MultiStepAction.Continue):((0,u.traceError)("Virtual env creation requires an interpreter."),h.MultiStepAction.Cancel)}),void 0);_.next=w;let T,C=!0,P=!0;e&&(C=void 0===(null==e?void 0:e.ignoreSourceControl)||e.ignoreSourceControl,P=void 0===(null==e?void 0:e.installPackages)||e.installPackages);const x=new h.MultiStepNode(w,(async e=>{if(t&&P)if(S!==y.ExistingVenvAction.UseExisting){try{T=await(0,y.pickPackagesToInstall)(t)}catch(e){if(e===h.MultiStepAction.Back||e===h.MultiStepAction.Cancel)return e;throw e}if(!T)return(0,u.traceVerbose)("Virtual env creation exited during dependencies selection."),h.MultiStepAction.Cancel}else if(e===h.MultiStepAction.Back)return h.MultiStepAction.Back;return h.MultiStepAction.Continue}),void 0);w.next=x;const I=await h.MultiStepNode.run(n);if(I===h.MultiStepAction.Back||I===h.MultiStepAction.Cancel)throw I;if(t)if(S===y.ExistingVenvAction.Recreate){if((0,f.sendTelemetryEvent)(g.EventName.ENVIRONMENT_DELETE,void 0,{environmentType:"venv",status:"triggered"}),!await(0,y.deleteEnvironment)(t,E))throw(0,f.sendTelemetryEvent)(g.EventName.ENVIRONMENT_DELETE,void 0,{environmentType:"venv",status:"failed"}),h.MultiStepAction.Cancel;(0,f.sendTelemetryEvent)(g.EventName.ENVIRONMENT_DELETE,void 0,{environmentType:"venv",status:"deleted"})}else if(S===y.ExistingVenvAction.UseExisting)return(0,f.sendTelemetryEvent)(g.EventName.ENVIRONMENT_REUSE,void 0,{environmentType:"venv"}),{path:(0,v.getVenvExecutable)(t),workspaceFolder:t};const R=function(e,t){var n;const r=[(0,s.createVenvScript)()];let i;if(t&&r.push("--git-ignore"),e){if(e.some((e=>"toml"===e.installType))){const t=null===(n=e.find((e=>"toml"===e.installType)))||void 0===n?void 0:n.source;r.push("--toml",(null==t?void 0:t.fileToCommandArgumentForPythonExt())||"pyproject.toml")}e.filter((e=>"toml"===e.installType)).map((e=>e.installItem)).forEach((e=>{e&&r.push("--extras",e)}));const t=e.filter((e=>"requirements"===e.installType)).map((e=>e.installItem));t.length<10?t.forEach((e=>{e&&r.push("--requirements",e)})):(r.push("--stdin"),i=JSON.stringify({requirements:t}))}return{argv:r,stdin:i}}(T,C);return(0,h.withProgress)({location:i.ProgressLocation.Notification,title:`${l.CreateEnv.statusTitle} ([${l.Common.showLogs}](command:${o.Commands.ViewOutput}))`,cancellable:!0},(async(e,n)=>{let i;e.report({message:l.CreateEnv.statusStarting});try{if(E&&t){if(i=await async function(e,t,n,i,o){i.report({message:l.CreateEnv.Venv.creating}),(0,f.sendTelemetryEvent)(g.EventName.ENVIRONMENT_CREATING,void 0,{environmentType:"venv",pythonVersion:void 0});const s=(0,c.createDeferred)();(0,u.traceLog)("Running Env creation script: ",[t,...n.argv]),n.stdin&&(0,u.traceLog)("Requirements passed in via stdin: ",n.stdin);const{proc:d,out:p,dispose:h}=(0,a.execObservable)(t,n.argv,{mergeStdOutErr:!0,token:o,cwd:e.uri.fsPath,stdinStr:n.stdin}),v=new m.VenvProgressAndTelemetry(i);let y;return p.subscribe((e=>{const t=e.out.split(/\r?\n/g).join(r.EOL);(0,u.traceLog)(t.trimEnd()),(t.includes(m.VENV_CREATED_MARKER)||t.includes(m.VENV_EXISTING_MARKER))&&(y=function(e){try{const t=e.split(/\r?\n/g).map((e=>e.trim())).filter((e=>e.startsWith(m.VENV_CREATED_MARKER)||e.startsWith(m.VENV_EXISTING_MARKER)))[0];return t.includes(m.VENV_CREATED_MARKER)?t.substring(m.VENV_CREATED_MARKER.length):t.substring(m.VENV_EXISTING_MARKER.length)}catch(e){return void(0,u.traceError)("Parsing out environment path failed.")}}(t)),v.process(t)}),(e=>{(0,u.traceError)("Error while running venv creation script: ",e),s.reject(e)}),(()=>{h(),0!==(null==d?void 0:d.exitCode)?((0,u.traceError)("Error while running venv creation script: ",v.getLastError()),s.reject(v.getLastError()||`Failed to create virtual environment with exitCode: ${null==d?void 0:d.exitCode}`)):s.resolve(y)})),s.promise}(t,E,R,e,n),i)return{path:i,workspaceFolder:t};throw new Error("Failed to create virtual environment. See Output > Python for more info.")}throw new Error("Failed to create virtual environment. Either interpreter or workspace is undefined.")}catch(e){return(0,u.traceError)(e),(0,v.showErrorMessageWithLogs)(l.CreateEnv.Venv.errorCreatingEnvironment),{error:e}}}))}}},12790:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteEnvironmentWindows=t.deleteEnvironmentNonWindows=void 0;const r=n(55674),i=n(71017),o=n(19735),s=n(83606),a=n(67098),c=n(59314),l=n(41152);async function u(e){try{return!await r.pathExists(e)||(await r.rmdir(e,{recursive:!0,maxRetries:10,retryDelay:200}),!0)}catch(t){return(0,o.traceError)(`Failed to delete directory [${e}]:`,t),!1}}t.deleteEnvironmentNonWindows=async function(e){const t=(0,s.getVenvPath)(e);return await u(t)?((0,o.traceInfo)(`Deleted venv dir: ${t}`),!0):((0,s.showErrorMessageWithLogs)(a.CreateEnv.Venv.errorDeletingEnvironment),!1)},t.deleteEnvironmentWindows=async function(e,t){const n=(0,s.getVenvPath)(e),d=i.join(n,"Scripts","python.exe");if(await async function(e){try{return!await r.pathExists(e)||(await r.unlink(e),!0)}catch(t){return(0,o.traceError)(`Failed to delete file [${e}]:`,t),!1}}(d))return(0,o.traceInfo)(`Deleted python executable: ${d}`),await u(n)?((0,o.traceInfo)(`Deleted ".venv" dir: ${n}`),!0):((0,o.traceError)(`Failed to delete ".venv" dir: ${n}`),(0,o.traceError)("This happens if the virtual environment is still in use, or some binary in the venv is still running."),(0,o.traceError)(`Please delete the ".venv" manually: [${n}]`),(0,s.showErrorMessageWithLogs)(a.CreateEnv.Venv.errorDeletingEnvironment),!1);if((0,o.traceError)(`Failed to delete python executable: ${d}`),(0,o.traceError)("This happens if the virtual environment is still in use."),t){(0,o.traceError)('We will attempt to switch python temporarily to delete the ".venv"'),await(0,l.switchSelectedPython)(t,e.uri,'temporarily to delete the ".venv"'),(0,o.traceInfo)(`Attempting to delete ".venv" again: ${n}`);const r=500;for(let e=0;e<5;e+=1){if((0,o.traceInfo)(`Waiting for ${r}ms to let processes exit, before a delete attempt.`),await(0,c.sleep)(r),await u(n))return(0,o.traceInfo)(`Deleted ".venv" dir: ${n}`),!0;(0,o.traceError)(`Failed to delete ".venv" dir [${n}] (attempt ${e+1}/5).`)}}else(0,o.traceError)(`Please delete the ".venv" dir manually: [${n}]`);return(0,s.showErrorMessageWithLogs)(a.CreateEnv.Venv.errorDeletingEnvironment),!1}},78970:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VenvProgressAndTelemetry=t.VENV_EXISTING_MARKER=t.VENV_CREATED_MARKER=void 0;const r=n(67098),i=n(54813),o=n(61522);t.VENV_CREATED_MARKER="CREATED_VENV:",t.VENV_EXISTING_MARKER="EXISTING_VENV:";const s="CREATE_VENV.PIP_NOT_FOUND",a="CREATE_VENV.VENV_NOT_FOUND",c="CREATE_VENV.PIP_FAILED_INSTALL_REQUIREMENTS",l="CREATE_VENV.PIP_FAILED_INSTALL_PYPROJECT",u="CREATE_VENV.VENV_FAILED_CREATION",d="CREATE_VENV.UPGRADE_PIP_FAILED",p="CREATE_VENV.MICROVENV_FAILED_CREATION",h="CREATE_MICROVENV.MICROVENV_FAILED_CREATION",f="CREATE_VENV.INSTALL_PIP_FAILED",g="CREATE_VENV.DOWNLOAD_PIP_FAILED";t.VenvProgressAndTelemetry=class{constructor(e){this.progress=e,this.processed=new Set,this.reportActions=new Map([[t.VENV_CREATED_MARKER,e=>{e.report({message:r.CreateEnv.Venv.created}),(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_CREATED,void 0,{environmentType:"venv",reason:"created"})}],[t.VENV_EXISTING_MARKER,e=>{e.report({message:r.CreateEnv.Venv.existing}),(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_CREATED,void 0,{environmentType:"venv",reason:"existing"})}],["VENV_INSTALLING_REQUIREMENTS:",e=>{e.report({message:r.CreateEnv.Venv.installingPackages}),(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLING_PACKAGES,void 0,{environmentType:"venv",using:"requirements.txt"})}],["VENV_INSTALLING_PYPROJECT:",e=>{e.report({message:r.CreateEnv.Venv.installingPackages}),(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLING_PACKAGES,void 0,{environmentType:"venv",using:"pyproject.toml"})}],[s,e=>((0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_FAILED,void 0,{environmentType:"venv",reason:"noPip"}),s)],["CREATE_VENV.DISTUTILS_NOT_INSTALLED",e=>((0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_FAILED,void 0,{environmentType:"venv",reason:"noDistUtils"}),a)],[a,e=>((0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_FAILED,void 0,{environmentType:"venv",reason:"noVenv"}),a)],[c,e=>((0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLING_PACKAGES_FAILED,void 0,{environmentType:"venv",using:"requirements.txt"}),c)],[l,e=>((0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLING_PACKAGES_FAILED,void 0,{environmentType:"venv",using:"pyproject.toml"}),l)],[u,e=>((0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_FAILED,void 0,{environmentType:"venv",reason:"other"}),u)],["CREATE_VENV.VENV_ALREADY_EXISTS",e=>{(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_CREATED,void 0,{environmentType:"venv",reason:"existing"})}],["CREATE_VENV.PIP_INSTALLED_REQUIREMENTS",e=>{(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLED_PACKAGES,void 0,{environmentType:"venv",using:"requirements.txt"})}],["CREATE_VENV.PIP_INSTALLED_PYPROJECT",e=>{(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLED_PACKAGES,void 0,{environmentType:"venv",using:"pyproject.toml"})}],["CREATE_VENV.UPGRADED_PIP",e=>{(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLED_PACKAGES,void 0,{environmentType:"venv",using:"pipUpgrade"})}],[d,e=>((0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLING_PACKAGES_FAILED,void 0,{environmentType:"venv",using:"pipUpgrade"}),d)],["CREATE_VENV.DOWNLOADING_PIP",e=>{e.report({message:r.CreateEnv.Venv.downloadingPip}),(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLING_PACKAGES,void 0,{environmentType:"venv",using:"pipDownload"})}],[g,e=>((0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLING_PACKAGES_FAILED,void 0,{environmentType:"venv",using:"pipDownload"}),g)],["CREATE_VENV.INSTALLING_PIP",e=>{e.report({message:r.CreateEnv.Venv.installingPip}),(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLING_PACKAGES,void 0,{environmentType:"venv",using:"pipInstall"})}],[f,e=>((0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLING_PACKAGES_FAILED,void 0,{environmentType:"venv",using:"pipInstall"}),f)],["CREATE_MICROVENV.CREATING_MICROVENV",e=>{e.report({message:r.CreateEnv.Venv.creatingMicrovenv}),(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_CREATING,void 0,{environmentType:"microvenv",pythonVersion:void 0})}],[p,e=>((0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_FAILED,void 0,{environmentType:"microvenv",reason:"other"}),p)],[h,e=>((0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_FAILED,void 0,{environmentType:"microvenv",reason:"other"}),h)],["CREATE_MICROVENV.CREATED_MICROVENV",e=>{(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_CREATED,void 0,{environmentType:"microvenv",reason:"created"})}],["CREATE_VENV.UPGRADING_PIP",e=>{e.report({message:r.CreateEnv.Venv.upgradingPip}),(0,i.sendTelemetryEvent)(o.EventName.ENVIRONMENT_INSTALLING_PACKAGES,void 0,{environmentType:"venv",using:"pipUpgrade"})}]]),this.lastError=void 0}getLastError(){return this.lastError}process(e){const t=Array.from(this.reportActions.keys());for(const n of t)if(e.includes(n)&&!this.processed.has(n)){const e=this.reportActions.get(n);if(e){const t=e(this.progress);t&&(this.lastError=t)}this.processed.add(n)}}}},41152:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchSelectedPython=void 0;const r=n(71017),i=n(59314),o=n(50189),s=n(5899),a=n(19735);t.switchSelectedPython=async function(e,t,n){var c;let l;try{const u=(0,i.createDeferred)(),d=null===(c=(0,o.getExtension)(s.PVSC_EXTENSION_ID))||void 0===c?void 0:c.exports;l=d.environments.onDidChangeActiveEnvironmentPath((async t=>{r.normalize(t.path)===r.normalize(e)&&((0,a.traceInfo)(`Switched to interpreter ${n}: ${e}`),u.resolve())})),d.environments.updateActiveEnvironmentPath(e,t),(0,a.traceInfo)(`Switching interpreter ${n}: ${e}`),await u.promise}finally{null==l||l.dispose()}}},12771:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickExistingVenvAction=t.ExistingVenvAction=t.deleteEnvironment=t.pickPackagesToInstall=t.isPipInstallableToml=t.getPipRequirementsFiles=t.OPEN_REQUIREMENTS_BUTTON=void 0;const r=n(5022),i=n(55674),o=n(96486),s=n(71017),a=n(66828),c=n(67098),l=n(56693),u=n(85261),d=n(19735),p=n(77570),h=n(65243),f=n(83606),g=n(12790);t.OPEN_REQUIREMENTS_BUTTON={iconPath:new a.ThemeIcon("go-to-file"),tooltip:c.CreateEnv.Venv.openRequirementsFile};const m="**/{.venv*,.git,.nox,.tox,.conda,site-packages,__pypackages__}/**";async function v(e,t){return(0,o.flatten)(await Promise.all([(0,u.findFiles)(new a.RelativePattern(e,"**/*requirement*.txt"),m,void 0,t),(0,u.findFiles)(new a.RelativePattern(e,"**/requirements/*.txt"),m,void 0,t)])).map((e=>e.fsPath))}function y(e){try{return r.parse(e)}catch(e){(0,d.traceError)("Failed to parse `pyproject.toml`:",e)}return{}}function b(e){return void 0!==e["build-system"]}function S(e){return void 0!==e.project}var _;t.getPipRequirementsFiles=v,t.isPipInstallableToml=function(e){const t=y(e);return b(t)&&S(t)},t.pickPackagesToInstall=async function(e,n){const r=s.join(e.uri.fsPath,"pyproject.toml"),u=[],p=new l.MultiStepNode(void 0,(async e=>{(0,d.traceVerbose)(`Looking for toml pyproject.toml with optional dependencies at: ${r}`);let t=[],s=!1,a=!1;if(await i.pathExists(r)){const e=y(await i.readFile(r,"utf-8"));t=function(e){const t=[];if(e.project&&e.project["optional-dependencies"]){const n=e.project["optional-dependencies"];for(const e of Object.keys(n))t.push(e)}return t}(e),s=b(e),a=S(e),a||(0,d.traceVerbose)("Create env: Found toml without project. So we will not use editable install."),s||(0,d.traceVerbose)("Create env: Found toml without build system. So we will not use editable install."),0===t.length&&(0,d.traceVerbose)("Create env: Found toml without optional dependencies.")}else if(e===l.MultiStepAction.Back)return l.MultiStepAction.Back;if(s&&a)if(t.length>0){(0,d.traceVerbose)("Create Env: Found toml with optional dependencies.");try{const e=await async function(e,t){const n=e.map((e=>({label:e}))),r=await(0,l.showQuickPickWithBack)(n,{placeHolder:c.CreateEnv.Venv.tomlExtrasQuickPickTitle,canPickMany:!0,ignoreFocusOut:!0},t);if(r&&(0,o.isArray)(r))return r.map((e=>e.label))}(t,n);if(!e)return l.MultiStepAction.Cancel;e.length>0&&e.forEach((e=>{u.push({installType:"toml",installItem:e,source:r})})),u.push({installType:"toml",source:r})}catch(e){if(e===l.MultiStepAction.Back||e===l.MultiStepAction.Cancel)return e;throw e}}else{if(e===l.MultiStepAction.Back)return l.MultiStepAction.Back;u.push({installType:"toml",source:r})}else if(e===l.MultiStepAction.Back)return l.MultiStepAction.Back;return l.MultiStepAction.Continue}),void 0),h=new l.MultiStepNode(p,(async r=>{(0,d.traceVerbose)("Looking for pip requirements.");const i=await v(e,n);if(i&&i.length>0){(0,d.traceVerbose)("Found pip requirements.");try{const r=await async function(e,n,r){const i=e.map((e=>s.relative(n,e))).sort(((e,t)=>{const n=e.split(/[\\\/]/).length,r=t.split(/[\\\/]/).length;return n===r?e.length===t.length?e.localeCompare(t):e.length-t.length:n-r})).map((e=>({label:e,buttons:[t.OPEN_REQUIREMENTS_BUTTON]}))),u=await(0,l.showQuickPickWithBack)(i,{placeHolder:c.CreateEnv.Venv.requirementsQuickPickTitle,ignoreFocusOut:!0,canPickMany:!0},r,(async e=>{e.item.label&&await(0,l.showTextDocument)(a.Uri.file(s.join(n,e.item.label)))}));if(u&&(0,o.isArray)(u))return u.map((e=>e.label))}(i,e.uri.fsPath,n),d=null==r?void 0:r.map((t=>s.join(e.uri.fsPath,t)));if(!d)return l.MultiStepAction.Cancel;d.forEach((e=>{u.push({installType:"requirements",installItem:e})}))}catch(e){if(e===l.MultiStepAction.Back||e===l.MultiStepAction.Cancel)return e;throw e}}else if(r===l.MultiStepAction.Back)return l.MultiStepAction.Back;return l.MultiStepAction.Continue}),void 0);p.next=h;const f=await l.MultiStepNode.run(p);if(f===l.MultiStepAction.Back||f===l.MultiStepAction.Cancel)throw f;return u},t.deleteEnvironment=async function(e,t){const n=(0,f.getVenvPath)(e);return(0,l.withProgress)({location:a.ProgressLocation.Notification,title:`${c.CreateEnv.Venv.deletingEnvironmentProgress} ([${c.Common.showLogs}](command:${p.Commands.ViewOutput})): ${n}`,cancellable:!1},(async()=>(0,h.isWindows)()?(0,g.deleteEnvironmentWindows)(e,t):(0,g.deleteEnvironmentNonWindows)(e)))},function(e){e[e.Recreate=0]="Recreate",e[e.UseExisting=1]="UseExisting",e[e.Create=2]="Create"}(_=t.ExistingVenvAction||(t.ExistingVenvAction={})),t.pickExistingVenvAction=async function(e){if(e){if(!await(0,f.hasVenv)(e))return _.Create;{const e=[{label:c.CreateEnv.Venv.useExisting,description:c.CreateEnv.Venv.useExistingDescription},{label:c.CreateEnv.Venv.recreate,description:c.CreateEnv.Venv.recreateDescription}],t=await(0,l.showQuickPickWithBack)(e,{placeHolder:c.CreateEnv.Venv.existingVenvQuickPickPlaceholder,ignoreFocusOut:!0},void 0);if((null==t?void 0:t.label)===c.CreateEnv.Venv.recreate)return _.Recreate;if((null==t?void 0:t.label)===c.CreateEnv.Venv.useExisting)return _.UseExisting}}throw l.MultiStepAction.Cancel}},21190:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerPyProjectTomlFeatures=void 0;const r=n(98638),i=n(85261),o=n(12771);async function s(e){(0,o.isPipInstallableToml)(e.getText())?await(0,r.executeCommand)("setContext","pipInstallableToml",!0):await(0,r.executeCommand)("setContext","pipInstallableToml",!1)}t.registerPyProjectTomlFeatures=function(e){e.push((0,i.onDidOpenTextDocument)((async e=>{e.fileName.endsWith("pyproject.toml")&&await s(e)})),(0,i.onDidSaveTextDocument)((async e=>{e.fileName.endsWith("pyproject.toml")&&await s(e)}))),(0,i.getOpenTextDocuments)().filter((e=>e.fileName.endsWith("pyproject.toml")&&(0,o.isPipInstallableToml)(e.getText()))).length>0?(0,r.executeCommand)("setContext","pipInstallableToml",!0):(0,r.executeCommand)("setContext","pipInstallableToml",!1)}},63369:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerAllCreateEnvironmentFeatures=void 0;const r=n(85949),i=n(61267),o=n(44049),s=n(50939),a=n(21190);t.registerAllCreateEnvironmentFeatures=function(e,t,n,c,l){(0,r.registerCreateEnvironmentFeatures)(e,t,n,l),(0,i.registerCreateEnvironmentButtonFeatures)(e),(0,a.registerPyProjectTomlFeatures)(e),(0,s.registerInstalledPackagesDiagnosticsProvider)(e,c),(0,o.registerTriggerForPipInTerminal)(e)}},24708:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.copyPythonExecInfo=t.buildPythonExecInfo=void 0,t.buildPythonExecInfo=function(e,t,n){if(Array.isArray(e)){const r=e.slice(1);return t&&r.push(...t),{args:r,command:e[0],python:[...e],pythonExecutable:null!=n?n:e[e.length-1]}}return{command:e,args:t||[],python:[e],pythonExecutable:e}},t.copyPythonExecInfo=function(e,t){const n={command:e.command,args:[...e.args],python:[...e.python],pythonExecutable:e.pythonExecutable};return t&&n.args.push(...t),void 0===n.pythonExecutable&&(n.pythonExecutable=n.python[n.python.length-1]),n}},29817:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activate=t.initialize=void 0;const r=n(66828),i=n(66828),o=n(96486),s=n(73766),a=n(87450),c=n(30752),l=n(27736),u=n(44644),d=n(3143),p=n(37769),h=n(14424),f=n(82399),g=n(74437),m=n(93235),v=n(43160),y=n(41770),b=n(5613),S=n(39046),_=n(67931),E=n(22544),w=n(68624),T=n(1092),C=n(11069),P=n(97954),x=n(17021),I=n(19735),R=n(96255),D=n(39805),O=n(80981),k=n(85261),A="PYTHON_ENV_INFO_CACHEv2";function N(){return"native"===(0,k.getConfiguration)("python").get("locator","js")}function M(e){const{initRoot:t,addRoot:n,removeRoot:i}=e,o=r.workspace.workspaceFolders;return o&&o.map((e=>e.uri)).forEach(t),r.workspace.onDidChangeWorkspaceFolders((e=>{for(const t of e.removed)i(t.uri);for(const t of e.added)n(t.uri)}))}t.initialize=async function(e){(0,p.initializeExternalDependencies)(e.legacyIOC.serviceContainer);const t=await(0,C.createPythonEnvironments)((()=>async function(e){const t=new h.ExtensionLocators(function(e){const t=[];N()?t.push(new O.NativeLocator):(t.push(new y.PyenvLocator,new g.CondaEnvironmentLocator,new R.ActiveStateLocator,new m.GlobalVirtualEnvironmentLocator,new f.CustomVirtualEnvironmentLocator),(0,a.getOSType)()===a.OSType.Windows?t.push(new b.WindowsRegistryLocator,new S.MicrosoftStoreLocator,new u.WindowsPathEnvVarLocator):t.push(new v.PosixKnownPathsLocator));const n=t.filter((e=>void 0!==e.dispose));return e.disposables.push(...n),t}(e),function(e){const t=new h.WorkspaceLocators(M,[e=>[new d.WorkspaceVirtualEnvironmentLocator(e.fsPath),new w.PoetryLocator(e.fsPath),new T.HatchLocator(e.fsPath),new D.CustomWorkspaceLocator(e.fsPath)]]);return e.disposables.push(t),t}(e)),n=(0,_.getEnvironmentInfoService)(e.disposables),r=new c.PythonEnvsReducer(t),p=new l.PythonEnvsResolver(r,n);return new x.EnvsCollectionService(await async function(e){const t=(0,s.getGlobalStorage)(e.context,A,[]);return await(0,P.createCollectionCache)({get:()=>function(e){return e.get().map((e=>(e.searchLocation&&("string"==typeof e.searchLocation?e.searchLocation=i.Uri.parse(e.searchLocation):"scheme"in e.searchLocation&&"path"in e.searchLocation?e.searchLocation=i.Uri.parse(`${e.searchLocation.scheme}://${e.searchLocation.path}`):(0,I.traceError)("Unexpected search location",JSON.stringify(e.searchLocation))),e)))}(t),store:async e=>function(e,t){return e.set((0,o.cloneDeep)(t).map((e=>(e.searchLocation&&(e.searchLocation=e.searchLocation.toString()),e)))),Promise.resolve()}(t,e)})}(e),p,N())}(e)));return(0,E.registerNewDiscoveryForIOC)(e.legacyIOC.serviceManager,t),t},t.activate=async function(e,t){const n=r.workspace.workspaceFolders;return(0,s.getGlobalStorage)(t.context,A,[]).get().length>0?null==n||n.forEach((async n=>{const r=(0,s.getGlobalStorage)(t.context,`PYTHON_WAS_DISCOVERY_TRIGGERED_${(0,p.normCasePath)(n.uri.fsPath)}`,!1);r.get()||(e.triggerRefresh({searchLocations:{roots:[n.uri],doNotIncludeNonRooted:!0}}).ignoreErrors(),await r.set(!0))})):(e.triggerRefresh().ignoreErrors(),null==n||n.forEach((async e=>{const n=(0,s.getGlobalStorage)(t.context,`PYTHON_WAS_DISCOVERY_TRIGGERED_${(0,p.normCasePath)(e.uri.fsPath)}`,!1);await n.set(!0)}))),{fullyReady:Promise.resolve()}}},93400:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExecutablePath=void 0;const r=n(31776),i=n(19735),o=n(24708);t.getExecutablePath=async function(e,t){try{const[n,i]=(0,r.getExecutable)(),s=(0,o.copyPythonExecInfo)(e,n),a=[s.command,...s.args].reduce(((e,t)=>e?`${e} ${t.toCommandArgumentForPythonExt()}`:`${t.toCommandArgumentForPythonExt()}`),""),c=i((await t(a,{timeout:15e3})).stdout.trim());if(""===c)throw new Error(`${a} resulted in empty stdout`);return c}catch(e){return void(0,i.traceError)(e)}}},81387:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvironmentTypeName=t.ModuleInstallerType=t.virtualEnvTypes=t.workspaceVirtualEnvTypes=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.MicrosoftStore="MicrosoftStore",e.Poetry="Poetry",e.Hatch="Hatch",e.VirtualEnvWrapper="VirtualEnvWrapper",e.ActiveState="ActiveState",e.Global="Global",e.System="System"}(n=t.EnvironmentType||(t.EnvironmentType={})),t.workspaceVirtualEnvTypes=[n.Poetry,n.Pipenv],t.virtualEnvTypes=[...t.workspaceVirtualEnvTypes,n.Hatch,n.Venv,n.VirtualEnvWrapper,n.Conda,n.VirtualEnv],(r=t.ModuleInstallerType||(t.ModuleInstallerType={})).Unknown="Unknown",r.Conda="Conda",r.Pip="Pip",r.Poetry="Poetry",r.Pipenv="Pipenv",t.getEnvironmentTypeName=function(e){switch(e){case n.Conda:return"conda";case n.Pipenv:return"Pipenv";case n.Pyenv:return"pyenv";case n.Venv:return"venv";case n.VirtualEnv:return"virtualenv";case n.MicrosoftStore:return"Microsoft Store";case n.Poetry:return"Poetry";case n.Hatch:return"Hatch";case n.VirtualEnvWrapper:return"virtualenvwrapper";case n.ActiveState:return"ActiveState";default:return""}}},69554:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterpreterInfo=void 0;const r=n(81249),i=n(4057),o=n(94146),s=n(87450),a=n(24708);t.getInterpreterInfo=async function(e,t,n){const[c,l]=(0,i.interpreterInfo)(),u=(0,a.copyPythonExecInfo)(e,c),d=[u.command,...u.args],p=d.reduce(((e,t)=>e?`${e} "${t}"`:`"${(0,o.replaceAll)(t,"\\","\\\\")}"`),""),h=await t(p,{timeout:15e3});h.stderr&&n&&n.error(`Failed to parse interpreter information for ${d} stderr: ${h.stderr}`);const f=l(h.stdout);if(n&&n.verbose(`Found interpreter for ${d}`),f)return function(e,t){let n=`${t.versionInfo.slice(0,3).join(".")}`;if(void 0!==t.versionInfo[3]&&["alpha","beta","candidate"].includes(t.versionInfo[3])&&(n=`${n}-${t.versionInfo[3]}`,void 0!==t.versionInfo[4])){let e=-1;try{e=parseInt(`${t.versionInfo[4]}`,10)}catch(t){e=-1}n=e>=0?`${n}${e}`:n}return{architecture:t.is64Bit?s.Architecture.x64:s.Architecture.x86,path:e,version:new r.SemVer(n),sysVersion:t.sysVersion,sysPrefix:t.sysPrefix}}(e.pythonExecutable,f)}},22544:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.registerNewDiscoveryForIOC=void 0;const i=n(86700),o=n(96486),s=n(66828),a=n(88409),c=n(18639),l=n(45878),u=n(35271),d=n(37769),p=n(81387),h=n(95084),f=n(59314),g=n(99910),m=n(75470),v=n(10423),y=n(1132),b=n(19735),S=new Map(Object.entries({[l.PythonEnvKind.OtherGlobal]:p.EnvironmentType.Global,[l.PythonEnvKind.System]:p.EnvironmentType.System,[l.PythonEnvKind.MicrosoftStore]:p.EnvironmentType.MicrosoftStore,[l.PythonEnvKind.Pyenv]:p.EnvironmentType.Pyenv,[l.PythonEnvKind.Conda]:p.EnvironmentType.Conda,[l.PythonEnvKind.VirtualEnv]:p.EnvironmentType.VirtualEnv,[l.PythonEnvKind.Pipenv]:p.EnvironmentType.Pipenv,[l.PythonEnvKind.Poetry]:p.EnvironmentType.Poetry,[l.PythonEnvKind.Hatch]:p.EnvironmentType.Hatch,[l.PythonEnvKind.Venv]:p.EnvironmentType.Venv,[l.PythonEnvKind.VirtualEnvWrapper]:p.EnvironmentType.VirtualEnvWrapper,[l.PythonEnvKind.ActiveState]:p.EnvironmentType.ActiveState}));function _(e){const{name:t,location:n,executable:r,arch:i,kind:o,version:s,distro:a,id:c}=e,{filename:l,sysPrefix:u}=r,d={id:c,sysPrefix:u,envType:p.EnvironmentType.Unknown,envName:t,envPath:n,path:l,architecture:i},f=S.get(o);if(void 0!==f&&(d.envType=f),void 0!==s){const{release:e,sysVersion:t}=s;d.sysVersion=void 0===e?"":t;const n=(0,h.toSemverLikeVersion)(s);d.version=n}return void 0!==a&&""!==a.org&&(d.companyDisplayName=a.org),d.displayName=e.display,d.detailedDisplayName=e.detailedDisplayName,d.type=e.type,d}let E=class{constructor(e){this.api=e,this.changed=new s.EventEmitter,this.api.onChanged((e=>{this.changed.fire({type:e.type,new:e.new?_(e.new):void 0,old:e.old?_(e.old):void 0,resource:e.searchLocation})}))}triggerRefresh(e,t){return this.api.triggerRefresh(e,t)}getRefreshPromise(e){return this.api.getRefreshPromise(e)}get onProgress(){return this.api.onProgress}get onChanged(){return this.changed.event}onDidCreate(e,t){const n=e?s.workspace.getWorkspaceFolder(e):void 0;return this.api.onChanged((e=>{n&&e.searchLocation&&((0,b.traceVerbose)(`Received event ${JSON.stringify(e)} file change event`),e.type===a.FileChangeType.Created&&(0,d.isParentPath)(e.searchLocation.fsPath,n.uri.fsPath)&&t())}))}async getInterpreterInformation(e){const t=await this.api.resolveEnv(e);return t?_(t):void 0}async isMacDefaultPythonPath(e){return(0,u.isMacDefaultPythonPath)(e)}async getInterpreterDetails(e){const t=await this.api.resolveEnv(e);if(t)return _(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 isMicrosoftStoreInterpreter(e){return(0,v.isMicrosoftStoreEnvironment)(e)}async hasInterpreters(e=(async()=>!0)){const t=(0,f.createDeferred)();return this.api.onChanged((async n=>{n.new&&await e(_(n.new))&&t.resolve()})),(await(0,g.asyncFilter)(this.api.getEnvs(),(t=>e(_(t))))).length>0||(await Promise.race([t.promise,this.api.getRefreshPromise()]),(await(0,g.asyncFilter)(this.api.getEnvs(),(t=>e(_(t))))).length>0)}getInterpreters(e,t){const n={};let r,i=[];void 0!==e&&(r=s.workspace.getWorkspaceFolder(e),r&&(i=[r.uri])),!r&&s.workspace.workspaceFolders&&s.workspace.workspaceFolders.length>0&&(!e||"untitled"===e.scheme)&&(i=s.workspace.workspaceFolders.map((e=>e.uri))),n.searchLocations={roots:i};let a=this.api.getEnvs(n);return t&&(a=a.filter((e=>(0,o.intersection)(t,e.source).length>0))),a.map(_)}async getWorkspaceVirtualEnvInterpreters(e,t){const n=s.workspace.getWorkspaceFolder(e);if(!n)return[];const r={searchLocations:{roots:[n.uri],doNotIncludeNonRooted:!0}};return(null==t?void 0:t.ignoreCache)&&await this.api.triggerRefresh(r),await this.api.getRefreshPromise(),this.api.getEnvs(r).map(_)}};E=r([(0,i.injectable)()],E),t.registerNewDiscoveryForIOC=function(e,t){e.addSingleton(c.ICondaService,y.CondaService),e.addSingletonInstance(c.IComponentAdapter,new E(t))}},40749:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPythonServer=void 0;const r=n(71017),i=n(32081),o=n(95028),s=n(66828),a=n(63281),c=n(19735),l=r.join(a.EXTENSION_ROOT_DIR,"python_files","python_server.py");let u;class d{constructor(e,t){this.connection=e,this.pythonServer=t,this.disposables=[],this.initialize(),this.input()}initialize(){this.disposables.push(this.connection.onNotification("log",(e=>{console.log("Log:",e)}))),this.connection.listen()}input(){this.connection.onRequest("input",(async e=>{let t="Enter your input here: ";return e&&e.prompt&&(t=e.prompt),{userInput:await s.window.showInputBox({title:"Input Request",prompt:t,ignoreFocusOut:!0})}}))}execute(e){return this.connection.sendRequest("execute",e)}interrupt(){this.pythonServer.kill("SIGINT")&&(0,c.traceLog)("Python REPL server interrupted")}async checkValidCommand(e){const t=await this.connection.sendRequest("check_valid_command",e);return new Promise("True"===t?e=>e(!0):e=>e(!1))}dispose(){this.connection.sendNotification("exit"),this.disposables.forEach((e=>e.dispose())),this.connection.dispose()}}t.createPythonServer=function(e){if(u)return u;const t=i.spawn(e[0],[...e.slice(1),l]);t.stderr.on("data",(e=>{(0,c.traceError)(e.toString())})),t.on("exit",(e=>{(0,c.traceError)(`Python server exited with code ${e}`)})),t.on("error",(e=>{(0,c.traceError)(e)}));const n=o.createMessageConnection(new o.StreamMessageReader(t.stdout),new o.StreamMessageWriter(t.stdin));return u=new d(n,t),u}},45346:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerReplExecuteOnEnter=t.registerReplCommands=void 0;const r=n(66828),i=n(77570),o=n(3481),s=n(50773),a=n(40749),c=n(71771),l=n(56693),u=n(85261);let d,p,h;r.workspace.onDidCloseNotebookDocument((e=>{h&&e.uri.toString()===h.uri.toString()&&(p=void 0,h=void 0)})),t.registerReplCommands=async function(e,t){e.push(r.commands.registerCommand(i.Commands.Exec_In_REPL,(async n=>{const a=function(){const e=(0,l.getActiveResource)();return(0,u.getConfiguration)("python",e).get("REPL.sendToNativeREPL",!1)}();if(!a)return void await r.commands.executeCommand(i.Commands.Exec_Selection_In_Terminal);const f=await t.getActiveInterpreter(n);if(f){if(f){const t=f.path;d||(d=(0,c.createReplController)(t,e));const n=r.window.activeTextEditor,o=await async function(e){if(!e)return;const{selection:t}=e;let n;return n=t.isEmpty?e.document.lineAt(t.start.line).text:t.isSingleLine?(0,s.getSingleLineSelectionText)(e):(0,s.getMultiLineSelectionText)(e),n}(n);if(!p){const e=await r.commands.executeCommand("interactive.open",{preserveFocus:!0,viewColumn:r.ViewColumn.Beside},void 0,d.id,"Python REPL");p=e.notebookEditor,h=e.notebookEditor.notebook}if(p&&h&&await r.window.showNotebookDocument(h,{viewColumn:r.ViewColumn.Beside}),h){d.updateNotebookAffinity(h,r.NotebookControllerAffinity.Default),await r.commands.executeCommand("notebook.selectKernel",{notebookEditor:p,id:d.id,extension:i.PVSC_EXTENSION_ID});const{cellCount:e}=h;await async function(e){const t=new r.NotebookCellData(r.NotebookCellKind.Code,e,"python"),{cellCount:n}=h,i=r.NotebookEdit.insertCells(n,[t]),o=new r.WorkspaceEdit;o.set(h.uri,[i]),await r.workspace.applyEdit(o)}(o),r.commands.executeCommand("notebook.cell.execute",{ranges:[{start:e,end:e+1}],document:h.uri})}}}else r.commands.executeCommand(i.Commands.TriggerEnvironmentSelection,n).then(o.noop,o.noop)})))},t.registerReplExecuteOnEnter=async function(e,t){e.push(r.commands.registerCommand(i.Commands.Exec_In_REPL_Enter,(async e=>{const n=await t.getActiveInterpreter(e);if(!n)return void r.commands.executeCommand(i.Commands.TriggerEnvironmentSelection,e).then(o.noop,o.noop);const s=(0,a.createPythonServer)([n.path]),c=r.window.activeTextEditor;let l,u=!1;if(c){const{document:e}=c;l=e.getText()}l&&(u=await s.checkValidCommand(l));const d=r.window.activeTextEditor;if(!u||(null!==(f=null===(h=null==(p=d)?void 0:p.document)||void 0===h?void 0:h.lineCount)&&void 0!==f?f:0)>1){if(d){const e=d.selection.active,t=e.with(e.line,d.document.lineAt(e.line).text.length);d.selection=new r.Selection(t,t),d.edit((e=>{e.insert(t,"\n")}))}d&&""===d.document.lineAt(d.selection.active.line).text&&await r.commands.executeCommand("interactive.execute")}else await r.commands.executeCommand("interactive.execute");var p,h,f})))}},71771:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createReplController=void 0;const r=n(66828),i=n(40749);t.createReplController=function(e,t){const n=(0,i.createPythonServer)([e]);t.push(n);const o=r.notebooks.createNotebookController("pythonREPL","interactive","Python REPL");return o.supportedLanguages=["python"],o.supportsExecutionOrder=!0,o.description="Python REPL",o.interruptHandler=async()=>{n.interrupt()},o.executeHandler=async e=>{for(const t of e){const e=o.createNotebookCellExecution(t);e.start(Date.now());try{const i=await n.execute(t.document.getText());e.replaceOutput([new r.NotebookCellOutput([r.NotebookCellOutputItem.text(i,"text/plain")])]),e.end(!0)}catch(t){const n=t;e.replaceOutput([new r.NotebookCellOutput([r.NotebookCellOutputItem.error({name:n.name,message:n.message,stack:n.stack})])]),e.end(!1)}}},t.push(o),o}},69284:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialize=t.SourceMapSupport=void 0;const r=n(71017);n(32727);const i=n(90209),o=n(63281),s=n(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),n(75913).install();const e=n(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=r.join(o.EXTENSION_ROOT_DIR,"out","client","extension.js"),n=r.join(o.EXTENSION_ROOT_DIR,"out","client","debugger","debugAdapter","main.js");await Promise.all([this.enableSourceMap(e,t),this.enableSourceMap(e,n)])}async enableSourceMap(e,t){const n=`${t}.map`,r=`${t}.map.disabled`;e?await this.rename(r,n):await this.rename(n,r)}async rename(e,t){const n=new i.FileSystem;await n.fileExists(t)||await n.move(e,t)}}t.SourceMapSupport=c,t.initialize=function(e=n(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,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasUserDefinedPythonPath=t.sendErrorTelemetry=t.sendStartupTelemetry=void 0;const r=n(66828),i=n(17585),o=n(77570),s=n(58400),a=n(61684),c=n(87282),l=n(18639),u=n(19735),d=n(81387),p=n(54813),h=n(61522);function f(e,t){let n=t.get(a.IInterpreterPathService).inspect(e);return!!(n.workspaceFolderValue&&"python"!==n.workspaceFolderValue||n.workspaceValue&&"python"!==n.workspaceValue||n.globalValue&&"python"!==n.globalValue)}async function g(e,t){var n,o;const a=r.env.appName,p=e.get(i.IWorkspaceService),h=(null===(n=p.workspaceFolders)||void 0===n?void 0:n.length)||0,g=e.get(s.ITerminalHelper).identifyTerminalShell();if(!p.isTrusted)return{workspaceFolderCount:h,terminal:g,isFirstSession:t};const m=e.get(l.IInterpreterService),v=(null===(o=p.workspaceFolders)||void 0===o?void 0:o.length)?p.workspaceFolders[0].uri:void 0,y=await m.hasInterpreters((async e=>{var t;return 3===(null===(t=e.version)||void 0===t?void 0:t.major)}));await m.refreshPromise;const b=await m.getActiveInterpreter().catch((()=>{})),S=b&&b.version?b.version.raw:void 0,_=b?b.envType:void 0;let E;if(_===d.EnvironmentType.Unknown&&(0,u.traceError)("Active interpreter type is detected as Unknown",JSON.stringify(b)),_===d.EnvironmentType.Conda){const t=e.get(l.ICondaService);E=await t.getCondaVersion().then((e=>e?e.raw:"")).catch((()=>""))}const w=f(v,e),T=!!b&&function(e,t){const n=t.get(c.IInterpreterAutoSelectionService).getAutoSelectedInterpreter(void 0);return!!n&&e===n.path}(b.path,e);return{condaVersion:E,terminal:g,pythonVersion:S,interpreterType:_,workspaceFolderCount:h,hasPythonThree:y,usingUserDefinedInterpreter:w,usingGlobalInterpreter:T,appName:a,isFirstSession:t}}t.sendStartupTelemetry=async function(e,t,n,r,i){if(!(0,o.isTestExecution)())try{await e,t.totalNonBlockingActivateTime=n.elapsedTime-t.startActivateTime;const o=await g(r,i);(0,p.sendTelemetryEvent)(h.EventName.EDITOR_LOAD,t,o)}catch(e){(0,u.traceError)("sendStartupTelemetry() failed.",e)}},t.sendErrorTelemetry=async function(e,t,n){try{let r={};if(n)try{r=await g(n)}catch(e){(0,u.traceError)("getActivationTelemetryProps() failed.",e)}(0,p.sendTelemetryEvent)(h.EventName.EDITOR_LOAD,t,r,e)}catch(e){(0,u.traceError)("sendErrorTelemetry() failed.",e)}},t.hasUserDefinedPythonPath=f},61522:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.PlatformErrors=t.EventName=void 0,(r=t.EventName||(t.EventName={})).FORMAT_ON_TYPE="FORMAT.FORMAT_ON_TYPE",r.EDITOR_LOAD="EDITOR.LOAD",r.REPL="REPL",r.CREATE_NEW_FILE_COMMAND="CREATE_NEW_FILE_COMMAND",r.SELECT_INTERPRETER="SELECT_INTERPRETER",r.SELECT_INTERPRETER_ENTER_BUTTON="SELECT_INTERPRETER_ENTER_BUTTON",r.SELECT_INTERPRETER_ENTER_CHOICE="SELECT_INTERPRETER_ENTER_CHOICE",r.SELECT_INTERPRETER_SELECTED="SELECT_INTERPRETER_SELECTED",r.SELECT_INTERPRETER_ENTER_OR_FIND="SELECT_INTERPRETER_ENTER_OR_FIND",r.SELECT_INTERPRETER_ENTERED_EXISTS="SELECT_INTERPRETER_ENTERED_EXISTS",r.PYTHON_INTERPRETER="PYTHON_INTERPRETER",r.PYTHON_INSTALL_PACKAGE="PYTHON_INSTALL_PACKAGE",r.ENVIRONMENT_WITHOUT_PYTHON_SELECTED="ENVIRONMENT_WITHOUT_PYTHON_SELECTED",r.PYTHON_ENVIRONMENTS_API="PYTHON_ENVIRONMENTS_API",r.PYTHON_INTERPRETER_DISCOVERY="PYTHON_INTERPRETER_DISCOVERY",r.PYTHON_INTERPRETER_DISCOVERY_NATIVE="PYTHON_INTERPRETER_DISCOVERY_NATIVE",r.PYTHON_INTERPRETER_AUTO_SELECTION="PYTHON_INTERPRETER_AUTO_SELECTION",r.PYTHON_INTERPRETER_ACTIVATION_ENVIRONMENT_VARIABLES="PYTHON_INTERPRETER.ACTIVATION_ENVIRONMENT_VARIABLES",r.PYTHON_INTERPRETER_ACTIVATION_FOR_RUNNING_CODE="PYTHON_INTERPRETER_ACTIVATION_FOR_RUNNING_CODE",r.PYTHON_INTERPRETER_ACTIVATION_FOR_TERMINAL="PYTHON_INTERPRETER_ACTIVATION_FOR_TERMINAL",r.TERMINAL_SHELL_IDENTIFICATION="TERMINAL_SHELL_IDENTIFICATION",r.PYTHON_INTERPRETER_ACTIVATE_ENVIRONMENT_PROMPT="PYTHON_INTERPRETER_ACTIVATE_ENVIRONMENT_PROMPT",r.PYTHON_NOT_INSTALLED_PROMPT="PYTHON_NOT_INSTALLED_PROMPT",r.CONDA_INHERIT_ENV_PROMPT="CONDA_INHERIT_ENV_PROMPT",r.TERMINAL_DEACTIVATE_PROMPT="TERMINAL_DEACTIVATE_PROMPT",r.REQUIRE_JUPYTER_PROMPT="REQUIRE_JUPYTER_PROMPT",r.ACTIVATED_CONDA_ENV_LAUNCH="ACTIVATED_CONDA_ENV_LAUNCH",r.ENVFILE_VARIABLE_SUBSTITUTION="ENVFILE_VARIABLE_SUBSTITUTION",r.ENVFILE_WORKSPACE="ENVFILE_WORKSPACE",r.EXECUTION_CODE="EXECUTION_CODE",r.EXECUTION_DJANGO="EXECUTION_DJANGO",r.DEBUG_IN_TERMINAL_BUTTON="DEBUG.IN_TERMINAL",r.DEBUG_ADAPTER_USING_WHEELS_PATH="DEBUG_ADAPTER.USING_WHEELS_PATH",r.DEBUG_SESSION_ERROR="DEBUG_SESSION.ERROR",r.DEBUG_SESSION_START="DEBUG_SESSION.START",r.DEBUG_SESSION_STOP="DEBUG_SESSION.STOP",r.DEBUG_SESSION_USER_CODE_RUNNING="DEBUG_SESSION.USER_CODE_RUNNING",r.DEBUGGER="DEBUGGER",r.DEBUGGER_ATTACH_TO_CHILD_PROCESS="DEBUGGER.ATTACH_TO_CHILD_PROCESS",r.DEBUGGER_ATTACH_TO_LOCAL_PROCESS="DEBUGGER.ATTACH_TO_LOCAL_PROCESS",r.UNITTEST_CONFIGURING="UNITTEST.CONFIGURING",r.UNITTEST_CONFIGURE="UNITTEST.CONFIGURE",r.UNITTEST_DISCOVERY_TRIGGER="UNITTEST.DISCOVERY.TRIGGER",r.UNITTEST_DISCOVERING="UNITTEST.DISCOVERING",r.UNITTEST_DISCOVERING_STOP="UNITTEST.DISCOVERY.STOP",r.UNITTEST_DISCOVERY_DONE="UNITTEST.DISCOVERY.DONE",r.UNITTEST_RUN_STOP="UNITTEST.RUN.STOP",r.UNITTEST_RUN="UNITTEST.RUN",r.UNITTEST_RUN_ALL_FAILED="UNITTEST.RUN_ALL_FAILED",r.UNITTEST_DISABLED="UNITTEST.DISABLED",r.PYTHON_EXPERIMENTS_INIT_PERFORMANCE="PYTHON_EXPERIMENTS_INIT_PERFORMANCE",r.PYTHON_EXPERIMENTS_LSP_NOTEBOOKS="PYTHON_EXPERIMENTS_LSP_NOTEBOOKS",r.PYTHON_EXPERIMENTS_OPT_IN_OPT_OUT_SETTINGS="PYTHON_EXPERIMENTS_OPT_IN_OPT_OUT_SETTINGS",r.EXTENSION_SURVEY_PROMPT="EXTENSION_SURVEY_PROMPT",r.LANGUAGE_SERVER_ENABLED="LANGUAGE_SERVER.ENABLED",r.LANGUAGE_SERVER_TRIGGER_TIME="LANGUAGE_SERVER_TRIGGER_TIME",r.LANGUAGE_SERVER_STARTUP="LANGUAGE_SERVER.STARTUP",r.LANGUAGE_SERVER_READY="LANGUAGE_SERVER.READY",r.LANGUAGE_SERVER_TELEMETRY="LANGUAGE_SERVER.EVENT",r.LANGUAGE_SERVER_REQUEST="LANGUAGE_SERVER.REQUEST",r.LANGUAGE_SERVER_RESTART="LANGUAGE_SERVER.RESTART",r.TERMINAL_CREATE="TERMINAL.CREATE",r.ACTIVATE_ENV_IN_CURRENT_TERMINAL="ACTIVATE_ENV_IN_CURRENT_TERMINAL",r.ACTIVATE_ENV_TO_GET_ENV_VARS_FAILED="ACTIVATE_ENV_TO_GET_ENV_VARS_FAILED",r.DIAGNOSTICS_ACTION="DIAGNOSTICS.ACTION",r.DIAGNOSTICS_MESSAGE="DIAGNOSTICS.MESSAGE",r.USE_REPORT_ISSUE_COMMAND="USE_REPORT_ISSUE_COMMAND",r.HASHED_PACKAGE_NAME="HASHED_PACKAGE_NAME",r.JEDI_LANGUAGE_SERVER_ENABLED="JEDI_LANGUAGE_SERVER.ENABLED",r.JEDI_LANGUAGE_SERVER_STARTUP="JEDI_LANGUAGE_SERVER.STARTUP",r.JEDI_LANGUAGE_SERVER_READY="JEDI_LANGUAGE_SERVER.READY",r.JEDI_LANGUAGE_SERVER_REQUEST="JEDI_LANGUAGE_SERVER.REQUEST",r.TENSORBOARD_SESSION_LAUNCH="TENSORBOARD.SESSION_LAUNCH",r.TENSORBOARD_SESSION_DURATION="TENSORBOARD.SESSION_DURATION",r.TENSORBOARD_SESSION_DAEMON_STARTUP_DURATION="TENSORBOARD.SESSION_DAEMON_STARTUP_DURATION",r.TENSORBOARD_LAUNCH_PROMPT_SELECTION="TENSORBOARD.LAUNCH_PROMPT_SELECTION",r.TENSORBOARD_SESSION_E2E_STARTUP_DURATION="TENSORBOARD.SESSION_E2E_STARTUP_DURATION",r.TENSORBOARD_ENTRYPOINT_SHOWN="TENSORBOARD.ENTRYPOINT_SHOWN",r.TENSORBOARD_INSTALL_PROMPT_SHOWN="TENSORBOARD.INSTALL_PROMPT_SHOWN",r.TENSORBOARD_INSTALL_PROMPT_SELECTION="TENSORBOARD.INSTALL_PROMPT_SELECTION",r.TENSORBOARD_DETECTED_IN_INTEGRATED_TERMINAL="TENSORBOARD_DETECTED_IN_INTEGRATED_TERMINAL",r.TENSORBOARD_PACKAGE_INSTALL_RESULT="TENSORBOARD.PACKAGE_INSTALL_RESULT",r.TENSORBOARD_TORCH_PROFILER_IMPORT="TENSORBOARD.TORCH_PROFILER_IMPORT",r.TENSORBOARD_JUMP_TO_SOURCE_REQUEST="TENSORBOARD_JUMP_TO_SOURCE_REQUEST",r.TENSORBOARD_JUMP_TO_SOURCE_FILE_NOT_FOUND="TENSORBOARD_JUMP_TO_SOURCE_FILE_NOT_FOUND",r.ENVIRONMENT_CREATING="ENVIRONMENT.CREATING",r.ENVIRONMENT_CREATED="ENVIRONMENT.CREATED",r.ENVIRONMENT_FAILED="ENVIRONMENT.FAILED",r.ENVIRONMENT_INSTALLING_PACKAGES="ENVIRONMENT.INSTALLING_PACKAGES",r.ENVIRONMENT_INSTALLED_PACKAGES="ENVIRONMENT.INSTALLED_PACKAGES",r.ENVIRONMENT_INSTALLING_PACKAGES_FAILED="ENVIRONMENT.INSTALLING_PACKAGES_FAILED",r.ENVIRONMENT_BUTTON="ENVIRONMENT.BUTTON",r.ENVIRONMENT_DELETE="ENVIRONMENT.DELETE",r.ENVIRONMENT_REUSE="ENVIRONMENT.REUSE",r.ENVIRONMENT_CHECK_TRIGGER="ENVIRONMENT.CHECK.TRIGGER",r.ENVIRONMENT_CHECK_RESULT="ENVIRONMENT.CHECK.RESULT",r.ENVIRONMENT_TERMINAL_GLOBAL_PIP="ENVIRONMENT.TERMINAL.GLOBAL_PIP",(n=t.PlatformErrors||(t.PlatformErrors={})).FailedToParseVersion="FailedToParseVersion",n.FailedToDetermineOS="FailedToDetermineOS"},98634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnvFileTelemetryTests=t.sendActivationTelemetry=t.sendFileCreationTelemetry=t.sendSettingTelemetry=void 0;const r=n(48683),i=n(54813),o=n(61522);let s,a=!1;function c(e=!1){(0,i.sendTelemetryEvent)(o.EventName.ENVFILE_WORKSPACE,void 0,{hasCustomEnvPath:e}),a=!0}function l(){return!a}function u(e){var t;if(!s){const n=e.getConfiguration("python");s=(null===(t=n.inspect("envFile"))||void 0===t?void 0:t.defaultValue)||""}return s}t.sendSettingTelemetry=function(e,t){l()&&t!==u(e)&&c(!0)},t.sendFileCreationTelemetry=function(){l()&&c()},t.sendActivationTelemetry=async function(e,t,n){if(l()){const i=new r.SystemVariables(n,void 0,t).resolveAny(u(t));await e.fileExists(i)&&c()}},t.EnvFileTelemetryTests={setState:({telemetrySent:e,defaultSetting:t})=>{void 0!==e&&(a=e),void 0!==u&&(s=t)},resetState:()=>{s=void 0,a=!1}}},72392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setExtensionInstallTelemetryProperties=void 0;const r=n(71017),i=n(54813),o=n(63281);t.setExtensionInstallTelemetryProperties=async function(e){const t=r.join(r.dirname(o.EXTENSION_ROOT_DIR),"PythonCodingPack");await e.fileExists(t)?(0,i.setSharedProperty)("installSource","pythonCodingPack"):(0,i.setSharedProperty)("installSource","marketPlace")}},15036:function(e,t,n){"use strict";var r,i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.getDocumentLines=t.ImportTracker=void 0;const s=n(86700),a=n(71017),c=n(39512),l=n(54813),u=n(17585),d=n(77570);n(32727);const p=n(61684),h=n(3481),f=n(2810),g=n(61522),m=/^\s*(from (?\w+)(?:\.\w+)* import \w+(?:, \w+)*(?: as \w+)?|import (?\w+(?:, \w+)*)(?: as \w+)?)$/,v=(0,d.isTestExecution)();let y=r=class{constructor(e,t){this.documentManager=e,this.disposables=t,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!0},this.pendingChecks=new Map,this.hashFn=n(33715).sha256,this.documentManager.onDidOpenTextDocument((e=>this.onOpenedOrSavedDocument(e)),this,this.disposables),this.documentManager.onDidSaveTextDocument((e=>this.onOpenedOrSavedDocument(e)),this,this.disposables)}dispose(){this.pendingChecks.clear()}async activate(){this.documentManager.textDocuments.forEach((e=>this.onOpenedOrSavedDocument(e)))}static hasModuleImport(e){return this.sentMatches.has(e)}onOpenedOrSavedDocument(e){".py"===a.extname(e.fileName).toLowerCase()&&this.scheduleDocument(e)}scheduleDocument(e){this.scheduleCheck(e.fileName,this.checkDocument.bind(this,e))}scheduleCheck(e,t){const n=this.pendingChecks.get(e);n&&((0,c.clearTimeout)(n),this.pendingChecks.delete(e)),v?t():this.pendingChecks.set(e,(0,c.setTimeout)(t,5e3))}checkDocument(e){this.pendingChecks.delete(e.fileName);const t=b(e);this.lookForImports(t)}sendTelemetry(e){if(r.sentMatches.has(e))return;r.sentMatches.add(e);const t=this.hashFn().update(e).digest("hex");(0,l.sendTelemetryEvent)(g.EventName.HASHED_PACKAGE_NAME,void 0,{hashedName:t})}lookForImports(e){try{for(const t of e){const e=t?m.exec(t):null;null!==e&&void 0!==e.groups&&(void 0!==e.groups.fromImport?this.sendTelemetry(e.groups.fromImport):void 0!==e.groups.importImport&&e.groups.importImport.split(",").map((e=>e.trim())).forEach((e=>this.sendTelemetry(e)))),t&&f.TorchProfilerImportRegEx.test(t)&&(0,l.sendTelemetryEvent)(g.EventName.TENSORBOARD_TORCH_PROFILER_IMPORT)}}catch(e){(0,h.noop)()}}};function b(e){return Array(Math.min(e.lineCount,1e3)).fill("").map(((t,n)=>{const r=e.lineAt(n);if(r&&!r.isEmptyOrWhitespace)return r.text})).filter((e=>e))}y.sentMatches=new Set,y=r=i([(0,s.injectable)(),o(0,(0,s.inject)(u.IDocumentManager)),o(1,(0,s.inject)(p.IDisposableRegistry))],y),t.ImportTracker=y,t.getDocumentLines=b},54813:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendTelemetryWhenDone=t.captureTelemetry=t.sendTelemetryEvent=t.clearTelemetryReporter=t.getTelemetryReporter=t._resetSharedProperties=t.setSharedProperty=t.isTelemetryDisabled=void 0;const r=n(77570),i=n(70057),o=n(59314);let s;function a(){if(!s){const e=n(66828).extensions.getExtension(r.PVSC_EXTENSION_ID);s=e.packageJSON}return!s.enableTelemetry}n(61522),t.isTelemetryDisabled=a;const c={};let l;function u(){if(!(0,r.isTestExecution)()&&l)return l;const e=n(92291).default;return l=new e(r.AppinsightsKey,[{lookup:/(errorName|errorMessage|errorStack)/g}]),l}function d(e,t,i,o){var s;if((0,r.isTestExecution)()||!function(){try{const e=n(66828),t=n(92291);return void 0!==e&&void 0!==t}catch(e){return!1}}()||a())return;const l=u(),d="number"==typeof t?{duration:t}:t||void 0,p={},h=e;if(i){const t=i;Object.getOwnPropertyNames(t).forEach((n=>{if(void 0!==t[n]&&null!==t[n])try{switch(typeof t[n]){case"string":p[n]=t[n];break;case"object":p[n]="object";break;default:p[n]=t[n].toString()}}catch(t){console.error(`Failed to serialize ${n} for ${String(e)}`,t)}}))}if(Object.assign(p,c),o){const e={errorName:o.name,errorStack:null!==(s=o.stack)&&void 0!==s?s:""};Object.assign(p,e),l.sendTelemetryErrorEvent(h,p,d)}else l.sendTelemetryEvent(h,p,d);process.env&&process.env.VSC_PYTHON_LOG_TELEMETRY&&console.info(`Telemetry Event : ${h} Measures: ${JSON.stringify(d)} Props: ${JSON.stringify(p)} `)}t.setSharedProperty=function(e,t){const n=e;(0,r.isUnitTestExecution)()&&n.startsWith("ds_")||(void 0===t?delete c[n]:c[n]=t)},t._resetSharedProperties=function(){for(const e of Object.keys(c))delete c[e]},t.getTelemetryReporter=u,t.clearTelemetryReporter=function(){l=void 0},t.sendTelemetryEvent=d,t.captureTelemetry=function(e,t,n=!0,r,s,a){return function(c,l,u){const p=u.value;return u.value=function(...c){if(!n&&!s&&!a)return d(e,void 0,t),p.apply(this,c);const l=e=>s?{...t,...s(this,e)}:t,u=n?new i.StopWatch:void 0,h=e=>{const t=u?{duration:u.elapsedTime}:void 0;return a?{...t,...a(this,e)}:t},f=p.apply(this,c);return f&&(0,o.isPromise)(f)?f.then((t=>(d(e,h(t),l(t)),t))).catch((t=>{const n={...l(),failed:!0};d(r||e,h(),n,t)})):d(e,h(f),l(f)),f},u}},t.sendTelemetryWhenDone=function(e,t,n,r){if(n=n||new i.StopWatch,"function"!=typeof t.then)throw new Error("Method is neither a Promise nor a Theneable");t.then((t=>(d(e,n.elapsedTime,r),t)),(t=>(d(e,n.elapsedTime,r,t),Promise.reject(t))))}},78838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IImportTracker=void 0,t.IImportTracker=Symbol("IImportTracker")},68329:(e,t)=>{"use strict";var n,r,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.TensorBoardEntrypoint=t.TensorBoardSessionStartResult=t.TensorBoardEntrypointTrigger=t.TensorBoardPromptSelection=void 0,(o=t.TensorBoardPromptSelection||(t.TensorBoardPromptSelection={})).Yes="yes",o.No="no",o.DoNotAskAgain="doNotAskAgain",o.None="none",(i=t.TensorBoardEntrypointTrigger||(t.TensorBoardEntrypointTrigger={})).tfeventfiles="tfeventfiles",i.fileimport="fileimport",i.nbextension="nbextension",i.palette="palette",(r=t.TensorBoardSessionStartResult||(t.TensorBoardSessionStartResult={})).cancel="canceled",r.success="success",r.error="error",(n=t.TensorBoardEntrypoint||(t.TensorBoardEntrypoint={})).prompt="prompt",n.codelens="codelens",n.palette="palette"},2810:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.containsNotebookExtension=t.containsTensorBoardImport=t.TorchProfilerImportRegEx=void 0;const r=n(3481);t.TorchProfilerImportRegEx=/^\s*(?:import (?:(\w+, )*torch\.profiler(, \w+)*))|(?:from torch import (?:(\w+, )*profiler(, \w+)*))/;const i=/^\s*(?:from torch\.utils\.tensorboard import \w+)|(?:from torch\.utils import (?:(\w+, )*tensorboard(, \w+)*))|(?:from tensorboardX import \w+)|(?:import (\w+, )*((torch\.utils\.tensorboard)|(tensorboardX)|(tensorboard))(, \w+)*)/;t.containsTensorBoardImport=function(e){try{for(const n of e)if(n&&(i.test(n)||t.TorchProfilerImportRegEx.test(n)))return!0}catch(e){(0,r.noop)()}return!1},t.containsNotebookExtension=function(e){for(const t of e)if((null==t?void 0:t.startsWith("%tensorboard"))||(null==t?void 0:t.startsWith("%load_ext tensorboard")))return!0;return!1}},87401:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TensorBoardNbextensionCodeLensProvider=void 0;const o=n(86700),s=n(96486),a=n(66828),c=n(77570),l=n(61684),u=n(67098),d=n(54813),p=n(61522),h=n(68329),f=n(2810),g=n(28795);let m=class{constructor(e,t){this.experiment=t,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!1},this.disposables=[],this.sendTelemetryOnce=(0,s.once)(d.sendTelemetryEvent.bind(this,p.EventName.TENSORBOARD_ENTRYPOINT_SHOWN,void 0,{trigger:h.TensorBoardEntrypointTrigger.nbextension,entrypoint:h.TensorBoardEntrypoint.codelens})),e.push(this)}dispose(){a.Disposable.from(...this.disposables).dispose()}async activate(){g.TensorboardExperiment.isTensorboardExtensionInstalled||(this.experiment.disposeOnInstallingTensorboard(this),this.activateInternal().ignoreErrors())}async activateInternal(){this.disposables.push(a.languages.registerCodeLensProvider([{scheme:c.NotebookCellScheme,language:c.PYTHON_LANGUAGE},{scheme:"vscode-notebook",language:c.PYTHON_LANGUAGE}],this))}provideCodeLenses(e,t){const n={title:u.TensorBoard.launchNativeTensorBoardSessionCodeLens,command:c.Commands.LaunchTensorBoard,arguments:[{trigger:h.TensorBoardEntrypointTrigger.nbextension,entrypoint:h.TensorBoardEntrypoint.codelens}]},r=[];for(let i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTypes=void 0;const r=n(90819),i=n(42540),o=n(18675),s=n(17950),a=n(68291),c=n(23968),l=n(87401),u=n(12074),d=n(84693),p=n(28795);t.registerTypes=function(e){e.addSingleton(c.TensorBoardSessionProvider,c.TensorBoardSessionProvider),e.addBinding(c.TensorBoardSessionProvider,r.IExtensionSingleActivationService),e.addSingleton(o.TensorBoardFileWatcher,o.TensorBoardFileWatcher),e.addBinding(o.TensorBoardFileWatcher,r.IExtensionSingleActivationService),e.addSingleton(a.TensorBoardPrompt,a.TensorBoardPrompt),e.addSingleton(r.IExtensionSingleActivationService,s.TensorBoardUsageTracker),e.addSingleton(i.TensorBoardImportCodeLensProvider,i.TensorBoardImportCodeLensProvider),e.addBinding(i.TensorBoardImportCodeLensProvider,r.IExtensionSingleActivationService),e.addSingleton(l.TensorBoardNbextensionCodeLensProvider,l.TensorBoardNbextensionCodeLensProvider),e.addBinding(l.TensorBoardNbextensionCodeLensProvider,r.IExtensionSingleActivationService),e.addSingleton(r.IExtensionSingleActivationService,u.TerminalWatcher),e.addSingleton(d.TensorboardDependencyChecker,d.TensorboardDependencyChecker),e.addSingleton(p.TensorboardExperiment,p.TensorboardExperiment)}},18675:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TensorBoardFileWatcher=void 0;const o=n(86700),s=n(66828),a=n(17585),c=n(61684),l=n(68329),u=n(68291),d=n(28795);let p=class{constructor(e,t,n,r){this.workspaceService=e,this.tensorBoardPrompt=t,this.experiment=r,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!1},this.fileSystemWatchers=new Map,this.globPatterns=["*tfevents*","*/*tfevents*","*/*/*tfevents*"],this.disposables=[],n.push(this)}dispose(){s.Disposable.from(...this.disposables).dispose()}async activate(){d.TensorboardExperiment.isTensorboardExtensionInstalled||(this.experiment.disposeOnInstallingTensorboard(this),this.activateInternal().ignoreErrors())}async activateInternal(){const e=this.workspaceService.workspaceFolders;if(e){for(const t of e)this.createFileSystemWatcher(t);this.disposables.push(this.workspaceService.onDidChangeWorkspaceFolders((e=>this.updateFileSystemWatchers(e))))}}async updateFileSystemWatchers(e){for(const t of e.added)this.createFileSystemWatcher(t);for(const t of e.removed){const e=this.fileSystemWatchers.get(t);e&&(e.forEach((e=>e.dispose())),this.fileSystemWatchers.delete(t))}}createFileSystemWatcher(e){const t=[];for(const n of this.globPatterns){const r=new s.RelativePattern(e,n),i=this.workspaceService.createFileSystemWatcher(r);this.disposables.push(i.onDidCreate((()=>this.tensorBoardPrompt.showNativeTensorBoardPrompt(l.TensorBoardEntrypointTrigger.tfeventfiles)))),this.disposables.push(i.onDidChange((()=>this.tensorBoardPrompt.showNativeTensorBoardPrompt(l.TensorBoardEntrypointTrigger.tfeventfiles)))),this.disposables.push(i),t.push(i)}this.fileSystemWatchers.set(e,t)}};p=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IWorkspaceService)),i(1,(0,o.inject)(u.TensorBoardPrompt)),i(2,(0,o.inject)(c.IDisposableRegistry)),i(3,(0,o.inject)(d.TensorboardExperiment))],p),t.TensorBoardFileWatcher=p},42540:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TensorBoardImportCodeLensProvider=void 0;const o=n(86700),s=n(96486),a=n(66828),c=n(77570),l=n(61684),u=n(67098),d=n(54813),p=n(61522),h=n(68329),f=n(2810),g=n(28795);let m=class{constructor(e,t){this.experiment=t,this.supportedWorkspaceTypes={untrustedWorkspace:!1,virtualWorkspace:!1},this.sendTelemetryOnce=(0,s.once)(d.sendTelemetryEvent.bind(this,p.EventName.TENSORBOARD_ENTRYPOINT_SHOWN,void 0,{trigger:h.TensorBoardEntrypointTrigger.fileimport,entrypoint:h.TensorBoardEntrypoint.codelens})),this.disposables=[],e.push(this)}dispose(){a.Disposable.from(...this.disposables).dispose()}async activate(){g.TensorboardExperiment.isTensorboardExtensionInstalled||(this.experiment.disposeOnInstallingTensorboard(this),this.activateInternal().ignoreErrors())}provideCodeLenses(e,t){const n={title:u.TensorBoard.launchNativeTensorBoardSessionCodeLens,command:c.Commands.LaunchTensorBoard,arguments:[{trigger:h.TensorBoardEntrypointTrigger.fileimport,entrypoint:h.TensorBoardEntrypoint.codelens}]},r=[];for(let i=0;i=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TensorBoardPrompt=void 0;const o=n(86700),s=n(96486),a=n(17585),c=n(77570),l=n(61684),u=n(67098),d=n(54813),p=n(61522),h=n(68329);var f;!function(e){e.ShowNativeTensorBoardPrompt="showNativeTensorBoardPrompt"}(f||(f={}));let g=class{constructor(e,t,n){this.applicationShell=e,this.commandManager=t,this.persistentStateFactory=n,this.enabledInCurrentSession=!0,this.waitingForUserSelection=!1,this.sendTelemetryOnce=(0,s.once)((e=>{(0,d.sendTelemetryEvent)(p.EventName.TENSORBOARD_ENTRYPOINT_SHOWN,void 0,{entrypoint:h.TensorBoardEntrypoint.prompt,trigger:e})})),this.state=this.persistentStateFactory.createWorkspacePersistentState(f.ShowNativeTensorBoardPrompt,!0),this.enabled=this.isPromptEnabled()}async showNativeTensorBoardPrompt(e){if(this.enabled&&this.enabledInCurrentSession&&!this.waitingForUserSelection){const t=u.Common.bannerLabelYes,n=u.Common.bannerLabelNo,r=u.Common.doNotShowAgain,i=[t,n,r];this.waitingForUserSelection=!0,this.sendTelemetryOnce(e);const o=await this.applicationShell.showInformationMessage(u.TensorBoard.nativeTensorBoardPrompt,...i);this.waitingForUserSelection=!1,this.enabledInCurrentSession=!1;let s=h.TensorBoardPromptSelection.None;switch(o){case t:s=h.TensorBoardPromptSelection.Yes,await this.commandManager.executeCommand(c.Commands.LaunchTensorBoard,h.TensorBoardEntrypoint.prompt,e);break;case r:s=h.TensorBoardPromptSelection.DoNotAskAgain,await this.disablePrompt();break;case n:s=h.TensorBoardPromptSelection.No}(0,d.sendTelemetryEvent)(p.EventName.TENSORBOARD_LAUNCH_PROMPT_SELECTION,void 0,{selection:s})}}isPromptEnabled(){return this.state.value}async disablePrompt(){await this.state.updateValue(!1)}};g=r([(0,o.injectable)(),i(0,(0,o.inject)(a.IApplicationShell)),i(1,(0,o.inject)(a.ICommandManager)),i(2,(0,o.inject)(l.IPersistentStateFactory))],g),t.TensorBoardPrompt=g},30094:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TensorBoardSession=void 0;const r=n(55674),i=n(71017),o=n(66828),s=n(29979),a=n(4057),c=n(61684),l=n(59314),u=n(67098),d=n(70057),p=n(54813),h=n(61522),f=n(15036),g=n(68329),m=n(59747),v=n(19735);var y;!function(e){e.JumpToSource="jump_to_source"}(y||(y={}));const b=">= 2.4.1",S=">= 0.2.0";t.TensorBoardSession=class{constructor(e,t,n,r,i,s,a,c,l,u){this.installer=e,this.interpreterService=t,this.workspaceService=n,this.pythonExecFactory=r,this.commandManager=i,this.disposables=s,this.applicationShell=a,this.globalMemento=c,this.multiStepFactory=l,this.configurationService=u,this._active=!1,this.onDidChangeViewStateEventEmitter=new o.EventEmitter,this.onDidDisposeEventEmitter=new o.EventEmitter,this.disposables.push(this.onDidChangeViewStateEventEmitter),this.disposables.push(this.onDidDisposeEventEmitter)}get panel(){return this.webviewPanel}get daemon(){return this.process}get onDidDispose(){return this.onDidDisposeEventEmitter.event}get onDidChangeViewState(){return this.onDidChangeViewStateEventEmitter.event}get active(){return this._active}async refresh(){this.webviewPanel&&(this.webviewPanel.webview.html="",this.webviewPanel.webview.html=await this.getHtml())}async initialize(){const e=new d.StopWatch;if(!await this.ensurePrerequisitesAreInstalled())return;const t=await this.getLogDirectory();t&&(await this.startTensorboardSession(t)&&(await this.showPanel(),(0,p.sendTelemetryEvent)(h.EventName.TENSORBOARD_SESSION_E2E_STARTUP_DURATION,e.elapsedTime)),this.sessionDurationStopwatch=new d.StopWatch)}async promptToInstall(e,t){(0,p.sendTelemetryEvent)(h.EventName.TENSORBOARD_INSTALL_PROMPT_SHOWN);const n=u.Common.bannerLabelYes,r=u.Common.bannerLabelNo,i=e===c.ProductInstallStatus.NeedsUpgrade;let o;o=e===c.ProductInstallStatus.Installed&&t!==c.ProductInstallStatus.Installed?u.TensorBoard.installProfilerPluginPrompt:t!==c.ProductInstallStatus.Installed?u.TensorBoard.installTensorBoardAndProfilerPluginPrompt:i?u.TensorBoard.upgradePrompt:u.TensorBoard.installPrompt;const s=await this.applicationShell.showErrorMessage(o,n,r);let a=g.TensorBoardPromptSelection.None;return s===n?a=g.TensorBoardPromptSelection.Yes:s===r&&(a=g.TensorBoardPromptSelection.No),(0,p.sendTelemetryEvent)(h.EventName.TENSORBOARD_INSTALL_PROMPT_SELECTION,void 0,{selection:a,operationType:i?"upgrade":"install"}),s}async ensurePrerequisitesAreInstalled(e){(0,v.traceVerbose)("Ensuring TensorBoard package is installed into active interpreter");const t=await this.interpreterService.getActiveInterpreter(e)||await this.commandManager.executeCommand("python.setInterpreter");if(!t)return!1;let[n,r]=await Promise.all([this.installer.isProductVersionCompatible(c.Product.tensorboard,b,t),this.installer.isProductVersionCompatible(c.Product.torchProfilerImportName,S,t)]);const i=f.ImportTracker.hasModuleImport("torch"),a=n!==c.ProductInstallStatus.Installed,l=r!==c.ProductInstallStatus.Installed;if(i&&!a&&!l||!i&&n===c.ProductInstallStatus.Installed)return!0;const d=await this.promptToInstall(n,i?r:c.ProductInstallStatus.Installed);if(d!==u.Common.bannerLabelYes&&!a)return!0;if(d!==u.Common.bannerLabelYes)return!1;const g=(new o.CancellationTokenSource).token,y=(0,s.createPromiseFromCancellation)({cancelAction:"resolve",defaultValue:c.InstallerResponse.Ignore,token:g}),_=[];return a&&_.push(this.installer.install(c.Product.tensorboard,t,g,n===c.ProductInstallStatus.NeedsUpgrade?m.ModuleInstallFlags.upgrade:void 0)),i&&l&&_.push(this.installer.install(c.Product.torchProfilerInstallName,t,g,r===c.ProductInstallStatus.NeedsUpgrade?m.ModuleInstallFlags.upgrade:void 0)),await Promise.race([..._,y]),[n,r]=await Promise.all([this.installer.isProductVersionCompatible(c.Product.tensorboard,b,t),this.installer.isProductVersionCompatible(c.Product.torchProfilerImportName,S,t)]),(0,p.sendTelemetryEvent)(h.EventName.TENSORBOARD_PACKAGE_INSTALL_RESULT,void 0,{wasTensorBoardAttempted:a,wasProfilerPluginAttempted:l,wasTensorBoardInstalled:n===c.ProductInstallStatus.Installed,wasProfilerPluginInstalled:r===c.ProductInstallStatus.Installed}),i&&r!==c.ProductInstallStatus.Installed&&(0,v.traceError)("Failed to install torch-tb-plugin. Profiler plugin will not appear in TensorBoard session."),n===c.ProductInstallStatus.Installed}async showFilePicker(){const e=await this.applicationShell.showOpenDialog({canSelectFiles:!1,canSelectFolders:!0,canSelectMany:!1});if(e)return e[0].fsPath}getQuickPickItems(e){const t=[];if(e){const e={label:u.TensorBoard.useCurrentWorkingDirectory,detail:u.TensorBoard.useCurrentWorkingDirectoryDetail},n={label:u.TensorBoard.selectAnotherFolder,detail:u.TensorBoard.selectAnotherFolderDetail};t.push(e,n)}else{const e={label:u.TensorBoard.selectAFolder,detail:u.TensorBoard.selectAFolderDetail};t.push(e)}return t.push({label:u.TensorBoard.enterRemoteUrl,detail:u.TensorBoard.enterRemoteUrlDetail}),t}async getLogDirectory(){var e;const t=null===(e=this.configurationService.getSettings().tensorBoard)||void 0===e?void 0:e.logDirectory;if(t)return(0,v.traceVerbose)(`Using log directory resolved by python.tensorBoard.logDirectory setting: ${t}`),t;const n=this.autopopulateLogDirectoryPath(),{useCurrentWorkingDirectory:r}=u.TensorBoard,{selectAFolder:i}=u.TensorBoard,{selectAnotherFolder:s}=u.TensorBoard,{enterRemoteUrl:a}=u.TensorBoard,c=this.getQuickPickItems(n),l=await this.applicationShell.showQuickPick(c,{canPickMany:!1,ignoreFocusOut:!1,placeHolder:n?o.l10n.t("Current: {0}",n):void 0});switch(null==l?void 0:l.label){case r:return n;case i:case s:return this.showFilePicker();case a:return this.applicationShell.showInputBox({prompt:u.TensorBoard.enterRemoteUrlDetail});default:return}}async startTensorboardSession(e){const t=await this.interpreterService.getActiveInterpreter();if(!t)return!1;const n={title:u.TensorBoard.progressMessage,location:o.ProgressLocation.Notification,cancellable:!0},r=await this.pythonExecFactory.createActivatedEnvironment({allowEnvironmentFetchExceptions:!0,interpreter:t}),i=(0,a.tensorboardLauncher)([e]),c=new d.StopWatch,f=r.execObservable(i,{}),m=await this.applicationShell.withProgress(n,((t,n)=>{(0,v.traceVerbose)(`Starting TensorBoard with log directory ${e}...`);const r=this.waitForTensorBoardStart(f),i=(0,s.createPromiseFromCancellation)({token:n,cancelAction:"resolve",defaultValue:"canceled"});return Promise.race([(0,l.sleep)(6e4),r,i])}));switch(m){case"canceled":return(0,v.traceVerbose)("Canceled starting TensorBoard session."),(0,p.sendTelemetryEvent)(h.EventName.TENSORBOARD_SESSION_DAEMON_STARTUP_DURATION,c.elapsedTime,{result:g.TensorBoardSessionStartResult.cancel}),f.dispose(),!1;case"success":return this.process=f.proc,(0,p.sendTelemetryEvent)(h.EventName.TENSORBOARD_SESSION_DAEMON_STARTUP_DURATION,c.elapsedTime,{result:g.TensorBoardSessionStartResult.success}),!0;case 6e4:throw(0,p.sendTelemetryEvent)(h.EventName.TENSORBOARD_SESSION_DAEMON_STARTUP_DURATION,c.elapsedTime,{result:g.TensorBoardSessionStartResult.error}),new Error("Timed out after 60 seconds waiting for TensorBoard to launch.");default:throw new Error(`Failed to start TensorBoard, received unknown promise result: ${m}`)}}async waitForTensorBoardStart(e){const t=(0,l.createDeferred)();return e.out.subscribe({next:e=>{if("stdout"===e.source){const n=e.out.match(/TensorBoard started at (.*)/);n&&n[1]&&(this.url=n[1],t.resolve("success")),(0,v.traceVerbose)(e.out)}else"stderr"===e.source&&(0,v.traceError)(e.out)},error:e=>{(0,v.traceError)(e)}}),t.promise}async showPanel(){(0,v.traceVerbose)("Showing TensorBoard panel"),(this.webviewPanel||await this.createPanel()).reveal(),this._active=!0,this.onDidChangeViewStateEventEmitter.fire()}async createPanel(){const e=o.window.createWebviewPanel("tensorBoardSession","TensorBoard",this.globalMemento.value,{enableScripts:!0,retainContextWhenHidden:!0});return e.webview.html=await this.getHtml(),this.webviewPanel=e,this.disposables.push(e.onDidDispose((()=>{var e,t;this.webviewPanel=void 0,null===(e=this.process)||void 0===e||e.kill(),(0,p.sendTelemetryEvent)(h.EventName.TENSORBOARD_SESSION_DURATION,null===(t=this.sessionDurationStopwatch)||void 0===t?void 0:t.elapsedTime),this.process=void 0,this._active=!1,this.onDidDisposeEventEmitter.fire(this)}))),this.disposables.push(e.onDidChangeViewState((async t=>{var n;this.active&&t.webviewPanel.active&&await this.globalMemento.updateValue(null!==(n=e.viewColumn)&&void 0!==n?n:o.ViewColumn.Active),this._active=t.webviewPanel.active,this.onDidChangeViewStateEventEmitter.fire()}))),this.disposables.push(e.webview.onDidReceiveMessage((e=>{e.command===y.JumpToSource&&this.jumpToSource(e.args.filename,e.args.line)}))),e}autopopulateLogDirectoryPath(){if(this.workspaceService.rootPath)return this.workspaceService.rootPath;const{activeTextEditor:e}=o.window;return e?i.dirname(e.document.uri.fsPath):void 0}async jumpToSource(e,t){let n;if((0,p.sendTelemetryEvent)(h.EventName.TENSORBOARD_JUMP_TO_SOURCE_REQUEST),r.existsSync(e))n=o.Uri.file(e);else{(0,p.sendTelemetryEvent)(h.EventName.TENSORBOARD_JUMP_TO_SOURCE_FILE_NOT_FOUND),(0,v.traceError)(`Requested jump to source filepath ${e} does not exist. Prompting user to select source file...`);const t=[{label:u.TensorBoard.selectMissingSourceFile,description:u.TensorBoard.selectMissingSourceFileDescription}],r=this.multiStepFactory.create();await r.run((async r=>{const i=await r.showQuickPick({items:t,title:u.TensorBoard.missingSourceFile,placeholder:e});switch(null==i?void 0:i.label){case u.TensorBoard.selectMissingSourceFile:{const e=await this.applicationShell.showOpenDialog({canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1});void 0!==e&&([n]=e);break}}}),{})}if(void 0===n)return;const i=await o.workspace.openTextDocument(n),s=await o.window.showTextDocument(i,o.ViewColumn.Beside);if(t\n \n \n \n \n \n TensorBoard\n \n \n