@ranger-testing/ranger-cli 3.0.1-alpha.ffffb5b-28 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -0
  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 -0
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/sessionCache.js +1 -1
  71. package/build/commands/utils/settings.js +1 -1
  72. package/build/commands/utils/skillContent.js +1 -1
  73. package/build/commands/utils/skills.js +1 -1
  74. package/build/commands/utils/stitchWebmFiles.js +1 -1
  75. package/build/commands/utils/telemetry.js +1 -1
  76. package/build/commands/utils/tokenRefresh.js +1 -1
  77. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  78. package/build/commands/utils/tunnelClient.js +1 -0
  79. package/build/commands/utils/userApi.js +1 -1
  80. package/build/commands/utils/version.js +1 -1
  81. package/build/commands/verifyFeature.js +1 -1
  82. package/build/commands/verifyFeatureCli.js +1 -1
  83. package/build/commands/verifyFeatureNovaCli.js +1 -1
  84. package/build/commands/verifyFeatureRangerwrightCli.js +1 -0
  85. package/package.json +4 -1
@@ -1 +1 @@
1
- const _0x3f30ba=_0x4b7a;(function(_0x3a8a08,_0x2f6ee3){const _0x343175=_0x4b7a,_0x3ee366=_0x3a8a08();while(!![]){try{const _0x3735ee=-parseInt(_0x343175(0x1fa))/0x1*(-parseInt(_0x343175(0x1e8))/0x2)+-parseInt(_0x343175(0x1d7))/0x3*(-parseInt(_0x343175(0x1a4))/0x4)+parseInt(_0x343175(0x195))/0x5*(-parseInt(_0x343175(0x1bc))/0x6)+parseInt(_0x343175(0x1f8))/0x7+-parseInt(_0x343175(0x1fd))/0x8+parseInt(_0x343175(0x19b))/0x9+-parseInt(_0x343175(0x19e))/0xa;if(_0x3735ee===_0x2f6ee3)break;else _0x3ee366['push'](_0x3ee366['shift']());}catch(_0x4004ee){_0x3ee366['push'](_0x3ee366['shift']());}}}(_0x5358,0xe9a44));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x175a33 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,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x243729=_0x4b7a,_0x498194={'kzewl':function(_0x447093){return _0x447093();}},_0x1cc09d=await _0x498194[_0x243729(0x1cf)](getToken);if(!_0x1cc09d)throw new Error(_0x243729(0x1d9));return _0x1cc09d;}async function apiRequest(_0xfdd7c4,_0x548e53={}){const _0x5b0f3e=_0x4b7a,_0x245c3f={'OAevO':function(_0x5d453c){return _0x5d453c();},'ALwVf':function(_0xf6a140){return _0xf6a140();},'PlLbc':function(_0x33301f,_0x4721d6){return _0x33301f===_0x4721d6;},'uzsIz':function(_0xf3bb27,_0x2472d3){return _0xf3bb27===_0x2472d3;},'hvksU':_0x5b0f3e(0x1e3),'IudKW':function(_0x38a975,_0x34153e){return _0x38a975===_0x34153e;}},_0x441faa=await _0x245c3f['OAevO'](requireToken),_0x447f1a=_0x245c3f['ALwVf'](getApiBaseUrl),_0x5588f7=await fetch(''+_0x447f1a+_0xfdd7c4,{..._0x548e53,'headers':{'Authorization':'Bearer\x20'+_0x441faa,'Content-Type':'application/json',..._0x548e53['headers']??{}}});if(!_0x5588f7['ok']){let _0x2b1363='',_0x2b1d0f;try{const _0x3f025e=await _0x5588f7[_0x5b0f3e(0x199)]();_0x2b1363=(_0x245c3f[_0x5b0f3e(0x1c2)](typeof _0x3f025e['error'],'string')?_0x3f025e['error']:undefined)??JSON[_0x5b0f3e(0x1da)](_0x3f025e);if(_0x245c3f['uzsIz'](typeof _0x3f025e[_0x5b0f3e(0x1c3)],_0x245c3f['hvksU']))_0x2b1d0f=_0x3f025e['code'];}catch{_0x2b1363=_0x5588f7[_0x5b0f3e(0x198)];}throw new ApiError(_0x5b0f3e(0x1c9)+_0xfdd7c4+_0x5b0f3e(0x1b0)+_0x5588f7[_0x5b0f3e(0x19c)]+_0x5b0f3e(0x1f5)+_0x2b1363,_0x5588f7[_0x5b0f3e(0x19c)],_0x2b1363,_0x2b1d0f);}if(_0x245c3f['IudKW'](_0x5588f7['status'],0xcc))return undefined;return _0x5588f7[_0x5b0f3e(0x199)]();}export class ApiError extends Error{[_0x3f30ba(0x19c)];['detail'];[_0x3f30ba(0x1c3)];constructor(_0x3aab56,_0x4e796c,_0xe6f051,_0x1706a9){const _0x181068=_0x3f30ba,_0x17417f={'mWkFg':_0x181068(0x19d)};super(_0x3aab56),this['status']=_0x4e796c,this['detail']=_0xe6f051,this[_0x181068(0x1c3)]=_0x1706a9,this[_0x181068(0x1ff)]=_0x17417f['mWkFg'];}}export async function fetchCloudProfile(_0x2df3bd){const _0x473dac=_0x3f30ba,_0x30db36={'jCpNG':function(_0x557dbe,_0x1093d2){return _0x557dbe===_0x1093d2;}};try{return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x2df3bd));}catch(_0x263388){if(_0x263388 instanceof ApiError&&_0x30db36[_0x473dac(0x1be)](_0x263388[_0x473dac(0x19c)],0x194))return null;throw _0x263388;}}export async function listCloudProfiles(){const _0x17f88e=_0x3f30ba,_0x464b47={'LpRTD':function(_0x4492e3,_0x35c7dc){return _0x4492e3(_0x35c7dc);}},_0x39b150=await _0x464b47['LpRTD'](apiRequest,_0x17f88e(0x1db));return _0x39b150[_0x17f88e(0x1dc)];}export async function deleteCloudProfile(_0x13d414){const _0x4e7bab=_0x3f30ba,_0x1d4663={'tNkVd':function(_0xe5c1e8,_0x5de568,_0x527951){return _0xe5c1e8(_0x5de568,_0x527951);},'hHaFb':function(_0x24f6e4,_0x16a0d4){return _0x24f6e4(_0x16a0d4);},'zCXCX':'DELETE','EFrPl':function(_0x14b86a,_0x6ede1d){return _0x14b86a===_0x6ede1d;}};try{await _0x1d4663['tNkVd'](apiRequest,_0x4e7bab(0x1e4)+_0x1d4663['hHaFb'](encodeURIComponent,_0x13d414),{'method':_0x1d4663['zCXCX']});}catch(_0x461d17){if(_0x461d17 instanceof ApiError&&_0x1d4663[_0x4e7bab(0x1f9)](_0x461d17['status'],0x194))throw new Error(_0x4e7bab(0x1f0)+_0x13d414+_0x4e7bab(0x1ea));throw _0x461d17;}}export async function createCloudProfile(_0xfe11ef,_0xf2b09b,_0x3e21d9={}){const _0x117d8e=_0x3f30ba,_0x5d8230={'FWILA':function(_0x4919ba,_0x4d3a50,_0x2834ee){return _0x4919ba(_0x4d3a50,_0x2834ee);}},_0x1c6ce1={'name':_0xfe11ef};if(_0xf2b09b)_0x1c6ce1['environment_key']=_0xf2b09b;_0x3e21d9[_0x117d8e(0x1e9)]&&Object[_0x117d8e(0x1a2)](_0x3e21d9[_0x117d8e(0x1e9)])['length']>0x0&&(_0x1c6ce1['settings']=_0x3e21d9['settings']);if(_0x3e21d9['username'])_0x1c6ce1['username']=_0x3e21d9['username'];if(_0x3e21d9['password'])_0x1c6ce1['password']=_0x3e21d9[_0x117d8e(0x1b6)];return await _0x5d8230['FWILA'](apiRequest,'/api/v1/profiles',{'method':'POST','body':JSON[_0x117d8e(0x1da)](_0x1c6ce1)});}export async function uploadCloudProfileSession(_0x36ede5,_0xae8a2c){const _0x1926d4=_0x3f30ba;return await apiRequest(_0x1926d4(0x1e4)+encodeURIComponent(_0x36ede5)+_0x1926d4(0x1bb),{'method':_0x1926d4(0x1d3),'body':JSON['stringify']({'session_state':_0xae8a2c})});}export async function saveCloudProfileCredentials(_0x4170f5,_0x467d16,_0x584102){const _0xe3aeba=_0x3f30ba,_0x411b79={'qzuBb':function(_0x552eda,_0x1a8050,_0x438793){return _0x552eda(_0x1a8050,_0x438793);},'rivgF':function(_0x593026,_0x429b7b){return _0x593026(_0x429b7b);}};await _0x411b79[_0xe3aeba(0x1f3)](apiRequest,'/api/v1/profiles/'+_0x411b79[_0xe3aeba(0x1aa)](encodeURIComponent,_0x4170f5),{'method':_0xe3aeba(0x1b3),'body':JSON['stringify']({'username':_0x467d16,'password':_0x584102})});}export async function fetchAuthConfig(){const _0x7911fe=_0x3f30ba,_0x56317d={'PEuEh':function(_0xf12b40,_0x13b5b0){return _0xf12b40(_0x13b5b0);},'NzZfr':'/api/v1/profiles/auth-config','QcOUF':function(_0x4b8022,_0x29f4bf){return _0x4b8022 instanceof _0x29f4bf;}};try{const _0x4d5639=await _0x56317d['PEuEh'](apiRequest,_0x56317d['NzZfr']);return _0x4d5639['auth_config'];}catch(_0x39c4aa){return _0x56317d[_0x7911fe(0x1c4)](_0x39c4aa,ApiError)&&_0x39c4aa[_0x7911fe(0x19c)]!==0x194&&console[_0x7911fe(0x196)](_0x7911fe(0x1c8)+_0x39c4aa['message']),null;}}export function pickAdHocEnvKey(_0x3f328b){const _0x16598f=_0x3f30ba,_0x261abb={'rmXMO':function(_0x40e3fc,_0x526057){return _0x40e3fc===_0x526057;},'xlGkQ':function(_0x322ddb,_0x5a5280){return _0x322ddb+_0x5a5280;}};if(!_0x3f328b)return null;if(_0x3f328b['defaultEnvironmentKey'])return _0x3f328b[_0x16598f(0x1c1)];const _0x215dce=Object[_0x16598f(0x1a2)](_0x3f328b['environments']??{});if(_0x261abb['rmXMO'](_0x215dce[_0x16598f(0x1a9)],0x1))return _0x215dce[0x0];if(_0x215dce['length']===0x0)return null;throw new Error(_0x261abb['xlGkQ'](_0x16598f(0x1ee)+_0x215dce['join'](',\x20')+_0x16598f(0x1df),'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.'));}export async function resolveAdHocProfile(_0x24f117=process[_0x3f30ba(0x1a6)]){const _0x5c14b1=_0x3f30ba,_0xead83e={'IEkjT':function(_0x53b3ed,_0xee2e49){return _0x53b3ed(_0xee2e49);}},_0x335480=_0x24f117[_0x5c14b1(0x1ef)];if(!_0x335480)return null;const _0x3aee73=await _0xead83e['IEkjT'](fetchCloudProfile,_0x335480);if(_0x3aee73)return{'name':_0x3aee73['name'],'profile':_0x3aee73};const _0x57b0e6=await fetchAuthConfig(),_0xc8091e=pickAdHocEnvKey(_0x57b0e6),_0x3bc425=_0x24f117[_0x5c14b1(0x1b1)],_0x486e90=await createCloudProfile(_0x335480,_0xc8091e??undefined,{'username':_0x335480,'password':_0x3bc425});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x486e90[_0x5c14b1(0x1ff)]+'\x22\x20for\x20'+_0x335480),{'name':_0x486e90[_0x5c14b1(0x1ff)],'profile':_0x486e90};}export async function writeSessionToLocalCache(_0x3bad2c,_0xe61fd,_0x4877d0,_0x41149d,_0x2f7e47,_0x8d042a,_0x40520b){const _0x3f83a7=_0x3f30ba,_0x53c4df={'nVJVG':function(_0x5926e9,_0x326622,_0x4f8594){return _0x5926e9(_0x326622,_0x4f8594);},'oNrsv':function(_0xec005b){return _0xec005b();},'EfLYv':function(_0x44c9f3,_0x176c01,_0x1aba82){return _0x44c9f3(_0x176c01,_0x1aba82);},'EGPNB':function(_0x508864,_0x35d714){return _0x508864>_0x35d714;},'vDEZx':function(_0x5b6ca5,_0x26073b,_0x35eab8){return _0x5b6ca5(_0x26073b,_0x35eab8);}},_0x119c47=sessionCacheHash({'orgId':_0xe61fd,'profileName':_0x3bad2c,'effectiveBaseUrl':_0x4877d0,'setupHeaders':_0x41149d,'invalidateOn':_0x40520b?.[_0x3f83a7(0x1e7)],'userAgent':_0x40520b?.[_0x3f83a7(0x1e5)],'clientIp':_0x40520b?.[_0x3f83a7(0x1ec)]}),_0x3a8bd9=_0x53c4df['nVJVG'](getSessionCachePath,_0x119c47,_0x3bad2c),_0x1936e0=join(_0x53c4df[_0x3f83a7(0x1ac)](getRangerHomeDir),_0x3f83a7(0x1a0));!existsSync(_0x1936e0)&&await _0x53c4df[_0x3f83a7(0x1c6)](mkdir,_0x1936e0,{'recursive':!![]});const _0x4c04f1={..._0x2f7e47};_0x8d042a&&_0x53c4df[_0x3f83a7(0x200)](_0x8d042a['length'],0x0)&&Array['isArray'](_0x4c04f1[_0x3f83a7(0x1ed)])&&(_0x4c04f1['cookies']=duplicateCookiesForDomains(_0x4c04f1[_0x3f83a7(0x1ed)],_0x8d042a));const _0x2695d4={'cached_at':new Date()[_0x3f83a7(0x1bf)](),'session_state':_0x4c04f1};await _0x53c4df['vDEZx'](writeFile,_0x3a8bd9,JSON['stringify'](_0x2695d4,null,0x2));const _0x38bc3f=getStorageStatePath(_0x3a8bd9);return await _0x53c4df['vDEZx'](writeFile,_0x38bc3f,JSON[_0x3f83a7(0x1da)](_0x4c04f1,null,0x2)),_0x38bc3f;}export async function checkLocalCache(_0x19aa1d,_0x351ec7,_0x5746f6,_0x3cf955,_0xd4979d){const _0x4b679a=_0x3f30ba,_0x7d54d7={'YxhWq':function(_0x44fd83,_0x362524,_0x175f70){return _0x44fd83(_0x362524,_0x175f70);},'lKgwX':function(_0x46dd4a,_0x1ccf5c){return _0x46dd4a(_0x1ccf5c);},'IVODL':function(_0x5c8100,_0x1d44ec){return _0x5c8100(_0x1d44ec);}},_0x267681=sessionCacheHash({'orgId':_0x351ec7,'profileName':_0x19aa1d,'effectiveBaseUrl':_0x5746f6,'setupHeaders':_0x3cf955,'invalidateOn':_0xd4979d?.['invalidateOn'],'userAgent':_0xd4979d?.['userAgent'],'clientIp':_0xd4979d?.[_0x4b679a(0x1ec)]}),_0x4773c7=_0x7d54d7[_0x4b679a(0x1ad)](getSessionCachePath,_0x267681,_0x19aa1d),_0x513b44=_0x7d54d7[_0x4b679a(0x197)](getStorageStatePath,_0x4773c7);if(!existsSync(_0x4773c7)||!_0x7d54d7[_0x4b679a(0x1d6)](existsSync,_0x513b44))return null;try{const _0x346198=await readFile(_0x4773c7,_0x4b679a(0x1b7));return JSON['parse'](_0x346198),{'storageStatePath':_0x513b44};}catch{return null;}}function launchRealBrowser(){const _0x5781bd=_0x3f30ba;return chromium[_0x5781bd(0x1f6)]({'headless':!![]});}function _0x4b7a(_0x369d44,_0x4ce63b){_0x369d44=_0x369d44-0x18e;const _0x5358f3=_0x5358();let _0x4b7ab9=_0x5358f3[_0x369d44];return _0x4b7ab9;}function emitSessionValidationHint(_0x5cb8f6,_0x189d4e){const _0x216bcb=_0x3f30ba,_0x5a6653={'TFAhW':function(_0xd60ccf,_0x14f05f){return _0xd60ccf===_0x14f05f;},'LuZNe':function(_0x2c25f6,_0x5b8e83){return _0x2c25f6+_0x5b8e83;}};if(!_0x189d4e||!_0x189d4e[_0x216bcb(0x1cb)]?.[_0x216bcb(0x1a9)])return;let _0x3f48e6;try{_0x3f48e6=new URL(_0x5cb8f6);}catch{return;}const _0xc1bf20=[];for(const _0x3686a7 of _0x189d4e[_0x216bcb(0x1cb)]){try{_0xc1bf20['push']({'raw':_0x3686a7,'url':new URL(_0x3686a7)});}catch{}}if(_0x5a6653[_0x216bcb(0x1b2)](_0xc1bf20[_0x216bcb(0x1a9)],0x0))return;if(_0xc1bf20['some'](_0x18b520=>_0x18b520['url']['origin']===_0x3f48e6[_0x216bcb(0x193)]))return;const _0x2dd77c=_0xc1bf20['map'](_0x3dfd14=>'\x22'+_0x3dfd14[_0x216bcb(0x1f2)]+'\x22')['join'](',\x20');console['log'](_0x5a6653['LuZNe'](_0x5a6653['LuZNe']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x2dd77c+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x5cb8f6+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20'),'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.'));}export async function serverSideLogin(_0x30a982,_0x237dff){const _0xeb0d22=_0x3f30ba,_0x1ba0b9={'cFXJr':function(_0x2d5701,_0x11bbee){return _0x2d5701 instanceof _0x11bbee;},'kSgKO':function(_0x49c076,_0x2a5fad){return _0x49c076===_0x2a5fad;},'rkhxC':'not_configured'},_0x1925c6=process['env']['RANGER_TEST_USERNAME'],_0x284fac=process[_0xeb0d22(0x1a6)]['RANGER_TEST_PASSWORD'],_0x5c3c95={};if(_0x1925c6)_0x5c3c95[_0xeb0d22(0x1fb)]=_0x1925c6;if(_0x284fac)_0x5c3c95[_0xeb0d22(0x1b6)]=_0x284fac;if(_0x237dff?.[_0xeb0d22(0x19a)])_0x5c3c95[_0xeb0d22(0x19a)]=!![];try{return await apiRequest(_0xeb0d22(0x1e4)+encodeURIComponent(_0x30a982)+_0xeb0d22(0x19f),{'method':'POST','body':JSON[_0xeb0d22(0x1da)](_0x5c3c95)});}catch(_0x3d6d7c){if(_0x1ba0b9[_0xeb0d22(0x1de)](_0x3d6d7c,ApiError)&&_0x3d6d7c[_0xeb0d22(0x19c)]===0x190&&_0x1ba0b9['kSgKO'](_0x3d6d7c[_0xeb0d22(0x1c3)],_0x1ba0b9['rkhxC']))return{'status':_0x1ba0b9['rkhxC'],'error':_0x3d6d7c['detail']};throw _0x3d6d7c;}}export async function manualBrowserLogin(_0x598b67,_0x4273b3){const _0x42969e=_0x3f30ba,_0x1f630c={'XdcBu':function(_0x1030a2,_0x6abb6c){return _0x1030a2/_0x6abb6c;},'HGgAn':function(_0x2ae01c){return _0x2ae01c();},'HzgBa':'close','NfwLF':function(_0x5bb040,_0x49346d){return _0x5bb040+_0x49346d;},'tfISX':function(_0x3ef091,_0xdaf476){return _0x3ef091>_0xdaf476;},'PpcpA':function(_0x3079dc,_0x41f274){return _0x3079dc(_0x41f274);},'gigiM':function(_0xc8cb96,_0xdd346d){return _0xc8cb96&&_0xdd346d;},'UPLBz':_0x42969e(0x1cd),'OzyJA':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','VSYOY':function(_0x1d545a,_0x2a950b,_0x38f2c8){return _0x1d545a(_0x2a950b,_0x38f2c8);},'GhKSS':'POST','cvMPR':'cli:manual-login'};if(!isInteractive())throw new Error(_0x1f630c[_0x42969e(0x1e6)](_0x42969e(0x1d2)+_0x598b67[_0x42969e(0x1ff)]+'\x22.\x0a',_0x42969e(0x1a8))+'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.');const _0x43dbbb=_0x4273b3&&_0x1f630c[_0x42969e(0x18f)](_0x4273b3['domains']['length'],0x0)?_0x4273b3['domains'][0x0]:_0x42969e(0x194);console['log']('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console['log'](_0x42969e(0x1a1)),await new Promise(_0x13bdf5=>setTimeout(_0x13bdf5,0x7d0));const _0x27d2a5=await chromium[_0x42969e(0x1f6)]({'headless':![]});let _0x2781ea=null;try{const _0x3a9ba8={'ignoreHTTPSErrors':!![]};_0x4273b3?.[_0x42969e(0x1f7)]&&(_0x3a9ba8['extraHTTPHeaders']=_0x4273b3['setupHeaders']);const _0xbc5a01=await _0x27d2a5[_0x42969e(0x1b9)](_0x3a9ba8);await _0x1f630c[_0x42969e(0x1b8)](addProfileSetupBanner,_0xbc5a01);const _0x46128f=await _0xbc5a01['newPage']();await _0x46128f['goto'](_0x43dbbb);let _0x3d735c=![];await new Promise(_0x4ce4d7=>{const _0x51e074={'LcQpo':function(_0x23fe7b,_0x49cd5d){return _0x1f630c['XdcBu'](_0x23fe7b,_0x49cd5d);},'dtubV':function(_0x301ad9){return _0x1f630c['HGgAn'](_0x301ad9);},'JiNrH':function(_0x5e1777,_0x42fb11){return _0x5e1777(_0x42fb11);}},_0x26dd42=setTimeout(()=>{const _0x1ec9d1=_0x4b7a;_0x3d735c=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+_0x51e074[_0x1ec9d1(0x1ba)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x1ec9d1(0x1c7)),_0x51e074[_0x1ec9d1(0x1b5)](_0x4ce4d7);},MANUAL_LOGIN_TIMEOUT_MS);_0x46128f['on'](_0x1f630c['HzgBa'],async()=>{const _0x5c5012=_0x4b7a;_0x51e074[_0x5c5012(0x1a5)](clearTimeout,_0x26dd42);try{const _0x1e2830=await _0xbc5a01[_0x5c5012(0x1d0)]();_0x2781ea=_0x1e2830;}catch{}_0x4ce4d7();});});if(_0x1f630c[_0x42969e(0x1e2)](_0x3d735c,!_0x2781ea))throw new Error(_0x1f630c[_0x42969e(0x1e1)]);}finally{await _0x27d2a5['close']()['catch'](()=>{});}if(!_0x2781ea)throw new Error(_0x1f630c[_0x42969e(0x1d4)]);return await _0x1f630c[_0x42969e(0x1d8)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x598b67['name'])+'/session',{'method':_0x1f630c['GhKSS'],'body':JSON['stringify']({'session_state':_0x2781ea,'updated_by':_0x1f630c[_0x42969e(0x1e0)]})}),{'sessionState':_0x2781ea};}export async function promptSaveCredentials(_0x1761cb){const _0x4407d0=_0x3f30ba,_0x566b65={'ovnIe':function(_0x29360e,_0x50b3c7){return _0x29360e||_0x50b3c7;},'CLLdh':function(_0x1f6207){return _0x1f6207();},'qUAzn':_0x4407d0(0x1a7),'zsNFN':_0x4407d0(0x1b4),'EElsA':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','WaUUW':function(_0x57b8e7,_0xe9fb6f,_0x54be8a){return _0x57b8e7(_0xe9fb6f,_0x54be8a);},'RtNmE':_0x4407d0(0x1b3),'GyuOI':_0x4407d0(0x1bd)},_0x1db193=process['env']['RANGER_TEST_USERNAME'],_0x1fb443=process[_0x4407d0(0x1a6)][_0x4407d0(0x1b1)];if(_0x566b65['ovnIe'](!_0x1db193,!_0x1fb443))return;if(!_0x566b65[_0x4407d0(0x1ca)](isInteractive))return;const {save:_0xda8558}=await _0x175a33['prompt']([{'type':_0x566b65['qUAzn'],'name':_0x566b65[_0x4407d0(0x18e)],'message':_0x566b65['EElsA'],'default':![]}]);if(!_0xda8558)return;await _0x566b65[_0x4407d0(0x1fe)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x1761cb),{'method':_0x566b65['RtNmE'],'body':JSON[_0x4407d0(0x1da)]({'username':_0x1db193,'password':_0x1fb443})}),console['log'](_0x566b65['GyuOI']);}export async function resolveCloudProfileSession(_0x33792d,_0x1cea13={}){const _0x292dbd=_0x3f30ba,_0x5408c4={'BKFtC':function(_0x2b69c5,_0x53cf96,_0x296c9a){return _0x2b69c5(_0x53cf96,_0x296c9a);},'torFx':function(_0x59fd9d,_0x104c11,_0x22db4f){return _0x59fd9d(_0x104c11,_0x22db4f);},'rkAdj':function(_0x2f8a25,_0xd3a890,_0x577634,_0x498aa0,_0x266094){return _0x2f8a25(_0xd3a890,_0x577634,_0x498aa0,_0x266094);},'DGDkJ':function(_0xb1601e,_0x2aad3e){return _0xb1601e(_0x2aad3e);},'TfvwS':'\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','TzTYi':function(_0x5c99f3,_0x4e39df){return _0x5c99f3===_0x4e39df;},'BoZsf':function(_0x22d660,_0x32a080,_0x251907,_0x1071a4,_0x26de75,_0x4e7c66,_0x2dfd7e,_0x2a1b0f){return _0x22d660(_0x32a080,_0x251907,_0x1071a4,_0x26de75,_0x4e7c66,_0x2dfd7e,_0x2a1b0f);},'AQcAk':function(_0x3f5e2c,_0x151731){return _0x3f5e2c(_0x151731);},'VSoZY':_0x292dbd(0x191),'bQTDY':function(_0x3d152e,_0x239429,_0xf39f3a,_0x5d0402,_0x4f279e,_0x35b0a1,_0x2192df,_0x419e75){return _0x3d152e(_0x239429,_0xf39f3a,_0x5d0402,_0x4f279e,_0x35b0a1,_0x2192df,_0x419e75);}},_0x217973=_0x33792d['settings']??{},_0x568ef8=await fetchAuthConfig(),_0x46da20=_0x568ef8?_0x5408c4['BKFtC'](resolveAuthEnvironmentLocally,_0x568ef8,_0x33792d[_0x292dbd(0x1ab)]):null,_0x79e351=_0x46da20?.[_0x292dbd(0x1cb)],_0x27d1ef=_0x217973['setupHeaders'],_0x4de620=_0x27d1ef??_0x46da20?.['setupHeaders'],_0x4fc736=_0x1cea13['effectiveBaseUrl']??_0x217973[_0x292dbd(0x190)]??(_0x79e351&&_0x79e351[_0x292dbd(0x1a9)]>0x0?_0x79e351[0x0]:''),_0x47d357={'invalidateOn':_0x46da20?.['invalidateOn'],'userAgent':_0x46da20?.[_0x292dbd(0x1af)]?.['userAgent']??_0x217973['userAgent']},_0x21bae0=await checkLocalCache(_0x33792d[_0x292dbd(0x1ff)],_0x33792d[_0x292dbd(0x1fc)],_0x4fc736,_0x4de620,_0x47d357);if(_0x21bae0){if(_0x4fc736){const _0x523873=await isCachedSessionLive(_0x21bae0['storageStatePath'],_0x4fc736,{'sessionCheckPath':_0x46da20?.['sessionCheckPath'],'setupHeaders':_0x4de620},{'launchBrowser':launchRealBrowser});if(_0x523873)return console['log']('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x33792d[_0x292dbd(0x1ff)]+'\x22'),{'authPath':_0x21bae0['storageStatePath'],'settings':_0x217973,'resolvedEnv':_0x46da20};console[_0x292dbd(0x1c5)](_0x292dbd(0x192)+_0x33792d['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x5408c4['torFx'](emitSessionValidationHint,_0x4fc736,_0x46da20);}else return{'authPath':_0x21bae0['storageStatePath'],'settings':_0x217973,'resolvedEnv':_0x46da20};}if(_0x33792d['sessionState']){const _0x207542=await writeSessionToLocalCache(_0x33792d['name'],_0x33792d[_0x292dbd(0x1fc)],_0x4fc736,_0x4de620,_0x33792d['sessionState'],_0x79e351,_0x47d357);if(_0x4fc736){const _0x3f4f2f=await _0x5408c4['rkAdj'](isCachedSessionLive,_0x207542,_0x4fc736,{'sessionCheckPath':_0x46da20?.['sessionCheckPath'],'setupHeaders':_0x4de620},{'launchBrowser':launchRealBrowser});if(_0x3f4f2f)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x33792d[_0x292dbd(0x1ff)]+'\x22,\x20cached\x20locally'),{'authPath':_0x207542,'settings':_0x217973,'resolvedEnv':_0x46da20};console['log'](_0x292dbd(0x1cc)+_0x33792d['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),emitSessionValidationHint(_0x4fc736,_0x46da20);}else return{'authPath':_0x207542,'settings':_0x217973,'resolvedEnv':_0x46da20};}console['log'](_0x292dbd(0x1ae)+_0x33792d['name']+'\x22,\x20attempting\x20login...');const _0x2963d4=_0x5408c4[_0x292dbd(0x1ce)](Boolean,process[_0x292dbd(0x1a6)][_0x292dbd(0x1ef)])&&Boolean(process['env'][_0x292dbd(0x1b1)]),_0x3acff7=_0x5408c4[_0x292dbd(0x1ce)](Boolean,_0x33792d[_0x292dbd(0x1fb)]);if(_0x2963d4||_0x3acff7)try{const _0x3e4eb4=await _0x5408c4['DGDkJ'](serverSideLogin,_0x33792d['name']);if(_0x3e4eb4['status']===_0x292dbd(0x1eb))console['log'](_0x5408c4[_0x292dbd(0x1c0)]);else{if(_0x5408c4[_0x292dbd(0x1d1)](_0x3e4eb4[_0x292dbd(0x19c)],'success')&&_0x3e4eb4['session_state']){console['log'](_0x292dbd(0x1dd));const _0x5445ae=await _0x5408c4[_0x292dbd(0x1f4)](writeSessionToLocalCache,_0x33792d[_0x292dbd(0x1ff)],_0x33792d[_0x292dbd(0x1fc)],_0x4fc736,_0x4de620,_0x3e4eb4[_0x292dbd(0x1d5)],_0x79e351,_0x47d357);return _0x2963d4&&!_0x3acff7&&await _0x5408c4['AQcAk'](promptSaveCredentials,_0x33792d[_0x292dbd(0x1ff)]),{'authPath':_0x5445ae,'settings':_0x217973,'resolvedEnv':_0x46da20};}else _0x3e4eb4['test_output']&&(console[_0x292dbd(0x1c5)](_0x5408c4['VSoZY']),console[_0x292dbd(0x1c5)](_0x3e4eb4['test_output'])),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0x28bce9){console[_0x292dbd(0x1c5)](_0x292dbd(0x1a3)+(_0x28bce9 instanceof Error?_0x28bce9['message']:String(_0x28bce9))),console[_0x292dbd(0x1c5)](_0x292dbd(0x1f1));}const {sessionState:_0x4c9027}=await manualBrowserLogin(_0x33792d,_0x46da20),_0x18c0da=await _0x5408c4['bQTDY'](writeSessionToLocalCache,_0x33792d[_0x292dbd(0x1ff)],_0x33792d[_0x292dbd(0x1fc)],_0x4fc736,_0x4de620,_0x4c9027,_0x79e351,_0x47d357);return{'authPath':_0x18c0da,'settings':_0x217973,'resolvedEnv':_0x46da20};}function _0x5358(){const _0x3dff4a=['stringify','/api/v1/profiles','profiles','\x20\x20Login\x20successful.\x20Session\x20cached.','cFXJr',').\x20','cvMPR','UPLBz','gigiM','string','/api/v1/profiles/','userAgent','NfwLF','invalidateOn','92VpveOv','settings','\x22\x20not\x20found.','not_configured','clientIp','cookies','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','RANGER_TEST_USERNAME','Cloud\x20profile\x20\x22','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','raw','qzuBb','BoZsf','):\x20','launch','setupHeaders','12478998zUPLuP','EFrPl','32559rkUSfd','username','organizationId','9721896OnZxFJ','WaUUW','name','EGPNB','zsNFN','tfISX','baseUrl','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','\x20\x20Cached\x20session\x20for\x20\x22','origin','about:blank','5qSIfOd','error','lKgwX','statusText','json','force','16255197OSDvLS','status','ApiError','30594220pzSNfB','/login','auth','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','keys','\x20\x20Server-side\x20login\x20error:\x20','996gqOtpn','JiNrH','env','confirm','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','length','rivgF','environmentKey','oNrsv','YxhWq','\x20\x20No\x20live\x20session\x20for\x20\x22','browserOptions','\x20failed\x20(','RANGER_TEST_PASSWORD','TFAhW','PUT','save','dtubV','password','utf-8','PpcpA','newContext','LcQpo','/session','7386774fkGsZz','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','jCpNG','toISOString','TfvwS','defaultEnvironmentKey','PlLbc','code','QcOUF','log','EfLYv','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','API\x20request\x20','CLLdh','domains','\x20\x20Cloud\x20session\x20for\x20\x22','Browser\x20login\x20timed\x20out\x20before\x20completion.','DGDkJ','kzewl','storageState','TzTYi','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','POST','OzyJA','session_state','IVODL','16581dYszYv','VSYOY','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'];_0x5358=function(){return _0x3dff4a;};return _0x5358();}
1
+ const _0x3a83a9=_0x20a5;(function(_0x53a4ba,_0x4ad983){const _0x1afb52=_0x20a5,_0x3e25b1=_0x53a4ba();while(!![]){try{const _0x42757c=-parseInt(_0x1afb52(0x16e))/0x1+-parseInt(_0x1afb52(0x112))/0x2+parseInt(_0x1afb52(0x164))/0x3*(parseInt(_0x1afb52(0x10e))/0x4)+-parseInt(_0x1afb52(0x157))/0x5+-parseInt(_0x1afb52(0x136))/0x6*(parseInt(_0x1afb52(0xf4))/0x7)+parseInt(_0x1afb52(0x145))/0x8*(parseInt(_0x1afb52(0x12b))/0x9)+parseInt(_0x1afb52(0xf3))/0xa;if(_0x42757c===_0x4ad983)break;else _0x3e25b1['push'](_0x3e25b1['shift']());}catch(_0x4d86f2){_0x3e25b1['push'](_0x3e25b1['shift']());}}}(_0x9e98,0x4305e));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x1ab9dd from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';function _0x9e98(){const _0x434d70=['\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','iyCjJ','/api/v1/profiles/','qZUoV','RANGER_TEST_USERNAME','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','username','DELETE','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','220370xUGxCY','toISOString','organizationId','xoZfk','string','uAyJu','effectiveBaseUrl','detail','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','iOBZO','kVVik','\x20\x20Created\x20cloud\x20profile\x20\x22',').\x20','103227RMYJRZ','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','error','\x20\x20Skipping\x20cloud\x20session\x20for\x20local\x20target\x20\x22','defaultEnvironmentKey','\x22;\x20proceeding\x20with\x20loginInstructions.','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','Bearer\x20','KXJfh','settings','136520NZBqCq','/api/v1/tunnel/sessions/','Cloud\x20profile\x20\x22','aoDIq','name','\x20failed\x20(','cBbvp','trim','IoBPJ','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','code','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','parse','HxARj','rfgOd','persistSessionState','save','8154900OtZflg','124432ZsyxKs','sessionCheckPath','auth','zISbG','\x22.\x0a','wxSPv','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','\x20\x20Server-side\x20login\x20error:\x20','tunnelUrl','json','RhYgW','\x22\x20not\x20found.','CfJFt','newContext','test_output','Jcadb','LNhxZ','FlZnk','Browser\x20login\x20timed\x20out\x20before\x20completion.','statusText','length','/api/v1/profiles','environments','close','log','agent','4bMhKyX','ZeKtM','/session','extraHTTPHeaders','800946jZQJXm','targetUrl','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','target_url','NYrmW','force','\x22\x20for\x20','origin','\x22,\x20refreshing\x20session...','not_configured','KBxUH','sessionId','\x20\x20No\x20live\x20session\x20for\x20\x22','DERsY','auWQO','browserOptions','\x22\x20on\x20profile\x20\x22','Hqnfe','status','setupHeaders','about:blank','KAsxg','session_state','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','userAgent','1625463VNnuRc','zQCOC','map','HkcwG','env','newPage','stringify','jcfKD','keys','pwEndpoint','RANGER_TEST_PASSWORD','120HxMqtO','POST','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ogarm','environmentKey','YyIvs','catch','loginInstructions','qvBpp','gXdDU','mLIGb','cookies','domains','KdPia','storageStatePath','16wWAZYV','YevbW','message','YccEc','tunnel','KcWgb','ztifs','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','baseUrl'];_0x9e98=function(){return _0x434d70;};return _0x9e98();}import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,needsTunnel,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x36f48c=_0x20a5,_0xe66665={'FlZnk':function(_0xe44b11){return _0xe44b11();},'CfJFt':_0x36f48c(0x138)},_0x5bec78=await _0xe66665[_0x36f48c(0x105)](getToken);if(!_0x5bec78)throw new Error(_0xe66665[_0x36f48c(0x100)]);return _0x5bec78;}async function apiRequest(_0x4f49ac,_0x43dd61={}){const _0x4b2347=_0x20a5,_0x3c2942={'KcWgb':function(_0x52c490){return _0x52c490();},'qZUoV':function(_0x318cf9){return _0x318cf9();},'jcfKD':'application/json','HxARj':function(_0x1a9063,_0x254f86){return _0x1a9063===_0x254f86;},'mLIGb':function(_0x2d591b,_0x3e03ae){return _0x2d591b===_0x3e03ae;}},_0x3e7ae9=await _0x3c2942[_0x4b2347(0x14a)](requireToken),_0x4910ff=_0x3c2942[_0x4b2347(0x151)](getApiBaseUrl),_0x3849da=await fetch(''+_0x4910ff+_0x4f49ac,{..._0x43dd61,'headers':{'Authorization':_0x4b2347(0x16b)+_0x3e7ae9,'Content-Type':_0x3c2942[_0x4b2347(0x132)],..._0x43dd61['headers']??{}}});if(!_0x3849da['ok']){let _0x3fe5ba='',_0x4366f4;try{const _0x29a282=await _0x3849da['json']();_0x3fe5ba=(_0x3c2942[_0x4b2347(0xef)](typeof _0x29a282[_0x4b2347(0x166)],'string')?_0x29a282['error']:undefined)??JSON['stringify'](_0x29a282);if(_0x3c2942[_0x4b2347(0x140)](typeof _0x29a282[_0x4b2347(0xec)],'string'))_0x4366f4=_0x29a282['code'];}catch{_0x3fe5ba=_0x3849da[_0x4b2347(0x107)];}throw new ApiError('API\x20request\x20'+_0x4f49ac+_0x4b2347(0x173)+_0x3849da[_0x4b2347(0x124)]+'):\x20'+_0x3fe5ba,_0x3849da['status'],_0x3fe5ba,_0x4366f4);}if(_0x3c2942['HxARj'](_0x3849da[_0x4b2347(0x124)],0xcc))return undefined;return _0x3849da[_0x4b2347(0xfd)]();}export class ApiError extends Error{['status'];[_0x3a83a9(0x15e)];[_0x3a83a9(0xec)];constructor(_0x22bcf7,_0x4f985f,_0x3bb6b1,_0x104038){const _0x3cc73a=_0x3a83a9;super(_0x22bcf7),this['status']=_0x4f985f,this['detail']=_0x3bb6b1,this['code']=_0x104038,this[_0x3cc73a(0x172)]='ApiError';}}export async function fetchCloudProfile(_0x54c843){const _0x5658ab=_0x3a83a9,_0x46b7c1={'yEyyg':function(_0xc57ff7,_0x111e5e){return _0xc57ff7(_0x111e5e);},'auWQO':function(_0x22c783,_0x34575a){return _0x22c783===_0x34575a;}};try{return await apiRequest('/api/v1/profiles/'+_0x46b7c1['yEyyg'](encodeURIComponent,_0x54c843));}catch(_0x3b3f53){if(_0x3b3f53 instanceof ApiError&&_0x46b7c1[_0x5658ab(0x120)](_0x3b3f53['status'],0x194))return null;throw _0x3b3f53;}}export async function listCloudProfiles(){const _0x164e6a=_0x3a83a9,_0x3e41f4=await apiRequest(_0x164e6a(0x109));return _0x3e41f4['profiles'];}export async function deleteCloudProfile(_0x560818){const _0x32590e=_0x3a83a9,_0x2b3b0d={'zmsez':function(_0x43b4e7,_0x55149f,_0x366303){return _0x43b4e7(_0x55149f,_0x366303);},'gaaGL':function(_0x2219fa,_0x238aef){return _0x2219fa===_0x238aef;}};try{await _0x2b3b0d['zmsez'](apiRequest,_0x32590e(0x150)+encodeURIComponent(_0x560818),{'method':_0x32590e(0x155)});}catch(_0x5351b4){if(_0x5351b4 instanceof ApiError&&_0x2b3b0d['gaaGL'](_0x5351b4['status'],0x194))throw new Error(_0x32590e(0x170)+_0x560818+_0x32590e(0xff));throw _0x5351b4;}}export async function createCloudProfile(_0x302484,_0x151dde,_0x5ae8bf={}){const _0x402c73=_0x3a83a9,_0x1f8430={'KorFY':function(_0x3a9400,_0x2cb1c4,_0x276a36){return _0x3a9400(_0x2cb1c4,_0x276a36);},'DpJDq':'/api/v1/profiles'},_0x4b6b72={'name':_0x302484};if(_0x151dde)_0x4b6b72['environment_key']=_0x151dde;_0x5ae8bf[_0x402c73(0x16d)]&&Object['keys'](_0x5ae8bf[_0x402c73(0x16d)])['length']>0x0&&(_0x4b6b72[_0x402c73(0x16d)]=_0x5ae8bf['settings']);if(_0x5ae8bf[_0x402c73(0x154)])_0x4b6b72['username']=_0x5ae8bf[_0x402c73(0x154)];if(_0x5ae8bf['password'])_0x4b6b72['password']=_0x5ae8bf['password'];return await _0x1f8430['KorFY'](apiRequest,_0x1f8430['DpJDq'],{'method':'POST','body':JSON['stringify'](_0x4b6b72)});}export async function uploadCloudProfileSession(_0x3d852f,_0x247e28){const _0x1b1e71=_0x3a83a9,_0x59799b={'zQCOC':function(_0x3fbd13,_0x5d1f2a,_0x492eed){return _0x3fbd13(_0x5d1f2a,_0x492eed);},'lxmrA':'POST'};return await _0x59799b[_0x1b1e71(0x12c)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x3d852f)+_0x1b1e71(0x110),{'method':_0x59799b['lxmrA'],'body':JSON['stringify']({'session_state':_0x247e28})});}export async function saveCloudProfileCredentials(_0x3dbce8,_0x4fbc64,_0x1fc80c){const _0x1593b8={'eRiKo':function(_0x3acfaa,_0x2ca21d){return _0x3acfaa(_0x2ca21d);}};await apiRequest('/api/v1/profiles/'+_0x1593b8['eRiKo'](encodeURIComponent,_0x3dbce8),{'method':'PUT','body':JSON['stringify']({'username':_0x4fbc64,'password':_0x1fc80c})});}function _0x20a5(_0x32c190,_0x27ee43){_0x32c190=_0x32c190-0xec;const _0x9e982=_0x9e98();let _0x20a54a=_0x9e982[_0x32c190];return _0x20a54a;}export async function fetchAuthConfig(){const _0x4ef02e=_0x3a83a9,_0x2953ec={'ztifs':'/api/v1/profiles/auth-config'};try{const _0x20e8a6=await apiRequest(_0x2953ec[_0x4ef02e(0x14b)]);return _0x20e8a6['auth_config'];}catch(_0x175fb3){return _0x175fb3 instanceof ApiError&&_0x175fb3[_0x4ef02e(0x124)]!==0x194&&console[_0x4ef02e(0x166)](_0x4ef02e(0x14c)+_0x175fb3[_0x4ef02e(0x147)]),null;}}async function createTunnelSession(_0x59df70){const _0x5e0072=_0x3a83a9,_0x54afa1={'dpVjA':'/api/v1/tunnel/sessions','dkfoR':'POST'};return await apiRequest(_0x54afa1['dpVjA'],{'method':_0x54afa1['dkfoR'],'body':JSON[_0x5e0072(0x131)]({'targetUrl':_0x59df70,'mode':_0x5e0072(0x10d)})});}async function deleteTunnelSession(_0x2a4ff2){const _0x325d21=_0x3a83a9,_0x1e6101={'rzjSz':function(_0x55865a,_0x43127e,_0xcb536){return _0x55865a(_0x43127e,_0xcb536);}};await _0x1e6101['rzjSz'](apiRequest,_0x325d21(0x16f)+_0x2a4ff2,{'method':'DELETE'});}export function pickAdHocEnvKey(_0x1293f1){const _0xc5aab0=_0x3a83a9,_0x1482b1={'iyCjJ':function(_0xa060d4,_0x5c4ab4){return _0xa060d4===_0x5c4ab4;}};if(!_0x1293f1)return null;if(_0x1293f1[_0xc5aab0(0x168)])return _0x1293f1[_0xc5aab0(0x168)];const _0x5e2047=Object[_0xc5aab0(0x133)](_0x1293f1[_0xc5aab0(0x10a)]??{});if(_0x1482b1[_0xc5aab0(0x14f)](_0x5e2047['length'],0x1))return _0x5e2047[0x0];if(_0x1482b1[_0xc5aab0(0x14f)](_0x5e2047[_0xc5aab0(0x108)],0x0))return null;throw new Error('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0x5e2047['join'](',\x20')+_0xc5aab0(0x163)+'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.');}export async function resolveAdHocProfile(_0x86772b=process[_0x3a83a9(0x12f)]){const _0x327eb0=_0x3a83a9,_0x282cd8={'YccEc':function(_0x4a2a57,_0xfdb744){return _0x4a2a57(_0xfdb744);},'IoBPJ':function(_0x1986cd,_0x9a2a1,_0x586430,_0x55a88c){return _0x1986cd(_0x9a2a1,_0x586430,_0x55a88c);}},_0x2bf704=_0x86772b['RANGER_TEST_USERNAME'];if(!_0x2bf704)return null;const _0x5c7ec0=await fetchCloudProfile(_0x2bf704);if(_0x5c7ec0)return{'name':_0x5c7ec0['name'],'profile':_0x5c7ec0};const _0x305c4c=await fetchAuthConfig(),_0x2cddfe=_0x282cd8[_0x327eb0(0x148)](pickAdHocEnvKey,_0x305c4c),_0x3aec18=_0x86772b[_0x327eb0(0x135)],_0x1faedc=await _0x282cd8[_0x327eb0(0x176)](createCloudProfile,_0x2bf704,_0x2cddfe??undefined,{'username':_0x2bf704,'password':_0x3aec18});return console[_0x327eb0(0x10c)](_0x327eb0(0x162)+_0x1faedc[_0x327eb0(0x172)]+_0x327eb0(0x118)+_0x2bf704),{'name':_0x1faedc[_0x327eb0(0x172)],'profile':_0x1faedc};}export async function writeSessionToLocalCache(_0x1536f6,_0x136ef8,_0x4d4d5b,_0x4f1a30,_0x56c02d,_0x481874,_0x57e82d){const _0x132082=_0x3a83a9,_0x15ff07={'LNhxZ':function(_0x11f36a,_0x2d61e2,_0x45aa7f){return _0x11f36a(_0x2d61e2,_0x45aa7f);},'BHTRQ':function(_0x4f82d8){return _0x4f82d8();},'JeyZE':function(_0x400d51,_0x3c9fa6){return _0x400d51(_0x3c9fa6);},'ZeKtM':function(_0x496f01,_0x4e9860,_0x2d6315){return _0x496f01(_0x4e9860,_0x2d6315);}},_0x417fc5=sessionCacheHash({'orgId':_0x136ef8,'profileName':_0x1536f6,'effectiveBaseUrl':_0x4d4d5b,'setupHeaders':_0x4f1a30,'invalidateOn':_0x57e82d?.['invalidateOn'],'userAgent':_0x57e82d?.[_0x132082(0x12a)],'clientIp':_0x57e82d?.['clientIp']}),_0x85bf5=getSessionCachePath(_0x417fc5,_0x1536f6),_0x4f7047=_0x15ff07['LNhxZ'](join,_0x15ff07['BHTRQ'](getRangerHomeDir),_0x132082(0xf6));!_0x15ff07['JeyZE'](existsSync,_0x4f7047)&&await _0x15ff07[_0x132082(0x10f)](mkdir,_0x4f7047,{'recursive':!![]});const _0xfc6e3d={..._0x56c02d};_0x481874&&_0x481874[_0x132082(0x108)]>0x0&&Array['isArray'](_0xfc6e3d[_0x132082(0x141)])&&(_0xfc6e3d[_0x132082(0x141)]=_0x15ff07[_0x132082(0x104)](duplicateCookiesForDomains,_0xfc6e3d[_0x132082(0x141)],_0x481874));const _0x104b0d={'cached_at':new Date()[_0x132082(0x158)](),'session_state':_0xfc6e3d};await _0x15ff07[_0x132082(0x104)](writeFile,_0x85bf5,JSON[_0x132082(0x131)](_0x104b0d,null,0x2));const _0x18d9ab=getStorageStatePath(_0x85bf5);return await _0x15ff07[_0x132082(0x10f)](writeFile,_0x18d9ab,JSON['stringify'](_0xfc6e3d,null,0x2)),_0x18d9ab;}export async function checkLocalCache(_0x54efcf,_0x59b59b,_0x302ef4,_0x50be82,_0x1083a2){const _0x11189f=_0x3a83a9,_0x2ff981={'zobMI':function(_0x4910e0,_0x33cf25){return _0x4910e0(_0x33cf25);},'uAyJu':function(_0x1fee21,_0x5198bc,_0x3e26fc){return _0x1fee21(_0x5198bc,_0x3e26fc);},'DERsY':function(_0x41b32e,_0x27b110){return _0x41b32e(_0x27b110);},'NYrmW':function(_0x6caad1,_0x8bfc5b,_0x19dae8){return _0x6caad1(_0x8bfc5b,_0x19dae8);},'oqfUd':'utf-8'},_0x5eb281=_0x2ff981['zobMI'](sessionCacheHash,{'orgId':_0x59b59b,'profileName':_0x54efcf,'effectiveBaseUrl':_0x302ef4,'setupHeaders':_0x50be82,'invalidateOn':_0x1083a2?.['invalidateOn'],'userAgent':_0x1083a2?.['userAgent'],'clientIp':_0x1083a2?.['clientIp']}),_0x50c83d=_0x2ff981[_0x11189f(0x15c)](getSessionCachePath,_0x5eb281,_0x54efcf),_0x47b90e=_0x2ff981[_0x11189f(0x11f)](getStorageStatePath,_0x50c83d);if(!existsSync(_0x50c83d)||!existsSync(_0x47b90e))return null;try{const _0x231e00=await _0x2ff981[_0x11189f(0x116)](readFile,_0x50c83d,_0x2ff981['oqfUd']);return JSON[_0x11189f(0xee)](_0x231e00),{'storageStatePath':_0x47b90e};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0xd9a7f3,_0x287431){const _0x7051f2=_0x3a83a9,_0x3dbee0={'yfbAK':function(_0x20fca0,_0x2f6a08){return _0x20fca0+_0x2f6a08;}};if(!_0x287431||!_0x287431[_0x7051f2(0x142)]?.[_0x7051f2(0x108)])return;let _0x3ec4bf;try{_0x3ec4bf=new URL(_0xd9a7f3);}catch{return;}const _0x3ee4b2=[];for(const _0x1bf349 of _0x287431[_0x7051f2(0x142)]){try{_0x3ee4b2['push']({'raw':_0x1bf349,'url':new URL(_0x1bf349)});}catch{}}if(_0x3ee4b2['length']===0x0)return;if(_0x3ee4b2['some'](_0x407cbd=>_0x407cbd['url'][_0x7051f2(0x119)]===_0x3ec4bf['origin']))return;const _0x4c5a7e=_0x3ee4b2[_0x7051f2(0x12d)](_0x4d20c1=>'\x22'+_0x4d20c1['raw']+'\x22')['join'](',\x20');console[_0x7051f2(0x10c)](_0x3dbee0['yfbAK'](_0x7051f2(0x16a)+_0x4c5a7e+';\x20','you\x27re\x20now\x20at\x20\x22'+_0xd9a7f3+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20')+_0x7051f2(0xed));}export async function serverSideLogin(_0x5618c4,_0x59b3c1){const _0x58ef2e=_0x3a83a9,_0x120cdc={'BDojl':function(_0x4671d1,_0x3f15ba,_0x5ecda6){return _0x4671d1(_0x3f15ba,_0x5ecda6);},'ogarm':_0x58ef2e(0x137)},_0x2f3843=process[_0x58ef2e(0x12f)][_0x58ef2e(0x152)],_0x213fc9=process[_0x58ef2e(0x12f)]['RANGER_TEST_PASSWORD'],_0x308500={};if(_0x2f3843)_0x308500[_0x58ef2e(0x154)]=_0x2f3843;if(_0x213fc9)_0x308500['password']=_0x213fc9;if(_0x59b3c1?.[_0x58ef2e(0x117)])_0x308500[_0x58ef2e(0x117)]=!![];if(_0x59b3c1?.[_0x58ef2e(0x113)])_0x308500[_0x58ef2e(0x115)]=_0x59b3c1[_0x58ef2e(0x113)];_0x59b3c1?.[_0x58ef2e(0x149)]&&(_0x308500['tunnel_session_id']=_0x59b3c1['tunnel'][_0x58ef2e(0x11d)],_0x308500['pw_endpoint']=_0x59b3c1[_0x58ef2e(0x149)]['pwEndpoint']);try{return await _0x120cdc['BDojl'](apiRequest,_0x58ef2e(0x150)+encodeURIComponent(_0x5618c4)+'/login',{'method':_0x120cdc[_0x58ef2e(0x139)],'body':JSON[_0x58ef2e(0x131)](_0x308500)});}catch(_0x26d4f1){if(_0x26d4f1 instanceof ApiError&&_0x26d4f1['status']===0x190&&_0x26d4f1[_0x58ef2e(0xec)]===_0x58ef2e(0x11b))return{'status':_0x58ef2e(0x11b),'error':_0x26d4f1['detail']};throw _0x26d4f1;}}async function serverSideLoginWithOptionalTunnel(_0x474ec2,_0x58addf,_0x26e980={}){const _0x489965=_0x3a83a9,_0x4b49b9={'cTpaA':function(_0x3a4f04,_0x3b36ab){return _0x3a4f04(_0x3b36ab);},'HkcwG':function(_0xe67c35){return _0xe67c35();}};if(!needsTunnel(_0x58addf))return await serverSideLogin(_0x474ec2,{'force':_0x26e980['force']});let _0x50e510=null,_0x2863a6=null,_0x882db=null;try{_0x50e510=await _0x4b49b9['cTpaA'](launchBrowserServer,{'headless':!![]}),_0x2863a6=await _0x4b49b9['cTpaA'](createTunnelSession,_0x58addf);const _0x2f783a=await _0x4b49b9[_0x489965(0x12e)](requireToken);return _0x882db=await createTunnelBridge({'localWsUrl':_0x50e510['wsEndpoint'],'tunnelServerUrl':_0x2863a6[_0x489965(0xfc)],'sessionId':_0x2863a6[_0x489965(0x11d)],'apiKey':_0x2f783a}),await serverSideLogin(_0x474ec2,{'force':_0x26e980[_0x489965(0x117)],'targetUrl':_0x58addf,'tunnel':{'sessionId':_0x2863a6['sessionId'],'pwEndpoint':_0x2863a6[_0x489965(0x134)]}});}finally{_0x882db?.['close'](),_0x50e510&&await _0x50e510[_0x489965(0x10b)]()[_0x489965(0x13c)](()=>{}),_0x2863a6&&await _0x4b49b9['cTpaA'](deleteTunnelSession,_0x2863a6[_0x489965(0x11d)])['catch'](()=>{});}}export async function manualBrowserLogin(_0x504fa4,_0x16e337,_0xf4119e={}){const _0x343109=_0x3a83a9,_0x24e8ba={'KBxUH':function(_0x5e288a){return _0x5e288a();},'cBbvp':function(_0x5b9ace,_0x1d09aa,_0x53e4d8){return _0x5b9ace(_0x1d09aa,_0x53e4d8);},'AuLcg':_0x343109(0x10b),'kVVik':function(_0x12b96c,_0x1dbde3){return _0x12b96c+_0x1dbde3;},'UPJoZ':_0x343109(0xfa),'YevbW':_0x343109(0x156),'wxSPv':function(_0x1cfd43,_0x21a055){return _0x1cfd43>_0x21a055;},'KXJfh':_0x343109(0x126),'zISbG':function(_0x295ecd,_0x44c219){return _0x295ecd(_0x44c219);},'rfgOd':function(_0x284893,_0x2eb81d){return _0x284893&&_0x2eb81d;},'hWGmg':_0x343109(0x106),'HZLCt':function(_0x44833e,_0x5a9510,_0x287436){return _0x44833e(_0x5a9510,_0x287436);}};if(!isInteractive())throw new Error(_0x24e8ba['kVVik'](_0x24e8ba[_0x343109(0x161)](_0x343109(0x165)+_0x504fa4[_0x343109(0x172)]+_0x343109(0xf8),_0x24e8ba['UPJoZ']),_0x24e8ba[_0x343109(0x146)]));const _0x31c582=_0x16e337&&_0x24e8ba[_0x343109(0xf9)](_0x16e337[_0x343109(0x142)][_0x343109(0x108)],0x0)?_0x16e337['domains'][0x0]:_0x24e8ba[_0x343109(0x16c)];console[_0x343109(0x10c)]('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console['log'](_0x343109(0x177)),await new Promise(_0x2434ea=>setTimeout(_0x2434ea,0x7d0));const _0x1ae9d2=await chromium['launch']({'headless':![]});let _0x5928b1=null;try{const _0x2611a3={'ignoreHTTPSErrors':!![]};_0x16e337?.[_0x343109(0x125)]&&(_0x2611a3[_0x343109(0x111)]=_0x16e337['setupHeaders']);const _0x216b7d=await _0x1ae9d2[_0x343109(0x101)](_0x2611a3);await _0x24e8ba[_0x343109(0xf7)](addProfileSetupBanner,_0x216b7d);const _0x550c0d=await _0x216b7d[_0x343109(0x130)]();await _0x550c0d['goto'](_0x31c582);let _0x1c7f55=![];await new Promise(_0x6c4e42=>{const _0x2a2539=_0x343109,_0x48f415={'xoZfk':function(_0x26b5f0){const _0x5afefa=_0x20a5;return _0x24e8ba[_0x5afefa(0x11c)](_0x26b5f0);},'aoDIq':function(_0x2498e3){return _0x2498e3();}},_0x2986a1=_0x24e8ba[_0x2a2539(0x174)](setTimeout,()=>{const _0x158e39=_0x2a2539;_0x1c7f55=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+MANUAL_LOGIN_TIMEOUT_MS/0xea60+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x48f415[_0x158e39(0x15a)](_0x6c4e42);},MANUAL_LOGIN_TIMEOUT_MS);_0x550c0d['on'](_0x24e8ba['AuLcg'],async()=>{const _0x310aa9=_0x2a2539;clearTimeout(_0x2986a1);try{const _0x2dcc77=await _0x216b7d['storageState']();_0x5928b1=_0x2dcc77;}catch{}_0x48f415[_0x310aa9(0x171)](_0x6c4e42);});});if(_0x24e8ba[_0x343109(0xf0)](_0x1c7f55,!_0x5928b1))throw new Error(_0x24e8ba['hWGmg']);}finally{await _0x1ae9d2[_0x343109(0x10b)]()[_0x343109(0x13c)](()=>{});}if(!_0x5928b1)throw new Error(_0x343109(0x114));return _0xf4119e[_0x343109(0xf1)]!==![]&&await _0x24e8ba['HZLCt'](apiRequest,_0x343109(0x150)+_0x24e8ba[_0x343109(0xf7)](encodeURIComponent,_0x504fa4['name'])+'/session',{'method':_0x343109(0x137),'body':JSON[_0x343109(0x131)]({'session_state':_0x5928b1,'updated_by':'cli:manual-login'})}),{'sessionState':_0x5928b1};}export async function promptSaveCredentials(_0x378939){const _0x381114=_0x3a83a9,_0xda67d7={'wZGmg':function(_0x169896,_0x487827){return _0x169896||_0x487827;},'XMFDA':function(_0x5e243d,_0x34e92e,_0x42a255){return _0x5e243d(_0x34e92e,_0x42a255);},'RPFrk':function(_0x1a4bb4,_0x2aeaa2){return _0x1a4bb4(_0x2aeaa2);},'gXdDU':'PUT'},_0x1014e7=process[_0x381114(0x12f)]['RANGER_TEST_USERNAME'],_0xa8a385=process[_0x381114(0x12f)][_0x381114(0x135)];if(_0xda67d7['wZGmg'](!_0x1014e7,!_0xa8a385))return;if(!isInteractive())return;const {save:_0xdca2b8}=await _0x1ab9dd['prompt']([{'type':'confirm','name':_0x381114(0xf2),'message':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','default':![]}]);if(!_0xdca2b8)return;await _0xda67d7['XMFDA'](apiRequest,'/api/v1/profiles/'+_0xda67d7['RPFrk'](encodeURIComponent,_0x378939),{'method':_0xda67d7[_0x381114(0x13f)],'body':JSON['stringify']({'username':_0x1014e7,'password':_0xa8a385})}),console['log']('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0x253325,_0x310b04={}){const _0x7422b=_0x3a83a9,_0x5b3818={'oTarT':function(_0x4197cd,_0x51c785,_0x585215){return _0x4197cd(_0x51c785,_0x585215);},'wGLmJ':function(_0x469285,_0xf43982){return _0x469285===_0xf43982;},'YyIvs':function(_0xdc0550,_0x463a7f){return _0xdc0550||_0x463a7f;},'Jcadb':function(_0x1255b5,_0x5ee355){return _0x1255b5(_0x5ee355);},'qvBpp':function(_0x2d7869,_0x327d9a,_0x6f0600,_0x14e96f,_0x4fcb1b){return _0x2d7869(_0x327d9a,_0x6f0600,_0x14e96f,_0x4fcb1b);},'qMgDA':function(_0x5ba10c,_0x4f738c,_0x4d5977,_0x2d5a22,_0x1eba17,_0x515731,_0x465b88,_0x253303){return _0x5ba10c(_0x4f738c,_0x4d5977,_0x2d5a22,_0x1eba17,_0x515731,_0x465b88,_0x253303);},'Hqnfe':function(_0x5e0164,_0x51ff10,_0x345684,_0x2889b9,_0x4db1c0){return _0x5e0164(_0x51ff10,_0x345684,_0x2889b9,_0x4db1c0);},'PgkdG':function(_0xda5a8a,_0x395b38){return _0xda5a8a(_0x395b38);},'YgeEH':function(_0x4d2b69,_0x132dda){return _0x4d2b69(_0x132dda);},'imKPO':function(_0x27ded1,_0x346c78){return _0x27ded1===_0x346c78;},'IMXzH':_0x7422b(0x11b),'RhYgW':'success','iOBZO':'\x20\x20Login\x20successful.\x20Session\x20cached.','KAsxg':function(_0x34cd16,_0x4ccc0f){return _0x34cd16&&_0x4ccc0f;},'dQQmP':function(_0x5888f0,_0x1eb890){return _0x5888f0(_0x1eb890);},'KdPia':function(_0x913d85,_0x3dda7c,_0x3d4ce3,_0x137187){return _0x913d85(_0x3dda7c,_0x3d4ce3,_0x137187);}},_0x29efa4=_0x253325[_0x7422b(0x16d)]??{},_0x3324e4=await fetchAuthConfig(),_0x2e36e1=_0x3324e4?_0x5b3818['oTarT'](resolveAuthEnvironmentLocally,_0x3324e4,_0x253325['environmentKey']):null,_0x18d232=typeof _0x2e36e1?.[_0x7422b(0x13d)]===_0x7422b(0x15b)&&_0x2e36e1['loginInstructions']['trim']()?_0x2e36e1['loginInstructions']:undefined,_0x41af56=_0x5b3818['wGLmJ'](typeof _0x29efa4['loginInstructions'],_0x7422b(0x15b))&&_0x29efa4[_0x7422b(0x13d)]['trim']()?_0x29efa4['loginInstructions']:undefined,_0x4e68b6=_0x5b3818[_0x7422b(0x13b)](_0x41af56,!_0x18d232)?_0x29efa4:{..._0x29efa4,'loginInstructions':_0x18d232},_0x4e0144=Boolean(_0x4e68b6['loginInstructions']?.[_0x7422b(0x175)]()),_0x230c4e=_0x5b3818[_0x7422b(0x103)](Boolean,_0x29efa4['forceLogin']||_0x2e36e1?.['forceLogin']),_0x4f95ec=_0x2e36e1?.['domains'],_0x4d38eb=_0x29efa4[_0x7422b(0x125)],_0x1014fc=_0x4d38eb??_0x2e36e1?.['setupHeaders'],_0x14e9fb=_0x310b04[_0x7422b(0x15d)]??_0x29efa4[_0x7422b(0x14d)]??(_0x4f95ec&&_0x4f95ec['length']>0x0?_0x4f95ec[0x0]:''),_0x286ec2=_0x14e9fb?needsTunnel(_0x14e9fb):![],_0x574d7a={'invalidateOn':_0x2e36e1?.['invalidateOn'],'userAgent':_0x2e36e1?.[_0x7422b(0x121)]?.[_0x7422b(0x12a)]??_0x29efa4[_0x7422b(0x12a)]};_0x230c4e&&console['log']('\x20\x20forceLogin\x20enabled\x20for\x20\x22'+_0x253325[_0x7422b(0x172)]+_0x7422b(0x11a));if(!_0x230c4e){const _0x28334c=await checkLocalCache(_0x253325['name'],_0x253325[_0x7422b(0x159)],_0x14e9fb,_0x1014fc,_0x574d7a);if(_0x28334c){if(_0x14e9fb&&!_0x286ec2){const _0x8ef6ba=await _0x5b3818[_0x7422b(0x13e)](isCachedSessionLive,_0x28334c[_0x7422b(0x144)],_0x14e9fb,{'sessionCheckPath':_0x2e36e1?.[_0x7422b(0xf5)],'setupHeaders':_0x1014fc},{'launchBrowser':launchRealBrowser});if(_0x8ef6ba)return console[_0x7422b(0x10c)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x253325[_0x7422b(0x172)]+'\x22'),{'authPath':_0x28334c[_0x7422b(0x144)],'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};console[_0x7422b(0x10c)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0x253325['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x5b3818['oTarT'](emitSessionValidationHint,_0x14e9fb,_0x2e36e1);}else return _0x286ec2&&console[_0x7422b(0x10c)](_0x7422b(0x129)+_0x253325['name']+'\x22'),{'authPath':_0x28334c['storageStatePath'],'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};}}if(!_0x230c4e&&_0x253325['sessionState']){if(_0x286ec2)console['log'](_0x7422b(0x167)+_0x14e9fb+_0x7422b(0x122)+_0x253325[_0x7422b(0x172)]+'\x22');else{const _0x55126b=await _0x5b3818['qMgDA'](writeSessionToLocalCache,_0x253325[_0x7422b(0x172)],_0x253325[_0x7422b(0x159)],_0x14e9fb,_0x1014fc,_0x253325['sessionState'],_0x4f95ec,_0x574d7a);if(_0x14e9fb){const _0xaa4ce2=await _0x5b3818[_0x7422b(0x123)](isCachedSessionLive,_0x55126b,_0x14e9fb,{'sessionCheckPath':_0x2e36e1?.['sessionCheckPath'],'setupHeaders':_0x1014fc},{'launchBrowser':launchRealBrowser});if(_0xaa4ce2)return console['log'](_0x7422b(0x153)+_0x253325[_0x7422b(0x172)]+'\x22,\x20cached\x20locally'),{'authPath':_0x55126b,'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x253325['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),_0x5b3818['oTarT'](emitSessionValidationHint,_0x14e9fb,_0x2e36e1);}else return{'authPath':_0x55126b,'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};}}if(_0x4e0144)return console[_0x7422b(0x10c)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x253325['name']+_0x7422b(0x169)),{'authPath':undefined,'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};console[_0x7422b(0x10c)](_0x7422b(0x11e)+_0x253325[_0x7422b(0x172)]+'\x22,\x20attempting\x20login...');const _0x2729e8=_0x5b3818['PgkdG'](Boolean,process[_0x7422b(0x12f)]['RANGER_TEST_USERNAME'])&&Boolean(process[_0x7422b(0x12f)][_0x7422b(0x135)]),_0x18f6e3=_0x5b3818['YgeEH'](Boolean,_0x253325['username']);if(_0x2729e8||_0x18f6e3)try{const _0x2483a2=_0x14e9fb?await serverSideLoginWithOptionalTunnel(_0x253325[_0x7422b(0x172)],_0x14e9fb,{'force':_0x230c4e}):await serverSideLogin(_0x253325[_0x7422b(0x172)],{'force':_0x230c4e});if(_0x5b3818['imKPO'](_0x2483a2['status'],_0x5b3818['IMXzH']))console['log'](_0x7422b(0x15f));else{if(_0x2483a2['status']===_0x5b3818[_0x7422b(0xfe)]&&_0x2483a2[_0x7422b(0x128)]){console['log'](_0x5b3818[_0x7422b(0x160)]);const _0x5cca42=await writeSessionToLocalCache(_0x253325['name'],_0x253325[_0x7422b(0x159)],_0x14e9fb,_0x1014fc,_0x2483a2[_0x7422b(0x128)],_0x4f95ec,_0x574d7a);return _0x5b3818[_0x7422b(0x127)](_0x2729e8,!_0x18f6e3)&&await promptSaveCredentials(_0x253325['name']),{'authPath':_0x5cca42,'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};}else _0x2483a2[_0x7422b(0x102)]&&(console[_0x7422b(0x10c)]('\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:'),console[_0x7422b(0x10c)](_0x2483a2['test_output'])),console['log'](_0x7422b(0x14e));}}catch(_0x16f7a5){console[_0x7422b(0x10c)](_0x7422b(0xfb)+(_0x16f7a5 instanceof Error?_0x16f7a5[_0x7422b(0x147)]:_0x5b3818['dQQmP'](String,_0x16f7a5))),console[_0x7422b(0x10c)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const _0x466500=_0x2e36e1?{..._0x2e36e1,'setupHeaders':_0x1014fc}:_0x14e9fb?{'key':_0x253325[_0x7422b(0x13a)]??'','domains':[_0x14e9fb],'setupHeaders':_0x1014fc}:null,{sessionState:_0x767afd}=await _0x5b3818[_0x7422b(0x143)](manualBrowserLogin,_0x253325,_0x466500,{'persistSessionState':!_0x286ec2}),_0x5b7198=await writeSessionToLocalCache(_0x253325[_0x7422b(0x172)],_0x253325[_0x7422b(0x159)],_0x14e9fb,_0x1014fc,_0x767afd,_0x4f95ec,_0x574d7a);return{'authPath':_0x5b7198,'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};}
@@ -1 +1 @@
1
- const _0x4f0da8=_0x5be4;(function(_0x4659b8,_0x7acac){const _0x1e221c=_0x5be4,_0x2615b6=_0x4659b8();while(!![]){try{const _0x3bce52=-parseInt(_0x1e221c(0x143))/0x1*(-parseInt(_0x1e221c(0x138))/0x2)+-parseInt(_0x1e221c(0x146))/0x3+-parseInt(_0x1e221c(0x12e))/0x4*(parseInt(_0x1e221c(0x123))/0x5)+-parseInt(_0x1e221c(0x130))/0x6*(parseInt(_0x1e221c(0x114))/0x7)+-parseInt(_0x1e221c(0x11e))/0x8+-parseInt(_0x1e221c(0x127))/0x9*(parseInt(_0x1e221c(0x12d))/0xa)+parseInt(_0x1e221c(0x117))/0xb;if(_0x3bce52===_0x7acac)break;else _0x2615b6['push'](_0x2615b6['shift']());}catch(_0x367417){_0x2615b6['push'](_0x2615b6['shift']());}}}(_0x1d0c,0x19aad));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x151dce=process['env'],_0x4d6fc0={'stdin':process[_0x4f0da8(0x12c)],'stdout':process[_0x4f0da8(0x116)]}){const _0x5822e8=_0x4f0da8,_0x1c83c4={'UrfdM':function(_0x4347da,_0x2c3386){return _0x4347da(_0x2c3386);}};if(_0x151dce['CI'])return![];return _0x1c83c4['UrfdM'](Boolean,_0x4d6fc0['stdin'][_0x5822e8(0x11d)])&&Boolean(_0x4d6fc0[_0x5822e8(0x116)][_0x5822e8(0x11d)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x59280e){const _0x16b33f=_0x4f0da8,_0x52a123={'AoJDm':_0x16b33f(0x11b),'YvLbw':'userAgent','NFwnY':function(_0x194922,_0x1619b7){return _0x194922!==_0x1619b7;},'yvSBP':'clientIp','PWjOU':'hex'},_0x4d42b1=new Set(_0x59280e[_0x16b33f(0x136)]??DEFAULT_INVALIDATE_ON),_0x1d8297={'orgId':_0x59280e[_0x16b33f(0x142)],'profileName':_0x59280e[_0x16b33f(0x145)]};return _0x4d42b1[_0x16b33f(0x11f)]('baseUrl')&&(_0x1d8297[_0x16b33f(0x113)]=_0x59280e['effectiveBaseUrl']),_0x4d42b1[_0x16b33f(0x11f)](_0x16b33f(0x11c))&&(_0x1d8297['setupHeaders']=_0x59280e['setupHeaders']?sortObjectKeys(_0x59280e[_0x16b33f(0x11c)]):_0x59280e['setupHeaders']),_0x4d42b1[_0x16b33f(0x11f)](_0x52a123['AoJDm'])&&(_0x1d8297[_0x16b33f(0x11b)]=extractPort(_0x59280e[_0x16b33f(0x113)])),_0x4d42b1['has'](_0x52a123[_0x16b33f(0x13b)])&&_0x52a123['NFwnY'](_0x59280e[_0x16b33f(0x13f)],undefined)&&(_0x1d8297['userAgent']=_0x59280e['userAgent']),_0x4d42b1[_0x16b33f(0x11f)](_0x52a123[_0x16b33f(0x126)])&&_0x59280e['clientIp']!==undefined&&(_0x1d8297['clientIp']=_0x59280e[_0x16b33f(0x12a)]),createHash(_0x16b33f(0x131))['update'](JSON[_0x16b33f(0x13e)](_0x1d8297))[_0x16b33f(0x12b)](_0x52a123['PWjOU'])['slice'](0x0,0xc);}function extractPort(_0x471036){const _0x328fdd=_0x4f0da8;try{return new URL(_0x471036)[_0x328fdd(0x11b)];}catch{return'';}}function sortObjectKeys(_0x459be0){const _0x57946e=_0x4f0da8,_0x1b5a89={};for(const _0x42a483 of Object[_0x57946e(0x137)](_0x459be0)['sort']()){_0x1b5a89[_0x42a483]=_0x459be0[_0x42a483];}return _0x1b5a89;}export function getSessionCachePath(_0x469a5a,_0x5367b3){const _0x5a52a4=_0x4f0da8,_0x593992={'NddDT':function(_0x1eca68,_0x394bb2,_0xdeef44,_0xc84462){return _0x1eca68(_0x394bb2,_0xdeef44,_0xc84462);},'ZgGMc':_0x5a52a4(0x132)};return _0x593992['NddDT'](join,getRangerHomeDir(),_0x593992[_0x5a52a4(0x13c)],_0x469a5a+'-'+_0x5367b3+'.json');}export function getStorageStatePath(_0x2567f7){const _0x367c70=_0x4f0da8,_0x3fbf33={'DJwkL':'.storageState.json'};return _0x2567f7[_0x367c70(0x134)](/\.json$/,_0x3fbf33[_0x367c70(0x12f)]);}export function needsTunnel(_0x56edd7){const _0x5472af=_0x4f0da8,_0x509a4a={'qUBKi':function(_0x41bfdc,_0x51966c){return _0x41bfdc===_0x51966c;},'koUwV':_0x5472af(0x119)};let _0x21e3fa;try{_0x21e3fa=new URL(_0x56edd7)[_0x5472af(0x141)];}catch{return![];}if(_0x21e3fa==='localhost'||_0x509a4a['qUBKi'](_0x21e3fa,'127.0.0.1'))return!![];if(_0x21e3fa['endsWith']('.localhost'))return!![];if(_0x21e3fa[_0x5472af(0x129)](_0x509a4a[_0x5472af(0x115)]))return!![];return![];}export function hostnameOf(_0x15aec7){const _0x556a3b=_0x4f0da8;return new URL(_0x15aec7)[_0x556a3b(0x141)];}export function duplicateCookiesForDomains(_0x137ed4,_0x17e2af){const _0x372e1f=_0x4f0da8,_0x3d0932=[..._0x137ed4],_0x35476a=new Set(_0x137ed4['map'](_0x1f0b37=>_0x1f0b37['domain']));for(const _0x35cbe0 of _0x17e2af){let _0x1138e3;try{_0x1138e3=hostnameOf(_0x35cbe0);}catch{continue;}if(!_0x1138e3)continue;const _0x20c313=_0x1138e3['startsWith']('.')?_0x1138e3:'.'+_0x1138e3;if(_0x35476a[_0x372e1f(0x11f)](_0x1138e3)||_0x35476a[_0x372e1f(0x11f)](_0x20c313))continue;for(const _0x31171e of _0x137ed4){_0x3d0932[_0x372e1f(0x125)]({..._0x31171e,'domain':_0x20c313});}_0x35476a[_0x372e1f(0x144)](_0x20c313);}return _0x3d0932;}export function resolveAuthEnvironmentLocally(_0x2b671e,_0x44c765){const _0x4ef99c=_0x4f0da8,_0x3d6e48={'qNlsr':function(_0x51918d,_0x3e7e09){return _0x51918d===_0x3e7e09;}},_0x131952=_0x2b671e['environments'];if(_0x44c765){const _0x270909=_0x131952[_0x44c765];if(!_0x270909)return null;return{'key':_0x44c765,..._0x270909};}if(_0x2b671e[_0x4ef99c(0x13d)]){const _0x33ed2a=_0x131952[_0x2b671e[_0x4ef99c(0x13d)]];if(!_0x33ed2a)return null;return{'key':_0x2b671e[_0x4ef99c(0x13d)],..._0x33ed2a};}const _0x4bda91=Object[_0x4ef99c(0x137)](_0x131952);if(_0x3d6e48[_0x4ef99c(0x122)](_0x4bda91[_0x4ef99c(0x11a)],0x1)){const _0x4a3a47=_0x4bda91[0x0];return{'key':_0x4a3a47,..._0x131952[_0x4a3a47]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x1e0b11,_0x2cbf8a){const _0x444b5f=_0x4f0da8;try{if(_0x2cbf8a)return new URL(_0x2cbf8a,_0x1e0b11)['toString']();return new URL(_0x1e0b11)[_0x444b5f(0x118)]();}catch{return null;}}function _0x5be4(_0x1c25c7,_0x3d6b9){_0x1c25c7=_0x1c25c7-0x113;const _0x1d0c63=_0x1d0c();let _0x5be4eb=_0x1d0c63[_0x1c25c7];return _0x5be4eb;}function _0x1d0c(){const _0x16dc90=['userAgent','LVewr','hostname','orgId','2BeOIrf','add','profileName','58113HqlInk','effectiveBaseUrl','722617ZvoYSg','koUwV','stdout','8398181tukvoD','toString','localhost.','length','port','setupHeaders','isTTY','1375232kSZtHW','has','close','pathname','qNlsr','5QLQCql','newPage','push','yvSBP','5499VgIeTm','url','includes','clientIp','digest','stdin','3220zZOlBl','805936QRorpI','DJwkL','6wrGHdt','sha256','auth','catch','replace','launchBrowser','invalidateOn','keys','34394rEkFTr','status','test','YvLbw','ZgGMc','defaultEnvironmentKey','stringify'];_0x1d0c=function(){return _0x16dc90;};return _0x1d0c();}export function looksLikeLoginUrl(_0x3cb22b){const _0x1cc219=_0x4f0da8;try{const _0x16a4a8=new URL(_0x3cb22b);return LOGIN_URL_PATTERN[_0x1cc219(0x13a)](_0x16a4a8[_0x1cc219(0x121)]);}catch{return LOGIN_URL_PATTERN[_0x1cc219(0x13a)](_0x3cb22b);}}export async function isCachedSessionLive(_0x2ad26c,_0x334a65,_0x565072={},_0x41b8e5={}){const _0x361c71=_0x4f0da8,_0x362680={'LVewr':function(_0x5c67d8,_0x1138a3,_0x2b635e){return _0x5c67d8(_0x1138a3,_0x2b635e);},'ZFWKA':function(_0x11f15e,_0xcab1ab){return _0x11f15e===_0xcab1ab;}},_0x17d2c4=_0x362680[_0x361c71(0x140)](buildSessionCheckUrl,_0x334a65,_0x565072['sessionCheckPath']);if(!_0x17d2c4)return!![];if(!_0x41b8e5[_0x361c71(0x135)])return!![];let _0x4cd9cc=null;try{_0x4cd9cc=await _0x41b8e5['launchBrowser']();const _0x167492=await _0x4cd9cc['newContext']({'storageState':_0x2ad26c,'ignoreHTTPSErrors':!![],..._0x565072[_0x361c71(0x11c)]?{'extraHTTPHeaders':_0x565072['setupHeaders']}:{}}),_0xad71c=await _0x167492[_0x361c71(0x124)](),_0x1e051a=await _0xad71c['goto'](_0x17d2c4,{'waitUntil':'domcontentloaded','timeout':0x3a98}),_0x2e0f2f=_0x1e051a?.[_0x361c71(0x139)]();if(_0x362680['ZFWKA'](_0x2e0f2f,0x191)||_0x2e0f2f===0x193)return![];const _0x42f07c=_0xad71c[_0x361c71(0x128)]();if(looksLikeLoginUrl(_0x42f07c))return![];return!![];}catch{return![];}finally{if(_0x4cd9cc)await _0x4cd9cc[_0x361c71(0x120)]()[_0x361c71(0x133)](()=>{});}}
1
+ const _0x482b7c=_0x2bfe;(function(_0x3d21de,_0x22e1c2){const _0x55cca0=_0x2bfe,_0x5bbd20=_0x3d21de();while(!![]){try{const _0x284d86=-parseInt(_0x55cca0(0x1ee))/0x1*(parseInt(_0x55cca0(0x1ef))/0x2)+-parseInt(_0x55cca0(0x210))/0x3+-parseInt(_0x55cca0(0x21c))/0x4+parseInt(_0x55cca0(0x218))/0x5+-parseInt(_0x55cca0(0x1f7))/0x6+parseInt(_0x55cca0(0x211))/0x7*(parseInt(_0x55cca0(0x201))/0x8)+parseInt(_0x55cca0(0x21b))/0x9;if(_0x284d86===_0x22e1c2)break;else _0x5bbd20['push'](_0x5bbd20['shift']());}catch(_0x24fd3f){_0x5bbd20['push'](_0x5bbd20['shift']());}}}(_0x21b2,0x75f31));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x4292dc=process[_0x482b7c(0x1f4)],_0x360b5={'stdin':process[_0x482b7c(0x209)],'stdout':process[_0x482b7c(0x20b)]}){const _0x2506a5=_0x482b7c,_0x1712cd={'cBSVM':function(_0x21e5e7,_0x4a6506){return _0x21e5e7(_0x4a6506);}};if(_0x4292dc['CI'])return![];return Boolean(_0x360b5['stdin']['isTTY'])&&_0x1712cd[_0x2506a5(0x1f6)](Boolean,_0x360b5[_0x2506a5(0x20b)][_0x2506a5(0x213)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x365cdb){const _0x1e043f=_0x482b7c,_0x24d16b={'sypbt':'baseUrl','UgxAC':function(_0x526fce,_0x5a0f77){return _0x526fce(_0x5a0f77);},'XaCze':_0x1e043f(0x214),'ZpOXD':function(_0x455323,_0x681bc4){return _0x455323!==_0x681bc4;},'WESPQ':'clientIp','Tnbhy':'hex'},_0xcd6b9a=new Set(_0x365cdb['invalidateOn']??DEFAULT_INVALIDATE_ON),_0x48df23={'orgId':_0x365cdb['orgId'],'profileName':_0x365cdb['profileName']};return _0xcd6b9a['has'](_0x24d16b['sypbt'])&&(_0x48df23['effectiveBaseUrl']=_0x365cdb['effectiveBaseUrl']),_0xcd6b9a['has'](_0x1e043f(0x1f5))&&(_0x48df23['setupHeaders']=_0x365cdb[_0x1e043f(0x1f5)]?_0x24d16b[_0x1e043f(0x1f9)](sortObjectKeys,_0x365cdb['setupHeaders']):_0x365cdb[_0x1e043f(0x1f5)]),_0xcd6b9a['has'](_0x24d16b[_0x1e043f(0x219)])&&(_0x48df23[_0x1e043f(0x214)]=extractPort(_0x365cdb[_0x1e043f(0x1fd)])),_0xcd6b9a[_0x1e043f(0x21d)](_0x1e043f(0x215))&&_0x24d16b[_0x1e043f(0x1ec)](_0x365cdb[_0x1e043f(0x215)],undefined)&&(_0x48df23[_0x1e043f(0x215)]=_0x365cdb[_0x1e043f(0x215)]),_0xcd6b9a['has'](_0x24d16b['WESPQ'])&&_0x24d16b[_0x1e043f(0x1ec)](_0x365cdb['clientIp'],undefined)&&(_0x48df23['clientIp']=_0x365cdb[_0x1e043f(0x1fb)]),createHash('sha256')[_0x1e043f(0x204)](JSON[_0x1e043f(0x207)](_0x48df23))[_0x1e043f(0x212)](_0x24d16b['Tnbhy'])['slice'](0x0,0xc);}function extractPort(_0x22e3b9){try{return new URL(_0x22e3b9)['port'];}catch{return'';}}function sortObjectKeys(_0x2c1edc){const _0x4f3eb9={};for(const _0x5a5053 of Object['keys'](_0x2c1edc)['sort']()){_0x4f3eb9[_0x5a5053]=_0x2c1edc[_0x5a5053];}return _0x4f3eb9;}export function getSessionCachePath(_0x49c6b7,_0x544b94){const _0xa4b94e=_0x482b7c,_0x302c3b={'qnvdZ':function(_0x2d7d39,_0x37d8ca,_0x3dc40d,_0x983fff){return _0x2d7d39(_0x37d8ca,_0x3dc40d,_0x983fff);},'CFuZA':function(_0x2dedf4){return _0x2dedf4();},'LBnlG':_0xa4b94e(0x208)};return _0x302c3b[_0xa4b94e(0x1ed)](join,_0x302c3b['CFuZA'](getRangerHomeDir),_0x302c3b[_0xa4b94e(0x203)],_0x49c6b7+'-'+_0x544b94+_0xa4b94e(0x1fc));}export function getStorageStatePath(_0x1be6aa){const _0x1288cf=_0x482b7c,_0x453630={'pTQhQ':'.storageState.json'};return _0x1be6aa[_0x1288cf(0x217)](/\.json$/,_0x453630['pTQhQ']);}export function needsTunnel(_0x5c4b18){const _0x3fe812=_0x482b7c,_0x1aef22={'MGoyh':function(_0x7d84f2,_0x371b9b){return _0x7d84f2===_0x371b9b;},'EIsHT':_0x3fe812(0x206),'KwUst':_0x3fe812(0x1f8),'ADayu':'localhost.'};let _0x701d2f;try{_0x701d2f=new URL(_0x5c4b18)['hostname'];}catch{return![];}if(_0x1aef22['MGoyh'](_0x701d2f,_0x1aef22['EIsHT'])||_0x1aef22[_0x3fe812(0x1fe)](_0x701d2f,_0x3fe812(0x20a)))return!![];if(_0x701d2f['endsWith'](_0x1aef22[_0x3fe812(0x1ff)]))return!![];if(_0x701d2f['includes'](_0x1aef22['ADayu']))return!![];return![];}export function hostnameOf(_0x5a9b63){return new URL(_0x5a9b63)['hostname'];}export function duplicateCookiesForDomains(_0x2fd381,_0x554a5d){const _0x309915=_0x482b7c,_0x15d683=[..._0x2fd381],_0xac20b=new Set(_0x2fd381[_0x309915(0x1f0)](_0xf8267d=>_0xf8267d['domain']));for(const _0x15b602 of _0x554a5d){let _0xfc78d;try{_0xfc78d=hostnameOf(_0x15b602);}catch{continue;}if(!_0xfc78d)continue;const _0xe0aa93=_0xfc78d[_0x309915(0x20e)]('.')?_0xfc78d:'.'+_0xfc78d;if(_0xac20b['has'](_0xfc78d)||_0xac20b['has'](_0xe0aa93))continue;for(const _0x888a30 of _0x2fd381){_0x15d683['push']({..._0x888a30,'domain':_0xe0aa93});}_0xac20b['add'](_0xe0aa93);}return _0x15d683;}export function resolveAuthEnvironmentLocally(_0x5406af,_0x5df35d){const _0x497449=_0x482b7c,_0x16b4f1=_0x5406af['environments'];if(_0x5df35d){const _0x40d6fd=_0x16b4f1[_0x5df35d];if(!_0x40d6fd)return null;return{'key':_0x5df35d,..._0x40d6fd};}if(_0x5406af[_0x497449(0x1f1)]){const _0x384e26=_0x16b4f1[_0x5406af[_0x497449(0x1f1)]];if(!_0x384e26)return null;return{'key':_0x5406af[_0x497449(0x1f1)],..._0x384e26};}const _0x334cfd=Object['keys'](_0x16b4f1);if(_0x334cfd[_0x497449(0x202)]===0x1){const _0xa05f57=_0x334cfd[0x0];return{'key':_0xa05f57,..._0x16b4f1[_0xa05f57]};}return null;}function _0x21b2(){const _0x29fafa=['KwUst','catch','280ZEBklZ','length','LBnlG','update','toString','localhost','stringify','auth','stdin','127.0.0.1','stdout','sessionCheckPath','pathname','startsWith','yhkUo','1678404YaUfFx','134792EaUBQv','digest','isTTY','port','userAgent','url','replace','1752545JuccpN','XaCze','test','14786721MceMiG','1070684QdoCXp','has','ZpOXD','qnvdZ','12422PFsOoM','94KbMLQL','map','defaultEnvironmentKey','domcontentloaded','launchBrowser','env','setupHeaders','cBSVM','4640064sHYyrL','.localhost','UgxAC','newPage','clientIp','.json','effectiveBaseUrl','MGoyh'];_0x21b2=function(){return _0x29fafa;};return _0x21b2();}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x4d1f6f,_0x266ce9){const _0x3adaf8=_0x482b7c;try{if(_0x266ce9)return new URL(_0x266ce9,_0x4d1f6f)[_0x3adaf8(0x205)]();return new URL(_0x4d1f6f)['toString']();}catch{return null;}}function _0x2bfe(_0x23460d,_0x3b80ed){_0x23460d=_0x23460d-0x1ec;const _0x21b24d=_0x21b2();let _0x2bfe9a=_0x21b24d[_0x23460d];return _0x2bfe9a;}export function looksLikeLoginUrl(_0x2acdd0){const _0xa67e12=_0x482b7c;try{const _0x1079c3=new URL(_0x2acdd0);return LOGIN_URL_PATTERN['test'](_0x1079c3[_0xa67e12(0x20d)]);}catch{return LOGIN_URL_PATTERN[_0xa67e12(0x21a)](_0x2acdd0);}}export async function isCachedSessionLive(_0x9ff98a,_0x6cd4b0,_0x1d1835={},_0x24effb={}){const _0x19aca4=_0x482b7c,_0x328a8a={'jmEvD':function(_0x32ae42,_0x563335,_0x2723d2){return _0x32ae42(_0x563335,_0x2723d2);},'yhkUo':function(_0x46d445,_0x3e886e){return _0x46d445(_0x3e886e);}},_0x4a4d14=_0x328a8a['jmEvD'](buildSessionCheckUrl,_0x6cd4b0,_0x1d1835[_0x19aca4(0x20c)]);if(!_0x4a4d14)return!![];if(!_0x24effb['launchBrowser'])return!![];let _0x186d7a=null;try{_0x186d7a=await _0x24effb[_0x19aca4(0x1f3)]();const _0x30d092=await _0x186d7a['newContext']({'storageState':_0x9ff98a,'ignoreHTTPSErrors':!![],..._0x1d1835['setupHeaders']?{'extraHTTPHeaders':_0x1d1835[_0x19aca4(0x1f5)]}:{}}),_0x555715=await _0x30d092[_0x19aca4(0x1fa)](),_0x158dc6=await _0x555715['goto'](_0x4a4d14,{'waitUntil':_0x19aca4(0x1f2),'timeout':0x3a98}),_0x233e7b=_0x158dc6?.['status']();if(_0x233e7b===0x191||_0x233e7b===0x193)return![];const _0x28f362=_0x555715[_0x19aca4(0x216)]();if(_0x328a8a[_0x19aca4(0x20f)](looksLikeLoginUrl,_0x28f362))return![];return!![];}catch{return![];}finally{if(_0x186d7a)await _0x186d7a['close']()[_0x19aca4(0x200)](()=>{});}}
@@ -1 +1 @@
1
- (function(_0x2c6306,_0x1e1db3){const _0x3da927=_0x19f5,_0x417d6=_0x2c6306();while(!![]){try{const _0x28413d=parseInt(_0x3da927(0xcf))/0x1*(parseInt(_0x3da927(0xd9))/0x2)+-parseInt(_0x3da927(0xc8))/0x3*(-parseInt(_0x3da927(0xc5))/0x4)+parseInt(_0x3da927(0xcc))/0x5*(parseInt(_0x3da927(0xc9))/0x6)+parseInt(_0x3da927(0xd5))/0x7*(-parseInt(_0x3da927(0xd3))/0x8)+parseInt(_0x3da927(0xcb))/0x9+parseInt(_0x3da927(0xd8))/0xa+-parseInt(_0x3da927(0xd7))/0xb;if(_0x28413d===_0x1e1db3)break;else _0x417d6['push'](_0x417d6['shift']());}catch(_0x16247a){_0x417d6['push'](_0x417d6['shift']());}}}(_0x32d1,0xe8fda));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(_0x2473ac){const _0x45b998=_0x19f5,_0x1ccb84={'Anvmq':function(_0x13a8f1,_0x29524e,_0x296ac0,_0x36dd9a,_0xf16f9b,_0xff6c78){return _0x13a8f1(_0x29524e,_0x296ac0,_0x36dd9a,_0xf16f9b,_0xff6c78);},'JoyfN':'sha256'};return _0x1ccb84[_0x45b998(0xd0)](pbkdf2Sync,_0x2473ac,SALT,0x186a0,KEY_LENGTH,_0x1ccb84[_0x45b998(0xc6)]);}function _0x19f5(_0x3466b1,_0x3cbc96){_0x3466b1=_0x3466b1-0xc4;const _0x32d170=_0x32d1();let _0x19f539=_0x32d170[_0x3466b1];return _0x19f539;}export function encrypt(_0xd1cb54,_0x27ba89){const _0x5342d3=_0x19f5,_0x1d412b={'faVGm':function(_0xedbdfa,_0x48fca5){return _0xedbdfa(_0x48fca5);}},_0x461e78=deriveKey(_0x27ba89),_0x93f5a8=_0x1d412b[_0x5342d3(0xce)](randomBytes,IV_LENGTH),_0xa07f62=createCipheriv(ALGORITHM,_0x461e78,_0x93f5a8),_0x69d3dd=Buffer['concat']([_0xa07f62['update'](_0xd1cb54,_0x5342d3(0xc7)),_0xa07f62[_0x5342d3(0xd2)]()]),_0x2850f6=_0xa07f62[_0x5342d3(0xca)]();return Buffer['concat']([_0x93f5a8,_0x2850f6,_0x69d3dd]);}function _0x32d1(){const _0x30d7c7=['3932mPJXmu','JoyfN','utf8','4704RflOSC','2082ViHeRt','getAuthTag','6199200IzuGHf','22150wWhDFX','mVLXi','faVGm','1127654eRKnQF','Anvmq','oPOuJ','final','536dGOTjp','setAuthTag','99953mhFGwR','subarray','36123769KqZAEm','2999940OLabTj','2GafzuV','ZfWKJ','zsEnl'];_0x32d1=function(){return _0x30d7c7;};return _0x32d1();}export function decrypt(_0x27687b,_0x451725){const _0x4b869f=_0x19f5,_0x47f3ad={'zsEnl':function(_0x2f2058,_0x3ef902){return _0x2f2058(_0x3ef902);},'mVLXi':function(_0x4fc1ab,_0x356037){return _0x4fc1ab+_0x356037;},'oPOuJ':function(_0x256910,_0x799867,_0x5dbc83,_0xbce26b){return _0x256910(_0x799867,_0x5dbc83,_0xbce26b);},'ShtMp':function(_0x2f2cbc,_0x3718a9){return _0x2f2cbc+_0x3718a9;},'ZfWKJ':'utf8'},_0x2d3a16=_0x47f3ad[_0x4b869f(0xc4)](deriveKey,_0x451725),_0x58769d=_0x27687b[_0x4b869f(0xd6)](0x0,IV_LENGTH),_0x48aa23=_0x27687b['subarray'](IV_LENGTH,_0x47f3ad[_0x4b869f(0xcd)](IV_LENGTH,TAG_LENGTH)),_0x37a67b=_0x27687b['subarray'](IV_LENGTH+TAG_LENGTH),_0x352158=_0x47f3ad[_0x4b869f(0xd1)](createDecipheriv,ALGORITHM,_0x2d3a16,_0x58769d);return _0x352158[_0x4b869f(0xd4)](_0x48aa23),_0x47f3ad['ShtMp'](_0x352158['update'](_0x37a67b),_0x352158['final'](_0x47f3ad[_0x4b869f(0xda)]));}
1
+ (function(_0x4cddd7,_0x2e842d){const _0x5ccd4b=_0xdf53,_0x4714eb=_0x4cddd7();while(!![]){try{const _0x10dbce=-parseInt(_0x5ccd4b(0x14c))/0x1*(-parseInt(_0x5ccd4b(0x158))/0x2)+parseInt(_0x5ccd4b(0x15a))/0x3+parseInt(_0x5ccd4b(0x149))/0x4*(-parseInt(_0x5ccd4b(0x147))/0x5)+parseInt(_0x5ccd4b(0x155))/0x6*(-parseInt(_0x5ccd4b(0x14a))/0x7)+-parseInt(_0x5ccd4b(0x154))/0x8+-parseInt(_0x5ccd4b(0x151))/0x9*(parseInt(_0x5ccd4b(0x153))/0xa)+parseInt(_0x5ccd4b(0x156))/0xb*(parseInt(_0x5ccd4b(0x14e))/0xc);if(_0x10dbce===_0x2e842d)break;else _0x4714eb['push'](_0x4714eb['shift']());}catch(_0xa8de94){_0x4714eb['push'](_0x4714eb['shift']());}}}(_0x3c42,0x565c8));function _0x3c42(){const _0x277a3c=['585arYgnq','dQWev','56790YDfEzF','1732608hxzsrm','2766OmVZVb','1263647ALcutY','aVdvq','4098XFCTfu','sha256','1799673SceVLU','HJFSw','GKgWL','582305iUXBsW','subarray','4GfUyIT','9422YCzRAU','oyMpi','189uJeKZt','DxgPK','72zEnzdp','vKOPx','final'];_0x3c42=function(){return _0x277a3c;};return _0x3c42();}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0xdf53(_0x298341,_0x138850){_0x298341=_0x298341-0x147;const _0x3c42d3=_0x3c42();let _0xdf532=_0x3c42d3[_0x298341];return _0xdf532;}export function deriveKey(_0x23b9b0){const _0x159b22=_0xdf53,_0x27d81f={'yOKBm':function(_0x303ffe,_0x13c0c2,_0x368d68,_0x4e4cf8,_0xa46419,_0x3c7e98){return _0x303ffe(_0x13c0c2,_0x368d68,_0x4e4cf8,_0xa46419,_0x3c7e98);}};return _0x27d81f['yOKBm'](pbkdf2Sync,_0x23b9b0,SALT,0x186a0,KEY_LENGTH,_0x159b22(0x159));}export function encrypt(_0x4323b5,_0x50edf4){const _0x9ee2d7=_0xdf53,_0xb071e={'aVdvq':function(_0x2dd94c,_0x1fdad7){return _0x2dd94c(_0x1fdad7);},'DxgPK':function(_0x35e730,_0x469967,_0x3e0c3a,_0x277016){return _0x35e730(_0x469967,_0x3e0c3a,_0x277016);},'dQWev':'utf8'},_0x373c0c=_0xb071e[_0x9ee2d7(0x157)](deriveKey,_0x50edf4),_0x336776=randomBytes(IV_LENGTH),_0x3a49ee=_0xb071e[_0x9ee2d7(0x14d)](createCipheriv,ALGORITHM,_0x373c0c,_0x336776),_0x594f38=Buffer['concat']([_0x3a49ee['update'](_0x4323b5,_0xb071e[_0x9ee2d7(0x152)]),_0x3a49ee[_0x9ee2d7(0x150)]()]),_0x138f45=_0x3a49ee['getAuthTag']();return Buffer['concat']([_0x336776,_0x138f45,_0x594f38]);}export function decrypt(_0x459b90,_0x31c627){const _0x2c4d46=_0xdf53,_0x5394c7={'GKgWL':function(_0x306622,_0x26d9a4){return _0x306622(_0x26d9a4);},'HJFSw':function(_0x54e984,_0x47f43c){return _0x54e984+_0x47f43c;},'vKOPx':function(_0x40f157,_0x5751ab,_0x1a84c1,_0x58cf79){return _0x40f157(_0x5751ab,_0x1a84c1,_0x58cf79);},'oyMpi':function(_0x419e17,_0xef86ab){return _0x419e17+_0xef86ab;},'zdvwI':'utf8'},_0x439043=_0x5394c7[_0x2c4d46(0x15c)](deriveKey,_0x31c627),_0x379bc8=_0x459b90[_0x2c4d46(0x148)](0x0,IV_LENGTH),_0x1d9e93=_0x459b90['subarray'](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x519924=_0x459b90[_0x2c4d46(0x148)](_0x5394c7[_0x2c4d46(0x15b)](IV_LENGTH,TAG_LENGTH)),_0x958ad8=_0x5394c7[_0x2c4d46(0x14f)](createDecipheriv,ALGORITHM,_0x439043,_0x379bc8);return _0x958ad8['setAuthTag'](_0x1d9e93),_0x5394c7[_0x2c4d46(0x14b)](_0x958ad8['update'](_0x519924),_0x958ad8[_0x2c4d46(0x150)](_0x5394c7['zdvwI']));}
@@ -1 +1 @@
1
- const _0x3e820b=_0x1e83;function _0x3b4d(){const _0x4a654d=['1615369UJqxgG','unknown_command','POST','10872iYcOMR','has_token','push','/api/v1/mcp/desire-path-logs','errorMessage','rawCommand','62QUydSj','[desire-path]\x20Sending\x20log\x20to\x20','1324992PQwsic','Authorization','split','--token','fHfyV','DEBUG','omnik','TPGyV','Missing\x20required\x20argument','[REDACTED]','no_token','--authorization','--cookie','has','woktQ','Unknown\x20argument','--pass','includes','syntax_error','startsWith','slice','27831xmMHLD','catch','25485GrokyX','toLowerCase','96vncCrZ','Bearer\x20','stringify','application/json','Invalid\x20values','mmivw','--auth','--key','425828WMDUjn','Unknown\x20command','ACDZf','error','runtime_error','[desire-path]\x20Payload:\x20','622350lXgcuP','env'];_0x3b4d=function(){return _0x4a654d;};return _0x3b4d();}(function(_0x26086c,_0x17eae7){const _0x12ecc1=_0x1e83,_0xe511a0=_0x26086c();while(!![]){try{const _0x2b7e68=-parseInt(_0x12ecc1(0x8c))/0x1+parseInt(_0x12ecc1(0xa7))/0x2*(-parseInt(_0x12ecc1(0x8a))/0x3)+-parseInt(_0x12ecc1(0x96))/0x4+parseInt(_0x12ecc1(0x9c))/0x5+parseInt(_0x12ecc1(0xa9))/0x6+parseInt(_0x12ecc1(0x9e))/0x7+-parseInt(_0x12ecc1(0x8e))/0x8*(-parseInt(_0x12ecc1(0xa1))/0x9);if(_0x2b7e68===_0x17eae7)break;else _0xe511a0['push'](_0xe511a0['shift']());}catch(_0x56f91d){_0xe511a0['push'](_0xe511a0['shift']());}}}(_0x3b4d,0x29c1c));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x1e83(_0x2a62d0,_0x21343d){_0x2a62d0=_0x2a62d0-0x80;const _0x3b4d19=_0x3b4d();let _0x1e839d=_0x3b4d19[_0x2a62d0];return _0x1e839d;}import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x3e820b(0xac),'-t','--secret','--api-key','--apikey',_0x3e820b(0x95),'--password',_0x3e820b(0x85),_0x3e820b(0x94),_0x3e820b(0x80),'--header',_0x3e820b(0x81),'--credentials']),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x37f573){return TOKEN_PATTERNS['some'](_0x14f3dc=>_0x14f3dc['test'](_0x37f573));}export function sanitizeArgs(_0x3b31b3){const _0x7390af=_0x3e820b,_0x136d0c={'mmivw':_0x7390af(0xb2),'omnik':function(_0x3e309b,_0x416d27){return _0x3e309b(_0x416d27);}},_0x5a2ec7=[];let _0x533213=![];for(let _0x1c86ec=0x0;_0x1c86ec<_0x3b31b3['length'];_0x1c86ec++){const _0x7bbca2=_0x3b31b3[_0x1c86ec];if(_0x533213){_0x5a2ec7['push'](_0x136d0c['mmivw']),_0x533213=![];continue;}if(_0x7bbca2[_0x7390af(0x88)]('--')||_0x7bbca2['startsWith']('-')){const _0x5c341b=_0x7bbca2['indexOf']('=');if(_0x5c341b!==-0x1){const _0xd8ca2f=_0x7bbca2['slice'](0x0,_0x5c341b)[_0x7390af(0x8d)]();if(SENSITIVE_FLAGS[_0x7390af(0x82)](_0xd8ca2f)){_0x5a2ec7[_0x7390af(0xa3)](_0x7bbca2[_0x7390af(0x89)](0x0,_0x5c341b)+'=[REDACTED]');continue;}}else{const _0x3d4f9e=_0x7bbca2['toLowerCase']();SENSITIVE_FLAGS[_0x7390af(0x82)](_0x3d4f9e)&&(_0x533213=!![]);}_0x5a2ec7['push'](_0x7bbca2);}else _0x136d0c[_0x7390af(0xaf)](looksLikeToken,_0x7bbca2)?_0x5a2ec7[_0x7390af(0xa3)](_0x136d0c[_0x7390af(0x93)]):_0x5a2ec7['push'](_0x7bbca2);}return _0x5a2ec7['join']('\x20');}export async function logDesirePath(_0x46bc58){const _0x433618=_0x3e820b,_0x577b34={'GySCd':function(_0x25ffce,_0x32cbc8,_0x5d38bf){return _0x25ffce(_0x32cbc8,_0x5d38bf);}};try{const _0x152cfb=await getToken()[_0x433618(0x8b)](()=>null),_0x4d426f=getApiBaseUrl(),_0x6499fe=getCurrentVersion(),_0x3358af=_0x152cfb?_0x433618(0xa2):_0x433618(0xb3),_0x1b5280={..._0x46bc58['metadata'],'authStatus':_0x3358af,'isTty':process['stdout']['isTTY']??![]},_0x361bbc={'Content-Type':_0x433618(0x91)};_0x152cfb&&(_0x361bbc[_0x433618(0xaa)]=_0x433618(0x8f)+_0x152cfb);const _0x16cce9={'rawCommand':_0x46bc58[_0x433618(0xa6)],'errorMessage':_0x46bc58[_0x433618(0xa5)],'errorType':_0x46bc58['errorType'],'featureId':_0x46bc58['featureId'],'sessionId':_0x46bc58['sessionId'],'metadata':_0x1b5280,'cliVersion':_0x6499fe};process[_0x433618(0x9d)][_0x433618(0xae)]&&(console['error'](_0x433618(0xa8)+_0x4d426f+_0x433618(0xa4)),console[_0x433618(0x99)](_0x433618(0x9b)+JSON['stringify'](_0x16cce9,null,0x2))),await _0x577b34['GySCd'](fetch,_0x4d426f+'/api/v1/mcp/desire-path-logs',{'method':_0x433618(0xa0),'headers':_0x361bbc,'body':JSON[_0x433618(0x90)](_0x16cce9)});}catch(_0x28d1e2){process['env']['DEBUG']&&console[_0x433618(0x99)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x28d1e2);}}export function getErrorType(_0x2d4fb9,_0x3ec130){const _0x22079b=_0x3e820b,_0x7ff855={'lXpYV':'1|2|3|5|7|0|4|6','oHeQv':_0x22079b(0x92),'TPGyV':'invalid_option_value','dZqTv':_0x22079b(0xb1),'RHVQD':'missing_option','ACDZf':_0x22079b(0x84),'fHfyV':'unknown_argument','woktQ':_0x22079b(0x87)},_0x22c431=_0x7ff855['lXpYV'][_0x22079b(0xab)]('|');let _0x2edf20=0x0;while(!![]){switch(_0x22c431[_0x2edf20++]){case'0':if(_0x2d4fb9[_0x22079b(0x86)](_0x7ff855['oHeQv']))return _0x7ff855[_0x22079b(0xb0)];continue;case'1':if(_0x3ec130)return _0x22079b(0x9a);continue;case'2':if(!_0x2d4fb9)return'unknown';continue;case'3':if(_0x2d4fb9['includes'](_0x22079b(0x97)))return _0x22079b(0x9f);continue;case'4':if(_0x2d4fb9[_0x22079b(0x86)](_0x7ff855['dZqTv']))return _0x7ff855['RHVQD'];continue;case'5':if(_0x2d4fb9[_0x22079b(0x86)](_0x7ff855[_0x22079b(0x98)]))return _0x7ff855[_0x22079b(0xad)];continue;case'6':return _0x7ff855[_0x22079b(0x83)];case'7':if(_0x2d4fb9[_0x22079b(0x86)]('Not\x20enough\x20non-option\x20arguments'))return'missing_required_argument';continue;}break;}}
1
+ const _0x240ec0=_0x5afd;(function(_0x535f9d,_0x4c6fe1){const _0x23c4c2=_0x5afd,_0x4cdbc0=_0x535f9d();while(!![]){try{const _0x477ea7=-parseInt(_0x23c4c2(0x99))/0x1*(-parseInt(_0x23c4c2(0x8a))/0x2)+-parseInt(_0x23c4c2(0x8b))/0x3+-parseInt(_0x23c4c2(0x71))/0x4*(parseInt(_0x23c4c2(0x9b))/0x5)+parseInt(_0x23c4c2(0x70))/0x6+parseInt(_0x23c4c2(0x6d))/0x7+-parseInt(_0x23c4c2(0x9e))/0x8+parseInt(_0x23c4c2(0x8d))/0x9;if(_0x477ea7===_0x4c6fe1)break;else _0x4cdbc0['push'](_0x4cdbc0['shift']());}catch(_0x20a5ed){_0x4cdbc0['push'](_0x4cdbc0['shift']());}}}(_0x22d8,0xef268));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x240ec0(0x75),'-t',_0x240ec0(0x7f),_0x240ec0(0x79),_0x240ec0(0x6f),_0x240ec0(0x81),'--password',_0x240ec0(0x9a),'--auth',_0x240ec0(0x78),_0x240ec0(0x69),'--cookie',_0x240ec0(0x8c)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x225527){const _0x229a24=_0x240ec0;return TOKEN_PATTERNS['some'](_0x26ff4e=>_0x26ff4e[_0x229a24(0x89)](_0x225527));}export function sanitizeArgs(_0x245225){const _0x534edc=_0x240ec0,_0x46e34d={'BkAUu':_0x534edc(0x8e)},_0x22a374=[];let _0x4dd84c=![];for(let _0x28560d=0x0;_0x28560d<_0x245225[_0x534edc(0x68)];_0x28560d++){const _0x5282fc=_0x245225[_0x28560d];if(_0x4dd84c){_0x22a374[_0x534edc(0x87)](_0x46e34d['BkAUu']),_0x4dd84c=![];continue;}if(_0x5282fc['startsWith']('--')||_0x5282fc[_0x534edc(0x73)]('-')){const _0x31888f=_0x5282fc['indexOf']('=');if(_0x31888f!==-0x1){const _0x71cf4b=_0x5282fc['slice'](0x0,_0x31888f)[_0x534edc(0x80)]();if(SENSITIVE_FLAGS['has'](_0x71cf4b)){_0x22a374[_0x534edc(0x87)](_0x5282fc[_0x534edc(0x83)](0x0,_0x31888f)+'=[REDACTED]');continue;}}else{const _0x455152=_0x5282fc[_0x534edc(0x80)]();SENSITIVE_FLAGS['has'](_0x455152)&&(_0x4dd84c=!![]);}_0x22a374['push'](_0x5282fc);}else looksLikeToken(_0x5282fc)?_0x22a374[_0x534edc(0x87)](_0x534edc(0x8e)):_0x22a374['push'](_0x5282fc);}return _0x22a374['join']('\x20');}function _0x5afd(_0x472124,_0x1cc73a){_0x472124=_0x472124-0x67;const _0x22d873=_0x22d8();let _0x5afdb8=_0x22d873[_0x472124];return _0x5afdb8;}function _0x22d8(){const _0x1e0080=['ZuRMz','Missing\x20required\x20argument','Authorization','DEBUG','UlYwP','no_token','[desire-path]\x20Payload:\x20','1GqeFDw','--pass','85bEfhWq','metadata','cXInT','2173232NSccOl','missing_required_argument','length','--header','Unknown\x20argument','env','/api/v1/mcp/desire-path-logs','717983WVAErF','invalid_option_value','--apikey','10005708fvBliW','277820Gnvmnz','XYIqz','startsWith','Invalid\x20values','--token','isTTY','missing_option','--authorization','--api-key','gPFOQ','sessionId','JBvcs','1|3|7|0|5|6|2|4','error','--secret','toLowerCase','--key','unknown','slice','errorMessage','includes','syntax_error','push','stringify','test','2390044SIkwkd','2613069LAeSUB','--credentials','3039867NtHPgi','[REDACTED]','stdout','unknown_command','has_token'];_0x22d8=function(){return _0x1e0080;};return _0x22d8();}export async function logDesirePath(_0x4d9d82){const _0x8fc416=_0x240ec0,_0x165acb={'rhaID':function(_0x532af2){return _0x532af2();},'LoHxb':function(_0x11d1f9){return _0x11d1f9();},'hErxj':_0x8fc416(0x91),'UlYwP':'application/json'};try{const _0x3f8909=await _0x165acb['rhaID'](getToken)['catch'](()=>null),_0x1a6495=getApiBaseUrl(),_0x7b3b81=_0x165acb['LoHxb'](getCurrentVersion),_0x1a341c=_0x3f8909?_0x165acb['hErxj']:_0x8fc416(0x97),_0x34d25e={..._0x4d9d82[_0x8fc416(0x9c)],'authStatus':_0x1a341c,'isTty':process[_0x8fc416(0x8f)][_0x8fc416(0x76)]??![]},_0x404108={'Content-Type':_0x165acb[_0x8fc416(0x96)]};_0x3f8909&&(_0x404108[_0x8fc416(0x94)]='Bearer\x20'+_0x3f8909);const _0x323a40={'rawCommand':_0x4d9d82['rawCommand'],'errorMessage':_0x4d9d82[_0x8fc416(0x84)],'errorType':_0x4d9d82['errorType'],'featureId':_0x4d9d82['featureId'],'sessionId':_0x4d9d82[_0x8fc416(0x7b)],'metadata':_0x34d25e,'cliVersion':_0x7b3b81};process['env'][_0x8fc416(0x95)]&&(console['error']('[desire-path]\x20Sending\x20log\x20to\x20'+_0x1a6495+'/api/v1/mcp/desire-path-logs'),console[_0x8fc416(0x7e)](_0x8fc416(0x98)+JSON[_0x8fc416(0x88)](_0x323a40,null,0x2))),await fetch(_0x1a6495+_0x8fc416(0x6c),{'method':'POST','headers':_0x404108,'body':JSON[_0x8fc416(0x88)](_0x323a40)});}catch(_0x3930ac){process[_0x8fc416(0x6b)][_0x8fc416(0x95)]&&console[_0x8fc416(0x7e)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x3930ac);}}export function getErrorType(_0x3b95a0,_0x7248f2){const _0x4efa7b=_0x240ec0,_0x410c17={'ZuRMz':_0x4efa7b(0x7d),'umZTQ':_0x4efa7b(0x6a),'gPFOQ':'unknown_argument','smEPK':_0x4efa7b(0x93),'XYIqz':_0x4efa7b(0x86),'ryjje':'Not\x20enough\x20non-option\x20arguments','JBvcs':_0x4efa7b(0x67),'cXInT':_0x4efa7b(0x6e)},_0x49b9e9=_0x410c17[_0x4efa7b(0x92)]['split']('|');let _0x2998a1=0x0;while(!![]){switch(_0x49b9e9[_0x2998a1++]){case'0':if(_0x3b95a0[_0x4efa7b(0x85)](_0x410c17['umZTQ']))return _0x410c17[_0x4efa7b(0x7a)];continue;case'1':if(_0x7248f2)return'runtime_error';continue;case'2':if(_0x3b95a0['includes'](_0x410c17['smEPK']))return _0x4efa7b(0x77);continue;case'3':if(!_0x3b95a0)return _0x4efa7b(0x82);continue;case'4':return _0x410c17[_0x4efa7b(0x72)];case'5':if(_0x3b95a0[_0x4efa7b(0x85)](_0x410c17['ryjje']))return _0x410c17[_0x4efa7b(0x7c)];continue;case'6':if(_0x3b95a0[_0x4efa7b(0x85)](_0x4efa7b(0x74)))return _0x410c17[_0x4efa7b(0x9d)];continue;case'7':if(_0x3b95a0['includes']('Unknown\x20command'))return _0x4efa7b(0x90);continue;}break;}}
@@ -1 +1 @@
1
- (function(_0x25dae4,_0x13b159){const _0x4ec695=_0x5e0a,_0x4a5933=_0x25dae4();while(!![]){try{const _0x168fe5=parseInt(_0x4ec695(0x1f9))/0x1+-parseInt(_0x4ec695(0x1ef))/0x2*(parseInt(_0x4ec695(0x1f7))/0x3)+-parseInt(_0x4ec695(0x1de))/0x4+-parseInt(_0x4ec695(0x1e2))/0x5+parseInt(_0x4ec695(0x1ce))/0x6+-parseInt(_0x4ec695(0x1e6))/0x7+parseInt(_0x4ec695(0x1d8))/0x8;if(_0x168fe5===_0x13b159)break;else _0x4a5933['push'](_0x4a5933['shift']());}catch(_0x51c53f){_0x4a5933['push'](_0x4a5933['shift']());}}}(_0x493e,0x2a9e0));import{spawn}from'child_process';import _0x7b549e 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='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x6daf20){const _0x1582fd=_0x5e0a,_0x5f079b={'wvThe':function(_0x2d4daa,_0x3a212c,_0xb5fd01){return _0x2d4daa(_0x3a212c,_0xb5fd01);},'nAgMI':_0x1582fd(0x1b9)},_0x1e4c19=await _0x5f079b[_0x1582fd(0x1bc)](fetch,WORKOS_DEVICE_AUTH_URL,{'method':_0x5f079b['nAgMI'],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x6daf20})});if(!_0x1e4c19['ok']){const _0x345a4f=await _0x1e4c19[_0x1582fd(0x1d5)]();throw new Error(_0x1582fd(0x1ea)+_0x1e4c19['status']+'\x20'+_0x345a4f);}return _0x1e4c19[_0x1582fd(0x1dc)]();}export async function pollForTokens(_0x252493,_0x4e8398,_0x132dbd,_0x166a29){const _0x497387=_0x5e0a,_0x4e92e2={'vmzSi':function(_0x569cd2,_0x1e5a34){return _0x569cd2+_0x1e5a34;},'RKSpg':function(_0x21a0a6,_0x2fa36a){return _0x21a0a6(_0x2fa36a);},'mpiOZ':function(_0x54d170,_0x517b6d,_0x245e71){return _0x54d170(_0x517b6d,_0x245e71);},'shpqG':'application/x-www-form-urlencoded','zcwRy':'authorization_pending','hHxqj':'slow_down','Oytky':'Device\x20authorization\x20timed\x20out'},_0x2447bb=_0x4e92e2['vmzSi'](Date[_0x497387(0x1d0)](),_0x166a29*0x3e8);let _0x28e1df=_0x132dbd*0x3e8;while(Date[_0x497387(0x1d0)]()<_0x2447bb){await _0x4e92e2['RKSpg'](sleep,_0x28e1df);const _0x14dbab=await _0x4e92e2[_0x497387(0x1f2)](fetch,WORKOS_TOKEN_URL,{'method':_0x497387(0x1b9),'headers':{'Content-Type':_0x4e92e2[_0x497387(0x1ff)]},'body':new URLSearchParams({'client_id':_0x252493,'device_code':_0x4e8398,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x14dbab['ok'])return _0x14dbab['json']();const _0x577f01=await _0x14dbab['json']();if(_0x577f01[_0x497387(0x1d6)]===_0x4e92e2[_0x497387(0x1d4)])continue;if(_0x577f01['error']===_0x4e92e2['hHxqj']){_0x28e1df+=0x3e8;continue;}throw new Error(_0x577f01['error_description']||_0x577f01[_0x497387(0x1d6)]||_0x497387(0x1d3));}throw new Error(_0x4e92e2['Oytky']);}async function fetchUserProfile(_0x318e3c){const _0x1d41b2=_0x5e0a,_0x2930f8={'qlZxu':function(_0x51a20c,_0x1e3fde,_0x402a8a){return _0x51a20c(_0x1e3fde,_0x402a8a);},'UxHwE':'GET'},_0x38fd45=getApiBaseUrl();try{const _0x26f500=await _0x2930f8['qlZxu'](fetch,_0x38fd45+'/organization/me',{'method':_0x2930f8[_0x1d41b2(0x1ee)],'headers':{'workos-token':_0x318e3c}});if(_0x26f500['ok'])return _0x26f500['json']();}catch{}return null;}function buildKeyName(_0x296cd6,_0x4e2aa0){const _0x2de58b=_0x5e0a,_0x5c6d36={'DjEoR':function(_0x1a56fb,_0x59ec7e){return _0x1a56fb===_0x59ec7e;},'XhXPz':function(_0x392dc2,_0x1466ae){return _0x392dc2+_0x1466ae;}},_0x5d17d5=_0x4e2aa0[_0x2de58b(0x1e0)](_0x2fa4b4=>_0x2fa4b4[_0x2de58b(0x1d1)]===_0x296cd6||_0x2fa4b4['name'][_0x2de58b(0x1bd)](_0x296cd6+'\x20('));if(_0x5c6d36['DjEoR'](_0x5d17d5['length'],0x0))return _0x296cd6;return _0x296cd6+'\x20('+_0x5c6d36[_0x2de58b(0x1f3)](_0x5d17d5['length'],0x1)+')';}function _0x493e(){const _0x118a03=['access_token','POST','GGBwT','Setting\x20up\x20your\x20organization...','wvThe','startsWith','interval','idLmb','\x27s\x20CLI\x20Key','platform','length','XilAv','firstName','LjPnd','parse','SLdvg','unref','wcUie','xdg-open','PwHlJ','split','EXJFE','1734072OAmJye','organizationId','now','name','Failed\x20to\x20provision\x20CLI\x20token:\x20','Authentication\x20failed','zcwRy','text','error','GET','3377992GZznhg','write','token','xYhDF','json','stringify','1053712BorzsK','rEiox','filter','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','345480OWMUpJ','selected','qJfgr','YNiDw','1105279sBiMfM','email','ignore','win32','Failed\x20to\x20request\x20device\x20code:\x20','start','verification_uri_complete','status','UxHwE','2HZQPTk','refresh_token','user_code','mpiOZ','XhXPz','YjepH','kjwdW','TmoPc','1028703ohzNjb','toString','296621AlpwLn','application/x-www-form-urlencoded','org_id','Using\x20organization:\x20','expires_in','utf-8','shpqG','Select\x20an\x20organization:','darwin','stdin','log','stdout','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','UiOvy','application/json','Failed\x20to\x20create\x20organization:\x20'];_0x493e=function(){return _0x118a03;};return _0x493e();}export async function provisionApiKey(_0x419b41){const _0x313afb=_0x5e0a,_0x496f06={'PWWBN':function(_0x5a1302){return _0x5a1302();},'UiOvy':function(_0x5a2188,_0x57a581){return _0x5a2188(_0x57a581);},'kjwdW':function(_0x3fcc67,_0x41951e,_0x1a9b94){return _0x3fcc67(_0x41951e,_0x1a9b94);},'XGmWq':_0x313afb(0x1b9)},_0x11a0a1=_0x496f06['PWWBN'](getApiBaseUrl),_0x399813={'Content-Type':_0x313afb(0x207),'workos-token':_0x419b41},_0x281ff0=await _0x496f06[_0x313afb(0x206)](fetchUserProfile,_0x419b41),_0x40d3d7=_0x281ff0?.[_0x313afb(0x1c4)]||_0x281ff0?.[_0x313afb(0x1e7)]?.[_0x313afb(0x1cc)]('@')[0x0],_0x113439=_0x40d3d7?_0x40d3d7+_0x313afb(0x1c0):'CLI\x20Key';let _0x11bd6f=[];try{const _0x30ef42=await fetch(_0x11a0a1+'/api-keys',{'method':_0x313afb(0x1d7),'headers':_0x399813});if(_0x30ef42['ok']){const _0x147c99=await _0x30ef42['json']();_0x11bd6f=_0x147c99['apiKeys'];}}catch{}const _0x1a067d=_0x496f06[_0x313afb(0x1f5)](buildKeyName,_0x113439,_0x11bd6f),_0x407a78=await _0x496f06[_0x313afb(0x1f5)](fetch,_0x11a0a1+'/api-keys',{'method':_0x496f06['XGmWq'],'headers':_0x399813,'body':JSON[_0x313afb(0x1dd)]({'name':_0x1a067d,'scope':'mcp:write'})});if(!_0x407a78['ok']){const _0x572f35=await _0x407a78[_0x313afb(0x1d5)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x407a78['status']+'\x20'+_0x572f35);}const _0x250d7f=await _0x407a78[_0x313afb(0x1dc)]();return _0x250d7f['apiKey'][_0x313afb(0x1da)];}export function openBrowser(_0x35f322){const _0x2b6cae=_0x5e0a,_0x5af41a={'PwHlJ':function(_0x36b49f,_0x2d8625){return _0x36b49f===_0x2d8625;},'wkOfH':_0x2b6cae(0x1e9),'RHGme':function(_0x4e7fa4,_0x46c06b,_0x4c98f6,_0x3411dd){return _0x4e7fa4(_0x46c06b,_0x4c98f6,_0x3411dd);},'YNiDw':'cmd','TzhvA':_0x2b6cae(0x1eb),'idLmb':'open','rEiox':function(_0x5c261d,_0x5a193a,_0x11cdde,_0x40fd87){return _0x5c261d(_0x5a193a,_0x11cdde,_0x40fd87);}};try{if(_0x5af41a[_0x2b6cae(0x1cb)](process[_0x2b6cae(0x1c1)],_0x5af41a['wkOfH'])){const _0x5b3f11=_0x5af41a['RHGme'](spawn,_0x5af41a[_0x2b6cae(0x1e5)],['/c',_0x5af41a['TzhvA'],'',_0x35f322],{'detached':!![],'stdio':_0x2b6cae(0x1e8),'windowsHide':!![]});_0x5b3f11[_0x2b6cae(0x1c8)]();return;}const _0x4d1486=process['platform']===_0x2b6cae(0x201)?_0x5af41a[_0x2b6cae(0x1bf)]:_0x2b6cae(0x1ca),_0x46d3c3=_0x5af41a[_0x2b6cae(0x1df)](spawn,_0x4d1486,[_0x35f322],{'detached':!![],'stdio':_0x2b6cae(0x1e8)});_0x46d3c3['unref']();}catch{}}function decodeJwtPayload(_0x586e55){const _0x5a3a5b=_0x5e0a,_0x554566={'AvYht':'base64url'},_0x2b9e14=_0x586e55[_0x5a3a5b(0x1cc)]('.');if(_0x2b9e14[_0x5a3a5b(0x1c2)]!==0x3)throw new Error('Invalid\x20JWT\x20format');const _0x34c69d=Buffer['from'](_0x2b9e14[0x1],_0x554566['AvYht'])[_0x5a3a5b(0x1f8)](_0x5a3a5b(0x1fe));return JSON[_0x5a3a5b(0x1c6)](_0x34c69d);}async function selfServeSignup(_0x40b672){const _0x243e14=_0x5e0a,_0x512247={'TmoPc':function(_0x1a45e4,_0x40c530,_0x170548){return _0x1a45e4(_0x40c530,_0x170548);}},_0x1edafc=getApiBaseUrl(),_0x4fae78=await _0x512247[_0x243e14(0x1f6)](fetch,_0x1edafc+'/organization/self-serve-signup',{'method':'POST','headers':{'Content-Type':_0x243e14(0x207),'workos-token':_0x40b672}});if(!_0x4fae78['ok']){const _0x323a2b=await _0x4fae78[_0x243e14(0x1d5)]();throw new Error(_0x243e14(0x1b7)+_0x4fae78[_0x243e14(0x1ed)]+'\x20'+_0x323a2b);}return _0x4fae78[_0x243e14(0x1dc)]();}async function fetchMyMemberships(_0x198f8a){const _0x467531=_0x5e0a,_0x41d5e0={'tlFNG':function(_0x1acc37){return _0x1acc37();},'BNGAi':function(_0x2a3787,_0x21f8f5,_0x4b347f){return _0x2a3787(_0x21f8f5,_0x4b347f);},'vQhyr':_0x467531(0x1d7)},_0x2b37f2=_0x41d5e0['tlFNG'](getApiBaseUrl),_0xbc868a=await _0x41d5e0['BNGAi'](fetch,_0x2b37f2+'/organization/my-memberships',{'method':_0x41d5e0['vQhyr'],'headers':{'workos-token':_0x198f8a}});if(!_0xbc868a['ok']){const _0x413ded=await _0xbc868a['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0xbc868a['status']+'\x20'+_0x413ded);}const _0x153619=await _0xbc868a[_0x467531(0x1dc)]();return _0x153619['memberships'];}function _0x5e0a(_0x5e347e,_0x5c7646){_0x5e347e=_0x5e347e-0x1b7;const _0x493ec0=_0x493e();let _0x5e0ac6=_0x493ec0[_0x5e347e];return _0x5e0ac6;}async function refreshTokenWithOrg(_0x30b3fa,_0x1bd092,_0x37a0e6){const _0x2ec6e7=_0x5e0a,_0x598337={'YLxez':function(_0x184091,_0x9aabcf,_0x53dea5){return _0x184091(_0x9aabcf,_0x53dea5);}},_0x53efbc=await _0x598337['YLxez'](fetch,WORKOS_TOKEN_URL,{'method':_0x2ec6e7(0x1b9),'headers':{'Content-Type':_0x2ec6e7(0x1fa)},'body':new URLSearchParams({'client_id':_0x30b3fa,'grant_type':'refresh_token','refresh_token':_0x1bd092,'organization_id':_0x37a0e6})});if(!_0x53efbc['ok']){const _0xe101eb=await _0x53efbc['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x53efbc['status']+'\x20'+_0xe101eb);}return _0x53efbc[_0x2ec6e7(0x1dc)]();}async function provisionCliToken(_0xa732e2){const _0x3c7276=_0x5e0a,_0x48a7ba=getApiBaseUrl(),_0x302693=await fetch(_0x48a7ba+'/cli-auth/token',{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0xa732e2}});if(!_0x302693['ok']){const _0x425127=await _0x302693['text']();throw new Error(_0x3c7276(0x1d2)+_0x302693[_0x3c7276(0x1ed)]+'\x20'+_0x425127);}return _0x302693[_0x3c7276(0x1dc)]();}export async function runDeviceAuthFlow(){const _0x563772=_0x5e0a,_0x1d8331={'EXJFE':function(_0x50941d){return _0x50941d();},'LjPnd':function(_0x325b85,_0x318ee5){return _0x325b85(_0x318ee5);},'qJfgr':'\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','ENJYC':function(_0x595fad,_0x98b2f2,_0x22c172,_0x1c4c6e,_0x2a1be5){return _0x595fad(_0x98b2f2,_0x22c172,_0x1c4c6e,_0x2a1be5);},'CbpDf':_0x563772(0x1bb),'wohDg':function(_0x9cb27d,_0x263cf3){return _0x9cb27d(_0x263cf3);},'CMcvn':function(_0x11d7ad,_0x3e8eaf){return _0x11d7ad===_0x3e8eaf;},'GGBwT':function(_0x55c0e6,_0x324b75){return _0x55c0e6+_0x324b75;},'wcUie':_0x563772(0x1e1),'YjepH':_0x563772(0x205),'SLdvg':function(_0x122f74,_0x444002,_0x1b83e2,_0x59076f){return _0x122f74(_0x444002,_0x1b83e2,_0x59076f);},'xYhDF':'Provisioning\x20CLI\x20token...','vinzQ':function(_0x276030,_0x49f1db){return _0x276030(_0x49f1db);},'XilAv':function(_0x430390,_0x56d2b3){return _0x430390(_0x56d2b3);}},_0x46d785=_0x1d8331[_0x563772(0x1cd)](getCurrentEnvironment),_0x55b948=ENVIRONMENT_CONFIGS[_0x46d785]['workosClientId'],_0x23cf06=await _0x1d8331[_0x563772(0x1c5)](requestDeviceCode,_0x55b948);console[_0x563772(0x203)]('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x563772(0x203)](_0x1d8331[_0x563772(0x1e4)]),openBrowser(_0x23cf06['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x23cf06[_0x563772(0x1ec)]),console[_0x563772(0x203)]('Code:\x20'+_0x23cf06[_0x563772(0x1f1)]+'\x0a'),process['stdout'][_0x563772(0x1d9)]('Waiting\x20for\x20authentication...');let _0x46a50d=await _0x1d8331['ENJYC'](pollForTokens,_0x55b948,_0x23cf06['device_code'],_0x23cf06[_0x563772(0x1be)],_0x23cf06[_0x563772(0x1fd)]);console['log']('\x20✓');const _0xba42a2=decodeJwtPayload(_0x46a50d[_0x563772(0x1b8)]);if(!_0xba42a2[_0x563772(0x1fb)]){const _0x450d40=await fetchMyMemberships(_0x46a50d[_0x563772(0x1b8)]);let _0x133809;if(_0x450d40[_0x563772(0x1c2)]===0x0){process[_0x563772(0x204)]['write'](_0x1d8331['CbpDf']);const _0x484dbf=await _0x1d8331['wohDg'](selfServeSignup,_0x46a50d[_0x563772(0x1b8)]);_0x133809=_0x484dbf['organizationId'],console['log']('\x20✓');}else{if(_0x1d8331['CMcvn'](_0x450d40[_0x563772(0x1c2)],0x1))_0x133809=_0x450d40[0x0]['organizationId'],console[_0x563772(0x203)](_0x563772(0x1fc)+_0x450d40[0x0][_0x563772(0x1d1)]);else{const _0x1fce13=process[_0x563772(0x202)]['isTTY']&&process[_0x563772(0x204)]['isTTY'];if(!_0x1fce13)throw new Error(_0x1d8331[_0x563772(0x1ba)](_0x1d8331[_0x563772(0x1c9)],_0x1d8331[_0x563772(0x1f4)]));const {selected:_0x584286}=await _0x7b549e['prompt']([{'type':'list','name':_0x563772(0x1e3),'message':_0x563772(0x200),'choices':_0x450d40['map'](_0x836424=>({'name':_0x836424[_0x563772(0x1d1)],'value':_0x836424[_0x563772(0x1cf)]}))}]);_0x133809=_0x584286;}}_0x46a50d=await _0x1d8331[_0x563772(0x1c7)](refreshTokenWithOrg,_0x55b948,_0x46a50d[_0x563772(0x1f0)],_0x133809);}process['stdout']['write'](_0x1d8331[_0x563772(0x1db)]);const _0x4ce0ed=await _0x1d8331['vinzQ'](provisionCliToken,_0x46a50d[_0x563772(0x1b8)]);return console[_0x563772(0x203)]('\x20✓'),await _0x1d8331[_0x563772(0x1c3)](storeToken,_0x4ce0ed[_0x563772(0x1da)]),_0x46a50d['refresh_token']&&await _0x1d8331[_0x563772(0x1c5)](storeRefreshToken,_0x46a50d[_0x563772(0x1f0)]),_0x4ce0ed[_0x563772(0x1da)];}function sleep(_0x4fa4cb){return new Promise(_0x53d570=>setTimeout(_0x53d570,_0x4fa4cb));}
1
+ const _0x3f6f9d=_0x4677;(function(_0x4e7be1,_0x92ab58){const _0x24e268=_0x4677,_0x1f8f8b=_0x4e7be1();while(!![]){try{const _0x513f6c=parseInt(_0x24e268(0x13d))/0x1+-parseInt(_0x24e268(0x128))/0x2*(parseInt(_0x24e268(0x17f))/0x3)+parseInt(_0x24e268(0x133))/0x4*(parseInt(_0x24e268(0x170))/0x5)+-parseInt(_0x24e268(0x163))/0x6*(parseInt(_0x24e268(0x169))/0x7)+parseInt(_0x24e268(0x131))/0x8*(parseInt(_0x24e268(0x132))/0x9)+-parseInt(_0x24e268(0x146))/0xa+parseInt(_0x24e268(0x142))/0xb;if(_0x513f6c===_0x92ab58)break;else _0x1f8f8b['push'](_0x1f8f8b['shift']());}catch(_0x5bfb69){_0x1f8f8b['push'](_0x1f8f8b['shift']());}}}(_0x2d43,0xa898e));function _0x2d43(){const _0x34f110=['9Ahgzcz','fOvZd','apiKeys','workosClientId','499308hkhsog','dlVoI','isTTY','POST','UTzik','UECKA','wYpLo','access_token','length','86120BLfXPY','981rtXMqO','4aFxuDO','application/json','/api-keys','apiKey','json','qCgTg','IZdhc','ScRtZ','Device\x20authorization\x20timed\x20out','GET','1083682puhXts','CLI\x20Key','Failed\x20to\x20request\x20device\x20code:\x20','YJbAS','iHGuh','9147710YrCOBY','device_code','WkZIi','xdg-open','13531910GKMDNO','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','jqBYC','Setting\x20up\x20your\x20organization...','from','Using\x20organization:\x20','stdout','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','Zgffu','zSaIr','jZJaP','map','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','Code:\x20','user_code','stdin','egvMo','JmnMB','Failed\x20to\x20create\x20organization:\x20','https://api.workos.com/user_management/authorize/device','/organization/my-memberships','organizationId','ddjns','log','verification_uri_complete','startsWith','wTMRs','stringify','Authentication\x20failed','6033318FQxMhp','QSwGu','parse','SvmQh','urn:ietf:params:oauth:grant-type:device_code','win32','7ZtzSYh','XUAge','text','mcp:write','org_id','pqgXc','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','3548015rAzMsv','status','/organization/me','error','/cli-auth/token','expires_in','utf-8','now','aAJrV','application/x-www-form-urlencoded','memberships','toString','vthkH','Failed\x20to\x20provision\x20API\x20key:\x20','platform'];_0x2d43=function(){return _0x34f110;};return _0x2d43();}import{spawn}from'child_process';import _0x27f7aa from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x3f6f9d(0x159),WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';function _0x4677(_0x1ba513,_0x341e22){_0x1ba513=_0x1ba513-0x128;const _0x2d43c3=_0x2d43();let _0x46776c=_0x2d43c3[_0x1ba513];return _0x46776c;}export async function requestDeviceCode(_0x4828ab){const _0x326104=_0x3f6f9d,_0x247b7b=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x326104(0x12b),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x4828ab})});if(!_0x247b7b['ok']){const _0x50761e=await _0x247b7b[_0x326104(0x16b)]();throw new Error(_0x326104(0x13f)+_0x247b7b['status']+'\x20'+_0x50761e);}return _0x247b7b['json']();}export async function pollForTokens(_0xe78bae,_0xd3e7fb,_0x402531,_0x189083){const _0x465749=_0x3f6f9d,_0x4eaf4d={'XUAge':function(_0x170287,_0x194fb1){return _0x170287+_0x194fb1;},'DcMMG':_0x465749(0x12b),'IKGXg':function(_0x4e1e74,_0x285116){return _0x4e1e74===_0x285116;},'SvmQh':'authorization_pending','BnSNN':function(_0x202546,_0x5cc41d){return _0x202546===_0x5cc41d;},'pqgXc':_0x465749(0x162),'wFeAp':_0x465749(0x13b)},_0x383372=_0x4eaf4d[_0x465749(0x16a)](Date[_0x465749(0x177)](),_0x189083*0x3e8);let _0x536e4d=_0x402531*0x3e8;while(Date['now']()<_0x383372){await sleep(_0x536e4d);const _0x2de856=await fetch(WORKOS_TOKEN_URL,{'method':_0x4eaf4d['DcMMG'],'headers':{'Content-Type':_0x465749(0x179)},'body':new URLSearchParams({'client_id':_0xe78bae,'device_code':_0xd3e7fb,'grant_type':_0x465749(0x167)})});if(_0x2de856['ok'])return _0x2de856['json']();const _0x41ea75=await _0x2de856['json']();if(_0x4eaf4d['IKGXg'](_0x41ea75[_0x465749(0x173)],_0x4eaf4d[_0x465749(0x166)]))continue;if(_0x4eaf4d['BnSNN'](_0x41ea75['error'],'slow_down')){_0x536e4d+=0x3e8;continue;}throw new Error(_0x41ea75['error_description']||_0x41ea75[_0x465749(0x173)]||_0x4eaf4d[_0x465749(0x16e)]);}throw new Error(_0x4eaf4d['wFeAp']);}async function fetchUserProfile(_0x3f844f){const _0x40dafb=_0x3f6f9d,_0x30f29c={'IZdhc':function(_0x44bcf3){return _0x44bcf3();},'wYpLo':function(_0x3bdf9f,_0x557a61,_0x111fdd){return _0x3bdf9f(_0x557a61,_0x111fdd);},'JmnMB':'GET'},_0x1b5ebf=_0x30f29c[_0x40dafb(0x139)](getApiBaseUrl);try{const _0x539a6d=await _0x30f29c[_0x40dafb(0x12e)](fetch,_0x1b5ebf+_0x40dafb(0x172),{'method':_0x30f29c[_0x40dafb(0x157)],'headers':{'workos-token':_0x3f844f}});if(_0x539a6d['ok'])return _0x539a6d['json']();}catch{}return null;}function buildKeyName(_0x1e33b2,_0x25a4a){const _0x5bdfd0=_0x3f6f9d,_0x1166f0={'iHGuh':function(_0x191dcb,_0x218b0d){return _0x191dcb===_0x218b0d;}},_0x26821b=_0x25a4a['filter'](_0x17d7c3=>_0x17d7c3['name']===_0x1e33b2||_0x17d7c3['name'][_0x5bdfd0(0x15f)](_0x1e33b2+'\x20('));if(_0x1166f0[_0x5bdfd0(0x141)](_0x26821b[_0x5bdfd0(0x130)],0x0))return _0x1e33b2;return _0x1e33b2+'\x20('+(_0x26821b[_0x5bdfd0(0x130)]+0x1)+')';}export async function provisionApiKey(_0x5a0be5){const _0x13346b=_0x3f6f9d,_0xea5b2a={'aAJrV':function(_0x3606f3){return _0x3606f3();},'ZNlis':'application/json','dlVoI':'GET','zSaIr':_0x13346b(0x16c)},_0x1d5393=_0xea5b2a[_0x13346b(0x178)](getApiBaseUrl),_0x58ebc1={'Content-Type':_0xea5b2a['ZNlis'],'workos-token':_0x5a0be5},_0x110d77=await fetchUserProfile(_0x5a0be5),_0xe355ec=_0x110d77?.['firstName']||_0x110d77?.['email']?.['split']('@')[0x0],_0xe09ef=_0xe355ec?_0xe355ec+'\x27s\x20CLI\x20Key':_0x13346b(0x13e);let _0x5daa75=[];try{const _0x1c78c2=await fetch(_0x1d5393+'/api-keys',{'method':_0xea5b2a[_0x13346b(0x129)],'headers':_0x58ebc1});if(_0x1c78c2['ok']){const _0xd6f800=await _0x1c78c2[_0x13346b(0x137)]();_0x5daa75=_0xd6f800[_0x13346b(0x181)];}}catch{}const _0x529b0c=buildKeyName(_0xe09ef,_0x5daa75),_0x132518=await fetch(_0x1d5393+_0x13346b(0x135),{'method':_0x13346b(0x12b),'headers':_0x58ebc1,'body':JSON[_0x13346b(0x161)]({'name':_0x529b0c,'scope':_0xea5b2a[_0x13346b(0x14f)]})});if(!_0x132518['ok']){const _0x592547=await _0x132518['text']();throw new Error(_0x13346b(0x17d)+_0x132518['status']+'\x20'+_0x592547);}const _0x1d7938=await _0x132518[_0x13346b(0x137)]();return _0x1d7938[_0x13346b(0x136)]['token'];}export function openBrowser(_0x2ee556){const _0x4c86b7=_0x3f6f9d,_0x1fccb1={'nMyUp':function(_0x18d6d7,_0x498246){return _0x18d6d7===_0x498246;},'illbl':_0x4c86b7(0x168),'fOvZd':function(_0x19639e,_0x24cf9b,_0x1f155c,_0x26827a){return _0x19639e(_0x24cf9b,_0x1f155c,_0x26827a);},'jqBYC':'cmd','sfIbI':'start','ffkpx':'ignore','YDaST':_0x4c86b7(0x145)};try{if(_0x1fccb1['nMyUp'](process[_0x4c86b7(0x17e)],_0x1fccb1['illbl'])){const _0x598306=_0x1fccb1[_0x4c86b7(0x180)](spawn,_0x1fccb1[_0x4c86b7(0x148)],['/c',_0x1fccb1['sfIbI'],'',_0x2ee556],{'detached':!![],'stdio':_0x1fccb1['ffkpx'],'windowsHide':!![]});_0x598306['unref']();return;}const _0x32a3d5=process[_0x4c86b7(0x17e)]==='darwin'?'open':_0x1fccb1['YDaST'],_0x38cbe3=spawn(_0x32a3d5,[_0x2ee556],{'detached':!![],'stdio':_0x1fccb1['ffkpx']});_0x38cbe3['unref']();}catch{}}function decodeJwtPayload(_0x96c3c9){const _0x1f6743=_0x3f6f9d,_0x5b99ce=_0x96c3c9['split']('.');if(_0x5b99ce['length']!==0x3)throw new Error('Invalid\x20JWT\x20format');const _0x4f6afd=Buffer[_0x1f6743(0x14a)](_0x5b99ce[0x1],'base64url')[_0x1f6743(0x17b)](_0x1f6743(0x176));return JSON[_0x1f6743(0x165)](_0x4f6afd);}async function selfServeSignup(_0x1c3c85){const _0x107eb2=_0x3f6f9d,_0x45b805={'CJuHs':function(_0x12cbf9){return _0x12cbf9();},'pProL':function(_0x11f7bc,_0x2e4e51,_0x580666){return _0x11f7bc(_0x2e4e51,_0x580666);},'ScRtZ':'application/json'},_0x376f57=_0x45b805['CJuHs'](getApiBaseUrl),_0x3992a6=await _0x45b805['pProL'](fetch,_0x376f57+'/organization/self-serve-signup',{'method':_0x107eb2(0x12b),'headers':{'Content-Type':_0x45b805[_0x107eb2(0x13a)],'workos-token':_0x1c3c85}});if(!_0x3992a6['ok']){const _0x734870=await _0x3992a6['text']();throw new Error(_0x107eb2(0x158)+_0x3992a6['status']+'\x20'+_0x734870);}return _0x3992a6['json']();}async function fetchMyMemberships(_0x4b8a43){const _0x33b53b=_0x3f6f9d,_0x7575ad={'UTzik':function(_0x5c214d,_0x5851ce,_0x32aaca){return _0x5c214d(_0x5851ce,_0x32aaca);}},_0x365594=getApiBaseUrl(),_0x2384aa=await _0x7575ad[_0x33b53b(0x12c)](fetch,_0x365594+_0x33b53b(0x15a),{'method':_0x33b53b(0x13c),'headers':{'workos-token':_0x4b8a43}});if(!_0x2384aa['ok']){const _0x4f9494=await _0x2384aa['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x2384aa['status']+'\x20'+_0x4f9494);}const _0x2bbeca=await _0x2384aa[_0x33b53b(0x137)]();return _0x2bbeca[_0x33b53b(0x17a)];}async function refreshTokenWithOrg(_0x187175,_0x59ac7c,_0x56fb73){const _0x43446a=_0x3f6f9d,_0x2c00ec={'IGtUl':function(_0x251175,_0x52b02c,_0x120e48){return _0x251175(_0x52b02c,_0x120e48);},'YIvBo':_0x43446a(0x12b),'NcdxK':'refresh_token'},_0x49e7df=await _0x2c00ec['IGtUl'](fetch,WORKOS_TOKEN_URL,{'method':_0x2c00ec['YIvBo'],'headers':{'Content-Type':_0x43446a(0x179)},'body':new URLSearchParams({'client_id':_0x187175,'grant_type':_0x2c00ec['NcdxK'],'refresh_token':_0x59ac7c,'organization_id':_0x56fb73})});if(!_0x49e7df['ok']){const _0x44c429=await _0x49e7df[_0x43446a(0x16b)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x49e7df[_0x43446a(0x171)]+'\x20'+_0x44c429);}return _0x49e7df['json']();}async function provisionCliToken(_0x14d876){const _0xc20ecd=_0x3f6f9d,_0x37627e={'XQCVa':function(_0x3029f2){return _0x3029f2();},'YJbAS':function(_0x5631f0,_0x460dd0,_0x5afd9c){return _0x5631f0(_0x460dd0,_0x5afd9c);},'jZJaP':_0xc20ecd(0x12b),'QSwGu':_0xc20ecd(0x134)},_0xa24f76=_0x37627e['XQCVa'](getApiBaseUrl),_0x5ecc51=await _0x37627e[_0xc20ecd(0x140)](fetch,_0xa24f76+_0xc20ecd(0x174),{'method':_0x37627e[_0xc20ecd(0x150)],'headers':{'Content-Type':_0x37627e[_0xc20ecd(0x164)],'workos-token':_0x14d876}});if(!_0x5ecc51['ok']){const _0x411d28=await _0x5ecc51['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x5ecc51[_0xc20ecd(0x171)]+'\x20'+_0x411d28);}return _0x5ecc51['json']();}export async function runDeviceAuthFlow(){const _0x2e1704=_0x3f6f9d,_0x5055f0={'wTMRs':function(_0x433720){return _0x433720();},'ddjns':function(_0x6e7838,_0x3867ce){return _0x6e7838(_0x3867ce);},'DJRbS':_0x2e1704(0x152),'qCgTg':'Waiting\x20for\x20authentication...','hAWIQ':function(_0x50fce0,_0x3c303d){return _0x50fce0(_0x3c303d);},'UECKA':function(_0x1a7085,_0x46e7b3){return _0x1a7085(_0x46e7b3);},'lyGZB':function(_0x14bcb3,_0x4a0e50){return _0x14bcb3(_0x4a0e50);},'Zgffu':function(_0x1ced2d,_0x24b3a6){return _0x1ced2d===_0x24b3a6;},'egvMo':function(_0x222c74,_0x3a26a5){return _0x222c74+_0x3a26a5;},'elnnn':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','vthkH':'selected','WkZIi':function(_0x37c656,_0x5ea30e,_0x542485,_0x138685){return _0x37c656(_0x5ea30e,_0x542485,_0x138685);},'TxhZp':function(_0x256e3e,_0x66e739){return _0x256e3e(_0x66e739);},'ojHru':function(_0x29db51,_0x22c9ce){return _0x29db51(_0x22c9ce);}},_0x381fec=_0x5055f0[_0x2e1704(0x160)](getCurrentEnvironment),_0x15ec78=ENVIRONMENT_CONFIGS[_0x381fec][_0x2e1704(0x182)],_0x3adfc6=await _0x5055f0[_0x2e1704(0x15c)](requestDeviceCode,_0x15ec78);console[_0x2e1704(0x15d)](_0x5055f0['DJRbS']),console[_0x2e1704(0x15d)](_0x2e1704(0x14d)),_0x5055f0['ddjns'](openBrowser,_0x3adfc6[_0x2e1704(0x15e)]),console[_0x2e1704(0x15d)](_0x2e1704(0x16f)+_0x3adfc6['verification_uri_complete']),console['log'](_0x2e1704(0x153)+_0x3adfc6[_0x2e1704(0x154)]+'\x0a'),process['stdout']['write'](_0x5055f0[_0x2e1704(0x138)]);let _0x15ec3f=await pollForTokens(_0x15ec78,_0x3adfc6[_0x2e1704(0x143)],_0x3adfc6['interval'],_0x3adfc6[_0x2e1704(0x175)]);console[_0x2e1704(0x15d)]('\x20✓');const _0x2bb197=_0x5055f0['hAWIQ'](decodeJwtPayload,_0x15ec3f['access_token']);if(!_0x2bb197[_0x2e1704(0x16d)]){const _0xdfa552=await _0x5055f0[_0x2e1704(0x12d)](fetchMyMemberships,_0x15ec3f['access_token']);let _0x4664e2;if(_0xdfa552[_0x2e1704(0x130)]===0x0){process[_0x2e1704(0x14c)]['write'](_0x2e1704(0x149));const _0x21848f=await _0x5055f0['lyGZB'](selfServeSignup,_0x15ec3f['access_token']);_0x4664e2=_0x21848f[_0x2e1704(0x15b)],console[_0x2e1704(0x15d)]('\x20✓');}else{if(_0x5055f0[_0x2e1704(0x14e)](_0xdfa552['length'],0x1))_0x4664e2=_0xdfa552[0x0]['organizationId'],console['log'](_0x2e1704(0x14b)+_0xdfa552[0x0]['name']);else{const _0x18591f=process[_0x2e1704(0x155)][_0x2e1704(0x12a)]&&process['stdout']['isTTY'];if(!_0x18591f)throw new Error(_0x5055f0[_0x2e1704(0x156)](_0x5055f0['elnnn'],_0x2e1704(0x147)));const {selected:_0x3c60e8}=await _0x27f7aa['prompt']([{'type':'list','name':_0x5055f0[_0x2e1704(0x17c)],'message':'Select\x20an\x20organization:','choices':_0xdfa552[_0x2e1704(0x151)](_0xd19f07=>({'name':_0xd19f07['name'],'value':_0xd19f07[_0x2e1704(0x15b)]}))}]);_0x4664e2=_0x3c60e8;}}_0x15ec3f=await _0x5055f0[_0x2e1704(0x144)](refreshTokenWithOrg,_0x15ec78,_0x15ec3f['refresh_token'],_0x4664e2);}process['stdout']['write']('Provisioning\x20CLI\x20token...');const _0x504610=await _0x5055f0['TxhZp'](provisionCliToken,_0x15ec3f[_0x2e1704(0x12f)]);return console[_0x2e1704(0x15d)]('\x20✓'),await _0x5055f0['ojHru'](storeToken,_0x504610['token']),_0x15ec3f['refresh_token']&&await storeRefreshToken(_0x15ec3f['refresh_token']),_0x504610['token'];}function sleep(_0x5eb155){return new Promise(_0xd97da8=>setTimeout(_0xd97da8,_0x5eb155));}
@@ -1 +1 @@
1
- const _0x43e2b0=_0x3089;(function(_0x3ddbb7,_0x3f2ab3){const _0x5696d6=_0x3089,_0xc6c2ad=_0x3ddbb7();while(!![]){try{const _0x1f27e1=-parseInt(_0x5696d6(0x122))/0x1*(parseInt(_0x5696d6(0xff))/0x2)+parseInt(_0x5696d6(0x108))/0x3+parseInt(_0x5696d6(0x115))/0x4*(parseInt(_0x5696d6(0x10a))/0x5)+-parseInt(_0x5696d6(0x118))/0x6*(-parseInt(_0x5696d6(0x10c))/0x7)+parseInt(_0x5696d6(0x112))/0x8+parseInt(_0x5696d6(0x103))/0x9+parseInt(_0x5696d6(0x114))/0xa*(-parseInt(_0x5696d6(0x109))/0xb);if(_0x1f27e1===_0x3f2ab3)break;else _0xc6c2ad['push'](_0xc6c2ad['shift']());}catch(_0x423353){_0xc6c2ad['push'](_0xc6c2ad['shift']());}}}(_0x1247,0x47aa9));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0x43e2b0(0x120),'aiProxyUrl':_0x43e2b0(0x11f),'mcpAuthUrl':_0x43e2b0(0x102)},'staging':{'apiBaseUrl':_0x43e2b0(0x11d),'workosClientId':_0x43e2b0(0x11c),'aiProxyUrl':_0x43e2b0(0x11a),'mcpAuthUrl':_0x43e2b0(0x110)},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x43e2b0(0x11b),'mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT='prod';function _0x1247(){const _0x497fbf=['http://localhost:8090','client_01J9CBYM2DKWV9HM17D95Z540K','https://api.staging.ranger.net','LSFQi','https://ai-proxy-716115358910.us-central1.run.app','client_01J9CBYM7M5ZETCF7G6614DXR2','find','133660ImibaE','YatjD','playwright-cli','4yWVJCa','ekcGU','LNAoN','https://mcp-auth.ranger.net/mcp','1064997lJJcLt','trim','RANGER_MCP_AUTH_URL','mcp','env','1266807WskNca','2331890FsLFMP','5caQDhy','Wudtw','189021IyAGuT','RANGER_CLI_ENV','RANGER_USE_NOVA_ACT','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli.','https://mcp-auth.staging.ranger.net/mcp','Invalid\x20RANGER_TRANSPORT=\x22','3333744KyvSXu','uZmOr','50vvGPcD','2005908xCpHyU','aiProxyUrl','staging','36HNyjgX','prod','https://ai-proxy-301751771437.us-central1.run.app'];_0x1247=function(){return _0x497fbf;};return _0x1247();}export function isValidEnvironment(_0x586e4d){const _0x35a470=_0x43e2b0,_0x40d0cd={'Wudtw':function(_0x15c392,_0x4abeca){return _0x15c392===_0x4abeca;},'LNAoN':function(_0x41af71,_0x51816e){return _0x41af71===_0x51816e;},'YatjD':function(_0x3d3d39,_0x4a294d){return _0x3d3d39===_0x4a294d;},'FwqCA':'local'};return _0x40d0cd[_0x35a470(0x10b)](_0x586e4d,_0x35a470(0x119))||_0x40d0cd[_0x35a470(0x101)](_0x586e4d,_0x35a470(0x117))||_0x40d0cd[_0x35a470(0x123)](_0x586e4d,_0x40d0cd['FwqCA']);}export function getCurrentEnvironment(){const _0x2877ed=_0x43e2b0,_0x5b7c35=process[_0x2877ed(0x107)][_0x2877ed(0x10d)];if(_0x5b7c35&&isValidEnvironment(_0x5b7c35))return _0x5b7c35;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x223a3a={'mnArs':function(_0x4816c1){return _0x4816c1();}};return ENVIRONMENT_CONFIGS[_0x223a3a['mnArs'](getCurrentEnvironment)]['apiBaseUrl'];}export function getAiProxyUrl(){const _0x403572=_0x43e2b0;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x403572(0x116)];}export function getMcpAuthUrl(){const _0x104440=_0x43e2b0;return process[_0x104440(0x107)][_0x104440(0x105)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['mcpAuthUrl'];}function _0x3089(_0xadee0a,_0x2936a9){_0xadee0a=_0xadee0a-0xff;const _0x124761=_0x1247();let _0x308982=_0x124761[_0xadee0a];return _0x308982;}export function isByokEnabled(){const _0x117314=_0x43e2b0,_0x5774fe={'sinRB':function(_0x429cf2,_0x3f84aa){return _0x429cf2===_0x3f84aa;},'LSFQi':'true'};return _0x5774fe['sinRB'](process['env']['RANGER_BYOK'],_0x5774fe[_0x117314(0x11e)]);}function isVerificationTransport(_0x51b672){const _0x5ef548=_0x43e2b0,_0x2ecc26={'ekcGU':function(_0x5df18f,_0xaf516b){return _0x5df18f===_0xaf516b;},'uZmOr':_0x5ef548(0x124)};return _0x2ecc26[_0x5ef548(0x100)](_0x51b672,'mcp')||_0x2ecc26['ekcGU'](_0x51b672,_0x2ecc26[_0x5ef548(0x113)])||_0x51b672==='nova-act-cli';}const LEGACY_TRANSPORT_ENV_VARS=[_0x43e2b0(0x10e),'RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x10eca4=_0x43e2b0,_0x154d0e={'qZbzF':function(_0x33577e,_0x5f263c){return _0x33577e(_0x5f263c);}},_0x56675b=process['env']['RANGER_TRANSPORT']?.[_0x10eca4(0x104)]();if(_0x56675b){if(_0x154d0e['qZbzF'](isVerificationTransport,_0x56675b))return _0x56675b;throw new Error(_0x10eca4(0x111)+_0x56675b+_0x10eca4(0x10f));}const _0x405fe2=LEGACY_TRANSPORT_ENV_VARS[_0x10eca4(0x121)](_0xa7825b=>process[_0x10eca4(0x107)][_0xa7825b]);if(_0x405fe2)throw new Error(_0x405fe2+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20or\x20RANGER_TRANSPORT=nova-act-cli.');return _0x10eca4(0x106);}
1
+ function _0x4b89(){const _0x1a404a=['XaWvJ','mvGMo','off','iyZeS','ZEtTL','http://localhost:8080/mcp','16816869bBvUze','5ykNKZj','\x22.\x20','RANGER_CLI_ENV','https://ai-proxy-301751771437.us-central1.run.app','https://ai-proxy-716115358910.us-central1.run.app','RANGER_USE_NOVA_ACT','https://mcp-auth.ranger.net/mcp','728QhXdzy','[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22','auto','525656vqidxC','\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.','72320AyRXdk','trim','env','https://mcp-auth.staging.ranger.net/mcp','http://localhost:8080','client_01J9CBYM2DKWV9HM17D95Z540K','error','toLowerCase','Btrjd','230398IOcpgo','117257aXAYdg','QDOkL','RXUiY','2029299CNWECk','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','https://api.ranger.net','RANGER_HOOKS','4062222dPLfow','RANGER_TRANSPORT','nova-act-cli','mcpAuthUrl','prod','true','client_01J9CBYM7M5ZETCF7G6614DXR2','http://localhost:8090','playwright-cli','pHfDO'];_0x4b89=function(){return _0x1a404a;};return _0x4b89();}const _0x26f9dd=_0x179f;(function(_0x238c7a,_0x14bc40){const _0x4e5393=_0x179f,_0x28d5a6=_0x238c7a();while(!![]){try{const _0x4a264c=parseInt(_0x4e5393(0xef))/0x1+parseInt(_0x4e5393(0xee))/0x2+parseInt(_0x4e5393(0xf2))/0x3+-parseInt(_0x4e5393(0xe3))/0x4*(parseInt(_0x4e5393(0xd9))/0x5)+parseInt(_0x4e5393(0xf6))/0x6+parseInt(_0x4e5393(0xe0))/0x7*(parseInt(_0x4e5393(0xe5))/0x8)+-parseInt(_0x4e5393(0xd8))/0x9;if(_0x4a264c===_0x14bc40)break;else _0x28d5a6['push'](_0x28d5a6['shift']());}catch(_0x13703b){_0x28d5a6['push'](_0x28d5a6['shift']());}}}(_0x4b89,0x80733));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x26f9dd(0xf4),'workosClientId':_0x26f9dd(0xfc),'aiProxyUrl':_0x26f9dd(0xdd),'mcpAuthUrl':_0x26f9dd(0xdf)},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':_0x26f9dd(0xea),'aiProxyUrl':_0x26f9dd(0xdc),'mcpAuthUrl':_0x26f9dd(0xe8)},'local':{'apiBaseUrl':_0x26f9dd(0xe9),'workosClientId':_0x26f9dd(0xea),'aiProxyUrl':_0x26f9dd(0xfd),'mcpAuthUrl':_0x26f9dd(0xd7)}};export const DEFAULT_ENVIRONMENT=_0x26f9dd(0xfa);export function isValidEnvironment(_0x5e2500){const _0x5e9da9=_0x26f9dd,_0x5b96f3={'FgQln':'prod','ZEtTL':function(_0x3612fe,_0x58218c){return _0x3612fe===_0x58218c;},'Altcj':'local'};return _0x5e2500===_0x5b96f3['FgQln']||_0x5b96f3[_0x5e9da9(0xd6)](_0x5e2500,'staging')||_0x5b96f3[_0x5e9da9(0xd6)](_0x5e2500,_0x5b96f3['Altcj']);}export function getCurrentEnvironment(){const _0x2b58a9=_0x26f9dd,_0x38902c=process[_0x2b58a9(0xe7)][_0x2b58a9(0xdb)];if(_0x38902c&&isValidEnvironment(_0x38902c))return _0x38902c;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x3114d5=_0x26f9dd,_0x2b5f0d={'iyZeS':function(_0x27fa55){return _0x27fa55();}};return ENVIRONMENT_CONFIGS[_0x2b5f0d[_0x3114d5(0xd5)](getCurrentEnvironment)]['apiBaseUrl'];}export function getAiProxyUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x54a432=_0x26f9dd;return process[_0x54a432(0xe7)]['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x54a432(0xf9)];}function _0x179f(_0x2840cd,_0x420999){_0x2840cd=_0x2840cd-0xd4;const _0x4b89e3=_0x4b89();let _0x179f9f=_0x4b89e3[_0x2840cd];return _0x179f9f;}export function isByokEnabled(){const _0x36617c=_0x26f9dd;return process[_0x36617c(0xe7)]['RANGER_BYOK']===_0x36617c(0xfb);}function isVerificationTransport(_0x419e3a){const _0x1e26ab=_0x26f9dd,_0xba4aae={'Btrjd':'mcp','pHfDO':function(_0x214f69,_0x28e71c){return _0x214f69===_0x28e71c;},'uxNnd':'rangerwright-cli'};return _0x419e3a===_0xba4aae[_0x1e26ab(0xed)]||_0xba4aae[_0x1e26ab(0xff)](_0x419e3a,_0x1e26ab(0xfe))||_0x419e3a===_0x1e26ab(0xf8)||_0xba4aae['pHfDO'](_0x419e3a,_0xba4aae['uxNnd']);}const LEGACY_TRANSPORT_ENV_VARS=[_0x26f9dd(0xde),'RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x479ebb=_0x26f9dd,_0x5813f0={'mvGMo':function(_0x1b46b5,_0x353bff){return _0x1b46b5(_0x353bff);}},_0x1bee7d=process[_0x479ebb(0xe7)][_0x479ebb(0xf7)]?.[_0x479ebb(0xe6)]();if(_0x1bee7d){if(_0x5813f0[_0x479ebb(0x101)](isVerificationTransport,_0x1bee7d))return _0x1bee7d;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x1bee7d+_0x479ebb(0xf3));}const _0x577a71=LEGACY_TRANSPORT_ENV_VARS['find'](_0x5c0704=>process[_0x479ebb(0xe7)][_0x5c0704]);if(_0x577a71)throw new Error(_0x577a71+_0x479ebb(0xe4));return'mcp';}export function resolveHookMode(_0x289207=process['env']){const _0x51eaf0=_0x26f9dd,_0x57c02f={'XaWvJ':function(_0x7f8122,_0xa8d186){return _0x7f8122===_0xa8d186;},'QDOkL':function(_0x3e0f11,_0x2908d0){return _0x3e0f11===_0x2908d0;},'RXUiY':function(_0x525af4,_0x3bf94c){return _0x525af4+_0x3bf94c;},'zeYGC':'auto'},_0xd7f12d=_0x289207[_0x51eaf0(0xf5)]?.[_0x51eaf0(0xe6)]()[_0x51eaf0(0xec)]();if(!_0xd7f12d)return'auto';if(_0x57c02f[_0x51eaf0(0x100)](_0xd7f12d,_0x51eaf0(0xd4))||_0xd7f12d==='on'||_0x57c02f[_0x51eaf0(0xf0)](_0xd7f12d,_0x51eaf0(0xe2)))return _0xd7f12d;return console[_0x51eaf0(0xeb)](_0x57c02f[_0x51eaf0(0xf1)](_0x51eaf0(0xe1)+_0x289207['RANGER_HOOKS']+_0x51eaf0(0xda),'Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.')),_0x57c02f['zeYGC'];}
@@ -1 +1 @@
1
- (function(_0x3f40ed,_0x5b98e9){const _0x4e37d2=_0xe605,_0x1f8268=_0x3f40ed();while(!![]){try{const _0x57436a=-parseInt(_0x4e37d2(0x1b8))/0x1+parseInt(_0x4e37d2(0x1b1))/0x2+parseInt(_0x4e37d2(0x1c5))/0x3+-parseInt(_0x4e37d2(0x1bf))/0x4+-parseInt(_0x4e37d2(0x1b5))/0x5*(parseInt(_0x4e37d2(0x1cd))/0x6)+parseInt(_0x4e37d2(0x1ac))/0x7+-parseInt(_0x4e37d2(0x1aa))/0x8*(-parseInt(_0x4e37d2(0x1d4))/0x9);if(_0x57436a===_0x5b98e9)break;else _0x1f8268['push'](_0x1f8268['shift']());}catch(_0x154b8f){_0x1f8268['push'](_0x1f8268['shift']());}}}(_0xc5c6,0xeb697));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x2dbdd1){const _0x58accf=_0xe605,_0x136e5c={'ttLHf':function(_0x1e5764){return _0x1e5764();},'hNvEY':'https://dashboard.ranger.net/billing'},_0x12bd59=await _0x136e5c['ttLHf'](getToken);if(!_0x12bd59)throw new Error(_0x58accf(0x1c9));const _0x11d730=getApiBaseUrl(),_0x4cab46=await fetch(_0x11d730+'/api/v1/mcp/features',{'method':'POST','headers':{'Authorization':_0x58accf(0x1be)+_0x12bd59,'Content-Type':_0x58accf(0x1bd)},'body':JSON[_0x58accf(0x1e2)](_0x2dbdd1)});if(!_0x4cab46['ok']){if(_0x4cab46['status']===0x192){const _0x1ffaef=await _0x4cab46['json'](),_0x25003c=_0x1ffaef[_0x58accf(0x1a3)]||_0x136e5c[_0x58accf(0x1b6)];throw new Error((_0x1ffaef[_0x58accf(0x1d5)]||_0x58accf(0x1b0))+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x25003c);}const _0x3022fc=await _0x4cab46['text']();throw new Error(_0x58accf(0x1e4)+_0x3022fc);}return _0x4cab46[_0x58accf(0x1a7)]();}export async function listFeatures(_0x4c9009){const _0x565c7a=_0xe605,_0xb70a7f={'VltQT':function(_0x599d56){return _0x599d56();},'VJiQR':_0x565c7a(0x1cc),'uStzO':_0x565c7a(0x1cf),'bbtJQ':'GET'},_0x27a29f=await _0xb70a7f['VltQT'](getToken);if(!_0x27a29f)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5b63cc=getApiBaseUrl(),_0x1c722e=new URLSearchParams();if(_0x4c9009?.[_0x565c7a(0x1d3)])_0x1c722e['set']('gitRepoUrl',_0x4c9009[_0x565c7a(0x1d3)]);if(_0x4c9009?.['gitBranch'])_0x1c722e[_0x565c7a(0x1ae)](_0xb70a7f['VJiQR'],_0x4c9009['gitBranch']);if(_0x4c9009?.['limit'])_0x1c722e[_0x565c7a(0x1ae)](_0x565c7a(0x1cb),_0x4c9009['limit'][_0x565c7a(0x1a6)]());if(_0x4c9009?.['offset'])_0x1c722e['set']('offset',_0x4c9009['offset'][_0x565c7a(0x1a6)]());if(_0x4c9009?.[_0x565c7a(0x1e3)])_0x1c722e[_0x565c7a(0x1ae)](_0x565c7a(0x1e3),_0xb70a7f[_0x565c7a(0x1b3)]);const _0x50e373=_0x5b63cc+'/api/v1/mcp/features'+(_0x1c722e[_0x565c7a(0x1a6)]()?'?'+_0x1c722e['toString']():''),_0x36b3a6=await fetch(_0x50e373,{'method':_0xb70a7f['bbtJQ'],'headers':{'Authorization':'Bearer\x20'+_0x27a29f}});if(!_0x36b3a6['ok']){const _0x429d29=await _0x36b3a6['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x429d29);}return _0x36b3a6[_0x565c7a(0x1a7)]();}export async function getFeature(_0x53b9eb){const _0x5075fb=_0xe605,_0x244632={'QWBTb':function(_0x294c8e){return _0x294c8e();}},_0x51fa1a=await getToken();if(!_0x51fa1a)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x318a50=_0x244632['QWBTb'](getApiBaseUrl),_0x15a5ee=await fetch(_0x318a50+_0x5075fb(0x1e5)+_0x53b9eb,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x51fa1a}});if(!_0x15a5ee['ok']){const _0x13cdbf=await _0x15a5ee[_0x5075fb(0x1ce)]();throw new Error(_0x5075fb(0x1ad)+_0x13cdbf);}return _0x15a5ee[_0x5075fb(0x1a7)]();}export async function updateFeature(_0x222be5,_0x4a93b2){const _0x2f22d6=_0xe605,_0x138596={'kAaNv':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','vTOUU':function(_0x2804c0){return _0x2804c0();},'JbIIA':_0x2f22d6(0x1dc)},_0x1e6d84=await getToken();if(!_0x1e6d84)throw new Error(_0x138596['kAaNv']);const _0x1e9a67=_0x138596[_0x2f22d6(0x1e1)](getApiBaseUrl),_0x14faeb=await fetch(_0x1e9a67+_0x2f22d6(0x1e5)+_0x222be5,{'method':_0x138596[_0x2f22d6(0x1a0)],'headers':{'Authorization':_0x2f22d6(0x1be)+_0x1e6d84,'Content-Type':_0x2f22d6(0x1bd)},'body':JSON[_0x2f22d6(0x1e2)](_0x4a93b2)});if(!_0x14faeb['ok']){const _0x47c85b=await _0x14faeb['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x47c85b);}return _0x14faeb['json']();}export async function createChecklistItem(_0x4442b8,_0x2d6653,_0x8568dc){const _0xab9f54=_0xe605,_0x2358d3={'pjTsj':function(_0x47c745,_0x5caf59,_0x5ee4e8){return _0x47c745(_0x5caf59,_0x5ee4e8);},'HplaC':'POST'},_0xd6998e=await getToken();if(!_0xd6998e)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x399d47=getApiBaseUrl(),_0x555cf0=await _0x2358d3[_0xab9f54(0x1ba)](fetch,_0x399d47+_0xab9f54(0x1e5)+_0x4442b8+_0xab9f54(0x1c6),{'method':_0x2358d3[_0xab9f54(0x1c7)],'headers':{'Authorization':_0xab9f54(0x1be)+_0xd6998e,'Content-Type':_0xab9f54(0x1bd)},'body':JSON[_0xab9f54(0x1e2)]({'description':_0x2d6653,'position':_0x8568dc})});if(!_0x555cf0['ok']){const _0x2d7a58=await _0x555cf0[_0xab9f54(0x1ce)]();throw new Error(_0xab9f54(0x1c1)+_0x2d7a58);}return _0x555cf0[_0xab9f54(0x1a7)]();}export async function updateChecklistItem(_0x57b3a7,_0xedddbe,_0x2342a5){const _0x2c4840=_0xe605,_0x18d2d3={'oLzpB':_0x2c4840(0x1c9),'fKkgv':function(_0x18bca5){return _0x18bca5();},'iPPgb':function(_0x2ce2c7,_0x5cf0bb,_0x23c667){return _0x2ce2c7(_0x5cf0bb,_0x23c667);},'GrxcN':'updateChecklistItem'};return _0x18d2d3[_0x2c4840(0x1d0)](withRetry,async()=>{const _0xd0be26=_0x2c4840,_0x250b72=await getToken();if(!_0x250b72)throw new Error(_0x18d2d3[_0xd0be26(0x1b9)]);const _0x1570ad=_0x18d2d3[_0xd0be26(0x1ca)](getApiBaseUrl),_0x33db29=await fetch(_0x1570ad+'/api/v1/mcp/features/'+_0x57b3a7+'/checklist/'+_0xedddbe,{'method':'PATCH','headers':{'Authorization':'Bearer\x20'+_0x250b72,'Content-Type':_0xd0be26(0x1bd)},'body':JSON[_0xd0be26(0x1e2)](_0x2342a5)});if(!_0x33db29['ok']){const _0x8eeca8=await _0x33db29[_0xd0be26(0x1ce)]();throw new Error(_0xd0be26(0x1d8)+_0x8eeca8);}return _0x33db29['json']();},{'label':_0x18d2d3[_0x2c4840(0x1de)]});}export async function getFeatureReport(_0x541992){const _0x2fa262=_0xe605,_0x3a27ef={'uBaJO':function(_0x26195d){return _0x26195d();},'ApotS':_0x2fa262(0x1c9),'ZzJqd':function(_0x523e27){return _0x523e27();},'wKgLZ':_0x2fa262(0x1d9)},_0x416672=await _0x3a27ef['uBaJO'](getToken);if(!_0x416672)throw new Error(_0x3a27ef['ApotS']);const _0x18330e=_0x3a27ef['ZzJqd'](getApiBaseUrl),_0x78446a=await fetch(_0x18330e+_0x2fa262(0x1e5)+_0x541992+'/report',{'method':_0x3a27ef[_0x2fa262(0x1bc)],'headers':{'Authorization':_0x2fa262(0x1be)+_0x416672}});if(!_0x78446a['ok']){const _0x37bd5d=await _0x78446a[_0x2fa262(0x1ce)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x37bd5d);}return _0x78446a[_0x2fa262(0x1a7)]();}export async function getFeatureReportMarkdown(_0x1fbb9a,_0xff4cdf){const _0x1d043b=_0xe605,_0x3394ad={'NpDzh':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','UFLku':function(_0x40a60a,_0x175c25){return _0x40a60a>_0x175c25;},'DOXtH':'itemIds','Gloxz':function(_0x573480,_0x2d784a){return _0x573480&&_0x2d784a;},'aEWKZ':_0x1d043b(0x1c8),'ihvQy':function(_0x170f5b,_0xa83fde,_0x22880c){return _0x170f5b(_0xa83fde,_0x22880c);},'ZreJb':_0x1d043b(0x1d9)},_0x1f8bc4=await getToken();if(!_0x1f8bc4)throw new Error(_0x3394ad[_0x1d043b(0x1a4)]);const _0x3cc9a3=getApiBaseUrl(),_0x1489d6=new URLSearchParams(),_0x5a1199=_0x3394ad['UFLku'](_0xff4cdf?.[_0x1d043b(0x1e0)]?.[_0x1d043b(0x1da)]??0x0,0x0),_0x357615=Boolean(_0xff4cdf?.[_0x1d043b(0x1a1)]);_0x5a1199&&_0xff4cdf?.[_0x1d043b(0x1e0)]&&_0x1489d6['set'](_0x3394ad['DOXtH'],_0xff4cdf[_0x1d043b(0x1e0)][_0x1d043b(0x1bb)](','));_0x357615&&_0xff4cdf?.['sessionId']&&_0x1489d6[_0x1d043b(0x1ae)](_0x1d043b(0x1a1),_0xff4cdf[_0x1d043b(0x1a1)]);_0x3394ad[_0x1d043b(0x1a5)](!_0x5a1199,!_0x357615)&&_0xff4cdf?.[_0x1d043b(0x1c8)]&&_0x1489d6['set'](_0x3394ad[_0x1d043b(0x1d6)],_0xff4cdf['style']);const _0x4bd250=_0x3cc9a3+'/api/v1/mcp/features/'+_0x1fbb9a+'/report/markdown',_0x2a162d=''+_0x4bd250+(_0x1489d6[_0x1d043b(0x1a6)]()?'?'+_0x1489d6['toString']():''),_0x43ec21=await _0x3394ad[_0x1d043b(0x1b4)](fetch,_0x2a162d,{'method':_0x3394ad[_0x1d043b(0x1a2)],'headers':{'Authorization':_0x1d043b(0x1be)+_0x1f8bc4}});if(!_0x43ec21['ok']){const _0x4a04c0=await _0x43ec21['text']();throw new Error(_0x1d043b(0x1c0)+_0x4a04c0);}return _0x43ec21['text']();}export async function listFeatureSessions(_0x6ef58d){const _0x1b255c=_0xe605,_0x2a7a8f={'XCUAS':function(_0x5688e5){return _0x5688e5();},'FYukR':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','qNmcd':'GET'},_0x121cc2=await _0x2a7a8f['XCUAS'](getToken);if(!_0x121cc2)throw new Error(_0x2a7a8f['FYukR']);const _0x3a368b=getApiBaseUrl(),_0x1ca526=await fetch(_0x3a368b+_0x1b255c(0x1e5)+_0x6ef58d+'/sessions',{'method':_0x2a7a8f['qNmcd'],'headers':{'Authorization':'Bearer\x20'+_0x121cc2}});if(!_0x1ca526['ok']){const _0x39d9de=await _0x1ca526['text']();throw new Error(_0x1b255c(0x1b2)+_0x39d9de);}return _0x1ca526[_0x1b255c(0x1a7)]();}export async function startSession(_0x2f7c3e,_0x5ef68a){const _0x18df5d=_0xe605,_0x50e69b={'zCSWf':function(_0x1ffc97){return _0x1ffc97();},'yYjkJ':function(_0x37cd07,_0x59819c,_0x1a4fe9){return _0x37cd07(_0x59819c,_0x1a4fe9);}},_0x5f540b=await _0x50e69b[_0x18df5d(0x1b7)](getToken);if(!_0x5f540b)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x422223=getApiBaseUrl(),_0x3baf59=await _0x50e69b[_0x18df5d(0x1d2)](fetch,_0x422223+_0x18df5d(0x1e5)+_0x2f7c3e+_0x18df5d(0x1c4)+_0x5ef68a+'/start',{'method':_0x18df5d(0x1af),'headers':{'Authorization':_0x18df5d(0x1be)+_0x5f540b}});if(!_0x3baf59['ok']){const _0x2e340c=await _0x3baf59[_0x18df5d(0x1ce)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x2e340c);}return _0x3baf59[_0x18df5d(0x1a7)]();}export async function concludeSession(_0x5cc423,_0x18104b){const _0xa02795=_0xe605,_0x4c4239={'XVDnZ':function(_0x2989c9){return _0x2989c9();},'caOjI':function(_0x3adef0){return _0x3adef0();},'TDaEV':function(_0x4211a7,_0x547394,_0x2c197e){return _0x4211a7(_0x547394,_0x2c197e);}},_0x370708=await _0x4c4239['XVDnZ'](getToken);if(!_0x370708)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x25d3d9=_0x4c4239['caOjI'](getApiBaseUrl),_0x1b05ac=await _0x4c4239['TDaEV'](fetch,_0x25d3d9+'/api/v1/mcp/features/'+_0x5cc423+_0xa02795(0x1c4)+_0x18104b+'/conclude',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x370708}});if(!_0x1b05ac['ok']){const _0x502286=await _0x1b05ac[_0xa02795(0x1ce)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x502286);}return _0x1b05ac['json']();}export async function getActionItems(_0x31e205){const _0x283e16=_0xe605,_0x3484ed={'upHSL':function(_0x551b3e,_0x204875,_0x18269b){return _0x551b3e(_0x204875,_0x18269b);},'KBuZm':_0x283e16(0x1d9)},_0x515809=await getToken();if(!_0x515809)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5cd321=getApiBaseUrl(),_0x49a901=await _0x3484ed['upHSL'](fetch,_0x5cd321+'/api/v1/mcp/features/'+_0x31e205+_0x283e16(0x1df),{'method':_0x3484ed['KBuZm'],'headers':{'Authorization':_0x283e16(0x1be)+_0x515809}});if(!_0x49a901['ok']){const _0x7ead99=await _0x49a901[_0x283e16(0x1ce)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x7ead99);}return _0x49a901['json']();}export async function getItemFeedback(_0x3cadfa,_0x1184e6){const _0x594328=_0xe605,_0x2aa4fd={'HANVU':function(_0x550a0a){return _0x550a0a();},'TKIaL':function(_0x35becf,_0x30c964,_0x2cc657){return _0x35becf(_0x30c964,_0x2cc657);},'irQXz':_0x594328(0x1d9)},_0x118c70=await _0x2aa4fd['HANVU'](getToken);if(!_0x118c70)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x75d15e=getApiBaseUrl(),_0x342cb8=await _0x2aa4fd['TKIaL'](fetch,_0x75d15e+'/api/v1/mcp/features/'+_0x3cadfa+_0x594328(0x1dd)+_0x1184e6+'/feedback',{'method':_0x2aa4fd[_0x594328(0x1ab)],'headers':{'Authorization':'Bearer\x20'+_0x118c70}});if(!_0x342cb8['ok']){const _0x3d4efd=await _0x342cb8[_0x594328(0x1ce)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x3d4efd);}return _0x342cb8[_0x594328(0x1a7)]();}export async function markCommentsAddressed(_0x520c29,_0x2d264c,_0x30dd65){const _0x15b1cf=_0xe605,_0x1192de={'JKvuM':function(_0x869a2e){return _0x869a2e();},'IYrvM':'POST'},_0x584802=await _0x1192de[_0x15b1cf(0x1d1)](getToken);if(!_0x584802)throw new Error(_0x15b1cf(0x1c9));const _0x4ff116=getApiBaseUrl(),_0x506481=await fetch(_0x4ff116+_0x15b1cf(0x1e5)+_0x520c29+_0x15b1cf(0x1a8),{'method':_0x1192de[_0x15b1cf(0x1c3)],'headers':{'Authorization':_0x15b1cf(0x1be)+_0x584802,'Content-Type':'application/json'},'body':JSON['stringify']({'checklistItemId':_0x2d264c,'commentIds':_0x30dd65})});if(!_0x506481['ok']){const _0x4ebb4f=await _0x506481[_0x15b1cf(0x1ce)]();throw new Error(_0x15b1cf(0x1c2)+_0x4ebb4f);}}function _0xe605(_0x51aeb0,_0x21caed){_0x51aeb0=_0x51aeb0-0x1a0;const _0xc5c65=_0xc5c6();let _0xe6053e=_0xc5c65[_0x51aeb0];return _0xe6053e;}export async function softDeleteFeature(_0x1182a1){const _0x4767fc=_0xe605,_0x1f98b0={'FbgIe':function(_0x1e797c){return _0x1e797c();},'hUHqH':_0x4767fc(0x1c9),'RtPkG':'DELETE'},_0x488d99=await _0x1f98b0[_0x4767fc(0x1db)](getToken);if(!_0x488d99)throw new Error(_0x1f98b0['hUHqH']);const _0x2e105f=getApiBaseUrl(),_0x46b946=await fetch(_0x2e105f+_0x4767fc(0x1e5)+_0x1182a1,{'method':_0x1f98b0['RtPkG'],'headers':{'Authorization':'Bearer\x20'+_0x488d99}});if(!_0x46b946['ok']){const _0x35db87=await _0x46b946['text']();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x35db87);}}export async function restoreFeature(_0x54cf3e){const _0x344e36=_0xe605,_0x27698b={'iaPfD':function(_0x5805a6){return _0x5805a6();},'NDEqJ':function(_0xcaeeba,_0x496a89,_0x59a959){return _0xcaeeba(_0x496a89,_0x59a959);},'YEnsP':'POST'},_0x1ccce4=await getToken();if(!_0x1ccce4)throw new Error(_0x344e36(0x1c9));const _0x2c23d8=_0x27698b['iaPfD'](getApiBaseUrl),_0x11aab6=await _0x27698b[_0x344e36(0x1a9)](fetch,_0x2c23d8+_0x344e36(0x1e5)+_0x54cf3e+'/restore',{'method':_0x27698b[_0x344e36(0x1d7)],'headers':{'Authorization':'Bearer\x20'+_0x1ccce4}});if(!_0x11aab6['ok']){const _0x2b318d=await _0x11aab6['text']();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x2b318d);}}function _0xc5c6(){const _0x22841d=['530NfZVAK','hNvEY','zCSWf','239332kIZoKH','oLzpB','pjTsj','join','wKgLZ','application/json','Bearer\x20','5679080twuQev','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','Failed\x20to\x20create\x20scenario:\x20','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','IYrvM','/sessions/','1914186LYHgLW','/checklist','HplaC','style','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','fKkgv','limit','gitBranch','96948BvgJnz','text','true','iPPgb','JKvuM','yYjkJ','gitRepoUrl','18xAJYdG','message','aEWKZ','YEnsP','Failed\x20to\x20update\x20scenario:\x20','GET','length','FbgIe','PATCH','/checklist-items/','GrxcN','/action-items','itemIds','vTOUU','stringify','includeDeleted','Failed\x20to\x20create\x20feature\x20review:\x20','/api/v1/mcp/features/','JbIIA','sessionId','ZreJb','billingUrl','NpDzh','Gloxz','toString','json','/comments/address','NDEqJ','1732552uwWHxx','irQXz','10305099qbRFdJ','Failed\x20to\x20get\x20feature\x20review:\x20','set','POST','Feature\x20limit\x20exceeded','3585480mbFluN','Failed\x20to\x20list\x20sessions:\x20','uStzO','ihvQy'];_0xc5c6=function(){return _0x22841d;};return _0xc5c6();}
1
+ (function(_0x359ece,_0x3523d0){const _0x44952e=_0x2434,_0x1c93df=_0x359ece();while(!![]){try{const _0x2dae9d=parseInt(_0x44952e(0x177))/0x1+-parseInt(_0x44952e(0x13e))/0x2*(parseInt(_0x44952e(0x137))/0x3)+parseInt(_0x44952e(0x132))/0x4*(parseInt(_0x44952e(0x173))/0x5)+-parseInt(_0x44952e(0x17b))/0x6+parseInt(_0x44952e(0x13f))/0x7+parseInt(_0x44952e(0x149))/0x8+-parseInt(_0x44952e(0x14a))/0x9*(parseInt(_0x44952e(0x174))/0xa);if(_0x2dae9d===_0x3523d0)break;else _0x1c93df['push'](_0x1c93df['shift']());}catch(_0x4949ba){_0x1c93df['push'](_0x1c93df['shift']());}}}(_0x2895,0xd5c94));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x2f295f){const _0x34e735=_0x2434,_0x15d5bc={'BCRSC':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ucPJt':_0x34e735(0x14e),'tWqnu':_0x34e735(0x17a)},_0x3df7da=await getToken();if(!_0x3df7da)throw new Error(_0x15d5bc[_0x34e735(0x158)]);const _0x17b346=getApiBaseUrl(),_0x355d96=await fetch(_0x17b346+'/api/v1/mcp/features',{'method':_0x34e735(0x15e),'headers':{'Authorization':'Bearer\x20'+_0x3df7da,'Content-Type':_0x15d5bc['ucPJt']},'body':JSON[_0x34e735(0x163)](_0x2f295f)});if(!_0x355d96['ok']){if(_0x355d96[_0x34e735(0x151)]===0x192){const _0xb33011=await _0x355d96[_0x34e735(0x139)](),_0x52f201=_0xb33011[_0x34e735(0x144)]||_0x15d5bc[_0x34e735(0x13b)];throw new Error((_0xb33011['message']||'Feature\x20limit\x20exceeded')+_0x34e735(0x14d)+_0x52f201);}const _0x24bde8=await _0x355d96['text']();throw new Error(_0x34e735(0x178)+_0x24bde8);}return _0x355d96[_0x34e735(0x139)]();}export async function listFeatures(_0x4eaedf){const _0x10cdc8=_0x2434,_0x461d40={'GneIT':'gitBranch','mpEDk':'offset','JheXL':_0x10cdc8(0x145),'RUBnr':'true','RPOwG':'GET'},_0x2a1860=await getToken();if(!_0x2a1860)throw new Error(_0x10cdc8(0x167));const _0x448a31=getApiBaseUrl(),_0x180e0a=new URLSearchParams();if(_0x4eaedf?.[_0x10cdc8(0x13d)])_0x180e0a['set'](_0x10cdc8(0x13d),_0x4eaedf['gitRepoUrl']);if(_0x4eaedf?.[_0x10cdc8(0x133)])_0x180e0a['set'](_0x461d40['GneIT'],_0x4eaedf[_0x10cdc8(0x133)]);if(_0x4eaedf?.['limit'])_0x180e0a['set']('limit',_0x4eaedf['limit'][_0x10cdc8(0x171)]());if(_0x4eaedf?.['offset'])_0x180e0a['set'](_0x461d40[_0x10cdc8(0x166)],_0x4eaedf['offset']['toString']());if(_0x4eaedf?.['includeDeleted'])_0x180e0a['set'](_0x461d40[_0x10cdc8(0x14f)],_0x461d40[_0x10cdc8(0x15b)]);const _0x5985f6=_0x448a31+_0x10cdc8(0x175)+(_0x180e0a[_0x10cdc8(0x171)]()?'?'+_0x180e0a[_0x10cdc8(0x171)]():''),_0x4b2455=await fetch(_0x5985f6,{'method':_0x461d40[_0x10cdc8(0x15d)],'headers':{'Authorization':_0x10cdc8(0x16b)+_0x2a1860}});if(!_0x4b2455['ok']){const _0x207ee1=await _0x4b2455[_0x10cdc8(0x16f)]();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x207ee1);}return _0x4b2455[_0x10cdc8(0x139)]();}export async function getFeature(_0x1d4242){const _0x58077b=_0x2434,_0xf0392c={'mcFIO':function(_0x31b0f1){return _0x31b0f1();},'XNUdl':_0x58077b(0x167)},_0x41c565=await _0xf0392c['mcFIO'](getToken);if(!_0x41c565)throw new Error(_0xf0392c['XNUdl']);const _0x2ec336=_0xf0392c[_0x58077b(0x153)](getApiBaseUrl),_0x5e4cda=await fetch(_0x2ec336+'/api/v1/mcp/features/'+_0x1d4242,{'method':'GET','headers':{'Authorization':_0x58077b(0x16b)+_0x41c565}});if(!_0x5e4cda['ok']){const _0x194f3c=await _0x5e4cda[_0x58077b(0x16f)]();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x194f3c);}return _0x5e4cda[_0x58077b(0x139)]();}export async function updateFeature(_0x7c448f,_0x1c1ba3){const _0x4598bb=_0x2434,_0x3b603b={'WqIKa':_0x4598bb(0x167),'GMCix':function(_0x289017,_0x3e70ff,_0x5b88df){return _0x289017(_0x3e70ff,_0x5b88df);},'TLHzG':'PATCH','Gvkwe':_0x4598bb(0x14e)},_0x263d2e=await getToken();if(!_0x263d2e)throw new Error(_0x3b603b[_0x4598bb(0x159)]);const _0x54f36b=getApiBaseUrl(),_0xad38b0=await _0x3b603b[_0x4598bb(0x136)](fetch,_0x54f36b+_0x4598bb(0x161)+_0x7c448f,{'method':_0x3b603b['TLHzG'],'headers':{'Authorization':_0x4598bb(0x16b)+_0x263d2e,'Content-Type':_0x3b603b['Gvkwe']},'body':JSON['stringify'](_0x1c1ba3)});if(!_0xad38b0['ok']){const _0xcdcfa=await _0xad38b0[_0x4598bb(0x16f)]();throw new Error(_0x4598bb(0x148)+_0xcdcfa);}return _0xad38b0[_0x4598bb(0x139)]();}export async function createChecklistItem(_0x42c896,_0x268bfe,_0x4f69c7){const _0x20328f=_0x2434,_0x1b13b9={'FhMmF':'POST'},_0x118f26=await getToken();if(!_0x118f26)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x51050a=getApiBaseUrl(),_0x120570=await fetch(_0x51050a+'/api/v1/mcp/features/'+_0x42c896+_0x20328f(0x16a),{'method':_0x1b13b9['FhMmF'],'headers':{'Authorization':_0x20328f(0x16b)+_0x118f26,'Content-Type':_0x20328f(0x14e)},'body':JSON[_0x20328f(0x163)]({'description':_0x268bfe,'position':_0x4f69c7})});if(!_0x120570['ok']){const _0x22fbf1=await _0x120570['text']();throw new Error(_0x20328f(0x16c)+_0x22fbf1);}return _0x120570[_0x20328f(0x139)]();}export async function updateChecklistItem(_0x3f4174,_0x4a4ef8,_0x1ffb4b){const _0x2e063b=_0x2434,_0x3878b5={'epLWM':function(_0x52b09d){return _0x52b09d();},'MVvei':function(_0x2d6d21,_0x3e20d0,_0x18e220){return _0x2d6d21(_0x3e20d0,_0x18e220);},'GFftK':'PATCH'};return withRetry(async()=>{const _0x3c621=_0x2434,_0x2bb566=await getToken();if(!_0x2bb566)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1c81b7=_0x3878b5[_0x3c621(0x146)](getApiBaseUrl),_0x31b995=await _0x3878b5['MVvei'](fetch,_0x1c81b7+_0x3c621(0x161)+_0x3f4174+_0x3c621(0x16e)+_0x4a4ef8,{'method':_0x3878b5[_0x3c621(0x17d)],'headers':{'Authorization':_0x3c621(0x16b)+_0x2bb566,'Content-Type':_0x3c621(0x14e)},'body':JSON['stringify'](_0x1ffb4b)});if(!_0x31b995['ok']){const _0x58f536=await _0x31b995['text']();throw new Error(_0x3c621(0x143)+_0x58f536);}return _0x31b995['json']();},{'label':_0x2e063b(0x156)});}export async function getFeatureReport(_0x410a65){const _0x54023a=_0x2434,_0x36bc3f={'Lkaax':function(_0xe99aea){return _0xe99aea();}},_0x2527a2=await _0x36bc3f[_0x54023a(0x142)](getToken);if(!_0x2527a2)throw new Error(_0x54023a(0x167));const _0x206cbc=getApiBaseUrl(),_0x268530=await fetch(_0x206cbc+'/api/v1/mcp/features/'+_0x410a65+'/report',{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x2527a2}});if(!_0x268530['ok']){const _0x5b563c=await _0x268530['text']();throw new Error(_0x54023a(0x13a)+_0x5b563c);}return _0x268530[_0x54023a(0x139)]();}export async function getFeatureReportMarkdown(_0x1dc508,_0x2e38bd){const _0x5beab9=_0x2434,_0x1e5ad4={'EiiCm':_0x5beab9(0x167),'WZwBh':'style','FCSMs':function(_0x4ca8b1,_0x3c548b,_0x526ce9){return _0x4ca8b1(_0x3c548b,_0x526ce9);},'mBlqU':_0x5beab9(0x172)},_0x5aa60b=await getToken();if(!_0x5aa60b)throw new Error(_0x1e5ad4[_0x5beab9(0x13c)]);const _0x2ae395=getApiBaseUrl(),_0x4ab570=new URLSearchParams(),_0xecb6ea=(_0x2e38bd?.[_0x5beab9(0x170)]?.['length']??0x0)>0x0,_0x32155d=Boolean(_0x2e38bd?.[_0x5beab9(0x17c)]);_0xecb6ea&&_0x2e38bd?.[_0x5beab9(0x170)]&&_0x4ab570['set'](_0x5beab9(0x170),_0x2e38bd[_0x5beab9(0x170)][_0x5beab9(0x14c)](','));_0x32155d&&_0x2e38bd?.['sessionId']&&_0x4ab570['set']('sessionId',_0x2e38bd['sessionId']);!_0xecb6ea&&!_0x32155d&&_0x2e38bd?.[_0x5beab9(0x16d)]&&_0x4ab570[_0x5beab9(0x138)](_0x1e5ad4[_0x5beab9(0x157)],_0x2e38bd[_0x5beab9(0x16d)]);const _0x52e7a9=_0x2ae395+_0x5beab9(0x161)+_0x1dc508+'/report/markdown',_0x597dbf=''+_0x52e7a9+(_0x4ab570['toString']()?'?'+_0x4ab570[_0x5beab9(0x171)]():''),_0x5922f7=await _0x1e5ad4[_0x5beab9(0x14b)](fetch,_0x597dbf,{'method':_0x1e5ad4[_0x5beab9(0x154)],'headers':{'Authorization':'Bearer\x20'+_0x5aa60b}});if(!_0x5922f7['ok']){const _0x1ea21c=await _0x5922f7['text']();throw new Error(_0x5beab9(0x135)+_0x1ea21c);}return _0x5922f7['text']();}export async function listFeatureSessions(_0x2f35d1){const _0x2e1943=_0x2434,_0x517e37={'GieyB':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','rzWCO':'GET'},_0x2345df=await getToken();if(!_0x2345df)throw new Error(_0x517e37['GieyB']);const _0x419b12=getApiBaseUrl(),_0x52d8ed=await fetch(_0x419b12+'/api/v1/mcp/features/'+_0x2f35d1+_0x2e1943(0x15f),{'method':_0x517e37[_0x2e1943(0x15c)],'headers':{'Authorization':'Bearer\x20'+_0x2345df}});if(!_0x52d8ed['ok']){const _0x101d0d=await _0x52d8ed['text']();throw new Error(_0x2e1943(0x176)+_0x101d0d);}return _0x52d8ed[_0x2e1943(0x139)]();}export async function startSession(_0x47f830,_0x14c2c6){const _0x5ace23=_0x2434,_0x39ffaf={'rfzhx':function(_0x4b04d0){return _0x4b04d0();},'KbXrI':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','hLYVO':function(_0x4f82cd){return _0x4f82cd();}},_0x129536=await _0x39ffaf[_0x5ace23(0x152)](getToken);if(!_0x129536)throw new Error(_0x39ffaf[_0x5ace23(0x134)]);const _0x44ad67=_0x39ffaf['hLYVO'](getApiBaseUrl),_0xb71942=await fetch(_0x44ad67+'/api/v1/mcp/features/'+_0x47f830+_0x5ace23(0x162)+_0x14c2c6+_0x5ace23(0x150),{'method':'POST','headers':{'Authorization':_0x5ace23(0x16b)+_0x129536}});if(!_0xb71942['ok']){const _0x3496f9=await _0xb71942[_0x5ace23(0x16f)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x3496f9);}return _0xb71942[_0x5ace23(0x139)]();}export async function concludeSession(_0x27921a,_0x108373){const _0x3db3fb=_0x2434,_0x35c80f={'SkOlB':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','MnDvp':'POST'},_0xddc08e=await getToken();if(!_0xddc08e)throw new Error(_0x35c80f['SkOlB']);const _0x4c4740=getApiBaseUrl(),_0x1ccf39=await fetch(_0x4c4740+'/api/v1/mcp/features/'+_0x27921a+_0x3db3fb(0x162)+_0x108373+'/conclude',{'method':_0x35c80f['MnDvp'],'headers':{'Authorization':'Bearer\x20'+_0xddc08e}});if(!_0x1ccf39['ok']){const _0x28299f=await _0x1ccf39['text']();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x28299f);}return _0x1ccf39['json']();}function _0x2895(){const _0x2ad3ec=['Failed\x20to\x20update\x20feature\x20review:\x20','13769624PwgZVT','26054181jncOaq','FCSMs','join','\x0a\x0aUpgrade\x20your\x20plan:\x20','application/json','JheXL','/start','status','rfzhx','mcFIO','mBlqU','Failed\x20to\x20delete\x20feature\x20review:\x20','updateChecklistItem','WZwBh','BCRSC','WqIKa','Boxim','RUBnr','rzWCO','RPOwG','POST','/sessions','Failed\x20to\x20get\x20item\x20feedback:\x20','/api/v1/mcp/features/','/sessions/','stringify','Failed\x20to\x20get\x20action\x20items:\x20','UDbBu','mpEDk','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','rtQEV','/restore','/checklist','Bearer\x20','Failed\x20to\x20create\x20scenario:\x20','style','/checklist/','text','itemIds','toString','GET','109715srHhUJ','10ABdKDj','/api/v1/mcp/features','Failed\x20to\x20list\x20sessions:\x20','1562809oOAKvB','Failed\x20to\x20create\x20feature\x20review:\x20','Failed\x20to\x20restore\x20feature\x20review:\x20','https://dashboard.ranger.net/billing','9947646vktjzK','sessionId','GFftK','188gEUZDI','gitBranch','KbXrI','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','GMCix','3JSxZNy','set','json','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','tWqnu','EiiCm','gitRepoUrl','939754AVTvuS','11081434jWXWAd','DwcEF','/comments/address','Lkaax','Failed\x20to\x20update\x20scenario:\x20','billingUrl','includeDeleted','epLWM','DELETE'];_0x2895=function(){return _0x2ad3ec;};return _0x2895();}export async function getActionItems(_0x31d6e2){const _0xde4eff=_0x2434,_0x5da453={'cqiQg':_0xde4eff(0x167),'kvLlk':function(_0x248845){return _0x248845();},'aqKQH':function(_0x2f6292,_0x5dc983,_0x4e7662){return _0x2f6292(_0x5dc983,_0x4e7662);},'TahvA':_0xde4eff(0x172)},_0x330992=await getToken();if(!_0x330992)throw new Error(_0x5da453['cqiQg']);const _0xa71241=_0x5da453['kvLlk'](getApiBaseUrl),_0x3c79e7=await _0x5da453['aqKQH'](fetch,_0xa71241+'/api/v1/mcp/features/'+_0x31d6e2+'/action-items',{'method':_0x5da453['TahvA'],'headers':{'Authorization':'Bearer\x20'+_0x330992}});if(!_0x3c79e7['ok']){const _0x2b9e2c=await _0x3c79e7[_0xde4eff(0x16f)]();throw new Error(_0xde4eff(0x164)+_0x2b9e2c);}return _0x3c79e7[_0xde4eff(0x139)]();}export async function getItemFeedback(_0x49fe6d,_0x55c160){const _0xd2f144=_0x2434,_0x5a0d89={'rtQEV':function(_0x541935){return _0x541935();},'JeaaC':function(_0x37eb3d,_0x245f44,_0x567aa2){return _0x37eb3d(_0x245f44,_0x567aa2);},'DwcEF':_0xd2f144(0x172)},_0x46c46e=await _0x5a0d89['rtQEV'](getToken);if(!_0x46c46e)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x322ab4=_0x5a0d89[_0xd2f144(0x168)](getApiBaseUrl),_0x522ed9=await _0x5a0d89['JeaaC'](fetch,_0x322ab4+_0xd2f144(0x161)+_0x49fe6d+'/checklist-items/'+_0x55c160+'/feedback',{'method':_0x5a0d89[_0xd2f144(0x140)],'headers':{'Authorization':'Bearer\x20'+_0x46c46e}});if(!_0x522ed9['ok']){const _0x2e0b31=await _0x522ed9[_0xd2f144(0x16f)]();throw new Error(_0xd2f144(0x160)+_0x2e0b31);}return _0x522ed9['json']();}export async function markCommentsAddressed(_0x423b5a,_0x38d3bb,_0x12bbf9){const _0x1c256f=_0x2434,_0x49e271={'gGpcM':function(_0x367e5b){return _0x367e5b();},'sczyf':'POST','wkEig':_0x1c256f(0x14e)},_0x1f435b=await getToken();if(!_0x1f435b)throw new Error(_0x1c256f(0x167));const _0x34776c=_0x49e271['gGpcM'](getApiBaseUrl),_0x10d55a=await fetch(_0x34776c+_0x1c256f(0x161)+_0x423b5a+_0x1c256f(0x141),{'method':_0x49e271['sczyf'],'headers':{'Authorization':_0x1c256f(0x16b)+_0x1f435b,'Content-Type':_0x49e271['wkEig']},'body':JSON[_0x1c256f(0x163)]({'checklistItemId':_0x38d3bb,'commentIds':_0x12bbf9})});if(!_0x10d55a['ok']){const _0x37baee=await _0x10d55a['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x37baee);}}function _0x2434(_0x119529,_0x33758f){_0x119529=_0x119529-0x132;const _0x289532=_0x2895();let _0x24343b=_0x289532[_0x119529];return _0x24343b;}export async function softDeleteFeature(_0x1e550c){const _0x2502cc=_0x2434,_0x1d23f8={'Boxim':function(_0x2089ca){return _0x2089ca();},'htwlZ':function(_0x44b01f,_0x565187,_0x580c2b){return _0x44b01f(_0x565187,_0x580c2b);}},_0x2308f3=await getToken();if(!_0x2308f3)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1c6efd=_0x1d23f8[_0x2502cc(0x15a)](getApiBaseUrl),_0x4cd473=await _0x1d23f8['htwlZ'](fetch,_0x1c6efd+'/api/v1/mcp/features/'+_0x1e550c,{'method':_0x2502cc(0x147),'headers':{'Authorization':'Bearer\x20'+_0x2308f3}});if(!_0x4cd473['ok']){const _0x31bb82=await _0x4cd473[_0x2502cc(0x16f)]();throw new Error(_0x2502cc(0x155)+_0x31bb82);}}export async function restoreFeature(_0x868119){const _0xe06a49=_0x2434,_0x31bdbc={'MxRYR':function(_0x3f2846){return _0x3f2846();},'UDbBu':_0xe06a49(0x15e)},_0x516599=await _0x31bdbc['MxRYR'](getToken);if(!_0x516599)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xe28b8d=_0x31bdbc['MxRYR'](getApiBaseUrl),_0x1675c5=await fetch(_0xe28b8d+_0xe06a49(0x161)+_0x868119+_0xe06a49(0x169),{'method':_0x31bdbc[_0xe06a49(0x165)],'headers':{'Authorization':_0xe06a49(0x16b)+_0x516599}});if(!_0x1675c5['ok']){const _0x91900f=await _0x1675c5[_0xe06a49(0x16f)]();throw new Error(_0xe06a49(0x179)+_0x91900f);}}