@ranger-testing/ranger-cli 3.1.5-alpha.aebd071-49 → 3.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -1
  60. package/build/commands/utils/playwrightCli.js +1 -1
  61. package/build/commands/utils/profileMessages.js +1 -1
  62. package/build/commands/utils/profileSetupBanner.js +1 -1
  63. package/build/commands/utils/projectsConfig.js +1 -1
  64. package/build/commands/utils/rangerConfig.js +1 -1
  65. package/build/commands/utils/rangerRoot.js +1 -1
  66. package/build/commands/utils/rangerwrightCli.js +1 -1
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/scenarioOriginCheck.js +1 -1
  71. package/build/commands/utils/sessionCache.js +1 -1
  72. package/build/commands/utils/settings.js +1 -1
  73. package/build/commands/utils/skillContent.js +1 -1
  74. package/build/commands/utils/skills.js +1 -1
  75. package/build/commands/utils/stitchWebmFiles.js +1 -1
  76. package/build/commands/utils/telemetry.js +1 -1
  77. package/build/commands/utils/tokenRefresh.js +1 -1
  78. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  79. package/build/commands/utils/tunnelClient.js +1 -1
  80. package/build/commands/utils/userApi.js +1 -1
  81. package/build/commands/utils/version.js +1 -1
  82. package/build/commands/verifyFeature.js +1 -1
  83. package/build/commands/verifyFeatureCli.js +1 -1
  84. package/build/commands/verifyFeatureNovaCli.js +1 -1
  85. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  86. package/package.json +2 -2
@@ -1 +1 @@
1
- const _0x4cc66b=_0x33f5;(function(_0x3cae3c,_0x484026){const _0x16e8f1=_0x33f5,_0x559c09=_0x3cae3c();while(!![]){try{const _0xfb9191=parseInt(_0x16e8f1(0x1e2))/0x1*(-parseInt(_0x16e8f1(0x1d2))/0x2)+-parseInt(_0x16e8f1(0x21e))/0x3+parseInt(_0x16e8f1(0x270))/0x4+-parseInt(_0x16e8f1(0x245))/0x5+-parseInt(_0x16e8f1(0x283))/0x6*(parseInt(_0x16e8f1(0x1d3))/0x7)+-parseInt(_0x16e8f1(0x1d9))/0x8*(parseInt(_0x16e8f1(0x26a))/0x9)+parseInt(_0x16e8f1(0x24c))/0xa;if(_0xfb9191===_0x484026)break;else _0x559c09['push'](_0x559c09['shift']());}catch(_0x300b72){_0x559c09['push'](_0x559c09['shift']());}}}(_0x20e1,0xcaea0));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x1e4fbc from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,needsTunnel,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{matchAuthEnvironmentByHost,matchAuthEnvironmentExact}from'./matchAuthEnvironment.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0xea255){const _0x2dab9a=_0x33f5,_0x298cf0={'KdmfL':_0x2dab9a(0x218)};try{return new URL(_0xea255)['host'];}catch{return _0x298cf0['KdmfL'];}}function errorMessageForTelemetry(_0x591474){const _0x2454e9=_0x33f5;return _0x591474 instanceof Error?_0x591474[_0x2454e9(0x24e)]:undefined;}function trackBridgeEvent(_0x434bbb,_0x348adf){const _0x2e28db=_0x33f5,_0xecbcf6={'sKPgh':_0x2e28db(0x1ff),'QtJNR':'local_ws_error'};if(!_0x434bbb)return;const _0x39cf9d={'tunnelSessionId':_0x348adf[_0x2e28db(0x1e5)],'tunnelEventType':_0x348adf[_0x2e28db(0x25e)],'connectionId':_0x348adf['connectionId'],'code':_0x348adf['code'],'reason':_0x348adf[_0x2e28db(0x25f)],'error':_0x348adf['error'],'elapsedMs':_0x348adf['elapsedMs'],'activeLocalConnections':_0x348adf[_0x2e28db(0x1fb)],'pendingLocalConnections':_0x348adf['pendingLocalConnections']};_0x434bbb['trackPhaseEnd']('tunnel_bridge_event',_0x39cf9d),(_0x348adf[_0x2e28db(0x25e)]===_0xecbcf6[_0x2e28db(0x23a)]||_0x348adf['type']===_0xecbcf6[_0x2e28db(0x258)])&&void _0x434bbb['trackPhaseError']('tunnel_bridge',new Error(_0x348adf['error']??_0x348adf['type']),_0x39cf9d);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x50021a={'HJZPN':function(_0x162688){return _0x162688();},'mUXUT':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0xfa01bb=await _0x50021a['HJZPN'](getToken);if(!_0xfa01bb)throw new Error(_0x50021a['mUXUT']);return _0xfa01bb;}async function apiRequest(_0x55c645,_0x24f839={}){const _0x5caf54=_0x33f5,_0x372b63={'xwMCa':function(_0x2cb77e){return _0x2cb77e();},'EgohG':'application/json','vYRLh':function(_0x198572,_0x27eb63){return _0x198572===_0x27eb63;},'EEpTB':_0x5caf54(0x271)},_0x2a280d=await _0x372b63['xwMCa'](requireToken),_0x18e5fe=getApiBaseUrl(),_0x1d3322=await fetch(''+_0x18e5fe+_0x55c645,{..._0x24f839,'headers':{'Authorization':_0x5caf54(0x269)+_0x2a280d,'Content-Type':_0x372b63[_0x5caf54(0x1dc)],..._0x24f839[_0x5caf54(0x27d)]??{}}});if(!_0x1d3322['ok']){let _0x2d9f32='',_0x208370;try{const _0x41571c=await _0x1d3322['json'](),_0x27af78=(typeof _0x41571c[_0x5caf54(0x1fe)]==='string'?_0x41571c[_0x5caf54(0x1fe)]:undefined)??JSON[_0x5caf54(0x1fa)](_0x41571c);_0x2d9f32=_0x27af78;_0x372b63['vYRLh'](typeof _0x41571c['test_output'],_0x5caf54(0x271))&&_0x41571c[_0x5caf54(0x1f6)]&&(_0x2d9f32=_0x2d9f32+'\x0a'+_0x41571c[_0x5caf54(0x1f6)]);if(typeof _0x41571c[_0x5caf54(0x25a)]===_0x372b63['EEpTB'])_0x208370=_0x41571c['code'];}catch{_0x2d9f32=_0x1d3322[_0x5caf54(0x225)];}throw new ApiError('API\x20request\x20'+_0x55c645+_0x5caf54(0x223)+_0x1d3322['status']+_0x5caf54(0x21f)+_0x2d9f32,_0x1d3322['status'],_0x2d9f32,_0x208370);}if(_0x1d3322['status']===0xcc)return undefined;return _0x1d3322[_0x5caf54(0x22b)]();}export class ApiError extends Error{['status'];[_0x4cc66b(0x259)];['code'];constructor(_0x29df18,_0x2b5af4,_0x44edcf,_0xb7cff0){const _0x536c0a=_0x4cc66b,_0x260e18={'PEUAb':'ApiError'};super(_0x29df18),this['status']=_0x2b5af4,this['detail']=_0x44edcf,this[_0x536c0a(0x25a)]=_0xb7cff0,this[_0x536c0a(0x1e4)]=_0x260e18[_0x536c0a(0x1f4)];}}export async function fetchCloudProfile(_0x92c461){const _0x4db117=_0x4cc66b,_0x15aacc={'XFbTr':function(_0x58783b,_0x48abdb){return _0x58783b(_0x48abdb);}};try{return await _0x15aacc['XFbTr'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x92c461));}catch(_0xf62e17){if(_0xf62e17 instanceof ApiError&&_0xf62e17[_0x4db117(0x1d5)]===0x194)return null;throw _0xf62e17;}}export async function listCloudProfiles(){const _0x3234a6=_0x4cc66b,_0x58cb28={'AyAFt':_0x3234a6(0x244)},_0x4010ce=await apiRequest(_0x58cb28[_0x3234a6(0x235)]);return _0x4010ce[_0x3234a6(0x26f)];}export async function deleteCloudProfile(_0x28c659){const _0x1f5c37=_0x4cc66b,_0x5e92af={'CwVDU':function(_0xb00e2b,_0x852278,_0x18823f){return _0xb00e2b(_0x852278,_0x18823f);},'dEnRs':function(_0x4b1ff9,_0x2fb6c8){return _0x4b1ff9 instanceof _0x2fb6c8;},'TDPHr':function(_0x474c73,_0x387b93){return _0x474c73===_0x387b93;}};try{await _0x5e92af[_0x1f5c37(0x23e)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x28c659),{'method':_0x1f5c37(0x247)});}catch(_0x432ff6){if(_0x5e92af['dEnRs'](_0x432ff6,ApiError)&&_0x5e92af[_0x1f5c37(0x272)](_0x432ff6[_0x1f5c37(0x1d5)],0x194))throw new Error(_0x1f5c37(0x261)+_0x28c659+_0x1f5c37(0x219));throw _0x432ff6;}}export async function createCloudProfile(_0x57004c,_0xe798be,_0x2d81ad={}){const _0x3eb182=_0x4cc66b,_0x438afb={'YkUVT':function(_0x193962,_0x34e85e){return _0x193962>_0x34e85e;},'NbGuJ':function(_0x3c21b3,_0x265f3,_0x5b252b){return _0x3c21b3(_0x265f3,_0x5b252b);},'GlWHT':'/api/v1/profiles','GHXCf':'POST'},_0x3f3813={'name':_0x57004c};if(_0xe798be)_0x3f3813[_0x3eb182(0x24b)]=_0xe798be;_0x2d81ad[_0x3eb182(0x23b)]&&_0x438afb['YkUVT'](Object['keys'](_0x2d81ad[_0x3eb182(0x23b)])['length'],0x0)&&(_0x3f3813[_0x3eb182(0x23b)]=_0x2d81ad['settings']);if(_0x2d81ad[_0x3eb182(0x1de)])_0x3f3813['username']=_0x2d81ad['username'];if(_0x2d81ad[_0x3eb182(0x257)])_0x3f3813[_0x3eb182(0x257)]=_0x2d81ad['password'];return await _0x438afb['NbGuJ'](apiRequest,_0x438afb['GlWHT'],{'method':_0x438afb[_0x3eb182(0x27e)],'body':JSON['stringify'](_0x3f3813)});}export async function uploadCloudProfileSession(_0x2f9ac4,_0xde6563){const _0x354ca2=_0x4cc66b,_0x5eac73={'sIRSa':function(_0x9968c5,_0x26ac09,_0x2497bd){return _0x9968c5(_0x26ac09,_0x2497bd);},'QQukE':function(_0x58a924,_0x2a5c66){return _0x58a924(_0x2a5c66);},'GadJR':_0x354ca2(0x1fd)};return await _0x5eac73['sIRSa'](apiRequest,'/api/v1/profiles/'+_0x5eac73['QQukE'](encodeURIComponent,_0x2f9ac4)+'/session',{'method':_0x5eac73['GadJR'],'body':JSON[_0x354ca2(0x1fa)]({'session_state':_0xde6563})});}export async function saveCloudProfileCredentials(_0x90e6c2,_0x6329fc,_0x582074){const _0x4e6b76=_0x4cc66b,_0x3988cc={'scpYx':function(_0x46cb25,_0x384d28,_0xd50340){return _0x46cb25(_0x384d28,_0xd50340);},'oSwzb':'PUT'};await _0x3988cc[_0x4e6b76(0x27b)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x90e6c2),{'method':_0x3988cc[_0x4e6b76(0x265)],'body':JSON[_0x4e6b76(0x1fa)]({'username':_0x6329fc,'password':_0x582074})});}export async function fetchAuthConfig(){const _0x174272=_0x4cc66b,_0x58bb19={'DgmYP':'/api/v1/profiles/auth-config','xUHHm':function(_0x1d741a,_0x1d393e){return _0x1d741a instanceof _0x1d393e;}};try{const _0xe03067=await apiRequest(_0x58bb19['DgmYP']);return _0xe03067['auth_config'];}catch(_0x269dab){return _0x58bb19[_0x174272(0x26d)](_0x269dab,ApiError)&&_0x269dab[_0x174272(0x1d5)]!==0x194&&console[_0x174272(0x1fe)]('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x269dab['message']),null;}}async function createTunnelSession(_0x5b2bbb){const _0x2044b0=_0x4cc66b,_0x4d47da={'xTsjT':function(_0x58aae5,_0x131320,_0x32fa49){return _0x58aae5(_0x131320,_0x32fa49);},'wBpwk':'POST'};return await _0x4d47da['xTsjT'](apiRequest,'/api/v1/tunnel/sessions',{'method':_0x4d47da['wBpwk'],'body':JSON['stringify']({'targetUrl':_0x5b2bbb,'mode':_0x2044b0(0x210)})});}async function deleteTunnelSession(_0x428fbf){const _0x1b2b01=_0x4cc66b,_0x5b75e8={'vKqDj':function(_0x487bc8,_0x5c0c60,_0x5750cf){return _0x487bc8(_0x5c0c60,_0x5750cf);},'MdiOf':_0x1b2b01(0x247)};await _0x5b75e8[_0x1b2b01(0x275)](apiRequest,'/api/v1/tunnel/sessions/'+_0x428fbf,{'method':_0x5b75e8[_0x1b2b01(0x255)]});}export function pickAdHocEnvKey(_0x29a3dc,_0x34d830,_0x131ed5){const _0x443678=_0x4cc66b,_0x5733db={'zkOcr':function(_0x18d5db,_0x2a055b){return _0x18d5db+_0x2a055b;},'UOQsO':function(_0x2f7e35,_0x4bdc05,_0xae39de){return _0x2f7e35(_0x4bdc05,_0xae39de);},'YXxHm':function(_0x199f6b,_0x5de071){return _0x199f6b in _0x5de071;},'VMnWR':'key','spvcP':function(_0x3c1b19,_0x5b4af3){return _0x3c1b19 in _0x5b4af3;},'yBPwD':function(_0x14a684,_0x32de7a){return _0x14a684+_0x32de7a;},'AWXqc':function(_0x18d5e1,_0x3605d3){return _0x18d5e1+_0x3605d3;},'UWLly':function(_0x4198a4,_0x60bc03){return _0x4198a4===_0x60bc03;},'cGzPg':function(_0x208ffd,_0x67f4){return _0x208ffd+_0x67f4;}};if(_0x131ed5){if(!_0x29a3dc?.['environments']?.[_0x131ed5]){const _0x4f097c=Object['keys'](_0x29a3dc?.['environments']??{});throw new Error(_0x5733db['zkOcr'](_0x5733db['zkOcr']('Auth\x20environment\x20\x22'+_0x131ed5+'\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.',_0x4f097c[_0x443678(0x22a)]?'\x20Available:\x20'+_0x4f097c[_0x443678(0x206)](',\x20')+'.':_0x443678(0x1fc)),'\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)'));}return _0x131ed5;}if(!_0x29a3dc)return null;if(_0x34d830){const _0x156cb3=matchAuthEnvironmentExact(_0x34d830,_0x29a3dc);if(_0x156cb3)return _0x156cb3;const _0x1934bb=_0x5733db[_0x443678(0x20c)](matchAuthEnvironmentByHost,_0x34d830,_0x29a3dc);if(_0x1934bb&&_0x5733db['YXxHm'](_0x5733db[_0x443678(0x24f)],_0x1934bb))return console['log']('\x20\x20Auth\x20env\x20\x22'+_0x1934bb[_0x443678(0x221)]+_0x443678(0x273)+_0x34d830+_0x443678(0x260)),_0x1934bb[_0x443678(0x221)];if(_0x1934bb&&_0x5733db[_0x443678(0x21c)]('ambiguous',_0x1934bb))throw new Error('Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20('+_0x1934bb['ambiguous'][_0x443678(0x206)](',\x20')+_0x443678(0x1f9));if(needsTunnel(_0x34d830))throw new Error(_0x5733db[_0x443678(0x249)](_0x5733db['zkOcr'](_0x5733db['AWXqc'](_0x443678(0x220)+_0x34d830+'\x22.\x0a','\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a'),'\x20\x20Options:\x0a')+_0x443678(0x1ea)+('\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22'+_0x34d830[_0x443678(0x23c)](/\/+$/,'')+'\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a'),_0x443678(0x27a)+_0x34d830+_0x443678(0x227)));}if(_0x29a3dc[_0x443678(0x266)])return _0x29a3dc['defaultEnvironmentKey'];const _0x2ed76f=Object[_0x443678(0x236)](_0x29a3dc[_0x443678(0x215)]??{});if(_0x5733db['UWLly'](_0x2ed76f[_0x443678(0x22a)],0x1))return _0x2ed76f[0x0];if(_0x2ed76f[_0x443678(0x22a)]===0x0)return null;throw new Error(_0x5733db[_0x443678(0x278)](_0x443678(0x207)+_0x2ed76f[_0x443678(0x206)](',\x20')+_0x443678(0x1d6),'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>`.'));}function _0x20e1(){const _0x1b7cfb=['\x20\x20Server-side\x20login\x20error:\x20','env','agent','force','envKey','clientIp','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','environments','/api/v1/profiles/','RANGER_TEST_USERNAME','invalid-url','\x22\x20not\x20found.','\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...','NvbuS','spvcP','push','390501EUecdZ','):\x20','No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22','key','telemetry','\x20failed\x20(','organizationId','statusText','\x22;\x20using\x20\x22','\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.','CmATx','\x22,\x20refreshing\x20session...','length','json','/login','jMpsR','close','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','QmdFX','true','setupHeaders','bAcie','storageStatePath','AyAFt','keys','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','DbJwo','tunnel','sKPgh','settings','replace','newContext','CwVDU','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','TlzyB','invalidateOn','uTAbO','then','/api/v1/profiles','7505760YYvAqa','BWVqM','DELETE','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','yBPwD','tunnel_login_cleanup','environment_key','59131540WHSIkx','poIHu','message','VMnWR','Xtjsz','target_url','PfIgt','\x20\x20Cloud\x20profile\x20\x22','pwEndpoint','MdiOf','not_configured','password','QtJNR','detail','code','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','VefhX','\x20\x20Login\x20successful.\x20Session\x20cached.','type','reason','\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).','Cloud\x20profile\x20\x22','fdnVT','effectiveBaseUrl','cookies','oSwzb','defaultEnvironmentKey','ebvNz','sessionCheckPath','Bearer\x20','1104489OdqeiD','PBCmP','newPage','xUHHm','domains','profiles','116852emFIif','string','TDPHr','\x22\x20matched\x20by\x20host\x20for\x20','XGrSM','vKqDj','PUT','Browser\x20login\x20timed\x20out\x20before\x20completion.','cGzPg','catch','\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20','scpYx','toLowerCase','headers','GHXCf','pw_endpoint','JWZwt','targetUrl','session_state','138ZDVYPw','\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22','VwYIF','\x22,\x20attempting\x20login...','FkhuN','xpOKr','utf-8','60fyPXdO','226807yxhuDa','\x20\x20No\x20live\x20session\x20for\x20\x22','status',').\x20','\x22\x20instead.','loginInstructions','72CJZkQD','trackPhaseEnd','origin','EgohG','\x22\x20on\x20profile\x20\x22','username','KIxtX','userAgent','\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22','54340wDdDsE','isArray','name','sessionId','\x20\x20forceLogin\x20enabled\x20for\x20\x22','tunnel_login_request','persistSessionState','baseUrl','\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a','wsEndpoint','launch','XSiDx','environmentKey','RANGER_TEST_PASSWORD','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','sessionState','you\x27re\x20now\x20at\x20\x22','/session','PEUAb','HNrNP','test_output','DwUlY','trackPhaseStart',');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.','stringify','activeLocalConnections','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','POST','error','tunnel_error','deBIf','trackPhaseError','kiqcm','tunnel_login_setup','yiiQo','\x22\x20failed\x20validation\x20—\x20refreshing...','join','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','vXdmo','hpruR','log','IvBPv','UOQsO','wzklJ'];_0x20e1=function(){return _0x1b7cfb;};return _0x20e1();}export function adHocProfileName(_0x564b51,_0x211118,_0x3e5efd){if(!_0x211118||_0x211118===_0x3e5efd)return _0x564b51;return _0x564b51+':'+_0x211118;}export async function resolveAdHocProfile(_0x2278de={},_0x6dde34=process[_0x4cc66b(0x20f)]){const _0x4141e7=_0x4cc66b,_0x47f9ee={'plaDx':function(_0x193a1b,_0xc73c5a){return _0x193a1b&&_0xc73c5a;},'bAcie':function(_0x1c0a94,_0x3f3d5b){return _0x1c0a94!==_0x3f3d5b;},'iYeJr':'none','PBCmP':function(_0x3c9678,_0x488b8c){return _0x3c9678(_0x488b8c);},'JUXOe':function(_0x12335a,_0x439547,_0x5ab9d4,_0x59a1ca){return _0x12335a(_0x439547,_0x5ab9d4,_0x59a1ca);}},_0x3f7662=_0x6dde34[_0x4141e7(0x217)];if(!_0x3f7662)return null;const _0x53439f=await fetchAuthConfig(),_0x5da21f=pickAdHocEnvKey(_0x53439f,_0x2278de['targetUrl'],_0x2278de[_0x4141e7(0x212)]);let _0x11b699=adHocProfileName(_0x3f7662,_0x5da21f,_0x53439f?.['defaultEnvironmentKey']),_0x26e200=await fetchCloudProfile(_0x11b699);_0x47f9ee['plaDx'](_0x26e200,_0x5da21f)&&_0x47f9ee[_0x4141e7(0x233)](_0x26e200['environmentKey'],_0x5da21f)&&(console[_0x4141e7(0x20a)](_0x4141e7(0x253)+_0x11b699+_0x4141e7(0x1e1)+(_0x26e200['environmentKey']??_0x47f9ee['iYeJr'])+_0x4141e7(0x284)+_0x5da21f+_0x4141e7(0x226)+_0x3f7662+':'+_0x5da21f+_0x4141e7(0x1d7)),_0x11b699=_0x3f7662+':'+_0x5da21f,_0x26e200=await _0x47f9ee[_0x4141e7(0x26b)](fetchCloudProfile,_0x11b699));if(_0x26e200)return{'name':_0x26e200['name'],'profile':_0x26e200};const _0x103413=_0x6dde34['RANGER_TEST_PASSWORD'],_0x16a8b6=await _0x47f9ee['JUXOe'](createCloudProfile,_0x11b699,_0x5da21f??undefined,{'username':_0x3f7662,'password':_0x103413});return console[_0x4141e7(0x20a)]('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x16a8b6[_0x4141e7(0x1e4)]+'\x22\x20for\x20'+_0x3f7662+(_0x5da21f?'\x20(auth\x20env:\x20'+_0x5da21f+')':'')),{'name':_0x16a8b6['name'],'profile':_0x16a8b6};}export async function writeSessionToLocalCache(_0x2b4599,_0xda44c6,_0x580c46,_0x2f2a3a,_0x4fc22b,_0x5316bc,_0x30cd1b){const _0x487d87=_0x4cc66b,_0x14b094={'QmdFX':function(_0x34d4ac,_0x1396ff){return _0x34d4ac(_0x1396ff);},'DbJwo':function(_0x283701,_0xaaae58,_0x3f3c5d){return _0x283701(_0xaaae58,_0x3f3c5d);},'mxTlI':function(_0x381810){return _0x381810();},'CyTPS':'auth','poIHu':function(_0x487256,_0x344458){return _0x487256>_0x344458;},'SUJJw':function(_0x175226,_0x2fe2dc,_0x4d9e58){return _0x175226(_0x2fe2dc,_0x4d9e58);}},_0x3db42c=_0x14b094[_0x487d87(0x230)](sessionCacheHash,{'orgId':_0xda44c6,'profileName':_0x2b4599,'effectiveBaseUrl':_0x580c46,'setupHeaders':_0x2f2a3a,'invalidateOn':_0x30cd1b?.[_0x487d87(0x241)],'userAgent':_0x30cd1b?.['userAgent'],'clientIp':_0x30cd1b?.[_0x487d87(0x213)]}),_0x16ae64=_0x14b094[_0x487d87(0x238)](getSessionCachePath,_0x3db42c,_0x2b4599),_0x1064bc=_0x14b094[_0x487d87(0x238)](join,_0x14b094['mxTlI'](getRangerHomeDir),_0x14b094['CyTPS']);!_0x14b094['QmdFX'](existsSync,_0x1064bc)&&await mkdir(_0x1064bc,{'recursive':!![]});const _0x47de09={..._0x4fc22b};_0x5316bc&&_0x14b094[_0x487d87(0x24d)](_0x5316bc['length'],0x0)&&Array[_0x487d87(0x1e3)](_0x47de09[_0x487d87(0x264)])&&(_0x47de09[_0x487d87(0x264)]=_0x14b094['DbJwo'](duplicateCookiesForDomains,_0x47de09['cookies'],_0x5316bc));const _0x33707f={'cached_at':new Date()['toISOString'](),'session_state':_0x47de09};await _0x14b094['SUJJw'](writeFile,_0x16ae64,JSON['stringify'](_0x33707f,null,0x2));const _0x43d931=_0x14b094['QmdFX'](getStorageStatePath,_0x16ae64);return await writeFile(_0x43d931,JSON[_0x487d87(0x1fa)](_0x47de09,null,0x2)),_0x43d931;}export async function checkLocalCache(_0x6b85c8,_0x2d4d9c,_0x2d6845,_0x172cf5,_0x48175f){const _0x471e17=_0x4cc66b,_0x107c0e={'NvbuS':function(_0x3b63b5,_0x528b9e){return _0x3b63b5(_0x528b9e);},'KIxtX':function(_0x1e7c4d,_0x2c26ac,_0x278e71){return _0x1e7c4d(_0x2c26ac,_0x278e71);},'EcLUL':function(_0x125a10,_0x1ceb61){return _0x125a10(_0x1ceb61);},'OWYET':function(_0x8f2080,_0x31a68f){return _0x8f2080(_0x31a68f);},'BWVqM':_0x471e17(0x1d1)},_0x107864=_0x107c0e[_0x471e17(0x21b)](sessionCacheHash,{'orgId':_0x2d4d9c,'profileName':_0x6b85c8,'effectiveBaseUrl':_0x2d6845,'setupHeaders':_0x172cf5,'invalidateOn':_0x48175f?.[_0x471e17(0x241)],'userAgent':_0x48175f?.[_0x471e17(0x1e0)],'clientIp':_0x48175f?.['clientIp']}),_0x45c9db=_0x107c0e[_0x471e17(0x1df)](getSessionCachePath,_0x107864,_0x6b85c8),_0x592387=_0x107c0e['EcLUL'](getStorageStatePath,_0x45c9db);if(!_0x107c0e['EcLUL'](existsSync,_0x45c9db)||!_0x107c0e['OWYET'](existsSync,_0x592387))return null;try{const _0x4fc9a5=await readFile(_0x45c9db,_0x107c0e[_0x471e17(0x246)]);return JSON['parse'](_0x4fc9a5),{'storageStatePath':_0x592387};}catch{return null;}}function launchRealBrowser(){const _0x15ed88=_0x4cc66b;return chromium[_0x15ed88(0x1ec)]({'headless':!![]});}function emitSessionValidationHint(_0x5f1bd9,_0x2d3c55){const _0x556b37=_0x4cc66b,_0x4be72a={'ufesP':function(_0x29cda3,_0x3cc9d1){return _0x29cda3+_0x3cc9d1;}};if(!_0x2d3c55||!_0x2d3c55[_0x556b37(0x26e)]?.['length'])return;let _0x433c0f;try{_0x433c0f=new URL(_0x5f1bd9);}catch{return;}const _0x5577fa=[];for(const _0x448919 of _0x2d3c55[_0x556b37(0x26e)]){try{_0x5577fa[_0x556b37(0x21d)]({'raw':_0x448919,'url':new URL(_0x448919)});}catch{}}if(_0x5577fa[_0x556b37(0x22a)]===0x0)return;if(_0x5577fa['some'](_0x2295e4=>_0x2295e4['url'][_0x556b37(0x1db)]===_0x433c0f[_0x556b37(0x1db)]))return;const _0x22b89d=_0x5577fa['map'](_0xa968c3=>'\x22'+_0xa968c3['raw']+'\x22')['join'](',\x20');console['log'](_0x4be72a['ufesP']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x22b89d+';\x20',_0x556b37(0x1f2)+_0x5f1bd9+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20')+_0x556b37(0x22f));}export async function serverSideLogin(_0x14f0b8,_0x108ab0){const _0x136c2b=_0x4cc66b,_0x120262={'rwzCo':function(_0x1e4671,_0x2da473,_0x1c3c2a){return _0x1e4671(_0x2da473,_0x1c3c2a);},'hbFmS':function(_0x3034a8,_0x34d1f1){return _0x3034a8 instanceof _0x34d1f1;},'deBIf':function(_0x11ed86,_0x280d54){return _0x11ed86===_0x280d54;}},_0x4a1e58=process[_0x136c2b(0x20f)][_0x136c2b(0x217)],_0x328d38=process[_0x136c2b(0x20f)][_0x136c2b(0x1ef)],_0x5a1de1={};if(_0x4a1e58)_0x5a1de1[_0x136c2b(0x1de)]=_0x4a1e58;if(_0x328d38)_0x5a1de1['password']=_0x328d38;if(_0x108ab0?.['force'])_0x5a1de1['force']=!![];if(_0x108ab0?.[_0x136c2b(0x281)])_0x5a1de1[_0x136c2b(0x251)]=_0x108ab0[_0x136c2b(0x281)];_0x108ab0?.['tunnel']&&(_0x5a1de1['tunnel_session_id']=_0x108ab0['tunnel']['sessionId'],_0x5a1de1[_0x136c2b(0x27f)]=_0x108ab0[_0x136c2b(0x239)][_0x136c2b(0x254)]);try{return await _0x120262['rwzCo'](apiRequest,_0x136c2b(0x216)+encodeURIComponent(_0x14f0b8)+_0x136c2b(0x22c),{'method':_0x136c2b(0x1fd),'body':JSON['stringify'](_0x5a1de1)});}catch(_0x4ef48a){if(_0x120262['hbFmS'](_0x4ef48a,ApiError)&&_0x120262['deBIf'](_0x4ef48a[_0x136c2b(0x1d5)],0x190)&&_0x120262[_0x136c2b(0x200)](_0x4ef48a[_0x136c2b(0x25a)],_0x136c2b(0x256)))return{'status':_0x136c2b(0x256),'error':_0x4ef48a['detail']};throw _0x4ef48a;}}async function serverSideLoginWithOptionalTunnel(_0x36b3b6,_0x989f12,_0x57f573={}){const _0x4d888a=_0x4cc66b,_0x10176b={'hpruR':_0x4d888a(0x1e7),'VwYIF':function(_0x41995d,_0x5962ee){return _0x41995d(_0x5962ee);},'Xtjsz':function(_0xeacf38,_0x1f5337){return _0xeacf38(_0x1f5337);},'dWGDx':function(_0x11f135,_0x50b0f6,_0x313341){return _0x11f135(_0x50b0f6,_0x313341);},'yiiQo':'tunnel_login_setup','IvBPv':_0x4d888a(0x21a),'EMrBm':function(_0x4c7f0f,_0x14aa95){return _0x4c7f0f(_0x14aa95);},'kiqcm':function(_0x14a5b2){return _0x14a5b2();},'XGrSM':function(_0xdea0e2,_0x32ef6c,_0x781302){return _0xdea0e2(_0x32ef6c,_0x781302);},'hWlJa':function(_0x1e16da,_0x3a2453){return _0x1e16da??_0x3a2453;},'TJqYU':function(_0x3aad02,_0x507565){return _0x3aad02??_0x507565;},'DzmBc':_0x4d888a(0x24a)};if(!_0x10176b['Xtjsz'](needsTunnel,_0x989f12))return await _0x10176b['dWGDx'](serverSideLogin,_0x36b3b6,{'force':_0x57f573['force']});let _0x21ef48=null,_0x320737=null,_0x3727cf=null,_0x378344=null,_0x5075b5=![];const _0x54c353=process[_0x4d888a(0x20f)]['RANGER_TUNNEL_LOGIN_HEADED']?.[_0x4d888a(0x27c)](),_0x2c47b5=_0x54c353==='1'||_0x54c353===_0x4d888a(0x231),_0x27f5bf={'profileName':_0x36b3b6,'targetUrlHost':targetHostForTelemetry(_0x989f12),'tunnelRequired':!![],'forceLogin':_0x10176b[_0x4d888a(0x285)](Boolean,_0x57f573[_0x4d888a(0x211)]),'localBrowserServerHeaded':_0x2c47b5};try{_0x57f573[_0x4d888a(0x222)]?.[_0x4d888a(0x1f8)](_0x10176b[_0x4d888a(0x204)],_0x27f5bf);_0x2c47b5&&console[_0x4d888a(0x20a)](_0x10176b[_0x4d888a(0x20b)]);_0x21ef48=await _0x10176b['Xtjsz'](launchBrowserServer,{'headless':!_0x2c47b5}),_0x320737=await _0x10176b['EMrBm'](createTunnelSession,_0x989f12);const _0x33b9f3=await _0x10176b[_0x4d888a(0x202)](requireToken);_0x3727cf=await _0x10176b[_0x4d888a(0x250)](createTunnelBridge,{'localWsUrl':_0x21ef48[_0x4d888a(0x1eb)],'tunnelServerUrl':_0x320737['tunnelUrl'],'sessionId':_0x320737[_0x4d888a(0x1e5)],'apiKey':_0x33b9f3,'onError':_0x163e1e=>{_0x378344=_0x163e1e;},'onClose':()=>{_0x378344??=new Error('Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20'+_0x36b3b6);},'onEvent':_0x4a3f99=>trackBridgeEvent(_0x57f573[_0x4d888a(0x222)],_0x4a3f99)}),_0x57f573['telemetry']?.[_0x4d888a(0x1da)](_0x10176b['yiiQo'],{..._0x27f5bf,'tunnelSessionId':_0x320737[_0x4d888a(0x1e5)],'localBrowserServer':!![],'localBrowserServerHeaded':_0x2c47b5}),_0x5075b5=!![];try{return _0x57f573['telemetry']?.[_0x4d888a(0x1f8)](_0x4d888a(0x1e7),{..._0x27f5bf,'tunnelSessionId':_0x320737[_0x4d888a(0x1e5)]}),await _0x10176b[_0x4d888a(0x274)](serverSideLogin,_0x36b3b6,{'force':_0x57f573[_0x4d888a(0x211)],'targetUrl':_0x989f12,'tunnel':{'sessionId':_0x320737[_0x4d888a(0x1e5)],'pwEndpoint':_0x320737['pwEndpoint']}})[_0x4d888a(0x243)](_0x4ac9eb=>{const _0x593b6d=_0x4d888a;return _0x57f573['telemetry']?.['trackPhaseEnd'](_0x10176b[_0x593b6d(0x209)],{..._0x27f5bf,'tunnelSessionId':_0x320737?.[_0x593b6d(0x1e5)],'loginStatus':_0x4ac9eb[_0x593b6d(0x1d5)],'hasSessionState':Boolean(_0x4ac9eb[_0x593b6d(0x282)]),'hasTestOutput':Boolean(_0x4ac9eb[_0x593b6d(0x1f6)]),'bridgeError':_0x10176b[_0x593b6d(0x285)](errorMessageForTelemetry,_0x378344)}),_0x4ac9eb;});}catch(_0x486349){await _0x57f573[_0x4d888a(0x222)]?.['trackPhaseError'](_0x10176b['hpruR'],_0x10176b['hWlJa'](_0x378344,_0x486349),{..._0x27f5bf,'tunnelSessionId':_0x320737['sessionId'],'bridgeError':_0x10176b['VwYIF'](errorMessageForTelemetry,_0x378344)});throw _0x10176b['TJqYU'](_0x378344,_0x486349);}}catch(_0x572d55){!_0x5075b5&&await _0x57f573['telemetry']?.[_0x4d888a(0x201)](_0x4d888a(0x203),_0x572d55,{..._0x27f5bf,'tunnelSessionId':_0x320737?.[_0x4d888a(0x1e5)]});throw _0x572d55;}finally{(_0x320737||_0x21ef48||_0x3727cf)&&(_0x57f573[_0x4d888a(0x222)]?.[_0x4d888a(0x1f8)](_0x10176b['DzmBc'],{..._0x27f5bf,'tunnelSessionId':_0x320737?.[_0x4d888a(0x1e5)]}),_0x3727cf?.[_0x4d888a(0x22e)](),_0x21ef48&&await _0x21ef48[_0x4d888a(0x22e)]()['catch'](()=>{}),_0x320737&&await _0x10176b['EMrBm'](deleteTunnelSession,_0x320737[_0x4d888a(0x1e5)])[_0x4d888a(0x279)](()=>{}),_0x57f573['telemetry']?.[_0x4d888a(0x1da)](_0x10176b['DzmBc'],{..._0x27f5bf,'tunnelSessionId':_0x320737?.['sessionId']}));}}export async function manualBrowserLogin(_0x38c5fc,_0x35dd7c,_0x5857ed={}){const _0xfbf4b0=_0x4cc66b,_0x51ff3e={'wzklJ':'close','PfIgt':function(_0x4fc465,_0x3102d6){return _0x4fc465+_0x3102d6;},'rLMfw':_0xfbf4b0(0x25b),'DwUlY':'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','fdnVT':function(_0xd2df30,_0x2b5bcd){return _0xd2df30>_0x2b5bcd;},'jMpsR':'about:blank','FkhuN':function(_0x495fb6,_0x40b42b){return _0x495fb6(_0x40b42b);},'qkYWm':function(_0x5175d4,_0x5b2bdd){return _0x5175d4&&_0x5b2bdd;},'JWZwt':_0xfbf4b0(0x277),'umaGb':function(_0x532654,_0x32b0a5){return _0x532654!==_0x32b0a5;},'GIZIL':function(_0x50eb0e,_0x4f48e6,_0x2c4b67){return _0x50eb0e(_0x4f48e6,_0x2c4b67);}};if(!isInteractive())throw new Error(_0x51ff3e[_0xfbf4b0(0x252)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x38c5fc['name']+'\x22.\x0a'+_0x51ff3e['rLMfw'],_0x51ff3e[_0xfbf4b0(0x1f7)]));const _0x3439b7=_0x35dd7c&&_0x51ff3e[_0xfbf4b0(0x262)](_0x35dd7c['domains'][_0xfbf4b0(0x22a)],0x0)?_0x35dd7c[_0xfbf4b0(0x26e)][0x0]:_0x51ff3e[_0xfbf4b0(0x22d)];console[_0xfbf4b0(0x20a)](_0xfbf4b0(0x23f)),console[_0xfbf4b0(0x20a)]('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x282367=>setTimeout(_0x282367,0x7d0));const _0x273b8b=await chromium['launch']({'headless':![]});let _0x443267=null;try{const _0x588478={'ignoreHTTPSErrors':!![]};_0x35dd7c?.['setupHeaders']&&(_0x588478['extraHTTPHeaders']=_0x35dd7c[_0xfbf4b0(0x232)]);const _0x47a7a8=await _0x273b8b[_0xfbf4b0(0x23d)](_0x588478);await _0x51ff3e[_0xfbf4b0(0x287)](addProfileSetupBanner,_0x47a7a8);const _0x1cc08b=await _0x47a7a8[_0xfbf4b0(0x26c)]();await _0x1cc08b['goto'](_0x3439b7);let _0x1c4790=![];await new Promise(_0x18562a=>{const _0xadd19=_0xfbf4b0,_0x57041a={'cCzYi':function(_0x3080da,_0x178efd){return _0x3080da/_0x178efd;},'uheCZ':function(_0x13cc36){return _0x13cc36();}},_0x499c17=setTimeout(()=>{const _0x418acf=_0x33f5;_0x1c4790=!![],console[_0x418acf(0x1fe)]('Browser\x20login\x20timed\x20out\x20after\x20'+_0x57041a['cCzYi'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x57041a['uheCZ'](_0x18562a);},MANUAL_LOGIN_TIMEOUT_MS);_0x1cc08b['on'](_0x51ff3e[_0xadd19(0x20d)],async()=>{clearTimeout(_0x499c17);try{const _0xcbcd3d=await _0x47a7a8['storageState']();_0x443267=_0xcbcd3d;}catch{}_0x18562a();});});if(_0x51ff3e['qkYWm'](_0x1c4790,!_0x443267))throw new Error(_0x51ff3e[_0xfbf4b0(0x280)]);}finally{await _0x273b8b[_0xfbf4b0(0x22e)]()['catch'](()=>{});}if(!_0x443267)throw new Error('Browser\x20closed\x20before\x20authentication\x20was\x20saved.');return _0x51ff3e['umaGb'](_0x5857ed[_0xfbf4b0(0x1e8)],![])&&await _0x51ff3e['GIZIL'](apiRequest,'/api/v1/profiles/'+_0x51ff3e[_0xfbf4b0(0x287)](encodeURIComponent,_0x38c5fc[_0xfbf4b0(0x1e4)])+_0xfbf4b0(0x1f3),{'method':'POST','body':JSON[_0xfbf4b0(0x1fa)]({'session_state':_0x443267,'updated_by':'cli:manual-login'})}),{'sessionState':_0x443267};}function _0x33f5(_0x41dcbe,_0x4f11fd){_0x41dcbe=_0x41dcbe-0x1d1;const _0x20e12d=_0x20e1();let _0x33f587=_0x20e12d[_0x41dcbe];return _0x33f587;}export async function promptSaveCredentials(_0x5a7579){const _0x496f53=_0x4cc66b,_0x4d0579={'xpOKr':function(_0x5e708a){return _0x5e708a();},'ebvNz':function(_0x458802,_0x194bbc,_0x1cd69d){return _0x458802(_0x194bbc,_0x1cd69d);},'cHDzx':function(_0x434018,_0x559538){return _0x434018(_0x559538);},'HNrNP':_0x496f53(0x276),'mmhiV':'\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.'},_0x4f63f1=process['env']['RANGER_TEST_USERNAME'],_0x33507d=process[_0x496f53(0x20f)]['RANGER_TEST_PASSWORD'];if(!_0x4f63f1||!_0x33507d)return;if(!_0x4d0579[_0x496f53(0x288)](isInteractive))return;const {save:_0x4ced7e}=await _0x1e4fbc['prompt']([{'type':'confirm','name':'save','message':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','default':![]}]);if(!_0x4ced7e)return;await _0x4d0579[_0x496f53(0x267)](apiRequest,'/api/v1/profiles/'+_0x4d0579['cHDzx'](encodeURIComponent,_0x5a7579),{'method':_0x4d0579[_0x496f53(0x1f5)],'body':JSON['stringify']({'username':_0x4f63f1,'password':_0x33507d})}),console[_0x496f53(0x20a)](_0x4d0579['mmhiV']);}export async function resolveCloudProfileSession(_0xfd2698,_0x423968={}){const _0x556d0c=_0x4cc66b,_0x1d0d44={'uTAbO':function(_0x4c3acc){return _0x4c3acc();},'CmATx':function(_0x5baf7b,_0x14b620){return _0x5baf7b===_0x14b620;},'ELtzR':'string','TlzyB':function(_0x14f149,_0x30c410){return _0x14f149||_0x30c410;},'DLSNf':function(_0x51ea2c,_0x43d4ad){return _0x51ea2c(_0x43d4ad);},'BAJPw':function(_0x5b2235,_0x309dee){return _0x5b2235>_0x309dee;},'XSiDx':function(_0x4d2481,_0x54c30e,_0x3116f9,_0xa65b73,_0x5dfcb8){return _0x4d2481(_0x54c30e,_0x3116f9,_0xa65b73,_0x5dfcb8);},'VefhX':function(_0x558e07,_0x316f3f,_0x525340){return _0x558e07(_0x316f3f,_0x525340);},'vXdmo':function(_0x2e684a,_0xa128fe){return _0x2e684a(_0xa128fe);},'UPXga':function(_0x4354cb,_0x1384fb){return _0x4354cb||_0x1384fb;},'AOHPa':'success','YefCu':_0x556d0c(0x25d),'TXgnp':function(_0x4d4ee7,_0x54e98d,_0x45d28f,_0x5cd623,_0x18bba2,_0x1a793d,_0xf82340,_0x59140e){return _0x4d4ee7(_0x54e98d,_0x45d28f,_0x5cd623,_0x18bba2,_0x1a793d,_0xf82340,_0x59140e);},'Tutug':function(_0x206808,_0x5d0e1a,_0x282632,_0x8fd12a){return _0x206808(_0x5d0e1a,_0x282632,_0x8fd12a);}},_0x824d0a=_0xfd2698['settings']??{},_0x3d3b66=await _0x1d0d44[_0x556d0c(0x242)](fetchAuthConfig),_0x256294=_0x3d3b66?resolveAuthEnvironmentLocally(_0x3d3b66,_0xfd2698[_0x556d0c(0x1ee)]):null,_0x48fb92=typeof _0x256294?.[_0x556d0c(0x1d8)]==='string'&&_0x256294[_0x556d0c(0x1d8)]['trim']()?_0x256294[_0x556d0c(0x1d8)]:undefined,_0x19db88=_0x1d0d44[_0x556d0c(0x228)](typeof _0x824d0a['loginInstructions'],_0x1d0d44['ELtzR'])&&_0x824d0a[_0x556d0c(0x1d8)]['trim']()?_0x824d0a[_0x556d0c(0x1d8)]:undefined,_0x3f2457=_0x1d0d44[_0x556d0c(0x240)](_0x19db88,!_0x48fb92)?_0x824d0a:{..._0x824d0a,'loginInstructions':_0x48fb92},_0x5ce403=Boolean(_0x3f2457[_0x556d0c(0x1d8)]?.['trim']()),_0x4bca58=_0x1d0d44['DLSNf'](Boolean,_0x824d0a['forceLogin']||_0x256294?.['forceLogin']),_0x47b886=_0x256294?.[_0x556d0c(0x26e)],_0x180991=_0x824d0a[_0x556d0c(0x232)],_0x3a5414=_0x180991??_0x256294?.[_0x556d0c(0x232)],_0x345236=_0x423968[_0x556d0c(0x263)]??_0x824d0a[_0x556d0c(0x1e9)]??(_0x47b886&&_0x1d0d44['BAJPw'](_0x47b886['length'],0x0)?_0x47b886[0x0]:''),_0x16fdf0=_0x345236?_0x1d0d44['DLSNf'](needsTunnel,_0x345236):![],_0x131675={'invalidateOn':_0x256294?.['invalidateOn'],'userAgent':_0x256294?.['browserOptions']?.[_0x556d0c(0x1e0)]??_0x824d0a['userAgent']};_0x4bca58&&console['log'](_0x556d0c(0x1e6)+_0xfd2698['name']+_0x556d0c(0x229));if(!_0x4bca58){const _0x1cc384=await checkLocalCache(_0xfd2698[_0x556d0c(0x1e4)],_0xfd2698[_0x556d0c(0x224)],_0x345236,_0x3a5414,_0x131675);if(_0x1cc384){if(_0x345236&&!_0x16fdf0){const _0x286482=await _0x1d0d44[_0x556d0c(0x1ed)](isCachedSessionLive,_0x1cc384['storageStatePath'],_0x345236,{'sessionCheckPath':_0x256294?.['sessionCheckPath'],'setupHeaders':_0x3a5414},{'launchBrowser':launchRealBrowser});if(_0x286482)return console['log'](_0x556d0c(0x237)+_0xfd2698['name']+'\x22'),{'authPath':_0x1cc384['storageStatePath'],'settings':_0x3f2457,'resolvedEnv':_0x256294};console[_0x556d0c(0x20a)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0xfd2698[_0x556d0c(0x1e4)]+_0x556d0c(0x205)),emitSessionValidationHint(_0x345236,_0x256294);}else return _0x16fdf0&&console[_0x556d0c(0x20a)]('\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22'+_0xfd2698['name']+'\x22'),{'authPath':_0x1cc384[_0x556d0c(0x234)],'settings':_0x3f2457,'resolvedEnv':_0x256294};}}if(!_0x4bca58&&_0xfd2698[_0x556d0c(0x1f1)]){if(_0x16fdf0)console[_0x556d0c(0x20a)]('\x20\x20Skipping\x20cloud\x20session\x20for\x20local\x20target\x20\x22'+_0x345236+_0x556d0c(0x1dd)+_0xfd2698['name']+'\x22');else{const _0x144150=await writeSessionToLocalCache(_0xfd2698['name'],_0xfd2698[_0x556d0c(0x224)],_0x345236,_0x3a5414,_0xfd2698[_0x556d0c(0x1f1)],_0x47b886,_0x131675);if(_0x345236){const _0x379c15=await isCachedSessionLive(_0x144150,_0x345236,{'sessionCheckPath':_0x256294?.[_0x556d0c(0x268)],'setupHeaders':_0x3a5414},{'launchBrowser':launchRealBrowser});if(_0x379c15)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0xfd2698[_0x556d0c(0x1e4)]+'\x22,\x20cached\x20locally'),{'authPath':_0x144150,'settings':_0x3f2457,'resolvedEnv':_0x256294};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0xfd2698['name']+_0x556d0c(0x1f0)),_0x1d0d44[_0x556d0c(0x25c)](emitSessionValidationHint,_0x345236,_0x256294);}else return{'authPath':_0x144150,'settings':_0x3f2457,'resolvedEnv':_0x256294};}}if(_0x5ce403)return console['log'](_0x556d0c(0x1d4)+_0xfd2698[_0x556d0c(0x1e4)]+'\x22;\x20proceeding\x20with\x20loginInstructions.'),{'authPath':undefined,'settings':_0x3f2457,'resolvedEnv':_0x256294};console[_0x556d0c(0x20a)](_0x556d0c(0x1d4)+_0xfd2698[_0x556d0c(0x1e4)]+_0x556d0c(0x286));const _0x351f08=Boolean(process['env']['RANGER_TEST_USERNAME'])&&Boolean(process['env'][_0x556d0c(0x1ef)]),_0x1e5829=_0x1d0d44['vXdmo'](Boolean,_0xfd2698[_0x556d0c(0x1de)]);if(_0x1d0d44['UPXga'](_0x351f08,_0x1e5829))try{const _0x5cd318=_0x345236?await serverSideLoginWithOptionalTunnel(_0xfd2698[_0x556d0c(0x1e4)],_0x345236,{'force':_0x4bca58,'telemetry':_0x423968[_0x556d0c(0x222)]}):await _0x1d0d44['VefhX'](serverSideLogin,_0xfd2698[_0x556d0c(0x1e4)],{'force':_0x4bca58});if(_0x5cd318['status']==='not_configured')console['log']('\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...');else{if(_0x5cd318[_0x556d0c(0x1d5)]===_0x1d0d44['AOHPa']&&_0x5cd318[_0x556d0c(0x282)]){console[_0x556d0c(0x20a)](_0x1d0d44['YefCu']);const _0x42ba6e=await _0x1d0d44['TXgnp'](writeSessionToLocalCache,_0xfd2698[_0x556d0c(0x1e4)],_0xfd2698['organizationId'],_0x345236,_0x3a5414,_0x5cd318[_0x556d0c(0x282)],_0x47b886,_0x131675);return _0x351f08&&!_0x1e5829&&await promptSaveCredentials(_0xfd2698['name']),{'authPath':_0x42ba6e,'settings':_0x3f2457,'resolvedEnv':_0x256294};}else _0x5cd318['test_output']&&(console['log'](_0x556d0c(0x248)),console[_0x556d0c(0x20a)](_0x5cd318[_0x556d0c(0x1f6)])),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0x2225d4){console[_0x556d0c(0x20a)](_0x556d0c(0x20e)+(_0x2225d4 instanceof Error?_0x2225d4['message']:_0x1d0d44[_0x556d0c(0x208)](String,_0x2225d4))),console[_0x556d0c(0x20a)](_0x556d0c(0x214));}const _0x3a4298=_0x256294?{..._0x256294,'setupHeaders':_0x3a5414}:_0x345236?{'key':_0xfd2698[_0x556d0c(0x1ee)]??'','domains':[_0x345236],'setupHeaders':_0x3a5414}:null,{sessionState:_0x4c37fb}=await _0x1d0d44['Tutug'](manualBrowserLogin,_0xfd2698,_0x3a4298,{'persistSessionState':!_0x16fdf0}),_0x2aed33=await writeSessionToLocalCache(_0xfd2698['name'],_0xfd2698['organizationId'],_0x345236,_0x3a5414,_0x4c37fb,_0x47b886,_0x131675);return{'authPath':_0x2aed33,'settings':_0x3f2457,'resolvedEnv':_0x256294};}
1
+ const _0xa12d9=_0x4050;(function(_0x6b1b8b,_0x4fcb78){const _0x72fbe4=_0x4050,_0x18891a=_0x6b1b8b();while(!![]){try{const _0x3350e7=-parseInt(_0x72fbe4(0xdf))/0x1+-parseInt(_0x72fbe4(0x127))/0x2*(-parseInt(_0x72fbe4(0x10d))/0x3)+parseInt(_0x72fbe4(0x142))/0x4*(parseInt(_0x72fbe4(0xd9))/0x5)+parseInt(_0x72fbe4(0xc7))/0x6*(-parseInt(_0x72fbe4(0x114))/0x7)+-parseInt(_0x72fbe4(0x128))/0x8*(parseInt(_0x72fbe4(0x12a))/0x9)+parseInt(_0x72fbe4(0x130))/0xa*(parseInt(_0x72fbe4(0x149))/0xb)+parseInt(_0x72fbe4(0x147))/0xc;if(_0x3350e7===_0x4fcb78)break;else _0x18891a['push'](_0x18891a['shift']());}catch(_0x30fad2){_0x18891a['push'](_0x18891a['shift']());}}}(_0x495a,0x93571));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x20e70b from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,needsTunnel,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{matchAuthEnvironmentByHost,matchAuthEnvironmentExact}from'./matchAuthEnvironment.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0x1b4b18){try{return new URL(_0x1b4b18)['host'];}catch{return'invalid-url';}}function errorMessageForTelemetry(_0x17b9fd){const _0x21f059=_0x4050,_0x37a14d={'FhRjF':function(_0x5b5ed,_0x240ce5){return _0x5b5ed instanceof _0x240ce5;}};return _0x37a14d[_0x21f059(0xe2)](_0x17b9fd,Error)?_0x17b9fd[_0x21f059(0x108)]:undefined;}function trackBridgeEvent(_0x341580,_0x19e4ea){const _0x12a387=_0x4050,_0x8c308a={'KTohZ':_0x12a387(0x14b),'omDoi':'tunnel_error','nMuef':function(_0x2474d4,_0x459cbb){return _0x2474d4===_0x459cbb;},'TNaZo':_0x12a387(0x154)};if(!_0x341580)return;const _0x186424={'tunnelSessionId':_0x19e4ea[_0x12a387(0x12e)],'tunnelEventType':_0x19e4ea['type'],'connectionId':_0x19e4ea['connectionId'],'code':_0x19e4ea[_0x12a387(0xca)],'reason':_0x19e4ea['reason'],'error':_0x19e4ea['error'],'elapsedMs':_0x19e4ea['elapsedMs'],'activeLocalConnections':_0x19e4ea[_0x12a387(0xd4)],'pendingLocalConnections':_0x19e4ea['pendingLocalConnections']};_0x341580['trackPhaseEnd'](_0x8c308a['KTohZ'],_0x186424),(_0x19e4ea[_0x12a387(0x126)]===_0x8c308a[_0x12a387(0xc3)]||_0x8c308a[_0x12a387(0xc2)](_0x19e4ea['type'],_0x8c308a['TNaZo']))&&void _0x341580['trackPhaseError'](_0x12a387(0x164),new Error(_0x19e4ea['error']??_0x19e4ea['type']),_0x186424);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x3b4c9b=_0x4050,_0x407cbc={'jiiqi':function(_0x591019){return _0x591019();}},_0x337669=await _0x407cbc['jiiqi'](getToken);if(!_0x337669)throw new Error(_0x3b4c9b(0xcb));return _0x337669;}async function apiRequest(_0x1467f1,_0x28a4e5={}){const _0xff2741=_0x4050,_0x3a5289={'AQPeO':function(_0x73ad09){return _0x73ad09();},'eKYxB':function(_0x1ec1d3,_0x430e31){return _0x1ec1d3===_0x430e31;},'OxujY':'string','ZySmn':function(_0x1cf93d,_0x8fcc7b){return _0x1cf93d===_0x8fcc7b;}},_0x542420=await _0x3a5289[_0xff2741(0xd0)](requireToken),_0x73314a=getApiBaseUrl(),_0x1c53fe=await fetch(''+_0x73314a+_0x1467f1,{..._0x28a4e5,'headers':{'Authorization':_0xff2741(0xea)+_0x542420,'Content-Type':_0xff2741(0x14a),..._0x28a4e5['headers']??{}}});if(!_0x1c53fe['ok']){let _0x82d994='',_0x4a9440;try{const _0x110e13=await _0x1c53fe[_0xff2741(0x129)](),_0x1559d8=(_0x3a5289['eKYxB'](typeof _0x110e13['error'],_0x3a5289['OxujY'])?_0x110e13[_0xff2741(0x10e)]:undefined)??JSON[_0xff2741(0x11d)](_0x110e13);_0x82d994=_0x1559d8;typeof _0x110e13[_0xff2741(0xfe)]==='string'&&_0x110e13['test_output']&&(_0x82d994=_0x82d994+'\x0a'+_0x110e13[_0xff2741(0xfe)]);if(typeof _0x110e13[_0xff2741(0xca)]==='string')_0x4a9440=_0x110e13[_0xff2741(0xca)];}catch{_0x82d994=_0x1c53fe['statusText'];}throw new ApiError(_0xff2741(0x159)+_0x1467f1+'\x20failed\x20('+_0x1c53fe['status']+_0xff2741(0x13c)+_0x82d994,_0x1c53fe['status'],_0x82d994,_0x4a9440);}if(_0x3a5289['ZySmn'](_0x1c53fe['status'],0xcc))return undefined;return _0x1c53fe[_0xff2741(0x129)]();}export class ApiError extends Error{[_0xa12d9(0x107)];['detail'];['code'];constructor(_0x3c429a,_0x3bf267,_0x40344b,_0x4fc915){const _0x58bb8d=_0xa12d9,_0x652de7=_0x58bb8d(0xd2)['split']('|');let _0x658295=0x0;while(!![]){switch(_0x652de7[_0x658295++]){case'0':this['code']=_0x4fc915;continue;case'1':this['detail']=_0x40344b;continue;case'2':super(_0x3c429a);continue;case'3':this[_0x58bb8d(0x11f)]='ApiError';continue;case'4':this[_0x58bb8d(0x107)]=_0x3bf267;continue;}break;}}}export async function fetchCloudProfile(_0x508ef1){const _0x1eedfb=_0xa12d9,_0x5a3dac={'QWzOI':function(_0x448dab,_0x2036ac){return _0x448dab(_0x2036ac);},'vUnZP':function(_0x2cc009,_0xf85d5b){return _0x2cc009 instanceof _0xf85d5b;}};try{return await _0x5a3dac[_0x1eedfb(0x103)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x508ef1));}catch(_0x5cdf00){if(_0x5a3dac['vUnZP'](_0x5cdf00,ApiError)&&_0x5cdf00[_0x1eedfb(0x107)]===0x194)return null;throw _0x5cdf00;}}function _0x4050(_0xf5c122,_0x102741){_0xf5c122=_0xf5c122-0xc0;const _0x495a93=_0x495a();let _0x405092=_0x495a93[_0xf5c122];return _0x405092;}export async function listCloudProfiles(){const _0x32539a=await apiRequest('/api/v1/profiles');return _0x32539a['profiles'];}export async function deleteCloudProfile(_0x1ae1a6){const _0x42b27c=_0xa12d9,_0x4445b7={'XbTWJ':function(_0x42125a,_0x2f35d4,_0x4a4330){return _0x42125a(_0x2f35d4,_0x4a4330);},'lEaVj':function(_0x2e54c8,_0xa67cb3){return _0x2e54c8(_0xa67cb3);},'ffVST':function(_0x1e0199,_0x4f932f){return _0x1e0199===_0x4f932f;}};try{await _0x4445b7['XbTWJ'](apiRequest,'/api/v1/profiles/'+_0x4445b7['lEaVj'](encodeURIComponent,_0x1ae1a6),{'method':_0x42b27c(0x134)});}catch(_0x3b6cfd){if(_0x3b6cfd instanceof ApiError&&_0x4445b7[_0x42b27c(0xdd)](_0x3b6cfd[_0x42b27c(0x107)],0x194))throw new Error('Cloud\x20profile\x20\x22'+_0x1ae1a6+_0x42b27c(0xff));throw _0x3b6cfd;}}export async function createCloudProfile(_0x233436,_0x53ed7d,_0x126fa0={}){const _0x29ce40=_0xa12d9,_0x31722e={'name':_0x233436};if(_0x53ed7d)_0x31722e['environment_key']=_0x53ed7d;_0x126fa0[_0x29ce40(0xdb)]&&Object['keys'](_0x126fa0[_0x29ce40(0xdb)])['length']>0x0&&(_0x31722e[_0x29ce40(0xdb)]=_0x126fa0[_0x29ce40(0xdb)]);if(_0x126fa0['username'])_0x31722e['username']=_0x126fa0[_0x29ce40(0x16b)];if(_0x126fa0['password'])_0x31722e['password']=_0x126fa0['password'];return await apiRequest(_0x29ce40(0xfd),{'method':'POST','body':JSON[_0x29ce40(0x11d)](_0x31722e)});}export async function uploadCloudProfileSession(_0x2be5e6,_0x14a838){const _0x28717e=_0xa12d9,_0xf7b0ef={'IxyTK':_0x28717e(0xf6)};return await apiRequest(_0x28717e(0x104)+encodeURIComponent(_0x2be5e6)+_0x28717e(0x122),{'method':_0xf7b0ef[_0x28717e(0x155)],'body':JSON['stringify']({'session_state':_0x14a838})});}export async function saveCloudProfileCredentials(_0x16e26a,_0x5d1d70,_0x642e0a){const _0x4b88a1=_0xa12d9,_0x3ad0b8={'IOyOk':function(_0x5357bf,_0x18e335,_0xd9ccb2){return _0x5357bf(_0x18e335,_0xd9ccb2);},'gIFwo':_0x4b88a1(0xf2)};await _0x3ad0b8[_0x4b88a1(0xf0)](apiRequest,_0x4b88a1(0x104)+encodeURIComponent(_0x16e26a),{'method':_0x3ad0b8['gIFwo'],'body':JSON[_0x4b88a1(0x11d)]({'username':_0x5d1d70,'password':_0x642e0a})});}export async function fetchAuthConfig(){const _0x13764f=_0xa12d9,_0xc9d31={'zVFrD':'/api/v1/profiles/auth-config','hbVwI':function(_0x5201b6,_0x364aa8){return _0x5201b6!==_0x364aa8;}};try{const _0x44ae20=await apiRequest(_0xc9d31['zVFrD']);return _0x44ae20['auth_config'];}catch(_0x20dfab){return _0x20dfab instanceof ApiError&&_0xc9d31['hbVwI'](_0x20dfab['status'],0x194)&&console[_0x13764f(0x10e)](_0x13764f(0xf9)+_0x20dfab[_0x13764f(0x108)]),null;}}async function createTunnelSession(_0x25f0c1){const _0x3d6a04=_0xa12d9,_0x5a54e5={'BeLDb':function(_0x406265,_0x2a2837,_0x1e360a){return _0x406265(_0x2a2837,_0x1e360a);},'QXnyL':'/api/v1/tunnel/sessions'};return await _0x5a54e5[_0x3d6a04(0x132)](apiRequest,_0x5a54e5['QXnyL'],{'method':'POST','body':JSON[_0x3d6a04(0x11d)]({'targetUrl':_0x25f0c1,'mode':_0x3d6a04(0x13f)})});}async function deleteTunnelSession(_0xbce425){const _0x444fe5=_0xa12d9,_0x44cb62={'QnEqm':function(_0x312591,_0x3b6e3f,_0x4365b6){return _0x312591(_0x3b6e3f,_0x4365b6);},'bSnvI':'DELETE'};await _0x44cb62['QnEqm'](apiRequest,_0x444fe5(0x10c)+_0xbce425,{'method':_0x44cb62[_0x444fe5(0x13d)]});}export function pickAdHocEnvKey(_0x1e13c2,_0x2725a6,_0x3d3670){const _0x6acc73=_0xa12d9,_0x489a17={'GFUAc':function(_0x47cecb,_0x5d1360){return _0x47cecb+_0x5d1360;},'BzWsn':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','XyjEM':function(_0x4600f2,_0x84afc6,_0x55248f){return _0x4600f2(_0x84afc6,_0x55248f);},'jxMax':function(_0x52b630,_0x3050e5,_0x4546fd){return _0x52b630(_0x3050e5,_0x4546fd);},'MfcvQ':function(_0x14bb1d,_0x1f742a){return _0x14bb1d in _0x1f742a;},'xkPDG':_0x6acc73(0xce),'VUOOI':_0x6acc73(0xf5),'Sgxuh':function(_0x4f6c04,_0x1f4bec){return _0x4f6c04(_0x1f4bec);},'dTrVm':function(_0x488e15,_0x4d99fe){return _0x488e15+_0x4d99fe;},'HpxaC':function(_0x569ea0,_0x310f25){return _0x569ea0+_0x310f25;},'qecKg':function(_0x462478,_0x8b323c){return _0x462478===_0x8b323c;}};if(_0x3d3670){if(!_0x1e13c2?.['environments']?.[_0x3d3670]){const _0x4e9945=Object[_0x6acc73(0x14f)](_0x1e13c2?.[_0x6acc73(0xf7)]??{});throw new Error(_0x489a17[_0x6acc73(0xe4)](_0x489a17['GFUAc']('Auth\x20environment\x20\x22'+_0x3d3670+_0x6acc73(0x124),_0x4e9945[_0x6acc73(0x10f)]?'\x20Available:\x20'+_0x4e9945[_0x6acc73(0xe8)](',\x20')+'.':_0x489a17[_0x6acc73(0x15a)]),'\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)'));}return _0x3d3670;}if(!_0x1e13c2)return null;if(_0x2725a6){const _0x4e8a15=_0x489a17['XyjEM'](matchAuthEnvironmentExact,_0x2725a6,_0x1e13c2);if(_0x4e8a15)return _0x4e8a15;const _0x3738aa=_0x489a17['jxMax'](matchAuthEnvironmentByHost,_0x2725a6,_0x1e13c2);if(_0x3738aa&&_0x489a17[_0x6acc73(0x144)](_0x489a17[_0x6acc73(0x14e)],_0x3738aa))return console[_0x6acc73(0x151)](_0x6acc73(0xeb)+_0x3738aa[_0x6acc73(0xce)]+_0x6acc73(0xd7)+_0x2725a6+'\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).'),_0x3738aa['key'];if(_0x3738aa&&_0x489a17['VUOOI']in _0x3738aa)throw new Error('Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20('+_0x3738aa[_0x6acc73(0xf5)]['join'](',\x20')+');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.');if(_0x489a17['Sgxuh'](needsTunnel,_0x2725a6))throw new Error(_0x489a17[_0x6acc73(0xc6)](_0x489a17['GFUAc'](_0x489a17['HpxaC']('No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22'+_0x2725a6+_0x6acc73(0xee),_0x6acc73(0x111))+_0x6acc73(0xef)+'\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a',_0x6acc73(0xcf)+_0x2725a6[_0x6acc73(0x13b)](/\/+$/,'')+'\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a'),'\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20'+_0x2725a6+'\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.'));}if(_0x1e13c2[_0x6acc73(0x16a)])return _0x1e13c2['defaultEnvironmentKey'];const _0x1b76bb=Object['keys'](_0x1e13c2[_0x6acc73(0xf7)]??{});if(_0x1b76bb[_0x6acc73(0x10f)]===0x1)return _0x1b76bb[0x0];if(_0x489a17['qecKg'](_0x1b76bb[_0x6acc73(0x10f)],0x0))return null;throw new Error(_0x6acc73(0x119)+_0x1b76bb['join'](',\x20')+_0x6acc73(0x121)+_0x6acc73(0x16c));}export function adHocProfileName(_0x1c1ef0,_0xe48dec,_0x4ddbab){const _0x15a9f3=_0xa12d9,_0x5ecf00={'grxCf':function(_0x54db70,_0x51be77){return _0x54db70===_0x51be77;}};if(!_0xe48dec||_0x5ecf00[_0x15a9f3(0xf3)](_0xe48dec,_0x4ddbab))return _0x1c1ef0;return _0x1c1ef0+':'+_0xe48dec;}export async function resolveAdHocProfile(_0x143c45={},_0x14eeea=process[_0xa12d9(0x112)]){const _0x973eb5=_0xa12d9,_0x4841cc={'GxdnQ':function(_0x440d50){return _0x440d50();},'llHjN':function(_0x3bfeef,_0x13d0e2,_0x224d9b,_0xf6edec){return _0x3bfeef(_0x13d0e2,_0x224d9b,_0xf6edec);},'paIxo':function(_0x35ab05,_0x44495d){return _0x35ab05(_0x44495d);},'tOQqG':function(_0x23dae3,_0x9d0f9d){return _0x23dae3!==_0x9d0f9d;},'ACKKq':function(_0x371b24,_0x34d4bc){return _0x371b24??_0x34d4bc;}},_0x3d9bd3=_0x14eeea['RANGER_TEST_USERNAME'];if(!_0x3d9bd3)return null;const _0xf86ea0=await _0x4841cc['GxdnQ'](fetchAuthConfig),_0x1f40ec=_0x4841cc['llHjN'](pickAdHocEnvKey,_0xf86ea0,_0x143c45[_0x973eb5(0xd6)],_0x143c45['envKey']);let _0x57f8f5=adHocProfileName(_0x3d9bd3,_0x1f40ec,_0xf86ea0?.[_0x973eb5(0x16a)]),_0x2ed321=await _0x4841cc['paIxo'](fetchCloudProfile,_0x57f8f5);_0x2ed321&&_0x1f40ec&&_0x4841cc['tOQqG'](_0x2ed321['environmentKey'],_0x1f40ec)&&(console['log']('\x20\x20Cloud\x20profile\x20\x22'+_0x57f8f5+_0x973eb5(0xe9)+(_0x2ed321['environmentKey']??_0x973eb5(0xfb))+_0x973eb5(0x101)+_0x1f40ec+_0x973eb5(0xcd)+_0x3d9bd3+':'+_0x1f40ec+_0x973eb5(0x143)),_0x57f8f5=_0x3d9bd3+':'+_0x1f40ec,_0x2ed321=await fetchCloudProfile(_0x57f8f5));if(_0x2ed321)return{'name':_0x2ed321['name'],'profile':_0x2ed321};const _0x23286f=_0x14eeea[_0x973eb5(0x16f)],_0x4963c0=await createCloudProfile(_0x57f8f5,_0x4841cc['ACKKq'](_0x1f40ec,undefined),{'username':_0x3d9bd3,'password':_0x23286f});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x4963c0['name']+'\x22\x20for\x20'+_0x3d9bd3+(_0x1f40ec?_0x973eb5(0x14c)+_0x1f40ec+')':'')),{'name':_0x4963c0['name'],'profile':_0x4963c0};}export async function writeSessionToLocalCache(_0x2c0ec9,_0x439f61,_0x74d922,_0x34a49a,_0x50b1b1,_0xa17d1e,_0x585924){const _0x1ceefd=_0xa12d9,_0x1c714c={'gbMpl':function(_0x47e3e7,_0x623a94){return _0x47e3e7(_0x623a94);},'EzxBF':function(_0x3ec815,_0x2ad541,_0x27113f){return _0x3ec815(_0x2ad541,_0x27113f);},'afwfD':function(_0x27b78d){return _0x27b78d();},'hlXuU':function(_0x38e4c3,_0x400dd3,_0x51164f){return _0x38e4c3(_0x400dd3,_0x51164f);}},_0x49b383=_0x1c714c['gbMpl'](sessionCacheHash,{'orgId':_0x439f61,'profileName':_0x2c0ec9,'effectiveBaseUrl':_0x74d922,'setupHeaders':_0x34a49a,'invalidateOn':_0x585924?.[_0x1ceefd(0x13a)],'userAgent':_0x585924?.['userAgent'],'clientIp':_0x585924?.['clientIp']}),_0xd03d25=_0x1c714c['EzxBF'](getSessionCachePath,_0x49b383,_0x2c0ec9),_0x5c4752=join(_0x1c714c[_0x1ceefd(0x137)](getRangerHomeDir),_0x1ceefd(0x138));!existsSync(_0x5c4752)&&await _0x1c714c[_0x1ceefd(0xd1)](mkdir,_0x5c4752,{'recursive':!![]});const _0x2a5ccd={..._0x50b1b1};_0xa17d1e&&_0xa17d1e[_0x1ceefd(0x10f)]>0x0&&Array['isArray'](_0x2a5ccd[_0x1ceefd(0x131)])&&(_0x2a5ccd['cookies']=_0x1c714c[_0x1ceefd(0xd1)](duplicateCookiesForDomains,_0x2a5ccd[_0x1ceefd(0x131)],_0xa17d1e));const _0x216b1c={'cached_at':new Date()[_0x1ceefd(0x160)](),'session_state':_0x2a5ccd};await _0x1c714c[_0x1ceefd(0xd1)](writeFile,_0xd03d25,JSON[_0x1ceefd(0x11d)](_0x216b1c,null,0x2));const _0x3be973=getStorageStatePath(_0xd03d25);return await _0x1c714c['EzxBF'](writeFile,_0x3be973,JSON['stringify'](_0x2a5ccd,null,0x2)),_0x3be973;}export async function checkLocalCache(_0x34bafc,_0x110686,_0x25f125,_0x4f2f3f,_0x258cd8){const _0x343971=_0xa12d9,_0x363d97={'uuZKf':function(_0xccb8c2,_0x29adc4){return _0xccb8c2(_0x29adc4);},'HDVqG':function(_0xf45ced,_0x2f2e82){return _0xf45ced(_0x2f2e82);},'GDiSG':function(_0x10290a,_0x475d8f,_0x12e244){return _0x10290a(_0x475d8f,_0x12e244);},'qirnz':_0x343971(0x152)},_0x15fdbb=_0x363d97[_0x343971(0x133)](sessionCacheHash,{'orgId':_0x110686,'profileName':_0x34bafc,'effectiveBaseUrl':_0x25f125,'setupHeaders':_0x4f2f3f,'invalidateOn':_0x258cd8?.[_0x343971(0x13a)],'userAgent':_0x258cd8?.[_0x343971(0x12b)],'clientIp':_0x258cd8?.[_0x343971(0x168)]}),_0x12be9b=getSessionCachePath(_0x15fdbb,_0x34bafc),_0x346751=_0x363d97['HDVqG'](getStorageStatePath,_0x12be9b);if(!existsSync(_0x12be9b)||!_0x363d97['HDVqG'](existsSync,_0x346751))return null;try{const _0x3b1024=await _0x363d97[_0x343971(0x167)](readFile,_0x12be9b,_0x363d97['qirnz']);return JSON['parse'](_0x3b1024),{'storageStatePath':_0x346751};}catch{return null;}}function launchRealBrowser(){const _0x10ee2f=_0xa12d9;return chromium[_0x10ee2f(0x165)]({'headless':!![]});}function _0x495a(){const _0x4d0512=['Rnxib','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','tunnel_session_id','telemetry','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','setupHeaders','SuLIJ','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','stringify','CsBvI','name','sessionCheckPath',').\x20','/session','RANGER_TEST_USERNAME','\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.','tunnel_login_setup','type','2XGLYWK','50536Bmoxwe','json','1629GaqFlV','userAgent','split','baseUrl','sessionId','sessionState','783690VtUaWB','cookies','BeLDb','uuZKf','DELETE','zbCWT','storageStatePath','afwfD','auth','CfhMR','invalidateOn','replace','):\x20','bSnvI','keQif','agent','target_url','OcloR','148eewNkr','\x22\x20instead.','MfcvQ','catch','not_configured','8817876zxxfSN','forceLogin','33YvqmgV','application/json','tunnel_bridge_event','\x20(auth\x20env:\x20','Xbjzh','xkPDG','keys','\x20\x20Cloud\x20session\x20for\x20\x22','log','utf-8','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','local_ws_error','IxyTK','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','YwRYD','close','API\x20request\x20','BzWsn','\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...','save','\x22,\x20attempting\x20login...','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','pNXeC','toISOString','tunnel_login_cleanup','tunnel','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','tunnel_bridge','launch','\x22,\x20refreshing\x20session...','GDiSG','clientIp','HlQsE','defaultEnvironmentKey','username','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>`.','pwEndpoint','confirm','RANGER_TEST_PASSWORD','rBztm','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','nMuef','omDoi','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','dTrVm','2641182lISLFr','url','loginInstructions','code','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','trim','\x22;\x20using\x20\x22','key','\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22','AQPeO','hlXuU','2|4|1|0|3','newContext','activeLocalConnections','BwHHZ','targetUrl','\x22\x20matched\x20by\x20host\x20for\x20','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','117255hyBIAS','domains','settings','CBFRc','ffVST','persistSessionState','627697cbMxRR','session_state','tunnel_login_request','FhRjF','extraHTTPHeaders','GFUAc','\x22,\x20cached\x20locally','organizationId','dlWMp','join','\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22','Bearer\x20','\x20\x20Auth\x20env\x20\x22','EHvZm','tunnelUrl','\x22.\x0a','\x20\x20Options:\x0a','IOyOk','password','PUT','grxCf','bngEP','ambiguous','POST','environments','/login','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','Browser\x20login\x20timed\x20out\x20before\x20completion.','none','trackPhaseError','/api/v1/profiles','test_output','\x22\x20not\x20found.','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22','map','QWzOI','/api/v1/profiles/','uNOZJ','newPage','status','message','\x22;\x20proceeding\x20with\x20loginInstructions.','toLowerCase','trackPhaseEnd','/api/v1/tunnel/sessions/','2931477IPncBm','error','length','force','\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a','env','\x20\x20No\x20live\x20session\x20for\x20\x22','7nSWpHu'];_0x495a=function(){return _0x4d0512;};return _0x495a();}function emitSessionValidationHint(_0x5bffd9,_0x4ae211){const _0x4a7309=_0xa12d9,_0x1d416a={'WNhpY':function(_0x55b166,_0x500cc5){return _0x55b166===_0x500cc5;},'CBFRc':function(_0x244cd7,_0x43ae2e){return _0x244cd7+_0x43ae2e;}};if(!_0x4ae211||!_0x4ae211['domains']?.[_0x4a7309(0x10f)])return;let _0x3ea602;try{_0x3ea602=new URL(_0x5bffd9);}catch{return;}const _0x268ec5=[];for(const _0x34cad9 of _0x4ae211[_0x4a7309(0xda)]){try{_0x268ec5['push']({'raw':_0x34cad9,'url':new URL(_0x34cad9)});}catch{}}if(_0x1d416a['WNhpY'](_0x268ec5['length'],0x0))return;if(_0x268ec5['some'](_0x1410c4=>_0x1410c4[_0x4a7309(0xc8)]['origin']===_0x3ea602['origin']))return;const _0x45e7c7=_0x268ec5[_0x4a7309(0x102)](_0x4fc2db=>'\x22'+_0x4fc2db['raw']+'\x22')[_0x4a7309(0xe8)](',\x20');console[_0x4a7309(0x151)](_0x1d416a[_0x4a7309(0xdc)]('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x45e7c7+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x5bffd9+_0x4a7309(0xd8))+'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.');}export async function serverSideLogin(_0x535f53,_0x5c1953){const _0x3945ab=_0xa12d9,_0x44355d={'aDfqp':function(_0x3710fd,_0x68603c){return _0x3710fd===_0x68603c;},'YAJRv':_0x3945ab(0x146)},_0x50c443=process['env'][_0x3945ab(0x123)],_0x44a2af=process['env'][_0x3945ab(0x16f)],_0x10e7f0={};if(_0x50c443)_0x10e7f0[_0x3945ab(0x16b)]=_0x50c443;if(_0x44a2af)_0x10e7f0[_0x3945ab(0xf1)]=_0x44a2af;if(_0x5c1953?.[_0x3945ab(0x110)])_0x10e7f0[_0x3945ab(0x110)]=!![];if(_0x5c1953?.['targetUrl'])_0x10e7f0[_0x3945ab(0x140)]=_0x5c1953[_0x3945ab(0xd6)];_0x5c1953?.[_0x3945ab(0x162)]&&(_0x10e7f0[_0x3945ab(0x117)]=_0x5c1953[_0x3945ab(0x162)][_0x3945ab(0x12e)],_0x10e7f0['pw_endpoint']=_0x5c1953['tunnel']['pwEndpoint']);try{return await apiRequest(_0x3945ab(0x104)+encodeURIComponent(_0x535f53)+_0x3945ab(0xf8),{'method':'POST','body':JSON['stringify'](_0x10e7f0)});}catch(_0x15af3d){if(_0x15af3d instanceof ApiError&&_0x15af3d[_0x3945ab(0x107)]===0x190&&_0x44355d['aDfqp'](_0x15af3d['code'],'not_configured'))return{'status':_0x44355d['YAJRv'],'error':_0x15af3d['detail']};throw _0x15af3d;}}async function serverSideLoginWithOptionalTunnel(_0x46b5f4,_0x4291eb,_0x3977c8={}){const _0x44649d=_0xa12d9,_0x1e68eb={'slnWf':function(_0x40567d,_0x288475){return _0x40567d(_0x288475);},'DCRhd':function(_0x533c06,_0x4d0144){return _0x533c06(_0x4d0144);},'uNOZJ':function(_0x376962,_0x5d25ed,_0x3c501a){return _0x376962(_0x5d25ed,_0x3c501a);},'zbCWT':function(_0x1c5016,_0x53439b){return _0x1c5016===_0x53439b;},'CfhMR':function(_0x1929b4,_0x12bdd8){return _0x1929b4(_0x12bdd8);},'rBztm':'tunnel_login_setup','dlWMp':function(_0x2a81a2,_0x12279b){return _0x2a81a2(_0x12279b);},'yNQql':function(_0x53b940,_0x10e283){return _0x53b940(_0x10e283);}};if(!_0x1e68eb['DCRhd'](needsTunnel,_0x4291eb))return await _0x1e68eb['uNOZJ'](serverSideLogin,_0x46b5f4,{'force':_0x3977c8['force']});let _0x1ebb21=null,_0x51e130=null,_0x3eeb8b=null,_0x3f6a48=null,_0x33fb46=![];const _0x2544e3=process[_0x44649d(0x112)]['RANGER_TUNNEL_LOGIN_HEADED']?.[_0x44649d(0x10a)](),_0x1599d9=_0x1e68eb[_0x44649d(0x135)](_0x2544e3,'1')||_0x1e68eb['zbCWT'](_0x2544e3,'true'),_0x397359={'profileName':_0x46b5f4,'targetUrlHost':targetHostForTelemetry(_0x4291eb),'tunnelRequired':!![],'forceLogin':_0x1e68eb[_0x44649d(0x139)](Boolean,_0x3977c8[_0x44649d(0x110)]),'localBrowserServerHeaded':_0x1599d9};try{_0x3977c8[_0x44649d(0x118)]?.['trackPhaseStart'](_0x1e68eb[_0x44649d(0xc0)],_0x397359);_0x1599d9&&console[_0x44649d(0x151)](_0x44649d(0x15b));_0x1ebb21=await _0x1e68eb['DCRhd'](launchBrowserServer,{'headless':!_0x1599d9}),_0x51e130=await _0x1e68eb[_0x44649d(0xe7)](createTunnelSession,_0x4291eb);const _0x59345e=await requireToken();_0x3eeb8b=await createTunnelBridge({'localWsUrl':_0x1ebb21['wsEndpoint'],'tunnelServerUrl':_0x51e130[_0x44649d(0xed)],'sessionId':_0x51e130['sessionId'],'apiKey':_0x59345e,'onError':_0x1d0ec9=>{_0x3f6a48=_0x1d0ec9;},'onClose':()=>{const _0x34f107=_0x44649d;_0x3f6a48??=new Error(_0x34f107(0x11c)+_0x46b5f4);},'onEvent':_0x177892=>trackBridgeEvent(_0x3977c8[_0x44649d(0x118)],_0x177892)}),_0x3977c8['telemetry']?.[_0x44649d(0x10b)](_0x44649d(0x125),{..._0x397359,'tunnelSessionId':_0x51e130['sessionId'],'localBrowserServer':!![],'localBrowserServerHeaded':_0x1599d9}),_0x33fb46=!![];try{return _0x3977c8[_0x44649d(0x118)]?.['trackPhaseStart']('tunnel_login_request',{..._0x397359,'tunnelSessionId':_0x51e130['sessionId']}),await _0x1e68eb[_0x44649d(0x105)](serverSideLogin,_0x46b5f4,{'force':_0x3977c8['force'],'targetUrl':_0x4291eb,'tunnel':{'sessionId':_0x51e130['sessionId'],'pwEndpoint':_0x51e130[_0x44649d(0x16d)]}})['then'](_0x33ebf2=>{const _0x3d1427=_0x44649d;return _0x3977c8['telemetry']?.['trackPhaseEnd'](_0x3d1427(0xe1),{..._0x397359,'tunnelSessionId':_0x51e130?.[_0x3d1427(0x12e)],'loginStatus':_0x33ebf2['status'],'hasSessionState':Boolean(_0x33ebf2[_0x3d1427(0xe0)]),'hasTestOutput':_0x1e68eb['slnWf'](Boolean,_0x33ebf2[_0x3d1427(0xfe)]),'bridgeError':errorMessageForTelemetry(_0x3f6a48)}),_0x33ebf2;});}catch(_0x3103ea){await _0x3977c8[_0x44649d(0x118)]?.['trackPhaseError'](_0x44649d(0xe1),_0x3f6a48??_0x3103ea,{..._0x397359,'tunnelSessionId':_0x51e130[_0x44649d(0x12e)],'bridgeError':_0x1e68eb['yNQql'](errorMessageForTelemetry,_0x3f6a48)});throw _0x3f6a48??_0x3103ea;}}catch(_0xd8af53){!_0x33fb46&&await _0x3977c8[_0x44649d(0x118)]?.[_0x44649d(0xfc)](_0x1e68eb['rBztm'],_0xd8af53,{..._0x397359,'tunnelSessionId':_0x51e130?.['sessionId']});throw _0xd8af53;}finally{if(_0x51e130||_0x1ebb21||_0x3eeb8b){const _0x319d67='3|2|0|1|4'[_0x44649d(0x12c)]('|');let _0x557ef8=0x0;while(!![]){switch(_0x319d67[_0x557ef8++]){case'0':_0x1ebb21&&await _0x1ebb21[_0x44649d(0x158)]()[_0x44649d(0x145)](()=>{});continue;case'1':_0x51e130&&await deleteTunnelSession(_0x51e130[_0x44649d(0x12e)])['catch'](()=>{});continue;case'2':_0x3eeb8b?.['close']();continue;case'3':_0x3977c8['telemetry']?.['trackPhaseStart']('tunnel_login_cleanup',{..._0x397359,'tunnelSessionId':_0x51e130?.[_0x44649d(0x12e)]});continue;case'4':_0x3977c8[_0x44649d(0x118)]?.[_0x44649d(0x10b)](_0x44649d(0x161),{..._0x397359,'tunnelSessionId':_0x51e130?.[_0x44649d(0x12e)]});continue;}break;}}}}export async function manualBrowserLogin(_0x5c9953,_0x23741e,_0x31aeee={}){const _0x5c26a3=_0xa12d9,_0x4dc1d3={'RCCHj':function(_0x5d3f17,_0x31f5f0){return _0x5d3f17(_0x31f5f0);},'TNIws':function(_0xe4d7d3,_0xc8040a){return _0xe4d7d3+_0xc8040a;},'qJlIV':function(_0x1a2e9c,_0x3396b7){return _0x1a2e9c>_0x3396b7;},'XUIfF':_0x5c26a3(0x116),'VKIuj':'\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','Xbjzh':function(_0xf87c28,_0xb672ab){return _0xf87c28&&_0xb672ab;},'Rnxib':_0x5c26a3(0xfa),'fMokn':function(_0x232354,_0x20b5ee){return _0x232354(_0x20b5ee);}};if(!isInteractive())throw new Error(_0x4dc1d3['TNIws'](_0x5c26a3(0x163)+_0x5c9953['name']+_0x5c26a3(0xee),'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20')+_0x5c26a3(0x156));const _0x5e8d96=_0x23741e&&_0x4dc1d3['qJlIV'](_0x23741e['domains']['length'],0x0)?_0x23741e['domains'][0x0]:'about:blank';console[_0x5c26a3(0x151)](_0x4dc1d3['XUIfF']),console[_0x5c26a3(0x151)](_0x4dc1d3['VKIuj']),await new Promise(_0x36a9e6=>setTimeout(_0x36a9e6,0x7d0));const _0x14d63b=await chromium['launch']({'headless':![]});let _0x52ce62=null;try{const _0x2106d0={'ignoreHTTPSErrors':!![]};_0x23741e?.['setupHeaders']&&(_0x2106d0[_0x5c26a3(0xe3)]=_0x23741e[_0x5c26a3(0x11a)]);const _0x57d014=await _0x14d63b[_0x5c26a3(0xd3)](_0x2106d0);await addProfileSetupBanner(_0x57d014);const _0x36e3c4=await _0x57d014[_0x5c26a3(0x106)]();await _0x36e3c4['goto'](_0x5e8d96);let _0x2a4cee=![];await new Promise(_0x394a05=>{const _0x437d10=_0x5c26a3,_0x31ec93={'tmiKh':function(_0x27336a,_0x377b8c){return _0x4dc1d3['RCCHj'](_0x27336a,_0x377b8c);}},_0x12edd6=setTimeout(()=>{const _0x4f40e9=_0x4050;_0x2a4cee=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+MANUAL_LOGIN_TIMEOUT_MS/0xea60+_0x4f40e9(0x100)),_0x394a05();},MANUAL_LOGIN_TIMEOUT_MS);_0x36e3c4['on'](_0x437d10(0x158),async()=>{_0x31ec93['tmiKh'](clearTimeout,_0x12edd6);try{const _0x896fcd=await _0x57d014['storageState']();_0x52ce62=_0x896fcd;}catch{}_0x394a05();});});if(_0x4dc1d3[_0x5c26a3(0x14d)](_0x2a4cee,!_0x52ce62))throw new Error(_0x4dc1d3[_0x5c26a3(0x115)]);}finally{await _0x14d63b['close']()[_0x5c26a3(0x145)](()=>{});}if(!_0x52ce62)throw new Error(_0x5c26a3(0xc5));return _0x31aeee[_0x5c26a3(0xde)]!==![]&&await apiRequest('/api/v1/profiles/'+_0x4dc1d3['fMokn'](encodeURIComponent,_0x5c9953[_0x5c26a3(0x11f)])+_0x5c26a3(0x122),{'method':'POST','body':JSON[_0x5c26a3(0x11d)]({'session_state':_0x52ce62,'updated_by':'cli:manual-login'})}),{'sessionState':_0x52ce62};}export async function promptSaveCredentials(_0x28dffb){const _0x556611=_0xa12d9,_0x32f69b={'autvJ':function(_0x1d9b1d,_0x42d6b1){return _0x1d9b1d||_0x42d6b1;},'bngEP':_0x556611(0x16e),'rRnvS':_0x556611(0x15c),'CsBvI':function(_0x172114,_0x33f62d,_0x4dbf0e){return _0x172114(_0x33f62d,_0x4dbf0e);},'WRAQt':'PUT'},_0x3ebee4=process['env'][_0x556611(0x123)],_0x23b6a4=process['env'][_0x556611(0x16f)];if(_0x32f69b['autvJ'](!_0x3ebee4,!_0x23b6a4))return;if(!isInteractive())return;const {save:_0x56e8e8}=await _0x20e70b['prompt']([{'type':_0x32f69b[_0x556611(0xf4)],'name':_0x32f69b['rRnvS'],'message':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','default':![]}]);if(!_0x56e8e8)return;await _0x32f69b[_0x556611(0x11e)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x28dffb),{'method':_0x32f69b['WRAQt'],'body':JSON['stringify']({'username':_0x3ebee4,'password':_0x23b6a4})}),console['log'](_0x556611(0xc1));}export async function resolveCloudProfileSession(_0x567d7e,_0x35613d={}){const _0x53a1e5=_0xa12d9,_0x3a3a0d={'keQif':function(_0x3df067){return _0x3df067();},'YwRYD':function(_0x11273a,_0x113673){return _0x11273a===_0x113673;},'EHvZm':function(_0x3c0ecd,_0x29aed3){return _0x3c0ecd(_0x29aed3);},'PFjlc':function(_0x5a9de7,_0x598333){return _0x5a9de7>_0x598333;},'ZjWRY':function(_0x52aaae,_0x385e29,_0x14779c,_0x37c6fc,_0x56d0da){return _0x52aaae(_0x385e29,_0x14779c,_0x37c6fc,_0x56d0da);},'HlQsE':function(_0x100902,_0x3d204f,_0x50a73b){return _0x100902(_0x3d204f,_0x50a73b);},'BwHHZ':function(_0x1ea508,_0x15cb3c){return _0x1ea508||_0x15cb3c;},'OcloR':function(_0x5e6b38,_0x7bedce,_0x12db43){return _0x5e6b38(_0x7bedce,_0x12db43);},'MiejP':'success','pNXeC':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','fxpwA':function(_0x4b22e3,_0xa7477){return _0x4b22e3 instanceof _0xa7477;},'JKTqK':function(_0x38b456,_0x1da4ed){return _0x38b456(_0x1da4ed);},'KRExO':_0x53a1e5(0xc4),'xPHOc':function(_0x2103df,_0x9f2d77,_0x20fb3f,_0x63034d){return _0x2103df(_0x9f2d77,_0x20fb3f,_0x63034d);},'SuLIJ':function(_0x550592,_0x1c0c22,_0x5b243f,_0x3754e7,_0x3a80e3,_0x1a961b,_0x2fa122,_0xf3742b){return _0x550592(_0x1c0c22,_0x5b243f,_0x3754e7,_0x3a80e3,_0x1a961b,_0x2fa122,_0xf3742b);}},_0x5742ec=_0x567d7e['settings']??{},_0x29369f=await _0x3a3a0d[_0x53a1e5(0x13e)](fetchAuthConfig),_0x277497=_0x29369f?resolveAuthEnvironmentLocally(_0x29369f,_0x567d7e['environmentKey']):null,_0x4a63d8=_0x3a3a0d[_0x53a1e5(0x157)](typeof _0x277497?.[_0x53a1e5(0xc9)],'string')&&_0x277497[_0x53a1e5(0xc9)][_0x53a1e5(0xcc)]()?_0x277497['loginInstructions']:undefined,_0x37ebef=typeof _0x5742ec['loginInstructions']==='string'&&_0x5742ec[_0x53a1e5(0xc9)][_0x53a1e5(0xcc)]()?_0x5742ec[_0x53a1e5(0xc9)]:undefined,_0x5a79d7=_0x37ebef||!_0x4a63d8?_0x5742ec:{..._0x5742ec,'loginInstructions':_0x4a63d8},_0x4cbab1=_0x3a3a0d[_0x53a1e5(0xec)](Boolean,_0x5a79d7['loginInstructions']?.['trim']()),_0x3d9079=Boolean(_0x5742ec[_0x53a1e5(0x148)]||_0x277497?.['forceLogin']),_0x4474ed=_0x277497?.[_0x53a1e5(0xda)],_0x54c25f=_0x5742ec['setupHeaders'],_0x2c1ada=_0x54c25f??_0x277497?.['setupHeaders'],_0x1fc8b6=_0x35613d['effectiveBaseUrl']??_0x5742ec[_0x53a1e5(0x12d)]??(_0x4474ed&&_0x3a3a0d['PFjlc'](_0x4474ed['length'],0x0)?_0x4474ed[0x0]:''),_0x20efb8=_0x1fc8b6?_0x3a3a0d['EHvZm'](needsTunnel,_0x1fc8b6):![],_0x36caff={'invalidateOn':_0x277497?.['invalidateOn'],'userAgent':_0x277497?.['browserOptions']?.['userAgent']??_0x5742ec['userAgent']};_0x3d9079&&console[_0x53a1e5(0x151)]('\x20\x20forceLogin\x20enabled\x20for\x20\x22'+_0x567d7e['name']+_0x53a1e5(0x166));if(!_0x3d9079){const _0x33ddc4=await checkLocalCache(_0x567d7e[_0x53a1e5(0x11f)],_0x567d7e[_0x53a1e5(0xe6)],_0x1fc8b6,_0x2c1ada,_0x36caff);if(_0x33ddc4){if(_0x1fc8b6&&!_0x20efb8){const _0x1983ed=await _0x3a3a0d['ZjWRY'](isCachedSessionLive,_0x33ddc4['storageStatePath'],_0x1fc8b6,{'sessionCheckPath':_0x277497?.[_0x53a1e5(0x120)],'setupHeaders':_0x2c1ada},{'launchBrowser':launchRealBrowser});if(_0x1983ed)return console['log']('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x567d7e['name']+'\x22'),{'authPath':_0x33ddc4['storageStatePath'],'settings':_0x5a79d7,'resolvedEnv':_0x277497};console[_0x53a1e5(0x151)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0x567d7e['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),emitSessionValidationHint(_0x1fc8b6,_0x277497);}else return _0x20efb8&&console['log'](_0x53a1e5(0x15e)+_0x567d7e[_0x53a1e5(0x11f)]+'\x22'),{'authPath':_0x33ddc4[_0x53a1e5(0x136)],'settings':_0x5a79d7,'resolvedEnv':_0x277497};}}if(!_0x3d9079&&_0x567d7e['sessionState']){if(_0x20efb8)console['log']('\x20\x20Skipping\x20cloud\x20session\x20for\x20local\x20target\x20\x22'+_0x1fc8b6+'\x22\x20on\x20profile\x20\x22'+_0x567d7e['name']+'\x22');else{const _0x4dc7b8=await writeSessionToLocalCache(_0x567d7e[_0x53a1e5(0x11f)],_0x567d7e['organizationId'],_0x1fc8b6,_0x2c1ada,_0x567d7e[_0x53a1e5(0x12f)],_0x4474ed,_0x36caff);if(_0x1fc8b6){const _0x49536e=await isCachedSessionLive(_0x4dc7b8,_0x1fc8b6,{'sessionCheckPath':_0x277497?.['sessionCheckPath'],'setupHeaders':_0x2c1ada},{'launchBrowser':launchRealBrowser});if(_0x49536e)return console[_0x53a1e5(0x151)]('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x567d7e['name']+_0x53a1e5(0xe5)),{'authPath':_0x4dc7b8,'settings':_0x5a79d7,'resolvedEnv':_0x277497};console['log'](_0x53a1e5(0x150)+_0x567d7e['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),_0x3a3a0d[_0x53a1e5(0x169)](emitSessionValidationHint,_0x1fc8b6,_0x277497);}else return{'authPath':_0x4dc7b8,'settings':_0x5a79d7,'resolvedEnv':_0x277497};}}if(_0x4cbab1)return console[_0x53a1e5(0x151)](_0x53a1e5(0x113)+_0x567d7e['name']+_0x53a1e5(0x109)),{'authPath':undefined,'settings':_0x5a79d7,'resolvedEnv':_0x277497};console['log']('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x567d7e[_0x53a1e5(0x11f)]+_0x53a1e5(0x15d));const _0x2c6cec=Boolean(process[_0x53a1e5(0x112)]['RANGER_TEST_USERNAME'])&&_0x3a3a0d['EHvZm'](Boolean,process[_0x53a1e5(0x112)]['RANGER_TEST_PASSWORD']),_0x200263=_0x3a3a0d['EHvZm'](Boolean,_0x567d7e[_0x53a1e5(0x16b)]);if(_0x3a3a0d[_0x53a1e5(0xd5)](_0x2c6cec,_0x200263))try{const _0x4c6067=_0x1fc8b6?await serverSideLoginWithOptionalTunnel(_0x567d7e['name'],_0x1fc8b6,{'force':_0x3d9079,'telemetry':_0x35613d[_0x53a1e5(0x118)]}):await _0x3a3a0d[_0x53a1e5(0x141)](serverSideLogin,_0x567d7e[_0x53a1e5(0x11f)],{'force':_0x3d9079});if(_0x4c6067['status']===_0x53a1e5(0x146))console['log'](_0x53a1e5(0x153));else{if(_0x4c6067['status']===_0x3a3a0d['MiejP']&&_0x4c6067[_0x53a1e5(0xe0)]){console['log']('\x20\x20Login\x20successful.\x20Session\x20cached.');const _0x5080e3=await writeSessionToLocalCache(_0x567d7e['name'],_0x567d7e[_0x53a1e5(0xe6)],_0x1fc8b6,_0x2c1ada,_0x4c6067[_0x53a1e5(0xe0)],_0x4474ed,_0x36caff);return _0x2c6cec&&!_0x200263&&await promptSaveCredentials(_0x567d7e['name']),{'authPath':_0x5080e3,'settings':_0x5a79d7,'resolvedEnv':_0x277497};}else _0x4c6067['test_output']&&(console['log'](_0x3a3a0d[_0x53a1e5(0x15f)]),console['log'](_0x4c6067['test_output'])),console[_0x53a1e5(0x151)](_0x53a1e5(0xc4));}}catch(_0x237990){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x3a3a0d['fxpwA'](_0x237990,Error)?_0x237990['message']:_0x3a3a0d['JKTqK'](String,_0x237990))),console['log'](_0x3a3a0d['KRExO']);}const _0x544acc=_0x277497?{..._0x277497,'setupHeaders':_0x2c1ada}:_0x1fc8b6?{'key':_0x567d7e['environmentKey']??'','domains':[_0x1fc8b6],'setupHeaders':_0x2c1ada}:null,{sessionState:_0x3e3f79}=await _0x3a3a0d['xPHOc'](manualBrowserLogin,_0x567d7e,_0x544acc,{'persistSessionState':!_0x20efb8}),_0x1095bd=await _0x3a3a0d[_0x53a1e5(0x11b)](writeSessionToLocalCache,_0x567d7e[_0x53a1e5(0x11f)],_0x567d7e['organizationId'],_0x1fc8b6,_0x2c1ada,_0x3e3f79,_0x4474ed,_0x36caff);return{'authPath':_0x1095bd,'settings':_0x5a79d7,'resolvedEnv':_0x277497};}
@@ -1 +1 @@
1
- function _0x23d0(){const _0x435d8a=['push','environments','localhost.','205PXTWHy','has','jgpPi','launchBrowser','invalidateOn','clientIp','url','Tdlkk','goto','lvgXV','190421asIFNi','.localhost','setupHeaders','hostname','toString','add','780214xpiQMk','defaultEnvironmentKey','includes','.storageState.json','194478hYLQUZ','effectiveBaseUrl','replace','domcontentloaded','14284450sixriK','216ybmJzB','length','orgId','sha256','566392hyjKAS','3975138AxkcLb','auth','ycODN','1192698kPRGfS','sessionCheckPath','127.0.0.1','rQnOV','port','digest','bQkZi','map','.json','sort','userAgent','iQjDD','slice','stdout','stringify','3YMPqYW'];_0x23d0=function(){return _0x435d8a;};return _0x23d0();}const _0x451f04=_0x16fb;(function(_0x1672e8,_0x1c1bba){const _0x43df4a=_0x16fb,_0x29b02a=_0x1672e8();while(!![]){try{const _0x16b099=-parseInt(_0x43df4a(0x1f5))/0x1+-parseInt(_0x43df4a(0x1e4))/0x2+parseInt(_0x43df4a(0x204))/0x3*(-parseInt(_0x43df4a(0x1f1))/0x4)+-parseInt(_0x43df4a(0x1d4))/0x5*(-parseInt(_0x43df4a(0x1e8))/0x6)+-parseInt(_0x43df4a(0x1de))/0x7*(parseInt(_0x43df4a(0x1ed))/0x8)+parseInt(_0x43df4a(0x1f2))/0x9+parseInt(_0x43df4a(0x1ec))/0xa;if(_0x16b099===_0x1c1bba)break;else _0x29b02a['push'](_0x29b02a['shift']());}catch(_0x1bdc45){_0x29b02a['push'](_0x29b02a['shift']());}}}(_0x23d0,0xb4b50));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x2da744=process['env'],_0x52a962={'stdin':process['stdin'],'stdout':process[_0x451f04(0x202)]}){const _0xc50344=_0x451f04,_0x145dcd={'bQkZi':function(_0x233f32,_0x3cce61){return _0x233f32(_0x3cce61);},'VskdJ':function(_0x4664a3,_0x33b5fa){return _0x4664a3(_0x33b5fa);}};if(_0x2da744['CI'])return![];return _0x145dcd[_0xc50344(0x1fb)](Boolean,_0x52a962['stdin']['isTTY'])&&_0x145dcd['VskdJ'](Boolean,_0x52a962[_0xc50344(0x202)]['isTTY']);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x5531e3){const _0x52a36c=_0x451f04,_0x2c4ac5={'lvgXV':function(_0x367e63,_0xaa148b){return _0x367e63(_0xaa148b);},'Tarob':'baseUrl','jgpPi':'setupHeaders','rQnOV':function(_0x33f543,_0x1bcd8d){return _0x33f543!==_0x1bcd8d;},'ycODN':_0x52a36c(0x1d9),'InWHv':function(_0x26794f,_0x5536ec){return _0x26794f!==_0x5536ec;},'iQjDD':function(_0x26b233,_0x48c52b){return _0x26b233(_0x48c52b);}},_0x5aaf18=new Set(_0x5531e3[_0x52a36c(0x1d8)]??DEFAULT_INVALIDATE_ON);_0x5531e3[_0x52a36c(0x1e9)]&&_0x2c4ac5[_0x52a36c(0x1dd)](needsTunnel,_0x5531e3[_0x52a36c(0x1e9)])&&_0x5aaf18[_0x52a36c(0x1e3)]('baseUrl');const _0x10a3c8={'orgId':_0x5531e3[_0x52a36c(0x1ef)],'profileName':_0x5531e3['profileName']};return _0x5aaf18[_0x52a36c(0x1d5)](_0x2c4ac5['Tarob'])&&(_0x10a3c8[_0x52a36c(0x1e9)]=_0x5531e3[_0x52a36c(0x1e9)]),_0x5aaf18['has'](_0x2c4ac5[_0x52a36c(0x1d6)])&&(_0x10a3c8[_0x52a36c(0x1e0)]=_0x5531e3['setupHeaders']?sortObjectKeys(_0x5531e3[_0x52a36c(0x1e0)]):_0x5531e3['setupHeaders']),_0x5aaf18['has'](_0x52a36c(0x1f9))&&(_0x10a3c8['port']=extractPort(_0x5531e3['effectiveBaseUrl'])),_0x5aaf18[_0x52a36c(0x1d5)]('userAgent')&&_0x2c4ac5[_0x52a36c(0x1f8)](_0x5531e3['userAgent'],undefined)&&(_0x10a3c8['userAgent']=_0x5531e3[_0x52a36c(0x1ff)]),_0x5aaf18[_0x52a36c(0x1d5)](_0x2c4ac5[_0x52a36c(0x1f4)])&&_0x2c4ac5['InWHv'](_0x5531e3['clientIp'],undefined)&&(_0x10a3c8['clientIp']=_0x5531e3[_0x52a36c(0x1d9)]),_0x2c4ac5[_0x52a36c(0x200)](createHash,_0x52a36c(0x1f0))['update'](JSON[_0x52a36c(0x203)](_0x10a3c8))[_0x52a36c(0x1fa)]('hex')[_0x52a36c(0x201)](0x0,0xc);}function extractPort(_0x4723bf){try{return new URL(_0x4723bf)['port'];}catch{return'';}}function sortObjectKeys(_0x596c71){const _0xde9263=_0x451f04,_0xf941e4={};for(const _0x2808b7 of Object['keys'](_0x596c71)[_0xde9263(0x1fe)]()){_0xf941e4[_0x2808b7]=_0x596c71[_0x2808b7];}return _0xf941e4;}export function getSessionCachePath(_0x338c12,_0x2d4944){const _0x545e1d=_0x451f04,_0x3c0a1a={'wXmYS':_0x545e1d(0x1f3)};return join(getRangerHomeDir(),_0x3c0a1a['wXmYS'],_0x338c12+'-'+_0x2d4944+_0x545e1d(0x1fd));}export function getStorageStatePath(_0x51af0d){const _0x131945=_0x451f04,_0x391370={'mTBKr':_0x131945(0x1e7)};return _0x51af0d[_0x131945(0x1ea)](/\.json$/,_0x391370['mTBKr']);}export function needsTunnel(_0x232934){const _0x361de9=_0x451f04,_0x54b218={'Tdlkk':function(_0x2b2a10,_0x1e828e){return _0x2b2a10===_0x1e828e;}};let _0x4aa26f;try{_0x4aa26f=new URL(_0x232934)['hostname'];}catch{return![];}if(_0x4aa26f==='localhost'||_0x54b218[_0x361de9(0x1db)](_0x4aa26f,_0x361de9(0x1f7)))return!![];if(_0x4aa26f['endsWith'](_0x361de9(0x1df)))return!![];if(_0x4aa26f[_0x361de9(0x1e6)](_0x361de9(0x1d3)))return!![];return![];}export function hostnameOf(_0x3db0f9){const _0x332036=_0x451f04;return new URL(_0x3db0f9)[_0x332036(0x1e1)];}export function duplicateCookiesForDomains(_0x66ffe,_0x4d269d){const _0x9e8361=_0x451f04,_0x1816f2=[..._0x66ffe],_0x437d99=new Set(_0x66ffe[_0x9e8361(0x1fc)](_0x10455c=>_0x10455c['domain']));for(const _0xeeffdd of _0x4d269d){let _0x87a49;try{_0x87a49=hostnameOf(_0xeeffdd);}catch{continue;}if(!_0x87a49)continue;const _0x3bd9c5=_0x87a49['startsWith']('.')?_0x87a49:'.'+_0x87a49;if(_0x437d99['has'](_0x87a49)||_0x437d99['has'](_0x3bd9c5))continue;for(const _0x395bcc of _0x66ffe){_0x1816f2[_0x9e8361(0x1d1)]({..._0x395bcc,'domain':_0x3bd9c5});}_0x437d99['add'](_0x3bd9c5);}return _0x1816f2;}function _0x16fb(_0x4b6616,_0x226ad7){_0x4b6616=_0x4b6616-0x1d1;const _0x23d068=_0x23d0();let _0x16fb29=_0x23d068[_0x4b6616];return _0x16fb29;}export function resolveAuthEnvironmentLocally(_0x531e44,_0x3eb869){const _0x20d84f=_0x451f04,_0x4c82f7=_0x531e44[_0x20d84f(0x1d2)];if(_0x3eb869){const _0x18f8cf=_0x4c82f7[_0x3eb869];if(!_0x18f8cf)return null;return{'key':_0x3eb869,..._0x18f8cf};}if(_0x531e44['defaultEnvironmentKey']){const _0x5ca423=_0x4c82f7[_0x531e44['defaultEnvironmentKey']];if(!_0x5ca423)return null;return{'key':_0x531e44[_0x20d84f(0x1e5)],..._0x5ca423};}const _0x3b10e8=Object['keys'](_0x4c82f7);if(_0x3b10e8[_0x20d84f(0x1ee)]===0x1){const _0x215dd6=_0x3b10e8[0x0];return{'key':_0x215dd6,..._0x4c82f7[_0x215dd6]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x7e63b0,_0x17ff60){const _0x27bc37=_0x451f04;try{if(_0x17ff60)return new URL(_0x17ff60,_0x7e63b0)[_0x27bc37(0x1e2)]();return new URL(_0x7e63b0)['toString']();}catch{return null;}}export function looksLikeLoginUrl(_0x4b246d){try{const _0x24df73=new URL(_0x4b246d);return LOGIN_URL_PATTERN['test'](_0x24df73['pathname']);}catch{return LOGIN_URL_PATTERN['test'](_0x4b246d);}}export async function isCachedSessionLive(_0x1893ba,_0x4ff75b,_0x5953fe={},_0x134315={}){const _0x158e4a=_0x451f04,_0x41383e={'zQubR':function(_0x3a8cec,_0x4ea96f){return _0x3a8cec===_0x4ea96f;},'sWxuL':function(_0x4934f0,_0x4aec89){return _0x4934f0(_0x4aec89);}},_0x4e4ea5=buildSessionCheckUrl(_0x4ff75b,_0x5953fe[_0x158e4a(0x1f6)]);if(!_0x4e4ea5)return!![];if(!_0x134315[_0x158e4a(0x1d7)])return!![];let _0x19bf9a=null;try{_0x19bf9a=await _0x134315['launchBrowser']();const _0xd3511=await _0x19bf9a['newContext']({'storageState':_0x1893ba,'ignoreHTTPSErrors':!![],..._0x5953fe[_0x158e4a(0x1e0)]?{'extraHTTPHeaders':_0x5953fe['setupHeaders']}:{}}),_0x96ae46=await _0xd3511['newPage'](),_0x557a3a=await _0x96ae46[_0x158e4a(0x1dc)](_0x4e4ea5,{'waitUntil':_0x158e4a(0x1eb),'timeout':0x3a98}),_0xd0139a=_0x557a3a?.['status']();if(_0x41383e['zQubR'](_0xd0139a,0x191)||_0xd0139a===0x193)return![];const _0x3b539b=_0x96ae46[_0x158e4a(0x1da)]();if(_0x41383e['sWxuL'](looksLikeLoginUrl,_0x3b539b))return![];return!![];}catch{return![];}finally{if(_0x19bf9a)await _0x19bf9a['close']()['catch'](()=>{});}}
1
+ const _0x18a565=_0x1eb7;(function(_0x244fec,_0x3c605b){const _0x3a7f75=_0x1eb7,_0x228d30=_0x244fec();while(!![]){try{const _0x14b56e=parseInt(_0x3a7f75(0xef))/0x1*(parseInt(_0x3a7f75(0xf6))/0x2)+-parseInt(_0x3a7f75(0xe7))/0x3*(parseInt(_0x3a7f75(0xe6))/0x4)+parseInt(_0x3a7f75(0x104))/0x5+parseInt(_0x3a7f75(0x103))/0x6*(parseInt(_0x3a7f75(0xff))/0x7)+-parseInt(_0x3a7f75(0xe3))/0x8+parseInt(_0x3a7f75(0xe8))/0x9+parseInt(_0x3a7f75(0xed))/0xa;if(_0x14b56e===_0x3c605b)break;else _0x228d30['push'](_0x228d30['shift']());}catch(_0x4eb440){_0x228d30['push'](_0x228d30['shift']());}}}(_0x244d,0xbc547));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';function _0x244d(){const _0x593c3a=['428420PmWXLw','.storageState.json','clientIp','length','userAgent','lQESF','test','toString','stdout','RhWBp','slice','replace','auth','setupHeaders','stringify','has','newPage','5615400XhHjOg','hostname','endsWith','232CrWbiu','23223SRnKkL','898803GTXlMz','PoFDv','orgId','localhost','profileName','8532360rQgXqp','.localhost','3219hUupFG','MvliS','baseUrl','add','launchBrowser','sort','defaultEnvironmentKey','338VzUBuj','close','effectiveBaseUrl','newContext','isTTY','port','frppQ','startsWith','map','21SklLVj','localhost.','PDyNt','gZVHO','679008mLbNfI'];_0x244d=function(){return _0x593c3a;};return _0x244d();}export function isInteractive(_0x1139f1=process['env'],_0x3bda76={'stdin':process['stdin'],'stdout':process[_0x18a565(0x10c)]}){const _0x36bc68=_0x18a565,_0x25ccbf={'PDyNt':function(_0x1828c2,_0x1a3a2a){return _0x1828c2(_0x1a3a2a);}};if(_0x1139f1['CI'])return![];return _0x25ccbf['PDyNt'](Boolean,_0x3bda76['stdin'][_0x36bc68(0xfa)])&&_0x25ccbf[_0x36bc68(0x101)](Boolean,_0x3bda76['stdout'][_0x36bc68(0xfa)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x22dffd){const _0x70f885=_0x18a565,_0xb221c3={'KbRLo':function(_0x56f3d1,_0x4f2777){return _0x56f3d1(_0x4f2777);},'frppQ':_0x70f885(0xf1),'ozwoQ':_0x70f885(0x108),'RhWBp':_0x70f885(0x106),'PoFDv':'sha256','MvliS':'hex'},_0x3e30e5=new Set(_0x22dffd['invalidateOn']??DEFAULT_INVALIDATE_ON);_0x22dffd[_0x70f885(0xf8)]&&_0xb221c3['KbRLo'](needsTunnel,_0x22dffd['effectiveBaseUrl'])&&_0x3e30e5[_0x70f885(0xf2)](_0x70f885(0xf1));const _0x2bdc2a={'orgId':_0x22dffd[_0x70f885(0xea)],'profileName':_0x22dffd[_0x70f885(0xec)]};return _0x3e30e5['has'](_0xb221c3[_0x70f885(0xfc)])&&(_0x2bdc2a[_0x70f885(0xf8)]=_0x22dffd['effectiveBaseUrl']),_0x3e30e5[_0x70f885(0x113)](_0x70f885(0x111))&&(_0x2bdc2a['setupHeaders']=_0x22dffd['setupHeaders']?sortObjectKeys(_0x22dffd[_0x70f885(0x111)]):_0x22dffd[_0x70f885(0x111)]),_0x3e30e5['has'](_0x70f885(0xfb))&&(_0x2bdc2a[_0x70f885(0xfb)]=extractPort(_0x22dffd[_0x70f885(0xf8)])),_0x3e30e5[_0x70f885(0x113)](_0xb221c3['ozwoQ'])&&_0x22dffd[_0x70f885(0x108)]!==undefined&&(_0x2bdc2a[_0x70f885(0x108)]=_0x22dffd[_0x70f885(0x108)]),_0x3e30e5[_0x70f885(0x113)](_0xb221c3[_0x70f885(0x10d)])&&_0x22dffd['clientIp']!==undefined&&(_0x2bdc2a['clientIp']=_0x22dffd['clientIp']),createHash(_0xb221c3[_0x70f885(0xe9)])['update'](JSON[_0x70f885(0x112)](_0x2bdc2a))['digest'](_0xb221c3[_0x70f885(0xf0)])[_0x70f885(0x10e)](0x0,0xc);}function extractPort(_0x267823){try{return new URL(_0x267823)['port'];}catch{return'';}}function sortObjectKeys(_0x61ac36){const _0x2b2a5d=_0x18a565,_0x495409={};for(const _0x3f7cd3 of Object['keys'](_0x61ac36)[_0x2b2a5d(0xf4)]()){_0x495409[_0x3f7cd3]=_0x61ac36[_0x3f7cd3];}return _0x495409;}export function getSessionCachePath(_0x58899c,_0x508651){const _0xc760ab=_0x18a565,_0x4d001a={'zHwNq':function(_0x50f3b2,_0x2a599a,_0x42c708,_0x40a9b2){return _0x50f3b2(_0x2a599a,_0x42c708,_0x40a9b2);},'DdNdS':function(_0x3ffd8f){return _0x3ffd8f();},'gNNoW':_0xc760ab(0x110)};return _0x4d001a['zHwNq'](join,_0x4d001a['DdNdS'](getRangerHomeDir),_0x4d001a['gNNoW'],_0x58899c+'-'+_0x508651+'.json');}function _0x1eb7(_0x46220f,_0x15c962){_0x46220f=_0x46220f-0xe2;const _0x244d9e=_0x244d();let _0x1eb722=_0x244d9e[_0x46220f];return _0x1eb722;}export function getStorageStatePath(_0x5ea2cc){const _0x188548=_0x18a565,_0x57d256={'gZVHO':_0x188548(0x105)};return _0x5ea2cc[_0x188548(0x10f)](/\.json$/,_0x57d256[_0x188548(0x102)]);}export function needsTunnel(_0x1e7d57){const _0x43da1c=_0x18a565,_0x5edf15={'lQESF':function(_0x1f374f,_0x3f2edb){return _0x1f374f===_0x3f2edb;},'ebgDH':'127.0.0.1','KsvvY':_0x43da1c(0xee)};let _0x3853a1;try{_0x3853a1=new URL(_0x1e7d57)['hostname'];}catch{return![];}if(_0x5edf15[_0x43da1c(0x109)](_0x3853a1,_0x43da1c(0xeb))||_0x5edf15[_0x43da1c(0x109)](_0x3853a1,_0x5edf15['ebgDH']))return!![];if(_0x3853a1[_0x43da1c(0xe5)](_0x5edf15['KsvvY']))return!![];if(_0x3853a1['includes'](_0x43da1c(0x100)))return!![];return![];}export function hostnameOf(_0x3d82f6){const _0x483340=_0x18a565;return new URL(_0x3d82f6)[_0x483340(0xe4)];}export function duplicateCookiesForDomains(_0x523b0b,_0x75b6a6){const _0x574f3d=_0x18a565,_0x3ae9ff=[..._0x523b0b],_0x4d6659=new Set(_0x523b0b[_0x574f3d(0xfe)](_0x4becda=>_0x4becda['domain']));for(const _0x3216da of _0x75b6a6){let _0x4f3751;try{_0x4f3751=hostnameOf(_0x3216da);}catch{continue;}if(!_0x4f3751)continue;const _0x380958=_0x4f3751[_0x574f3d(0xfd)]('.')?_0x4f3751:'.'+_0x4f3751;if(_0x4d6659['has'](_0x4f3751)||_0x4d6659[_0x574f3d(0x113)](_0x380958))continue;for(const _0x412a0c of _0x523b0b){_0x3ae9ff['push']({..._0x412a0c,'domain':_0x380958});}_0x4d6659['add'](_0x380958);}return _0x3ae9ff;}export function resolveAuthEnvironmentLocally(_0x3c8166,_0x3d33af){const _0x19f008=_0x18a565,_0x2b32a3=_0x3c8166['environments'];if(_0x3d33af){const _0x399a4e=_0x2b32a3[_0x3d33af];if(!_0x399a4e)return null;return{'key':_0x3d33af,..._0x399a4e};}if(_0x3c8166[_0x19f008(0xf5)]){const _0x168e10=_0x2b32a3[_0x3c8166[_0x19f008(0xf5)]];if(!_0x168e10)return null;return{'key':_0x3c8166['defaultEnvironmentKey'],..._0x168e10};}const _0x201dde=Object['keys'](_0x2b32a3);if(_0x201dde[_0x19f008(0x107)]===0x1){const _0x4d9374=_0x201dde[0x0];return{'key':_0x4d9374,..._0x2b32a3[_0x4d9374]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x1865b5,_0x4033d7){const _0x352f42=_0x18a565;try{if(_0x4033d7)return new URL(_0x4033d7,_0x1865b5)[_0x352f42(0x10b)]();return new URL(_0x1865b5)[_0x352f42(0x10b)]();}catch{return null;}}export function looksLikeLoginUrl(_0x185f27){const _0x1da561=_0x18a565;try{const _0x4a45d5=new URL(_0x185f27);return LOGIN_URL_PATTERN['test'](_0x4a45d5['pathname']);}catch{return LOGIN_URL_PATTERN[_0x1da561(0x10a)](_0x185f27);}}export async function isCachedSessionLive(_0x1abe19,_0x677a88,_0x37ca11={},_0x205741={}){const _0x6f7be2=_0x18a565,_0x3961cd={'neFYt':'domcontentloaded','KYAZh':function(_0x53b7de,_0x517b65){return _0x53b7de===_0x517b65;}},_0x3ac27d=buildSessionCheckUrl(_0x677a88,_0x37ca11['sessionCheckPath']);if(!_0x3ac27d)return!![];if(!_0x205741[_0x6f7be2(0xf3)])return!![];let _0x4875f3=null;try{_0x4875f3=await _0x205741[_0x6f7be2(0xf3)]();const _0x27cb15=await _0x4875f3[_0x6f7be2(0xf9)]({'storageState':_0x1abe19,'ignoreHTTPSErrors':!![],..._0x37ca11['setupHeaders']?{'extraHTTPHeaders':_0x37ca11['setupHeaders']}:{}}),_0x438c1b=await _0x27cb15[_0x6f7be2(0xe2)](),_0x5669da=await _0x438c1b['goto'](_0x3ac27d,{'waitUntil':_0x3961cd['neFYt'],'timeout':0x3a98}),_0x4cc5d6=_0x5669da?.['status']();if(_0x3961cd['KYAZh'](_0x4cc5d6,0x191)||_0x4cc5d6===0x193)return![];const _0x1bbf64=_0x438c1b['url']();if(looksLikeLoginUrl(_0x1bbf64))return![];return!![];}catch{return![];}finally{if(_0x4875f3)await _0x4875f3[_0x6f7be2(0xf7)]()['catch'](()=>{});}}
@@ -1 +1 @@
1
- function _0x3168(_0x299228,_0x5307a9){_0x299228=_0x299228-0x9a;const _0x2805dd=_0x2805();let _0x3168a6=_0x2805dd[_0x299228];return _0x3168a6;}(function(_0x23020f,_0x2ca27c){const _0x508855=_0x3168,_0x1d43af=_0x23020f();while(!![]){try{const _0x5d5aac=parseInt(_0x508855(0xa0))/0x1+-parseInt(_0x508855(0xa5))/0x2*(-parseInt(_0x508855(0xa3))/0x3)+parseInt(_0x508855(0xac))/0x4+-parseInt(_0x508855(0x9b))/0x5*(parseInt(_0x508855(0xab))/0x6)+-parseInt(_0x508855(0xa8))/0x7+parseInt(_0x508855(0xa6))/0x8*(-parseInt(_0x508855(0xa7))/0x9)+parseInt(_0x508855(0xa1))/0xa*(parseInt(_0x508855(0xa2))/0xb);if(_0x5d5aac===_0x2ca27c)break;else _0x1d43af['push'](_0x1d43af['shift']());}catch(_0x3ac55d){_0x1d43af['push'](_0x1d43af['shift']());}}}(_0x2805,0xc4b94));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;export function deriveKey(_0x481cc3){const _0x219d14=_0x3168,_0x49e765={'ARzHH':function(_0x32ba87,_0x79e16,_0xe427aa,_0x15cf15,_0x11afb3,_0x5e2a31){return _0x32ba87(_0x79e16,_0xe427aa,_0x15cf15,_0x11afb3,_0x5e2a31);},'aiLaR':_0x219d14(0x9a)};return _0x49e765['ARzHH'](pbkdf2Sync,_0x481cc3,SALT,0x186a0,KEY_LENGTH,_0x49e765['aiLaR']);}export function encrypt(_0x1c2d9d,_0x5297ab){const _0x9373b9=_0x3168,_0x476792={'hwQJe':function(_0x530664,_0x1b6d3f,_0x202b2c,_0x4f9852){return _0x530664(_0x1b6d3f,_0x202b2c,_0x4f9852);}},_0x1f9ffe=deriveKey(_0x5297ab),_0x570c63=randomBytes(IV_LENGTH),_0x57598d=_0x476792[_0x9373b9(0x9e)](createCipheriv,ALGORITHM,_0x1f9ffe,_0x570c63),_0x354895=Buffer['concat']([_0x57598d['update'](_0x1c2d9d,_0x9373b9(0x9c)),_0x57598d['final']()]),_0x4fd214=_0x57598d[_0x9373b9(0x9f)]();return Buffer[_0x9373b9(0x9d)]([_0x570c63,_0x4fd214,_0x354895]);}export function decrypt(_0x36fbb9,_0x3300c8){const _0x1ae9ee=_0x3168,_0x4080f7={'vXHrQ':function(_0x5e8ddb,_0x1dbe6c){return _0x5e8ddb+_0x1dbe6c;},'MMQVH':function(_0x2b9610,_0x5e3b1b,_0x8d729f,_0x380e5d){return _0x2b9610(_0x5e3b1b,_0x8d729f,_0x380e5d);}},_0x2ad33c=deriveKey(_0x3300c8),_0x578a02=_0x36fbb9['subarray'](0x0,IV_LENGTH),_0xb4916d=_0x36fbb9['subarray'](IV_LENGTH,_0x4080f7['vXHrQ'](IV_LENGTH,TAG_LENGTH)),_0x4765c9=_0x36fbb9['subarray'](IV_LENGTH+TAG_LENGTH),_0xf07e68=_0x4080f7[_0x1ae9ee(0xaa)](createDecipheriv,ALGORITHM,_0x2ad33c,_0x578a02);return _0xf07e68['setAuthTag'](_0xb4916d),_0x4080f7[_0x1ae9ee(0xa4)](_0xf07e68[_0x1ae9ee(0xa9)](_0x4765c9),_0xf07e68['final'](_0x1ae9ee(0x9c)));}function _0x2805(){const _0x56c99a=['vXHrQ','36KZcrSx','808KeBJSt','60372zuhnuO','152558fZYDYd','update','MMQVH','6JMEhTK','2387140JKGMdL','sha256','921505IOkbMy','utf8','concat','hwQJe','getAuthTag','319174INkULa','45570djPiCo','330gvDEVC','106119PAeDsK'];_0x2805=function(){return _0x56c99a;};return _0x2805();}
1
+ function _0x5412(){const _0x3854ba=['121214PSlUam','utf8','6vDSbjg','750qfwdda','AdUrR','getAuthTag','50553UmcfJt','mzRvO','933999gvxQwK','3089640EIhKNp','final','19625PmoPya','uCxqF','aes-256-gcm','2lWxBds','1094513tTkGsa','6913687KuxrXo','92MJmgoH'];_0x5412=function(){return _0x3854ba;};return _0x5412();}const _0x5481b1=_0x2200;(function(_0x4f4fd7,_0x29e810){const _0x34c914=_0x2200,_0xf04870=_0x4f4fd7();while(!![]){try{const _0x1953ee=-parseInt(_0x34c914(0x175))/0x1*(-parseInt(_0x34c914(0x179))/0x2)+parseInt(_0x34c914(0x181))/0x3+parseInt(_0x34c914(0x178))/0x4*(-parseInt(_0x34c914(0x172))/0x5)+parseInt(_0x34c914(0x17b))/0x6*(parseInt(_0x34c914(0x176))/0x7)+-parseInt(_0x34c914(0x182))/0x8+parseInt(_0x34c914(0x17f))/0x9*(-parseInt(_0x34c914(0x17c))/0xa)+parseInt(_0x34c914(0x177))/0xb;if(_0x1953ee===_0x29e810)break;else _0xf04870['push'](_0xf04870['shift']());}catch(_0x53629a){_0xf04870['push'](_0xf04870['shift']());}}}(_0x5412,0x4e0b4));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM=_0x5481b1(0x174),SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x5c3427){return pbkdf2Sync(_0x5c3427,SALT,0x186a0,KEY_LENGTH,'sha256');}export function encrypt(_0x38019c,_0x545b3f){const _0x66bfa7=_0x5481b1,_0x13756f={'bJNFY':function(_0x3c39b7,_0x59bc5b,_0x2bed35,_0x10bff0){return _0x3c39b7(_0x59bc5b,_0x2bed35,_0x10bff0);},'uCxqF':_0x66bfa7(0x17a)},_0x4af6f0=deriveKey(_0x545b3f),_0x5905f8=randomBytes(IV_LENGTH),_0x36003a=_0x13756f['bJNFY'](createCipheriv,ALGORITHM,_0x4af6f0,_0x5905f8),_0x16925e=Buffer['concat']([_0x36003a['update'](_0x38019c,_0x13756f[_0x66bfa7(0x173)]),_0x36003a['final']()]),_0x3545c3=_0x36003a[_0x66bfa7(0x17e)]();return Buffer['concat']([_0x5905f8,_0x3545c3,_0x16925e]);}function _0x2200(_0x16d2d3,_0x5c0c90){_0x16d2d3=_0x16d2d3-0x172;const _0x541255=_0x5412();let _0x2200a6=_0x541255[_0x16d2d3];return _0x2200a6;}export function decrypt(_0x1fe0d4,_0x11ad2b){const _0x1055d0=_0x5481b1,_0x210096={'edFeV':function(_0x190b4d,_0xa9607f){return _0x190b4d(_0xa9607f);},'mzRvO':function(_0x50b8fe,_0x5c5b72){return _0x50b8fe+_0x5c5b72;},'zxWNe':function(_0x54014e,_0x4828b1,_0x950cb6,_0x13e7cf){return _0x54014e(_0x4828b1,_0x950cb6,_0x13e7cf);},'AdUrR':'utf8'},_0x2433aa=_0x210096['edFeV'](deriveKey,_0x11ad2b),_0x2d5e64=_0x1fe0d4['subarray'](0x0,IV_LENGTH),_0x2630bc=_0x1fe0d4['subarray'](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x252885=_0x1fe0d4['subarray'](_0x210096[_0x1055d0(0x180)](IV_LENGTH,TAG_LENGTH)),_0x4a5376=_0x210096['zxWNe'](createDecipheriv,ALGORITHM,_0x2433aa,_0x2d5e64);return _0x4a5376['setAuthTag'](_0x2630bc),_0x4a5376['update'](_0x252885)+_0x4a5376[_0x1055d0(0x183)](_0x210096[_0x1055d0(0x17d)]);}
@@ -1 +1 @@
1
- function _0x4829(_0x3bd608,_0x58d8cb){_0x3bd608=_0x3bd608-0x73;const _0x15e76c=_0x15e7();let _0x48297c=_0x15e76c[_0x3bd608];return _0x48297c;}const _0x25d799=_0x4829;(function(_0x676a4a,_0x106e68){const _0x287a17=_0x4829,_0x360659=_0x676a4a();while(!![]){try{const _0x28e8f4=parseInt(_0x287a17(0x81))/0x1*(parseInt(_0x287a17(0x8d))/0x2)+parseInt(_0x287a17(0x97))/0x3*(parseInt(_0x287a17(0x85))/0x4)+parseInt(_0x287a17(0x83))/0x5+-parseInt(_0x287a17(0x92))/0x6+-parseInt(_0x287a17(0x8f))/0x7*(-parseInt(_0x287a17(0x76))/0x8)+parseInt(_0x287a17(0x79))/0x9+-parseInt(_0x287a17(0x99))/0xa;if(_0x28e8f4===_0x106e68)break;else _0x360659['push'](_0x360659['shift']());}catch(_0x90a85d){_0x360659['push'](_0x360659['shift']());}}}(_0x15e7,0xc7202));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t','--secret',_0x25d799(0x73),_0x25d799(0x93),'--key','--password','--pass','--auth',_0x25d799(0x75),_0x25d799(0x74),'--cookie',_0x25d799(0x9a)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x4216c6){const _0x1b995b=_0x25d799;return TOKEN_PATTERNS[_0x1b995b(0x88)](_0x482e53=>_0x482e53[_0x1b995b(0x8a)](_0x4216c6));}export function sanitizeArgs(_0x4a2126){const _0x28a316=_0x25d799,_0x37b1fc={'AuGRD':'[REDACTED]','gAriX':function(_0x475351,_0x2ff691){return _0x475351!==_0x2ff691;},'ppyCz':function(_0x34e5b5,_0x3df203){return _0x34e5b5(_0x3df203);}},_0x548379=[];let _0x6a1fac=![];for(let _0x119219=0x0;_0x119219<_0x4a2126['length'];_0x119219++){const _0x72727a=_0x4a2126[_0x119219];if(_0x6a1fac){_0x548379['push'](_0x37b1fc[_0x28a316(0x7d)]),_0x6a1fac=![];continue;}if(_0x72727a[_0x28a316(0x98)]('--')||_0x72727a[_0x28a316(0x98)]('-')){const _0x110ccc=_0x72727a['indexOf']('=');if(_0x37b1fc['gAriX'](_0x110ccc,-0x1)){const _0x3baeca=_0x72727a[_0x28a316(0x8e)](0x0,_0x110ccc)['toLowerCase']();if(SENSITIVE_FLAGS[_0x28a316(0x7c)](_0x3baeca)){_0x548379['push'](_0x72727a['slice'](0x0,_0x110ccc)+_0x28a316(0x91));continue;}}else{const _0x34ea63=_0x72727a['toLowerCase']();SENSITIVE_FLAGS['has'](_0x34ea63)&&(_0x6a1fac=!![]);}_0x548379[_0x28a316(0x7e)](_0x72727a);}else _0x37b1fc['ppyCz'](looksLikeToken,_0x72727a)?_0x548379[_0x28a316(0x7e)](_0x37b1fc['AuGRD']):_0x548379['push'](_0x72727a);}return _0x548379['join']('\x20');}export async function logDesirePath(_0x362427){const _0x2c7b87=_0x25d799,_0x24fbaa={'KDBTN':function(_0x595b28){return _0x595b28();},'wigeK':function(_0x24e8ec){return _0x24e8ec();},'ABgQt':_0x2c7b87(0x78),'qwRKh':'application/json','pbiCu':'POST'};try{const _0xabb041=await _0x24fbaa['KDBTN'](getToken)['catch'](()=>null),_0x18031d=getApiBaseUrl(),_0x5dba93=_0x24fbaa['wigeK'](getCurrentVersion),_0x162b25=_0xabb041?_0x24fbaa[_0x2c7b87(0x8b)]:'no_token',_0x4e29c6={..._0x362427[_0x2c7b87(0x7b)],'authStatus':_0x162b25,'isTty':process['stdout']['isTTY']??![]},_0x153537={'Content-Type':_0x24fbaa[_0x2c7b87(0x94)]};_0xabb041&&(_0x153537['Authorization']='Bearer\x20'+_0xabb041);const _0x2a7b81={'rawCommand':_0x362427['rawCommand'],'errorMessage':_0x362427['errorMessage'],'errorType':_0x362427['errorType'],'featureId':_0x362427[_0x2c7b87(0x9b)],'sessionId':_0x362427[_0x2c7b87(0x84)],'metadata':_0x4e29c6,'cliVersion':_0x5dba93};process[_0x2c7b87(0x96)]['DEBUG']&&(console[_0x2c7b87(0x95)](_0x2c7b87(0x7f)+_0x18031d+'/api/v1/mcp/desire-path-logs'),console['error']('[desire-path]\x20Payload:\x20'+JSON['stringify'](_0x2a7b81,null,0x2))),await fetch(_0x18031d+'/api/v1/mcp/desire-path-logs',{'method':_0x24fbaa['pbiCu'],'headers':_0x153537,'body':JSON['stringify'](_0x2a7b81)});}catch(_0x27b06f){process['env'][_0x2c7b87(0x8c)]&&console['error'](_0x2c7b87(0x86)+_0x27b06f);}}function _0x15e7(){const _0x46d6e9=['has_token','14434155aHyNIa','includes','metadata','has','AuGRD','push','[desire-path]\x20Sending\x20log\x20to\x20','unknown_argument','2SmgKoJ','ATpiY','1023415uonFDD','sessionId','1297716QmfDlD','[desire-path]\x20Failed\x20to\x20send:\x20','HIiVY','some','invalid_option_value','test','ABgQt','DEBUG','707346diCMqm','slice','9955694kKEuOI','Missing\x20required\x20argument','=[REDACTED]','6293364CozwQm','--apikey','qwRKh','error','env','9IBGXnu','startsWith','30468410dnOQVu','--credentials','featureId','--api-key','--header','--authorization','8WQywqH','syntax_error'];_0x15e7=function(){return _0x46d6e9;};return _0x15e7();}export function getErrorType(_0xc755a0,_0xf7e097){const _0x18e739=_0x25d799,_0x4fe4e7={'HIiVY':'4|2|7|1|6|0|3|5','UBHjZ':'Invalid\x20values','dbDxv':_0x18e739(0x89),'jZlgO':'Unknown\x20argument','yGgpj':'missing_option','ATpiY':'runtime_error','RVgkd':_0x18e739(0x77),'RpPeU':'Not\x20enough\x20non-option\x20arguments'},_0x50cbca=_0x4fe4e7[_0x18e739(0x87)]['split']('|');let _0x232965=0x0;while(!![]){switch(_0x50cbca[_0x232965++]){case'0':if(_0xc755a0['includes'](_0x4fe4e7['UBHjZ']))return _0x4fe4e7['dbDxv'];continue;case'1':if(_0xc755a0[_0x18e739(0x7a)](_0x4fe4e7['jZlgO']))return _0x18e739(0x80);continue;case'2':if(!_0xc755a0)return'unknown';continue;case'3':if(_0xc755a0[_0x18e739(0x7a)](_0x18e739(0x90)))return _0x4fe4e7['yGgpj'];continue;case'4':if(_0xf7e097)return _0x4fe4e7[_0x18e739(0x82)];continue;case'5':return _0x4fe4e7['RVgkd'];case'6':if(_0xc755a0['includes'](_0x4fe4e7['RpPeU']))return'missing_required_argument';continue;case'7':if(_0xc755a0['includes']('Unknown\x20command'))return'unknown_command';continue;}break;}}
1
+ const _0x14626b=_0x1cde;(function(_0x1353cd,_0x3a93c9){const _0x123309=_0x1cde,_0x376594=_0x1353cd();while(!![]){try{const _0x510a14=parseInt(_0x123309(0x108))/0x1+parseInt(_0x123309(0xf9))/0x2*(parseInt(_0x123309(0xf6))/0x3)+-parseInt(_0x123309(0xff))/0x4+-parseInt(_0x123309(0xea))/0x5+-parseInt(_0x123309(0xe5))/0x6*(parseInt(_0x123309(0xf2))/0x7)+parseInt(_0x123309(0xf7))/0x8*(-parseInt(_0x123309(0xda))/0x9)+parseInt(_0x123309(0x107))/0xa*(parseInt(_0x123309(0xfe))/0xb);if(_0x510a14===_0x3a93c9)break;else _0x376594['push'](_0x376594['shift']());}catch(_0x275e9d){_0x376594['push'](_0x376594['shift']());}}}(_0x526c,0x441a9));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x1cde(_0x56f20f,_0x514bde){_0x56f20f=_0x56f20f-0xd5;const _0x526c7f=_0x526c();let _0x1cde3f=_0x526c7f[_0x56f20f];return _0x1cde3f;}import{getCurrentVersion}from'./version.js';function _0x526c(){const _0x443df0=['DEBUG','83802ttmemt','ZOnEP','vVoSU','--secret','missing_option','662890dKnOge','/api/v1/mcp/desire-path-logs','errorMessage','BCaiZ','Missing\x20required\x20argument','test','runtime_error','--header','7ArEHaf','--authorization','application/json','error','18288EoTfBf','3408152eDxFSe','missing_required_argument','140SUWAaf','includes','BuAbh','Authorization','kZtQk','110IEfGfI','1855012nGLJzZ','GIRtV','invalid_option_value','unknown_argument','errorType','sessionId','indexOf','has','860110PabOJc','28440Yrawkn','syntax_error','push','[REDACTED]','no_token','slice','[desire-path]\x20Payload:\x20','9kdMlCk','GhWEF','--credentials','=[REDACTED]','stringify','isTTY','stdout','HthaQ','--apikey','--key'];_0x526c=function(){return _0x443df0;};return _0x526c();}const SENSITIVE_FLAGS=new Set(['--token','-t',_0x14626b(0xe8),'--api-key',_0x14626b(0xe2),_0x14626b(0xe3),'--password','--pass','--auth',_0x14626b(0xf3),_0x14626b(0xf1),'--cookie',_0x14626b(0xdc)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x35dfce){const _0x195336=_0x14626b;return TOKEN_PATTERNS['some'](_0x5e0dc1=>_0x5e0dc1[_0x195336(0xef)](_0x35dfce));}export function sanitizeArgs(_0x1d2106){const _0x333b29=_0x14626b,_0x1320b9={'kZtQk':function(_0x15c19b,_0x4d6d09){return _0x15c19b(_0x4d6d09);},'mOrBo':_0x333b29(0xd6)},_0x467c90=[];let _0x473980=![];for(let _0xfc3a4c=0x0;_0xfc3a4c<_0x1d2106['length'];_0xfc3a4c++){const _0x5ab652=_0x1d2106[_0xfc3a4c];if(_0x473980){_0x467c90['push']('[REDACTED]'),_0x473980=![];continue;}if(_0x5ab652['startsWith']('--')||_0x5ab652['startsWith']('-')){const _0x1ab2aa=_0x5ab652[_0x333b29(0x105)]('=');if(_0x1ab2aa!==-0x1){const _0x42c6d7=_0x5ab652[_0x333b29(0xd8)](0x0,_0x1ab2aa)['toLowerCase']();if(SENSITIVE_FLAGS[_0x333b29(0x106)](_0x42c6d7)){_0x467c90['push'](_0x5ab652[_0x333b29(0xd8)](0x0,_0x1ab2aa)+_0x333b29(0xdd));continue;}}else{const _0x43a31e=_0x5ab652['toLowerCase']();SENSITIVE_FLAGS['has'](_0x43a31e)&&(_0x473980=!![]);}_0x467c90[_0x333b29(0xd5)](_0x5ab652);}else _0x1320b9[_0x333b29(0xfd)](looksLikeToken,_0x5ab652)?_0x467c90['push'](_0x1320b9['mOrBo']):_0x467c90['push'](_0x5ab652);}return _0x467c90['join']('\x20');}export async function logDesirePath(_0x7d3d75){const _0x2f9ddb=_0x14626b,_0x3bb966={'BCaiZ':function(_0x3cbc00){return _0x3cbc00();},'vVoSU':_0x2f9ddb(0xd7),'oiPHk':_0x2f9ddb(0xfc),'xRHZv':function(_0x3ebdef,_0x10896c,_0x502823){return _0x3ebdef(_0x10896c,_0x502823);},'VUcxT':'POST'};try{const _0x2a15c2=await _0x3bb966[_0x2f9ddb(0xed)](getToken)['catch'](()=>null),_0x532b01=getApiBaseUrl(),_0x4aa76c=getCurrentVersion(),_0xcc2d60=_0x2a15c2?'has_token':_0x3bb966[_0x2f9ddb(0xe7)],_0x23c106={..._0x7d3d75['metadata'],'authStatus':_0xcc2d60,'isTty':process[_0x2f9ddb(0xe0)][_0x2f9ddb(0xdf)]??![]},_0x3a8061={'Content-Type':_0x2f9ddb(0xf4)};_0x2a15c2&&(_0x3a8061[_0x3bb966['oiPHk']]='Bearer\x20'+_0x2a15c2);const _0x282f9f={'rawCommand':_0x7d3d75['rawCommand'],'errorMessage':_0x7d3d75[_0x2f9ddb(0xec)],'errorType':_0x7d3d75[_0x2f9ddb(0x103)],'featureId':_0x7d3d75['featureId'],'sessionId':_0x7d3d75[_0x2f9ddb(0x104)],'metadata':_0x23c106,'cliVersion':_0x4aa76c};process['env'][_0x2f9ddb(0xe4)]&&(console['error']('[desire-path]\x20Sending\x20log\x20to\x20'+_0x532b01+_0x2f9ddb(0xeb)),console[_0x2f9ddb(0xf5)](_0x2f9ddb(0xd9)+JSON[_0x2f9ddb(0xde)](_0x282f9f,null,0x2))),await _0x3bb966['xRHZv'](fetch,_0x532b01+'/api/v1/mcp/desire-path-logs',{'method':_0x3bb966['VUcxT'],'headers':_0x3a8061,'body':JSON['stringify'](_0x282f9f)});}catch(_0x20077a){process['env']['DEBUG']&&console[_0x2f9ddb(0xf5)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x20077a);}}export function getErrorType(_0x7aa000,_0x1f17e0){const _0x552a4b=_0x14626b,_0x362047={'GIRtV':_0x552a4b(0xf0),'tmlkX':'unknown','ZOnEP':'Unknown\x20command','ZHkLr':'Unknown\x20argument','EkuhR':'Not\x20enough\x20non-option\x20arguments','BuAbh':_0x552a4b(0x101),'HthaQ':_0x552a4b(0xe9),'GhWEF':_0x552a4b(0x109)};if(_0x1f17e0)return _0x362047[_0x552a4b(0x100)];if(!_0x7aa000)return _0x362047['tmlkX'];if(_0x7aa000[_0x552a4b(0xfa)](_0x362047[_0x552a4b(0xe6)]))return'unknown_command';if(_0x7aa000[_0x552a4b(0xfa)](_0x362047['ZHkLr']))return _0x552a4b(0x102);if(_0x7aa000[_0x552a4b(0xfa)](_0x362047['EkuhR']))return _0x552a4b(0xf8);if(_0x7aa000['includes']('Invalid\x20values'))return _0x362047[_0x552a4b(0xfb)];if(_0x7aa000['includes'](_0x552a4b(0xee)))return _0x362047[_0x552a4b(0xe1)];return _0x362047[_0x552a4b(0xdb)];}
@@ -1 +1 @@
1
- const _0x321e2f=_0x22ae;(function(_0x2075fe,_0x421a71){const _0x4f0b39=_0x22ae,_0x3b02a0=_0x2075fe();while(!![]){try{const _0x1ed207=parseInt(_0x4f0b39(0x1c2))/0x1*(parseInt(_0x4f0b39(0x1b8))/0x2)+-parseInt(_0x4f0b39(0x199))/0x3*(parseInt(_0x4f0b39(0x1b6))/0x4)+-parseInt(_0x4f0b39(0x1e5))/0x5*(parseInt(_0x4f0b39(0x19b))/0x6)+parseInt(_0x4f0b39(0x18e))/0x7+-parseInt(_0x4f0b39(0x19f))/0x8+-parseInt(_0x4f0b39(0x1b2))/0x9*(-parseInt(_0x4f0b39(0x1a0))/0xa)+-parseInt(_0x4f0b39(0x1b3))/0xb*(-parseInt(_0x4f0b39(0x1c9))/0xc);if(_0x1ed207===_0x421a71)break;else _0x3b02a0['push'](_0x3b02a0['shift']());}catch(_0x159203){_0x3b02a0['push'](_0x3b02a0['shift']());}}}(_0x5bab,0x833f8));import{spawn}from'child_process';import _0xcc9e5e from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL=_0x321e2f(0x1bd);function _0x5bab(){const _0x569ec0=['Provisioning\x20CLI\x20token...','prompt','error','startsWith','392769YxSdeX','6257779uDdKTD','length','ABBKu','4LlqDeO','unref','578tunORU','oFRIr','stdout','TXbEK','lsMXZ','https://api.workos.com/user_management/authenticate','status','urn:ietf:params:oauth:grant-type:device_code','write','toString','7XoQSIt','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','split','pXJtg','access_token','Failed\x20to\x20request\x20device\x20code:\x20','platform','36yVVjax','tntiM','isTTY','start','text','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','token','pgsmL','oDlKI','apiKeys','HXOXY','LQPHR','verification_uri_complete','apiKey','oAINE','org_id','open','/cli-auth/token','refresh_token','memberships','GET','filter','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','Failed\x20to\x20create\x20organization:\x20','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','BwenA','/organization/me','json','2805975lTNpFB','list','user_code','utf-8','3067134LzbFBE','name','POST','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','mcp:write','\x27s\x20CLI\x20Key','Failed\x20to\x20provision\x20API\x20key:\x20','application/x-www-form-urlencoded','stringify','/api-keys','WrWBB','2827131FvoSyH','stdin','6GRAILX','Authentication\x20failed','UyVTh','xdg-open','5035040jNmStJ','120qkJoOh','RClPI','MiwbA','cIZiy','Waiting\x20for\x20authentication...','cmd','organizationId','selected','Setting\x20up\x20your\x20organization...','from','win32','log','FbJQC','now'];_0x5bab=function(){return _0x569ec0;};return _0x5bab();}export async function requestDeviceCode(_0x2a2340){const _0x4ce377=_0x321e2f,_0x423a44={'LQPHR':function(_0x4bcf58,_0x100cf4,_0x1885f7){return _0x4bcf58(_0x100cf4,_0x1885f7);},'CwXJv':_0x4ce377(0x190)},_0x328926=await _0x423a44[_0x4ce377(0x1d4)](fetch,WORKOS_DEVICE_AUTH_URL,{'method':_0x423a44['CwXJv'],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x2a2340})});if(!_0x328926['ok']){const _0xe1982b=await _0x328926['text']();throw new Error(_0x4ce377(0x1c7)+_0x328926[_0x4ce377(0x1be)]+'\x20'+_0xe1982b);}return _0x328926[_0x4ce377(0x1e4)]();}export async function pollForTokens(_0x2f7157,_0xbab48b,_0x422577,_0x130daa){const _0x4e886b=_0x321e2f,_0x46fcb4={'WrWBB':function(_0x47619d,_0x11a838){return _0x47619d+_0x11a838;},'tntiM':function(_0x25f618,_0x15f654){return _0x25f618*_0x15f654;},'Rgkxg':function(_0x2fb9ff,_0x5923a8){return _0x2fb9ff(_0x5923a8);},'oAINE':function(_0x278972,_0x387f88){return _0x278972===_0x387f88;},'pXJtg':'slow_down','RClPI':'Device\x20authorization\x20timed\x20out'},_0x386b9d=_0x46fcb4[_0x4e886b(0x198)](Date[_0x4e886b(0x1ad)](),_0x130daa*0x3e8);let _0x5bcaa5=_0x46fcb4[_0x4e886b(0x1ca)](_0x422577,0x3e8);while(Date[_0x4e886b(0x1ad)]()<_0x386b9d){await _0x46fcb4['Rgkxg'](sleep,_0x5bcaa5);const _0x19093a=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x2f7157,'device_code':_0xbab48b,'grant_type':_0x4e886b(0x1bf)})});if(_0x19093a['ok'])return _0x19093a[_0x4e886b(0x1e4)]();const _0x36e07a=await _0x19093a['json']();if(_0x46fcb4[_0x4e886b(0x1d7)](_0x36e07a[_0x4e886b(0x1b0)],'authorization_pending'))continue;if(_0x46fcb4[_0x4e886b(0x1d7)](_0x36e07a[_0x4e886b(0x1b0)],_0x46fcb4[_0x4e886b(0x1c5)])){_0x5bcaa5+=0x3e8;continue;}throw new Error(_0x36e07a['error_description']||_0x36e07a['error']||_0x4e886b(0x19c));}throw new Error(_0x46fcb4[_0x4e886b(0x1a1)]);}async function fetchUserProfile(_0x437be5){const _0x4fdeea=_0x321e2f,_0x241770=getApiBaseUrl();try{const _0x168427=await fetch(_0x241770+_0x4fdeea(0x1e3),{'method':_0x4fdeea(0x1dd),'headers':{'workos-token':_0x437be5}});if(_0x168427['ok'])return _0x168427[_0x4fdeea(0x1e4)]();}catch{}return null;}function buildKeyName(_0x3bb9b1,_0x4e9fa3){const _0x575d8e=_0x321e2f,_0x4cc3d2={'jonzU':function(_0x474ce4,_0x24ff18){return _0x474ce4===_0x24ff18;},'cIZiy':function(_0x33c63f,_0x24f50e){return _0x33c63f+_0x24f50e;}},_0x4567b3=_0x4e9fa3[_0x575d8e(0x1de)](_0x42e82b=>_0x42e82b['name']===_0x3bb9b1||_0x42e82b[_0x575d8e(0x18f)][_0x575d8e(0x1b1)](_0x3bb9b1+'\x20('));if(_0x4cc3d2['jonzU'](_0x4567b3['length'],0x0))return _0x3bb9b1;return _0x3bb9b1+'\x20('+_0x4cc3d2[_0x575d8e(0x1a3)](_0x4567b3[_0x575d8e(0x1b4)],0x1)+')';}export async function provisionApiKey(_0xb49265){const _0x34fe9b=_0x321e2f,_0x25c8c4={'dhYcl':function(_0x3705ac){return _0x3705ac();},'FbJQC':'application/json','MiwbA':function(_0x4f4614,_0x4d13f5){return _0x4f4614(_0x4d13f5);},'TXbEK':_0x34fe9b(0x190),'HXOXY':_0x34fe9b(0x192)},_0x3d2ac9=_0x25c8c4['dhYcl'](getApiBaseUrl),_0x39938c={'Content-Type':_0x25c8c4[_0x34fe9b(0x1ac)],'workos-token':_0xb49265},_0xb266e3=await _0x25c8c4[_0x34fe9b(0x1a2)](fetchUserProfile,_0xb49265),_0x24fc06=_0xb266e3?.['firstName']||_0xb266e3?.['email']?.['split']('@')[0x0],_0x2cbd79=_0x24fc06?_0x24fc06+_0x34fe9b(0x193):'CLI\x20Key';let _0x1e3613=[];try{const _0x3d2965=await fetch(_0x3d2ac9+_0x34fe9b(0x197),{'method':_0x34fe9b(0x1dd),'headers':_0x39938c});if(_0x3d2965['ok']){const _0x3a0445=await _0x3d2965['json']();_0x1e3613=_0x3a0445[_0x34fe9b(0x1d2)];}}catch{}const _0x1d76fb=buildKeyName(_0x2cbd79,_0x1e3613),_0x26ca7e=await fetch(_0x3d2ac9+'/api-keys',{'method':_0x25c8c4[_0x34fe9b(0x1bb)],'headers':_0x39938c,'body':JSON[_0x34fe9b(0x196)]({'name':_0x1d76fb,'scope':_0x25c8c4[_0x34fe9b(0x1d3)]})});if(!_0x26ca7e['ok']){const _0x5588de=await _0x26ca7e[_0x34fe9b(0x1cd)]();throw new Error(_0x34fe9b(0x194)+_0x26ca7e[_0x34fe9b(0x1be)]+'\x20'+_0x5588de);}const _0x2c3191=await _0x26ca7e['json']();return _0x2c3191[_0x34fe9b(0x1d6)][_0x34fe9b(0x1cf)];}export function openBrowser(_0x1d526e){const _0x11b4fd=_0x321e2f,_0x2b2c15={'oFRIr':_0x11b4fd(0x1aa),'Znycr':function(_0x689213,_0x17d86f,_0x262ba3,_0x2f1f4a){return _0x689213(_0x17d86f,_0x262ba3,_0x2f1f4a);},'nghOJ':_0x11b4fd(0x1a5),'OkweF':'ignore'};try{if(process[_0x11b4fd(0x1c8)]===_0x2b2c15[_0x11b4fd(0x1b9)]){const _0xa2e88d=_0x2b2c15['Znycr'](spawn,_0x2b2c15['nghOJ'],['/c',_0x11b4fd(0x1cc),'',_0x1d526e],{'detached':!![],'stdio':_0x2b2c15['OkweF'],'windowsHide':!![]});_0xa2e88d[_0x11b4fd(0x1b7)]();return;}const _0xdb48e4=process['platform']==='darwin'?_0x11b4fd(0x1d9):_0x11b4fd(0x19e),_0x3b20ef=spawn(_0xdb48e4,[_0x1d526e],{'detached':!![],'stdio':_0x2b2c15['OkweF']});_0x3b20ef[_0x11b4fd(0x1b7)]();}catch{}}function decodeJwtPayload(_0x24588e){const _0x351e2e=_0x321e2f,_0x1ebbaf={'vLPyV':'Invalid\x20JWT\x20format','wpIvg':'base64url'},_0x4cc883=_0x24588e[_0x351e2e(0x1c4)]('.');if(_0x4cc883['length']!==0x3)throw new Error(_0x1ebbaf['vLPyV']);const _0x586117=Buffer[_0x351e2e(0x1a9)](_0x4cc883[0x1],_0x1ebbaf['wpIvg'])[_0x351e2e(0x1c1)](_0x351e2e(0x18d));return JSON['parse'](_0x586117);}async function selfServeSignup(_0x541d2a){const _0x1b76af=_0x321e2f,_0x21b1ea={'nrLxb':function(_0x40686e){return _0x40686e();},'pgsmL':function(_0x457064,_0x507529,_0x4eddce){return _0x457064(_0x507529,_0x4eddce);}},_0x207501=_0x21b1ea['nrLxb'](getApiBaseUrl),_0x33d20b=await _0x21b1ea[_0x1b76af(0x1d0)](fetch,_0x207501+'/organization/self-serve-signup',{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x541d2a}});if(!_0x33d20b['ok']){const _0xcd3c3b=await _0x33d20b[_0x1b76af(0x1cd)]();throw new Error(_0x1b76af(0x1e0)+_0x33d20b[_0x1b76af(0x1be)]+'\x20'+_0xcd3c3b);}return _0x33d20b['json']();}async function fetchMyMemberships(_0x5deeeb){const _0x3c21e9=_0x321e2f,_0x4b4326={'vrvfa':function(_0x345ae6,_0x32405b,_0x537a93){return _0x345ae6(_0x32405b,_0x537a93);}},_0x460a3f=getApiBaseUrl(),_0x1b0d2d=await _0x4b4326['vrvfa'](fetch,_0x460a3f+'/organization/my-memberships',{'method':'GET','headers':{'workos-token':_0x5deeeb}});if(!_0x1b0d2d['ok']){const _0x21241f=await _0x1b0d2d[_0x3c21e9(0x1cd)]();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x1b0d2d['status']+'\x20'+_0x21241f);}const _0x6da1ee=await _0x1b0d2d[_0x3c21e9(0x1e4)]();return _0x6da1ee[_0x3c21e9(0x1dc)];}function _0x22ae(_0x192d3e,_0x41ded8){_0x192d3e=_0x192d3e-0x18c;const _0x5babf5=_0x5bab();let _0x22ae80=_0x5babf5[_0x192d3e];return _0x22ae80;}async function refreshTokenWithOrg(_0x215378,_0x44bed8,_0x4b065c){const _0x4408b9=_0x321e2f,_0x22afdd=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x4408b9(0x195)},'body':new URLSearchParams({'client_id':_0x215378,'grant_type':_0x4408b9(0x1db),'refresh_token':_0x44bed8,'organization_id':_0x4b065c})});if(!_0x22afdd['ok']){const _0x510f2b=await _0x22afdd['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x22afdd[_0x4408b9(0x1be)]+'\x20'+_0x510f2b);}return _0x22afdd['json']();}async function provisionCliToken(_0x346db6){const _0x5aa2a3=_0x321e2f,_0x3f6e17={'UyVTh':function(_0x49b457){return _0x49b457();},'XoVOx':function(_0x473481,_0x6e48fa,_0xffa19a){return _0x473481(_0x6e48fa,_0xffa19a);}},_0x526e77=_0x3f6e17[_0x5aa2a3(0x19d)](getApiBaseUrl),_0x7c1846=await _0x3f6e17['XoVOx'](fetch,_0x526e77+_0x5aa2a3(0x1da),{'method':_0x5aa2a3(0x190),'headers':{'Content-Type':'application/json','workos-token':_0x346db6}});if(!_0x7c1846['ok']){const _0x276f52=await _0x7c1846['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x7c1846[_0x5aa2a3(0x1be)]+'\x20'+_0x276f52);}return _0x7c1846['json']();}export async function runDeviceAuthFlow(){const _0x411366=_0x321e2f,_0x5ae87b={'UeOyw':function(_0x35d465,_0x24f1bd){return _0x35d465(_0x24f1bd);},'Bwkmv':_0x411366(0x1c3),'lsMXZ':_0x411366(0x1e1),'BwenA':_0x411366(0x1a7),'ABBKu':'Select\x20an\x20organization:','qTUDH':_0x411366(0x1ae),'oDlKI':function(_0x47a508,_0x360f1d){return _0x47a508(_0x360f1d);}},_0x4bbd1e=getCurrentEnvironment(),_0x5c75c6=ENVIRONMENT_CONFIGS[_0x4bbd1e]['workosClientId'],_0x1f9320=await _0x5ae87b['UeOyw'](requestDeviceCode,_0x5c75c6);console[_0x411366(0x1ab)](_0x411366(0x191)),console['log'](_0x5ae87b['Bwkmv']),openBrowser(_0x1f9320[_0x411366(0x1d5)]),console['log'](_0x411366(0x1ce)+_0x1f9320['verification_uri_complete']),console['log']('Code:\x20'+_0x1f9320[_0x411366(0x18c)]+'\x0a'),process[_0x411366(0x1ba)]['write'](_0x411366(0x1a4));let _0x4db8ea=await pollForTokens(_0x5c75c6,_0x1f9320['device_code'],_0x1f9320['interval'],_0x1f9320['expires_in']);console['log']('\x20✓');const _0x487711=_0x5ae87b['UeOyw'](decodeJwtPayload,_0x4db8ea['access_token']);if(!_0x487711[_0x411366(0x1d8)]){const _0x12bcf5=await fetchMyMemberships(_0x4db8ea[_0x411366(0x1c6)]);let _0x465508;if(_0x12bcf5[_0x411366(0x1b4)]===0x0){process[_0x411366(0x1ba)][_0x411366(0x1c0)](_0x411366(0x1a8));const _0x136ca6=await selfServeSignup(_0x4db8ea[_0x411366(0x1c6)]);_0x465508=_0x136ca6[_0x411366(0x1a6)],console['log']('\x20✓');}else{if(_0x12bcf5[_0x411366(0x1b4)]===0x1)_0x465508=_0x12bcf5[0x0][_0x411366(0x1a6)],console[_0x411366(0x1ab)]('Using\x20organization:\x20'+_0x12bcf5[0x0][_0x411366(0x18f)]);else{const _0x2a3c57=process[_0x411366(0x19a)][_0x411366(0x1cb)]&&process[_0x411366(0x1ba)][_0x411366(0x1cb)];if(!_0x2a3c57)throw new Error(_0x411366(0x1df)+_0x5ae87b[_0x411366(0x1bc)]);const {selected:_0x36a413}=await _0xcc9e5e[_0x411366(0x1af)]([{'type':_0x411366(0x1e6),'name':_0x5ae87b[_0x411366(0x1e2)],'message':_0x5ae87b[_0x411366(0x1b5)],'choices':_0x12bcf5['map'](_0x280be2=>({'name':_0x280be2['name'],'value':_0x280be2['organizationId']}))}]);_0x465508=_0x36a413;}}_0x4db8ea=await refreshTokenWithOrg(_0x5c75c6,_0x4db8ea['refresh_token'],_0x465508);}process['stdout']['write'](_0x5ae87b['qTUDH']);const _0x516cb5=await _0x5ae87b[_0x411366(0x1d1)](provisionCliToken,_0x4db8ea[_0x411366(0x1c6)]);return console['log']('\x20✓'),await storeToken(_0x516cb5[_0x411366(0x1cf)]),_0x4db8ea[_0x411366(0x1db)]&&await storeRefreshToken(_0x4db8ea[_0x411366(0x1db)]),_0x516cb5['token'];}function sleep(_0x597c00){return new Promise(_0x27151d=>setTimeout(_0x27151d,_0x597c00));}
1
+ const _0x55b5d9=_0x5940;(function(_0x75c7,_0xc352ad){const _0x4c34d7=_0x5940,_0x46e4eb=_0x75c7();while(!![]){try{const _0x15fa4b=parseInt(_0x4c34d7(0x1e2))/0x1*(-parseInt(_0x4c34d7(0x22d))/0x2)+-parseInt(_0x4c34d7(0x1e7))/0x3*(-parseInt(_0x4c34d7(0x1fb))/0x4)+parseInt(_0x4c34d7(0x226))/0x5*(parseInt(_0x4c34d7(0x21e))/0x6)+-parseInt(_0x4c34d7(0x1de))/0x7*(-parseInt(_0x4c34d7(0x213))/0x8)+parseInt(_0x4c34d7(0x209))/0x9*(parseInt(_0x4c34d7(0x1fc))/0xa)+-parseInt(_0x4c34d7(0x1dc))/0xb*(-parseInt(_0x4c34d7(0x215))/0xc)+parseInt(_0x4c34d7(0x1fd))/0xd;if(_0x15fa4b===_0xc352ad)break;else _0x46e4eb['push'](_0x46e4eb['shift']());}catch(_0x160f50){_0x46e4eb['push'](_0x46e4eb['shift']());}}}(_0x2b37,0x6e0cf));import{spawn}from'child_process';import _0x51bba1 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL=_0x55b5d9(0x1f9);export async function requestDeviceCode(_0x281de2){const _0x2cfd4c=_0x55b5d9,_0xffd26d={'oAKtj':function(_0x35003c,_0x47092c,_0x5eaf00){return _0x35003c(_0x47092c,_0x5eaf00);},'YXgTk':'application/x-www-form-urlencoded'},_0x2bcad1=await _0xffd26d[_0x2cfd4c(0x20f)](fetch,WORKOS_DEVICE_AUTH_URL,{'method':_0x2cfd4c(0x21a),'headers':{'Content-Type':_0xffd26d[_0x2cfd4c(0x227)]},'body':new URLSearchParams({'client_id':_0x281de2})});if(!_0x2bcad1['ok']){const _0x59dc6a=await _0x2bcad1[_0x2cfd4c(0x1f4)]();throw new Error(_0x2cfd4c(0x224)+_0x2bcad1[_0x2cfd4c(0x1db)]+'\x20'+_0x59dc6a);}return _0x2bcad1['json']();}export async function pollForTokens(_0x18393d,_0x2b1ee6,_0xac7c6e,_0x18f9b2){const _0x4cc5bc=_0x55b5d9,_0x390a88={'AABiD':function(_0x409ead,_0xb400ce){return _0x409ead+_0xb400ce;},'efCTw':function(_0xebba82,_0x1f52e5){return _0xebba82*_0x1f52e5;},'DJpPx':function(_0x33df8b,_0x1ea0f0){return _0x33df8b(_0x1ea0f0);},'qxxfZ':function(_0x4ed853,_0xe82058,_0x30ef92){return _0x4ed853(_0xe82058,_0x30ef92);},'HAAOp':_0x4cc5bc(0x21a),'IoMVL':_0x4cc5bc(0x21f),'pAFuv':function(_0x383ea6,_0x5822ab){return _0x383ea6===_0x5822ab;}},_0x993c60=_0x390a88[_0x4cc5bc(0x22c)](Date[_0x4cc5bc(0x21d)](),_0x390a88['efCTw'](_0x18f9b2,0x3e8));let _0x5c160a=_0xac7c6e*0x3e8;while(Date[_0x4cc5bc(0x21d)]()<_0x993c60){await _0x390a88['DJpPx'](sleep,_0x5c160a);const _0x9e0925=await _0x390a88['qxxfZ'](fetch,WORKOS_TOKEN_URL,{'method':_0x390a88[_0x4cc5bc(0x207)],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x18393d,'device_code':_0x2b1ee6,'grant_type':_0x390a88[_0x4cc5bc(0x218)]})});if(_0x9e0925['ok'])return _0x9e0925['json']();const _0xc3b621=await _0x9e0925[_0x4cc5bc(0x1f3)]();if(_0x390a88[_0x4cc5bc(0x22b)](_0xc3b621[_0x4cc5bc(0x21c)],'authorization_pending'))continue;if(_0x390a88[_0x4cc5bc(0x22b)](_0xc3b621['error'],'slow_down')){_0x5c160a+=0x3e8;continue;}throw new Error(_0xc3b621['error_description']||_0xc3b621['error']||'Authentication\x20failed');}throw new Error('Device\x20authorization\x20timed\x20out');}async function fetchUserProfile(_0x1e46b4){const _0x5cb6d4=_0x55b5d9,_0x2fc4f9={'OjKfs':function(_0xaa68ca,_0x48bf44,_0x4b6448){return _0xaa68ca(_0x48bf44,_0x4b6448);}},_0x1ace2c=getApiBaseUrl();try{const _0x5e1294=await _0x2fc4f9[_0x5cb6d4(0x205)](fetch,_0x1ace2c+'/organization/me',{'method':_0x5cb6d4(0x1e9),'headers':{'workos-token':_0x1e46b4}});if(_0x5e1294['ok'])return _0x5e1294[_0x5cb6d4(0x1f3)]();}catch{}return null;}function buildKeyName(_0x5c0948,_0xdd02b2){const _0x224e3a=_0x55b5d9,_0x369f17=_0xdd02b2['filter'](_0x3de05d=>_0x3de05d[_0x224e3a(0x1e5)]===_0x5c0948||_0x3de05d[_0x224e3a(0x1e5)]['startsWith'](_0x5c0948+'\x20('));if(_0x369f17['length']===0x0)return _0x5c0948;return _0x5c0948+'\x20('+(_0x369f17['length']+0x1)+')';}export async function provisionApiKey(_0x44f68d){const _0x4c89e7=_0x55b5d9,_0x32d024={'jjbGB':function(_0x317992){return _0x317992();},'vgYLU':function(_0x28f320,_0x40c511,_0x2ec340){return _0x28f320(_0x40c511,_0x2ec340);},'ICQZu':_0x4c89e7(0x1e6)},_0xf5d11e=_0x32d024[_0x4c89e7(0x1df)](getApiBaseUrl),_0x375c02={'Content-Type':'application/json','workos-token':_0x44f68d},_0x19ff51=await fetchUserProfile(_0x44f68d),_0x4c665a=_0x19ff51?.[_0x4c89e7(0x1dd)]||_0x19ff51?.[_0x4c89e7(0x220)]?.['split']('@')[0x0],_0xd81c42=_0x4c665a?_0x4c665a+_0x4c89e7(0x1f8):_0x4c89e7(0x1e3);let _0x39c7b7=[];try{const _0x20d296=await fetch(_0xf5d11e+'/api-keys',{'method':'GET','headers':_0x375c02});if(_0x20d296['ok']){const _0x3a3f33=await _0x20d296[_0x4c89e7(0x1f3)]();_0x39c7b7=_0x3a3f33[_0x4c89e7(0x202)];}}catch{}const _0x463799=buildKeyName(_0xd81c42,_0x39c7b7),_0x1975eb=await _0x32d024[_0x4c89e7(0x20b)](fetch,_0xf5d11e+'/api-keys',{'method':'POST','headers':_0x375c02,'body':JSON[_0x4c89e7(0x1e0)]({'name':_0x463799,'scope':_0x32d024[_0x4c89e7(0x221)]})});if(!_0x1975eb['ok']){const _0x1e369c=await _0x1975eb['text']();throw new Error(_0x4c89e7(0x21b)+_0x1975eb[_0x4c89e7(0x1db)]+'\x20'+_0x1e369c);}const _0xf2f248=await _0x1975eb[_0x4c89e7(0x1f3)]();return _0xf2f248['apiKey'][_0x4c89e7(0x1da)];}export function openBrowser(_0x1423c2){const _0x496bcb=_0x55b5d9,_0x5db9ee={'PnBRi':function(_0x4ce59d,_0x1a5b9e,_0x42bb85,_0x350d27){return _0x4ce59d(_0x1a5b9e,_0x42bb85,_0x350d27);},'MeTNh':function(_0x1c0d45,_0x1aa916){return _0x1c0d45===_0x1aa916;},'HPcse':function(_0x12128e,_0x41b58b,_0x296778,_0x10aaf0){return _0x12128e(_0x41b58b,_0x296778,_0x10aaf0);}};try{if(process['platform']===_0x496bcb(0x225)){const _0x3dc939=_0x5db9ee['PnBRi'](spawn,_0x496bcb(0x20d),['/c','start','',_0x1423c2],{'detached':!![],'stdio':_0x496bcb(0x22e),'windowsHide':!![]});_0x3dc939['unref']();return;}const _0x394a50=_0x5db9ee['MeTNh'](process['platform'],_0x496bcb(0x20c))?_0x496bcb(0x201):_0x496bcb(0x1fe),_0x7c7215=_0x5db9ee[_0x496bcb(0x1ea)](spawn,_0x394a50,[_0x1423c2],{'detached':!![],'stdio':_0x496bcb(0x22e)});_0x7c7215['unref']();}catch{}}function decodeJwtPayload(_0x4853c9){const _0x4b9559=_0x55b5d9,_0x310dc6={'tBBxt':function(_0x4ead4c,_0x2e41d8){return _0x4ead4c!==_0x2e41d8;},'ZynXt':'Invalid\x20JWT\x20format'},_0x14d955=_0x4853c9[_0x4b9559(0x22f)]('.');if(_0x310dc6[_0x4b9559(0x229)](_0x14d955[_0x4b9559(0x22a)],0x3))throw new Error(_0x310dc6[_0x4b9559(0x20a)]);const _0x4aeeeb=Buffer['from'](_0x14d955[0x1],'base64url')['toString']('utf-8');return JSON['parse'](_0x4aeeeb);}function _0x5940(_0x407296,_0x5d0f2d){_0x407296=_0x407296-0x1da;const _0x2b3743=_0x2b37();let _0x594063=_0x2b3743[_0x407296];return _0x594063;}function _0x2b37(){const _0x26913b=['xdg-open','uSKiW','LPdYc','open','apiKeys','access_token','stdout','OjKfs','HzHRq','HAAOp','Using\x20organization:\x20','11871ORzbtn','ZynXt','vgYLU','darwin','cmd','interval','oAKtj','org_id','isTTY','caIKR','16YheBQx','Code:\x20','8304uJdeAe','write','FTsAl','IoMVL','QFADM','POST','Failed\x20to\x20provision\x20API\x20key:\x20','error','now','6jSBcjQ','urn:ietf:params:oauth:grant-type:device_code','email','ICQZu','refresh_token','expires_in','Failed\x20to\x20request\x20device\x20code:\x20','win32','1443440SAGmCd','YXgTk','Failed\x20to\x20create\x20organization:\x20','tBBxt','length','pAFuv','AABiD','18072FaTEFj','ignore','split','token','status','44syIJjy','firstName','991865owKWhu','jjbGB','stringify','tXLeG','98KWAkYb','CLI\x20Key','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','name','mcp:write','1432659AfoBma','stdin','GET','HPcse','device_code','/organization/self-serve-signup','iEoIi','workosClientId','map','organizationId','log','zPHxB','json','text','mHHHX','application/json','user_code','\x27s\x20CLI\x20Key','https://api.workos.com/user_management/authenticate','HIgWf','4cjPnha','2060OzQgMn','158366uSkwXa'];_0x2b37=function(){return _0x26913b;};return _0x2b37();}async function selfServeSignup(_0x27bb6a){const _0x54d112=_0x55b5d9,_0x8ca65f={'FuXpS':function(_0x17bf1a){return _0x17bf1a();}},_0x3efc14=_0x8ca65f['FuXpS'](getApiBaseUrl),_0x514749=await fetch(_0x3efc14+_0x54d112(0x1ec),{'method':'POST','headers':{'Content-Type':_0x54d112(0x1f6),'workos-token':_0x27bb6a}});if(!_0x514749['ok']){const _0x385630=await _0x514749[_0x54d112(0x1f4)]();throw new Error(_0x54d112(0x228)+_0x514749[_0x54d112(0x1db)]+'\x20'+_0x385630);}return _0x514749['json']();}async function fetchMyMemberships(_0x28cc27){const _0x440ef3=_0x55b5d9,_0xd48213={'jKULs':function(_0x1932b7,_0x12f940,_0x500850){return _0x1932b7(_0x12f940,_0x500850);}},_0x27bdd3=getApiBaseUrl(),_0x204312=await _0xd48213['jKULs'](fetch,_0x27bdd3+'/organization/my-memberships',{'method':_0x440ef3(0x1e9),'headers':{'workos-token':_0x28cc27}});if(!_0x204312['ok']){const _0x3af709=await _0x204312[_0x440ef3(0x1f4)]();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x204312[_0x440ef3(0x1db)]+'\x20'+_0x3af709);}const _0x4a948c=await _0x204312[_0x440ef3(0x1f3)]();return _0x4a948c['memberships'];}async function refreshTokenWithOrg(_0x17721b,_0x3cac33,_0x122b86){const _0x2a53ae=_0x55b5d9,_0x1d7a7b={'HIgWf':'refresh_token'},_0x1bda51=await fetch(WORKOS_TOKEN_URL,{'method':_0x2a53ae(0x21a),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x17721b,'grant_type':_0x1d7a7b[_0x2a53ae(0x1fa)],'refresh_token':_0x3cac33,'organization_id':_0x122b86})});if(!_0x1bda51['ok']){const _0x3ee625=await _0x1bda51[_0x2a53ae(0x1f4)]();throw new Error(_0x2a53ae(0x1e4)+_0x1bda51['status']+'\x20'+_0x3ee625);}return _0x1bda51['json']();}async function provisionCliToken(_0x3ecd64){const _0x5b7da0=_0x55b5d9,_0x90a3f3={'tXLeG':function(_0x2632a0,_0x487600,_0x4f47d3){return _0x2632a0(_0x487600,_0x4f47d3);},'FTsAl':'POST'},_0x26d408=getApiBaseUrl(),_0x2c567d=await _0x90a3f3[_0x5b7da0(0x1e1)](fetch,_0x26d408+'/cli-auth/token',{'method':_0x90a3f3[_0x5b7da0(0x217)],'headers':{'Content-Type':'application/json','workos-token':_0x3ecd64}});if(!_0x2c567d['ok']){const _0x33329b=await _0x2c567d['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x2c567d['status']+'\x20'+_0x33329b);}return _0x2c567d[_0x5b7da0(0x1f3)]();}export async function runDeviceAuthFlow(){const _0x53732a=_0x55b5d9,_0x5f5c94={'HzHRq':function(_0x10dd63,_0x1db03a){return _0x10dd63(_0x1db03a);},'LPdYc':function(_0x247cc6,_0x26fe90,_0x219741,_0x35cf26,_0x474adf){return _0x247cc6(_0x26fe90,_0x219741,_0x35cf26,_0x474adf);},'uSKiW':'Setting\x20up\x20your\x20organization...','CleMp':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','Vorvo':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','zPHxB':'list','caIKR':'selected','iEoIi':'Select\x20an\x20organization:','mHHHX':function(_0x4bc838,_0x4ba93a,_0x4133b3,_0x4f759b){return _0x4bc838(_0x4ba93a,_0x4133b3,_0x4f759b);},'QFADM':'Provisioning\x20CLI\x20token...','vhsZY':function(_0x431eaf,_0x4e7bc5){return _0x431eaf(_0x4e7bc5);}},_0x48ede8=getCurrentEnvironment(),_0x571100=ENVIRONMENT_CONFIGS[_0x48ede8][_0x53732a(0x1ee)],_0x6c2c5b=await _0x5f5c94[_0x53732a(0x206)](requestDeviceCode,_0x571100);console['log']('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x53732a(0x1f1)]('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),openBrowser(_0x6c2c5b['verification_uri_complete']),console[_0x53732a(0x1f1)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x6c2c5b['verification_uri_complete']),console[_0x53732a(0x1f1)](_0x53732a(0x214)+_0x6c2c5b[_0x53732a(0x1f7)]+'\x0a'),process[_0x53732a(0x204)]['write']('Waiting\x20for\x20authentication...');let _0x4a28c7=await _0x5f5c94[_0x53732a(0x200)](pollForTokens,_0x571100,_0x6c2c5b[_0x53732a(0x1eb)],_0x6c2c5b[_0x53732a(0x20e)],_0x6c2c5b[_0x53732a(0x223)]);console[_0x53732a(0x1f1)]('\x20✓');const _0x547b8c=_0x5f5c94['HzHRq'](decodeJwtPayload,_0x4a28c7[_0x53732a(0x203)]);if(!_0x547b8c[_0x53732a(0x210)]){const _0x29511c=await _0x5f5c94['HzHRq'](fetchMyMemberships,_0x4a28c7[_0x53732a(0x203)]);let _0x457a0a;if(_0x29511c[_0x53732a(0x22a)]===0x0){process[_0x53732a(0x204)]['write'](_0x5f5c94[_0x53732a(0x1ff)]);const _0x25c481=await selfServeSignup(_0x4a28c7['access_token']);_0x457a0a=_0x25c481[_0x53732a(0x1f0)],console['log']('\x20✓');}else{if(_0x29511c[_0x53732a(0x22a)]===0x1)_0x457a0a=_0x29511c[0x0]['organizationId'],console['log'](_0x53732a(0x208)+_0x29511c[0x0][_0x53732a(0x1e5)]);else{const _0x4e07fa=process[_0x53732a(0x1e8)][_0x53732a(0x211)]&&process[_0x53732a(0x204)]['isTTY'];if(!_0x4e07fa)throw new Error(_0x5f5c94['CleMp']+_0x5f5c94['Vorvo']);const {selected:_0x5968a4}=await _0x51bba1['prompt']([{'type':_0x5f5c94[_0x53732a(0x1f2)],'name':_0x5f5c94[_0x53732a(0x212)],'message':_0x5f5c94[_0x53732a(0x1ed)],'choices':_0x29511c[_0x53732a(0x1ef)](_0x5ae9aa=>({'name':_0x5ae9aa['name'],'value':_0x5ae9aa[_0x53732a(0x1f0)]}))}]);_0x457a0a=_0x5968a4;}}_0x4a28c7=await _0x5f5c94[_0x53732a(0x1f5)](refreshTokenWithOrg,_0x571100,_0x4a28c7['refresh_token'],_0x457a0a);}process['stdout'][_0x53732a(0x216)](_0x5f5c94[_0x53732a(0x219)]);const _0x42b198=await _0x5f5c94['HzHRq'](provisionCliToken,_0x4a28c7[_0x53732a(0x203)]);return console[_0x53732a(0x1f1)]('\x20✓'),await _0x5f5c94[_0x53732a(0x206)](storeToken,_0x42b198['token']),_0x4a28c7['refresh_token']&&await _0x5f5c94['vhsZY'](storeRefreshToken,_0x4a28c7[_0x53732a(0x222)]),_0x42b198['token'];}function sleep(_0x967d71){return new Promise(_0x506e72=>setTimeout(_0x506e72,_0x967d71));}
@@ -1 +1 @@
1
- const _0x206b5e=_0x27d6;(function(_0x423000,_0x5338bc){const _0x5ae56a=_0x27d6,_0x13d5d5=_0x423000();while(!![]){try{const _0x1cc9f8=parseInt(_0x5ae56a(0x1b7))/0x1+parseInt(_0x5ae56a(0x1bb))/0x2*(parseInt(_0x5ae56a(0x1b0))/0x3)+-parseInt(_0x5ae56a(0x1d3))/0x4+parseInt(_0x5ae56a(0x1c3))/0x5+-parseInt(_0x5ae56a(0x1ba))/0x6+parseInt(_0x5ae56a(0x1c4))/0x7+-parseInt(_0x5ae56a(0x1cf))/0x8;if(_0x1cc9f8===_0x5338bc)break;else _0x13d5d5['push'](_0x13d5d5['shift']());}catch(_0x12f5ab){_0x13d5d5['push'](_0x13d5d5['shift']());}}}(_0x5110,0xdb234));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x206b5e(0x1c2),'workosClientId':_0x206b5e(0x1b3),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':_0x206b5e(0x1dc)},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':_0x206b5e(0x1c7),'aiProxyUrl':'https://ai-proxy-301751771437.us-central1.run.app','mcpAuthUrl':_0x206b5e(0x1b2)},'local':{'apiBaseUrl':_0x206b5e(0x1ca),'workosClientId':_0x206b5e(0x1c7),'aiProxyUrl':'http://localhost:8090','mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT=_0x206b5e(0x1c0);export function isValidEnvironment(_0x311eeb){const _0x5c2614=_0x206b5e,_0x259e29={'GZbUA':_0x5c2614(0x1c0),'wuSbw':'staging','dQBIT':'local'};return _0x311eeb===_0x259e29['GZbUA']||_0x311eeb===_0x259e29[_0x5c2614(0x1d6)]||_0x311eeb===_0x259e29[_0x5c2614(0x1d5)];}export function getCurrentEnvironment(){const _0x3ea59f=_0x206b5e,_0x2d2b25={'oELKR':function(_0x395dec,_0x44bfe4){return _0x395dec(_0x44bfe4);}},_0x48904b=process[_0x3ea59f(0x1b8)][_0x3ea59f(0x1d4)];if(_0x48904b&&_0x2d2b25[_0x3ea59f(0x1c9)](isValidEnvironment,_0x48904b))return _0x48904b;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x4d357a=_0x206b5e,_0x333dbc={'sCXOV':function(_0x55e57f){return _0x55e57f();}};return ENVIRONMENT_CONFIGS[_0x333dbc[_0x4d357a(0x1bc)](getCurrentEnvironment)][_0x4d357a(0x1c6)];}export function getAiProxyUrl(){const _0x2891ca={'nhCRT':function(_0x5d1229){return _0x5d1229();}};return ENVIRONMENT_CONFIGS[_0x2891ca['nhCRT'](getCurrentEnvironment)]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x259ac5=_0x206b5e;return process[_0x259ac5(0x1b8)]['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x259ac5(0x1d0)];}function _0x27d6(_0x54bff6,_0x15a2dc){_0x54bff6=_0x54bff6-0x1b0;const _0x51103c=_0x5110();let _0x27d67c=_0x51103c[_0x54bff6];return _0x27d67c;}export function isByokEnabled(){const _0x1edbf4=_0x206b5e,_0x1c1b8d={'jqehT':function(_0x829ead,_0x462d01){return _0x829ead===_0x462d01;}};return _0x1c1b8d['jqehT'](process[_0x1edbf4(0x1b8)]['RANGER_BYOK'],_0x1edbf4(0x1c1));}function _0x5110(){const _0xa987d0=['http://localhost:8080','toLowerCase','Yjugb','ocpvW','\x22.\x20','3962424knQEYO','mcpAuthUrl','mcp','nova-act-cli','5047316AIpwhE','RANGER_CLI_ENV','dQBIT','wuSbw','POFTy','QiIze','okfcN','aGnrk','RANGER_USE_NOVA_ACT','https://mcp-auth.ranger.net/mcp','21CcBMIZ','[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22','https://mcp-auth.staging.ranger.net/mcp','client_01J9CBYM7M5ZETCF7G6614DXR2','auto','YvwkD','find','1290327rlvskm','env','\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.','8666220PtJxjt','4124iVTRNL','sCXOV','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','trim','RANGER_HOOKS','prod','true','https://api.ranger.net','6370290uMgcRV','10641897vhJMPn','off','apiBaseUrl','client_01J9CBYM2DKWV9HM17D95Z540K','rangerwright-cli','oELKR'];_0x5110=function(){return _0xa987d0;};return _0x5110();}function isVerificationTransport(_0x2b4327){const _0x38b5fd=_0x206b5e,_0x2e78a0={'okfcN':function(_0x305dda,_0x4d842c){return _0x305dda===_0x4d842c;},'Yjugb':'mcp','QiIze':function(_0x32be42,_0x399928){return _0x32be42===_0x399928;},'oHRsy':'playwright-cli','aGnrk':_0x38b5fd(0x1d2),'ocpvW':_0x38b5fd(0x1c8)};return _0x2e78a0[_0x38b5fd(0x1d9)](_0x2b4327,_0x2e78a0[_0x38b5fd(0x1cc)])||_0x2e78a0[_0x38b5fd(0x1d8)](_0x2b4327,_0x2e78a0['oHRsy'])||_0x2b4327===_0x2e78a0[_0x38b5fd(0x1da)]||_0x2b4327===_0x2e78a0[_0x38b5fd(0x1cd)];}const LEGACY_TRANSPORT_ENV_VARS=[_0x206b5e(0x1db),'RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x41b054=_0x206b5e,_0x1215e2={'uMPSK':function(_0x343984,_0x10f80a){return _0x343984(_0x10f80a);},'YvwkD':_0x41b054(0x1d1)},_0x519bdb=process[_0x41b054(0x1b8)]['RANGER_TRANSPORT']?.['trim']();if(_0x519bdb){if(_0x1215e2['uMPSK'](isVerificationTransport,_0x519bdb))return _0x519bdb;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x519bdb+_0x41b054(0x1bd));}const _0x4b229d=LEGACY_TRANSPORT_ENV_VARS[_0x41b054(0x1b6)](_0x51298c=>process['env'][_0x51298c]);if(_0x4b229d)throw new Error(_0x4b229d+_0x41b054(0x1b9));return _0x1215e2[_0x41b054(0x1b5)];}export function resolveHookMode(_0x477e6c=process['env']){const _0x339a71=_0x206b5e,_0x1c4a3c={'POFTy':_0x339a71(0x1b4),'LXHMI':_0x339a71(0x1c5),'HgSRf':function(_0x28ac20,_0x8dc7c2){return _0x28ac20===_0x8dc7c2;},'BXHcJ':function(_0x57c421,_0x16227f){return _0x57c421===_0x16227f;}},_0x38df3e=_0x477e6c[_0x339a71(0x1bf)]?.[_0x339a71(0x1be)]()[_0x339a71(0x1cb)]();if(!_0x38df3e)return _0x1c4a3c[_0x339a71(0x1d7)];if(_0x38df3e===_0x1c4a3c['LXHMI']||_0x1c4a3c['HgSRf'](_0x38df3e,'on')||_0x1c4a3c['BXHcJ'](_0x38df3e,_0x1c4a3c['POFTy']))return _0x38df3e;return console['error'](_0x339a71(0x1b1)+_0x477e6c[_0x339a71(0x1bf)]+_0x339a71(0x1ce)+'Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.'),_0x1c4a3c['POFTy'];}
1
+ const _0x1986da=_0x66f5;(function(_0x4cbbe6,_0x5f5204){const _0x1ed6f3=_0x66f5,_0x22771a=_0x4cbbe6();while(!![]){try{const _0x399fc4=-parseInt(_0x1ed6f3(0x150))/0x1+parseInt(_0x1ed6f3(0x156))/0x2*(-parseInt(_0x1ed6f3(0x13a))/0x3)+parseInt(_0x1ed6f3(0x14e))/0x4*(-parseInt(_0x1ed6f3(0x14c))/0x5)+parseInt(_0x1ed6f3(0x13f))/0x6+-parseInt(_0x1ed6f3(0x13b))/0x7*(parseInt(_0x1ed6f3(0x155))/0x8)+-parseInt(_0x1ed6f3(0x157))/0x9+parseInt(_0x1ed6f3(0x13e))/0xa;if(_0x399fc4===_0x5f5204)break;else _0x22771a['push'](_0x22771a['shift']());}catch(_0x10b4fc){_0x22771a['push'](_0x22771a['shift']());}}}(_0x1cc6,0xa7e90));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':'client_01J9CBYM7M5ZETCF7G6614DXR2','aiProxyUrl':_0x1986da(0x134),'mcpAuthUrl':_0x1986da(0x137)},'staging':{'apiBaseUrl':_0x1986da(0x136),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x1986da(0x147),'mcpAuthUrl':_0x1986da(0x14b)},'local':{'apiBaseUrl':_0x1986da(0x151),'workosClientId':_0x1986da(0x158),'aiProxyUrl':_0x1986da(0x13d),'mcpAuthUrl':_0x1986da(0x141)}};export const DEFAULT_ENVIRONMENT='prod';function _0x66f5(_0x55e09e,_0x31107b){_0x55e09e=_0x55e09e-0x133;const _0x1cc641=_0x1cc6();let _0x66f5cb=_0x1cc641[_0x55e09e];return _0x66f5cb;}export function isValidEnvironment(_0x5919dc){const _0x3267a1={'hZiAF':function(_0x409196,_0xf53fc){return _0x409196===_0xf53fc;},'rofJY':'staging'};return _0x3267a1['hZiAF'](_0x5919dc,'prod')||_0x3267a1['hZiAF'](_0x5919dc,_0x3267a1['rofJY'])||_0x5919dc==='local';}export function getCurrentEnvironment(){const _0x43cd2f=_0x1986da,_0x48cad4=process[_0x43cd2f(0x146)]['RANGER_CLI_ENV'];if(_0x48cad4&&isValidEnvironment(_0x48cad4))return _0x48cad4;return DEFAULT_ENVIRONMENT;}function _0x1cc6(){const _0x49d708=['45107070psAuQy','6009828vHqEUN','error','http://localhost:8080/mcp','RANGER_HOOKS','RANGER_BYOK','DooUn','rangerwright-cli','env','https://ai-proxy-301751771437.us-central1.run.app','AGkGC','wmLwB','Invalid\x20RANGER_TRANSPORT=\x22','https://mcp-auth.staging.ranger.net/mcp','5LqmFka','auto','4196116AbguyB','trim','673882bSOEFn','http://localhost:8080','\x22.\x20','nQgJR','find','6200gpUJtD','2tshCop','5134869nWAgGL','client_01J9CBYM2DKWV9HM17D95Z540K','sIzWd','RANGER_MCP_AUTH_URL','https://ai-proxy-716115358910.us-central1.run.app','nova-act-cli','https://api.staging.ranger.net','https://mcp-auth.ranger.net/mcp','LOCjv','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','3566499oZxatR','12124uQUBqX','RANGER_TRANSPORT','http://localhost:8090'];_0x1cc6=function(){return _0x49d708;};return _0x1cc6();}export function getApiBaseUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['apiBaseUrl'];}export function getAiProxyUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x3ed4a8=_0x1986da,_0x4fabdb={'sIzWd':function(_0x1b2f20){return _0x1b2f20();}};return process['env'][_0x3ed4a8(0x133)]??ENVIRONMENT_CONFIGS[_0x4fabdb[_0x3ed4a8(0x159)](getCurrentEnvironment)]['mcpAuthUrl'];}export function isByokEnabled(){const _0x5cfd81=_0x1986da;return process[_0x5cfd81(0x146)][_0x5cfd81(0x143)]==='true';}function isVerificationTransport(_0x4ab20a){const _0x1ff7d9=_0x1986da,_0x187c48={'DooUn':'mcp','AGkGC':'playwright-cli','TfFli':_0x1ff7d9(0x145)};return _0x4ab20a===_0x187c48[_0x1ff7d9(0x144)]||_0x4ab20a===_0x187c48[_0x1ff7d9(0x148)]||_0x4ab20a===_0x1ff7d9(0x135)||_0x4ab20a===_0x187c48['TfFli'];}const LEGACY_TRANSPORT_ENV_VARS=['RANGER_USE_NOVA_ACT','RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x4c941b=_0x1986da,_0xfc4f35={'wmLwB':function(_0xfe0469,_0x8128af){return _0xfe0469(_0x8128af);}},_0x3fc0ab=process[_0x4c941b(0x146)][_0x4c941b(0x13c)]?.['trim']();if(_0x3fc0ab){if(_0xfc4f35[_0x4c941b(0x149)](isVerificationTransport,_0x3fc0ab))return _0x3fc0ab;throw new Error(_0x4c941b(0x14a)+_0x3fc0ab+_0x4c941b(0x139));}const _0x14614a=LEGACY_TRANSPORT_ENV_VARS[_0x4c941b(0x154)](_0x4c083e=>process[_0x4c941b(0x146)][_0x4c083e]);if(_0x14614a)throw new Error(_0x14614a+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return'mcp';}export function resolveHookMode(_0x489874=process['env']){const _0x3575ec=_0x1986da,_0x186b38={'nQgJR':'off','LOCjv':_0x3575ec(0x14d)},_0x3f3731=_0x489874[_0x3575ec(0x142)]?.[_0x3575ec(0x14f)]()['toLowerCase']();if(!_0x3f3731)return _0x3575ec(0x14d);if(_0x3f3731===_0x186b38[_0x3575ec(0x153)]||_0x3f3731==='on'||_0x3f3731===_0x3575ec(0x14d))return _0x3f3731;return console[_0x3575ec(0x140)]('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x489874[_0x3575ec(0x142)]+_0x3575ec(0x152)+'Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.'),_0x186b38[_0x3575ec(0x138)];}
@@ -1 +1 @@
1
- (function(_0x2d3dae,_0x5a738d){const _0x458833=_0x3a20,_0x51ca15=_0x2d3dae();while(!![]){try{const _0x124147=-parseInt(_0x458833(0x1c2))/0x1*(-parseInt(_0x458833(0x18b))/0x2)+-parseInt(_0x458833(0x19c))/0x3*(parseInt(_0x458833(0x1c7))/0x4)+-parseInt(_0x458833(0x19d))/0x5*(-parseInt(_0x458833(0x196))/0x6)+parseInt(_0x458833(0x198))/0x7+-parseInt(_0x458833(0x1b7))/0x8*(-parseInt(_0x458833(0x1a4))/0x9)+-parseInt(_0x458833(0x191))/0xa*(parseInt(_0x458833(0x1cb))/0xb)+-parseInt(_0x458833(0x1b0))/0xc;if(_0x124147===_0x5a738d)break;else _0x51ca15['push'](_0x51ca15['shift']());}catch(_0x15c6c9){_0x51ca15['push'](_0x51ca15['shift']());}}}(_0x59d6,0xbceb5));import{getToken}from'./keychain.js';function _0x3a20(_0x238282,_0x26f79c){_0x238282=_0x238282-0x18b;const _0x59d6f7=_0x59d6();let _0x3a202a=_0x59d6f7[_0x238282];return _0x3a202a;}import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x1ae61c){const _0x2ac420=_0x3a20,_0x3e5742={'BtpLA':function(_0x216e26){return _0x216e26();},'CpxgR':_0x2ac420(0x193)},_0x59c35b=await _0x3e5742[_0x2ac420(0x1b3)](getToken);if(!_0x59c35b)throw new Error(_0x2ac420(0x1b5));const _0x2c8584=getApiBaseUrl(),_0x36f4e2=await fetch(_0x2c8584+'/api/v1/mcp/features',{'method':'POST','headers':{'Authorization':_0x2ac420(0x1b9)+_0x59c35b,'Content-Type':'application/json'},'body':JSON['stringify'](_0x1ae61c)});if(!_0x36f4e2['ok']){if(_0x36f4e2[_0x2ac420(0x1b8)]===0x192){const _0x6f733f=await _0x36f4e2['json'](),_0x154817=_0x6f733f[_0x2ac420(0x1c3)]||_0x2ac420(0x19e);throw new Error((_0x6f733f['message']||_0x3e5742['CpxgR'])+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x154817);}const _0x99b30f=await _0x36f4e2[_0x2ac420(0x1d0)]();throw new Error('Failed\x20to\x20create\x20feature\x20review:\x20'+_0x99b30f);}return _0x36f4e2[_0x2ac420(0x1b6)]();}function _0x59d6(){const _0x19a031=['9255008xEgGal','kbONn','cwWOw','limit','962085qvCpIg','866605wUPOFm','https://dashboard.ranger.net/billing','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','fNIcM','application/json','/sessions/','JBNMs','334926VtvoyK','rRbaF','MerAe','stringify','UXcCf','PATCH','pwDkl','/start','qfbBg','Failed\x20to\x20get\x20action\x20items:\x20','GET','/api/v1/mcp/features','14673204MPcTyT','/api/v1/mcp/features/','/comments/address','BtpLA','true','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','json','168hAtZpI','status','Bearer\x20','Failed\x20to\x20list\x20feature\x20reviews:\x20','join','offset','QYBlV','UWhFh','gitRepoUrl','MFKrh','flWKo','549436ubuVQq','billingUrl','dfAjA','itemIds','LsgHV','8UFhqCa','Failed\x20to\x20restore\x20feature\x20review:\x20','hblix','includeDeleted','8116471kSBHQZ','EaBUz','Failed\x20to\x20update\x20scenario:\x20','set','siTlt','text','/feedback','Xcyvc','DELETE','rVhHF','POST','sMheE','wSigw','gitBranch','4qZkOMZ','ZqLYi','WYaUm','bHqIy','/conclude','QNuHa','10VEQWLe','Failed\x20to\x20conclude\x20session:\x20','Feature\x20limit\x20exceeded','sessionId','toString','6JVXsdU','hWYCP'];_0x59d6=function(){return _0x19a031;};return _0x59d6();}export async function listFeatures(_0xd6cf92){const _0x334408=_0x3a20,_0x4fb23c={'UXcCf':function(_0x58b6d6){return _0x58b6d6();},'kbONn':_0x334408(0x1bf),'LsgHV':_0x334408(0x1d8),'cwWOw':_0x334408(0x19b),'bHqIy':_0x334408(0x1ca)},_0x2c116a=await _0x4fb23c[_0x334408(0x1a8)](getToken);if(!_0x2c116a)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xac1c1e=getApiBaseUrl(),_0x31eea6=new URLSearchParams();if(_0xd6cf92?.[_0x334408(0x1bf)])_0x31eea6['set'](_0x4fb23c[_0x334408(0x199)],_0xd6cf92['gitRepoUrl']);if(_0xd6cf92?.[_0x334408(0x1d8)])_0x31eea6['set'](_0x4fb23c[_0x334408(0x1c6)],_0xd6cf92['gitBranch']);if(_0xd6cf92?.[_0x334408(0x19b)])_0x31eea6['set'](_0x4fb23c[_0x334408(0x19a)],_0xd6cf92['limit']['toString']());if(_0xd6cf92?.[_0x334408(0x1bc)])_0x31eea6['set']('offset',_0xd6cf92[_0x334408(0x1bc)]['toString']());if(_0xd6cf92?.['includeDeleted'])_0x31eea6['set'](_0x4fb23c[_0x334408(0x18e)],_0x334408(0x1b4));const _0x1b0a19=_0xac1c1e+_0x334408(0x1af)+(_0x31eea6['toString']()?'?'+_0x31eea6[_0x334408(0x195)]():''),_0x1d6ef1=await fetch(_0x1b0a19,{'method':_0x334408(0x1ae),'headers':{'Authorization':'Bearer\x20'+_0x2c116a}});if(!_0x1d6ef1['ok']){const _0x4c62c3=await _0x1d6ef1[_0x334408(0x1d0)]();throw new Error(_0x334408(0x1ba)+_0x4c62c3);}return _0x1d6ef1['json']();}export async function getFeature(_0x2248d9){const _0x63ea14=_0x3a20,_0x55ed22={'hWYCP':function(_0x2fc899){return _0x2fc899();},'sMheE':function(_0x1668bb,_0x5a807d,_0x7a79a4){return _0x1668bb(_0x5a807d,_0x7a79a4);},'hblix':_0x63ea14(0x1ae)},_0x1ce40e=await _0x55ed22[_0x63ea14(0x197)](getToken);if(!_0x1ce40e)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x26711b=getApiBaseUrl(),_0x1cbbe1=await _0x55ed22[_0x63ea14(0x1d6)](fetch,_0x26711b+_0x63ea14(0x1b1)+_0x2248d9,{'method':_0x55ed22[_0x63ea14(0x1c9)],'headers':{'Authorization':'Bearer\x20'+_0x1ce40e}});if(!_0x1cbbe1['ok']){const _0x1d0888=await _0x1cbbe1[_0x63ea14(0x1d0)]();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x1d0888);}return _0x1cbbe1['json']();}export async function updateFeature(_0xdad7c5,_0x46baef){const _0x5ed8de=_0x3a20,_0x516e5b={'wSigw':function(_0x1088b){return _0x1088b();},'ZqLYi':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','fNIcM':_0x5ed8de(0x1a9),'EaBUz':_0x5ed8de(0x1a1)},_0x5c7c67=await _0x516e5b['wSigw'](getToken);if(!_0x5c7c67)throw new Error(_0x516e5b[_0x5ed8de(0x18c)]);const _0x241e45=_0x516e5b[_0x5ed8de(0x1d7)](getApiBaseUrl),_0x51e1d6=await fetch(_0x241e45+'/api/v1/mcp/features/'+_0xdad7c5,{'method':_0x516e5b[_0x5ed8de(0x1a0)],'headers':{'Authorization':_0x5ed8de(0x1b9)+_0x5c7c67,'Content-Type':_0x516e5b[_0x5ed8de(0x1cc)]},'body':JSON['stringify'](_0x46baef)});if(!_0x51e1d6['ok']){const _0x5de5fa=await _0x51e1d6[_0x5ed8de(0x1d0)]();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x5de5fa);}return _0x51e1d6['json']();}export async function createChecklistItem(_0xedb547,_0x22573a,_0xdd8d0){const _0x11bb87=_0x3a20,_0x37b433={'CUPxS':function(_0x463862){return _0x463862();},'VxgKI':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','rRbaF':'POST'},_0x474999=await _0x37b433['CUPxS'](getToken);if(!_0x474999)throw new Error(_0x37b433['VxgKI']);const _0x58595f=getApiBaseUrl(),_0x37fe99=await fetch(_0x58595f+_0x11bb87(0x1b1)+_0xedb547+'/checklist',{'method':_0x37b433[_0x11bb87(0x1a5)],'headers':{'Authorization':_0x11bb87(0x1b9)+_0x474999,'Content-Type':_0x11bb87(0x1a1)},'body':JSON['stringify']({'description':_0x22573a,'position':_0xdd8d0})});if(!_0x37fe99['ok']){const _0x4a28e7=await _0x37fe99[_0x11bb87(0x1d0)]();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x4a28e7);}return _0x37fe99['json']();}export async function updateChecklistItem(_0x2288f2,_0x530182,_0x4003fe){const _0x5b9203=_0x3a20,_0x101e34={'siTlt':function(_0x701e2e){return _0x701e2e();},'fxaNg':function(_0x50cd47){return _0x50cd47();},'qfbBg':function(_0x5e5977,_0x4243bb,_0x7a6ea6){return _0x5e5977(_0x4243bb,_0x7a6ea6);},'QYBlV':'application/json','UWhFh':'updateChecklistItem'};return _0x101e34[_0x5b9203(0x1ac)](withRetry,async()=>{const _0x3306fa=_0x5b9203,_0x5bcbec=await _0x101e34[_0x3306fa(0x1cf)](getToken);if(!_0x5bcbec)throw new Error(_0x3306fa(0x1b5));const _0x4f4503=_0x101e34['fxaNg'](getApiBaseUrl),_0x16c56c=await _0x101e34['qfbBg'](fetch,_0x4f4503+'/api/v1/mcp/features/'+_0x2288f2+'/checklist/'+_0x530182,{'method':_0x3306fa(0x1a9),'headers':{'Authorization':'Bearer\x20'+_0x5bcbec,'Content-Type':_0x101e34[_0x3306fa(0x1bd)]},'body':JSON['stringify'](_0x4003fe)});if(!_0x16c56c['ok']){const _0x17f0ec=await _0x16c56c[_0x3306fa(0x1d0)]();throw new Error(_0x3306fa(0x1cd)+_0x17f0ec);}return _0x16c56c['json']();},{'label':_0x101e34[_0x5b9203(0x1be)]});}export async function getFeatureReport(_0x1a4758){const _0x138fc3=_0x3a20,_0x3b9475={'hJAwQ':function(_0x27a94b,_0x30bd68,_0x2638ca){return _0x27a94b(_0x30bd68,_0x2638ca);}},_0x7d3a6d=await getToken();if(!_0x7d3a6d)throw new Error(_0x138fc3(0x1b5));const _0x529bff=getApiBaseUrl(),_0x4a0ddc=await _0x3b9475['hJAwQ'](fetch,_0x529bff+_0x138fc3(0x1b1)+_0x1a4758+'/report',{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x7d3a6d}});if(!_0x4a0ddc['ok']){const _0x577c6a=await _0x4a0ddc['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x577c6a);}return _0x4a0ddc['json']();}export async function getFeatureReportMarkdown(_0x8b855,_0x2c6036){const _0x2135d7=_0x3a20,_0x139ece={'dfAjA':function(_0x1bebd3){return _0x1bebd3();},'cRfCs':function(_0x665ad2,_0x453687){return _0x665ad2(_0x453687);},'MerAe':'itemIds','obECq':'style'},_0x28dbab=await getToken();if(!_0x28dbab)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x19fc16=_0x139ece[_0x2135d7(0x1c4)](getApiBaseUrl),_0x187847=new URLSearchParams(),_0x5e9b37=(_0x2c6036?.[_0x2135d7(0x1c5)]?.['length']??0x0)>0x0,_0x156d88=_0x139ece['cRfCs'](Boolean,_0x2c6036?.['sessionId']);_0x5e9b37&&_0x2c6036?.['itemIds']&&_0x187847['set'](_0x139ece[_0x2135d7(0x1a6)],_0x2c6036[_0x2135d7(0x1c5)][_0x2135d7(0x1bb)](','));_0x156d88&&_0x2c6036?.['sessionId']&&_0x187847[_0x2135d7(0x1ce)](_0x2135d7(0x194),_0x2c6036[_0x2135d7(0x194)]);!_0x5e9b37&&!_0x156d88&&_0x2c6036?.['style']&&_0x187847['set'](_0x139ece['obECq'],_0x2c6036['style']);const _0x34acb2=_0x19fc16+'/api/v1/mcp/features/'+_0x8b855+'/report/markdown',_0x2ab458=''+_0x34acb2+(_0x187847['toString']()?'?'+_0x187847['toString']():''),_0x193f5b=await fetch(_0x2ab458,{'method':_0x2135d7(0x1ae),'headers':{'Authorization':'Bearer\x20'+_0x28dbab}});if(!_0x193f5b['ok']){const _0x2bcaed=await _0x193f5b['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x2bcaed);}return _0x193f5b[_0x2135d7(0x1d0)]();}export async function listFeatureSessions(_0x412569){const _0xb8fcd0=_0x3a20,_0x4b21c7={'pAfYC':function(_0x461e75){return _0x461e75();},'QNuHa':_0xb8fcd0(0x1b5),'OKcLL':function(_0x2b6166,_0x3a1c0b,_0xfb08c){return _0x2b6166(_0x3a1c0b,_0xfb08c);},'YlDnn':_0xb8fcd0(0x1ae)},_0x56da70=await _0x4b21c7['pAfYC'](getToken);if(!_0x56da70)throw new Error(_0x4b21c7[_0xb8fcd0(0x190)]);const _0x69f14b=getApiBaseUrl(),_0xd79c2b=await _0x4b21c7['OKcLL'](fetch,_0x69f14b+'/api/v1/mcp/features/'+_0x412569+'/sessions',{'method':_0x4b21c7['YlDnn'],'headers':{'Authorization':'Bearer\x20'+_0x56da70}});if(!_0xd79c2b['ok']){const _0x54c5de=await _0xd79c2b[_0xb8fcd0(0x1d0)]();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x54c5de);}return _0xd79c2b[_0xb8fcd0(0x1b6)]();}export async function startSession(_0x1cd9fd,_0x547460){const _0x875b02=_0x3a20,_0x38ff03={'VAaHY':function(_0x34b3f5){return _0x34b3f5();},'JBNMs':function(_0x34e2b4,_0x59b552,_0x976dfd){return _0x34e2b4(_0x59b552,_0x976dfd);},'DrLdk':_0x875b02(0x1d5)},_0xa0327e=await _0x38ff03['VAaHY'](getToken);if(!_0xa0327e)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5f0e13=getApiBaseUrl(),_0x4590a8=await _0x38ff03[_0x875b02(0x1a3)](fetch,_0x5f0e13+'/api/v1/mcp/features/'+_0x1cd9fd+_0x875b02(0x1a2)+_0x547460+_0x875b02(0x1ab),{'method':_0x38ff03['DrLdk'],'headers':{'Authorization':'Bearer\x20'+_0xa0327e}});if(!_0x4590a8['ok']){const _0x2fef0e=await _0x4590a8[_0x875b02(0x1d0)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x2fef0e);}return _0x4590a8['json']();}export async function concludeSession(_0x29c636,_0x14bd4c){const _0x365a65=_0x3a20,_0x354505={'AiwdG':function(_0xab639b){return _0xab639b();},'pwDkl':function(_0x36f695,_0x376f98,_0x32503b){return _0x36f695(_0x376f98,_0x32503b);}},_0x1d0389=await _0x354505['AiwdG'](getToken);if(!_0x1d0389)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3c0aee=getApiBaseUrl(),_0x1ce774=await _0x354505[_0x365a65(0x1aa)](fetch,_0x3c0aee+'/api/v1/mcp/features/'+_0x29c636+_0x365a65(0x1a2)+_0x14bd4c+_0x365a65(0x18f),{'method':_0x365a65(0x1d5),'headers':{'Authorization':'Bearer\x20'+_0x1d0389}});if(!_0x1ce774['ok']){const _0x2473f0=await _0x1ce774[_0x365a65(0x1d0)]();throw new Error(_0x365a65(0x192)+_0x2473f0);}return _0x1ce774[_0x365a65(0x1b6)]();}export async function getActionItems(_0x41ef80){const _0x30e5d2=_0x3a20,_0x1163e4={'vRZEN':function(_0xad80d6){return _0xad80d6();},'Xcyvc':_0x30e5d2(0x1b5),'ArTBB':'GET'},_0x3ff340=await _0x1163e4['vRZEN'](getToken);if(!_0x3ff340)throw new Error(_0x1163e4[_0x30e5d2(0x1d2)]);const _0x593dc6=getApiBaseUrl(),_0x232640=await fetch(_0x593dc6+'/api/v1/mcp/features/'+_0x41ef80+'/action-items',{'method':_0x1163e4['ArTBB'],'headers':{'Authorization':_0x30e5d2(0x1b9)+_0x3ff340}});if(!_0x232640['ok']){const _0x89944c=await _0x232640[_0x30e5d2(0x1d0)]();throw new Error(_0x30e5d2(0x1ad)+_0x89944c);}return _0x232640[_0x30e5d2(0x1b6)]();}export async function getItemFeedback(_0x3b6bbc,_0x26fcbb){const _0x3aef1e=_0x3a20,_0x223b3d={'MFKrh':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x570272=await getToken();if(!_0x570272)throw new Error(_0x223b3d[_0x3aef1e(0x1c0)]);const _0x9f15b6=getApiBaseUrl(),_0x1f3078=await fetch(_0x9f15b6+'/api/v1/mcp/features/'+_0x3b6bbc+'/checklist-items/'+_0x26fcbb+_0x3aef1e(0x1d1),{'method':_0x3aef1e(0x1ae),'headers':{'Authorization':'Bearer\x20'+_0x570272}});if(!_0x1f3078['ok']){const _0x56bc58=await _0x1f3078['text']();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x56bc58);}return _0x1f3078[_0x3aef1e(0x1b6)]();}export async function markCommentsAddressed(_0x52a1bc,_0x308f13,_0x3f56a3){const _0xd2950=_0x3a20,_0x308ef7={'TihrK':function(_0x248600){return _0x248600();},'gdFHQ':_0xd2950(0x1b5),'qrSyM':'application/json'},_0x48aa5c=await _0x308ef7['TihrK'](getToken);if(!_0x48aa5c)throw new Error(_0x308ef7['gdFHQ']);const _0x4e0043=_0x308ef7['TihrK'](getApiBaseUrl),_0x492abf=await fetch(_0x4e0043+_0xd2950(0x1b1)+_0x52a1bc+_0xd2950(0x1b2),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x48aa5c,'Content-Type':_0x308ef7['qrSyM']},'body':JSON[_0xd2950(0x1a7)]({'checklistItemId':_0x308f13,'commentIds':_0x3f56a3})});if(!_0x492abf['ok']){const _0x5daf1f=await _0x492abf['text']();throw new Error(_0xd2950(0x19f)+_0x5daf1f);}}export async function softDeleteFeature(_0x4e1d74){const _0x3b524b=_0x3a20,_0x3fb4ad={'DrCCb':function(_0x412022){return _0x412022();},'flWKo':function(_0x41b4d8,_0x2b25b0,_0x287881){return _0x41b4d8(_0x2b25b0,_0x287881);}},_0x45595b=await _0x3fb4ad['DrCCb'](getToken);if(!_0x45595b)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x258e7c=getApiBaseUrl(),_0x7b1c8b=await _0x3fb4ad[_0x3b524b(0x1c1)](fetch,_0x258e7c+_0x3b524b(0x1b1)+_0x4e1d74,{'method':_0x3b524b(0x1d3),'headers':{'Authorization':_0x3b524b(0x1b9)+_0x45595b}});if(!_0x7b1c8b['ok']){const _0x372391=await _0x7b1c8b[_0x3b524b(0x1d0)]();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x372391);}}export async function restoreFeature(_0xad4395){const _0x576d5e=_0x3a20,_0x200639={'rVhHF':function(_0x63de57){return _0x63de57();},'WYaUm':function(_0x341668,_0x40f3ab,_0x13be92){return _0x341668(_0x40f3ab,_0x13be92);},'tITIM':_0x576d5e(0x1d5)},_0x21fc55=await _0x200639['rVhHF'](getToken);if(!_0x21fc55)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x25e4c0=_0x200639[_0x576d5e(0x1d4)](getApiBaseUrl),_0x1dbf45=await _0x200639[_0x576d5e(0x18d)](fetch,_0x25e4c0+_0x576d5e(0x1b1)+_0xad4395+'/restore',{'method':_0x200639['tITIM'],'headers':{'Authorization':_0x576d5e(0x1b9)+_0x21fc55}});if(!_0x1dbf45['ok']){const _0x2abca5=await _0x1dbf45[_0x576d5e(0x1d0)]();throw new Error(_0x576d5e(0x1c8)+_0x2abca5);}}
1
+ (function(_0x134aaa,_0x5715ba){const _0x550863=_0x5257,_0x5ae433=_0x134aaa();while(!![]){try{const _0x40db6a=parseInt(_0x550863(0x135))/0x1+parseInt(_0x550863(0x14b))/0x2*(parseInt(_0x550863(0x131))/0x3)+-parseInt(_0x550863(0x150))/0x4*(-parseInt(_0x550863(0x12b))/0x5)+-parseInt(_0x550863(0x145))/0x6+parseInt(_0x550863(0x174))/0x7+parseInt(_0x550863(0x13d))/0x8*(parseInt(_0x550863(0x171))/0x9)+-parseInt(_0x550863(0x16e))/0xa;if(_0x40db6a===_0x5715ba)break;else _0x5ae433['push'](_0x5ae433['shift']());}catch(_0x4119ea){_0x5ae433['push'](_0x5ae433['shift']());}}}(_0x56af,0xccb5b));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x4282a0){const _0x1f93f6=_0x5257,_0x239a2d={'qFtnq':_0x1f93f6(0x170),'rPrpQ':function(_0x3c30e1){return _0x3c30e1();},'KAhhu':function(_0x1b6051,_0x260a8e){return _0x1b6051===_0x260a8e;},'YlCga':_0x1f93f6(0x12d)},_0x2be393=await getToken();if(!_0x2be393)throw new Error(_0x239a2d['qFtnq']);const _0x240efc=_0x239a2d[_0x1f93f6(0x141)](getApiBaseUrl),_0x570097=await fetch(_0x240efc+_0x1f93f6(0x161),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x2be393,'Content-Type':'application/json'},'body':JSON[_0x1f93f6(0x144)](_0x4282a0)});if(!_0x570097['ok']){if(_0x239a2d['KAhhu'](_0x570097['status'],0x192)){const _0x49b10b=await _0x570097['json'](),_0x3a5843=_0x49b10b[_0x1f93f6(0x177)]||'https://dashboard.ranger.net/billing';throw new Error((_0x49b10b['message']||_0x239a2d['YlCga'])+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x3a5843);}const _0x53e61a=await _0x570097['text']();throw new Error(_0x1f93f6(0x148)+_0x53e61a);}return _0x570097['json']();}export async function listFeatures(_0x43c461){const _0x51543d=_0x5257,_0x58f783={'EQInR':_0x51543d(0x178),'psrsE':_0x51543d(0x165),'DpwHV':_0x51543d(0x15d),'Cqxgf':_0x51543d(0x168),'OVgLm':'true','ReKYx':_0x51543d(0x159)},_0x6b8ff5=await getToken();if(!_0x6b8ff5)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3eeaa6=getApiBaseUrl(),_0x4d7451=new URLSearchParams();if(_0x43c461?.['gitRepoUrl'])_0x4d7451['set'](_0x58f783[_0x51543d(0x14f)],_0x43c461[_0x51543d(0x178)]);if(_0x43c461?.['gitBranch'])_0x4d7451[_0x51543d(0x142)](_0x58f783['psrsE'],_0x43c461['gitBranch']);if(_0x43c461?.['limit'])_0x4d7451['set'](_0x51543d(0x14a),_0x43c461[_0x51543d(0x14a)]['toString']());if(_0x43c461?.[_0x51543d(0x15d)])_0x4d7451['set'](_0x58f783[_0x51543d(0x13c)],_0x43c461[_0x51543d(0x15d)]['toString']());if(_0x43c461?.[_0x51543d(0x168)])_0x4d7451['set'](_0x58f783['Cqxgf'],_0x58f783[_0x51543d(0x155)]);const _0x339a25=_0x3eeaa6+'/api/v1/mcp/features'+(_0x4d7451[_0x51543d(0x15e)]()?'?'+_0x4d7451[_0x51543d(0x15e)]():''),_0x262ab5=await fetch(_0x339a25,{'method':_0x58f783['ReKYx'],'headers':{'Authorization':_0x51543d(0x157)+_0x6b8ff5}});if(!_0x262ab5['ok']){const _0x58ba07=await _0x262ab5[_0x51543d(0x14d)]();throw new Error(_0x51543d(0x164)+_0x58ba07);}return _0x262ab5['json']();}export async function getFeature(_0x579598){const _0x1234d1=_0x5257,_0x32a9db={'Bwlnt':function(_0x44c14c){return _0x44c14c();},'FuXBg':function(_0x54f19f,_0x2d791c,_0x4aa5c7){return _0x54f19f(_0x2d791c,_0x4aa5c7);},'OJopd':'GET'},_0x3e4e9d=await _0x32a9db['Bwlnt'](getToken);if(!_0x3e4e9d)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x22f97b=getApiBaseUrl(),_0x4b2805=await _0x32a9db['FuXBg'](fetch,_0x22f97b+'/api/v1/mcp/features/'+_0x579598,{'method':_0x32a9db[_0x1234d1(0x151)],'headers':{'Authorization':'Bearer\x20'+_0x3e4e9d}});if(!_0x4b2805['ok']){const _0x88e8a7=await _0x4b2805['text']();throw new Error(_0x1234d1(0x15b)+_0x88e8a7);}return _0x4b2805[_0x1234d1(0x14c)]();}export async function updateFeature(_0x565bd7,_0x4c1533){const _0x2c5e09=_0x5257,_0x3d854e={'joZIZ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','YjYQa':function(_0x4af6c5){return _0x4af6c5();},'VwCPZ':function(_0xdcbf42,_0x37d1ed,_0x1d69e0){return _0xdcbf42(_0x37d1ed,_0x1d69e0);},'TnlLp':'PATCH','WvSqZ':'application/json'},_0x334b96=await getToken();if(!_0x334b96)throw new Error(_0x3d854e[_0x2c5e09(0x16f)]);const _0x1ddb5d=_0x3d854e['YjYQa'](getApiBaseUrl),_0x6b7b2=await _0x3d854e['VwCPZ'](fetch,_0x1ddb5d+_0x2c5e09(0x132)+_0x565bd7,{'method':_0x3d854e['TnlLp'],'headers':{'Authorization':'Bearer\x20'+_0x334b96,'Content-Type':_0x3d854e[_0x2c5e09(0x15c)]},'body':JSON[_0x2c5e09(0x144)](_0x4c1533)});if(!_0x6b7b2['ok']){const _0x3b7f21=await _0x6b7b2['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x3b7f21);}return _0x6b7b2['json']();}export async function createChecklistItem(_0x158ef6,_0x3b8b8b,_0x43006c){const _0x3cb1eb=_0x5257,_0x4fc235={'SPgHc':function(_0x2c6cc7,_0x830e47,_0x1803e7){return _0x2c6cc7(_0x830e47,_0x1803e7);},'RfZGE':'POST','kafYb':'application/json'},_0x2beb85=await getToken();if(!_0x2beb85)throw new Error(_0x3cb1eb(0x170));const _0x4e67b6=getApiBaseUrl(),_0xce7f0b=await _0x4fc235[_0x3cb1eb(0x16b)](fetch,_0x4e67b6+'/api/v1/mcp/features/'+_0x158ef6+_0x3cb1eb(0x163),{'method':_0x4fc235[_0x3cb1eb(0x13f)],'headers':{'Authorization':'Bearer\x20'+_0x2beb85,'Content-Type':_0x4fc235[_0x3cb1eb(0x173)]},'body':JSON['stringify']({'description':_0x3b8b8b,'position':_0x43006c})});if(!_0xce7f0b['ok']){const _0x117fad=await _0xce7f0b['text']();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x117fad);}return _0xce7f0b['json']();}export async function updateChecklistItem(_0x2597ab,_0x52dd9c,_0x13612e){const _0x326a17=_0x5257,_0x17b26f={'LnCEm':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ibfzh':function(_0x535981){return _0x535981();},'pHzpU':function(_0x2bee44,_0x21885a,_0x22593c){return _0x2bee44(_0x21885a,_0x22593c);},'XnEDA':_0x326a17(0x12f),'sHwLQ':_0x326a17(0x12c)};return withRetry(async()=>{const _0x520eaa=_0x326a17,_0x26d38f=await getToken();if(!_0x26d38f)throw new Error(_0x17b26f['LnCEm']);const _0x1170cf=_0x17b26f[_0x520eaa(0x12e)](getApiBaseUrl),_0x249f29=await _0x17b26f['pHzpU'](fetch,_0x1170cf+'/api/v1/mcp/features/'+_0x2597ab+_0x520eaa(0x176)+_0x52dd9c,{'method':_0x17b26f['XnEDA'],'headers':{'Authorization':_0x520eaa(0x157)+_0x26d38f,'Content-Type':'application/json'},'body':JSON['stringify'](_0x13612e)});if(!_0x249f29['ok']){const _0x296c9a=await _0x249f29[_0x520eaa(0x14d)]();throw new Error(_0x520eaa(0x136)+_0x296c9a);}return _0x249f29[_0x520eaa(0x14c)]();},{'label':_0x17b26f['sHwLQ']});}function _0x5257(_0x4f0950,_0x507c6c){_0x4f0950=_0x4f0950-0x12b;const _0x56af4d=_0x56af();let _0x5257d3=_0x56af4d[_0x4f0950];return _0x5257d3;}export async function getFeatureReport(_0x5ea5b4){const _0xad8f81=_0x5257,_0x373f80={'fnsTE':function(_0x2ed63c){return _0x2ed63c();},'sCxXZ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','VaTPr':'GET'},_0x55b33f=await _0x373f80[_0xad8f81(0x166)](getToken);if(!_0x55b33f)throw new Error(_0x373f80['sCxXZ']);const _0xfcfc45=_0x373f80['fnsTE'](getApiBaseUrl),_0x2058e9=await fetch(_0xfcfc45+'/api/v1/mcp/features/'+_0x5ea5b4+'/report',{'method':_0x373f80['VaTPr'],'headers':{'Authorization':'Bearer\x20'+_0x55b33f}});if(!_0x2058e9['ok']){const _0x51fe34=await _0x2058e9['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x51fe34);}return _0x2058e9['json']();}export async function getFeatureReportMarkdown(_0x1f0a42,_0x2bfeff){const _0x5c9717=_0x5257,_0x1b6618={'OgWJR':function(_0x17f4ab,_0x554f06){return _0x17f4ab(_0x554f06);},'FQElb':'sessionId','EGKRW':_0x5c9717(0x160)},_0x59ddda=await getToken();if(!_0x59ddda)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x4dc3c1=getApiBaseUrl(),_0x51b6ae=new URLSearchParams(),_0x5217e0=(_0x2bfeff?.['itemIds']?.[_0x5c9717(0x143)]??0x0)>0x0,_0x510740=_0x1b6618['OgWJR'](Boolean,_0x2bfeff?.[_0x5c9717(0x137)]);_0x5217e0&&_0x2bfeff?.['itemIds']&&_0x51b6ae['set'](_0x5c9717(0x14e),_0x2bfeff['itemIds']['join'](','));_0x510740&&_0x2bfeff?.['sessionId']&&_0x51b6ae[_0x5c9717(0x142)](_0x1b6618['FQElb'],_0x2bfeff[_0x5c9717(0x137)]);!_0x5217e0&&!_0x510740&&_0x2bfeff?.['style']&&_0x51b6ae['set'](_0x1b6618['EGKRW'],_0x2bfeff['style']);const _0x2b9eaf=_0x4dc3c1+'/api/v1/mcp/features/'+_0x1f0a42+'/report/markdown',_0xa902c9=''+_0x2b9eaf+(_0x51b6ae[_0x5c9717(0x15e)]()?'?'+_0x51b6ae['toString']():''),_0x1da67d=await fetch(_0xa902c9,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x59ddda}});if(!_0x1da67d['ok']){const _0x5870a0=await _0x1da67d[_0x5c9717(0x14d)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x5870a0);}return _0x1da67d[_0x5c9717(0x14d)]();}export async function listFeatureSessions(_0x43a115){const _0x58f0da=_0x5257,_0x1dd05f={'HkwFL':function(_0x2da238,_0xb8f86f,_0xc95026){return _0x2da238(_0xb8f86f,_0xc95026);},'sMzxx':_0x58f0da(0x159)},_0x4b8e64=await getToken();if(!_0x4b8e64)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x329311=getApiBaseUrl(),_0xfe8046=await _0x1dd05f['HkwFL'](fetch,_0x329311+_0x58f0da(0x132)+_0x43a115+_0x58f0da(0x158),{'method':_0x1dd05f[_0x58f0da(0x134)],'headers':{'Authorization':_0x58f0da(0x157)+_0x4b8e64}});if(!_0xfe8046['ok']){const _0x158195=await _0xfe8046['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x158195);}return _0xfe8046['json']();}export async function startSession(_0x1da2ff,_0x4520b7){const _0x54b5e2=_0x5257,_0x815bbb={'dZufu':function(_0x16cb62){return _0x16cb62();},'MTjMI':_0x54b5e2(0x170),'kSNhc':_0x54b5e2(0x133)},_0x3273c5=await _0x815bbb[_0x54b5e2(0x179)](getToken);if(!_0x3273c5)throw new Error(_0x815bbb[_0x54b5e2(0x146)]);const _0x3a2664=_0x815bbb[_0x54b5e2(0x179)](getApiBaseUrl),_0x1b04d7=await fetch(_0x3a2664+_0x54b5e2(0x132)+_0x1da2ff+_0x54b5e2(0x13e)+_0x4520b7+'/start',{'method':_0x815bbb[_0x54b5e2(0x130)],'headers':{'Authorization':_0x54b5e2(0x157)+_0x3273c5}});if(!_0x1b04d7['ok']){const _0x539a24=await _0x1b04d7[_0x54b5e2(0x14d)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x539a24);}return _0x1b04d7[_0x54b5e2(0x14c)]();}export async function concludeSession(_0x565b3d,_0x5bb843){const _0x16e01b=_0x5257,_0x43d8af={'LpFBd':function(_0x44f531){return _0x44f531();},'qYbGq':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','HSGFZ':function(_0x535de7){return _0x535de7();},'Jpcnv':function(_0xd286c3,_0x3a064d,_0xb3f2b4){return _0xd286c3(_0x3a064d,_0xb3f2b4);}},_0xfa91e7=await _0x43d8af['LpFBd'](getToken);if(!_0xfa91e7)throw new Error(_0x43d8af[_0x16e01b(0x138)]);const _0x21b94c=_0x43d8af['HSGFZ'](getApiBaseUrl),_0x538e59=await _0x43d8af[_0x16e01b(0x16d)](fetch,_0x21b94c+'/api/v1/mcp/features/'+_0x565b3d+_0x16e01b(0x13e)+_0x5bb843+'/conclude',{'method':'POST','headers':{'Authorization':_0x16e01b(0x157)+_0xfa91e7}});if(!_0x538e59['ok']){const _0x58a73e=await _0x538e59['text']();throw new Error(_0x16e01b(0x139)+_0x58a73e);}return _0x538e59[_0x16e01b(0x14c)]();}export async function getActionItems(_0x2120dc){const _0x448830=_0x5257,_0x3988db={'iOkws':function(_0x11568a){return _0x11568a();},'oEDmM':_0x448830(0x170),'WcFcX':function(_0x1728c2){return _0x1728c2();},'XczjI':function(_0x44dc5c,_0x2be880,_0x31a9b1){return _0x44dc5c(_0x2be880,_0x31a9b1);}},_0x514165=await _0x3988db[_0x448830(0x13b)](getToken);if(!_0x514165)throw new Error(_0x3988db[_0x448830(0x167)]);const _0x156713=_0x3988db['WcFcX'](getApiBaseUrl),_0x2b95f7=await _0x3988db[_0x448830(0x156)](fetch,_0x156713+_0x448830(0x132)+_0x2120dc+_0x448830(0x15a),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x514165}});if(!_0x2b95f7['ok']){const _0x2091c2=await _0x2b95f7[_0x448830(0x14d)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x2091c2);}return _0x2b95f7[_0x448830(0x14c)]();}export async function getItemFeedback(_0x2fffb1,_0x2ed19d){const _0x42b832=_0x5257,_0x216acc={'xoFmU':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','iNfJk':function(_0x3d66ca){return _0x3d66ca();},'eXLXl':function(_0x1aba72,_0xab5867,_0x2aeb7a){return _0x1aba72(_0xab5867,_0x2aeb7a);}},_0x41b984=await getToken();if(!_0x41b984)throw new Error(_0x216acc[_0x42b832(0x152)]);const _0x4db5d9=_0x216acc['iNfJk'](getApiBaseUrl),_0x40b3e3=await _0x216acc[_0x42b832(0x16a)](fetch,_0x4db5d9+_0x42b832(0x132)+_0x2fffb1+'/checklist-items/'+_0x2ed19d+'/feedback',{'method':_0x42b832(0x159),'headers':{'Authorization':'Bearer\x20'+_0x41b984}});if(!_0x40b3e3['ok']){const _0x8772a5=await _0x40b3e3[_0x42b832(0x14d)]();throw new Error(_0x42b832(0x13a)+_0x8772a5);}return _0x40b3e3[_0x42b832(0x14c)]();}export async function markCommentsAddressed(_0x2990e1,_0x13f4fa,_0x1aa9fb){const _0x33db29=_0x5257,_0x525337={'FjuNw':_0x33db29(0x133),'lselT':_0x33db29(0x169)},_0x56519f=await getToken();if(!_0x56519f)throw new Error(_0x33db29(0x170));const _0xfea2d2=getApiBaseUrl(),_0x3ca0e8=await fetch(_0xfea2d2+_0x33db29(0x132)+_0x2990e1+'/comments/address',{'method':_0x525337[_0x33db29(0x147)],'headers':{'Authorization':_0x33db29(0x157)+_0x56519f,'Content-Type':_0x525337[_0x33db29(0x175)]},'body':JSON[_0x33db29(0x144)]({'checklistItemId':_0x13f4fa,'commentIds':_0x1aa9fb})});if(!_0x3ca0e8['ok']){const _0x44178c=await _0x3ca0e8['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x44178c);}}export async function softDeleteFeature(_0x4c3cf7){const _0x53f539=_0x5257,_0x177c45={'eZgtV':function(_0x538dc4){return _0x538dc4();},'Zvkxh':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','dZLLx':function(_0x51af9c,_0x40c68d,_0x50492f){return _0x51af9c(_0x40c68d,_0x50492f);},'dnLwD':_0x53f539(0x140)},_0x3baddb=await _0x177c45['eZgtV'](getToken);if(!_0x3baddb)throw new Error(_0x177c45[_0x53f539(0x149)]);const _0x2b24a4=_0x177c45[_0x53f539(0x16c)](getApiBaseUrl),_0x5dd461=await _0x177c45[_0x53f539(0x15f)](fetch,_0x2b24a4+'/api/v1/mcp/features/'+_0x4c3cf7,{'method':_0x177c45['dnLwD'],'headers':{'Authorization':_0x53f539(0x157)+_0x3baddb}});if(!_0x5dd461['ok']){const _0x4acb52=await _0x5dd461['text']();throw new Error(_0x53f539(0x153)+_0x4acb52);}}export async function restoreFeature(_0x563ca8){const _0xdd3951=_0x5257,_0x5b3f08={'QSkjg':function(_0x5828fe){return _0x5828fe();},'NHvLw':_0xdd3951(0x133)},_0x18d10b=await getToken();if(!_0x18d10b)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3a320f=_0x5b3f08['QSkjg'](getApiBaseUrl),_0x195914=await fetch(_0x3a320f+_0xdd3951(0x132)+_0x563ca8+_0xdd3951(0x154),{'method':_0x5b3f08[_0xdd3951(0x172)],'headers':{'Authorization':'Bearer\x20'+_0x18d10b}});if(!_0x195914['ok']){const _0x3fdc90=await _0x195914['text']();throw new Error(_0xdd3951(0x162)+_0x3fdc90);}}function _0x56af(){const _0x3aa73c=['Bearer\x20','/sessions','GET','/action-items','Failed\x20to\x20get\x20feature\x20review:\x20','WvSqZ','offset','toString','dZLLx','style','/api/v1/mcp/features','Failed\x20to\x20restore\x20feature\x20review:\x20','/checklist','Failed\x20to\x20list\x20feature\x20reviews:\x20','gitBranch','fnsTE','oEDmM','includeDeleted','application/json','eXLXl','SPgHc','eZgtV','Jpcnv','16710920UjDPmE','joZIZ','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','908649pLHoSr','NHvLw','kafYb','9758623QRAMsh','lselT','/checklist/','billingUrl','gitRepoUrl','dZufu','265420Pbkyzg','updateChecklistItem','Feature\x20limit\x20exceeded','ibfzh','PATCH','kSNhc','510mpIndw','/api/v1/mcp/features/','POST','sMzxx','346053edIEDt','Failed\x20to\x20update\x20scenario:\x20','sessionId','qYbGq','Failed\x20to\x20conclude\x20session:\x20','Failed\x20to\x20get\x20item\x20feedback:\x20','iOkws','DpwHV','40FWmsir','/sessions/','RfZGE','DELETE','rPrpQ','set','length','stringify','3716820pCbpVz','MTjMI','FjuNw','Failed\x20to\x20create\x20feature\x20review:\x20','Zvkxh','limit','1658veLHcJ','json','text','itemIds','EQInR','56HozUgH','OJopd','xoFmU','Failed\x20to\x20delete\x20feature\x20review:\x20','/restore','OVgLm','XczjI'];_0x56af=function(){return _0x3aa73c;};return _0x56af();}