@ranger-testing/ranger-cli 3.1.7-alpha.a5be4ca-60 → 3.1.7-alpha.d64f22a-65

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 (88) 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/actors.js +1 -0
  38. package/build/commands/utils/agentEnv.js +1 -1
  39. package/build/commands/utils/browserSessionsApi.js +1 -1
  40. package/build/commands/utils/claudeConfig.js +1 -1
  41. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  42. package/build/commands/utils/claudePlugin.js +1 -1
  43. package/build/commands/utils/cloudProfile.js +1 -1
  44. package/build/commands/utils/cloudProfileSession.js +1 -1
  45. package/build/commands/utils/crypto.js +1 -1
  46. package/build/commands/utils/desirePathLog.js +1 -1
  47. package/build/commands/utils/deviceAuth.js +1 -1
  48. package/build/commands/utils/environment.js +1 -1
  49. package/build/commands/utils/featureApi.js +1 -1
  50. package/build/commands/utils/fixWebmDuration.js +1 -1
  51. package/build/commands/utils/gitTracked.js +1 -1
  52. package/build/commands/utils/keychain.js +1 -1
  53. package/build/commands/utils/legacyWarning.js +1 -1
  54. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  55. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  56. package/build/commands/utils/mcpImageBase64.js +1 -1
  57. package/build/commands/utils/model.js +1 -1
  58. package/build/commands/utils/novaActCli.js +1 -1
  59. package/build/commands/utils/opencodeConfig.js +1 -1
  60. package/build/commands/utils/organizationEnvApi.js +1 -1
  61. package/build/commands/utils/playwrightCli.js +1 -1
  62. package/build/commands/utils/profileMessages.js +1 -1
  63. package/build/commands/utils/profileSetupBanner.js +1 -1
  64. package/build/commands/utils/projectsConfig.js +1 -1
  65. package/build/commands/utils/rangerConfig.js +1 -1
  66. package/build/commands/utils/rangerRoot.js +1 -1
  67. package/build/commands/utils/rangerwrightCli.js +1 -1
  68. package/build/commands/utils/resolveProfileContext.js +1 -1
  69. package/build/commands/utils/resolveProfileUrl.js +1 -1
  70. package/build/commands/utils/retry.js +1 -1
  71. package/build/commands/utils/scenarioOriginCheck.js +1 -1
  72. package/build/commands/utils/sessionCache.js +1 -1
  73. package/build/commands/utils/settings.js +1 -1
  74. package/build/commands/utils/skillContent.js +1 -1
  75. package/build/commands/utils/skills.js +1 -1
  76. package/build/commands/utils/stitchWebmFiles.js +1 -1
  77. package/build/commands/utils/telemetry.js +1 -1
  78. package/build/commands/utils/tokenRefresh.js +1 -1
  79. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  80. package/build/commands/utils/tunnelClient.js +1 -1
  81. package/build/commands/utils/userApi.js +1 -1
  82. package/build/commands/utils/version.js +1 -1
  83. package/build/commands/verifyFeature.js +1 -1
  84. package/build/commands/verifyFeatureCli.js +1 -1
  85. package/build/commands/verifyFeatureNovaCli.js +1 -1
  86. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  87. package/build/skills/ranger/SKILL.md +8 -0
  88. package/package.json +1 -1
@@ -1 +1 @@
1
- const _0x25ed96=_0xdb1b;(function(_0x798f6f,_0xbfc016){const _0x1ce422=_0xdb1b,_0x516fc7=_0x798f6f();while(!![]){try{const _0x51b9cc=parseInt(_0x1ce422(0x1bb))/0x1+parseInt(_0x1ce422(0x1ee))/0x2+-parseInt(_0x1ce422(0x188))/0x3*(parseInt(_0x1ce422(0x1fe))/0x4)+-parseInt(_0x1ce422(0x192))/0x5*(-parseInt(_0x1ce422(0x1c6))/0x6)+-parseInt(_0x1ce422(0x1aa))/0x7+parseInt(_0x1ce422(0x1e7))/0x8*(parseInt(_0x1ce422(0x1b8))/0x9)+-parseInt(_0x1ce422(0x1ff))/0xa;if(_0x51b9cc===_0xbfc016)break;else _0x516fc7['push'](_0x516fc7['shift']());}catch(_0xb237cb){_0x516fc7['push'](_0x516fc7['shift']());}}}(_0xa0f0,0xec11d));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x226ce7 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,isBareLocalhost,isCachedSessionLive,isInteractive,needsTunnel,orderLoginDomains,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{matchAuthEnvironmentByHost,matchAuthEnvironmentExact}from'./matchAuthEnvironment.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0x93010a){const _0x4b7259=_0xdb1b;try{return new URL(_0x93010a)[_0x4b7259(0x184)];}catch{return _0x4b7259(0x1b4);}}function errorMessageForTelemetry(_0x1d16f2){const _0x20037f=_0xdb1b,_0x56855e={'ZgwII':function(_0x319d3c,_0x46d946){return _0x319d3c instanceof _0x46d946;}};return _0x56855e['ZgwII'](_0x1d16f2,Error)?_0x1d16f2[_0x20037f(0x196)]:undefined;}function trackBridgeEvent(_0x22bbbb,_0x3d7ba7){const _0x16d40e=_0xdb1b,_0x4f0b1b={'wonEv':'tunnel_bridge_event','BZihN':function(_0x3be5eb,_0x596592){return _0x3be5eb===_0x596592;},'IrgCD':'tunnel_error','ClgyF':'local_ws_error'};if(!_0x22bbbb)return;const _0x275220={'tunnelSessionId':_0x3d7ba7['sessionId'],'tunnelEventType':_0x3d7ba7['type'],'connectionId':_0x3d7ba7['connectionId'],'code':_0x3d7ba7['code'],'reason':_0x3d7ba7['reason'],'error':_0x3d7ba7[_0x16d40e(0x21a)],'elapsedMs':_0x3d7ba7[_0x16d40e(0x175)],'activeLocalConnections':_0x3d7ba7['activeLocalConnections'],'pendingLocalConnections':_0x3d7ba7[_0x16d40e(0x18e)]};_0x22bbbb[_0x16d40e(0x1da)](_0x4f0b1b['wonEv'],_0x275220),(_0x4f0b1b[_0x16d40e(0x165)](_0x3d7ba7[_0x16d40e(0x17b)],_0x4f0b1b[_0x16d40e(0x16a)])||_0x4f0b1b['BZihN'](_0x3d7ba7[_0x16d40e(0x17b)],_0x4f0b1b[_0x16d40e(0x1e5)]))&&void _0x22bbbb[_0x16d40e(0x214)]('tunnel_bridge',new Error(_0x3d7ba7['error']??_0x3d7ba7[_0x16d40e(0x17b)]),_0x275220);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x59618d=await getToken();if(!_0x59618d)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');return _0x59618d;}async function apiRequest(_0x45924d,_0x18e67e={}){const _0x663edd=_0xdb1b,_0x2a0329={'eRwOL':function(_0x5a6749){return _0x5a6749();},'ozmxI':function(_0x4429e2,_0x3d1fd9,_0x358fed){return _0x4429e2(_0x3d1fd9,_0x358fed);},'chhYe':function(_0x1883d9,_0x3cff81){return _0x1883d9===_0x3cff81;},'URTcs':'string'},_0xb3e008=await _0x2a0329['eRwOL'](requireToken),_0x44e4ce=getApiBaseUrl(),_0x2d5793=await _0x2a0329[_0x663edd(0x1c7)](fetch,''+_0x44e4ce+_0x45924d,{..._0x18e67e,'headers':{'Authorization':_0x663edd(0x166)+_0xb3e008,'Content-Type':_0x663edd(0x16e),..._0x18e67e[_0x663edd(0x19f)]??{}}});if(!_0x2d5793['ok']){let _0x21d069='',_0x49f3ae;try{const _0x4599d6=await _0x2d5793[_0x663edd(0x1f6)](),_0x134a6f=(_0x2a0329[_0x663edd(0x1c5)](typeof _0x4599d6['error'],_0x663edd(0x1ca))?_0x4599d6[_0x663edd(0x21a)]:undefined)??JSON['stringify'](_0x4599d6);_0x21d069=_0x134a6f;typeof _0x4599d6[_0x663edd(0x1c2)]===_0x2a0329['URTcs']&&_0x4599d6[_0x663edd(0x1c2)]&&(_0x21d069=_0x21d069+'\x0a'+_0x4599d6[_0x663edd(0x1c2)]);if(_0x2a0329['chhYe'](typeof _0x4599d6[_0x663edd(0x1b0)],'string'))_0x49f3ae=_0x4599d6[_0x663edd(0x1b0)];}catch{_0x21d069=_0x2d5793[_0x663edd(0x170)];}throw new ApiError('API\x20request\x20'+_0x45924d+_0x663edd(0x190)+_0x2d5793[_0x663edd(0x17a)]+'):\x20'+_0x21d069,_0x2d5793[_0x663edd(0x17a)],_0x21d069,_0x49f3ae);}if(_0x2d5793[_0x663edd(0x17a)]===0xcc)return undefined;return _0x2d5793['json']();}export class ApiError extends Error{['status'];['detail'];[_0x25ed96(0x1b0)];constructor(_0x486244,_0x8239fe,_0xb70317,_0xe93b9b){const _0x5ba6bb=_0x25ed96,_0x1f25ac={'YQtXB':_0x5ba6bb(0x174)};super(_0x486244),this[_0x5ba6bb(0x17a)]=_0x8239fe,this['detail']=_0xb70317,this[_0x5ba6bb(0x1b0)]=_0xe93b9b,this[_0x5ba6bb(0x1a3)]=_0x1f25ac['YQtXB'];}}export async function fetchCloudProfile(_0x330146){const _0x2f869e=_0x25ed96,_0x3527ae={'UnOgg':function(_0x41df68,_0x3c87f3){return _0x41df68 instanceof _0x3c87f3;},'bJmWU':function(_0x5d1ce0,_0x7ac9cf){return _0x5d1ce0===_0x7ac9cf;}};try{return await apiRequest(_0x2f869e(0x1f5)+encodeURIComponent(_0x330146));}catch(_0x5accf9){if(_0x3527ae[_0x2f869e(0x1d9)](_0x5accf9,ApiError)&&_0x3527ae[_0x2f869e(0x168)](_0x5accf9['status'],0x194))return null;throw _0x5accf9;}}export async function listCloudProfiles(){const _0x21631b=_0x25ed96,_0x353219={'bdgnK':'/api/v1/profiles'},_0x24db0a=await apiRequest(_0x353219['bdgnK']);return _0x24db0a[_0x21631b(0x1d6)];}export async function deleteCloudProfile(_0x98610b){const _0x25bf25=_0x25ed96;try{await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x98610b),{'method':'DELETE'});}catch(_0x4900cc){if(_0x4900cc instanceof ApiError&&_0x4900cc[_0x25bf25(0x17a)]===0x194)throw new Error(_0x25bf25(0x221)+_0x98610b+'\x22\x20not\x20found.');throw _0x4900cc;}}function _0xa0f0(){const _0x32d51b=['/login','Pass\x20--base-url\x20<your-app-url>\x20so\x20Ranger\x20can\x20match\x20the\x20right\x20one,\x20or\x20create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`.','PWPql','storageStatePath','profiles','fHmRX','Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20(','UnOgg','trackPhaseEnd','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','tunnel_login_request','join','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','environment_key','wsEndpoint','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','extraHTTPHeaders','organizationId','jicvZ','ClgyF','\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a','514328PKsSOH','\x22\x20on\x20profile\x20\x22','PNYWV','map','\x22,\x20and\x20cloud\x20sessions\x20don\x27t\x20apply\x20to\x20localhost.\x0a','invalidateOn','envKey','998270FpKTCL','SfPfg','replace','DELETE','loginInstructions','\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a','QYaWl','/api/v1/profiles/','json','setupHeaders','\x22,\x20attempting\x20login...','sessionId','stringify','\x22,\x20refreshing\x20session...','domains','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','116HoEbra','5796550tUOTLB','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','newPage','close','ZWQlx','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','env','session_state','JfhvB','whskW','kLjxP','\x22\x20matched\x20by\x20host\x20for\x20','ABilH','storageState','YrNqK','browserOptions','success','JKgvX','omPQX','qwEBx','RANGER_TEST_PASSWORD','trackPhaseError','sKsFo','No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','wvYVR','tunnel','error','keys','THitF','opfyK','length','xKPoZ','environmentKey','Cloud\x20profile\x20\x22','sessionCheckPath','Edxdi','auth','/api/v1/profiles','forceLogin','vBKqK','BZihN','Bearer\x20','COuTq','bJmWU','tunnel_session_id','IrgCD','FhCUJ','MkTwG','effectiveBaseUrl','application/json','\x20\x20Login\x20successful.\x20Session\x20cached.','statusText','RANGER_TUNNEL_LOGIN_HEADED','log','isArray','ApiError','elapsedMs','Browser\x20login\x20timed\x20out\x20before\x20completion.','RANGER_TEST_USERNAME','YWemU','GFGzp','status','type','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','WRPwW','FvZjx','RxAiB','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','origin','EfVYm','gRknK','host','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','push','force','173427tBpnNG','/api/v1/profiles/auth-config','\x20\x20•\x20or\x20pass\x20--env\x20<key>\x20to\x20run\x20an\x20automated\x20login\x20for\x20this\x20target.','\x22\x20instead.','Tvifg','tOFCB','pendingLocalConnections','trim','\x20failed\x20(','mcXry','25dIHWvo','settings','trackPhaseStart','none','message','ambiguous','clientIp','\x20\x20Created\x20cloud\x20profile\x20\x22','/session','WmRxp','\x20\x20Server-side\x20login\x20error:\x20','newContext','Browser\x20login\x20timed\x20out\x20after\x20','headers','maXfT','target_url','\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20','name','userAgent','pNWWK','cookies','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','assertedEnv','\x22;\x20proceeding\x20with\x20loginInstructions.','9821427hfLGat','true','environments','\x20--url\x20','OtQfG','oXZkv','code','RQMZC','NiXEb','parse','invalid-url','sessionState','SqUbD','\x22.\x0a','72QnppYL','utf-8','POST','1708185hzBrJT','key','\x20\x20Cached\x20session\x20for\x20\x22','telemetry','username','KhAzu','\x20\x20No\x20live\x20session\x20for\x20\x22','test_output','\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)','Auth\x20environment\x20\x22','chhYe','2285364SUdSmt','ozmxI','pw_endpoint','\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22','string','defaultEnvironmentKey','ZElnw','/api/v1/tunnel/sessions/','MTObm','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','TpHSd','HLGOs'];_0xa0f0=function(){return _0x32d51b;};return _0xa0f0();}export async function createCloudProfile(_0x31293c,_0xbd48f2,_0x59d21d={}){const _0x484f02=_0x25ed96,_0x61197a={'yRphM':function(_0x535625,_0x2e5711,_0x1692e7){return _0x535625(_0x2e5711,_0x1692e7);}},_0x42eb35={'name':_0x31293c};if(_0xbd48f2)_0x42eb35[_0x484f02(0x1df)]=_0xbd48f2;_0x59d21d[_0x484f02(0x193)]&&Object[_0x484f02(0x21b)](_0x59d21d[_0x484f02(0x193)])['length']>0x0&&(_0x42eb35['settings']=_0x59d21d['settings']);if(_0x59d21d['username'])_0x42eb35['username']=_0x59d21d['username'];if(_0x59d21d['password'])_0x42eb35['password']=_0x59d21d['password'];return await _0x61197a['yRphM'](apiRequest,_0x484f02(0x162),{'method':'POST','body':JSON[_0x484f02(0x1fa)](_0x42eb35)});}export async function uploadCloudProfileSession(_0x1f99b9,_0x1a6f6d){const _0x42e3a9=_0x25ed96,_0x3bb642={'QYaWl':function(_0x19ff56,_0xabd062,_0x247e74){return _0x19ff56(_0xabd062,_0x247e74);},'omPQX':function(_0x34b9b5,_0xefcea5){return _0x34b9b5(_0xefcea5);}};return await _0x3bb642[_0x42e3a9(0x1f4)](apiRequest,'/api/v1/profiles/'+_0x3bb642[_0x42e3a9(0x211)](encodeURIComponent,_0x1f99b9)+_0x42e3a9(0x19a),{'method':'POST','body':JSON[_0x42e3a9(0x1fa)]({'session_state':_0x1a6f6d})});}export async function saveCloudProfileCredentials(_0x2fd36d,_0x32c198,_0xb3ac10){const _0x114d60={'cDITo':function(_0x49f149,_0x125a3b,_0x3a0707){return _0x49f149(_0x125a3b,_0x3a0707);},'UaoVV':function(_0x2a59c3,_0x25a720){return _0x2a59c3(_0x25a720);}};await _0x114d60['cDITo'](apiRequest,'/api/v1/profiles/'+_0x114d60['UaoVV'](encodeURIComponent,_0x2fd36d),{'method':'PUT','body':JSON['stringify']({'username':_0x32c198,'password':_0xb3ac10})});}export async function fetchAuthConfig(){const _0x219cc1=_0x25ed96,_0x19c58c={'IdSVf':function(_0x41eb8b,_0x1b53b6){return _0x41eb8b instanceof _0x1b53b6;}};try{const _0x21d146=await apiRequest(_0x219cc1(0x189));return _0x21d146['auth_config'];}catch(_0x49a49b){return _0x19c58c['IdSVf'](_0x49a49b,ApiError)&&_0x49a49b['status']!==0x194&&console['error'](_0x219cc1(0x1de)+_0x49a49b['message']),null;}}function _0xdb1b(_0x441673,_0x15cf64){_0x441673=_0x441673-0x162;const _0xa0f059=_0xa0f0();let _0xdb1b03=_0xa0f059[_0x441673];return _0xdb1b03;}async function createTunnelSession(_0x1c19f9){const _0x4fdff1=_0x25ed96,_0x55595a={'FuVGf':function(_0x194bf6,_0x3a51ee,_0x2bcfd6){return _0x194bf6(_0x3a51ee,_0x2bcfd6);},'MkTwG':'agent'};return await _0x55595a['FuVGf'](apiRequest,'/api/v1/tunnel/sessions',{'method':_0x4fdff1(0x1ba),'body':JSON['stringify']({'targetUrl':_0x1c19f9,'mode':_0x55595a[_0x4fdff1(0x16c)]})});}async function deleteTunnelSession(_0x1b9e61){const _0x3bcd34=_0x25ed96,_0x558b62={'SqUbD':_0x3bcd34(0x1f1)};await apiRequest(_0x3bcd34(0x1cd)+_0x1b9e61,{'method':_0x558b62[_0x3bcd34(0x1b6)]});}export function pickAdHocEnvKey(_0x439fb8,_0x1d3057,_0x1067af){const _0x3419ca=_0x25ed96,_0x18c7bc={'nHRMN':function(_0x229ada,_0x3e10eb){return _0x229ada+_0x3e10eb;},'HLGOs':function(_0x514af3,_0x13a337){return _0x514af3+_0x13a337;},'YWemU':function(_0x4e9320,_0x21185e,_0x62bcad){return _0x4e9320(_0x21185e,_0x62bcad);},'maXfT':function(_0x3ddfd3,_0x39a7f7){return _0x3ddfd3 in _0x39a7f7;},'GVmMt':_0x3419ca(0x197),'EfVYm':function(_0x2e2b41,_0x3a39d5){return _0x2e2b41+_0x3a39d5;},'MTObm':function(_0x532ed3,_0x57923d){return _0x532ed3===_0x57923d;}};if(_0x1067af){if(!_0x439fb8?.[_0x3419ca(0x1ac)]?.[_0x1067af]){const _0x20cf76=Object[_0x3419ca(0x21b)](_0x439fb8?.[_0x3419ca(0x1ac)]??{});throw new Error(_0x18c7bc['nHRMN'](_0x18c7bc['HLGOs'](_0x3419ca(0x1c4)+_0x1067af+'\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.',_0x20cf76[_0x3419ca(0x21e)]?'\x20Available:\x20'+_0x20cf76[_0x3419ca(0x1dd)](',\x20')+'.':_0x3419ca(0x1cf)),_0x3419ca(0x1c3)));}return _0x1067af;}if(!_0x439fb8)return null;if(_0x1d3057){const _0x5971d7=_0x18c7bc[_0x3419ca(0x178)](matchAuthEnvironmentExact,_0x1d3057,_0x439fb8);if(_0x5971d7)return _0x5971d7;const _0x1dfdb8=matchAuthEnvironmentByHost(_0x1d3057,_0x439fb8);if(_0x1dfdb8&&_0x18c7bc[_0x3419ca(0x1a0)](_0x3419ca(0x1bc),_0x1dfdb8))return console[_0x3419ca(0x172)]('\x20\x20Auth\x20env\x20\x22'+_0x1dfdb8[_0x3419ca(0x1bc)]+_0x3419ca(0x20a)+_0x1d3057+'\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).'),_0x1dfdb8[_0x3419ca(0x1bc)];if(_0x1dfdb8&&_0x18c7bc[_0x3419ca(0x1a0)](_0x18c7bc['GVmMt'],_0x1dfdb8))throw new Error(_0x3419ca(0x1d8)+_0x1dfdb8[_0x3419ca(0x197)][_0x3419ca(0x1dd)](',\x20')+');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.');if(needsTunnel(_0x1d3057))throw new Error(_0x18c7bc[_0x3419ca(0x1d1)](_0x18c7bc['EfVYm'](_0x18c7bc[_0x3419ca(0x182)](_0x3419ca(0x216)+_0x1d3057+_0x3419ca(0x1b7),_0x3419ca(0x1f3)),'\x20\x20Options:\x0a')+_0x3419ca(0x1e6)+(_0x3419ca(0x1c9)+_0x1d3057[_0x3419ca(0x1f0)](/\/+$/,'')+'\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a'),_0x3419ca(0x1a2)+_0x1d3057+'\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.'));}if(_0x439fb8['defaultEnvironmentKey'])return _0x439fb8['defaultEnvironmentKey'];const _0x3368d1=Object[_0x3419ca(0x21b)](_0x439fb8['environments']??{});if(_0x3368d1[_0x3419ca(0x21e)]===0x1)return _0x3368d1[0x0];if(_0x18c7bc[_0x3419ca(0x1ce)](_0x3368d1[_0x3419ca(0x21e)],0x0))return null;throw new Error(_0x3419ca(0x1db)+_0x3368d1['join'](',\x20')+').\x20'+_0x3419ca(0x1d3));}export function adHocProfileName(_0x415cd4,_0x35b491,_0x1d113f){if(!_0x35b491||_0x35b491===_0x1d113f)return _0x415cd4;return _0x415cd4+':'+_0x35b491;}export async function resolveAdHocProfile(_0x55c466={},_0x3d5c20=process['env']){const _0x47cf9a=_0x25ed96,_0xb9ad8e={'xKPoZ':function(_0x21ac91,_0x1faf3c){return _0x21ac91&&_0x1faf3c;},'COuTq':_0x47cf9a(0x195),'kLjxP':function(_0x31579b,_0x4bb5be,_0xb877cf,_0x4dc878){return _0x31579b(_0x4bb5be,_0xb877cf,_0x4dc878);},'opfyK':function(_0x41cff0,_0xc34d9b){return _0x41cff0??_0xc34d9b;}},_0x3240c8=_0x3d5c20['RANGER_TEST_USERNAME'];if(!_0x3240c8)return null;const _0x1be6ec=await fetchAuthConfig(),_0x3b72f5=pickAdHocEnvKey(_0x1be6ec,_0x55c466['targetUrl'],_0x55c466[_0x47cf9a(0x1ed)]);let _0x551a58=adHocProfileName(_0x3240c8,_0x3b72f5,_0x1be6ec?.[_0x47cf9a(0x1cb)]),_0x3f02d8=await fetchCloudProfile(_0x551a58);_0xb9ad8e[_0x47cf9a(0x21f)](_0x3f02d8,_0x3b72f5)&&_0x3f02d8[_0x47cf9a(0x220)]!==_0x3b72f5&&(console[_0x47cf9a(0x172)]('\x20\x20Cloud\x20profile\x20\x22'+_0x551a58+'\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22'+(_0x3f02d8['environmentKey']??_0xb9ad8e[_0x47cf9a(0x167)])+'\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22'+_0x3b72f5+'\x22;\x20using\x20\x22'+_0x3240c8+':'+_0x3b72f5+_0x47cf9a(0x18b)),_0x551a58=_0x3240c8+':'+_0x3b72f5,_0x3f02d8=await fetchCloudProfile(_0x551a58));if(_0x3f02d8)return{'name':_0x3f02d8[_0x47cf9a(0x1a3)],'profile':_0x3f02d8};const _0x3100aa=_0x3d5c20['RANGER_TEST_PASSWORD'],_0x445336=await _0xb9ad8e[_0x47cf9a(0x209)](createCloudProfile,_0x551a58,_0xb9ad8e[_0x47cf9a(0x21d)](_0x3b72f5,undefined),{'username':_0x3240c8,'password':_0x3100aa});return console['log'](_0x47cf9a(0x199)+_0x445336[_0x47cf9a(0x1a3)]+'\x22\x20for\x20'+_0x3240c8+(_0x3b72f5?'\x20(auth\x20env:\x20'+_0x3b72f5+')':'')),{'name':_0x445336[_0x47cf9a(0x1a3)],'profile':_0x445336};}export async function writeSessionToLocalCache(_0x16a46e,_0x471448,_0x1f71dc,_0x580697,_0x5b1387,_0x21f84e,_0x2d2c74){const _0x500b03=_0x25ed96,_0x323b62={'THitF':function(_0x3ac85e,_0x2ecdcc){return _0x3ac85e(_0x2ecdcc);},'FvZjx':function(_0x210b0d,_0x572f00,_0x1e22d6){return _0x210b0d(_0x572f00,_0x1e22d6);},'ZElnw':_0x500b03(0x224),'fHmRX':function(_0xf2bbe1,_0x5dd5c8){return _0xf2bbe1(_0x5dd5c8);},'wvYVR':function(_0x2cdefd,_0x53062a){return _0x2cdefd>_0x53062a;},'vBKqK':function(_0x5c0143,_0x50e8e1,_0x57dd8b){return _0x5c0143(_0x50e8e1,_0x57dd8b);},'lWyIx':function(_0x3fef0d,_0x2c7806){return _0x3fef0d(_0x2c7806);}},_0xad280b=_0x323b62[_0x500b03(0x21c)](sessionCacheHash,{'orgId':_0x471448,'profileName':_0x16a46e,'effectiveBaseUrl':_0x1f71dc,'setupHeaders':_0x580697,'invalidateOn':_0x2d2c74?.[_0x500b03(0x1ec)],'userAgent':_0x2d2c74?.['userAgent'],'clientIp':_0x2d2c74?.['clientIp']}),_0x528444=_0x323b62['FvZjx'](getSessionCachePath,_0xad280b,_0x16a46e),_0x429994=_0x323b62[_0x500b03(0x17e)](join,getRangerHomeDir(),_0x323b62[_0x500b03(0x1cc)]);!_0x323b62[_0x500b03(0x1d7)](existsSync,_0x429994)&&await mkdir(_0x429994,{'recursive':!![]});const _0x33bab1={..._0x5b1387};_0x21f84e&&_0x323b62[_0x500b03(0x218)](_0x21f84e['length'],0x0)&&Array[_0x500b03(0x173)](_0x33bab1[_0x500b03(0x1a6)])&&(_0x33bab1['cookies']=duplicateCookiesForDomains(_0x33bab1[_0x500b03(0x1a6)],_0x21f84e));const _0x4663a3={'cached_at':new Date()['toISOString'](),'session_state':_0x33bab1};await _0x323b62[_0x500b03(0x164)](writeFile,_0x528444,JSON['stringify'](_0x4663a3,null,0x2));const _0x48fdaf=_0x323b62['lWyIx'](getStorageStatePath,_0x528444);return await _0x323b62[_0x500b03(0x17e)](writeFile,_0x48fdaf,JSON['stringify'](_0x33bab1,null,0x2)),_0x48fdaf;}export async function checkLocalCache(_0x28d1b4,_0x4ce679,_0x2a8b49,_0x1757eb,_0x17fc6f){const _0x12cf64=_0x25ed96,_0xd1ab1f={'jicvZ':function(_0x1bd8d5,_0xeda901){return _0x1bd8d5(_0xeda901);},'XOuAR':function(_0x494dd7,_0x383449){return _0x494dd7(_0x383449);},'fUunv':function(_0x4c6927,_0xa3735a,_0x3f219a){return _0x4c6927(_0xa3735a,_0x3f219a);},'DDMko':_0x12cf64(0x1b9)},_0x1f325c=sessionCacheHash({'orgId':_0x4ce679,'profileName':_0x28d1b4,'effectiveBaseUrl':_0x2a8b49,'setupHeaders':_0x1757eb,'invalidateOn':_0x17fc6f?.['invalidateOn'],'userAgent':_0x17fc6f?.[_0x12cf64(0x1a4)],'clientIp':_0x17fc6f?.[_0x12cf64(0x198)]}),_0x4cb9d6=getSessionCachePath(_0x1f325c,_0x28d1b4),_0xc69ef8=_0xd1ab1f[_0x12cf64(0x1e4)](getStorageStatePath,_0x4cb9d6);if(!existsSync(_0x4cb9d6)||!_0xd1ab1f['XOuAR'](existsSync,_0xc69ef8))return null;try{const _0x506666=await _0xd1ab1f['fUunv'](readFile,_0x4cb9d6,_0xd1ab1f['DDMko']);return JSON[_0x12cf64(0x1b3)](_0x506666),{'storageStatePath':_0xc69ef8};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x1eede1,_0x794842){const _0xde914e=_0x25ed96,_0x4ff6aa={'whskW':function(_0x13dc01,_0x5f3dd7){return _0x13dc01===_0x5f3dd7;},'JfhvB':function(_0x5e1cb7,_0x157ce0){return _0x5e1cb7+_0x157ce0;},'cVjGb':function(_0x36b602,_0x1a3fd3){return _0x36b602+_0x1a3fd3;}};if(!_0x794842||!_0x794842['domains']?.['length'])return;let _0x3eada4;try{_0x3eada4=new URL(_0x1eede1);}catch{return;}const _0x3993ed=[];for(const _0x571653 of _0x794842[_0xde914e(0x1fc)]){try{_0x3993ed[_0xde914e(0x186)]({'raw':_0x571653,'url':new URL(_0x571653)});}catch{}}if(_0x4ff6aa[_0xde914e(0x208)](_0x3993ed[_0xde914e(0x21e)],0x0))return;if(_0x3993ed['some'](_0x30748f=>_0x30748f['url']['origin']===_0x3eada4[_0xde914e(0x181)]))return;const _0x2d324a=_0x3993ed[_0xde914e(0x1ea)](_0x55b5a8=>'\x22'+_0x55b5a8['raw']+'\x22')['join'](',\x20');console['log'](_0x4ff6aa[_0xde914e(0x207)](_0x4ff6aa['cVjGb'](_0xde914e(0x204)+_0x2d324a+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x1eede1+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20'),'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.'));}export async function serverSideLogin(_0x41e515,_0x27eedf){const _0x40406d=_0x25ed96,_0x345a8f={'NiXEb':function(_0x3534bd,_0x96bdcd){return _0x3534bd(_0x96bdcd);},'Tvifg':_0x40406d(0x1ba),'WRPwW':function(_0x2d480f,_0x529906){return _0x2d480f===_0x529906;},'FhCUJ':'not_configured'},_0x5a867c=process[_0x40406d(0x205)][_0x40406d(0x177)],_0x3d9700=process['env'][_0x40406d(0x213)],_0x3f5094={};if(_0x5a867c)_0x3f5094[_0x40406d(0x1bf)]=_0x5a867c;if(_0x3d9700)_0x3f5094['password']=_0x3d9700;if(_0x27eedf?.[_0x40406d(0x187)])_0x3f5094[_0x40406d(0x187)]=!![];if(_0x27eedf?.['targetUrl'])_0x3f5094[_0x40406d(0x1a1)]=_0x27eedf['targetUrl'];if(_0x27eedf?.['env'])_0x3f5094[_0x40406d(0x205)]=_0x27eedf['env'];_0x27eedf?.[_0x40406d(0x219)]&&(_0x3f5094[_0x40406d(0x169)]=_0x27eedf[_0x40406d(0x219)]['sessionId'],_0x3f5094[_0x40406d(0x1c8)]=_0x27eedf['tunnel']['pwEndpoint']);try{return await apiRequest('/api/v1/profiles/'+_0x345a8f[_0x40406d(0x1b2)](encodeURIComponent,_0x41e515)+_0x40406d(0x1d2),{'method':_0x345a8f[_0x40406d(0x18c)],'body':JSON['stringify'](_0x3f5094)});}catch(_0x22fcad){if(_0x22fcad instanceof ApiError&&_0x345a8f[_0x40406d(0x17d)](_0x22fcad[_0x40406d(0x17a)],0x190)&&_0x22fcad['code']===_0x345a8f['FhCUJ'])return{'status':_0x345a8f[_0x40406d(0x16b)],'error':_0x22fcad['detail']};throw _0x22fcad;}}async function serverSideLoginWithOptionalTunnel(_0x224ba5,_0x15b9af,_0x59ddf9={}){const _0x7e14b3=_0x25ed96,_0x4c16f7={'SfPfg':_0x7e14b3(0x1dc),'qwEBx':function(_0x340818,_0x57ece2){return _0x340818(_0x57ece2);},'SVvrC':'tunnel_login_setup','oquGp':function(_0x38c806,_0x1e4ccf){return _0x38c806??_0x1e4ccf;},'TiFym':function(_0x47e29d,_0x51f3d9){return _0x47e29d||_0x51f3d9;},'PNYWV':'tunnel_login_cleanup','cSyTD':function(_0x472289,_0x566de7){return _0x472289(_0x566de7);}};if(!_0x4c16f7[_0x7e14b3(0x212)](needsTunnel,_0x15b9af))return await serverSideLogin(_0x224ba5,{'force':_0x59ddf9['force'],'env':_0x59ddf9[_0x7e14b3(0x205)]});let _0x759e41=null,_0x4340d5=null,_0x23023e=null,_0x11b191=null,_0x2fe2d2=![];const _0x506ef3=process['env'][_0x7e14b3(0x171)]?.['toLowerCase'](),_0x55b837=_0x506ef3==='1'||_0x506ef3===_0x7e14b3(0x1ab),_0x4e8b25={'profileName':_0x224ba5,'targetUrlHost':_0x4c16f7[_0x7e14b3(0x212)](targetHostForTelemetry,_0x15b9af),'tunnelRequired':!![],'forceLogin':Boolean(_0x59ddf9[_0x7e14b3(0x187)]),'localBrowserServerHeaded':_0x55b837};try{_0x59ddf9['telemetry']?.['trackPhaseStart'](_0x4c16f7['SVvrC'],_0x4e8b25);_0x55b837&&console['log']('\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...');_0x759e41=await _0x4c16f7[_0x7e14b3(0x212)](launchBrowserServer,{'headless':!_0x55b837}),_0x4340d5=await _0x4c16f7[_0x7e14b3(0x212)](createTunnelSession,_0x15b9af);const _0x79cce7=await requireToken();_0x23023e=await _0x4c16f7['qwEBx'](createTunnelBridge,{'localWsUrl':_0x759e41[_0x7e14b3(0x1e0)],'tunnelServerUrl':_0x4340d5['tunnelUrl'],'sessionId':_0x4340d5[_0x7e14b3(0x1f9)],'apiKey':_0x79cce7,'onError':_0x531794=>{_0x11b191=_0x531794;},'onClose':()=>{const _0x5bea94=_0x7e14b3;_0x11b191??=new Error(_0x5bea94(0x180)+_0x224ba5);},'onEvent':_0xf0652=>trackBridgeEvent(_0x59ddf9[_0x7e14b3(0x1be)],_0xf0652)}),_0x59ddf9['telemetry']?.[_0x7e14b3(0x1da)]('tunnel_login_setup',{..._0x4e8b25,'tunnelSessionId':_0x4340d5['sessionId'],'localBrowserServer':!![],'localBrowserServerHeaded':_0x55b837}),_0x2fe2d2=!![];try{return _0x59ddf9[_0x7e14b3(0x1be)]?.[_0x7e14b3(0x194)]('tunnel_login_request',{..._0x4e8b25,'tunnelSessionId':_0x4340d5[_0x7e14b3(0x1f9)]}),await serverSideLogin(_0x224ba5,{'force':_0x59ddf9[_0x7e14b3(0x187)],'targetUrl':_0x15b9af,'env':_0x59ddf9['env'],'tunnel':{'sessionId':_0x4340d5['sessionId'],'pwEndpoint':_0x4340d5['pwEndpoint']}})['then'](_0x2a6a04=>{const _0x2074fc=_0x7e14b3;return _0x59ddf9['telemetry']?.['trackPhaseEnd'](_0x4c16f7[_0x2074fc(0x1ef)],{..._0x4e8b25,'tunnelSessionId':_0x4340d5?.[_0x2074fc(0x1f9)],'loginStatus':_0x2a6a04['status'],'hasSessionState':_0x4c16f7['qwEBx'](Boolean,_0x2a6a04[_0x2074fc(0x206)]),'hasTestOutput':Boolean(_0x2a6a04['test_output']),'bridgeError':errorMessageForTelemetry(_0x11b191)}),_0x2a6a04;});}catch(_0x5c5b57){await _0x59ddf9[_0x7e14b3(0x1be)]?.[_0x7e14b3(0x214)](_0x4c16f7['SfPfg'],_0x4c16f7['oquGp'](_0x11b191,_0x5c5b57),{..._0x4e8b25,'tunnelSessionId':_0x4340d5['sessionId'],'bridgeError':errorMessageForTelemetry(_0x11b191)});throw _0x11b191??_0x5c5b57;}}catch(_0x3ccfe1){!_0x2fe2d2&&await _0x59ddf9[_0x7e14b3(0x1be)]?.[_0x7e14b3(0x214)]('tunnel_login_setup',_0x3ccfe1,{..._0x4e8b25,'tunnelSessionId':_0x4340d5?.[_0x7e14b3(0x1f9)]});throw _0x3ccfe1;}finally{if(_0x4c16f7['TiFym'](_0x4340d5,_0x759e41)||_0x23023e){const _0x593ebf='0|2|3|4|1'['split']('|');let _0x335290=0x0;while(!![]){switch(_0x593ebf[_0x335290++]){case'0':_0x59ddf9['telemetry']?.[_0x7e14b3(0x194)](_0x4c16f7[_0x7e14b3(0x1e9)],{..._0x4e8b25,'tunnelSessionId':_0x4340d5?.[_0x7e14b3(0x1f9)]});continue;case'1':_0x59ddf9['telemetry']?.[_0x7e14b3(0x1da)]('tunnel_login_cleanup',{..._0x4e8b25,'tunnelSessionId':_0x4340d5?.[_0x7e14b3(0x1f9)]});continue;case'2':_0x23023e?.['close']();continue;case'3':_0x759e41&&await _0x759e41['close']()['catch'](()=>{});continue;case'4':_0x4340d5&&await _0x4c16f7['cSyTD'](deleteTunnelSession,_0x4340d5[_0x7e14b3(0x1f9)])['catch'](()=>{});continue;}break;}}}}export async function manualBrowserLogin(_0x3acf8c,_0x56bb9d,_0x47e830={}){const _0x34f6de=_0x25ed96,_0x21e962={'mcXry':function(_0x258ab4,_0x56e59a){return _0x258ab4/_0x56e59a;},'XyVFd':_0x34f6de(0x202),'OtQfG':'about:blank','GbfgK':'\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','GFGzp':_0x34f6de(0x1fd),'LnHPT':function(_0xa1fe4b,_0x4dddd0){return _0xa1fe4b(_0x4dddd0);},'KhAzu':_0x34f6de(0x200),'sKsFo':function(_0x579d20,_0x1c4001){return _0x579d20!==_0x1c4001;},'JDYyW':'cli:manual-login'};if(!isInteractive())throw new Error('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x3acf8c['name']+'\x22.\x0a'+_0x34f6de(0x1a7)+'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.');const _0x532ef3=_0x56bb9d&&_0x56bb9d[_0x34f6de(0x1fc)][_0x34f6de(0x21e)]>0x0?_0x56bb9d['domains'][0x0]:_0x21e962[_0x34f6de(0x1ae)];console['log'](_0x21e962['GbfgK']),console['log'](_0x21e962[_0x34f6de(0x179)]),await new Promise(_0x4b907a=>setTimeout(_0x4b907a,0x7d0));const _0x5a3cc2=await chromium['launch']({'headless':![]});let _0x45796f=null;try{const _0x19b204={'ignoreHTTPSErrors':!![]};_0x56bb9d?.['setupHeaders']&&(_0x19b204[_0x34f6de(0x1e2)]=_0x56bb9d['setupHeaders']);const _0x4193c8=await _0x5a3cc2[_0x34f6de(0x19d)](_0x19b204);await _0x21e962['LnHPT'](addProfileSetupBanner,_0x4193c8);const _0x53edc5=await _0x4193c8[_0x34f6de(0x201)]();await _0x53edc5['goto'](_0x532ef3);let _0x1b395c=![];await new Promise(_0x4e6adc=>{const _0x1a0166=setTimeout(()=>{const _0x426829=_0xdb1b;_0x1b395c=!![],console[_0x426829(0x21a)](_0x426829(0x19e)+_0x21e962[_0x426829(0x191)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x4e6adc();},MANUAL_LOGIN_TIMEOUT_MS);_0x53edc5['on'](_0x21e962['XyVFd'],async()=>{const _0xa16973=_0xdb1b;clearTimeout(_0x1a0166);try{const _0x3efa51=await _0x4193c8[_0xa16973(0x20c)]();_0x45796f=_0x3efa51;}catch{}_0x4e6adc();});});if(_0x1b395c&&!_0x45796f)throw new Error(_0x34f6de(0x176));}finally{await _0x5a3cc2['close']()['catch'](()=>{});}if(!_0x45796f)throw new Error(_0x21e962[_0x34f6de(0x1c0)]);return _0x21e962[_0x34f6de(0x215)](_0x47e830['persistSessionState'],![])&&await apiRequest(_0x34f6de(0x1f5)+_0x21e962['LnHPT'](encodeURIComponent,_0x3acf8c['name'])+'/session',{'method':'POST','body':JSON['stringify']({'session_state':_0x45796f,'updated_by':_0x21e962['JDYyW']})}),{'sessionState':_0x45796f};}export async function promptSaveCredentials(_0x3582c9){const _0x55dd16=_0x25ed96,_0x95d1b9={'UzDCk':function(_0x5e84a5,_0x2c2ffe){return _0x5e84a5||_0x2c2ffe;},'tOFCB':function(_0x4e63d4){return _0x4e63d4();},'oXZkv':'save','NUeqY':function(_0x316922,_0x483ed5,_0x31a2ed){return _0x316922(_0x483ed5,_0x31a2ed);}},_0x1d4792=process['env'][_0x55dd16(0x177)],_0x4312d1=process['env']['RANGER_TEST_PASSWORD'];if(_0x95d1b9['UzDCk'](!_0x1d4792,!_0x4312d1))return;if(!_0x95d1b9[_0x55dd16(0x18d)](isInteractive))return;const {save:_0x3e2c6a}=await _0x226ce7['prompt']([{'type':'confirm','name':_0x95d1b9[_0x55dd16(0x1af)],'message':_0x55dd16(0x217),'default':![]}]);if(!_0x3e2c6a)return;await _0x95d1b9['NUeqY'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x3582c9),{'method':'PUT','body':JSON[_0x55dd16(0x1fa)]({'username':_0x1d4792,'password':_0x4312d1})}),console['log']('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0x125d20,_0x1425b8={}){const _0x2002da=_0x25ed96,_0x231c97={'Edxdi':function(_0x4c58fb){return _0x4c58fb();},'fsgrP':function(_0x5bb0cb,_0x2c6278){return _0x5bb0cb===_0x2c6278;},'PWPql':_0x2002da(0x1ca),'ZWQlx':function(_0x3c39be,_0x8ecb8a){return _0x3c39be===_0x8ecb8a;},'gRknK':function(_0x14771f,_0x2860b3){return _0x14771f||_0x2860b3;},'YrNqK':function(_0x59f885,_0x2918a0){return _0x59f885(_0x2918a0);},'egwqC':function(_0x1ac0f9,_0x53c0dc){return _0x1ac0f9(_0x53c0dc);},'pYSXP':function(_0x1dc0b6,_0x103430){return _0x1dc0b6>_0x103430;},'WmRxp':function(_0x8cde5a,_0x57d792,_0xed5bd9,_0x507a99,_0x30a468,_0x368cc7){return _0x8cde5a(_0x57d792,_0xed5bd9,_0x507a99,_0x30a468,_0x368cc7);},'PwpuS':function(_0x4c9034,_0x23fc57,_0x565ad6){return _0x4c9034(_0x23fc57,_0x565ad6);},'RQMZC':function(_0x47ec59,_0x230071,_0x565948){return _0x47ec59(_0x230071,_0x565948);},'RxAiB':function(_0x4709a2,_0x5bd746){return _0x4709a2(_0x5bd746);},'HXdTd':function(_0x358881,_0x583016,_0x511604,_0x5df8f1){return _0x358881(_0x583016,_0x511604,_0x5df8f1);},'IzIAr':function(_0x24db32,_0x40911d,_0x4dd511){return _0x24db32(_0x40911d,_0x4dd511);},'mmTNn':'\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','ABilH':function(_0x52904a,_0x52f0b8){return _0x52904a===_0x52f0b8;},'JKgvX':_0x2002da(0x20f),'olOxN':function(_0xadff0,_0x1084da,_0x41ac8b,_0x3c8be0,_0x4149a1,_0x1c0807,_0x18fe2d,_0x33bcce){return _0xadff0(_0x1084da,_0x41ac8b,_0x3c8be0,_0x4149a1,_0x1c0807,_0x18fe2d,_0x33bcce);},'TpHSd':function(_0x36d826,_0x12ce7e){return _0x36d826&&_0x12ce7e;},'YbPtz':function(_0x353ee9,_0x3fa475){return _0x353ee9(_0x3fa475);},'pNWWK':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','bNTzM':function(_0x3d4f66,_0x1a5a8c){return _0x3d4f66 instanceof _0x1a5a8c;},'gEzSy':function(_0x563c1d,_0x890838){return _0x563c1d+_0x890838;},'QOQOj':function(_0x45b6bc,_0xc0407c,_0xddbcaf){return _0x45b6bc(_0xc0407c,_0xddbcaf);},'EtVLc':function(_0x530c9c,_0x3d60c5,_0x3a372a,_0x1fb36a,_0x416641,_0x90c4f5,_0x5670cc,_0x22c888){return _0x530c9c(_0x3d60c5,_0x3a372a,_0x1fb36a,_0x416641,_0x90c4f5,_0x5670cc,_0x22c888);}},_0x5d045c=_0x125d20[_0x2002da(0x193)]??{},_0x769213=await _0x231c97[_0x2002da(0x223)](fetchAuthConfig),_0x1901a0=_0x769213?resolveAuthEnvironmentLocally(_0x769213,_0x1425b8['assertedEnv']??_0x125d20['environmentKey']):null,_0x2a7edb=_0x231c97['fsgrP'](typeof _0x1901a0?.[_0x2002da(0x1f2)],_0x231c97[_0x2002da(0x1d4)])&&_0x1901a0['loginInstructions'][_0x2002da(0x18f)]()?_0x1901a0['loginInstructions']:undefined,_0x1dc295=_0x231c97[_0x2002da(0x203)](typeof _0x5d045c[_0x2002da(0x1f2)],'string')&&_0x5d045c[_0x2002da(0x1f2)]['trim']()?_0x5d045c['loginInstructions']:undefined,_0x2f9259=_0x231c97[_0x2002da(0x183)](_0x1dc295,!_0x2a7edb)?_0x5d045c:{..._0x5d045c,'loginInstructions':_0x2a7edb},_0x497e08=_0x231c97[_0x2002da(0x20d)](Boolean,_0x2f9259[_0x2002da(0x1f2)]?.['trim']()),_0x352a3c=_0x231c97['egwqC'](Boolean,_0x5d045c[_0x2002da(0x163)]||_0x1901a0?.['forceLogin']),_0x138242=_0x1901a0?.['domains'],_0x1810f5=_0x5d045c[_0x2002da(0x1f7)],_0x31eca6=_0x1810f5??_0x1901a0?.[_0x2002da(0x1f7)],_0x5e5a68=_0x1425b8[_0x2002da(0x16d)]??_0x5d045c['baseUrl']??(_0x138242&&_0x231c97['pYSXP'](_0x138242['length'],0x0)?_0x138242[0x0]:''),_0x2de6b9=_0x5e5a68?needsTunnel(_0x5e5a68):![],_0x27ec99={'invalidateOn':_0x1901a0?.[_0x2002da(0x1ec)],'userAgent':_0x1901a0?.[_0x2002da(0x20e)]?.['userAgent']??_0x5d045c[_0x2002da(0x1a4)]};_0x352a3c&&console['log']('\x20\x20forceLogin\x20enabled\x20for\x20\x22'+_0x125d20[_0x2002da(0x1a3)]+_0x2002da(0x1fb));if(!_0x352a3c){const _0x2088d6=await _0x231c97[_0x2002da(0x19b)](checkLocalCache,_0x125d20['name'],_0x125d20['organizationId'],_0x5e5a68,_0x31eca6,_0x27ec99);if(_0x2088d6){if(_0x5e5a68&&!_0x2de6b9){const _0x2b2d8f=await isCachedSessionLive(_0x2088d6[_0x2002da(0x1d5)],_0x5e5a68,{'sessionCheckPath':_0x1901a0?.[_0x2002da(0x222)],'setupHeaders':_0x31eca6},{'launchBrowser':launchRealBrowser});if(_0x2b2d8f)return console[_0x2002da(0x172)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x125d20['name']+'\x22'),{'authPath':_0x2088d6['storageStatePath'],'settings':_0x2f9259,'resolvedEnv':_0x1901a0};console[_0x2002da(0x172)](_0x2002da(0x1bd)+_0x125d20['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x231c97['PwpuS'](emitSessionValidationHint,_0x5e5a68,_0x1901a0);}else return _0x2de6b9&&console[_0x2002da(0x172)](_0x2002da(0x1e1)+_0x125d20[_0x2002da(0x1a3)]+'\x22'),{'authPath':_0x2088d6[_0x2002da(0x1d5)],'settings':_0x2f9259,'resolvedEnv':_0x1901a0};}}if(!_0x352a3c&&_0x125d20[_0x2002da(0x1b5)]){const _0x49ff13=await writeSessionToLocalCache(_0x125d20['name'],_0x125d20['organizationId'],_0x5e5a68,_0x31eca6,_0x125d20['sessionState'],_0x138242,_0x27ec99);if(_0x5e5a68){const _0x9efb45=await isCachedSessionLive(_0x49ff13,_0x5e5a68,{'sessionCheckPath':_0x1901a0?.['sessionCheckPath'],'setupHeaders':_0x31eca6},{'launchBrowser':launchRealBrowser});if(_0x9efb45)return console[_0x2002da(0x172)](_0x2002da(0x185)+_0x125d20['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x49ff13,'settings':_0x2f9259,'resolvedEnv':_0x1901a0};console[_0x2002da(0x172)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x125d20[_0x2002da(0x1a3)]+_0x2002da(0x17c)),_0x231c97[_0x2002da(0x1b1)](emitSessionValidationHint,_0x5e5a68,_0x1901a0);}else return{'authPath':_0x49ff13,'settings':_0x2f9259,'resolvedEnv':_0x1901a0};}if(_0x497e08)return console['log']('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x125d20[_0x2002da(0x1a3)]+_0x2002da(0x1a9)),{'authPath':undefined,'settings':_0x2f9259,'resolvedEnv':_0x1901a0};console['log'](_0x2002da(0x1c1)+_0x125d20['name']+_0x2002da(0x1f8));const _0x4bb471=Boolean(process[_0x2002da(0x205)][_0x2002da(0x177)])&&_0x231c97['YrNqK'](Boolean,process['env'][_0x2002da(0x213)]),_0x3a9ca9=_0x231c97[_0x2002da(0x17f)](Boolean,_0x125d20[_0x2002da(0x1bf)]),_0x255a82=Boolean(_0x1425b8[_0x2002da(0x1a8)]),_0x6c0db5=_0x5e5a68?isBareLocalhost(_0x5e5a68):![],_0x355730=_0x231c97['gRknK'](_0x4bb471,_0x3a9ca9)&&_0x231c97[_0x2002da(0x183)](!_0x6c0db5,_0x255a82);if(_0x355730)try{const _0x3877e2=_0x5e5a68?await _0x231c97['HXdTd'](serverSideLoginWithOptionalTunnel,_0x125d20[_0x2002da(0x1a3)],_0x5e5a68,{'force':_0x352a3c,'telemetry':_0x1425b8[_0x2002da(0x1be)],'env':_0x1425b8['assertedEnv']}):await _0x231c97['IzIAr'](serverSideLogin,_0x125d20[_0x2002da(0x1a3)],{'force':_0x352a3c,'env':_0x1425b8['assertedEnv']});if(_0x3877e2['status']==='not_configured')console['log'](_0x231c97['mmTNn']);else{if(_0x231c97[_0x2002da(0x20b)](_0x3877e2[_0x2002da(0x17a)],_0x231c97[_0x2002da(0x210)])&&_0x3877e2['session_state']){console[_0x2002da(0x172)](_0x2002da(0x16f));const _0x2963d3=await _0x231c97['olOxN'](writeSessionToLocalCache,_0x125d20['name'],_0x125d20[_0x2002da(0x1e3)],_0x5e5a68,_0x31eca6,_0x3877e2[_0x2002da(0x206)],_0x138242,_0x27ec99);return _0x231c97[_0x2002da(0x1d0)](_0x4bb471,!_0x3a9ca9)&&await _0x231c97['YbPtz'](promptSaveCredentials,_0x125d20['name']),{'authPath':_0x2963d3,'settings':_0x2f9259,'resolvedEnv':_0x1901a0};}else _0x3877e2['test_output']&&(console['log']('\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:'),console['log'](_0x3877e2['test_output'])),console['log'](_0x231c97[_0x2002da(0x1a5)]);}}catch(_0x4db916){console[_0x2002da(0x172)](_0x2002da(0x19c)+(_0x231c97['bNTzM'](_0x4db916,Error)?_0x4db916['message']:String(_0x4db916))),console['log'](_0x231c97['pNWWK']);}if(_0x6c0db5&&!_0x255a82&&!isInteractive())throw new Error(_0x231c97['gEzSy']('No\x20saved\x20session\x20for\x20\x22'+_0x5e5a68+_0x2002da(0x1e8)+_0x125d20['name']+_0x2002da(0x1eb),'\x20\x20•\x20capture\x20one\x20(a\x20browser\x20opens):\x20ranger\x20profile\x20add\x20'+_0x125d20[_0x2002da(0x1a3)]+_0x2002da(0x1ad)+_0x5e5a68+'\x0a')+_0x2002da(0x18a));const _0x19c610=_0x1901a0?{..._0x1901a0,'domains':_0x231c97['QOQOj'](orderLoginDomains,_0x5e5a68,_0x1901a0[_0x2002da(0x1fc)]),'setupHeaders':_0x31eca6}:_0x5e5a68?{'key':_0x125d20['environmentKey']??'','domains':[_0x5e5a68],'setupHeaders':_0x31eca6}:null,{sessionState:_0x23e6a7}=await manualBrowserLogin(_0x125d20,_0x19c610,{'persistSessionState':!_0x2de6b9}),_0x56ea2f=await _0x231c97['EtVLc'](writeSessionToLocalCache,_0x125d20['name'],_0x125d20['organizationId'],_0x5e5a68,_0x31eca6,_0x23e6a7,_0x138242,_0x27ec99);return{'authPath':_0x56ea2f,'settings':_0x2f9259,'resolvedEnv':_0x1901a0};}
1
+ const _0x473257=_0x4cd6;(function(_0x95776a,_0x2367d5){const _0x3c7982=_0x4cd6,_0x5635a8=_0x95776a();while(!![]){try{const _0x5783b9=-parseInt(_0x3c7982(0x124))/0x1+-parseInt(_0x3c7982(0x159))/0x2+-parseInt(_0x3c7982(0x15c))/0x3*(-parseInt(_0x3c7982(0xdc))/0x4)+parseInt(_0x3c7982(0x151))/0x5+-parseInt(_0x3c7982(0x173))/0x6+parseInt(_0x3c7982(0x136))/0x7*(parseInt(_0x3c7982(0xeb))/0x8)+parseInt(_0x3c7982(0x10c))/0x9;if(_0x5783b9===_0x2367d5)break;else _0x5635a8['push'](_0x5635a8['shift']());}catch(_0x1f0d19){_0x5635a8['push'](_0x5635a8['shift']());}}}(_0x2a92,0x4f5bc));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x2ef7c3 from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';function _0x2a92(){const _0xa98c60=['agent','headers','trackPhaseError','force','ambiguous','defaultEnvironmentKey','gNocX','\x20Available:\x20','agyvl','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','\x22,\x20refreshing\x20session...','/api/v1/profiles/auth-config','GwGBG','jKoQb','application/json','IRJue','GuxjO','7BIkTND','pwEndpoint','auth_config','yIQlN','detail','jFaNs','FqPLG','name','environmentKey','No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22','effectiveBaseUrl','\x22\x20for\x20','\x20\x20Login\x20successful.\x20Session\x20cached.','forceLogin','/api/v1/profiles/','/api/v1/tunnel/sessions/','rPLuj','\x20\x20Cached\x20session\x20for\x20\x22','SuPey','you\x27re\x20now\x20at\x20\x22','\x22;\x20proceeding\x20with\x20loginInstructions.','daQzH','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','ROTwh','PqUXo','\x22\x20on\x20profile\x20\x22','/api/v1/tunnel/sessions','2469410fbtHYt','PqhGe','sessionCheckPath','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','targetUrl','tunnel_session_id','\x20\x20Created\x20cloud\x20profile\x20\x22','json','1225666ipWUYG','goto','clientIp','19638dNfifu','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','close','sessionState','invalid-url','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','sNLYq','tunnel_bridge','No\x20saved\x20session\x20for\x20\x22','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','origin','tunnelUrl','jackF','nUjdx','POST','gwjGi','stringify','settings','profiles','\x20\x20•\x20capture\x20one\x20(a\x20browser\x20opens):\x20ranger\x20profile\x20add\x20','Cloud\x20profile\x20\x22','CwMZx','/api/v1/profiles','3403590HWwPjw','qPIyF','WhEXY','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','type','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','env','storageState','session_state','trim','userAgent','cookies','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','organizationId','some','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','tunnel_login_setup','true','message','isArray','cvuKe','uzaUh','\x22.\x0a','ALKPM','key','AvrcP','map','domains','\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a','prompt','duxAQ','mCwUW','CoxCJ','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','\x20\x20No\x20live\x20session\x20for\x20\x22','sessionId','extraHTTPHeaders','\x20\x20Options:\x0a','log','212aGhMfc','raw','length','bJGeh','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','DELETE','Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20(','vpXqY','vhBgX','success','environments','username','jazYG','connectionId','invalidateOn','64248lmUZTw','target_url','yHSZZ','Bearer\x20','HPCym','CQrRK','AxGUA','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','string','error','\x22,\x20cached\x20locally','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','assertedEnv','parse','UugLv','INeDH','aRjgT','\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22','newContext','nCeOi','XeDup','password','status','fgmOJ','UKipH','pw_endpoint','\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a','UNstX','Pass\x20--base-url\x20<your-app-url>\x20so\x20Ranger\x20can\x20match\x20the\x20right\x20one,\x20or\x20create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`.','\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','not_configured','tunnel_login_cleanup','8704566OssPZJ','trackPhaseEnd','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','setupHeaders','\x22,\x20and\x20cloud\x20sessions\x20don\x27t\x20apply\x20to\x20localhost.\x0a','launch','yvqzr','elapsedMs','telemetry','\x20\x20Cloud\x20profile\x20\x22','loginInstructions','tunnel','pendingLocalConnections','RANGER_TEST_PASSWORD','uYtyG','split','code','catch','save','TLUDX','VKVxD','mdwJk','newPage','join','310875mpcLGi'];_0x2a92=function(){return _0xa98c60;};return _0x2a92();}import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isBareLocalhost,isCachedSessionLive,isInteractive,needsTunnel,orderLoginDomains,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{matchAuthEnvironmentByHost,matchAuthEnvironmentExact}from'./matchAuthEnvironment.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0x416a89){const _0x42fe81=_0x4cd6,_0x3e6222={'trtBi':_0x42fe81(0x160)};try{return new URL(_0x416a89)['host'];}catch{return _0x3e6222['trtBi'];}}function errorMessageForTelemetry(_0x1e730c){const _0x48dbde=_0x4cd6;return _0x1e730c instanceof Error?_0x1e730c[_0x48dbde(0x185)]:undefined;}function trackBridgeEvent(_0x1b2230,_0x4f6d7f){const _0x40e245=_0x4cd6,_0x3b3434={'yHSZZ':function(_0x18fe7d,_0x528583){return _0x18fe7d===_0x528583;},'CoxCJ':'local_ws_error','iIUAl':_0x40e245(0x163)};if(!_0x1b2230)return;const _0x699025={'tunnelSessionId':_0x4f6d7f[_0x40e245(0xd8)],'tunnelEventType':_0x4f6d7f[_0x40e245(0x177)],'connectionId':_0x4f6d7f[_0x40e245(0xe9)],'code':_0x4f6d7f[_0x40e245(0x11c)],'reason':_0x4f6d7f['reason'],'error':_0x4f6d7f[_0x40e245(0xf4)],'elapsedMs':_0x4f6d7f[_0x40e245(0x113)],'activeLocalConnections':_0x4f6d7f['activeLocalConnections'],'pendingLocalConnections':_0x4f6d7f[_0x40e245(0x118)]};_0x1b2230[_0x40e245(0x10d)]('tunnel_bridge_event',_0x699025),(_0x4f6d7f['type']==='tunnel_error'||_0x3b3434[_0x40e245(0xed)](_0x4f6d7f['type'],_0x3b3434[_0x40e245(0xd5)]))&&void _0x1b2230[_0x40e245(0x127)](_0x3b3434['iIUAl'],new Error(_0x4f6d7f['error']??_0x4f6d7f['type']),_0x699025);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x5ef00f={'xqput':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x53402f=await getToken();if(!_0x53402f)throw new Error(_0x5ef00f['xqput']);return _0x53402f;}async function apiRequest(_0x123a22,_0x5a0f92={}){const _0x1e3dd1=_0x4cd6,_0x236ac5={'qPIyF':function(_0x29ff58){return _0x29ff58();},'YgFBk':_0x1e3dd1(0x133),'UKipH':function(_0x3a3cd1,_0x432148){return _0x3a3cd1===_0x432148;},'vpXqY':'string','KFlXZ':function(_0xc50a52,_0x257ac9){return _0xc50a52===_0x257ac9;}},_0x453512=await _0x236ac5[_0x1e3dd1(0x174)](requireToken),_0x47c5ee=getApiBaseUrl(),_0x2d2fc5=await fetch(''+_0x47c5ee+_0x123a22,{..._0x5a0f92,'headers':{'Authorization':_0x1e3dd1(0xee)+_0x453512,'Content-Type':_0x236ac5['YgFBk'],..._0x5a0f92[_0x1e3dd1(0x126)]??{}}});if(!_0x2d2fc5['ok']){let _0x113bd0='',_0x5d3d70;try{const _0x5c3356=await _0x2d2fc5[_0x1e3dd1(0x158)](),_0x280865=(_0x236ac5[_0x1e3dd1(0x103)](typeof _0x5c3356['error'],_0x236ac5['vpXqY'])?_0x5c3356[_0x1e3dd1(0xf4)]:undefined)??JSON['stringify'](_0x5c3356);_0x113bd0=_0x280865;typeof _0x5c3356['test_output']===_0x236ac5[_0x1e3dd1(0xe3)]&&_0x5c3356['test_output']&&(_0x113bd0=_0x113bd0+'\x0a'+_0x5c3356['test_output']);if(_0x236ac5[_0x1e3dd1(0x103)](typeof _0x5c3356[_0x1e3dd1(0x11c)],_0x236ac5['vpXqY']))_0x5d3d70=_0x5c3356['code'];}catch{_0x113bd0=_0x2d2fc5['statusText'];}throw new ApiError('API\x20request\x20'+_0x123a22+'\x20failed\x20('+_0x2d2fc5['status']+'):\x20'+_0x113bd0,_0x2d2fc5[_0x1e3dd1(0x101)],_0x113bd0,_0x5d3d70);}if(_0x236ac5['KFlXZ'](_0x2d2fc5['status'],0xcc))return undefined;return _0x2d2fc5[_0x1e3dd1(0x158)]();}export class ApiError extends Error{['status'];[_0x473257(0x13a)];['code'];constructor(_0x9869ac,_0xc8dc93,_0x30c620,_0x2ed922){const _0x4ec072=_0x473257,_0x37134f={'nUjdx':'2|1|4|3|0'},_0x449d96=_0x37134f[_0x4ec072(0x169)][_0x4ec072(0x11b)]('|');let _0x3a4082=0x0;while(!![]){switch(_0x449d96[_0x3a4082++]){case'0':this[_0x4ec072(0x13d)]='ApiError';continue;case'1':this[_0x4ec072(0x101)]=_0xc8dc93;continue;case'2':super(_0x9869ac);continue;case'3':this['code']=_0x2ed922;continue;case'4':this['detail']=_0x30c620;continue;}break;}}}export async function fetchCloudProfile(_0x4ebf9d){const _0x47c378=_0x473257,_0xb8a21b={'XeDup':function(_0x22f36a,_0x17024a,_0x10722a){return _0x22f36a(_0x17024a,_0x10722a);},'jXGNn':function(_0x52b6d6,_0x37c8bf){return _0x52b6d6===_0x37c8bf;}};try{return await _0xb8a21b[_0x47c378(0xff)](apiRequest,_0x47c378(0x144)+encodeURIComponent(_0x4ebf9d),{'signal':AbortSignal['timeout'](0x3a98)});}catch(_0xc450e1){if(_0xc450e1 instanceof ApiError&&_0xb8a21b['jXGNn'](_0xc450e1['status'],0x194))return null;throw _0xc450e1;}}export async function listCloudProfiles(){const _0x61e9ca=_0x473257,_0x1f34da=await apiRequest(_0x61e9ca(0x172));return _0x1f34da[_0x61e9ca(0x16e)];}export async function deleteCloudProfile(_0x482ad1){const _0x4205bf=_0x473257,_0x5e991b={'jackF':function(_0x25baca,_0x4a45f5){return _0x25baca instanceof _0x4a45f5;}};try{await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x482ad1),{'method':_0x4205bf(0xe1)});}catch(_0x33678c){if(_0x5e991b[_0x4205bf(0x168)](_0x33678c,ApiError)&&_0x33678c['status']===0x194)throw new Error(_0x4205bf(0x170)+_0x482ad1+'\x22\x20not\x20found.');throw _0x33678c;}}export async function createCloudProfile(_0x2e989,_0x1a59d5,_0x5f32d0={}){const _0x3c6377=_0x473257,_0x373bc9={'INeDH':function(_0x3862c3,_0x1c2b73){return _0x3862c3>_0x1c2b73;},'JzGQG':function(_0x39f0fe,_0xca448f,_0x325d5c){return _0x39f0fe(_0xca448f,_0x325d5c);},'ARXTi':'POST'},_0x53cf9c={'name':_0x2e989};if(_0x1a59d5)_0x53cf9c['environment_key']=_0x1a59d5;_0x5f32d0[_0x3c6377(0x16d)]&&_0x373bc9[_0x3c6377(0xfa)](Object['keys'](_0x5f32d0[_0x3c6377(0x16d)])['length'],0x0)&&(_0x53cf9c[_0x3c6377(0x16d)]=_0x5f32d0[_0x3c6377(0x16d)]);if(_0x5f32d0[_0x3c6377(0xe7)])_0x53cf9c[_0x3c6377(0xe7)]=_0x5f32d0['username'];if(_0x5f32d0['password'])_0x53cf9c['password']=_0x5f32d0[_0x3c6377(0x100)];return await _0x373bc9['JzGQG'](apiRequest,_0x3c6377(0x172),{'method':_0x373bc9['ARXTi'],'body':JSON[_0x3c6377(0x16c)](_0x53cf9c)});}export async function uploadCloudProfileSession(_0x382393,_0x4571f2){const _0x24fbc1=_0x473257;return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x382393)+'/session',{'method':_0x24fbc1(0x16a),'body':JSON[_0x24fbc1(0x16c)]({'session_state':_0x4571f2})});}export async function saveCloudProfileCredentials(_0x1fd1a1,_0x3fa480,_0x1a061f){const _0x52431a=_0x473257,_0x188973={'bJGeh':function(_0x20729e,_0x11ae2a,_0x1d1a74){return _0x20729e(_0x11ae2a,_0x1d1a74);}};await _0x188973[_0x52431a(0xdf)](apiRequest,_0x52431a(0x144)+encodeURIComponent(_0x1fd1a1),{'method':'PUT','body':JSON[_0x52431a(0x16c)]({'username':_0x3fa480,'password':_0x1a061f})});}export async function fetchAuthConfig(){const _0x3d787b=_0x473257,_0x648298={'vGnSb':_0x3d787b(0x130),'haRQD':function(_0x40cf64,_0x273de2){return _0x40cf64 instanceof _0x273de2;}};try{const _0x40deeb=await apiRequest(_0x648298['vGnSb']);return _0x40deeb[_0x3d787b(0x138)];}catch(_0x3ea15a){return _0x648298['haRQD'](_0x3ea15a,ApiError)&&_0x3ea15a[_0x3d787b(0x101)]!==0x194&&console[_0x3d787b(0xf4)](_0x3d787b(0xf6)+_0x3ea15a[_0x3d787b(0x185)]),null;}}async function createTunnelSession(_0x8b4a66){const _0x580ef3=_0x473257,_0x2a062b={'PqUXo':_0x580ef3(0x150),'fgmOJ':_0x580ef3(0x125)};return await apiRequest(_0x2a062b[_0x580ef3(0x14e)],{'method':_0x580ef3(0x16a),'body':JSON[_0x580ef3(0x16c)]({'targetUrl':_0x8b4a66,'mode':_0x2a062b[_0x580ef3(0x102)]})});}async function deleteTunnelSession(_0x880a4d){const _0x3b11dc=_0x473257,_0x583c68={'CwMZx':function(_0x53f2bf,_0x3bd6b5,_0x554f36){return _0x53f2bf(_0x3bd6b5,_0x554f36);}};await _0x583c68[_0x3b11dc(0x171)](apiRequest,_0x3b11dc(0x145)+_0x880a4d,{'method':_0x3b11dc(0xe1)});}export function pickAdHocEnvKey(_0xae78e0,_0x561cde,_0x27915e){const _0x5ce58b=_0x473257,_0x49cc5b={'qaMah':function(_0x3fe16a,_0x1b7153){return _0x3fe16a+_0x1b7153;},'FqPLG':function(_0x249ee6,_0x2ea2d5,_0xecdac0){return _0x249ee6(_0x2ea2d5,_0xecdac0);},'agyvl':function(_0x4fbe8e,_0xc55ad6){return _0x4fbe8e in _0xc55ad6;},'UugLv':function(_0xed53a1,_0x33e5fd){return _0xed53a1+_0x33e5fd;},'qbudh':function(_0x86d47e,_0x48c007){return _0x86d47e+_0x48c007;},'PqhGe':function(_0x435573,_0x227e3c){return _0x435573===_0x227e3c;}};if(_0x27915e){if(!_0xae78e0?.[_0x5ce58b(0xe6)]?.[_0x27915e]){const _0x58b7ab=Object['keys'](_0xae78e0?.[_0x5ce58b(0xe6)]??{});throw new Error(_0x49cc5b['qaMah']('Auth\x20environment\x20\x22'+_0x27915e+'\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.'+(_0x58b7ab['length']?_0x5ce58b(0x12c)+_0x58b7ab[_0x5ce58b(0x123)](',\x20')+'.':_0x5ce58b(0xd6)),'\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)'));}return _0x27915e;}if(!_0xae78e0)return null;if(_0x561cde){const _0xc3311e=_0x49cc5b[_0x5ce58b(0x13c)](matchAuthEnvironmentExact,_0x561cde,_0xae78e0);if(_0xc3311e)return _0xc3311e;const _0x377585=matchAuthEnvironmentByHost(_0x561cde,_0xae78e0);if(_0x377585&&_0x49cc5b[_0x5ce58b(0x12d)](_0x5ce58b(0x18b),_0x377585))return console['log']('\x20\x20Auth\x20env\x20\x22'+_0x377585['key']+'\x22\x20matched\x20by\x20host\x20for\x20'+_0x561cde+'\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).'),_0x377585['key'];if(_0x377585&&_0x49cc5b[_0x5ce58b(0x12d)]('ambiguous',_0x377585))throw new Error(_0x5ce58b(0xe2)+_0x377585[_0x5ce58b(0x129)]['join'](',\x20')+');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.');if(needsTunnel(_0x561cde))throw new Error(_0x49cc5b[_0x5ce58b(0xf9)](_0x49cc5b['UugLv'](_0x49cc5b['qaMah'](_0x49cc5b['qbudh'](_0x5ce58b(0x13f)+_0x561cde+_0x5ce58b(0x189),_0x5ce58b(0x105)),_0x5ce58b(0xda)),_0x5ce58b(0xd1)),_0x5ce58b(0xfc)+_0x561cde['replace'](/\/+$/,'')+'\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a')+('\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20'+_0x561cde+'\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.'));}if(_0xae78e0['defaultEnvironmentKey'])return _0xae78e0['defaultEnvironmentKey'];const _0xe5b3a9=Object['keys'](_0xae78e0['environments']??{});if(_0x49cc5b['PqhGe'](_0xe5b3a9[_0x5ce58b(0xde)],0x1))return _0xe5b3a9[0x0];if(_0x49cc5b[_0x5ce58b(0x152)](_0xe5b3a9[_0x5ce58b(0xde)],0x0))return null;throw new Error(_0x5ce58b(0x165)+_0xe5b3a9['join'](',\x20')+').\x20'+_0x5ce58b(0x107));}export function adHocProfileName(_0x3db0f4,_0x118b56,_0x11e5e7){if(!_0x118b56||_0x118b56===_0x11e5e7)return _0x3db0f4;return _0x3db0f4+':'+_0x118b56;}export async function resolveAdHocProfile(_0x5e4375={},_0x5f0d52=process['env']){const _0x330f1c=_0x473257,_0x4cce1c={'ZCUgq':function(_0x30fd43,_0xfdebed,_0x28c26b,_0x390408){return _0x30fd43(_0xfdebed,_0x28c26b,_0x390408);},'yvqzr':function(_0x18ecf2,_0x1fa40a){return _0x18ecf2&&_0x1fa40a;},'aRjgT':function(_0x11d64a,_0x118778){return _0x11d64a!==_0x118778;},'pUErh':'none'},_0xe6c888=_0x5f0d52['RANGER_TEST_USERNAME'];if(!_0xe6c888)return null;const _0x693248=await fetchAuthConfig(),_0x27b4e7=pickAdHocEnvKey(_0x693248,_0x5e4375[_0x330f1c(0x155)],_0x5e4375['envKey']);let _0xe9de23=_0x4cce1c['ZCUgq'](adHocProfileName,_0xe6c888,_0x27b4e7,_0x693248?.[_0x330f1c(0x12a)]),_0x2e01f9=await fetchCloudProfile(_0xe9de23);_0x4cce1c[_0x330f1c(0x112)](_0x2e01f9,_0x27b4e7)&&_0x4cce1c[_0x330f1c(0xfb)](_0x2e01f9['environmentKey'],_0x27b4e7)&&(console[_0x330f1c(0xdb)](_0x330f1c(0x115)+_0xe9de23+_0x330f1c(0x108)+(_0x2e01f9[_0x330f1c(0x13e)]??_0x4cce1c['pUErh'])+'\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22'+_0x27b4e7+'\x22;\x20using\x20\x22'+_0xe6c888+':'+_0x27b4e7+'\x22\x20instead.'),_0xe9de23=_0xe6c888+':'+_0x27b4e7,_0x2e01f9=await fetchCloudProfile(_0xe9de23));if(_0x2e01f9)return{'name':_0x2e01f9['name'],'profile':_0x2e01f9};const _0x4e1cee=_0x5f0d52[_0x330f1c(0x119)],_0x24c455=await _0x4cce1c['ZCUgq'](createCloudProfile,_0xe9de23,_0x27b4e7??undefined,{'username':_0xe6c888,'password':_0x4e1cee});return console[_0x330f1c(0xdb)](_0x330f1c(0x157)+_0x24c455[_0x330f1c(0x13d)]+_0x330f1c(0x141)+_0xe6c888+(_0x27b4e7?'\x20(auth\x20env:\x20'+_0x27b4e7+')':'')),{'name':_0x24c455[_0x330f1c(0x13d)],'profile':_0x24c455};}export async function writeSessionToLocalCache(_0xe7531b,_0x26b3bf,_0x171f18,_0x38b81d,_0x17505c,_0x2a9e17,_0x552fe6){const _0x1fc229=_0x473257,_0x52f318={'WhEXY':function(_0xe2d3c7,_0x5a54de){return _0xe2d3c7(_0x5a54de);},'mXhyL':function(_0x361496,_0x1ce11d,_0x3eb9de){return _0x361496(_0x1ce11d,_0x3eb9de);},'MrkWL':function(_0x75621d,_0x47f3b2){return _0x75621d>_0x47f3b2;}},_0x2b4f5c=_0x52f318[_0x1fc229(0x175)](sessionCacheHash,{'orgId':_0x26b3bf,'profileName':_0xe7531b,'effectiveBaseUrl':_0x171f18,'setupHeaders':_0x38b81d,'invalidateOn':_0x552fe6?.['invalidateOn'],'userAgent':_0x552fe6?.['userAgent'],'clientIp':_0x552fe6?.['clientIp']}),_0x2658e9=getSessionCachePath(_0x2b4f5c,_0xe7531b),_0x4a12c4=_0x52f318['mXhyL'](join,getRangerHomeDir(),'auth');!_0x52f318[_0x1fc229(0x175)](existsSync,_0x4a12c4)&&await mkdir(_0x4a12c4,{'recursive':!![]});const _0x4a1e1e={..._0x17505c};_0x2a9e17&&_0x52f318['MrkWL'](_0x2a9e17['length'],0x0)&&Array[_0x1fc229(0x186)](_0x4a1e1e[_0x1fc229(0x17e)])&&(_0x4a1e1e[_0x1fc229(0x17e)]=_0x52f318['mXhyL'](duplicateCookiesForDomains,_0x4a1e1e[_0x1fc229(0x17e)],_0x2a9e17));const _0x28b8a1={'cached_at':new Date()['toISOString'](),'session_state':_0x4a1e1e};await _0x52f318['mXhyL'](writeFile,_0x2658e9,JSON['stringify'](_0x28b8a1,null,0x2));const _0x57c506=getStorageStatePath(_0x2658e9);return await writeFile(_0x57c506,JSON['stringify'](_0x4a1e1e,null,0x2)),_0x57c506;}export async function checkLocalCache(_0xce4c5f,_0x276988,_0x49105e,_0xac4439,_0x1aff3c){const _0x1bb20a=_0x473257,_0x4eac90={'sNLYq':function(_0x35f203,_0x5ebef2,_0x49b542){return _0x35f203(_0x5ebef2,_0x49b542);}},_0x4e55ab=sessionCacheHash({'orgId':_0x276988,'profileName':_0xce4c5f,'effectiveBaseUrl':_0x49105e,'setupHeaders':_0xac4439,'invalidateOn':_0x1aff3c?.['invalidateOn'],'userAgent':_0x1aff3c?.[_0x1bb20a(0x17d)],'clientIp':_0x1aff3c?.[_0x1bb20a(0x15b)]}),_0x56d554=_0x4eac90[_0x1bb20a(0x162)](getSessionCachePath,_0x4e55ab,_0xce4c5f),_0xd3e9a9=getStorageStatePath(_0x56d554);if(!existsSync(_0x56d554)||!existsSync(_0xd3e9a9))return null;try{const _0x27eefb=await _0x4eac90['sNLYq'](readFile,_0x56d554,'utf-8');return JSON[_0x1bb20a(0xf8)](_0x27eefb),{'storageStatePath':_0xd3e9a9};}catch{return null;}}function launchRealBrowser(){const _0x427e70=_0x473257;return chromium[_0x427e70(0x111)]({'headless':!![]});}function emitSessionValidationHint(_0x227d1f,_0x45854e){const _0xfda083=_0x473257,_0x2281bf={'vtBsz':function(_0x5bb7f8,_0x17b787){return _0x5bb7f8===_0x17b787;},'HxbPE':function(_0x18549e,_0x5eb5b8){return _0x18549e+_0x5eb5b8;}};if(!_0x45854e||!_0x45854e['domains']?.['length'])return;let _0x292cc9;try{_0x292cc9=new URL(_0x227d1f);}catch{return;}const _0x908013=[];for(const _0x40c9be of _0x45854e['domains']){try{_0x908013['push']({'raw':_0x40c9be,'url':new URL(_0x40c9be)});}catch{}}if(_0x2281bf['vtBsz'](_0x908013[_0xfda083(0xde)],0x0))return;if(_0x908013[_0xfda083(0x181)](_0x10db1c=>_0x10db1c['url'][_0xfda083(0x166)]===_0x292cc9[_0xfda083(0x166)]))return;const _0x398561=_0x908013[_0xfda083(0xcf)](_0x16dcbf=>'\x22'+_0x16dcbf[_0xfda083(0xdd)]+'\x22')['join'](',\x20');console['log'](_0x2281bf['HxbPE'](_0x2281bf['HxbPE'](_0xfda083(0xf2)+_0x398561+';\x20',_0xfda083(0x149)+_0x227d1f+_0xfda083(0x14c)),_0xfda083(0x176)));}function _0x4cd6(_0x555f65,_0x133d35){_0x555f65=_0x555f65-0xce;const _0x2a923f=_0x2a92();let _0x4cd64f=_0x2a923f[_0x555f65];return _0x4cd64f;}export async function serverSideLogin(_0x203dc7,_0x9e66aa){const _0x3abe0c=_0x473257,_0x36b29c={'yIIsf':function(_0x54ae72,_0x793900,_0x2c1b4a){return _0x54ae72(_0x793900,_0x2c1b4a);},'VKVxD':function(_0x4277d4,_0x3b83c0){return _0x4277d4(_0x3b83c0);},'XcGov':'POST','SuPey':function(_0x1c3a73,_0x174017){return _0x1c3a73 instanceof _0x174017;},'AvrcP':function(_0x1d2a8a,_0x153b65){return _0x1d2a8a===_0x153b65;}},_0xd874b3=process['env']['RANGER_TEST_USERNAME'],_0x55e2fe=process[_0x3abe0c(0x179)][_0x3abe0c(0x119)],_0x4861f1={};if(_0xd874b3)_0x4861f1['username']=_0xd874b3;if(_0x55e2fe)_0x4861f1['password']=_0x55e2fe;if(_0x9e66aa?.[_0x3abe0c(0x128)])_0x4861f1[_0x3abe0c(0x128)]=!![];if(_0x9e66aa?.['targetUrl'])_0x4861f1[_0x3abe0c(0xec)]=_0x9e66aa['targetUrl'];if(_0x9e66aa?.['env'])_0x4861f1[_0x3abe0c(0x179)]=_0x9e66aa[_0x3abe0c(0x179)];_0x9e66aa?.[_0x3abe0c(0x117)]&&(_0x4861f1[_0x3abe0c(0x156)]=_0x9e66aa[_0x3abe0c(0x117)]['sessionId'],_0x4861f1[_0x3abe0c(0x104)]=_0x9e66aa['tunnel'][_0x3abe0c(0x137)]);try{return await _0x36b29c['yIIsf'](apiRequest,'/api/v1/profiles/'+_0x36b29c[_0x3abe0c(0x120)](encodeURIComponent,_0x203dc7)+'/login',{'method':_0x36b29c['XcGov'],'body':JSON[_0x3abe0c(0x16c)](_0x4861f1)});}catch(_0x43d31d){if(_0x36b29c[_0x3abe0c(0x148)](_0x43d31d,ApiError)&&_0x36b29c[_0x3abe0c(0xce)](_0x43d31d[_0x3abe0c(0x101)],0x190)&&_0x43d31d[_0x3abe0c(0x11c)]===_0x3abe0c(0x10a))return{'status':'not_configured','error':_0x43d31d[_0x3abe0c(0x13a)]};throw _0x43d31d;}}async function serverSideLoginWithOptionalTunnel(_0x36336b,_0x288403,_0x4af198={}){const _0x15878a=_0x473257,_0x32df1={'UNstX':function(_0x2abcf4,_0x2e1adf){return _0x2abcf4(_0x2e1adf);},'WKECN':function(_0x46a5d9,_0x51a2b4){return _0x46a5d9(_0x51a2b4);},'TLUDX':function(_0x3581f6,_0x163304){return _0x3581f6===_0x163304;},'GwGBG':_0x15878a(0x183),'cnoyL':function(_0x25ac71){return _0x25ac71();},'gNocX':function(_0x170139,_0x5d1433){return _0x170139(_0x5d1433);},'IRJue':'tunnel_login_request','VGell':function(_0x41913a,_0x2684ee){return _0x41913a??_0x2684ee;},'uYtyG':function(_0x35e219,_0xaaf27a){return _0x35e219||_0xaaf27a;},'yIQlN':function(_0x25bbf3,_0x2c2775){return _0x25bbf3(_0x2c2775);},'nCeOi':'tunnel_login_cleanup'};if(!_0x32df1['WKECN'](needsTunnel,_0x288403))return await serverSideLogin(_0x36336b,{'force':_0x4af198['force'],'env':_0x4af198['env']});let _0x239ef1=null,_0x537ffc=null,_0x18ebe2=null,_0x65cd2c=null,_0x33ed22=![];const _0xe8514c=process[_0x15878a(0x179)]['RANGER_TUNNEL_LOGIN_HEADED']?.['toLowerCase'](),_0x5ba156=_0xe8514c==='1'||_0x32df1[_0x15878a(0x11f)](_0xe8514c,_0x15878a(0x184)),_0x2ee3bc={'profileName':_0x36336b,'targetUrlHost':targetHostForTelemetry(_0x288403),'tunnelRequired':!![],'forceLogin':_0x32df1['WKECN'](Boolean,_0x4af198['force']),'localBrowserServerHeaded':_0x5ba156};try{_0x4af198[_0x15878a(0x114)]?.['trackPhaseStart'](_0x32df1[_0x15878a(0x131)],_0x2ee3bc);_0x5ba156&&console[_0x15878a(0xdb)]('\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...');_0x239ef1=await launchBrowserServer({'headless':!_0x5ba156}),_0x537ffc=await createTunnelSession(_0x288403);const _0x1d8913=await _0x32df1['cnoyL'](requireToken);_0x18ebe2=await _0x32df1[_0x15878a(0x12b)](createTunnelBridge,{'localWsUrl':_0x239ef1['wsEndpoint'],'tunnelServerUrl':_0x537ffc[_0x15878a(0x167)],'sessionId':_0x537ffc['sessionId'],'apiKey':_0x1d8913,'onError':_0x407c58=>{_0x65cd2c=_0x407c58;},'onClose':()=>{const _0x1677f7=_0x15878a;_0x65cd2c??=new Error(_0x1677f7(0x15d)+_0x36336b);},'onEvent':_0x49b69e=>trackBridgeEvent(_0x4af198[_0x15878a(0x114)],_0x49b69e)}),_0x4af198[_0x15878a(0x114)]?.[_0x15878a(0x10d)](_0x32df1[_0x15878a(0x131)],{..._0x2ee3bc,'tunnelSessionId':_0x537ffc[_0x15878a(0xd8)],'localBrowserServer':!![],'localBrowserServerHeaded':_0x5ba156}),_0x33ed22=!![];try{return _0x4af198[_0x15878a(0x114)]?.['trackPhaseStart'](_0x32df1[_0x15878a(0x134)],{..._0x2ee3bc,'tunnelSessionId':_0x537ffc['sessionId']}),await serverSideLogin(_0x36336b,{'force':_0x4af198[_0x15878a(0x128)],'targetUrl':_0x288403,'env':_0x4af198[_0x15878a(0x179)],'tunnel':{'sessionId':_0x537ffc[_0x15878a(0xd8)],'pwEndpoint':_0x537ffc['pwEndpoint']}})['then'](_0x4890b3=>{const _0x50ec9a=_0x15878a;return _0x4af198['telemetry']?.['trackPhaseEnd']('tunnel_login_request',{..._0x2ee3bc,'tunnelSessionId':_0x537ffc?.[_0x50ec9a(0xd8)],'loginStatus':_0x4890b3[_0x50ec9a(0x101)],'hasSessionState':_0x32df1[_0x50ec9a(0x106)](Boolean,_0x4890b3['session_state']),'hasTestOutput':_0x32df1[_0x50ec9a(0x106)](Boolean,_0x4890b3['test_output']),'bridgeError':_0x32df1[_0x50ec9a(0x106)](errorMessageForTelemetry,_0x65cd2c)}),_0x4890b3;});}catch(_0x5bbfce){await _0x4af198['telemetry']?.[_0x15878a(0x127)](_0x32df1[_0x15878a(0x134)],_0x32df1['VGell'](_0x65cd2c,_0x5bbfce),{..._0x2ee3bc,'tunnelSessionId':_0x537ffc[_0x15878a(0xd8)],'bridgeError':_0x32df1['WKECN'](errorMessageForTelemetry,_0x65cd2c)});throw _0x32df1['VGell'](_0x65cd2c,_0x5bbfce);}}catch(_0x19573c){!_0x33ed22&&await _0x4af198[_0x15878a(0x114)]?.['trackPhaseError'](_0x32df1[_0x15878a(0x131)],_0x19573c,{..._0x2ee3bc,'tunnelSessionId':_0x537ffc?.['sessionId']});throw _0x19573c;}finally{(_0x32df1[_0x15878a(0x11a)](_0x537ffc,_0x239ef1)||_0x18ebe2)&&(_0x4af198['telemetry']?.['trackPhaseStart'](_0x15878a(0x10b),{..._0x2ee3bc,'tunnelSessionId':_0x537ffc?.['sessionId']}),_0x18ebe2?.['close'](),_0x239ef1&&await _0x239ef1['close']()[_0x15878a(0x11d)](()=>{}),_0x537ffc&&await _0x32df1[_0x15878a(0x139)](deleteTunnelSession,_0x537ffc[_0x15878a(0xd8)])['catch'](()=>{}),_0x4af198[_0x15878a(0x114)]?.[_0x15878a(0x10d)](_0x32df1[_0x15878a(0xfe)],{..._0x2ee3bc,'tunnelSessionId':_0x537ffc?.['sessionId']}));}}export async function manualBrowserLogin(_0x36e412,_0x4cd4a6,_0x30424b={}){const _0x31fc64=_0x473257,_0x247f1b={'Klhsw':function(_0x18baff,_0xa57e91){return _0x18baff/_0xa57e91;},'ZTXUR':function(_0x284501){return _0x284501();},'jFaNs':function(_0x295a4c,_0x24e3be,_0xbe70a1){return _0x295a4c(_0x24e3be,_0xbe70a1);},'PIMcM':function(_0x3f5414){return _0x3f5414();},'HPCym':function(_0x1ab578,_0x587b7a){return _0x1ab578+_0x587b7a;},'ROTwh':function(_0x164922,_0x3a9c12){return _0x164922>_0x3a9c12;},'vhBgX':'about:blank','AxGUA':_0x31fc64(0x109),'FKzJV':function(_0x4ef526,_0x49877e){return _0x4ef526(_0x49877e);},'XHTrX':'Browser\x20login\x20timed\x20out\x20before\x20completion.','jazYG':function(_0x59a833,_0x5022d0){return _0x59a833(_0x5022d0);},'VyWNa':'cli:manual-login'};if(!_0x247f1b['PIMcM'](isInteractive))throw new Error(_0x247f1b[_0x31fc64(0xef)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x36e412['name']+_0x31fc64(0x189)+'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20',_0x31fc64(0x161)));const _0x599946=_0x4cd4a6&&_0x247f1b[_0x31fc64(0x14d)](_0x4cd4a6['domains']['length'],0x0)?_0x4cd4a6['domains'][0x0]:_0x247f1b[_0x31fc64(0xe4)];console[_0x31fc64(0xdb)]('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console['log'](_0x247f1b[_0x31fc64(0xf1)]),await new Promise(_0x457fcf=>setTimeout(_0x457fcf,0x7d0));const _0x516d5a=await chromium[_0x31fc64(0x111)]({'headless':![]});let _0x454edf=null;try{const _0x38fdf3={'ignoreHTTPSErrors':!![]};_0x4cd4a6?.['setupHeaders']&&(_0x38fdf3[_0x31fc64(0xd9)]=_0x4cd4a6[_0x31fc64(0x10f)]);const _0x14e5c5=await _0x516d5a[_0x31fc64(0xfd)](_0x38fdf3);await _0x247f1b['FKzJV'](addProfileSetupBanner,_0x14e5c5);const _0xcf694b=await _0x14e5c5[_0x31fc64(0x122)]();await _0xcf694b[_0x31fc64(0x15a)](_0x599946);let _0xa64fc7=![];await new Promise(_0x4d5108=>{const _0xb34fd4=_0x31fc64,_0x274811={'jKoQb':function(_0x4a3276,_0x57e778){return _0x247f1b['Klhsw'](_0x4a3276,_0x57e778);},'rPLuj':function(_0x1d0068){return _0x247f1b['ZTXUR'](_0x1d0068);}},_0x3ef09b=_0x247f1b[_0xb34fd4(0x13b)](setTimeout,()=>{const _0x28f444=_0xb34fd4;_0xa64fc7=!![],console[_0x28f444(0xf4)]('Browser\x20login\x20timed\x20out\x20after\x20'+_0x274811[_0x28f444(0x132)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x274811[_0x28f444(0x146)](_0x4d5108);},MANUAL_LOGIN_TIMEOUT_MS);_0xcf694b['on'](_0xb34fd4(0x15e),async()=>{const _0x1c9b48=_0xb34fd4;clearTimeout(_0x3ef09b);try{const _0x50fc9d=await _0x14e5c5[_0x1c9b48(0x17a)]();_0x454edf=_0x50fc9d;}catch{}_0x4d5108();});});if(_0xa64fc7&&!_0x454edf)throw new Error(_0x247f1b['XHTrX']);}finally{await _0x516d5a[_0x31fc64(0x15e)]()['catch'](()=>{});}if(!_0x454edf)throw new Error(_0x31fc64(0x154));return _0x30424b['persistSessionState']!==![]&&await _0x247f1b['jFaNs'](apiRequest,_0x31fc64(0x144)+_0x247f1b[_0x31fc64(0xe8)](encodeURIComponent,_0x36e412['name'])+'/session',{'method':_0x31fc64(0x16a),'body':JSON[_0x31fc64(0x16c)]({'session_state':_0x454edf,'updated_by':_0x247f1b['VyWNa']})}),{'sessionState':_0x454edf};}export async function promptSaveCredentials(_0x14f1f7){const _0x582959=_0x473257,_0x3f9f6a={'ALKPM':function(_0x27c42f,_0x191051){return _0x27c42f||_0x191051;},'daQzH':'confirm','KSHYl':_0x582959(0x11e),'mdwJk':function(_0x52a96f,_0x455c2b,_0x3aa343){return _0x52a96f(_0x455c2b,_0x3aa343);},'mRVoC':function(_0x49d919,_0x212240){return _0x49d919(_0x212240);},'ZjiIH':'\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.'},_0xd50d2d=process[_0x582959(0x179)]['RANGER_TEST_USERNAME'],_0x19b001=process['env']['RANGER_TEST_PASSWORD'];if(_0x3f9f6a[_0x582959(0x18a)](!_0xd50d2d,!_0x19b001))return;if(!isInteractive())return;const {save:_0x2166d6}=await _0x2ef7c3[_0x582959(0xd2)]([{'type':_0x3f9f6a[_0x582959(0x14b)],'name':_0x3f9f6a['KSHYl'],'message':_0x582959(0xe0),'default':![]}]);if(!_0x2166d6)return;await _0x3f9f6a[_0x582959(0x121)](apiRequest,'/api/v1/profiles/'+_0x3f9f6a['mRVoC'](encodeURIComponent,_0x14f1f7),{'method':'PUT','body':JSON[_0x582959(0x16c)]({'username':_0xd50d2d,'password':_0x19b001})}),console[_0x582959(0xdb)](_0x3f9f6a['ZjiIH']);}export async function resolveCloudProfileSession(_0x403c04,_0x1efe6e={}){const _0x4d4d9a=_0x473257,_0x2317d4={'dZAQO':function(_0x3bc311){return _0x3bc311();},'GuxjO':function(_0xf2799c,_0x47f6e1){return _0xf2799c===_0x47f6e1;},'rxazj':_0x4d4d9a(0xf3),'mCwUW':function(_0x5787ee,_0xcb2874){return _0x5787ee||_0xcb2874;},'uzaUh':function(_0x14283f,_0x223d27){return _0x14283f(_0x223d27);},'xjtrG':function(_0x404eef,_0x4523aa,_0x4de92a,_0x595e18,_0x14aa96){return _0x404eef(_0x4523aa,_0x4de92a,_0x595e18,_0x14aa96);},'VsaZh':function(_0x502765,_0x4d7d2e,_0x3fb993){return _0x502765(_0x4d7d2e,_0x3fb993);},'duxAQ':function(_0x140cbd,_0x302b57,_0x11a206,_0x3f928f,_0x2fb1ca,_0x3c6478,_0x3b86a5,_0x16649a){return _0x140cbd(_0x302b57,_0x11a206,_0x3f928f,_0x2fb1ca,_0x3c6478,_0x3b86a5,_0x16649a);},'SzMmb':_0x4d4d9a(0x178),'CQrRK':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','cvuKe':function(_0x5230c2,_0x37a86a){return _0x5230c2(_0x37a86a);},'gwjGi':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','eAOnk':function(_0x3d6425,_0x5410dd){return _0x3d6425+_0x5410dd;},'kaSVq':function(_0x40cce1,_0x13f4ac,_0x13486b,_0x2cde7a){return _0x40cce1(_0x13f4ac,_0x13486b,_0x2cde7a);}},_0x27cc15=_0x403c04['settings']??{},_0x762058=await _0x2317d4['dZAQO'](fetchAuthConfig),_0x4f6f3a=_0x762058?resolveAuthEnvironmentLocally(_0x762058,_0x1efe6e['assertedEnv']??_0x403c04[_0x4d4d9a(0x13e)]):null,_0x2382b0=_0x2317d4[_0x4d4d9a(0x135)](typeof _0x4f6f3a?.['loginInstructions'],_0x2317d4['rxazj'])&&_0x4f6f3a[_0x4d4d9a(0x116)]['trim']()?_0x4f6f3a['loginInstructions']:undefined,_0xa86ad0=typeof _0x27cc15[_0x4d4d9a(0x116)]===_0x2317d4['rxazj']&&_0x27cc15[_0x4d4d9a(0x116)]['trim']()?_0x27cc15[_0x4d4d9a(0x116)]:undefined,_0x582665=_0x2317d4[_0x4d4d9a(0xd4)](_0xa86ad0,!_0x2382b0)?_0x27cc15:{..._0x27cc15,'loginInstructions':_0x2382b0},_0xb56211=_0x2317d4[_0x4d4d9a(0x188)](Boolean,_0x582665['loginInstructions']?.[_0x4d4d9a(0x17c)]()),_0x4d168d=Boolean(_0x27cc15[_0x4d4d9a(0x143)]||_0x4f6f3a?.[_0x4d4d9a(0x143)]),_0x45736b=_0x4f6f3a?.[_0x4d4d9a(0xd0)],_0x24a709=_0x27cc15[_0x4d4d9a(0x10f)],_0x49bee9=_0x24a709??_0x4f6f3a?.['setupHeaders'],_0x489415=_0x1efe6e[_0x4d4d9a(0x140)]??_0x27cc15['baseUrl']??(_0x45736b&&_0x45736b[_0x4d4d9a(0xde)]>0x0?_0x45736b[0x0]:''),_0x44dbb8=_0x489415?needsTunnel(_0x489415):![],_0x293e3f={'invalidateOn':_0x4f6f3a?.[_0x4d4d9a(0xea)],'userAgent':_0x4f6f3a?.['browserOptions']?.['userAgent']??_0x27cc15['userAgent']};_0x4d168d&&console[_0x4d4d9a(0xdb)]('\x20\x20forceLogin\x20enabled\x20for\x20\x22'+_0x403c04[_0x4d4d9a(0x13d)]+_0x4d4d9a(0x12f));if(!_0x4d168d){const _0x2e2deb=await checkLocalCache(_0x403c04['name'],_0x403c04[_0x4d4d9a(0x180)],_0x489415,_0x49bee9,_0x293e3f);if(_0x2e2deb){if(_0x489415&&!_0x44dbb8){const _0x501b9f=await _0x2317d4['xjtrG'](isCachedSessionLive,_0x2e2deb['storageStatePath'],_0x489415,{'sessionCheckPath':_0x4f6f3a?.[_0x4d4d9a(0x153)],'setupHeaders':_0x49bee9},{'launchBrowser':launchRealBrowser});if(_0x501b9f)return console[_0x4d4d9a(0xdb)](_0x4d4d9a(0x17f)+_0x403c04['name']+'\x22'),{'authPath':_0x2e2deb['storageStatePath'],'settings':_0x582665,'resolvedEnv':_0x4f6f3a};console['log'](_0x4d4d9a(0x147)+_0x403c04[_0x4d4d9a(0x13d)]+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x2317d4['VsaZh'](emitSessionValidationHint,_0x489415,_0x4f6f3a);}else return _0x44dbb8&&console[_0x4d4d9a(0xdb)](_0x4d4d9a(0x12e)+_0x403c04['name']+'\x22'),{'authPath':_0x2e2deb['storageStatePath'],'settings':_0x582665,'resolvedEnv':_0x4f6f3a};}}if(!_0x4d168d&&_0x403c04[_0x4d4d9a(0x15f)]){const _0x588b75=await _0x2317d4[_0x4d4d9a(0xd3)](writeSessionToLocalCache,_0x403c04['name'],_0x403c04['organizationId'],_0x489415,_0x49bee9,_0x403c04['sessionState'],_0x45736b,_0x293e3f);if(_0x489415){const _0x52545d=await _0x2317d4['xjtrG'](isCachedSessionLive,_0x588b75,_0x489415,{'sessionCheckPath':_0x4f6f3a?.[_0x4d4d9a(0x153)],'setupHeaders':_0x49bee9},{'launchBrowser':launchRealBrowser});if(_0x52545d)return console['log'](_0x4d4d9a(0x10e)+_0x403c04[_0x4d4d9a(0x13d)]+_0x4d4d9a(0xf5)),{'authPath':_0x588b75,'settings':_0x582665,'resolvedEnv':_0x4f6f3a};console[_0x4d4d9a(0xdb)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x403c04['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),emitSessionValidationHint(_0x489415,_0x4f6f3a);}else return{'authPath':_0x588b75,'settings':_0x582665,'resolvedEnv':_0x4f6f3a};}if(_0xb56211)return console[_0x4d4d9a(0xdb)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x403c04['name']+_0x4d4d9a(0x14a)),{'authPath':undefined,'settings':_0x582665,'resolvedEnv':_0x4f6f3a};console[_0x4d4d9a(0xdb)](_0x4d4d9a(0xd7)+_0x403c04[_0x4d4d9a(0x13d)]+'\x22,\x20attempting\x20login...');const _0x264846=Boolean(process['env']['RANGER_TEST_USERNAME'])&&_0x2317d4['uzaUh'](Boolean,process['env'][_0x4d4d9a(0x119)]),_0x136ad7=_0x2317d4['uzaUh'](Boolean,_0x403c04['username']),_0x20d491=_0x2317d4[_0x4d4d9a(0x188)](Boolean,_0x1efe6e['assertedEnv']),_0x346a3a=_0x489415?_0x2317d4[_0x4d4d9a(0x188)](isBareLocalhost,_0x489415):![],_0x23c2e8=(_0x264846||_0x136ad7)&&(!_0x346a3a||_0x20d491);if(_0x23c2e8)try{const _0x256156=_0x489415?await serverSideLoginWithOptionalTunnel(_0x403c04['name'],_0x489415,{'force':_0x4d168d,'telemetry':_0x1efe6e['telemetry'],'env':_0x1efe6e['assertedEnv']}):await _0x2317d4['VsaZh'](serverSideLogin,_0x403c04[_0x4d4d9a(0x13d)],{'force':_0x4d168d,'env':_0x1efe6e[_0x4d4d9a(0xf7)]});if(_0x2317d4[_0x4d4d9a(0x135)](_0x256156['status'],'not_configured'))console[_0x4d4d9a(0xdb)](_0x2317d4['SzMmb']);else{if(_0x2317d4['GuxjO'](_0x256156[_0x4d4d9a(0x101)],_0x4d4d9a(0xe5))&&_0x256156[_0x4d4d9a(0x17b)]){console[_0x4d4d9a(0xdb)](_0x4d4d9a(0x142));const _0x27d142=await writeSessionToLocalCache(_0x403c04[_0x4d4d9a(0x13d)],_0x403c04['organizationId'],_0x489415,_0x49bee9,_0x256156[_0x4d4d9a(0x17b)],_0x45736b,_0x293e3f);return _0x264846&&!_0x136ad7&&await _0x2317d4['uzaUh'](promptSaveCredentials,_0x403c04[_0x4d4d9a(0x13d)]),{'authPath':_0x27d142,'settings':_0x582665,'resolvedEnv':_0x4f6f3a};}else _0x256156['test_output']&&(console['log'](_0x2317d4[_0x4d4d9a(0xf0)]),console['log'](_0x256156['test_output'])),console['log'](_0x4d4d9a(0x182));}}catch(_0x303687){console[_0x4d4d9a(0xdb)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x303687 instanceof Error?_0x303687['message']:_0x2317d4[_0x4d4d9a(0x187)](String,_0x303687))),console['log'](_0x2317d4[_0x4d4d9a(0x16b)]);}if(_0x346a3a&&!_0x20d491&&!isInteractive())throw new Error(_0x2317d4['eAOnk'](_0x4d4d9a(0x164)+_0x489415+_0x4d4d9a(0x14f)+_0x403c04[_0x4d4d9a(0x13d)]+_0x4d4d9a(0x110)+(_0x4d4d9a(0x16f)+_0x403c04[_0x4d4d9a(0x13d)]+'\x20--url\x20'+_0x489415+'\x0a'),'\x20\x20•\x20or\x20pass\x20--env\x20<key>\x20to\x20run\x20an\x20automated\x20login\x20for\x20this\x20target.'));const _0xa15514=_0x4f6f3a?{..._0x4f6f3a,'domains':orderLoginDomains(_0x489415,_0x4f6f3a[_0x4d4d9a(0xd0)]),'setupHeaders':_0x49bee9}:_0x489415?{'key':_0x403c04['environmentKey']??'','domains':[_0x489415],'setupHeaders':_0x49bee9}:null,{sessionState:_0x36d073}=await _0x2317d4['kaSVq'](manualBrowserLogin,_0x403c04,_0xa15514,{'persistSessionState':!_0x44dbb8}),_0x4f1c51=await writeSessionToLocalCache(_0x403c04['name'],_0x403c04['organizationId'],_0x489415,_0x49bee9,_0x36d073,_0x45736b,_0x293e3f);return{'authPath':_0x4f1c51,'settings':_0x582665,'resolvedEnv':_0x4f6f3a};}
@@ -1 +1 @@
1
- const _0x396108=_0x469d;(function(_0x310cc8,_0x4391db){const _0x792bba=_0x469d,_0x482732=_0x310cc8();while(!![]){try{const _0x252692=parseInt(_0x792bba(0x131))/0x1*(parseInt(_0x792bba(0x141))/0x2)+parseInt(_0x792bba(0x14f))/0x3+parseInt(_0x792bba(0x12d))/0x4+-parseInt(_0x792bba(0x14c))/0x5+parseInt(_0x792bba(0x155))/0x6*(parseInt(_0x792bba(0x12c))/0x7)+parseInt(_0x792bba(0x135))/0x8*(parseInt(_0x792bba(0x12b))/0x9)+-parseInt(_0x792bba(0x139))/0xa;if(_0x252692===_0x4391db)break;else _0x482732['push'](_0x482732['shift']());}catch(_0x229a3b){_0x482732['push'](_0x482732['shift']());}}}(_0x2af9,0x917e1));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x1e9992=process[_0x396108(0x13b)],_0x51c517={'stdin':process['stdin'],'stdout':process[_0x396108(0x134)]}){const _0x49307f=_0x396108,_0x1b3b13={'ftNyw':function(_0x8db514,_0x52d240){return _0x8db514(_0x52d240);}};if(_0x1e9992['CI'])return![];return Boolean(_0x51c517[_0x49307f(0x13a)]['isTTY'])&&_0x1b3b13[_0x49307f(0x142)](Boolean,_0x51c517['stdout']['isTTY']);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x276d67){const _0x29ef0d=_0x396108,_0xfc0cc6={'Sfgzh':function(_0x30068e,_0xe7ed5c){return _0x30068e(_0xe7ed5c);},'qXLKb':'baseUrl','SAflx':'userAgent','DWPDu':function(_0x1ae11c,_0x233e2d){return _0x1ae11c!==_0x233e2d;}},_0x32d139=new Set(_0x276d67['invalidateOn']??DEFAULT_INVALIDATE_ON);_0x276d67[_0x29ef0d(0x12e)]&&_0xfc0cc6['Sfgzh'](needsTunnel,_0x276d67[_0x29ef0d(0x12e)])&&_0x32d139['add'](_0xfc0cc6['qXLKb']);const _0x3a9ce9={'orgId':_0x276d67[_0x29ef0d(0x14e)],'profileName':_0x276d67[_0x29ef0d(0x13c)]};return _0x32d139[_0x29ef0d(0x15e)](_0x29ef0d(0x151))&&(_0x3a9ce9[_0x29ef0d(0x12e)]=_0x276d67[_0x29ef0d(0x12e)]),_0x32d139[_0x29ef0d(0x15e)](_0x29ef0d(0x149))&&(_0x3a9ce9[_0x29ef0d(0x149)]=_0x276d67['setupHeaders']?sortObjectKeys(_0x276d67[_0x29ef0d(0x149)]):_0x276d67['setupHeaders']),_0x32d139[_0x29ef0d(0x15e)](_0x29ef0d(0x15c))&&(_0x3a9ce9[_0x29ef0d(0x15c)]=extractPort(_0x276d67['effectiveBaseUrl'])),_0x32d139['has'](_0xfc0cc6['SAflx'])&&_0xfc0cc6[_0x29ef0d(0x14b)](_0x276d67['userAgent'],undefined)&&(_0x3a9ce9['userAgent']=_0x276d67[_0x29ef0d(0x144)]),_0x32d139['has']('clientIp')&&_0x276d67[_0x29ef0d(0x148)]!==undefined&&(_0x3a9ce9[_0x29ef0d(0x148)]=_0x276d67[_0x29ef0d(0x148)]),_0xfc0cc6[_0x29ef0d(0x154)](createHash,'sha256')['update'](JSON[_0x29ef0d(0x13f)](_0x3a9ce9))[_0x29ef0d(0x157)](_0x29ef0d(0x162))[_0x29ef0d(0x152)](0x0,0xc);}function extractPort(_0x32aa30){const _0x27f4fe=_0x396108;try{return new URL(_0x32aa30)[_0x27f4fe(0x15c)];}catch{return'';}}function sortObjectKeys(_0x11a8c6){const _0x5656ca={};for(const _0x2f8bc8 of Object['keys'](_0x11a8c6)['sort']()){_0x5656ca[_0x2f8bc8]=_0x11a8c6[_0x2f8bc8];}return _0x5656ca;}export function getSessionCachePath(_0x29d976,_0x2bb4be){const _0x50daf7=_0x396108,_0x3791ea={'kbHoS':function(_0x182f76,_0x49d28f,_0x10d182,_0x50035b){return _0x182f76(_0x49d28f,_0x10d182,_0x50035b);}};return _0x3791ea[_0x50daf7(0x146)](join,getRangerHomeDir(),_0x50daf7(0x150),_0x29d976+'-'+_0x2bb4be+_0x50daf7(0x14d));}export function getStorageStatePath(_0x3da326){const _0x3e73c4=_0x396108;return _0x3da326['replace'](/\.json$/,_0x3e73c4(0x158));}export function needsTunnel(_0x1a5bd6){const _0x1e6d9b=_0x396108,_0x452b08={'IZwHt':function(_0x298c75,_0x5dc0d1){return _0x298c75===_0x5dc0d1;},'vFvvs':function(_0x4c0837,_0x42a0a7){return _0x4c0837===_0x42a0a7;},'bcxZR':'127.0.0.1','vyTgS':'localhost.'};let _0x675a7e;try{_0x675a7e=new URL(_0x1a5bd6)['hostname'];}catch{return![];}if(_0x452b08[_0x1e6d9b(0x13d)](_0x675a7e,_0x1e6d9b(0x15d))||_0x452b08[_0x1e6d9b(0x130)](_0x675a7e,_0x452b08['bcxZR']))return!![];if(_0x675a7e['endsWith'](_0x1e6d9b(0x15f)))return!![];if(_0x675a7e[_0x1e6d9b(0x138)](_0x452b08['vyTgS']))return!![];return![];}function _0x469d(_0x54a31a,_0x102bee){_0x54a31a=_0x54a31a-0x12b;const _0x2af983=_0x2af9();let _0x469d2a=_0x2af983[_0x54a31a];return _0x469d2a;}export function isBareLocalhost(_0x2e0d97){const _0x2e9daf=_0x396108,_0x27f108={'fEXeE':function(_0xd8e98,_0x46b03a){return _0xd8e98===_0x46b03a;},'nFAJH':'::1'};let _0x42a744;try{_0x42a744=new URL(_0x2e0d97)[_0x2e9daf(0x160)];}catch{return![];}return _0x27f108['fEXeE'](_0x42a744,'localhost')||_0x27f108['fEXeE'](_0x42a744,'127.0.0.1')||_0x42a744===_0x27f108[_0x2e9daf(0x156)]||_0x42a744==='[::1]';}export function orderLoginDomains(_0x3f8774,_0x10c9b3){const _0x3787b7=_0x396108,_0x31c3ba=_0x10c9b3??[];if(!_0x3f8774)return _0x31c3ba;return[_0x3f8774,..._0x31c3ba[_0x3787b7(0x161)](_0x68f331=>_0x68f331!==_0x3f8774)];}export function hostnameOf(_0x12c37d){const _0x50ef98=_0x396108;return new URL(_0x12c37d)[_0x50ef98(0x160)];}export function duplicateCookiesForDomains(_0x50a976,_0x2113da){const _0x2f1b5b=_0x396108,_0xc24e13=[..._0x50a976],_0x591e39=new Set(_0x50a976[_0x2f1b5b(0x12f)](_0x48c623=>_0x48c623['domain']));for(const _0x566eed of _0x2113da){let _0x62b195;try{_0x62b195=hostnameOf(_0x566eed);}catch{continue;}if(!_0x62b195)continue;const _0x208b73=_0x62b195['startsWith']('.')?_0x62b195:'.'+_0x62b195;if(_0x591e39['has'](_0x62b195)||_0x591e39['has'](_0x208b73))continue;for(const _0x186fd2 of _0x50a976){_0xc24e13['push']({..._0x186fd2,'domain':_0x208b73});}_0x591e39[_0x2f1b5b(0x14a)](_0x208b73);}return _0xc24e13;}export function resolveAuthEnvironmentLocally(_0x1cf939,_0x443740){const _0x166cfb=_0x396108,_0x3222ff=_0x1cf939['environments'];if(_0x443740){const _0x7126ce=_0x3222ff[_0x443740];if(!_0x7126ce)return null;return{'key':_0x443740,..._0x7126ce};}if(_0x1cf939['defaultEnvironmentKey']){const _0x57151d=_0x3222ff[_0x1cf939['defaultEnvironmentKey']];if(!_0x57151d)return null;return{'key':_0x1cf939['defaultEnvironmentKey'],..._0x57151d};}const _0x5d940a=Object[_0x166cfb(0x140)](_0x3222ff);if(_0x5d940a[_0x166cfb(0x15a)]===0x1){const _0x5c995b=_0x5d940a[0x0];return{'key':_0x5c995b,..._0x3222ff[_0x5c995b]};}return null;}function _0x2af9(){const _0x27d572=['digest','.storageState.json','peUbG','length','url','port','localhost','has','.localhost','hostname','filter','hex','9SbAcvc','1906338cmCBuL','2754232veVHGY','effectiveBaseUrl','map','vFvvs','1JILVnR','hEQYu','newContext','stdout','5573432AeuLUs','launchBrowser','newPage','includes','11489720qlZpFu','stdin','env','profileName','IZwHt','domcontentloaded','stringify','keys','304176MXtYsA','ftNyw','goto','userAgent','toString','kbHoS','pathname','clientIp','setupHeaders','add','DWPDu','2601770mxKcZl','.json','orgId','549810sGvAzP','auth','baseUrl','slice','test','Sfgzh','12RkZGhe','nFAJH'];_0x2af9=function(){return _0x27d572;};return _0x2af9();}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x419915,_0x556f22){const _0x169f6f=_0x396108;try{if(_0x556f22)return new URL(_0x556f22,_0x419915)[_0x169f6f(0x145)]();return new URL(_0x419915)[_0x169f6f(0x145)]();}catch{return null;}}export function looksLikeLoginUrl(_0x35a2da){const _0x18b290=_0x396108;try{const _0x18184e=new URL(_0x35a2da);return LOGIN_URL_PATTERN['test'](_0x18184e[_0x18b290(0x147)]);}catch{return LOGIN_URL_PATTERN[_0x18b290(0x153)](_0x35a2da);}}export async function isCachedSessionLive(_0x413f90,_0x164362,_0x183401={},_0x25e8d1={}){const _0x21ac2a=_0x396108,_0x33d5e3={'hEQYu':_0x21ac2a(0x13e),'ytDdw':function(_0x174307,_0x4260c4){return _0x174307===_0x4260c4;},'peUbG':function(_0x3b3275,_0x5adc3c){return _0x3b3275(_0x5adc3c);}},_0x40cbd7=buildSessionCheckUrl(_0x164362,_0x183401['sessionCheckPath']);if(!_0x40cbd7)return!![];if(!_0x25e8d1['launchBrowser'])return!![];let _0xef9428=null;try{_0xef9428=await _0x25e8d1[_0x21ac2a(0x136)]();const _0x4c9325=await _0xef9428[_0x21ac2a(0x133)]({'storageState':_0x413f90,'ignoreHTTPSErrors':!![],..._0x183401['setupHeaders']?{'extraHTTPHeaders':_0x183401[_0x21ac2a(0x149)]}:{}}),_0x2b5afd=await _0x4c9325[_0x21ac2a(0x137)](),_0x43c13e=await _0x2b5afd[_0x21ac2a(0x143)](_0x40cbd7,{'waitUntil':_0x33d5e3[_0x21ac2a(0x132)],'timeout':0x3a98}),_0x9272a=_0x43c13e?.['status']();if(_0x9272a===0x191||_0x33d5e3['ytDdw'](_0x9272a,0x193))return![];const _0x466c04=_0x2b5afd[_0x21ac2a(0x15b)]();if(_0x33d5e3[_0x21ac2a(0x159)](looksLikeLoginUrl,_0x466c04))return![];return!![];}catch{return![];}finally{if(_0xef9428)await _0xef9428['close']()['catch'](()=>{});}}
1
+ const _0x456319=_0x501c;function _0x501c(_0x54035f,_0x15d13d){_0x54035f=_0x54035f-0x8b;const _0x4816ed=_0x4816();let _0x501ca9=_0x4816ed[_0x54035f];return _0x501ca9;}function _0x4816(){const _0x34b498=['[::1]','baseUrl','496245xiuSIe','pathname','defaultEnvironmentKey','has','fzGto','toString','sessionCheckPath','142zIHLuz','stringify','startsWith','localhost.','includes','isTTY','newPage','port','892602GPSgCR','clientIp','map','.storageState.json','close','8622576vynFDi','.json','test','filter','5788lDALrI','28KmvjRx','localhost','crfFA','28VHszBF','hex','setupHeaders','add','update','61340mcNUXX','profileName','auth','slice','domcontentloaded','561TDPkks','push','invalidateOn','effectiveBaseUrl','replace','QrkXD','.localhost','DUarG','hostname','rVgOh','4649280YdVDwh','orgId','stdin','userAgent','215610IADrfQ','HRHkJ','bhOli','EqSfC','Rjumg','oEQqx','endsWith'];_0x4816=function(){return _0x34b498;};return _0x4816();}(function(_0x1a6741,_0x3356c7){const _0x31c98b=_0x501c,_0x1e2c6a=_0x1a6741();while(!![]){try{const _0x2f9c70=parseInt(_0x31c98b(0x9f))/0x1*(parseInt(_0x31c98b(0xb0))/0x2)+parseInt(_0x31c98b(0xa7))/0x3+parseInt(_0x31c98b(0xb4))/0x4*(parseInt(_0x31c98b(0x98))/0x5)+-parseInt(_0x31c98b(0x8f))/0x6*(parseInt(_0x31c98b(0xb1))/0x7)+parseInt(_0x31c98b(0x8b))/0x8+-parseInt(_0x31c98b(0xac))/0x9+-parseInt(_0x31c98b(0xb9))/0xa*(parseInt(_0x31c98b(0xbe))/0xb);if(_0x2f9c70===_0x3356c7)break;else _0x1e2c6a['push'](_0x1e2c6a['shift']());}catch(_0x50fd19){_0x1e2c6a['push'](_0x1e2c6a['shift']());}}}(_0x4816,0x8b193));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x2b31a6=process['env'],_0x40d8e8={'stdin':process[_0x456319(0x8d)],'stdout':process['stdout']}){const _0x3ebe5a=_0x456319,_0x1db427={'cfETS':function(_0x53c548,_0x439634){return _0x53c548(_0x439634);}};if(_0x2b31a6['CI'])return![];return Boolean(_0x40d8e8[_0x3ebe5a(0x8d)][_0x3ebe5a(0xa4)])&&_0x1db427['cfETS'](Boolean,_0x40d8e8['stdout'][_0x3ebe5a(0xa4)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x3a1324){const _0x1ed3e9=_0x456319,_0x14c536={'dGGsi':function(_0x5403b8,_0x1c4cf3){return _0x5403b8(_0x1c4cf3);},'TSYHh':_0x1ed3e9(0x97),'HRHkJ':function(_0x3100c5,_0x768b9b){return _0x3100c5(_0x768b9b);},'czcEx':_0x1ed3e9(0xa6),'Luxzu':_0x1ed3e9(0x8e),'bhOli':function(_0xe14df1,_0x4e39b3){return _0xe14df1!==_0x4e39b3;},'UeQoG':'clientIp','aNRfB':function(_0x5cc362,_0x36a18b){return _0x5cc362(_0x36a18b);},'QrkXD':'sha256'},_0x322f3e=new Set(_0x3a1324[_0x1ed3e9(0xc0)]??DEFAULT_INVALIDATE_ON);_0x3a1324[_0x1ed3e9(0xc1)]&&_0x14c536['dGGsi'](needsTunnel,_0x3a1324['effectiveBaseUrl'])&&_0x322f3e[_0x1ed3e9(0xb7)](_0x14c536['TSYHh']);const _0xbd0afe={'orgId':_0x3a1324[_0x1ed3e9(0x8c)],'profileName':_0x3a1324[_0x1ed3e9(0xba)]};return _0x322f3e['has'](_0x1ed3e9(0x97))&&(_0xbd0afe[_0x1ed3e9(0xc1)]=_0x3a1324['effectiveBaseUrl']),_0x322f3e['has'](_0x1ed3e9(0xb6))&&(_0xbd0afe['setupHeaders']=_0x3a1324['setupHeaders']?_0x14c536[_0x1ed3e9(0x90)](sortObjectKeys,_0x3a1324['setupHeaders']):_0x3a1324['setupHeaders']),_0x322f3e[_0x1ed3e9(0x9b)](_0x14c536['czcEx'])&&(_0xbd0afe[_0x1ed3e9(0xa6)]=_0x14c536['dGGsi'](extractPort,_0x3a1324[_0x1ed3e9(0xc1)])),_0x322f3e['has'](_0x14c536['Luxzu'])&&_0x14c536[_0x1ed3e9(0x91)](_0x3a1324['userAgent'],undefined)&&(_0xbd0afe[_0x1ed3e9(0x8e)]=_0x3a1324['userAgent']),_0x322f3e['has'](_0x14c536['UeQoG'])&&_0x3a1324[_0x1ed3e9(0xa8)]!==undefined&&(_0xbd0afe[_0x1ed3e9(0xa8)]=_0x3a1324['clientIp']),_0x14c536['aNRfB'](createHash,_0x14c536[_0x1ed3e9(0xc3)])[_0x1ed3e9(0xb8)](JSON[_0x1ed3e9(0xa0)](_0xbd0afe))['digest'](_0x1ed3e9(0xb5))[_0x1ed3e9(0xbc)](0x0,0xc);}function extractPort(_0x1cd7a4){const _0x3611ed=_0x456319;try{return new URL(_0x1cd7a4)[_0x3611ed(0xa6)];}catch{return'';}}function sortObjectKeys(_0x1253fa){const _0x5ee512={};for(const _0xa3d87d of Object['keys'](_0x1253fa)['sort']()){_0x5ee512[_0xa3d87d]=_0x1253fa[_0xa3d87d];}return _0x5ee512;}export function getSessionCachePath(_0x4f1ac8,_0x22359a){const _0x48b8f1=_0x456319,_0x10b650={'Rhahx':function(_0x4b5678){return _0x4b5678();},'crfFA':_0x48b8f1(0xbb)};return join(_0x10b650['Rhahx'](getRangerHomeDir),_0x10b650[_0x48b8f1(0xb3)],_0x4f1ac8+'-'+_0x22359a+_0x48b8f1(0xad));}export function getStorageStatePath(_0x48721a){const _0x2d31a5=_0x456319;return _0x48721a[_0x2d31a5(0xc2)](/\.json$/,_0x2d31a5(0xaa));}export function needsTunnel(_0xb5de66){const _0x4a0331=_0x456319,_0x3968e3={'fzGto':function(_0x3b0313,_0x3341d8){return _0x3b0313===_0x3341d8;},'bKBMv':_0x4a0331(0xb2),'GRdZQ':function(_0x4cd0ef,_0x2e06fb){return _0x4cd0ef===_0x2e06fb;}};let _0x43c17d;try{_0x43c17d=new URL(_0xb5de66)[_0x4a0331(0xc6)];}catch{return![];}if(_0x3968e3[_0x4a0331(0x9c)](_0x43c17d,_0x3968e3['bKBMv'])||_0x3968e3['GRdZQ'](_0x43c17d,'127.0.0.1'))return!![];if(_0x43c17d[_0x4a0331(0x95)](_0x4a0331(0xc4)))return!![];if(_0x43c17d[_0x4a0331(0xa3)](_0x4a0331(0xa2)))return!![];return![];}export function isBareLocalhost(_0x3a9c18){const _0x38ceb7=_0x456319,_0x36f692={'rVgOh':function(_0x5472fe,_0x1ad970){return _0x5472fe===_0x1ad970;},'EqSfC':'localhost'};let _0x260d6d;try{_0x260d6d=new URL(_0x3a9c18)[_0x38ceb7(0xc6)];}catch{return![];}return _0x36f692['rVgOh'](_0x260d6d,_0x36f692[_0x38ceb7(0x92)])||_0x36f692[_0x38ceb7(0xc7)](_0x260d6d,'127.0.0.1')||_0x260d6d==='::1'||_0x260d6d===_0x38ceb7(0x96);}export function orderLoginDomains(_0x1feef5,_0x22d46f){const _0x3483ee=_0x456319,_0x15202c=_0x22d46f??[];if(!_0x1feef5)return _0x15202c;return[_0x1feef5,..._0x15202c[_0x3483ee(0xaf)](_0x44f835=>_0x44f835!==_0x1feef5)];}export function hostnameOf(_0x3bb04c){return new URL(_0x3bb04c)['hostname'];}export function duplicateCookiesForDomains(_0x3e23b2,_0x41c5a6){const _0x35b1a5=_0x456319,_0x500514={'VYPLQ':function(_0x6d67dd,_0x45e9db){return _0x6d67dd(_0x45e9db);}},_0x48f15a=[..._0x3e23b2],_0x27b0c9=new Set(_0x3e23b2[_0x35b1a5(0xa9)](_0x23d8a5=>_0x23d8a5['domain']));for(const _0x306f7c of _0x41c5a6){let _0x1f3545;try{_0x1f3545=_0x500514['VYPLQ'](hostnameOf,_0x306f7c);}catch{continue;}if(!_0x1f3545)continue;const _0x312f07=_0x1f3545[_0x35b1a5(0xa1)]('.')?_0x1f3545:'.'+_0x1f3545;if(_0x27b0c9[_0x35b1a5(0x9b)](_0x1f3545)||_0x27b0c9[_0x35b1a5(0x9b)](_0x312f07))continue;for(const _0x5c6924 of _0x3e23b2){_0x48f15a[_0x35b1a5(0xbf)]({..._0x5c6924,'domain':_0x312f07});}_0x27b0c9[_0x35b1a5(0xb7)](_0x312f07);}return _0x48f15a;}export function resolveAuthEnvironmentLocally(_0x5a1e3b,_0x28f72c){const _0x2ea55a=_0x456319,_0x454b34=_0x5a1e3b['environments'];if(_0x28f72c){const _0x282678=_0x454b34[_0x28f72c];if(!_0x282678)return null;return{'key':_0x28f72c,..._0x282678};}if(_0x5a1e3b[_0x2ea55a(0x9a)]){const _0xc4a08c=_0x454b34[_0x5a1e3b[_0x2ea55a(0x9a)]];if(!_0xc4a08c)return null;return{'key':_0x5a1e3b[_0x2ea55a(0x9a)],..._0xc4a08c};}const _0x4dc48f=Object['keys'](_0x454b34);if(_0x4dc48f['length']===0x1){const _0x4f01b9=_0x4dc48f[0x0];return{'key':_0x4f01b9,..._0x454b34[_0x4f01b9]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x92586b,_0x52f5c6){const _0x2daf6b=_0x456319;try{if(_0x52f5c6)return new URL(_0x52f5c6,_0x92586b)[_0x2daf6b(0x9d)]();return new URL(_0x92586b)[_0x2daf6b(0x9d)]();}catch{return null;}}export function looksLikeLoginUrl(_0x2a9013){const _0x1a9bc3=_0x456319;try{const _0x287ddc=new URL(_0x2a9013);return LOGIN_URL_PATTERN['test'](_0x287ddc[_0x1a9bc3(0x99)]);}catch{return LOGIN_URL_PATTERN[_0x1a9bc3(0xae)](_0x2a9013);}}export async function isCachedSessionLive(_0x1c0a4e,_0x310493,_0x5d3110={},_0x1ba58f={}){const _0x3c2fea=_0x456319,_0xb48d34={'oEQqx':function(_0x1e9e5c,_0xcefccf,_0x4c27fc){return _0x1e9e5c(_0xcefccf,_0x4c27fc);},'Rjumg':function(_0x497a66,_0x57522e){return _0x497a66===_0x57522e;},'DUarG':function(_0x47a150,_0x4bb626){return _0x47a150(_0x4bb626);}},_0x5962e8=_0xb48d34[_0x3c2fea(0x94)](buildSessionCheckUrl,_0x310493,_0x5d3110[_0x3c2fea(0x9e)]);if(!_0x5962e8)return!![];if(!_0x1ba58f['launchBrowser'])return!![];let _0x560d0f=null;try{_0x560d0f=await _0x1ba58f['launchBrowser']();const _0x48d51f=await _0x560d0f['newContext']({'storageState':_0x1c0a4e,'ignoreHTTPSErrors':!![],..._0x5d3110['setupHeaders']?{'extraHTTPHeaders':_0x5d3110[_0x3c2fea(0xb6)]}:{}}),_0x2a2150=await _0x48d51f[_0x3c2fea(0xa5)](),_0x188b8e=await _0x2a2150['goto'](_0x5962e8,{'waitUntil':_0x3c2fea(0xbd),'timeout':0x3a98}),_0x3a32f8=_0x188b8e?.['status']();if(_0xb48d34[_0x3c2fea(0x93)](_0x3a32f8,0x191)||_0xb48d34[_0x3c2fea(0x93)](_0x3a32f8,0x193))return![];const _0x32df58=_0x2a2150['url']();if(_0xb48d34[_0x3c2fea(0xc5)](looksLikeLoginUrl,_0x32df58))return![];return!![];}catch{return![];}finally{if(_0x560d0f)await _0x560d0f[_0x3c2fea(0xab)]()['catch'](()=>{});}}
@@ -1 +1 @@
1
- (function(_0x1f5c69,_0x24e6af){const _0x3081f2=_0xfcc8,_0x7d095a=_0x1f5c69();while(!![]){try{const _0x2f9a28=-parseInt(_0x3081f2(0x12b))/0x1+parseInt(_0x3081f2(0x137))/0x2*(-parseInt(_0x3081f2(0x128))/0x3)+parseInt(_0x3081f2(0x136))/0x4*(parseInt(_0x3081f2(0x12c))/0x5)+parseInt(_0x3081f2(0x12d))/0x6*(parseInt(_0x3081f2(0x13a))/0x7)+parseInt(_0x3081f2(0x12f))/0x8+parseInt(_0x3081f2(0x12a))/0x9*(parseInt(_0x3081f2(0x131))/0xa)+-parseInt(_0x3081f2(0x127))/0xb;if(_0x2f9a28===_0x24e6af)break;else _0x7d095a['push'](_0x7d095a['shift']());}catch(_0x15c151){_0x7d095a['push'](_0x7d095a['shift']());}}}(_0x2582,0xddf64));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0xfcc8(_0x2b83d2,_0x2ea066){_0x2b83d2=_0x2b83d2-0x127;const _0x25828f=_0x2582();let _0xfcc816=_0x25828f[_0x2b83d2];return _0xfcc816;}export function deriveKey(_0x154c25){const _0x50afe4={'lHNBn':function(_0x4b27d3,_0x54eeee,_0x1be655,_0x2eae48,_0x3deb7e,_0x1533a0){return _0x4b27d3(_0x54eeee,_0x1be655,_0x2eae48,_0x3deb7e,_0x1533a0);}};return _0x50afe4['lHNBn'](pbkdf2Sync,_0x154c25,SALT,0x186a0,KEY_LENGTH,'sha256');}function _0x2582(){const _0xf7d782=['concat','OfcBn','LoDtK','getAuthTag','244380RImvEw','22VPpSWp','subarray','dPdUA','203gJUAVp','1978416AUuPYQ','406194LhDxva','dDsfT','11133KcUTva','1682411tffECt','40SteLEt','300654QvKDcK','setAuthTag','14127528clTwSg','utf8','4470LFXapk'];_0x2582=function(){return _0xf7d782;};return _0x2582();}export function encrypt(_0x5351d6,_0x244e80){const _0x44a9dd=_0xfcc8,_0x12aa93={'OfcBn':function(_0x440cf5,_0x50423a){return _0x440cf5(_0x50423a);},'dPdUA':function(_0x4eb2f6,_0x35a766,_0x272ee6,_0x4d5087){return _0x4eb2f6(_0x35a766,_0x272ee6,_0x4d5087);}},_0x3ab6cb=_0x12aa93[_0x44a9dd(0x133)](deriveKey,_0x244e80),_0x380c9d=_0x12aa93['OfcBn'](randomBytes,IV_LENGTH),_0x5959e3=_0x12aa93[_0x44a9dd(0x139)](createCipheriv,ALGORITHM,_0x3ab6cb,_0x380c9d),_0x2ce8e9=Buffer['concat']([_0x5959e3['update'](_0x5351d6,'utf8'),_0x5959e3['final']()]),_0x48b944=_0x5959e3[_0x44a9dd(0x135)]();return Buffer[_0x44a9dd(0x132)]([_0x380c9d,_0x48b944,_0x2ce8e9]);}export function decrypt(_0x312013,_0x1e36c1){const _0x1a53f5=_0xfcc8,_0x52eed1={'Jrtyp':function(_0x25e5a4,_0x336a5e){return _0x25e5a4+_0x336a5e;},'LoDtK':function(_0x3ebc8f,_0x4c24cb){return _0x3ebc8f+_0x4c24cb;},'dDsfT':_0x1a53f5(0x130)},_0x2253d4=deriveKey(_0x1e36c1),_0xd2a0e4=_0x312013[_0x1a53f5(0x138)](0x0,IV_LENGTH),_0x120303=_0x312013[_0x1a53f5(0x138)](IV_LENGTH,_0x52eed1['Jrtyp'](IV_LENGTH,TAG_LENGTH)),_0x1c81bd=_0x312013[_0x1a53f5(0x138)](_0x52eed1[_0x1a53f5(0x134)](IV_LENGTH,TAG_LENGTH)),_0x2c2892=createDecipheriv(ALGORITHM,_0x2253d4,_0xd2a0e4);return _0x2c2892[_0x1a53f5(0x12e)](_0x120303),_0x2c2892['update'](_0x1c81bd)+_0x2c2892['final'](_0x52eed1[_0x1a53f5(0x129)]);}
1
+ const _0x23830a=_0x4166;(function(_0x582470,_0x318dc5){const _0x4f23c1=_0x4166,_0x14c679=_0x582470();while(!![]){try{const _0x447bc0=parseInt(_0x4f23c1(0x14b))/0x1*(parseInt(_0x4f23c1(0x144))/0x2)+-parseInt(_0x4f23c1(0x13f))/0x3+parseInt(_0x4f23c1(0x141))/0x4*(-parseInt(_0x4f23c1(0x146))/0x5)+parseInt(_0x4f23c1(0x149))/0x6+-parseInt(_0x4f23c1(0x14a))/0x7+-parseInt(_0x4f23c1(0x13c))/0x8*(parseInt(_0x4f23c1(0x13d))/0x9)+parseInt(_0x4f23c1(0x145))/0xa*(parseInt(_0x4f23c1(0x13a))/0xb);if(_0x447bc0===_0x318dc5)break;else _0x14c679['push'](_0x14c679['shift']());}catch(_0x46a6e2){_0x14c679['push'](_0x14c679['shift']());}}}(_0x40db,0x959e5));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0x4166(_0x30587a,_0x4f5f37){_0x30587a=_0x30587a-0x13a;const _0x40db52=_0x40db();let _0x4166d6=_0x40db52[_0x30587a];return _0x4166d6;}const ALGORITHM=_0x23830a(0x142),SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x13cbf7){const _0x1cd36b={'uNblW':function(_0x1a2e7f,_0x267de4,_0x5b0285,_0x4e29d3,_0x5e7955,_0x41e69a){return _0x1a2e7f(_0x267de4,_0x5b0285,_0x4e29d3,_0x5e7955,_0x41e69a);}};return _0x1cd36b['uNblW'](pbkdf2Sync,_0x13cbf7,SALT,0x186a0,KEY_LENGTH,'sha256');}function _0x40db(){const _0x4b55b8=['utf8','44868WGgigs','aes-256-gcm','tyisq','98TGxUDr','10XKRoRa','470GWCJVY','update','TlQwY','987648BLftoj','5909190hVnKZU','15429lojdsP','37980921kcUMOo','elQae','2672ZaxydW','22374YSCrAo','subarray','3095133GCoOYC'];_0x40db=function(){return _0x4b55b8;};return _0x40db();}export function encrypt(_0x499d71,_0x2d138f){const _0x3d1be9=_0x23830a,_0x4a53d2={'tyisq':function(_0xfe78bc,_0xfdf754){return _0xfe78bc(_0xfdf754);},'mpXRH':'utf8'},_0xac5624=_0x4a53d2[_0x3d1be9(0x143)](deriveKey,_0x2d138f),_0x451253=randomBytes(IV_LENGTH),_0x1ab695=createCipheriv(ALGORITHM,_0xac5624,_0x451253),_0x341817=Buffer['concat']([_0x1ab695['update'](_0x499d71,_0x4a53d2['mpXRH']),_0x1ab695['final']()]),_0x14b21f=_0x1ab695['getAuthTag']();return Buffer['concat']([_0x451253,_0x14b21f,_0x341817]);}export function decrypt(_0xdadfa9,_0x5e668f){const _0x4de49d=_0x23830a,_0x3a3836={'elQae':function(_0x352727,_0x4ab706){return _0x352727(_0x4ab706);},'TlQwY':function(_0x3017c1,_0x1d4e7f){return _0x3017c1+_0x1d4e7f;},'Wdbhn':_0x4de49d(0x140)},_0x559c6=_0x3a3836[_0x4de49d(0x13b)](deriveKey,_0x5e668f),_0x41f581=_0xdadfa9[_0x4de49d(0x13e)](0x0,IV_LENGTH),_0x1464d8=_0xdadfa9['subarray'](IV_LENGTH,_0x3a3836[_0x4de49d(0x148)](IV_LENGTH,TAG_LENGTH)),_0x1a37d1=_0xdadfa9[_0x4de49d(0x13e)](_0x3a3836['TlQwY'](IV_LENGTH,TAG_LENGTH)),_0x30b9c6=createDecipheriv(ALGORITHM,_0x559c6,_0x41f581);return _0x30b9c6['setAuthTag'](_0x1464d8),_0x30b9c6[_0x4de49d(0x147)](_0x1a37d1)+_0x30b9c6['final'](_0x3a3836['Wdbhn']);}
@@ -1 +1 @@
1
- const _0x5bdf99=_0x1e9b;function _0x1174(){const _0x4d6f36=['Not\x20enough\x20non-option\x20arguments','includes','featureId','error','yfUrc','--key','210oWUwdZ','685802QclmDY','startsWith','24sfhgft','errorMessage','347694XbmVoL','toLowerCase','Wymtw','missing_option','slice','--credentials','syntax_error','stringify','Unknown\x20command','missing_required_argument','no_token','--pass','7mNcwmx','catch','1158SpAFLs','some','yoobm','has','application/json','4smRDgD','232045CMUdAd','push','invalid_option_value','uEjOO','3117584cEUgxT','4062420mPRIfJ','2815DjzQeR','errorType','join','env','--authorization','1266726AQDljH','[desire-path]\x20Payload:\x20','length','--apikey','2ZjKwUz','DiIfe','Invalid\x20values','runtime_error','Bearer\x20'];_0x1174=function(){return _0x4d6f36;};return _0x1174();}(function(_0xd2549f,_0x27368f){const _0x5b4a4f=_0x1e9b,_0x41c3c2=_0xd2549f();while(!![]){try{const _0x2a35e1=-parseInt(_0x5b4a4f(0x14b))/0x1*(-parseInt(_0x5b4a4f(0x15b))/0x2)+parseInt(_0x5b4a4f(0x147))/0x3*(-parseInt(_0x5b4a4f(0x16e))/0x4)+parseInt(_0x5b4a4f(0x142))/0x5*(parseInt(_0x5b4a4f(0x169))/0x6)+parseInt(_0x5b4a4f(0x167))/0x7*(parseInt(_0x5b4a4f(0x140))/0x8)+-parseInt(_0x5b4a4f(0x141))/0x9+-parseInt(_0x5b4a4f(0x156))/0xa*(-parseInt(_0x5b4a4f(0x16f))/0xb)+-parseInt(_0x5b4a4f(0x159))/0xc*(parseInt(_0x5b4a4f(0x157))/0xd);if(_0x2a35e1===_0x27368f)break;else _0x41c3c2['push'](_0x41c3c2['shift']());}catch(_0x43a89e){_0x41c3c2['push'](_0x41c3c2['shift']());}}}(_0x1174,0x4ba9c));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t','--secret','--api-key',_0x5bdf99(0x14a),_0x5bdf99(0x155),'--password',_0x5bdf99(0x166),'--auth',_0x5bdf99(0x146),'--header','--cookie',_0x5bdf99(0x160)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function _0x1e9b(_0x1f6da1,_0x36df2d){_0x1f6da1=_0x1f6da1-0x140;const _0x1174a9=_0x1174();let _0x1e9b29=_0x1174a9[_0x1f6da1];return _0x1e9b29;}function looksLikeToken(_0x1e423){const _0x34eb19=_0x5bdf99;return TOKEN_PATTERNS[_0x34eb19(0x16a)](_0x35b95a=>_0x35b95a['test'](_0x1e423));}export function sanitizeArgs(_0x531c89){const _0x3108ef=_0x5bdf99,_0x1d9203={'uNjXD':function(_0xdafe4c,_0x296b88){return _0xdafe4c<_0x296b88;},'Wymtw':'[REDACTED]','uEjOO':function(_0x43e6e9,_0x50961c){return _0x43e6e9(_0x50961c);}},_0x1a3329=[];let _0x40450e=![];for(let _0x2395c4=0x0;_0x1d9203['uNjXD'](_0x2395c4,_0x531c89[_0x3108ef(0x149)]);_0x2395c4++){const _0x7f642d=_0x531c89[_0x2395c4];if(_0x40450e){_0x1a3329[_0x3108ef(0x170)](_0x1d9203['Wymtw']),_0x40450e=![];continue;}if(_0x7f642d['startsWith']('--')||_0x7f642d[_0x3108ef(0x158)]('-')){const _0x292607=_0x7f642d['indexOf']('=');if(_0x292607!==-0x1){const _0x5166e7=_0x7f642d['slice'](0x0,_0x292607)[_0x3108ef(0x15c)]();if(SENSITIVE_FLAGS['has'](_0x5166e7)){_0x1a3329['push'](_0x7f642d[_0x3108ef(0x15f)](0x0,_0x292607)+'=[REDACTED]');continue;}}else{const _0x3c26fd=_0x7f642d['toLowerCase']();SENSITIVE_FLAGS[_0x3108ef(0x16c)](_0x3c26fd)&&(_0x40450e=!![]);}_0x1a3329['push'](_0x7f642d);}else _0x1d9203[_0x3108ef(0x172)](looksLikeToken,_0x7f642d)?_0x1a3329['push'](_0x1d9203[_0x3108ef(0x15d)]):_0x1a3329[_0x3108ef(0x170)](_0x7f642d);}return _0x1a3329[_0x3108ef(0x144)]('\x20');}export async function logDesirePath(_0x294e90){const _0x3b3e48=_0x5bdf99,_0x11a15b={'yoobm':'has_token','AFHSA':_0x3b3e48(0x16d),'DiIfe':function(_0x49b60a,_0x415fe9,_0xdddcd3){return _0x49b60a(_0x415fe9,_0xdddcd3);}};try{const _0x53031f=await getToken()[_0x3b3e48(0x168)](()=>null),_0x32d551=getApiBaseUrl(),_0x11fa54=getCurrentVersion(),_0x29a1c7=_0x53031f?_0x11a15b[_0x3b3e48(0x16b)]:_0x3b3e48(0x165),_0x27147d={..._0x294e90['metadata'],'authStatus':_0x29a1c7,'isTty':process['stdout']['isTTY']??![]},_0x586514={'Content-Type':_0x11a15b['AFHSA']};_0x53031f&&(_0x586514['Authorization']=_0x3b3e48(0x14f)+_0x53031f);const _0x52fc04={'rawCommand':_0x294e90['rawCommand'],'errorMessage':_0x294e90[_0x3b3e48(0x15a)],'errorType':_0x294e90[_0x3b3e48(0x143)],'featureId':_0x294e90[_0x3b3e48(0x152)],'sessionId':_0x294e90['sessionId'],'metadata':_0x27147d,'cliVersion':_0x11fa54};process[_0x3b3e48(0x145)]['DEBUG']&&(console['error']('[desire-path]\x20Sending\x20log\x20to\x20'+_0x32d551+'/api/v1/mcp/desire-path-logs'),console['error'](_0x3b3e48(0x148)+JSON[_0x3b3e48(0x162)](_0x52fc04,null,0x2))),await _0x11a15b[_0x3b3e48(0x14c)](fetch,_0x32d551+'/api/v1/mcp/desire-path-logs',{'method':'POST','headers':_0x586514,'body':JSON['stringify'](_0x52fc04)});}catch(_0x599e12){process[_0x3b3e48(0x145)]['DEBUG']&&console[_0x3b3e48(0x153)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x599e12);}}export function getErrorType(_0x5d9721,_0x5d2366){const _0x3a9caa=_0x5bdf99,_0x4da7b3={'HwZia':'unknown_argument','FGdOv':_0x3a9caa(0x14d),'yfUrc':_0x3a9caa(0x171),'nOykq':'Missing\x20required\x20argument'};if(_0x5d2366)return _0x3a9caa(0x14e);if(!_0x5d9721)return'unknown';if(_0x5d9721['includes'](_0x3a9caa(0x163)))return'unknown_command';if(_0x5d9721['includes']('Unknown\x20argument'))return _0x4da7b3['HwZia'];if(_0x5d9721['includes'](_0x3a9caa(0x150)))return _0x3a9caa(0x164);if(_0x5d9721[_0x3a9caa(0x151)](_0x4da7b3['FGdOv']))return _0x4da7b3[_0x3a9caa(0x154)];if(_0x5d9721[_0x3a9caa(0x151)](_0x4da7b3['nOykq']))return _0x3a9caa(0x15e);return _0x3a9caa(0x161);}
1
+ const _0x17e143=_0x23a9;(function(_0x1c6f7a,_0xcde2f7){const _0x3fe177=_0x23a9,_0x27a35c=_0x1c6f7a();while(!![]){try{const _0x58ebd4=-parseInt(_0x3fe177(0x1ad))/0x1*(-parseInt(_0x3fe177(0x199))/0x2)+parseInt(_0x3fe177(0x1a9))/0x3+-parseInt(_0x3fe177(0x1a5))/0x4+-parseInt(_0x3fe177(0x19f))/0x5+parseInt(_0x3fe177(0x1b0))/0x6*(parseInt(_0x3fe177(0x18e))/0x7)+-parseInt(_0x3fe177(0x1a2))/0x8+parseInt(_0x3fe177(0x18f))/0x9;if(_0x58ebd4===_0xcde2f7)break;else _0x27a35c['push'](_0x27a35c['shift']());}catch(_0x265fbf){_0x27a35c['push'](_0x27a35c['shift']());}}}(_0x384f,0xc9e8c));function _0x23a9(_0x7c6ee3,_0x1e1bd3){_0x7c6ee3=_0x7c6ee3-0x17f;const _0x384f97=_0x384f();let _0x23a981=_0x384f97[_0x7c6ee3];return _0x23a981;}import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x17e143(0x1a3),'-t','--secret','--api-key','--apikey',_0x17e143(0x191),'--password','--pass',_0x17e143(0x19d),_0x17e143(0x1a6),_0x17e143(0x185),_0x17e143(0x1a4),_0x17e143(0x1a8)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function _0x384f(){const _0x508121=['toLowerCase','POST','okXDw','tpbSa','join','14CDiNPB','18879039cWJApQ','some','--key','has_token','Qqyyg','stringify','startsWith','yDbgR','env','missing_option','5984vokaEr','/api/v1/mcp/desire-path-logs','runtime_error','Uomgh','--auth','[desire-path]\x20Failed\x20to\x20send:\x20','5175940GihdKS','syntax_error','includes','11883640prPwDa','--token','--cookie','6067580hkmYvK','--authorization','test','--credentials','2259255gZyxwu','[desire-path]\x20Payload:\x20','unknown_command','qPikp','173BBlOmE','rawCommand','errorMessage','4488558oNrLPX','has','[REDACTED]','slice','errorType','Authorization','RYieQ','isTTY','stdout','--header','error','LmEOc','=[REDACTED]'];_0x384f=function(){return _0x508121;};return _0x384f();}function looksLikeToken(_0x5a6931){const _0x32a60b=_0x17e143;return TOKEN_PATTERNS[_0x32a60b(0x190)](_0x5605a1=>_0x5605a1[_0x32a60b(0x1a7)](_0x5a6931));}export function sanitizeArgs(_0x4a6151){const _0x3fbca2=_0x17e143,_0x2cb14c={'Qqyyg':function(_0xb6ee1,_0x874f31){return _0xb6ee1<_0x874f31;},'Uomgh':_0x3fbca2(0x1b2),'vmgzA':function(_0x1364b3,_0x104df3){return _0x1364b3!==_0x104df3;},'cuTbG':function(_0xbbf1a7,_0x280950){return _0xbbf1a7(_0x280950);}},_0x187700=[];let _0x5ece17=![];for(let _0xc7fafb=0x0;_0x2cb14c[_0x3fbca2(0x193)](_0xc7fafb,_0x4a6151['length']);_0xc7fafb++){const _0x42b486=_0x4a6151[_0xc7fafb];if(_0x5ece17){_0x187700['push'](_0x2cb14c['Uomgh']),_0x5ece17=![];continue;}if(_0x42b486[_0x3fbca2(0x195)]('--')||_0x42b486[_0x3fbca2(0x195)]('-')){const _0x509c55=_0x42b486['indexOf']('=');if(_0x2cb14c['vmgzA'](_0x509c55,-0x1)){const _0x244225=_0x42b486[_0x3fbca2(0x17f)](0x0,_0x509c55)['toLowerCase']();if(SENSITIVE_FLAGS[_0x3fbca2(0x1b1)](_0x244225)){_0x187700['push'](_0x42b486[_0x3fbca2(0x17f)](0x0,_0x509c55)+_0x3fbca2(0x188));continue;}}else{const _0x4144ef=_0x42b486[_0x3fbca2(0x189)]();SENSITIVE_FLAGS[_0x3fbca2(0x1b1)](_0x4144ef)&&(_0x5ece17=!![]);}_0x187700['push'](_0x42b486);}else _0x2cb14c['cuTbG'](looksLikeToken,_0x42b486)?_0x187700['push'](_0x2cb14c[_0x3fbca2(0x19c)]):_0x187700['push'](_0x42b486);}return _0x187700[_0x3fbca2(0x18d)]('\x20');}export async function logDesirePath(_0x32eccf){const _0x54fb28=_0x17e143,_0x505e62={'kLxkp':function(_0x3cc46b){return _0x3cc46b();},'kcpFg':_0x54fb28(0x192),'okXDw':'application/json','XnbNL':function(_0x27f9ef,_0x2cebec,_0x4133a1){return _0x27f9ef(_0x2cebec,_0x4133a1);},'WrcOL':_0x54fb28(0x18a)};try{const _0x45b861=await getToken()['catch'](()=>null),_0x5db4cd=getApiBaseUrl(),_0x23c06d=_0x505e62['kLxkp'](getCurrentVersion),_0x47d61f=_0x45b861?_0x505e62['kcpFg']:'no_token',_0x53b2e4={..._0x32eccf['metadata'],'authStatus':_0x47d61f,'isTty':process[_0x54fb28(0x184)][_0x54fb28(0x183)]??![]},_0x4e5910={'Content-Type':_0x505e62[_0x54fb28(0x18b)]};_0x45b861&&(_0x4e5910[_0x54fb28(0x181)]='Bearer\x20'+_0x45b861);const _0x2d0f74={'rawCommand':_0x32eccf[_0x54fb28(0x1ae)],'errorMessage':_0x32eccf[_0x54fb28(0x1af)],'errorType':_0x32eccf[_0x54fb28(0x180)],'featureId':_0x32eccf['featureId'],'sessionId':_0x32eccf['sessionId'],'metadata':_0x53b2e4,'cliVersion':_0x23c06d};process[_0x54fb28(0x197)]['DEBUG']&&(console['error']('[desire-path]\x20Sending\x20log\x20to\x20'+_0x5db4cd+'/api/v1/mcp/desire-path-logs'),console[_0x54fb28(0x186)](_0x54fb28(0x1aa)+JSON[_0x54fb28(0x194)](_0x2d0f74,null,0x2))),await _0x505e62['XnbNL'](fetch,_0x5db4cd+_0x54fb28(0x19a),{'method':_0x505e62['WrcOL'],'headers':_0x4e5910,'body':JSON[_0x54fb28(0x194)](_0x2d0f74)});}catch(_0x5a4bd3){process['env']['DEBUG']&&console[_0x54fb28(0x186)](_0x54fb28(0x19e)+_0x5a4bd3);}}export function getErrorType(_0x108afa,_0x21645a){const _0x302a59=_0x17e143,_0x565fb2={'tpbSa':_0x302a59(0x19b),'qPikp':'unknown','CuiTV':'Unknown\x20command','xkPIq':_0x302a59(0x1ab),'sgizg':'Unknown\x20argument','RYieQ':'Not\x20enough\x20non-option\x20arguments','yDbgR':'Invalid\x20values','LmEOc':_0x302a59(0x198),'yGrSY':_0x302a59(0x1a0)};if(_0x21645a)return _0x565fb2[_0x302a59(0x18c)];if(!_0x108afa)return _0x565fb2[_0x302a59(0x1ac)];if(_0x108afa['includes'](_0x565fb2['CuiTV']))return _0x565fb2['xkPIq'];if(_0x108afa['includes'](_0x565fb2['sgizg']))return'unknown_argument';if(_0x108afa[_0x302a59(0x1a1)](_0x565fb2[_0x302a59(0x182)]))return'missing_required_argument';if(_0x108afa['includes'](_0x565fb2[_0x302a59(0x196)]))return'invalid_option_value';if(_0x108afa[_0x302a59(0x1a1)]('Missing\x20required\x20argument'))return _0x565fb2[_0x302a59(0x187)];return _0x565fb2['yGrSY'];}
@@ -1 +1 @@
1
- const _0x59297d=_0x4309;(function(_0x54dad1,_0x144c21){const _0x16494e=_0x4309,_0x12f607=_0x54dad1();while(!![]){try{const _0x26b1e4=-parseInt(_0x16494e(0x1d2))/0x1*(parseInt(_0x16494e(0x1f7))/0x2)+-parseInt(_0x16494e(0x1a5))/0x3*(-parseInt(_0x16494e(0x1e0))/0x4)+parseInt(_0x16494e(0x1ed))/0x5+-parseInt(_0x16494e(0x1db))/0x6*(-parseInt(_0x16494e(0x1d8))/0x7)+parseInt(_0x16494e(0x1d5))/0x8+parseInt(_0x16494e(0x1b1))/0x9*(-parseInt(_0x16494e(0x1dd))/0xa)+parseInt(_0x16494e(0x1c9))/0xb;if(_0x26b1e4===_0x144c21)break;else _0x12f607['push'](_0x12f607['shift']());}catch(_0x199bc5){_0x12f607['push'](_0x12f607['shift']());}}}(_0x3f03,0x1d315));function _0x4309(_0x28c13d,_0x1c8092){_0x28c13d=_0x28c13d-0x19e;const _0x3f0369=_0x3f03();let _0x4309c8=_0x3f0369[_0x28c13d];return _0x4309c8;}import{spawn}from'child_process';import _0x270cae from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';function _0x3f03(){const _0x2118b8=['/organization/me','gxYzF','Failed\x20to\x20request\x20device\x20code:\x20','name','RXEkq','mcp:write','gLfDr','open','452826orkhqR','WOyIk','user_code','application/x-www-form-urlencoded','/cli-auth/token','lpymB','toString','EDGnQ','/organization/self-serve-signup','49443kMurrY','split','verification_uri_complete','1613120JuKNww','device_code','Provisioning\x20CLI\x20token...','35ZtDrmj','ijems','slow_down','65454HBXnOB','ignore','270rGbCXk','buxPp','Failed\x20to\x20provision\x20API\x20key:\x20','28UULmZI','LXmCw','Code:\x20','KNHOe','base64url','win32','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','json','Failed\x20to\x20create\x20organization:\x20','status','token','oCCrk','length','1067825eStcwo','vCDNz','list','stringify','xyUzO','wgZvt','error_description','/organization/my-memberships','cmd','log','8SIjIAt','start','platform','map','firstName','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','rYQvu','filter','stdout','unref','xdg-open','aZDYz','5007OZKZlk','CAfYx','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','kBIPM','workosClientId','https://api.workos.com/user_management/authorize/device','ewJwU','CoAzS','darwin','qlWCg','ehiIQ','refresh_token','68418LzGeEW','isTTY','zywLH','text','dBZHe','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','Failed\x20to\x20fetch\x20memberships:\x20','POST','qwLjB','utf-8','XEIKI','Invalid\x20JWT\x20format','selected','/api-keys','write','error'];_0x3f03=function(){return _0x2118b8;};return _0x3f03();}const WORKOS_DEVICE_AUTH_URL=_0x59297d(0x1aa),WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0xeb6696){const _0x35cb51=_0x59297d,_0x24f891={'aZDYz':'POST'},_0x2eda30=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x24f891[_0x35cb51(0x1a4)],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0xeb6696})});if(!_0x2eda30['ok']){const _0x31f9e4=await _0x2eda30['text']();throw new Error(_0x35cb51(0x1c3)+_0x2eda30[_0x35cb51(0x1e9)]+'\x20'+_0x31f9e4);}return _0x2eda30['json']();}export async function pollForTokens(_0x164f38,_0x12c7a4,_0x59a058,_0x1f4100){const _0x3b2ac0=_0x59297d,_0x56656e={'CoAzS':function(_0x49e885,_0x24ed6a){return _0x49e885*_0x24ed6a;},'mwySp':function(_0x484b23,_0x47f69d){return _0x484b23*_0x47f69d;},'ehiIQ':function(_0xd89cf2,_0x435a4d){return _0xd89cf2<_0x435a4d;},'vCDNz':function(_0x3ea6a2,_0x592bd7){return _0x3ea6a2===_0x592bd7;},'buxPp':'authorization_pending','EDGnQ':_0x3b2ac0(0x1da),'CeQQo':'Authentication\x20failed','oLxOI':'Device\x20authorization\x20timed\x20out'},_0x2f1c86=Date['now']()+_0x56656e[_0x3b2ac0(0x1ac)](_0x1f4100,0x3e8);let _0x3184dd=_0x56656e['mwySp'](_0x59a058,0x3e8);while(_0x56656e[_0x3b2ac0(0x1af)](Date['now'](),_0x2f1c86)){await sleep(_0x3184dd);const _0x37796c=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x3b2ac0(0x1cc)},'body':new URLSearchParams({'client_id':_0x164f38,'device_code':_0x12c7a4,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x37796c['ok'])return _0x37796c[_0x3b2ac0(0x1e7)]();const _0xc0209e=await _0x37796c['json']();if(_0x56656e['vCDNz'](_0xc0209e[_0x3b2ac0(0x1c0)],_0x56656e[_0x3b2ac0(0x1de)]))continue;if(_0x56656e[_0x3b2ac0(0x1ee)](_0xc0209e[_0x3b2ac0(0x1c0)],_0x56656e[_0x3b2ac0(0x1d0)])){_0x3184dd+=0x3e8;continue;}throw new Error(_0xc0209e[_0x3b2ac0(0x1f3)]||_0xc0209e[_0x3b2ac0(0x1c0)]||_0x56656e['CeQQo']);}throw new Error(_0x56656e['oLxOI']);}async function fetchUserProfile(_0x2a2a65){const _0xc6cfe1=_0x59297d,_0x463330={'UVlvZ':function(_0x1482e5){return _0x1482e5();},'ydoQM':function(_0x1e2a4b,_0x5f1ae2,_0x51e7f0){return _0x1e2a4b(_0x5f1ae2,_0x51e7f0);},'ewJwU':'GET'},_0x450bf5=_0x463330['UVlvZ'](getApiBaseUrl);try{const _0x7e39cc=await _0x463330['ydoQM'](fetch,_0x450bf5+_0xc6cfe1(0x1c1),{'method':_0x463330[_0xc6cfe1(0x1ab)],'headers':{'workos-token':_0x2a2a65}});if(_0x7e39cc['ok'])return _0x7e39cc['json']();}catch{}return null;}function buildKeyName(_0x335661,_0x2473f8){const _0x10b2d8=_0x59297d,_0x5c393d={'zywLH':function(_0x475358,_0xeebe46){return _0x475358===_0xeebe46;},'AbvZW':function(_0x2fdfb8,_0x2d5d86){return _0x2fdfb8+_0x2d5d86;}},_0xad81bd=_0x2473f8[_0x10b2d8(0x1a0)](_0x5a2af0=>_0x5a2af0['name']===_0x335661||_0x5a2af0[_0x10b2d8(0x1c4)]['startsWith'](_0x335661+'\x20('));if(_0x5c393d[_0x10b2d8(0x1b3)](_0xad81bd['length'],0x0))return _0x335661;return _0x335661+'\x20('+_0x5c393d['AbvZW'](_0xad81bd['length'],0x1)+')';}export async function provisionApiKey(_0x4c1e47){const _0x410e66=_0x59297d,_0x23e493={'dBZHe':function(_0x4f5597){return _0x4f5597();},'pzoUf':function(_0x5b2dbe,_0x2b23ae){return _0x5b2dbe(_0x2b23ae);},'qwLjB':'CLI\x20Key','wtHSU':function(_0x1e7293,_0x52750e,_0x1ffb22){return _0x1e7293(_0x52750e,_0x1ffb22);},'KOSzR':'GET','ijems':'POST','BzoMt':_0x410e66(0x1c6)},_0x7843bd=_0x23e493[_0x410e66(0x1b5)](getApiBaseUrl),_0x1b2dc4={'Content-Type':'application/json','workos-token':_0x4c1e47},_0x561e84=await _0x23e493['pzoUf'](fetchUserProfile,_0x4c1e47),_0x37db71=_0x561e84?.[_0x410e66(0x1fb)]||_0x561e84?.['email']?.['split']('@')[0x0],_0x1127fc=_0x37db71?_0x37db71+'\x27s\x20CLI\x20Key':_0x23e493[_0x410e66(0x1b9)];let _0x598281=[];try{const _0xc7f727=await _0x23e493['wtHSU'](fetch,_0x7843bd+_0x410e66(0x1be),{'method':_0x23e493['KOSzR'],'headers':_0x1b2dc4});if(_0xc7f727['ok']){const _0x21c940=await _0xc7f727['json']();_0x598281=_0x21c940['apiKeys'];}}catch{}const _0xad39cf=buildKeyName(_0x1127fc,_0x598281),_0x57cb5b=await _0x23e493['wtHSU'](fetch,_0x7843bd+_0x410e66(0x1be),{'method':_0x23e493[_0x410e66(0x1d9)],'headers':_0x1b2dc4,'body':JSON[_0x410e66(0x1f0)]({'name':_0xad39cf,'scope':_0x23e493['BzoMt']})});if(!_0x57cb5b['ok']){const _0x57550a=await _0x57cb5b['text']();throw new Error(_0x410e66(0x1df)+_0x57cb5b[_0x410e66(0x1e9)]+'\x20'+_0x57550a);}const _0xc85cbc=await _0x57cb5b[_0x410e66(0x1e7)]();return _0xc85cbc['apiKey'][_0x410e66(0x1ea)];}export function openBrowser(_0x49981e){const _0x44e5ef=_0x59297d,_0x13e5d3={'gLfDr':function(_0x3fb21d,_0x450d54){return _0x3fb21d===_0x450d54;},'xyUzO':_0x44e5ef(0x1e5),'kBIPM':function(_0x380fc7,_0x26aa15,_0x5b3490,_0xeb6fcc){return _0x380fc7(_0x26aa15,_0x5b3490,_0xeb6fcc);},'wgZvt':_0x44e5ef(0x1f8),'xaDQa':_0x44e5ef(0x1ad),'WOyIk':_0x44e5ef(0x1a3),'uxYrh':'ignore'};try{if(_0x13e5d3[_0x44e5ef(0x1c7)](process[_0x44e5ef(0x1f9)],_0x13e5d3[_0x44e5ef(0x1f1)])){const _0x3103c3=_0x13e5d3[_0x44e5ef(0x1a8)](spawn,_0x44e5ef(0x1f5),['/c',_0x13e5d3[_0x44e5ef(0x1f2)],'',_0x49981e],{'detached':!![],'stdio':_0x44e5ef(0x1dc),'windowsHide':!![]});_0x3103c3[_0x44e5ef(0x1a2)]();return;}const _0x41e1f5=process['platform']===_0x13e5d3['xaDQa']?_0x44e5ef(0x1c8):_0x13e5d3[_0x44e5ef(0x1ca)],_0x513fee=_0x13e5d3['kBIPM'](spawn,_0x41e1f5,[_0x49981e],{'detached':!![],'stdio':_0x13e5d3['uxYrh']});_0x513fee['unref']();}catch{}}function decodeJwtPayload(_0x34247a){const _0x27be17=_0x59297d,_0x5a3168=_0x34247a[_0x27be17(0x1d3)]('.');if(_0x5a3168[_0x27be17(0x1ec)]!==0x3)throw new Error(_0x27be17(0x1bc));const _0x3189bc=Buffer['from'](_0x5a3168[0x1],_0x27be17(0x1e4))[_0x27be17(0x1cf)](_0x27be17(0x1ba));return JSON['parse'](_0x3189bc);}async function selfServeSignup(_0x14b269){const _0x4a5d42=_0x59297d,_0x426a31=getApiBaseUrl(),_0x5560ac=await fetch(_0x426a31+_0x4a5d42(0x1d1),{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x14b269}});if(!_0x5560ac['ok']){const _0x3de893=await _0x5560ac['text']();throw new Error(_0x4a5d42(0x1e8)+_0x5560ac[_0x4a5d42(0x1e9)]+'\x20'+_0x3de893);}return _0x5560ac[_0x4a5d42(0x1e7)]();}async function fetchMyMemberships(_0x5ff96e){const _0x245ca7=_0x59297d,_0x4797c2={'XEIKI':function(_0x43f60b,_0x338920,_0x47939c){return _0x43f60b(_0x338920,_0x47939c);}},_0x489b61=getApiBaseUrl(),_0x4067d8=await _0x4797c2[_0x245ca7(0x1bb)](fetch,_0x489b61+_0x245ca7(0x1f4),{'method':'GET','headers':{'workos-token':_0x5ff96e}});if(!_0x4067d8['ok']){const _0x45402c=await _0x4067d8[_0x245ca7(0x1b4)]();throw new Error(_0x245ca7(0x1b7)+_0x4067d8[_0x245ca7(0x1e9)]+'\x20'+_0x45402c);}const _0x7a7de7=await _0x4067d8['json']();return _0x7a7de7['memberships'];}async function refreshTokenWithOrg(_0x4a6bf6,_0x58c22d,_0x1cba98){const _0x1a150d=_0x59297d,_0x28767c={'RXEkq':function(_0x3c0dd6,_0x39f716,_0x8198e5){return _0x3c0dd6(_0x39f716,_0x8198e5);},'qlWCg':_0x1a150d(0x1b8),'lpymB':'application/x-www-form-urlencoded','KNHOe':_0x1a150d(0x1b0)},_0x14c2f6=await _0x28767c[_0x1a150d(0x1c5)](fetch,WORKOS_TOKEN_URL,{'method':_0x28767c[_0x1a150d(0x1ae)],'headers':{'Content-Type':_0x28767c[_0x1a150d(0x1ce)]},'body':new URLSearchParams({'client_id':_0x4a6bf6,'grant_type':_0x28767c[_0x1a150d(0x1e3)],'refresh_token':_0x58c22d,'organization_id':_0x1cba98})});if(!_0x14c2f6['ok']){const _0x4be89d=await _0x14c2f6[_0x1a150d(0x1b4)]();throw new Error(_0x1a150d(0x1e6)+_0x14c2f6[_0x1a150d(0x1e9)]+'\x20'+_0x4be89d);}return _0x14c2f6[_0x1a150d(0x1e7)]();}async function provisionCliToken(_0x3a14a4){const _0x56a5aa=_0x59297d,_0x4dbb0f=getApiBaseUrl(),_0x441967=await fetch(_0x4dbb0f+_0x56a5aa(0x1cd),{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x3a14a4}});if(!_0x441967['ok']){const _0x10f3be=await _0x441967['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x441967[_0x56a5aa(0x1e9)]+'\x20'+_0x10f3be);}return _0x441967['json']();}export async function runDeviceAuthFlow(){const _0x24fdb9=_0x59297d,_0x547ec0={'gxYzF':function(_0x4bad7e,_0x1dc393){return _0x4bad7e(_0x1dc393);},'YFcML':'\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','GfEdL':function(_0x15e892,_0xfa9781){return _0x15e892(_0xfa9781);},'yjsSb':function(_0x50acff,_0x465446){return _0x50acff(_0x465446);},'CAfYx':function(_0x1f6c75,_0x5122cd){return _0x1f6c75===_0x5122cd;},'jZWsy':'Setting\x20up\x20your\x20organization...','stDRN':function(_0x2cf6e8,_0x18d738){return _0x2cf6e8(_0x18d738);},'rYQvu':function(_0x369715,_0x52736b){return _0x369715===_0x52736b;},'oCCrk':function(_0x6713b6,_0x4b3c09){return _0x6713b6+_0x4b3c09;},'glwJl':_0x24fdb9(0x1b6),'zfzZC':_0x24fdb9(0x1ef),'LXmCw':'Select\x20an\x20organization:','QmGyQ':_0x24fdb9(0x1d7)},_0x38fb10=getCurrentEnvironment(),_0x3bc646=ENVIRONMENT_CONFIGS[_0x38fb10][_0x24fdb9(0x1a9)],_0x4f4a99=await _0x547ec0[_0x24fdb9(0x1c2)](requestDeviceCode,_0x3bc646);console[_0x24fdb9(0x1f6)](_0x547ec0['YFcML']),console['log'](_0x24fdb9(0x1a7)),openBrowser(_0x4f4a99[_0x24fdb9(0x1d4)]),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x4f4a99[_0x24fdb9(0x1d4)]),console[_0x24fdb9(0x1f6)](_0x24fdb9(0x1e2)+_0x4f4a99[_0x24fdb9(0x1cb)]+'\x0a'),process[_0x24fdb9(0x1a1)][_0x24fdb9(0x1bf)]('Waiting\x20for\x20authentication...');let _0x541838=await pollForTokens(_0x3bc646,_0x4f4a99[_0x24fdb9(0x1d6)],_0x4f4a99['interval'],_0x4f4a99['expires_in']);console[_0x24fdb9(0x1f6)]('\x20✓');const _0x199c37=_0x547ec0['GfEdL'](decodeJwtPayload,_0x541838['access_token']);if(!_0x199c37['org_id']){const _0x142a1d=await _0x547ec0['yjsSb'](fetchMyMemberships,_0x541838['access_token']);let _0x21a269;if(_0x547ec0[_0x24fdb9(0x1a6)](_0x142a1d[_0x24fdb9(0x1ec)],0x0)){process[_0x24fdb9(0x1a1)]['write'](_0x547ec0['jZWsy']);const _0x45edac=await _0x547ec0['stDRN'](selfServeSignup,_0x541838['access_token']);_0x21a269=_0x45edac['organizationId'],console[_0x24fdb9(0x1f6)]('\x20✓');}else{if(_0x547ec0[_0x24fdb9(0x19f)](_0x142a1d[_0x24fdb9(0x1ec)],0x1))_0x21a269=_0x142a1d[0x0]['organizationId'],console['log']('Using\x20organization:\x20'+_0x142a1d[0x0][_0x24fdb9(0x1c4)]);else{const _0x62ad19=process['stdin']['isTTY']&&process[_0x24fdb9(0x1a1)][_0x24fdb9(0x1b2)];if(!_0x62ad19)throw new Error(_0x547ec0[_0x24fdb9(0x1eb)](_0x24fdb9(0x19e),_0x547ec0['glwJl']));const {selected:_0x89c613}=await _0x270cae['prompt']([{'type':_0x547ec0['zfzZC'],'name':_0x24fdb9(0x1bd),'message':_0x547ec0[_0x24fdb9(0x1e1)],'choices':_0x142a1d[_0x24fdb9(0x1fa)](_0x4ee0fa=>({'name':_0x4ee0fa['name'],'value':_0x4ee0fa['organizationId']}))}]);_0x21a269=_0x89c613;}}_0x541838=await refreshTokenWithOrg(_0x3bc646,_0x541838['refresh_token'],_0x21a269);}process['stdout'][_0x24fdb9(0x1bf)](_0x547ec0['QmGyQ']);const _0x28fc7f=await _0x547ec0[_0x24fdb9(0x1c2)](provisionCliToken,_0x541838['access_token']);return console['log']('\x20✓'),await storeToken(_0x28fc7f[_0x24fdb9(0x1ea)]),_0x541838['refresh_token']&&await storeRefreshToken(_0x541838['refresh_token']),_0x28fc7f['token'];}function sleep(_0x2e8a44){return new Promise(_0x11cb5f=>setTimeout(_0x11cb5f,_0x2e8a44));}
1
+ const _0x16a076=_0x4ece;(function(_0x1ac6a8,_0x1d273c){const _0x1e6ef3=_0x4ece,_0x53f3c2=_0x1ac6a8();while(!![]){try{const _0x50dcab=-parseInt(_0x1e6ef3(0xf5))/0x1*(-parseInt(_0x1e6ef3(0x129))/0x2)+-parseInt(_0x1e6ef3(0x100))/0x3*(parseInt(_0x1e6ef3(0x11f))/0x4)+-parseInt(_0x1e6ef3(0x10d))/0x5*(parseInt(_0x1e6ef3(0xf7))/0x6)+parseInt(_0x1e6ef3(0xe8))/0x7+-parseInt(_0x1e6ef3(0x111))/0x8*(-parseInt(_0x1e6ef3(0x133))/0x9)+-parseInt(_0x1e6ef3(0xeb))/0xa*(parseInt(_0x1e6ef3(0x112))/0xb)+parseInt(_0x1e6ef3(0x130))/0xc*(parseInt(_0x1e6ef3(0x102))/0xd);if(_0x50dcab===_0x1d273c)break;else _0x53f3c2['push'](_0x53f3c2['shift']());}catch(_0x4bcb2c){_0x53f3c2['push'](_0x53f3c2['shift']());}}}(_0x92fd,0x81f94));import{spawn}from'child_process';import _0x569490 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x16a076(0xe4),WORKOS_TOKEN_URL=_0x16a076(0xdf);function _0x92fd(){const _0x3d70b2=['143SEtKjz','Code:\x20','mcp:write','QRhdl','access_token','OeaIX','memberships','Invalid\x20JWT\x20format','Failed\x20to\x20fetch\x20memberships:\x20','XSZPe','Setting\x20up\x20your\x20organization...','stdout','parse','28hkEreO','organizationId','qWUBT','error','bJNzf','tMqiD','/api-keys','status','WSIuy','soAWO','6170HsmWAa','text','isTTY','PGObO','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','POST','sksdR','355944wGvRLA','Failed\x20to\x20provision\x20API\x20key:\x20','split','23274yijXdy','Failed\x20to\x20request\x20device\x20code:\x20','user_code','UViis','AEpmA','/organization/self-serve-signup','write','GET','https://api.workos.com/user_management/authenticate','NqVwk','QeEFv','firstName','iyAmX','https://api.workos.com/user_management/authorize/device','cPZLX','iaAcJ','now','4943715MWTZEw','toString','apiKey','792410bTcmWu','darwin','IiFXi','jqgha','name','CCKRv','fNrTt','token','/cli-auth/token','application/json','263JcutEw','cmd','30vdeVuu','uWqjA','application/x-www-form-urlencoded','json','length','yKVoO','SIXGv','verification_uri_complete','authorization_pending','271137iwtzrm','unref','208hBHOUe','ignore','Waiting\x20for\x20authentication...','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','expires_in','org_id','log','from','refresh_token','\x27s\x20CLI\x20Key','730580dcIzTA','startsWith','sxAet','blrPD','2888BvRjBv'];_0x92fd=function(){return _0x3d70b2;};return _0x92fd();}export async function requestDeviceCode(_0x2f600b){const _0x532a56=_0x16a076,_0x5a8669={'OeaIX':function(_0x304ea5,_0x2acfc7,_0x269ea2){return _0x304ea5(_0x2acfc7,_0x269ea2);},'yKVoO':'application/x-www-form-urlencoded'},_0x683642=await _0x5a8669[_0x532a56(0x117)](fetch,WORKOS_DEVICE_AUTH_URL,{'method':_0x532a56(0x12e),'headers':{'Content-Type':_0x5a8669[_0x532a56(0xfc)]},'body':new URLSearchParams({'client_id':_0x2f600b})});if(!_0x683642['ok']){const _0x543057=await _0x683642['text']();throw new Error(_0x532a56(0x134)+_0x683642['status']+'\x20'+_0x543057);}return _0x683642['json']();}export async function pollForTokens(_0x4281e2,_0x5748c5,_0x3857e1,_0x4a34ad){const _0x1cab7b=_0x16a076,_0x103566={'iTRJZ':function(_0x53c607,_0x528110){return _0x53c607*_0x528110;},'oZTid':_0x1cab7b(0xf9),'soAWO':function(_0x425e0d,_0x4d5829){return _0x425e0d===_0x4d5829;},'FHHZc':_0x1cab7b(0xff),'PGObO':'slow_down','XSZPe':'Authentication\x20failed','OMZIK':'Device\x20authorization\x20timed\x20out'},_0x379552=Date['now']()+_0x4a34ad*0x3e8;let _0x57d345=_0x103566['iTRJZ'](_0x3857e1,0x3e8);while(Date[_0x1cab7b(0xe7)]()<_0x379552){await sleep(_0x57d345);const _0x35ff57=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x103566['oZTid']},'body':new URLSearchParams({'client_id':_0x4281e2,'device_code':_0x5748c5,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x35ff57['ok'])return _0x35ff57['json']();const _0x2ec5d5=await _0x35ff57[_0x1cab7b(0xfa)]();if(_0x103566[_0x1cab7b(0x128)](_0x2ec5d5['error'],_0x103566['FHHZc']))continue;if(_0x2ec5d5['error']===_0x103566[_0x1cab7b(0x12c)]){_0x57d345+=0x3e8;continue;}throw new Error(_0x2ec5d5['error_description']||_0x2ec5d5[_0x1cab7b(0x122)]||_0x103566[_0x1cab7b(0x11b)]);}throw new Error(_0x103566['OMZIK']);}async function fetchUserProfile(_0x34d87d){const _0x407a3e=_0x16a076,_0x501834={'cWdJi':function(_0x2773ff){return _0x2773ff();},'LRhUc':function(_0x3e508d,_0x181ee1,_0x12a845){return _0x3e508d(_0x181ee1,_0x12a845);},'iyAmX':_0x407a3e(0xde)},_0xd189af=_0x501834['cWdJi'](getApiBaseUrl);try{const _0x3b7f1e=await _0x501834['LRhUc'](fetch,_0xd189af+'/organization/me',{'method':_0x501834[_0x407a3e(0xe3)],'headers':{'workos-token':_0x34d87d}});if(_0x3b7f1e['ok'])return _0x3b7f1e[_0x407a3e(0xfa)]();}catch{}return null;}function _0x4ece(_0x4a0885,_0x11e270){_0x4a0885=_0x4a0885-0xdc;const _0x92fdca=_0x92fd();let _0x4eced6=_0x92fdca[_0x4a0885];return _0x4eced6;}function buildKeyName(_0x2a684d,_0x343628){const _0x38aa6c=_0x16a076,_0x3764d6={'blrPD':function(_0x280f69,_0x62a998){return _0x280f69===_0x62a998;}},_0x51bc07=_0x343628['filter'](_0x313f77=>_0x313f77[_0x38aa6c(0xef)]===_0x2a684d||_0x313f77['name'][_0x38aa6c(0x10e)](_0x2a684d+'\x20('));if(_0x3764d6[_0x38aa6c(0x110)](_0x51bc07['length'],0x0))return _0x2a684d;return _0x2a684d+'\x20('+(_0x51bc07['length']+0x1)+')';}export async function provisionApiKey(_0xe3b4cc){const _0x3f3225=_0x16a076,_0x22516c={'oNTXM':function(_0x192e17){return _0x192e17();},'ELaba':function(_0x3dff7e,_0xa61e4c){return _0x3dff7e(_0xa61e4c);},'gTTwB':'CLI\x20Key','QRhdl':function(_0x5badc2,_0x46f7d3,_0xc76160){return _0x5badc2(_0x46f7d3,_0xc76160);},'iaAcJ':function(_0x19201b,_0x3b150,_0x5028ec){return _0x19201b(_0x3b150,_0x5028ec);},'NzuLR':_0x3f3225(0x114)},_0x407aad=_0x22516c['oNTXM'](getApiBaseUrl),_0x58a264={'Content-Type':_0x3f3225(0xf4),'workos-token':_0xe3b4cc},_0x13bbb1=await _0x22516c['ELaba'](fetchUserProfile,_0xe3b4cc),_0x215cec=_0x13bbb1?.[_0x3f3225(0xe2)]||_0x13bbb1?.['email']?.[_0x3f3225(0x132)]('@')[0x0],_0x47f818=_0x215cec?_0x215cec+_0x3f3225(0x10c):_0x22516c['gTTwB'];let _0x3b6aa4=[];try{const _0x24a208=await _0x22516c[_0x3f3225(0x115)](fetch,_0x407aad+_0x3f3225(0x125),{'method':_0x3f3225(0xde),'headers':_0x58a264});if(_0x24a208['ok']){const _0x3c6732=await _0x24a208['json']();_0x3b6aa4=_0x3c6732['apiKeys'];}}catch{}const _0x1a0de7=_0x22516c[_0x3f3225(0xe6)](buildKeyName,_0x47f818,_0x3b6aa4),_0x428e29=await fetch(_0x407aad+'/api-keys',{'method':_0x3f3225(0x12e),'headers':_0x58a264,'body':JSON['stringify']({'name':_0x1a0de7,'scope':_0x22516c['NzuLR']})});if(!_0x428e29['ok']){const _0x573ea4=await _0x428e29['text']();throw new Error(_0x3f3225(0x131)+_0x428e29[_0x3f3225(0x126)]+'\x20'+_0x573ea4);}const _0x27811d=await _0x428e29[_0x3f3225(0xfa)]();return _0x27811d[_0x3f3225(0xea)][_0x3f3225(0xf2)];}export function openBrowser(_0x4c363d){const _0x3ded0d=_0x16a076,_0x29da3a={'sLzlJ':'win32','yjbyx':function(_0x44dfc2,_0x5a0e51,_0x49c485,_0x19c6b8){return _0x44dfc2(_0x5a0e51,_0x49c485,_0x19c6b8);},'IiFXi':'start','TLqhP':_0x3ded0d(0x103),'UViis':function(_0x13fd77,_0x563879){return _0x13fd77===_0x563879;},'bJNzf':_0x3ded0d(0xec),'CCKRv':'xdg-open'};try{if(process['platform']===_0x29da3a['sLzlJ']){const _0x3e80f9=_0x29da3a['yjbyx'](spawn,_0x3ded0d(0xf6),['/c',_0x29da3a[_0x3ded0d(0xed)],'',_0x4c363d],{'detached':!![],'stdio':_0x29da3a['TLqhP'],'windowsHide':!![]});_0x3e80f9[_0x3ded0d(0x101)]();return;}const _0x3d416a=_0x29da3a[_0x3ded0d(0x136)](process['platform'],_0x29da3a[_0x3ded0d(0x123)])?'open':_0x29da3a[_0x3ded0d(0xf0)],_0x2c2793=spawn(_0x3d416a,[_0x4c363d],{'detached':!![],'stdio':_0x3ded0d(0x103)});_0x2c2793['unref']();}catch{}}function decodeJwtPayload(_0xe6e068){const _0x11a052=_0x16a076,_0x3c2fd7=_0xe6e068[_0x11a052(0x132)]('.');if(_0x3c2fd7[_0x11a052(0xfb)]!==0x3)throw new Error(_0x11a052(0x119));const _0x192fde=Buffer[_0x11a052(0x10a)](_0x3c2fd7[0x1],'base64url')[_0x11a052(0xe9)]('utf-8');return JSON[_0x11a052(0x11e)](_0x192fde);}async function selfServeSignup(_0x2efc2c){const _0x5bd81b=_0x16a076,_0x231d12={'NqVwk':function(_0x25202b,_0x457c6b,_0x5f40bb){return _0x25202b(_0x457c6b,_0x5f40bb);},'qWUBT':_0x5bd81b(0xf4)},_0x25bda4=getApiBaseUrl(),_0x140253=await _0x231d12[_0x5bd81b(0xe0)](fetch,_0x25bda4+_0x5bd81b(0xdc),{'method':_0x5bd81b(0x12e),'headers':{'Content-Type':_0x231d12[_0x5bd81b(0x121)],'workos-token':_0x2efc2c}});if(!_0x140253['ok']){const _0x225a6e=await _0x140253[_0x5bd81b(0x12a)]();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x140253[_0x5bd81b(0x126)]+'\x20'+_0x225a6e);}return _0x140253['json']();}async function fetchMyMemberships(_0x52344a){const _0x3fdce9=_0x16a076,_0x306378={'SLbKL':'GET'},_0x1664e1=getApiBaseUrl(),_0x26e8d5=await fetch(_0x1664e1+'/organization/my-memberships',{'method':_0x306378['SLbKL'],'headers':{'workos-token':_0x52344a}});if(!_0x26e8d5['ok']){const _0x454d1d=await _0x26e8d5[_0x3fdce9(0x12a)]();throw new Error(_0x3fdce9(0x11a)+_0x26e8d5['status']+'\x20'+_0x454d1d);}const _0x33bc1c=await _0x26e8d5[_0x3fdce9(0xfa)]();return _0x33bc1c[_0x3fdce9(0x118)];}async function refreshTokenWithOrg(_0x4eebf6,_0x2766d2,_0x26e7a2){const _0x4aa8a7=_0x16a076,_0x55c213={'SIXGv':_0x4aa8a7(0xf9)},_0x5719c3=await fetch(WORKOS_TOKEN_URL,{'method':_0x4aa8a7(0x12e),'headers':{'Content-Type':_0x55c213[_0x4aa8a7(0xfd)]},'body':new URLSearchParams({'client_id':_0x4eebf6,'grant_type':_0x4aa8a7(0x10b),'refresh_token':_0x2766d2,'organization_id':_0x26e7a2})});if(!_0x5719c3['ok']){const _0x27c022=await _0x5719c3['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x5719c3['status']+'\x20'+_0x27c022);}return _0x5719c3[_0x4aa8a7(0xfa)]();}async function provisionCliToken(_0x364764){const _0x1bc57b=_0x16a076,_0x14cc27=getApiBaseUrl(),_0x28cf1d=await fetch(_0x14cc27+_0x1bc57b(0xf3),{'method':'POST','headers':{'Content-Type':_0x1bc57b(0xf4),'workos-token':_0x364764}});if(!_0x28cf1d['ok']){const _0x577f06=await _0x28cf1d[_0x1bc57b(0x12a)]();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x28cf1d['status']+'\x20'+_0x577f06);}return _0x28cf1d[_0x1bc57b(0xfa)]();}export async function runDeviceAuthFlow(){const _0x3f932e=_0x16a076,_0x183f15={'WSIuy':function(_0x29f30a){return _0x29f30a();},'OeANy':_0x3f932e(0x12d),'QeEFv':_0x3f932e(0x104),'sxAet':function(_0x3ba8b0,_0x2d8ce4){return _0x3ba8b0(_0x2d8ce4);},'uWqjA':function(_0x3e7eed,_0x567f61){return _0x3e7eed(_0x567f61);},'AEpmA':function(_0x54caf0,_0x275d7c){return _0x54caf0===_0x275d7c;},'jqgha':_0x3f932e(0x11c),'cPZLX':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','ljDeP':'list','sksdR':'Select\x20an\x20organization:','fNrTt':function(_0x3f50db,_0x504c5d,_0x109d3e,_0x1e4ae5){return _0x3f50db(_0x504c5d,_0x109d3e,_0x1e4ae5);},'tMqiD':'Provisioning\x20CLI\x20token...'},_0x2aadc9=_0x183f15[_0x3f932e(0x127)](getCurrentEnvironment),_0x175e22=ENVIRONMENT_CONFIGS[_0x2aadc9]['workosClientId'],_0x1389a9=await requestDeviceCode(_0x175e22);console[_0x3f932e(0x109)](_0x183f15['OeANy']),console['log'](_0x3f932e(0x105)),openBrowser(_0x1389a9['verification_uri_complete']),console[_0x3f932e(0x109)](_0x3f932e(0x106)+_0x1389a9[_0x3f932e(0xfe)]),console[_0x3f932e(0x109)](_0x3f932e(0x113)+_0x1389a9[_0x3f932e(0x135)]+'\x0a'),process['stdout'][_0x3f932e(0xdd)](_0x183f15[_0x3f932e(0xe1)]);let _0x5198f7=await pollForTokens(_0x175e22,_0x1389a9['device_code'],_0x1389a9['interval'],_0x1389a9[_0x3f932e(0x107)]);console[_0x3f932e(0x109)]('\x20✓');const _0x569487=_0x183f15[_0x3f932e(0x10f)](decodeJwtPayload,_0x5198f7[_0x3f932e(0x116)]);if(!_0x569487[_0x3f932e(0x108)]){const _0xa33d18=await _0x183f15[_0x3f932e(0xf8)](fetchMyMemberships,_0x5198f7[_0x3f932e(0x116)]);let _0x223bb9;if(_0x183f15[_0x3f932e(0x137)](_0xa33d18['length'],0x0)){process[_0x3f932e(0x11d)]['write'](_0x183f15[_0x3f932e(0xee)]);const _0x3187b8=await selfServeSignup(_0x5198f7[_0x3f932e(0x116)]);_0x223bb9=_0x3187b8[_0x3f932e(0x120)],console[_0x3f932e(0x109)]('\x20✓');}else{if(_0xa33d18[_0x3f932e(0xfb)]===0x1)_0x223bb9=_0xa33d18[0x0][_0x3f932e(0x120)],console['log']('Using\x20organization:\x20'+_0xa33d18[0x0][_0x3f932e(0xef)]);else{const _0x2ec0ac=process['stdin']['isTTY']&&process[_0x3f932e(0x11d)][_0x3f932e(0x12b)];if(!_0x2ec0ac)throw new Error('Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a'+_0x183f15[_0x3f932e(0xe5)]);const {selected:_0x4ff88f}=await _0x569490['prompt']([{'type':_0x183f15['ljDeP'],'name':'selected','message':_0x183f15[_0x3f932e(0x12f)],'choices':_0xa33d18['map'](_0x56496a=>({'name':_0x56496a['name'],'value':_0x56496a['organizationId']}))}]);_0x223bb9=_0x4ff88f;}}_0x5198f7=await _0x183f15[_0x3f932e(0xf1)](refreshTokenWithOrg,_0x175e22,_0x5198f7[_0x3f932e(0x10b)],_0x223bb9);}process[_0x3f932e(0x11d)][_0x3f932e(0xdd)](_0x183f15[_0x3f932e(0x124)]);const _0x3b5681=await provisionCliToken(_0x5198f7[_0x3f932e(0x116)]);return console['log']('\x20✓'),await storeToken(_0x3b5681[_0x3f932e(0xf2)]),_0x5198f7['refresh_token']&&await _0x183f15['sxAet'](storeRefreshToken,_0x5198f7[_0x3f932e(0x10b)]),_0x3b5681[_0x3f932e(0xf2)];}function sleep(_0x1f7dca){return new Promise(_0x4a1bb1=>setTimeout(_0x4a1bb1,_0x1f7dca));}
@@ -1 +1 @@
1
- const _0x5f071b=_0x3815;(function(_0x1cad02,_0x5ca1b2){const _0x20401e=_0x3815,_0x32759d=_0x1cad02();while(!![]){try{const _0x47d024=-parseInt(_0x20401e(0x75))/0x1*(parseInt(_0x20401e(0x83))/0x2)+-parseInt(_0x20401e(0x82))/0x3+parseInt(_0x20401e(0x8e))/0x4*(-parseInt(_0x20401e(0x89))/0x5)+parseInt(_0x20401e(0x90))/0x6+parseInt(_0x20401e(0x7d))/0x7+parseInt(_0x20401e(0x73))/0x8+parseInt(_0x20401e(0x7b))/0x9*(parseInt(_0x20401e(0x76))/0xa);if(_0x47d024===_0x5ca1b2)break;else _0x32759d['push'](_0x32759d['shift']());}catch(_0x52fb98){_0x32759d['push'](_0x32759d['shift']());}}}(_0x39e8,0xa0c08));export const DEFAULT_VERIFICATION_TRANSPORT=_0x5f071b(0x88);export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x5f071b(0x95),'workosClientId':_0x5f071b(0x71),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':_0x5f071b(0x92)},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x5f071b(0x7a),'mcpAuthUrl':_0x5f071b(0x91)},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':_0x5f071b(0x87),'aiProxyUrl':_0x5f071b(0x79),'mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x535d96){const _0x3d1087=_0x5f071b,_0x1a4dc9={'nUvSH':_0x3d1087(0x8b),'ifkNd':_0x3d1087(0x93)};return _0x535d96===_0x1a4dc9[_0x3d1087(0x70)]||_0x535d96==='staging'||_0x535d96===_0x1a4dc9['ifkNd'];}function _0x39e8(){const _0x28e73d=['true','off','RANGER_HOOKS','nUvSH','client_01J9CBYM7M5ZETCF7G6614DXR2','env','2322008unULRh','auto','810659FpDBur','40yHmvpb','toLowerCase','\x22.\x20','http://localhost:8090','https://ai-proxy-301751771437.us-central1.run.app','3935025QmxJqK','mcp','178171LnCdYG','RANGER_DISABLE_MCP','trim','RANGER_BYOK','ccvOF','1992966jNQxRw','2ZCbrzw','FFQEp','Invalid\x20RANGER_TRANSPORT=\x22','kEqea','client_01J9CBYM2DKWV9HM17D95Z540K','rangerwright-cli','1297765VkBEar','RANGER_USE_NOVA_ACT','prod','playwright-cli','mOAdN','12JRgHDp','RANGER_TRANSPORT','5084856gndhaI','https://mcp-auth.staging.ranger.net/mcp','https://mcp-auth.ranger.net/mcp','local','cmBDE','https://api.ranger.net','RANGER_CLI_ENV','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.'];_0x39e8=function(){return _0x28e73d;};return _0x39e8();}export function getCurrentEnvironment(){const _0x13a9ef=_0x5f071b,_0x2eb2c2=process[_0x13a9ef(0x72)][_0x13a9ef(0x96)];if(_0x2eb2c2&&isValidEnvironment(_0x2eb2c2))return _0x2eb2c2;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['apiBaseUrl'];}export function getAiProxyUrl(){const _0xa8b469=_0x5f071b,_0x3e2004={'mOAdN':function(_0x41e3f3){return _0x41e3f3();}};return ENVIRONMENT_CONFIGS[_0x3e2004[_0xa8b469(0x8d)](getCurrentEnvironment)]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x588aea=_0x5f071b,_0x30b1b6={'wXnJb':function(_0x4b50ad){return _0x4b50ad();}};return process[_0x588aea(0x72)]['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[_0x30b1b6['wXnJb'](getCurrentEnvironment)]['mcpAuthUrl'];}export function isByokEnabled(){const _0x2255a7=_0x5f071b,_0x57fe36={'pLSus':function(_0x44b04b,_0x100a2d){return _0x44b04b===_0x100a2d;}};return _0x57fe36['pLSus'](process['env'][_0x2255a7(0x80)],_0x2255a7(0x98));}function _0x3815(_0x357b6f,_0x36eb82){_0x357b6f=_0x357b6f-0x70;const _0x39e83c=_0x39e8();let _0x381505=_0x39e83c[_0x357b6f];return _0x381505;}function isVerificationTransport(_0x3c1a7b){const _0x3ea5bb=_0x5f071b,_0x93c4ef={'XymfK':function(_0x1e0ff2,_0x1f55cd){return _0x1e0ff2===_0x1f55cd;},'uqhEB':function(_0x5ea875,_0x51ba0f){return _0x5ea875===_0x51ba0f;},'ccvOF':'nova-act-cli','kEqea':function(_0x1163cf,_0x23750a){return _0x1163cf===_0x23750a;},'tqYup':_0x3ea5bb(0x88)};return _0x93c4ef['XymfK'](_0x3c1a7b,_0x3ea5bb(0x7c))||_0x93c4ef['uqhEB'](_0x3c1a7b,_0x3ea5bb(0x8c))||_0x3c1a7b===_0x93c4ef[_0x3ea5bb(0x81)]||_0x93c4ef[_0x3ea5bb(0x86)](_0x3c1a7b,_0x93c4ef['tqYup']);}const LEGACY_TRANSPORT_ENV_VARS=[_0x5f071b(0x8a),_0x5f071b(0x7e)];export function getVerificationTransport(){const _0x3e5399=_0x5f071b,_0xae3489=process[_0x3e5399(0x72)][_0x3e5399(0x8f)]?.[_0x3e5399(0x7f)]();if(_0xae3489){if(isVerificationTransport(_0xae3489))return _0xae3489;throw new Error(_0x3e5399(0x85)+_0xae3489+'\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.');}const _0x366662=LEGACY_TRANSPORT_ENV_VARS['find'](_0x549eaa=>process[_0x3e5399(0x72)][_0x549eaa]);if(_0x366662)throw new Error(_0x366662+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return DEFAULT_VERIFICATION_TRANSPORT;}export function resolveHookMode(_0x31b08b=process['env']){const _0x565549=_0x5f071b,_0xff7fa={'cmBDE':_0x565549(0x74),'FFQEp':function(_0xbb5d1a,_0x438908){return _0xbb5d1a===_0x438908;},'gbCOh':_0x565549(0x99)},_0x452fd9=_0x31b08b[_0x565549(0x9a)]?.['trim']()[_0x565549(0x77)]();if(!_0x452fd9)return _0xff7fa[_0x565549(0x94)];if(_0xff7fa[_0x565549(0x84)](_0x452fd9,_0xff7fa['gbCOh'])||_0xff7fa['FFQEp'](_0x452fd9,'on')||_0xff7fa[_0x565549(0x84)](_0x452fd9,_0xff7fa['cmBDE']))return _0x452fd9;return console['error']('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x31b08b['RANGER_HOOKS']+_0x565549(0x78)+_0x565549(0x97)),_0xff7fa['cmBDE'];}
1
+ const _0x538886=_0x1dd0;(function(_0x31ed3e,_0xb3a055){const _0x4b6f79=_0x1dd0,_0x342a02=_0x31ed3e();while(!![]){try{const _0x295d23=-parseInt(_0x4b6f79(0x15b))/0x1+parseInt(_0x4b6f79(0x169))/0x2*(-parseInt(_0x4b6f79(0x162))/0x3)+parseInt(_0x4b6f79(0x156))/0x4+-parseInt(_0x4b6f79(0x168))/0x5+-parseInt(_0x4b6f79(0x161))/0x6+-parseInt(_0x4b6f79(0x163))/0x7+parseInt(_0x4b6f79(0x175))/0x8*(parseInt(_0x4b6f79(0x15d))/0x9);if(_0x295d23===_0xb3a055)break;else _0x342a02['push'](_0x342a02['shift']());}catch(_0x22d4ea){_0x342a02['push'](_0x342a02['shift']());}}}(_0x171b,0x4cb2b));export const DEFAULT_VERIFICATION_TRANSPORT=_0x538886(0x153);export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x538886(0x155),'workosClientId':_0x538886(0x151),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x538886(0x16c),'mcpAuthUrl':_0x538886(0x16d)},'local':{'apiBaseUrl':_0x538886(0x16e),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'http://localhost:8090','mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x39538f){const _0x4a604b=_0x538886,_0x339f89={'MXylm':'prod','cZzbo':_0x4a604b(0x157)};return _0x39538f===_0x339f89['MXylm']||_0x39538f===_0x4a604b(0x15c)||_0x39538f===_0x339f89[_0x4a604b(0x166)];}export function getCurrentEnvironment(){const _0x3d446f=_0x538886,_0x226b76=process[_0x3d446f(0x16f)]['RANGER_CLI_ENV'];if(_0x226b76&&isValidEnvironment(_0x226b76))return _0x226b76;return DEFAULT_ENVIRONMENT;}function _0x171b(){const _0x19e390=['https://ai-proxy-301751771437.us-central1.run.app','https://mcp-auth.staging.ranger.net/mcp','http://localhost:8080','env','apiBaseUrl','RANGER_AI_PROXY_URL','RANGER_API_URL','ccHAy','Xyovj','224MESKDZ','NFabB','oaBme','client_01J9CBYM7M5ZETCF7G6614DXR2','RANGER_USE_NOVA_ACT','rangerwright-cli','mcpAuthUrl','https://api.ranger.net','247300ELvAOa','local','RANGER_HOOKS','playwright-cli','bDgbY','250399fdOWZn','staging','689868RquQHs','\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.','RANGER_BYOK','RANGER_TRANSPORT','3627048Plrwie','12CgAwCL','3110849IEAnsh','auto','nova-act-cli','cZzbo','true','1762600CUnqOJ','121046oCoYSZ','qGRrr','Invalid\x20RANGER_TRANSPORT=\x22'];_0x171b=function(){return _0x19e390;};return _0x171b();}function _0x1dd0(_0x8ee720,_0x2c3d45){_0x8ee720=_0x8ee720-0x150;const _0x171be8=_0x171b();let _0x1dd01f=_0x171be8[_0x8ee720];return _0x1dd01f;}export function getApiBaseUrl(){const _0x421045=_0x538886,_0x1fc0bc={'zlIjN':function(_0x24c194){return _0x24c194();}};return process['env'][_0x421045(0x172)]||ENVIRONMENT_CONFIGS[_0x1fc0bc['zlIjN'](getCurrentEnvironment)][_0x421045(0x170)];}export function getAiProxyUrl(){const _0x3fb52d=_0x538886,_0x729c9b={'NFabB':function(_0x372bcd){return _0x372bcd();}};return process[_0x3fb52d(0x16f)][_0x3fb52d(0x171)]||ENVIRONMENT_CONFIGS[_0x729c9b[_0x3fb52d(0x176)](getCurrentEnvironment)]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x3339ae=_0x538886;return process['env']['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x3339ae(0x154)];}export function isByokEnabled(){const _0x37c3f7=_0x538886,_0x5e2900={'HNWGV':function(_0x5b4b51,_0x83aec4){return _0x5b4b51===_0x83aec4;}};return _0x5e2900['HNWGV'](process[_0x37c3f7(0x16f)][_0x37c3f7(0x15f)],_0x37c3f7(0x167));}function isVerificationTransport(_0x15288e){const _0x45289d=_0x538886,_0x321a86={'Xyovj':function(_0xb10212,_0x47b85a){return _0xb10212===_0x47b85a;},'qGRrr':_0x45289d(0x153)};return _0x15288e==='mcp'||_0x15288e===_0x45289d(0x159)||_0x321a86['Xyovj'](_0x15288e,_0x45289d(0x165))||_0x321a86[_0x45289d(0x174)](_0x15288e,_0x321a86[_0x45289d(0x16a)]);}const LEGACY_TRANSPORT_ENV_VARS=[_0x538886(0x152),'RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x1caa73=_0x538886,_0x38d459={'jCsao':function(_0x1b5c29,_0x186d4e){return _0x1b5c29(_0x186d4e);}},_0x312e3e=process[_0x1caa73(0x16f)][_0x1caa73(0x160)]?.['trim']();if(_0x312e3e){if(_0x38d459['jCsao'](isVerificationTransport,_0x312e3e))return _0x312e3e;throw new Error(_0x1caa73(0x16b)+_0x312e3e+'\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.');}const _0x5cc2f6=LEGACY_TRANSPORT_ENV_VARS['find'](_0x3e2ae6=>process[_0x1caa73(0x16f)][_0x3e2ae6]);if(_0x5cc2f6)throw new Error(_0x5cc2f6+_0x1caa73(0x15e));return DEFAULT_VERIFICATION_TRANSPORT;}export function resolveHookMode(_0x479fb6=process[_0x538886(0x16f)]){const _0x148a8b=_0x538886,_0x451323={'bDgbY':'auto','KQzFW':function(_0x26be16,_0x5c495d){return _0x26be16===_0x5c495d;},'BIyKa':'off','oaBme':function(_0x420df4,_0x4d5fbd){return _0x420df4===_0x4d5fbd;},'ccHAy':function(_0x25692d,_0x462a8c){return _0x25692d+_0x462a8c;}},_0x28523e=_0x479fb6[_0x148a8b(0x158)]?.['trim']()['toLowerCase']();if(!_0x28523e)return _0x451323[_0x148a8b(0x15a)];if(_0x451323['KQzFW'](_0x28523e,_0x451323['BIyKa'])||_0x451323[_0x148a8b(0x150)](_0x28523e,'on')||_0x28523e===_0x148a8b(0x164))return _0x28523e;return console['error'](_0x451323[_0x148a8b(0x173)]('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x479fb6['RANGER_HOOKS']+'\x22.\x20','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.')),_0x451323[_0x148a8b(0x15a)];}
@@ -1 +1 @@
1
- (function(_0x240d99,_0x3e9137){const _0x509c6f=_0x1469,_0x4b69cb=_0x240d99();while(!![]){try{const _0x3d7206=parseInt(_0x509c6f(0x1cb))/0x1*(-parseInt(_0x509c6f(0x1e8))/0x2)+-parseInt(_0x509c6f(0x1de))/0x3+parseInt(_0x509c6f(0x219))/0x4*(-parseInt(_0x509c6f(0x1ff))/0x5)+-parseInt(_0x509c6f(0x203))/0x6*(parseInt(_0x509c6f(0x1d1))/0x7)+-parseInt(_0x509c6f(0x1cf))/0x8*(parseInt(_0x509c6f(0x1e0))/0x9)+parseInt(_0x509c6f(0x1d3))/0xa+parseInt(_0x509c6f(0x1f5))/0xb*(parseInt(_0x509c6f(0x1e3))/0xc);if(_0x3d7206===_0x3e9137)break;else _0x4b69cb['push'](_0x4b69cb['shift']());}catch(_0xee4140){_0x4b69cb['push'](_0x4b69cb['shift']());}}}(_0x4e18,0x54c41));import{getToken}from'./keychain.js';function _0x4e18(){const _0x203ed6=['aGkaO','/conclude','852942WcrjFL','ofSTS','/sessions','JoIdp','Failed\x20to\x20create\x20feature\x20review:\x20','/report','text','COBQb','message','Kctkh','Qltcm','mPjqt','Failed\x20to\x20start\x20session:\x20','OprUU','QZLvG','SsPBo','JwcTK','json','sessionId','Kragl','includeDeleted','qrTYz','20cpvQgM','eYCnK','POST','/checklist-items/','210rrFEMR','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','Failed\x20to\x20list\x20feature\x20reviews:\x20','style','34872NStqey','hrKWG','7zpQCQt','Failed\x20to\x20get\x20action\x20items:\x20','3891680iqqpyX','Failed\x20to\x20create\x20scenario:\x20','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','set','/action-items','avoOe','gitRepoUrl','CIeAj','billingUrl','GET','/api/v1/mcp/features/','578934KgvRhQ','heNnE','207Dnzfgd','AXENE','toString','708276FOcZMD','stringify','cecvp','gitBranch','limit','2014KvRbvj','PATCH','Failed\x20to\x20conclude\x20session:\x20','Failed\x20to\x20update\x20feature\x20review:\x20','OuztC','DaQIH','Failed\x20to\x20get\x20feature\x20review:\x20','OxfsH','pVURw','/checklist','Failed\x20to\x20list\x20sessions:\x20','updateChecklistItem','njhvq','220gGypeQ','wynga','Bearer\x20','mYwvI','https://dashboard.ranger.net/billing','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','iQrrI','application/json','itemIds','Failed\x20to\x20delete\x20feature\x20review:\x20','575565cNACDA','mJXzg'];_0x4e18=function(){return _0x203ed6;};return _0x4e18();}import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x3e0b02){const _0x5592a2=_0x1469,_0x428e16={'KRaTi':function(_0x451eda){return _0x451eda();},'rlRVk':function(_0xb1d258){return _0xb1d258();},'njhvq':function(_0x386b85,_0xd2caf1,_0x42e9bb){return _0x386b85(_0xd2caf1,_0x42e9bb);},'ofSTS':'POST'},_0x10da72=await _0x428e16['KRaTi'](getToken);if(!_0x10da72)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x55eeb9=_0x428e16['rlRVk'](getApiBaseUrl),_0x30a8d6=await _0x428e16[_0x5592a2(0x1f4)](fetch,_0x55eeb9+'/api/v1/mcp/features',{'method':_0x428e16[_0x5592a2(0x204)],'headers':{'Authorization':'Bearer\x20'+_0x10da72,'Content-Type':_0x5592a2(0x1fc)},'body':JSON[_0x5592a2(0x1e4)](_0x3e0b02)});if(!_0x30a8d6['ok']){if(_0x30a8d6['status']===0x192){const _0x230fb0=await _0x30a8d6['json'](),_0x31349d=_0x230fb0[_0x5592a2(0x1db)]||_0x5592a2(0x1f9);throw new Error((_0x230fb0[_0x5592a2(0x20b)]||'Feature\x20limit\x20exceeded')+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x31349d);}const _0x1da907=await _0x30a8d6[_0x5592a2(0x209)]();throw new Error(_0x5592a2(0x207)+_0x1da907);}return _0x30a8d6[_0x5592a2(0x214)]();}export async function listFeatures(_0x25fb6a){const _0x24e9c6=_0x1469,_0x41a8b8={'OxfsH':'gitRepoUrl','OprUU':'GET'},_0x4cb5e6=await getToken();if(!_0x4cb5e6)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5ce65d=getApiBaseUrl(),_0x4921dc=new URLSearchParams();if(_0x25fb6a?.[_0x24e9c6(0x1d9)])_0x4921dc['set'](_0x41a8b8[_0x24e9c6(0x1ef)],_0x25fb6a[_0x24e9c6(0x1d9)]);if(_0x25fb6a?.['gitBranch'])_0x4921dc['set']('gitBranch',_0x25fb6a[_0x24e9c6(0x1e6)]);if(_0x25fb6a?.[_0x24e9c6(0x1e7)])_0x4921dc['set']('limit',_0x25fb6a[_0x24e9c6(0x1e7)]['toString']());if(_0x25fb6a?.['offset'])_0x4921dc['set']('offset',_0x25fb6a['offset'][_0x24e9c6(0x1e2)]());if(_0x25fb6a?.[_0x24e9c6(0x217)])_0x4921dc['set'](_0x24e9c6(0x217),'true');const _0xbdef09=_0x5ce65d+'/api/v1/mcp/features'+(_0x4921dc[_0x24e9c6(0x1e2)]()?'?'+_0x4921dc[_0x24e9c6(0x1e2)]():''),_0x4d0f54=await fetch(_0xbdef09,{'method':_0x41a8b8[_0x24e9c6(0x210)],'headers':{'Authorization':'Bearer\x20'+_0x4cb5e6}});if(!_0x4d0f54['ok']){const _0x3c204f=await _0x4d0f54['text']();throw new Error(_0x24e9c6(0x1cd)+_0x3c204f);}return _0x4d0f54[_0x24e9c6(0x214)]();}export async function getFeature(_0x47d2c6){const _0x55bfac=_0x1469,_0x4e3540={'SsPBo':function(_0xb4c9d9){return _0xb4c9d9();},'JoIdp':_0x55bfac(0x1d5),'fIRVi':function(_0x30b960){return _0x30b960();},'PYqQF':_0x55bfac(0x1dc)},_0x1fd396=await _0x4e3540[_0x55bfac(0x212)](getToken);if(!_0x1fd396)throw new Error(_0x4e3540[_0x55bfac(0x206)]);const _0x47dd26=_0x4e3540['fIRVi'](getApiBaseUrl),_0x23a3a1=await fetch(_0x47dd26+_0x55bfac(0x1dd)+_0x47d2c6,{'method':_0x4e3540['PYqQF'],'headers':{'Authorization':_0x55bfac(0x1f7)+_0x1fd396}});if(!_0x23a3a1['ok']){const _0x41ffd0=await _0x23a3a1['text']();throw new Error(_0x55bfac(0x1ee)+_0x41ffd0);}return _0x23a3a1[_0x55bfac(0x214)]();}export async function updateFeature(_0x3c4dea,_0x42e7af){const _0x78b706=_0x1469,_0x58aa46={'nhznc':function(_0x408d9f){return _0x408d9f();},'JwcTK':function(_0x1d3f68){return _0x1d3f68();},'ektvF':function(_0xae4b,_0x3e6dbd,_0x42d002){return _0xae4b(_0x3e6dbd,_0x42d002);}},_0x328345=await _0x58aa46['nhznc'](getToken);if(!_0x328345)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x411a97=_0x58aa46[_0x78b706(0x213)](getApiBaseUrl),_0x2b5a2f=await _0x58aa46['ektvF'](fetch,_0x411a97+_0x78b706(0x1dd)+_0x3c4dea,{'method':_0x78b706(0x1e9),'headers':{'Authorization':_0x78b706(0x1f7)+_0x328345,'Content-Type':'application/json'},'body':JSON[_0x78b706(0x1e4)](_0x42e7af)});if(!_0x2b5a2f['ok']){const _0x16dc9c=await _0x2b5a2f['text']();throw new Error(_0x78b706(0x1eb)+_0x16dc9c);}return _0x2b5a2f[_0x78b706(0x214)]();}export async function createChecklistItem(_0x636f89,_0x242505,_0x2f0012){const _0x72d8fa=_0x1469,_0x452fe5={'kESvd':_0x72d8fa(0x1d5),'heNnE':function(_0x2d95e9,_0x5b7099,_0x347468){return _0x2d95e9(_0x5b7099,_0x347468);},'QZLvG':_0x72d8fa(0x1c9),'aGkaO':_0x72d8fa(0x1fc)},_0x3e9443=await getToken();if(!_0x3e9443)throw new Error(_0x452fe5['kESvd']);const _0x328a66=getApiBaseUrl(),_0x3dcb60=await _0x452fe5[_0x72d8fa(0x1df)](fetch,_0x328a66+_0x72d8fa(0x1dd)+_0x636f89+_0x72d8fa(0x1f1),{'method':_0x452fe5[_0x72d8fa(0x211)],'headers':{'Authorization':'Bearer\x20'+_0x3e9443,'Content-Type':_0x452fe5[_0x72d8fa(0x201)]},'body':JSON[_0x72d8fa(0x1e4)]({'description':_0x242505,'position':_0x2f0012})});if(!_0x3dcb60['ok']){const _0x2ef126=await _0x3dcb60[_0x72d8fa(0x209)]();throw new Error(_0x72d8fa(0x1d4)+_0x2ef126);}return _0x3dcb60['json']();}export async function updateChecklistItem(_0x50e540,_0x2e5430,_0x2aca89){const _0x59bacc=_0x1469,_0x5c089e={'SbwoA':function(_0x58893e){return _0x58893e();},'qrTYz':function(_0x41ee50,_0x2488ea,_0x1d9ed7){return _0x41ee50(_0x2488ea,_0x1d9ed7);},'Qltcm':_0x59bacc(0x1e9),'COBQb':_0x59bacc(0x1fc),'HmjqF':_0x59bacc(0x1f3)};return withRetry(async()=>{const _0x315ba2=_0x59bacc,_0x5ad0f0=await _0x5c089e['SbwoA'](getToken);if(!_0x5ad0f0)throw new Error(_0x315ba2(0x1d5));const _0x597800=_0x5c089e['SbwoA'](getApiBaseUrl),_0x3161be=await _0x5c089e[_0x315ba2(0x218)](fetch,_0x597800+_0x315ba2(0x1dd)+_0x50e540+'/checklist/'+_0x2e5430,{'method':_0x5c089e[_0x315ba2(0x20d)],'headers':{'Authorization':'Bearer\x20'+_0x5ad0f0,'Content-Type':_0x5c089e[_0x315ba2(0x20a)]},'body':JSON[_0x315ba2(0x1e4)](_0x2aca89)});if(!_0x3161be['ok']){const _0x44dcfa=await _0x3161be[_0x315ba2(0x209)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x44dcfa);}return _0x3161be['json']();},{'label':_0x5c089e['HmjqF']});}export async function getFeatureReport(_0x59559a){const _0x2eb895=_0x1469,_0x181e4e={'buAiU':'GET'},_0x1eafba=await getToken();if(!_0x1eafba)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2a74b3=getApiBaseUrl(),_0x537503=await fetch(_0x2a74b3+'/api/v1/mcp/features/'+_0x59559a+_0x2eb895(0x208),{'method':_0x181e4e['buAiU'],'headers':{'Authorization':'Bearer\x20'+_0x1eafba}});if(!_0x537503['ok']){const _0x1855c4=await _0x537503[_0x2eb895(0x209)]();throw new Error(_0x2eb895(0x1fa)+_0x1855c4);}return _0x537503['json']();}export async function getFeatureReportMarkdown(_0x4a1ac7,_0x3d5b58){const _0x568158=_0x1469,_0x23f092={'cWFCE':_0x568158(0x1d5),'BrQKX':function(_0x2906fd,_0x4bdbb6){return _0x2906fd>_0x4bdbb6;},'OkIcu':_0x568158(0x1fd),'iukQz':function(_0x4f379b,_0x3c557d){return _0x4f379b&&_0x3c557d;},'uTgAv':function(_0xf740e0,_0x2dbfff,_0x4c945f){return _0xf740e0(_0x2dbfff,_0x4c945f);},'qaYSv':_0x568158(0x1dc)},_0x172019=await getToken();if(!_0x172019)throw new Error(_0x23f092['cWFCE']);const _0x111715=getApiBaseUrl(),_0x42abcf=new URLSearchParams(),_0x46ea16=_0x23f092['BrQKX'](_0x3d5b58?.[_0x568158(0x1fd)]?.['length']??0x0,0x0),_0x370fdc=Boolean(_0x3d5b58?.[_0x568158(0x215)]);_0x46ea16&&_0x3d5b58?.[_0x568158(0x1fd)]&&_0x42abcf[_0x568158(0x1d6)](_0x23f092['OkIcu'],_0x3d5b58[_0x568158(0x1fd)]['join'](','));_0x370fdc&&_0x3d5b58?.['sessionId']&&_0x42abcf[_0x568158(0x1d6)](_0x568158(0x215),_0x3d5b58['sessionId']);_0x23f092['iukQz'](!_0x46ea16,!_0x370fdc)&&_0x3d5b58?.['style']&&_0x42abcf[_0x568158(0x1d6)]('style',_0x3d5b58[_0x568158(0x1ce)]);const _0x92799a=_0x111715+_0x568158(0x1dd)+_0x4a1ac7+'/report/markdown',_0x58b2a5=''+_0x92799a+(_0x42abcf[_0x568158(0x1e2)]()?'?'+_0x42abcf[_0x568158(0x1e2)]():''),_0x270632=await _0x23f092['uTgAv'](fetch,_0x58b2a5,{'method':_0x23f092['qaYSv'],'headers':{'Authorization':_0x568158(0x1f7)+_0x172019}});if(!_0x270632['ok']){const _0x2aabd5=await _0x270632['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x2aabd5);}return _0x270632['text']();}export async function listFeatureSessions(_0x345e58){const _0x789cb6=_0x1469,_0x3cba53={'wynga':function(_0xf0ebf3){return _0xf0ebf3();},'pVURw':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','OuztC':'GET'},_0x384a87=await _0x3cba53[_0x789cb6(0x1f6)](getToken);if(!_0x384a87)throw new Error(_0x3cba53[_0x789cb6(0x1f0)]);const _0x3aaf9c=getApiBaseUrl(),_0x224af3=await fetch(_0x3aaf9c+'/api/v1/mcp/features/'+_0x345e58+_0x789cb6(0x205),{'method':_0x3cba53[_0x789cb6(0x1ec)],'headers':{'Authorization':_0x789cb6(0x1f7)+_0x384a87}});if(!_0x224af3['ok']){const _0x30ef8f=await _0x224af3['text']();throw new Error(_0x789cb6(0x1f2)+_0x30ef8f);}return _0x224af3[_0x789cb6(0x214)]();}export async function startSession(_0x6a6f,_0x5f161f){const _0x38f97b=_0x1469,_0x532693={'dSkAF':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','UgjfF':function(_0x445836){return _0x445836();},'CIeAj':function(_0x36b1e6,_0x71677,_0xa18b2){return _0x36b1e6(_0x71677,_0xa18b2);},'hrKWG':_0x38f97b(0x1c9)},_0x13b31e=await getToken();if(!_0x13b31e)throw new Error(_0x532693['dSkAF']);const _0x4743b5=_0x532693['UgjfF'](getApiBaseUrl),_0x21d117=await _0x532693[_0x38f97b(0x1da)](fetch,_0x4743b5+'/api/v1/mcp/features/'+_0x6a6f+'/sessions/'+_0x5f161f+'/start',{'method':_0x532693[_0x38f97b(0x1d0)],'headers':{'Authorization':_0x38f97b(0x1f7)+_0x13b31e}});if(!_0x21d117['ok']){const _0x36d8b4=await _0x21d117['text']();throw new Error(_0x38f97b(0x20f)+_0x36d8b4);}return _0x21d117['json']();}export async function concludeSession(_0x222d1e,_0x2a3b92){const _0x26b03e=_0x1469,_0x1ee649={'mJXzg':function(_0x450c6a){return _0x450c6a();},'YMAbv':_0x26b03e(0x1c9)},_0x2cdeef=await _0x1ee649[_0x26b03e(0x200)](getToken);if(!_0x2cdeef)throw new Error(_0x26b03e(0x1d5));const _0x5ac05c=getApiBaseUrl(),_0x910d94=await fetch(_0x5ac05c+'/api/v1/mcp/features/'+_0x222d1e+'/sessions/'+_0x2a3b92+_0x26b03e(0x202),{'method':_0x1ee649['YMAbv'],'headers':{'Authorization':'Bearer\x20'+_0x2cdeef}});if(!_0x910d94['ok']){const _0x56c63f=await _0x910d94['text']();throw new Error(_0x26b03e(0x1ea)+_0x56c63f);}return _0x910d94['json']();}export async function getActionItems(_0x1721db){const _0x2b1114=_0x1469,_0x180b8a=await getToken();if(!_0x180b8a)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x72583f=getApiBaseUrl(),_0x3a621d=await fetch(_0x72583f+_0x2b1114(0x1dd)+_0x1721db+_0x2b1114(0x1d7),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x180b8a}});if(!_0x3a621d['ok']){const _0x322d11=await _0x3a621d[_0x2b1114(0x209)]();throw new Error(_0x2b1114(0x1d2)+_0x322d11);}return _0x3a621d[_0x2b1114(0x214)]();}export async function getItemFeedback(_0xeb615,_0x3858c0){const _0x1213ea=_0x1469,_0xb56d60={'VdDrO':function(_0x2abaab){return _0x2abaab();},'avoOe':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','iQrrI':function(_0x4a2f53,_0x4b2fb4,_0x3ddb54){return _0x4a2f53(_0x4b2fb4,_0x3ddb54);},'fHepa':'GET'},_0x513d5f=await _0xb56d60['VdDrO'](getToken);if(!_0x513d5f)throw new Error(_0xb56d60[_0x1213ea(0x1d8)]);const _0x104ad0=getApiBaseUrl(),_0x3e5448=await _0xb56d60[_0x1213ea(0x1fb)](fetch,_0x104ad0+'/api/v1/mcp/features/'+_0xeb615+_0x1213ea(0x1ca)+_0x3858c0+'/feedback',{'method':_0xb56d60['fHepa'],'headers':{'Authorization':_0x1213ea(0x1f7)+_0x513d5f}});if(!_0x3e5448['ok']){const _0x3f0141=await _0x3e5448[_0x1213ea(0x209)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x3f0141);}return _0x3e5448[_0x1213ea(0x214)]();}export async function markCommentsAddressed(_0x27fba0,_0x2808a2,_0x2d7381){const _0x283da9=_0x1469,_0x312a13={'DaQIH':function(_0x54454d){return _0x54454d();},'Kragl':function(_0x3b0c29){return _0x3b0c29();},'Kctkh':function(_0x1a43a0,_0x223901,_0x367d98){return _0x1a43a0(_0x223901,_0x367d98);},'JFhBI':'application/json'},_0x46b66d=await _0x312a13[_0x283da9(0x1ed)](getToken);if(!_0x46b66d)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xbd993d=_0x312a13[_0x283da9(0x216)](getApiBaseUrl),_0x5b0324=await _0x312a13[_0x283da9(0x20c)](fetch,_0xbd993d+_0x283da9(0x1dd)+_0x27fba0+'/comments/address',{'method':_0x283da9(0x1c9),'headers':{'Authorization':_0x283da9(0x1f7)+_0x46b66d,'Content-Type':_0x312a13['JFhBI']},'body':JSON[_0x283da9(0x1e4)]({'checklistItemId':_0x2808a2,'commentIds':_0x2d7381})});if(!_0x5b0324['ok']){const _0x3e4a33=await _0x5b0324['text']();throw new Error(_0x283da9(0x1cc)+_0x3e4a33);}}export async function softDeleteFeature(_0x4f7d43){const _0x3e310d=_0x1469,_0x35f5a6=await getToken();if(!_0x35f5a6)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x4ad880=getApiBaseUrl(),_0x5bc1e9=await fetch(_0x4ad880+_0x3e310d(0x1dd)+_0x4f7d43,{'method':'DELETE','headers':{'Authorization':_0x3e310d(0x1f7)+_0x35f5a6}});if(!_0x5bc1e9['ok']){const _0x3a938e=await _0x5bc1e9['text']();throw new Error(_0x3e310d(0x1fe)+_0x3a938e);}}function _0x1469(_0x2e040f,_0x116176){_0x2e040f=_0x2e040f-0x1c8;const _0x4e1825=_0x4e18();let _0x146925=_0x4e1825[_0x2e040f];return _0x146925;}export async function restoreFeature(_0x3b2078){const _0x57d5e2=_0x1469,_0x53eb5d={'mPjqt':function(_0x4d18d2){return _0x4d18d2();},'AXENE':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','mYwvI':function(_0x5adf9c){return _0x5adf9c();},'eYCnK':function(_0x5ea1dc,_0x46608b,_0x60e8ae){return _0x5ea1dc(_0x46608b,_0x60e8ae);},'cecvp':_0x57d5e2(0x1c9)},_0x5c0f55=await _0x53eb5d[_0x57d5e2(0x20e)](getToken);if(!_0x5c0f55)throw new Error(_0x53eb5d[_0x57d5e2(0x1e1)]);const _0x37fd49=_0x53eb5d[_0x57d5e2(0x1f8)](getApiBaseUrl),_0x5ebb6f=await _0x53eb5d[_0x57d5e2(0x1c8)](fetch,_0x37fd49+_0x57d5e2(0x1dd)+_0x3b2078+'/restore',{'method':_0x53eb5d[_0x57d5e2(0x1e5)],'headers':{'Authorization':'Bearer\x20'+_0x5c0f55}});if(!_0x5ebb6f['ok']){const _0x2fa535=await _0x5ebb6f[_0x57d5e2(0x209)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x2fa535);}}
1
+ (function(_0xc8fc6a,_0x3fc505){const _0x161849=_0x5ab3,_0x45db96=_0xc8fc6a();while(!![]){try{const _0x2ff89b=parseInt(_0x161849(0x1c8))/0x1*(parseInt(_0x161849(0x1c4))/0x2)+-parseInt(_0x161849(0x1dc))/0x3+-parseInt(_0x161849(0x1d2))/0x4+parseInt(_0x161849(0x1bf))/0x5*(parseInt(_0x161849(0x1b3))/0x6)+-parseInt(_0x161849(0x1d3))/0x7*(-parseInt(_0x161849(0x1c6))/0x8)+-parseInt(_0x161849(0x1ee))/0x9+-parseInt(_0x161849(0x1e9))/0xa*(-parseInt(_0x161849(0x1e2))/0xb);if(_0x2ff89b===_0x3fc505)break;else _0x45db96['push'](_0x45db96['shift']());}catch(_0x300555){_0x45db96['push'](_0x45db96['shift']());}}}(_0xf971,0x89347));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x2c8654){const _0x1b0f56=_0x5ab3,_0x530363={'iUuya':function(_0x1b97fb,_0xf3b0ed,_0x3ad6ea){return _0x1b97fb(_0xf3b0ed,_0x3ad6ea);},'nNVga':'POST','ytNiz':_0x1b0f56(0x1c7),'RriVj':_0x1b0f56(0x1d6)},_0x1267cc=await getToken();if(!_0x1267cc)throw new Error(_0x1b0f56(0x1be));const _0x1351b1=getApiBaseUrl(),_0x5edd2c=await _0x530363['iUuya'](fetch,_0x1351b1+_0x1b0f56(0x1ae),{'method':_0x530363[_0x1b0f56(0x1b0)],'headers':{'Authorization':_0x1b0f56(0x1b4)+_0x1267cc,'Content-Type':_0x1b0f56(0x1c5)},'body':JSON[_0x1b0f56(0x1e8)](_0x2c8654)});if(!_0x5edd2c['ok']){if(_0x5edd2c['status']===0x192){const _0x426d50=await _0x5edd2c[_0x1b0f56(0x1cd)](),_0xcddc2e=_0x426d50['billingUrl']||_0x530363['ytNiz'];throw new Error((_0x426d50[_0x1b0f56(0x1b2)]||_0x530363['RriVj'])+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0xcddc2e);}const _0x10b4ff=await _0x5edd2c[_0x1b0f56(0x1dd)]();throw new Error('Failed\x20to\x20create\x20feature\x20review:\x20'+_0x10b4ff);}return _0x5edd2c[_0x1b0f56(0x1cd)]();}export async function listFeatures(_0x5590a9){const _0x45ccb0=_0x5ab3,_0x1cebc3={'sPuKw':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','dPBmC':_0x45ccb0(0x1e4),'NmgaF':_0x45ccb0(0x1d1),'ByhDX':_0x45ccb0(0x1b5),'iPLPI':'true','ojsVC':_0x45ccb0(0x1da)},_0x5e0e30=await getToken();if(!_0x5e0e30)throw new Error(_0x1cebc3['sPuKw']);const _0x58247c=getApiBaseUrl(),_0x5f648a=new URLSearchParams();if(_0x5590a9?.['gitRepoUrl'])_0x5f648a['set'](_0x45ccb0(0x1d8),_0x5590a9['gitRepoUrl']);if(_0x5590a9?.['gitBranch'])_0x5f648a[_0x45ccb0(0x1cb)](_0x45ccb0(0x1c3),_0x5590a9[_0x45ccb0(0x1c3)]);if(_0x5590a9?.[_0x45ccb0(0x1e4)])_0x5f648a[_0x45ccb0(0x1cb)](_0x1cebc3[_0x45ccb0(0x1e7)],_0x5590a9[_0x45ccb0(0x1e4)]['toString']());if(_0x5590a9?.['offset'])_0x5f648a[_0x45ccb0(0x1cb)](_0x1cebc3['NmgaF'],_0x5590a9['offset']['toString']());if(_0x5590a9?.['includeDeleted'])_0x5f648a[_0x45ccb0(0x1cb)](_0x1cebc3[_0x45ccb0(0x1c1)],_0x1cebc3['iPLPI']);const _0x298137=_0x58247c+'/api/v1/mcp/features'+(_0x5f648a['toString']()?'?'+_0x5f648a['toString']():''),_0x41b440=await fetch(_0x298137,{'method':_0x1cebc3[_0x45ccb0(0x1c2)],'headers':{'Authorization':_0x45ccb0(0x1b4)+_0x5e0e30}});if(!_0x41b440['ok']){const _0x4f86ad=await _0x41b440[_0x45ccb0(0x1dd)]();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x4f86ad);}return _0x41b440['json']();}export async function getFeature(_0x5e78af){const _0x365488=_0x5ab3,_0x307e4a={'CsGUn':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ZaqAq':function(_0x26b942){return _0x26b942();},'QhLFT':function(_0x61eafc,_0x4c6bdb,_0x1b96a2){return _0x61eafc(_0x4c6bdb,_0x1b96a2);},'FRxfc':'GET'},_0x207f14=await getToken();if(!_0x207f14)throw new Error(_0x307e4a['CsGUn']);const _0x26bb6f=_0x307e4a['ZaqAq'](getApiBaseUrl),_0x1281c5=await _0x307e4a['QhLFT'](fetch,_0x26bb6f+_0x365488(0x1ea)+_0x5e78af,{'method':_0x307e4a[_0x365488(0x1de)],'headers':{'Authorization':_0x365488(0x1b4)+_0x207f14}});if(!_0x1281c5['ok']){const _0xdc5fa3=await _0x1281c5[_0x365488(0x1dd)]();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0xdc5fa3);}return _0x1281c5['json']();}export async function updateFeature(_0x4cec26,_0x526a04){const _0x174050=_0x5ab3,_0x359a61={'WuMEy':function(_0x577392){return _0x577392();},'aGpub':_0x174050(0x1be),'dypBT':function(_0xd63b77,_0x17d9e3,_0x290c82){return _0xd63b77(_0x17d9e3,_0x290c82);},'oUCUU':_0x174050(0x1c5)},_0x1385a5=await _0x359a61[_0x174050(0x1db)](getToken);if(!_0x1385a5)throw new Error(_0x359a61[_0x174050(0x1c0)]);const _0x28696c=getApiBaseUrl(),_0x4d0c39=await _0x359a61['dypBT'](fetch,_0x28696c+_0x174050(0x1ea)+_0x4cec26,{'method':'PATCH','headers':{'Authorization':_0x174050(0x1b4)+_0x1385a5,'Content-Type':_0x359a61[_0x174050(0x1bc)]},'body':JSON['stringify'](_0x526a04)});if(!_0x4d0c39['ok']){const _0x4c57de=await _0x4d0c39[_0x174050(0x1dd)]();throw new Error(_0x174050(0x1e0)+_0x4c57de);}return _0x4d0c39[_0x174050(0x1cd)]();}export async function createChecklistItem(_0x304019,_0x29eb4a,_0x94e7eb){const _0x12aafc=_0x5ab3,_0xef097={'AzYMW':function(_0x402f36){return _0x402f36();},'gtYPC':_0x12aafc(0x1be),'Qblke':function(_0x507dd7,_0x39eb11,_0x407963){return _0x507dd7(_0x39eb11,_0x407963);},'IwABC':'POST','jourz':_0x12aafc(0x1c5)},_0x246bbf=await _0xef097['AzYMW'](getToken);if(!_0x246bbf)throw new Error(_0xef097[_0x12aafc(0x1bd)]);const _0x57b707=getApiBaseUrl(),_0x240d86=await _0xef097[_0x12aafc(0x1ab)](fetch,_0x57b707+'/api/v1/mcp/features/'+_0x304019+'/checklist',{'method':_0xef097['IwABC'],'headers':{'Authorization':_0x12aafc(0x1b4)+_0x246bbf,'Content-Type':_0xef097['jourz']},'body':JSON['stringify']({'description':_0x29eb4a,'position':_0x94e7eb})});if(!_0x240d86['ok']){const _0x3564cb=await _0x240d86[_0x12aafc(0x1dd)]();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x3564cb);}return _0x240d86[_0x12aafc(0x1cd)]();}function _0xf971(){const _0x5e4015=['POST','GET','WuMEy','3331512KADSoF','text','FRxfc','QmLNv','Failed\x20to\x20update\x20feature\x20review:\x20','style','165ksjiUE','HxNwL','limit','JZkBX','/report','dPBmC','stringify','696770SUlory','/api/v1/mcp/features/','nnuTS','xiauD','pOACF','7139736fwfJip','zNAxf','join','RfZMm','llLYs','Qblke','FmQio','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','/api/v1/mcp/features','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','nNVga','bmiKS','message','2988774zYwhOG','Bearer\x20','includeDeleted','FWQJL','/sessions','/action-items','itemIds','ECTfL','/sessions/','oUCUU','gtYPC','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','5fRMpfa','aGpub','ByhDX','ojsVC','gitBranch','2ftvwew','application/json','363704KFcjwS','https://dashboard.ranger.net/billing','1064311IuqNFh','mZTJK','gPgbw','set','URPsy','json','sessionId','PATCH','Failed\x20to\x20get\x20action\x20items:\x20','offset','749036KaMaht','7wmwOCS','/checklist/','Failed\x20to\x20restore\x20feature\x20review:\x20','Feature\x20limit\x20exceeded','toString','gitRepoUrl'];_0xf971=function(){return _0x5e4015;};return _0xf971();}export async function updateChecklistItem(_0xdb0043,_0x37a051,_0x323f8f){const _0x2cb7c4=_0x5ab3,_0x37d0b4={'ECTfL':_0x2cb7c4(0x1be),'bmiKS':function(_0x96897c){return _0x96897c();},'AZajk':function(_0x505e89,_0x308433,_0x319a5a){return _0x505e89(_0x308433,_0x319a5a);},'FmQio':'updateChecklistItem'};return withRetry(async()=>{const _0x58862a=_0x2cb7c4,_0x32dcfd=await getToken();if(!_0x32dcfd)throw new Error(_0x37d0b4[_0x58862a(0x1ba)]);const _0x24bf04=_0x37d0b4[_0x58862a(0x1b1)](getApiBaseUrl),_0x4af4e4=await _0x37d0b4['AZajk'](fetch,_0x24bf04+'/api/v1/mcp/features/'+_0xdb0043+_0x58862a(0x1d4)+_0x37a051,{'method':_0x58862a(0x1cf),'headers':{'Authorization':'Bearer\x20'+_0x32dcfd,'Content-Type':_0x58862a(0x1c5)},'body':JSON[_0x58862a(0x1e8)](_0x323f8f)});if(!_0x4af4e4['ok']){const _0x7fdaec=await _0x4af4e4[_0x58862a(0x1dd)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x7fdaec);}return _0x4af4e4['json']();},{'label':_0x37d0b4[_0x2cb7c4(0x1ac)]});}export async function getFeatureReport(_0x5b346d){const _0x366ded=_0x5ab3,_0x53a82b={'zNAxf':function(_0x217856){return _0x217856();},'DcEOi':_0x366ded(0x1be),'dnMJC':function(_0x331bf4,_0xa1fc43,_0x54d97f){return _0x331bf4(_0xa1fc43,_0x54d97f);}},_0x4b4d31=await _0x53a82b[_0x366ded(0x1ef)](getToken);if(!_0x4b4d31)throw new Error(_0x53a82b['DcEOi']);const _0x55af09=getApiBaseUrl(),_0x15d394=await _0x53a82b['dnMJC'](fetch,_0x55af09+'/api/v1/mcp/features/'+_0x5b346d+_0x366ded(0x1e6),{'method':'GET','headers':{'Authorization':_0x366ded(0x1b4)+_0x4b4d31}});if(!_0x15d394['ok']){const _0x44c6c3=await _0x15d394['text']();throw new Error(_0x366ded(0x1af)+_0x44c6c3);}return _0x15d394['json']();}export async function getFeatureReportMarkdown(_0x16aecf,_0x5ce775){const _0x3792ef=_0x5ab3,_0x43aa2e={'zOHcB':function(_0x11071c){return _0x11071c();},'SXFgQ':function(_0x10ef16){return _0x10ef16();},'VpNsI':function(_0x4b75a2,_0x2ffdc9){return _0x4b75a2>_0x2ffdc9;},'gFFxq':'style','gPgbw':function(_0x1cf4d1,_0xf26e75,_0x2237d1){return _0x1cf4d1(_0xf26e75,_0x2237d1);}},_0x332f65=await _0x43aa2e['zOHcB'](getToken);if(!_0x332f65)throw new Error(_0x3792ef(0x1be));const _0x33bcd3=_0x43aa2e['SXFgQ'](getApiBaseUrl),_0x793ffe=new URLSearchParams(),_0x43746c=_0x43aa2e['VpNsI'](_0x5ce775?.[_0x3792ef(0x1b9)]?.['length']??0x0,0x0),_0x42c30f=Boolean(_0x5ce775?.[_0x3792ef(0x1ce)]);_0x43746c&&_0x5ce775?.[_0x3792ef(0x1b9)]&&_0x793ffe[_0x3792ef(0x1cb)]('itemIds',_0x5ce775['itemIds'][_0x3792ef(0x1f0)](','));_0x42c30f&&_0x5ce775?.['sessionId']&&_0x793ffe['set'](_0x3792ef(0x1ce),_0x5ce775[_0x3792ef(0x1ce)]);!_0x43746c&&!_0x42c30f&&_0x5ce775?.['style']&&_0x793ffe['set'](_0x43aa2e['gFFxq'],_0x5ce775[_0x3792ef(0x1e1)]);const _0x39edb2=_0x33bcd3+_0x3792ef(0x1ea)+_0x16aecf+'/report/markdown',_0x138a7d=''+_0x39edb2+(_0x793ffe[_0x3792ef(0x1d7)]()?'?'+_0x793ffe['toString']():''),_0x3d2515=await _0x43aa2e[_0x3792ef(0x1ca)](fetch,_0x138a7d,{'method':_0x3792ef(0x1da),'headers':{'Authorization':_0x3792ef(0x1b4)+_0x332f65}});if(!_0x3d2515['ok']){const _0x504cce=await _0x3d2515[_0x3792ef(0x1dd)]();throw new Error(_0x3792ef(0x1ad)+_0x504cce);}return _0x3d2515['text']();}export async function listFeatureSessions(_0x54daec){const _0xbd55d5=_0x5ab3,_0x10672a={'NdliS':function(_0x52da43){return _0x52da43();}},_0xe9a5c7=await getToken();if(!_0xe9a5c7)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x30d0f9=_0x10672a['NdliS'](getApiBaseUrl),_0x36f358=await fetch(_0x30d0f9+_0xbd55d5(0x1ea)+_0x54daec+_0xbd55d5(0x1b7),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0xe9a5c7}});if(!_0x36f358['ok']){const _0x2c9007=await _0x36f358['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x2c9007);}return _0x36f358['json']();}export async function startSession(_0x2261f9,_0x56b94f){const _0xaf718e=_0x5ab3,_0x3fb96d={'llLYs':function(_0x4e157f){return _0x4e157f();},'URPsy':_0xaf718e(0x1be),'XnHAr':_0xaf718e(0x1d9)},_0x5bd505=await _0x3fb96d[_0xaf718e(0x1aa)](getToken);if(!_0x5bd505)throw new Error(_0x3fb96d[_0xaf718e(0x1cc)]);const _0x4c2de9=_0x3fb96d['llLYs'](getApiBaseUrl),_0x5d21fd=await fetch(_0x4c2de9+_0xaf718e(0x1ea)+_0x2261f9+_0xaf718e(0x1bb)+_0x56b94f+'/start',{'method':_0x3fb96d['XnHAr'],'headers':{'Authorization':_0xaf718e(0x1b4)+_0x5bd505}});if(!_0x5d21fd['ok']){const _0x35eeb5=await _0x5d21fd['text']();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x35eeb5);}return _0x5d21fd['json']();}export async function concludeSession(_0x590558,_0xb9e7a){const _0x4b98e6=_0x5ab3,_0x3c53f9={'nnuTS':function(_0x59d485){return _0x59d485();},'gRGJR':function(_0x4653fc){return _0x4653fc();},'SLzMa':_0x4b98e6(0x1d9)},_0x4249e9=await _0x3c53f9[_0x4b98e6(0x1eb)](getToken);if(!_0x4249e9)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x22e727=_0x3c53f9['gRGJR'](getApiBaseUrl),_0x49cf5d=await fetch(_0x22e727+_0x4b98e6(0x1ea)+_0x590558+'/sessions/'+_0xb9e7a+'/conclude',{'method':_0x3c53f9['SLzMa'],'headers':{'Authorization':_0x4b98e6(0x1b4)+_0x4249e9}});if(!_0x49cf5d['ok']){const _0x4d4cf5=await _0x49cf5d[_0x4b98e6(0x1dd)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x4d4cf5);}return _0x49cf5d['json']();}function _0x5ab3(_0x3bcc0,_0x1c0982){_0x3bcc0=_0x3bcc0-0x1aa;const _0xf9714f=_0xf971();let _0x5ab341=_0xf9714f[_0x3bcc0];return _0x5ab341;}export async function getActionItems(_0x3bdbca){const _0x15557e=_0x5ab3,_0x23934e={'HxNwL':_0x15557e(0x1be),'DlARo':function(_0x2c72f3){return _0x2c72f3();},'fHVIp':function(_0x1bf540,_0x1a1d9c,_0x107b76){return _0x1bf540(_0x1a1d9c,_0x107b76);}},_0x8a6fbc=await getToken();if(!_0x8a6fbc)throw new Error(_0x23934e[_0x15557e(0x1e3)]);const _0x1a7dd3=_0x23934e['DlARo'](getApiBaseUrl),_0x104b2f=await _0x23934e['fHVIp'](fetch,_0x1a7dd3+'/api/v1/mcp/features/'+_0x3bdbca+_0x15557e(0x1b8),{'method':_0x15557e(0x1da),'headers':{'Authorization':_0x15557e(0x1b4)+_0x8a6fbc}});if(!_0x104b2f['ok']){const _0x3ad4b3=await _0x104b2f[_0x15557e(0x1dd)]();throw new Error(_0x15557e(0x1d0)+_0x3ad4b3);}return _0x104b2f[_0x15557e(0x1cd)]();}export async function getItemFeedback(_0x48ddca,_0x4ff8a9){const _0x4db05b=_0x5ab3,_0x1402e1={'FWQJL':function(_0x4e9453){return _0x4e9453();}},_0x1b36da=await getToken();if(!_0x1b36da)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5a04db=_0x1402e1[_0x4db05b(0x1b6)](getApiBaseUrl),_0x231830=await fetch(_0x5a04db+'/api/v1/mcp/features/'+_0x48ddca+'/checklist-items/'+_0x4ff8a9+'/feedback',{'method':_0x4db05b(0x1da),'headers':{'Authorization':_0x4db05b(0x1b4)+_0x1b36da}});if(!_0x231830['ok']){const _0x5aa91d=await _0x231830[_0x4db05b(0x1dd)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x5aa91d);}return _0x231830[_0x4db05b(0x1cd)]();}export async function markCommentsAddressed(_0x3457ba,_0x53a804,_0x51ddfe){const _0x1e7b3e=_0x5ab3,_0x135dbb={'QmLNv':function(_0x3a3449){return _0x3a3449();},'tTLVS':function(_0x3b26a2,_0x2a25c3,_0x4f4a0c){return _0x3b26a2(_0x2a25c3,_0x4f4a0c);},'RfZMm':'POST','HxQvx':'application/json'},_0x5eb290=await _0x135dbb['QmLNv'](getToken);if(!_0x5eb290)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x74107d=_0x135dbb[_0x1e7b3e(0x1df)](getApiBaseUrl),_0x3bde11=await _0x135dbb['tTLVS'](fetch,_0x74107d+'/api/v1/mcp/features/'+_0x3457ba+'/comments/address',{'method':_0x135dbb[_0x1e7b3e(0x1f1)],'headers':{'Authorization':'Bearer\x20'+_0x5eb290,'Content-Type':_0x135dbb['HxQvx']},'body':JSON['stringify']({'checklistItemId':_0x53a804,'commentIds':_0x51ddfe})});if(!_0x3bde11['ok']){const _0x1bb433=await _0x3bde11['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x1bb433);}}export async function softDeleteFeature(_0x114554){const _0xfe0c88=_0x5ab3,_0x6d3a4f={'xiauD':function(_0x5e05c5){return _0x5e05c5();},'mZTJK':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','cLeGW':function(_0x11018e,_0x414962,_0x1cee8c){return _0x11018e(_0x414962,_0x1cee8c);}},_0x478dbe=await _0x6d3a4f[_0xfe0c88(0x1ec)](getToken);if(!_0x478dbe)throw new Error(_0x6d3a4f[_0xfe0c88(0x1c9)]);const _0x55a8d9=_0x6d3a4f['xiauD'](getApiBaseUrl),_0x5da8cc=await _0x6d3a4f['cLeGW'](fetch,_0x55a8d9+_0xfe0c88(0x1ea)+_0x114554,{'method':'DELETE','headers':{'Authorization':'Bearer\x20'+_0x478dbe}});if(!_0x5da8cc['ok']){const _0x42c9b6=await _0x5da8cc[_0xfe0c88(0x1dd)]();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x42c9b6);}}export async function restoreFeature(_0x38d684){const _0x16b836=_0x5ab3,_0x422020={'JZkBX':function(_0x4aa872){return _0x4aa872();},'pOACF':function(_0x348a26,_0x5e65c0,_0x1774f3){return _0x348a26(_0x5e65c0,_0x1774f3);},'mizjI':'POST'},_0x50c2f8=await _0x422020['JZkBX'](getToken);if(!_0x50c2f8)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x4e0a48=_0x422020[_0x16b836(0x1e5)](getApiBaseUrl),_0x196f13=await _0x422020[_0x16b836(0x1ed)](fetch,_0x4e0a48+'/api/v1/mcp/features/'+_0x38d684+'/restore',{'method':_0x422020['mizjI'],'headers':{'Authorization':'Bearer\x20'+_0x50c2f8}});if(!_0x196f13['ok']){const _0x1fe187=await _0x196f13[_0x16b836(0x1dd)]();throw new Error(_0x16b836(0x1d5)+_0x1fe187);}}