@ranger-testing/ranger-cli 3.1.3-alpha.e1ca941-42 → 3.1.4-alpha.fb796e7-45

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 (85) 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/sessionCache.js +1 -1
  71. package/build/commands/utils/settings.js +1 -1
  72. package/build/commands/utils/skillContent.js +1 -1
  73. package/build/commands/utils/skills.js +1 -1
  74. package/build/commands/utils/stitchWebmFiles.js +1 -1
  75. package/build/commands/utils/telemetry.js +1 -1
  76. package/build/commands/utils/tokenRefresh.js +1 -1
  77. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  78. package/build/commands/utils/tunnelClient.js +1 -1
  79. package/build/commands/utils/userApi.js +1 -1
  80. package/build/commands/utils/version.js +1 -1
  81. package/build/commands/verifyFeature.js +1 -1
  82. package/build/commands/verifyFeatureCli.js +1 -1
  83. package/build/commands/verifyFeatureNovaCli.js +1 -1
  84. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  85. package/package.json +2 -2
@@ -1 +1 @@
1
- const _0x184572=_0x4cf0;(function(_0x4ab5d1,_0x5a7055){const _0x3c31b7=_0x4cf0,_0x49a013=_0x4ab5d1();while(!![]){try{const _0x17475f=-parseInt(_0x3c31b7(0x253))/0x1*(-parseInt(_0x3c31b7(0x24e))/0x2)+-parseInt(_0x3c31b7(0x203))/0x3+parseInt(_0x3c31b7(0x273))/0x4*(parseInt(_0x3c31b7(0x265))/0x5)+parseInt(_0x3c31b7(0x1e3))/0x6*(-parseInt(_0x3c31b7(0x21f))/0x7)+parseInt(_0x3c31b7(0x1f8))/0x8+-parseInt(_0x3c31b7(0x22f))/0x9+parseInt(_0x3c31b7(0x27b))/0xa;if(_0x17475f===_0x5a7055)break;else _0x49a013['push'](_0x49a013['shift']());}catch(_0x2f2af1){_0x49a013['push'](_0x49a013['shift']());}}}(_0x2911,0x41d30));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x2911(){const _0x444831=['aIYTW','EnDwU','tunnel_session_id','GsQxl','environmentKey','fPFbs','/api/v1/profiles','agent','XCfdM','VofsB','wsEndpoint','nooqj','not_configured','host','YmYUi','2282144mDfuLR','upmVj','\x20\x20forceLogin\x20enabled\x20for\x20\x22','\x22\x20failed\x20validation\x20—\x20refreshing...','setupHeaders','JALmf','cwhpo','json','status','WMJjh','xDmVZ','1090851nAokft','Cloud\x20profile\x20\x22','trackPhaseStart','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','browserOptions','password','close','PUT','tunnel_bridge_event','GumKD','some','launch','profiles','username','storageStatePath','\x20failed\x20(','DIxCv','RANGER_TEST_PASSWORD','tunnel_login_setup','map','trim','):\x20','POST','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','AxJrt','log','error','headers','21hArvFp','VHHSl','lvhoe','vqKGW','invalid-url','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','RANGER_TEST_USERNAME','eVRwr','\x20\x20Cloud\x20session\x20for\x20\x22','/api/v1/tunnel/sessions','invalidateOn','storageState','stringify','WEznm','\x20\x20No\x20live\x20session\x20for\x20\x22','test_output','4741164rbhzqD','QFJiu','confirm','Browser\x20login\x20timed\x20out\x20after\x20','dQSHX','pPxZh','split','Bearer\x20','zuVXS','message','save','\x22;\x20proceeding\x20with\x20loginInstructions.','Browser\x20login\x20timed\x20out\x20before\x20completion.','uQUNL','kqlhl',').\x20','NphHD','then','sessionId','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','MLnda','fmtWV','MMUlt','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','auth','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','ZECEP','targetUrl','extraHTTPHeaders','join','sessionState','34hhgQnZ','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','ziSAZ','you\x27re\x20now\x20at\x20\x22','IqEqE','12585bBNcol','code','vUSPj','env','pendingLocalConnections','loginInstructions','\x22\x20not\x20found.','\x22\x20on\x20profile\x20\x22','settings','tGNEd','origin','parse','type','newPage','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','cookies','TXAXx','\x22,\x20refreshing\x20session...','1280225qSTAEc','/api/v1/profiles/','userAgent','telemetry','string','pwEndpoint','activeLocalConnections','force','\x20\x20Cached\x20session\x20for\x20\x22','tunnel_login_request','uqYlq','GLsYf','keys','QheIp','4wYrVFv','forceLogin','baseUrl','name','XOhAe','pw_endpoint','length','trackPhaseEnd','6167930LXTuDq','domains','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','/session','organizationId','newContext','tunnel_login_cleanup','bypMb','utf-8','tunnel','catch','aeibO','kTWnS','jAsnj','OiJhf','424044WBYkPJ','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','\x22,\x20cached\x20locally','persistSessionState','OvVCC','trackPhaseError'];_0x2911=function(){return _0x444831;};return _0x2911();}import _0x4e7ffc from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,needsTunnel,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0x10020f){const _0x4bf5a4=_0x4cf0;try{return new URL(_0x10020f)[_0x4bf5a4(0x1f6)];}catch{return _0x4bf5a4(0x223);}}function _0x4cf0(_0x35c324,_0x4706fb){_0x35c324=_0x35c324-0x1dc;const _0x29112b=_0x2911();let _0x4cf093=_0x29112b[_0x35c324];return _0x4cf093;}function errorMessageForTelemetry(_0x53d88a){const _0x568b82={'AugqC':function(_0x1d886e,_0x152abd){return _0x1d886e instanceof _0x152abd;}};return _0x568b82['AugqC'](_0x53d88a,Error)?_0x53d88a['message']:undefined;}function trackBridgeEvent(_0x558cdd,_0x44d57e){const _0x546450=_0x4cf0,_0x571793={'sJHSZ':_0x546450(0x20b),'HzXqk':'tunnel_error'};if(!_0x558cdd)return;const _0x41ec57={'tunnelSessionId':_0x44d57e['sessionId'],'tunnelEventType':_0x44d57e[_0x546450(0x25f)],'connectionId':_0x44d57e['connectionId'],'code':_0x44d57e[_0x546450(0x254)],'reason':_0x44d57e['reason'],'error':_0x44d57e['error'],'elapsedMs':_0x44d57e['elapsedMs'],'activeLocalConnections':_0x44d57e[_0x546450(0x26b)],'pendingLocalConnections':_0x44d57e[_0x546450(0x257)]};_0x558cdd[_0x546450(0x27a)](_0x571793['sJHSZ'],_0x41ec57),(_0x44d57e['type']===_0x571793['HzXqk']||_0x44d57e['type']==='local_ws_error')&&void _0x558cdd[_0x546450(0x1e8)]('tunnel_bridge',new Error(_0x44d57e['error']??_0x44d57e[_0x546450(0x25f)]),_0x41ec57);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x356d6f={'TyZMw':function(_0x2aa18c){return _0x2aa18c();}},_0xe4b917=await _0x356d6f['TyZMw'](getToken);if(!_0xe4b917)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');return _0xe4b917;}async function apiRequest(_0x328aeb,_0x4aea38={}){const _0x14622a=_0x4cf0,_0x5a4484={'fmtWV':function(_0xb6558d,_0x5a089a,_0x5a0b58){return _0xb6558d(_0x5a089a,_0x5a0b58);},'bypMb':'application/json','ovKwz':function(_0x5390b5,_0x4144fc){return _0x5390b5===_0x4144fc;},'EjJCR':_0x14622a(0x269)},_0x729535=await requireToken(),_0x16a6e6=getApiBaseUrl(),_0x6b2e3=await _0x5a4484[_0x14622a(0x244)](fetch,''+_0x16a6e6+_0x328aeb,{..._0x4aea38,'headers':{'Authorization':_0x14622a(0x236)+_0x729535,'Content-Type':_0x5a4484[_0x14622a(0x282)],..._0x4aea38[_0x14622a(0x21e)]??{}}});if(!_0x6b2e3['ok']){let _0x29f75f='',_0x35640f;try{const _0x308550=await _0x6b2e3[_0x14622a(0x1ff)]();_0x29f75f=(_0x5a4484['ovKwz'](typeof _0x308550['error'],_0x14622a(0x269))?_0x308550[_0x14622a(0x21d)]:undefined)??JSON['stringify'](_0x308550);if(_0x5a4484['ovKwz'](typeof _0x308550[_0x14622a(0x254)],_0x5a4484['EjJCR']))_0x35640f=_0x308550['code'];}catch{_0x29f75f=_0x6b2e3['statusText'];}throw new ApiError('API\x20request\x20'+_0x328aeb+_0x14622a(0x212)+_0x6b2e3[_0x14622a(0x200)]+_0x14622a(0x218)+_0x29f75f,_0x6b2e3[_0x14622a(0x200)],_0x29f75f,_0x35640f);}if(_0x6b2e3[_0x14622a(0x200)]===0xcc)return undefined;return _0x6b2e3[_0x14622a(0x1ff)]();}export class ApiError extends Error{[_0x184572(0x200)];['detail'];['code'];constructor(_0x23374b,_0x1839e6,_0x405e62,_0x199314){const _0x2f7ba6=_0x184572,_0x569763={'zvame':'0|1|3|2|4','QqOnK':'ApiError'},_0x372156=_0x569763['zvame'][_0x2f7ba6(0x235)]('|');let _0x268002=0x0;while(!![]){switch(_0x372156[_0x268002++]){case'0':super(_0x23374b);continue;case'1':this[_0x2f7ba6(0x200)]=_0x1839e6;continue;case'2':this[_0x2f7ba6(0x254)]=_0x199314;continue;case'3':this['detail']=_0x405e62;continue;case'4':this['name']=_0x569763['QqOnK'];continue;}break;}}}export async function fetchCloudProfile(_0x177840){const _0x2cb38d=_0x184572,_0x2355cb={'xDmVZ':function(_0x4db74b,_0x3b7b52){return _0x4db74b(_0x3b7b52);},'fZwGk':function(_0x322b98,_0x1930ea){return _0x322b98===_0x1930ea;}};try{return await apiRequest(_0x2cb38d(0x266)+_0x2355cb[_0x2cb38d(0x202)](encodeURIComponent,_0x177840));}catch(_0x1c5494){if(_0x1c5494 instanceof ApiError&&_0x2355cb['fZwGk'](_0x1c5494['status'],0x194))return null;throw _0x1c5494;}}export async function listCloudProfiles(){const _0x1fa798=_0x184572,_0x513bf8=await apiRequest('/api/v1/profiles');return _0x513bf8[_0x1fa798(0x20f)];}export async function deleteCloudProfile(_0x40f240){const _0x4c8c25=_0x184572,_0x41fbf7={'EnDwU':function(_0x251031,_0x3de119,_0x943ce6){return _0x251031(_0x3de119,_0x943ce6);},'TXAXx':function(_0x48b25d,_0x396cd8){return _0x48b25d(_0x396cd8);},'xhpvD':function(_0x211bc3,_0x27d8af){return _0x211bc3 instanceof _0x27d8af;},'fPFbs':function(_0x8a7451,_0x55f50e){return _0x8a7451===_0x55f50e;}};try{await _0x41fbf7[_0x4c8c25(0x1ea)](apiRequest,_0x4c8c25(0x266)+_0x41fbf7[_0x4c8c25(0x263)](encodeURIComponent,_0x40f240),{'method':'DELETE'});}catch(_0x2d037a){if(_0x41fbf7['xhpvD'](_0x2d037a,ApiError)&&_0x41fbf7[_0x4c8c25(0x1ee)](_0x2d037a['status'],0x194))throw new Error(_0x4c8c25(0x204)+_0x40f240+_0x4c8c25(0x259));throw _0x2d037a;}}export async function createCloudProfile(_0x3b25a6,_0x5cc87d,_0x51bf46={}){const _0x2fd2d6=_0x184572,_0xbe2650={'eVRwr':_0x2fd2d6(0x1ef),'QzYUd':'POST'},_0x25399b={'name':_0x3b25a6};if(_0x5cc87d)_0x25399b['environment_key']=_0x5cc87d;_0x51bf46[_0x2fd2d6(0x25b)]&&Object[_0x2fd2d6(0x271)](_0x51bf46[_0x2fd2d6(0x25b)])[_0x2fd2d6(0x279)]>0x0&&(_0x25399b['settings']=_0x51bf46[_0x2fd2d6(0x25b)]);if(_0x51bf46[_0x2fd2d6(0x210)])_0x25399b['username']=_0x51bf46[_0x2fd2d6(0x210)];if(_0x51bf46[_0x2fd2d6(0x208)])_0x25399b[_0x2fd2d6(0x208)]=_0x51bf46[_0x2fd2d6(0x208)];return await apiRequest(_0xbe2650[_0x2fd2d6(0x226)],{'method':_0xbe2650['QzYUd'],'body':JSON[_0x2fd2d6(0x22b)](_0x25399b)});}export async function uploadCloudProfileSession(_0x2ea8f1,_0x25c583){const _0x1e6a31=_0x184572,_0x1ad1d6={'DtwqD':function(_0x123e51,_0x3b9707,_0x3a9c6e){return _0x123e51(_0x3b9707,_0x3a9c6e);}};return await _0x1ad1d6['DtwqD'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x2ea8f1)+_0x1e6a31(0x27e),{'method':'POST','body':JSON[_0x1e6a31(0x22b)]({'session_state':_0x25c583})});}export async function saveCloudProfileCredentials(_0x28bb50,_0x550c25,_0x7acf38){const _0x5dac92=_0x184572,_0x5705a9={'wXysQ':function(_0x3d64bf,_0x1cdd18,_0x2eeb35){return _0x3d64bf(_0x1cdd18,_0x2eeb35);},'ziSAZ':function(_0x4153e6,_0x2d4711){return _0x4153e6(_0x2d4711);},'npsaQ':_0x5dac92(0x20a)};await _0x5705a9['wXysQ'](apiRequest,'/api/v1/profiles/'+_0x5705a9[_0x5dac92(0x250)](encodeURIComponent,_0x28bb50),{'method':_0x5705a9['npsaQ'],'body':JSON[_0x5dac92(0x22b)]({'username':_0x550c25,'password':_0x7acf38})});}export async function fetchAuthConfig(){const _0x5b2c68=_0x184572,_0x385b5c={'AWWtL':function(_0x57c2b5,_0x73c3f1){return _0x57c2b5(_0x73c3f1);}};try{const _0x2ecfd1=await _0x385b5c['AWWtL'](apiRequest,'/api/v1/profiles/auth-config');return _0x2ecfd1['auth_config'];}catch(_0x1bca34){return _0x1bca34 instanceof ApiError&&_0x1bca34['status']!==0x194&&console['error'](_0x5b2c68(0x21a)+_0x1bca34[_0x5b2c68(0x238)]),null;}}async function createTunnelSession(_0x19dc30){const _0x2510a3=_0x184572,_0x1f946f={'XsMIM':function(_0x59d51d,_0x1a6d82,_0xb8b51a){return _0x59d51d(_0x1a6d82,_0xb8b51a);},'YawRi':_0x2510a3(0x228)};return await _0x1f946f['XsMIM'](apiRequest,_0x1f946f['YawRi'],{'method':_0x2510a3(0x219),'body':JSON[_0x2510a3(0x22b)]({'targetUrl':_0x19dc30,'mode':_0x2510a3(0x1f0)})});}async function deleteTunnelSession(_0x789413){const _0x32c3c9=_0x184572,_0x598e17={'YmYUi':function(_0xb74327,_0x43c5ac,_0x3cbd36){return _0xb74327(_0x43c5ac,_0x3cbd36);},'QheIp':'DELETE'};await _0x598e17[_0x32c3c9(0x1f7)](apiRequest,'/api/v1/tunnel/sessions/'+_0x789413,{'method':_0x598e17[_0x32c3c9(0x272)]});}export function pickAdHocEnvKey(_0x5cd0f7){const _0x161c72=_0x184572,_0x24edcc={'blAiZ':function(_0x5c4d81,_0xfb6a02){return _0x5c4d81===_0xfb6a02;},'AxJrt':function(_0xacf9c,_0x3bc7a2){return _0xacf9c+_0x3bc7a2;}};if(!_0x5cd0f7)return null;if(_0x5cd0f7['defaultEnvironmentKey'])return _0x5cd0f7['defaultEnvironmentKey'];const _0x507057=Object[_0x161c72(0x271)](_0x5cd0f7['environments']??{});if(_0x24edcc['blAiZ'](_0x507057['length'],0x1))return _0x507057[0x0];if(_0x507057['length']===0x0)return null;throw new Error(_0x24edcc[_0x161c72(0x21b)]('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0x507057[_0x161c72(0x24c)](',\x20')+_0x161c72(0x23e),'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.'));}export async function resolveAdHocProfile(_0xea6e79=process['env']){const _0x4a3de3=_0x184572,_0x14c596={'uVocd':function(_0x4322d5,_0x363e07){return _0x4322d5(_0x363e07);},'tvuPJ':function(_0x1444d4){return _0x1444d4();},'OiJhf':function(_0x21c9d1,_0x36a53f,_0x55c7c2,_0x189565){return _0x21c9d1(_0x36a53f,_0x55c7c2,_0x189565);}},_0xca43c0=_0xea6e79[_0x4a3de3(0x225)];if(!_0xca43c0)return null;const _0x2cb927=await _0x14c596['uVocd'](fetchCloudProfile,_0xca43c0);if(_0x2cb927)return{'name':_0x2cb927[_0x4a3de3(0x276)],'profile':_0x2cb927};const _0x2deb0e=await _0x14c596['tvuPJ'](fetchAuthConfig),_0x2db4af=pickAdHocEnvKey(_0x2deb0e),_0x4a7089=_0xea6e79[_0x4a3de3(0x214)],_0x470c6e=await _0x14c596[_0x4a3de3(0x1e2)](createCloudProfile,_0xca43c0,_0x2db4af??undefined,{'username':_0xca43c0,'password':_0x4a7089});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x470c6e[_0x4a3de3(0x276)]+'\x22\x20for\x20'+_0xca43c0),{'name':_0x470c6e['name'],'profile':_0x470c6e};}export async function writeSessionToLocalCache(_0x58c2d5,_0x7a27e8,_0x203828,_0x6bfa8e,_0x549fae,_0x2975d9,_0x5a2689){const _0x2a301b=_0x184572,_0x1a25a0={'AxbIn':function(_0x3d96d9,_0x475fe6){return _0x3d96d9(_0x475fe6);},'OvVCC':function(_0x3612c5,_0x13ca0f,_0x4087ca){return _0x3612c5(_0x13ca0f,_0x4087ca);},'xtLDn':function(_0x5c3634,_0x9d0300,_0x389057){return _0x5c3634(_0x9d0300,_0x389057);},'GLsYf':function(_0xe2041d,_0x148baf,_0x4949db){return _0xe2041d(_0x148baf,_0x4949db);}},_0x3d281d=_0x1a25a0['AxbIn'](sessionCacheHash,{'orgId':_0x7a27e8,'profileName':_0x58c2d5,'effectiveBaseUrl':_0x203828,'setupHeaders':_0x6bfa8e,'invalidateOn':_0x5a2689?.['invalidateOn'],'userAgent':_0x5a2689?.['userAgent'],'clientIp':_0x5a2689?.['clientIp']}),_0x5e4c7d=_0x1a25a0[_0x2a301b(0x1e7)](getSessionCachePath,_0x3d281d,_0x58c2d5),_0x4fa36e=join(getRangerHomeDir(),_0x2a301b(0x247));!existsSync(_0x4fa36e)&&await _0x1a25a0[_0x2a301b(0x1e7)](mkdir,_0x4fa36e,{'recursive':!![]});const _0x2a8c7e={..._0x549fae};_0x2975d9&&_0x2975d9[_0x2a301b(0x279)]>0x0&&Array['isArray'](_0x2a8c7e[_0x2a301b(0x262)])&&(_0x2a8c7e['cookies']=_0x1a25a0['xtLDn'](duplicateCookiesForDomains,_0x2a8c7e[_0x2a301b(0x262)],_0x2975d9));const _0xe4cc54={'cached_at':new Date()['toISOString'](),'session_state':_0x2a8c7e};await _0x1a25a0[_0x2a301b(0x270)](writeFile,_0x5e4c7d,JSON[_0x2a301b(0x22b)](_0xe4cc54,null,0x2));const _0x50c85a=getStorageStatePath(_0x5e4c7d);return await writeFile(_0x50c85a,JSON[_0x2a301b(0x22b)](_0x2a8c7e,null,0x2)),_0x50c85a;}export async function checkLocalCache(_0x21eccb,_0x1c020c,_0x2d4854,_0x22a2b6,_0xface6a){const _0x35ef35=_0x184572,_0x3e4c17={'zuVXS':function(_0x11b0a9,_0x5d13e2){return _0x11b0a9(_0x5d13e2);},'aIYTW':function(_0x2539de,_0x434268,_0x496248){return _0x2539de(_0x434268,_0x496248);},'MMUlt':function(_0x35592e,_0x52057b,_0xa04d96){return _0x35592e(_0x52057b,_0xa04d96);},'WGrZB':_0x35ef35(0x1dc)},_0x1741f5=_0x3e4c17[_0x35ef35(0x237)](sessionCacheHash,{'orgId':_0x1c020c,'profileName':_0x21eccb,'effectiveBaseUrl':_0x2d4854,'setupHeaders':_0x22a2b6,'invalidateOn':_0xface6a?.['invalidateOn'],'userAgent':_0xface6a?.[_0x35ef35(0x267)],'clientIp':_0xface6a?.['clientIp']}),_0x5f5396=_0x3e4c17[_0x35ef35(0x1e9)](getSessionCachePath,_0x1741f5,_0x21eccb),_0x29e538=_0x3e4c17['zuVXS'](getStorageStatePath,_0x5f5396);if(!existsSync(_0x5f5396)||!_0x3e4c17['zuVXS'](existsSync,_0x29e538))return null;try{const _0x2e0d7c=await _0x3e4c17[_0x35ef35(0x245)](readFile,_0x5f5396,_0x3e4c17['WGrZB']);return JSON[_0x35ef35(0x25e)](_0x2e0d7c),{'storageStatePath':_0x29e538};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x1e1c3f,_0x258144){const _0x1287ae=_0x184572,_0x565ecf={'GumKD':function(_0x2f7635,_0x29a152){return _0x2f7635===_0x29a152;},'cdPWZ':function(_0x1d59d9,_0x46be8b){return _0x1d59d9+_0x46be8b;}};if(!_0x258144||!_0x258144['domains']?.['length'])return;let _0x485dc3;try{_0x485dc3=new URL(_0x1e1c3f);}catch{return;}const _0x46449d=[];for(const _0x3db1df of _0x258144['domains']){try{_0x46449d['push']({'raw':_0x3db1df,'url':new URL(_0x3db1df)});}catch{}}if(_0x565ecf[_0x1287ae(0x20c)](_0x46449d['length'],0x0))return;if(_0x46449d[_0x1287ae(0x20d)](_0x42ad7f=>_0x42ad7f['url']['origin']===_0x485dc3[_0x1287ae(0x25d)]))return;const _0xfaedd0=_0x46449d[_0x1287ae(0x216)](_0x992e29=>'\x22'+_0x992e29['raw']+'\x22')['join'](',\x20');console['log'](_0x565ecf['cdPWZ']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0xfaedd0+';\x20'+(_0x1287ae(0x251)+_0x1e1c3f+_0x1287ae(0x1e4)),'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.'));}export async function serverSideLogin(_0x373bde,_0x780bb1){const _0x16e93c=_0x184572,_0x5331ba={'kqlhl':function(_0x5c4b69,_0x2c8ab8){return _0x5c4b69(_0x2c8ab8);},'NphHD':function(_0x2a93df,_0x3f05e2){return _0x2a93df===_0x3f05e2;},'iFalo':'not_configured'},_0x2f578c=process['env']['RANGER_TEST_USERNAME'],_0x3e5bfc=process['env']['RANGER_TEST_PASSWORD'],_0x234b24={};if(_0x2f578c)_0x234b24['username']=_0x2f578c;if(_0x3e5bfc)_0x234b24[_0x16e93c(0x208)]=_0x3e5bfc;if(_0x780bb1?.[_0x16e93c(0x26c)])_0x234b24['force']=!![];if(_0x780bb1?.[_0x16e93c(0x24a)])_0x234b24['target_url']=_0x780bb1[_0x16e93c(0x24a)];_0x780bb1?.['tunnel']&&(_0x234b24[_0x16e93c(0x1eb)]=_0x780bb1[_0x16e93c(0x1dd)][_0x16e93c(0x241)],_0x234b24[_0x16e93c(0x278)]=_0x780bb1['tunnel'][_0x16e93c(0x26a)]);try{return await apiRequest(_0x16e93c(0x266)+_0x5331ba[_0x16e93c(0x23d)](encodeURIComponent,_0x373bde)+'/login',{'method':'POST','body':JSON[_0x16e93c(0x22b)](_0x234b24)});}catch(_0x305ee2){if(_0x305ee2 instanceof ApiError&&_0x5331ba[_0x16e93c(0x23f)](_0x305ee2[_0x16e93c(0x200)],0x190)&&_0x305ee2[_0x16e93c(0x254)]===_0x5331ba['iFalo'])return{'status':_0x16e93c(0x1f5),'error':_0x305ee2['detail']};throw _0x305ee2;}}async function serverSideLoginWithOptionalTunnel(_0x20dc38,_0x3e4e16,_0x25d862={}){const _0x2aa7d7=_0x184572,_0x3f3335={'QFJiu':_0x2aa7d7(0x26e),'ydIgn':function(_0x1faf0a,_0x8e3933){return _0x1faf0a(_0x8e3933);},'lvhoe':function(_0x34d396,_0x4fed3f){return _0x34d396(_0x4fed3f);},'JALmf':function(_0x88fa5,_0x2fed19){return _0x88fa5(_0x2fed19);},'uiwhx':function(_0x3dde8e,_0xe7b830,_0x58f23e){return _0x3dde8e(_0xe7b830,_0x58f23e);},'ZECEP':function(_0x2285e2,_0x1ee221){return _0x2285e2??_0x1ee221;},'IqEqE':_0x2aa7d7(0x215),'zJKwR':function(_0x5f5146,_0xc83c27){return _0x5f5146||_0xc83c27;},'ArAlq':'3|1|0|4|2'};if(!_0x3f3335['ydIgn'](needsTunnel,_0x3e4e16))return await serverSideLogin(_0x20dc38,{'force':_0x25d862[_0x2aa7d7(0x26c)]});let _0x503dc1=null,_0x1e31b5=null,_0x42947b=null,_0x51e926=null,_0x4f0a33=![];const _0x1c4a65={'profileName':_0x20dc38,'targetUrlHost':targetHostForTelemetry(_0x3e4e16),'tunnelRequired':!![],'forceLogin':Boolean(_0x25d862[_0x2aa7d7(0x26c)])};try{_0x25d862[_0x2aa7d7(0x268)]?.[_0x2aa7d7(0x205)]('tunnel_login_setup',_0x1c4a65),_0x503dc1=await _0x3f3335[_0x2aa7d7(0x221)](launchBrowserServer,{'headless':!![]}),_0x1e31b5=await _0x3f3335[_0x2aa7d7(0x1fd)](createTunnelSession,_0x3e4e16);const _0x50d6e1=await requireToken();_0x42947b=await _0x3f3335['lvhoe'](createTunnelBridge,{'localWsUrl':_0x503dc1[_0x2aa7d7(0x1f3)],'tunnelServerUrl':_0x1e31b5['tunnelUrl'],'sessionId':_0x1e31b5['sessionId'],'apiKey':_0x50d6e1,'onError':_0x23b084=>{_0x51e926=_0x23b084;},'onClose':()=>{const _0x151dfa=_0x2aa7d7;_0x51e926??=new Error(_0x151dfa(0x242)+_0x20dc38);},'onEvent':_0x2592e4=>trackBridgeEvent(_0x25d862['telemetry'],_0x2592e4)}),_0x25d862[_0x2aa7d7(0x268)]?.['trackPhaseEnd'](_0x2aa7d7(0x215),{..._0x1c4a65,'tunnelSessionId':_0x1e31b5['sessionId'],'localBrowserServer':!![]}),_0x4f0a33=!![];try{return _0x25d862[_0x2aa7d7(0x268)]?.['trackPhaseStart'](_0x3f3335[_0x2aa7d7(0x230)],{..._0x1c4a65,'tunnelSessionId':_0x1e31b5['sessionId']}),await _0x3f3335['uiwhx'](serverSideLogin,_0x20dc38,{'force':_0x25d862[_0x2aa7d7(0x26c)],'targetUrl':_0x3e4e16,'tunnel':{'sessionId':_0x1e31b5['sessionId'],'pwEndpoint':_0x1e31b5[_0x2aa7d7(0x26a)]}})[_0x2aa7d7(0x240)](_0x2800c1=>{const _0x1cb40d=_0x2aa7d7;return _0x25d862['telemetry']?.[_0x1cb40d(0x27a)](_0x3f3335[_0x1cb40d(0x230)],{..._0x1c4a65,'tunnelSessionId':_0x1e31b5?.[_0x1cb40d(0x241)],'loginStatus':_0x2800c1['status'],'hasSessionState':Boolean(_0x2800c1['session_state']),'hasTestOutput':Boolean(_0x2800c1['test_output']),'bridgeError':errorMessageForTelemetry(_0x51e926)}),_0x2800c1;});}catch(_0x4d10b4){await _0x25d862['telemetry']?.[_0x2aa7d7(0x1e8)]('tunnel_login_request',_0x51e926??_0x4d10b4,{..._0x1c4a65,'tunnelSessionId':_0x1e31b5[_0x2aa7d7(0x241)],'bridgeError':errorMessageForTelemetry(_0x51e926)});throw _0x3f3335[_0x2aa7d7(0x249)](_0x51e926,_0x4d10b4);}}catch(_0x1f18be){!_0x4f0a33&&await _0x25d862['telemetry']?.['trackPhaseError'](_0x3f3335[_0x2aa7d7(0x252)],_0x1f18be,{..._0x1c4a65,'tunnelSessionId':_0x1e31b5?.[_0x2aa7d7(0x241)]});throw _0x1f18be;}finally{if(_0x3f3335['zJKwR'](_0x1e31b5,_0x503dc1)||_0x42947b){const _0x593045=_0x3f3335['ArAlq']['split']('|');let _0x3efc96=0x0;while(!![]){switch(_0x593045[_0x3efc96++]){case'0':_0x503dc1&&await _0x503dc1[_0x2aa7d7(0x209)]()[_0x2aa7d7(0x1de)](()=>{});continue;case'1':_0x42947b?.[_0x2aa7d7(0x209)]();continue;case'2':_0x25d862['telemetry']?.[_0x2aa7d7(0x27a)](_0x2aa7d7(0x281),{..._0x1c4a65,'tunnelSessionId':_0x1e31b5?.[_0x2aa7d7(0x241)]});continue;case'3':_0x25d862['telemetry']?.[_0x2aa7d7(0x205)]('tunnel_login_cleanup',{..._0x1c4a65,'tunnelSessionId':_0x1e31b5?.['sessionId']});continue;case'4':_0x1e31b5&&await deleteTunnelSession(_0x1e31b5[_0x2aa7d7(0x241)])[_0x2aa7d7(0x1de)](()=>{});continue;}break;}}}}export async function manualBrowserLogin(_0x17a0f4,_0xe7f444,_0x13edd8={}){const _0x2310aa=_0x184572,_0x1fd2cc={'uqYlq':function(_0x3d46f9,_0x3d0a85){return _0x3d46f9/_0x3d0a85;},'tGNEd':function(_0x2d9e9c,_0x27c34b){return _0x2d9e9c(_0x27c34b);},'dHCuO':function(_0x3ab88a,_0x9af3c4,_0x511c2e){return _0x3ab88a(_0x9af3c4,_0x511c2e);},'nooqj':_0x2310aa(0x209),'jAsnj':function(_0x5e625a){return _0x5e625a();},'XCfdM':function(_0x51559c,_0x1ab37b){return _0x51559c+_0x1ab37b;},'Dqazz':'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','pPxZh':function(_0x25a471,_0x3a04ef){return _0x25a471>_0x3a04ef;},'koUSH':_0x2310aa(0x246),'uQUNL':function(_0x4d5443,_0x55c337){return _0x4d5443&&_0x55c337;},'dQSHX':_0x2310aa(0x23b),'vqKGW':function(_0x468c99,_0x478e1b){return _0x468c99!==_0x478e1b;},'MLnda':function(_0xfede26,_0x544303,_0x408562){return _0xfede26(_0x544303,_0x408562);},'cwhpo':'POST'};if(!_0x1fd2cc[_0x2310aa(0x1e1)](isInteractive))throw new Error(_0x1fd2cc[_0x2310aa(0x1f1)](_0x2310aa(0x224)+_0x17a0f4['name']+'\x22.\x0a',_0x1fd2cc['Dqazz'])+'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.');const _0x3fa24a=_0xe7f444&&_0x1fd2cc[_0x2310aa(0x234)](_0xe7f444['domains']['length'],0x0)?_0xe7f444[_0x2310aa(0x27c)][0x0]:'about:blank';console['log'](_0x1fd2cc['koUSH']),console[_0x2310aa(0x21c)](_0x2310aa(0x206)),await new Promise(_0x71aeb0=>setTimeout(_0x71aeb0,0x7d0));const _0x280009=await chromium[_0x2310aa(0x20e)]({'headless':![]});let _0x564497=null;try{const _0x499f56={'ignoreHTTPSErrors':!![]};_0xe7f444?.[_0x2310aa(0x1fc)]&&(_0x499f56[_0x2310aa(0x24b)]=_0xe7f444['setupHeaders']);const _0x4d48d4=await _0x280009[_0x2310aa(0x280)](_0x499f56);await addProfileSetupBanner(_0x4d48d4);const _0x195784=await _0x4d48d4[_0x2310aa(0x260)]();await _0x195784['goto'](_0x3fa24a);let _0x35f0b9=![];await new Promise(_0x378141=>{const _0x3e4788=_0x2310aa,_0x20b17e={'IHusB':function(_0x54c477,_0x4b666a){const _0x16f49f=_0x4cf0;return _0x1fd2cc[_0x16f49f(0x26f)](_0x54c477,_0x4b666a);},'WMJjh':function(_0xbf9069,_0x6b6ce4){const _0x2c5517=_0x4cf0;return _0x1fd2cc[_0x2c5517(0x25c)](_0xbf9069,_0x6b6ce4);},'pxwQo':function(_0x24ddc9){return _0x24ddc9();}},_0x225747=_0x1fd2cc['dHCuO'](setTimeout,()=>{const _0x59a223=_0x4cf0;_0x35f0b9=!![],console[_0x59a223(0x21d)](_0x59a223(0x232)+_0x20b17e['IHusB'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x378141();},MANUAL_LOGIN_TIMEOUT_MS);_0x195784['on'](_0x1fd2cc[_0x3e4788(0x1f4)],async()=>{const _0x525ae7=_0x3e4788;_0x20b17e[_0x525ae7(0x201)](clearTimeout,_0x225747);try{const _0x17dd45=await _0x4d48d4[_0x525ae7(0x22a)]();_0x564497=_0x17dd45;}catch{}_0x20b17e['pxwQo'](_0x378141);});});if(_0x1fd2cc[_0x2310aa(0x23c)](_0x35f0b9,!_0x564497))throw new Error(_0x1fd2cc[_0x2310aa(0x233)]);}finally{await _0x280009[_0x2310aa(0x209)]()[_0x2310aa(0x1de)](()=>{});}if(!_0x564497)throw new Error(_0x2310aa(0x248));return _0x1fd2cc[_0x2310aa(0x222)](_0x13edd8[_0x2310aa(0x1e6)],![])&&await _0x1fd2cc[_0x2310aa(0x243)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x17a0f4[_0x2310aa(0x276)])+'/session',{'method':_0x1fd2cc[_0x2310aa(0x1fe)],'body':JSON[_0x2310aa(0x22b)]({'session_state':_0x564497,'updated_by':'cli:manual-login'})}),{'sessionState':_0x564497};}export async function promptSaveCredentials(_0x5da02c){const _0x62fabd=_0x184572,_0x274404={'fRLvv':function(_0x380024,_0x13982e){return _0x380024||_0x13982e;},'ILXmL':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','csuVW':function(_0x2187ff,_0x467df7,_0x11d383){return _0x2187ff(_0x467df7,_0x11d383);},'upmVj':_0x62fabd(0x20a)},_0x5160b1=process[_0x62fabd(0x256)][_0x62fabd(0x225)],_0x437f81=process[_0x62fabd(0x256)]['RANGER_TEST_PASSWORD'];if(_0x274404['fRLvv'](!_0x5160b1,!_0x437f81))return;if(!isInteractive())return;const {save:_0x23c11d}=await _0x4e7ffc['prompt']([{'type':_0x62fabd(0x231),'name':_0x62fabd(0x239),'message':_0x274404['ILXmL'],'default':![]}]);if(!_0x23c11d)return;await _0x274404['csuVW'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x5da02c),{'method':_0x274404[_0x62fabd(0x1f9)],'body':JSON['stringify']({'username':_0x5160b1,'password':_0x437f81})}),console[_0x62fabd(0x21c)]('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0x2f0b2b,_0x270413={}){const _0x9a693=_0x184572,_0x5253d9={'XOhAe':function(_0x3d7f8a){return _0x3d7f8a();},'DIxCv':function(_0x326d81,_0x3fba33){return _0x326d81===_0x3fba33;},'VofsB':'string','NYGRV':function(_0x479c65,_0x4b28aa){return _0x479c65||_0x4b28aa;},'kTWnS':function(_0x55bda2,_0x1356b7){return _0x55bda2(_0x1356b7);},'qMBng':function(_0x277b28,_0x2fb315){return _0x277b28>_0x2fb315;},'zNOTc':function(_0x2b8a06,_0x312a1b){return _0x2b8a06(_0x312a1b);},'aeibO':function(_0x394967,_0xf4ef50,_0x4fdce0,_0x5420da,_0x5c8ee4,_0x4a0523){return _0x394967(_0xf4ef50,_0x4fdce0,_0x5420da,_0x5c8ee4,_0x4a0523);},'WxglA':function(_0x21cb25,_0x1cecca,_0x59dfa3){return _0x21cb25(_0x1cecca,_0x59dfa3);},'kPQnv':function(_0x1f1197,_0xd7afef,_0x13e82e){return _0x1f1197(_0xd7afef,_0x13e82e);},'VHHSl':function(_0x1e1c75,_0x57fda2){return _0x1e1c75(_0x57fda2);},'yWREa':function(_0x20299d,_0x228c97,_0x5dd9cc,_0x1e0eb1){return _0x20299d(_0x228c97,_0x5dd9cc,_0x1e0eb1);},'WEznm':function(_0x3ca172,_0x246cca,_0xd29d62){return _0x3ca172(_0x246cca,_0xd29d62);},'amRxQ':'not_configured','HSwQG':'\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','vUSPj':'\x20\x20Login\x20successful.\x20Session\x20cached.','OJKNW':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','PvcgX':_0x9a693(0x27d),'GsQxl':function(_0x3f7891,_0x3ea6a5,_0x5cd6f0,_0x2eb5b4){return _0x3f7891(_0x3ea6a5,_0x5cd6f0,_0x2eb5b4);}},_0x5acdc3=_0x2f0b2b[_0x9a693(0x25b)]??{},_0x17bfad=await _0x5253d9[_0x9a693(0x277)](fetchAuthConfig),_0x4650bf=_0x17bfad?resolveAuthEnvironmentLocally(_0x17bfad,_0x2f0b2b[_0x9a693(0x1ed)]):null,_0x32c49d=typeof _0x4650bf?.['loginInstructions']==='string'&&_0x4650bf['loginInstructions']['trim']()?_0x4650bf['loginInstructions']:undefined,_0xf9c7df=_0x5253d9['DIxCv'](typeof _0x5acdc3[_0x9a693(0x258)],_0x5253d9[_0x9a693(0x1f2)])&&_0x5acdc3[_0x9a693(0x258)][_0x9a693(0x217)]()?_0x5acdc3[_0x9a693(0x258)]:undefined,_0x4268d2=_0x5253d9['NYGRV'](_0xf9c7df,!_0x32c49d)?_0x5acdc3:{..._0x5acdc3,'loginInstructions':_0x32c49d},_0x1673a9=Boolean(_0x4268d2['loginInstructions']?.['trim']()),_0x45c579=_0x5253d9['kTWnS'](Boolean,_0x5acdc3[_0x9a693(0x274)]||_0x4650bf?.[_0x9a693(0x274)]),_0x11adab=_0x4650bf?.[_0x9a693(0x27c)],_0x297a7e=_0x5acdc3[_0x9a693(0x1fc)],_0x47ee59=_0x297a7e??_0x4650bf?.[_0x9a693(0x1fc)],_0x188d35=_0x270413['effectiveBaseUrl']??_0x5acdc3[_0x9a693(0x275)]??(_0x11adab&&_0x5253d9['qMBng'](_0x11adab[_0x9a693(0x279)],0x0)?_0x11adab[0x0]:''),_0xa0d383=_0x188d35?_0x5253d9['zNOTc'](needsTunnel,_0x188d35):![],_0x387dad={'invalidateOn':_0x4650bf?.[_0x9a693(0x229)],'userAgent':_0x4650bf?.[_0x9a693(0x207)]?.['userAgent']??_0x5acdc3[_0x9a693(0x267)]};_0x45c579&&console[_0x9a693(0x21c)](_0x9a693(0x1fa)+_0x2f0b2b['name']+_0x9a693(0x264));if(!_0x45c579){const _0x16f619=await _0x5253d9[_0x9a693(0x1df)](checkLocalCache,_0x2f0b2b[_0x9a693(0x276)],_0x2f0b2b['organizationId'],_0x188d35,_0x47ee59,_0x387dad);if(_0x16f619){if(_0x188d35&&!_0xa0d383){const _0x163c64=await isCachedSessionLive(_0x16f619[_0x9a693(0x211)],_0x188d35,{'sessionCheckPath':_0x4650bf?.['sessionCheckPath'],'setupHeaders':_0x47ee59},{'launchBrowser':launchRealBrowser});if(_0x163c64)return console['log']('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x2f0b2b[_0x9a693(0x276)]+'\x22'),{'authPath':_0x16f619[_0x9a693(0x211)],'settings':_0x4268d2,'resolvedEnv':_0x4650bf};console['log'](_0x9a693(0x26d)+_0x2f0b2b['name']+_0x9a693(0x1fb)),_0x5253d9['WxglA'](emitSessionValidationHint,_0x188d35,_0x4650bf);}else return _0xa0d383&&console['log']('\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x2f0b2b['name']+'\x22'),{'authPath':_0x16f619['storageStatePath'],'settings':_0x4268d2,'resolvedEnv':_0x4650bf};}}if(!_0x45c579&&_0x2f0b2b[_0x9a693(0x24d)]){if(_0xa0d383)console[_0x9a693(0x21c)]('\x20\x20Skipping\x20cloud\x20session\x20for\x20local\x20target\x20\x22'+_0x188d35+_0x9a693(0x25a)+_0x2f0b2b['name']+'\x22');else{const _0x581f40=await writeSessionToLocalCache(_0x2f0b2b[_0x9a693(0x276)],_0x2f0b2b[_0x9a693(0x27f)],_0x188d35,_0x47ee59,_0x2f0b2b['sessionState'],_0x11adab,_0x387dad);if(_0x188d35){const _0x4df15f=await isCachedSessionLive(_0x581f40,_0x188d35,{'sessionCheckPath':_0x4650bf?.['sessionCheckPath'],'setupHeaders':_0x47ee59},{'launchBrowser':launchRealBrowser});if(_0x4df15f)return console['log'](_0x9a693(0x24f)+_0x2f0b2b[_0x9a693(0x276)]+_0x9a693(0x1e5)),{'authPath':_0x581f40,'settings':_0x4268d2,'resolvedEnv':_0x4650bf};console[_0x9a693(0x21c)](_0x9a693(0x227)+_0x2f0b2b[_0x9a693(0x276)]+_0x9a693(0x261)),_0x5253d9['kPQnv'](emitSessionValidationHint,_0x188d35,_0x4650bf);}else return{'authPath':_0x581f40,'settings':_0x4268d2,'resolvedEnv':_0x4650bf};}}if(_0x1673a9)return console[_0x9a693(0x21c)](_0x9a693(0x22d)+_0x2f0b2b[_0x9a693(0x276)]+_0x9a693(0x23a)),{'authPath':undefined,'settings':_0x4268d2,'resolvedEnv':_0x4650bf};console['log'](_0x9a693(0x22d)+_0x2f0b2b['name']+'\x22,\x20attempting\x20login...');const _0x304ad4=Boolean(process['env'][_0x9a693(0x225)])&&_0x5253d9[_0x9a693(0x220)](Boolean,process[_0x9a693(0x256)]['RANGER_TEST_PASSWORD']),_0x4069c8=_0x5253d9[_0x9a693(0x1e0)](Boolean,_0x2f0b2b['username']);if(_0x304ad4||_0x4069c8)try{const _0x38211d=_0x188d35?await _0x5253d9['yWREa'](serverSideLoginWithOptionalTunnel,_0x2f0b2b[_0x9a693(0x276)],_0x188d35,{'force':_0x45c579,'telemetry':_0x270413['telemetry']}):await _0x5253d9[_0x9a693(0x22c)](serverSideLogin,_0x2f0b2b[_0x9a693(0x276)],{'force':_0x45c579});if(_0x5253d9[_0x9a693(0x213)](_0x38211d['status'],_0x5253d9['amRxQ']))console[_0x9a693(0x21c)](_0x5253d9['HSwQG']);else{if(_0x5253d9[_0x9a693(0x213)](_0x38211d['status'],'success')&&_0x38211d['session_state']){console['log'](_0x5253d9[_0x9a693(0x255)]);const _0x159192=await writeSessionToLocalCache(_0x2f0b2b['name'],_0x2f0b2b[_0x9a693(0x27f)],_0x188d35,_0x47ee59,_0x38211d['session_state'],_0x11adab,_0x387dad);return _0x304ad4&&!_0x4069c8&&await promptSaveCredentials(_0x2f0b2b['name']),{'authPath':_0x159192,'settings':_0x4268d2,'resolvedEnv':_0x4650bf};}else _0x38211d[_0x9a693(0x22e)]&&(console[_0x9a693(0x21c)](_0x5253d9['OJKNW']),console['log'](_0x38211d['test_output'])),console[_0x9a693(0x21c)](_0x5253d9['PvcgX']);}}catch(_0x13cbde){console[_0x9a693(0x21c)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x13cbde instanceof Error?_0x13cbde[_0x9a693(0x238)]:String(_0x13cbde))),console[_0x9a693(0x21c)](_0x5253d9['PvcgX']);}const _0x399358=_0x4650bf?{..._0x4650bf,'setupHeaders':_0x47ee59}:_0x188d35?{'key':_0x2f0b2b[_0x9a693(0x1ed)]??'','domains':[_0x188d35],'setupHeaders':_0x47ee59}:null,{sessionState:_0x44624a}=await _0x5253d9[_0x9a693(0x1ec)](manualBrowserLogin,_0x2f0b2b,_0x399358,{'persistSessionState':!_0xa0d383}),_0x4b1619=await writeSessionToLocalCache(_0x2f0b2b['name'],_0x2f0b2b['organizationId'],_0x188d35,_0x47ee59,_0x44624a,_0x11adab,_0x387dad);return{'authPath':_0x4b1619,'settings':_0x4268d2,'resolvedEnv':_0x4650bf};}
1
+ const _0x136a80=_0x318f;(function(_0x9d5796,_0x1a1776){const _0x195ece=_0x318f,_0x2a8a4d=_0x9d5796();while(!![]){try{const _0x1e3a1e=-parseInt(_0x195ece(0xc6))/0x1*(parseInt(_0x195ece(0x11f))/0x2)+-parseInt(_0x195ece(0xd2))/0x3*(parseInt(_0x195ece(0xca))/0x4)+-parseInt(_0x195ece(0xbb))/0x5+parseInt(_0x195ece(0xa8))/0x6+-parseInt(_0x195ece(0x114))/0x7+-parseInt(_0x195ece(0x10f))/0x8+parseInt(_0x195ece(0x121))/0x9;if(_0x1e3a1e===_0x1a1776)break;else _0x2a8a4d['push'](_0x2a8a4d['shift']());}catch(_0x2002b7){_0x2a8a4d['push'](_0x2a8a4d['shift']());}}}(_0x17c2,0x1ed41));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x318f(_0x1b4d24,_0x1c0ed9){_0x1b4d24=_0x1b4d24-0x9e;const _0x17c230=_0x17c2();let _0x318f25=_0x17c230[_0x1b4d24];return _0x318f25;}import _0x1d08e0 from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,needsTunnel,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0x141a45){const _0xfe54db=_0x318f,_0x2b08da={'exXMu':_0xfe54db(0xee)};try{return new URL(_0x141a45)['host'];}catch{return _0x2b08da['exXMu'];}}function errorMessageForTelemetry(_0x5ef999){return _0x5ef999 instanceof Error?_0x5ef999['message']:undefined;}function trackBridgeEvent(_0x8a5f3f,_0x520a90){const _0x359b34=_0x318f,_0x3b9ab2={'qCqvV':_0x359b34(0x108),'iCgTT':_0x359b34(0xb4)};if(!_0x8a5f3f)return;const _0xc91cc9={'tunnelSessionId':_0x520a90['sessionId'],'tunnelEventType':_0x520a90['type'],'connectionId':_0x520a90[_0x359b34(0x109)],'code':_0x520a90['code'],'reason':_0x520a90['reason'],'error':_0x520a90[_0x359b34(0xd0)],'elapsedMs':_0x520a90['elapsedMs'],'activeLocalConnections':_0x520a90[_0x359b34(0xd4)],'pendingLocalConnections':_0x520a90['pendingLocalConnections']};_0x8a5f3f['trackPhaseEnd']('tunnel_bridge_event',_0xc91cc9),(_0x520a90[_0x359b34(0x10a)]===_0x3b9ab2['qCqvV']||_0x520a90[_0x359b34(0x10a)]===_0x3b9ab2[_0x359b34(0xe5)])&&void _0x8a5f3f[_0x359b34(0xd6)]('tunnel_bridge',new Error(_0x520a90[_0x359b34(0xd0)]??_0x520a90[_0x359b34(0x10a)]),_0xc91cc9);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x2ea254=_0x318f,_0x2a4bd9={'sBfjD':function(_0x2b5b28){return _0x2b5b28();},'WUyJw':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x23723f=await _0x2a4bd9[_0x2ea254(0x106)](getToken);if(!_0x23723f)throw new Error(_0x2a4bd9[_0x2ea254(0xfd)]);return _0x23723f;}async function apiRequest(_0x3f6fbe,_0x266277={}){const _0x59bdb0=_0x318f,_0x3807b1={'HIyDJ':function(_0x1c5735){return _0x1c5735();},'UKtrG':function(_0x7109b7,_0x5bd5f9,_0x42dca2){return _0x7109b7(_0x5bd5f9,_0x42dca2);},'yLCUs':_0x59bdb0(0x125),'aQkqx':function(_0x13e831,_0x477ba4){return _0x13e831===_0x477ba4;},'teKir':'string'},_0x358083=await requireToken(),_0x48422e=_0x3807b1['HIyDJ'](getApiBaseUrl),_0x28fe68=await _0x3807b1[_0x59bdb0(0xe3)](fetch,''+_0x48422e+_0x3f6fbe,{..._0x266277,'headers':{'Authorization':_0x59bdb0(0xf8)+_0x358083,'Content-Type':_0x3807b1['yLCUs'],..._0x266277['headers']??{}}});if(!_0x28fe68['ok']){let _0x137092='',_0x120e98;try{const _0x4ac2b9=await _0x28fe68['json'](),_0x204b70=(_0x3807b1['aQkqx'](typeof _0x4ac2b9['error'],_0x3807b1['teKir'])?_0x4ac2b9[_0x59bdb0(0xd0)]:undefined)??JSON[_0x59bdb0(0x112)](_0x4ac2b9);_0x137092=_0x204b70;typeof _0x4ac2b9['test_output']==='string'&&_0x4ac2b9[_0x59bdb0(0xd9)]&&(_0x137092=_0x137092+'\x0a'+_0x4ac2b9[_0x59bdb0(0xd9)]);if(typeof _0x4ac2b9['code']==='string')_0x120e98=_0x4ac2b9[_0x59bdb0(0xce)];}catch{_0x137092=_0x28fe68['statusText'];}throw new ApiError(_0x59bdb0(0x110)+_0x3f6fbe+'\x20failed\x20('+_0x28fe68['status']+'):\x20'+_0x137092,_0x28fe68[_0x59bdb0(0xeb)],_0x137092,_0x120e98);}if(_0x3807b1['aQkqx'](_0x28fe68['status'],0xcc))return undefined;return _0x28fe68['json']();}export class ApiError extends Error{[_0x136a80(0xeb)];['detail'];['code'];constructor(_0x112db1,_0x557a12,_0x1446d3,_0x5ebd86){const _0x6fa314=_0x136a80,_0x42c326={'pYaDx':_0x6fa314(0xcf)};super(_0x112db1),this[_0x6fa314(0xeb)]=_0x557a12,this['detail']=_0x1446d3,this['code']=_0x5ebd86,this['name']=_0x42c326['pYaDx'];}}export async function fetchCloudProfile(_0x4ab070){const _0x129b83=_0x136a80,_0x2743a9={'gxvGk':function(_0x19e45a,_0x5ddba7){return _0x19e45a===_0x5ddba7;}};try{return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x4ab070));}catch(_0x57da6a){if(_0x57da6a instanceof ApiError&&_0x2743a9[_0x129b83(0xfe)](_0x57da6a['status'],0x194))return null;throw _0x57da6a;}}export async function listCloudProfiles(){const _0x322f47=_0x136a80,_0x5ed712={'ysOoZ':function(_0x4715bc,_0x1c5d45){return _0x4715bc(_0x1c5d45);}},_0x250243=await _0x5ed712[_0x322f47(0xb0)](apiRequest,'/api/v1/profiles');return _0x250243[_0x322f47(0xcc)];}export async function deleteCloudProfile(_0x25afc3){const _0x4d713a=_0x136a80,_0x554b36={'WUvgb':function(_0xeac05,_0x537b10,_0x2d05b2){return _0xeac05(_0x537b10,_0x2d05b2);},'kxbdy':'DELETE'};try{await _0x554b36[_0x4d713a(0xfb)](apiRequest,_0x4d713a(0xa6)+encodeURIComponent(_0x25afc3),{'method':_0x554b36['kxbdy']});}catch(_0x183d48){if(_0x183d48 instanceof ApiError&&_0x183d48['status']===0x194)throw new Error('Cloud\x20profile\x20\x22'+_0x25afc3+'\x22\x20not\x20found.');throw _0x183d48;}}export async function createCloudProfile(_0x17c4db,_0x280f31,_0x31568e={}){const _0x247146=_0x136a80,_0x5eac6f={'FExrf':function(_0x5074ac,_0x1e96b9){return _0x5074ac>_0x1e96b9;},'sgxKI':function(_0x442141,_0x5bba94,_0x4878f6){return _0x442141(_0x5bba94,_0x4878f6);},'ZpHxJ':'/api/v1/profiles'},_0x1894f4={'name':_0x17c4db};if(_0x280f31)_0x1894f4[_0x247146(0x132)]=_0x280f31;_0x31568e[_0x247146(0x9f)]&&_0x5eac6f['FExrf'](Object['keys'](_0x31568e['settings'])['length'],0x0)&&(_0x1894f4['settings']=_0x31568e[_0x247146(0x9f)]);if(_0x31568e['username'])_0x1894f4[_0x247146(0x12a)]=_0x31568e[_0x247146(0x12a)];if(_0x31568e['password'])_0x1894f4['password']=_0x31568e['password'];return await _0x5eac6f[_0x247146(0xe8)](apiRequest,_0x5eac6f[_0x247146(0x127)],{'method':'POST','body':JSON['stringify'](_0x1894f4)});}export async function uploadCloudProfileSession(_0x2f3a32,_0x2248fc){const _0x2e39e9=_0x136a80,_0x498c5d={'jaKqS':function(_0x32a52e,_0x48fb98,_0x3002d7){return _0x32a52e(_0x48fb98,_0x3002d7);},'guMXb':'POST'};return await _0x498c5d[_0x2e39e9(0xb7)](apiRequest,_0x2e39e9(0xa6)+encodeURIComponent(_0x2f3a32)+'/session',{'method':_0x498c5d['guMXb'],'body':JSON[_0x2e39e9(0x112)]({'session_state':_0x2248fc})});}export async function saveCloudProfileCredentials(_0x501bf1,_0x429ad5,_0x396f85){const _0x11653f=_0x136a80,_0x1d4745={'VOIJs':function(_0x33a2f5,_0x3228fd){return _0x33a2f5(_0x3228fd);},'NnDQO':_0x11653f(0xf7)};await apiRequest(_0x11653f(0xa6)+_0x1d4745['VOIJs'](encodeURIComponent,_0x501bf1),{'method':_0x1d4745[_0x11653f(0x11e)],'body':JSON['stringify']({'username':_0x429ad5,'password':_0x396f85})});}export async function fetchAuthConfig(){const _0x962ed1=_0x136a80,_0x4bca8e={'MEKrF':'/api/v1/profiles/auth-config','dAoiG':function(_0x48f188,_0x4f6bcf){return _0x48f188!==_0x4f6bcf;}};try{const _0x31c5ca=await apiRequest(_0x4bca8e['MEKrF']);return _0x31c5ca[_0x962ed1(0xf9)];}catch(_0x2d6bbe){return _0x2d6bbe instanceof ApiError&&_0x4bca8e['dAoiG'](_0x2d6bbe['status'],0x194)&&console['error']('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x2d6bbe[_0x962ed1(0x10e)]),null;}}async function createTunnelSession(_0x5acf5f){const _0x5b5eda=_0x136a80,_0x4b1d41={'CsyTw':function(_0x2b4c72,_0x2a37b1,_0x347669){return _0x2b4c72(_0x2a37b1,_0x347669);},'jjzal':_0x5b5eda(0xb3),'EgAqF':'agent'};return await _0x4b1d41[_0x5b5eda(0xf1)](apiRequest,_0x4b1d41[_0x5b5eda(0x115)],{'method':_0x5b5eda(0xa3),'body':JSON['stringify']({'targetUrl':_0x5acf5f,'mode':_0x4b1d41[_0x5b5eda(0xa2)]})});}function _0x17c2(){const _0x1aaeef=['userAgent','length','environment_key','gvEXc','raw','pw_endpoint','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','TePkx','settings','mzZNm','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','EgAqF','POST','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','khqQS','/api/v1/profiles/','\x20\x20Skipping\x20cloud\x20session\x20for\x20local\x20target\x20\x22','37884zeHGMX','OwSGy','browserOptions','prompt','tunnel_login_cleanup','\x22\x20failed\x20validation\x20—\x20refreshing...','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','UkJIE','ysOoZ','sessionId','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','/api/v1/tunnel/sessions','local_ws_error','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','EjsND','jaKqS','VXiYB','force','HJoxE','908225vXAuDJ','WqFhh','eHfjc','log','launch','wmEpx','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','tunnelUrl','EzxQd','hpHeg','UPmbi','10567cUHgGP','domains','trackPhaseStart','yFZvV','194436IkqEOp','JXvzW','profiles','sHRvE','code','ApiError','error','defaultEnvironmentKey','6rhWhLE','/api/v1/tunnel/sessions/','activeLocalConnections','telemetry','trackPhaseError','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...','test_output','success','auoEy','wsEndpoint','LotYq','session_state','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','trim','catch','loginInstructions','UKtrG','iPcdR','iCgTT','parse','sessionCheckPath','sgxKI','env','TxvXC','status','wxkCU','about:blank','invalid-url','cookies','KKUeE','CsyTw','environmentKey','QboTv','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','invalidateOn','PUT','Bearer\x20','auth_config','RANGER_TEST_PASSWORD','WUvgb','gSDzl','WUyJw','gxvGk','yFGLm','\x20\x20Login\x20successful.\x20Session\x20cached.','forceLogin','toISOString','storageState','setupHeaders','origin','sBfjD','trackPhaseEnd','tunnel_error','connectionId','type','split','keys','some','message','1706528rwBQol','API\x20request\x20','\x20\x20No\x20live\x20session\x20for\x20\x22','stringify','name','1384502pnzXYm','jjzal','clientIp','cdbDK','\x22;\x20proceeding\x20with\x20loginInstructions.',').\x20','chOnN','confirm','persistSessionState','HtNFX','NnDQO','42AFWJYT','storageStatePath','9286479xExeMB','close','organizationId','/login','application/json','join','ZpHxJ','\x22,\x20cached\x20locally','\x22.\x0a','username','you\x27re\x20now\x20at\x20\x22','HIYlK','wVpRZ','RANGER_TEST_USERNAME','extraHTTPHeaders'];_0x17c2=function(){return _0x1aaeef;};return _0x17c2();}async function deleteTunnelSession(_0x33a7d3){const _0x421d0e=_0x136a80;await apiRequest(_0x421d0e(0xd3)+_0x33a7d3,{'method':'DELETE'});}export function pickAdHocEnvKey(_0x24d97b){const _0x46c236=_0x136a80,_0x3369ee={'wVpRZ':function(_0x3e4596,_0xe20754){return _0x3e4596===_0xe20754;}};if(!_0x24d97b)return null;if(_0x24d97b[_0x46c236(0xd1)])return _0x24d97b['defaultEnvironmentKey'];const _0x6a869f=Object[_0x46c236(0x10c)](_0x24d97b['environments']??{});if(_0x3369ee[_0x46c236(0x12d)](_0x6a869f['length'],0x1))return _0x6a869f[0x0];if(_0x6a869f['length']===0x0)return null;throw new Error('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0x6a869f[_0x46c236(0x126)](',\x20')+_0x46c236(0x119)+'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.');}export async function resolveAdHocProfile(_0x3daa72=process['env']){const _0x564425=_0x136a80,_0x28adf8={'auoEy':function(_0x3a1152,_0x30a385){return _0x3a1152(_0x30a385);},'khqQS':function(_0x3822b7,_0x42643e,_0x49eec5,_0x26b02a){return _0x3822b7(_0x42643e,_0x49eec5,_0x26b02a);},'RgTwE':function(_0x8e11aa,_0xc6cb87){return _0x8e11aa??_0xc6cb87;}},_0x14e950=_0x3daa72[_0x564425(0x12e)];if(!_0x14e950)return null;const _0x24213e=await fetchCloudProfile(_0x14e950);if(_0x24213e)return{'name':_0x24213e[_0x564425(0x113)],'profile':_0x24213e};const _0x3f0cb4=await fetchAuthConfig(),_0x529a49=_0x28adf8[_0x564425(0xdb)](pickAdHocEnvKey,_0x3f0cb4),_0x598716=_0x3daa72['RANGER_TEST_PASSWORD'],_0x33c01e=await _0x28adf8[_0x564425(0xa5)](createCloudProfile,_0x14e950,_0x28adf8['RgTwE'](_0x529a49,undefined),{'username':_0x14e950,'password':_0x598716});return console[_0x564425(0xbe)]('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x33c01e[_0x564425(0x113)]+'\x22\x20for\x20'+_0x14e950),{'name':_0x33c01e[_0x564425(0x113)],'profile':_0x33c01e};}export async function writeSessionToLocalCache(_0x1e09a5,_0x407cb6,_0x2cbf5e,_0x30dd76,_0x39761c,_0x427d8e,_0x47dee6){const _0x578d7d=_0x136a80,_0x2ded3e={'NsTrQ':function(_0x49e838,_0x4c1d5f){return _0x49e838(_0x4c1d5f);},'HHoKq':function(_0x5a52ea,_0x15faf9,_0x42f432){return _0x5a52ea(_0x15faf9,_0x42f432);},'TXMPx':function(_0x168cfc){return _0x168cfc();},'yFGLm':'auth','sfHyn':function(_0x17d8ad,_0x4344c3,_0xce7032){return _0x17d8ad(_0x4344c3,_0xce7032);},'EjsND':function(_0x9fb34,_0x25a72e,_0x253030){return _0x9fb34(_0x25a72e,_0x253030);},'wgnPs':function(_0x4e4950,_0x25b2e5,_0x1738fb){return _0x4e4950(_0x25b2e5,_0x1738fb);}},_0x43a9cf=_0x2ded3e['NsTrQ'](sessionCacheHash,{'orgId':_0x407cb6,'profileName':_0x1e09a5,'effectiveBaseUrl':_0x2cbf5e,'setupHeaders':_0x30dd76,'invalidateOn':_0x47dee6?.['invalidateOn'],'userAgent':_0x47dee6?.['userAgent'],'clientIp':_0x47dee6?.[_0x578d7d(0x116)]}),_0x1bf774=_0x2ded3e['HHoKq'](getSessionCachePath,_0x43a9cf,_0x1e09a5),_0x39ccb9=join(_0x2ded3e['TXMPx'](getRangerHomeDir),_0x2ded3e[_0x578d7d(0xff)]);!existsSync(_0x39ccb9)&&await _0x2ded3e['sfHyn'](mkdir,_0x39ccb9,{'recursive':!![]});const _0x5a3ea7={..._0x39761c};_0x427d8e&&_0x427d8e['length']>0x0&&Array['isArray'](_0x5a3ea7[_0x578d7d(0xef)])&&(_0x5a3ea7['cookies']=_0x2ded3e[_0x578d7d(0xb6)](duplicateCookiesForDomains,_0x5a3ea7['cookies'],_0x427d8e));const _0x1c68bb={'cached_at':new Date()[_0x578d7d(0x102)](),'session_state':_0x5a3ea7};await _0x2ded3e['wgnPs'](writeFile,_0x1bf774,JSON[_0x578d7d(0x112)](_0x1c68bb,null,0x2));const _0x519452=_0x2ded3e['NsTrQ'](getStorageStatePath,_0x1bf774);return await writeFile(_0x519452,JSON['stringify'](_0x5a3ea7,null,0x2)),_0x519452;}export async function checkLocalCache(_0xd3c86f,_0x42d90c,_0x3e507f,_0x416aa3,_0x283545){const _0x2e6b52=_0x136a80,_0x33d654={'TePkx':function(_0x3e0758,_0x2f8ac3,_0x1a2aa7){return _0x3e0758(_0x2f8ac3,_0x1a2aa7);},'QboTv':function(_0x32b001,_0x30c68c){return _0x32b001(_0x30c68c);}},_0x4dc3e3=sessionCacheHash({'orgId':_0x42d90c,'profileName':_0xd3c86f,'effectiveBaseUrl':_0x3e507f,'setupHeaders':_0x416aa3,'invalidateOn':_0x283545?.[_0x2e6b52(0xf6)],'userAgent':_0x283545?.['userAgent'],'clientIp':_0x283545?.[_0x2e6b52(0x116)]}),_0x21d177=_0x33d654[_0x2e6b52(0x9e)](getSessionCachePath,_0x4dc3e3,_0xd3c86f),_0xa26c7d=getStorageStatePath(_0x21d177);if(!existsSync(_0x21d177)||!_0x33d654[_0x2e6b52(0xf3)](existsSync,_0xa26c7d))return null;try{const _0x322784=await _0x33d654[_0x2e6b52(0x9e)](readFile,_0x21d177,'utf-8');return JSON[_0x2e6b52(0xe6)](_0x322784),{'storageStatePath':_0xa26c7d};}catch{return null;}}function launchRealBrowser(){const _0x59c771=_0x136a80;return chromium[_0x59c771(0xbf)]({'headless':!![]});}function emitSessionValidationHint(_0x156006,_0x13a6aa){const _0x206a38=_0x136a80,_0x5bc22c={'SYqRv':function(_0x5b298b,_0x1c044b){return _0x5b298b===_0x1c044b;},'yFZvV':function(_0x17741f,_0x4a6933){return _0x17741f+_0x4a6933;}};if(!_0x13a6aa||!_0x13a6aa['domains']?.['length'])return;let _0x4af90a;try{_0x4af90a=new URL(_0x156006);}catch{return;}const _0x1831b2=[];for(const _0x11706c of _0x13a6aa[_0x206a38(0xc7)]){try{_0x1831b2['push']({'raw':_0x11706c,'url':new URL(_0x11706c)});}catch{}}if(_0x5bc22c['SYqRv'](_0x1831b2[_0x206a38(0x131)],0x0))return;if(_0x1831b2[_0x206a38(0x10d)](_0x1fdf91=>_0x1fdf91['url'][_0x206a38(0x105)]===_0x4af90a[_0x206a38(0x105)]))return;const _0x5abfd6=_0x1831b2['map'](_0x1b972f=>'\x22'+_0x1b972f[_0x206a38(0x134)]+'\x22')['join'](',\x20');console[_0x206a38(0xbe)](_0x5bc22c[_0x206a38(0xc9)](_0x206a38(0xf4)+_0x5abfd6+';\x20',_0x206a38(0x12b)+_0x156006+_0x206a38(0xb2))+_0x206a38(0xae));}export async function serverSideLogin(_0x1a1dde,_0x1cf97c){const _0x3dd3c6=_0x136a80,_0x4d4e9a={'fSQYI':function(_0x276513,_0xcd2bc5){return _0x276513(_0xcd2bc5);},'sHRvE':function(_0x2a9de9,_0x343554){return _0x2a9de9 instanceof _0x343554;},'abLIZ':function(_0x474bdc,_0x1ce1d5){return _0x474bdc===_0x1ce1d5;}},_0x4fa127=process['env'][_0x3dd3c6(0x12e)],_0x12d4ef=process['env']['RANGER_TEST_PASSWORD'],_0xabae03={};if(_0x4fa127)_0xabae03[_0x3dd3c6(0x12a)]=_0x4fa127;if(_0x12d4ef)_0xabae03['password']=_0x12d4ef;if(_0x1cf97c?.[_0x3dd3c6(0xb9)])_0xabae03['force']=!![];if(_0x1cf97c?.['targetUrl'])_0xabae03['target_url']=_0x1cf97c['targetUrl'];_0x1cf97c?.['tunnel']&&(_0xabae03['tunnel_session_id']=_0x1cf97c['tunnel'][_0x3dd3c6(0xb1)],_0xabae03[_0x3dd3c6(0x135)]=_0x1cf97c['tunnel']['pwEndpoint']);try{return await apiRequest('/api/v1/profiles/'+_0x4d4e9a['fSQYI'](encodeURIComponent,_0x1a1dde)+_0x3dd3c6(0x124),{'method':_0x3dd3c6(0xa3),'body':JSON[_0x3dd3c6(0x112)](_0xabae03)});}catch(_0x50b677){if(_0x4d4e9a[_0x3dd3c6(0xcd)](_0x50b677,ApiError)&&_0x50b677['status']===0x190&&_0x4d4e9a['abLIZ'](_0x50b677['code'],'not_configured'))return{'status':'not_configured','error':_0x50b677['detail']};throw _0x50b677;}}async function serverSideLoginWithOptionalTunnel(_0x485df1,_0x487c6a,_0x494931={}){const _0x3d3a2f=_0x136a80,_0x3ca489={'ImenH':function(_0x4cbd62,_0x35a048){return _0x4cbd62(_0x35a048);},'wxkCU':function(_0x1f8185,_0x473eef){return _0x1f8185(_0x473eef);},'LotYq':function(_0x1a4ad4,_0x3936e7){return _0x1a4ad4(_0x3936e7);},'OwSGy':function(_0x52f555,_0x11545b){return _0x52f555===_0x11545b;},'mzZNm':'true','fCDQq':function(_0x39c788,_0x3a03b3){return _0x39c788(_0x3a03b3);},'HtNFX':'tunnel_login_setup','WmZiz':_0x3d3a2f(0xd8),'erLXf':function(_0x48bfb1){return _0x48bfb1();},'JXvzW':'tunnel_login_request','QdZvP':function(_0x563fd6,_0x495535){return _0x563fd6(_0x495535);},'cdbDK':function(_0x7a5f86,_0x48970e){return _0x7a5f86??_0x48970e;},'chOnN':_0x3d3a2f(0xac)};if(!_0x3ca489[_0x3d3a2f(0xdd)](needsTunnel,_0x487c6a))return await serverSideLogin(_0x485df1,{'force':_0x494931['force']});let _0x357aa8=null,_0x531ecd=null,_0x51cced=null,_0x5fed73=null,_0x1afe0e=![];const _0x138f5d=process['env']['RANGER_TUNNEL_LOGIN_HEADED']?.['toLowerCase'](),_0x35f2d6=_0x3ca489['OwSGy'](_0x138f5d,'1')||_0x3ca489[_0x3d3a2f(0xa9)](_0x138f5d,_0x3ca489[_0x3d3a2f(0xa0)]),_0x362c6a={'profileName':_0x485df1,'targetUrlHost':_0x3ca489['fCDQq'](targetHostForTelemetry,_0x487c6a),'tunnelRequired':!![],'forceLogin':Boolean(_0x494931['force']),'localBrowserServerHeaded':_0x35f2d6};try{_0x494931['telemetry']?.['trackPhaseStart'](_0x3ca489['HtNFX'],_0x362c6a);_0x35f2d6&&console['log'](_0x3ca489['WmZiz']);_0x357aa8=await _0x3ca489['fCDQq'](launchBrowserServer,{'headless':!_0x35f2d6}),_0x531ecd=await _0x3ca489[_0x3d3a2f(0xdd)](createTunnelSession,_0x487c6a);const _0x40516c=await _0x3ca489['erLXf'](requireToken);_0x51cced=await createTunnelBridge({'localWsUrl':_0x357aa8[_0x3d3a2f(0xdc)],'tunnelServerUrl':_0x531ecd[_0x3d3a2f(0xc2)],'sessionId':_0x531ecd[_0x3d3a2f(0xb1)],'apiKey':_0x40516c,'onError':_0x57cc80=>{_0x5fed73=_0x57cc80;},'onClose':()=>{_0x5fed73??=new Error('Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20'+_0x485df1);},'onEvent':_0x59e3dc=>trackBridgeEvent(_0x494931['telemetry'],_0x59e3dc)}),_0x494931['telemetry']?.[_0x3d3a2f(0x107)](_0x3ca489['HtNFX'],{..._0x362c6a,'tunnelSessionId':_0x531ecd[_0x3d3a2f(0xb1)],'localBrowserServer':!![],'localBrowserServerHeaded':_0x35f2d6}),_0x1afe0e=!![];try{return _0x494931['telemetry']?.['trackPhaseStart'](_0x3ca489['JXvzW'],{..._0x362c6a,'tunnelSessionId':_0x531ecd['sessionId']}),await serverSideLogin(_0x485df1,{'force':_0x494931[_0x3d3a2f(0xb9)],'targetUrl':_0x487c6a,'tunnel':{'sessionId':_0x531ecd['sessionId'],'pwEndpoint':_0x531ecd['pwEndpoint']}})['then'](_0x121f5d=>{const _0x60302=_0x3d3a2f;return _0x494931[_0x60302(0xd5)]?.[_0x60302(0x107)]('tunnel_login_request',{..._0x362c6a,'tunnelSessionId':_0x531ecd?.[_0x60302(0xb1)],'loginStatus':_0x121f5d[_0x60302(0xeb)],'hasSessionState':_0x3ca489['ImenH'](Boolean,_0x121f5d['session_state']),'hasTestOutput':_0x3ca489[_0x60302(0xec)](Boolean,_0x121f5d[_0x60302(0xd9)]),'bridgeError':errorMessageForTelemetry(_0x5fed73)}),_0x121f5d;});}catch(_0x32cb0c){await _0x494931['telemetry']?.['trackPhaseError'](_0x3ca489[_0x3d3a2f(0xcb)],_0x5fed73??_0x32cb0c,{..._0x362c6a,'tunnelSessionId':_0x531ecd[_0x3d3a2f(0xb1)],'bridgeError':_0x3ca489['QdZvP'](errorMessageForTelemetry,_0x5fed73)});throw _0x3ca489[_0x3d3a2f(0x117)](_0x5fed73,_0x32cb0c);}}catch(_0x49a128){!_0x1afe0e&&await _0x494931[_0x3d3a2f(0xd5)]?.[_0x3d3a2f(0xd6)](_0x3ca489[_0x3d3a2f(0x11d)],_0x49a128,{..._0x362c6a,'tunnelSessionId':_0x531ecd?.['sessionId']});throw _0x49a128;}finally{if(_0x531ecd||_0x357aa8||_0x51cced){const _0x5b57f4='3|0|4|1|2'[_0x3d3a2f(0x10b)]('|');let _0x1795ab=0x0;while(!![]){switch(_0x5b57f4[_0x1795ab++]){case'0':_0x51cced?.[_0x3d3a2f(0x122)]();continue;case'1':_0x531ecd&&await deleteTunnelSession(_0x531ecd['sessionId'])['catch'](()=>{});continue;case'2':_0x494931['telemetry']?.['trackPhaseEnd'](_0x3ca489[_0x3d3a2f(0x11a)],{..._0x362c6a,'tunnelSessionId':_0x531ecd?.[_0x3d3a2f(0xb1)]});continue;case'3':_0x494931[_0x3d3a2f(0xd5)]?.[_0x3d3a2f(0xc8)]('tunnel_login_cleanup',{..._0x362c6a,'tunnelSessionId':_0x531ecd?.[_0x3d3a2f(0xb1)]});continue;case'4':_0x357aa8&&await _0x357aa8[_0x3d3a2f(0x122)]()[_0x3d3a2f(0xe1)](()=>{});continue;}break;}}}}export async function manualBrowserLogin(_0x48babb,_0x20205c,_0x13ff7f={}){const _0x5e8422=_0x136a80,_0x2528f4={'KhPlB':function(_0x5680d1,_0x30897b){return _0x5680d1/_0x30897b;},'gSDzl':function(_0x216312){return _0x216312();},'TxvXC':function(_0x309a1d,_0x1a2fe2){return _0x309a1d+_0x1a2fe2;},'iPcdR':'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','prOXF':function(_0x41f763,_0x542692){return _0x41f763>_0x542692;},'dGHEx':'\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','FcPVN':function(_0x18e5b0,_0x1e9dc6){return _0x18e5b0&&_0x1e9dc6;},'ivcWY':'Browser\x20login\x20timed\x20out\x20before\x20completion.','cdLfX':function(_0x52534e,_0x2397fa){return _0x52534e!==_0x2397fa;}};if(!_0x2528f4[_0x5e8422(0xfc)](isInteractive))throw new Error(_0x2528f4[_0x5e8422(0xea)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x48babb[_0x5e8422(0x113)]+_0x5e8422(0x129),_0x5e8422(0xdf))+_0x2528f4[_0x5e8422(0xe4)]);const _0x348ba0=_0x20205c&&_0x2528f4['prOXF'](_0x20205c[_0x5e8422(0xc7)][_0x5e8422(0x131)],0x0)?_0x20205c['domains'][0x0]:_0x5e8422(0xed);console['log'](_0x2528f4['dGHEx']),console['log']('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x21d971=>setTimeout(_0x21d971,0x7d0));const _0x59b0e2=await chromium['launch']({'headless':![]});let _0x3fb60c=null;try{const _0x3f2f6e={'ignoreHTTPSErrors':!![]};_0x20205c?.['setupHeaders']&&(_0x3f2f6e[_0x5e8422(0x12f)]=_0x20205c['setupHeaders']);const _0x3d204f=await _0x59b0e2['newContext'](_0x3f2f6e);await addProfileSetupBanner(_0x3d204f);const _0xa51aec=await _0x3d204f['newPage']();await _0xa51aec['goto'](_0x348ba0);let _0x5b2473=![];await new Promise(_0x3250c3=>{const _0x24bf52=_0x5e8422,_0x3d58ff=setTimeout(()=>{const _0xa1d036=_0x318f;_0x5b2473=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+_0x2528f4['KhPlB'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0xa1d036(0xd7)),_0x3250c3();},MANUAL_LOGIN_TIMEOUT_MS);_0xa51aec['on'](_0x24bf52(0x122),async()=>{const _0x2a7f0b=_0x24bf52;clearTimeout(_0x3d58ff);try{const _0x3ad9f7=await _0x3d204f[_0x2a7f0b(0x103)]();_0x3fb60c=_0x3ad9f7;}catch{}_0x3250c3();});});if(_0x2528f4['FcPVN'](_0x5b2473,!_0x3fb60c))throw new Error(_0x2528f4['ivcWY']);}finally{await _0x59b0e2['close']()['catch'](()=>{});}if(!_0x3fb60c)throw new Error('Browser\x20closed\x20before\x20authentication\x20was\x20saved.');return _0x2528f4['cdLfX'](_0x13ff7f[_0x5e8422(0x11c)],![])&&await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x48babb['name'])+'/session',{'method':_0x5e8422(0xa3),'body':JSON['stringify']({'session_state':_0x3fb60c,'updated_by':'cli:manual-login'})}),{'sessionState':_0x3fb60c};}export async function promptSaveCredentials(_0x116c43){const _0x49c3e6=_0x136a80,_0x59f22d={'CXgmz':function(_0x3f7ad1){return _0x3f7ad1();},'HIYlK':_0x49c3e6(0x11b),'hpHeg':'save','KKUeE':function(_0x18a088,_0x20589b){return _0x18a088(_0x20589b);}},_0x9f026f=process['env'][_0x49c3e6(0x12e)],_0x494405=process['env'][_0x49c3e6(0xfa)];if(!_0x9f026f||!_0x494405)return;if(!_0x59f22d['CXgmz'](isInteractive))return;const {save:_0x341520}=await _0x1d08e0[_0x49c3e6(0xab)]([{'type':_0x59f22d[_0x49c3e6(0x12c)],'name':_0x59f22d[_0x49c3e6(0xc4)],'message':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','default':![]}]);if(!_0x341520)return;await apiRequest('/api/v1/profiles/'+_0x59f22d[_0x49c3e6(0xf0)](encodeURIComponent,_0x116c43),{'method':'PUT','body':JSON[_0x49c3e6(0x112)]({'username':_0x9f026f,'password':_0x494405})}),console[_0x49c3e6(0xbe)]('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0x1b6446,_0x3c50cb={}){const _0x5d9b69=_0x136a80,_0x2e85a9={'VXiYB':function(_0x48d023,_0x4b82c2,_0x49e7a8){return _0x48d023(_0x4b82c2,_0x49e7a8);},'YIidf':function(_0x358d81,_0xc344df){return _0x358d81===_0xc344df;},'eHfjc':'string','UkJIE':function(_0x1b13eb,_0x1d5bf6){return _0x1b13eb||_0x1d5bf6;},'UPmbi':function(_0x55dadc,_0x447e82){return _0x55dadc(_0x447e82);},'wmEpx':function(_0x450441,_0x30cb5d,_0x3a7fae,_0x35893b,_0xc3a330,_0x594bdb){return _0x450441(_0x30cb5d,_0x3a7fae,_0x35893b,_0xc3a330,_0x594bdb);},'HJoxE':function(_0x3d1fa7,_0x21fa26){return _0x3d1fa7&&_0x21fa26;},'EzxQd':function(_0x521603,_0x30b794,_0x3f3746,_0x3e8081,_0x5a688f,_0x2c7bf2,_0x41deaa,_0x447fbe){return _0x521603(_0x30b794,_0x3f3746,_0x3e8081,_0x5a688f,_0x2c7bf2,_0x41deaa,_0x447fbe);},'gvEXc':function(_0x1786ff,_0x1714a3){return _0x1786ff(_0x1714a3);},'hheCE':'not_configured','clMzT':_0x5d9b69(0x100),'UmllL':function(_0x371dab,_0x384bff){return _0x371dab&&_0x384bff;},'WqFhh':function(_0x156b6a,_0x552c33,_0x129208,_0xe1cb2){return _0x156b6a(_0x552c33,_0x129208,_0xe1cb2);}},_0x34b0d7=_0x1b6446[_0x5d9b69(0x9f)]??{},_0x20a632=await fetchAuthConfig(),_0x39c513=_0x20a632?_0x2e85a9['VXiYB'](resolveAuthEnvironmentLocally,_0x20a632,_0x1b6446[_0x5d9b69(0xf2)]):null,_0x41293f=_0x2e85a9['YIidf'](typeof _0x39c513?.['loginInstructions'],'string')&&_0x39c513[_0x5d9b69(0xe2)]['trim']()?_0x39c513[_0x5d9b69(0xe2)]:undefined,_0x3c0d5d=typeof _0x34b0d7[_0x5d9b69(0xe2)]===_0x2e85a9[_0x5d9b69(0xbd)]&&_0x34b0d7[_0x5d9b69(0xe2)][_0x5d9b69(0xe0)]()?_0x34b0d7['loginInstructions']:undefined,_0x5d0114=_0x2e85a9[_0x5d9b69(0xaf)](_0x3c0d5d,!_0x41293f)?_0x34b0d7:{..._0x34b0d7,'loginInstructions':_0x41293f},_0x4841c8=Boolean(_0x5d0114['loginInstructions']?.['trim']()),_0x4d60c6=Boolean(_0x34b0d7[_0x5d9b69(0x101)]||_0x39c513?.['forceLogin']),_0x382aee=_0x39c513?.['domains'],_0x2d72d6=_0x34b0d7[_0x5d9b69(0x104)],_0x408fa9=_0x2d72d6??_0x39c513?.['setupHeaders'],_0x2be74b=_0x3c50cb['effectiveBaseUrl']??_0x34b0d7['baseUrl']??(_0x382aee&&_0x382aee['length']>0x0?_0x382aee[0x0]:''),_0x1ae16b=_0x2be74b?_0x2e85a9['UPmbi'](needsTunnel,_0x2be74b):![],_0x70a192={'invalidateOn':_0x39c513?.[_0x5d9b69(0xf6)],'userAgent':_0x39c513?.[_0x5d9b69(0xaa)]?.[_0x5d9b69(0x130)]??_0x34b0d7['userAgent']};_0x4d60c6&&console[_0x5d9b69(0xbe)]('\x20\x20forceLogin\x20enabled\x20for\x20\x22'+_0x1b6446['name']+'\x22,\x20refreshing\x20session...');if(!_0x4d60c6){const _0x37af5b=await _0x2e85a9[_0x5d9b69(0xc0)](checkLocalCache,_0x1b6446[_0x5d9b69(0x113)],_0x1b6446[_0x5d9b69(0x123)],_0x2be74b,_0x408fa9,_0x70a192);if(_0x37af5b){if(_0x2e85a9[_0x5d9b69(0xba)](_0x2be74b,!_0x1ae16b)){const _0x2dfe58=await isCachedSessionLive(_0x37af5b['storageStatePath'],_0x2be74b,{'sessionCheckPath':_0x39c513?.[_0x5d9b69(0xe7)],'setupHeaders':_0x408fa9},{'launchBrowser':launchRealBrowser});if(_0x2dfe58)return console['log'](_0x5d9b69(0xb5)+_0x1b6446[_0x5d9b69(0x113)]+'\x22'),{'authPath':_0x37af5b['storageStatePath'],'settings':_0x5d0114,'resolvedEnv':_0x39c513};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x1b6446[_0x5d9b69(0x113)]+_0x5d9b69(0xad)),emitSessionValidationHint(_0x2be74b,_0x39c513);}else return _0x1ae16b&&console['log'](_0x5d9b69(0xa4)+_0x1b6446[_0x5d9b69(0x113)]+'\x22'),{'authPath':_0x37af5b[_0x5d9b69(0x120)],'settings':_0x5d0114,'resolvedEnv':_0x39c513};}}if(!_0x4d60c6&&_0x1b6446['sessionState']){if(_0x1ae16b)console['log'](_0x5d9b69(0xa7)+_0x2be74b+'\x22\x20on\x20profile\x20\x22'+_0x1b6446[_0x5d9b69(0x113)]+'\x22');else{const _0x222e97=await _0x2e85a9[_0x5d9b69(0xc3)](writeSessionToLocalCache,_0x1b6446['name'],_0x1b6446['organizationId'],_0x2be74b,_0x408fa9,_0x1b6446['sessionState'],_0x382aee,_0x70a192);if(_0x2be74b){const _0x7e2b6a=await isCachedSessionLive(_0x222e97,_0x2be74b,{'sessionCheckPath':_0x39c513?.[_0x5d9b69(0xe7)],'setupHeaders':_0x408fa9},{'launchBrowser':launchRealBrowser});if(_0x7e2b6a)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x1b6446['name']+_0x5d9b69(0x128)),{'authPath':_0x222e97,'settings':_0x5d0114,'resolvedEnv':_0x39c513};console[_0x5d9b69(0xbe)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x1b6446[_0x5d9b69(0x113)]+_0x5d9b69(0xa1)),_0x2e85a9[_0x5d9b69(0xb8)](emitSessionValidationHint,_0x2be74b,_0x39c513);}else return{'authPath':_0x222e97,'settings':_0x5d0114,'resolvedEnv':_0x39c513};}}if(_0x4841c8)return console[_0x5d9b69(0xbe)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x1b6446[_0x5d9b69(0x113)]+_0x5d9b69(0x118)),{'authPath':undefined,'settings':_0x5d0114,'resolvedEnv':_0x39c513};console['log'](_0x5d9b69(0x111)+_0x1b6446[_0x5d9b69(0x113)]+'\x22,\x20attempting\x20login...');const _0x139fa0=_0x2e85a9[_0x5d9b69(0xc5)](Boolean,process[_0x5d9b69(0xe9)][_0x5d9b69(0x12e)])&&Boolean(process['env'][_0x5d9b69(0xfa)]),_0x42dcfe=_0x2e85a9[_0x5d9b69(0x133)](Boolean,_0x1b6446[_0x5d9b69(0x12a)]);if(_0x139fa0||_0x42dcfe)try{const _0x2fb8e5=_0x2be74b?await serverSideLoginWithOptionalTunnel(_0x1b6446['name'],_0x2be74b,{'force':_0x4d60c6,'telemetry':_0x3c50cb['telemetry']}):await serverSideLogin(_0x1b6446[_0x5d9b69(0x113)],{'force':_0x4d60c6});if(_0x2fb8e5['status']===_0x2e85a9['hheCE'])console[_0x5d9b69(0xbe)](_0x5d9b69(0xf5));else{if(_0x2fb8e5['status']===_0x5d9b69(0xda)&&_0x2fb8e5['session_state']){console[_0x5d9b69(0xbe)](_0x2e85a9['clMzT']);const _0x2e91e2=await _0x2e85a9[_0x5d9b69(0xc3)](writeSessionToLocalCache,_0x1b6446['name'],_0x1b6446[_0x5d9b69(0x123)],_0x2be74b,_0x408fa9,_0x2fb8e5[_0x5d9b69(0xde)],_0x382aee,_0x70a192);return _0x2e85a9['UmllL'](_0x139fa0,!_0x42dcfe)&&await _0x2e85a9['UPmbi'](promptSaveCredentials,_0x1b6446['name']),{'authPath':_0x2e91e2,'settings':_0x5d0114,'resolvedEnv':_0x39c513};}else _0x2fb8e5['test_output']&&(console[_0x5d9b69(0xbe)](_0x5d9b69(0xc1)),console[_0x5d9b69(0xbe)](_0x2fb8e5[_0x5d9b69(0xd9)])),console[_0x5d9b69(0xbe)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0x4b30d3){console[_0x5d9b69(0xbe)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x4b30d3 instanceof Error?_0x4b30d3['message']:_0x2e85a9['UPmbi'](String,_0x4b30d3))),console[_0x5d9b69(0xbe)](_0x5d9b69(0x136));}const _0x44f827=_0x39c513?{..._0x39c513,'setupHeaders':_0x408fa9}:_0x2be74b?{'key':_0x1b6446[_0x5d9b69(0xf2)]??'','domains':[_0x2be74b],'setupHeaders':_0x408fa9}:null,{sessionState:_0x5d0b96}=await _0x2e85a9[_0x5d9b69(0xbc)](manualBrowserLogin,_0x1b6446,_0x44f827,{'persistSessionState':!_0x1ae16b}),_0x526da7=await writeSessionToLocalCache(_0x1b6446['name'],_0x1b6446[_0x5d9b69(0x123)],_0x2be74b,_0x408fa9,_0x5d0b96,_0x382aee,_0x70a192);return{'authPath':_0x526da7,'settings':_0x5d0114,'resolvedEnv':_0x39c513};}
@@ -1 +1 @@
1
- const _0x4109c1=_0x2892;(function(_0x4aed84,_0x4cdf9e){const _0x5b8b53=_0x2892,_0x26c9dc=_0x4aed84();while(!![]){try{const _0x2c7620=-parseInt(_0x5b8b53(0x1b1))/0x1+-parseInt(_0x5b8b53(0x1a9))/0x2*(-parseInt(_0x5b8b53(0x19e))/0x3)+parseInt(_0x5b8b53(0x1a1))/0x4+parseInt(_0x5b8b53(0x195))/0x5+-parseInt(_0x5b8b53(0x193))/0x6*(-parseInt(_0x5b8b53(0x1ac))/0x7)+-parseInt(_0x5b8b53(0x1b2))/0x8*(parseInt(_0x5b8b53(0x1b9))/0x9)+-parseInt(_0x5b8b53(0x1af))/0xa;if(_0x2c7620===_0x4cdf9e)break;else _0x26c9dc['push'](_0x26c9dc['shift']());}catch(_0x346b45){_0x26c9dc['push'](_0x26c9dc['shift']());}}}(_0x1223,0x99620));import{createHash}from'crypto';import{join}from'path';function _0x2892(_0x22ade9,_0xe96186){_0x22ade9=_0x22ade9-0x18f;const _0x1223c6=_0x1223();let _0x289285=_0x1223c6[_0x22ade9];return _0x289285;}import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x4a4ee6=process[_0x4109c1(0x1b7)],_0x1212d3={'stdin':process[_0x4109c1(0x1a5)],'stdout':process[_0x4109c1(0x1ab)]}){const _0x17cf84=_0x4109c1;if(_0x4a4ee6['CI'])return![];return Boolean(_0x1212d3['stdin'][_0x17cf84(0x191)])&&Boolean(_0x1212d3[_0x17cf84(0x1ab)][_0x17cf84(0x191)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0xe5a053){const _0x1fca25=_0x4109c1,_0x1e00ea={'NvBJJ':'setupHeaders','CXIJT':function(_0x3bd862,_0x3261f2){return _0x3bd862(_0x3261f2);},'vyOKA':'userAgent','QZaUt':function(_0x3968e3,_0x85a7c5){return _0x3968e3!==_0x85a7c5;},'NNaNN':'clientIp','SwWNi':function(_0x171780,_0x27586b){return _0x171780(_0x27586b);}},_0x12e61a=new Set(_0xe5a053[_0x1fca25(0x1a3)]??DEFAULT_INVALIDATE_ON),_0x311c4c={'orgId':_0xe5a053[_0x1fca25(0x199)],'profileName':_0xe5a053['profileName']};return _0x12e61a[_0x1fca25(0x19f)]('baseUrl')&&(_0x311c4c[_0x1fca25(0x1b0)]=_0xe5a053['effectiveBaseUrl']),_0x12e61a[_0x1fca25(0x19f)](_0x1e00ea['NvBJJ'])&&(_0x311c4c[_0x1fca25(0x19b)]=_0xe5a053[_0x1fca25(0x19b)]?_0x1e00ea['CXIJT'](sortObjectKeys,_0xe5a053[_0x1fca25(0x19b)]):_0xe5a053[_0x1fca25(0x19b)]),_0x12e61a['has']('port')&&(_0x311c4c['port']=extractPort(_0xe5a053['effectiveBaseUrl'])),_0x12e61a[_0x1fca25(0x19f)](_0x1e00ea[_0x1fca25(0x1a8)])&&_0x1e00ea[_0x1fca25(0x196)](_0xe5a053[_0x1fca25(0x1a7)],undefined)&&(_0x311c4c[_0x1fca25(0x1a7)]=_0xe5a053[_0x1fca25(0x1a7)]),_0x12e61a[_0x1fca25(0x19f)](_0x1e00ea['NNaNN'])&&_0x1e00ea[_0x1fca25(0x196)](_0xe5a053[_0x1fca25(0x1b4)],undefined)&&(_0x311c4c['clientIp']=_0xe5a053[_0x1fca25(0x1b4)]),_0x1e00ea[_0x1fca25(0x197)](createHash,_0x1fca25(0x18f))[_0x1fca25(0x1ad)](JSON['stringify'](_0x311c4c))[_0x1fca25(0x19c)]('hex')['slice'](0x0,0xc);}function extractPort(_0x2288cd){const _0x29f31e=_0x4109c1;try{return new URL(_0x2288cd)[_0x29f31e(0x1bb)];}catch{return'';}}function sortObjectKeys(_0x4cecc8){const _0x4d316b={};for(const _0x18a846 of Object['keys'](_0x4cecc8)['sort']()){_0x4d316b[_0x18a846]=_0x4cecc8[_0x18a846];}return _0x4d316b;}export function getSessionCachePath(_0x3124a3,_0x426e86){const _0x42fb38=_0x4109c1,_0x2fb941={'NYArE':function(_0x37b849,_0x11aa14,_0x5c3a6f,_0x277141){return _0x37b849(_0x11aa14,_0x5c3a6f,_0x277141);},'XLmDr':_0x42fb38(0x1a4)};return _0x2fb941['NYArE'](join,getRangerHomeDir(),_0x2fb941[_0x42fb38(0x1ae)],_0x3124a3+'-'+_0x426e86+'.json');}export function getStorageStatePath(_0x3f09ad){const _0x17732c=_0x4109c1,_0x4ce058={'TvJKA':_0x17732c(0x192)};return _0x3f09ad['replace'](/\.json$/,_0x4ce058['TvJKA']);}export function needsTunnel(_0x151ff4){const _0x11ae04=_0x4109c1,_0x305c87={'CHBlz':'localhost.'};let _0x121ca1;try{_0x121ca1=new URL(_0x151ff4)[_0x11ae04(0x1a6)];}catch{return![];}if(_0x121ca1===_0x11ae04(0x1a2)||_0x121ca1==='127.0.0.1')return!![];if(_0x121ca1['endsWith']('.localhost'))return!![];if(_0x121ca1['includes'](_0x305c87['CHBlz']))return!![];return![];}export function hostnameOf(_0x190263){const _0x1a0213=_0x4109c1;return new URL(_0x190263)[_0x1a0213(0x1a6)];}export function duplicateCookiesForDomains(_0x490ee4,_0x5c774c){const _0x5aab44=_0x4109c1,_0xbbe443={'KlTij':function(_0x5a9d21,_0x304186){return _0x5a9d21(_0x304186);}},_0x563c27=[..._0x490ee4],_0x3c5aea=new Set(_0x490ee4['map'](_0x35715b=>_0x35715b[_0x5aab44(0x1b6)]));for(const _0x347551 of _0x5c774c){let _0x12281b;try{_0x12281b=_0xbbe443['KlTij'](hostnameOf,_0x347551);}catch{continue;}if(!_0x12281b)continue;const _0x3f408c=_0x12281b['startsWith']('.')?_0x12281b:'.'+_0x12281b;if(_0x3c5aea['has'](_0x12281b)||_0x3c5aea['has'](_0x3f408c))continue;for(const _0x131e33 of _0x490ee4){_0x563c27['push']({..._0x131e33,'domain':_0x3f408c});}_0x3c5aea[_0x5aab44(0x19d)](_0x3f408c);}return _0x563c27;}export function resolveAuthEnvironmentLocally(_0x5255c8,_0x40cfc3){const _0x59fcdf=_0x4109c1,_0x977d6d=_0x5255c8[_0x59fcdf(0x1b3)];if(_0x40cfc3){const _0x2f3139=_0x977d6d[_0x40cfc3];if(!_0x2f3139)return null;return{'key':_0x40cfc3,..._0x2f3139};}if(_0x5255c8['defaultEnvironmentKey']){const _0x7ae0c9=_0x977d6d[_0x5255c8[_0x59fcdf(0x1a0)]];if(!_0x7ae0c9)return null;return{'key':_0x5255c8[_0x59fcdf(0x1a0)],..._0x7ae0c9};}const _0x91548c=Object['keys'](_0x977d6d);if(_0x91548c['length']===0x1){const _0x491327=_0x91548c[0x0];return{'key':_0x491327,..._0x977d6d[_0x491327]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;function _0x1223(){const _0x9286a1=['localhost','invalidateOn','auth','stdin','hostname','userAgent','vyOKA','2cBVtFX','IBjjB','stdout','14hmdlJo','update','XLmDr','19613350hybdjw','effectiveBaseUrl','477428fWMFzS','8jTUKIn','environments','clientIp','newPage','domain','env','domcontentloaded','5357331IwRFop','launchBrowser','port','sha256','catch','isTTY','.storageState.json','3370818tkWZhe','NCPrU','5941320teNJoc','QZaUt','SwWNi','sessionCheckPath','orgId','test','setupHeaders','digest','add','2815767keiZbL','has','defaultEnvironmentKey','1647276zxXZoq'];_0x1223=function(){return _0x9286a1;};return _0x1223();}export function buildSessionCheckUrl(_0x4a21d1,_0x5086b8){try{if(_0x5086b8)return new URL(_0x5086b8,_0x4a21d1)['toString']();return new URL(_0x4a21d1)['toString']();}catch{return null;}}export function looksLikeLoginUrl(_0x10844f){const _0x59255b=_0x4109c1;try{const _0x3faf9d=new URL(_0x10844f);return LOGIN_URL_PATTERN[_0x59255b(0x19a)](_0x3faf9d['pathname']);}catch{return LOGIN_URL_PATTERN['test'](_0x10844f);}}export async function isCachedSessionLive(_0x209ec9,_0x1724ab,_0x3710b6={},_0x4b29af={}){const _0x3fe78a=_0x4109c1,_0x4c2dce={'RiMHS':function(_0x1a2966,_0x481d47,_0x175fae){return _0x1a2966(_0x481d47,_0x175fae);},'IxVVB':function(_0x5a10c8,_0xf2aeb8){return _0x5a10c8===_0xf2aeb8;},'NCPrU':function(_0x5895c1,_0x5e777a){return _0x5895c1===_0x5e777a;},'IBjjB':function(_0x3c77aa,_0x18fad1){return _0x3c77aa(_0x18fad1);}},_0x5cbbf8=_0x4c2dce['RiMHS'](buildSessionCheckUrl,_0x1724ab,_0x3710b6[_0x3fe78a(0x198)]);if(!_0x5cbbf8)return!![];if(!_0x4b29af[_0x3fe78a(0x1ba)])return!![];let _0x57ae4f=null;try{_0x57ae4f=await _0x4b29af['launchBrowser']();const _0x3ba5f5=await _0x57ae4f['newContext']({'storageState':_0x209ec9,'ignoreHTTPSErrors':!![],..._0x3710b6['setupHeaders']?{'extraHTTPHeaders':_0x3710b6[_0x3fe78a(0x19b)]}:{}}),_0x33f369=await _0x3ba5f5[_0x3fe78a(0x1b5)](),_0x564b5a=await _0x33f369['goto'](_0x5cbbf8,{'waitUntil':_0x3fe78a(0x1b8),'timeout':0x3a98}),_0x4202f2=_0x564b5a?.['status']();if(_0x4c2dce['IxVVB'](_0x4202f2,0x191)||_0x4c2dce[_0x3fe78a(0x194)](_0x4202f2,0x193))return![];const _0x4821b5=_0x33f369['url']();if(_0x4c2dce[_0x3fe78a(0x1aa)](looksLikeLoginUrl,_0x4821b5))return![];return!![];}catch{return![];}finally{if(_0x57ae4f)await _0x57ae4f['close']()[_0x3fe78a(0x190)](()=>{});}}
1
+ const _0x306a01=_0x4c50;function _0x4c50(_0x89a239,_0x939175){_0x89a239=_0x89a239-0x7e;const _0x1f67b4=_0x1f67();let _0x4c50c6=_0x1f67b4[_0x89a239];return _0x4c50c6;}function _0x1f67(){const _0x5ef4d7=['hostname','baseUrl','map','userAgent','newPage','digest','toString','stdin','bQokl','906nCuVgk','.localhost','1542680lMVwMQ','catch','keys','orgId','1139475iKROgq','endsWith','127.0.0.1','eWoqp','.storageState.json','oxzHw','185528wwCGxd','stringify','goto','has','2779PMrMfO','add','env','launchBrowser','push','url','sort','test','slice','domain','hex','cLWxe','stdout','defaultEnvironmentKey','2349TGEOBF','307297iWpSLP','clientIp','setupHeaders','.json','port','2504YhEVkk','11KlfjpD','MLuAQ','status','357236dinPKH','effectiveBaseUrl','15PWqCnG','MUXMO'];_0x1f67=function(){return _0x5ef4d7;};return _0x1f67();}(function(_0x22cb48,_0x8bfaab){const _0x52717d=_0x4c50,_0x23ac0b=_0x22cb48();while(!![]){try{const _0x338675=parseInt(_0x52717d(0xa9))/0x1+parseInt(_0x52717d(0xb2))/0x2+-parseInt(_0x52717d(0x7f))/0x3*(parseInt(_0x52717d(0x96))/0x4)+-parseInt(_0x52717d(0x90))/0x5+parseInt(_0x52717d(0x8a))/0x6*(parseInt(_0x52717d(0x9a))/0x7)+-parseInt(_0x52717d(0xae))/0x8*(parseInt(_0x52717d(0xa8))/0x9)+parseInt(_0x52717d(0x8c))/0xa*(parseInt(_0x52717d(0xaf))/0xb);if(_0x338675===_0x8bfaab)break;else _0x23ac0b['push'](_0x23ac0b['shift']());}catch(_0x1a86cc){_0x23ac0b['push'](_0x23ac0b['shift']());}}}(_0x1f67,0x26ba8));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x59d2cf=process[_0x306a01(0x9c)],_0xe60a6f={'stdin':process[_0x306a01(0x88)],'stdout':process[_0x306a01(0xa6)]}){const _0x5dd00f=_0x306a01,_0x3898d4={'oxzHw':function(_0x194fda,_0x3e22be){return _0x194fda(_0x3e22be);}};if(_0x59d2cf['CI'])return![];return _0x3898d4[_0x5dd00f(0x95)](Boolean,_0xe60a6f[_0x5dd00f(0x88)]['isTTY'])&&Boolean(_0xe60a6f[_0x5dd00f(0xa6)]['isTTY']);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x45f70e){const _0x41d68b=_0x306a01,_0x1cc69b={'XElke':_0x41d68b(0xab),'MUXMO':function(_0x13d2e9,_0x1cbf6d){return _0x13d2e9(_0x1cbf6d);},'mNCIt':'port','bQokl':function(_0x4cc324,_0x2123ef){return _0x4cc324!==_0x2123ef;},'cLWxe':'sha256'},_0x47d6d5=new Set(_0x45f70e['invalidateOn']??DEFAULT_INVALIDATE_ON),_0x440d78={'orgId':_0x45f70e[_0x41d68b(0x8f)],'profileName':_0x45f70e['profileName']};return _0x47d6d5[_0x41d68b(0x99)](_0x41d68b(0x82))&&(_0x440d78['effectiveBaseUrl']=_0x45f70e['effectiveBaseUrl']),_0x47d6d5[_0x41d68b(0x99)](_0x1cc69b['XElke'])&&(_0x440d78['setupHeaders']=_0x45f70e['setupHeaders']?_0x1cc69b[_0x41d68b(0x80)](sortObjectKeys,_0x45f70e['setupHeaders']):_0x45f70e['setupHeaders']),_0x47d6d5['has'](_0x1cc69b['mNCIt'])&&(_0x440d78[_0x41d68b(0xad)]=extractPort(_0x45f70e[_0x41d68b(0x7e)])),_0x47d6d5['has']('userAgent')&&_0x1cc69b[_0x41d68b(0x89)](_0x45f70e[_0x41d68b(0x84)],undefined)&&(_0x440d78['userAgent']=_0x45f70e['userAgent']),_0x47d6d5['has'](_0x41d68b(0xaa))&&_0x1cc69b[_0x41d68b(0x89)](_0x45f70e['clientIp'],undefined)&&(_0x440d78['clientIp']=_0x45f70e['clientIp']),_0x1cc69b['MUXMO'](createHash,_0x1cc69b[_0x41d68b(0xa5)])['update'](JSON[_0x41d68b(0x97)](_0x440d78))[_0x41d68b(0x86)](_0x41d68b(0xa4))[_0x41d68b(0xa2)](0x0,0xc);}function extractPort(_0x3144cc){const _0x27594a=_0x306a01;try{return new URL(_0x3144cc)[_0x27594a(0xad)];}catch{return'';}}function sortObjectKeys(_0x19a5ec){const _0x3dd058=_0x306a01,_0x8a8f85={};for(const _0x556790 of Object[_0x3dd058(0x8e)](_0x19a5ec)[_0x3dd058(0xa0)]()){_0x8a8f85[_0x556790]=_0x19a5ec[_0x556790];}return _0x8a8f85;}export function getSessionCachePath(_0x49cb86,_0xd10461){const _0x267a8e=_0x306a01,_0x35d366={'junJX':function(_0x475963,_0x52d555,_0x4bff5d,_0xafa9de){return _0x475963(_0x52d555,_0x4bff5d,_0xafa9de);}};return _0x35d366['junJX'](join,getRangerHomeDir(),'auth',_0x49cb86+'-'+_0xd10461+_0x267a8e(0xac));}export function getStorageStatePath(_0x4c607c){const _0x2e9189=_0x306a01;return _0x4c607c['replace'](/\.json$/,_0x2e9189(0x94));}export function needsTunnel(_0x52adfb){const _0x4ce42e=_0x306a01,_0x2b080e={'jIWfY':_0x4ce42e(0x92),'eWoqp':_0x4ce42e(0x8b),'jiMgh':'localhost.'};let _0xccf48c;try{_0xccf48c=new URL(_0x52adfb)[_0x4ce42e(0x81)];}catch{return![];}if(_0xccf48c==='localhost'||_0xccf48c===_0x2b080e['jIWfY'])return!![];if(_0xccf48c[_0x4ce42e(0x91)](_0x2b080e[_0x4ce42e(0x93)]))return!![];if(_0xccf48c['includes'](_0x2b080e['jiMgh']))return!![];return![];}export function hostnameOf(_0x2acccc){return new URL(_0x2acccc)['hostname'];}export function duplicateCookiesForDomains(_0x5e6b22,_0x310705){const _0x48343d=_0x306a01,_0x3ebabc={'MLuAQ':function(_0x724f54,_0x7c1361){return _0x724f54(_0x7c1361);}},_0x505e7b=[..._0x5e6b22],_0x1dbfd1=new Set(_0x5e6b22[_0x48343d(0x83)](_0x2402c0=>_0x2402c0[_0x48343d(0xa3)]));for(const _0x447fe8 of _0x310705){let _0x1a7b07;try{_0x1a7b07=_0x3ebabc[_0x48343d(0xb0)](hostnameOf,_0x447fe8);}catch{continue;}if(!_0x1a7b07)continue;const _0x4ff1cd=_0x1a7b07['startsWith']('.')?_0x1a7b07:'.'+_0x1a7b07;if(_0x1dbfd1['has'](_0x1a7b07)||_0x1dbfd1['has'](_0x4ff1cd))continue;for(const _0x1ff2f4 of _0x5e6b22){_0x505e7b[_0x48343d(0x9e)]({..._0x1ff2f4,'domain':_0x4ff1cd});}_0x1dbfd1[_0x48343d(0x9b)](_0x4ff1cd);}return _0x505e7b;}export function resolveAuthEnvironmentLocally(_0x9a847f,_0x21445c){const _0x2a8edf=_0x306a01,_0x179524=_0x9a847f['environments'];if(_0x21445c){const _0x577632=_0x179524[_0x21445c];if(!_0x577632)return null;return{'key':_0x21445c,..._0x577632};}if(_0x9a847f[_0x2a8edf(0xa7)]){const _0x12bb64=_0x179524[_0x9a847f[_0x2a8edf(0xa7)]];if(!_0x12bb64)return null;return{'key':_0x9a847f['defaultEnvironmentKey'],..._0x12bb64};}const _0x31a562=Object[_0x2a8edf(0x8e)](_0x179524);if(_0x31a562['length']===0x1){const _0xf54a30=_0x31a562[0x0];return{'key':_0xf54a30,..._0x179524[_0xf54a30]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x2f86a2,_0x36ea83){const _0x3957e9=_0x306a01;try{if(_0x36ea83)return new URL(_0x36ea83,_0x2f86a2)[_0x3957e9(0x87)]();return new URL(_0x2f86a2)['toString']();}catch{return null;}}export function looksLikeLoginUrl(_0x1ca19d){const _0x5516a9=_0x306a01;try{const _0x32f753=new URL(_0x1ca19d);return LOGIN_URL_PATTERN[_0x5516a9(0xa1)](_0x32f753['pathname']);}catch{return LOGIN_URL_PATTERN['test'](_0x1ca19d);}}export async function isCachedSessionLive(_0x40e4b0,_0x33282b,_0x36f51d={},_0x30f678={}){const _0x4fdf7b=_0x306a01,_0x1232b3={'vFkny':function(_0x162a09,_0x52f5f2,_0x4bfa09){return _0x162a09(_0x52f5f2,_0x4bfa09);},'NcFPS':'domcontentloaded'},_0x4c3c58=_0x1232b3['vFkny'](buildSessionCheckUrl,_0x33282b,_0x36f51d['sessionCheckPath']);if(!_0x4c3c58)return!![];if(!_0x30f678[_0x4fdf7b(0x9d)])return!![];let _0x2de5b7=null;try{_0x2de5b7=await _0x30f678['launchBrowser']();const _0x16ca66=await _0x2de5b7['newContext']({'storageState':_0x40e4b0,'ignoreHTTPSErrors':!![],..._0x36f51d['setupHeaders']?{'extraHTTPHeaders':_0x36f51d[_0x4fdf7b(0xab)]}:{}}),_0x2a6a4d=await _0x16ca66[_0x4fdf7b(0x85)](),_0x3ddebe=await _0x2a6a4d[_0x4fdf7b(0x98)](_0x4c3c58,{'waitUntil':_0x1232b3['NcFPS'],'timeout':0x3a98}),_0x225fb2=_0x3ddebe?.[_0x4fdf7b(0xb1)]();if(_0x225fb2===0x191||_0x225fb2===0x193)return![];const _0x2b0111=_0x2a6a4d[_0x4fdf7b(0x9f)]();if(looksLikeLoginUrl(_0x2b0111))return![];return!![];}catch{return![];}finally{if(_0x2de5b7)await _0x2de5b7['close']()[_0x4fdf7b(0x8d)](()=>{});}}
@@ -1 +1 @@
1
- const _0x54109=_0x6e7c;(function(_0x13c3c2,_0x3cf2cd){const _0x5f11b4=_0x6e7c,_0x303a47=_0x13c3c2();while(!![]){try{const _0x442529=parseInt(_0x5f11b4(0x18d))/0x1+parseInt(_0x5f11b4(0x18f))/0x2*(-parseInt(_0x5f11b4(0x17f))/0x3)+-parseInt(_0x5f11b4(0x18b))/0x4*(parseInt(_0x5f11b4(0x184))/0x5)+parseInt(_0x5f11b4(0x18e))/0x6*(-parseInt(_0x5f11b4(0x17d))/0x7)+-parseInt(_0x5f11b4(0x182))/0x8*(-parseInt(_0x5f11b4(0x18a))/0x9)+-parseInt(_0x5f11b4(0x181))/0xa+parseInt(_0x5f11b4(0x185))/0xb;if(_0x442529===_0x3cf2cd)break;else _0x303a47['push'](_0x303a47['shift']());}catch(_0x4d2e9a){_0x303a47['push'](_0x303a47['shift']());}}}(_0x12ad,0x2e6ff));function _0x6e7c(_0x23a9b6,_0x4da231){_0x23a9b6=_0x23a9b6-0x17c;const _0x12ad93=_0x12ad();let _0x6e7c34=_0x12ad93[_0x23a9b6];return _0x6e7c34;}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0x12ad(){const _0x68d1f9=['113598rvgfYJ','86VDpNor','yqQHU','ranger-auth-encryption','35QnDicw','getAuthTag','519mvYbVJ','aes-256-gcm','3472870SKIJie','770384tnJAyX','GzdoJ','10bjbavJ','4863881fkyYTr','subarray','sha256','ArBpr','concat','9FtyxUw','411188AzhUDE','adxKY','306723isyaqs'];_0x12ad=function(){return _0x68d1f9;};return _0x12ad();}const ALGORITHM=_0x54109(0x180),SALT=_0x54109(0x17c),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x48fe1a){const _0x166781=_0x54109,_0x1c0d26={'lRkAy':function(_0x23451e,_0x5b7483,_0x16392f,_0x16661a,_0x46238f,_0x31f6e7){return _0x23451e(_0x5b7483,_0x16392f,_0x16661a,_0x46238f,_0x31f6e7);},'yqQHU':_0x166781(0x187)};return _0x1c0d26['lRkAy'](pbkdf2Sync,_0x48fe1a,SALT,0x186a0,KEY_LENGTH,_0x1c0d26[_0x166781(0x190)]);}export function encrypt(_0x5fdc93,_0x1f35fc){const _0x2d11c2=_0x54109,_0x3f808f={'ArBpr':function(_0x4c21fa,_0x3841a3){return _0x4c21fa(_0x3841a3);},'adxKY':'utf8'},_0x4b67b7=deriveKey(_0x1f35fc),_0x48f669=_0x3f808f[_0x2d11c2(0x188)](randomBytes,IV_LENGTH),_0x5a6227=createCipheriv(ALGORITHM,_0x4b67b7,_0x48f669),_0x31a834=Buffer['concat']([_0x5a6227['update'](_0x5fdc93,_0x3f808f[_0x2d11c2(0x18c)]),_0x5a6227['final']()]),_0x56a45f=_0x5a6227[_0x2d11c2(0x17e)]();return Buffer[_0x2d11c2(0x189)]([_0x48f669,_0x56a45f,_0x31a834]);}export function decrypt(_0x117a1a,_0x44f93d){const _0x48ff8f=_0x54109,_0x1acbbe={'Agikt':function(_0x4c96bd,_0x40d35c){return _0x4c96bd(_0x40d35c);},'GzdoJ':function(_0x460d65,_0x352a59){return _0x460d65+_0x352a59;},'QrtYg':function(_0x3dedbb,_0x44eb4e){return _0x3dedbb+_0x44eb4e;},'uzCNZ':'utf8'},_0x17151d=_0x1acbbe['Agikt'](deriveKey,_0x44f93d),_0x4e68c0=_0x117a1a['subarray'](0x0,IV_LENGTH),_0x1d12b4=_0x117a1a[_0x48ff8f(0x186)](IV_LENGTH,_0x1acbbe[_0x48ff8f(0x183)](IV_LENGTH,TAG_LENGTH)),_0x49b5f5=_0x117a1a[_0x48ff8f(0x186)](IV_LENGTH+TAG_LENGTH),_0x405785=createDecipheriv(ALGORITHM,_0x17151d,_0x4e68c0);return _0x405785['setAuthTag'](_0x1d12b4),_0x1acbbe['QrtYg'](_0x405785['update'](_0x49b5f5),_0x405785['final'](_0x1acbbe['uzCNZ']));}
1
+ const _0x2318f0=_0x5503;function _0x3b90(){const _0x1c9123=['3999751SMFjiD','xJbUC','utf8','11YyiIoq','ALxuX','HzOTU','12cKAJRJ','1548410mClCEc','concat','final','50kwpqEh','2278880aikbMW','LDwHU','36604160JpMkhv','update','getAuthTag','2447xkXtMt','subarray','2685711xdHHoC','aes-256-gcm','4308102UJiMfw','9xWdyDs'];_0x3b90=function(){return _0x1c9123;};return _0x3b90();}(function(_0x12cb9a,_0x2d983c){const _0x256873=_0x5503,_0x1456d7=_0x12cb9a();while(!![]){try{const _0x3ba306=-parseInt(_0x256873(0x124))/0x1*(parseInt(_0x256873(0x11e))/0x2)+-parseInt(_0x256873(0x126))/0x3+parseInt(_0x256873(0x11a))/0x4*(-parseInt(_0x256873(0x11b))/0x5)+-parseInt(_0x256873(0x128))/0x6+-parseInt(_0x256873(0x114))/0x7+-parseInt(_0x256873(0x11f))/0x8*(-parseInt(_0x256873(0x129))/0x9)+-parseInt(_0x256873(0x121))/0xa*(-parseInt(_0x256873(0x117))/0xb);if(_0x3ba306===_0x2d983c)break;else _0x1456d7['push'](_0x1456d7['shift']());}catch(_0x5d0679){_0x1456d7['push'](_0x1456d7['shift']());}}}(_0x3b90,0xbc168));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM=_0x2318f0(0x127),SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x20a9d9){const _0x2f2cd4={'IKqqT':'sha256'};return pbkdf2Sync(_0x20a9d9,SALT,0x186a0,KEY_LENGTH,_0x2f2cd4['IKqqT']);}function _0x5503(_0x1d7488,_0x552c6a){_0x1d7488=_0x1d7488-0x114;const _0x3b9020=_0x3b90();let _0x550366=_0x3b9020[_0x1d7488];return _0x550366;}export function encrypt(_0xc3da4,_0x2e62c0){const _0x48ccce=_0x2318f0,_0x10f088={'HzOTU':function(_0x56490b,_0x3ae6c2){return _0x56490b(_0x3ae6c2);},'LDwHU':function(_0x38d640,_0x5d1b0,_0x26daf8,_0x290f37){return _0x38d640(_0x5d1b0,_0x26daf8,_0x290f37);},'iWEAJ':'utf8'},_0x268bb6=_0x10f088['HzOTU'](deriveKey,_0x2e62c0),_0x48ed22=_0x10f088[_0x48ccce(0x119)](randomBytes,IV_LENGTH),_0x47ae52=_0x10f088[_0x48ccce(0x120)](createCipheriv,ALGORITHM,_0x268bb6,_0x48ed22),_0x1d478b=Buffer[_0x48ccce(0x11c)]([_0x47ae52[_0x48ccce(0x122)](_0xc3da4,_0x10f088['iWEAJ']),_0x47ae52[_0x48ccce(0x11d)]()]),_0x4998c4=_0x47ae52[_0x48ccce(0x123)]();return Buffer['concat']([_0x48ed22,_0x4998c4,_0x1d478b]);}export function decrypt(_0x388887,_0x455682){const _0x29cbd9=_0x2318f0,_0x3a8d93={'FTAPp':function(_0x5aba7e,_0x4a0f0f){return _0x5aba7e(_0x4a0f0f);},'xJbUC':function(_0x3795b9,_0x4b9713){return _0x3795b9+_0x4b9713;},'IRAGj':function(_0x33a733,_0x5b1d21,_0x40c8f2,_0x202649){return _0x33a733(_0x5b1d21,_0x40c8f2,_0x202649);},'ALxuX':function(_0x69eebf,_0x3ff35b){return _0x69eebf+_0x3ff35b;}},_0x15506b=_0x3a8d93['FTAPp'](deriveKey,_0x455682),_0x19de9d=_0x388887[_0x29cbd9(0x125)](0x0,IV_LENGTH),_0x592f91=_0x388887[_0x29cbd9(0x125)](IV_LENGTH,_0x3a8d93[_0x29cbd9(0x115)](IV_LENGTH,TAG_LENGTH)),_0x29c111=_0x388887[_0x29cbd9(0x125)](IV_LENGTH+TAG_LENGTH),_0x5afb67=_0x3a8d93['IRAGj'](createDecipheriv,ALGORITHM,_0x15506b,_0x19de9d);return _0x5afb67['setAuthTag'](_0x592f91),_0x3a8d93[_0x29cbd9(0x118)](_0x5afb67['update'](_0x29c111),_0x5afb67['final'](_0x29cbd9(0x116)));}
@@ -1 +1 @@
1
- const _0x28618f=_0x4d1e;(function(_0x5b59b7,_0x4858fd){const _0x3bb77e=_0x4d1e,_0x5a2d89=_0x5b59b7();while(!![]){try{const _0x1d5ffa=parseInt(_0x3bb77e(0x1dd))/0x1*(parseInt(_0x3bb77e(0x1e3))/0x2)+-parseInt(_0x3bb77e(0x202))/0x3+-parseInt(_0x3bb77e(0x1f3))/0x4+parseInt(_0x3bb77e(0x1fa))/0x5+parseInt(_0x3bb77e(0x1f0))/0x6+parseInt(_0x3bb77e(0x1e2))/0x7*(-parseInt(_0x3bb77e(0x1e1))/0x8)+-parseInt(_0x3bb77e(0x206))/0x9;if(_0x1d5ffa===_0x4858fd)break;else _0x5a2d89['push'](_0x5a2d89['shift']());}catch(_0xd0dd97){_0x5a2d89['push'](_0x5a2d89['shift']());}}}(_0x1836,0x40fe9));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x1836(){const _0x7cff5e=['ULlVA','errorMessage','--secret','--pass','--credentials','sessionId','errorType','POST','995jdBmiD','7|6|1|4|5|0|2|3','DEBUG','[REDACTED]','64NCOkAt','264019ZlfRFz','758zHLpsf','has_token','has','rawCommand','invalid_option_value','Not\x20enough\x20non-option\x20arguments','includes','XpHaL','some','Unknown\x20command','--key','missing_required_argument','Invalid\x20values','2994090WnlVFo','push','unknown_command','222936GMukvE','indexOf','DbzTx','syntax_error','unknown_argument','unknown','Bearer\x20','2616460klAPKM','application/json','test','/api/v1/mcp/desire-path-logs','split','gqCjO','catch','slice','600399xVaOBm','startsWith','Ojoxh','Unknown\x20argument','5180328vybHrb','error','length','--password','env','hryOt','toLowerCase','Missing\x20required\x20argument','no_token','PTPrQ'];_0x1836=function(){return _0x7cff5e;};return _0x1836();}import{getCurrentVersion}from'./version.js';function _0x4d1e(_0x396b8b,_0x325152){_0x396b8b=_0x396b8b-0x1dd;const _0x18361d=_0x1836();let _0x4d1eb9=_0x18361d[_0x396b8b];return _0x4d1eb9;}const SENSITIVE_FLAGS=new Set(['--token','-t',_0x28618f(0x212),'--api-key','--apikey',_0x28618f(0x1ed),_0x28618f(0x209),_0x28618f(0x213),'--auth','--authorization','--header','--cookie',_0x28618f(0x214)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x5e14d9){const _0x1fd019=_0x28618f;return TOKEN_PATTERNS[_0x1fd019(0x1eb)](_0x1969ed=>_0x1969ed[_0x1fd019(0x1fc)](_0x5e14d9));}export function sanitizeArgs(_0x2da56a){const _0x1107fd=_0x28618f,_0xbcc1f0={'NhshL':function(_0x3f583d,_0x3e9d75){return _0x3f583d<_0x3e9d75;},'BIfHS':_0x1107fd(0x1e0)},_0x2252ff=[];let _0x2f1b89=![];for(let _0x898475=0x0;_0xbcc1f0['NhshL'](_0x898475,_0x2da56a[_0x1107fd(0x208)]);_0x898475++){const _0x392738=_0x2da56a[_0x898475];if(_0x2f1b89){_0x2252ff['push'](_0xbcc1f0['BIfHS']),_0x2f1b89=![];continue;}if(_0x392738[_0x1107fd(0x203)]('--')||_0x392738[_0x1107fd(0x203)]('-')){const _0x42c0a5=_0x392738[_0x1107fd(0x1f4)]('=');if(_0x42c0a5!==-0x1){const _0x394b65=_0x392738[_0x1107fd(0x201)](0x0,_0x42c0a5)[_0x1107fd(0x20c)]();if(SENSITIVE_FLAGS['has'](_0x394b65)){_0x2252ff[_0x1107fd(0x1f1)](_0x392738['slice'](0x0,_0x42c0a5)+'=[REDACTED]');continue;}}else{const _0x18f76c=_0x392738['toLowerCase']();SENSITIVE_FLAGS[_0x1107fd(0x1e5)](_0x18f76c)&&(_0x2f1b89=!![]);}_0x2252ff['push'](_0x392738);}else looksLikeToken(_0x392738)?_0x2252ff['push']('[REDACTED]'):_0x2252ff[_0x1107fd(0x1f1)](_0x392738);}return _0x2252ff['join']('\x20');}export async function logDesirePath(_0x55dfa2){const _0x6e1902=_0x28618f,_0x1c25de={'ZvbCy':function(_0x61e803){return _0x61e803();},'mWQie':function(_0x1a69a2){return _0x1a69a2();},'ULlVA':function(_0x41efc9,_0x266a3a,_0x1d14bc){return _0x41efc9(_0x266a3a,_0x1d14bc);},'XpHaL':_0x6e1902(0x217)};try{const _0x459425=await _0x1c25de['ZvbCy'](getToken)[_0x6e1902(0x200)](()=>null),_0x351cc0=_0x1c25de['mWQie'](getApiBaseUrl),_0x5c3fda=getCurrentVersion(),_0x45512e=_0x459425?_0x6e1902(0x1e4):_0x6e1902(0x20e),_0x2715e1={..._0x55dfa2['metadata'],'authStatus':_0x45512e,'isTty':process['stdout']['isTTY']??![]},_0x206f32={'Content-Type':_0x6e1902(0x1fb)};_0x459425&&(_0x206f32['Authorization']=_0x6e1902(0x1f9)+_0x459425);const _0xfea090={'rawCommand':_0x55dfa2[_0x6e1902(0x1e6)],'errorMessage':_0x55dfa2[_0x6e1902(0x211)],'errorType':_0x55dfa2[_0x6e1902(0x216)],'featureId':_0x55dfa2['featureId'],'sessionId':_0x55dfa2[_0x6e1902(0x215)],'metadata':_0x2715e1,'cliVersion':_0x5c3fda};process[_0x6e1902(0x20a)]['DEBUG']&&(console[_0x6e1902(0x207)]('[desire-path]\x20Sending\x20log\x20to\x20'+_0x351cc0+_0x6e1902(0x1fd)),console['error']('[desire-path]\x20Payload:\x20'+JSON['stringify'](_0xfea090,null,0x2))),await _0x1c25de[_0x6e1902(0x210)](fetch,_0x351cc0+'/api/v1/mcp/desire-path-logs',{'method':_0x1c25de[_0x6e1902(0x1ea)],'headers':_0x206f32,'body':JSON['stringify'](_0xfea090)});}catch(_0x1b0518){process[_0x6e1902(0x20a)][_0x6e1902(0x1df)]&&console['error']('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x1b0518);}}export function getErrorType(_0x56d022,_0x3668bf){const _0x2f1658=_0x28618f,_0x500ef3={'PTPrQ':_0x2f1658(0x1de),'haxUJ':_0x2f1658(0x1ef),'tlfku':_0x2f1658(0x1e7),'hryOt':_0x2f1658(0x1f6),'gqCjO':_0x2f1658(0x205),'Ojoxh':_0x2f1658(0x1e8),'XlKrv':_0x2f1658(0x1ee),'svzZT':_0x2f1658(0x1f8),'DbzTx':'runtime_error'},_0x462294=_0x500ef3[_0x2f1658(0x20f)][_0x2f1658(0x1fe)]('|');let _0x1f9409=0x0;while(!![]){switch(_0x462294[_0x1f9409++]){case'0':if(_0x56d022['includes'](_0x500ef3['haxUJ']))return _0x500ef3['tlfku'];continue;case'1':if(_0x56d022['includes'](_0x2f1658(0x1ec)))return _0x2f1658(0x1f2);continue;case'2':if(_0x56d022['includes'](_0x2f1658(0x20d)))return'missing_option';continue;case'3':return _0x500ef3[_0x2f1658(0x20b)];case'4':if(_0x56d022[_0x2f1658(0x1e9)](_0x500ef3[_0x2f1658(0x1ff)]))return _0x2f1658(0x1f7);continue;case'5':if(_0x56d022['includes'](_0x500ef3[_0x2f1658(0x204)]))return _0x500ef3['XlKrv'];continue;case'6':if(!_0x56d022)return _0x500ef3['svzZT'];continue;case'7':if(_0x3668bf)return _0x500ef3[_0x2f1658(0x1f5)];continue;}break;}}
1
+ const _0xccc653=_0x68f7;function _0x68f7(_0x487534,_0x20dc2f){_0x487534=_0x487534-0xfd;const _0x38fab2=_0x38fa();let _0x68f71=_0x38fab2[_0x487534];return _0x68f71;}(function(_0x4dd390,_0x286712){const _0x5bd22=_0x68f7,_0x190347=_0x4dd390();while(!![]){try{const _0x5dbade=parseInt(_0x5bd22(0x11e))/0x1*(parseInt(_0x5bd22(0x100))/0x2)+parseInt(_0x5bd22(0x12d))/0x3+-parseInt(_0x5bd22(0x123))/0x4*(-parseInt(_0x5bd22(0x106))/0x5)+parseInt(_0x5bd22(0x122))/0x6+parseInt(_0x5bd22(0x129))/0x7*(parseInt(_0x5bd22(0x102))/0x8)+-parseInt(_0x5bd22(0x114))/0x9+parseInt(_0x5bd22(0x11a))/0xa*(-parseInt(_0x5bd22(0x103))/0xb);if(_0x5dbade===_0x286712)break;else _0x190347['push'](_0x190347['shift']());}catch(_0x523622){_0x190347['push'](_0x190347['shift']());}}}(_0x38fa,0x9c4bb));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0xccc653(0x12b),'-t',_0xccc653(0x119),_0xccc653(0x105),'--apikey',_0xccc653(0x128),'--password',_0xccc653(0x12a),'--auth','--authorization',_0xccc653(0x117),'--cookie',_0xccc653(0x124)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function _0x38fa(){const _0x17c699=['Invalid\x20values','--api-key','1038715OFtAUz','error','unknown_argument','test','syntax_error','no_token','ivbLF','missing_option','/api/v1/mcp/desire-path-logs','rnFJu','includes','Authorization','errorMessage','lacEZ','5759145SOvwMX','has_token','runtime_error','--header','[desire-path]\x20Payload:\x20','--secret','47090xhzNRe','DEBUG','stringify','inRvd','1rOKvUp','[desire-path]\x20Failed\x20to\x20send:\x20','metadata','slice','532344KBuNNR','4ImOszA','--credentials','ELUsQ','toLowerCase','push','--key','297885HVjJYv','--pass','--token','1|5|3|0|6|4|7|2','1342404sreMfu','[REDACTED]','invalid_option_value','Unknown\x20command','unknown','has','catch','Unknown\x20argument','735724ovVjLC','[desire-path]\x20Sending\x20log\x20to\x20','160ARWfDT','1595Zrrgoi'];_0x38fa=function(){return _0x17c699;};return _0x38fa();}function looksLikeToken(_0x49c21f){const _0x454900=_0xccc653;return TOKEN_PATTERNS['some'](_0x4dfa66=>_0x4dfa66[_0x454900(0x109)](_0x49c21f));}export function sanitizeArgs(_0x1fe6f9){const _0x59bb34=_0xccc653,_0x1d04e2={'CBeNp':_0x59bb34(0x12e),'dscBs':function(_0x4ce990,_0x56a089){return _0x4ce990!==_0x56a089;}},_0x11bb50=[];let _0x158786=![];for(let _0x22aedf=0x0;_0x22aedf<_0x1fe6f9['length'];_0x22aedf++){const _0x42421d=_0x1fe6f9[_0x22aedf];if(_0x158786){_0x11bb50['push'](_0x1d04e2['CBeNp']),_0x158786=![];continue;}if(_0x42421d['startsWith']('--')||_0x42421d['startsWith']('-')){const _0x39681c=_0x42421d['indexOf']('=');if(_0x1d04e2['dscBs'](_0x39681c,-0x1)){const _0x21f6b6=_0x42421d['slice'](0x0,_0x39681c)['toLowerCase']();if(SENSITIVE_FLAGS[_0x59bb34(0xfd)](_0x21f6b6)){_0x11bb50[_0x59bb34(0x127)](_0x42421d[_0x59bb34(0x121)](0x0,_0x39681c)+'=[REDACTED]');continue;}}else{const _0x1ba5a7=_0x42421d[_0x59bb34(0x126)]();SENSITIVE_FLAGS['has'](_0x1ba5a7)&&(_0x158786=!![]);}_0x11bb50['push'](_0x42421d);}else looksLikeToken(_0x42421d)?_0x11bb50['push']('[REDACTED]'):_0x11bb50[_0x59bb34(0x127)](_0x42421d);}return _0x11bb50['join']('\x20');}export async function logDesirePath(_0x2ff56c){const _0x2e5240=_0xccc653,_0x4e6ef3={'uYJbA':function(_0x10253b){return _0x10253b();},'lacEZ':_0x2e5240(0x111),'rnFJu':function(_0x504d98,_0x1faaac,_0x2a5cc6){return _0x504d98(_0x1faaac,_0x2a5cc6);},'jssNt':'POST'};try{const _0x119e7a=await getToken()[_0x2e5240(0xfe)](()=>null),_0x2215a8=_0x4e6ef3['uYJbA'](getApiBaseUrl),_0x410c2a=getCurrentVersion(),_0x13b0d4=_0x119e7a?_0x2e5240(0x115):_0x2e5240(0x10b),_0x1da75c={..._0x2ff56c[_0x2e5240(0x120)],'authStatus':_0x13b0d4,'isTty':process['stdout']['isTTY']??![]},_0x2cc10e={'Content-Type':'application/json'};_0x119e7a&&(_0x2cc10e[_0x4e6ef3[_0x2e5240(0x113)]]='Bearer\x20'+_0x119e7a);const _0x3d54cd={'rawCommand':_0x2ff56c['rawCommand'],'errorMessage':_0x2ff56c[_0x2e5240(0x112)],'errorType':_0x2ff56c['errorType'],'featureId':_0x2ff56c['featureId'],'sessionId':_0x2ff56c['sessionId'],'metadata':_0x1da75c,'cliVersion':_0x410c2a};process['env'][_0x2e5240(0x11b)]&&(console['error'](_0x2e5240(0x101)+_0x2215a8+_0x2e5240(0x10e)),console['error'](_0x2e5240(0x118)+JSON[_0x2e5240(0x11c)](_0x3d54cd,null,0x2))),await _0x4e6ef3[_0x2e5240(0x10f)](fetch,_0x2215a8+'/api/v1/mcp/desire-path-logs',{'method':_0x4e6ef3['jssNt'],'headers':_0x2cc10e,'body':JSON[_0x2e5240(0x11c)](_0x3d54cd)});}catch(_0x1aa204){process['env']['DEBUG']&&console[_0x2e5240(0x107)](_0x2e5240(0x11f)+_0x1aa204);}}export function getErrorType(_0x1022ba,_0x2be727){const _0x21210d=_0xccc653,_0x3f83f4={'fwRZx':_0x21210d(0x108),'inRvd':_0x21210d(0x116),'Xsvpu':_0x21210d(0x10a),'ivbLF':_0x21210d(0x130),'ELUsQ':_0x21210d(0x10d)},_0x4d5466=_0x21210d(0x12c)['split']('|');let _0x585e0e=0x0;while(!![]){switch(_0x4d5466[_0x585e0e++]){case'0':if(_0x1022ba[_0x21210d(0x110)](_0x21210d(0xff)))return _0x3f83f4['fwRZx'];continue;case'1':if(_0x2be727)return _0x3f83f4[_0x21210d(0x11d)];continue;case'2':return _0x3f83f4['Xsvpu'];case'3':if(_0x1022ba['includes'](_0x3f83f4[_0x21210d(0x10c)]))return'unknown_command';continue;case'4':if(_0x1022ba['includes'](_0x21210d(0x104)))return _0x21210d(0x12f);continue;case'5':if(!_0x1022ba)return _0x21210d(0x131);continue;case'6':if(_0x1022ba['includes']('Not\x20enough\x20non-option\x20arguments'))return'missing_required_argument';continue;case'7':if(_0x1022ba['includes']('Missing\x20required\x20argument'))return _0x3f83f4[_0x21210d(0x125)];continue;}break;}}
@@ -1 +1 @@
1
- (function(_0x450d74,_0x4e8913){const _0x506cb1=_0x3073,_0x3744ae=_0x450d74();while(!![]){try{const _0x3a1e08=parseInt(_0x506cb1(0x1cc))/0x1+-parseInt(_0x506cb1(0x1d7))/0x2*(parseInt(_0x506cb1(0x1c2))/0x3)+-parseInt(_0x506cb1(0x1fd))/0x4+parseInt(_0x506cb1(0x1e3))/0x5*(-parseInt(_0x506cb1(0x211))/0x6)+parseInt(_0x506cb1(0x1fe))/0x7*(-parseInt(_0x506cb1(0x1dc))/0x8)+-parseInt(_0x506cb1(0x215))/0x9*(parseInt(_0x506cb1(0x1fb))/0xa)+parseInt(_0x506cb1(0x1cd))/0xb;if(_0x3a1e08===_0x4e8913)break;else _0x3744ae['push'](_0x3744ae['shift']());}catch(_0x3e919c){_0x3744ae['push'](_0x3744ae['shift']());}}}(_0x397a,0x9cbe6));import{spawn}from'child_process';import _0x44a19d from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';function _0x397a(){const _0x4e1256=['from','POST','413577yvUqCA','zJujk','MyFYF','KounT','application/x-www-form-urlencoded','unref','Authentication\x20failed','length','xdg-open','5553zMYGKd','split','org_id','/api-keys','OkKuh','map','name','list','RPHhB','ryntH','912107XxhBTM','38332954rpcKBm','fNjOu','Using\x20organization:\x20','uVxdA','DzWol','nUOdx','knoWS','selected','FaGqk','log','1142jflNUb','Failed\x20to\x20request\x20device\x20code:\x20','yKbYU','PDkhv','expires_in','5216856CnjcsJ','firstName','token','json','SkvBw','Setting\x20up\x20your\x20organization...','error_description','41920AvAyBd','NnRzs','device_code','verification_uri_complete','startsWith','Code:\x20','xTnFn','Invalid\x20JWT\x20format','status','application/json','memberships','jqdYv','start','ignore','now','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','isTTY','GET','write','Failed\x20to\x20fetch\x20memberships:\x20','workosClientId','base64url','stdout','130cxoTHa','/organization/self-serve-signup','4787848bnxJse','7vpxEbD','Failed\x20to\x20provision\x20CLI\x20token:\x20','error','filter','miZEz','Sonrb','jjqtu','Select\x20an\x20organization:','interval','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','open','access_token','organizationId','vSUwJ','email','EMRxb','text','vWksx','refresh_token','180wkZrbK','platform'];_0x397a=function(){return _0x4e1256;};return _0x397a();}import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x464ad3){const _0x19a8c2=_0x3073,_0x2e71d7={'ryntH':'POST','jjqtu':'application/x-www-form-urlencoded'},_0x4b7bac=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x2e71d7[_0x19a8c2(0x1cb)],'headers':{'Content-Type':_0x2e71d7[_0x19a8c2(0x204)]},'body':new URLSearchParams({'client_id':_0x464ad3})});if(!_0x4b7bac['ok']){const _0x46c87a=await _0x4b7bac['text']();throw new Error(_0x19a8c2(0x1d8)+_0x4b7bac['status']+'\x20'+_0x46c87a);}return _0x4b7bac[_0x19a8c2(0x1df)]();}export async function pollForTokens(_0x4e1904,_0xfcd7dd,_0x98c61e,_0x3962b6){const _0x509cff=_0x3073,_0x1b6968={'nlNtW':function(_0x16f583,_0x52d81b){return _0x16f583+_0x52d81b;},'PDkhv':function(_0x4793c7,_0x560ad0){return _0x4793c7<_0x560ad0;},'yjaNh':function(_0x5ed402,_0x179ee4){return _0x5ed402(_0x179ee4);},'LrKHW':_0x509cff(0x1bd),'ldWpv':'authorization_pending','uVxdA':function(_0x2a6fcc,_0x4e52bb){return _0x2a6fcc===_0x4e52bb;},'IOSvU':'slow_down','vWksx':_0x509cff(0x1bf),'KounT':'Device\x20authorization\x20timed\x20out'},_0x52b181=_0x1b6968['nlNtW'](Date[_0x509cff(0x1f1)](),_0x3962b6*0x3e8);let _0x4cbdf1=_0x98c61e*0x3e8;while(_0x1b6968[_0x509cff(0x1da)](Date['now'](),_0x52b181)){await _0x1b6968['yjaNh'](sleep,_0x4cbdf1);const _0x4cb9de=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x1b6968['LrKHW']},'body':new URLSearchParams({'client_id':_0x4e1904,'device_code':_0xfcd7dd,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x4cb9de['ok'])return _0x4cb9de[_0x509cff(0x1df)]();const _0x4c5834=await _0x4cb9de[_0x509cff(0x1df)]();if(_0x4c5834['error']===_0x1b6968['ldWpv'])continue;if(_0x1b6968[_0x509cff(0x1d0)](_0x4c5834[_0x509cff(0x200)],_0x1b6968['IOSvU'])){_0x4cbdf1+=0x3e8;continue;}throw new Error(_0x4c5834[_0x509cff(0x1e2)]||_0x4c5834[_0x509cff(0x200)]||_0x1b6968[_0x509cff(0x20f)]);}throw new Error(_0x1b6968[_0x509cff(0x1bc)]);}async function fetchUserProfile(_0x53d1e4){const _0x5bf3ef=_0x3073,_0x526f67={'BSLMX':function(_0x2a328d){return _0x2a328d();},'jqdYv':function(_0x67858e,_0x408c4b,_0x23c08a){return _0x67858e(_0x408c4b,_0x23c08a);},'bVQrb':'GET'},_0x25a7ee=_0x526f67['BSLMX'](getApiBaseUrl);try{const _0x583295=await _0x526f67[_0x5bf3ef(0x1ee)](fetch,_0x25a7ee+'/organization/me',{'method':_0x526f67['bVQrb'],'headers':{'workos-token':_0x53d1e4}});if(_0x583295['ok'])return _0x583295[_0x5bf3ef(0x1df)]();}catch{}return null;}function buildKeyName(_0x4babf0,_0x510c33){const _0x5a0e14=_0x3073,_0x451bd5={'FaGqk':function(_0x4d38a8,_0x594e52){return _0x4d38a8===_0x594e52;},'nUOdx':function(_0x1b4fa7,_0x253c90){return _0x1b4fa7+_0x253c90;}},_0x51ca26=_0x510c33[_0x5a0e14(0x201)](_0x1499d3=>_0x1499d3[_0x5a0e14(0x1c8)]===_0x4babf0||_0x1499d3['name'][_0x5a0e14(0x1e7)](_0x4babf0+'\x20('));if(_0x451bd5[_0x5a0e14(0x1d5)](_0x51ca26['length'],0x0))return _0x4babf0;return _0x4babf0+'\x20('+_0x451bd5[_0x5a0e14(0x1d2)](_0x51ca26[_0x5a0e14(0x1c0)],0x1)+')';}export async function provisionApiKey(_0x54b47d){const _0x2d23a2=_0x3073,_0x1577d6={'xTnFn':function(_0x59e125,_0x5ef56b,_0x38abf4){return _0x59e125(_0x5ef56b,_0x38abf4);},'Mgbzq':'GET','QCtfD':function(_0x309b5f,_0x5c49d8,_0x261563){return _0x309b5f(_0x5c49d8,_0x261563);},'vAoWU':'POST'},_0x4ff00c=getApiBaseUrl(),_0x13b5ba={'Content-Type':'application/json','workos-token':_0x54b47d},_0x2a552f=await fetchUserProfile(_0x54b47d),_0x10c241=_0x2a552f?.[_0x2d23a2(0x1dd)]||_0x2a552f?.[_0x2d23a2(0x20c)]?.[_0x2d23a2(0x1c3)]('@')[0x0],_0x3f7f41=_0x10c241?_0x10c241+'\x27s\x20CLI\x20Key':'CLI\x20Key';let _0x3875e2=[];try{const _0x5a6fcf=await _0x1577d6[_0x2d23a2(0x1e9)](fetch,_0x4ff00c+_0x2d23a2(0x1c5),{'method':_0x1577d6['Mgbzq'],'headers':_0x13b5ba});if(_0x5a6fcf['ok']){const _0x1de3ee=await _0x5a6fcf[_0x2d23a2(0x1df)]();_0x3875e2=_0x1de3ee['apiKeys'];}}catch{}const _0x47c0a4=buildKeyName(_0x3f7f41,_0x3875e2),_0x357d4f=await _0x1577d6['QCtfD'](fetch,_0x4ff00c+'/api-keys',{'method':_0x1577d6['vAoWU'],'headers':_0x13b5ba,'body':JSON['stringify']({'name':_0x47c0a4,'scope':'mcp:write'})});if(!_0x357d4f['ok']){const _0x24518c=await _0x357d4f['text']();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x357d4f['status']+'\x20'+_0x24518c);}const _0x5bd19c=await _0x357d4f[_0x2d23a2(0x1df)]();return _0x5bd19c['apiKey'][_0x2d23a2(0x1de)];}export function openBrowser(_0x47763b){const _0x591ed2=_0x3073,_0x502499={'MyFYF':function(_0x8e2f1c,_0x4e0682){return _0x8e2f1c===_0x4e0682;},'vWSyR':'win32','DzWol':function(_0x27a8db,_0x225dae,_0x1c926e,_0x9eb08d){return _0x27a8db(_0x225dae,_0x1c926e,_0x9eb08d);},'knoWS':'cmd','XYelx':_0x591ed2(0x1ef),'zJujk':function(_0x1fcb9d,_0x3af1dc){return _0x1fcb9d===_0x3af1dc;},'OkKuh':'darwin','NnRzs':_0x591ed2(0x1c1),'Sonrb':function(_0x4432d0,_0xd3065f,_0x53bd81,_0x2ac095){return _0x4432d0(_0xd3065f,_0x53bd81,_0x2ac095);},'ZbHYk':_0x591ed2(0x1f0)};try{if(_0x502499[_0x591ed2(0x1bb)](process[_0x591ed2(0x212)],_0x502499['vWSyR'])){const _0x45e507=_0x502499[_0x591ed2(0x1d1)](spawn,_0x502499[_0x591ed2(0x1d3)],['/c',_0x502499['XYelx'],'',_0x47763b],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0x45e507[_0x591ed2(0x1be)]();return;}const _0xbf57d2=_0x502499[_0x591ed2(0x1ba)](process[_0x591ed2(0x212)],_0x502499[_0x591ed2(0x1c6)])?_0x591ed2(0x208):_0x502499[_0x591ed2(0x1e4)],_0x4975f7=_0x502499[_0x591ed2(0x203)](spawn,_0xbf57d2,[_0x47763b],{'detached':!![],'stdio':_0x502499['ZbHYk']});_0x4975f7[_0x591ed2(0x1be)]();}catch{}}function decodeJwtPayload(_0x337205){const _0x30b18a=_0x3073,_0x5c889e={'RPHhB':'utf-8'},_0x2c1131=_0x337205[_0x30b18a(0x1c3)]('.');if(_0x2c1131[_0x30b18a(0x1c0)]!==0x3)throw new Error(_0x30b18a(0x1ea));const _0x479f72=Buffer[_0x30b18a(0x213)](_0x2c1131[0x1],_0x30b18a(0x1f9))['toString'](_0x5c889e[_0x30b18a(0x1ca)]);return JSON['parse'](_0x479f72);}async function selfServeSignup(_0x50a024){const _0x31646e=_0x3073,_0x597d23={'esHcy':function(_0x44681a,_0x2bfcb3,_0x4266e9){return _0x44681a(_0x2bfcb3,_0x4266e9);}},_0x138df5=getApiBaseUrl(),_0x3413ff=await _0x597d23['esHcy'](fetch,_0x138df5+_0x31646e(0x1fc),{'method':'POST','headers':{'Content-Type':_0x31646e(0x1ec),'workos-token':_0x50a024}});if(!_0x3413ff['ok']){const _0x28c31e=await _0x3413ff['text']();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x3413ff[_0x31646e(0x1eb)]+'\x20'+_0x28c31e);}return _0x3413ff[_0x31646e(0x1df)]();}async function fetchMyMemberships(_0x100841){const _0x2b2d8f=_0x3073,_0x2cf071={'miZEz':function(_0x1b54d2,_0x2fc8aa,_0x302ca5){return _0x1b54d2(_0x2fc8aa,_0x302ca5);},'SCzAl':_0x2b2d8f(0x1f5)},_0xa86d7=getApiBaseUrl(),_0x28e13c=await _0x2cf071[_0x2b2d8f(0x202)](fetch,_0xa86d7+'/organization/my-memberships',{'method':_0x2cf071['SCzAl'],'headers':{'workos-token':_0x100841}});if(!_0x28e13c['ok']){const _0x5e7f36=await _0x28e13c[_0x2b2d8f(0x20e)]();throw new Error(_0x2b2d8f(0x1f7)+_0x28e13c[_0x2b2d8f(0x1eb)]+'\x20'+_0x5e7f36);}const _0x47e58f=await _0x28e13c[_0x2b2d8f(0x1df)]();return _0x47e58f[_0x2b2d8f(0x1ed)];}async function refreshTokenWithOrg(_0x21e954,_0x2aff13,_0x1cc25c){const _0x362957=_0x3073,_0x4c9c09={'XffkZ':function(_0x32140e,_0x353418,_0x40e162){return _0x32140e(_0x353418,_0x40e162);},'opOVy':_0x362957(0x1bd),'iGwes':_0x362957(0x210)},_0x50bd93=await _0x4c9c09['XffkZ'](fetch,WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x4c9c09['opOVy']},'body':new URLSearchParams({'client_id':_0x21e954,'grant_type':_0x4c9c09['iGwes'],'refresh_token':_0x2aff13,'organization_id':_0x1cc25c})});if(!_0x50bd93['ok']){const _0x3d8eee=await _0x50bd93[_0x362957(0x20e)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x50bd93['status']+'\x20'+_0x3d8eee);}return _0x50bd93[_0x362957(0x1df)]();}function _0x3073(_0x10b433,_0x68ff86){_0x10b433=_0x10b433-0x1ba;const _0x397aa8=_0x397a();let _0x3073a2=_0x397aa8[_0x10b433];return _0x3073a2;}async function provisionCliToken(_0x2a8bfa){const _0x1cfa99=_0x3073,_0x319d5c={'xHahA':function(_0x20f250){return _0x20f250();},'yKbYU':function(_0x4de1a8,_0x39b2bc,_0x2a8ae3){return _0x4de1a8(_0x39b2bc,_0x2a8ae3);},'QslWG':_0x1cfa99(0x214),'WAoTf':_0x1cfa99(0x1ec)},_0x6758=_0x319d5c['xHahA'](getApiBaseUrl),_0x3475c3=await _0x319d5c[_0x1cfa99(0x1d9)](fetch,_0x6758+'/cli-auth/token',{'method':_0x319d5c['QslWG'],'headers':{'Content-Type':_0x319d5c['WAoTf'],'workos-token':_0x2a8bfa}});if(!_0x3475c3['ok']){const _0x5cb047=await _0x3475c3[_0x1cfa99(0x20e)]();throw new Error(_0x1cfa99(0x1ff)+_0x3475c3['status']+'\x20'+_0x5cb047);}return _0x3475c3[_0x1cfa99(0x1df)]();}export async function runDeviceAuthFlow(){const _0x3130d6=_0x3073,_0x5211df={'wBXgh':function(_0x4c4b61){return _0x4c4b61();},'fNjOu':function(_0x524d77,_0x283e13){return _0x524d77(_0x283e13);},'ZdTMi':_0x3130d6(0x1f3),'SkvBw':function(_0x1b7c50,_0xc87001){return _0x1b7c50(_0xc87001);},'iyIBN':_0x3130d6(0x207),'vSUwJ':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','auUTZ':_0x3130d6(0x1d4),'nXpff':function(_0xeccfbe,_0xc122eb,_0x551fd8,_0x4b7af9){return _0xeccfbe(_0xc122eb,_0x551fd8,_0x4b7af9);},'EMRxb':'Provisioning\x20CLI\x20token...'},_0xaec1a3=_0x5211df['wBXgh'](getCurrentEnvironment),_0x33e6d7=ENVIRONMENT_CONFIGS[_0xaec1a3][_0x3130d6(0x1f8)],_0x2d48b5=await _0x5211df[_0x3130d6(0x1ce)](requestDeviceCode,_0x33e6d7);console['log'](_0x5211df['ZdTMi']),console[_0x3130d6(0x1d6)](_0x3130d6(0x1f2)),_0x5211df[_0x3130d6(0x1e0)](openBrowser,_0x2d48b5[_0x3130d6(0x1e6)]),console[_0x3130d6(0x1d6)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x2d48b5[_0x3130d6(0x1e6)]),console[_0x3130d6(0x1d6)](_0x3130d6(0x1e8)+_0x2d48b5['user_code']+'\x0a'),process['stdout'][_0x3130d6(0x1f6)]('Waiting\x20for\x20authentication...');let _0x79c713=await pollForTokens(_0x33e6d7,_0x2d48b5[_0x3130d6(0x1e5)],_0x2d48b5[_0x3130d6(0x206)],_0x2d48b5[_0x3130d6(0x1db)]);console[_0x3130d6(0x1d6)]('\x20✓');const _0x45fff1=decodeJwtPayload(_0x79c713[_0x3130d6(0x209)]);if(!_0x45fff1[_0x3130d6(0x1c4)]){const _0x50e3ad=await fetchMyMemberships(_0x79c713[_0x3130d6(0x209)]);let _0x2da1d6;if(_0x50e3ad[_0x3130d6(0x1c0)]===0x0){process['stdout'][_0x3130d6(0x1f6)](_0x3130d6(0x1e1));const _0x11d6f8=await _0x5211df[_0x3130d6(0x1e0)](selfServeSignup,_0x79c713[_0x3130d6(0x209)]);_0x2da1d6=_0x11d6f8[_0x3130d6(0x20a)],console[_0x3130d6(0x1d6)]('\x20✓');}else{if(_0x50e3ad['length']===0x1)_0x2da1d6=_0x50e3ad[0x0][_0x3130d6(0x20a)],console[_0x3130d6(0x1d6)](_0x3130d6(0x1cf)+_0x50e3ad[0x0]['name']);else{const _0x36397e=process['stdin'][_0x3130d6(0x1f4)]&&process[_0x3130d6(0x1fa)]['isTTY'];if(!_0x36397e)throw new Error(_0x5211df['iyIBN']+_0x5211df[_0x3130d6(0x20b)]);const {selected:_0x3872c4}=await _0x44a19d['prompt']([{'type':_0x3130d6(0x1c9),'name':_0x5211df['auUTZ'],'message':_0x3130d6(0x205),'choices':_0x50e3ad[_0x3130d6(0x1c7)](_0xcbbcc2=>({'name':_0xcbbcc2['name'],'value':_0xcbbcc2[_0x3130d6(0x20a)]}))}]);_0x2da1d6=_0x3872c4;}}_0x79c713=await _0x5211df['nXpff'](refreshTokenWithOrg,_0x33e6d7,_0x79c713['refresh_token'],_0x2da1d6);}process[_0x3130d6(0x1fa)][_0x3130d6(0x1f6)](_0x5211df[_0x3130d6(0x20d)]);const _0x3ebcb8=await provisionCliToken(_0x79c713['access_token']);return console['log']('\x20✓'),await _0x5211df['fNjOu'](storeToken,_0x3ebcb8['token']),_0x79c713['refresh_token']&&await storeRefreshToken(_0x79c713['refresh_token']),_0x3ebcb8['token'];}function sleep(_0x6b1c1){return new Promise(_0x5d1232=>setTimeout(_0x5d1232,_0x6b1c1));}
1
+ const _0x31c3b4=_0x126c;function _0x126c(_0x18bbdd,_0x4024ac){_0x18bbdd=_0x18bbdd-0x72;const _0xe0071b=_0xe007();let _0x126c96=_0xe0071b[_0x18bbdd];return _0x126c96;}(function(_0x1d14b1,_0x210f83){const _0x4994e6=_0x126c,_0x510628=_0x1d14b1();while(!![]){try{const _0x38b275=parseInt(_0x4994e6(0x7d))/0x1*(parseInt(_0x4994e6(0xc9))/0x2)+-parseInt(_0x4994e6(0xcd))/0x3*(-parseInt(_0x4994e6(0xb3))/0x4)+-parseInt(_0x4994e6(0x90))/0x5*(parseInt(_0x4994e6(0x9a))/0x6)+-parseInt(_0x4994e6(0x97))/0x7+-parseInt(_0x4994e6(0x72))/0x8*(parseInt(_0x4994e6(0xa4))/0x9)+-parseInt(_0x4994e6(0x91))/0xa*(parseInt(_0x4994e6(0xad))/0xb)+parseInt(_0x4994e6(0xb2))/0xc*(parseInt(_0x4994e6(0x82))/0xd);if(_0x38b275===_0x210f83)break;else _0x510628['push'](_0x510628['shift']());}catch(_0x56f926){_0x510628['push'](_0x510628['shift']());}}}(_0xe007,0xd5815));import{spawn}from'child_process';import _0x1476e1 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x31c3b4(0xbc),WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x4fe99b){const _0x2a8501=_0x31c3b4,_0x19907d={'HGGBq':'POST','FeKLF':'application/x-www-form-urlencoded'},_0x15ec97=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x19907d[_0x2a8501(0xc0)],'headers':{'Content-Type':_0x19907d['FeKLF']},'body':new URLSearchParams({'client_id':_0x4fe99b})});if(!_0x15ec97['ok']){const _0x3600d8=await _0x15ec97['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x15ec97['status']+'\x20'+_0x3600d8);}return _0x15ec97[_0x2a8501(0xbd)]();}export async function pollForTokens(_0x19dc41,_0x503354,_0x5749ad,_0x18c1f3){const _0x42422c=_0x31c3b4,_0x55c44f={'prvHW':function(_0x450563,_0x135f4a){return _0x450563*_0x135f4a;},'eoXiE':function(_0xef2f13,_0x35cacc){return _0xef2f13*_0x35cacc;},'VQCKr':function(_0xff571c,_0x3179ef){return _0xff571c<_0x3179ef;},'QTfOF':function(_0x5ca952,_0x2ecd67){return _0x5ca952(_0x2ecd67);},'agiZk':'POST','ijRDH':'application/x-www-form-urlencoded','Nohsj':function(_0xa18bbf,_0x4bc93d){return _0xa18bbf===_0x4bc93d;},'ioqxo':_0x42422c(0x8f),'bbfAa':_0x42422c(0x7c)},_0x24272b=Date['now']()+_0x55c44f[_0x42422c(0xac)](_0x18c1f3,0x3e8);let _0x363f7b=_0x55c44f['eoXiE'](_0x5749ad,0x3e8);while(_0x55c44f[_0x42422c(0x9e)](Date[_0x42422c(0xaf)](),_0x24272b)){await _0x55c44f['QTfOF'](sleep,_0x363f7b);const _0x1213cb=await fetch(WORKOS_TOKEN_URL,{'method':_0x55c44f['agiZk'],'headers':{'Content-Type':_0x55c44f[_0x42422c(0x76)]},'body':new URLSearchParams({'client_id':_0x19dc41,'device_code':_0x503354,'grant_type':_0x42422c(0xcc)})});if(_0x1213cb['ok'])return _0x1213cb['json']();const _0x26b81d=await _0x1213cb[_0x42422c(0xbd)]();if(_0x55c44f['Nohsj'](_0x26b81d[_0x42422c(0xb7)],'authorization_pending'))continue;if(_0x26b81d[_0x42422c(0xb7)]===_0x55c44f[_0x42422c(0x86)]){_0x363f7b+=0x3e8;continue;}throw new Error(_0x26b81d[_0x42422c(0x75)]||_0x26b81d[_0x42422c(0xb7)]||'Authentication\x20failed');}throw new Error(_0x55c44f[_0x42422c(0xab)]);}async function fetchUserProfile(_0x34d91f){const _0x4892e5=_0x31c3b4,_0x4eed0b={'MhLZT':function(_0x1936ce,_0x596277,_0x48c34a){return _0x1936ce(_0x596277,_0x48c34a);},'SHDDM':_0x4892e5(0xbe)},_0x3d9709=getApiBaseUrl();try{const _0x4f7cb7=await _0x4eed0b[_0x4892e5(0x9f)](fetch,_0x3d9709+_0x4892e5(0x7e),{'method':_0x4eed0b[_0x4892e5(0x89)],'headers':{'workos-token':_0x34d91f}});if(_0x4f7cb7['ok'])return _0x4f7cb7['json']();}catch{}return null;}function buildKeyName(_0x1ff155,_0x4f401c){const _0x531d50=_0x31c3b4,_0x39ad9d={'XduLD':function(_0x2c82c9,_0x3b52a3){return _0x2c82c9===_0x3b52a3;},'utBrd':function(_0x31da0c,_0x450e73){return _0x31da0c+_0x450e73;}},_0x46ad6b=_0x4f401c['filter'](_0x15ed7f=>_0x15ed7f[_0x531d50(0xcf)]===_0x1ff155||_0x15ed7f['name'][_0x531d50(0xa5)](_0x1ff155+'\x20('));if(_0x39ad9d[_0x531d50(0x83)](_0x46ad6b['length'],0x0))return _0x1ff155;return _0x1ff155+'\x20('+_0x39ad9d['utBrd'](_0x46ad6b[_0x531d50(0x77)],0x1)+')';}export async function provisionApiKey(_0x46b3b9){const _0x17f4a3=_0x31c3b4,_0x4e06f0={'aSKRr':'application/json','itvmY':function(_0x2f466d,_0x483182){return _0x2f466d(_0x483182);},'mGNUX':_0x17f4a3(0xb4),'TeMvJ':function(_0x447891,_0x51c0da,_0x549818){return _0x447891(_0x51c0da,_0x549818);},'UEuaO':'GET','owKPi':'mcp:write'},_0x27084d=getApiBaseUrl(),_0x15989e={'Content-Type':_0x4e06f0['aSKRr'],'workos-token':_0x46b3b9},_0x5cd2d1=await _0x4e06f0[_0x17f4a3(0x88)](fetchUserProfile,_0x46b3b9),_0x1dffcf=_0x5cd2d1?.[_0x17f4a3(0xa2)]||_0x5cd2d1?.[_0x17f4a3(0x8c)]?.['split']('@')[0x0],_0x3b492d=_0x1dffcf?_0x1dffcf+'\x27s\x20CLI\x20Key':_0x4e06f0['mGNUX'];let _0x4fe06f=[];try{const _0x3264e7=await _0x4e06f0[_0x17f4a3(0x99)](fetch,_0x27084d+'/api-keys',{'method':_0x4e06f0[_0x17f4a3(0x8a)],'headers':_0x15989e});if(_0x3264e7['ok']){const _0x10624a=await _0x3264e7['json']();_0x4fe06f=_0x10624a[_0x17f4a3(0xb8)];}}catch{}const _0xd4d039=buildKeyName(_0x3b492d,_0x4fe06f),_0x53ab6c=await fetch(_0x27084d+'/api-keys',{'method':'POST','headers':_0x15989e,'body':JSON['stringify']({'name':_0xd4d039,'scope':_0x4e06f0['owKPi']})});if(!_0x53ab6c['ok']){const _0x3c9484=await _0x53ab6c['text']();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x53ab6c['status']+'\x20'+_0x3c9484);}const _0x557748=await _0x53ab6c[_0x17f4a3(0xbd)]();return _0x557748[_0x17f4a3(0xaa)]['token'];}export function openBrowser(_0x4f3ec1){const _0x3b412c=_0x31c3b4,_0x438198={'dGyne':function(_0x366a86,_0x334027){return _0x366a86===_0x334027;},'GfpXO':'win32','aZyxs':_0x3b412c(0xb5),'kdxvK':_0x3b412c(0x85),'jQeah':function(_0x314b1a,_0x183604,_0x3e4cd7,_0x2c8084){return _0x314b1a(_0x183604,_0x3e4cd7,_0x2c8084);}};try{if(_0x438198['dGyne'](process[_0x3b412c(0x7a)],_0x438198['GfpXO'])){const _0x369688=spawn(_0x3b412c(0xbb),['/c',_0x438198['aZyxs'],'',_0x4f3ec1],{'detached':!![],'stdio':_0x3b412c(0xae),'windowsHide':!![]});_0x369688['unref']();return;}const _0x37d894=process[_0x3b412c(0x7a)]===_0x438198['kdxvK']?'open':_0x3b412c(0xd1),_0x565243=_0x438198[_0x3b412c(0xa7)](spawn,_0x37d894,[_0x4f3ec1],{'detached':!![],'stdio':'ignore'});_0x565243[_0x3b412c(0xb6)]();}catch{}}function decodeJwtPayload(_0x2800f4){const _0xbeb3e4=_0x31c3b4,_0x5e2c61={'NcrFt':function(_0x58b0b9,_0x2e7f91){return _0x58b0b9!==_0x2e7f91;},'dWgIs':_0xbeb3e4(0xa3),'uwVYj':_0xbeb3e4(0x87)},_0xcab3e9=_0x2800f4['split']('.');if(_0x5e2c61[_0xbeb3e4(0x7b)](_0xcab3e9['length'],0x3))throw new Error(_0x5e2c61[_0xbeb3e4(0x92)]);const _0x383f71=Buffer['from'](_0xcab3e9[0x1],_0xbeb3e4(0xc2))[_0xbeb3e4(0xb1)](_0x5e2c61[_0xbeb3e4(0x7f)]);return JSON[_0xbeb3e4(0xc4)](_0x383f71);}async function selfServeSignup(_0x2e87d2){const _0x24b9e9=_0x31c3b4,_0x1493c7={'dlIxn':function(_0x2ce05d){return _0x2ce05d();},'mzYJO':function(_0xae772a,_0x2b012e,_0x1d9af4){return _0xae772a(_0x2b012e,_0x1d9af4);},'ZbGzQ':_0x24b9e9(0x81),'fywsJ':'application/json'},_0x13a461=_0x1493c7['dlIxn'](getApiBaseUrl),_0x2a4541=await _0x1493c7['mzYJO'](fetch,_0x13a461+_0x24b9e9(0x94),{'method':_0x1493c7['ZbGzQ'],'headers':{'Content-Type':_0x1493c7[_0x24b9e9(0xa8)],'workos-token':_0x2e87d2}});if(!_0x2a4541['ok']){const _0x174624=await _0x2a4541[_0x24b9e9(0xc8)]();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x2a4541[_0x24b9e9(0x8b)]+'\x20'+_0x174624);}return _0x2a4541['json']();}function _0xe007(){const _0x350f40=['TeMvJ','6asOwRi','aZbeM','log','interval','VQCKr','MhLZT','Failed\x20to\x20fetch\x20memberships:\x20','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','firstName','Invalid\x20JWT\x20format','269442SKSDvy','startsWith','device_code','jQeah','fywsJ','memberships','apiKey','bbfAa','prvHW','11vSKnzq','ignore','now','access_token','toString','1457556IDGRRa','40UWUIUD','CLI\x20Key','start','unref','error','apiKeys','write','tbrim','cmd','https://api.workos.com/user_management/authorize/device','json','GET','org_id','HGGBq','Setting\x20up\x20your\x20organization...','base64url','verification_uri_complete','parse','stdout','token','expires_in','text','14892htUhHK','YtPLN','prompt','urn:ietf:params:oauth:grant-type:device_code','516606OakjTy','/organization/my-memberships','name','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','xdg-open','isTTY','jhWgL','112IszKlu','bqAng','XJtJw','error_description','ijRDH','length','Using\x20organization:\x20','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','platform','NcrFt','Device\x20authorization\x20timed\x20out','43hhinuE','/organization/me','uwVYj','VhAZU','POST','13aoKrje','XduLD','WpWpb','darwin','ioqxo','utf-8','itvmY','SHDDM','UEuaO','status','email','Provisioning\x20CLI\x20token...','selected','slow_down','1134845ahNfks','6323890QAfRLC','dWgIs','Failed\x20to\x20provision\x20CLI\x20token:\x20','/organization/self-serve-signup','yQnCQ','refresh_token','74578wqxbwY','/cli-auth/token'];_0xe007=function(){return _0x350f40;};return _0xe007();}async function fetchMyMemberships(_0x32b2e9){const _0x2de462=_0x31c3b4,_0x377e0b={'kFTMu':function(_0x5e64f9,_0x23b4f1,_0x45fe45){return _0x5e64f9(_0x23b4f1,_0x45fe45);}},_0x4dcb0a=getApiBaseUrl(),_0x153e7a=await _0x377e0b['kFTMu'](fetch,_0x4dcb0a+_0x2de462(0xce),{'method':'GET','headers':{'workos-token':_0x32b2e9}});if(!_0x153e7a['ok']){const _0x54b2ea=await _0x153e7a['text']();throw new Error(_0x2de462(0xa0)+_0x153e7a['status']+'\x20'+_0x54b2ea);}const _0x4ca0ee=await _0x153e7a['json']();return _0x4ca0ee[_0x2de462(0xa9)];}async function refreshTokenWithOrg(_0x12e9bf,_0x354dce,_0x3193b0){const _0x4247b5=_0x31c3b4,_0x36466f={'YtPLN':'application/x-www-form-urlencoded'},_0x1c4c0f=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x36466f[_0x4247b5(0xca)]},'body':new URLSearchParams({'client_id':_0x12e9bf,'grant_type':'refresh_token','refresh_token':_0x354dce,'organization_id':_0x3193b0})});if(!_0x1c4c0f['ok']){const _0x9139b7=await _0x1c4c0f['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x1c4c0f['status']+'\x20'+_0x9139b7);}return _0x1c4c0f[_0x4247b5(0xbd)]();}async function provisionCliToken(_0x154aba){const _0x5aaac1=_0x31c3b4,_0x310396={'WpWpb':'application/json'},_0x40e049=getApiBaseUrl(),_0x2d391f=await fetch(_0x40e049+_0x5aaac1(0x98),{'method':'POST','headers':{'Content-Type':_0x310396[_0x5aaac1(0x84)],'workos-token':_0x154aba}});if(!_0x2d391f['ok']){const _0x4a85de=await _0x2d391f[_0x5aaac1(0xc8)]();throw new Error(_0x5aaac1(0x93)+_0x2d391f[_0x5aaac1(0x8b)]+'\x20'+_0x4a85de);}return _0x2d391f[_0x5aaac1(0xbd)]();}export async function runDeviceAuthFlow(){const _0x5af263=_0x31c3b4,_0x82b9c3={'tbrim':function(_0x18032f,_0x22bb9f){return _0x18032f(_0x22bb9f);},'VhAZU':_0x5af263(0xa1),'jhWgL':_0x5af263(0xd0),'Kxwkv':function(_0x3347ad,_0x2e47d5){return _0x3347ad===_0x2e47d5;},'yQnCQ':function(_0xa121f2,_0x84ea08){return _0xa121f2(_0x84ea08);},'yaijg':_0x5af263(0x79),'bqAng':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','aZbeM':'list','wSBFK':_0x5af263(0x8e),'XJtJw':'Select\x20an\x20organization:','PESCL':function(_0x198e1b,_0xd4837e,_0x16341f,_0x37e356){return _0x198e1b(_0xd4837e,_0x16341f,_0x37e356);}},_0x304253=getCurrentEnvironment(),_0x18e1c1=ENVIRONMENT_CONFIGS[_0x304253]['workosClientId'],_0x184c75=await _0x82b9c3[_0x5af263(0xba)](requestDeviceCode,_0x18e1c1);console['log'](_0x82b9c3[_0x5af263(0x80)]),console['log'](_0x82b9c3[_0x5af263(0xd3)]),_0x82b9c3['tbrim'](openBrowser,_0x184c75[_0x5af263(0xc3)]),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x184c75['verification_uri_complete']),console['log']('Code:\x20'+_0x184c75['user_code']+'\x0a'),process[_0x5af263(0xc5)][_0x5af263(0xb9)]('Waiting\x20for\x20authentication...');let _0x4ea644=await pollForTokens(_0x18e1c1,_0x184c75[_0x5af263(0xa6)],_0x184c75[_0x5af263(0x9d)],_0x184c75[_0x5af263(0xc7)]);console[_0x5af263(0x9c)]('\x20✓');const _0xdb7de9=decodeJwtPayload(_0x4ea644[_0x5af263(0xb0)]);if(!_0xdb7de9[_0x5af263(0xbf)]){const _0x1ed109=await fetchMyMemberships(_0x4ea644[_0x5af263(0xb0)]);let _0x1ab07a;if(_0x82b9c3['Kxwkv'](_0x1ed109['length'],0x0)){process['stdout']['write'](_0x5af263(0xc1));const _0x346f49=await _0x82b9c3[_0x5af263(0x95)](selfServeSignup,_0x4ea644['access_token']);_0x1ab07a=_0x346f49['organizationId'],console[_0x5af263(0x9c)]('\x20✓');}else{if(_0x82b9c3['Kxwkv'](_0x1ed109['length'],0x1))_0x1ab07a=_0x1ed109[0x0]['organizationId'],console[_0x5af263(0x9c)](_0x5af263(0x78)+_0x1ed109[0x0]['name']);else{const _0x3f36e6=process['stdin']['isTTY']&&process[_0x5af263(0xc5)][_0x5af263(0xd2)];if(!_0x3f36e6)throw new Error(_0x82b9c3['yaijg']+_0x82b9c3[_0x5af263(0x73)]);const {selected:_0x5db825}=await _0x1476e1[_0x5af263(0xcb)]([{'type':_0x82b9c3[_0x5af263(0x9b)],'name':_0x82b9c3['wSBFK'],'message':_0x82b9c3[_0x5af263(0x74)],'choices':_0x1ed109['map'](_0x1d0b5b=>({'name':_0x1d0b5b[_0x5af263(0xcf)],'value':_0x1d0b5b['organizationId']}))}]);_0x1ab07a=_0x5db825;}}_0x4ea644=await _0x82b9c3['PESCL'](refreshTokenWithOrg,_0x18e1c1,_0x4ea644[_0x5af263(0x96)],_0x1ab07a);}process[_0x5af263(0xc5)][_0x5af263(0xb9)](_0x5af263(0x8d));const _0x2f43cb=await provisionCliToken(_0x4ea644['access_token']);return console['log']('\x20✓'),await storeToken(_0x2f43cb['token']),_0x4ea644['refresh_token']&&await storeRefreshToken(_0x4ea644['refresh_token']),_0x2f43cb[_0x5af263(0xc6)];}function sleep(_0x2f9f13){return new Promise(_0x4787e6=>setTimeout(_0x4787e6,_0x2f9f13));}
@@ -1 +1 @@
1
- const _0x4e4d91=_0x5224;(function(_0x2706f5,_0x110c07){const _0x3b6c67=_0x5224,_0x45ec3b=_0x2706f5();while(!![]){try{const _0x3c7bac=parseInt(_0x3b6c67(0xe2))/0x1+parseInt(_0x3b6c67(0xd9))/0x2+-parseInt(_0x3b6c67(0xd1))/0x3*(-parseInt(_0x3b6c67(0xd0))/0x4)+-parseInt(_0x3b6c67(0xdc))/0x5*(parseInt(_0x3b6c67(0xce))/0x6)+-parseInt(_0x3b6c67(0xd5))/0x7+parseInt(_0x3b6c67(0xd2))/0x8+-parseInt(_0x3b6c67(0xd6))/0x9;if(_0x3c7bac===_0x110c07)break;else _0x45ec3b['push'](_0x45ec3b['shift']());}catch(_0x23fab1){_0x45ec3b['push'](_0x45ec3b['shift']());}}}(_0x359d,0xcd181));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':'client_01J9CBYM7M5ZETCF7G6614DXR2','aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':_0x4e4d91(0xd3)},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x4e4d91(0xeb),'mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':_0x4e4d91(0xdd),'workosClientId':_0x4e4d91(0xe6),'aiProxyUrl':'http://localhost:8090','mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x545e14){return _0x545e14==='prod'||_0x545e14==='staging'||_0x545e14==='local';}export function getCurrentEnvironment(){const _0x107d48=_0x4e4d91,_0x236431=process[_0x107d48(0xcd)][_0x107d48(0xd7)];if(_0x236431&&isValidEnvironment(_0x236431))return _0x236431;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x32b22d=_0x4e4d91;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x32b22d(0xee)];}export function getAiProxyUrl(){const _0x5510c7=_0x4e4d91,_0x550aeb={'kROyP':function(_0x36289f){return _0x36289f();}};return ENVIRONMENT_CONFIGS[_0x550aeb[_0x5510c7(0xe5)](getCurrentEnvironment)][_0x5510c7(0xe8)];}export function getMcpAuthUrl(){const _0xa01fc3=_0x4e4d91,_0x4a57af={'EjTsn':function(_0x48785a){return _0x48785a();}};return process[_0xa01fc3(0xcd)][_0xa01fc3(0xe9)]??ENVIRONMENT_CONFIGS[_0x4a57af[_0xa01fc3(0xcf)](getCurrentEnvironment)]['mcpAuthUrl'];}function _0x359d(){const _0x43a382=['SiDcr','apiBaseUrl','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','env','6YSQyat','EjTsn','44rJBVRR','6441GUTAls','12891896mrjeWo','https://mcp-auth.ranger.net/mcp','RANGER_DISABLE_MCP','2557520GXrUJB','16354233QbKayF','RANGER_CLI_ENV','trim','3155548mnlJjR','[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22','off','3917810YAdMsJ','http://localhost:8080','nova-act-cli','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.','rHybA','\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.','593246MYVZhF','ZgfMH','cYgtV','kROyP','client_01J9CBYM2DKWV9HM17D95Z540K','mtBDk','aiProxyUrl','RANGER_MCP_AUTH_URL','rangerwright-cli','https://ai-proxy-301751771437.us-central1.run.app','RANGER_USE_NOVA_ACT'];_0x359d=function(){return _0x43a382;};return _0x359d();}function _0x5224(_0x11a574,_0x532359){_0x11a574=_0x11a574-0xcc;const _0x359dc9=_0x359d();let _0x522418=_0x359dc9[_0x11a574];return _0x522418;}export function isByokEnabled(){const _0x450f33=_0x4e4d91;return process[_0x450f33(0xcd)]['RANGER_BYOK']==='true';}function isVerificationTransport(_0x32f3e0){const _0x4ad8f0=_0x4e4d91,_0x4c6fa5={'cYgtV':function(_0x46cc6b,_0xc41e3a){return _0x46cc6b===_0xc41e3a;},'xqyfP':'playwright-cli','EnGMM':_0x4ad8f0(0xde),'rHybA':_0x4ad8f0(0xea)};return _0x4c6fa5[_0x4ad8f0(0xe4)](_0x32f3e0,'mcp')||_0x32f3e0===_0x4c6fa5['xqyfP']||_0x32f3e0===_0x4c6fa5['EnGMM']||_0x32f3e0===_0x4c6fa5[_0x4ad8f0(0xe0)];}const LEGACY_TRANSPORT_ENV_VARS=[_0x4e4d91(0xec),_0x4e4d91(0xd4)];export function getVerificationTransport(){const _0x1689be=_0x4e4d91,_0x164e30={'ZgfMH':function(_0x13572e,_0x32ecea){return _0x13572e(_0x32ecea);},'rfLBk':'mcp'},_0x295f70=process[_0x1689be(0xcd)]['RANGER_TRANSPORT']?.[_0x1689be(0xd8)]();if(_0x295f70){if(_0x164e30[_0x1689be(0xe3)](isVerificationTransport,_0x295f70))return _0x295f70;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x295f70+_0x1689be(0xcc));}const _0x7f0c37=LEGACY_TRANSPORT_ENV_VARS['find'](_0x51be06=>process[_0x1689be(0xcd)][_0x51be06]);if(_0x7f0c37)throw new Error(_0x7f0c37+_0x1689be(0xe1));return _0x164e30['rfLBk'];}export function resolveHookMode(_0x3ecb11=process[_0x4e4d91(0xcd)]){const _0x3a9876=_0x4e4d91,_0x19dcf9={'SiDcr':function(_0x59f4cb,_0x2b13a5){return _0x59f4cb===_0x2b13a5;},'mtBDk':_0x3a9876(0xdb),'mWtjB':function(_0x4dff83,_0x48073b){return _0x4dff83+_0x48073b;}},_0x3b3f28=_0x3ecb11['RANGER_HOOKS']?.[_0x3a9876(0xd8)]()['toLowerCase']();if(!_0x3b3f28)return'auto';if(_0x19dcf9[_0x3a9876(0xed)](_0x3b3f28,_0x19dcf9[_0x3a9876(0xe7)])||_0x19dcf9['SiDcr'](_0x3b3f28,'on')||_0x3b3f28==='auto')return _0x3b3f28;return console['error'](_0x19dcf9['mWtjB'](_0x3a9876(0xda)+_0x3ecb11['RANGER_HOOKS']+'\x22.\x20',_0x3a9876(0xdf))),'auto';}
1
+ const _0xb42e0c=_0x4469;(function(_0x45bedf,_0x16c639){const _0x4c372d=_0x4469,_0x3ecb45=_0x45bedf();while(!![]){try{const _0x42c778=parseInt(_0x4c372d(0x14f))/0x1+parseInt(_0x4c372d(0x15d))/0x2+-parseInt(_0x4c372d(0x162))/0x3+-parseInt(_0x4c372d(0x140))/0x4*(parseInt(_0x4c372d(0x143))/0x5)+parseInt(_0x4c372d(0x151))/0x6+-parseInt(_0x4c372d(0x141))/0x7+parseInt(_0x4c372d(0x158))/0x8;if(_0x42c778===_0x16c639)break;else _0x3ecb45['push'](_0x3ecb45['shift']());}catch(_0x4dd926){_0x3ecb45['push'](_0x3ecb45['shift']());}}}(_0x5eef,0x71998));function _0x5eef(){const _0x3d07d8=['local','pwIwA','prod','error','RqlmX','http://localhost:8090','RANGER_DISABLE_MCP','bPoHO','[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22','90023BGNzvy','env','5038434qKZLwo','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','RANGER_BYOK','RANGER_TRANSPORT','toLowerCase','client_01J9CBYM2DKWV9HM17D95Z540K','https://api.ranger.net','6417808RjIlIr','VDBOu','https://mcp-auth.ranger.net/mcp','trim','true','822032UGqhaZ','https://mcp-auth.staging.ranger.net/mcp','RANGER_CLI_ENV','staging','auirB','2284077FVGkJA','RANGER_USE_NOVA_ACT','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.','off','\x22.\x20','rangerwright-cli','\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.','http://localhost:8080','jzWSA','4axjyaV','1143793msdZku','client_01J9CBYM7M5ZETCF7G6614DXR2','3764710BrgbvN','http://localhost:8080/mcp','auto'];_0x5eef=function(){return _0x3d07d8;};return _0x5eef();}export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0xb42e0c(0x157),'workosClientId':_0xb42e0c(0x142),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':_0xb42e0c(0x15a)},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'https://ai-proxy-301751771437.us-central1.run.app','mcpAuthUrl':_0xb42e0c(0x15e)},'local':{'apiBaseUrl':_0xb42e0c(0x13e),'workosClientId':_0xb42e0c(0x156),'aiProxyUrl':_0xb42e0c(0x14b),'mcpAuthUrl':_0xb42e0c(0x144)}};export const DEFAULT_ENVIRONMENT=_0xb42e0c(0x148);export function isValidEnvironment(_0x3d29af){const _0x1f92d9=_0xb42e0c,_0x503186={'auirB':_0x1f92d9(0x160),'MuYOq':function(_0x464641,_0x94e80c){return _0x464641===_0x94e80c;}};return _0x3d29af===_0x1f92d9(0x148)||_0x3d29af===_0x503186[_0x1f92d9(0x161)]||_0x503186['MuYOq'](_0x3d29af,_0x1f92d9(0x146));}export function getCurrentEnvironment(){const _0x5ec12e=_0xb42e0c,_0x40c4ad={'RqlmX':function(_0xf89076,_0x18e3af){return _0xf89076(_0x18e3af);}},_0x44eca8=process['env'][_0x5ec12e(0x15f)];if(_0x44eca8&&_0x40c4ad[_0x5ec12e(0x14a)](isValidEnvironment,_0x44eca8))return _0x44eca8;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['apiBaseUrl'];}export function getAiProxyUrl(){const _0x3d5fe4=_0xb42e0c,_0x11609f={'jzWSA':function(_0x308a40){return _0x308a40();}};return ENVIRONMENT_CONFIGS[_0x11609f[_0x3d5fe4(0x13f)](getCurrentEnvironment)]['aiProxyUrl'];}function _0x4469(_0xd6e359,_0x52c5af){_0xd6e359=_0xd6e359-0x13b;const _0x5eef0e=_0x5eef();let _0x4469d6=_0x5eef0e[_0xd6e359];return _0x4469d6;}export function getMcpAuthUrl(){const _0x3a85b9={'nInTu':function(_0x2f1539){return _0x2f1539();}};return process['env']['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[_0x3a85b9['nInTu'](getCurrentEnvironment)]['mcpAuthUrl'];}export function isByokEnabled(){const _0x199b7b=_0xb42e0c,_0x365bbb={'vNmCW':function(_0x1c636c,_0x9a5e53){return _0x1c636c===_0x9a5e53;},'pwIwA':_0x199b7b(0x15c)};return _0x365bbb['vNmCW'](process['env'][_0x199b7b(0x153)],_0x365bbb[_0x199b7b(0x147)]);}function isVerificationTransport(_0x49aa75){const _0x3257ff=_0xb42e0c,_0x5ba113={'Dcxrg':'playwright-cli','bPoHO':function(_0x125cd6,_0x59d385){return _0x125cd6===_0x59d385;},'MhyCe':_0x3257ff(0x13c)};return _0x49aa75==='mcp'||_0x49aa75===_0x5ba113['Dcxrg']||_0x5ba113[_0x3257ff(0x14d)](_0x49aa75,'nova-act-cli')||_0x5ba113['bPoHO'](_0x49aa75,_0x5ba113['MhyCe']);}const LEGACY_TRANSPORT_ENV_VARS=[_0xb42e0c(0x163),_0xb42e0c(0x14c)];export function getVerificationTransport(){const _0x45a32c=_0xb42e0c,_0x33e43e={'mFLBP':'mcp'},_0x46d191=process['env'][_0x45a32c(0x154)]?.[_0x45a32c(0x15b)]();if(_0x46d191){if(isVerificationTransport(_0x46d191))return _0x46d191;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x46d191+_0x45a32c(0x152));}const _0xbd9334=LEGACY_TRANSPORT_ENV_VARS['find'](_0x773430=>process[_0x45a32c(0x150)][_0x773430]);if(_0xbd9334)throw new Error(_0xbd9334+_0x45a32c(0x13d));return _0x33e43e['mFLBP'];}export function resolveHookMode(_0x59e3cb=process['env']){const _0x2ad8a6=_0xb42e0c,_0x304dd6={'HMZLG':_0x2ad8a6(0x145),'VDBOu':_0x2ad8a6(0x165)},_0x1fadb2=_0x59e3cb['RANGER_HOOKS']?.['trim']()[_0x2ad8a6(0x155)]();if(!_0x1fadb2)return _0x304dd6['HMZLG'];if(_0x1fadb2===_0x304dd6[_0x2ad8a6(0x159)]||_0x1fadb2==='on'||_0x1fadb2===_0x2ad8a6(0x145))return _0x1fadb2;return console[_0x2ad8a6(0x149)](_0x2ad8a6(0x14e)+_0x59e3cb['RANGER_HOOKS']+_0x2ad8a6(0x13b)+_0x2ad8a6(0x164)),'auto';}
@@ -1 +1 @@
1
- (function(_0x571d66,_0x1bee4d){const _0x4569a0=_0x4b33,_0x200c6f=_0x571d66();while(!![]){try{const _0x51dba5=-parseInt(_0x4569a0(0x1ad))/0x1*(parseInt(_0x4569a0(0x1ca))/0x2)+-parseInt(_0x4569a0(0x1b7))/0x3+parseInt(_0x4569a0(0x1c4))/0x4*(-parseInt(_0x4569a0(0x1b8))/0x5)+parseInt(_0x4569a0(0x1ab))/0x6*(parseInt(_0x4569a0(0x1a3))/0x7)+-parseInt(_0x4569a0(0x1b0))/0x8+-parseInt(_0x4569a0(0x1b9))/0x9*(parseInt(_0x4569a0(0x1d2))/0xa)+parseInt(_0x4569a0(0x1e6))/0xb;if(_0x51dba5===_0x1bee4d)break;else _0x200c6f['push'](_0x200c6f['shift']());}catch(_0x4afe91){_0x200c6f['push'](_0x200c6f['shift']());}}}(_0x399d,0x44522));function _0x4b33(_0x6ba84e,_0x4a2007){_0x6ba84e=_0x6ba84e-0x19f;const _0x399d22=_0x399d();let _0x4b3349=_0x399d22[_0x6ba84e];return _0x4b3349;}import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0xcb2026){const _0x3f811c=_0x4b33,_0x59ad7e={'ZUkjf':function(_0x63a202){return _0x63a202();},'EcXvu':_0x3f811c(0x1a2),'NyHaK':function(_0x153505,_0x2d2295){return _0x153505===_0x2d2295;},'KlBax':'Feature\x20limit\x20exceeded'},_0x1de6ac=await _0x59ad7e['ZUkjf'](getToken);if(!_0x1de6ac)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x4d38f7=_0x59ad7e['ZUkjf'](getApiBaseUrl),_0x14c80b=await fetch(_0x4d38f7+_0x3f811c(0x1da),{'method':'POST','headers':{'Authorization':_0x3f811c(0x1c0)+_0x1de6ac,'Content-Type':_0x59ad7e['EcXvu']},'body':JSON['stringify'](_0xcb2026)});if(!_0x14c80b['ok']){if(_0x59ad7e['NyHaK'](_0x14c80b[_0x3f811c(0x1cb)],0x192)){const _0x13a0b3=await _0x14c80b[_0x3f811c(0x1b5)](),_0x57e787=_0x13a0b3['billingUrl']||'https://dashboard.ranger.net/billing';throw new Error((_0x13a0b3['message']||_0x59ad7e[_0x3f811c(0x1d1)])+_0x3f811c(0x1e3)+_0x57e787);}const _0x2b2958=await _0x14c80b['text']();throw new Error(_0x3f811c(0x1c6)+_0x2b2958);}return _0x14c80b['json']();}export async function listFeatures(_0x565803){const _0x17dae0=_0x4b33,_0x123b22={'nOhYE':function(_0x3f08e4){return _0x3f08e4();},'XHnLX':_0x17dae0(0x1d5),'hpiRD':'gitRepoUrl','MftEP':'gitBranch','aEuuk':_0x17dae0(0x1a5)},_0x3002f2=await _0x123b22[_0x17dae0(0x1cc)](getToken);if(!_0x3002f2)throw new Error(_0x123b22['XHnLX']);const _0x45105c=_0x123b22['nOhYE'](getApiBaseUrl),_0x34a120=new URLSearchParams();if(_0x565803?.['gitRepoUrl'])_0x34a120['set'](_0x123b22['hpiRD'],_0x565803[_0x17dae0(0x1e8)]);if(_0x565803?.['gitBranch'])_0x34a120['set'](_0x123b22['MftEP'],_0x565803[_0x17dae0(0x1dd)]);if(_0x565803?.[_0x17dae0(0x1af)])_0x34a120['set']('limit',_0x565803[_0x17dae0(0x1af)][_0x17dae0(0x1a6)]());if(_0x565803?.[_0x17dae0(0x1a5)])_0x34a120['set'](_0x123b22['aEuuk'],_0x565803[_0x17dae0(0x1a5)]['toString']());if(_0x565803?.[_0x17dae0(0x1aa)])_0x34a120[_0x17dae0(0x1b6)]('includeDeleted','true');const _0x114c3a=_0x45105c+'/api/v1/mcp/features'+(_0x34a120[_0x17dae0(0x1a6)]()?'?'+_0x34a120[_0x17dae0(0x1a6)]():''),_0xa41d28=await fetch(_0x114c3a,{'method':'GET','headers':{'Authorization':_0x17dae0(0x1c0)+_0x3002f2}});if(!_0xa41d28['ok']){const _0x1f2615=await _0xa41d28[_0x17dae0(0x1a8)]();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x1f2615);}return _0xa41d28['json']();}export async function getFeature(_0x31b8f4){const _0x2a9170=_0x4b33,_0x30263d={'uurMZ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','nwJZg':function(_0x22a33c){return _0x22a33c();},'jhNzO':function(_0x39e843,_0x12d16c,_0x4e326b){return _0x39e843(_0x12d16c,_0x4e326b);},'pJDMu':_0x2a9170(0x1b1)},_0x1c7e4c=await getToken();if(!_0x1c7e4c)throw new Error(_0x30263d['uurMZ']);const _0x100c73=_0x30263d['nwJZg'](getApiBaseUrl),_0x132d87=await _0x30263d['jhNzO'](fetch,_0x100c73+_0x2a9170(0x1e4)+_0x31b8f4,{'method':_0x30263d[_0x2a9170(0x1d4)],'headers':{'Authorization':_0x2a9170(0x1c0)+_0x1c7e4c}});if(!_0x132d87['ok']){const _0x31be78=await _0x132d87[_0x2a9170(0x1a8)]();throw new Error(_0x2a9170(0x1e7)+_0x31be78);}return _0x132d87[_0x2a9170(0x1b5)]();}export async function updateFeature(_0x93d28e,_0x22f3b9){const _0x4c98c9=_0x4b33,_0x1dc718={'RSqXs':function(_0x38324a){return _0x38324a();},'LETfR':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x4b329d=await _0x1dc718[_0x4c98c9(0x1b4)](getToken);if(!_0x4b329d)throw new Error(_0x1dc718[_0x4c98c9(0x1d7)]);const _0xc49946=getApiBaseUrl(),_0x33888b=await fetch(_0xc49946+_0x4c98c9(0x1e4)+_0x93d28e,{'method':'PATCH','headers':{'Authorization':_0x4c98c9(0x1c0)+_0x4b329d,'Content-Type':_0x4c98c9(0x1a2)},'body':JSON[_0x4c98c9(0x1e1)](_0x22f3b9)});if(!_0x33888b['ok']){const _0x184023=await _0x33888b[_0x4c98c9(0x1a8)]();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x184023);}return _0x33888b['json']();}export async function createChecklistItem(_0x13f52b,_0x4063a1,_0x5e169b){const _0x505846=_0x4b33,_0x44e3cf={'MxgNQ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','fNBXf':function(_0x3d3cae){return _0x3d3cae();}},_0x2c6518=await getToken();if(!_0x2c6518)throw new Error(_0x44e3cf['MxgNQ']);const _0x30b3cf=_0x44e3cf[_0x505846(0x1a9)](getApiBaseUrl),_0x238766=await fetch(_0x30b3cf+'/api/v1/mcp/features/'+_0x13f52b+'/checklist',{'method':_0x505846(0x1e9),'headers':{'Authorization':_0x505846(0x1c0)+_0x2c6518,'Content-Type':_0x505846(0x1a2)},'body':JSON['stringify']({'description':_0x4063a1,'position':_0x5e169b})});if(!_0x238766['ok']){const _0x2230b8=await _0x238766['text']();throw new Error(_0x505846(0x1e2)+_0x2230b8);}return _0x238766[_0x505846(0x1b5)]();}export async function updateChecklistItem(_0x2c7983,_0x2b27e5,_0x287fc6){const _0x5a1f15=_0x4b33,_0x55e736={'xvKMy':_0x5a1f15(0x1d5),'nOmEE':function(_0x270f02,_0x4575b5,_0x4bc969){return _0x270f02(_0x4575b5,_0x4bc969);},'rtFGj':'PATCH'};return withRetry(async()=>{const _0x5a91a4=_0x5a1f15,_0x198efa=await getToken();if(!_0x198efa)throw new Error(_0x55e736[_0x5a91a4(0x1cf)]);const _0x1f8fd8=getApiBaseUrl(),_0x4f7bcd=await _0x55e736['nOmEE'](fetch,_0x1f8fd8+_0x5a91a4(0x1e4)+_0x2c7983+'/checklist/'+_0x2b27e5,{'method':_0x55e736['rtFGj'],'headers':{'Authorization':_0x5a91a4(0x1c0)+_0x198efa,'Content-Type':'application/json'},'body':JSON[_0x5a91a4(0x1e1)](_0x287fc6)});if(!_0x4f7bcd['ok']){const _0x3ea0de=await _0x4f7bcd[_0x5a91a4(0x1a8)]();throw new Error(_0x5a91a4(0x1df)+_0x3ea0de);}return _0x4f7bcd[_0x5a91a4(0x1b5)]();},{'label':_0x5a1f15(0x1c1)});}export async function getFeatureReport(_0x416ad8){const _0x482d83=_0x4b33,_0x196b05={'GfnpA':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','BozNe':function(_0x44dfbb){return _0x44dfbb();},'sZLRX':function(_0xc29932,_0x15d59d,_0x4b1f7d){return _0xc29932(_0x15d59d,_0x4b1f7d);}},_0x27aa7e=await getToken();if(!_0x27aa7e)throw new Error(_0x196b05['GfnpA']);const _0x349760=_0x196b05[_0x482d83(0x1bc)](getApiBaseUrl),_0x44f121=await _0x196b05['sZLRX'](fetch,_0x349760+_0x482d83(0x1e4)+_0x416ad8+_0x482d83(0x1db),{'method':_0x482d83(0x1b1),'headers':{'Authorization':'Bearer\x20'+_0x27aa7e}});if(!_0x44f121['ok']){const _0x16a036=await _0x44f121[_0x482d83(0x1a8)]();throw new Error(_0x482d83(0x1ba)+_0x16a036);}return _0x44f121['json']();}export async function getFeatureReportMarkdown(_0x564d80,_0x30920a){const _0x129cd3=_0x4b33,_0x3de0c7={'XVxYB':function(_0x339784){return _0x339784();},'lZpet':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','yNXag':function(_0x528bbe,_0x1f7686){return _0x528bbe>_0x1f7686;},'KmTsr':function(_0x83051f,_0x3b0a44){return _0x83051f(_0x3b0a44);},'oYZbL':function(_0x18d1a8,_0x4590c6){return _0x18d1a8&&_0x4590c6;}},_0x15e53c=await _0x3de0c7[_0x129cd3(0x1d3)](getToken);if(!_0x15e53c)throw new Error(_0x3de0c7[_0x129cd3(0x1cd)]);const _0xe6f395=getApiBaseUrl(),_0x500f1d=new URLSearchParams(),_0x500eed=_0x3de0c7[_0x129cd3(0x1a7)](_0x30920a?.['itemIds']?.[_0x129cd3(0x1b2)]??0x0,0x0),_0x4c1056=_0x3de0c7['KmTsr'](Boolean,_0x30920a?.['sessionId']);_0x500eed&&_0x30920a?.[_0x129cd3(0x1c5)]&&_0x500f1d[_0x129cd3(0x1b6)]('itemIds',_0x30920a[_0x129cd3(0x1c5)][_0x129cd3(0x1b3)](','));_0x4c1056&&_0x30920a?.[_0x129cd3(0x1bd)]&&_0x500f1d['set']('sessionId',_0x30920a[_0x129cd3(0x1bd)]);_0x3de0c7[_0x129cd3(0x1ce)](!_0x500eed,!_0x4c1056)&&_0x30920a?.['style']&&_0x500f1d['set'](_0x129cd3(0x1c8),_0x30920a[_0x129cd3(0x1c8)]);const _0x1637b0=_0xe6f395+'/api/v1/mcp/features/'+_0x564d80+'/report/markdown',_0x273308=''+_0x1637b0+(_0x500f1d[_0x129cd3(0x1a6)]()?'?'+_0x500f1d[_0x129cd3(0x1a6)]():''),_0x4b009f=await fetch(_0x273308,{'method':_0x129cd3(0x1b1),'headers':{'Authorization':_0x129cd3(0x1c0)+_0x15e53c}});if(!_0x4b009f['ok']){const _0x17d58e=await _0x4b009f[_0x129cd3(0x1a8)]();throw new Error(_0x129cd3(0x1dc)+_0x17d58e);}return _0x4b009f[_0x129cd3(0x1a8)]();}export async function listFeatureSessions(_0x5cc977){const _0xe2684a=_0x4b33,_0x2a5478={'bXeqY':function(_0x2fbb59){return _0x2fbb59();}},_0x274732=await getToken();if(!_0x274732)throw new Error(_0xe2684a(0x1d5));const _0x13aeef=_0x2a5478['bXeqY'](getApiBaseUrl),_0x15790d=await fetch(_0x13aeef+_0xe2684a(0x1e4)+_0x5cc977+_0xe2684a(0x1de),{'method':_0xe2684a(0x1b1),'headers':{'Authorization':'Bearer\x20'+_0x274732}});if(!_0x15790d['ok']){const _0x1e14cc=await _0x15790d[_0xe2684a(0x1a8)]();throw new Error(_0xe2684a(0x1e0)+_0x1e14cc);}return _0x15790d['json']();}export async function startSession(_0x433418,_0x55e4c9){const _0x3abb65=_0x4b33,_0x13e018={'BdsBk':function(_0x501eb1){return _0x501eb1();},'tMzfF':function(_0x2d8318,_0x438823,_0x234706){return _0x2d8318(_0x438823,_0x234706);}},_0xadb8ab=await _0x13e018[_0x3abb65(0x1c3)](getToken);if(!_0xadb8ab)throw new Error(_0x3abb65(0x1d5));const _0x28aa89=getApiBaseUrl(),_0x20ce7b=await _0x13e018['tMzfF'](fetch,_0x28aa89+_0x3abb65(0x1e4)+_0x433418+'/sessions/'+_0x55e4c9+_0x3abb65(0x1e5),{'method':_0x3abb65(0x1e9),'headers':{'Authorization':'Bearer\x20'+_0xadb8ab}});if(!_0x20ce7b['ok']){const _0x1f524f=await _0x20ce7b['text']();throw new Error(_0x3abb65(0x1d8)+_0x1f524f);}return _0x20ce7b['json']();}export async function concludeSession(_0x35bcdc,_0x10a791){const _0x3ce610=_0x4b33,_0x10669f={'lyhfO':function(_0x43dd44){return _0x43dd44();},'yQSbi':function(_0x57ab15,_0x312856,_0x26511f){return _0x57ab15(_0x312856,_0x26511f);},'dTGal':_0x3ce610(0x1e9)},_0x18b71a=await _0x10669f[_0x3ce610(0x1ea)](getToken);if(!_0x18b71a)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1ab73b=_0x10669f['lyhfO'](getApiBaseUrl),_0x4962f7=await _0x10669f['yQSbi'](fetch,_0x1ab73b+'/api/v1/mcp/features/'+_0x35bcdc+_0x3ce610(0x1ac)+_0x10a791+_0x3ce610(0x1d6),{'method':_0x10669f[_0x3ce610(0x1ae)],'headers':{'Authorization':_0x3ce610(0x1c0)+_0x18b71a}});if(!_0x4962f7['ok']){const _0x37d415=await _0x4962f7[_0x3ce610(0x1a8)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x37d415);}return _0x4962f7['json']();}export async function getActionItems(_0x5edf6a){const _0x5d5764=_0x4b33,_0x32c44b={'RjSUY':_0x5d5764(0x1d5),'CbMaQ':'GET'},_0x1b93c1=await getToken();if(!_0x1b93c1)throw new Error(_0x32c44b['RjSUY']);const _0x1a1c91=getApiBaseUrl(),_0x5d5b7d=await fetch(_0x1a1c91+_0x5d5764(0x1e4)+_0x5edf6a+'/action-items',{'method':_0x32c44b[_0x5d5764(0x1a0)],'headers':{'Authorization':'Bearer\x20'+_0x1b93c1}});if(!_0x5d5b7d['ok']){const _0x4d090a=await _0x5d5b7d[_0x5d5764(0x1a8)]();throw new Error(_0x5d5764(0x1c7)+_0x4d090a);}return _0x5d5b7d[_0x5d5764(0x1b5)]();}export async function getItemFeedback(_0x54ed7d,_0xf4cd4a){const _0x6ee0ff=_0x4b33,_0x1dbf12={'PSfBr':function(_0x2770d9){return _0x2770d9();},'TskUU':function(_0x3c076b,_0x81baf9,_0x1c2dc3){return _0x3c076b(_0x81baf9,_0x1c2dc3);},'aVmFU':_0x6ee0ff(0x1b1)},_0x17a8d9=await _0x1dbf12['PSfBr'](getToken);if(!_0x17a8d9)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x23b20d=_0x1dbf12['PSfBr'](getApiBaseUrl),_0x4c205e=await _0x1dbf12['TskUU'](fetch,_0x23b20d+_0x6ee0ff(0x1e4)+_0x54ed7d+'/checklist-items/'+_0xf4cd4a+_0x6ee0ff(0x1a1),{'method':_0x1dbf12['aVmFU'],'headers':{'Authorization':_0x6ee0ff(0x1c0)+_0x17a8d9}});if(!_0x4c205e['ok']){const _0x4ad4bd=await _0x4c205e[_0x6ee0ff(0x1a8)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x4ad4bd);}return _0x4c205e[_0x6ee0ff(0x1b5)]();}export async function markCommentsAddressed(_0x1a96a1,_0x3039db,_0x104d9b){const _0x2ee252=_0x4b33,_0xd1d68={'aHjjl':function(_0x1f2ad5){return _0x1f2ad5();},'vkYJE':function(_0x202c01){return _0x202c01();}},_0x292f50=await _0xd1d68['aHjjl'](getToken);if(!_0x292f50)throw new Error(_0x2ee252(0x1d5));const _0x2a7188=_0xd1d68['vkYJE'](getApiBaseUrl),_0x109c6a=await fetch(_0x2a7188+'/api/v1/mcp/features/'+_0x1a96a1+'/comments/address',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x292f50,'Content-Type':'application/json'},'body':JSON['stringify']({'checklistItemId':_0x3039db,'commentIds':_0x104d9b})});if(!_0x109c6a['ok']){const _0x1933ec=await _0x109c6a[_0x2ee252(0x1a8)]();throw new Error(_0x2ee252(0x1d0)+_0x1933ec);}}export async function softDeleteFeature(_0x4ba749){const _0x12b1bf=_0x4b33,_0x56f974={'KaAfF':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','KoIcl':function(_0x269361){return _0x269361();},'usLwv':function(_0x689f3f,_0x2945d8,_0x47c3b3){return _0x689f3f(_0x2945d8,_0x47c3b3);},'okOJd':'DELETE'},_0x3c7c02=await getToken();if(!_0x3c7c02)throw new Error(_0x56f974[_0x12b1bf(0x1c2)]);const _0x16de5d=_0x56f974[_0x12b1bf(0x1bb)](getApiBaseUrl),_0xc2754c=await _0x56f974[_0x12b1bf(0x1d9)](fetch,_0x16de5d+'/api/v1/mcp/features/'+_0x4ba749,{'method':_0x56f974[_0x12b1bf(0x1bf)],'headers':{'Authorization':'Bearer\x20'+_0x3c7c02}});if(!_0xc2754c['ok']){const _0x5bda56=await _0xc2754c['text']();throw new Error(_0x12b1bf(0x19f)+_0x5bda56);}}function _0x399d(){const _0x4b654b=['14XrNxuz','jnJnB','offset','toString','yNXag','text','fNBXf','includeDeleted','981528ZBVByP','/sessions/','19212QRKmAq','dTGal','limit','724280opSbWW','GET','length','join','RSqXs','json','set','641727FIlioR','271985VgrIao','18GaWUYM','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','KoIcl','BozNe','sessionId','VCXad','okOJd','Bearer\x20','updateChecklistItem','KaAfF','BdsBk','16vVzpdz','itemIds','Failed\x20to\x20create\x20feature\x20review:\x20','Failed\x20to\x20get\x20action\x20items:\x20','style','/restore','22lHWhwJ','status','nOhYE','lZpet','oYZbL','xvKMy','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','KlBax','194530KizlbG','XVxYB','pJDMu','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','/conclude','LETfR','Failed\x20to\x20start\x20session:\x20','usLwv','/api/v1/mcp/features','/report','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','gitBranch','/sessions','Failed\x20to\x20update\x20scenario:\x20','Failed\x20to\x20list\x20sessions:\x20','stringify','Failed\x20to\x20create\x20scenario:\x20','\x0a\x0aUpgrade\x20your\x20plan:\x20','/api/v1/mcp/features/','/start','7974296kXMCPl','Failed\x20to\x20get\x20feature\x20review:\x20','gitRepoUrl','POST','lyhfO','Failed\x20to\x20delete\x20feature\x20review:\x20','CbMaQ','/feedback','application/json'];_0x399d=function(){return _0x4b654b;};return _0x399d();}export async function restoreFeature(_0xb1cfd4){const _0x27c4e6=_0x4b33,_0x11d071={'VCXad':function(_0x27f722){return _0x27f722();},'jnJnB':_0x27c4e6(0x1e9)},_0x171326=await _0x11d071[_0x27c4e6(0x1be)](getToken);if(!_0x171326)throw new Error(_0x27c4e6(0x1d5));const _0x21a007=getApiBaseUrl(),_0x2c3b65=await fetch(_0x21a007+_0x27c4e6(0x1e4)+_0xb1cfd4+_0x27c4e6(0x1c9),{'method':_0x11d071[_0x27c4e6(0x1a4)],'headers':{'Authorization':_0x27c4e6(0x1c0)+_0x171326}});if(!_0x2c3b65['ok']){const _0x5f0bac=await _0x2c3b65['text']();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x5f0bac);}}
1
+ (function(_0x1640f6,_0x4e8958){const _0x1d8fd7=_0x57d2,_0x95ef0d=_0x1640f6();while(!![]){try{const _0x4e3f5a=parseInt(_0x1d8fd7(0xfb))/0x1*(parseInt(_0x1d8fd7(0xe7))/0x2)+-parseInt(_0x1d8fd7(0x105))/0x3+parseInt(_0x1d8fd7(0x10a))/0x4*(parseInt(_0x1d8fd7(0xf0))/0x5)+parseInt(_0x1d8fd7(0xd4))/0x6+parseInt(_0x1d8fd7(0xff))/0x7*(parseInt(_0x1d8fd7(0xc5))/0x8)+-parseInt(_0x1d8fd7(0xcb))/0x9+-parseInt(_0x1d8fd7(0x100))/0xa;if(_0x4e3f5a===_0x4e8958)break;else _0x95ef0d['push'](_0x95ef0d['shift']());}catch(_0x490ca9){_0x95ef0d['push'](_0x95ef0d['shift']());}}}(_0x5104,0x673fc));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0xf4a1b2){const _0x191217=_0x57d2,_0x4b5a27={'uJLaN':function(_0x4a7268){return _0x4a7268();},'cegui':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','LAfVA':function(_0x5ec21d){return _0x5ec21d();},'ZGUfi':function(_0xe542eb,_0x210839,_0x109bc4){return _0xe542eb(_0x210839,_0x109bc4);},'okglP':_0x191217(0x108),'sKmPr':'Feature\x20limit\x20exceeded'},_0x3e21c8=await _0x4b5a27['uJLaN'](getToken);if(!_0x3e21c8)throw new Error(_0x4b5a27['cegui']);const _0x2b3e2a=_0x4b5a27[_0x191217(0xc6)](getApiBaseUrl),_0x1482be=await _0x4b5a27[_0x191217(0xc4)](fetch,_0x2b3e2a+'/api/v1/mcp/features',{'method':_0x4b5a27[_0x191217(0xce)],'headers':{'Authorization':'Bearer\x20'+_0x3e21c8,'Content-Type':_0x191217(0xf9)},'body':JSON[_0x191217(0xf2)](_0xf4a1b2)});if(!_0x1482be['ok']){if(_0x1482be['status']===0x192){const _0x4eeb1e=await _0x1482be[_0x191217(0xee)](),_0x595447=_0x4eeb1e['billingUrl']||'https://dashboard.ranger.net/billing';throw new Error((_0x4eeb1e[_0x191217(0x103)]||_0x4b5a27['sKmPr'])+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x595447);}const _0x9998b6=await _0x1482be[_0x191217(0xcc)]();throw new Error(_0x191217(0xed)+_0x9998b6);}return _0x1482be['json']();}export async function listFeatures(_0x134e30){const _0x2bace3=_0x57d2,_0x276fea={'YZIso':'gitRepoUrl','zSMLV':'gitBranch','EivFD':_0x2bace3(0xd8),'nwHLP':_0x2bace3(0xe3)},_0x5c5175=await getToken();if(!_0x5c5175)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2ff90d=getApiBaseUrl(),_0xf3e3f4=new URLSearchParams();if(_0x134e30?.['gitRepoUrl'])_0xf3e3f4['set'](_0x276fea[_0x2bace3(0x10b)],_0x134e30['gitRepoUrl']);if(_0x134e30?.[_0x2bace3(0xe2)])_0xf3e3f4[_0x2bace3(0xea)](_0x276fea[_0x2bace3(0xe6)],_0x134e30[_0x2bace3(0xe2)]);if(_0x134e30?.['limit'])_0xf3e3f4['set'](_0x2bace3(0xf3),_0x134e30[_0x2bace3(0xf3)][_0x2bace3(0xc2)]());if(_0x134e30?.['offset'])_0xf3e3f4['set'](_0x276fea[_0x2bace3(0xec)],_0x134e30['offset'][_0x2bace3(0xc2)]());if(_0x134e30?.[_0x2bace3(0xd5)])_0xf3e3f4['set']('includeDeleted',_0x2bace3(0xef));const _0x11b2fc=_0x2ff90d+_0x2bace3(0x106)+(_0xf3e3f4[_0x2bace3(0xc2)]()?'?'+_0xf3e3f4['toString']():''),_0x430a12=await fetch(_0x11b2fc,{'method':_0x276fea[_0x2bace3(0xca)],'headers':{'Authorization':'Bearer\x20'+_0x5c5175}});if(!_0x430a12['ok']){const _0x428031=await _0x430a12[_0x2bace3(0xcc)]();throw new Error(_0x2bace3(0xdb)+_0x428031);}return _0x430a12[_0x2bace3(0xee)]();}export async function getFeature(_0x40401c){const _0x27147d=_0x57d2,_0x49493c={'EzhiK':function(_0x30c090){return _0x30c090();}},_0x223deb=await _0x49493c[_0x27147d(0xd7)](getToken);if(!_0x223deb)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2b505d=getApiBaseUrl(),_0x1dfbf9=await fetch(_0x2b505d+_0x27147d(0xd3)+_0x40401c,{'method':_0x27147d(0xe3),'headers':{'Authorization':_0x27147d(0xd1)+_0x223deb}});if(!_0x1dfbf9['ok']){const _0xc9140=await _0x1dfbf9['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0xc9140);}return _0x1dfbf9['json']();}export async function updateFeature(_0x30a5a2,_0x49b70d){const _0x5f002c=_0x57d2,_0x541970={'ZVrRg':function(_0xc9e054){return _0xc9e054();}},_0x3c51f9=await _0x541970['ZVrRg'](getToken);if(!_0x3c51f9)throw new Error(_0x5f002c(0x102));const _0x24a5b3=getApiBaseUrl(),_0x1d8ba2=await fetch(_0x24a5b3+'/api/v1/mcp/features/'+_0x30a5a2,{'method':_0x5f002c(0xe8),'headers':{'Authorization':_0x5f002c(0xd1)+_0x3c51f9,'Content-Type':_0x5f002c(0xf9)},'body':JSON[_0x5f002c(0xf2)](_0x49b70d)});if(!_0x1d8ba2['ok']){const _0x3e1893=await _0x1d8ba2[_0x5f002c(0xcc)]();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x3e1893);}return _0x1d8ba2[_0x5f002c(0xee)]();}export async function createChecklistItem(_0x1e7861,_0x382c1f,_0x38caef){const _0x26a243=_0x57d2,_0x57b05e={'rjirt':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','Acofu':_0x26a243(0x108),'OjoUV':_0x26a243(0xf9)},_0x34417c=await getToken();if(!_0x34417c)throw new Error(_0x57b05e['rjirt']);const _0xd2b53d=getApiBaseUrl(),_0x6f0210=await fetch(_0xd2b53d+_0x26a243(0xd3)+_0x1e7861+'/checklist',{'method':_0x57b05e['Acofu'],'headers':{'Authorization':_0x26a243(0xd1)+_0x34417c,'Content-Type':_0x57b05e[_0x26a243(0xc7)]},'body':JSON['stringify']({'description':_0x382c1f,'position':_0x38caef})});if(!_0x6f0210['ok']){const _0x25b834=await _0x6f0210['text']();throw new Error(_0x26a243(0xdd)+_0x25b834);}return _0x6f0210['json']();}export async function updateChecklistItem(_0x9a6085,_0xe7eb84,_0xf5826){const _0x1e616e={'AFdVO':function(_0x235252){return _0x235252();},'eIugh':function(_0x184435,_0x402e2e,_0x5b16f7){return _0x184435(_0x402e2e,_0x5b16f7);}};return withRetry(async()=>{const _0x5bf462=_0x57d2,_0x4507d8=await _0x1e616e[_0x5bf462(0x107)](getToken);if(!_0x4507d8)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x4e364f=getApiBaseUrl(),_0x2b0b8a=await _0x1e616e[_0x5bf462(0xe1)](fetch,_0x4e364f+_0x5bf462(0xd3)+_0x9a6085+'/checklist/'+_0xe7eb84,{'method':'PATCH','headers':{'Authorization':_0x5bf462(0xd1)+_0x4507d8,'Content-Type':_0x5bf462(0xf9)},'body':JSON[_0x5bf462(0xf2)](_0xf5826)});if(!_0x2b0b8a['ok']){const _0x505c3e=await _0x2b0b8a[_0x5bf462(0xcc)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x505c3e);}return _0x2b0b8a['json']();},{'label':'updateChecklistItem'});}export async function getFeatureReport(_0x2227fd){const _0x221791=_0x57d2,_0x517b6f={'bARYN':function(_0xcd5b34){return _0xcd5b34();},'hfeGA':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','sovuE':'GET'},_0x2a756f=await _0x517b6f['bARYN'](getToken);if(!_0x2a756f)throw new Error(_0x517b6f['hfeGA']);const _0x4c9c1c=_0x517b6f[_0x221791(0xcd)](getApiBaseUrl),_0x55b8e2=await fetch(_0x4c9c1c+_0x221791(0xd3)+_0x2227fd+'/report',{'method':_0x517b6f['sovuE'],'headers':{'Authorization':'Bearer\x20'+_0x2a756f}});if(!_0x55b8e2['ok']){const _0x26efd6=await _0x55b8e2[_0x221791(0xcc)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x26efd6);}return _0x55b8e2['json']();}export async function getFeatureReportMarkdown(_0x547502,_0x5d87cc){const _0x244447=_0x57d2,_0x12f382={'NEvwj':function(_0x1e1c66){return _0x1e1c66();},'wdnEF':_0x244447(0x102),'nxrIe':function(_0x1001d8,_0x55fc37){return _0x1001d8(_0x55fc37);},'AaqLw':_0x244447(0xcf),'bfsby':'sessionId','LGUdZ':function(_0x7867a8,_0x5549bf){return _0x7867a8&&_0x5549bf;},'ZCxvP':_0x244447(0xfa),'QwcVr':function(_0x58002f,_0x4f073d,_0x1c19d7){return _0x58002f(_0x4f073d,_0x1c19d7);},'TgVrL':'GET'},_0xee34da=await _0x12f382[_0x244447(0xf1)](getToken);if(!_0xee34da)throw new Error(_0x12f382[_0x244447(0xe4)]);const _0x301752=_0x12f382[_0x244447(0xf1)](getApiBaseUrl),_0x2308fb=new URLSearchParams(),_0x4c55c1=(_0x5d87cc?.['itemIds']?.[_0x244447(0xeb)]??0x0)>0x0,_0x352f07=_0x12f382[_0x244447(0xd6)](Boolean,_0x5d87cc?.['sessionId']);_0x4c55c1&&_0x5d87cc?.['itemIds']&&_0x2308fb[_0x244447(0xea)](_0x12f382[_0x244447(0xe5)],_0x5d87cc[_0x244447(0xcf)][_0x244447(0xf5)](','));_0x352f07&&_0x5d87cc?.['sessionId']&&_0x2308fb[_0x244447(0xea)](_0x12f382['bfsby'],_0x5d87cc['sessionId']);_0x12f382['LGUdZ'](!_0x4c55c1,!_0x352f07)&&_0x5d87cc?.['style']&&_0x2308fb['set'](_0x12f382[_0x244447(0xe0)],_0x5d87cc[_0x244447(0xfa)]);const _0x15e28a=_0x301752+'/api/v1/mcp/features/'+_0x547502+_0x244447(0xd9),_0x39834b=''+_0x15e28a+(_0x2308fb[_0x244447(0xc2)]()?'?'+_0x2308fb[_0x244447(0xc2)]():''),_0x2ab6cb=await _0x12f382['QwcVr'](fetch,_0x39834b,{'method':_0x12f382[_0x244447(0xc8)],'headers':{'Authorization':'Bearer\x20'+_0xee34da}});if(!_0x2ab6cb['ok']){const _0x5a7fcb=await _0x2ab6cb['text']();throw new Error(_0x244447(0xdf)+_0x5a7fcb);}return _0x2ab6cb['text']();}export async function listFeatureSessions(_0x39b94c){const _0x48ff36=_0x57d2,_0x5d9a47={'GAhwd':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','BiaoD':function(_0x46345e){return _0x46345e();}},_0x273575=await getToken();if(!_0x273575)throw new Error(_0x5d9a47[_0x48ff36(0xde)]);const _0xac6029=_0x5d9a47[_0x48ff36(0xf7)](getApiBaseUrl),_0x45f6a7=await fetch(_0xac6029+'/api/v1/mcp/features/'+_0x39b94c+'/sessions',{'method':'GET','headers':{'Authorization':_0x48ff36(0xd1)+_0x273575}});if(!_0x45f6a7['ok']){const _0x291914=await _0x45f6a7[_0x48ff36(0xcc)]();throw new Error(_0x48ff36(0xd2)+_0x291914);}return _0x45f6a7['json']();}export async function startSession(_0x4d93ed,_0x14ed99){const _0xf89e1c=_0x57d2,_0x26d8fc={'BPGxK':function(_0x370626){return _0x370626();},'KgKxB':_0xf89e1c(0x102),'JpkZz':function(_0x4bf3b3,_0x2a95cb,_0x448c6b){return _0x4bf3b3(_0x2a95cb,_0x448c6b);}},_0x4f80e4=await _0x26d8fc['BPGxK'](getToken);if(!_0x4f80e4)throw new Error(_0x26d8fc[_0xf89e1c(0xd0)]);const _0x4f5c0b=_0x26d8fc['BPGxK'](getApiBaseUrl),_0x53dd8f=await _0x26d8fc[_0xf89e1c(0xf8)](fetch,_0x4f5c0b+_0xf89e1c(0xd3)+_0x4d93ed+'/sessions/'+_0x14ed99+'/start',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x4f80e4}});if(!_0x53dd8f['ok']){const _0x88396e=await _0x53dd8f[_0xf89e1c(0xcc)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x88396e);}return _0x53dd8f[_0xf89e1c(0xee)]();}function _0x5104(){const _0x482f8d=['JpSBZ','join','/conclude','BiaoD','JpkZz','application/json','style','138093jpzKYC','LJTBO','Failed\x20to\x20get\x20action\x20items:\x20','Coiwx','182xbIVtB','3194040TEVPjB','Failed\x20to\x20get\x20item\x20feedback:\x20','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','message','/comments/address','2229939RjrtVf','/api/v1/mcp/features','AFdVO','POST','Failed\x20to\x20delete\x20feature\x20review:\x20','1370392VkNLlZ','YZIso','/action-items','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','toString','DUhBg','ZGUfi','20456wsNwGH','LAfVA','OjoUV','TgVrL','/checklist-items/','nwHLP','7204158EGbpEL','text','bARYN','okglP','itemIds','KgKxB','Bearer\x20','Failed\x20to\x20list\x20sessions:\x20','/api/v1/mcp/features/','5063664YfMLDY','includeDeleted','nxrIe','EzhiK','offset','/report/markdown','DELETE','Failed\x20to\x20list\x20feature\x20reviews:\x20','Failed\x20to\x20restore\x20feature\x20review:\x20','Failed\x20to\x20create\x20scenario:\x20','GAhwd','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','ZCxvP','eIugh','gitBranch','GET','wdnEF','AaqLw','zSMLV','10BxBbUm','PATCH','MskdS','set','length','EivFD','Failed\x20to\x20create\x20feature\x20review:\x20','json','true','10poVGLk','NEvwj','stringify','limit'];_0x5104=function(){return _0x482f8d;};return _0x5104();}function _0x57d2(_0x4919c7,_0x400cd2){_0x4919c7=_0x4919c7-0xc0;const _0x5104a6=_0x5104();let _0x57d29a=_0x5104a6[_0x4919c7];return _0x57d29a;}export async function concludeSession(_0xd1a4e,_0x5a4980){const _0x47906e=_0x57d2,_0x4fb73a={'MskdS':function(_0x5dc134){return _0x5dc134();},'LJTBO':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','Coiwx':function(_0x4d4909,_0x502d0d,_0x2f1264){return _0x4d4909(_0x502d0d,_0x2f1264);}},_0x47fe5b=await _0x4fb73a[_0x47906e(0xe9)](getToken);if(!_0x47fe5b)throw new Error(_0x4fb73a[_0x47906e(0xfc)]);const _0xe08dba=getApiBaseUrl(),_0x47e86a=await _0x4fb73a[_0x47906e(0xfe)](fetch,_0xe08dba+'/api/v1/mcp/features/'+_0xd1a4e+'/sessions/'+_0x5a4980+_0x47906e(0xf6),{'method':_0x47906e(0x108),'headers':{'Authorization':'Bearer\x20'+_0x47fe5b}});if(!_0x47e86a['ok']){const _0x439ae2=await _0x47e86a[_0x47906e(0xcc)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x439ae2);}return _0x47e86a[_0x47906e(0xee)]();}export async function getActionItems(_0x115b03){const _0x2e21df=_0x57d2,_0x517bc4={'WzaFq':function(_0x42446e){return _0x42446e();},'Ayfap':function(_0x538360,_0x568bd3,_0x460c71){return _0x538360(_0x568bd3,_0x460c71);},'roFFh':_0x2e21df(0xe3)},_0x38cf53=await _0x517bc4['WzaFq'](getToken);if(!_0x38cf53)throw new Error(_0x2e21df(0x102));const _0x544a82=getApiBaseUrl(),_0x345e80=await _0x517bc4['Ayfap'](fetch,_0x544a82+_0x2e21df(0xd3)+_0x115b03+_0x2e21df(0xc0),{'method':_0x517bc4['roFFh'],'headers':{'Authorization':_0x2e21df(0xd1)+_0x38cf53}});if(!_0x345e80['ok']){const _0x91766c=await _0x345e80[_0x2e21df(0xcc)]();throw new Error(_0x2e21df(0xfd)+_0x91766c);}return _0x345e80['json']();}export async function getItemFeedback(_0x1315e7,_0xb720bc){const _0x3c117f=_0x57d2,_0x1ea8d0={'wgXLI':function(_0x1e0bdb,_0x3ac802,_0x15d60c){return _0x1e0bdb(_0x3ac802,_0x15d60c);},'xNfCP':_0x3c117f(0xe3)},_0x32c245=await getToken();if(!_0x32c245)throw new Error(_0x3c117f(0x102));const _0x22770c=getApiBaseUrl(),_0x464b62=await _0x1ea8d0['wgXLI'](fetch,_0x22770c+_0x3c117f(0xd3)+_0x1315e7+_0x3c117f(0xc9)+_0xb720bc+'/feedback',{'method':_0x1ea8d0['xNfCP'],'headers':{'Authorization':'Bearer\x20'+_0x32c245}});if(!_0x464b62['ok']){const _0x3d237f=await _0x464b62[_0x3c117f(0xcc)]();throw new Error(_0x3c117f(0x101)+_0x3d237f);}return _0x464b62[_0x3c117f(0xee)]();}export async function markCommentsAddressed(_0x385944,_0x4894d5,_0x588650){const _0x5841cf=_0x57d2,_0x22ab84={'YDIdv':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','DUhBg':function(_0x50e957,_0x58d335,_0x379ddb){return _0x50e957(_0x58d335,_0x379ddb);},'JpSBZ':'POST'},_0x1ececa=await getToken();if(!_0x1ececa)throw new Error(_0x22ab84['YDIdv']);const _0x31ad05=getApiBaseUrl(),_0x503f4c=await _0x22ab84[_0x5841cf(0xc3)](fetch,_0x31ad05+'/api/v1/mcp/features/'+_0x385944+_0x5841cf(0x104),{'method':_0x22ab84[_0x5841cf(0xf4)],'headers':{'Authorization':'Bearer\x20'+_0x1ececa,'Content-Type':'application/json'},'body':JSON[_0x5841cf(0xf2)]({'checklistItemId':_0x4894d5,'commentIds':_0x588650})});if(!_0x503f4c['ok']){const _0x1caafe=await _0x503f4c[_0x5841cf(0xcc)]();throw new Error(_0x5841cf(0xc1)+_0x1caafe);}}export async function softDeleteFeature(_0x473f45){const _0x2263bb=_0x57d2,_0x2d902b=await getToken();if(!_0x2d902b)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x20fb62=getApiBaseUrl(),_0x1274f0=await fetch(_0x20fb62+_0x2263bb(0xd3)+_0x473f45,{'method':_0x2263bb(0xda),'headers':{'Authorization':_0x2263bb(0xd1)+_0x2d902b}});if(!_0x1274f0['ok']){const _0x3e5079=await _0x1274f0[_0x2263bb(0xcc)]();throw new Error(_0x2263bb(0x109)+_0x3e5079);}}export async function restoreFeature(_0x2dc53a){const _0x194ea4=_0x57d2,_0x2c1ecb={'DVIIo':_0x194ea4(0x102),'CqioE':function(_0x1da107){return _0x1da107();},'Ujdwv':function(_0x261cc9,_0x3d3354,_0x4a4d5f){return _0x261cc9(_0x3d3354,_0x4a4d5f);}},_0x36c3d7=await getToken();if(!_0x36c3d7)throw new Error(_0x2c1ecb['DVIIo']);const _0xa2b8a3=_0x2c1ecb['CqioE'](getApiBaseUrl),_0x301ce9=await _0x2c1ecb['Ujdwv'](fetch,_0xa2b8a3+'/api/v1/mcp/features/'+_0x2dc53a+'/restore',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x36c3d7}});if(!_0x301ce9['ok']){const _0x56291a=await _0x301ce9['text']();throw new Error(_0x194ea4(0xdc)+_0x56291a);}}