@ranger-testing/ranger-cli 3.1.5 → 3.1.6-alpha.4287155-52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -1
  60. package/build/commands/utils/playwrightCli.js +1 -1
  61. package/build/commands/utils/profileMessages.js +1 -1
  62. package/build/commands/utils/profileSetupBanner.js +1 -1
  63. package/build/commands/utils/projectsConfig.js +1 -1
  64. package/build/commands/utils/rangerConfig.js +1 -1
  65. package/build/commands/utils/rangerRoot.js +1 -1
  66. package/build/commands/utils/rangerwrightCli.js +1 -1
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/scenarioOriginCheck.js +1 -1
  71. package/build/commands/utils/sessionCache.js +1 -1
  72. package/build/commands/utils/settings.js +1 -1
  73. package/build/commands/utils/skillContent.js +1 -1
  74. package/build/commands/utils/skills.js +1 -1
  75. package/build/commands/utils/stitchWebmFiles.js +1 -1
  76. package/build/commands/utils/telemetry.js +1 -1
  77. package/build/commands/utils/tokenRefresh.js +1 -1
  78. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  79. package/build/commands/utils/tunnelClient.js +1 -1
  80. package/build/commands/utils/userApi.js +1 -1
  81. package/build/commands/utils/version.js +1 -1
  82. package/build/commands/verifyFeature.js +1 -1
  83. package/build/commands/verifyFeatureCli.js +1 -1
  84. package/build/commands/verifyFeatureNovaCli.js +1 -1
  85. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  86. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x184362,_0x208d99){const _0x3e3d52=_0x3a23,_0x5c44a2=_0x184362();while(!![]){try{const _0x14581e=parseInt(_0x3e3d52(0x222))/0x1*(-parseInt(_0x3e3d52(0x20d))/0x2)+-parseInt(_0x3e3d52(0x1b0))/0x3*(-parseInt(_0x3e3d52(0x1a5))/0x4)+-parseInt(_0x3e3d52(0x1c1))/0x5+-parseInt(_0x3e3d52(0x20e))/0x6+parseInt(_0x3e3d52(0x1f7))/0x7+parseInt(_0x3e3d52(0x1c8))/0x8+parseInt(_0x3e3d52(0x1b2))/0x9*(-parseInt(_0x3e3d52(0x1ce))/0xa);if(_0x14581e===_0x208d99)break;else _0x5c44a2['push'](_0x5c44a2['shift']());}catch(_0x529e74){_0x5c44a2['push'](_0x5c44a2['shift']());}}}(_0x39dc,0x581ff));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x26ae9b from'inquirer';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{fetchAuthConfig,createCloudProfile,manualBrowserLogin,ApiError}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';import{setProfileOverride}from'./utils/projectsConfig.js';const CLOUD_PROFILE_SHARING_WARNING='This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization';function warnCloudProfileSharedInOrg(){const _0x26fd6c=_0x3a23;if(!process['stdout']['isTTY'])return;console[_0x26fd6c(0x1fd)](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x4e35d8){const _0x37890f=_0x3a23,_0xf4fe7b={'iIdyh':function(_0x46c9f6,_0x52666a){return _0x46c9f6(_0x52666a);},'Ktsmj':'Invalid\x20URL','SDhRL':'TypeError','Xsias':_0x37890f(0x1f2)};try{const _0x53e80a=new AbortController(),_0x350ebc=setTimeout(()=>_0x53e80a[_0x37890f(0x208)](),0x1388),_0x17e5ac={'method':_0x37890f(0x1fa),'signal':_0x53e80a['signal'],'redirect':_0x37890f(0x1d9)};/^https:\/\/localhost(:\d+)?/i['test'](_0x4e35d8)&&(process[_0x37890f(0x21c)][_0x37890f(0x20f)]='0');const _0x33198f=await fetch(_0x4e35d8,_0x17e5ac);delete process['env'][_0x37890f(0x20f)],_0xf4fe7b[_0x37890f(0x1bb)](clearTimeout,_0x350ebc);if(_0x33198f['status']<0x190)return{'ok':!![]};return{'ok':![],'error':_0x37890f(0x1a3)+_0x33198f['status']};}catch(_0xa0572c){delete process['env'][_0x37890f(0x20f)];const _0x356e72=_0xa0572c,_0x55af85=_0x356e72['message']||_0xf4fe7b['iIdyh'](String,_0xa0572c),_0x3519e1=_0x55af85['includes'](_0xf4fe7b['Ktsmj'])||_0x356e72['name']===_0xf4fe7b['SDhRL']||_0x55af85[_0x37890f(0x1bd)](_0xf4fe7b[_0x37890f(0x1d0)]);return{'ok':![],'error':_0x55af85,'isProtocolError':_0x3519e1};}}async function sweepOrphanLocalProfile(_0x2642be,_0x53ad35,_0x57bd5d){const _0x25654b=_0x3a23,_0xb2f29e={'vvUjD':'local','jndwg':function(_0x3ab559,_0x3d75db){return _0x3ab559(_0x3d75db);},'SXnGy':function(_0x72fb7e,_0x261691){return _0x72fb7e(_0x261691);},'RVUuh':function(_0x45f9d9,_0x5a1ff0,_0x47915d){return _0x45f9d9(_0x5a1ff0,_0x47915d);}},_0x3a88e7=join(_0x53ad35,_0xb2f29e['vvUjD']),_0x4285dd=join(_0x3a88e7,_0x2642be);_0xb2f29e[_0x25654b(0x19f)](existsSync,_0x4285dd)&&(_0x57bd5d&&await _0xb2f29e[_0x25654b(0x1b3)](isPathGitTracked,_0x4285dd)?console[_0x25654b(0x1ca)](_0x25654b(0x1fb)+_0x4285dd+'\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.'):(await rm(_0x4285dd,{'recursive':!![],'force':!![]}),console[_0x25654b(0x1ca)](_0x25654b(0x1e6)+_0x4285dd)));if(existsSync(_0x3a88e7)){let _0x3f38fd=[];try{_0x3f38fd=await readdir(_0x3a88e7);}catch{return;}const _0x28035b='.tmp-'+_0x2642be+'-';for(const _0x41df11 of _0x3f38fd){if(!_0x41df11[_0x25654b(0x1f9)](_0x28035b))continue;const _0x1b6a25=_0xb2f29e[_0x25654b(0x1e3)](join,_0x3a88e7,_0x41df11);await rm(_0x1b6a25,{'recursive':!![],'force':!![]}),console['log']('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x1b6a25);}}}function _0x39dc(){const _0x47b3c5=['BZFEN','isProtocolError','\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20','status','3633168XxGUUP','✓\x20Profile\x20\x27','log',')\x0a\x20\x20Save\x20\x27','crBwo','cwd','6342090CDRFpS','Found\x20auth\x20environment\x20\x27','Xsias','skipAuth','mOoag','epvmb','Use\x20','message','cdqyS','trim','no_match','manual','To\x20set\x20up\x20a\x20profile,\x20run:\x0a','oVMgO','setupHeader','setupHeaders','keys','tuNSi','LpUqH','baseUrl','The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','RVUuh','indexOf','profile.add.autoRouted','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','\x20\x20Set\x20active\x20profile:\x20','Could\x20not\x20reach\x20','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','LmdeH','\x20\x20https://docs.ranger.net/main/concepts/profiles','exit','domains','PIIAJ','✓\x20Cloud\x20profile\x20\x27','\x0a\x20\x20(domains:\x20','fetch\x20failed','url','\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','mgYLO','\x27\x20matching\x20','2577750SEsyhx','vmYgC','startsWith','HEAD','\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20','Lqiok','warn','What\x20would\x20you\x20like\x20to\x20do?','\x0a🌐\x20Profile\x20Setup\x0a','\x20\x20Did\x20you\x20mean\x20','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20','http://localhost:3000','prompt','⚠\x20Could\x20not\x20reach\x20','--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','KNSRx','user_declined','abort','input','authEnv','\x27\x20created\x20with\x20a\x20captured\x20session.\x0a','aIoZd','68HxVbnw','994794GSlFxb','NODE_TLS_REJECT_UNAUTHORIZED','\x27\x20created\x20(CDP).','dLbGL','bBazH','\x0a\x20\x20Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team\x20yet\x20—\x20that\x27s\x20the\x20path\x20that\x20lets\x20Ranger\x20log\x20into\x20your\x20app\x20for\x20you\x20in\x20CI\x20/\x20background\x20agents.\x0a','SFHmZ','\x0a\x20\x20Still\x20could\x20not\x20reach\x20','length','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','slice','\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','\x0a\x20\x20A\x20profile\x20named\x20\x22','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','env','\x0a\x20\x20Could\x20not\x20reach\x20','GBVmv','trackPhaseEnd','join','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','4454LYVQHM','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','jlAuM','BQtiV','no_auth_config','\x22:\x20','profile.add.autoRouteSkipped','mjImk','cAJXw','origin','bBVNW','jndwg','Continue\x20anyway','\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22','cdpEndpoint','HTTP\x20','saveToCloud','244EkgwCS','wSZUv','action','kvdfk','vYFfj','dDYaG','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','Enter\x20a\x20different\x20URL','http://','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','31833jrAzEi','FimPh','9hyBvwQ','SXnGy','force','EhisU','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','error','environments','TlZHQ','wJInF','iIdyh','OxiBh','includes','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','use_suggestion','786320LzjCCU','FWuHX','list'];_0x39dc=function(){return _0x47b3c5;};return _0x39dc();}async function sweepOrphansBestEffort(_0x2653e3){const _0x5ad480=_0x3a23,_0x1effdd={'bBVNW':function(_0x236694,_0x42aecf){return _0x236694!==_0x42aecf;},'bbEkq':function(_0x4e9341){return _0x4e9341();},'sPUUB':function(_0x38e578,_0x493fea){return _0x38e578(_0x493fea);}};try{await sweepOrphanLocalProfile(_0x2653e3,getRangerHomeDir(),![]);const _0x3dc65a=getRangerDir();_0x1effdd[_0x5ad480(0x19e)](_0x3dc65a,_0x1effdd['bbEkq'](getRangerHomeDir))&&await sweepOrphanLocalProfile(_0x2653e3,_0x3dc65a,!![]);}catch(_0x3010e6){console[_0x5ad480(0x1ca)](_0x5ad480(0x21b)+(_0x3010e6 instanceof Error?_0x3010e6['message']:_0x1effdd['sPUUB'](String,_0x3010e6))+').');}}function _0x3a23(_0x3976f9,_0x1d69a7){_0x3976f9=_0x3976f9-0x19d;const _0x39dcac=_0x39dc();let _0x3a23f4=_0x39dcac[_0x3976f9];return _0x3a23f4;}async function markActive(_0x2f7654){const _0x178614=_0x3a23;try{await writeActiveProfileName(_0x2f7654),console[_0x178614(0x1ca)](_0x178614(0x1e8)+_0x2f7654);}catch{console[_0x178614(0x1ca)](_0x178614(0x223));}}async function tryAutoRouteCloudProfile(_0x52f364,_0x25d723,_0x24295e,_0x315070,_0x353b52){const _0x42cdc5=_0x3a23,_0x3d11cd={'mgYLO':function(_0x42de19,_0x4cd77a){return _0x42de19===_0x4cd77a;},'epvmb':function(_0x2fc5ce,_0x1d7e58){return _0x2fc5ce(_0x1d7e58);},'vYFfj':_0x42cdc5(0x226),'cdqyS':function(_0x41ae8a,_0x3e6fad){return _0x41ae8a+_0x3e6fad;},'UmRUi':function(_0x156e3e,_0x276187){return _0x156e3e+_0x276187;},'JwBkW':function(_0x1f377b,_0x3b9a4b){return _0x1f377b+_0x3b9a4b;},'cAJXw':_0x42cdc5(0x1f4),'UwzHI':_0x42cdc5(0x219),'GUmBG':'env_not_found','BQtiV':function(_0x363d1e,_0x58104d){return _0x363d1e+_0x58104d;},'BZFEN':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','jlAuM':function(_0x58ffb6,_0x1a8f50,_0x86401c){return _0x58ffb6(_0x1a8f50,_0x86401c);},'aIoZd':_0x42cdc5(0x1a4),'dDYaG':function(_0x3a48a6,_0x5ee080,_0x1cbc44,_0x3bd4e6){return _0x3a48a6(_0x5ee080,_0x1cbc44,_0x3bd4e6);},'wJInF':function(_0x23e314){return _0x23e314();},'dLbGL':function(_0x8562e9,_0x462579){return _0x8562e9 instanceof _0x462579;},'pJZQT':function(_0x2e6eb7,_0x388729){return _0x2e6eb7+_0x388729;},'LmdeH':function(_0x522e75,_0x4dbc4f){return _0x522e75+_0x4dbc4f;},'FimPh':'profile.add.autoRouted'};let _0x579a36;try{_0x579a36=await fetchAuthConfig();}catch(_0x1b09a2){return _0x353b52?.[_0x42cdc5(0x21f)](_0x42cdc5(0x228),{'reason':'no_auth_config','profileName':_0x52f364}),console[_0x42cdc5(0x1b7)]('\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20'+(_0x1b09a2 instanceof Error?_0x1b09a2[_0x42cdc5(0x1d5)]:_0x3d11cd[_0x42cdc5(0x1d3)](String,_0x1b09a2))),![];}if((!_0x579a36||!_0x579a36['environments']||_0x3d11cd[_0x42cdc5(0x1f5)](Object['keys'](_0x579a36['environments'])[_0x42cdc5(0x216)],0x0))&&!_0x24295e[_0x42cdc5(0x20a)]){if(_0x315070)return await captureEnvLessProfile(_0x52f364,_0x25d723,_0x24295e,_0x353b52);return _0x353b52?.[_0x42cdc5(0x21f)](_0x42cdc5(0x228),{'reason':_0x3d11cd[_0x42cdc5(0x1a9)],'profileName':_0x52f364}),console[_0x42cdc5(0x1b7)](_0x3d11cd['cdqyS'](_0x3d11cd[_0x42cdc5(0x1d6)](_0x3d11cd['UmRUi'](_0x3d11cd['JwBkW'](_0x3d11cd['cdqyS'](_0x42cdc5(0x213),'\x0a'),_0x3d11cd[_0x42cdc5(0x22a)])+(_0x42cdc5(0x201)+_0x52f364+'\x20--url\x20'+_0x25d723+'\x20--skip-auth\x0a'),'\x0a'),_0x3d11cd['UwzHI']),_0x42cdc5(0x1af))),![];}let _0x2cb23f;if(_0x24295e['authEnv']){if(!_0x579a36?.[_0x42cdc5(0x1b8)]?.[_0x24295e[_0x42cdc5(0x20a)]]){const _0x49988d=Object['keys'](_0x579a36?.[_0x42cdc5(0x1b8)]??{});return _0x353b52?.['trackPhaseEnd'](_0x42cdc5(0x228),{'reason':_0x3d11cd['GUmBG'],'profileName':_0x52f364}),console['error'](_0x3d11cd[_0x42cdc5(0x225)]('\x0a\x20\x20Auth\x20environment\x20\x22'+_0x24295e['authEnv']+'\x22\x20not\x20found.',_0x49988d[_0x42cdc5(0x216)]?'\x20Configured\x20envs:\x20'+_0x49988d['join'](',\x20')+'.':_0x3d11cd[_0x42cdc5(0x1c4)])),![];}_0x2cb23f=_0x24295e[_0x42cdc5(0x20a)];}else _0x2cb23f=_0x3d11cd[_0x42cdc5(0x224)](matchAuthEnvironment,_0x25d723,_0x579a36);if(!_0x2cb23f)return _0x353b52?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':_0x42cdc5(0x1d8),'profileName':_0x52f364}),console[_0x42cdc5(0x1b7)]('\x0a\x20\x20No\x20auth\x20env\x20matches\x20'+_0x25d723+_0x42cdc5(0x1ae)+Object[_0x42cdc5(0x1de)](_0x579a36?.[_0x42cdc5(0x1b8)]??{})['join'](',\x20')+'.'),![];const _0x469688=_0x579a36?.['environments']?.[_0x2cb23f],_0x249889=_0x469688?.[_0x42cdc5(0x1ee)]??[];if(_0x315070&&!_0x24295e['yes']){const {saveToCloud:_0x15905f}=await _0x26ae9b['prompt']([{'type':'confirm','name':_0x3d11cd[_0x42cdc5(0x20c)],'message':_0x42cdc5(0x1cf)+_0x2cb23f+_0x42cdc5(0x1f6)+_0x25d723+_0x42cdc5(0x1f1)+_0x249889[_0x42cdc5(0x220)](',\x20')+_0x42cdc5(0x1cb)+_0x52f364+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0x15905f)return _0x353b52?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':'user_declined','profileName':_0x52f364}),console['error']('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.'),![];}const _0x1ecce2=_0x249889['some'](_0x12dc26=>{const _0x323872=_0x42cdc5;try{return _0x3d11cd['mgYLO'](new URL(_0x12dc26)[_0x323872(0x19d)],new URL(_0x25d723)[_0x323872(0x19d)]);}catch{return![];}}),_0x27303b={};!_0x1ecce2&&(_0x27303b['baseUrl']=_0x25d723);try{await _0x3d11cd[_0x42cdc5(0x1aa)](createCloudProfile,_0x52f364,_0x2cb23f,{'settings':_0x27303b}),_0x3d11cd[_0x42cdc5(0x1ba)](warnCloudProfileSharedInOrg);}catch(_0x1bb481){if(_0x3d11cd[_0x42cdc5(0x211)](_0x1bb481,ApiError)&&_0x1bb481['status']===0x199){console[_0x42cdc5(0x1b7)](_0x3d11cd['pJZQT']('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x52f364+_0x42cdc5(0x1ab),_0x42cdc5(0x217)+_0x52f364));throw _0x1bb481;}throw _0x1bb481;}return console[_0x42cdc5(0x1ca)](_0x3d11cd[_0x42cdc5(0x1eb)]('✓\x20Profile\x20\x27'+_0x52f364+'\x27\x20created.\x0a','\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x52f364)),await sweepOrphansBestEffort(_0x52f364),_0x353b52?.['trackPhaseEnd'](_0x3d11cd[_0x42cdc5(0x1b1)],{'envKey':_0x2cb23f,'profileName':_0x52f364}),!![];}async function createUnconfiguredCloudProfile(_0x3bdf19,_0x57dc1a){const _0x29939f=_0x3a23,_0x5a0927={'KNSRx':function(_0x23f373,_0x87fcef,_0x229e3e,_0x46e19a){return _0x23f373(_0x87fcef,_0x229e3e,_0x46e19a);},'GBVmv':function(_0x30167b,_0x417b1d){return _0x30167b===_0x417b1d;},'BEXOZ':function(_0x331a97,_0x3d58ca){return _0x331a97+_0x3d58ca;}};try{await _0x5a0927[_0x29939f(0x206)](createCloudProfile,_0x3bdf19,undefined,{'settings':_0x57dc1a}),warnCloudProfileSharedInOrg();}catch(_0x15ab89){_0x15ab89 instanceof ApiError&&_0x5a0927[_0x29939f(0x21e)](_0x15ab89[_0x29939f(0x1c7)],0x199)&&console['error'](_0x5a0927['BEXOZ'](_0x29939f(0x21a)+_0x3bdf19+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x3bdf19));throw _0x15ab89;}}async function captureEnvLessProfile(_0x163d3a,_0x3dceeb,_0x4192a8,_0x3c9ea3){const _0x27615c=_0x3a23,_0x2fb93a={'WVXcM':'confirm','Lqiok':'profile.add.autoRouteSkipped','rRyRc':function(_0x53473d,_0x456949){return _0x53473d===_0x456949;},'OxiBh':function(_0x24c3da,_0x3d3f6e){return _0x24c3da+_0x3d3f6e;},'bBazH':function(_0xdf5804,_0x4e2c4e){return _0xdf5804>_0x4e2c4e;},'resCn':function(_0x4929ab){return _0x4929ab();},'MyYRo':function(_0x195108,_0x19f2ea){return _0x195108 instanceof _0x19f2ea;},'jcFWW':function(_0x46b127,_0x185bb5){return _0x46b127+_0x185bb5;},'xRZfn':function(_0x31edbe,_0x1b6ad4){return _0x31edbe+_0x1b6ad4;}};if(!_0x4192a8['yes']){const {capture:_0x5885a1}=await _0x26ae9b[_0x27615c(0x203)]([{'type':_0x2fb93a['WVXcM'],'name':'capture','message':'Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','default':!![]}]);if(!_0x5885a1)return _0x3c9ea3?.[_0x27615c(0x21f)](_0x2fb93a[_0x27615c(0x1fc)],{'reason':_0x27615c(0x207),'profileName':_0x163d3a}),console[_0x27615c(0x1b7)]('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a'+'\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.'),![];}const _0x397783={};if(_0x4192a8['setupHeader'])for(const _0x50b4e2 of _0x4192a8[_0x27615c(0x1dc)]){const _0x575709=_0x50b4e2[_0x27615c(0x1e4)](':');if(_0x2fb93a['rRyRc'](_0x575709,-0x1))continue;_0x397783[_0x50b4e2['slice'](0x0,_0x575709)[_0x27615c(0x1d7)]()]=_0x50b4e2[_0x27615c(0x218)](_0x2fb93a[_0x27615c(0x1bc)](_0x575709,0x1))[_0x27615c(0x1d7)]();}const _0x5a1346={'baseUrl':_0x3dceeb};_0x2fb93a[_0x27615c(0x212)](Object['keys'](_0x397783)['length'],0x0)&&(_0x5a1346['setupHeaders']=_0x397783);let _0x27d894;try{_0x27d894=await createCloudProfile(_0x163d3a,undefined,{'settings':_0x5a1346}),_0x2fb93a['resCn'](warnCloudProfileSharedInOrg);}catch(_0x422bc4){_0x2fb93a['MyYRo'](_0x422bc4,ApiError)&&_0x2fb93a['rRyRc'](_0x422bc4['status'],0x199)&&console['error'](_0x2fb93a['jcFWW'](_0x27615c(0x21a)+_0x163d3a+_0x27615c(0x1ab),'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x163d3a));throw _0x422bc4;}return await manualBrowserLogin(_0x27d894,{'key':'','domains':[_0x3dceeb],'setupHeaders':Object['keys'](_0x397783)[_0x27615c(0x216)]>0x0?_0x397783:undefined}),console['log'](_0x2fb93a['xRZfn']('\x0a✓\x20Profile\x20\x27'+_0x163d3a+_0x27615c(0x20b),'\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x163d3a)),await sweepOrphansBestEffort(_0x163d3a),_0x3c9ea3?.[_0x27615c(0x21f)](_0x27615c(0x1e5),{'envKey':null,'profileName':_0x163d3a}),!![];}export async function addEnv(_0x494a89,_0x136abd={},_0x4a6984){const _0x110e94=_0x3a23,_0x5c15b1={'oVMgO':function(_0x32ac0e,_0x592612){return _0x32ac0e+_0x592612;},'brSME':function(_0x1ba041,_0x1d6259){return _0x1ba041+_0x1d6259;},'BqPjw':_0x110e94(0x1e2),'PIIAJ':'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','KvrOb':_0x110e94(0x1b6),'TbCPT':_0x110e94(0x1ec),'niDux':function(_0x5ca6fc,_0x15f8a8){return _0x5ca6fc===_0x15f8a8;},'mOoag':function(_0x3bdae3,_0x1b4644){return _0x3bdae3+_0x1b4644;},'mjImk':function(_0x2d7e6e,_0x34adc0){return _0x2d7e6e!==_0x34adc0;},'wSZUv':'--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','LpUqH':_0x110e94(0x205),'JMMcX':function(_0x4abafd){return _0x4abafd();},'gRaCL':_0x110e94(0x1be),'tuNSi':function(_0x1137ad,_0x521961,_0x5c5a6f,_0x203a25,_0x382a25){return _0x1137ad(_0x521961,_0x5c5a6f,_0x203a25,_0x382a25);},'EhisU':'isElectron','vmYgC':function(_0x3b617a,_0x35d15f){return _0x3b617a instanceof _0x35d15f;},'FWuHX':function(_0x126ebe,_0x41d2c5){return _0x126ebe(_0x41d2c5);},'xpQhi':function(_0x1d31cb,_0x329a72){return _0x1d31cb(_0x329a72);},'TlZHQ':function(_0x4818c0,_0x18f9bd,_0x20788c){return _0x4818c0(_0x18f9bd,_0x20788c);},'crBwo':function(_0x5c59d2,_0x2d0d23){return _0x5c59d2(_0x2d0d23);},'JFlaN':_0x110e94(0x1ff),'fLuTD':'\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','smDeU':_0x110e94(0x1bf),'kvdfk':_0x110e94(0x209),'FuxTn':_0x110e94(0x1e1),'afJVX':_0x110e94(0x202),'SFHmZ':function(_0x2d27eb,_0x5c8184){return _0x2d27eb===_0x5c8184;}};_0x136abd['ci']&&(console['error'](_0x5c15b1[_0x110e94(0x1db)](_0x5c15b1['oVMgO'](_0x5c15b1['brSME'](_0x5c15b1['oVMgO'](_0x5c15b1['BqPjw']+_0x5c15b1[_0x110e94(0x1ef)],'\x0a')+_0x110e94(0x1da),_0x5c15b1['KvrOb']),'\x0a'),'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a')+_0x5c15b1['TbCPT']),process[_0x110e94(0x1ed)](0x1));const _0x133e36={};if(_0x136abd[_0x110e94(0x1dc)])for(const _0x97cfd0 of _0x136abd[_0x110e94(0x1dc)]){const _0x1d19ee=_0x97cfd0['indexOf'](':');if(_0x5c15b1['niDux'](_0x1d19ee,-0x1))throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x97cfd0+_0x110e94(0x1e7));const _0xacec1=_0x97cfd0['slice'](0x0,_0x1d19ee)['trim'](),_0x4f27c7=_0x97cfd0[_0x110e94(0x218)](_0x5c15b1[_0x110e94(0x1d2)](_0x1d19ee,0x1))['trim']();_0x133e36[_0xacec1]=_0x4f27c7;}if(_0x5c15b1[_0x110e94(0x229)](_0x136abd[_0x110e94(0x1a2)],undefined)&&_0x136abd[_0x110e94(0x1a2)][_0x110e94(0x1d7)]()==='')throw new Error('--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222');if(_0x136abd[_0x110e94(0x1a2)]&&_0x136abd[_0x110e94(0x1f3)])throw new Error(_0x5c15b1[_0x110e94(0x1a6)]);if(_0x136abd['authEnv']&&_0x136abd[_0x110e94(0x1d1)])throw new Error('--skip-auth\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20--skip-auth\x20makes\x20an\x20env-less\x20profile,\x20--env\x20binds\x20one\x20to\x20an\x20auth\x20environment.');if(_0x136abd['authEnv']&&_0x136abd['cdpEndpoint'])throw new Error(_0x5c15b1[_0x110e94(0x1e0)]);const _0x4896b0=Boolean(_0x136abd['cdpEndpoint']),_0x1fbddc=_0x5c15b1['JMMcX'](isInteractive);if(!_0x1fbddc&&!_0x136abd['url']&&!_0x4896b0&&!_0x136abd[_0x110e94(0x1d1)])throw new Error('Please\x20provide\x20--url\x20when\x20running\x20in\x20non-interactive\x20mode.\x0aMake\x20sure\x20the\x20service\x20is\x20running\x20on\x20that\x20port\x20before\x20retrying.\x0aExample:\x20ranger\x20profile\x20add\x20local\x20--url\x20http://localhost:3000');if(_0x4896b0){const _0x55ac34=_0x136abd[_0x110e94(0x1a2)];console[_0x110e94(0x1ca)](_0x5c15b1['gRaCL']),console['log']('\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20'+_0x55ac34);const _0x5bc38b={'cdpEndpoint':_0x55ac34,'isElectron':!![]};Object[_0x110e94(0x1de)](_0x133e36)['length']>0x0&&(_0x5bc38b['setupHeaders']=_0x133e36);await createUnconfiguredCloudProfile(_0x494a89,_0x5bc38b);try{_0x5c15b1[_0x110e94(0x1df)](setProfileOverride,process[_0x110e94(0x1cd)](),_0x494a89,_0x110e94(0x1a2),_0x55ac34),setProfileOverride(process[_0x110e94(0x1cd)](),_0x494a89,_0x5c15b1[_0x110e94(0x1b5)],!![]);}catch(_0x51c5b0){console['error'](_0x110e94(0x1c6)+(_0x5c15b1[_0x110e94(0x1f8)](_0x51c5b0,Error)?_0x51c5b0['message']:String(_0x51c5b0)));}console[_0x110e94(0x1ca)](_0x110e94(0x1f0)+_0x494a89+_0x110e94(0x210)),await _0x5c15b1[_0x110e94(0x1c2)](sweepOrphansBestEffort,_0x494a89),await _0x5c15b1['xpQhi'](markActive,_0x494a89);return;}if(_0x136abd[_0x110e94(0x1d1)]){const _0x46b8e2={};_0x136abd['url']&&(_0x46b8e2[_0x110e94(0x1e1)]=_0x136abd['url']);Object[_0x110e94(0x1de)](_0x133e36)['length']>0x0&&(_0x46b8e2[_0x110e94(0x1dd)]=_0x133e36);await _0x5c15b1[_0x110e94(0x1b9)](createUnconfiguredCloudProfile,_0x494a89,_0x46b8e2),console[_0x110e94(0x1ca)](_0x5c15b1['brSME'](_0x110e94(0x1c9)+_0x494a89+'\x27\x20created\x20(no\x20session).\x0a','\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20'+_0x494a89+'`\x20again\x20without\x20--skip-auth.')),await _0x5c15b1['crBwo'](sweepOrphansBestEffort,_0x494a89),await _0x5c15b1[_0x110e94(0x1cc)](markActive,_0x494a89);return;}if(_0x136abd[_0x110e94(0x1f3)]){const _0x22cabf=_0x136abd[_0x110e94(0x1f3)],_0x560326=await _0x5c15b1['crBwo'](checkUrlReachability,_0x22cabf);if(!_0x560326['ok']&&!_0x136abd[_0x110e94(0x1b4)])throw new Error(_0x110e94(0x1e9)+_0x22cabf+':\x20'+_0x560326['error']+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x560326['ok']&&_0x136abd['force']&&console[_0x110e94(0x1ca)](_0x110e94(0x204)+_0x22cabf+':\x20'+_0x560326['error']+'\x20(continuing\x20with\x20--force)');}else{console['log'](_0x5c15b1['JFlaN']),console['log'](_0x5c15b1['fLuTD']),console['log'](_0x5c15b1['smDeU']);let _0x73114b='',_0x4a576a=![];while(!![]){const _0x1bfe34=await _0x26ae9b['prompt']([{'type':_0x5c15b1[_0x110e94(0x1a8)],'name':_0x5c15b1['FuxTn'],'message':_0x4a576a?_0x110e94(0x1ea):_0x110e94(0x221),'default':_0x73114b||_0x5c15b1['afJVX']}]);_0x73114b=_0x1bfe34['baseUrl'];const _0x210eba=await checkUrlReachability(_0x73114b);if(_0x210eba['ok'])break;const _0x4cd602=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x73114b),_0x1975b7=_0x210eba[_0x110e94(0x1c5)]&&!_0x4cd602,_0x37ca3b=_0x1975b7?_0x110e94(0x1ad)+_0x73114b:null;_0x4a576a=!![],console['log'](_0x110e94(0x21d)+_0x73114b+':\x20'+_0x210eba['error']);_0x37ca3b&&console[_0x110e94(0x1ca)](_0x110e94(0x200)+_0x37ca3b+'?');const {action:_0xfbcfc7}=await _0x26ae9b['prompt']([{'type':_0x110e94(0x1c3),'name':_0x110e94(0x1a7),'message':_0x110e94(0x1fe),'choices':[..._0x37ca3b?[{'name':_0x110e94(0x1d4)+_0x37ca3b,'value':_0x110e94(0x1c0)}]:[],{'name':_0x110e94(0x1ac),'value':'retry'},{'name':_0x110e94(0x1a0),'value':'continue'}]}]);if(_0xfbcfc7===_0x110e94(0x1c0)&&_0x37ca3b){_0x73114b=_0x37ca3b;const _0xf5ce25=await checkUrlReachability(_0x73114b);if(_0xf5ce25['ok'])break;console[_0x110e94(0x1ca)](_0x110e94(0x215)+_0x73114b+':\x20'+_0xf5ce25['error']);}else{if(_0x5c15b1[_0x110e94(0x214)](_0xfbcfc7,'continue'))break;}}_0x136abd={..._0x136abd,'url':_0x73114b};}let _0x83b5c1=![];try{_0x83b5c1=await tryAutoRouteCloudProfile(_0x494a89,_0x136abd['url'],_0x136abd,_0x1fbddc,_0x4a6984);}catch(_0x11d269){console[_0x110e94(0x1b7)](_0x110e94(0x1a1)+_0x494a89+_0x110e94(0x227)+(_0x11d269 instanceof Error?_0x11d269['message']:String(_0x11d269))),process['exit'](0x1);}!_0x83b5c1&&process['exit'](0x1),await _0x5c15b1['FWuHX'](markActive,_0x494a89);}
1
+ (function(_0x2ef848,_0x54fb6f){const _0x471b32=_0x267c,_0xe20aef=_0x2ef848();while(!![]){try{const _0x3011ff=parseInt(_0x471b32(0x91))/0x1*(parseInt(_0x471b32(0xb4))/0x2)+parseInt(_0x471b32(0x70))/0x3+parseInt(_0x471b32(0xd5))/0x4+-parseInt(_0x471b32(0x9f))/0x5*(-parseInt(_0x471b32(0xcf))/0x6)+-parseInt(_0x471b32(0x80))/0x7*(parseInt(_0x471b32(0xd8))/0x8)+-parseInt(_0x471b32(0xda))/0x9*(parseInt(_0x471b32(0xd1))/0xa)+-parseInt(_0x471b32(0x74))/0xb;if(_0x3011ff===_0x54fb6f)break;else _0xe20aef['push'](_0xe20aef['shift']());}catch(_0xb18f83){_0xe20aef['push'](_0xe20aef['shift']());}}}(_0x5281,0x682e6));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x24f4bb from'inquirer';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{fetchAuthConfig,createCloudProfile,manualBrowserLogin,ApiError}from'./utils/cloudProfile.js';function _0x5281(){const _0x558397=['2186244SEqMuv','\x20\x20Set\x20active\x20profile:\x20','trackPhaseEnd','startsWith','11636174SKhXXw','IPCGF',')\x0a\x20\x20Save\x20\x27','FcbJu','prompt','environments','PLSFw','manual','env','NODE_TLS_REJECT_UNAUTHORIZED','isProtocolError','EtgsQ','7XDOdej','local','rrtVt','yNUOt','DJIJT','FebZR','leGeZ','cdpEndpoint','\x27\x20created\x20(no\x20session).\x0a','signal','✓\x20Cloud\x20profile\x20\x27','ThAph','skipAuth','cwd','GkbSP','origin','lTyxr','340528VxPYNB','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20','dKKXW','--skip-auth\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20--skip-auth\x20makes\x20an\x20env-less\x20profile,\x20--env\x20binds\x20one\x20to\x20an\x20auth\x20environment.','saveToCloud','Invalid\x20URL','BnaOk','`\x20again\x20without\x20--skip-auth.','user_declined','--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','sNCLw','profile.add.autoRouted','\x27\x20matching\x20','log','495ZrYSZg','--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','IyhUC','tQxRU','\x22\x20not\x20found.','error','abort','some','\x0a\x20\x20No\x20auth\x20env\x20matches\x20','no_auth_config','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','retry','\x0a\x20\x20Could\x20not\x20reach\x20','confirm','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','setupHeaders','DwQXL','\x0a\x20\x20Still\x20could\x20not\x20reach\x20','Cjuqh','\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20','trim','4ZPtpOx','test','sbSJB','gpZjm','fetch\x20failed','\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20','\x0a\x20\x20Auth\x20environment\x20\x22','Enter\x20a\x20different\x20URL','RUZSl','lxiIP','indexOf','LKBFZ','baseUrl','ZidiP','authEnv','To\x20set\x20up\x20a\x20profile,\x20run:\x0a','url','continue','keys','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','TRcGd','fDmvv','isTTY','join','PTKpa','\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','status','5190PurXHQ','uEnyk','42910dRtNff','setupHeader','iKkSR','length','1112972bQXvGZ','message','slice','2072680NIOsbh','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','63Vptwjh','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','TwMIb','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','dcaQO','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','\x0a\x20\x20(domains:\x20','Please\x20provide\x20--url\x20when\x20running\x20in\x20non-interactive\x20mode.\x0aMake\x20sure\x20the\x20service\x20is\x20running\x20on\x20that\x20port\x20before\x20retrying.\x0aExample:\x20ranger\x20profile\x20add\x20local\x20--url\x20http://localhost:3000','http://localhost:3000','aOlad','CLvRV','\x0a\x20\x20A\x20profile\x20named\x20\x22','\x20--url\x20','ssfPY','RFWSa'];_0x5281=function(){return _0x558397;};return _0x5281();}import{isInteractive}from'./utils/cloudProfileSession.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';import{setProfileOverride}from'./utils/projectsConfig.js';const CLOUD_PROFILE_SHARING_WARNING='This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization';function warnCloudProfileSharedInOrg(){const _0x1c9c49=_0x267c;if(!process['stdout'][_0x1c9c49(0xca)])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}function _0x267c(_0xa89593,_0x6351dd){_0xa89593=_0xa89593-0x6c;const _0x52815a=_0x5281();let _0x267c38=_0x52815a[_0xa89593];return _0x267c38;}async function checkUrlReachability(_0x646e9a){const _0x4ad29c=_0x267c,_0x537c59={'rrtVt':function(_0x2f6ade,_0x20e0a4){return _0x2f6ade<_0x20e0a4;},'IPCGF':_0x4ad29c(0xb8)};try{const _0x553027=new AbortController(),_0x651c18=setTimeout(()=>_0x553027[_0x4ad29c(0xa5)](),0x1388),_0x3c80e6={'method':'HEAD','signal':_0x553027[_0x4ad29c(0x89)],'redirect':_0x4ad29c(0x7b)};/^https:\/\/localhost(:\d+)?/i[_0x4ad29c(0xb5)](_0x646e9a)&&(process[_0x4ad29c(0x7c)]['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x32c54b=await fetch(_0x646e9a,_0x3c80e6);delete process[_0x4ad29c(0x7c)][_0x4ad29c(0x7d)],clearTimeout(_0x651c18);if(_0x537c59[_0x4ad29c(0x82)](_0x32c54b['status'],0x190))return{'ok':!![]};return{'ok':![],'error':'HTTP\x20'+_0x32c54b['status']};}catch(_0x265f0a){delete process[_0x4ad29c(0x7c)][_0x4ad29c(0x7d)];const _0x3187fb=_0x265f0a,_0x54883a=_0x3187fb[_0x4ad29c(0xd6)]||String(_0x265f0a),_0x3ca68c=_0x54883a['includes'](_0x4ad29c(0x96))||_0x3187fb['name']==='TypeError'||_0x54883a['includes'](_0x537c59[_0x4ad29c(0x75)]);return{'ok':![],'error':_0x54883a,'isProtocolError':_0x3ca68c};}}async function sweepOrphanLocalProfile(_0x1cff0d,_0x5e922e,_0x5509e5){const _0x3d8fbf=_0x267c,_0xcd841b={'TRcGd':function(_0x144716,_0x1c7fa7){return _0x144716(_0x1c7fa7);},'hoQwa':function(_0x30678a,_0xd7d1dc,_0x487e2a){return _0x30678a(_0xd7d1dc,_0x487e2a);},'ZMnwR':function(_0x3f241b,_0x252e3e){return _0x3f241b(_0x252e3e);}},_0x1e2f5d=join(_0x5e922e,_0x3d8fbf(0x81)),_0x747a7a=join(_0x1e2f5d,_0x1cff0d);existsSync(_0x747a7a)&&(_0x5509e5&&await _0xcd841b[_0x3d8fbf(0xc8)](isPathGitTracked,_0x747a7a)?console['log'](_0x3d8fbf(0xb9)+_0x747a7a+_0x3d8fbf(0xad)):(await _0xcd841b['hoQwa'](rm,_0x747a7a,{'recursive':!![],'force':!![]}),console[_0x3d8fbf(0x9e)]('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x747a7a)));if(_0xcd841b[_0x3d8fbf(0xc8)](existsSync,_0x1e2f5d)){let _0x5e8c89=[];try{_0x5e8c89=await _0xcd841b['ZMnwR'](readdir,_0x1e2f5d);}catch{return;}const _0xa9a26='.tmp-'+_0x1cff0d+'-';for(const _0x39386e of _0x5e8c89){if(!_0x39386e[_0x3d8fbf(0x73)](_0xa9a26))continue;const _0x55ce60=join(_0x1e2f5d,_0x39386e);await rm(_0x55ce60,{'recursive':!![],'force':!![]}),console[_0x3d8fbf(0x9e)](_0x3d8fbf(0xdd)+_0x55ce60);}}}async function sweepOrphansBestEffort(_0x36498e){const _0x20cb57=_0x267c,_0x1728cf={'iKkSR':function(_0xd665b4){return _0xd665b4();},'FebZR':function(_0x758a47,_0x20bac8){return _0x758a47!==_0x20bac8;},'GkbSP':function(_0x4922d2,_0x309667){return _0x4922d2(_0x309667);}};try{await sweepOrphanLocalProfile(_0x36498e,_0x1728cf[_0x20cb57(0xd3)](getRangerHomeDir),![]);const _0x400dc1=_0x1728cf['iKkSR'](getRangerDir);_0x1728cf[_0x20cb57(0x85)](_0x400dc1,getRangerHomeDir())&&await sweepOrphanLocalProfile(_0x36498e,_0x400dc1,!![]);}catch(_0x196681){console[_0x20cb57(0x9e)](_0x20cb57(0xa9)+(_0x196681 instanceof Error?_0x196681['message']:_0x1728cf[_0x20cb57(0x8e)](String,_0x196681))+').');}}async function markActive(_0x596afa){const _0x3b27e9=_0x267c,_0xee8b63={'IyhUC':'Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.'};try{await writeActiveProfileName(_0x596afa),console[_0x3b27e9(0x9e)](_0x3b27e9(0x71)+_0x596afa);}catch{console['log'](_0xee8b63[_0x3b27e9(0xa1)]);}}async function tryAutoRouteCloudProfile(_0x306edc,_0x5566e2,_0x122768,_0x4b1840,_0x5b1949){const _0x16846f=_0x267c,_0x1835bf={'lHMRA':function(_0x5b01fc,_0x34d259){return _0x5b01fc===_0x34d259;},'DJIJT':function(_0x248e04){return _0x248e04();},'lTyxr':function(_0x2c6406,_0x34880e){return _0x2c6406===_0x34880e;},'RUZSl':function(_0x4376ef,_0x548917,_0x1418e5,_0xe95c87,_0x381de4){return _0x4376ef(_0x548917,_0x1418e5,_0xe95c87,_0x381de4);},'sbSJB':'profile.add.autoRouteSkipped','fDmvv':_0x16846f(0xa8),'RJfrh':function(_0x57c7ca,_0x1fbac3){return _0x57c7ca+_0x1fbac3;},'wuyfd':function(_0x41d08f,_0x594d0b){return _0x41d08f+_0x594d0b;},'aOlad':'\x0a\x20\x20Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team\x20yet\x20—\x20that\x27s\x20the\x20path\x20that\x20lets\x20Ranger\x20log\x20into\x20your\x20app\x20for\x20you\x20in\x20CI\x20/\x20background\x20agents.\x0a','CIllq':'\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','LKBFZ':'env_not_found','ftBUL':function(_0x526e09,_0xfd47fe){return _0x526e09+_0xfd47fe;},'ThAph':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','vJAKy':'no_match','tQxRU':_0x16846f(0x95),'pPxbG':_0x16846f(0x99),'gSvka':'\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','drGzf':function(_0x2cbc5d,_0x589d6d,_0x3dba45,_0x18ac4a){return _0x2cbc5d(_0x589d6d,_0x3dba45,_0x18ac4a);}};let _0x44a1c9;try{_0x44a1c9=await _0x1835bf[_0x16846f(0x84)](fetchAuthConfig);}catch(_0xa959e7){return _0x5b1949?.[_0x16846f(0x72)]('profile.add.autoRouteSkipped',{'reason':_0x16846f(0xa8),'profileName':_0x306edc}),console['error'](_0x16846f(0xb2)+(_0xa959e7 instanceof Error?_0xa959e7['message']:String(_0xa959e7))),![];}if((!_0x44a1c9||!_0x44a1c9['environments']||_0x1835bf[_0x16846f(0x90)](Object[_0x16846f(0xc6)](_0x44a1c9[_0x16846f(0x79)])[_0x16846f(0xd4)],0x0))&&!_0x122768['authEnv']){if(_0x4b1840)return await _0x1835bf[_0x16846f(0xbc)](captureEnvLessProfile,_0x306edc,_0x5566e2,_0x122768,_0x5b1949);return _0x5b1949?.['trackPhaseEnd'](_0x1835bf['sbSJB'],{'reason':_0x1835bf[_0x16846f(0xc9)],'profileName':_0x306edc}),console[_0x16846f(0xa4)](_0x1835bf['RJfrh'](_0x1835bf['wuyfd'](_0x1835bf['wuyfd'](_0x1835bf['wuyfd'](_0x1835bf['wuyfd'](_0x1835bf[_0x16846f(0xe4)]+'\x0a','\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a'),'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x306edc+_0x16846f(0x6d)+_0x5566e2+'\x20--skip-auth\x0a'),'\x0a'),'\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a'),_0x1835bf['CIllq'])),![];}let _0xb2b843;if(_0x122768[_0x16846f(0xc2)]){if(!_0x44a1c9?.[_0x16846f(0x79)]?.[_0x122768['authEnv']]){const _0x242984=Object['keys'](_0x44a1c9?.[_0x16846f(0x79)]??{});return _0x5b1949?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':_0x1835bf[_0x16846f(0xbf)],'profileName':_0x306edc}),console[_0x16846f(0xa4)](_0x1835bf['ftBUL'](_0x16846f(0xba)+_0x122768[_0x16846f(0xc2)]+_0x16846f(0xa3),_0x242984[_0x16846f(0xd4)]?'\x20Configured\x20envs:\x20'+_0x242984[_0x16846f(0xcb)](',\x20')+'.':_0x1835bf[_0x16846f(0x8b)])),![];}_0xb2b843=_0x122768[_0x16846f(0xc2)];}else _0xb2b843=matchAuthEnvironment(_0x5566e2,_0x44a1c9);if(!_0xb2b843)return _0x5b1949?.['trackPhaseEnd'](_0x1835bf[_0x16846f(0xb6)],{'reason':_0x1835bf['vJAKy'],'profileName':_0x306edc}),console[_0x16846f(0xa4)](_0x16846f(0xa7)+_0x5566e2+_0x16846f(0x92)+Object['keys'](_0x44a1c9?.[_0x16846f(0x79)]??{})[_0x16846f(0xcb)](',\x20')+'.'),![];const _0x53d77a=_0x44a1c9?.['environments']?.[_0xb2b843],_0x21803a=_0x53d77a?.['domains']??[];if(_0x4b1840&&!_0x122768['yes']){const {saveToCloud:_0x4e365f}=await _0x24f4bb['prompt']([{'type':'confirm','name':_0x1835bf[_0x16846f(0xa2)],'message':'Found\x20auth\x20environment\x20\x27'+_0xb2b843+_0x16846f(0x9d)+_0x5566e2+_0x16846f(0xe1)+_0x21803a[_0x16846f(0xcb)](',\x20')+_0x16846f(0x76)+_0x306edc+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0x4e365f)return _0x5b1949?.[_0x16846f(0x72)](_0x1835bf['sbSJB'],{'reason':_0x1835bf['pPxbG'],'profileName':_0x306edc}),console[_0x16846f(0xa4)](_0x1835bf['gSvka']),![];}const _0x5e47d0=_0x21803a[_0x16846f(0xa6)](_0x391f42=>{const _0xdfb877=_0x16846f;try{return _0x1835bf['lHMRA'](new URL(_0x391f42)['origin'],new URL(_0x5566e2)[_0xdfb877(0x8f)]);}catch{return![];}}),_0xc50694={};!_0x5e47d0&&(_0xc50694[_0x16846f(0xc0)]=_0x5566e2);try{await _0x1835bf['drGzf'](createCloudProfile,_0x306edc,_0xb2b843,{'settings':_0xc50694}),warnCloudProfileSharedInOrg();}catch(_0x26fa62){if(_0x26fa62 instanceof ApiError&&_0x1835bf[_0x16846f(0x90)](_0x26fa62[_0x16846f(0xce)],0x199)){console[_0x16846f(0xa4)](_0x16846f(0x6c)+_0x306edc+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a'+(_0x16846f(0xc7)+_0x306edc));throw _0x26fa62;}throw _0x26fa62;}return console['log'](_0x1835bf['wuyfd']('✓\x20Profile\x20\x27'+_0x306edc+'\x27\x20created.\x0a','\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x306edc)),await sweepOrphansBestEffort(_0x306edc),_0x5b1949?.['trackPhaseEnd']('profile.add.autoRouted',{'envKey':_0xb2b843,'profileName':_0x306edc}),!![];}async function createUnconfiguredCloudProfile(_0x5e4a66,_0x1c3580){const _0x221abb=_0x267c,_0x25e9e0={'lxiIP':function(_0x15a2af){return _0x15a2af();},'FJJyK':function(_0x1a06b8,_0x47fde3){return _0x1a06b8 instanceof _0x47fde3;},'leGeZ':function(_0x1bd6d0,_0x4f52fa){return _0x1bd6d0===_0x4f52fa;}};try{await createCloudProfile(_0x5e4a66,undefined,{'settings':_0x1c3580}),_0x25e9e0[_0x221abb(0xbd)](warnCloudProfileSharedInOrg);}catch(_0x5e086f){_0x25e9e0['FJJyK'](_0x5e086f,ApiError)&&_0x25e9e0[_0x221abb(0x86)](_0x5e086f[_0x221abb(0xce)],0x199)&&console[_0x221abb(0xa4)](_0x221abb(0x6c)+_0x5e4a66+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a'+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x5e4a66));throw _0x5e086f;}}async function captureEnvLessProfile(_0xe380d2,_0x4d2462,_0x426ab5,_0x11c6b1){const _0x19909c=_0x267c,_0x2600b8={'jxiXI':_0x19909c(0xac),'kTZeT':'capture','gJeYw':'Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','sNCLw':'profile.add.autoRouteSkipped','bfnJE':'user_declined','gpZjm':function(_0x35902b,_0x5aadae){return _0x35902b===_0x5aadae;},'BnaOk':function(_0x503801,_0x276576){return _0x503801>_0x276576;},'jyhWm':function(_0x116dcf,_0x2ee2ce,_0xac9499,_0x389011){return _0x116dcf(_0x2ee2ce,_0xac9499,_0x389011);},'TwMIb':function(_0x480173){return _0x480173();},'FGKPr':function(_0x145131,_0x49b2a1){return _0x145131 instanceof _0x49b2a1;},'uEnyk':function(_0x4d4c4c,_0x36e872){return _0x4d4c4c===_0x36e872;},'dKKXW':function(_0x166df9,_0xd87f77){return _0x166df9+_0xd87f77;},'Htcwm':function(_0x264d31,_0x2c9652,_0xe1427a){return _0x264d31(_0x2c9652,_0xe1427a);}};if(!_0x426ab5['yes']){const {capture:_0x34d0ce}=await _0x24f4bb[_0x19909c(0x78)]([{'type':_0x2600b8['jxiXI'],'name':_0x2600b8['kTZeT'],'message':_0x2600b8['gJeYw'],'default':!![]}]);if(!_0x34d0ce)return _0x11c6b1?.[_0x19909c(0x72)](_0x2600b8[_0x19909c(0x9b)],{'reason':_0x2600b8['bfnJE'],'profileName':_0xe380d2}),console['error']('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a'+'\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.'),![];}const _0x21cdfa={};if(_0x426ab5['setupHeader'])for(const _0xb9b766 of _0x426ab5['setupHeader']){const _0x34f1bd=_0xb9b766['indexOf'](':');if(_0x2600b8[_0x19909c(0xb7)](_0x34f1bd,-0x1))continue;_0x21cdfa[_0xb9b766[_0x19909c(0xd7)](0x0,_0x34f1bd)['trim']()]=_0xb9b766['slice'](_0x34f1bd+0x1)[_0x19909c(0xb3)]();}const _0x2cd38f={'baseUrl':_0x4d2462};_0x2600b8[_0x19909c(0x97)](Object['keys'](_0x21cdfa)['length'],0x0)&&(_0x2cd38f['setupHeaders']=_0x21cdfa);let _0x397df8;try{_0x397df8=await _0x2600b8['jyhWm'](createCloudProfile,_0xe380d2,undefined,{'settings':_0x2cd38f}),_0x2600b8[_0x19909c(0xdc)](warnCloudProfileSharedInOrg);}catch(_0x1e76c9){_0x2600b8['FGKPr'](_0x1e76c9,ApiError)&&_0x2600b8[_0x19909c(0xd0)](_0x1e76c9[_0x19909c(0xce)],0x199)&&console[_0x19909c(0xa4)](_0x2600b8[_0x19909c(0x93)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0xe380d2+_0x19909c(0xdb),_0x19909c(0xc7)+_0xe380d2));throw _0x1e76c9;}return await _0x2600b8['Htcwm'](manualBrowserLogin,_0x397df8,{'key':'','domains':[_0x4d2462],'setupHeaders':_0x2600b8['BnaOk'](Object[_0x19909c(0xc6)](_0x21cdfa)['length'],0x0)?_0x21cdfa:undefined}),console['log'](_0x2600b8[_0x19909c(0x93)]('\x0a✓\x20Profile\x20\x27'+_0xe380d2+'\x27\x20created\x20with\x20a\x20captured\x20session.\x0a','\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0xe380d2)),await sweepOrphansBestEffort(_0xe380d2),_0x11c6b1?.[_0x19909c(0x72)](_0x19909c(0x9c),{'envKey':null,'profileName':_0xe380d2}),!![];}export async function addEnv(_0x4d7bb5,_0x31de7a={},_0x17a994){const _0x595080=_0x267c,_0x505d6b={'PTKpa':function(_0x4c0edc,_0x4c7585){return _0x4c0edc+_0x4c7585;},'CLvRV':function(_0x4579dd,_0x4be16c){return _0x4579dd+_0x4be16c;},'DwQXL':function(_0x4373a7,_0x2d1cbb){return _0x4373a7+_0x2d1cbb;},'ssfPY':function(_0x4d3110,_0x3aefc0){return _0x4d3110+_0x3aefc0;},'XUeDz':'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','ONtkx':function(_0x3befd7,_0x3088d1){return _0x3befd7===_0x3088d1;},'XiNbU':'--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','dKKcP':_0x595080(0xa0),'FcbJu':_0x595080(0x94),'IzGCi':function(_0x286717,_0x23905f){return _0x286717(_0x23905f);},'kzYBk':function(_0x58be00){return _0x58be00();},'yNUOt':_0x595080(0xe2),'KWQMs':function(_0x60a33e,_0x44339f,_0x308178){return _0x60a33e(_0x44339f,_0x308178);},'PLSFw':'cdpEndpoint','xseXN':function(_0x3d2d12,_0x39fdb9){return _0x3d2d12 instanceof _0x39fdb9;},'csCpr':function(_0x430af0,_0x1771e0){return _0x430af0(_0x1771e0);},'fIQAz':'\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','xWzUR':'input','EtgsQ':'What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','dcaQO':function(_0x40e837,_0x4d2325){return _0x40e837||_0x4d2325;},'QPgvT':_0x595080(0xe3),'yZUXS':'action','Cjuqh':'use_suggestion','ZidiP':_0x595080(0xbb),'RFWSa':function(_0x235218,_0x1ff1ef){return _0x235218 instanceof _0x1ff1ef;},'oZDoI':function(_0x460ff9,_0x2b3dda){return _0x460ff9(_0x2b3dda);},'WxuGx':function(_0x1dc98f,_0x440cbd){return _0x1dc98f(_0x440cbd);}};_0x31de7a['ci']&&(console[_0x595080(0xa4)](_0x505d6b[_0x595080(0xcc)](_0x505d6b['PTKpa'](_0x505d6b[_0x595080(0xe5)](_0x505d6b[_0x595080(0xaf)](_0x505d6b[_0x595080(0x6e)]('The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a',_0x505d6b['XUeDz']),'\x0a'),_0x595080(0xc3))+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','\x0a')+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','\x20\x20https://docs.ranger.net/main/concepts/profiles')),process['exit'](0x1));const _0x545dd0={};if(_0x31de7a['setupHeader'])for(const _0x5dd7ab of _0x31de7a[_0x595080(0xd2)]){const _0x3e1b0d=_0x5dd7ab[_0x595080(0xbe)](':');if(_0x3e1b0d===-0x1)throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x5dd7ab+_0x595080(0xe0));const _0x4cbf56=_0x5dd7ab[_0x595080(0xd7)](0x0,_0x3e1b0d)[_0x595080(0xb3)](),_0xcc49fd=_0x5dd7ab['slice'](_0x505d6b[_0x595080(0xe5)](_0x3e1b0d,0x1))[_0x595080(0xb3)]();_0x545dd0[_0x4cbf56]=_0xcc49fd;}if(_0x31de7a[_0x595080(0x87)]!==undefined&&_0x505d6b['ONtkx'](_0x31de7a['cdpEndpoint'][_0x595080(0xb3)](),''))throw new Error(_0x505d6b['XiNbU']);if(_0x31de7a[_0x595080(0x87)]&&_0x31de7a[_0x595080(0xc4)])throw new Error(_0x505d6b['dKKcP']);if(_0x31de7a[_0x595080(0xc2)]&&_0x31de7a[_0x595080(0x8c)])throw new Error(_0x505d6b[_0x595080(0x77)]);if(_0x31de7a['authEnv']&&_0x31de7a[_0x595080(0x87)])throw new Error(_0x595080(0x9a));const _0x3cf622=_0x505d6b['IzGCi'](Boolean,_0x31de7a[_0x595080(0x87)]),_0x4e88a1=_0x505d6b['kzYBk'](isInteractive);if(!_0x4e88a1&&!_0x31de7a['url']&&!_0x3cf622&&!_0x31de7a['skipAuth'])throw new Error(_0x505d6b[_0x595080(0x83)]);if(_0x3cf622){const _0x5868b4=_0x31de7a[_0x595080(0x87)];console[_0x595080(0x9e)]('\x0a🔌\x20CDP\x20Profile\x20Setup\x0a'),console[_0x595080(0x9e)](_0x595080(0xdf)+_0x5868b4);const _0x111739={'cdpEndpoint':_0x5868b4,'isElectron':!![]};Object[_0x595080(0xc6)](_0x545dd0)['length']>0x0&&(_0x111739['setupHeaders']=_0x545dd0);await _0x505d6b['KWQMs'](createUnconfiguredCloudProfile,_0x4d7bb5,_0x111739);try{setProfileOverride(process[_0x595080(0x8d)](),_0x4d7bb5,_0x505d6b[_0x595080(0x7a)],_0x5868b4),setProfileOverride(process[_0x595080(0x8d)](),_0x4d7bb5,'isElectron',!![]);}catch(_0x33d087){console['error']('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x505d6b['xseXN'](_0x33d087,Error)?_0x33d087['message']:String(_0x33d087)));}console[_0x595080(0x9e)](_0x595080(0x8a)+_0x4d7bb5+'\x27\x20created\x20(CDP).'),await _0x505d6b['csCpr'](sweepOrphansBestEffort,_0x4d7bb5),await markActive(_0x4d7bb5);return;}if(_0x31de7a['skipAuth']){const _0x2279f7={};_0x31de7a[_0x595080(0xc4)]&&(_0x2279f7['baseUrl']=_0x31de7a[_0x595080(0xc4)]);Object['keys'](_0x545dd0)[_0x595080(0xd4)]>0x0&&(_0x2279f7[_0x595080(0xae)]=_0x545dd0);await createUnconfiguredCloudProfile(_0x4d7bb5,_0x2279f7),console['log']('✓\x20Profile\x20\x27'+_0x4d7bb5+_0x595080(0x88)+('\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20'+_0x4d7bb5+_0x595080(0x98))),await _0x505d6b['csCpr'](sweepOrphansBestEffort,_0x4d7bb5),await markActive(_0x4d7bb5);return;}if(_0x31de7a[_0x595080(0xc4)]){const _0xf475c9=_0x31de7a[_0x595080(0xc4)],_0x5005b1=await checkUrlReachability(_0xf475c9);if(!_0x5005b1['ok']&&!_0x31de7a['force'])throw new Error('Could\x20not\x20reach\x20'+_0xf475c9+':\x20'+_0x5005b1[_0x595080(0xa4)]+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x5005b1['ok']&&_0x31de7a['force']&&console[_0x595080(0x9e)]('⚠\x20Could\x20not\x20reach\x20'+_0xf475c9+':\x20'+_0x5005b1['error']+'\x20(continuing\x20with\x20--force)');}else{console[_0x595080(0x9e)]('\x0a🌐\x20Profile\x20Setup\x0a'),console['log'](_0x505d6b['fIQAz']),console['log'](_0x595080(0xcd));let _0x2f0baa='',_0x460593=![];while(!![]){const _0x3e8b3b=await _0x24f4bb['prompt']([{'type':_0x505d6b['xWzUR'],'name':_0x595080(0xc0),'message':_0x460593?_0x595080(0xd9):_0x505d6b[_0x595080(0x7f)],'default':_0x505d6b[_0x595080(0xde)](_0x2f0baa,_0x505d6b['QPgvT'])}]);_0x2f0baa=_0x3e8b3b['baseUrl'];const _0x4b6205=await checkUrlReachability(_0x2f0baa);if(_0x4b6205['ok'])break;const _0x19b335=/^[a-zA-Z][\w+.-]*:\/\//[_0x595080(0xb5)](_0x2f0baa),_0x288988=_0x4b6205[_0x595080(0x7e)]&&!_0x19b335,_0x335e99=_0x288988?'http://'+_0x2f0baa:null;_0x460593=!![],console[_0x595080(0x9e)](_0x595080(0xab)+_0x2f0baa+':\x20'+_0x4b6205['error']);_0x335e99&&console['log']('\x20\x20Did\x20you\x20mean\x20'+_0x335e99+'?');const {action:_0x50b89a}=await _0x24f4bb['prompt']([{'type':'list','name':_0x505d6b['yZUXS'],'message':'What\x20would\x20you\x20like\x20to\x20do?','choices':[..._0x335e99?[{'name':'Use\x20'+_0x335e99,'value':_0x505d6b[_0x595080(0xb1)]}]:[],{'name':_0x505d6b[_0x595080(0xc1)],'value':_0x595080(0xaa)},{'name':'Continue\x20anyway','value':'continue'}]}]);if(_0x50b89a==='use_suggestion'&&_0x335e99){_0x2f0baa=_0x335e99;const _0x1b01d7=await checkUrlReachability(_0x2f0baa);if(_0x1b01d7['ok'])break;console['log'](_0x595080(0xb0)+_0x2f0baa+':\x20'+_0x1b01d7['error']);}else{if(_0x50b89a===_0x595080(0xc5))break;}}_0x31de7a={..._0x31de7a,'url':_0x2f0baa};}let _0x5a587e=![];try{_0x5a587e=await tryAutoRouteCloudProfile(_0x4d7bb5,_0x31de7a['url'],_0x31de7a,_0x4e88a1,_0x17a994);}catch(_0x71e8bb){console[_0x595080(0xa4)]('\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22'+_0x4d7bb5+'\x22:\x20'+(_0x505d6b[_0x595080(0x6f)](_0x71e8bb,Error)?_0x71e8bb['message']:_0x505d6b['oZDoI'](String,_0x71e8bb))),process['exit'](0x1);}!_0x5a587e&&process['exit'](0x1),await _0x505d6b['WxuGx'](markActive,_0x4d7bb5);}
@@ -1 +1 @@
1
- function _0x5de6(_0x47d50e,_0x3f122a){_0x47d50e=_0x47d50e-0x136;var _0x3a4273=_0x3a42();var _0x5de601=_0x3a4273[_0x47d50e];return _0x5de601;}(function(_0x1d940a,_0x3ffe4d){var _0x12dbd4=_0x5de6,_0x4a7e93=_0x1d940a();while(!![]){try{var _0x3fd4e5=-parseInt(_0x12dbd4(0x146))/0x1*(parseInt(_0x12dbd4(0x143))/0x2)+parseInt(_0x12dbd4(0x137))/0x3+-parseInt(_0x12dbd4(0x13a))/0x4+parseInt(_0x12dbd4(0x13d))/0x5+parseInt(_0x12dbd4(0x140))/0x6+-parseInt(_0x12dbd4(0x145))/0x7*(-parseInt(_0x12dbd4(0x138))/0x8)+parseInt(_0x12dbd4(0x13c))/0x9*(-parseInt(_0x12dbd4(0x141))/0xa);if(_0x3fd4e5===_0x3ffe4d)break;else _0x4a7e93['push'](_0x4a7e93['shift']());}catch(_0x2d83ff){_0x4a7e93['push'](_0x4a7e93['shift']());}}}(_0x3a42,0xc68ec));function _0x3a42(){var _0x370646=['9JWXmBr','45810WBMdXv','error','Hlnyh','5461980RBtnHk','14148560OEvGPR','ranger\x20profile\x20encrypt-auth\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x0a','6INMOTU','session\x20state\x20for\x20you,\x20so\x20encrypted\x20on-disk\x20auth\x20is\x20unnecessary.\x0a','21oHIBEW','112089fVEEeo','WBgUq','918120mbNWDn','3818624HDEEER','RMbvD','372404OdUlvw','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a'];_0x3a42=function(){return _0x370646;};return _0x3a42();}export async function authEncrypt(_0x1a702c){var _0x52b0ae=_0x5de6,_0x4c3618={'RMbvD':function(_0x10f568,_0x5a0a43){return _0x10f568+_0x5a0a43;},'Hlnyh':function(_0x4801ec,_0x15446e){return _0x4801ec+_0x15446e;},'DXurq':_0x52b0ae(0x142),'WBgUq':_0x52b0ae(0x144),'nZQVs':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'};console[_0x52b0ae(0x13e)](_0x4c3618['RMbvD'](_0x4c3618['RMbvD'](_0x4c3618[_0x52b0ae(0x13f)](_0x4c3618[_0x52b0ae(0x139)](_0x4c3618['DXurq']+_0x4c3618[_0x52b0ae(0x136)],'\x0a')+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a',_0x4c3618['nZQVs'])+'\x0a',_0x52b0ae(0x13b)),'\x20\x20https://docs.ranger.net/main/concepts/profiles')),process['exit'](0x1);}
1
+ (function(_0x59f039,_0x45d086){var _0x13521c=_0xa604,_0x380798=_0x59f039();while(!![]){try{var _0x1bcaa3=-parseInt(_0x13521c(0x1b0))/0x1*(-parseInt(_0x13521c(0x1ac))/0x2)+parseInt(_0x13521c(0x1b1))/0x3*(-parseInt(_0x13521c(0x1b3))/0x4)+parseInt(_0x13521c(0x1b5))/0x5+-parseInt(_0x13521c(0x1ae))/0x6+parseInt(_0x13521c(0x1b4))/0x7+parseInt(_0x13521c(0x1b2))/0x8+-parseInt(_0x13521c(0x1af))/0x9*(parseInt(_0x13521c(0x1a4))/0xa);if(_0x1bcaa3===_0x45d086)break;else _0x380798['push'](_0x380798['shift']());}catch(_0x58263a){_0x380798['push'](_0x380798['shift']());}}}(_0x4f4d,0x9673e));function _0xa604(_0x260e05,_0x368835){_0x260e05=_0x260e05-0x1a3;var _0x4f4d69=_0x4f4d();var _0xa60449=_0x4f4d69[_0x260e05];return _0xa60449;}function _0x4f4d(){var _0x175bd0=['2161110ALhHOj','3786552sZrWTz','120233YARYwI','180678NqhbAD','156024tvKZtf','40HGQGpo','4813648cNzBNZ','2854310PQUhol','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','10NrRwdS','\x20\x20https://docs.ranger.net/main/concepts/profiles','DkXVm','RQxER','error','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','JnXcS','Ripxm','12PNVeol','ujZGV'];_0x4f4d=function(){return _0x175bd0;};return _0x4f4d();}export async function authEncrypt(_0x4623d5){var _0xf32764=_0xa604,_0xc8d963={'DkXVm':function(_0x18d7b4,_0x1a5c83){return _0x18d7b4+_0x1a5c83;},'RQxER':function(_0x211a23,_0x5c7d15){return _0x211a23+_0x5c7d15;},'bONPx':'session\x20state\x20for\x20you,\x20so\x20encrypted\x20on-disk\x20auth\x20is\x20unnecessary.\x0a','Ripxm':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','JnXcS':_0xf32764(0x1a9),'ujZGV':_0xf32764(0x1a5)};console[_0xf32764(0x1a8)](_0xc8d963['DkXVm'](_0xc8d963[_0xf32764(0x1a6)](_0xc8d963[_0xf32764(0x1a7)](_0xc8d963[_0xf32764(0x1a7)]('ranger\x20profile\x20encrypt-auth\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x0a'+_0xc8d963['bONPx'],'\x0a')+_0xc8d963[_0xf32764(0x1ab)],_0xc8d963[_0xf32764(0x1aa)]),'\x0a')+_0xf32764(0x1a3),_0xc8d963[_0xf32764(0x1ad)])),process['exit'](0x1);}
@@ -1 +1 @@
1
- const _0x57064a=_0x29f6;(function(_0x46f893,_0x219195){const _0x42f666=_0x29f6,_0x1dcd56=_0x46f893();while(!![]){try{const _0x3712d0=parseInt(_0x42f666(0xf0))/0x1+-parseInt(_0x42f666(0x109))/0x2+-parseInt(_0x42f666(0xe9))/0x3+parseInt(_0x42f666(0x10a))/0x4+-parseInt(_0x42f666(0xfe))/0x5*(-parseInt(_0x42f666(0x10c))/0x6)+parseInt(_0x42f666(0xf4))/0x7*(parseInt(_0x42f666(0xff))/0x8)+parseInt(_0x42f666(0xe2))/0x9*(parseInt(_0x42f666(0xfa))/0xa);if(_0x3712d0===_0x219195)break;else _0x1dcd56['push'](_0x1dcd56['shift']());}catch(_0x1b7090){_0x1dcd56['push'](_0x1dcd56['shift']());}}}(_0x24f3,0xac799));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{spawn}from'child_process';import{deleteAllCredentials}from'./utils/keychain.js';import{getProjectRoot,getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getCacheFile}from'./utils/sessionCache.js';import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=[_0x57064a(0x10b),'feature-tracker',_0x57064a(0x115),'e2e-test-recommender'],opencodePluginName='@ranger-testing/opencode-plugin';function _0x24f3(){const _0x23175f=['ranger','3906678ntEXZZ','CwzqP','SglAO','ignore','mYcoK','jDQAM','YLQrx','\x0a✅\x20Cleanup\x20complete!\x0a','close','bug-bash','qHjyC','log','length','4521843VxVntU','uninstall','push','replace','KWMEv','--scope','Reupg','1872315hApKPR','RzDgV','parse','✓\x20Removed\x20trailhead\x20marketplace','✓\x20Removed\x20.ranger/\x20directory','\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','COsrv','377987SciffV','✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','user','isArray','5062715LrFphq','project','vldqN','GLBEC','JicXC','JIfcp','10vCcafA','wmMEn','oJsdx','NXLZZ','5msiauF','8cHaDaN','opencode.json','✓\x20Removed\x20user\x20skill:\x20','sTxwJ','✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','utf-8','ranger@trailhead','plugin','claude','cTqzp','2462396xDErZC','1227952jIXtnG'];_0x24f3=function(){return _0x23175f;};return _0x24f3();}function parseJsonc(_0x140c5f){const _0x526ef6=_0x57064a,_0x1f087d=_0x140c5f['replace'](/\/\*[\s\S]*?\*\//g,''),_0x57f688=_0x1f087d['replace'](/^\s*\/\/.*$/gm,''),_0x38cbdd=_0x57f688[_0x526ef6(0xe5)](/,\s*([}\]])/g,'$1');return JSON[_0x526ef6(0xeb)](_0x38cbdd);}async function removeOpencodePluginConfig(_0x5b6ee5){const _0x6c6d31=_0x57064a,_0x4e7928={'LLAIc':function(_0x113027,_0x50eeb1){return _0x113027!==_0x50eeb1;},'EFovU':function(_0x1e21c0,_0x5a941c){return _0x1e21c0!==_0x5a941c;},'CfKxo':function(_0xe3bb82,_0x1be99d,_0x5f0b2c){return _0xe3bb82(_0x1be99d,_0x5f0b2c);},'rVIXJ':_0x6c6d31(0x104),'JIfcp':function(_0x2503f0,_0x3561dd){return _0x2503f0===_0x3561dd;},'hcHDn':function(_0x10fd85,_0x4e764d){return _0x10fd85===_0x4e764d;},'mYcoK':function(_0x3d46b2,_0x555de5,_0xae46){return _0x3d46b2(_0x555de5,_0xae46);}};if(!existsSync(_0x5b6ee5))return![];let _0x435f8b;try{const _0x1d9ee1=await _0x4e7928['CfKxo'](readFile,_0x5b6ee5,_0x4e7928['rVIXJ']);_0x435f8b=parseJsonc(_0x1d9ee1);}catch{return![];}const _0xd59ccc=Array[_0x6c6d31(0xf3)](_0x435f8b['plugin'])?_0x435f8b['plugin']:[];if(_0x4e7928['JIfcp'](_0xd59ccc['length'],0x0))return![];const _0x337eed=_0xd59ccc['filter'](_0x148f22=>{if(_0x4e7928['LLAIc'](typeof _0x148f22,'string'))return!![];return _0x4e7928['EFovU'](_0x148f22,opencodePluginName);});if(_0x4e7928['hcHDn'](_0x337eed[_0x6c6d31(0x118)],_0xd59ccc['length']))return![];return _0x4e7928[_0x6c6d31(0xf9)](_0x337eed[_0x6c6d31(0x118)],0x0)?delete _0x435f8b['plugin']:_0x435f8b['plugin']=_0x337eed,await _0x4e7928[_0x6c6d31(0x110)](writeFile,_0x5b6ee5,JSON['stringify'](_0x435f8b,null,0x2)+'\x0a'),!![];}async function uninstallClaudePlugin(_0x3aae85){const _0x1dda16=_0x57064a,_0x46213d={'KWMEv':_0x1dda16(0xe3),'oJsdx':_0x1dda16(0x105),'dzaNJ':_0x1dda16(0xe7),'qHjyC':_0x1dda16(0x10f)};return new Promise(_0x26aae4=>{const _0x5e64a8=_0x1dda16,_0x28fc33={'pFMOr':function(_0x2eeafd,_0x5dfa92){return _0x2eeafd===_0x5dfa92;}},_0x2ec2ba=[_0x5e64a8(0x106),_0x46213d[_0x5e64a8(0xe6)],_0x46213d[_0x5e64a8(0xfc)]];_0x3aae85&&_0x2ec2ba[_0x5e64a8(0xe4)](_0x46213d['dzaNJ'],_0x3aae85);const _0x31877d=spawn(_0x5e64a8(0x107),_0x2ec2ba,{'stdio':[_0x46213d[_0x5e64a8(0x116)],_0x46213d['qHjyC'],'ignore'],'cwd':_0x3aae85?getProjectRoot():undefined,'shell':process['platform']==='win32'});_0x31877d['on'](_0x5e64a8(0x114),_0x30a8cb=>{_0x26aae4(_0x28fc33['pFMOr'](_0x30a8cb,0x0));}),_0x31877d['on']('error',()=>{_0x26aae4(![]);});});}function _0x29f6(_0x36823a,_0x22ce5b){_0x36823a=_0x36823a-0xe2;const _0x24f3a3=_0x24f3();let _0x29f6c2=_0x24f3a3[_0x36823a];return _0x29f6c2;}async function removeMarketplace(){const _0x51c276=_0x57064a,_0x11c9c2={'qmWQb':function(_0x43dcce,_0x16b889,_0x56ee9b,_0x5e3b40){return _0x43dcce(_0x16b889,_0x56ee9b,_0x5e3b40);},'jDQAM':'claude','CwzqP':_0x51c276(0x106),'rQjcR':'marketplace','COsrv':'trailhead','yjHaP':_0x51c276(0x10f),'wmMEn':'close','SglAO':'error'};return new Promise(_0xecac28=>{const _0x212b9e=_0x51c276,_0x19e0be=_0x11c9c2['qmWQb'](spawn,_0x11c9c2[_0x212b9e(0x111)],[_0x11c9c2[_0x212b9e(0x10d)],_0x11c9c2['rQjcR'],'remove',_0x11c9c2[_0x212b9e(0xef)]],{'stdio':[_0x212b9e(0x10f),'ignore',_0x11c9c2['yjHaP']],'shell':process['platform']==='win32'});_0x19e0be['on'](_0x11c9c2[_0x212b9e(0xfb)],_0xf8018b=>{_0xecac28(_0xf8018b===0x0);}),_0x19e0be['on'](_0x11c9c2[_0x212b9e(0x10e)],()=>{_0xecac28(![]);});});}export async function clean(){const _0x428e50=_0x57064a,_0x4e616e={'JicXC':'✓\x20Removed\x20stored\x20credentials','vldqN':function(_0x495a1b,_0x3bb16b){return _0x495a1b(_0x3bb16b);},'YLQrx':function(_0x229e37){return _0x229e37();},'KJTmx':_0x428e50(0xed),'GLBEC':function(_0xc3d35d,_0x353c6c,_0x5cda74){return _0xc3d35d(_0x353c6c,_0x5cda74);},'NXLZZ':function(_0x13f984,_0x564e0e,_0xd5ee2b){return _0x13f984(_0x564e0e,_0xd5ee2b);},'AwdXg':function(_0x5d363c,_0x4d8fb0){return _0x5d363c(_0x4d8fb0);},'cTqzp':_0x428e50(0xf5),'sTxwJ':'✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)','RzDgV':_0x428e50(0xf1),'VPPlc':'✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','Reupg':_0x428e50(0xec)};console[_0x428e50(0x117)](_0x428e50(0xee));let _0x3afe90=![];try{await deleteAllCredentials(),console[_0x428e50(0x117)](_0x4e616e[_0x428e50(0xf8)]),_0x3afe90=!![];}catch{}const _0x174cd8=getCacheFile();_0x4e616e[_0x428e50(0xf6)](existsSync,_0x174cd8)&&(await rm(_0x174cd8),_0x3afe90=!![]);const _0x14948a=_0x4e616e['YLQrx'](getRangerDir);existsSync(_0x14948a)&&(await rm(_0x14948a,{'recursive':!![]}),console['log'](_0x4e616e['KJTmx']),_0x3afe90=!![]);const _0x485454=getProjectSkillsDir();for(const _0x264482 of skillsToRemove){const _0x2c9c80=_0x4e616e['GLBEC'](join,_0x485454,_0x264482);existsSync(_0x2c9c80)&&(await _0x4e616e['NXLZZ'](rm,_0x2c9c80,{'recursive':!![]}),console['log']('✓\x20Removed\x20project\x20skill:\x20'+_0x264482),_0x3afe90=!![]);}const _0x384ec6=getUserSkillsDir();for(const _0xdc5972 of skillsToRemove){const _0x1085e1=_0x4e616e[_0x428e50(0xfd)](join,_0x384ec6,_0xdc5972);existsSync(_0x1085e1)&&(await rm(_0x1085e1,{'recursive':!![]}),console[_0x428e50(0x117)](_0x428e50(0x101)+_0xdc5972),_0x3afe90=!![]);}const _0x290e87=_0x4e616e['vldqN'](getOpencodeSkillsDir,'project');for(const _0x2dd97e of skillsToRemove){const _0x2c8ab9=join(_0x290e87,_0x2dd97e);_0x4e616e[_0x428e50(0xf6)](existsSync,_0x2c8ab9)&&(await _0x4e616e['GLBEC'](rm,_0x2c8ab9,{'recursive':!![]}),console[_0x428e50(0x117)]('✓\x20Removed\x20OpenCode\x20project\x20skill:\x20'+_0x2dd97e),_0x3afe90=!![]);}const _0x565bad=_0x4e616e['AwdXg'](getOpencodeSkillsDir,'user');for(const _0x58f954 of skillsToRemove){const _0x1c8c83=_0x4e616e[_0x428e50(0xf7)](join,_0x565bad,_0x58f954);existsSync(_0x1c8c83)&&(await rm(_0x1c8c83,{'recursive':!![]}),console['log']('✓\x20Removed\x20OpenCode\x20user\x20skill:\x20'+_0x58f954),_0x3afe90=!![]);}const _0x337ff3=join(_0x4e616e[_0x428e50(0xf6)](getOpencodeConfigDir,_0x4e616e[_0x428e50(0x108)]),'opencode.json');await removeOpencodePluginConfig(_0x337ff3)&&(console[_0x428e50(0x117)](_0x428e50(0x103)),_0x3afe90=!![]);const _0x2c6bb8=_0x4e616e['NXLZZ'](join,_0x4e616e[_0x428e50(0xf6)](getOpencodeConfigDir,_0x428e50(0xf2)),_0x428e50(0x100));await _0x4e616e['AwdXg'](removeOpencodePluginConfig,_0x2c6bb8)&&(console[_0x428e50(0x117)](_0x4e616e[_0x428e50(0x102)]),_0x3afe90=!![]);const _0x1b1893=await _0x4e616e[_0x428e50(0x112)](uninstallClaudePlugin);_0x1b1893&&(console[_0x428e50(0x117)](_0x4e616e[_0x428e50(0xea)]),_0x3afe90=!![]);const _0x205d5f=await uninstallClaudePlugin(_0x4e616e['cTqzp']);_0x205d5f&&(console['log'](_0x4e616e['VPPlc']),_0x3afe90=!![]);const _0xa65a31=await removeMarketplace();_0xa65a31&&(console['log'](_0x4e616e[_0x428e50(0xe8)]),_0x3afe90=!![]),_0x3afe90?console[_0x428e50(0x117)](_0x428e50(0x113)):console[_0x428e50(0x117)]('Nothing\x20to\x20clean\x20up.\x0a');}
1
+ function _0x189e(_0x3d1f10,_0xf50c96){_0x3d1f10=_0x3d1f10-0xba;const _0x2a0b19=_0x2a0b();let _0x189ec0=_0x2a0b19[_0x3d1f10];return _0x189ec0;}const _0x2ff99f=_0x189e;(function(_0x447721,_0x35b46a){const _0x2987ce=_0x189e,_0x420bc4=_0x447721();while(!![]){try{const _0x3d8dd8=parseInt(_0x2987ce(0xbf))/0x1+parseInt(_0x2987ce(0xd5))/0x2*(parseInt(_0x2987ce(0xe5))/0x3)+parseInt(_0x2987ce(0xcd))/0x4+-parseInt(_0x2987ce(0xe0))/0x5*(parseInt(_0x2987ce(0xe2))/0x6)+-parseInt(_0x2987ce(0xdd))/0x7+parseInt(_0x2987ce(0xbe))/0x8+-parseInt(_0x2987ce(0xe9))/0x9;if(_0x3d8dd8===_0x35b46a)break;else _0x420bc4['push'](_0x420bc4['shift']());}catch(_0x3d1007){_0x420bc4['push'](_0x420bc4['shift']());}}}(_0x2a0b,0xeac5c));function _0x2a0b(){const _0x3d8e6a=['VomkG','\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','QcVmM','uninstall','10833193vYaeEg','push','\x0a✅\x20Cleanup\x20complete!\x0a','19865pBaDfp','UqaAM','1218DxNXYx','close','lLMKe','927039KobTDy','platform','log','parse','1601685CqoEIW','YRhgZ','✓\x20Removed\x20trailhead\x20marketplace','Nothing\x20to\x20clean\x20up.\x0a','ranger@trailhead','sCAPz','✓\x20Removed\x20OpenCode\x20user\x20skill:\x20','vXrfa','XXETe','7150840QKptac','142975YmkkYt','feature-tracker','e2e-test-recommender','string','ecvJo','filter','ignore','project','✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','vjhsm','✓\x20Removed\x20user\x20skill:\x20','claude','✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','stringify','7355420ojLHCT','✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','QFLdX','plugin','nNoeM','length','utf-8','lDChq','4aMmSvJ','trailhead','DqfXb','marketplace'];_0x2a0b=function(){return _0x3d8e6a;};return _0x2a0b();}import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{spawn}from'child_process';import{deleteAllCredentials}from'./utils/keychain.js';import{getProjectRoot,getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getCacheFile}from'./utils/sessionCache.js';import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=['ranger',_0x2ff99f(0xc0),'bug-bash',_0x2ff99f(0xc1)],opencodePluginName='@ranger-testing/opencode-plugin';function parseJsonc(_0x45228d){const _0x4d440f=_0x2ff99f,_0x3816fd=_0x45228d['replace'](/\/\*[\s\S]*?\*\//g,''),_0x5df3fc=_0x3816fd['replace'](/^\s*\/\/.*$/gm,''),_0x40f578=_0x5df3fc['replace'](/,\s*([}\]])/g,'$1');return JSON[_0x4d440f(0xe8)](_0x40f578);}async function removeOpencodePluginConfig(_0x52a7eb){const _0x202343=_0x2ff99f,_0x352015={'jHWZl':function(_0x51b829,_0x562188){return _0x51b829!==_0x562188;},'BEjzT':function(_0x28ee72,_0x4b40f2){return _0x28ee72(_0x4b40f2);},'hkIVX':_0x202343(0xd3),'QcVmM':function(_0x44b096,_0x56b516){return _0x44b096===_0x56b516;},'ecvJo':function(_0x23db84,_0x1ca2ad){return _0x23db84===_0x1ca2ad;}};if(!_0x352015['BEjzT'](existsSync,_0x52a7eb))return![];let _0x1b676b;try{const _0x5b1941=await readFile(_0x52a7eb,_0x352015['hkIVX']);_0x1b676b=parseJsonc(_0x5b1941);}catch{return![];}const _0x27c0bf=Array['isArray'](_0x1b676b[_0x202343(0xd0)])?_0x1b676b['plugin']:[];if(_0x27c0bf['length']===0x0)return![];const _0x53ef68=_0x27c0bf[_0x202343(0xc4)](_0x3aa1ca=>{const _0xc08b06=_0x202343;if(_0x352015['jHWZl'](typeof _0x3aa1ca,_0xc08b06(0xc2)))return!![];return _0x3aa1ca!==opencodePluginName;});if(_0x352015[_0x202343(0xdb)](_0x53ef68[_0x202343(0xd2)],_0x27c0bf['length']))return![];return _0x352015[_0x202343(0xc3)](_0x53ef68['length'],0x0)?delete _0x1b676b[_0x202343(0xd0)]:_0x1b676b[_0x202343(0xd0)]=_0x53ef68,await writeFile(_0x52a7eb,JSON[_0x202343(0xcc)](_0x1b676b,null,0x2)+'\x0a'),!![];}async function uninstallClaudePlugin(_0xc8106b){const _0x2b1762=_0x2ff99f,_0x2ddb62={'zpMNj':_0x2b1762(0xed),'IItSn':'--scope','gQOJX':'ignore','DqfXb':function(_0x2dc02d){return _0x2dc02d();},'TgzsZ':function(_0x49359b,_0x7485fa){return _0x49359b===_0x7485fa;}};return new Promise(_0x130c5d=>{const _0xfce1a4=_0x2b1762,_0x376427=['plugin',_0xfce1a4(0xdc),_0x2ddb62['zpMNj']];_0xc8106b&&_0x376427[_0xfce1a4(0xde)](_0x2ddb62['IItSn'],_0xc8106b);const _0x2badc7=spawn(_0xfce1a4(0xca),_0x376427,{'stdio':[_0x2ddb62['gQOJX'],_0x2ddb62['gQOJX'],_0x2ddb62['gQOJX']],'cwd':_0xc8106b?_0x2ddb62[_0xfce1a4(0xd7)](getProjectRoot):undefined,'shell':_0x2ddb62['TgzsZ'](process[_0xfce1a4(0xe6)],'win32')});_0x2badc7['on']('close',_0xf8d017=>{_0x130c5d(_0xf8d017===0x0);}),_0x2badc7['on']('error',()=>{_0x130c5d(![]);});});}async function removeMarketplace(){const _0x1ca38f=_0x2ff99f,_0x32272b={'OieNP':function(_0x3b6209,_0x152afb){return _0x3b6209(_0x152afb);},'YRhgZ':function(_0x1b68f9,_0x266ada,_0x87a0f6,_0x494a89){return _0x1b68f9(_0x266ada,_0x87a0f6,_0x494a89);},'jSuXQ':_0x1ca38f(0xca),'psVux':_0x1ca38f(0xd8),'EvHeI':_0x1ca38f(0xc5),'naAhF':function(_0xbaec4c,_0x2da6be){return _0xbaec4c===_0x2da6be;},'DxJSc':'win32'};return new Promise(_0x17e709=>{const _0x483442=_0x1ca38f,_0x414b1e=_0x32272b[_0x483442(0xea)](spawn,_0x32272b['jSuXQ'],[_0x483442(0xd0),_0x32272b['psVux'],'remove',_0x483442(0xd6)],{'stdio':['ignore',_0x32272b['EvHeI'],_0x483442(0xc5)],'shell':_0x32272b['naAhF'](process['platform'],_0x32272b['DxJSc'])});_0x414b1e['on'](_0x483442(0xe3),_0x19967f=>{_0x17e709(_0x19967f===0x0);}),_0x414b1e['on']('error',()=>{_0x32272b['OieNP'](_0x17e709,![]);});});}export async function clean(){const _0x1d3bb6=_0x2ff99f,_0x1a2d4b={'RkbrS':function(_0x56fc46){return _0x56fc46();},'cNmCb':'✓\x20Removed\x20stored\x20credentials','VomkG':function(_0x3ad4a5,_0x3c5452){return _0x3ad4a5(_0x3c5452);},'lDChq':function(_0x5d23a9){return _0x5d23a9();},'SEqWU':function(_0x15372c,_0x1db42b){return _0x15372c(_0x1db42b);},'vXrfa':function(_0x5df914,_0x3ab309,_0x2ecde6){return _0x5df914(_0x3ab309,_0x2ecde6);},'CrEQe':'project','sCAPz':function(_0x2a49e6,_0x3914b5,_0x1d705a){return _0x2a49e6(_0x3914b5,_0x1d705a);},'UqaAM':'user','VDBJH':function(_0x1d5ba1,_0x9a55a0,_0x42df3f){return _0x1d5ba1(_0x9a55a0,_0x42df3f);},'nNoeM':function(_0x5b6fe2,_0x36d497){return _0x5b6fe2(_0x36d497);},'QFLdX':_0x1d3bb6(0xc7),'uDNFR':function(_0x281b8e,_0x40a685){return _0x281b8e(_0x40a685);},'zWUhZ':function(_0x561807){return _0x561807();},'lLMKe':_0x1d3bb6(0xce),'XXETe':_0x1d3bb6(0xcb),'vjhsm':_0x1d3bb6(0xeb)};console['log'](_0x1d3bb6(0xda));let _0x2b9431=![];try{await _0x1a2d4b['RkbrS'](deleteAllCredentials),console['log'](_0x1a2d4b['cNmCb']),_0x2b9431=!![];}catch{}const _0x19775f=_0x1a2d4b['RkbrS'](getCacheFile);existsSync(_0x19775f)&&(await _0x1a2d4b[_0x1d3bb6(0xd9)](rm,_0x19775f),_0x2b9431=!![]);const _0x25f735=_0x1a2d4b[_0x1d3bb6(0xd4)](getRangerDir);existsSync(_0x25f735)&&(await rm(_0x25f735,{'recursive':!![]}),console['log']('✓\x20Removed\x20.ranger/\x20directory'),_0x2b9431=!![]);const _0x3dc073=getProjectSkillsDir();for(const _0x1dd541 of skillsToRemove){const _0x5b558e=join(_0x3dc073,_0x1dd541);_0x1a2d4b['SEqWU'](existsSync,_0x5b558e)&&(await rm(_0x5b558e,{'recursive':!![]}),console['log']('✓\x20Removed\x20project\x20skill:\x20'+_0x1dd541),_0x2b9431=!![]);}const _0xd09e70=getUserSkillsDir();for(const _0x32ac9e of skillsToRemove){const _0x4bbbe9=join(_0xd09e70,_0x32ac9e);existsSync(_0x4bbbe9)&&(await _0x1a2d4b[_0x1d3bb6(0xbc)](rm,_0x4bbbe9,{'recursive':!![]}),console[_0x1d3bb6(0xe7)](_0x1d3bb6(0xc9)+_0x32ac9e),_0x2b9431=!![]);}const _0x1b6fb5=getOpencodeSkillsDir(_0x1a2d4b['CrEQe']);for(const _0x366d5b of skillsToRemove){const _0xa539f9=_0x1a2d4b[_0x1d3bb6(0xbc)](join,_0x1b6fb5,_0x366d5b);existsSync(_0xa539f9)&&(await _0x1a2d4b[_0x1d3bb6(0xba)](rm,_0xa539f9,{'recursive':!![]}),console[_0x1d3bb6(0xe7)]('✓\x20Removed\x20OpenCode\x20project\x20skill:\x20'+_0x366d5b),_0x2b9431=!![]);}const _0x1dc99c=getOpencodeSkillsDir(_0x1a2d4b[_0x1d3bb6(0xe1)]);for(const _0x473ca5 of skillsToRemove){const _0x4efb3c=_0x1a2d4b[_0x1d3bb6(0xbc)](join,_0x1dc99c,_0x473ca5);existsSync(_0x4efb3c)&&(await _0x1a2d4b['VDBJH'](rm,_0x4efb3c,{'recursive':!![]}),console['log'](_0x1d3bb6(0xbb)+_0x473ca5),_0x2b9431=!![]);}const _0x46d51d=join(_0x1a2d4b['SEqWU'](getOpencodeConfigDir,_0x1d3bb6(0xc6)),'opencode.json');await _0x1a2d4b['nNoeM'](removeOpencodePluginConfig,_0x46d51d)&&(console[_0x1d3bb6(0xe7)](_0x1a2d4b[_0x1d3bb6(0xcf)]),_0x2b9431=!![]);const _0x2bd4e2=join(_0x1a2d4b[_0x1d3bb6(0xd1)](getOpencodeConfigDir,_0x1a2d4b[_0x1d3bb6(0xe1)]),'opencode.json');await _0x1a2d4b['uDNFR'](removeOpencodePluginConfig,_0x2bd4e2)&&(console[_0x1d3bb6(0xe7)]('✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)'),_0x2b9431=!![]);const _0x4eedbb=await _0x1a2d4b['zWUhZ'](uninstallClaudePlugin);_0x4eedbb&&(console['log'](_0x1a2d4b[_0x1d3bb6(0xe4)]),_0x2b9431=!![]);const _0x35ae06=await uninstallClaudePlugin(_0x1a2d4b['CrEQe']);_0x35ae06&&(console['log'](_0x1a2d4b[_0x1d3bb6(0xbd)]),_0x2b9431=!![]);const _0x24e6fc=await removeMarketplace();_0x24e6fc&&(console['log'](_0x1a2d4b[_0x1d3bb6(0xc8)]),_0x2b9431=!![]),_0x2b9431?console[_0x1d3bb6(0xe7)](_0x1d3bb6(0xdf)):console[_0x1d3bb6(0xe7)](_0x1d3bb6(0xec));}
@@ -1 +1 @@
1
- const _0x3540ab=_0xaf3e;(function(_0x121e8a,_0x1cb339){const _0x339701=_0xaf3e,_0x5a80e6=_0x121e8a();while(!![]){try{const _0x11b80c=parseInt(_0x339701(0x155))/0x1+parseInt(_0x339701(0x145))/0x2*(parseInt(_0x339701(0x14c))/0x3)+-parseInt(_0x339701(0x158))/0x4*(parseInt(_0x339701(0x14e))/0x5)+parseInt(_0x339701(0x15d))/0x6*(parseInt(_0x339701(0x15c))/0x7)+-parseInt(_0x339701(0x170))/0x8+-parseInt(_0x339701(0x165))/0x9*(-parseInt(_0x339701(0x161))/0xa)+parseInt(_0x339701(0x159))/0xb*(-parseInt(_0x339701(0x141))/0xc);if(_0x11b80c===_0x1cb339)break;else _0x5a80e6['push'](_0x5a80e6['shift']());}catch(_0x40de29){_0x5a80e6['push'](_0x5a80e6['shift']());}}}(_0x1984,0xbe33a));import{existsSync}from'fs';import{loadSettings,getNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=[_0x3540ab(0x15f),'allowInsecureLocalhost','forceLogin'];function parseLocalValue(_0x2cd629,_0x4c5a95){const _0x178923=_0x3540ab,_0x14c394={'kLPzk':function(_0x3b1434,_0x5b08f9){return _0x3b1434===_0x5b08f9;},'BHyeH':_0x178923(0x14d)};if(BOOLEAN_KEYS[_0x178923(0x14b)](_0x2cd629)){if(_0x14c394[_0x178923(0x171)](_0x4c5a95,_0x178923(0x14a)))return!![];if(_0x4c5a95===_0x14c394['BHyeH'])return![];throw new Error('Invalid\x20value\x20for\x20'+_0x2cd629+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x4c5a95;}function parseOverrideValue(_0x5ab95b){const _0x5a78e0=_0x3540ab,_0x3eedad={'QWuPk':_0x5a78e0(0x167),'xeePt':_0x5a78e0(0x16c)};if(_0x5ab95b==='true')return!![];if(_0x5ab95b===_0x5a78e0(0x14d))return![];if(_0x5ab95b===_0x3eedad['QWuPk'])return null;if(_0x5ab95b===_0x3eedad[_0x5a78e0(0x163)])return undefined;if(/^-?\d+$/['test'](_0x5ab95b)){const _0x163d09=Number(_0x5ab95b);if(Number[_0x5a78e0(0x157)](_0x163d09))return _0x163d09;}if(/^-?\d+\.\d+$/[_0x5a78e0(0x13f)](_0x5ab95b)){const _0x207164=Number(_0x5ab95b);if(!Number[_0x5a78e0(0x16b)](_0x207164))return _0x207164;}const _0x43ae02=_0x5ab95b['trim']();if(_0x43ae02['startsWith']('{')&&_0x43ae02[_0x5a78e0(0x15a)]('}')||_0x43ae02[_0x5a78e0(0x173)]('[')&&_0x43ae02['endsWith'](']'))try{return JSON[_0x5a78e0(0x164)](_0x43ae02);}catch{}return _0x5ab95b;}function _0xaf3e(_0x236dab,_0x146c5a){_0x236dab=_0x236dab-0x13c;const _0x19844c=_0x1984();let _0xaf3eb4=_0x19844c[_0x236dab];return _0xaf3eb4;}async function resolveProfileTarget(_0x4e01cb){const _0x419936=_0x3540ab,_0x2e0be8={'ItpVc':function(_0x1477f7,_0x29a282){return _0x1477f7(_0x29a282);},'iBNYH':function(_0x858ec4,_0x15a77c){return _0x858ec4(_0x15a77c);}},_0x2cb273=_0x2e0be8[_0x419936(0x16f)](existsSync,_0x2e0be8['iBNYH'](getEnvDir,_0x4e01cb));let _0x443be3=![];try{const _0x249cae=await fetchCloudProfile(_0x4e01cb);_0x443be3=_0x2e0be8['iBNYH'](Boolean,_0x249cae);}catch{}if(_0x443be3)return{'kind':_0x419936(0x142),'alsoExistsElsewhere':_0x2cb273};if(_0x2cb273)return{'kind':_0x419936(0x14f),'alsoExistsElsewhere':![]};throw new Error(_0x419936(0x16d)+_0x4e01cb+_0x419936(0x148)+_0x4e01cb);}function printDualExistsHint(_0x1796f8){const _0x585873=_0x3540ab;console[_0x585873(0x15e)](_0x585873(0x146)+_0x1796f8+_0x585873(0x16e));}function _0x1984(){const _0x4e46dd=['isSafeInteger','1589620nEtWdj','11iAVLec','endsWith','\x20for\x20\x22','7sbJTWI','5764542wpoOSb','log','headless','Set\x20','1553890jxoYOu','\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22','xeePt','parse','45nwFCAb','bkwgy','null','kind','alsoExistsElsewhere','\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.','isNaN','undefined','Profile\x20\x22','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','ItpVc','7763728uVclls','kLPzk','stringify','startsWith','GdbBm','rdNpI','ffxEi','Key\x20\x22','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','object','test','cwd','23689428cJbeVl','cloud','GdVld','fJRkP','138004GBOdnI','\x20\x20Note:\x20\x22','gYtTI','\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20','No\x20configuration\x20set\x20for\x20\x22','true','includes','51ESmtkJ','false','5QiHqUQ','local','IFQBo','Removed\x20','pzcvm','UlaYO','PiQex','1210320akvyNZ','keys'];_0x1984=function(){return _0x4e46dd;};return _0x1984();}function getProjectPath(){const _0x18ea9d=_0x3540ab;return process[_0x18ea9d(0x140)]();}async function loadEffectiveCloudSettings(_0x2f7279){const _0x1b94b5={'jQlzK':function(_0x22ebdd,_0xd24b3d,_0x2fc935){return _0x22ebdd(_0xd24b3d,_0x2fc935);},'ajpwi':function(_0x5b8959){return _0x5b8959();},'ngdmD':function(_0x43e188,_0x30b8f4){return _0x43e188??_0x30b8f4;}},_0xbf954f=await fetchCloudProfile(_0x2f7279),_0x2b31e3=_0x1b94b5['jQlzK'](readProfileOverrides,_0x1b94b5['ajpwi'](getProjectPath),_0x2f7279);return mergeCloudProfileSettings(_0xbf954f?.['settings']??{},_0x1b94b5['ngdmD'](_0x2b31e3,undefined));}export async function configSet(_0x33fe81,_0x2e21d7,_0x14352f){const _0x84e1f8=_0x3540ab,_0x32319a={'GdbBm':function(_0xd555de,_0x42b255){return _0xd555de(_0x42b255);},'gYtTI':function(_0x2f4a3d,_0x112a88,_0x55ccd3,_0x577ebf,_0x2aae5d){return _0x2f4a3d(_0x112a88,_0x55ccd3,_0x577ebf,_0x2aae5d);},'bkwgy':function(_0x55bc1f){return _0x55bc1f();}},_0x2fbe54=await resolveProfileTarget(_0x33fe81);if(_0x2fbe54['kind']===_0x84e1f8(0x142)){if(_0x2fbe54[_0x84e1f8(0x169)])_0x32319a[_0x84e1f8(0x174)](printDualExistsHint,_0x33fe81);const _0x49a9b4=_0x32319a['GdbBm'](parseOverrideValue,_0x14352f);_0x32319a[_0x84e1f8(0x147)](setProfileOverride,_0x32319a[_0x84e1f8(0x166)](getProjectPath),_0x33fe81,_0x2e21d7,_0x49a9b4),console[_0x84e1f8(0x15e)](_0x84e1f8(0x160)+_0x2e21d7+'\x20=\x20'+JSON[_0x84e1f8(0x172)](_0x49a9b4)+_0x84e1f8(0x15b)+_0x33fe81+'\x22');return;}const _0x4cf27b=parseLocalValue(_0x2e21d7,_0x14352f);setProfileOverride(_0x32319a['bkwgy'](getProjectPath),_0x33fe81,_0x2e21d7,_0x4cf27b),console['log']('Set\x20'+_0x2e21d7+'\x20=\x20'+_0x4cf27b+'\x20for\x20\x22'+_0x33fe81+'\x22');}export async function configGet(_0x43cc37,_0x4a15f7){const _0x4e51a6=_0x3540ab,_0x30ed76={'IFQBo':function(_0x28d226,_0x771e89){return _0x28d226(_0x771e89);},'PiQex':'cloud','rdNpI':_0x4e51a6(0x13e),'UlaYO':function(_0x3d23cd,_0x5a8957){return _0x3d23cd===_0x5a8957;},'EHpsn':function(_0x3c7bd0,_0xa9582e){return _0x3c7bd0===_0xa9582e;}},_0x4d4bde=await _0x30ed76['IFQBo'](resolveProfileTarget,_0x43cc37);if(_0x4d4bde['kind']===_0x30ed76[_0x4e51a6(0x154)]){const _0x550f6c=await _0x30ed76[_0x4e51a6(0x150)](loadEffectiveCloudSettings,_0x43cc37),_0x3718c3=getNestedValue(_0x550f6c,_0x4a15f7);if(_0x3718c3===undefined)console['log']('(not\x20set)');else typeof _0x3718c3===_0x30ed76[_0x4e51a6(0x175)]?console[_0x4e51a6(0x15e)](JSON[_0x4e51a6(0x172)](_0x3718c3,null,0x2)):console['log'](_0x3718c3);return;}const _0x4e387c=await loadSettings(_0x43cc37),_0x23e898=getNestedValue(_0x4e387c,_0x4a15f7);if(_0x30ed76[_0x4e51a6(0x153)](_0x23e898,undefined))console[_0x4e51a6(0x15e)]('(not\x20set)');else _0x30ed76['EHpsn'](typeof _0x23e898,_0x4e51a6(0x13e))?console['log'](JSON[_0x4e51a6(0x172)](_0x23e898,null,0x2)):console[_0x4e51a6(0x15e)](_0x23e898);}export async function configList(_0x46074b){const _0x375b27=_0x3540ab,_0x5d4f14={'QLYTS':function(_0x1bd7ed,_0x502a23){return _0x1bd7ed===_0x502a23;},'ttsry':function(_0x2b3164,_0x5310c5){return _0x2b3164(_0x5310c5);},'GdVld':function(_0x16fd7c,_0x10eb90){return _0x16fd7c(_0x10eb90);}},_0x4955d3=await resolveProfileTarget(_0x46074b);if(_0x5d4f14['QLYTS'](_0x4955d3['kind'],'cloud')){const _0x50fae7=await loadEffectiveCloudSettings(_0x46074b);if(!_0x50fae7||_0x5d4f14['QLYTS'](Object[_0x375b27(0x156)](_0x50fae7)['length'],0x0)){console[_0x375b27(0x15e)]('No\x20configuration\x20set\x20for\x20\x22'+_0x46074b+'\x22');return;}console['log'](JSON['stringify'](_0x50fae7,null,0x2));return;}const _0x3bfdf0=getSettingsPath(_0x46074b);if(!_0x5d4f14['ttsry'](existsSync,_0x3bfdf0)){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x46074b+'\x22');return;}const _0x5512ac=await _0x5d4f14[_0x375b27(0x143)](loadSettings,_0x46074b),_0x2c75c0=_0x5d4f14[_0x375b27(0x143)](formatSettings,_0x5512ac);!_0x2c75c0?console['log'](_0x375b27(0x149)+_0x46074b+'\x22'):console[_0x375b27(0x15e)](_0x2c75c0);}export async function configUnset(_0x24917f,_0x2ca180){const _0x1b0849=_0x3540ab,_0x2cd6fd={'ffxEi':function(_0x3ae3e0,_0x44566b){return _0x3ae3e0(_0x44566b);},'fJRkP':_0x1b0849(0x142),'pzcvm':function(_0x17c971,_0x4df99f){return _0x17c971(_0x4df99f);},'JAPDP':function(_0x5bc1af,_0x126fd5,_0x5a6d7d){return _0x5bc1af(_0x126fd5,_0x5a6d7d);}},_0x256c6a=await _0x2cd6fd[_0x1b0849(0x176)](resolveProfileTarget,_0x24917f);if(_0x256c6a['kind']===_0x2cd6fd[_0x1b0849(0x144)]){if(_0x256c6a['alsoExistsElsewhere'])_0x2cd6fd['ffxEi'](printDualExistsHint,_0x24917f);const _0x2524a6=unsetProfileOverride(getProjectPath(),_0x24917f,_0x2ca180);_0x2524a6?console['log']('Removed\x20'+_0x2ca180+'\x20for\x20\x22'+_0x24917f+'\x22'):console['log']('Key\x20\x22'+_0x2ca180+'\x22\x20not\x20found');return;}const _0x5b2b7a=unsetProfileOverride(getProjectPath(),_0x24917f,_0x2ca180);if(_0x5b2b7a){console['log'](_0x1b0849(0x151)+_0x2ca180);return;}const _0xde21c9=await _0x2cd6fd[_0x1b0849(0x152)](loadSettings,_0x24917f),_0xe15279=_0x2cd6fd['JAPDP'](deleteNestedValue,_0xde21c9,_0x2ca180);_0xe15279?console[_0x1b0849(0x15e)](_0x1b0849(0x13c)+_0x2ca180+_0x1b0849(0x162)+_0x24917f+_0x1b0849(0x16a)):console[_0x1b0849(0x15e)]('Key\x20\x22'+_0x2ca180+'\x22\x20not\x20found');}export async function configReset(_0x33f161){const _0x3ef9fa=_0x3540ab,_0x39ca16={'CKDrb':function(_0x1734cc,_0x129f90){return _0x1734cc(_0x129f90);},'KXKaj':function(_0x3aa31a,_0x1c09c6){return _0x3aa31a===_0x1c09c6;}},_0x4f14f4=await _0x39ca16['CKDrb'](resolveProfileTarget,_0x33f161);if(_0x39ca16['KXKaj'](_0x4f14f4[_0x3ef9fa(0x168)],_0x3ef9fa(0x142))){resetProfileOverrides(getProjectPath(),_0x33f161),console[_0x3ef9fa(0x15e)]('Cleared\x20local\x20overrides\x20for\x20\x22'+_0x33f161+'\x22');return;}console[_0x3ef9fa(0x15e)]('\x22'+_0x33f161+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x33f161+_0x3ef9fa(0x13d));}
1
+ function _0x10c5(){const _0x4ed523=['\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20','1969032oBORuz','kind','orMiY','false','settings','\x20=\x20','QDNAl',':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22','log','Set\x20','stringify','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','5335078XBqeqz','startsWith','headless','\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22','fZeBn','endsWith','alsoExistsElsewhere','1544394QJMxMT','parse','toivt','83645HyUtdL','TRuXY','\x20\x20Note:\x20\x22','kZcuH','ywfnm','No\x20configuration\x20set\x20for\x20\x22','keys','UcTsk','120ncJNmb','1889152BjKIUC','\x20for\x20\x22','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','28123cIZWSp','includes','length','xGEmh','cloud','9VCmgjP','test','pStKJ','Invalid\x20value\x20for\x20','4354812PEVnLf','HqwaC','isSafeInteger','trim','(not\x20set)','pNmwI','true','forceLogin','VJKej','allowInsecureLocalhost','BUPLP','Key\x20\x22'];_0x10c5=function(){return _0x4ed523;};return _0x10c5();}const _0x1c71d4=_0x39da;(function(_0x59e687,_0x106061){const _0x43e20b=_0x39da,_0x254847=_0x59e687();while(!![]){try{const _0x1c940a=-parseInt(_0x43e20b(0x1ee))/0x1+parseInt(_0x43e20b(0x1df))/0x2+-parseInt(_0x43e20b(0x1cc))/0x3+-parseInt(_0x43e20b(0x1ea))/0x4*(-parseInt(_0x43e20b(0x1e2))/0x5)+-parseInt(_0x43e20b(0x1bf))/0x6+parseInt(_0x43e20b(0x1d8))/0x7+-parseInt(_0x43e20b(0x1eb))/0x8*(parseInt(_0x43e20b(0x1f3))/0x9);if(_0x1c940a===_0x106061)break;else _0x254847['push'](_0x254847['shift']());}catch(_0x1f11d1){_0x254847['push'](_0x254847['shift']());}}}(_0x10c5,0x5f2b0));import{existsSync}from'fs';import{loadSettings,getNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=[_0x1c71d4(0x1da),_0x1c71d4(0x1c8),_0x1c71d4(0x1c6)];function parseLocalValue(_0x206641,_0x17db84){const _0x4e7929=_0x1c71d4,_0x4aec72={'jYDkg':_0x4e7929(0x1cf)};if(BOOLEAN_KEYS[_0x4e7929(0x1ef)](_0x206641)){if(_0x17db84==='true')return!![];if(_0x17db84===_0x4aec72['jYDkg'])return![];throw new Error(_0x4e7929(0x1be)+_0x206641+_0x4e7929(0x1d3));}return _0x17db84;}function parseOverrideValue(_0x34030b){const _0x3b6ffc=_0x1c71d4,_0x4370f4={'LxTmS':function(_0x39e427,_0x53d837){return _0x39e427===_0x53d837;},'lcvzO':_0x3b6ffc(0x1cf),'OAnXy':'null'};if(_0x4370f4['LxTmS'](_0x34030b,_0x3b6ffc(0x1c5)))return!![];if(_0x4370f4['LxTmS'](_0x34030b,_0x4370f4['lcvzO']))return![];if(_0x34030b===_0x4370f4['OAnXy'])return null;if(_0x34030b==='undefined')return undefined;if(/^-?\d+$/[_0x3b6ffc(0x1bc)](_0x34030b)){const _0x1b456a=Number(_0x34030b);if(Number[_0x3b6ffc(0x1c1)](_0x1b456a))return _0x1b456a;}if(/^-?\d+\.\d+$/['test'](_0x34030b)){const _0x5be63c=Number(_0x34030b);if(!Number['isNaN'](_0x5be63c))return _0x5be63c;}const _0x561cee=_0x34030b[_0x3b6ffc(0x1c2)]();if(_0x561cee[_0x3b6ffc(0x1d9)]('{')&&_0x561cee[_0x3b6ffc(0x1dd)]('}')||_0x561cee[_0x3b6ffc(0x1d9)]('[')&&_0x561cee['endsWith'](']'))try{return JSON[_0x3b6ffc(0x1e0)](_0x561cee);}catch{}return _0x34030b;}async function resolveProfileTarget(_0x4129a2){const _0x5aaf84=_0x1c71d4,_0x3a83c8={'wkpoZ':function(_0x44006f,_0x3f9f42){return _0x44006f(_0x3f9f42);},'uhObi':function(_0x554c51,_0x543610){return _0x554c51(_0x543610);},'HAZbn':'cloud'},_0x167689=_0x3a83c8['wkpoZ'](existsSync,getEnvDir(_0x4129a2));let _0x1291f5=![];try{const _0x2c6719=await _0x3a83c8['uhObi'](fetchCloudProfile,_0x4129a2);_0x1291f5=Boolean(_0x2c6719);}catch{}if(_0x1291f5)return{'kind':_0x3a83c8['HAZbn'],'alsoExistsElsewhere':_0x167689};if(_0x167689)return{'kind':'local','alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x4129a2+_0x5aaf84(0x1cb)+_0x4129a2);}function printDualExistsHint(_0x5ccc30){const _0x2305b8=_0x1c71d4;console[_0x2305b8(0x1d4)](_0x2305b8(0x1e4)+_0x5ccc30+_0x2305b8(0x1d7));}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x588762){const _0xd09093=_0x1c71d4,_0x4462d6={'Cumbq':function(_0x2c76de,_0x2bac44){return _0x2c76de(_0x2bac44);},'kZcuH':function(_0x226346,_0x57688d,_0x39cdb0){return _0x226346(_0x57688d,_0x39cdb0);},'fheHK':function(_0x3fb504){return _0x3fb504();},'pNmwI':function(_0x5e22f3,_0x4daef0){return _0x5e22f3??_0x4daef0;}},_0x201e88=await _0x4462d6['Cumbq'](fetchCloudProfile,_0x588762),_0x8f065c=_0x4462d6[_0xd09093(0x1e5)](readProfileOverrides,_0x4462d6['fheHK'](getProjectPath),_0x588762);return _0x4462d6[_0xd09093(0x1e5)](mergeCloudProfileSettings,_0x201e88?.[_0xd09093(0x1d0)]??{},_0x4462d6[_0xd09093(0x1c4)](_0x8f065c,undefined));}function _0x39da(_0x4c6006,_0x171d4d){_0x4c6006=_0x4c6006-0x1bc;const _0x10c59f=_0x10c5();let _0x39da81=_0x10c59f[_0x4c6006];return _0x39da81;}export async function configSet(_0x12b5f5,_0x41b876,_0x6ed279){const _0x371d36=_0x1c71d4,_0xf3bcbe={'YdKja':function(_0x29adb0,_0x225313){return _0x29adb0(_0x225313);},'SWhTC':function(_0x30596e,_0x2413bc){return _0x30596e===_0x2413bc;},'QDNAl':function(_0x3b99f5){return _0x3b99f5();},'Qisth':function(_0x28f73c,_0x54c398,_0x4f286c,_0x422aef,_0x36e62c){return _0x28f73c(_0x54c398,_0x4f286c,_0x422aef,_0x36e62c);}},_0x4cf4ae=await _0xf3bcbe['YdKja'](resolveProfileTarget,_0x12b5f5);if(_0xf3bcbe['SWhTC'](_0x4cf4ae[_0x371d36(0x1cd)],_0x371d36(0x1f2))){if(_0x4cf4ae[_0x371d36(0x1de)])printDualExistsHint(_0x12b5f5);const _0x2235f3=parseOverrideValue(_0x6ed279);setProfileOverride(_0xf3bcbe[_0x371d36(0x1d2)](getProjectPath),_0x12b5f5,_0x41b876,_0x2235f3),console['log'](_0x371d36(0x1d5)+_0x41b876+_0x371d36(0x1d1)+JSON[_0x371d36(0x1d6)](_0x2235f3)+_0x371d36(0x1ec)+_0x12b5f5+'\x22');return;}const _0x432a64=parseLocalValue(_0x41b876,_0x6ed279);_0xf3bcbe['Qisth'](setProfileOverride,getProjectPath(),_0x12b5f5,_0x41b876,_0x432a64),console[_0x371d36(0x1d4)](_0x371d36(0x1d5)+_0x41b876+_0x371d36(0x1d1)+_0x432a64+'\x20for\x20\x22'+_0x12b5f5+'\x22');}export async function configGet(_0x5ba724,_0x38ddb6){const _0x4c33c7=_0x1c71d4,_0x4f42d8={'xGEmh':function(_0x1039bd,_0x1a9fb6){return _0x1039bd(_0x1a9fb6);},'orMiY':function(_0x5a86e3,_0x1e3061){return _0x5a86e3===_0x1e3061;},'pStKJ':function(_0x72fb96,_0x1b3007,_0x6f6b3e){return _0x72fb96(_0x1b3007,_0x6f6b3e);},'VJKej':function(_0x5cd1cb,_0x36af8b){return _0x5cd1cb(_0x36af8b);},'szwrp':function(_0x315452,_0x4c6d0c){return _0x315452===_0x4c6d0c;},'fZeBn':'object'},_0x994a4c=await _0x4f42d8[_0x4c33c7(0x1f1)](resolveProfileTarget,_0x5ba724);if(_0x4f42d8[_0x4c33c7(0x1ce)](_0x994a4c[_0x4c33c7(0x1cd)],_0x4c33c7(0x1f2))){const _0x56e08e=await loadEffectiveCloudSettings(_0x5ba724),_0x555b5c=_0x4f42d8[_0x4c33c7(0x1bd)](getNestedValue,_0x56e08e,_0x38ddb6);if(_0x555b5c===undefined)console['log'](_0x4c33c7(0x1c3));else typeof _0x555b5c==='object'?console['log'](JSON[_0x4c33c7(0x1d6)](_0x555b5c,null,0x2)):console['log'](_0x555b5c);return;}const _0x436e98=await _0x4f42d8[_0x4c33c7(0x1c7)](loadSettings,_0x5ba724),_0x18a814=_0x4f42d8['pStKJ'](getNestedValue,_0x436e98,_0x38ddb6);if(_0x4f42d8['szwrp'](_0x18a814,undefined))console['log']('(not\x20set)');else typeof _0x18a814===_0x4f42d8[_0x4c33c7(0x1dc)]?console['log'](JSON[_0x4c33c7(0x1d6)](_0x18a814,null,0x2)):console['log'](_0x18a814);}export async function configList(_0xb0c208){const _0x49a317=_0x1c71d4,_0xf8e1ca={'ywfnm':function(_0x2afaca,_0x406a44){return _0x2afaca(_0x406a44);},'NDqbI':function(_0x31be7e,_0x352b52){return _0x31be7e===_0x352b52;},'MuAZO':function(_0x58fcff,_0x4a351a){return _0x58fcff===_0x4a351a;},'toivt':function(_0xf88755,_0x396d8){return _0xf88755(_0x396d8);}},_0x19c6d6=await _0xf8e1ca['ywfnm'](resolveProfileTarget,_0xb0c208);if(_0xf8e1ca['NDqbI'](_0x19c6d6['kind'],_0x49a317(0x1f2))){const _0x415952=await _0xf8e1ca[_0x49a317(0x1e6)](loadEffectiveCloudSettings,_0xb0c208);if(!_0x415952||_0xf8e1ca['MuAZO'](Object[_0x49a317(0x1e8)](_0x415952)[_0x49a317(0x1f0)],0x0)){console['log'](_0x49a317(0x1e7)+_0xb0c208+'\x22');return;}console['log'](JSON[_0x49a317(0x1d6)](_0x415952,null,0x2));return;}const _0x1a4111=_0xf8e1ca[_0x49a317(0x1e1)](getSettingsPath,_0xb0c208);if(!existsSync(_0x1a4111)){console['log'](_0x49a317(0x1e7)+_0xb0c208+'\x22');return;}const _0x41acc9=await loadSettings(_0xb0c208),_0x1e55a3=_0xf8e1ca['toivt'](formatSettings,_0x41acc9);!_0x1e55a3?console['log'](_0x49a317(0x1e7)+_0xb0c208+'\x22'):console[_0x49a317(0x1d4)](_0x1e55a3);}export async function configUnset(_0x4f045c,_0x3d8155){const _0x1e5695=_0x1c71d4,_0x1d5b5a={'BUPLP':function(_0x4efca3,_0x227d30){return _0x4efca3===_0x227d30;},'HqwaC':_0x1e5695(0x1f2),'UcTsk':function(_0x205f0a,_0x549601,_0x2b1856,_0x10c3dd){return _0x205f0a(_0x549601,_0x2b1856,_0x10c3dd);},'BNcuT':function(_0x3442bd,_0x476842){return _0x3442bd(_0x476842);},'TRuXY':function(_0x2a4248,_0x4ee293,_0x3cc082){return _0x2a4248(_0x4ee293,_0x3cc082);}},_0x28b415=await resolveProfileTarget(_0x4f045c);if(_0x1d5b5a[_0x1e5695(0x1c9)](_0x28b415[_0x1e5695(0x1cd)],_0x1d5b5a[_0x1e5695(0x1c0)])){if(_0x28b415[_0x1e5695(0x1de)])printDualExistsHint(_0x4f045c);const _0x283b51=_0x1d5b5a[_0x1e5695(0x1e9)](unsetProfileOverride,getProjectPath(),_0x4f045c,_0x3d8155);_0x283b51?console[_0x1e5695(0x1d4)]('Removed\x20'+_0x3d8155+'\x20for\x20\x22'+_0x4f045c+'\x22'):console['log'](_0x1e5695(0x1ca)+_0x3d8155+'\x22\x20not\x20found');return;}const _0x3fddca=unsetProfileOverride(getProjectPath(),_0x4f045c,_0x3d8155);if(_0x3fddca){console[_0x1e5695(0x1d4)]('Removed\x20'+_0x3d8155);return;}const _0x5e5f7a=await _0x1d5b5a['BNcuT'](loadSettings,_0x4f045c),_0x281009=_0x1d5b5a[_0x1e5695(0x1e3)](deleteNestedValue,_0x5e5f7a,_0x3d8155);_0x281009?console[_0x1e5695(0x1d4)](_0x1e5695(0x1ca)+_0x3d8155+_0x1e5695(0x1db)+_0x4f045c+'\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.'):console[_0x1e5695(0x1d4)]('Key\x20\x22'+_0x3d8155+'\x22\x20not\x20found');}export async function configReset(_0x5b8d47){const _0xc93b37=_0x1c71d4,_0x3e67e1={'hRiHU':function(_0x2e529c,_0x9a0ba4){return _0x2e529c(_0x9a0ba4);},'dVQlj':function(_0x311469,_0xc4825e){return _0x311469===_0xc4825e;}},_0x2fd82a=await _0x3e67e1['hRiHU'](resolveProfileTarget,_0x5b8d47);if(_0x3e67e1['dVQlj'](_0x2fd82a['kind'],_0xc93b37(0x1f2))){resetProfileOverrides(getProjectPath(),_0x5b8d47),console[_0xc93b37(0x1d4)]('Cleared\x20local\x20overrides\x20for\x20\x22'+_0x5b8d47+'\x22');return;}console['log']('\x22'+_0x5b8d47+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x5b8d47+_0xc93b37(0x1ed));}
@@ -1 +1 @@
1
- (function(_0x22f1a0,_0x4c9aef){const _0x51ace4=_0xeb1d,_0x2d5166=_0x22f1a0();while(!![]){try{const _0xe12270=parseInt(_0x51ace4(0xb9))/0x1*(parseInt(_0x51ace4(0xc2))/0x2)+-parseInt(_0x51ace4(0xc5))/0x3*(-parseInt(_0x51ace4(0xc7))/0x4)+parseInt(_0x51ace4(0xca))/0x5+parseInt(_0x51ace4(0xce))/0x6*(parseInt(_0x51ace4(0xc9))/0x7)+-parseInt(_0x51ace4(0xcb))/0x8*(parseInt(_0x51ace4(0xba))/0x9)+-parseInt(_0x51ace4(0xbf))/0xa*(-parseInt(_0x51ace4(0xcc))/0xb)+parseInt(_0x51ace4(0xcf))/0xc*(-parseInt(_0x51ace4(0xc3))/0xd);if(_0xe12270===_0x4c9aef)break;else _0x2d5166['push'](_0x2d5166['shift']());}catch(_0x5ac249){_0x2d5166['push'](_0x2d5166['shift']());}}}(_0x4afc,0x8f960));import _0x53dd10 from'inquirer';function _0xeb1d(_0x227875,_0x56c221){_0x227875=_0x227875-0xb9;const _0x4afcb0=_0x4afc();let _0xeb1d0e=_0x4afcb0[_0x227875];return _0xeb1d0e;}import{deleteCloudProfile,fetchCloudProfile}from'./utils/cloudProfile.js';function _0x4afc(){const _0xc7d6b8=['input','71730TDXQaf','34385806rOEFLb','\x22\x20for\x20everyone\x20in\x20your\x20organization.','3WNgulX','✓\x20Deleted\x20cloud\x20profile\x20\x22','2467988kCqTZx','\x22\x20to\x20confirm\x20deletion:','94087kxHhzp','4314420VpZGmc','168SnPKMK','1265tAUUUE','log','432dhtApQ','12RpclkZ','25dSXXUo','162387CbDaDH','\x22\x20not\x20found.','Profile\x20deletion\x20cancelled:\x20confirmation\x20did\x20not\x20match.','VECzS','confirmation','23290hDLwFl','yes'];_0x4afc=function(){return _0xc7d6b8;};return _0x4afc();}import{isInteractive}from'./utils/cloudProfileSession.js';import{clearLastProfile,resetProfileOverrides}from'./utils/projectsConfig.js';export async function deleteProfile(_0x6a3263,_0x28560b={}){const _0x265a16=_0xeb1d,_0xf9b64c={'tFRNN':function(_0x294ac8,_0x437402){return _0x294ac8(_0x437402);},'VECzS':_0x265a16(0xbc)},_0x47c345=await _0xf9b64c['tFRNN'](fetchCloudProfile,_0x6a3263);if(!_0x47c345)throw new Error('Cloud\x20profile\x20\x22'+_0x6a3263+_0x265a16(0xbb));if(!_0x28560b[_0x265a16(0xc0)]&&!isInteractive())throw new Error('Profile\x20deletion\x20requires\x20an\x20interactive\x20terminal\x20so\x20the\x20profile\x20name\x20can\x20be\x20typed\x20for\x20confirmation.\x20Pass\x20--yes\x20to\x20skip\x20confirmation.');console[_0x265a16(0xcd)]('\x0aWarning:\x20this\x20deletes\x20the\x20shared\x20cloud\x20profile\x20\x22'+_0x6a3263+_0x265a16(0xc4));if(!_0x28560b['yes']){const {confirmation:_0x34f634}=await _0x53dd10['prompt']([{'type':_0x265a16(0xc1),'name':_0x265a16(0xbe),'message':'Type\x20\x22'+_0x6a3263+_0x265a16(0xc8)}]);if(_0x34f634!==_0x6a3263)throw new Error(_0xf9b64c[_0x265a16(0xbd)]);}await _0xf9b64c['tFRNN'](deleteCloudProfile,_0x6a3263),resetProfileOverrides(process['cwd'](),_0x6a3263),clearLastProfile(process['cwd'](),_0x6a3263),console[_0x265a16(0xcd)](_0x265a16(0xc6)+_0x6a3263+'\x22.');}
1
+ function _0xb040(_0x154e85,_0x15cf92){_0x154e85=_0x154e85-0xa4;const _0x2ae8c2=_0x2ae8();let _0xb04052=_0x2ae8c2[_0x154e85];return _0xb04052;}(function(_0x2a82d9,_0x4a10da){const _0x563c7c=_0xb040,_0x5ed14d=_0x2a82d9();while(!![]){try{const _0x24b38a=parseInt(_0x563c7c(0xab))/0x1*(parseInt(_0x563c7c(0xaf))/0x2)+-parseInt(_0x563c7c(0xa7))/0x3*(-parseInt(_0x563c7c(0xb0))/0x4)+-parseInt(_0x563c7c(0xaa))/0x5*(-parseInt(_0x563c7c(0xb4))/0x6)+-parseInt(_0x563c7c(0xa9))/0x7*(parseInt(_0x563c7c(0xb1))/0x8)+parseInt(_0x563c7c(0xa6))/0x9+-parseInt(_0x563c7c(0xa5))/0xa+parseInt(_0x563c7c(0xa8))/0xb*(parseInt(_0x563c7c(0xad))/0xc);if(_0x24b38a===_0x4a10da)break;else _0x5ed14d['push'](_0x5ed14d['shift']());}catch(_0x368c84){_0x5ed14d['push'](_0x5ed14d['shift']());}}}(_0x2ae8,0xee1c3));import _0x1c5ca8 from'inquirer';import{deleteCloudProfile,fetchCloudProfile}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{clearLastProfile,resetProfileOverrides}from'./utils/projectsConfig.js';export async function deleteProfile(_0xb0ed4a,_0x475826={}){const _0x495a54=_0xb040,_0x1ae5b0={'ONNGK':function(_0x5664b6,_0x15737b){return _0x5664b6!==_0x15737b;}},_0x327fd0=await fetchCloudProfile(_0xb0ed4a);if(!_0x327fd0)throw new Error(_0x495a54(0xa4)+_0xb0ed4a+'\x22\x20not\x20found.');if(!_0x475826['yes']&&!isInteractive())throw new Error('Profile\x20deletion\x20requires\x20an\x20interactive\x20terminal\x20so\x20the\x20profile\x20name\x20can\x20be\x20typed\x20for\x20confirmation.\x20Pass\x20--yes\x20to\x20skip\x20confirmation.');console[_0x495a54(0xae)]('\x0aWarning:\x20this\x20deletes\x20the\x20shared\x20cloud\x20profile\x20\x22'+_0xb0ed4a+'\x22\x20for\x20everyone\x20in\x20your\x20organization.');if(!_0x475826['yes']){const {confirmation:_0x4792c7}=await _0x1c5ca8[_0x495a54(0xb2)]([{'type':'input','name':_0x495a54(0xac),'message':'Type\x20\x22'+_0xb0ed4a+'\x22\x20to\x20confirm\x20deletion:'}]);if(_0x1ae5b0['ONNGK'](_0x4792c7,_0xb0ed4a))throw new Error('Profile\x20deletion\x20cancelled:\x20confirmation\x20did\x20not\x20match.');}await deleteCloudProfile(_0xb0ed4a),resetProfileOverrides(process[_0x495a54(0xb3)](),_0xb0ed4a),clearLastProfile(process[_0x495a54(0xb3)](),_0xb0ed4a),console[_0x495a54(0xae)]('✓\x20Deleted\x20cloud\x20profile\x20\x22'+_0xb0ed4a+'\x22.');}function _0x2ae8(){const _0xda20e=['824355dwYWAn','6729OVgJGp','7453908VocqjG','589904TQPBTe','989435hNTPge','1280106brQgCV','confirmation','12pNpVTk','log','2GsZIvm','692QrLBDO','128wdnTUN','prompt','cwd','6RVBzQb','Cloud\x20profile\x20\x22','3116040wvfyoP'];_0x2ae8=function(){return _0xda20e;};return _0x2ae8();}
@@ -1 +1 @@
1
- const _0x5ae571=_0xab25;(function(_0x588e56,_0x475f49){const _0x57ad2a=_0xab25,_0xcba12f=_0x588e56();while(!![]){try{const _0x3a7f7e=parseInt(_0x57ad2a(0x10a))/0x1*(-parseInt(_0x57ad2a(0x10d))/0x2)+parseInt(_0x57ad2a(0x119))/0x3*(-parseInt(_0x57ad2a(0x12d))/0x4)+-parseInt(_0x57ad2a(0x113))/0x5+-parseInt(_0x57ad2a(0x109))/0x6+parseInt(_0x57ad2a(0x120))/0x7+parseInt(_0x57ad2a(0x11c))/0x8*(parseInt(_0x57ad2a(0x127))/0x9)+parseInt(_0x57ad2a(0x110))/0xa;if(_0x3a7f7e===_0x475f49)break;else _0xcba12f['push'](_0xcba12f['shift']());}catch(_0x28be0e){_0xcba12f['push'](_0xcba12f['shift']());}}}(_0x56b6,0xea945));import{readdir,stat}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{getRangerDir}from'./utils/rangerRoot.js';import{loadSettings}from'./utils/settings.js';import{readActiveProfileName}from'./utils/activeProfile.js';import{getToken}from'./utils/keychain.js';import{listCloudProfiles}from'./utils/cloudProfile.js';const NON_ENV_DIRS=['sessions',_0x5ae571(0x115),'reports',_0x5ae571(0x112),'ci'];export function shouldGroupByEnvironment(_0x1b0a3b){const _0x31e1fc=_0x5ae571;return _0x1b0a3b[_0x31e1fc(0x126)](_0x1341a1=>_0x1341a1[_0x31e1fc(0x130)]);}function _0x56b6(){const _0x12d831=['local','4245310IssBSX','ATncA','bug-bashes','baseUrl','legacy','profiles','41556DfgpUZ','\x0aNo\x20profiles\x20found.','length','293208GuLeBI','environmentDetails','fqNgH','gZZum','8307978TaDCjd','set','\x0a*\x20=\x20active\x20profile','log','\x20\x20\x20\x20\x20\x20Details:\x20','nZxNY','some','261VMpyAa','\x0aCloud\x20Profiles:','keys','\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20','get','message','88friQoS','startsWith','yqSRP','environmentKey','efMjE','name','endsWith','qgAHq','isDirectory','2378802cuidpu','56iQTURQ','includes','localeCompare','15136BwkNyF','push','sort','6851850MAuECb','map'];_0x56b6=function(){return _0x12d831;};return _0x56b6();}export function groupCloudProfilesByEnvironment(_0x349cf5){const _0x27c44b=_0x5ae571,_0x203838={'CjqKh':function(_0x1f8651,_0x1ffe6e){return _0x1f8651===_0x1ffe6e;},'wKoQc':function(_0x5a746c,_0x420707){return _0x5a746c===_0x420707;}},_0x23df27=new Map();for(const _0x5ab948 of _0x349cf5){const _0x25b3d2=_0x5ab948[_0x27c44b(0x130)]??null,_0x58cfba=_0x23df27[_0x27c44b(0x12b)](_0x25b3d2);if(_0x58cfba)_0x58cfba[_0x27c44b(0x10e)](_0x5ab948);else _0x23df27[_0x27c44b(0x121)](_0x25b3d2,[_0x5ab948]);}const _0x5a2d17=[..._0x23df27[_0x27c44b(0x129)]()]['sort']((_0x4a8097,_0x5894d5)=>{const _0x36129d=_0x27c44b;if(_0x203838['CjqKh'](_0x4a8097,null))return 0x1;if(_0x203838['wKoQc'](_0x5894d5,null))return-0x1;return _0x4a8097[_0x36129d(0x10c)](_0x5894d5);});return _0x5a2d17[_0x27c44b(0x111)](_0x55f1a3=>({'environmentKey':_0x55f1a3,'profiles':_0x23df27['get'](_0x55f1a3)[_0x27c44b(0x10f)]((_0x22aa6d,_0x5c2368)=>_0x22aa6d['name'][_0x27c44b(0x10c)](_0x5c2368['name']))}));}function _0xab25(_0x5f138e,_0x541911){_0x5f138e=_0x5f138e-0x109;const _0x56b6e9=_0x56b6();let _0xab25b=_0x56b6e9[_0x5f138e];return _0xab25b;}export async function getEnvNames(){const _0x5d7435=_0x5ae571,_0xecaf95={'TtNUH':function(_0x235c8b){return _0x235c8b();},'gZZum':function(_0x2f4589,_0x4148f3){return _0x2f4589(_0x4148f3);},'eOddd':'local','BuUJM':function(_0x330b8d,_0x58ec6c,_0x22f5ea){return _0x330b8d(_0x58ec6c,_0x22f5ea);},'ATncA':function(_0x1e8a35,_0x3894da){return _0x1e8a35(_0x3894da);},'hZmIr':'.txt','otCoq':'settings.json','tSifY':_0x5d7435(0x117)},_0x4920bd=_0xecaf95['TtNUH'](getRangerDir);if(!_0xecaf95['gZZum'](existsSync,_0x4920bd))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x11f4ff=await readActiveProfileName(),_0x1b31db=[],_0x235669={},_0x3499ed=join(_0x4920bd,'local');if(_0xecaf95[_0x5d7435(0x11f)](existsSync,_0x3499ed)){const _0x40f0d7=await readdir(_0x3499ed);for(const _0x325221 of _0x40f0d7){const _0x8dc9d8=join(_0x3499ed,_0x325221),_0x542af9=await _0xecaf95[_0x5d7435(0x11f)](stat,_0x8dc9d8);_0x542af9[_0x5d7435(0x135)]()&&(_0x1b31db[_0x5d7435(0x10e)](_0x325221),_0x235669[_0x325221]=_0xecaf95['eOddd']);}}const _0x8d0b49=_0xecaf95['BuUJM'](join,_0x4920bd,'ci');if(existsSync(_0x8d0b49)){const _0x5d04a2=await _0xecaf95['ATncA'](readdir,_0x8d0b49);for(const _0x44e6b3 of _0x5d04a2){const _0xa3b056=join(_0x8d0b49,_0x44e6b3),_0x58e7a9=await stat(_0xa3b056);_0x58e7a9['isDirectory']()&&(_0x1b31db['push'](_0x44e6b3),_0x235669[_0x44e6b3]='ci');}}const _0x339396=await _0xecaf95[_0x5d7435(0x114)](readdir,_0x4920bd);for(const _0x2bef47 of _0x339396){if(NON_ENV_DIRS['includes'](_0x2bef47))continue;if(_0x2bef47[_0x5d7435(0x12e)]('.'))continue;if(_0x2bef47[_0x5d7435(0x133)](_0xecaf95['hZmIr']))continue;const _0x5e9cc2=join(_0x4920bd,_0x2bef47),_0x56187c=await _0xecaf95['gZZum'](stat,_0x5e9cc2);_0x56187c[_0x5d7435(0x135)]()&&existsSync(join(_0x5e9cc2,_0xecaf95['otCoq']))&&(!_0x1b31db[_0x5d7435(0x10b)](_0x2bef47)&&(_0x1b31db['push'](_0x2bef47),_0x235669[_0x2bef47]=_0xecaf95['tSifY']));}return{'envNames':_0x1b31db,'activeEnv':_0x11f4ff,'envTypes':_0x235669};}export async function envList(){const _0x2c7b66=_0x5ae571,_0x306eee={'HyWev':function(_0x4e29e6,_0x1cd5c8){return _0x4e29e6===_0x1cd5c8;},'LmtrV':function(_0x8e016c){return _0x8e016c();},'qgAHq':function(_0x29041e,_0x56b7f3){return _0x29041e(_0x56b7f3);},'nZxNY':'\x0aCloud\x20Profiles\x20(by\x20environment):','efMjE':function(_0x45c351,_0x390e7e){return _0x45c351(_0x390e7e);},'fqNgH':function(_0x15a4cb,_0x3eaeb9,_0xe5c55c){return _0x15a4cb(_0x3eaeb9,_0xe5c55c);},'yqSRP':'\x20\x20\x20\x20'},{envNames:_0x25a000,activeEnv:_0x44697e,envTypes:_0x7a2b4f}=await _0x306eee['LmtrV'](getEnvNames);let _0x37a509=[];const _0x58b4c9=await getToken();if(_0x58b4c9)try{_0x37a509=await listCloudProfiles();}catch(_0xb36636){console['error'](_0x2c7b66(0x12a)+(_0xb36636 instanceof Error?_0xb36636[_0x2c7b66(0x12c)]:_0x306eee[_0x2c7b66(0x134)](String,_0xb36636)));}if(_0x306eee['HyWev'](_0x25a000['length'],0x0)&&_0x306eee['HyWev'](_0x37a509[_0x2c7b66(0x11b)],0x0)){console['log'](_0x2c7b66(0x11a)),console[_0x2c7b66(0x123)]('Run:\x20ranger\x20profile\x20add\x20<profile-name>');return;}const _0x5ebcfd=new Set(_0x37a509['map'](_0xc66870=>_0xc66870[_0x2c7b66(0x132)]));if(_0x25a000[_0x2c7b66(0x11b)]>0x0){console['log']('\x0aLocal\x20Profiles\x20(legacy):');for(const _0x15b270 of _0x25a000[_0x2c7b66(0x10f)]()){const _0x289433=_0x306eee['HyWev'](_0x15b270,_0x44697e)&&!_0x5ebcfd['has'](_0x15b270),_0x2d373d=_0x7a2b4f[_0x15b270]||'local',_0x544933=await _0x306eee[_0x2c7b66(0x134)](loadSettings,_0x15b270),_0x57fb00=_0x306eee['HyWev'](_0x2d373d,_0x2c7b66(0x117))?'':'\x20['+_0x2d373d+']';console['log']('\x20\x20'+(_0x289433?'*\x20':'\x20\x20')+_0x15b270+_0x57fb00),_0x544933['baseUrl']&&console[_0x2c7b66(0x123)]('\x20\x20\x20\x20\x20\x20URL:\x20'+_0x544933[_0x2c7b66(0x116)]),_0x544933['environmentDetails']&&console['log'](_0x2c7b66(0x124)+_0x544933[_0x2c7b66(0x11d)]);}}const _0x12850c=(_0x506eca,_0x37c911)=>{const _0x77985c=_0x2c7b66,_0xfb3bef=_0x306eee['HyWev'](_0x506eca['name'],_0x44697e),_0x112ce2=_0x506eca['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x506eca['sessionUpdatedAt']+')':'no\x20session';console[_0x77985c(0x123)](''+_0x37c911+(_0xfb3bef?'*\x20':'\x20\x20')+_0x506eca['name']),console['log'](_0x37c911+'\x20\x20\x20\x20Session:\x20'+_0x112ce2);};if(_0x37a509[_0x2c7b66(0x11b)]>0x0){if(shouldGroupByEnvironment(_0x37a509)){console[_0x2c7b66(0x123)](_0x306eee[_0x2c7b66(0x125)]);for(const _0x33e7cc of _0x306eee[_0x2c7b66(0x131)](groupCloudProfilesByEnvironment,_0x37a509)){const _0x95fa40=_0x33e7cc[_0x2c7b66(0x130)]??'(no\x20environment\x20—\x20manual\x20or\x20no\x20auth)';console[_0x2c7b66(0x123)]('\x0a\x20\x20'+_0x95fa40);for(const _0x3ec11f of _0x33e7cc[_0x2c7b66(0x118)]){_0x306eee['fqNgH'](_0x12850c,_0x3ec11f,_0x306eee[_0x2c7b66(0x12f)]);}}}else{console[_0x2c7b66(0x123)](_0x2c7b66(0x128));for(const _0x2238bc of[..._0x37a509]['sort']((_0x174982,_0x231279)=>_0x174982[_0x2c7b66(0x132)][_0x2c7b66(0x10c)](_0x231279['name']))){_0x306eee[_0x2c7b66(0x11e)](_0x12850c,_0x2238bc,'\x20\x20');}}}_0x44697e&&console[_0x2c7b66(0x123)](_0x2c7b66(0x122));}
1
+ const _0x5b1142=_0x59e5;(function(_0x57af48,_0x36032a){const _0xb6cae8=_0x59e5,_0x599d38=_0x57af48();while(!![]){try{const _0x1e99ae=parseInt(_0xb6cae8(0x154))/0x1*(-parseInt(_0xb6cae8(0x15c))/0x2)+parseInt(_0xb6cae8(0x159))/0x3*(-parseInt(_0xb6cae8(0x146))/0x4)+-parseInt(_0xb6cae8(0x14f))/0x5*(-parseInt(_0xb6cae8(0x16d))/0x6)+-parseInt(_0xb6cae8(0x16c))/0x7*(parseInt(_0xb6cae8(0x163))/0x8)+-parseInt(_0xb6cae8(0x166))/0x9+parseInt(_0xb6cae8(0x150))/0xa+parseInt(_0xb6cae8(0x14d))/0xb;if(_0x1e99ae===_0x36032a)break;else _0x599d38['push'](_0x599d38['shift']());}catch(_0xe0e428){_0x599d38['push'](_0x599d38['shift']());}}}(_0x27c2,0x8b0df));import{readdir,stat}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x59e5(_0x2ab668,_0x413bcf){_0x2ab668=_0x2ab668-0x13f;const _0x27c2d8=_0x27c2();let _0x59e530=_0x27c2d8[_0x2ab668];return _0x59e530;}import{getRangerDir}from'./utils/rangerRoot.js';import{loadSettings}from'./utils/settings.js';import{readActiveProfileName}from'./utils/activeProfile.js';import{getToken}from'./utils/keychain.js';import{listCloudProfiles}from'./utils/cloudProfile.js';function _0x27c2(){const _0x14b880=['profiles','\x0aCloud\x20Profiles:','sessions','YkABv','no\x20session','dXBzn','endsWith','name','675060jkmJHF','localeCompare','uVVvK','local','JLyMA','environmentKey','bSFYO','15188338hgeazL','some','295jovEWC','4130240VeHjVr','jHMhu','\x20\x20\x20\x20','ITNGg','1blNUjK','length','\x20\x20\x20\x20Session:\x20','cached\x20(updated\x20','error','3aDjGQM','sort','GOrJv','1616206ETHRJu','log','map','NDBHi','includes','baseUrl','sessionUpdatedAt','112YzgJrs','(no\x20environment\x20—\x20manual\x20or\x20no\x20auth)','bug-bashes','1651968FoErDe','EJDeo','bbQgb','environmentDetails','push','bJqwI','487466HSLURI','92658NwjjPZ','ARgyQ','xwBis','get'];_0x27c2=function(){return _0x14b880;};return _0x27c2();}const NON_ENV_DIRS=[_0x5b1142(0x140),_0x5b1142(0x165),'reports','local','ci'];export function shouldGroupByEnvironment(_0x4386e5){const _0x55c76e=_0x5b1142;return _0x4386e5[_0x55c76e(0x14e)](_0x21721d=>_0x21721d[_0x55c76e(0x14b)]);}export function groupCloudProfilesByEnvironment(_0x4d8ea9){const _0x27507d=_0x5b1142,_0xefa492=new Map();for(const _0x581bf1 of _0x4d8ea9){const _0xfd4486=_0x581bf1['environmentKey']??null,_0x2be6ec=_0xefa492[_0x27507d(0x170)](_0xfd4486);if(_0x2be6ec)_0x2be6ec['push'](_0x581bf1);else _0xefa492['set'](_0xfd4486,[_0x581bf1]);}const _0x31efc5=[..._0xefa492['keys']()][_0x27507d(0x15a)]((_0x49818d,_0x5bd380)=>{const _0x1cc67f=_0x27507d;if(_0x49818d===null)return 0x1;if(_0x5bd380===null)return-0x1;return _0x49818d[_0x1cc67f(0x147)](_0x5bd380);});return _0x31efc5['map'](_0x5040c1=>({'environmentKey':_0x5040c1,'profiles':_0xefa492['get'](_0x5040c1)[_0x27507d(0x15a)]((_0xee2ee7,_0xd646a2)=>_0xee2ee7[_0x27507d(0x145)][_0x27507d(0x147)](_0xd646a2['name']))}));}export async function getEnvNames(){const _0xa87af=_0x5b1142,_0x2246ea={'JLyMA':function(_0x3e7c31){return _0x3e7c31();},'bbQgb':function(_0x4bd379,_0x24a2a4){return _0x4bd379(_0x24a2a4);},'jHMhu':function(_0x437d16,_0x3ec630,_0x20daf2){return _0x437d16(_0x3ec630,_0x20daf2);},'dXBzn':function(_0x3da57f,_0x52743d){return _0x3da57f(_0x52743d);},'bSFYO':'local','YkABv':function(_0x669fd6,_0x3b92c2,_0xf25d3){return _0x669fd6(_0x3b92c2,_0xf25d3);},'TIbKW':function(_0x1e6686,_0x3ca0ba){return _0x1e6686(_0x3ca0ba);},'rvfps':function(_0xcbdb67,_0x499079){return _0xcbdb67(_0x499079);},'ARgyQ':'.txt','XVjQD':function(_0x10847d,_0x5f3638){return _0x10847d(_0x5f3638);}},_0x4597d5=_0x2246ea[_0xa87af(0x14a)](getRangerDir);if(!_0x2246ea[_0xa87af(0x168)](existsSync,_0x4597d5))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x36bde6=await readActiveProfileName(),_0x1741da=[],_0x1e083a={},_0x3e2ed=_0x2246ea[_0xa87af(0x151)](join,_0x4597d5,_0xa87af(0x149));if(existsSync(_0x3e2ed)){const _0x298a47=await _0x2246ea[_0xa87af(0x143)](readdir,_0x3e2ed);for(const _0x501e73 of _0x298a47){const _0xaaf69a=join(_0x3e2ed,_0x501e73),_0x51e341=await stat(_0xaaf69a);_0x51e341['isDirectory']()&&(_0x1741da[_0xa87af(0x16a)](_0x501e73),_0x1e083a[_0x501e73]=_0x2246ea[_0xa87af(0x14c)]);}}const _0x7351e9=_0x2246ea['YkABv'](join,_0x4597d5,'ci');if(_0x2246ea['TIbKW'](existsSync,_0x7351e9)){const _0x705ca5=await readdir(_0x7351e9);for(const _0x557b7c of _0x705ca5){const _0x522ba7=join(_0x7351e9,_0x557b7c),_0x82b8f0=await _0x2246ea['rvfps'](stat,_0x522ba7);_0x82b8f0['isDirectory']()&&(_0x1741da['push'](_0x557b7c),_0x1e083a[_0x557b7c]='ci');}}const _0x3eccca=await readdir(_0x4597d5);for(const _0x61f220 of _0x3eccca){if(NON_ENV_DIRS['includes'](_0x61f220))continue;if(_0x61f220['startsWith']('.'))continue;if(_0x61f220[_0xa87af(0x144)](_0x2246ea[_0xa87af(0x16e)]))continue;const _0x598e4b=_0x2246ea[_0xa87af(0x141)](join,_0x4597d5,_0x61f220),_0x289744=await _0x2246ea['XVjQD'](stat,_0x598e4b);_0x289744['isDirectory']()&&existsSync(join(_0x598e4b,'settings.json'))&&(!_0x1741da[_0xa87af(0x160)](_0x61f220)&&(_0x1741da['push'](_0x61f220),_0x1e083a[_0x61f220]='legacy'));}return{'envNames':_0x1741da,'activeEnv':_0x36bde6,'envTypes':_0x1e083a};}export async function envList(){const _0x1953e1=_0x5b1142,_0x233dae={'aFWQa':function(_0x5eb441,_0x582787){return _0x5eb441===_0x582787;},'ITNGg':_0x1953e1(0x142),'uVVvK':function(_0x2b9d69){return _0x2b9d69();},'ixPzQ':function(_0x3062b1){return _0x3062b1();},'uBPje':function(_0x54eb27,_0x1a9aed){return _0x54eb27 instanceof _0x1a9aed;},'gmANb':function(_0x537f8a,_0x4d4ef0){return _0x537f8a===_0x4d4ef0;},'JUtbT':'\x0aNo\x20profiles\x20found.','vYSyE':function(_0x11994d,_0x30f423){return _0x11994d>_0x30f423;},'ZCiTe':'\x0aLocal\x20Profiles\x20(legacy):','tuAmc':'legacy','NDBHi':function(_0x3d819b,_0x2d87c0){return _0x3d819b>_0x2d87c0;},'GOrJv':function(_0x2daa6f,_0x43be65){return _0x2daa6f(_0x43be65);},'bJqwI':'\x0aCloud\x20Profiles\x20(by\x20environment):','xwBis':function(_0x20b5d6,_0x55064a){return _0x20b5d6(_0x55064a);},'DSEIJ':function(_0x4dad51,_0x439011,_0x1a3fea){return _0x4dad51(_0x439011,_0x1a3fea);},'shhrQ':_0x1953e1(0x13f),'EJDeo':function(_0x51a56a,_0x71d4ba,_0x42e2ab){return _0x51a56a(_0x71d4ba,_0x42e2ab);}},{envNames:_0x40a15b,activeEnv:_0x480883,envTypes:_0x5b1e8f}=await getEnvNames();let _0x53a9fe=[];const _0x5ec52e=await _0x233dae[_0x1953e1(0x148)](getToken);if(_0x5ec52e)try{_0x53a9fe=await _0x233dae['ixPzQ'](listCloudProfiles);}catch(_0x2bad13){console[_0x1953e1(0x158)]('\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20'+(_0x233dae['uBPje'](_0x2bad13,Error)?_0x2bad13['message']:String(_0x2bad13)));}if(_0x233dae['gmANb'](_0x40a15b['length'],0x0)&&_0x53a9fe['length']===0x0){console[_0x1953e1(0x15d)](_0x233dae['JUtbT']),console[_0x1953e1(0x15d)]('Run:\x20ranger\x20profile\x20add\x20<profile-name>');return;}const _0x418881=new Set(_0x53a9fe[_0x1953e1(0x15e)](_0x1252e3=>_0x1252e3['name']));if(_0x233dae['vYSyE'](_0x40a15b['length'],0x0)){console[_0x1953e1(0x15d)](_0x233dae['ZCiTe']);for(const _0x114f98 of _0x40a15b['sort']()){const _0x3810eb=_0x114f98===_0x480883&&!_0x418881['has'](_0x114f98),_0x1c1fce=_0x5b1e8f[_0x114f98]||_0x1953e1(0x149),_0x4cd8f9=await loadSettings(_0x114f98),_0x139bb5=_0x1c1fce===_0x233dae['tuAmc']?'':'\x20['+_0x1c1fce+']';console[_0x1953e1(0x15d)]('\x20\x20'+(_0x3810eb?'*\x20':'\x20\x20')+_0x114f98+_0x139bb5),_0x4cd8f9['baseUrl']&&console['log']('\x20\x20\x20\x20\x20\x20URL:\x20'+_0x4cd8f9[_0x1953e1(0x161)]),_0x4cd8f9[_0x1953e1(0x169)]&&console[_0x1953e1(0x15d)]('\x20\x20\x20\x20\x20\x20Details:\x20'+_0x4cd8f9['environmentDetails']);}}const _0xde423f=(_0x504cdd,_0x5a4177)=>{const _0x2e7889=_0x1953e1,_0x3f6150=_0x233dae['aFWQa'](_0x504cdd[_0x2e7889(0x145)],_0x480883),_0x452858=_0x504cdd['sessionUpdatedAt']?_0x2e7889(0x157)+_0x504cdd[_0x2e7889(0x162)]+')':_0x233dae[_0x2e7889(0x153)];console['log'](''+_0x5a4177+(_0x3f6150?'*\x20':'\x20\x20')+_0x504cdd[_0x2e7889(0x145)]),console['log'](_0x5a4177+_0x2e7889(0x156)+_0x452858);};if(_0x233dae[_0x1953e1(0x15f)](_0x53a9fe[_0x1953e1(0x155)],0x0)){if(_0x233dae[_0x1953e1(0x15b)](shouldGroupByEnvironment,_0x53a9fe)){console[_0x1953e1(0x15d)](_0x233dae[_0x1953e1(0x16b)]);for(const _0x1aed0d of _0x233dae[_0x1953e1(0x16f)](groupCloudProfilesByEnvironment,_0x53a9fe)){const _0x1a62e5=_0x1aed0d[_0x1953e1(0x14b)]??_0x1953e1(0x164);console['log']('\x0a\x20\x20'+_0x1a62e5);for(const _0x4ab77e of _0x1aed0d[_0x1953e1(0x171)]){_0x233dae['DSEIJ'](_0xde423f,_0x4ab77e,_0x1953e1(0x152));}}}else{console['log'](_0x233dae['shhrQ']);for(const _0xe4f56f of[..._0x53a9fe][_0x1953e1(0x15a)]((_0x436e33,_0x1cc1f2)=>_0x436e33[_0x1953e1(0x145)][_0x1953e1(0x147)](_0x1cc1f2[_0x1953e1(0x145)]))){_0x233dae[_0x1953e1(0x167)](_0xde423f,_0xe4f56f,'\x20\x20');}}}_0x480883&&console[_0x1953e1(0x15d)]('\x0a*\x20=\x20active\x20profile');}