@ranger-testing/ranger-cli 3.0.1-alpha.bb18058-34 → 3.0.1-alpha.ebe0997-35

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 (84) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -1
  60. package/build/commands/utils/playwrightCli.js +1 -1
  61. package/build/commands/utils/profileMessages.js +1 -1
  62. package/build/commands/utils/profileSetupBanner.js +1 -1
  63. package/build/commands/utils/projectsConfig.js +1 -1
  64. package/build/commands/utils/rangerConfig.js +1 -1
  65. package/build/commands/utils/rangerRoot.js +1 -1
  66. package/build/commands/utils/rangerwrightCli.js +1 -1
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/sessionCache.js +1 -1
  71. package/build/commands/utils/settings.js +1 -1
  72. package/build/commands/utils/skillContent.js +1 -1
  73. package/build/commands/utils/skills.js +1 -1
  74. package/build/commands/utils/stitchWebmFiles.js +1 -1
  75. package/build/commands/utils/telemetry.js +1 -1
  76. package/build/commands/utils/tokenRefresh.js +1 -1
  77. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  78. package/build/commands/utils/userApi.js +1 -1
  79. package/build/commands/utils/version.js +1 -1
  80. package/build/commands/verifyFeature.js +1 -1
  81. package/build/commands/verifyFeatureCli.js +1 -1
  82. package/build/commands/verifyFeatureNovaCli.js +1 -1
  83. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  84. package/package.json +1 -1
@@ -1 +1 @@
1
- function _0x4d38(){const _0x47db2f=['GHRep','keys','extraHTTPHeaders','newContext','storageState','environmentKey','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','string','mvZrn','dtOwE','API\x20request\x20','2224BSYdgU','password','join','toISOString','length','loginInstructions','json','TFVbV','test_output','settings','parse','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','vEgvg','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','name','zIwaz','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','1240030zNfEaS','some','xXAcl','dZLOD','trim','statusText','xAWmR','tkmoy','defaultEnvironmentKey','63414HNFIWU','hTwYx','5418728bXTJPq','newPage','xpbCK','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','HVmTJ','6XldEcd','auth','launch','username','origin','FofMl','auth_config','cookies','570354uduilh','\x20\x20Cloud\x20session\x20for\x20\x22','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','BXbIB','pQMeF','/session','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','goto','detail','invalidateOn','error','fRfiz','IDLpY','storageStatePath','\x22\x20for\x20','you\x27re\x20now\x20at\x20\x22','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','POST','userAgent','domains','status','\x20\x20Cached\x20session\x20for\x20\x22','621135cGllcc','jEAbM','/api/v1/profiles/','not_configured','ngvYt','UqIVB','QhmvS','organizationId','map','nfCSa','sessionCheckPath','log','praic','EHVUH','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','close','\x20failed\x20(','WOqZE','NhMAx','2323328octgkF','env','\x22,\x20attempting\x20login...','stringify','cqSla','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','isArray','push','baseUrl','url','260613mgUmuT','about:blank','PHPZq','/login','RANGER_TEST_USERNAME','save','code','RANGER_TEST_PASSWORD','gBDTo','Bearer\x20','ApiError','\x20\x20Created\x20cloud\x20profile\x20\x22','force'];_0x4d38=function(){return _0x47db2f;};return _0x4d38();}const _0xc45c82=_0x365e;(function(_0x56898d,_0x415c1c){const _0x20ab3d=_0x365e,_0x4441ba=_0x56898d();while(!![]){try{const _0x297063=parseInt(_0x20ab3d(0x1d8))/0x1*(-parseInt(_0x20ab3d(0x213))/0x2)+-parseInt(_0x20ab3d(0x231))/0x3+parseInt(_0x20ab3d(0x1ce))/0x4+-parseInt(_0x20ab3d(0x203))/0x5+-parseInt(_0x20ab3d(0x21b))/0x6+-parseInt(_0x20ab3d(0x20e))/0x7+parseInt(_0x20ab3d(0x1f0))/0x8*(parseInt(_0x20ab3d(0x20c))/0x9);if(_0x297063===_0x415c1c)break;else _0x4441ba['push'](_0x4441ba['shift']());}catch(_0xf9dd22){_0x4441ba['push'](_0x4441ba['shift']());}}}(_0x4d38,0x69d9f));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x310049 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 _0x2f9441={'eDSaP':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x1c7852=await getToken();if(!_0x1c7852)throw new Error(_0x2f9441['eDSaP']);return _0x1c7852;}async function apiRequest(_0x851cb3,_0x22f750={}){const _0x389f07=_0x365e,_0x2f91e9={'cqSla':function(_0x525baf){return _0x525baf();},'jEAbM':function(_0xc53e40){return _0xc53e40();},'TFVbV':function(_0x5df92b,_0x498902){return _0x5df92b===_0x498902;}},_0x517354=await _0x2f91e9[_0x389f07(0x1d2)](requireToken),_0x4310bc=_0x2f91e9[_0x389f07(0x232)](getApiBaseUrl),_0x5a6b9b=await fetch(''+_0x4310bc+_0x851cb3,{..._0x22f750,'headers':{'Authorization':_0x389f07(0x1e1)+_0x517354,'Content-Type':'application/json',..._0x22f750['headers']??{}}});if(!_0x5a6b9b['ok']){let _0x22abcb='',_0xa6118f;try{const _0x2099a9=await _0x5a6b9b[_0x389f07(0x1f6)]();_0x22abcb=(typeof _0x2099a9['error']==='string'?_0x2099a9['error']:undefined)??JSON['stringify'](_0x2099a9);if(_0x2f91e9['TFVbV'](typeof _0x2099a9[_0x389f07(0x1de)],'string'))_0xa6118f=_0x2099a9[_0x389f07(0x1de)];}catch{_0x22abcb=_0x5a6b9b[_0x389f07(0x208)];}throw new ApiError(_0x389f07(0x1ef)+_0x851cb3+_0x389f07(0x1cb)+_0x5a6b9b[_0x389f07(0x22f)]+'):\x20'+_0x22abcb,_0x5a6b9b[_0x389f07(0x22f)],_0x22abcb,_0xa6118f);}if(_0x2f91e9[_0x389f07(0x1f7)](_0x5a6b9b['status'],0xcc))return undefined;return _0x5a6b9b['json']();}export class ApiError extends Error{[_0xc45c82(0x22f)];['detail'];[_0xc45c82(0x1de)];constructor(_0x386e2b,_0x5259ce,_0x5be22b,_0x1ab39a){const _0x27a655=_0xc45c82;super(_0x386e2b),this['status']=_0x5259ce,this[_0x27a655(0x223)]=_0x5be22b,this[_0x27a655(0x1de)]=_0x1ab39a,this[_0x27a655(0x200)]=_0x27a655(0x1e2);}}export async function fetchCloudProfile(_0x4e2c13){const _0x3300ad=_0xc45c82,_0x2ac0be={'HVmTJ':function(_0x126ae5,_0x591f76){return _0x126ae5(_0x591f76);}};try{return await _0x2ac0be[_0x3300ad(0x212)](apiRequest,_0x3300ad(0x233)+encodeURIComponent(_0x4e2c13));}catch(_0x24e609){if(_0x24e609 instanceof ApiError&&_0x24e609[_0x3300ad(0x22f)]===0x194)return null;throw _0x24e609;}}export async function listCloudProfiles(){const _0xcc7869={'WSMmk':function(_0x10d10d,_0x3d9493){return _0x10d10d(_0x3d9493);}},_0x178545=await _0xcc7869['WSMmk'](apiRequest,'/api/v1/profiles');return _0x178545['profiles'];}export async function deleteCloudProfile(_0x4fff04){const _0x233130=_0xc45c82,_0x355ce0={'UckjZ':function(_0x38e267,_0x24a161){return _0x38e267 instanceof _0x24a161;},'mYbYK':function(_0x37a191,_0x11a444){return _0x37a191===_0x11a444;}};try{await apiRequest(_0x233130(0x233)+encodeURIComponent(_0x4fff04),{'method':'DELETE'});}catch(_0x3bc350){if(_0x355ce0['UckjZ'](_0x3bc350,ApiError)&&_0x355ce0['mYbYK'](_0x3bc350['status'],0x194))throw new Error('Cloud\x20profile\x20\x22'+_0x4fff04+'\x22\x20not\x20found.');throw _0x3bc350;}}export async function createCloudProfile(_0x58248e,_0x4c93d2,_0x48640d={}){const _0x301ddd=_0xc45c82,_0x40d2bb={'xshsR':function(_0x49c6bd,_0x22133f){return _0x49c6bd>_0x22133f;},'UsoLH':function(_0x17d78e,_0x4537e1,_0x1c8a6a){return _0x17d78e(_0x4537e1,_0x1c8a6a);}},_0xb1170a={'name':_0x58248e};if(_0x4c93d2)_0xb1170a['environment_key']=_0x4c93d2;_0x48640d['settings']&&_0x40d2bb['xshsR'](Object[_0x301ddd(0x1e6)](_0x48640d['settings'])[_0x301ddd(0x1f4)],0x0)&&(_0xb1170a['settings']=_0x48640d[_0x301ddd(0x1f9)]);if(_0x48640d[_0x301ddd(0x216)])_0xb1170a[_0x301ddd(0x216)]=_0x48640d[_0x301ddd(0x216)];if(_0x48640d['password'])_0xb1170a[_0x301ddd(0x1f1)]=_0x48640d[_0x301ddd(0x1f1)];return await _0x40d2bb['UsoLH'](apiRequest,'/api/v1/profiles',{'method':'POST','body':JSON[_0x301ddd(0x1d1)](_0xb1170a)});}function _0x365e(_0x2b2ff1,_0xb71f30){_0x2b2ff1=_0x2b2ff1-0x1cb;const _0x4d38d0=_0x4d38();let _0x365e81=_0x4d38d0[_0x2b2ff1];return _0x365e81;}export async function uploadCloudProfileSession(_0x27fce0,_0x1efe2e){const _0x56bbcd=_0xc45c82,_0x192c58={'oBHkl':function(_0x4786e8,_0xfa1a83){return _0x4786e8(_0xfa1a83);}};return await apiRequest('/api/v1/profiles/'+_0x192c58['oBHkl'](encodeURIComponent,_0x27fce0)+_0x56bbcd(0x220),{'method':_0x56bbcd(0x22c),'body':JSON[_0x56bbcd(0x1d1)]({'session_state':_0x1efe2e})});}export async function saveCloudProfileCredentials(_0x3a5f2e,_0x4f777e,_0x54c55b){const _0x5866c9=_0xc45c82,_0x230e89={'XNRXP':function(_0x596ae7,_0x2bc163){return _0x596ae7(_0x2bc163);},'FmMSw':'PUT'};await apiRequest(_0x5866c9(0x233)+_0x230e89['XNRXP'](encodeURIComponent,_0x3a5f2e),{'method':_0x230e89['FmMSw'],'body':JSON['stringify']({'username':_0x4f777e,'password':_0x54c55b})});}export async function fetchAuthConfig(){const _0x4a6a5a=_0xc45c82,_0x58654f={'hTwYx':function(_0x5d1c5e,_0x282703){return _0x5d1c5e(_0x282703);},'GcVau':function(_0x596aef,_0x402459){return _0x596aef!==_0x402459;}};try{const _0x3f9599=await _0x58654f[_0x4a6a5a(0x20d)](apiRequest,'/api/v1/profiles/auth-config');return _0x3f9599[_0x4a6a5a(0x219)];}catch(_0x156a80){return _0x156a80 instanceof ApiError&&_0x58654f['GcVau'](_0x156a80[_0x4a6a5a(0x22f)],0x194)&&console['error'](_0x4a6a5a(0x1fb)+_0x156a80['message']),null;}}export function pickAdHocEnvKey(_0x543f1a){const _0x41d4a6=_0xc45c82,_0x5d81f3={'zIwaz':function(_0x5156a1,_0x1044de){return _0x5156a1===_0x1044de;}};if(!_0x543f1a)return null;if(_0x543f1a['defaultEnvironmentKey'])return _0x543f1a[_0x41d4a6(0x20b)];const _0x1fc3b8=Object['keys'](_0x543f1a['environments']??{});if(_0x5d81f3[_0x41d4a6(0x201)](_0x1fc3b8[_0x41d4a6(0x1f4)],0x1))return _0x1fc3b8[0x0];if(_0x1fc3b8['length']===0x0)return null;throw new Error('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0x1fc3b8['join'](',\x20')+').\x20'+'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(_0xfbd497=process[_0xc45c82(0x1cf)]){const _0x4e181d=_0xc45c82,_0x3d622f={'icyfO':function(_0xda19e5,_0x3c1f03){return _0xda19e5(_0x3c1f03);},'agfJZ':function(_0x16d39a,_0x5531c4,_0x19eec3,_0x38d536){return _0x16d39a(_0x5531c4,_0x19eec3,_0x38d536);}},_0x5d59f6=_0xfbd497['RANGER_TEST_USERNAME'];if(!_0x5d59f6)return null;const _0x1b81ef=await _0x3d622f['icyfO'](fetchCloudProfile,_0x5d59f6);if(_0x1b81ef)return{'name':_0x1b81ef['name'],'profile':_0x1b81ef};const _0x5a6f1c=await fetchAuthConfig(),_0x546f51=_0x3d622f['icyfO'](pickAdHocEnvKey,_0x5a6f1c),_0xa960b7=_0xfbd497[_0x4e181d(0x1df)],_0x39c91f=await _0x3d622f['agfJZ'](createCloudProfile,_0x5d59f6,_0x546f51??undefined,{'username':_0x5d59f6,'password':_0xa960b7});return console[_0x4e181d(0x23c)](_0x4e181d(0x1e3)+_0x39c91f['name']+_0x4e181d(0x229)+_0x5d59f6),{'name':_0x39c91f[_0x4e181d(0x200)],'profile':_0x39c91f};}export async function writeSessionToLocalCache(_0x471c46,_0x290066,_0x406aa9,_0x249c3c,_0x2c0fa5,_0x4f1375,_0x420448){const _0x477178=_0xc45c82,_0x69d210={'QhmvS':function(_0x52567d,_0x39f009,_0x38df97){return _0x52567d(_0x39f009,_0x38df97);},'dZLOD':function(_0x316234,_0x2068e5,_0x577473){return _0x316234(_0x2068e5,_0x577473);},'cqsoK':function(_0x3579ff){return _0x3579ff();},'Kteez':_0x477178(0x214),'KMhmH':function(_0x4f1f09,_0x3c3de8){return _0x4f1f09>_0x3c3de8;},'BKXkl':function(_0x11dd00,_0x185823){return _0x11dd00(_0x185823);}},_0x1f09d2=sessionCacheHash({'orgId':_0x290066,'profileName':_0x471c46,'effectiveBaseUrl':_0x406aa9,'setupHeaders':_0x249c3c,'invalidateOn':_0x420448?.[_0x477178(0x224)],'userAgent':_0x420448?.[_0x477178(0x22d)],'clientIp':_0x420448?.['clientIp']}),_0x318c13=_0x69d210[_0x477178(0x237)](getSessionCachePath,_0x1f09d2,_0x471c46),_0x2bf032=_0x69d210[_0x477178(0x206)](join,_0x69d210['cqsoK'](getRangerHomeDir),_0x69d210['Kteez']);!existsSync(_0x2bf032)&&await mkdir(_0x2bf032,{'recursive':!![]});const _0x23fe17={..._0x2c0fa5};_0x4f1375&&_0x69d210['KMhmH'](_0x4f1375[_0x477178(0x1f4)],0x0)&&Array[_0x477178(0x1d4)](_0x23fe17[_0x477178(0x21a)])&&(_0x23fe17['cookies']=_0x69d210['QhmvS'](duplicateCookiesForDomains,_0x23fe17['cookies'],_0x4f1375));const _0x36a5b0={'cached_at':new Date()[_0x477178(0x1f3)](),'session_state':_0x23fe17};await _0x69d210[_0x477178(0x206)](writeFile,_0x318c13,JSON['stringify'](_0x36a5b0,null,0x2));const _0x15b7c9=_0x69d210['BKXkl'](getStorageStatePath,_0x318c13);return await writeFile(_0x15b7c9,JSON['stringify'](_0x23fe17,null,0x2)),_0x15b7c9;}export async function checkLocalCache(_0x53c6d1,_0x3818e2,_0x1a55a1,_0x4801e0,_0x31d205){const _0x122604=_0xc45c82,_0x183a39={'NhMAx':function(_0x41d204,_0x3e889c,_0x1153e2){return _0x41d204(_0x3e889c,_0x1153e2);},'fRfiz':function(_0x338429,_0x17f034){return _0x338429(_0x17f034);}},_0xf12b3e=sessionCacheHash({'orgId':_0x3818e2,'profileName':_0x53c6d1,'effectiveBaseUrl':_0x1a55a1,'setupHeaders':_0x4801e0,'invalidateOn':_0x31d205?.[_0x122604(0x224)],'userAgent':_0x31d205?.[_0x122604(0x22d)],'clientIp':_0x31d205?.['clientIp']}),_0x54f56d=_0x183a39['NhMAx'](getSessionCachePath,_0xf12b3e,_0x53c6d1),_0x468a98=_0x183a39[_0x122604(0x226)](getStorageStatePath,_0x54f56d);if(!existsSync(_0x54f56d)||!existsSync(_0x468a98))return null;try{const _0x53b60c=await _0x183a39[_0x122604(0x1cd)](readFile,_0x54f56d,'utf-8');return JSON[_0x122604(0x1fa)](_0x53b60c),{'storageStatePath':_0x468a98};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x260b74,_0x4e774a){const _0xf3bc4d=_0xc45c82,_0x489215={'EHVUH':function(_0x6ea0bb,_0x101834){return _0x6ea0bb+_0x101834;}};if(!_0x4e774a||!_0x4e774a['domains']?.['length'])return;let _0xfecb16;try{_0xfecb16=new URL(_0x260b74);}catch{return;}const _0x2032dc=[];for(const _0x34f0fa of _0x4e774a['domains']){try{_0x2032dc[_0xf3bc4d(0x1d5)]({'raw':_0x34f0fa,'url':new URL(_0x34f0fa)});}catch{}}if(_0x2032dc['length']===0x0)return;if(_0x2032dc[_0xf3bc4d(0x204)](_0x2b867b=>_0x2b867b[_0xf3bc4d(0x1d7)][_0xf3bc4d(0x217)]===_0xfecb16['origin']))return;const _0x5dccee=_0x2032dc[_0xf3bc4d(0x239)](_0x15b61e=>'\x22'+_0x15b61e['raw']+'\x22')[_0xf3bc4d(0x1f2)](',\x20');console[_0xf3bc4d(0x23c)](_0x489215[_0xf3bc4d(0x23e)](_0x489215['EHVUH'](_0xf3bc4d(0x221)+_0x5dccee+';\x20',_0xf3bc4d(0x22a)+_0x260b74+_0xf3bc4d(0x1ff)),_0xf3bc4d(0x22b)));}export async function serverSideLogin(_0x128d02,_0x2784af){const _0x1559b2=_0xc45c82,_0x120039={'WOqZE':function(_0x3a65a7,_0x5a9b05,_0x44dd61){return _0x3a65a7(_0x5a9b05,_0x44dd61);},'xAWmR':function(_0x276a69,_0x53e238){return _0x276a69===_0x53e238;},'dtOwE':_0x1559b2(0x234)},_0x3c27bf=process[_0x1559b2(0x1cf)]['RANGER_TEST_USERNAME'],_0x2cdbfe=process[_0x1559b2(0x1cf)][_0x1559b2(0x1df)],_0x592210={};if(_0x3c27bf)_0x592210['username']=_0x3c27bf;if(_0x2cdbfe)_0x592210[_0x1559b2(0x1f1)]=_0x2cdbfe;if(_0x2784af?.[_0x1559b2(0x1e4)])_0x592210[_0x1559b2(0x1e4)]=!![];try{return await _0x120039[_0x1559b2(0x1cc)](apiRequest,_0x1559b2(0x233)+encodeURIComponent(_0x128d02)+_0x1559b2(0x1db),{'method':_0x1559b2(0x22c),'body':JSON[_0x1559b2(0x1d1)](_0x592210)});}catch(_0x9dc608){if(_0x9dc608 instanceof ApiError&&_0x120039[_0x1559b2(0x209)](_0x9dc608[_0x1559b2(0x22f)],0x190)&&_0x9dc608['code']===_0x120039[_0x1559b2(0x1ee)])return{'status':'not_configured','error':_0x9dc608['detail']};throw _0x9dc608;}}export async function manualBrowserLogin(_0x119d88,_0x7b182c){const _0x521a74=_0xc45c82,_0x3590b5={'fnGFs':function(_0x39c7d1,_0xf5c841){return _0x39c7d1/_0xf5c841;},'BXbIB':function(_0x137a37){return _0x137a37();},'FJXPj':function(_0x3d3b58,_0x2a0736,_0x26265f){return _0x3d3b58(_0x2a0736,_0x26265f);},'xXAcl':_0x521a74(0x1d9),'hZkqR':_0x521a74(0x1fc),'jNqKK':'\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','FofMl':'Browser\x20login\x20timed\x20out\x20before\x20completion.','nfCSa':function(_0x3900fb,_0x2a61ff,_0xb512be){return _0x3900fb(_0x2a61ff,_0xb512be);},'enrwd':function(_0x1d9f90,_0x5b74f7){return _0x1d9f90(_0x5b74f7);}};if(!_0x3590b5[_0x521a74(0x21e)](isInteractive))throw new Error('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x119d88['name']+'\x22.\x0a'+'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20'+'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.');const _0x15f90a=_0x7b182c&&_0x7b182c['domains'][_0x521a74(0x1f4)]>0x0?_0x7b182c['domains'][0x0]:_0x3590b5[_0x521a74(0x205)];console[_0x521a74(0x23c)](_0x3590b5['hZkqR']),console['log'](_0x3590b5['jNqKK']),await new Promise(_0x1163e1=>setTimeout(_0x1163e1,0x7d0));const _0x21fbec=await chromium[_0x521a74(0x215)]({'headless':![]});let _0x551826=null;try{const _0x3c98ab={'ignoreHTTPSErrors':!![]};_0x7b182c?.['setupHeaders']&&(_0x3c98ab[_0x521a74(0x1e7)]=_0x7b182c['setupHeaders']);const _0x2a2298=await _0x21fbec[_0x521a74(0x1e8)](_0x3c98ab);await addProfileSetupBanner(_0x2a2298);const _0x140334=await _0x2a2298[_0x521a74(0x20f)]();await _0x140334[_0x521a74(0x222)](_0x15f90a);let _0x5b26ec=![];await new Promise(_0x13ea7e=>{const _0x5308e6=_0x521a74,_0x2ac322={'gBDTo':function(_0x155c4e){return _0x155c4e();}},_0x1a03a2=_0x3590b5['FJXPj'](setTimeout,()=>{const _0x109002=_0x365e;_0x5b26ec=!![],console[_0x109002(0x225)]('Browser\x20login\x20timed\x20out\x20after\x20'+_0x3590b5['fnGFs'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x109002(0x1eb)),_0x3590b5['BXbIB'](_0x13ea7e);},MANUAL_LOGIN_TIMEOUT_MS);_0x140334['on'](_0x5308e6(0x240),async()=>{const _0x1f0631=_0x5308e6;clearTimeout(_0x1a03a2);try{const _0x550091=await _0x2a2298[_0x1f0631(0x1e9)]();_0x551826=_0x550091;}catch{}_0x2ac322[_0x1f0631(0x1e0)](_0x13ea7e);});});if(_0x5b26ec&&!_0x551826)throw new Error(_0x3590b5[_0x521a74(0x218)]);}finally{await _0x21fbec[_0x521a74(0x240)]()['catch'](()=>{});}if(!_0x551826)throw new Error(_0x521a74(0x1d3));return await _0x3590b5[_0x521a74(0x23a)](apiRequest,_0x521a74(0x233)+_0x3590b5['enrwd'](encodeURIComponent,_0x119d88[_0x521a74(0x200)])+'/session',{'method':'POST','body':JSON['stringify']({'session_state':_0x551826,'updated_by':'cli:manual-login'})}),{'sessionState':_0x551826};}export async function promptSaveCredentials(_0x1fa8e1){const _0x3df326=_0xc45c82,_0x2c245f={'tkmoy':function(_0x2af4a6,_0xb4aa82){return _0x2af4a6||_0xb4aa82;},'QZSxZ':function(_0x36a65b){return _0x36a65b();},'pQMeF':'confirm','sxZIT':_0x3df326(0x1dd),'mvZrn':_0x3df326(0x1fd),'iyeWV':function(_0x582f2f,_0xa64789){return _0x582f2f(_0xa64789);},'IDLpY':_0x3df326(0x211)},_0x23c2e9=process[_0x3df326(0x1cf)][_0x3df326(0x1dc)],_0x2d0302=process[_0x3df326(0x1cf)]['RANGER_TEST_PASSWORD'];if(_0x2c245f[_0x3df326(0x20a)](!_0x23c2e9,!_0x2d0302))return;if(!_0x2c245f['QZSxZ'](isInteractive))return;const {save:_0x4c7526}=await _0x310049['prompt']([{'type':_0x2c245f[_0x3df326(0x21f)],'name':_0x2c245f['sxZIT'],'message':_0x2c245f[_0x3df326(0x1ed)],'default':![]}]);if(!_0x4c7526)return;await apiRequest('/api/v1/profiles/'+_0x2c245f['iyeWV'](encodeURIComponent,_0x1fa8e1),{'method':'PUT','body':JSON['stringify']({'username':_0x23c2e9,'password':_0x2d0302})}),console['log'](_0x2c245f[_0x3df326(0x227)]);}export async function resolveCloudProfileSession(_0x3f2033,_0x48f007={}){const _0x25c627=_0xc45c82,_0x3da30b={'GHRep':function(_0x55ed52){return _0x55ed52();},'PHPZq':_0x25c627(0x1ec),'UqIVB':function(_0x438baa,_0x4f51d3){return _0x438baa(_0x4f51d3);},'dVBVT':function(_0x15e9d5,_0x3525c2,_0x538ccd,_0x51d7d9,_0x2d486a,_0x4b4281){return _0x15e9d5(_0x3525c2,_0x538ccd,_0x51d7d9,_0x2d486a,_0x4b4281);},'ngvYt':function(_0x3e379,_0x50ae97,_0x247c3e,_0x4c0156,_0x363576){return _0x3e379(_0x50ae97,_0x247c3e,_0x4c0156,_0x363576);},'tlzlU':function(_0x5c99b1,_0x23a069,_0x44a9de,_0x4e489d,_0xceac00){return _0x5c99b1(_0x23a069,_0x44a9de,_0x4e489d,_0xceac00);},'PePSg':function(_0xcd4b81,_0x8f674d){return _0xcd4b81(_0x8f674d);},'rbVTZ':function(_0x312d19,_0x31c0e8){return _0x312d19||_0x31c0e8;},'LUCSi':_0x25c627(0x202),'vEgvg':function(_0x2e9cdc,_0x26aa04){return _0x2e9cdc===_0x26aa04;},'fdMRa':'success','FygLO':'\x20\x20Login\x20successful.\x20Session\x20cached.','cAkey':_0x25c627(0x23f),'xpbCK':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','xciaz':function(_0x4e4007,_0x75a0a4){return _0x4e4007 instanceof _0x75a0a4;},'praic':function(_0x46475e,_0x4556df){return _0x46475e(_0x4556df);},'JoyXg':function(_0x3cbb98,_0x1fbca8,_0xed60e4,_0x598ebf,_0x35246c,_0x14b6be,_0x522c40,_0x158f2d){return _0x3cbb98(_0x1fbca8,_0xed60e4,_0x598ebf,_0x35246c,_0x14b6be,_0x522c40,_0x158f2d);}},_0x1bff43=_0x3f2033['settings']??{},_0x1717fa=await _0x3da30b[_0x25c627(0x1e5)](fetchAuthConfig),_0x53a380=_0x1717fa?resolveAuthEnvironmentLocally(_0x1717fa,_0x3f2033[_0x25c627(0x1ea)]):null,_0x43c63a=typeof _0x53a380?.[_0x25c627(0x1f5)]===_0x3da30b[_0x25c627(0x1da)]&&_0x53a380[_0x25c627(0x1f5)]['trim']()?_0x53a380[_0x25c627(0x1f5)]:undefined,_0x2d763e=typeof _0x1bff43[_0x25c627(0x1f5)]===_0x3da30b[_0x25c627(0x1da)]&&_0x1bff43['loginInstructions'][_0x25c627(0x207)]()?_0x1bff43[_0x25c627(0x1f5)]:undefined,_0x4e8e31=_0x2d763e||!_0x43c63a?_0x1bff43:{..._0x1bff43,'loginInstructions':_0x43c63a},_0x3d878c=_0x3da30b['UqIVB'](Boolean,_0x4e8e31['loginInstructions']?.['trim']()),_0xecf803=_0x53a380?.[_0x25c627(0x22e)],_0x10e55d=_0x1bff43['setupHeaders'],_0x422a18=_0x10e55d??_0x53a380?.['setupHeaders'],_0x3308fa=_0x48f007['effectiveBaseUrl']??_0x1bff43[_0x25c627(0x1d6)]??(_0xecf803&&_0xecf803[_0x25c627(0x1f4)]>0x0?_0xecf803[0x0]:''),_0x38cc16={'invalidateOn':_0x53a380?.[_0x25c627(0x224)],'userAgent':_0x53a380?.['browserOptions']?.['userAgent']??_0x1bff43['userAgent']},_0x5c0e20=await _0x3da30b['dVBVT'](checkLocalCache,_0x3f2033[_0x25c627(0x200)],_0x3f2033[_0x25c627(0x238)],_0x3308fa,_0x422a18,_0x38cc16);if(_0x5c0e20){if(_0x3308fa){const _0x4901f7=await _0x3da30b[_0x25c627(0x235)](isCachedSessionLive,_0x5c0e20[_0x25c627(0x228)],_0x3308fa,{'sessionCheckPath':_0x53a380?.[_0x25c627(0x23b)],'setupHeaders':_0x422a18},{'launchBrowser':launchRealBrowser});if(_0x4901f7)return console[_0x25c627(0x23c)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x3f2033[_0x25c627(0x200)]+'\x22'),{'authPath':_0x5c0e20[_0x25c627(0x228)],'settings':_0x4e8e31,'resolvedEnv':_0x53a380};console[_0x25c627(0x23c)](_0x25c627(0x230)+_0x3f2033['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),emitSessionValidationHint(_0x3308fa,_0x53a380);}else return{'authPath':_0x5c0e20['storageStatePath'],'settings':_0x4e8e31,'resolvedEnv':_0x53a380};}if(_0x3f2033['sessionState']){const _0x47f449=await writeSessionToLocalCache(_0x3f2033['name'],_0x3f2033[_0x25c627(0x238)],_0x3308fa,_0x422a18,_0x3f2033['sessionState'],_0xecf803,_0x38cc16);if(_0x3308fa){const _0x596e84=await _0x3da30b['tlzlU'](isCachedSessionLive,_0x47f449,_0x3308fa,{'sessionCheckPath':_0x53a380?.['sessionCheckPath'],'setupHeaders':_0x422a18},{'launchBrowser':launchRealBrowser});if(_0x596e84)return console[_0x25c627(0x23c)]('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x3f2033['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x47f449,'settings':_0x4e8e31,'resolvedEnv':_0x53a380};console[_0x25c627(0x23c)](_0x25c627(0x21c)+_0x3f2033[_0x25c627(0x200)]+_0x25c627(0x21d)),emitSessionValidationHint(_0x3308fa,_0x53a380);}else return{'authPath':_0x47f449,'settings':_0x4e8e31,'resolvedEnv':_0x53a380};}if(_0x3d878c)return console[_0x25c627(0x23c)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x3f2033['name']+'\x22;\x20proceeding\x20with\x20loginInstructions.'),{'authPath':undefined,'settings':_0x4e8e31,'resolvedEnv':_0x53a380};console['log']('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x3f2033[_0x25c627(0x200)]+_0x25c627(0x1d0));const _0x250d8b=Boolean(process[_0x25c627(0x1cf)][_0x25c627(0x1dc)])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0xfd7243=_0x3da30b['PePSg'](Boolean,_0x3f2033[_0x25c627(0x216)]);if(_0x3da30b['rbVTZ'](_0x250d8b,_0xfd7243))try{const _0xe194cb=await _0x3da30b[_0x25c627(0x236)](serverSideLogin,_0x3f2033[_0x25c627(0x200)]);if(_0xe194cb[_0x25c627(0x22f)]===_0x25c627(0x234))console[_0x25c627(0x23c)](_0x3da30b['LUCSi']);else{if(_0x3da30b[_0x25c627(0x1fe)](_0xe194cb['status'],_0x3da30b['fdMRa'])&&_0xe194cb['session_state']){console[_0x25c627(0x23c)](_0x3da30b['FygLO']);const _0x1cf35d=await writeSessionToLocalCache(_0x3f2033['name'],_0x3f2033[_0x25c627(0x238)],_0x3308fa,_0x422a18,_0xe194cb['session_state'],_0xecf803,_0x38cc16);return _0x250d8b&&!_0xfd7243&&await promptSaveCredentials(_0x3f2033['name']),{'authPath':_0x1cf35d,'settings':_0x4e8e31,'resolvedEnv':_0x53a380};}else _0xe194cb[_0x25c627(0x1f8)]&&(console[_0x25c627(0x23c)](_0x3da30b['cAkey']),console['log'](_0xe194cb[_0x25c627(0x1f8)])),console['log'](_0x3da30b[_0x25c627(0x210)]);}}catch(_0x566921){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x3da30b['xciaz'](_0x566921,Error)?_0x566921['message']:_0x3da30b[_0x25c627(0x23d)](String,_0x566921))),console[_0x25c627(0x23c)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const {sessionState:_0x43b63d}=await manualBrowserLogin(_0x3f2033,_0x53a380),_0x24cb3f=await _0x3da30b['JoyXg'](writeSessionToLocalCache,_0x3f2033['name'],_0x3f2033['organizationId'],_0x3308fa,_0x422a18,_0x43b63d,_0xecf803,_0x38cc16);return{'authPath':_0x24cb3f,'settings':_0x4e8e31,'resolvedEnv':_0x53a380};}
1
+ const _0x254ff9=_0x1d73;(function(_0x4fd0de,_0x3c204d){const _0x44e494=_0x1d73,_0x15b13d=_0x4fd0de();while(!![]){try{const _0x29048f=parseInt(_0x44e494(0xe9))/0x1*(parseInt(_0x44e494(0xbc))/0x2)+parseInt(_0x44e494(0xc7))/0x3*(-parseInt(_0x44e494(0xbd))/0x4)+parseInt(_0x44e494(0xd8))/0x5*(-parseInt(_0x44e494(0xd9))/0x6)+-parseInt(_0x44e494(0xf5))/0x7+-parseInt(_0x44e494(0x82))/0x8+-parseInt(_0x44e494(0xf1))/0x9+-parseInt(_0x44e494(0xe4))/0xa*(-parseInt(_0x44e494(0x98))/0xb);if(_0x29048f===_0x3c204d)break;else _0x15b13d['push'](_0x15b13d['shift']());}catch(_0x4c5af8){_0x15b13d['push'](_0x15b13d['shift']());}}}(_0x5d05,0x966b9));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x4bb1ef 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 _0x9bbac=_0x1d73,_0x14dc73={'bRLvb':function(_0x441744){return _0x441744();},'WWxYg':_0x9bbac(0x9f)},_0x49c33f=await _0x14dc73['bRLvb'](getToken);if(!_0x49c33f)throw new Error(_0x14dc73['WWxYg']);return _0x49c33f;}async function apiRequest(_0xa826ce,_0x4de4b3={}){const _0x8e7c3e=_0x1d73,_0x326099={'HIJVc':function(_0x1edc15){return _0x1edc15();},'HQSwN':'string','BHPNl':function(_0x247f75,_0x325980){return _0x247f75===_0x325980;}},_0x54aa35=await requireToken(),_0x288a13=_0x326099['HIJVc'](getApiBaseUrl),_0x5b5f78=await fetch(''+_0x288a13+_0xa826ce,{..._0x4de4b3,'headers':{'Authorization':_0x8e7c3e(0xad)+_0x54aa35,'Content-Type':_0x8e7c3e(0xbe),..._0x4de4b3[_0x8e7c3e(0xbb)]??{}}});if(!_0x5b5f78['ok']){let _0x5e19ef='',_0x1cbd8a;try{const _0xd383ed=await _0x5b5f78[_0x8e7c3e(0xce)]();_0x5e19ef=(typeof _0xd383ed[_0x8e7c3e(0x8c)]===_0x326099['HQSwN']?_0xd383ed['error']:undefined)??JSON[_0x8e7c3e(0xaa)](_0xd383ed);if(typeof _0xd383ed['code']===_0x326099['HQSwN'])_0x1cbd8a=_0xd383ed['code'];}catch{_0x5e19ef=_0x5b5f78[_0x8e7c3e(0xc8)];}throw new ApiError(_0x8e7c3e(0x88)+_0xa826ce+'\x20failed\x20('+_0x5b5f78[_0x8e7c3e(0xdc)]+_0x8e7c3e(0xb2)+_0x5e19ef,_0x5b5f78[_0x8e7c3e(0xdc)],_0x5e19ef,_0x1cbd8a);}if(_0x326099[_0x8e7c3e(0x9d)](_0x5b5f78[_0x8e7c3e(0xdc)],0xcc))return undefined;return _0x5b5f78[_0x8e7c3e(0xce)]();}export class ApiError extends Error{['status'];['detail'];[_0x254ff9(0xb9)];constructor(_0x4732db,_0x6bb331,_0x246691,_0x589b6e){const _0x1b233a=_0x254ff9,_0x20c6fe='1|2|3|4|0'[_0x1b233a(0x9a)]('|');let _0x231f86=0x0;while(!![]){switch(_0x20c6fe[_0x231f86++]){case'0':this['name']=_0x1b233a(0xda);continue;case'1':super(_0x4732db);continue;case'2':this[_0x1b233a(0xdc)]=_0x6bb331;continue;case'3':this[_0x1b233a(0xc2)]=_0x246691;continue;case'4':this['code']=_0x589b6e;continue;}break;}}}export async function fetchCloudProfile(_0x4eb6b7){const _0x4cab52=_0x254ff9,_0x23523f={'BaJqe':function(_0xcde29f,_0x32deaf){return _0xcde29f(_0x32deaf);},'Sbeyg':function(_0xa0792c,_0x4523df){return _0xa0792c instanceof _0x4523df;},'LJSoT':function(_0x345b91,_0x5566c5){return _0x345b91===_0x5566c5;}};try{return await apiRequest(_0x4cab52(0xc6)+_0x23523f[_0x4cab52(0x92)](encodeURIComponent,_0x4eb6b7));}catch(_0x1a2292){if(_0x23523f[_0x4cab52(0xc0)](_0x1a2292,ApiError)&&_0x23523f[_0x4cab52(0xbf)](_0x1a2292[_0x4cab52(0xdc)],0x194))return null;throw _0x1a2292;}}function _0x1d73(_0xf57d41,_0x4ca6e3){_0xf57d41=_0xf57d41-0x81;const _0x5d051f=_0x5d05();let _0x1d7388=_0x5d051f[_0xf57d41];return _0x1d7388;}export async function listCloudProfiles(){const _0x10001f=_0x254ff9,_0x4feecd={'dRcyA':_0x10001f(0xd2)},_0x378ea8=await apiRequest(_0x4feecd['dRcyA']);return _0x378ea8['profiles'];}export async function deleteCloudProfile(_0x13fdbf){const _0x35b4d5=_0x254ff9,_0x2c67a3={'sWEnd':function(_0x3844da,_0x279035,_0x41b17d){return _0x3844da(_0x279035,_0x41b17d);},'JkpdK':function(_0x895c59,_0x29c99a){return _0x895c59(_0x29c99a);},'pkymY':'DELETE','AXyQs':function(_0x2ff179,_0x345721){return _0x2ff179 instanceof _0x345721;},'NYajJ':function(_0x24d8f0,_0x32b422){return _0x24d8f0===_0x32b422;}};try{await _0x2c67a3['sWEnd'](apiRequest,'/api/v1/profiles/'+_0x2c67a3[_0x35b4d5(0xa8)](encodeURIComponent,_0x13fdbf),{'method':_0x2c67a3['pkymY']});}catch(_0x3a118d){if(_0x2c67a3['AXyQs'](_0x3a118d,ApiError)&&_0x2c67a3['NYajJ'](_0x3a118d[_0x35b4d5(0xdc)],0x194))throw new Error(_0x35b4d5(0xf6)+_0x13fdbf+'\x22\x20not\x20found.');throw _0x3a118d;}}export async function createCloudProfile(_0x5c0470,_0x537150,_0x27bdd1={}){const _0xa0ee4b=_0x254ff9,_0x3f5d4c={'iZjie':_0xa0ee4b(0xd2),'udEVO':_0xa0ee4b(0x94)},_0x5f304d={'name':_0x5c0470};if(_0x537150)_0x5f304d['environment_key']=_0x537150;_0x27bdd1[_0xa0ee4b(0xd6)]&&Object[_0xa0ee4b(0x95)](_0x27bdd1['settings'])['length']>0x0&&(_0x5f304d['settings']=_0x27bdd1[_0xa0ee4b(0xd6)]);if(_0x27bdd1['username'])_0x5f304d['username']=_0x27bdd1[_0xa0ee4b(0xf3)];if(_0x27bdd1['password'])_0x5f304d[_0xa0ee4b(0xe7)]=_0x27bdd1[_0xa0ee4b(0xe7)];return await apiRequest(_0x3f5d4c[_0xa0ee4b(0xec)],{'method':_0x3f5d4c[_0xa0ee4b(0xc5)],'body':JSON['stringify'](_0x5f304d)});}export async function uploadCloudProfileSession(_0x62b5f3,_0x1d9611){const _0x4908e4=_0x254ff9,_0x2abc44={'vUiLH':'POST'};return await apiRequest(_0x4908e4(0xc6)+encodeURIComponent(_0x62b5f3)+'/session',{'method':_0x2abc44[_0x4908e4(0xa4)],'body':JSON[_0x4908e4(0xaa)]({'session_state':_0x1d9611})});}export async function saveCloudProfileCredentials(_0x596970,_0x504a08,_0x3b2031){const _0x23c030=_0x254ff9,_0x4cdf44={'LErFD':function(_0x297655,_0x68fb4,_0x3739ec){return _0x297655(_0x68fb4,_0x3739ec);}};await _0x4cdf44['LErFD'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x596970),{'method':_0x23c030(0x97),'body':JSON[_0x23c030(0xaa)]({'username':_0x504a08,'password':_0x3b2031})});}export async function fetchAuthConfig(){const _0xe97795=_0x254ff9,_0x126f84={'JCNeb':function(_0x30acf9,_0x2c5d95){return _0x30acf9(_0x2c5d95);},'fQsMO':function(_0x339914,_0x5f1000){return _0x339914!==_0x5f1000;}};try{const _0x3bf5dd=await _0x126f84['JCNeb'](apiRequest,'/api/v1/profiles/auth-config');return _0x3bf5dd['auth_config'];}catch(_0x5c834a){return _0x5c834a instanceof ApiError&&_0x126f84['fQsMO'](_0x5c834a['status'],0x194)&&console[_0xe97795(0x8c)]('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x5c834a[_0xe97795(0x99)]),null;}}export function pickAdHocEnvKey(_0x2d8000){const _0x3dfea2=_0x254ff9,_0x13d728={'yZAqF':function(_0x3dfbef,_0xc90734){return _0x3dfbef===_0xc90734;},'XUlgc':function(_0x590ad0,_0x45f12e){return _0x590ad0+_0x45f12e;}};if(!_0x2d8000)return null;if(_0x2d8000[_0x3dfea2(0xb6)])return _0x2d8000[_0x3dfea2(0xb6)];const _0x7ceeb6=Object['keys'](_0x2d8000['environments']??{});if(_0x13d728['yZAqF'](_0x7ceeb6['length'],0x1))return _0x7ceeb6[0x0];if(_0x7ceeb6[_0x3dfea2(0xd5)]===0x0)return null;throw new Error(_0x13d728['XUlgc']('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0x7ceeb6[_0x3dfea2(0x83)](',\x20')+_0x3dfea2(0xf4),_0x3dfea2(0xb8)));}export async function resolveAdHocProfile(_0x115148=process['env']){const _0x3ccd42=_0x254ff9,_0x3996f8={'vhaYx':function(_0xdfdac3,_0x41ec86,_0x29cb29,_0x8079c){return _0xdfdac3(_0x41ec86,_0x29cb29,_0x8079c);}},_0x15f2fc=_0x115148[_0x3ccd42(0xd4)];if(!_0x15f2fc)return null;const _0x6ef6c2=await fetchCloudProfile(_0x15f2fc);if(_0x6ef6c2)return{'name':_0x6ef6c2['name'],'profile':_0x6ef6c2};const _0x2bb1a3=await fetchAuthConfig(),_0x1d8147=pickAdHocEnvKey(_0x2bb1a3),_0x53ba41=_0x115148[_0x3ccd42(0xa5)],_0x169b0b=await _0x3996f8['vhaYx'](createCloudProfile,_0x15f2fc,_0x1d8147??undefined,{'username':_0x15f2fc,'password':_0x53ba41});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x169b0b['name']+_0x3ccd42(0xb4)+_0x15f2fc),{'name':_0x169b0b[_0x3ccd42(0x9b)],'profile':_0x169b0b};}function _0x5d05(){const _0x3b465b=['organizationId','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','BaJqe','pEyfO','POST','keys','cookies','PUT','25751WHBqwl','message','split','name','effectiveBaseUrl','BHPNl','LuoTa','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','storageStatePath','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','tfhTI','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','vUiLH','RANGER_TEST_PASSWORD','\x22.\x0a','\x20\x20Cloud\x20session\x20for\x20\x22','JkpdK','close','stringify','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','url','Bearer\x20','TfTdG','force','goto','\x20\x20Server-side\x20login\x20error:\x20','):\x20','log','\x22\x20for\x20','\x22,\x20attempting\x20login...','defaultEnvironmentKey','launch','Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.','code','CprPt','headers','1963538myJpGG','20LSzrSR','application/json','LJSoT','Sbeyg','extraHTTPHeaders','detail','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','PmoLt','udEVO','/api/v1/profiles/','226293XeBBKz','statusText','sessionCheckPath','OPlHL','catch','domains','toISOString','json','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','push','raw','/api/v1/profiles','env','RANGER_TEST_USERNAME','length','settings','oObaW','13535pFFtaI','72KLdNqc','ApiError','loginInstructions','status','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','oDwfN','ugcrq','/session','sxFkM','not_configured','invalidateOn','7630DbmvAE','string','baseUrl','password','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','1kKkVMg','session_state','newContext','iZjie','utf-8','LUVga','setupHeaders','clientIp','5108076ZMhGZX','nOiVK','username',').\x20','2796906xYvXra','Cloud\x20profile\x20\x22','trim','6200560xGTqBn','join','xMvOV','environmentKey','NGlXz','fFHZh','API\x20request\x20','wlsUU','auth','userAgent','error','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','\x20\x20No\x20live\x20session\x20for\x20\x22'];_0x5d05=function(){return _0x3b465b;};return _0x5d05();}export async function writeSessionToLocalCache(_0x2be8d8,_0x5f3c79,_0x130dc8,_0x132090,_0x47e381,_0x5c66cf,_0x27d410){const _0x456380=_0x254ff9,_0x4e4373={'oDwfN':function(_0x2b76a3,_0x26fe34,_0x171099){return _0x2b76a3(_0x26fe34,_0x171099);},'bjYyD':function(_0x14980a){return _0x14980a();},'keGGz':function(_0x4863e6,_0x5cd861,_0x4b7557){return _0x4863e6(_0x5cd861,_0x4b7557);}},_0x3c55a1=sessionCacheHash({'orgId':_0x5f3c79,'profileName':_0x2be8d8,'effectiveBaseUrl':_0x130dc8,'setupHeaders':_0x132090,'invalidateOn':_0x27d410?.['invalidateOn'],'userAgent':_0x27d410?.['userAgent'],'clientIp':_0x27d410?.[_0x456380(0xf0)]}),_0xa69626=_0x4e4373[_0x456380(0xde)](getSessionCachePath,_0x3c55a1,_0x2be8d8),_0x549d71=join(_0x4e4373['bjYyD'](getRangerHomeDir),_0x456380(0x8a));!existsSync(_0x549d71)&&await mkdir(_0x549d71,{'recursive':!![]});const _0x582f64={..._0x47e381};_0x5c66cf&&_0x5c66cf[_0x456380(0xd5)]>0x0&&Array['isArray'](_0x582f64['cookies'])&&(_0x582f64[_0x456380(0x96)]=_0x4e4373['oDwfN'](duplicateCookiesForDomains,_0x582f64[_0x456380(0x96)],_0x5c66cf));const _0x5c7fc6={'cached_at':new Date()[_0x456380(0xcd)](),'session_state':_0x582f64};await _0x4e4373['keGGz'](writeFile,_0xa69626,JSON[_0x456380(0xaa)](_0x5c7fc6,null,0x2));const _0x1a4ee6=getStorageStatePath(_0xa69626);return await writeFile(_0x1a4ee6,JSON[_0x456380(0xaa)](_0x582f64,null,0x2)),_0x1a4ee6;}export async function checkLocalCache(_0x1398d2,_0x2ece2c,_0x509ae5,_0x2ecd11,_0x430d10){const _0x36a9f0=_0x254ff9,_0x41c2c8={'oObaW':function(_0x5b2eae,_0x176557){return _0x5b2eae(_0x176557);},'hjygK':function(_0x219fcd,_0x5cadbe){return _0x219fcd(_0x5cadbe);}},_0x1c74e3=sessionCacheHash({'orgId':_0x2ece2c,'profileName':_0x1398d2,'effectiveBaseUrl':_0x509ae5,'setupHeaders':_0x2ecd11,'invalidateOn':_0x430d10?.[_0x36a9f0(0xe3)],'userAgent':_0x430d10?.[_0x36a9f0(0x8b)],'clientIp':_0x430d10?.['clientIp']}),_0x259782=getSessionCachePath(_0x1c74e3,_0x1398d2),_0x5cba79=_0x41c2c8[_0x36a9f0(0xd7)](getStorageStatePath,_0x259782);if(!_0x41c2c8[_0x36a9f0(0xd7)](existsSync,_0x259782)||!_0x41c2c8['hjygK'](existsSync,_0x5cba79))return null;try{const _0x8aa9e3=await readFile(_0x259782,_0x36a9f0(0xed));return JSON['parse'](_0x8aa9e3),{'storageStatePath':_0x5cba79};}catch{return null;}}function launchRealBrowser(){const _0x10271c=_0x254ff9;return chromium[_0x10271c(0xb7)]({'headless':!![]});}function emitSessionValidationHint(_0x3eb985,_0x233b96){const _0x4451cf=_0x254ff9,_0x6fad27={'nOiVK':function(_0x5ef0c7,_0x2560e3){return _0x5ef0c7===_0x2560e3;},'EHsNm':function(_0x38610f,_0x595aee){return _0x38610f+_0x595aee;}};if(!_0x233b96||!_0x233b96['domains']?.[_0x4451cf(0xd5)])return;let _0x2e899c;try{_0x2e899c=new URL(_0x3eb985);}catch{return;}const _0x39a4e7=[];for(const _0x2b2de5 of _0x233b96['domains']){try{_0x39a4e7[_0x4451cf(0xd0)]({'raw':_0x2b2de5,'url':new URL(_0x2b2de5)});}catch{}}if(_0x6fad27[_0x4451cf(0xf2)](_0x39a4e7['length'],0x0))return;if(_0x39a4e7['some'](_0x52f8d7=>_0x52f8d7[_0x4451cf(0xac)]['origin']===_0x2e899c['origin']))return;const _0x28da97=_0x39a4e7['map'](_0x1d889b=>'\x22'+_0x1d889b[_0x4451cf(0xd1)]+'\x22')['join'](',\x20');console[_0x4451cf(0xb3)](_0x6fad27['EHsNm']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x28da97+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x3eb985+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20')+_0x4451cf(0xa3));}export async function serverSideLogin(_0x204d7e,_0x47e598){const _0x158448=_0x254ff9,_0x36651b={'sxFkM':function(_0x4a9a27,_0x265baa){return _0x4a9a27 instanceof _0x265baa;},'hhAjM':function(_0x2a35de,_0x407ca9){return _0x2a35de===_0x407ca9;}},_0x2f92ee=process[_0x158448(0xd3)][_0x158448(0xd4)],_0x1cfcc4=process['env'][_0x158448(0xa5)],_0x3f6818={};if(_0x2f92ee)_0x3f6818['username']=_0x2f92ee;if(_0x1cfcc4)_0x3f6818[_0x158448(0xe7)]=_0x1cfcc4;if(_0x47e598?.[_0x158448(0xaf)])_0x3f6818[_0x158448(0xaf)]=!![];try{return await apiRequest(_0x158448(0xc6)+encodeURIComponent(_0x204d7e)+'/login',{'method':'POST','body':JSON['stringify'](_0x3f6818)});}catch(_0x172727){if(_0x36651b[_0x158448(0xe1)](_0x172727,ApiError)&&_0x36651b['hhAjM'](_0x172727['status'],0x190)&&_0x172727['code']===_0x158448(0xe2))return{'status':_0x158448(0xe2),'error':_0x172727['detail']};throw _0x172727;}}export async function manualBrowserLogin(_0x1ad215,_0x371cd6){const _0x49e27e=_0x254ff9,_0x5eda14={'YkWLZ':function(_0x39b747){return _0x39b747();},'pEyfO':_0x49e27e(0xdd),'xsWsV':function(_0x637769,_0x12aed6){return _0x637769>_0x12aed6;},'HPSja':'about:blank','OPlHL':'\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','fFHZh':function(_0xfb6938,_0x3eed11){return _0xfb6938(_0x3eed11);},'zxAyR':'cli:manual-login'};if(!isInteractive())throw new Error('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x1ad215['name']+_0x49e27e(0xa6)+_0x5eda14[_0x49e27e(0x93)]+'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.');const _0x3da932=_0x371cd6&&_0x5eda14['xsWsV'](_0x371cd6[_0x49e27e(0xcc)]['length'],0x0)?_0x371cd6['domains'][0x0]:_0x5eda14['HPSja'];console['log']('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console[_0x49e27e(0xb3)](_0x5eda14[_0x49e27e(0xca)]),await new Promise(_0x363e47=>setTimeout(_0x363e47,0x7d0));const _0x1f1b4d=await chromium[_0x49e27e(0xb7)]({'headless':![]});let _0x391eb1=null;try{const _0x69fdad={'ignoreHTTPSErrors':!![]};_0x371cd6?.[_0x49e27e(0xef)]&&(_0x69fdad[_0x49e27e(0xc1)]=_0x371cd6[_0x49e27e(0xef)]);const _0x4489ba=await _0x1f1b4d[_0x49e27e(0xeb)](_0x69fdad);await addProfileSetupBanner(_0x4489ba);const _0x20c691=await _0x4489ba['newPage']();await _0x20c691[_0x49e27e(0xb0)](_0x3da932);let _0x260c44=![];await new Promise(_0xeea643=>{const _0x497211={'CprPt':function(_0xf5143b,_0x1c4394){return _0xf5143b/_0x1c4394;},'NIXcB':function(_0x4eb799){return _0x5eda14['YkWLZ'](_0x4eb799);}},_0x58a444=setTimeout(()=>{const _0x296ccb=_0x1d73;_0x260c44=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+_0x497211[_0x296ccb(0xba)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x296ccb(0x90)),_0x497211['NIXcB'](_0xeea643);},MANUAL_LOGIN_TIMEOUT_MS);_0x20c691['on']('close',async()=>{clearTimeout(_0x58a444);try{const _0x1381b0=await _0x4489ba['storageState']();_0x391eb1=_0x1381b0;}catch{}_0xeea643();});});if(_0x260c44&&!_0x391eb1)throw new Error('Browser\x20login\x20timed\x20out\x20before\x20completion.');}finally{await _0x1f1b4d[_0x49e27e(0xa9)]()[_0x49e27e(0xcb)](()=>{});}if(!_0x391eb1)throw new Error('Browser\x20closed\x20before\x20authentication\x20was\x20saved.');return await apiRequest('/api/v1/profiles/'+_0x5eda14[_0x49e27e(0x87)](encodeURIComponent,_0x1ad215[_0x49e27e(0x9b)])+_0x49e27e(0xe0),{'method':'POST','body':JSON['stringify']({'session_state':_0x391eb1,'updated_by':_0x5eda14['zxAyR']})}),{'sessionState':_0x391eb1};}export async function promptSaveCredentials(_0x794368){const _0x593910=_0x254ff9,_0x4a03dc={'tfhTI':function(_0x10c844,_0x19c6d8){return _0x10c844||_0x19c6d8;},'vxBEP':'save','ugcrq':function(_0x50691b,_0x4f210c){return _0x50691b(_0x4f210c);}},_0x2cd765=process[_0x593910(0xd3)][_0x593910(0xd4)],_0x56d4f6=process[_0x593910(0xd3)][_0x593910(0xa5)];if(_0x4a03dc[_0x593910(0xa2)](!_0x2cd765,!_0x56d4f6))return;if(!isInteractive())return;const {save:_0xd12a1}=await _0x4bb1ef['prompt']([{'type':'confirm','name':_0x4a03dc['vxBEP'],'message':_0x593910(0xab),'default':![]}]);if(!_0xd12a1)return;await apiRequest(_0x593910(0xc6)+_0x4a03dc[_0x593910(0xdf)](encodeURIComponent,_0x794368),{'method':_0x593910(0x97),'body':JSON['stringify']({'username':_0x2cd765,'password':_0x56d4f6})}),console[_0x593910(0xb3)](_0x593910(0xe8));}export async function resolveCloudProfileSession(_0x20c306,_0x50eda0={}){const _0x413433=_0x254ff9,_0x153fdb={'NGlXz':function(_0x46dbad){return _0x46dbad();},'PmoLt':function(_0x2c5e0,_0xe15bc8){return _0x2c5e0===_0xe15bc8;},'LuoTa':'string','xMvOV':function(_0x121485,_0x251e11){return _0x121485(_0x251e11);},'edauo':function(_0x472e94,_0x553f47,_0x1c5eb4,_0x236685,_0x29089e,_0x342e92){return _0x472e94(_0x553f47,_0x1c5eb4,_0x236685,_0x29089e,_0x342e92);},'TfTdG':function(_0x5e43a9,_0x59fc26,_0x3901d7,_0x311460,_0xb3842c){return _0x5e43a9(_0x59fc26,_0x3901d7,_0x311460,_0xb3842c);},'LUVga':function(_0x505789,_0x577a97,_0x3b0f2a){return _0x505789(_0x577a97,_0x3b0f2a);},'clXel':function(_0x4e10aa,_0x15e587,_0x43d0a1){return _0x4e10aa(_0x15e587,_0x43d0a1);},'TxAVL':_0x413433(0xe2),'ntQif':_0x413433(0xa1),'RTfra':'\x20\x20Login\x20successful.\x20Session\x20cached.','wyPxr':function(_0x4ca4fb,_0x4bec84){return _0x4ca4fb&&_0x4bec84;},'wlsUU':function(_0xba4aa8,_0x47021a){return _0xba4aa8 instanceof _0x47021a;}},_0x16c71b=_0x20c306[_0x413433(0xd6)]??{},_0x30bb0d=await _0x153fdb[_0x413433(0x86)](fetchAuthConfig),_0x5a14c0=_0x30bb0d?resolveAuthEnvironmentLocally(_0x30bb0d,_0x20c306[_0x413433(0x85)]):null,_0x541da5=_0x153fdb[_0x413433(0xc4)](typeof _0x5a14c0?.['loginInstructions'],_0x153fdb[_0x413433(0x9e)])&&_0x5a14c0[_0x413433(0xdb)][_0x413433(0x81)]()?_0x5a14c0['loginInstructions']:undefined,_0x31856d=typeof _0x16c71b[_0x413433(0xdb)]===_0x413433(0xe5)&&_0x16c71b[_0x413433(0xdb)]['trim']()?_0x16c71b[_0x413433(0xdb)]:undefined,_0x4428f9=_0x31856d||!_0x541da5?_0x16c71b:{..._0x16c71b,'loginInstructions':_0x541da5},_0x22eefc=_0x153fdb[_0x413433(0x84)](Boolean,_0x4428f9[_0x413433(0xdb)]?.[_0x413433(0x81)]()),_0x4fc0ef=_0x5a14c0?.['domains'],_0x3a79d6=_0x16c71b[_0x413433(0xef)],_0x415a28=_0x3a79d6??_0x5a14c0?.[_0x413433(0xef)],_0x3da340=_0x50eda0[_0x413433(0x9c)]??_0x16c71b[_0x413433(0xe6)]??(_0x4fc0ef&&_0x4fc0ef['length']>0x0?_0x4fc0ef[0x0]:''),_0x81d4f3={'invalidateOn':_0x5a14c0?.['invalidateOn'],'userAgent':_0x5a14c0?.['browserOptions']?.['userAgent']??_0x16c71b['userAgent']},_0x501caf=await _0x153fdb['edauo'](checkLocalCache,_0x20c306['name'],_0x20c306[_0x413433(0x8f)],_0x3da340,_0x415a28,_0x81d4f3);if(_0x501caf){if(_0x3da340){const _0x13e14d=await _0x153fdb['TfTdG'](isCachedSessionLive,_0x501caf[_0x413433(0xa0)],_0x3da340,{'sessionCheckPath':_0x5a14c0?.['sessionCheckPath'],'setupHeaders':_0x415a28},{'launchBrowser':launchRealBrowser});if(_0x13e14d)return console[_0x413433(0xb3)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x20c306['name']+'\x22'),{'authPath':_0x501caf['storageStatePath'],'settings':_0x4428f9,'resolvedEnv':_0x5a14c0};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x20c306[_0x413433(0x9b)]+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x153fdb[_0x413433(0xee)](emitSessionValidationHint,_0x3da340,_0x5a14c0);}else return{'authPath':_0x501caf[_0x413433(0xa0)],'settings':_0x4428f9,'resolvedEnv':_0x5a14c0};}if(_0x20c306['sessionState']){const _0x57aae5=await writeSessionToLocalCache(_0x20c306[_0x413433(0x9b)],_0x20c306['organizationId'],_0x3da340,_0x415a28,_0x20c306['sessionState'],_0x4fc0ef,_0x81d4f3);if(_0x3da340){const _0x1ef9ee=await _0x153fdb[_0x413433(0xae)](isCachedSessionLive,_0x57aae5,_0x3da340,{'sessionCheckPath':_0x5a14c0?.[_0x413433(0xc9)],'setupHeaders':_0x415a28},{'launchBrowser':launchRealBrowser});if(_0x1ef9ee)return console[_0x413433(0xb3)](_0x413433(0x91)+_0x20c306['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x57aae5,'settings':_0x4428f9,'resolvedEnv':_0x5a14c0};console[_0x413433(0xb3)](_0x413433(0xa7)+_0x20c306['name']+_0x413433(0xc3)),_0x153fdb['clXel'](emitSessionValidationHint,_0x3da340,_0x5a14c0);}else return{'authPath':_0x57aae5,'settings':_0x4428f9,'resolvedEnv':_0x5a14c0};}if(_0x22eefc)return console[_0x413433(0xb3)](_0x413433(0x8e)+_0x20c306[_0x413433(0x9b)]+'\x22;\x20proceeding\x20with\x20loginInstructions.'),{'authPath':undefined,'settings':_0x4428f9,'resolvedEnv':_0x5a14c0};console['log']('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x20c306[_0x413433(0x9b)]+_0x413433(0xb5));const _0x122f08=Boolean(process['env'][_0x413433(0xd4)])&&Boolean(process[_0x413433(0xd3)]['RANGER_TEST_PASSWORD']),_0x5a82ab=Boolean(_0x20c306[_0x413433(0xf3)]);if(_0x122f08||_0x5a82ab)try{const _0x11d880=await serverSideLogin(_0x20c306[_0x413433(0x9b)]);if(_0x11d880['status']===_0x153fdb['TxAVL'])console['log'](_0x153fdb['ntQif']);else{if(_0x153fdb[_0x413433(0xc4)](_0x11d880[_0x413433(0xdc)],'success')&&_0x11d880['session_state']){console[_0x413433(0xb3)](_0x153fdb['RTfra']);const _0x274715=await writeSessionToLocalCache(_0x20c306['name'],_0x20c306['organizationId'],_0x3da340,_0x415a28,_0x11d880[_0x413433(0xea)],_0x4fc0ef,_0x81d4f3);return _0x153fdb['wyPxr'](_0x122f08,!_0x5a82ab)&&await _0x153fdb[_0x413433(0x84)](promptSaveCredentials,_0x20c306[_0x413433(0x9b)]),{'authPath':_0x274715,'settings':_0x4428f9,'resolvedEnv':_0x5a14c0};}else _0x11d880['test_output']&&(console['log'](_0x413433(0xcf)),console[_0x413433(0xb3)](_0x11d880['test_output'])),console[_0x413433(0xb3)](_0x413433(0x8d));}}catch(_0x3439e3){console[_0x413433(0xb3)](_0x413433(0xb1)+(_0x153fdb[_0x413433(0x89)](_0x3439e3,Error)?_0x3439e3['message']:_0x153fdb[_0x413433(0x84)](String,_0x3439e3))),console[_0x413433(0xb3)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const _0x453346=_0x5a14c0?{..._0x5a14c0,'setupHeaders':_0x415a28}:_0x3da340?{'key':_0x20c306['environmentKey']??'','domains':[_0x3da340],'setupHeaders':_0x415a28}:null,{sessionState:_0x37856d}=await manualBrowserLogin(_0x20c306,_0x453346),_0x223e7b=await writeSessionToLocalCache(_0x20c306[_0x413433(0x9b)],_0x20c306['organizationId'],_0x3da340,_0x415a28,_0x37856d,_0x4fc0ef,_0x81d4f3);return{'authPath':_0x223e7b,'settings':_0x4428f9,'resolvedEnv':_0x5a14c0};}
@@ -1 +1 @@
1
- const _0x57338f=_0x4806;(function(_0x5202a3,_0x295e4d){const _0x352c26=_0x4806,_0x66605f=_0x5202a3();while(!![]){try{const _0x22fd46=-parseInt(_0x352c26(0xff))/0x1+-parseInt(_0x352c26(0x119))/0x2*(-parseInt(_0x352c26(0x107))/0x3)+parseInt(_0x352c26(0xf9))/0x4*(parseInt(_0x352c26(0x104))/0x5)+-parseInt(_0x352c26(0x109))/0x6+-parseInt(_0x352c26(0x115))/0x7+-parseInt(_0x352c26(0x10c))/0x8+parseInt(_0x352c26(0x111))/0x9;if(_0x22fd46===_0x295e4d)break;else _0x66605f['push'](_0x66605f['shift']());}catch(_0x2a86f3){_0x66605f['push'](_0x66605f['shift']());}}}(_0x2e3e,0xa248c));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x277cef=process['env'],_0x177652={'stdin':process[_0x57338f(0x113)],'stdout':process['stdout']}){const _0xf47ea7=_0x57338f,_0x54d960={'DibOE':function(_0x53ecf4,_0x42465d){return _0x53ecf4(_0x42465d);}};if(_0x277cef['CI'])return![];return _0x54d960['DibOE'](Boolean,_0x177652['stdin']['isTTY'])&&Boolean(_0x177652[_0xf47ea7(0x124)]['isTTY']);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x3b2779){const _0x34abb1=_0x57338f,_0x19df4e={'myaHg':'baseUrl','aiwas':function(_0x5772ce,_0x2fa559){return _0x5772ce(_0x2fa559);},'zXXfP':function(_0x5e72e6,_0x1f04a8){return _0x5e72e6(_0x1f04a8);},'VbhpD':'userAgent','PzoBt':function(_0x2b2956,_0x4eb6c1){return _0x2b2956!==_0x4eb6c1;},'MsDdm':function(_0x3f5e61,_0x50fbfe){return _0x3f5e61(_0x50fbfe);},'EkFqE':_0x34abb1(0x10f),'FJzgI':'hex'},_0x11d84a=new Set(_0x3b2779['invalidateOn']??DEFAULT_INVALIDATE_ON),_0x41c3bd={'orgId':_0x3b2779['orgId'],'profileName':_0x3b2779['profileName']};return _0x11d84a['has'](_0x19df4e[_0x34abb1(0x11e)])&&(_0x41c3bd['effectiveBaseUrl']=_0x3b2779['effectiveBaseUrl']),_0x11d84a[_0x34abb1(0xfd)](_0x34abb1(0x10a))&&(_0x41c3bd['setupHeaders']=_0x3b2779['setupHeaders']?_0x19df4e[_0x34abb1(0x127)](sortObjectKeys,_0x3b2779['setupHeaders']):_0x3b2779[_0x34abb1(0x10a)]),_0x11d84a['has']('port')&&(_0x41c3bd['port']=_0x19df4e['zXXfP'](extractPort,_0x3b2779[_0x34abb1(0x102)])),_0x11d84a['has'](_0x19df4e[_0x34abb1(0x100)])&&_0x19df4e['PzoBt'](_0x3b2779[_0x34abb1(0x101)],undefined)&&(_0x41c3bd[_0x34abb1(0x101)]=_0x3b2779[_0x34abb1(0x101)]),_0x11d84a['has'](_0x34abb1(0x103))&&_0x3b2779[_0x34abb1(0x103)]!==undefined&&(_0x41c3bd[_0x34abb1(0x103)]=_0x3b2779[_0x34abb1(0x103)]),_0x19df4e['MsDdm'](createHash,_0x19df4e['EkFqE'])['update'](JSON[_0x34abb1(0xfc)](_0x41c3bd))['digest'](_0x19df4e[_0x34abb1(0xfe)])[_0x34abb1(0x118)](0x0,0xc);}function extractPort(_0x185f01){try{return new URL(_0x185f01)['port'];}catch{return'';}}function sortObjectKeys(_0x35767c){const _0x4e149e=_0x57338f,_0x49d00={};for(const _0x300ccf of Object[_0x4e149e(0x11b)](_0x35767c)['sort']()){_0x49d00[_0x300ccf]=_0x35767c[_0x300ccf];}return _0x49d00;}export function getSessionCachePath(_0x6c33a9,_0x4a76fe){const _0x46e058=_0x57338f,_0x21e37e={'TmrlK':function(_0x1b9893,_0x2b6982,_0x328887,_0x30af37){return _0x1b9893(_0x2b6982,_0x328887,_0x30af37);}};return _0x21e37e[_0x46e058(0x123)](join,getRangerHomeDir(),_0x46e058(0x10e),_0x6c33a9+'-'+_0x4a76fe+'.json');}function _0x2e3e(){const _0x30529c=['928264pauJGl','VbhpD','userAgent','effectiveBaseUrl','clientIp','5505185BoeLde','close','bUuLE','4173QkuhlZ','goto','7680054kKdiTI','setupHeaders','sessionCheckPath','4214808ktVkRd','toString','auth','sha256','wHpez','20636145DYqYhY','push','stdin','catch','7465941lPNykY','launchBrowser','test','slice','1542WceHuh','sXVXm','keys','endsWith','domcontentloaded','myaHg','replace','MPzfs','newPage','status','TmrlK','stdout','defaultEnvironmentKey','127.0.0.1','aiwas','4Lqtmon','.storageState.json','length','stringify','has','FJzgI'];_0x2e3e=function(){return _0x30529c;};return _0x2e3e();}export function getStorageStatePath(_0x12e5b2){const _0x2b3606=_0x57338f,_0x31e9ca={'CvxmB':_0x2b3606(0xfa)};return _0x12e5b2[_0x2b3606(0x11f)](/\.json$/,_0x31e9ca['CvxmB']);}export function needsTunnel(_0x4eb4e5){const _0x27752d=_0x57338f,_0x3ca05e={'BBmKb':function(_0x3ce744,_0x345acc){return _0x3ce744===_0x345acc;},'WVQxO':'localhost','bUuLE':'.localhost','sXVXm':'localhost.'};let _0x25b0ef;try{_0x25b0ef=new URL(_0x4eb4e5)['hostname'];}catch{return![];}if(_0x3ca05e['BBmKb'](_0x25b0ef,_0x3ca05e['WVQxO'])||_0x25b0ef===_0x27752d(0x126))return!![];if(_0x25b0ef[_0x27752d(0x11c)](_0x3ca05e[_0x27752d(0x106)]))return!![];if(_0x25b0ef['includes'](_0x3ca05e[_0x27752d(0x11a)]))return!![];return![];}export function hostnameOf(_0x47853a){return new URL(_0x47853a)['hostname'];}export function duplicateCookiesForDomains(_0x28a61d,_0x236e5b){const _0x23f6a0=_0x57338f,_0x45f385={'MPzfs':function(_0x5e3ff1,_0xf97ca5){return _0x5e3ff1(_0xf97ca5);}},_0x400fa5=[..._0x28a61d],_0x30cfe3=new Set(_0x28a61d['map'](_0xfd5eb8=>_0xfd5eb8['domain']));for(const _0x217d9e of _0x236e5b){let _0x507904;try{_0x507904=_0x45f385[_0x23f6a0(0x120)](hostnameOf,_0x217d9e);}catch{continue;}if(!_0x507904)continue;const _0x2365d1=_0x507904['startsWith']('.')?_0x507904:'.'+_0x507904;if(_0x30cfe3['has'](_0x507904)||_0x30cfe3[_0x23f6a0(0xfd)](_0x2365d1))continue;for(const _0x28b104 of _0x28a61d){_0x400fa5[_0x23f6a0(0x112)]({..._0x28b104,'domain':_0x2365d1});}_0x30cfe3['add'](_0x2365d1);}return _0x400fa5;}function _0x4806(_0x490418,_0x8b88e4){_0x490418=_0x490418-0xf9;const _0x2e3e66=_0x2e3e();let _0x4806d1=_0x2e3e66[_0x490418];return _0x4806d1;}export function resolveAuthEnvironmentLocally(_0x5d2854,_0xf7f050){const _0x103a31=_0x57338f,_0x213ff3={'wHpez':function(_0x58d11d,_0x107519){return _0x58d11d===_0x107519;}},_0x201126=_0x5d2854['environments'];if(_0xf7f050){const _0x13ca26=_0x201126[_0xf7f050];if(!_0x13ca26)return null;return{'key':_0xf7f050,..._0x13ca26};}if(_0x5d2854[_0x103a31(0x125)]){const _0x196e46=_0x201126[_0x5d2854[_0x103a31(0x125)]];if(!_0x196e46)return null;return{'key':_0x5d2854[_0x103a31(0x125)],..._0x196e46};}const _0xfbec90=Object[_0x103a31(0x11b)](_0x201126);if(_0x213ff3[_0x103a31(0x110)](_0xfbec90[_0x103a31(0xfb)],0x1)){const _0x528c04=_0xfbec90[0x0];return{'key':_0x528c04,..._0x201126[_0x528c04]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x46fd3c,_0x3905aa){const _0x252c21=_0x57338f;try{if(_0x3905aa)return new URL(_0x3905aa,_0x46fd3c)['toString']();return new URL(_0x46fd3c)[_0x252c21(0x10d)]();}catch{return null;}}export function looksLikeLoginUrl(_0x4b2054){const _0x5ec71a=_0x57338f;try{const _0x1039d5=new URL(_0x4b2054);return LOGIN_URL_PATTERN['test'](_0x1039d5['pathname']);}catch{return LOGIN_URL_PATTERN[_0x5ec71a(0x117)](_0x4b2054);}}export async function isCachedSessionLive(_0x2fd021,_0x4f8d6d,_0x4a7ae5={},_0x5c5a80={}){const _0x510ba9=_0x57338f,_0x301007=buildSessionCheckUrl(_0x4f8d6d,_0x4a7ae5[_0x510ba9(0x10b)]);if(!_0x301007)return!![];if(!_0x5c5a80[_0x510ba9(0x116)])return!![];let _0x4ca197=null;try{_0x4ca197=await _0x5c5a80[_0x510ba9(0x116)]();const _0x2b8082=await _0x4ca197['newContext']({'storageState':_0x2fd021,'ignoreHTTPSErrors':!![],..._0x4a7ae5['setupHeaders']?{'extraHTTPHeaders':_0x4a7ae5['setupHeaders']}:{}}),_0x55fddb=await _0x2b8082[_0x510ba9(0x121)](),_0x334c61=await _0x55fddb[_0x510ba9(0x108)](_0x301007,{'waitUntil':_0x510ba9(0x11d),'timeout':0x3a98}),_0x29ecb7=_0x334c61?.[_0x510ba9(0x122)]();if(_0x29ecb7===0x191||_0x29ecb7===0x193)return![];const _0x22d4ef=_0x55fddb['url']();if(looksLikeLoginUrl(_0x22d4ef))return![];return!![];}catch{return![];}finally{if(_0x4ca197)await _0x4ca197[_0x510ba9(0x105)]()[_0x510ba9(0x114)](()=>{});}}
1
+ const _0x4b7eda=_0xc2f2;(function(_0x4af198,_0x2c60f8){const _0x4f7f56=_0xc2f2,_0x4d4dc7=_0x4af198();while(!![]){try{const _0x36401a=-parseInt(_0x4f7f56(0x106))/0x1+parseInt(_0x4f7f56(0x118))/0x2+-parseInt(_0x4f7f56(0x114))/0x3+-parseInt(_0x4f7f56(0x11b))/0x4+-parseInt(_0x4f7f56(0x119))/0x5+parseInt(_0x4f7f56(0x115))/0x6+-parseInt(_0x4f7f56(0x102))/0x7*(-parseInt(_0x4f7f56(0xfb))/0x8);if(_0x36401a===_0x2c60f8)break;else _0x4d4dc7['push'](_0x4d4dc7['shift']());}catch(_0x4bac17){_0x4d4dc7['push'](_0x4d4dc7['shift']());}}}(_0x57f6,0x6c05f));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x4cdb22=process['env'],_0x244516={'stdin':process[_0x4b7eda(0x117)],'stdout':process['stdout']}){const _0x5583d6=_0x4b7eda,_0x5a631f={'Gnjtw':function(_0x56848f,_0x3cc22c){return _0x56848f(_0x3cc22c);}};if(_0x4cdb22['CI'])return![];return _0x5a631f['Gnjtw'](Boolean,_0x244516[_0x5583d6(0x117)]['isTTY'])&&Boolean(_0x244516[_0x5583d6(0xf1)][_0x5583d6(0xfd)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x1072bb){const _0x1fe5d1=_0x4b7eda,_0x156179={'JFviF':'baseUrl','HscNU':'setupHeaders','EqpZK':_0x1fe5d1(0xf2),'zEfWJ':function(_0x1e53bb,_0x2f0178){return _0x1e53bb(_0x2f0178);},'IErPj':_0x1fe5d1(0x110),'CZNTq':'sha256','JLZRS':_0x1fe5d1(0xfc)},_0x19c2c2=new Set(_0x1072bb['invalidateOn']??DEFAULT_INVALIDATE_ON),_0x39e592={'orgId':_0x1072bb['orgId'],'profileName':_0x1072bb[_0x1fe5d1(0x112)]};return _0x19c2c2[_0x1fe5d1(0xf4)](_0x156179[_0x1fe5d1(0x109)])&&(_0x39e592[_0x1fe5d1(0x104)]=_0x1072bb['effectiveBaseUrl']),_0x19c2c2['has'](_0x156179['HscNU'])&&(_0x39e592['setupHeaders']=_0x1072bb['setupHeaders']?sortObjectKeys(_0x1072bb['setupHeaders']):_0x1072bb[_0x1fe5d1(0x100)]),_0x19c2c2[_0x1fe5d1(0xf4)](_0x156179[_0x1fe5d1(0xf8)])&&(_0x39e592['port']=_0x156179[_0x1fe5d1(0x10a)](extractPort,_0x1072bb['effectiveBaseUrl'])),_0x19c2c2[_0x1fe5d1(0xf4)](_0x156179['IErPj'])&&_0x1072bb[_0x1fe5d1(0x110)]!==undefined&&(_0x39e592['userAgent']=_0x1072bb['userAgent']),_0x19c2c2['has'](_0x1fe5d1(0x11c))&&_0x1072bb[_0x1fe5d1(0x11c)]!==undefined&&(_0x39e592['clientIp']=_0x1072bb[_0x1fe5d1(0x11c)]),createHash(_0x156179[_0x1fe5d1(0xf5)])['update'](JSON['stringify'](_0x39e592))['digest'](_0x156179['JLZRS'])['slice'](0x0,0xc);}function extractPort(_0xde104f){try{return new URL(_0xde104f)['port'];}catch{return'';}}function sortObjectKeys(_0xa2322d){const _0x2d3698=_0x4b7eda,_0x489c74={};for(const _0x23c389 of Object[_0x2d3698(0xf9)](_0xa2322d)['sort']()){_0x489c74[_0x23c389]=_0xa2322d[_0x23c389];}return _0x489c74;}export function getSessionCachePath(_0xdf970b,_0x2e2fcc){const _0x163ab3=_0x4b7eda,_0xbbca25={'YmCFV':function(_0x228172,_0x350461,_0x5111c2,_0x363daa){return _0x228172(_0x350461,_0x5111c2,_0x363daa);},'VHUrR':function(_0x2ef1c8){return _0x2ef1c8();}};return _0xbbca25['YmCFV'](join,_0xbbca25['VHUrR'](getRangerHomeDir),_0x163ab3(0x10d),_0xdf970b+'-'+_0x2e2fcc+'.json');}export function getStorageStatePath(_0x369d1c){const _0x38e265={'ybAbm':'.storageState.json'};return _0x369d1c['replace'](/\.json$/,_0x38e265['ybAbm']);}function _0xc2f2(_0x416e4f,_0xb5736e){_0x416e4f=_0x416e4f-0xef;const _0x57f656=_0x57f6();let _0xc2f233=_0x57f656[_0x416e4f];return _0xc2f233;}export function needsTunnel(_0x20f60a){const _0x7f8875=_0x4b7eda,_0x12bedd={'OFRNL':_0x7f8875(0x113),'xVDIz':_0x7f8875(0x11a)};let _0x58faee;try{_0x58faee=new URL(_0x20f60a)[_0x7f8875(0x10e)];}catch{return![];}if(_0x58faee==='localhost'||_0x58faee===_0x12bedd[_0x7f8875(0xf7)])return!![];if(_0x58faee['endsWith'](_0x7f8875(0x10f)))return!![];if(_0x58faee[_0x7f8875(0x10b)](_0x12bedd[_0x7f8875(0x111)]))return!![];return![];}function _0x57f6(){const _0x17700f=['hostname','.localhost','userAgent','xVDIz','profileName','127.0.0.1','1983135yegMRG','4565910CdilDa','MeVuD','stdin','1635110KnQfgG','1629770OuFWnB','localhost.','2393400yEhPIh','clientIp','environments','add','sessionCheckPath','push','stdout','port','startsWith','has','CZNTq','newPage','OFRNL','EqpZK','keys','status','4635320mWqtwJ','hex','isTTY','toString','close','setupHeaders','url','7URUWlD','pathname','effectiveBaseUrl','test','130143tKheLy','defaultEnvironmentKey','length','JFviF','zEfWJ','includes','launchBrowser','auth'];_0x57f6=function(){return _0x17700f;};return _0x57f6();}export function hostnameOf(_0x2a0c0f){const _0xc7cfd0=_0x4b7eda;return new URL(_0x2a0c0f)[_0xc7cfd0(0x10e)];}export function duplicateCookiesForDomains(_0x45bdc6,_0x2e6f0a){const _0x2ad08f=_0x4b7eda,_0x3b5811=[..._0x45bdc6],_0x1ea4fa=new Set(_0x45bdc6['map'](_0x3c6a35=>_0x3c6a35['domain']));for(const _0x4ee7fd of _0x2e6f0a){let _0xe8f7b7;try{_0xe8f7b7=hostnameOf(_0x4ee7fd);}catch{continue;}if(!_0xe8f7b7)continue;const _0x147387=_0xe8f7b7[_0x2ad08f(0xf3)]('.')?_0xe8f7b7:'.'+_0xe8f7b7;if(_0x1ea4fa[_0x2ad08f(0xf4)](_0xe8f7b7)||_0x1ea4fa[_0x2ad08f(0xf4)](_0x147387))continue;for(const _0x4e8e06 of _0x45bdc6){_0x3b5811[_0x2ad08f(0xf0)]({..._0x4e8e06,'domain':_0x147387});}_0x1ea4fa[_0x2ad08f(0x11e)](_0x147387);}return _0x3b5811;}export function resolveAuthEnvironmentLocally(_0x1540d2,_0x1b8323){const _0x1b89fd=_0x4b7eda,_0x1e662b={'nbMKc':function(_0x50ed6f,_0x329721){return _0x50ed6f===_0x329721;}},_0xafadf=_0x1540d2[_0x1b89fd(0x11d)];if(_0x1b8323){const _0x56eacf=_0xafadf[_0x1b8323];if(!_0x56eacf)return null;return{'key':_0x1b8323,..._0x56eacf};}if(_0x1540d2[_0x1b89fd(0x107)]){const _0x3b7c6f=_0xafadf[_0x1540d2[_0x1b89fd(0x107)]];if(!_0x3b7c6f)return null;return{'key':_0x1540d2['defaultEnvironmentKey'],..._0x3b7c6f};}const _0x5116c7=Object['keys'](_0xafadf);if(_0x1e662b['nbMKc'](_0x5116c7[_0x1b89fd(0x108)],0x1)){const _0x18121d=_0x5116c7[0x0];return{'key':_0x18121d,..._0xafadf[_0x18121d]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x508766,_0x49d293){const _0x239dfe=_0x4b7eda;try{if(_0x49d293)return new URL(_0x49d293,_0x508766)['toString']();return new URL(_0x508766)[_0x239dfe(0xfe)]();}catch{return null;}}export function looksLikeLoginUrl(_0x2285f7){const _0x619659=_0x4b7eda;try{const _0x225b4d=new URL(_0x2285f7);return LOGIN_URL_PATTERN[_0x619659(0x105)](_0x225b4d[_0x619659(0x103)]);}catch{return LOGIN_URL_PATTERN['test'](_0x2285f7);}}export async function isCachedSessionLive(_0x1a3716,_0x4411ef,_0x29c80c={},_0x2d6f53={}){const _0x936159=_0x4b7eda,_0x4d9d21={'MeVuD':function(_0x1b08a6,_0x5955ea){return _0x1b08a6(_0x5955ea);}},_0x49210a=buildSessionCheckUrl(_0x4411ef,_0x29c80c[_0x936159(0xef)]);if(!_0x49210a)return!![];if(!_0x2d6f53[_0x936159(0x10c)])return!![];let _0xba75d2=null;try{_0xba75d2=await _0x2d6f53[_0x936159(0x10c)]();const _0x14f8f7=await _0xba75d2['newContext']({'storageState':_0x1a3716,'ignoreHTTPSErrors':!![],..._0x29c80c[_0x936159(0x100)]?{'extraHTTPHeaders':_0x29c80c[_0x936159(0x100)]}:{}}),_0x41bfd3=await _0x14f8f7[_0x936159(0xf6)](),_0x10e522=await _0x41bfd3['goto'](_0x49210a,{'waitUntil':'domcontentloaded','timeout':0x3a98}),_0x39cd12=_0x10e522?.[_0x936159(0xfa)]();if(_0x39cd12===0x191||_0x39cd12===0x193)return![];const _0x3bba70=_0x41bfd3[_0x936159(0x101)]();if(_0x4d9d21[_0x936159(0x116)](looksLikeLoginUrl,_0x3bba70))return![];return!![];}catch{return![];}finally{if(_0xba75d2)await _0xba75d2[_0x936159(0xff)]()['catch'](()=>{});}}
@@ -1 +1 @@
1
- const _0x3236b5=_0x3f23;(function(_0x117d27,_0x347fbb){const _0x2a9bfa=_0x3f23,_0xd03a6f=_0x117d27();while(!![]){try{const _0x1e1a18=-parseInt(_0x2a9bfa(0x92))/0x1+parseInt(_0x2a9bfa(0x8b))/0x2+parseInt(_0x2a9bfa(0x93))/0x3*(-parseInt(_0x2a9bfa(0x91))/0x4)+parseInt(_0x2a9bfa(0x9c))/0x5*(parseInt(_0x2a9bfa(0x99))/0x6)+-parseInt(_0x2a9bfa(0x8c))/0x7+-parseInt(_0x2a9bfa(0x94))/0x8*(-parseInt(_0x2a9bfa(0x8a))/0x9)+-parseInt(_0x2a9bfa(0x96))/0xa*(parseInt(_0x2a9bfa(0x98))/0xb);if(_0x1e1a18===_0x347fbb)break;else _0xd03a6f['push'](_0xd03a6f['shift']());}catch(_0x2562b8){_0xd03a6f['push'](_0xd03a6f['shift']());}}}(_0x3a4a,0xb3d94));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM=_0x3236b5(0x9a),SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0x3f23(_0xc4080,_0x5b96a4){_0xc4080=_0xc4080-0x88;const _0x3a4afd=_0x3a4a();let _0x3f2376=_0x3a4afd[_0xc4080];return _0x3f2376;}export function deriveKey(_0x57c947){const _0x406c2b=_0x3236b5,_0x262936={'mffUb':function(_0x1908ec,_0x187234,_0x3550fe,_0x49c693,_0x175893,_0x49b7ae){return _0x1908ec(_0x187234,_0x3550fe,_0x49c693,_0x175893,_0x49b7ae);}};return _0x262936['mffUb'](pbkdf2Sync,_0x57c947,SALT,0x186a0,KEY_LENGTH,_0x406c2b(0x97));}export function encrypt(_0x4353dc,_0x443372){const _0x126c20=_0x3236b5,_0x35d1cc={'sBKwq':function(_0x42cfa7,_0x5b5919,_0xb9820c,_0x160ec0){return _0x42cfa7(_0x5b5919,_0xb9820c,_0x160ec0);}},_0x4c1e73=deriveKey(_0x443372),_0x22d637=randomBytes(IV_LENGTH),_0x3a92a4=_0x35d1cc[_0x126c20(0x8d)](createCipheriv,ALGORITHM,_0x4c1e73,_0x22d637),_0x5e4180=Buffer['concat']([_0x3a92a4[_0x126c20(0x8f)](_0x4353dc,'utf8'),_0x3a92a4[_0x126c20(0x89)]()]),_0x5cbe0f=_0x3a92a4[_0x126c20(0x95)]();return Buffer[_0x126c20(0x8e)]([_0x22d637,_0x5cbe0f,_0x5e4180]);}function _0x3a4a(){const _0x53a1ff=['utf8','sySiB','final','12307689LFEoPe','1807312pRnqgZ','4876102QdnEOM','sBKwq','concat','update','setAuthTag','916396ccTuvU','392182mMNtmK','3GRhZCV','8mRhuki','getAuthTag','90PakCUJ','sha256','1386143ylbbmU','13866MJVrbw','aes-256-gcm','jKDYC','1985NoCpwT','subarray'];_0x3a4a=function(){return _0x53a1ff;};return _0x3a4a();}export function decrypt(_0x47b7bf,_0x315b33){const _0x3104d4=_0x3236b5,_0x582aa9={'zcCah':function(_0x2b08fd,_0x44e06b){return _0x2b08fd(_0x44e06b);},'NuwiM':function(_0x15f404,_0x2e34d1){return _0x15f404+_0x2e34d1;},'jKDYC':function(_0x1bde05,_0x1993fe){return _0x1bde05+_0x1993fe;},'cSlnf':function(_0x478ca6,_0x3c2381,_0x4f81ba,_0x112f36){return _0x478ca6(_0x3c2381,_0x4f81ba,_0x112f36);},'sySiB':_0x3104d4(0x9e)},_0x5749bc=_0x582aa9['zcCah'](deriveKey,_0x315b33),_0x364778=_0x47b7bf[_0x3104d4(0x9d)](0x0,IV_LENGTH),_0x333fc1=_0x47b7bf['subarray'](IV_LENGTH,_0x582aa9['NuwiM'](IV_LENGTH,TAG_LENGTH)),_0x5a2158=_0x47b7bf[_0x3104d4(0x9d)](_0x582aa9[_0x3104d4(0x9b)](IV_LENGTH,TAG_LENGTH)),_0x55043f=_0x582aa9['cSlnf'](createDecipheriv,ALGORITHM,_0x5749bc,_0x364778);return _0x55043f[_0x3104d4(0x90)](_0x333fc1),_0x55043f[_0x3104d4(0x8f)](_0x5a2158)+_0x55043f['final'](_0x582aa9[_0x3104d4(0x88)]);}
1
+ (function(_0x2584ab,_0x4969e3){const _0x27f5f0=_0x255e,_0x1f1eec=_0x2584ab();while(!![]){try{const _0xc22cb5=parseInt(_0x27f5f0(0x116))/0x1*(parseInt(_0x27f5f0(0x10f))/0x2)+-parseInt(_0x27f5f0(0x11b))/0x3*(parseInt(_0x27f5f0(0x10d))/0x4)+parseInt(_0x27f5f0(0x10e))/0x5+-parseInt(_0x27f5f0(0x112))/0x6*(parseInt(_0x27f5f0(0x11c))/0x7)+-parseInt(_0x27f5f0(0x10c))/0x8*(parseInt(_0x27f5f0(0x108))/0x9)+parseInt(_0x27f5f0(0x10a))/0xa+parseInt(_0x27f5f0(0x114))/0xb*(parseInt(_0x27f5f0(0x117))/0xc);if(_0xc22cb5===_0x4969e3)break;else _0x1f1eec['push'](_0x1f1eec['shift']());}catch(_0x139d5b){_0x1f1eec['push'](_0x1f1eec['shift']());}}}(_0x5e0c,0xdc937));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 _0x255e(_0x3d7d8f,_0x2ea204){_0x3d7d8f=_0x3d7d8f-0x107;const _0x5e0cde=_0x5e0c();let _0x255ee1=_0x5e0cde[_0x3d7d8f];return _0x255ee1;}export function deriveKey(_0x586a61){const _0x474acb=_0x255e,_0x815313={'YctmV':function(_0xd525bb,_0x4cb1d6,_0x225697,_0x596f17,_0x25056c,_0x1c4861){return _0xd525bb(_0x4cb1d6,_0x225697,_0x596f17,_0x25056c,_0x1c4861);},'ERAGr':_0x474acb(0x110)};return _0x815313['YctmV'](pbkdf2Sync,_0x586a61,SALT,0x186a0,KEY_LENGTH,_0x815313[_0x474acb(0x11a)]);}function _0x5e0c(){const _0x3621d4=['getAuthTag','8vNvrNn','1552YsIVym','8435900jzOvnO','2AtUzPw','sha256','UQbOH','66OYNSmu','update','407SyPfOu','IxXCU','635313bbZMtk','324996ZRkAMj','subarray','final','ERAGr','10071sxpsnr','345247DooWJs','IiwYw','7663419hBaMMY','concat','2754530ZEgljB'];_0x5e0c=function(){return _0x3621d4;};return _0x5e0c();}export function encrypt(_0x137cbc,_0x3792a3){const _0x131c7b=_0x255e,_0x1a5428={'bdgXG':function(_0x37aaa3,_0x113cdc){return _0x37aaa3(_0x113cdc);},'IiwYw':'utf8'},_0x1d8363=_0x1a5428['bdgXG'](deriveKey,_0x3792a3),_0x4b5f34=randomBytes(IV_LENGTH),_0x47b5fe=createCipheriv(ALGORITHM,_0x1d8363,_0x4b5f34),_0x5a5960=Buffer['concat']([_0x47b5fe['update'](_0x137cbc,_0x1a5428[_0x131c7b(0x107)]),_0x47b5fe['final']()]),_0x4d64ee=_0x47b5fe[_0x131c7b(0x10b)]();return Buffer[_0x131c7b(0x109)]([_0x4b5f34,_0x4d64ee,_0x5a5960]);}export function decrypt(_0x290c1e,_0x5a075c){const _0x695fd9=_0x255e,_0x3573be={'UQbOH':function(_0x39ed55,_0x4eac8){return _0x39ed55+_0x4eac8;},'IxXCU':function(_0x2b9854,_0x271dcf,_0x4828d6,_0x576dff){return _0x2b9854(_0x271dcf,_0x4828d6,_0x576dff);},'zYlWb':'utf8'},_0x49c1fb=deriveKey(_0x5a075c),_0x3e8d6a=_0x290c1e[_0x695fd9(0x118)](0x0,IV_LENGTH),_0x30aca3=_0x290c1e[_0x695fd9(0x118)](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x44d632=_0x290c1e['subarray'](_0x3573be['UQbOH'](IV_LENGTH,TAG_LENGTH)),_0x17b16f=_0x3573be[_0x695fd9(0x115)](createDecipheriv,ALGORITHM,_0x49c1fb,_0x3e8d6a);return _0x17b16f['setAuthTag'](_0x30aca3),_0x3573be[_0x695fd9(0x111)](_0x17b16f[_0x695fd9(0x113)](_0x44d632),_0x17b16f[_0x695fd9(0x119)](_0x3573be['zYlWb']));}
@@ -1 +1 @@
1
- const _0x89c315=_0x39e0;(function(_0x3c4957,_0x1113b4){const _0x2eebb7=_0x39e0,_0x1a2ab1=_0x3c4957();while(!![]){try{const _0x41c2e6=parseInt(_0x2eebb7(0x1e0))/0x1+-parseInt(_0x2eebb7(0x1ee))/0x2*(parseInt(_0x2eebb7(0x1e1))/0x3)+parseInt(_0x2eebb7(0x1ea))/0x4*(-parseInt(_0x2eebb7(0x1f6))/0x5)+-parseInt(_0x2eebb7(0x1e2))/0x6*(parseInt(_0x2eebb7(0x1c9))/0x7)+parseInt(_0x2eebb7(0x1f7))/0x8+parseInt(_0x2eebb7(0x1e9))/0x9*(parseInt(_0x2eebb7(0x1d9))/0xa)+parseInt(_0x2eebb7(0x1f4))/0xb;if(_0x41c2e6===_0x1113b4)break;else _0x1a2ab1['push'](_0x1a2ab1['shift']());}catch(_0x54f970){_0x1a2ab1['push'](_0x1a2ab1['shift']());}}}(_0x158a,0x6be8a));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x89c315(0x1e4),'-t',_0x89c315(0x1f3),_0x89c315(0x1f9),'--apikey',_0x89c315(0x1cf),_0x89c315(0x1d5),'--pass','--auth','--authorization',_0x89c315(0x1cc),'--cookie','--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(_0x530edf){const _0x4caa1a=_0x89c315;return TOKEN_PATTERNS['some'](_0x2aa1bf=>_0x2aa1bf[_0x4caa1a(0x1ed)](_0x530edf));}export function sanitizeArgs(_0xc82e12){const _0x3ac26f=_0x89c315,_0x598824={'QvKCh':_0x3ac26f(0x1d2),'xjuEb':function(_0x16c971,_0x4d5f63){return _0x16c971!==_0x4d5f63;}},_0xbddad7=[];let _0x2603ee=![];for(let _0x384a3d=0x0;_0x384a3d<_0xc82e12['length'];_0x384a3d++){const _0x13e72b=_0xc82e12[_0x384a3d];if(_0x2603ee){_0xbddad7['push'](_0x598824[_0x3ac26f(0x1e6)]),_0x2603ee=![];continue;}if(_0x13e72b[_0x3ac26f(0x1cd)]('--')||_0x13e72b[_0x3ac26f(0x1cd)]('-')){const _0x24e108=_0x13e72b[_0x3ac26f(0x1fb)]('=');if(_0x598824['xjuEb'](_0x24e108,-0x1)){const _0x2dbca1=_0x13e72b['slice'](0x0,_0x24e108)[_0x3ac26f(0x1fc)]();if(SENSITIVE_FLAGS[_0x3ac26f(0x1d1)](_0x2dbca1)){_0xbddad7[_0x3ac26f(0x1d7)](_0x13e72b[_0x3ac26f(0x1d8)](0x0,_0x24e108)+_0x3ac26f(0x1f8));continue;}}else{const _0x845262=_0x13e72b[_0x3ac26f(0x1fc)]();SENSITIVE_FLAGS[_0x3ac26f(0x1d1)](_0x845262)&&(_0x2603ee=!![]);}_0xbddad7['push'](_0x13e72b);}else looksLikeToken(_0x13e72b)?_0xbddad7['push'](_0x598824['QvKCh']):_0xbddad7[_0x3ac26f(0x1d7)](_0x13e72b);}return _0xbddad7[_0x3ac26f(0x1ce)]('\x20');}function _0x39e0(_0x2baf07,_0x4ed163){_0x2baf07=_0x2baf07-0x1c7;const _0x158ad7=_0x158a();let _0x39e06b=_0x158ad7[_0x2baf07];return _0x39e06b;}export async function logDesirePath(_0x42d26e){const _0x25f658=_0x89c315,_0x1d8d4f={'jIPJK':function(_0x5bf200){return _0x5bf200();},'YCghx':_0x25f658(0x1ca),'VrWiC':'application/json'};try{const _0x5b75ad=await _0x1d8d4f[_0x25f658(0x1f2)](getToken)['catch'](()=>null),_0x305ca6=getApiBaseUrl(),_0x341a31=getCurrentVersion(),_0x1febb8=_0x5b75ad?_0x1d8d4f['YCghx']:_0x25f658(0x1f1),_0x38c738={..._0x42d26e[_0x25f658(0x1dc)],'authStatus':_0x1febb8,'isTty':process['stdout']['isTTY']??![]},_0x5c2956={'Content-Type':_0x1d8d4f['VrWiC']};_0x5b75ad&&(_0x5c2956[_0x25f658(0x1d4)]='Bearer\x20'+_0x5b75ad);const _0x3239d3={'rawCommand':_0x42d26e['rawCommand'],'errorMessage':_0x42d26e['errorMessage'],'errorType':_0x42d26e[_0x25f658(0x1cb)],'featureId':_0x42d26e['featureId'],'sessionId':_0x42d26e[_0x25f658(0x1ec)],'metadata':_0x38c738,'cliVersion':_0x341a31};process[_0x25f658(0x1fd)][_0x25f658(0x1d6)]&&(console[_0x25f658(0x1e7)](_0x25f658(0x1df)+_0x305ca6+'/api/v1/mcp/desire-path-logs'),console[_0x25f658(0x1e7)]('[desire-path]\x20Payload:\x20'+JSON[_0x25f658(0x1fa)](_0x3239d3,null,0x2))),await fetch(_0x305ca6+'/api/v1/mcp/desire-path-logs',{'method':_0x25f658(0x1e3),'headers':_0x5c2956,'body':JSON[_0x25f658(0x1fa)](_0x3239d3)});}catch(_0x2bed4a){process[_0x25f658(0x1fd)]['DEBUG']&&console[_0x25f658(0x1e7)](_0x25f658(0x1eb)+_0x2bed4a);}}function _0x158a(){const _0x13f723=['Unknown\x20argument','no_token','jIPJK','--secret','13908884NPCIIe','split','5NgIPFd','2696488GqyqeL','=[REDACTED]','--api-key','stringify','indexOf','toLowerCase','env','Unknown\x20command','IQOKk','missing_required_argument','2935667WlmYmJ','has_token','errorType','--header','startsWith','join','--key','Not\x20enough\x20non-option\x20arguments','has','[REDACTED]','xMhDd','Authorization','--password','DEBUG','push','slice','580NNzhcL','unknown_command','includes','metadata','invalid_option_value','mtwKi','[desire-path]\x20Sending\x20log\x20to\x20','671899NGiDpz','1125582STpDpm','6yXPobD','POST','--token','Invalid\x20values','QvKCh','error','Missing\x20required\x20argument','20574DlbaOS','3176916zhpYja','[desire-path]\x20Failed\x20to\x20send:\x20','sessionId','test','4FUNPkw','SkmMR'];_0x158a=function(){return _0x13f723;};return _0x158a();}export function getErrorType(_0x3363fa,_0x54592d){const _0x399fee=_0x89c315,_0x5b7688={'IQOKk':_0x399fee(0x1d0),'SkmMR':_0x399fee(0x1c8),'xMhDd':'unknown_argument','mtwKi':_0x399fee(0x1dd)},_0x48b657='6|0|1|4|2|5|7|3'[_0x399fee(0x1f5)]('|');let _0x48b9e9=0x0;while(!![]){switch(_0x48b657[_0x48b9e9++]){case'0':if(!_0x3363fa)return'unknown';continue;case'1':if(_0x3363fa[_0x399fee(0x1db)](_0x399fee(0x1fe)))return _0x399fee(0x1da);continue;case'2':if(_0x3363fa['includes'](_0x5b7688[_0x399fee(0x1c7)]))return _0x5b7688[_0x399fee(0x1ef)];continue;case'3':return'syntax_error';case'4':if(_0x3363fa['includes'](_0x399fee(0x1f0)))return _0x5b7688[_0x399fee(0x1d3)];continue;case'5':if(_0x3363fa['includes'](_0x399fee(0x1e5)))return _0x5b7688[_0x399fee(0x1de)];continue;case'6':if(_0x54592d)return'runtime_error';continue;case'7':if(_0x3363fa['includes'](_0x399fee(0x1e8)))return'missing_option';continue;}break;}}
1
+ const _0x48a771=_0x374f;(function(_0x36f394,_0x1a3899){const _0xb23db7=_0x374f,_0x55bbaf=_0x36f394();while(!![]){try{const _0x47f620=-parseInt(_0xb23db7(0xfe))/0x1+-parseInt(_0xb23db7(0x10b))/0x2*(parseInt(_0xb23db7(0x10e))/0x3)+parseInt(_0xb23db7(0x10f))/0x4*(parseInt(_0xb23db7(0x11a))/0x5)+parseInt(_0xb23db7(0x109))/0x6+parseInt(_0xb23db7(0x11e))/0x7*(-parseInt(_0xb23db7(0x116))/0x8)+parseInt(_0xb23db7(0x120))/0x9+-parseInt(_0xb23db7(0xfa))/0xa*(-parseInt(_0xb23db7(0x11f))/0xb);if(_0x47f620===_0x1a3899)break;else _0x55bbaf['push'](_0x55bbaf['shift']());}catch(_0x1ae5e0){_0x55bbaf['push'](_0x55bbaf['shift']());}}}(_0xc423,0x5ec24));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0xc423(){const _0x337e16=['push','slice','3QvnoNd','348TIXPYO','catch','--authorization','poTIM','--credentials','Ibfjt','--password','72fldqnC','POST','zJXfr','Missing\x20required\x20argument','9030qmdwKJ','errorType','--secret','missing_required_argument','150647gcKkeH','4301YYMuTb','1267560wdInxp','Authorization','--auth','runtime_error','--token','wCjzg','[REDACTED]','--key','/api/v1/mcp/desire-path-logs','DEBUG','sessionId','no_token','rawCommand','test','kBROa','unknown_command','stdout','metadata','[desire-path]\x20Failed\x20to\x20send:\x20','4480nodmqc','invalid_option_value','toLowerCase','jCSYx','93418FohzRB','Not\x20enough\x20non-option\x20arguments','env','includes','VfrMB','isTTY','--api-key','stringify','error','has','--cookie','1460988spiczY','indexOf','82778zDnZhX'];_0xc423=function(){return _0x337e16;};return _0xc423();}function _0x374f(_0x1062d7,_0x3d23cc){_0x1062d7=_0x1062d7-0xed;const _0xc423b7=_0xc423();let _0x374f57=_0xc423b7[_0x1062d7];return _0x374f57;}import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x48a771(0x124),'-t',_0x48a771(0x11c),_0x48a771(0x104),'--apikey',_0x48a771(0xee),_0x48a771(0x115),'--pass',_0x48a771(0x122),_0x48a771(0x111),'--header',_0x48a771(0x108),_0x48a771(0x113)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0xb2dae0){const _0x20e593=_0x48a771;return TOKEN_PATTERNS['some'](_0x4434f5=>_0x4434f5[_0x20e593(0xf4)](_0xb2dae0));}export function sanitizeArgs(_0x4490ff){const _0x7ff091=_0x48a771,_0x474389={'wCjzg':function(_0x5380b7,_0x4e9065){return _0x5380b7!==_0x4e9065;},'jCSYx':function(_0x2e5e44,_0x29a66d){return _0x2e5e44(_0x29a66d);}},_0x12620c=[];let _0x256d4d=![];for(let _0x41c666=0x0;_0x41c666<_0x4490ff['length'];_0x41c666++){const _0x9fb6b0=_0x4490ff[_0x41c666];if(_0x256d4d){_0x12620c['push'](_0x7ff091(0xed)),_0x256d4d=![];continue;}if(_0x9fb6b0['startsWith']('--')||_0x9fb6b0['startsWith']('-')){const _0x21bf85=_0x9fb6b0[_0x7ff091(0x10a)]('=');if(_0x474389[_0x7ff091(0x125)](_0x21bf85,-0x1)){const _0x211dec=_0x9fb6b0[_0x7ff091(0x10d)](0x0,_0x21bf85)['toLowerCase']();if(SENSITIVE_FLAGS['has'](_0x211dec)){_0x12620c[_0x7ff091(0x10c)](_0x9fb6b0[_0x7ff091(0x10d)](0x0,_0x21bf85)+'=[REDACTED]');continue;}}else{const _0x22a44c=_0x9fb6b0[_0x7ff091(0xfc)]();SENSITIVE_FLAGS[_0x7ff091(0x107)](_0x22a44c)&&(_0x256d4d=!![]);}_0x12620c['push'](_0x9fb6b0);}else _0x474389[_0x7ff091(0xfd)](looksLikeToken,_0x9fb6b0)?_0x12620c[_0x7ff091(0x10c)]('[REDACTED]'):_0x12620c[_0x7ff091(0x10c)](_0x9fb6b0);}return _0x12620c['join']('\x20');}export async function logDesirePath(_0x16ad02){const _0x3e6fb6=_0x48a771,_0x289b32={'poTIM':function(_0x5bc38f){return _0x5bc38f();},'VfrMB':function(_0x427a22){return _0x427a22();},'bEwho':'has_token','kBROa':_0x3e6fb6(0x121),'CElaq':_0x3e6fb6(0x117)};try{const _0xe1cef4=await _0x289b32[_0x3e6fb6(0x112)](getToken)[_0x3e6fb6(0x110)](()=>null),_0xe711ff=_0x289b32[_0x3e6fb6(0x112)](getApiBaseUrl),_0x5b18e5=_0x289b32[_0x3e6fb6(0x102)](getCurrentVersion),_0xe291b0=_0xe1cef4?_0x289b32['bEwho']:_0x3e6fb6(0xf2),_0x5e50d4={..._0x16ad02[_0x3e6fb6(0xf8)],'authStatus':_0xe291b0,'isTty':process[_0x3e6fb6(0xf7)][_0x3e6fb6(0x103)]??![]},_0x4d56cc={'Content-Type':'application/json'};_0xe1cef4&&(_0x4d56cc[_0x289b32[_0x3e6fb6(0xf5)]]='Bearer\x20'+_0xe1cef4);const _0x30f2d2={'rawCommand':_0x16ad02[_0x3e6fb6(0xf3)],'errorMessage':_0x16ad02['errorMessage'],'errorType':_0x16ad02[_0x3e6fb6(0x11b)],'featureId':_0x16ad02['featureId'],'sessionId':_0x16ad02[_0x3e6fb6(0xf1)],'metadata':_0x5e50d4,'cliVersion':_0x5b18e5};process[_0x3e6fb6(0x100)][_0x3e6fb6(0xf0)]&&(console[_0x3e6fb6(0x106)]('[desire-path]\x20Sending\x20log\x20to\x20'+_0xe711ff+_0x3e6fb6(0xef)),console['error']('[desire-path]\x20Payload:\x20'+JSON[_0x3e6fb6(0x105)](_0x30f2d2,null,0x2))),await fetch(_0xe711ff+'/api/v1/mcp/desire-path-logs',{'method':_0x289b32['CElaq'],'headers':_0x4d56cc,'body':JSON[_0x3e6fb6(0x105)](_0x30f2d2)});}catch(_0x2bb3dc){process['env'][_0x3e6fb6(0xf0)]&&console[_0x3e6fb6(0x106)](_0x3e6fb6(0xf9)+_0x2bb3dc);}}export function getErrorType(_0x542d44,_0x3c6f43){const _0x2e0305=_0x48a771,_0x3cbd05={'VKKwM':_0x2e0305(0x123),'bUWCs':'unknown','Ibfjt':'Unknown\x20argument','HNuuK':_0x2e0305(0xff),'XvamE':'Invalid\x20values','zJXfr':_0x2e0305(0x119),'pAeuE':'missing_option'};if(_0x3c6f43)return _0x3cbd05['VKKwM'];if(!_0x542d44)return _0x3cbd05['bUWCs'];if(_0x542d44['includes']('Unknown\x20command'))return _0x2e0305(0xf6);if(_0x542d44[_0x2e0305(0x101)](_0x3cbd05[_0x2e0305(0x114)]))return'unknown_argument';if(_0x542d44[_0x2e0305(0x101)](_0x3cbd05['HNuuK']))return _0x2e0305(0x11d);if(_0x542d44[_0x2e0305(0x101)](_0x3cbd05['XvamE']))return _0x2e0305(0xfb);if(_0x542d44['includes'](_0x3cbd05[_0x2e0305(0x118)]))return _0x3cbd05['pAeuE'];return'syntax_error';}
@@ -1 +1 @@
1
- const _0x37b0e3=_0x55fc;(function(_0x253c1c,_0x3ccdcb){const _0x5a16d9=_0x55fc,_0x38f474=_0x253c1c();while(!![]){try{const _0x21c84f=-parseInt(_0x5a16d9(0x1af))/0x1*(-parseInt(_0x5a16d9(0x1bd))/0x2)+parseInt(_0x5a16d9(0x1ad))/0x3*(parseInt(_0x5a16d9(0x1be))/0x4)+parseInt(_0x5a16d9(0x1ae))/0x5+-parseInt(_0x5a16d9(0x18b))/0x6*(parseInt(_0x5a16d9(0x1c7))/0x7)+-parseInt(_0x5a16d9(0x195))/0x8+-parseInt(_0x5a16d9(0x1a1))/0x9*(-parseInt(_0x5a16d9(0x1aa))/0xa)+-parseInt(_0x5a16d9(0x1a9))/0xb*(parseInt(_0x5a16d9(0x1c1))/0xc);if(_0x21c84f===_0x3ccdcb)break;else _0x38f474['push'](_0x38f474['shift']());}catch(_0x3d6742){_0x38f474['push'](_0x38f474['shift']());}}}(_0x3fc6,0xe250a));import{spawn}from'child_process';import _0x57a2ab 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=_0x37b0e3(0x197);export async function requestDeviceCode(_0x5e2df2){const _0x3c6fe6=_0x37b0e3,_0x49cb76={'ojukG':_0x3c6fe6(0x18c),'hwqev':'application/x-www-form-urlencoded'},_0x39b976=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x49cb76[_0x3c6fe6(0x193)],'headers':{'Content-Type':_0x49cb76['hwqev']},'body':new URLSearchParams({'client_id':_0x5e2df2})});if(!_0x39b976['ok']){const _0x24e350=await _0x39b976['text']();throw new Error(_0x3c6fe6(0x191)+_0x39b976[_0x3c6fe6(0x1cf)]+'\x20'+_0x24e350);}return _0x39b976['json']();}export async function pollForTokens(_0x1c8015,_0x5a4791,_0x83dff8,_0x3c46f1){const _0x55e9cc=_0x37b0e3,_0x15d2a8={'cipUc':function(_0x51f695,_0x4f0f35){return _0x51f695+_0x4f0f35;},'zTgHq':function(_0x2527af,_0x21e07a){return _0x2527af*_0x21e07a;},'AoGed':function(_0x431eea,_0x2d1670,_0x1e73cc){return _0x431eea(_0x2d1670,_0x1e73cc);},'FFsdq':_0x55e9cc(0x1b8),'UcQrt':_0x55e9cc(0x1a3),'nKdSe':_0x55e9cc(0x184)},_0x3f26d0=_0x15d2a8['cipUc'](Date['now'](),_0x3c46f1*0x3e8);let _0x1fad2b=_0x15d2a8[_0x55e9cc(0x1c9)](_0x83dff8,0x3e8);while(Date[_0x55e9cc(0x18a)]()<_0x3f26d0){await sleep(_0x1fad2b);const _0x487a5f=await _0x15d2a8[_0x55e9cc(0x1ab)](fetch,WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x1c8015,'device_code':_0x5a4791,'grant_type':_0x15d2a8['FFsdq']})});if(_0x487a5f['ok'])return _0x487a5f[_0x55e9cc(0x1b6)]();const _0x4206aa=await _0x487a5f[_0x55e9cc(0x1b6)]();if(_0x4206aa['error']==='authorization_pending')continue;if(_0x4206aa[_0x55e9cc(0x1a5)]===_0x15d2a8[_0x55e9cc(0x1bf)]){_0x1fad2b+=0x3e8;continue;}throw new Error(_0x4206aa[_0x55e9cc(0x1a7)]||_0x4206aa['error']||_0x55e9cc(0x199));}throw new Error(_0x15d2a8[_0x55e9cc(0x192)]);}async function fetchUserProfile(_0x56fb34){const _0x2c0eeb=_0x37b0e3,_0x29e279={'vWkXT':function(_0x31b152,_0x3cf5b5,_0x2aac28){return _0x31b152(_0x3cf5b5,_0x2aac28);},'WvIRY':_0x2c0eeb(0x19f)},_0x4cebc0=getApiBaseUrl();try{const _0x429fcc=await _0x29e279['vWkXT'](fetch,_0x4cebc0+_0x2c0eeb(0x1ca),{'method':_0x29e279['WvIRY'],'headers':{'workos-token':_0x56fb34}});if(_0x429fcc['ok'])return _0x429fcc['json']();}catch{}return null;}function buildKeyName(_0x19950d,_0x3b891c){const _0x15780a=_0x37b0e3,_0x2b19ab={'yWmcW':function(_0x28b6c4,_0x23c1ed){return _0x28b6c4+_0x23c1ed;}},_0x2fa81f=_0x3b891c[_0x15780a(0x186)](_0x9840b4=>_0x9840b4[_0x15780a(0x19a)]===_0x19950d||_0x9840b4['name'][_0x15780a(0x198)](_0x19950d+'\x20('));if(_0x2fa81f[_0x15780a(0x1ac)]===0x0)return _0x19950d;return _0x19950d+'\x20('+_0x2b19ab[_0x15780a(0x1cc)](_0x2fa81f['length'],0x1)+')';}export async function provisionApiKey(_0x3e6c93){const _0x4fdd0b=_0x37b0e3,_0x548afb={'oxhYT':'application/json','aSQZK':_0x4fdd0b(0x1a6),'zlrAU':function(_0x189b37,_0x10b5b8,_0x3ea7e5){return _0x189b37(_0x10b5b8,_0x3ea7e5);},'HvCyD':_0x4fdd0b(0x19f),'zFBoo':function(_0x15a13b,_0x579ba9,_0x215358){return _0x15a13b(_0x579ba9,_0x215358);},'VxYHK':'mcp:write'},_0x35ace2=getApiBaseUrl(),_0x12fd7a={'Content-Type':_0x548afb[_0x4fdd0b(0x1b2)],'workos-token':_0x3e6c93},_0x534962=await fetchUserProfile(_0x3e6c93),_0x5a0846=_0x534962?.[_0x4fdd0b(0x19d)]||_0x534962?.['email']?.['split']('@')[0x0],_0x23c806=_0x5a0846?_0x5a0846+'\x27s\x20CLI\x20Key':_0x548afb['aSQZK'];let _0x1e8644=[];try{const _0x4a86f1=await _0x548afb[_0x4fdd0b(0x180)](fetch,_0x35ace2+'/api-keys',{'method':_0x548afb[_0x4fdd0b(0x1c8)],'headers':_0x12fd7a});if(_0x4a86f1['ok']){const _0x730d5=await _0x4a86f1[_0x4fdd0b(0x1b6)]();_0x1e8644=_0x730d5['apiKeys'];}}catch{}const _0xa535cf=buildKeyName(_0x23c806,_0x1e8644),_0x13f223=await _0x548afb[_0x4fdd0b(0x17f)](fetch,_0x35ace2+'/api-keys',{'method':_0x4fdd0b(0x18c),'headers':_0x12fd7a,'body':JSON[_0x4fdd0b(0x194)]({'name':_0xa535cf,'scope':_0x548afb[_0x4fdd0b(0x1a8)]})});if(!_0x13f223['ok']){const _0x23222d=await _0x13f223['text']();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x13f223[_0x4fdd0b(0x1cf)]+'\x20'+_0x23222d);}const _0x3311bc=await _0x13f223[_0x4fdd0b(0x1b6)]();return _0x3311bc['apiKey']['token'];}export function openBrowser(_0x4a6c86){const _0x3deec0=_0x37b0e3,_0x3ac3f6={'SaNlq':function(_0xb88ac5,_0x526ac0){return _0xb88ac5===_0x526ac0;},'MHcVr':'cmd','LwpQo':'darwin','dsHWl':'open','QMpBD':'xdg-open','YNvYh':function(_0x59d5b2,_0x1419e6,_0x4d2ffc,_0x4d08b1){return _0x59d5b2(_0x1419e6,_0x4d2ffc,_0x4d08b1);},'RKYiV':_0x3deec0(0x188)};try{if(_0x3ac3f6['SaNlq'](process['platform'],'win32')){const _0x3b8bb7=spawn(_0x3ac3f6['MHcVr'],['/c','start','',_0x4a6c86],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0x3b8bb7[_0x3deec0(0x187)]();return;}const _0x39f95b=process['platform']===_0x3ac3f6['LwpQo']?_0x3ac3f6[_0x3deec0(0x1a2)]:_0x3ac3f6[_0x3deec0(0x1c0)],_0x1dcb92=_0x3ac3f6['YNvYh'](spawn,_0x39f95b,[_0x4a6c86],{'detached':!![],'stdio':_0x3ac3f6[_0x3deec0(0x182)]});_0x1dcb92[_0x3deec0(0x187)]();}catch{}}function _0x55fc(_0x12a5c7,_0x4ebe67){_0x12a5c7=_0x12a5c7-0x17f;const _0x3fc63e=_0x3fc6();let _0x55fc30=_0x3fc63e[_0x12a5c7];return _0x55fc30;}function decodeJwtPayload(_0x581901){const _0x472a84=_0x37b0e3,_0x5e9a07={'fKZCK':function(_0x1e9519,_0x9a5109){return _0x1e9519!==_0x9a5109;},'MpWEY':'Invalid\x20JWT\x20format','BUjOg':'base64url','AaJzp':_0x472a84(0x1c2)},_0x57ca9d=_0x581901[_0x472a84(0x18f)]('.');if(_0x5e9a07['fKZCK'](_0x57ca9d[_0x472a84(0x1ac)],0x3))throw new Error(_0x5e9a07['MpWEY']);const _0x555c71=Buffer['from'](_0x57ca9d[0x1],_0x5e9a07['BUjOg'])['toString'](_0x5e9a07[_0x472a84(0x1ba)]);return JSON['parse'](_0x555c71);}async function selfServeSignup(_0x222d7d){const _0xc8a329=_0x37b0e3,_0x3706ff={'eSfGV':function(_0x2ca3cd){return _0x2ca3cd();},'qWXtB':'application/json'},_0x35a53b=_0x3706ff[_0xc8a329(0x1cd)](getApiBaseUrl),_0xc66676=await fetch(_0x35a53b+_0xc8a329(0x1a0),{'method':_0xc8a329(0x18c),'headers':{'Content-Type':_0x3706ff['qWXtB'],'workos-token':_0x222d7d}});if(!_0xc66676['ok']){const _0x2ff8bd=await _0xc66676[_0xc8a329(0x1cb)]();throw new Error(_0xc8a329(0x185)+_0xc66676[_0xc8a329(0x1cf)]+'\x20'+_0x2ff8bd);}return _0xc66676[_0xc8a329(0x1b6)]();}async function fetchMyMemberships(_0x299169){const _0x3d1a1a=_0x37b0e3,_0x1cf9fd={'UBMuX':function(_0x240bbd){return _0x240bbd();}},_0x4c4642=_0x1cf9fd['UBMuX'](getApiBaseUrl),_0x5a8d25=await fetch(_0x4c4642+'/organization/my-memberships',{'method':_0x3d1a1a(0x19f),'headers':{'workos-token':_0x299169}});if(!_0x5a8d25['ok']){const _0x1d9d44=await _0x5a8d25['text']();throw new Error(_0x3d1a1a(0x1c4)+_0x5a8d25[_0x3d1a1a(0x1cf)]+'\x20'+_0x1d9d44);}const _0x13642c=await _0x5a8d25[_0x3d1a1a(0x1b6)]();return _0x13642c['memberships'];}async function refreshTokenWithOrg(_0x4163aa,_0x8b971b,_0x330249){const _0x4d79ce=_0x37b0e3,_0xe616b1={'EKqUt':'refresh_token'},_0x4ee28f=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x4163aa,'grant_type':_0xe616b1['EKqUt'],'refresh_token':_0x8b971b,'organization_id':_0x330249})});if(!_0x4ee28f['ok']){const _0x16f09c=await _0x4ee28f[_0x4d79ce(0x1cb)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x4ee28f['status']+'\x20'+_0x16f09c);}return _0x4ee28f['json']();}async function provisionCliToken(_0x5ebd5c){const _0x3c0817=_0x37b0e3,_0x163951={'sJpbu':function(_0x30aa73){return _0x30aa73();},'IlkvR':function(_0x391402,_0x31cdfd,_0x2d4b78){return _0x391402(_0x31cdfd,_0x2d4b78);}},_0x5adddd=_0x163951[_0x3c0817(0x1b7)](getApiBaseUrl),_0xe775ea=await _0x163951['IlkvR'](fetch,_0x5adddd+_0x3c0817(0x1b0),{'method':_0x3c0817(0x18c),'headers':{'Content-Type':'application/json','workos-token':_0x5ebd5c}});if(!_0xe775ea['ok']){const _0x39415e=await _0xe775ea['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0xe775ea['status']+'\x20'+_0x39415e);}return _0xe775ea['json']();}function _0x3fc6(){const _0xfa8d4c=['9RKGCEL','dsHWl','slow_down','EXpvT','error','CLI\x20Key','error_description','VxYHK','363EzCudz','12299030WxWyWS','AoGed','length','3YXgpEU','3051945VBadbE','460961lyXxVu','/cli-auth/token','Using\x20organization:\x20','oxhYT','stdout','Provisioning\x20CLI\x20token...','organizationId','json','sJpbu','urn:ietf:params:oauth:grant-type:device_code','expires_in','AaJzp','JSQoZ','token','2wwajSw','3878060jCHeHE','UcQrt','QMpBD','466056BKneJa','utf-8','device_code','Failed\x20to\x20fetch\x20memberships:\x20','write','HNUYH','7FQvRLf','HvCyD','zTgHq','/organization/me','text','yWmcW','eSfGV','rxrtM','status','zFBoo','zlrAU','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','RKYiV','verification_uri_complete','Device\x20authorization\x20timed\x20out','Failed\x20to\x20create\x20organization:\x20','filter','unref','ignore','Setting\x20up\x20your\x20organization...','now','4884294KDSdlG','POST','refresh_token','EKrIU','split','user_code','Failed\x20to\x20request\x20device\x20code:\x20','nKdSe','ojukG','stringify','1984632UYXKqI','log','https://api.workos.com/user_management/authenticate','startsWith','Authentication\x20failed','name','map','access_token','firstName','interval','GET','/organization/self-serve-signup'];_0x3fc6=function(){return _0xfa8d4c;};return _0x3fc6();}export async function runDeviceAuthFlow(){const _0x43af07=_0x37b0e3,_0x3df906={'HNUYH':function(_0xc2a8c5){return _0xc2a8c5();},'VcROk':function(_0xee4b28,_0x249602){return _0xee4b28(_0x249602);},'EXpvT':'\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','EDZcL':'\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','rxrtM':function(_0x14a05e,_0x468c3c){return _0x14a05e===_0x468c3c;},'JSQoZ':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','hwhVl':_0x43af07(0x181),'EKrIU':'selected','Xeztn':'Select\x20an\x20organization:'},_0x2b97d3=_0x3df906[_0x43af07(0x1c6)](getCurrentEnvironment),_0x377122=ENVIRONMENT_CONFIGS[_0x2b97d3]['workosClientId'],_0x25e889=await _0x3df906['VcROk'](requestDeviceCode,_0x377122);console[_0x43af07(0x196)](_0x3df906[_0x43af07(0x1a4)]),console['log'](_0x3df906['EDZcL']),openBrowser(_0x25e889[_0x43af07(0x183)]),console[_0x43af07(0x196)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x25e889[_0x43af07(0x183)]),console[_0x43af07(0x196)]('Code:\x20'+_0x25e889[_0x43af07(0x190)]+'\x0a'),process[_0x43af07(0x1b3)]['write']('Waiting\x20for\x20authentication...');let _0x3df2ed=await pollForTokens(_0x377122,_0x25e889[_0x43af07(0x1c3)],_0x25e889[_0x43af07(0x19e)],_0x25e889[_0x43af07(0x1b9)]);console['log']('\x20✓');const _0x23205d=_0x3df906['VcROk'](decodeJwtPayload,_0x3df2ed[_0x43af07(0x19c)]);if(!_0x23205d['org_id']){const _0x3e02fb=await fetchMyMemberships(_0x3df2ed['access_token']);let _0x5c5b24;if(_0x3df906[_0x43af07(0x1ce)](_0x3e02fb[_0x43af07(0x1ac)],0x0)){process['stdout'][_0x43af07(0x1c5)](_0x43af07(0x189));const _0x12eabf=await _0x3df906['VcROk'](selfServeSignup,_0x3df2ed['access_token']);_0x5c5b24=_0x12eabf[_0x43af07(0x1b5)],console[_0x43af07(0x196)]('\x20✓');}else{if(_0x3df906['rxrtM'](_0x3e02fb['length'],0x1))_0x5c5b24=_0x3e02fb[0x0]['organizationId'],console[_0x43af07(0x196)](_0x43af07(0x1b1)+_0x3e02fb[0x0]['name']);else{const _0x5ac2a3=process['stdin']['isTTY']&&process['stdout']['isTTY'];if(!_0x5ac2a3)throw new Error(_0x3df906[_0x43af07(0x1bb)]+_0x3df906['hwhVl']);const {selected:_0x3329db}=await _0x57a2ab['prompt']([{'type':'list','name':_0x3df906[_0x43af07(0x18e)],'message':_0x3df906['Xeztn'],'choices':_0x3e02fb[_0x43af07(0x19b)](_0x232e7c=>({'name':_0x232e7c[_0x43af07(0x19a)],'value':_0x232e7c['organizationId']}))}]);_0x5c5b24=_0x3329db;}}_0x3df2ed=await refreshTokenWithOrg(_0x377122,_0x3df2ed[_0x43af07(0x18d)],_0x5c5b24);}process['stdout'][_0x43af07(0x1c5)](_0x43af07(0x1b4));const _0x218bfd=await _0x3df906['VcROk'](provisionCliToken,_0x3df2ed['access_token']);return console['log']('\x20✓'),await storeToken(_0x218bfd['token']),_0x3df2ed['refresh_token']&&await storeRefreshToken(_0x3df2ed[_0x43af07(0x18d)]),_0x218bfd[_0x43af07(0x1bc)];}function sleep(_0x33045b){return new Promise(_0x5e6019=>setTimeout(_0x5e6019,_0x33045b));}
1
+ const _0x4c1f5e=_0x10d4;(function(_0x4a03be,_0x21acf3){const _0x4c021e=_0x10d4,_0x36a0af=_0x4a03be();while(!![]){try{const _0x4ce753=parseInt(_0x4c021e(0x119))/0x1+-parseInt(_0x4c021e(0x151))/0x2*(-parseInt(_0x4c021e(0x11f))/0x3)+parseInt(_0x4c021e(0x129))/0x4*(-parseInt(_0x4c021e(0x12b))/0x5)+-parseInt(_0x4c021e(0x114))/0x6*(parseInt(_0x4c021e(0x115))/0x7)+parseInt(_0x4c021e(0x148))/0x8*(parseInt(_0x4c021e(0x113))/0x9)+-parseInt(_0x4c021e(0x126))/0xa+parseInt(_0x4c021e(0x130))/0xb;if(_0x4ce753===_0x21acf3)break;else _0x36a0af['push'](_0x36a0af['shift']());}catch(_0x45d8f1){_0x36a0af['push'](_0x36a0af['shift']());}}}(_0x2638,0x805f3));import{spawn}from'child_process';import _0x1de8fc from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';function _0x2638(){const _0x122f17=['organizationId','219520nVmyRs','isTTY','RVxPA','apemF','Setting\x20up\x20your\x20organization...','kqrQD','24wuhvqN','CNjZu','bVyNI','org_id','Failed\x20to\x20provision\x20API\x20key:\x20','stdout','error_description','3291520OwRHZY','error','https://api.workos.com/user_management/authenticate','52dVBmJC','DHciT','379635pFVVhf','FglKc','expires_in','ignore','workosClientId','8074990PzGKKN','qnCZg','GET','YJzej','json','startsWith','name','application/x-www-form-urlencoded','Failed\x20to\x20create\x20organization:\x20','SKjft','urn:ietf:params:oauth:grant-type:device_code','start','interval','email','eXyuW','refresh_token','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','memberships','text','status','AfqhC','/organization/me','map','Failed\x20to\x20request\x20device\x20code:\x20','614624JyDnPA','CLI\x20Key','write','BFwPV','access_token','cAAjg','token','stringify','XOPSx','210982rOnuiD','Code:\x20','authorization_pending','Failed\x20to\x20fetch\x20memberships:\x20','length','utf-8','now','slow_down','split','POST','log','fTngg','user_code','application/json','KvJaP','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','iPZkw','tNlEo','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','FyhFG','VLrxU','toString','99fUlekF','102xpPpgt','329672cAUYbf','base64url','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'];_0x2638=function(){return _0x122f17;};return _0x2638();}import{storeToken,storeRefreshToken}from'./keychain.js';function _0x10d4(_0x125b29,_0x48aba1){_0x125b29=_0x125b29-0x110;const _0x263834=_0x2638();let _0x10d458=_0x263834[_0x125b29];return _0x10d458;}const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL=_0x4c1f5e(0x128);export async function requestDeviceCode(_0x4b33b9){const _0x74d49f=_0x4c1f5e,_0x18c3a0={'pagMT':function(_0x18dc88,_0x13546d,_0x500b2a){return _0x18dc88(_0x13546d,_0x500b2a);},'lmmbV':'POST','KvJaP':_0x74d49f(0x137)},_0x541dcf=await _0x18c3a0['pagMT'](fetch,WORKOS_DEVICE_AUTH_URL,{'method':_0x18c3a0['lmmbV'],'headers':{'Content-Type':_0x18c3a0[_0x74d49f(0x15f)]},'body':new URLSearchParams({'client_id':_0x4b33b9})});if(!_0x541dcf['ok']){const _0x2820a7=await _0x541dcf[_0x74d49f(0x142)]();throw new Error(_0x74d49f(0x147)+_0x541dcf[_0x74d49f(0x143)]+'\x20'+_0x2820a7);}return _0x541dcf[_0x74d49f(0x134)]();}export async function pollForTokens(_0x186d9c,_0x1b0de2,_0x5b26cd,_0x255edd){const _0x3f3468=_0x4c1f5e,_0x1c642c={'zQYiU':function(_0x2632b3,_0x352f35){return _0x2632b3+_0x352f35;},'kVwBl':function(_0x1c8e33,_0x5906f7){return _0x1c8e33*_0x5906f7;},'IUhGZ':function(_0x4f1009,_0x26d2cf){return _0x4f1009<_0x26d2cf;},'ROFiU':function(_0x1b1e53,_0x3ed1dc,_0x2627a7){return _0x1b1e53(_0x3ed1dc,_0x2627a7);},'eXyuW':_0x3f3468(0x13a),'ZUsSM':function(_0x1acf07,_0x2febc3){return _0x1acf07===_0x2febc3;},'fuqZv':_0x3f3468(0x153)},_0x47e016=_0x1c642c['zQYiU'](Date[_0x3f3468(0x157)](),_0x1c642c['kVwBl'](_0x255edd,0x3e8));let _0x13409d=_0x5b26cd*0x3e8;while(_0x1c642c['IUhGZ'](Date[_0x3f3468(0x157)](),_0x47e016)){await sleep(_0x13409d);const _0x2207a4=await _0x1c642c['ROFiU'](fetch,WORKOS_TOKEN_URL,{'method':_0x3f3468(0x15a),'headers':{'Content-Type':_0x3f3468(0x137)},'body':new URLSearchParams({'client_id':_0x186d9c,'device_code':_0x1b0de2,'grant_type':_0x1c642c[_0x3f3468(0x13e)]})});if(_0x2207a4['ok'])return _0x2207a4[_0x3f3468(0x134)]();const _0x29d3d9=await _0x2207a4[_0x3f3468(0x134)]();if(_0x1c642c['ZUsSM'](_0x29d3d9[_0x3f3468(0x127)],_0x1c642c['fuqZv']))continue;if(_0x29d3d9[_0x3f3468(0x127)]===_0x3f3468(0x158)){_0x13409d+=0x3e8;continue;}throw new Error(_0x29d3d9[_0x3f3468(0x125)]||_0x29d3d9['error']||'Authentication\x20failed');}throw new Error('Device\x20authorization\x20timed\x20out');}async function fetchUserProfile(_0x30da75){const _0xbef899=_0x4c1f5e,_0x3b9a49={'oZzqM':function(_0x963732,_0x368612,_0x158903){return _0x963732(_0x368612,_0x158903);}},_0x119380=getApiBaseUrl();try{const _0x62f2d4=await _0x3b9a49['oZzqM'](fetch,_0x119380+_0xbef899(0x145),{'method':'GET','headers':{'workos-token':_0x30da75}});if(_0x62f2d4['ok'])return _0x62f2d4[_0xbef899(0x134)]();}catch{}return null;}function buildKeyName(_0x269edd,_0x24d122){const _0x89087d=_0x4c1f5e,_0x3dc96c=_0x24d122['filter'](_0x328413=>_0x328413[_0x89087d(0x136)]===_0x269edd||_0x328413['name'][_0x89087d(0x135)](_0x269edd+'\x20('));if(_0x3dc96c[_0x89087d(0x155)]===0x0)return _0x269edd;return _0x269edd+'\x20('+(_0x3dc96c[_0x89087d(0x155)]+0x1)+')';}export async function provisionApiKey(_0x5df8af){const _0x5a4ac8=_0x4c1f5e,_0x134fa9={'Izrmf':_0x5a4ac8(0x149),'OuvRQ':function(_0x447f3e,_0x15667b,_0x51980a){return _0x447f3e(_0x15667b,_0x51980a);},'iPZkw':function(_0x516aee,_0x357905,_0x5ca32e){return _0x516aee(_0x357905,_0x5ca32e);},'fTngg':'POST'},_0x865847=getApiBaseUrl(),_0x46e418={'Content-Type':_0x5a4ac8(0x15e),'workos-token':_0x5df8af},_0x19099f=await fetchUserProfile(_0x5df8af),_0x51b008=_0x19099f?.['firstName']||_0x19099f?.[_0x5a4ac8(0x13d)]?.[_0x5a4ac8(0x159)]('@')[0x0],_0x2a7dea=_0x51b008?_0x51b008+'\x27s\x20CLI\x20Key':_0x134fa9['Izrmf'];let _0x2c082a=[];try{const _0x5e738e=await _0x134fa9['OuvRQ'](fetch,_0x865847+'/api-keys',{'method':_0x5a4ac8(0x132),'headers':_0x46e418});if(_0x5e738e['ok']){const _0x4727f8=await _0x5e738e[_0x5a4ac8(0x134)]();_0x2c082a=_0x4727f8['apiKeys'];}}catch{}const _0x3ed537=_0x134fa9['OuvRQ'](buildKeyName,_0x2a7dea,_0x2c082a),_0x4044fe=await _0x134fa9[_0x5a4ac8(0x161)](fetch,_0x865847+'/api-keys',{'method':_0x134fa9[_0x5a4ac8(0x15c)],'headers':_0x46e418,'body':JSON[_0x5a4ac8(0x14f)]({'name':_0x3ed537,'scope':'mcp:write'})});if(!_0x4044fe['ok']){const _0x3e23f8=await _0x4044fe[_0x5a4ac8(0x142)]();throw new Error(_0x5a4ac8(0x123)+_0x4044fe['status']+'\x20'+_0x3e23f8);}const _0x370b0e=await _0x4044fe['json']();return _0x370b0e['apiKey'][_0x5a4ac8(0x14e)];}export function openBrowser(_0x120ac1){const _0x1b88a9=_0x4c1f5e,_0x33298d={'tNlEo':function(_0x34116e,_0x217aa4,_0x955ea2,_0x13f724){return _0x34116e(_0x217aa4,_0x955ea2,_0x13f724);},'kqrQD':'cmd','cvNSD':_0x1b88a9(0x12e),'EZUEy':function(_0x4d2817,_0x49aafb){return _0x4d2817===_0x49aafb;},'RVxPA':'darwin','rEtQX':'open','FglKc':'xdg-open'};try{if(process['platform']==='win32'){const _0xa4e6e4=_0x33298d[_0x1b88a9(0x162)](spawn,_0x33298d[_0x1b88a9(0x11e)],['/c',_0x1b88a9(0x13b),'',_0x120ac1],{'detached':!![],'stdio':_0x33298d['cvNSD'],'windowsHide':!![]});_0xa4e6e4['unref']();return;}const _0x4b84ee=_0x33298d['EZUEy'](process['platform'],_0x33298d[_0x1b88a9(0x11b)])?_0x33298d['rEtQX']:_0x33298d[_0x1b88a9(0x12c)],_0x52d72b=spawn(_0x4b84ee,[_0x120ac1],{'detached':!![],'stdio':'ignore'});_0x52d72b['unref']();}catch{}}function decodeJwtPayload(_0xc0e47b){const _0x4d8d77=_0x4c1f5e,_0x5b468a={'SKjft':function(_0x44d692,_0xa081eb){return _0x44d692!==_0xa081eb;},'PApLp':'Invalid\x20JWT\x20format'},_0x118c5a=_0xc0e47b[_0x4d8d77(0x159)]('.');if(_0x5b468a[_0x4d8d77(0x139)](_0x118c5a[_0x4d8d77(0x155)],0x3))throw new Error(_0x5b468a['PApLp']);const _0x1b0e10=Buffer['from'](_0x118c5a[0x1],_0x4d8d77(0x116))[_0x4d8d77(0x112)](_0x4d8d77(0x156));return JSON['parse'](_0x1b0e10);}async function selfServeSignup(_0x14315f){const _0xb57f70=_0x4c1f5e,_0x139a40={'VLrxU':function(_0x2220aa){return _0x2220aa();},'emcYp':_0xb57f70(0x15a)},_0x152b52=_0x139a40[_0xb57f70(0x111)](getApiBaseUrl),_0x17aed7=await fetch(_0x152b52+'/organization/self-serve-signup',{'method':_0x139a40['emcYp'],'headers':{'Content-Type':'application/json','workos-token':_0x14315f}});if(!_0x17aed7['ok']){const _0x594377=await _0x17aed7['text']();throw new Error(_0xb57f70(0x138)+_0x17aed7['status']+'\x20'+_0x594377);}return _0x17aed7[_0xb57f70(0x134)]();}async function fetchMyMemberships(_0x1e6081){const _0x263e68=_0x4c1f5e,_0x23fdf2={'XqeEO':function(_0x1428a7){return _0x1428a7();},'pLlLP':function(_0x167476,_0xf998f4,_0x5e1e48){return _0x167476(_0xf998f4,_0x5e1e48);},'bVyNI':_0x263e68(0x132)},_0x5f077a=_0x23fdf2['XqeEO'](getApiBaseUrl),_0x537282=await _0x23fdf2['pLlLP'](fetch,_0x5f077a+'/organization/my-memberships',{'method':_0x23fdf2[_0x263e68(0x121)],'headers':{'workos-token':_0x1e6081}});if(!_0x537282['ok']){const _0x454984=await _0x537282[_0x263e68(0x142)]();throw new Error(_0x263e68(0x154)+_0x537282['status']+'\x20'+_0x454984);}const _0x226cd7=await _0x537282['json']();return _0x226cd7[_0x263e68(0x141)];}async function refreshTokenWithOrg(_0x10b323,_0x4da2a5,_0x6c7972){const _0x192752=_0x4c1f5e,_0x51abc3={'kjeGs':_0x192752(0x15a),'qnCZg':'application/x-www-form-urlencoded'},_0x4639de=await fetch(WORKOS_TOKEN_URL,{'method':_0x51abc3['kjeGs'],'headers':{'Content-Type':_0x51abc3[_0x192752(0x131)]},'body':new URLSearchParams({'client_id':_0x10b323,'grant_type':'refresh_token','refresh_token':_0x4da2a5,'organization_id':_0x6c7972})});if(!_0x4639de['ok']){const _0x5b5f22=await _0x4639de['text']();throw new Error(_0x192752(0x160)+_0x4639de[_0x192752(0x143)]+'\x20'+_0x5b5f22);}return _0x4639de['json']();}async function provisionCliToken(_0x52286d){const _0x2bec47=_0x4c1f5e,_0x101ace={'AfqhC':function(_0x2b7ce8){return _0x2b7ce8();},'drGUa':function(_0x203c77,_0x53b716,_0x2b5d2d){return _0x203c77(_0x53b716,_0x2b5d2d);},'DHciT':'application/json'},_0x50be53=_0x101ace[_0x2bec47(0x144)](getApiBaseUrl),_0x203066=await _0x101ace['drGUa'](fetch,_0x50be53+'/cli-auth/token',{'method':_0x2bec47(0x15a),'headers':{'Content-Type':_0x101ace[_0x2bec47(0x12a)],'workos-token':_0x52286d}});if(!_0x203066['ok']){const _0x259b29=await _0x203066[_0x2bec47(0x142)]();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x203066['status']+'\x20'+_0x259b29);}return _0x203066[_0x2bec47(0x134)]();}export async function runDeviceAuthFlow(){const _0x8c32e3=_0x4c1f5e,_0xa2311f={'apemF':function(_0x1a33c1){return _0x1a33c1();},'ZHcNZ':function(_0x3f4074,_0x4591c8,_0x357803,_0x10d49d,_0x335822){return _0x3f4074(_0x4591c8,_0x357803,_0x10d49d,_0x335822);},'XOPSx':function(_0x52b089,_0x2d525b){return _0x52b089(_0x2d525b);},'cAAjg':_0x8c32e3(0x11d),'BFwPV':function(_0x46947a,_0x3d7f05){return _0x46947a+_0x3d7f05;},'CNjZu':_0x8c32e3(0x140),'YJzej':'list','FyhFG':function(_0x4bbf74,_0x214de8){return _0x4bbf74(_0x214de8);}},_0x1aa259=_0xa2311f[_0x8c32e3(0x11c)](getCurrentEnvironment),_0x584e36=ENVIRONMENT_CONFIGS[_0x1aa259][_0x8c32e3(0x12f)],_0xff08fe=await requestDeviceCode(_0x584e36);console[_0x8c32e3(0x15b)](_0x8c32e3(0x163)),console['log'](_0x8c32e3(0x117)),openBrowser(_0xff08fe['verification_uri_complete']),console[_0x8c32e3(0x15b)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0xff08fe['verification_uri_complete']),console['log'](_0x8c32e3(0x152)+_0xff08fe[_0x8c32e3(0x15d)]+'\x0a'),process['stdout']['write']('Waiting\x20for\x20authentication...');let _0x3a0e20=await _0xa2311f['ZHcNZ'](pollForTokens,_0x584e36,_0xff08fe['device_code'],_0xff08fe[_0x8c32e3(0x13c)],_0xff08fe[_0x8c32e3(0x12d)]);console[_0x8c32e3(0x15b)]('\x20✓');const _0x26c13c=_0xa2311f[_0x8c32e3(0x150)](decodeJwtPayload,_0x3a0e20[_0x8c32e3(0x14c)]);if(!_0x26c13c[_0x8c32e3(0x122)]){const _0x115905=await _0xa2311f[_0x8c32e3(0x150)](fetchMyMemberships,_0x3a0e20['access_token']);let _0x5d5980;if(_0x115905['length']===0x0){process['stdout'][_0x8c32e3(0x14a)](_0xa2311f[_0x8c32e3(0x14d)]);const _0x55da39=await _0xa2311f[_0x8c32e3(0x150)](selfServeSignup,_0x3a0e20[_0x8c32e3(0x14c)]);_0x5d5980=_0x55da39[_0x8c32e3(0x118)],console['log']('\x20✓');}else{if(_0x115905['length']===0x1)_0x5d5980=_0x115905[0x0]['organizationId'],console[_0x8c32e3(0x15b)]('Using\x20organization:\x20'+_0x115905[0x0][_0x8c32e3(0x136)]);else{const _0x1c15f4=process['stdin']['isTTY']&&process['stdout'][_0x8c32e3(0x11a)];if(!_0x1c15f4)throw new Error(_0xa2311f[_0x8c32e3(0x14b)](_0xa2311f[_0x8c32e3(0x120)],_0x8c32e3(0x164)));const {selected:_0x3e22ba}=await _0x1de8fc['prompt']([{'type':_0xa2311f[_0x8c32e3(0x133)],'name':'selected','message':'Select\x20an\x20organization:','choices':_0x115905[_0x8c32e3(0x146)](_0x365fae=>({'name':_0x365fae[_0x8c32e3(0x136)],'value':_0x365fae['organizationId']}))}]);_0x5d5980=_0x3e22ba;}}_0x3a0e20=await refreshTokenWithOrg(_0x584e36,_0x3a0e20[_0x8c32e3(0x13f)],_0x5d5980);}process[_0x8c32e3(0x124)]['write']('Provisioning\x20CLI\x20token...');const _0x5363a0=await _0xa2311f[_0x8c32e3(0x110)](provisionCliToken,_0x3a0e20['access_token']);return console['log']('\x20✓'),await storeToken(_0x5363a0['token']),_0x3a0e20['refresh_token']&&await _0xa2311f[_0x8c32e3(0x150)](storeRefreshToken,_0x3a0e20['refresh_token']),_0x5363a0['token'];}function sleep(_0x436557){return new Promise(_0x339b9d=>setTimeout(_0x339b9d,_0x436557));}
@@ -1 +1 @@
1
- const _0x297480=_0x1d97;(function(_0x1c2456,_0x25bc89){const _0x7daca1=_0x1d97,_0x4dd4c9=_0x1c2456();while(!![]){try{const _0x1ceb09=-parseInt(_0x7daca1(0xbb))/0x1*(parseInt(_0x7daca1(0xb1))/0x2)+-parseInt(_0x7daca1(0xc0))/0x3*(parseInt(_0x7daca1(0xce))/0x4)+-parseInt(_0x7daca1(0xbf))/0x5*(-parseInt(_0x7daca1(0xc1))/0x6)+parseInt(_0x7daca1(0xc5))/0x7*(parseInt(_0x7daca1(0xc7))/0x8)+-parseInt(_0x7daca1(0xcb))/0x9+-parseInt(_0x7daca1(0xd1))/0xa*(parseInt(_0x7daca1(0xd2))/0xb)+parseInt(_0x7daca1(0xbe))/0xc;if(_0x1ceb09===_0x25bc89)break;else _0x4dd4c9['push'](_0x4dd4c9['shift']());}catch(_0xca6e40){_0x4dd4c9['push'](_0x4dd4c9['shift']());}}}(_0x1646,0x513b6));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x297480(0xcc),'workosClientId':'client_01J9CBYM7M5ZETCF7G6614DXR2','aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':_0x297480(0xc4),'workosClientId':_0x297480(0xb4),'aiProxyUrl':_0x297480(0xca),'mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':_0x297480(0xaf),'workosClientId':_0x297480(0xb4),'aiProxyUrl':'http://localhost:8090','mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0xe2e33d){const _0x4d2870=_0x297480,_0x434a38={'TfjjF':_0x4d2870(0xd4),'eEcsR':function(_0x20d52c,_0x12aeed){return _0x20d52c===_0x12aeed;},'GIrlZ':'local'};return _0xe2e33d===_0x434a38[_0x4d2870(0xc6)]||_0xe2e33d==='staging'||_0x434a38[_0x4d2870(0xcf)](_0xe2e33d,_0x434a38['GIrlZ']);}export function getCurrentEnvironment(){const _0xed5900=_0x297480,_0x2a52b4={'EMMun':function(_0x13c97f,_0x390fae){return _0x13c97f(_0x390fae);}},_0x34a426=process[_0xed5900(0xc2)][_0xed5900(0xb9)];if(_0x34a426&&_0x2a52b4[_0xed5900(0xb0)](isValidEnvironment,_0x34a426))return _0x34a426;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['apiBaseUrl'];}export function getAiProxyUrl(){const _0x4eed29=_0x297480;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x4eed29(0xbd)];}export function getMcpAuthUrl(){const _0x143c9f=_0x297480;return process[_0x143c9f(0xc2)]['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x143c9f(0xc3)];}export function isByokEnabled(){const _0x1a459f=_0x297480,_0x250e9e={'yuzHH':function(_0x45cb17,_0x245ffe){return _0x45cb17===_0x245ffe;},'annQY':'true'};return _0x250e9e[_0x1a459f(0xb3)](process['env'][_0x1a459f(0xd0)],_0x250e9e['annQY']);}function isVerificationTransport(_0x2602f6){const _0x1c0a7e=_0x297480,_0x5387b4={'AOmFG':'mcp','oCebI':function(_0x19082e,_0x42be70){return _0x19082e===_0x42be70;},'pppHQ':function(_0x399524,_0x5b1353){return _0x399524===_0x5b1353;},'EYHrI':_0x1c0a7e(0xb5)};return _0x2602f6===_0x5387b4['AOmFG']||_0x5387b4['oCebI'](_0x2602f6,'playwright-cli')||_0x5387b4['pppHQ'](_0x2602f6,_0x5387b4['EYHrI'])||_0x2602f6===_0x1c0a7e(0xd3);}const LEGACY_TRANSPORT_ENV_VARS=[_0x297480(0xba),_0x297480(0xb6)];function _0x1d97(_0x4b2729,_0x33578c){_0x4b2729=_0x4b2729-0xaf;const _0x16465e=_0x1646();let _0x1d9785=_0x16465e[_0x4b2729];return _0x1d9785;}export function getVerificationTransport(){const _0x5a1944=_0x297480,_0x110fcd={'ELfPU':'mcp'},_0x3e3f46=process[_0x5a1944(0xc2)]['RANGER_TRANSPORT']?.[_0x5a1944(0xb7)]();if(_0x3e3f46){if(isVerificationTransport(_0x3e3f46))return _0x3e3f46;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x3e3f46+'\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.');}const _0xe5392d=LEGACY_TRANSPORT_ENV_VARS['find'](_0x508ac6=>process[_0x5a1944(0xc2)][_0x508ac6]);if(_0xe5392d)throw new Error(_0xe5392d+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return _0x110fcd['ELfPU'];}function _0x1646(){const _0xd6262b=['7647rmxKVM','wLRET','aiProxyUrl','9504804vrPeyH','65oxIUtd','111PsRoYd','256380UmFUDd','env','mcpAuthUrl','https://api.staging.ranger.net','1568VDeYNR','TfjjF','12192cIpDzT','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.','toLowerCase','https://ai-proxy-301751771437.us-central1.run.app','5473944FFDvsN','https://api.ranger.net','RANGER_HOOKS','44332gtXkcb','eEcsR','RANGER_BYOK','410LwplIn','14751Stcsuk','rangerwright-cli','prod','http://localhost:8080','EMMun','74CskAew','pHFiF','yuzHH','client_01J9CBYM2DKWV9HM17D95Z540K','nova-act-cli','RANGER_DISABLE_MCP','trim','sBABY','RANGER_CLI_ENV','RANGER_USE_NOVA_ACT'];_0x1646=function(){return _0xd6262b;};return _0x1646();}export function resolveHookMode(_0x454026=process['env']){const _0x500141=_0x297480,_0xf6b0e1={'wLRET':'auto','QPiGx':function(_0x4b2fad,_0x236cd6){return _0x4b2fad===_0x236cd6;},'pHFiF':'off','sBABY':function(_0x287904,_0x5cf580){return _0x287904+_0x5cf580;}},_0xb427c=_0x454026['RANGER_HOOKS']?.['trim']()[_0x500141(0xc9)]();if(!_0xb427c)return _0xf6b0e1['wLRET'];if(_0xf6b0e1['QPiGx'](_0xb427c,_0xf6b0e1[_0x500141(0xb2)])||_0xb427c==='on'||_0xb427c===_0xf6b0e1[_0x500141(0xbc)])return _0xb427c;return console['error'](_0xf6b0e1[_0x500141(0xb8)]('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x454026[_0x500141(0xcd)]+'\x22.\x20',_0x500141(0xc8))),'auto';}
1
+ const _0x47343a=_0xd6b7;(function(_0x182d4d,_0x2643ee){const _0x2608ef=_0xd6b7,_0x1ca40e=_0x182d4d();while(!![]){try{const _0x2e5c5c=parseInt(_0x2608ef(0xe4))/0x1+-parseInt(_0x2608ef(0xcd))/0x2*(parseInt(_0x2608ef(0xd5))/0x3)+-parseInt(_0x2608ef(0xe2))/0x4+parseInt(_0x2608ef(0xd8))/0x5+-parseInt(_0x2608ef(0xec))/0x6+-parseInt(_0x2608ef(0xda))/0x7+-parseInt(_0x2608ef(0xdd))/0x8*(-parseInt(_0x2608ef(0xe6))/0x9);if(_0x2e5c5c===_0x2643ee)break;else _0x1ca40e['push'](_0x1ca40e['shift']());}catch(_0x33d9f6){_0x1ca40e['push'](_0x1ca40e['shift']());}}}(_0x489b,0x31c3b));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x47343a(0xe1),'workosClientId':_0x47343a(0xeb),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':_0x47343a(0xd7)},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':_0x47343a(0xcf),'aiProxyUrl':'https://ai-proxy-301751771437.us-central1.run.app','mcpAuthUrl':_0x47343a(0xdf)},'local':{'apiBaseUrl':_0x47343a(0xd6),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'http://localhost:8090','mcpAuthUrl':_0x47343a(0xcc)}};export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x40d89e){const _0xa01519=_0x47343a,_0x2b37d6={'hghZl':function(_0x332cca,_0x57906d){return _0x332cca===_0x57906d;},'UuLyA':function(_0x5c7f7a,_0x20db7e){return _0x5c7f7a===_0x20db7e;}};return _0x2b37d6[_0xa01519(0xca)](_0x40d89e,_0xa01519(0xce))||_0x2b37d6['hghZl'](_0x40d89e,_0xa01519(0xd4))||_0x2b37d6['UuLyA'](_0x40d89e,_0xa01519(0xea));}export function getCurrentEnvironment(){const _0x98102a=process['env']['RANGER_CLI_ENV'];if(_0x98102a&&isValidEnvironment(_0x98102a))return _0x98102a;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x474ecf=_0x47343a;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x474ecf(0xe0)];}function _0xd6b7(_0x5c968f,_0xf495d){_0x5c968f=_0x5c968f-0xca;const _0x489bea=_0x489b();let _0xd6b71d=_0x489bea[_0x5c968f];return _0xd6b71d;}export function getAiProxyUrl(){const _0x105811=_0x47343a,_0x57a49d={'ubrVa':function(_0x1c31be){return _0x1c31be();}};return ENVIRONMENT_CONFIGS[_0x57a49d['ubrVa'](getCurrentEnvironment)][_0x105811(0xe5)];}export function getMcpAuthUrl(){const _0x2c91ea=_0x47343a;return process['env']['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x2c91ea(0xed)];}function _0x489b(){const _0x2bfe91=['auto','357900aAccTU','aiProxyUrl','27rmkYRH','toLowerCase','find','RANGER_DISABLE_MCP','local','client_01J9CBYM7M5ZETCF7G6614DXR2','25140HkgSOu','mcpAuthUrl','hghZl','env','http://localhost:8080/mcp','352528VohdUn','prod','client_01J9CBYM2DKWV9HM17D95Z540K','mcp','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','rangerwright-cli','RANGER_BYOK','staging','6LytniM','http://localhost:8080','https://mcp-auth.ranger.net/mcp','1642295okQobm','trim','1779519YVZUkj','kFagp','ikLWr','519736QnIgHm','RANGER_HOOKS','https://mcp-auth.staging.ranger.net/mcp','apiBaseUrl','https://api.ranger.net','265960wDkbYS'];_0x489b=function(){return _0x2bfe91;};return _0x489b();}export function isByokEnabled(){const _0x49e8bd=_0x47343a,_0x2a4a46={'jIIun':function(_0x1f56e8,_0x40f256){return _0x1f56e8===_0x40f256;}};return _0x2a4a46['jIIun'](process[_0x49e8bd(0xcb)][_0x49e8bd(0xd3)],'true');}function isVerificationTransport(_0x5d883f){const _0x4f59d0=_0x47343a,_0x5a9334={'ZtJlA':function(_0x3fc913,_0x118869){return _0x3fc913===_0x118869;},'VHOAz':'nova-act-cli'};return _0x5a9334['ZtJlA'](_0x5d883f,_0x4f59d0(0xd0))||_0x5d883f==='playwright-cli'||_0x5d883f===_0x5a9334['VHOAz']||_0x5d883f===_0x4f59d0(0xd2);}const LEGACY_TRANSPORT_ENV_VARS=['RANGER_USE_NOVA_ACT',_0x47343a(0xe9)];export function getVerificationTransport(){const _0x141dbc=_0x47343a,_0x136181={'kFagp':function(_0x242c12,_0x33d8a6){return _0x242c12(_0x33d8a6);},'ikLWr':_0x141dbc(0xd0)},_0x223d5f=process['env']['RANGER_TRANSPORT']?.[_0x141dbc(0xd9)]();if(_0x223d5f){if(_0x136181[_0x141dbc(0xdb)](isVerificationTransport,_0x223d5f))return _0x223d5f;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x223d5f+_0x141dbc(0xd1));}const _0x347385=LEGACY_TRANSPORT_ENV_VARS[_0x141dbc(0xe8)](_0x73d2a8=>process[_0x141dbc(0xcb)][_0x73d2a8]);if(_0x347385)throw new Error(_0x347385+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return _0x136181[_0x141dbc(0xdc)];}export function resolveHookMode(_0x5bd530=process[_0x47343a(0xcb)]){const _0x3f539b=_0x47343a,_0x508988={'xBWGo':_0x3f539b(0xe3),'maxWP':'off','QFmQK':function(_0xc4a164,_0x5a8d37){return _0xc4a164===_0x5a8d37;},'mphTz':function(_0x241c78,_0x2c9396){return _0x241c78+_0x2c9396;}},_0x502348=_0x5bd530['RANGER_HOOKS']?.[_0x3f539b(0xd9)]()[_0x3f539b(0xe7)]();if(!_0x502348)return _0x508988['xBWGo'];if(_0x502348===_0x508988['maxWP']||_0x508988['QFmQK'](_0x502348,'on')||_0x502348==='auto')return _0x502348;return console['error'](_0x508988['mphTz']('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x5bd530[_0x3f539b(0xde)]+'\x22.\x20','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.')),_0x3f539b(0xe3);}
@@ -1 +1 @@
1
- (function(_0x2c6006,_0x46afac){const _0x3f4c03=_0x4fb1,_0xe24554=_0x2c6006();while(!![]){try{const _0x341408=-parseInt(_0x3f4c03(0x134))/0x1*(-parseInt(_0x3f4c03(0x168))/0x2)+-parseInt(_0x3f4c03(0x172))/0x3+parseInt(_0x3f4c03(0x163))/0x4+-parseInt(_0x3f4c03(0x138))/0x5*(-parseInt(_0x3f4c03(0x16b))/0x6)+parseInt(_0x3f4c03(0x15a))/0x7+parseInt(_0x3f4c03(0x160))/0x8+parseInt(_0x3f4c03(0x153))/0x9*(parseInt(_0x3f4c03(0x144))/0xa);if(_0x341408===_0x46afac)break;else _0xe24554['push'](_0xe24554['shift']());}catch(_0x270333){_0xe24554['push'](_0xe24554['shift']());}}}(_0xf96b,0x93699));import{getToken}from'./keychain.js';function _0x4fb1(_0x1b62ff,_0x4c95e2){_0x1b62ff=_0x1b62ff-0x131;const _0xf96b10=_0xf96b();let _0x4fb131=_0xf96b10[_0x1b62ff];return _0x4fb131;}import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x1f2dc3){const _0x4f527a=_0x4fb1,_0x30656d={'suzRP':function(_0x1252b4){return _0x1252b4();},'ulQgo':function(_0x264be7,_0x53c043,_0x59c5c8){return _0x264be7(_0x53c043,_0x59c5c8);},'fMDGk':function(_0xe3ac56,_0x3afcc9){return _0xe3ac56===_0x3afcc9;}},_0xaf034b=await _0x30656d[_0x4f527a(0x164)](getToken);if(!_0xaf034b)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x42b5c5=_0x30656d[_0x4f527a(0x164)](getApiBaseUrl),_0x229552=await _0x30656d['ulQgo'](fetch,_0x42b5c5+_0x4f527a(0x141),{'method':_0x4f527a(0x133),'headers':{'Authorization':_0x4f527a(0x167)+_0xaf034b,'Content-Type':'application/json'},'body':JSON[_0x4f527a(0x17c)](_0x1f2dc3)});if(!_0x229552['ok']){if(_0x30656d['fMDGk'](_0x229552[_0x4f527a(0x16e)],0x192)){const _0x422c88=await _0x229552['json'](),_0x34eaac=_0x422c88[_0x4f527a(0x169)]||'https://dashboard.ranger.net/billing';throw new Error((_0x422c88['message']||_0x4f527a(0x17b))+_0x4f527a(0x161)+_0x34eaac);}const _0x2a3a32=await _0x229552['text']();throw new Error(_0x4f527a(0x174)+_0x2a3a32);}return _0x229552[_0x4f527a(0x135)]();}export async function listFeatures(_0x1ccc48){const _0x5ede73=_0x4fb1,_0x526424={'TBnNj':_0x5ede73(0x14d),'BQfDY':function(_0xa45e14){return _0xa45e14();},'pFAvo':'gitRepoUrl','UJzOC':'gitBranch','dSvbU':'limit','oUsJD':'offset','WHQkv':_0x5ede73(0x15f),'TzrHD':_0x5ede73(0x14a)},_0x149742=await getToken();if(!_0x149742)throw new Error(_0x526424['TBnNj']);const _0x9c2942=_0x526424['BQfDY'](getApiBaseUrl),_0x1b8393=new URLSearchParams();if(_0x1ccc48?.[_0x5ede73(0x171)])_0x1b8393[_0x5ede73(0x178)](_0x526424['pFAvo'],_0x1ccc48[_0x5ede73(0x171)]);if(_0x1ccc48?.[_0x5ede73(0x173)])_0x1b8393[_0x5ede73(0x178)](_0x526424['UJzOC'],_0x1ccc48[_0x5ede73(0x173)]);if(_0x1ccc48?.[_0x5ede73(0x150)])_0x1b8393[_0x5ede73(0x178)](_0x526424['dSvbU'],_0x1ccc48[_0x5ede73(0x150)]['toString']());if(_0x1ccc48?.[_0x5ede73(0x157)])_0x1b8393[_0x5ede73(0x178)](_0x526424['oUsJD'],_0x1ccc48[_0x5ede73(0x157)][_0x5ede73(0x13d)]());if(_0x1ccc48?.[_0x5ede73(0x15f)])_0x1b8393[_0x5ede73(0x178)](_0x526424[_0x5ede73(0x13f)],_0x526424[_0x5ede73(0x166)]);const _0x295344=_0x9c2942+'/api/v1/mcp/features'+(_0x1b8393[_0x5ede73(0x13d)]()?'?'+_0x1b8393['toString']():''),_0x22fbfd=await fetch(_0x295344,{'method':_0x5ede73(0x170),'headers':{'Authorization':_0x5ede73(0x167)+_0x149742}});if(!_0x22fbfd['ok']){const _0xf17fde=await _0x22fbfd[_0x5ede73(0x13e)]();throw new Error(_0x5ede73(0x140)+_0xf17fde);}return _0x22fbfd['json']();}export async function getFeature(_0x29e4bf){const _0x3e3f98=_0x4fb1,_0x2bc1e4={'lophn':function(_0x38b165){return _0x38b165();},'syZbu':_0x3e3f98(0x14d),'Sjbll':'GET'},_0x339705=await _0x2bc1e4[_0x3e3f98(0x145)](getToken);if(!_0x339705)throw new Error(_0x2bc1e4[_0x3e3f98(0x179)]);const _0x38df11=getApiBaseUrl(),_0x2e92df=await fetch(_0x38df11+_0x3e3f98(0x14c)+_0x29e4bf,{'method':_0x2bc1e4[_0x3e3f98(0x151)],'headers':{'Authorization':'Bearer\x20'+_0x339705}});if(!_0x2e92df['ok']){const _0x4f9563=await _0x2e92df['text']();throw new Error(_0x3e3f98(0x152)+_0x4f9563);}return _0x2e92df[_0x3e3f98(0x135)]();}export async function updateFeature(_0x21ebb0,_0x3c7166){const _0x1f0cee=_0x4fb1,_0x1203ff={'uovla':function(_0x3f4b88){return _0x3f4b88();},'Fblcd':_0x1f0cee(0x14d),'OPxnl':_0x1f0cee(0x154)},_0x2e0461=await _0x1203ff[_0x1f0cee(0x16d)](getToken);if(!_0x2e0461)throw new Error(_0x1203ff[_0x1f0cee(0x175)]);const _0x38ca97=getApiBaseUrl(),_0x62308=await fetch(_0x38ca97+_0x1f0cee(0x14c)+_0x21ebb0,{'method':_0x1203ff['OPxnl'],'headers':{'Authorization':_0x1f0cee(0x167)+_0x2e0461,'Content-Type':'application/json'},'body':JSON[_0x1f0cee(0x17c)](_0x3c7166)});if(!_0x62308['ok']){const _0x3a46f3=await _0x62308[_0x1f0cee(0x13e)]();throw new Error(_0x1f0cee(0x143)+_0x3a46f3);}return _0x62308[_0x1f0cee(0x135)]();}export async function createChecklistItem(_0x54eb00,_0xfe60f4,_0x34e8a0){const _0x1fe635=_0x4fb1,_0x279764={'VRloW':_0x1fe635(0x14d),'rSBHL':function(_0x4cbc77){return _0x4cbc77();},'MJuis':function(_0x482ef3,_0x50dac4,_0x2a1674){return _0x482ef3(_0x50dac4,_0x2a1674);},'cuoeH':'application/json'},_0x34583f=await getToken();if(!_0x34583f)throw new Error(_0x279764[_0x1fe635(0x146)]);const _0x4b2590=_0x279764[_0x1fe635(0x148)](getApiBaseUrl),_0x1a0608=await _0x279764[_0x1fe635(0x13b)](fetch,_0x4b2590+_0x1fe635(0x14c)+_0x54eb00+'/checklist',{'method':'POST','headers':{'Authorization':_0x1fe635(0x167)+_0x34583f,'Content-Type':_0x279764['cuoeH']},'body':JSON['stringify']({'description':_0xfe60f4,'position':_0x34e8a0})});if(!_0x1a0608['ok']){const _0x40713a=await _0x1a0608[_0x1fe635(0x13e)]();throw new Error(_0x1fe635(0x155)+_0x40713a);}return _0x1a0608['json']();}function _0xf96b(){const _0x549c63=['GET','gitRepoUrl','2623146gjYwOb','gitBranch','Failed\x20to\x20create\x20feature\x20review:\x20','Fblcd','qnzMf','syeqb','set','syZbu','kAUtE','Feature\x20limit\x20exceeded','stringify','Failed\x20to\x20delete\x20feature\x20review:\x20','oJBfo','iuzpK','POST','1234WlOCzL','json','QNefO','OWetC','10ztzDUh','/sessions','EpBYQ','MJuis','sessionId','toString','text','WHQkv','Failed\x20to\x20list\x20feature\x20reviews:\x20','/api/v1/mcp/features','WqRTT','Failed\x20to\x20update\x20feature\x20review:\x20','10rfgswN','lophn','VRloW','RVUQO','rSBHL','style','true','PmXcJ','/api/v1/mcp/features/','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','MaUdl','Failed\x20to\x20conclude\x20session:\x20','limit','Sjbll','Failed\x20to\x20get\x20feature\x20review:\x20','3091167qEAuoM','PATCH','Failed\x20to\x20create\x20scenario:\x20','/report','offset','seoCJ','/action-items','4151756EKnPYz','updateChecklistItem','vSQCw','/sessions/','KjjMf','includeDeleted','58160UIUFqy','\x0a\x0aUpgrade\x20your\x20plan:\x20','itemIds','1708104yfRhUs','suzRP','length','TzrHD','Bearer\x20','32vSSTRR','billingUrl','/report/markdown','262716wcxmZv','/checklist-items/','uovla','status','ImLIO'];_0xf96b=function(){return _0x549c63;};return _0xf96b();}export async function updateChecklistItem(_0x2bd583,_0x2f3a51,_0x30ce36){const _0x3fe058=_0x4fb1,_0x855bdc={'EpBYQ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','MpVwv':function(_0x1931bb){return _0x1931bb();},'qnzMf':'application/json','thqLd':function(_0x1062f9,_0x5518ce,_0x4ea990){return _0x1062f9(_0x5518ce,_0x4ea990);}};return _0x855bdc['thqLd'](withRetry,async()=>{const _0x1d9097=_0x4fb1,_0x4e179a=await getToken();if(!_0x4e179a)throw new Error(_0x855bdc[_0x1d9097(0x13a)]);const _0x1da62f=_0x855bdc['MpVwv'](getApiBaseUrl),_0x4562a8=await fetch(_0x1da62f+'/api/v1/mcp/features/'+_0x2bd583+'/checklist/'+_0x2f3a51,{'method':'PATCH','headers':{'Authorization':_0x1d9097(0x167)+_0x4e179a,'Content-Type':_0x855bdc[_0x1d9097(0x176)]},'body':JSON[_0x1d9097(0x17c)](_0x30ce36)});if(!_0x4562a8['ok']){const _0x241b54=await _0x4562a8[_0x1d9097(0x13e)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x241b54);}return _0x4562a8['json']();},{'label':_0x3fe058(0x15b)});}export async function getFeatureReport(_0x1f4c2){const _0x308bd2=_0x4fb1,_0x49b97f={'WqRTT':function(_0xf89aee){return _0xf89aee();}},_0x670ac8=await _0x49b97f[_0x308bd2(0x142)](getToken);if(!_0x670ac8)throw new Error(_0x308bd2(0x14d));const _0x4855ee=getApiBaseUrl(),_0x4b65e1=await fetch(_0x4855ee+_0x308bd2(0x14c)+_0x1f4c2+_0x308bd2(0x156),{'method':_0x308bd2(0x170),'headers':{'Authorization':_0x308bd2(0x167)+_0x670ac8}});if(!_0x4b65e1['ok']){const _0xe473c1=await _0x4b65e1['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0xe473c1);}return _0x4b65e1[_0x308bd2(0x135)]();}export async function getFeatureReportMarkdown(_0x2f488f,_0x3c3a76){const _0x2008c5=_0x4fb1,_0x442741={'seoCJ':function(_0x5d5e07){return _0x5d5e07();},'OWetC':'sessionId','oJBfo':function(_0x2410f0,_0x5519fb){return _0x2410f0&&_0x5519fb;}},_0x4890c0=await getToken();if(!_0x4890c0)throw new Error(_0x2008c5(0x14d));const _0x407fdf=_0x442741[_0x2008c5(0x158)](getApiBaseUrl),_0xcfd340=new URLSearchParams(),_0x37af6c=(_0x3c3a76?.['itemIds']?.[_0x2008c5(0x165)]??0x0)>0x0,_0x265c18=Boolean(_0x3c3a76?.['sessionId']);_0x37af6c&&_0x3c3a76?.['itemIds']&&_0xcfd340[_0x2008c5(0x178)](_0x2008c5(0x162),_0x3c3a76[_0x2008c5(0x162)]['join'](','));_0x265c18&&_0x3c3a76?.[_0x2008c5(0x13c)]&&_0xcfd340[_0x2008c5(0x178)](_0x442741[_0x2008c5(0x137)],_0x3c3a76['sessionId']);_0x442741[_0x2008c5(0x131)](!_0x37af6c,!_0x265c18)&&_0x3c3a76?.['style']&&_0xcfd340[_0x2008c5(0x178)](_0x2008c5(0x149),_0x3c3a76[_0x2008c5(0x149)]);const _0x347998=_0x407fdf+'/api/v1/mcp/features/'+_0x2f488f+_0x2008c5(0x16a),_0x40e915=''+_0x347998+(_0xcfd340[_0x2008c5(0x13d)]()?'?'+_0xcfd340['toString']():''),_0x280aab=await fetch(_0x40e915,{'method':_0x2008c5(0x170),'headers':{'Authorization':'Bearer\x20'+_0x4890c0}});if(!_0x280aab['ok']){const _0xad6ebd=await _0x280aab[_0x2008c5(0x13e)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0xad6ebd);}return _0x280aab['text']();}export async function listFeatureSessions(_0x2cf825){const _0x20e4fa=_0x4fb1,_0x574cfc={'MaUdl':function(_0x292299){return _0x292299();},'KjjMf':function(_0x1c0e09){return _0x1c0e09();},'PWWjt':function(_0x56224c,_0x5e085c,_0xdf18ba){return _0x56224c(_0x5e085c,_0xdf18ba);},'kOYXz':_0x20e4fa(0x170)},_0x235949=await _0x574cfc[_0x20e4fa(0x14e)](getToken);if(!_0x235949)throw new Error(_0x20e4fa(0x14d));const _0xa644dd=_0x574cfc[_0x20e4fa(0x15e)](getApiBaseUrl),_0x4c10ae=await _0x574cfc['PWWjt'](fetch,_0xa644dd+_0x20e4fa(0x14c)+_0x2cf825+_0x20e4fa(0x139),{'method':_0x574cfc['kOYXz'],'headers':{'Authorization':_0x20e4fa(0x167)+_0x235949}});if(!_0x4c10ae['ok']){const _0x1ae6a1=await _0x4c10ae[_0x20e4fa(0x13e)]();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x1ae6a1);}return _0x4c10ae[_0x20e4fa(0x135)]();}export async function startSession(_0x67b15f,_0x398a2c){const _0x6ec37c=_0x4fb1,_0x421971={'wjYTy':function(_0x572e5f){return _0x572e5f();},'yMCHZ':_0x6ec37c(0x14d),'NwwHi':function(_0xa9c59b,_0x405bb0,_0x131f44){return _0xa9c59b(_0x405bb0,_0x131f44);}},_0x1d65f2=await _0x421971['wjYTy'](getToken);if(!_0x1d65f2)throw new Error(_0x421971['yMCHZ']);const _0x39139c=getApiBaseUrl(),_0x14a0e6=await _0x421971['NwwHi'](fetch,_0x39139c+_0x6ec37c(0x14c)+_0x67b15f+_0x6ec37c(0x15d)+_0x398a2c+'/start',{'method':_0x6ec37c(0x133),'headers':{'Authorization':'Bearer\x20'+_0x1d65f2}});if(!_0x14a0e6['ok']){const _0x4eb0d8=await _0x14a0e6[_0x6ec37c(0x13e)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x4eb0d8);}return _0x14a0e6['json']();}export async function concludeSession(_0x3db640,_0xa73a34){const _0x44ed52=_0x4fb1,_0x473d4f={'pXdEo':function(_0x3bc67b){return _0x3bc67b();},'zVWqI':_0x44ed52(0x14d),'PmXcJ':function(_0x3096ee){return _0x3096ee();},'QNefO':function(_0x4bd51f,_0x253341,_0x3ac54e){return _0x4bd51f(_0x253341,_0x3ac54e);}},_0x8938bb=await _0x473d4f['pXdEo'](getToken);if(!_0x8938bb)throw new Error(_0x473d4f['zVWqI']);const _0x1f0a9c=_0x473d4f[_0x44ed52(0x14b)](getApiBaseUrl),_0x3a5a72=await _0x473d4f[_0x44ed52(0x136)](fetch,_0x1f0a9c+'/api/v1/mcp/features/'+_0x3db640+'/sessions/'+_0xa73a34+'/conclude',{'method':_0x44ed52(0x133),'headers':{'Authorization':_0x44ed52(0x167)+_0x8938bb}});if(!_0x3a5a72['ok']){const _0x30cc3c=await _0x3a5a72['text']();throw new Error(_0x44ed52(0x14f)+_0x30cc3c);}return _0x3a5a72['json']();}export async function getActionItems(_0x22f849){const _0x8aadfe=_0x4fb1,_0x19f60a={'SSteG':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','vSQCw':_0x8aadfe(0x170)},_0x3fdda5=await getToken();if(!_0x3fdda5)throw new Error(_0x19f60a['SSteG']);const _0x3b322f=getApiBaseUrl(),_0x44df69=await fetch(_0x3b322f+'/api/v1/mcp/features/'+_0x22f849+_0x8aadfe(0x159),{'method':_0x19f60a[_0x8aadfe(0x15c)],'headers':{'Authorization':_0x8aadfe(0x167)+_0x3fdda5}});if(!_0x44df69['ok']){const _0x178151=await _0x44df69['text']();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x178151);}return _0x44df69['json']();}export async function getItemFeedback(_0x515d12,_0x292db1){const _0x4cce58=_0x4fb1,_0x2bf773={'dTxbc':function(_0x104e64){return _0x104e64();},'iuzpK':function(_0x4d54ee){return _0x4d54ee();},'RVUQO':_0x4cce58(0x170)},_0x3eedf7=await _0x2bf773['dTxbc'](getToken);if(!_0x3eedf7)throw new Error(_0x4cce58(0x14d));const _0xe6d86a=_0x2bf773[_0x4cce58(0x132)](getApiBaseUrl),_0x2699cb=await fetch(_0xe6d86a+_0x4cce58(0x14c)+_0x515d12+_0x4cce58(0x16c)+_0x292db1+'/feedback',{'method':_0x2bf773[_0x4cce58(0x147)],'headers':{'Authorization':_0x4cce58(0x167)+_0x3eedf7}});if(!_0x2699cb['ok']){const _0x4a4c7d=await _0x2699cb[_0x4cce58(0x13e)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x4a4c7d);}return _0x2699cb['json']();}export async function markCommentsAddressed(_0x50a7e5,_0x36836e,_0x5d54ba){const _0x5351ce=_0x4fb1,_0xa2ea7={'RslGL':function(_0x34f5e6){return _0x34f5e6();},'syeqb':function(_0x224c5b){return _0x224c5b();},'ImLIO':'application/json'},_0x292534=await _0xa2ea7['RslGL'](getToken);if(!_0x292534)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2e3f3e=_0xa2ea7[_0x5351ce(0x177)](getApiBaseUrl),_0x2b3684=await fetch(_0x2e3f3e+_0x5351ce(0x14c)+_0x50a7e5+'/comments/address',{'method':'POST','headers':{'Authorization':_0x5351ce(0x167)+_0x292534,'Content-Type':_0xa2ea7[_0x5351ce(0x16f)]},'body':JSON[_0x5351ce(0x17c)]({'checklistItemId':_0x36836e,'commentIds':_0x5d54ba})});if(!_0x2b3684['ok']){const _0xe3ae5e=await _0x2b3684['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0xe3ae5e);}}export async function softDeleteFeature(_0x39bfb1){const _0x1c8583=_0x4fb1,_0x3df761={'eHoDp':function(_0x49ead2){return _0x49ead2();},'kAUtE':'DELETE'},_0x462e83=await getToken();if(!_0x462e83)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3cab10=_0x3df761['eHoDp'](getApiBaseUrl),_0x226cde=await fetch(_0x3cab10+'/api/v1/mcp/features/'+_0x39bfb1,{'method':_0x3df761[_0x1c8583(0x17a)],'headers':{'Authorization':_0x1c8583(0x167)+_0x462e83}});if(!_0x226cde['ok']){const _0x510b7e=await _0x226cde[_0x1c8583(0x13e)]();throw new Error(_0x1c8583(0x17d)+_0x510b7e);}}export async function restoreFeature(_0x3ea715){const _0x105aa2=_0x4fb1,_0x15b6ec={'kqGQF':function(_0x583dd5){return _0x583dd5();}},_0x3f7531=await _0x15b6ec['kqGQF'](getToken);if(!_0x3f7531)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x20ca55=_0x15b6ec['kqGQF'](getApiBaseUrl),_0x1a2935=await fetch(_0x20ca55+_0x105aa2(0x14c)+_0x3ea715+'/restore',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x3f7531}});if(!_0x1a2935['ok']){const _0x17ea44=await _0x1a2935['text']();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x17ea44);}}
1
+ (function(_0x397580,_0x440a09){const _0x169130=_0xac0b,_0x501cfb=_0x397580();while(!![]){try{const _0x31358d=parseInt(_0x169130(0x11c))/0x1*(parseInt(_0x169130(0x100))/0x2)+parseInt(_0x169130(0x13f))/0x3+parseInt(_0x169130(0x120))/0x4*(parseInt(_0x169130(0x114))/0x5)+-parseInt(_0x169130(0x126))/0x6*(-parseInt(_0x169130(0x132))/0x7)+-parseInt(_0x169130(0x11b))/0x8*(-parseInt(_0x169130(0x131))/0x9)+parseInt(_0x169130(0x12b))/0xa*(-parseInt(_0x169130(0x121))/0xb)+-parseInt(_0x169130(0x112))/0xc;if(_0x31358d===_0x440a09)break;else _0x501cfb['push'](_0x501cfb['shift']());}catch(_0x5d6e03){_0x501cfb['push'](_0x501cfb['shift']());}}}(_0x2d10,0x64fa6));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x3cc3a8){const _0x2fb364=_0xac0b,_0x3b4a54={'XamZB':function(_0x2bf008){return _0x2bf008();},'VUrdH':'POST','UsdNc':'application/json'},_0x45ebd3=await getToken();if(!_0x45ebd3)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xe1a433=_0x3b4a54['XamZB'](getApiBaseUrl),_0xa298dd=await fetch(_0xe1a433+_0x2fb364(0x12d),{'method':_0x3b4a54[_0x2fb364(0x138)],'headers':{'Authorization':_0x2fb364(0x128)+_0x45ebd3,'Content-Type':_0x3b4a54['UsdNc']},'body':JSON['stringify'](_0x3cc3a8)});if(!_0xa298dd['ok']){if(_0xa298dd['status']===0x192){const _0x528406=await _0xa298dd[_0x2fb364(0x13b)](),_0x3516db=_0x528406['billingUrl']||'https://dashboard.ranger.net/billing';throw new Error((_0x528406[_0x2fb364(0x115)]||_0x2fb364(0x141))+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x3516db);}const _0x152a9b=await _0xa298dd[_0x2fb364(0x140)]();throw new Error(_0x2fb364(0x12c)+_0x152a9b);}return _0xa298dd[_0x2fb364(0x13b)]();}export async function listFeatures(_0x480928){const _0x5a2848=_0xac0b,_0x510484={'jGXhz':_0x5a2848(0x122)},_0x5babad=await getToken();if(!_0x5babad)throw new Error(_0x510484['jGXhz']);const _0x4c35d1=getApiBaseUrl(),_0x42e258=new URLSearchParams();if(_0x480928?.[_0x5a2848(0x111)])_0x42e258['set'](_0x5a2848(0x111),_0x480928[_0x5a2848(0x111)]);if(_0x480928?.[_0x5a2848(0x105)])_0x42e258['set']('gitBranch',_0x480928[_0x5a2848(0x105)]);if(_0x480928?.['limit'])_0x42e258['set']('limit',_0x480928[_0x5a2848(0x136)][_0x5a2848(0x127)]());if(_0x480928?.['offset'])_0x42e258['set']('offset',_0x480928['offset'][_0x5a2848(0x127)]());if(_0x480928?.['includeDeleted'])_0x42e258[_0x5a2848(0x101)]('includeDeleted','true');const _0x566eac=_0x4c35d1+_0x5a2848(0x12d)+(_0x42e258[_0x5a2848(0x127)]()?'?'+_0x42e258[_0x5a2848(0x127)]():''),_0x50b34f=await fetch(_0x566eac,{'method':_0x5a2848(0x123),'headers':{'Authorization':'Bearer\x20'+_0x5babad}});if(!_0x50b34f['ok']){const _0x2a73bc=await _0x50b34f[_0x5a2848(0x140)]();throw new Error(_0x5a2848(0x118)+_0x2a73bc);}return _0x50b34f[_0x5a2848(0x13b)]();}export async function getFeature(_0x34e6f8){const _0x1fecf3=_0xac0b,_0x113cea={'yWrII':function(_0x2e7c35,_0x2a3179,_0x5f0c14){return _0x2e7c35(_0x2a3179,_0x5f0c14);},'yaVFK':'GET'},_0x59dbf8=await getToken();if(!_0x59dbf8)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x417f25=getApiBaseUrl(),_0x6b3a06=await _0x113cea[_0x1fecf3(0x10a)](fetch,_0x417f25+_0x1fecf3(0x116)+_0x34e6f8,{'method':_0x113cea[_0x1fecf3(0x12a)],'headers':{'Authorization':'Bearer\x20'+_0x59dbf8}});if(!_0x6b3a06['ok']){const _0x325dff=await _0x6b3a06[_0x1fecf3(0x140)]();throw new Error(_0x1fecf3(0x137)+_0x325dff);}return _0x6b3a06[_0x1fecf3(0x13b)]();}function _0xac0b(_0x580f86,_0x2d76d1){_0x580f86=_0x580f86-0xff;const _0x2d1016=_0x2d10();let _0xac0bd5=_0x2d1016[_0x580f86];return _0xac0bd5;}export async function updateFeature(_0x400e69,_0x3917fa){const _0x1c7e43=_0xac0b,_0x2e0eb4={'YSSgE':function(_0x3a6361){return _0x3a6361();},'IYBnL':_0x1c7e43(0x108)},_0x6b7da1=await _0x2e0eb4[_0x1c7e43(0x10b)](getToken);if(!_0x6b7da1)throw new Error(_0x1c7e43(0x122));const _0x381ac8=getApiBaseUrl(),_0x5607b4=await fetch(_0x381ac8+_0x1c7e43(0x116)+_0x400e69,{'method':'PATCH','headers':{'Authorization':_0x1c7e43(0x128)+_0x6b7da1,'Content-Type':_0x2e0eb4['IYBnL']},'body':JSON['stringify'](_0x3917fa)});if(!_0x5607b4['ok']){const _0x4fdfed=await _0x5607b4['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x4fdfed);}return _0x5607b4[_0x1c7e43(0x13b)]();}export async function createChecklistItem(_0x52a616,_0x54c49e,_0x30a41a){const _0x3e94e3=_0xac0b,_0x51d133={'dSnol':function(_0x5cf30b,_0x5d6e2e,_0x58585c){return _0x5cf30b(_0x5d6e2e,_0x58585c);},'LXlcN':'application/json'},_0x1e6495=await getToken();if(!_0x1e6495)throw new Error(_0x3e94e3(0x122));const _0x1f1d84=getApiBaseUrl(),_0x2ef95c=await _0x51d133['dSnol'](fetch,_0x1f1d84+_0x3e94e3(0x116)+_0x52a616+_0x3e94e3(0x144),{'method':'POST','headers':{'Authorization':_0x3e94e3(0x128)+_0x1e6495,'Content-Type':_0x51d133['LXlcN']},'body':JSON[_0x3e94e3(0x102)]({'description':_0x54c49e,'position':_0x30a41a})});if(!_0x2ef95c['ok']){const _0x507e4d=await _0x2ef95c[_0x3e94e3(0x140)]();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x507e4d);}return _0x2ef95c['json']();}export async function updateChecklistItem(_0x2930eb,_0x50e594,_0x75fda6){const _0x46b5e8=_0xac0b,_0x16f9d9={'TbmaQ':function(_0x12c7e1){return _0x12c7e1();},'WNInG':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','NuPtT':function(_0x39380b){return _0x39380b();},'naimz':'PATCH','ELJOY':'application/json'};return withRetry(async()=>{const _0x28b176=_0xac0b,_0x1ca13d=await _0x16f9d9[_0x28b176(0x12f)](getToken);if(!_0x1ca13d)throw new Error(_0x16f9d9[_0x28b176(0x10d)]);const _0x2daf4f=_0x16f9d9['NuPtT'](getApiBaseUrl),_0x4c46ac=await fetch(_0x2daf4f+'/api/v1/mcp/features/'+_0x2930eb+'/checklist/'+_0x50e594,{'method':_0x16f9d9[_0x28b176(0x142)],'headers':{'Authorization':_0x28b176(0x128)+_0x1ca13d,'Content-Type':_0x16f9d9['ELJOY']},'body':JSON[_0x28b176(0x102)](_0x75fda6)});if(!_0x4c46ac['ok']){const _0x84447a=await _0x4c46ac[_0x28b176(0x140)]();throw new Error(_0x28b176(0xff)+_0x84447a);}return _0x4c46ac[_0x28b176(0x13b)]();},{'label':_0x46b5e8(0x11a)});}export async function getFeatureReport(_0x28993a){const _0x3ad74b=_0xac0b,_0x1e25ca={'lrZyO':function(_0x9038b3){return _0x9038b3();}},_0x38c6a3=await _0x1e25ca[_0x3ad74b(0x133)](getToken);if(!_0x38c6a3)throw new Error(_0x3ad74b(0x122));const _0x5049bb=_0x1e25ca[_0x3ad74b(0x133)](getApiBaseUrl),_0x407015=await fetch(_0x5049bb+_0x3ad74b(0x116)+_0x28993a+_0x3ad74b(0x135),{'method':'GET','headers':{'Authorization':_0x3ad74b(0x128)+_0x38c6a3}});if(!_0x407015['ok']){const _0x97b19=await _0x407015[_0x3ad74b(0x140)]();throw new Error(_0x3ad74b(0x109)+_0x97b19);}return _0x407015[_0x3ad74b(0x13b)]();}export async function getFeatureReportMarkdown(_0x59c2e1,_0x3c3701){const _0x4c52ca=_0xac0b,_0x109947={'LQjEW':function(_0x5eea1f){return _0x5eea1f();},'ejTvo':function(_0x3bab5e,_0x5ad04d){return _0x3bab5e>_0x5ad04d;},'PbPew':function(_0xa3eda9,_0x5bb02a){return _0xa3eda9(_0x5bb02a);},'Azfca':_0x4c52ca(0x12e),'XUrpI':'style','wbfDJ':function(_0x511a57,_0x30df84,_0x31b034){return _0x511a57(_0x30df84,_0x31b034);}},_0x312334=await _0x109947[_0x4c52ca(0x130)](getToken);if(!_0x312334)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x48c3d7=getApiBaseUrl(),_0x46148c=new URLSearchParams(),_0x5301de=_0x109947[_0x4c52ca(0x13d)](_0x3c3701?.['itemIds']?.['length']??0x0,0x0),_0x1240e5=_0x109947[_0x4c52ca(0x104)](Boolean,_0x3c3701?.['sessionId']);_0x5301de&&_0x3c3701?.[_0x4c52ca(0x12e)]&&_0x46148c[_0x4c52ca(0x101)](_0x109947['Azfca'],_0x3c3701['itemIds']['join'](','));_0x1240e5&&_0x3c3701?.[_0x4c52ca(0x139)]&&_0x46148c[_0x4c52ca(0x101)](_0x4c52ca(0x139),_0x3c3701['sessionId']);!_0x5301de&&!_0x1240e5&&_0x3c3701?.[_0x4c52ca(0x129)]&&_0x46148c[_0x4c52ca(0x101)](_0x109947['XUrpI'],_0x3c3701['style']);const _0x5f49bc=_0x48c3d7+'/api/v1/mcp/features/'+_0x59c2e1+_0x4c52ca(0x145),_0x2e0bef=''+_0x5f49bc+(_0x46148c['toString']()?'?'+_0x46148c[_0x4c52ca(0x127)]():''),_0x5a47ea=await _0x109947[_0x4c52ca(0x110)](fetch,_0x2e0bef,{'method':'GET','headers':{'Authorization':_0x4c52ca(0x128)+_0x312334}});if(!_0x5a47ea['ok']){const _0x2ee68b=await _0x5a47ea[_0x4c52ca(0x140)]();throw new Error(_0x4c52ca(0x13c)+_0x2ee68b);}return _0x5a47ea['text']();}export async function listFeatureSessions(_0x45b285){const _0x2afe76=_0xac0b,_0x400bfe=await getToken();if(!_0x400bfe)throw new Error(_0x2afe76(0x122));const _0x22c063=getApiBaseUrl(),_0xd223cd=await fetch(_0x22c063+_0x2afe76(0x116)+_0x45b285+_0x2afe76(0x119),{'method':'GET','headers':{'Authorization':_0x2afe76(0x128)+_0x400bfe}});if(!_0xd223cd['ok']){const _0x90c9b7=await _0xd223cd['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x90c9b7);}return _0xd223cd[_0x2afe76(0x13b)]();}export async function startSession(_0x446e84,_0x165073){const _0x47b72d=_0xac0b,_0x1377c7={'IqmGG':_0x47b72d(0x122),'ZhRiq':function(_0x51c055,_0x36b3db,_0x558a40){return _0x51c055(_0x36b3db,_0x558a40);}},_0x5c431c=await getToken();if(!_0x5c431c)throw new Error(_0x1377c7['IqmGG']);const _0x2240e2=getApiBaseUrl(),_0x54a7ff=await _0x1377c7['ZhRiq'](fetch,_0x2240e2+'/api/v1/mcp/features/'+_0x446e84+_0x47b72d(0x10c)+_0x165073+'/start',{'method':'POST','headers':{'Authorization':_0x47b72d(0x128)+_0x5c431c}});if(!_0x54a7ff['ok']){const _0x2e5929=await _0x54a7ff['text']();throw new Error(_0x47b72d(0x107)+_0x2e5929);}return _0x54a7ff[_0x47b72d(0x13b)]();}export async function concludeSession(_0x4f4a00,_0x5087aa){const _0x335661=_0xac0b,_0x1b80b8={'mohTO':function(_0x3df7a2){return _0x3df7a2();},'RjFtt':function(_0x521bd2,_0xe5563a,_0x51e244){return _0x521bd2(_0xe5563a,_0x51e244);}},_0x61dbfb=await _0x1b80b8[_0x335661(0x13e)](getToken);if(!_0x61dbfb)throw new Error(_0x335661(0x122));const _0x4dfa57=_0x1b80b8['mohTO'](getApiBaseUrl),_0x1351b4=await _0x1b80b8[_0x335661(0x11e)](fetch,_0x4dfa57+'/api/v1/mcp/features/'+_0x4f4a00+'/sessions/'+_0x5087aa+'/conclude',{'method':_0x335661(0x134),'headers':{'Authorization':'Bearer\x20'+_0x61dbfb}});if(!_0x1351b4['ok']){const _0x2eccfc=await _0x1351b4['text']();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x2eccfc);}return _0x1351b4['json']();}export async function getActionItems(_0x1c2479){const _0x5a5af7=_0xac0b,_0x22e3e5={'FXFxQ':function(_0x43bfcf){return _0x43bfcf();},'AdCQv':function(_0x383001,_0x4fb9bc,_0x191eb2){return _0x383001(_0x4fb9bc,_0x191eb2);},'SaCNR':'GET'},_0x52bcd4=await getToken();if(!_0x52bcd4)throw new Error(_0x5a5af7(0x122));const _0x2a8f8b=_0x22e3e5['FXFxQ'](getApiBaseUrl),_0x3a6f75=await _0x22e3e5[_0x5a5af7(0x11d)](fetch,_0x2a8f8b+_0x5a5af7(0x116)+_0x1c2479+_0x5a5af7(0x113),{'method':_0x22e3e5['SaCNR'],'headers':{'Authorization':_0x5a5af7(0x128)+_0x52bcd4}});if(!_0x3a6f75['ok']){const _0x49cc89=await _0x3a6f75[_0x5a5af7(0x140)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x49cc89);}return _0x3a6f75[_0x5a5af7(0x13b)]();}export async function getItemFeedback(_0x40e294,_0x17e689){const _0x2c4702=_0xac0b,_0x3bba08={'liYRu':function(_0x4e3bfa){return _0x4e3bfa();},'iWyiU':function(_0x450eb9){return _0x450eb9();},'KnbfC':'GET'},_0x2d2ea2=await _0x3bba08[_0x2c4702(0x143)](getToken);if(!_0x2d2ea2)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x17bf43=_0x3bba08['iWyiU'](getApiBaseUrl),_0x3cb804=await fetch(_0x17bf43+'/api/v1/mcp/features/'+_0x40e294+_0x2c4702(0x124)+_0x17e689+_0x2c4702(0x125),{'method':_0x3bba08[_0x2c4702(0x117)],'headers':{'Authorization':_0x2c4702(0x128)+_0x2d2ea2}});if(!_0x3cb804['ok']){const _0x168443=await _0x3cb804[_0x2c4702(0x140)]();throw new Error(_0x2c4702(0x13a)+_0x168443);}return _0x3cb804['json']();}export async function markCommentsAddressed(_0x104ebe,_0x488f32,_0x2b5c4b){const _0x27430a=_0xac0b,_0x5d3f7f={'pliQh':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x1af08f=await getToken();if(!_0x1af08f)throw new Error(_0x5d3f7f[_0x27430a(0x11f)]);const _0x2ade9c=getApiBaseUrl(),_0x3d9c09=await fetch(_0x2ade9c+'/api/v1/mcp/features/'+_0x104ebe+_0x27430a(0x10f),{'method':_0x27430a(0x134),'headers':{'Authorization':'Bearer\x20'+_0x1af08f,'Content-Type':'application/json'},'body':JSON['stringify']({'checklistItemId':_0x488f32,'commentIds':_0x2b5c4b})});if(!_0x3d9c09['ok']){const _0x39e8e3=await _0x3d9c09['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x39e8e3);}}export async function softDeleteFeature(_0x5b99ab){const _0x5632d4=_0xac0b,_0xdd07f6={'RROsE':function(_0x560448){return _0x560448();},'HkkoZ':function(_0x399737,_0x131618,_0x1997ad){return _0x399737(_0x131618,_0x1997ad);},'HygLH':'DELETE'},_0xea46c4=await _0xdd07f6[_0x5632d4(0x106)](getToken);if(!_0xea46c4)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xa9e5a4=getApiBaseUrl(),_0x6d278b=await _0xdd07f6['HkkoZ'](fetch,_0xa9e5a4+_0x5632d4(0x116)+_0x5b99ab,{'method':_0xdd07f6['HygLH'],'headers':{'Authorization':_0x5632d4(0x128)+_0xea46c4}});if(!_0x6d278b['ok']){const _0x2ddc6d=await _0x6d278b['text']();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x2ddc6d);}}function _0x2d10(){const _0x4d5feb=['message','/api/v1/mcp/features/','KnbfC','Failed\x20to\x20list\x20feature\x20reviews:\x20','/sessions','updateChecklistItem','2165336nqiase','98993uONAmC','AdCQv','RjFtt','pliQh','12pPawIl','55rvMEFz','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','GET','/checklist-items/','/feedback','3408eGZYDF','toString','Bearer\x20','style','yaVFK','609750CVCNcf','Failed\x20to\x20create\x20feature\x20review:\x20','/api/v1/mcp/features','itemIds','TbmaQ','LQjEW','18rMjdEw','5656zVuovT','lrZyO','POST','/report','limit','Failed\x20to\x20get\x20feature\x20review:\x20','VUrdH','sessionId','Failed\x20to\x20get\x20item\x20feedback:\x20','json','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','ejTvo','mohTO','793614GWWbuc','text','Feature\x20limit\x20exceeded','naimz','liYRu','/checklist','/report/markdown','Failed\x20to\x20update\x20scenario:\x20','4xhscwc','set','stringify','WMbxd','PbPew','gitBranch','RROsE','Failed\x20to\x20start\x20session:\x20','application/json','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','yWrII','YSSgE','/sessions/','WNInG','Failed\x20to\x20restore\x20feature\x20review:\x20','/comments/address','wbfDJ','gitRepoUrl','16530480LmYPJi','/action-items','1055365oufxQJ'];_0x2d10=function(){return _0x4d5feb;};return _0x2d10();}export async function restoreFeature(_0x49a16c){const _0x5aa300=_0xac0b,_0x3943f3={'RoQLd':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','WMbxd':function(_0x2faeb7){return _0x2faeb7();}},_0x3f7963=await getToken();if(!_0x3f7963)throw new Error(_0x3943f3['RoQLd']);const _0x56d21b=_0x3943f3[_0x5aa300(0x103)](getApiBaseUrl),_0xb63e05=await fetch(_0x56d21b+_0x5aa300(0x116)+_0x49a16c+'/restore',{'method':_0x5aa300(0x134),'headers':{'Authorization':_0x5aa300(0x128)+_0x3f7963}});if(!_0xb63e05['ok']){const _0x2c9bbf=await _0xb63e05['text']();throw new Error(_0x5aa300(0x10e)+_0x2c9bbf);}}