@ranger-testing/ranger-cli 2.5.4-alpha.1f7a251-7 → 2.5.4-alpha.27e3ee8-11

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 (78) 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/env.js +1 -1
  7. package/build/commands/feature.js +1 -1
  8. package/build/commands/hook.js +1 -1
  9. package/build/commands/hooks/autoPrompt.js +1 -1
  10. package/build/commands/hooks/disable.js +1 -1
  11. package/build/commands/hooks/enable.js +1 -1
  12. package/build/commands/hooks/exitPlanMode.js +1 -1
  13. package/build/commands/hooks/index.js +1 -1
  14. package/build/commands/hooks/output.js +1 -1
  15. package/build/commands/hooks/planReminder.js +1 -1
  16. package/build/commands/hooks/planStart.js +1 -1
  17. package/build/commands/hooks/postEdit.js +1 -1
  18. package/build/commands/hooks/preCompact.js +1 -1
  19. package/build/commands/hooks/sessionEnd.js +1 -1
  20. package/build/commands/hooks/sessionStart.js +1 -1
  21. package/build/commands/hooks/stopHook.js +1 -1
  22. package/build/commands/index.js +1 -1
  23. package/build/commands/login.js +1 -1
  24. package/build/commands/mcpBootstrap.js +1 -1
  25. package/build/commands/migrateProfile.js +1 -1
  26. package/build/commands/setup/claude.js +1 -1
  27. package/build/commands/setup/opencode.js +1 -1
  28. package/build/commands/setupCi.js +1 -1
  29. package/build/commands/skillup.js +1 -1
  30. package/build/commands/start.js +1 -1
  31. package/build/commands/status.js +1 -1
  32. package/build/commands/update.js +1 -1
  33. package/build/commands/updateEnv.js +1 -1
  34. package/build/commands/useEnv.js +1 -1
  35. package/build/commands/utils/activeProfile.js +1 -1
  36. package/build/commands/utils/agentEnv.js +1 -1
  37. package/build/commands/utils/browserSessionsApi.js +1 -1
  38. package/build/commands/utils/claudeConfig.js +1 -1
  39. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  40. package/build/commands/utils/claudePlugin.js +1 -1
  41. package/build/commands/utils/cloudProfile.js +1 -1
  42. package/build/commands/utils/cloudProfileSession.js +1 -1
  43. package/build/commands/utils/crypto.js +1 -1
  44. package/build/commands/utils/desirePathLog.js +1 -1
  45. package/build/commands/utils/deviceAuth.js +1 -1
  46. package/build/commands/utils/environment.js +1 -1
  47. package/build/commands/utils/featureApi.js +1 -1
  48. package/build/commands/utils/fixWebmDuration.js +1 -1
  49. package/build/commands/utils/gitTracked.js +1 -1
  50. package/build/commands/utils/keychain.js +1 -1
  51. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  52. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  53. package/build/commands/utils/mcpImageBase64.js +1 -1
  54. package/build/commands/utils/model.js +1 -1
  55. package/build/commands/utils/opencodeConfig.js +1 -1
  56. package/build/commands/utils/playwrightCli.js +1 -1
  57. package/build/commands/utils/profileMessages.js +1 -1
  58. package/build/commands/utils/profileSetupBanner.js +1 -1
  59. package/build/commands/utils/projectsConfig.js +1 -1
  60. package/build/commands/utils/rangerConfig.js +1 -1
  61. package/build/commands/utils/rangerRoot.js +1 -1
  62. package/build/commands/utils/resolveProfileContext.js +1 -1
  63. package/build/commands/utils/resolveProfileUrl.js +1 -1
  64. package/build/commands/utils/retry.js +1 -1
  65. package/build/commands/utils/sessionCache.js +1 -1
  66. package/build/commands/utils/settings.js +1 -1
  67. package/build/commands/utils/skillContent.js +1 -1
  68. package/build/commands/utils/skills.js +1 -1
  69. package/build/commands/utils/stitchWebmFiles.js +1 -1
  70. package/build/commands/utils/telemetry.js +1 -1
  71. package/build/commands/utils/tokenRefresh.js +1 -1
  72. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  73. package/build/commands/utils/userApi.js +1 -1
  74. package/build/commands/utils/version.js +1 -1
  75. package/build/commands/verifyFeature.js +1 -1
  76. package/build/commands/verifyFeatureCli.js +1 -1
  77. package/build/skills/ranger/verify.md +6 -12
  78. package/package.json +1 -1
@@ -1 +1 @@
1
- const _0x23c1b4=_0x108f;(function(_0x4258f4,_0x31eb22){const _0x1da9cb=_0x108f,_0x378812=_0x4258f4();while(!![]){try{const _0xd8063a=-parseInt(_0x1da9cb(0x1d9))/0x1*(-parseInt(_0x1da9cb(0x21c))/0x2)+parseInt(_0x1da9cb(0x1e0))/0x3*(-parseInt(_0x1da9cb(0x1c6))/0x4)+parseInt(_0x1da9cb(0x1c5))/0x5+parseInt(_0x1da9cb(0x1e1))/0x6*(parseInt(_0x1da9cb(0x1ea))/0x7)+-parseInt(_0x1da9cb(0x1e2))/0x8*(-parseInt(_0x1da9cb(0x227))/0x9)+parseInt(_0x1da9cb(0x1dc))/0xa+parseInt(_0x1da9cb(0x225))/0xb*(-parseInt(_0x1da9cb(0x22c))/0xc);if(_0xd8063a===_0x31eb22)break;else _0x378812['push'](_0x378812['shift']());}catch(_0x39bfa6){_0x378812['push'](_0x378812['shift']());}}}(_0x4ab4,0xcedd0));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x211aff from'inquirer';function _0x4ab4(){const _0x336b32=['iDffj','31539HWTOvp','6WftkJI','423488hdqLgl','\x20failed\x20(','/api/v1/profiles','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','PUT','zGoQZ','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','message','8312633vycJvH','log','/login','QEsqu','RKGJe','kPpKJ','kucVG','POST','newContext','password','zuUZS','statusText','SqlIZ','launch','defaultEnvironmentKey','cli:manual-login','mXKsn','qxlQM','setupHeaders','sessionState','\x20\x20Login\x20successful.\x20Session\x20cached.','\x22\x20failed\x20validation\x20—\x20refreshing...','parse',').\x20','\x20\x20Cloud\x20session\x20for\x20\x22','keys','RANGER_TEST_PASSWORD','tnvrV','isArray','\x22\x20for\x20','env','catch','userAgent','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','stringify','lAcNE','sessionDeps','ozfjd','ylerU','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','force','name','extraHTTPHeaders','PJYNC','\x22,\x20attempting\x20login...','Bearer\x20','fIfdE','error','10oteygM','Yehxn','kCAnV','VWNjT','storageStatePath','API\x20request\x20','domains','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','detail','88mufTeV','/session','18bDIuwt','length','code','uGcTr','status','3155772IASSYC','ljElJ','kPDLY','Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20(','RANGER_TEST_USERNAME','clientIp','close','auth','3121310wCamku','372qfSSIq','iAPNN','toISOString','\x20\x20No\x20live\x20session\x20for\x20\x22','username','string','GxlFF','):\x20','HiZUS','environmentKey','settings','MnZuI','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','organizationId','/api/v1/profiles/','XkPgL','sessionCheckPath','rmQuf','291129rVWBZJ','newPage','nkDyr','5555710JcFrLt','BzOaj','mkHTA'];_0x4ab4=function(){return _0x336b32;};return _0x4ab4();}import{chromium}from'playwright';function _0x108f(_0x2d331e,_0x213c0c){_0x2d331e=_0x2d331e-0x1c4;const _0x4ab4a7=_0x4ab4();let _0x108f65=_0x4ab4a7[_0x2d331e];return _0x108f65;}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 _0x536985=_0x108f,_0x21975b={'SnCjK':_0x536985(0x1e5)},_0x19d131=await getToken();if(!_0x19d131)throw new Error(_0x21975b['SnCjK']);return _0x19d131;}async function apiRequest(_0x1faa04,_0x543fe7={}){const _0x2ea8cd=_0x108f,_0x7aad78={'wqBpf':function(_0xefe0a){return _0xefe0a();},'QrjCo':'application/json','rmQuf':'string'},_0xdf6110=await requireToken(),_0x2c20a3=_0x7aad78['wqBpf'](getApiBaseUrl),_0x22bf5c=await fetch(''+_0x2c20a3+_0x1faa04,{..._0x543fe7,'headers':{'Authorization':_0x2ea8cd(0x219)+_0xdf6110,'Content-Type':_0x7aad78['QrjCo'],..._0x543fe7['headers']??{}}});if(!_0x22bf5c['ok']){let _0x4cc351='',_0x29735f;try{const _0x1f8f7d=await _0x22bf5c['json']();_0x4cc351=(typeof _0x1f8f7d['error']===_0x2ea8cd(0x1cb)?_0x1f8f7d[_0x2ea8cd(0x21b)]:undefined)??JSON['stringify'](_0x1f8f7d);if(typeof _0x1f8f7d['code']===_0x7aad78[_0x2ea8cd(0x1d8)])_0x29735f=_0x1f8f7d[_0x2ea8cd(0x229)];}catch{_0x4cc351=_0x22bf5c[_0x2ea8cd(0x1f5)];}throw new ApiError(_0x2ea8cd(0x221)+_0x1faa04+_0x2ea8cd(0x1e3)+_0x22bf5c[_0x2ea8cd(0x22b)]+_0x2ea8cd(0x1cd)+_0x4cc351,_0x22bf5c['status'],_0x4cc351,_0x29735f);}return _0x22bf5c['json']();}export class ApiError extends Error{['status'];['detail'];['code'];constructor(_0x354024,_0x272242,_0x2f1c52,_0x5b4f21){const _0x269dfd=_0x108f,_0x46821f='1|3|4|0|2'['split']('|');let _0xa2d304=0x0;while(!![]){switch(_0x46821f[_0xa2d304++]){case'0':this[_0x269dfd(0x229)]=_0x5b4f21;continue;case'1':super(_0x354024);continue;case'2':this[_0x269dfd(0x215)]='ApiError';continue;case'3':this['status']=_0x272242;continue;case'4':this[_0x269dfd(0x224)]=_0x2f1c52;continue;}break;}}}export async function fetchCloudProfile(_0x491653){try{return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x491653));}catch(_0x41d604){if(_0x41d604 instanceof ApiError&&_0x41d604['status']===0x194)return null;throw _0x41d604;}}export async function listCloudProfiles(){const _0x97dad3=await apiRequest('/api/v1/profiles');return _0x97dad3['profiles'];}export async function createCloudProfile(_0xa8073a,_0x5dfd3c,_0x16169a={}){const _0x19cb52=_0x108f,_0xcaa53e={'OZEHc':function(_0xa1721d,_0x1dce93){return _0xa1721d>_0x1dce93;},'PXTgo':function(_0xe643b8,_0x3cd9d5,_0x2b5f6e){return _0xe643b8(_0x3cd9d5,_0x2b5f6e);},'HiZUS':_0x19cb52(0x1e4)},_0x5cd330={'name':_0xa8073a};if(_0x5dfd3c)_0x5cd330['environment_key']=_0x5dfd3c;_0x16169a[_0x19cb52(0x1d0)]&&_0xcaa53e['OZEHc'](Object[_0x19cb52(0x203)](_0x16169a[_0x19cb52(0x1d0)])[_0x19cb52(0x228)],0x0)&&(_0x5cd330[_0x19cb52(0x1d0)]=_0x16169a['settings']);if(_0x16169a[_0x19cb52(0x1ca)])_0x5cd330[_0x19cb52(0x1ca)]=_0x16169a[_0x19cb52(0x1ca)];if(_0x16169a['password'])_0x5cd330['password']=_0x16169a[_0x19cb52(0x1f3)];return await _0xcaa53e['PXTgo'](apiRequest,_0xcaa53e[_0x19cb52(0x1ce)],{'method':_0x19cb52(0x1f1),'body':JSON['stringify'](_0x5cd330)});}export async function uploadCloudProfileSession(_0x24f480,_0x108923){const _0x235308=_0x108f,_0x28a3a9={'mkHTA':function(_0x9f0ab8,_0x5e43c1,_0x3f6775){return _0x9f0ab8(_0x5e43c1,_0x3f6775);},'ylerU':_0x235308(0x1f1)};return await _0x28a3a9[_0x235308(0x1de)](apiRequest,_0x235308(0x1d5)+encodeURIComponent(_0x24f480)+'/session',{'method':_0x28a3a9[_0x235308(0x210)],'body':JSON[_0x235308(0x20c)]({'session_state':_0x108923})});}export async function saveCloudProfileCredentials(_0x472b61,_0x3a5d3f,_0x7b68a9){const _0x5de34a=_0x108f,_0x419fdf={'vjAoe':function(_0x54287b,_0x248e70,_0x275907){return _0x54287b(_0x248e70,_0x275907);},'SqlIZ':function(_0x58f5a6,_0x42b7bb){return _0x58f5a6(_0x42b7bb);},'yKYDU':_0x5de34a(0x1e6)};await _0x419fdf['vjAoe'](apiRequest,_0x5de34a(0x1d5)+_0x419fdf[_0x5de34a(0x1f6)](encodeURIComponent,_0x472b61),{'method':_0x419fdf['yKYDU'],'body':JSON['stringify']({'username':_0x3a5d3f,'password':_0x7b68a9})});}export async function fetchAuthConfig(){const _0x20ac9f=_0x108f,_0x2144b8={'qxlQM':'/api/v1/profiles/auth-config'};try{const _0x28ae7a=await apiRequest(_0x2144b8[_0x20ac9f(0x1fb)]);return _0x28ae7a['auth_config'];}catch{return null;}}export function pickAdHocEnvKey(_0x27568a){const _0x18843d=_0x108f,_0x156354={'QPwQh':function(_0x13ddf1,_0x4fe594){return _0x13ddf1===_0x4fe594;}};if(!_0x27568a)return null;if(_0x27568a[_0x18843d(0x1f8)])return _0x27568a[_0x18843d(0x1f8)];const _0x3df48b=Object[_0x18843d(0x203)](_0x27568a['environments']??{});if(_0x3df48b[_0x18843d(0x228)]===0x1)return _0x3df48b[0x0];if(_0x156354['QPwQh'](_0x3df48b['length'],0x0))return null;throw new Error(_0x18843d(0x22f)+_0x3df48b['join'](',\x20')+_0x18843d(0x201)+'Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.');}export async function resolveAdHocProfile(_0x1a3e0e=process[_0x23c1b4(0x208)]){const _0x40ec27=_0x23c1b4,_0x471024={'gELrN':function(_0x483827,_0x1e9698){return _0x483827(_0x1e9698);}},_0x22903a=_0x1a3e0e[_0x40ec27(0x230)];if(!_0x22903a)return null;const _0x10695e=await fetchCloudProfile(_0x22903a);if(_0x10695e)return{'name':_0x10695e['name'],'profile':_0x10695e};const _0x57dead=await fetchAuthConfig(),_0x47fd14=_0x471024['gELrN'](pickAdHocEnvKey,_0x57dead),_0x5ef3e0=_0x1a3e0e[_0x40ec27(0x204)],_0x45384f=await createCloudProfile(_0x22903a,_0x47fd14??undefined,{'username':_0x22903a,'password':_0x5ef3e0});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x45384f['name']+_0x40ec27(0x207)+_0x22903a),{'name':_0x45384f[_0x40ec27(0x215)],'profile':_0x45384f};}export async function writeSessionToLocalCache(_0x2fa8f9,_0x2f0ed9,_0x9735e,_0x3a092b,_0x3b5a31,_0x2c9acf,_0x4e8407){const _0x257273=_0x23c1b4,_0x49dda5={'zuUZS':function(_0x358e03,_0x46a22d,_0x239610){return _0x358e03(_0x46a22d,_0x239610);},'kPpKJ':function(_0x3b2c41,_0x4ce122){return _0x3b2c41(_0x4ce122);},'VWNjT':function(_0x752e4d,_0x134ce9){return _0x752e4d(_0x134ce9);}},_0x4f5546=sessionCacheHash({'orgId':_0x2f0ed9,'profileName':_0x2fa8f9,'effectiveBaseUrl':_0x9735e,'setupHeaders':_0x3a092b,'sessionDeps':_0x4e8407?.['sessionDeps'],'userAgent':_0x4e8407?.[_0x257273(0x20a)],'clientIp':_0x4e8407?.[_0x257273(0x231)]}),_0x3fc67a=_0x49dda5[_0x257273(0x1f4)](getSessionCachePath,_0x4f5546,_0x2fa8f9),_0x36f621=_0x49dda5[_0x257273(0x1f4)](join,getRangerHomeDir(),_0x257273(0x1c4));!_0x49dda5[_0x257273(0x1ef)](existsSync,_0x36f621)&&await mkdir(_0x36f621,{'recursive':!![]});const _0x3b8abc={..._0x3b5a31};_0x2c9acf&&_0x2c9acf['length']>0x0&&Array[_0x257273(0x206)](_0x3b8abc['cookies'])&&(_0x3b8abc['cookies']=_0x49dda5[_0x257273(0x1f4)](duplicateCookiesForDomains,_0x3b8abc['cookies'],_0x2c9acf));const _0x6e8264={'cached_at':new Date()[_0x257273(0x1c8)](),'session_state':_0x3b8abc};await _0x49dda5['zuUZS'](writeFile,_0x3fc67a,JSON[_0x257273(0x20c)](_0x6e8264,null,0x2));const _0x1030f2=_0x49dda5[_0x257273(0x21f)](getStorageStatePath,_0x3fc67a);return await writeFile(_0x1030f2,JSON[_0x257273(0x20c)](_0x3b8abc,null,0x2)),_0x1030f2;}export async function checkLocalCache(_0x35cc76,_0x3d31c0,_0x177ac5,_0x5db28d,_0x49cf82){const _0x59bf6e=_0x23c1b4,_0x158ea0={'uGcTr':function(_0x5084ae,_0x57ee5f){return _0x5084ae(_0x57ee5f);},'PJYNC':'utf-8'},_0x175de7=_0x158ea0['uGcTr'](sessionCacheHash,{'orgId':_0x3d31c0,'profileName':_0x35cc76,'effectiveBaseUrl':_0x177ac5,'setupHeaders':_0x5db28d,'sessionDeps':_0x49cf82?.['sessionDeps'],'userAgent':_0x49cf82?.[_0x59bf6e(0x20a)],'clientIp':_0x49cf82?.[_0x59bf6e(0x231)]}),_0x2d2721=getSessionCachePath(_0x175de7,_0x35cc76),_0x46f92c=_0x158ea0['uGcTr'](getStorageStatePath,_0x2d2721);if(!_0x158ea0['uGcTr'](existsSync,_0x2d2721)||!_0x158ea0[_0x59bf6e(0x22a)](existsSync,_0x46f92c))return null;try{const _0x4da196=await readFile(_0x2d2721,_0x158ea0[_0x59bf6e(0x217)]);return JSON[_0x59bf6e(0x200)](_0x4da196),{'storageStatePath':_0x46f92c};}catch{return null;}}function launchRealBrowser(){const _0x3f6686=_0x23c1b4;return chromium[_0x3f6686(0x1f7)]({'headless':!![]});}export async function serverSideLogin(_0x34ad3d,_0x5a5e7c){const _0x50f6bf=_0x23c1b4,_0x15a840={'MnZuI':function(_0x4d352f,_0x4dd368){return _0x4d352f===_0x4dd368;}},_0x36b2fa=process[_0x50f6bf(0x208)]['RANGER_TEST_USERNAME'],_0x41aa4e=process['env'][_0x50f6bf(0x204)],_0x52246b={};if(_0x36b2fa)_0x52246b[_0x50f6bf(0x1ca)]=_0x36b2fa;if(_0x41aa4e)_0x52246b[_0x50f6bf(0x1f3)]=_0x41aa4e;if(_0x5a5e7c?.[_0x50f6bf(0x214)])_0x52246b['force']=!![];try{return await apiRequest(_0x50f6bf(0x1d5)+encodeURIComponent(_0x34ad3d)+_0x50f6bf(0x1ec),{'method':_0x50f6bf(0x1f1),'body':JSON['stringify'](_0x52246b)});}catch(_0x3bbc82){if(_0x3bbc82 instanceof ApiError&&_0x3bbc82[_0x50f6bf(0x22b)]===0x190&&_0x15a840[_0x50f6bf(0x1d1)](_0x3bbc82['code'],'not_configured'))return{'status':'not_configured','error':_0x3bbc82['detail']};throw _0x3bbc82;}}export async function manualBrowserLogin(_0x5e25f3,_0xc9f8ff){const _0x409e5d=_0x23c1b4,_0x4f0ed3={'PlogQ':function(_0x2e1208,_0x2238a7){return _0x2e1208(_0x2238a7);},'Yehxn':function(_0x5f2ed6,_0x308d37,_0x37a56c){return _0x5f2ed6(_0x308d37,_0x37a56c);},'Thwto':_0x409e5d(0x232),'kPDLY':function(_0x527c8f){return _0x527c8f();},'ozfjd':function(_0x1de507,_0x5a746a){return _0x1de507+_0x5a746a;},'zGoQZ':'about:blank','CwQkC':'\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','kucVG':_0x409e5d(0x1d3),'ljElJ':function(_0x43f99e,_0x8b8213){return _0x43f99e&&_0x8b8213;},'QEsqu':'Browser\x20login\x20timed\x20out\x20before\x20completion.','RKGJe':_0x409e5d(0x1f1)};if(!_0x4f0ed3[_0x409e5d(0x22e)](isInteractive))throw new Error(_0x4f0ed3[_0x409e5d(0x20f)](_0x4f0ed3['ozfjd'](_0x409e5d(0x1e8)+_0x5e25f3['name']+'\x22.\x0a','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20'),'loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.'));const _0x14ef4c=_0xc9f8ff&&_0xc9f8ff[_0x409e5d(0x222)]['length']>0x0?_0xc9f8ff[_0x409e5d(0x222)][0x0]:_0x4f0ed3[_0x409e5d(0x1e7)];console['log'](_0x4f0ed3['CwQkC']),console['log'](_0x4f0ed3[_0x409e5d(0x1f0)]),await new Promise(_0x5255a0=>setTimeout(_0x5255a0,0x7d0));const _0x99314d=await chromium[_0x409e5d(0x1f7)]({'headless':![]});let _0x5b5156=null;try{const _0xa12040={'ignoreHTTPSErrors':!![]};_0xc9f8ff?.[_0x409e5d(0x1fc)]&&(_0xa12040[_0x409e5d(0x216)]=_0xc9f8ff['setupHeaders']);const _0x1fe968=await _0x99314d[_0x409e5d(0x1f2)](_0xa12040);await _0x4f0ed3['PlogQ'](addProfileSetupBanner,_0x1fe968);const _0x458edb=await _0x1fe968[_0x409e5d(0x1da)]();await _0x458edb['goto'](_0x14ef4c);let _0x39103d=![];await new Promise(_0xc9180f=>{const _0x362b51=_0x409e5d,_0x2e20b0={'tnvrV':function(_0x351edd){return _0x351edd();}},_0x110767=_0x4f0ed3[_0x362b51(0x21d)](setTimeout,()=>{const _0xaebe81=_0x362b51;_0x39103d=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+MANUAL_LOGIN_TIMEOUT_MS/0xea60+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x2e20b0[_0xaebe81(0x205)](_0xc9180f);},MANUAL_LOGIN_TIMEOUT_MS);_0x458edb['on'](_0x4f0ed3['Thwto'],async()=>{_0x4f0ed3['PlogQ'](clearTimeout,_0x110767);try{const _0x9a4c37=await _0x1fe968['storageState']();_0x5b5156=_0x9a4c37;}catch{}_0xc9180f();});});if(_0x4f0ed3[_0x409e5d(0x22d)](_0x39103d,!_0x5b5156))throw new Error(_0x4f0ed3[_0x409e5d(0x1ed)]);}finally{await _0x99314d['close']()[_0x409e5d(0x209)](()=>{});}if(!_0x5b5156)throw new Error(_0x409e5d(0x212));return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x5e25f3[_0x409e5d(0x215)])+_0x409e5d(0x226),{'method':_0x4f0ed3[_0x409e5d(0x1ee)],'body':JSON['stringify']({'session_state':_0x5b5156,'updated_by':_0x409e5d(0x1f9)})}),{'sessionState':_0x5b5156};}export async function promptSaveCredentials(_0x18fd9d){const _0x4e046b=_0x23c1b4,_0x1b7deb={'dcvvE':function(_0x2b4891){return _0x2b4891();},'XkPgL':function(_0x374d77,_0x3ec773){return _0x374d77(_0x3ec773);},'wgOoc':_0x4e046b(0x1e6),'paPUF':_0x4e046b(0x1d2)},_0x5a69c7=process[_0x4e046b(0x208)]['RANGER_TEST_USERNAME'],_0x1b522e=process['env'][_0x4e046b(0x204)];if(!_0x5a69c7||!_0x1b522e)return;if(!_0x1b7deb['dcvvE'](isInteractive))return;const {save:_0x3dff54}=await _0x211aff['prompt']([{'type':'confirm','name':'save','message':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','default':![]}]);if(!_0x3dff54)return;await apiRequest(_0x4e046b(0x1d5)+_0x1b7deb[_0x4e046b(0x1d6)](encodeURIComponent,_0x18fd9d),{'method':_0x1b7deb['wgOoc'],'body':JSON[_0x4e046b(0x20c)]({'username':_0x5a69c7,'password':_0x1b522e})}),console[_0x4e046b(0x1eb)](_0x1b7deb['paPUF']);}export async function resolveCloudProfileSession(_0xdd6d22,_0x1d130c={}){const _0x1bdf71=_0x23c1b4,_0x408597={'kCAnV':function(_0x2c4efe){return _0x2c4efe();},'OEONd':function(_0x4f05c6,_0x2d34db,_0x33beb1){return _0x4f05c6(_0x2d34db,_0x33beb1);},'JRWRy':function(_0x494a14,_0x47c0c6,_0x510cd8,_0x2d8750,_0x473301){return _0x494a14(_0x47c0c6,_0x510cd8,_0x2d8750,_0x473301);},'iAPNN':function(_0x5dbfde,_0x4aeb90,_0x7f906f,_0x314a09,_0x42e3ae,_0x53d430,_0x354545,_0x33c2d9){return _0x5dbfde(_0x4aeb90,_0x7f906f,_0x314a09,_0x42e3ae,_0x53d430,_0x354545,_0x33c2d9);},'BzOaj':function(_0x31865a,_0xfc3887){return _0x31865a(_0xfc3887);},'KivWq':function(_0x4a3fa2,_0x14e452){return _0x4a3fa2||_0x14e452;},'fIfdE':function(_0x17eb59,_0x3a6a9e){return _0x17eb59===_0x3a6a9e;},'GxlFF':function(_0x46047f,_0x56965a,_0x126ee9,_0x126606,_0x2a4caf,_0x42cca9,_0x40101f,_0x2d567e){return _0x46047f(_0x56965a,_0x126ee9,_0x126606,_0x2a4caf,_0x42cca9,_0x40101f,_0x2d567e);},'mXKsn':function(_0x463c9c,_0x798b9a){return _0x463c9c&&_0x798b9a;},'nkDyr':_0x1bdf71(0x20b),'lAcNE':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','iDffj':function(_0xdc896a,_0x132e72,_0x510774){return _0xdc896a(_0x132e72,_0x510774);}},_0x53ce04=_0xdd6d22['settings']??{},_0x2149a4=await _0x408597[_0x1bdf71(0x21e)](fetchAuthConfig),_0x46bf05=_0x2149a4?_0x408597['OEONd'](resolveAuthEnvironmentLocally,_0x2149a4,_0xdd6d22[_0x1bdf71(0x1cf)]):null,_0x35f89d=_0x46bf05?.['domains'],_0x57f979=_0x53ce04['setupHeaders'],_0x1beede=_0x57f979??_0x46bf05?.[_0x1bdf71(0x1fc)],_0xf5487a=_0x1d130c['effectiveBaseUrl']??_0x53ce04['baseUrl']??(_0x35f89d&&_0x35f89d['length']>0x0?_0x35f89d[0x0]:''),_0x4b63a3={'sessionDeps':_0x46bf05?.[_0x1bdf71(0x20e)],'userAgent':_0x46bf05?.['browserOptions']?.['userAgent']??_0x53ce04['userAgent']},_0x4f6535=await checkLocalCache(_0xdd6d22[_0x1bdf71(0x215)],_0xdd6d22['organizationId'],_0xf5487a,_0x1beede,_0x4b63a3);if(_0x4f6535){if(_0xf5487a){const _0x595706=await _0x408597['JRWRy'](isCachedSessionLive,_0x4f6535[_0x1bdf71(0x220)],_0xf5487a,{'sessionCheckPath':_0x46bf05?.[_0x1bdf71(0x1d7)],'setupHeaders':_0x1beede},{'launchBrowser':launchRealBrowser});if(_0x595706)return console[_0x1bdf71(0x1eb)](_0x1bdf71(0x211)+_0xdd6d22['name']+'\x22'),{'authPath':_0x4f6535['storageStatePath'],'settings':_0x53ce04,'resolvedEnv':_0x46bf05};console[_0x1bdf71(0x1eb)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0xdd6d22[_0x1bdf71(0x215)]+_0x1bdf71(0x1ff));}else return{'authPath':_0x4f6535[_0x1bdf71(0x220)],'settings':_0x53ce04,'resolvedEnv':_0x46bf05};}if(_0xdd6d22['sessionState']){const _0x144aab=await _0x408597[_0x1bdf71(0x1c7)](writeSessionToLocalCache,_0xdd6d22['name'],_0xdd6d22['organizationId'],_0xf5487a,_0x1beede,_0xdd6d22[_0x1bdf71(0x1fd)],_0x35f89d,_0x4b63a3);if(_0xf5487a){const _0x2893ad=await isCachedSessionLive(_0x144aab,_0xf5487a,{'sessionCheckPath':_0x46bf05?.['sessionCheckPath'],'setupHeaders':_0x1beede},{'launchBrowser':launchRealBrowser});if(_0x2893ad)return console['log'](_0x1bdf71(0x213)+_0xdd6d22[_0x1bdf71(0x215)]+'\x22,\x20cached\x20locally'),{'authPath':_0x144aab,'settings':_0x53ce04,'resolvedEnv':_0x46bf05};console[_0x1bdf71(0x1eb)](_0x1bdf71(0x202)+_0xdd6d22[_0x1bdf71(0x215)]+_0x1bdf71(0x223));}else return{'authPath':_0x144aab,'settings':_0x53ce04,'resolvedEnv':_0x46bf05};}console[_0x1bdf71(0x1eb)](_0x1bdf71(0x1c9)+_0xdd6d22['name']+_0x1bdf71(0x218));const _0x1a70e6=Boolean(process[_0x1bdf71(0x208)][_0x1bdf71(0x230)])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x23e8a9=_0x408597[_0x1bdf71(0x1dd)](Boolean,_0xdd6d22['username']);if(_0x408597['KivWq'](_0x1a70e6,_0x23e8a9))try{const _0x267754=await serverSideLogin(_0xdd6d22[_0x1bdf71(0x215)]);if(_0x408597['fIfdE'](_0x267754[_0x1bdf71(0x22b)],'not_configured'))console['log']('\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...');else{if(_0x408597[_0x1bdf71(0x21a)](_0x267754[_0x1bdf71(0x22b)],'success')&&_0x267754['session_state']){console[_0x1bdf71(0x1eb)](_0x1bdf71(0x1fe));const _0x20bc2c=await _0x408597[_0x1bdf71(0x1cc)](writeSessionToLocalCache,_0xdd6d22[_0x1bdf71(0x215)],_0xdd6d22[_0x1bdf71(0x1d4)],_0xf5487a,_0x1beede,_0x267754['session_state'],_0x35f89d,_0x4b63a3);return _0x408597[_0x1bdf71(0x1fa)](_0x1a70e6,!_0x23e8a9)&&await promptSaveCredentials(_0xdd6d22[_0x1bdf71(0x215)]),{'authPath':_0x20bc2c,'settings':_0x53ce04,'resolvedEnv':_0x46bf05};}else _0x267754['test_output']&&(console['log'](_0x408597[_0x1bdf71(0x1db)]),console['log'](_0x267754['test_output'])),console[_0x1bdf71(0x1eb)](_0x408597[_0x1bdf71(0x20d)]);}}catch(_0x429edb){console[_0x1bdf71(0x1eb)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x429edb instanceof Error?_0x429edb[_0x1bdf71(0x1e9)]:String(_0x429edb))),console['log'](_0x408597['lAcNE']);}const {sessionState:_0x20f330}=await _0x408597[_0x1bdf71(0x1df)](manualBrowserLogin,_0xdd6d22,_0x46bf05),_0x435733=await writeSessionToLocalCache(_0xdd6d22['name'],_0xdd6d22[_0x1bdf71(0x1d4)],_0xf5487a,_0x1beede,_0x20f330,_0x35f89d,_0x4b63a3);return{'authPath':_0x435733,'settings':_0x53ce04,'resolvedEnv':_0x46bf05};}
1
+ (function(_0x45e95c,_0x40d609){const _0x281d28=_0x2e9d,_0x323525=_0x45e95c();while(!![]){try{const _0x4f4920=parseInt(_0x281d28(0x13a))/0x1+-parseInt(_0x281d28(0x170))/0x2*(-parseInt(_0x281d28(0x13d))/0x3)+-parseInt(_0x281d28(0x140))/0x4*(parseInt(_0x281d28(0x146))/0x5)+-parseInt(_0x281d28(0x165))/0x6*(-parseInt(_0x281d28(0x171))/0x7)+-parseInt(_0x281d28(0x177))/0x8*(-parseInt(_0x281d28(0x141))/0x9)+-parseInt(_0x281d28(0x18b))/0xa+-parseInt(_0x281d28(0x14e))/0xb*(-parseInt(_0x281d28(0x179))/0xc);if(_0x4f4920===_0x40d609)break;else _0x323525['push'](_0x323525['shift']());}catch(_0x88fd8f){_0x323525['push'](_0x323525['shift']());}}}(_0xc673,0xb4d83));import{readFile,writeFile,mkdir}from'fs/promises';function _0xc673(){const _0x2cfeb7=['test_output','error','confirm','ePgVJ','/api/v1/profiles/','POST','GqsOI','join','MXdzc','WCGrT','storageStatePath','qfegy','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','7715470gTYYMo','newContext','username','ZxjOI','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','RjJwF','Ugdgj','EaSzI','message','code','OxSNM','utf-8','settings','log','lGVkM','saZSj','password','tlHXm','\x20\x20Cached\x20session\x20for\x20\x22','close','RANGER_TEST_PASSWORD','Bearer\x20','stringify','\x22\x20failed\x20validation\x20—\x20refreshing...','\x20\x20Login\x20successful.\x20Session\x20cached.','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','status','Browser\x20login\x20timed\x20out\x20before\x20completion.','goto','\x22,\x20attempting\x20login...','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','706464ObQewe','catch','domains','3022059WqbLin','RANGER_TEST_USERNAME','auth_config','4zyoOmj','3630168ELEYcp','environments','defaultEnvironmentKey','HtyyG','LHNPx','6991295oOvUuP','string','setupHeaders','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ecdmd','PWDAh','detail','273086bbFHGH','wIoLy','about:blank','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','AjbYo','PUT','zQUaT','isArray','save','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','ibtSx','sessionState','uBZwV','force','Browser\x20login\x20timed\x20out\x20after\x20','not_configured','organizationId','environmentKey','cTovd','\x22,\x20cached\x20locally','length','QTqfM','3121740VmfWmp','userAgent','environment_key','viavz','json','TmspA','headers','statusText','env','\x20\x20Created\x20cloud\x20profile\x20\x22','ZTJJU','2ctLolR','7gVpEQJ','launch','name','baseUrl','auth','iahCh','8UUFDyT','browserOptions','132DRcWhP','Yjkxk','sessionCheckPath','clientIp','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'];_0xc673=function(){return _0x2cfeb7;};return _0xc673();}import{join}from'path';import{existsSync}from'fs';import _0x16393f from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';function _0x2e9d(_0x4ff6f4,_0x11ebd5){_0x4ff6f4=_0x4ff6f4-0x127;const _0xc67374=_0xc673();let _0x2e9d13=_0xc67374[_0x4ff6f4];return _0x2e9d13;}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 _0x3bb079=_0x2e9d,_0x2eb845={'PWDAh':function(_0x151229){return _0x151229();}},_0x2b23fb=await _0x2eb845[_0x3bb079(0x14c)](getToken);if(!_0x2b23fb)throw new Error(_0x3bb079(0x14a));return _0x2b23fb;}async function apiRequest(_0x2734c9,_0x2e80cd={}){const _0x3f9147=_0x2e9d,_0x22e22e={'nOHnK':function(_0xfd4473){return _0xfd4473();},'Glqvb':function(_0x31503f,_0x42dc92,_0x8e31f){return _0x31503f(_0x42dc92,_0x8e31f);},'iahCh':'application/json','PPJdq':_0x3f9147(0x147),'pDINw':function(_0xb6367d,_0x4eaf95){return _0xb6367d===_0x4eaf95;}},_0x4b3a0d=await requireToken(),_0x135b45=_0x22e22e['nOHnK'](getApiBaseUrl),_0x237603=await _0x22e22e['Glqvb'](fetch,''+_0x135b45+_0x2734c9,{..._0x2e80cd,'headers':{'Authorization':_0x3f9147(0x12f)+_0x4b3a0d,'Content-Type':_0x22e22e[_0x3f9147(0x176)],..._0x2e80cd[_0x3f9147(0x16b)]??{}}});if(!_0x237603['ok']){let _0x2b9cc8='',_0x230242;try{const _0xe3efdc=await _0x237603[_0x3f9147(0x169)]();_0x2b9cc8=(typeof _0xe3efdc['error']===_0x22e22e['PPJdq']?_0xe3efdc[_0x3f9147(0x17f)]:undefined)??JSON[_0x3f9147(0x130)](_0xe3efdc);if(_0x22e22e['pDINw'](typeof _0xe3efdc[_0x3f9147(0x194)],'string'))_0x230242=_0xe3efdc[_0x3f9147(0x194)];}catch{_0x2b9cc8=_0x237603[_0x3f9147(0x16c)];}throw new ApiError('API\x20request\x20'+_0x2734c9+'\x20failed\x20('+_0x237603['status']+'):\x20'+_0x2b9cc8,_0x237603['status'],_0x2b9cc8,_0x230242);}return _0x237603[_0x3f9147(0x169)]();}export class ApiError extends Error{['status'];['detail'];['code'];constructor(_0x4df941,_0x1ee065,_0x3f3010,_0x438955){const _0x323101=_0x2e9d,_0x5e1373={'TvYzq':'ApiError'};super(_0x4df941),this['status']=_0x1ee065,this[_0x323101(0x14d)]=_0x3f3010,this['code']=_0x438955,this[_0x323101(0x173)]=_0x5e1373['TvYzq'];}}export async function fetchCloudProfile(_0x2085cf){const _0x412b14=_0x2e9d,_0x74d8a6={'Ugdgj':function(_0x30c686,_0x55f34f){return _0x30c686(_0x55f34f);}};try{return await _0x74d8a6[_0x412b14(0x191)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x2085cf));}catch(_0x564e6a){if(_0x564e6a instanceof ApiError&&_0x564e6a['status']===0x194)return null;throw _0x564e6a;}}export async function listCloudProfiles(){const _0x51e2a1=_0x2e9d,_0x343305={'ewPRI':function(_0x474ad1,_0x105554){return _0x474ad1(_0x105554);},'QTqfM':'/api/v1/profiles'},_0x4f3826=await _0x343305['ewPRI'](apiRequest,_0x343305[_0x51e2a1(0x164)]);return _0x4f3826['profiles'];}export async function createCloudProfile(_0x494415,_0x578a09,_0x4d76a2={}){const _0x5cf18c=_0x2e9d,_0x33e160={'name':_0x494415};if(_0x578a09)_0x33e160[_0x5cf18c(0x167)]=_0x578a09;_0x4d76a2[_0x5cf18c(0x197)]&&Object['keys'](_0x4d76a2['settings'])['length']>0x0&&(_0x33e160[_0x5cf18c(0x197)]=_0x4d76a2[_0x5cf18c(0x197)]);if(_0x4d76a2[_0x5cf18c(0x18d)])_0x33e160['username']=_0x4d76a2['username'];if(_0x4d76a2['password'])_0x33e160['password']=_0x4d76a2['password'];return await apiRequest('/api/v1/profiles',{'method':'POST','body':JSON['stringify'](_0x33e160)});}export async function uploadCloudProfileSession(_0x371250,_0x4a157c){const _0x4c366f=_0x2e9d,_0x353bc1={'ZTJJU':function(_0x275e20,_0x2edfdc,_0x11eda7){return _0x275e20(_0x2edfdc,_0x11eda7);},'cANjw':_0x4c366f(0x183)};return await _0x353bc1[_0x4c366f(0x16f)](apiRequest,_0x4c366f(0x182)+encodeURIComponent(_0x371250)+'/session',{'method':_0x353bc1['cANjw'],'body':JSON['stringify']({'session_state':_0x4a157c})});}export async function saveCloudProfileCredentials(_0x52204e,_0xa3eac8,_0x55ca96){const _0x572185=_0x2e9d,_0x4308f6={'cTovd':function(_0x5c2e85,_0x1c3fb2,_0x4cde56){return _0x5c2e85(_0x1c3fb2,_0x4cde56);},'viavz':_0x572185(0x154)};await _0x4308f6[_0x572185(0x161)](apiRequest,_0x572185(0x182)+encodeURIComponent(_0x52204e),{'method':_0x4308f6[_0x572185(0x168)],'body':JSON['stringify']({'username':_0xa3eac8,'password':_0x55ca96})});}export async function fetchAuthConfig(){const _0x3a5a8a=_0x2e9d,_0x3c0419={'eebNn':function(_0x1c83c5,_0x543e3b){return _0x1c83c5(_0x543e3b);}};try{const _0x492a64=await _0x3c0419['eebNn'](apiRequest,'/api/v1/profiles/auth-config');return _0x492a64[_0x3a5a8a(0x13f)];}catch{return null;}}export function pickAdHocEnvKey(_0x412b7c){const _0x1b5a89=_0x2e9d,_0x5a60db={'uBZwV':function(_0x5b3f8c,_0x198089){return _0x5b3f8c===_0x198089;},'Qoasr':function(_0x16ab27,_0x47e1e1){return _0x16ab27+_0x47e1e1;}};if(!_0x412b7c)return null;if(_0x412b7c[_0x1b5a89(0x143)])return _0x412b7c['defaultEnvironmentKey'];const _0x280851=Object['keys'](_0x412b7c[_0x1b5a89(0x142)]??{});if(_0x5a60db['uBZwV'](_0x280851['length'],0x1))return _0x280851[0x0];if(_0x5a60db[_0x1b5a89(0x15b)](_0x280851[_0x1b5a89(0x163)],0x0))return null;throw new Error(_0x5a60db['Qoasr']('Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20('+_0x280851[_0x1b5a89(0x185)](',\x20')+').\x20','Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.'));}export async function resolveAdHocProfile(_0x2bdd71=process['env']){const _0x591e36=_0x2e9d,_0x49bd51={'qfegy':function(_0x39e575,_0x53f05b){return _0x39e575(_0x53f05b);},'WCGrT':function(_0x3ba536,_0x2e0e9c,_0x1e5fa2,_0x350bed){return _0x3ba536(_0x2e0e9c,_0x1e5fa2,_0x350bed);}},_0x8037e1=_0x2bdd71[_0x591e36(0x13e)];if(!_0x8037e1)return null;const _0x3e91a5=await fetchCloudProfile(_0x8037e1);if(_0x3e91a5)return{'name':_0x3e91a5['name'],'profile':_0x3e91a5};const _0x21a9b9=await fetchAuthConfig(),_0x5e5b36=_0x49bd51[_0x591e36(0x189)](pickAdHocEnvKey,_0x21a9b9),_0x1f95e9=_0x2bdd71['RANGER_TEST_PASSWORD'],_0x3d5aff=await _0x49bd51[_0x591e36(0x187)](createCloudProfile,_0x8037e1,_0x5e5b36??undefined,{'username':_0x8037e1,'password':_0x1f95e9});return console[_0x591e36(0x127)](_0x591e36(0x16e)+_0x3d5aff['name']+'\x22\x20for\x20'+_0x8037e1),{'name':_0x3d5aff['name'],'profile':_0x3d5aff};}export async function writeSessionToLocalCache(_0x1058b8,_0x5ebe3e,_0xf6bec1,_0x3d71bf,_0x276bf6,_0x3b5bae,_0x3147ef){const _0x86a121=_0x2e9d,_0x4d5cb5={'RjJwF':function(_0x3a1f66,_0x1d67c5,_0x5d384c){return _0x3a1f66(_0x1d67c5,_0x5d384c);},'YZgqw':function(_0xcfd2d3,_0xed18d2){return _0xcfd2d3>_0xed18d2;},'zQUaT':function(_0x20ce36,_0x5893f6){return _0x20ce36(_0x5893f6);},'baacS':function(_0x34288f,_0x263224,_0xac244){return _0x34288f(_0x263224,_0xac244);}},_0x2f22b4=sessionCacheHash({'orgId':_0x5ebe3e,'profileName':_0x1058b8,'effectiveBaseUrl':_0xf6bec1,'setupHeaders':_0x3d71bf,'sessionDeps':_0x3147ef?.['sessionDeps'],'userAgent':_0x3147ef?.['userAgent'],'clientIp':_0x3147ef?.[_0x86a121(0x17c)]}),_0x310255=_0x4d5cb5['RjJwF'](getSessionCachePath,_0x2f22b4,_0x1058b8),_0x4fbf86=join(getRangerHomeDir(),_0x86a121(0x175));!existsSync(_0x4fbf86)&&await mkdir(_0x4fbf86,{'recursive':!![]});const _0x415ab6={..._0x276bf6};_0x3b5bae&&_0x4d5cb5['YZgqw'](_0x3b5bae['length'],0x0)&&Array[_0x86a121(0x156)](_0x415ab6['cookies'])&&(_0x415ab6['cookies']=_0x4d5cb5['RjJwF'](duplicateCookiesForDomains,_0x415ab6['cookies'],_0x3b5bae));const _0x141fc2={'cached_at':new Date()['toISOString'](),'session_state':_0x415ab6};await _0x4d5cb5[_0x86a121(0x190)](writeFile,_0x310255,JSON['stringify'](_0x141fc2,null,0x2));const _0x1de330=_0x4d5cb5[_0x86a121(0x155)](getStorageStatePath,_0x310255);return await _0x4d5cb5['baacS'](writeFile,_0x1de330,JSON[_0x86a121(0x130)](_0x415ab6,null,0x2)),_0x1de330;}export async function checkLocalCache(_0x204c3a,_0x253a89,_0x592839,_0x515421,_0x4763a5){const _0x3aee8a=_0x2e9d,_0x372bd1={'ophuA':function(_0x3291f8,_0x50c38d,_0x37a76f){return _0x3291f8(_0x50c38d,_0x37a76f);},'wIoLy':function(_0x3efcd7,_0x1f173b){return _0x3efcd7(_0x1f173b);}},_0x3a24c9=sessionCacheHash({'orgId':_0x253a89,'profileName':_0x204c3a,'effectiveBaseUrl':_0x592839,'setupHeaders':_0x515421,'sessionDeps':_0x4763a5?.['sessionDeps'],'userAgent':_0x4763a5?.[_0x3aee8a(0x166)],'clientIp':_0x4763a5?.['clientIp']}),_0x399245=_0x372bd1['ophuA'](getSessionCachePath,_0x3a24c9,_0x204c3a),_0x26997f=getStorageStatePath(_0x399245);if(!existsSync(_0x399245)||!_0x372bd1[_0x3aee8a(0x14f)](existsSync,_0x26997f))return null;try{const _0x2f368c=await readFile(_0x399245,_0x3aee8a(0x196));return JSON['parse'](_0x2f368c),{'storageStatePath':_0x26997f};}catch{return null;}}function launchRealBrowser(){const _0xfead2a=_0x2e9d;return chromium[_0xfead2a(0x172)]({'headless':!![]});}export async function serverSideLogin(_0x41ec10,_0x41226c){const _0x26585f=_0x2e9d,_0x357c3a={'lIPQO':function(_0x1fea28,_0x596220,_0x4d0759){return _0x1fea28(_0x596220,_0x4d0759);},'HtyyG':function(_0x42f458,_0x35d02a){return _0x42f458 instanceof _0x35d02a;},'WyrIX':function(_0x3ba5a3,_0x5a9a38){return _0x3ba5a3===_0x5a9a38;},'AjbYo':'not_configured'},_0x4b8749=process['env'][_0x26585f(0x13e)],_0x50aa00=process[_0x26585f(0x16d)][_0x26585f(0x12e)],_0x40767f={};if(_0x4b8749)_0x40767f[_0x26585f(0x18d)]=_0x4b8749;if(_0x50aa00)_0x40767f[_0x26585f(0x12a)]=_0x50aa00;if(_0x41226c?.[_0x26585f(0x15c)])_0x40767f['force']=!![];try{return await _0x357c3a['lIPQO'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x41ec10)+'/login',{'method':_0x26585f(0x183),'body':JSON[_0x26585f(0x130)](_0x40767f)});}catch(_0x45dd99){if(_0x357c3a[_0x26585f(0x144)](_0x45dd99,ApiError)&&_0x45dd99[_0x26585f(0x134)]===0x190&&_0x357c3a['WyrIX'](_0x45dd99[_0x26585f(0x194)],_0x357c3a[_0x26585f(0x153)]))return{'status':_0x26585f(0x15e),'error':_0x45dd99['detail']};throw _0x45dd99;}}export async function manualBrowserLogin(_0x3f6624,_0x16d9d0){const _0x445a73=_0x2e9d,_0x307586={'IscZk':function(_0x5df17f,_0x287088){return _0x5df17f(_0x287088);},'gCsAB':function(_0x251d4b){return _0x251d4b();},'LHNPx':function(_0x273ed5,_0x1ead97){return _0x273ed5+_0x1ead97;},'BLmcl':'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','xdfXw':function(_0x59c9fb,_0x4cfe24){return _0x59c9fb&&_0x4cfe24;},'ZzDpG':_0x445a73(0x135),'saZSj':_0x445a73(0x152),'lGVkM':function(_0x596d7a,_0xe4319,_0x4419c4){return _0x596d7a(_0xe4319,_0x4419c4);}};if(!isInteractive())throw new Error(_0x307586[_0x445a73(0x145)](_0x445a73(0x133)+_0x3f6624['name']+'\x22.\x0a'+_0x307586['BLmcl'],'loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.'));const _0x4cd308=_0x16d9d0&&_0x16d9d0[_0x445a73(0x13c)]['length']>0x0?_0x16d9d0['domains'][0x0]:_0x445a73(0x150);console['log'](_0x445a73(0x139)),console['log'](_0x445a73(0x18f)),await new Promise(_0x7f2f0d=>setTimeout(_0x7f2f0d,0x7d0));const _0x5a7269=await chromium['launch']({'headless':![]});let _0x320a92=null;try{const _0x431fe8={'ignoreHTTPSErrors':!![]};_0x16d9d0?.[_0x445a73(0x148)]&&(_0x431fe8['extraHTTPHeaders']=_0x16d9d0[_0x445a73(0x148)]);const _0x2e8926=await _0x5a7269[_0x445a73(0x18c)](_0x431fe8);await addProfileSetupBanner(_0x2e8926);const _0x4ff129=await _0x2e8926['newPage']();await _0x4ff129[_0x445a73(0x136)](_0x4cd308);let _0x523acb=![];await new Promise(_0x21b7ca=>{const _0x4e0c27=_0x445a73,_0x3f95e7={'OxSNM':function(_0xca46b7,_0xb20ebe){return _0x307586['IscZk'](_0xca46b7,_0xb20ebe);},'Uihzh':function(_0x28d569){return _0x307586['gCsAB'](_0x28d569);}},_0x1011d6=setTimeout(()=>{const _0x457ce8=_0x2e9d;_0x523acb=!![],console[_0x457ce8(0x17f)](_0x457ce8(0x15d)+MANUAL_LOGIN_TIMEOUT_MS/0xea60+_0x457ce8(0x138)),_0x21b7ca();},MANUAL_LOGIN_TIMEOUT_MS);_0x4ff129['on'](_0x4e0c27(0x12d),async()=>{const _0x42821e=_0x4e0c27;_0x3f95e7[_0x42821e(0x195)](clearTimeout,_0x1011d6);try{const _0x1a23ee=await _0x2e8926['storageState']();_0x320a92=_0x1a23ee;}catch{}_0x3f95e7['Uihzh'](_0x21b7ca);});});if(_0x307586['xdfXw'](_0x523acb,!_0x320a92))throw new Error(_0x307586['ZzDpG']);}finally{await _0x5a7269[_0x445a73(0x12d)]()[_0x445a73(0x13b)](()=>{});}if(!_0x320a92)throw new Error(_0x307586[_0x445a73(0x129)]);return await _0x307586[_0x445a73(0x128)](apiRequest,_0x445a73(0x182)+encodeURIComponent(_0x3f6624[_0x445a73(0x173)])+'/session',{'method':_0x445a73(0x183),'body':JSON[_0x445a73(0x130)]({'session_state':_0x320a92,'updated_by':'cli:manual-login'})}),{'sessionState':_0x320a92};}export async function promptSaveCredentials(_0x4379a5){const _0x24b938=_0x2e9d,_0x11c593={'ePgVJ':function(_0x1b081b,_0x311e9a){return _0x1b081b||_0x311e9a;},'VIoNb':_0x24b938(0x180),'TmspA':_0x24b938(0x158),'FuIku':function(_0x4ffc18,_0x345591,_0x2e8a2f){return _0x4ffc18(_0x345591,_0x2e8a2f);},'EaSzI':function(_0x2c739c,_0x48a620){return _0x2c739c(_0x48a620);}},_0x40e34b=process['env'][_0x24b938(0x13e)],_0x362057=process['env']['RANGER_TEST_PASSWORD'];if(_0x11c593[_0x24b938(0x181)](!_0x40e34b,!_0x362057))return;if(!isInteractive())return;const {save:_0x57e3a9}=await _0x16393f['prompt']([{'type':_0x11c593['VIoNb'],'name':_0x24b938(0x157),'message':_0x11c593[_0x24b938(0x16a)],'default':![]}]);if(!_0x57e3a9)return;await _0x11c593['FuIku'](apiRequest,_0x24b938(0x182)+_0x11c593[_0x24b938(0x192)](encodeURIComponent,_0x4379a5),{'method':'PUT','body':JSON[_0x24b938(0x130)]({'username':_0x40e34b,'password':_0x362057})}),console[_0x24b938(0x127)](_0x24b938(0x151));}export async function resolveCloudProfileSession(_0x18b379,_0x31748b={}){const _0x38a45f=_0x2e9d,_0x548adf={'DjBkQ':function(_0x5a5816,_0x230a0a,_0xf42569){return _0x5a5816(_0x230a0a,_0xf42569);},'tlHXm':function(_0x517b1b,_0x4efbe6){return _0x517b1b>_0x4efbe6;},'GqsOI':function(_0x2fb348,_0x5b86fc,_0x3c471f,_0x2b4389,_0x15d665,_0x2f943e){return _0x2fb348(_0x5b86fc,_0x3c471f,_0x2b4389,_0x15d665,_0x2f943e);},'ibtSx':function(_0x4a7aa2,_0x5eed84,_0xf90e7d,_0x7c4d87,_0x4d2be3){return _0x4a7aa2(_0x5eed84,_0xf90e7d,_0x7c4d87,_0x4d2be3);},'MXdzc':function(_0x41b8ea,_0x32535c){return _0x41b8ea(_0x32535c);},'EBWbk':function(_0x557792,_0x190d76){return _0x557792||_0x190d76;},'xYmcw':'not_configured','bcwTz':'\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','Xemfo':function(_0x133276,_0x280781){return _0x133276===_0x280781;},'Yjkxk':function(_0x173e2e,_0x147316,_0xc5fe19,_0x3c4ac7,_0x1c4574,_0x1e350c,_0x2f92ba,_0x1bc677){return _0x173e2e(_0x147316,_0xc5fe19,_0x3c4ac7,_0x1c4574,_0x1e350c,_0x2f92ba,_0x1bc677);},'ZxjOI':function(_0x4e9b09,_0x28dc19){return _0x4e9b09(_0x28dc19);},'dKkhh':function(_0x5529e1,_0xb5ce35){return _0x5529e1 instanceof _0xb5ce35;},'zrMVx':function(_0x3336e5,_0x5411c1){return _0x3336e5(_0x5411c1);},'ecdmd':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...'},_0x2f2890=_0x18b379['settings']??{},_0x125ceb=await fetchAuthConfig(),_0x226fca=_0x125ceb?_0x548adf['DjBkQ'](resolveAuthEnvironmentLocally,_0x125ceb,_0x18b379[_0x38a45f(0x160)]):null,_0x59e9b4=_0x226fca?.['domains'],_0x19e84e=_0x2f2890['setupHeaders'],_0x4a5a48=_0x19e84e??_0x226fca?.['setupHeaders'],_0x1701f5=_0x31748b['effectiveBaseUrl']??_0x2f2890[_0x38a45f(0x174)]??(_0x59e9b4&&_0x548adf[_0x38a45f(0x12b)](_0x59e9b4[_0x38a45f(0x163)],0x0)?_0x59e9b4[0x0]:''),_0x4601d9={'sessionDeps':_0x226fca?.['sessionDeps'],'userAgent':_0x226fca?.[_0x38a45f(0x178)]?.['userAgent']??_0x2f2890[_0x38a45f(0x166)]},_0x2d7c60=await _0x548adf[_0x38a45f(0x184)](checkLocalCache,_0x18b379[_0x38a45f(0x173)],_0x18b379[_0x38a45f(0x15f)],_0x1701f5,_0x4a5a48,_0x4601d9);if(_0x2d7c60){if(_0x1701f5){const _0x4f88ed=await _0x548adf['ibtSx'](isCachedSessionLive,_0x2d7c60['storageStatePath'],_0x1701f5,{'sessionCheckPath':_0x226fca?.[_0x38a45f(0x17b)],'setupHeaders':_0x4a5a48},{'launchBrowser':launchRealBrowser});if(_0x4f88ed)return console[_0x38a45f(0x127)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x18b379[_0x38a45f(0x173)]+'\x22'),{'authPath':_0x2d7c60['storageStatePath'],'settings':_0x2f2890,'resolvedEnv':_0x226fca};console[_0x38a45f(0x127)](_0x38a45f(0x12c)+_0x18b379['name']+_0x38a45f(0x131));}else return{'authPath':_0x2d7c60[_0x38a45f(0x188)],'settings':_0x2f2890,'resolvedEnv':_0x226fca};}if(_0x18b379['sessionState']){const _0x289010=await writeSessionToLocalCache(_0x18b379[_0x38a45f(0x173)],_0x18b379[_0x38a45f(0x15f)],_0x1701f5,_0x4a5a48,_0x18b379[_0x38a45f(0x15a)],_0x59e9b4,_0x4601d9);if(_0x1701f5){const _0x3c981f=await _0x548adf[_0x38a45f(0x159)](isCachedSessionLive,_0x289010,_0x1701f5,{'sessionCheckPath':_0x226fca?.['sessionCheckPath'],'setupHeaders':_0x4a5a48},{'launchBrowser':launchRealBrowser});if(_0x3c981f)return console[_0x38a45f(0x127)](_0x38a45f(0x17d)+_0x18b379['name']+_0x38a45f(0x162)),{'authPath':_0x289010,'settings':_0x2f2890,'resolvedEnv':_0x226fca};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x18b379['name']+_0x38a45f(0x149));}else return{'authPath':_0x289010,'settings':_0x2f2890,'resolvedEnv':_0x226fca};}console[_0x38a45f(0x127)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x18b379['name']+_0x38a45f(0x137));const _0x3c5d8e=_0x548adf[_0x38a45f(0x186)](Boolean,process['env']['RANGER_TEST_USERNAME'])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0xdb9ff3=Boolean(_0x18b379[_0x38a45f(0x18d)]);if(_0x548adf['EBWbk'](_0x3c5d8e,_0xdb9ff3))try{const _0x2d77a7=await serverSideLogin(_0x18b379[_0x38a45f(0x173)]);if(_0x2d77a7['status']===_0x548adf['xYmcw'])console['log'](_0x548adf['bcwTz']);else{if(_0x548adf['Xemfo'](_0x2d77a7[_0x38a45f(0x134)],'success')&&_0x2d77a7['session_state']){console[_0x38a45f(0x127)](_0x38a45f(0x132));const _0x5c5e52=await _0x548adf[_0x38a45f(0x17a)](writeSessionToLocalCache,_0x18b379[_0x38a45f(0x173)],_0x18b379['organizationId'],_0x1701f5,_0x4a5a48,_0x2d77a7['session_state'],_0x59e9b4,_0x4601d9);return _0x3c5d8e&&!_0xdb9ff3&&await _0x548adf[_0x38a45f(0x18e)](promptSaveCredentials,_0x18b379[_0x38a45f(0x173)]),{'authPath':_0x5c5e52,'settings':_0x2f2890,'resolvedEnv':_0x226fca};}else _0x2d77a7[_0x38a45f(0x17e)]&&(console[_0x38a45f(0x127)](_0x38a45f(0x18a)),console['log'](_0x2d77a7[_0x38a45f(0x17e)])),console[_0x38a45f(0x127)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0xffdfed){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x548adf['dKkhh'](_0xffdfed,Error)?_0xffdfed[_0x38a45f(0x193)]:_0x548adf['zrMVx'](String,_0xffdfed))),console[_0x38a45f(0x127)](_0x548adf[_0x38a45f(0x14b)]);}const {sessionState:_0x349177}=await manualBrowserLogin(_0x18b379,_0x226fca),_0x4c0dd2=await writeSessionToLocalCache(_0x18b379[_0x38a45f(0x173)],_0x18b379[_0x38a45f(0x15f)],_0x1701f5,_0x4a5a48,_0x349177,_0x59e9b4,_0x4601d9);return{'authPath':_0x4c0dd2,'settings':_0x2f2890,'resolvedEnv':_0x226fca};}
@@ -1 +1 @@
1
- const _0x3124b8=_0x5da4;(function(_0x47b6e2,_0x4fe463){const _0x407b8c=_0x5da4,_0x2bdcd1=_0x47b6e2();while(!![]){try{const _0x44b827=-parseInt(_0x407b8c(0x16d))/0x1+parseInt(_0x407b8c(0x166))/0x2+-parseInt(_0x407b8c(0x15b))/0x3+parseInt(_0x407b8c(0x164))/0x4*(-parseInt(_0x407b8c(0x15e))/0x5)+-parseInt(_0x407b8c(0x151))/0x6+parseInt(_0x407b8c(0x167))/0x7+parseInt(_0x407b8c(0x156))/0x8;if(_0x44b827===_0x4fe463)break;else _0x2bdcd1['push'](_0x2bdcd1['shift']());}catch(_0x57bb87){_0x2bdcd1['push'](_0x2bdcd1['shift']());}}}(_0xf263,0x3b0bb));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x59ebd1=process['env'],_0x1994df={'stdin':process[_0x3124b8(0x158)],'stdout':process['stdout']}){const _0x46abd0=_0x3124b8;if(_0x59ebd1['CI'])return![];return Boolean(_0x1994df['stdin']['isTTY'])&&Boolean(_0x1994df[_0x46abd0(0x157)]['isTTY']);}export const DEFAULT_SESSION_DEPS=['baseUrl',_0x3124b8(0x171)];export function sessionCacheHash(_0x24bbfb){const _0x414e3a=_0x3124b8,_0x3214be={'Kvfxz':_0x414e3a(0x171),'HBoUC':'port','kbXLz':function(_0x46a1ae,_0x236649){return _0x46a1ae(_0x236649);},'UUioJ':'userAgent','cewpM':function(_0x179379,_0x18ef46){return _0x179379!==_0x18ef46;}},_0x3c05b3=_0x24bbfb['sessionDeps']??DEFAULT_SESSION_DEPS,_0x2332cf=new Set(_0x3c05b3),_0x342fc3={'orgId':_0x24bbfb['orgId'],'profileName':_0x24bbfb[_0x414e3a(0x172)]};return(_0x2332cf[_0x414e3a(0x14f)]('baseUrl')||!_0x24bbfb['sessionDeps'])&&(_0x342fc3['effectiveBaseUrl']=_0x24bbfb['effectiveBaseUrl']),(_0x2332cf[_0x414e3a(0x14f)](_0x3214be['Kvfxz'])||!_0x24bbfb[_0x414e3a(0x154)])&&(_0x342fc3[_0x414e3a(0x171)]=_0x24bbfb['setupHeaders']?sortObjectKeys(_0x24bbfb[_0x414e3a(0x171)]):_0x24bbfb[_0x414e3a(0x171)]),_0x2332cf['has'](_0x3214be[_0x414e3a(0x165)])&&(_0x342fc3[_0x414e3a(0x15d)]=_0x3214be['kbXLz'](extractPort,_0x24bbfb[_0x414e3a(0x14e)])),_0x2332cf['has'](_0x3214be['UUioJ'])&&_0x3214be['cewpM'](_0x24bbfb['userAgent'],undefined)&&(_0x342fc3['userAgent']=_0x24bbfb[_0x414e3a(0x16e)]),_0x2332cf[_0x414e3a(0x14f)](_0x414e3a(0x16a))&&_0x3214be['cewpM'](_0x24bbfb[_0x414e3a(0x16a)],undefined)&&(_0x342fc3[_0x414e3a(0x16a)]=_0x24bbfb[_0x414e3a(0x16a)]),createHash(_0x414e3a(0x16f))['update'](JSON[_0x414e3a(0x159)](_0x342fc3))[_0x414e3a(0x162)]('hex')['slice'](0x0,0xc);}function extractPort(_0x1f5af5){const _0x4f714f=_0x3124b8;try{return new URL(_0x1f5af5)[_0x4f714f(0x15d)];}catch{return'';}}function _0x5da4(_0x47c216,_0x4fc7cc){_0x47c216=_0x47c216-0x14b;const _0xf2633e=_0xf263();let _0x5da4f4=_0xf2633e[_0x47c216];return _0x5da4f4;}function _0xf263(){const _0x486bd4=['2036784UbSNot','url','IHesz','sessionDeps','goto','5947840kpHgjv','stdout','stdin','stringify','defaultEnvironmentKey','1156473yZyUNx','toString','port','493835gltLtK','NVwcJ','pathname','domain','digest','newContext','4wPaqQK','HBoUC','908582xBVOPQ','650258XmvOev','localhost','newPage','clientIp','test','map','225092UpqQoN','userAgent','sha256','sort','setupHeaders','profileName','ZYNoQ','izVZJ','close','keys','catch','effectiveBaseUrl','has','.localhost'];_0xf263=function(){return _0x486bd4;};return _0xf263();}function sortObjectKeys(_0x496fef){const _0x51565a=_0x3124b8,_0x1c8fe0={};for(const _0x51ee00 of Object['keys'](_0x496fef)[_0x51565a(0x170)]()){_0x1c8fe0[_0x51ee00]=_0x496fef[_0x51ee00];}return _0x1c8fe0;}export function getSessionCachePath(_0x51d8f7,_0x30fe57){return join(getRangerHomeDir(),'auth',_0x51d8f7+'-'+_0x30fe57+'.json');}export function getStorageStatePath(_0x56f1f4){const _0x32b0d3={'uRcMf':'.storageState.json'};return _0x56f1f4['replace'](/\.json$/,_0x32b0d3['uRcMf']);}export function needsTunnel(_0x1a0961){const _0x473530=_0x3124b8,_0x4f6b23={'EVGKy':_0x473530(0x168),'NVwcJ':'127.0.0.1','ZYNoQ':_0x473530(0x150)};let _0x6ebae9;try{_0x6ebae9=new URL(_0x1a0961)['hostname'];}catch{return![];}if(_0x6ebae9===_0x4f6b23['EVGKy']||_0x6ebae9===_0x4f6b23[_0x473530(0x15f)])return!![];if(_0x6ebae9['endsWith'](_0x4f6b23[_0x473530(0x173)]))return!![];if(_0x6ebae9['includes']('localhost.'))return!![];return![];}export function hostnameOf(_0x38fa9a){return new URL(_0x38fa9a)['hostname'];}export function duplicateCookiesForDomains(_0x1ab199,_0x20f152){const _0x13963f=_0x3124b8,_0xb95118=[..._0x1ab199],_0x48c24b=new Set(_0x1ab199[_0x13963f(0x16c)](_0x150118=>_0x150118[_0x13963f(0x161)]));for(const _0x133dae of _0x20f152){let _0x1697b5;try{_0x1697b5=hostnameOf(_0x133dae);}catch{continue;}if(!_0x1697b5)continue;const _0x26fbde=_0x1697b5['startsWith']('.')?_0x1697b5:'.'+_0x1697b5;if(_0x48c24b[_0x13963f(0x14f)](_0x1697b5)||_0x48c24b[_0x13963f(0x14f)](_0x26fbde))continue;for(const _0x4a2a19 of _0x1ab199){_0xb95118['push']({..._0x4a2a19,'domain':_0x26fbde});}_0x48c24b['add'](_0x26fbde);}return _0xb95118;}export function resolveAuthEnvironmentLocally(_0x304833,_0x25ae61){const _0x2a1abe=_0x3124b8,_0x2ece38=_0x304833['environments'];if(_0x25ae61){const _0x4d0f6d=_0x2ece38[_0x25ae61];if(!_0x4d0f6d)return null;return{'key':_0x25ae61,..._0x4d0f6d};}if(_0x304833['defaultEnvironmentKey']){const _0x3fd2ad=_0x2ece38[_0x304833[_0x2a1abe(0x15a)]];if(!_0x3fd2ad)return null;return{'key':_0x304833['defaultEnvironmentKey'],..._0x3fd2ad};}const _0x50da01=Object[_0x2a1abe(0x14c)](_0x2ece38);if(_0x50da01['length']===0x1){const _0x2f04e3=_0x50da01[0x0];return{'key':_0x2f04e3,..._0x2ece38[_0x2f04e3]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x340a20,_0x47d6dd){const _0x82f8f7=_0x3124b8;try{if(_0x47d6dd)return new URL(_0x47d6dd,_0x340a20)['toString']();return new URL(_0x340a20)[_0x82f8f7(0x15c)]();}catch{return null;}}export function looksLikeLoginUrl(_0x1bc25b){const _0x1277c8=_0x3124b8;try{const _0x466258=new URL(_0x1bc25b);return LOGIN_URL_PATTERN[_0x1277c8(0x16b)](_0x466258[_0x1277c8(0x160)]);}catch{return LOGIN_URL_PATTERN[_0x1277c8(0x16b)](_0x1bc25b);}}export async function isCachedSessionLive(_0x1025a2,_0x556940,_0x8a5f8a={},_0x224a26={}){const _0x5c405a=_0x3124b8,_0x3bbc04={'UlpZu':function(_0x2ecfe8,_0x5c67cf,_0x58822c){return _0x2ecfe8(_0x5c67cf,_0x58822c);},'izVZJ':'domcontentloaded','IHesz':function(_0x17e2a6,_0x50e4ba){return _0x17e2a6===_0x50e4ba;}},_0x2cdc7e=_0x3bbc04['UlpZu'](buildSessionCheckUrl,_0x556940,_0x8a5f8a['sessionCheckPath']);if(!_0x2cdc7e)return!![];if(!_0x224a26['launchBrowser'])return!![];let _0x375483=null;try{_0x375483=await _0x224a26['launchBrowser']();const _0x4ecc18=await _0x375483[_0x5c405a(0x163)]({'storageState':_0x1025a2,'ignoreHTTPSErrors':!![],..._0x8a5f8a['setupHeaders']?{'extraHTTPHeaders':_0x8a5f8a[_0x5c405a(0x171)]}:{}}),_0x21dc38=await _0x4ecc18[_0x5c405a(0x169)](),_0x1a06cd=await _0x21dc38[_0x5c405a(0x155)](_0x2cdc7e,{'waitUntil':_0x3bbc04[_0x5c405a(0x174)],'timeout':0x3a98}),_0x3b423b=_0x1a06cd?.['status']();if(_0x3bbc04[_0x5c405a(0x153)](_0x3b423b,0x191)||_0x3b423b===0x193)return![];const _0x51458a=_0x21dc38[_0x5c405a(0x152)]();if(looksLikeLoginUrl(_0x51458a))return![];return!![];}catch{return![];}finally{if(_0x375483)await _0x375483[_0x5c405a(0x14b)]()[_0x5c405a(0x14d)](()=>{});}}
1
+ const _0x2567ed=_0x5747;(function(_0x132249,_0xe34596){const _0x36c42b=_0x5747,_0x5c9b4c=_0x132249();while(!![]){try{const _0x1fce26=-parseInt(_0x36c42b(0x1c4))/0x1+-parseInt(_0x36c42b(0x1b6))/0x2+parseInt(_0x36c42b(0x19f))/0x3+parseInt(_0x36c42b(0x1c9))/0x4+-parseInt(_0x36c42b(0x1a4))/0x5*(parseInt(_0x36c42b(0x1b2))/0x6)+-parseInt(_0x36c42b(0x1bc))/0x7+-parseInt(_0x36c42b(0x1ba))/0x8*(-parseInt(_0x36c42b(0x1b5))/0x9);if(_0x1fce26===_0xe34596)break;else _0x5c9b4c['push'](_0x5c9b4c['shift']());}catch(_0x4fc98a){_0x5c9b4c['push'](_0x5c9b4c['shift']());}}}(_0x2097,0x6a9c0));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0xd84203=process[_0x2567ed(0x1be)],_0x1a9a73={'stdin':process['stdin'],'stdout':process['stdout']}){const _0x56768c=_0x2567ed,_0x2ef07e={'EtHRy':function(_0x2f434d,_0x3ff641){return _0x2f434d(_0x3ff641);}};if(_0xd84203['CI'])return![];return _0x2ef07e[_0x56768c(0x1ae)](Boolean,_0x1a9a73[_0x56768c(0x1a9)]['isTTY'])&&Boolean(_0x1a9a73['stdout'][_0x56768c(0x1ca)]);}function _0x5747(_0xedb3c8,_0x5b0a21){_0xedb3c8=_0xedb3c8-0x19f;const _0x20972c=_0x2097();let _0x57479d=_0x20972c[_0xedb3c8];return _0x57479d;}export const DEFAULT_SESSION_DEPS=[];export function sessionCacheHash(_0x55f171){const _0x20f6f9=_0x2567ed,_0x6b73e2={'nicEs':function(_0x44784a,_0x22a8f8){return _0x44784a(_0x22a8f8);},'UJrBl':'port','fnlOs':_0x20f6f9(0x1b4),'yCHZJ':'sha256','qMcmC':_0x20f6f9(0x1a3)},_0x4000e6=new Set(_0x55f171['sessionDeps']??DEFAULT_SESSION_DEPS),_0x402fcf={'orgId':_0x55f171['orgId'],'profileName':_0x55f171['profileName']};return _0x4000e6[_0x20f6f9(0x1a8)]('baseUrl')&&(_0x402fcf['effectiveBaseUrl']=_0x55f171['effectiveBaseUrl']),_0x4000e6['has']('setupHeaders')&&(_0x402fcf['setupHeaders']=_0x55f171[_0x20f6f9(0x1c7)]?_0x6b73e2[_0x20f6f9(0x1af)](sortObjectKeys,_0x55f171[_0x20f6f9(0x1c7)]):_0x55f171['setupHeaders']),_0x4000e6['has'](_0x6b73e2['UJrBl'])&&(_0x402fcf[_0x20f6f9(0x1c1)]=extractPort(_0x55f171[_0x20f6f9(0x1b1)])),_0x4000e6['has'](_0x20f6f9(0x1bb))&&_0x55f171[_0x20f6f9(0x1bb)]!==undefined&&(_0x402fcf[_0x20f6f9(0x1bb)]=_0x55f171[_0x20f6f9(0x1bb)]),_0x4000e6[_0x20f6f9(0x1a8)](_0x6b73e2['fnlOs'])&&_0x55f171['clientIp']!==undefined&&(_0x402fcf[_0x20f6f9(0x1b4)]=_0x55f171['clientIp']),_0x6b73e2[_0x20f6f9(0x1af)](createHash,_0x6b73e2['yCHZJ'])['update'](JSON['stringify'](_0x402fcf))[_0x20f6f9(0x1b0)](_0x6b73e2[_0x20f6f9(0x1a2)])['slice'](0x0,0xc);}function _0x2097(){const _0x2b8cd6=['newPage','AEidx','port','status','.json','262429nAgOnL','url','defaultEnvironmentKey','setupHeaders','catch','920192Bpmlgj','isTTY','1001568djRmNg','domain','replace','qMcmC','hex','64180SAwrbd','includes','osLRH','keys','has','stdin','length','endsWith','oenaW','localhost','EtHRy','nicEs','digest','effectiveBaseUrl','228FUUHgP','xubnm','clientIp','9dCCmet','1134942oKYGdp','localhost.','add','.localhost','10789224SMQOzy','userAgent','1107519YMLDAM','ihbZg','env'];_0x2097=function(){return _0x2b8cd6;};return _0x2097();}function extractPort(_0x46a332){const _0x4ec8e8=_0x2567ed;try{return new URL(_0x46a332)[_0x4ec8e8(0x1c1)];}catch{return'';}}function sortObjectKeys(_0x443fdb){const _0x353306=_0x2567ed,_0x45b9eb={};for(const _0x4b8269 of Object[_0x353306(0x1a7)](_0x443fdb)['sort']()){_0x45b9eb[_0x4b8269]=_0x443fdb[_0x4b8269];}return _0x45b9eb;}export function getSessionCachePath(_0x262b82,_0x188527){const _0x11f151=_0x2567ed,_0x49880d={'QNNal':function(_0x18c354,_0x1cda0f,_0x2e6aa4,_0x5d6fc3){return _0x18c354(_0x1cda0f,_0x2e6aa4,_0x5d6fc3);}};return _0x49880d['QNNal'](join,getRangerHomeDir(),'auth',_0x262b82+'-'+_0x188527+_0x11f151(0x1c3));}export function getStorageStatePath(_0x34156d){const _0x179100=_0x2567ed;return _0x34156d[_0x179100(0x1a1)](/\.json$/,'.storageState.json');}export function needsTunnel(_0x28ea4c){const _0x1b41ac=_0x2567ed,_0x65862d={'oenaW':function(_0x29f992,_0x109eb1){return _0x29f992===_0x109eb1;},'xPhFl':'127.0.0.1','ihbZg':_0x1b41ac(0x1b7)};let _0x5ae3ae;try{_0x5ae3ae=new URL(_0x28ea4c)['hostname'];}catch{return![];}if(_0x5ae3ae===_0x1b41ac(0x1ad)||_0x65862d[_0x1b41ac(0x1ac)](_0x5ae3ae,_0x65862d['xPhFl']))return!![];if(_0x5ae3ae[_0x1b41ac(0x1ab)](_0x1b41ac(0x1b9)))return!![];if(_0x5ae3ae[_0x1b41ac(0x1a5)](_0x65862d[_0x1b41ac(0x1bd)]))return!![];return![];}export function hostnameOf(_0x36ccbe){return new URL(_0x36ccbe)['hostname'];}export function duplicateCookiesForDomains(_0x298063,_0x1fdd0c){const _0xefd6f1=_0x2567ed,_0xfab501=[..._0x298063],_0x1e5cab=new Set(_0x298063['map'](_0x2ab674=>_0x2ab674[_0xefd6f1(0x1a0)]));for(const _0x40224e of _0x1fdd0c){let _0x598546;try{_0x598546=hostnameOf(_0x40224e);}catch{continue;}if(!_0x598546)continue;const _0x420715=_0x598546['startsWith']('.')?_0x598546:'.'+_0x598546;if(_0x1e5cab[_0xefd6f1(0x1a8)](_0x598546)||_0x1e5cab[_0xefd6f1(0x1a8)](_0x420715))continue;for(const _0x1dc90e of _0x298063){_0xfab501['push']({..._0x1dc90e,'domain':_0x420715});}_0x1e5cab[_0xefd6f1(0x1b8)](_0x420715);}return _0xfab501;}export function resolveAuthEnvironmentLocally(_0x35e25c,_0x1c9d36){const _0x284b34=_0x2567ed,_0x2dfc55={'AEidx':function(_0xfb845d,_0x7730c1){return _0xfb845d===_0x7730c1;}},_0x5b8cc6=_0x35e25c['environments'];if(_0x1c9d36){const _0x4af70f=_0x5b8cc6[_0x1c9d36];if(!_0x4af70f)return null;return{'key':_0x1c9d36,..._0x4af70f};}if(_0x35e25c[_0x284b34(0x1c6)]){const _0x5070dd=_0x5b8cc6[_0x35e25c[_0x284b34(0x1c6)]];if(!_0x5070dd)return null;return{'key':_0x35e25c['defaultEnvironmentKey'],..._0x5070dd};}const _0x4fd29d=Object[_0x284b34(0x1a7)](_0x5b8cc6);if(_0x2dfc55[_0x284b34(0x1c0)](_0x4fd29d[_0x284b34(0x1aa)],0x1)){const _0x101c4d=_0x4fd29d[0x0];return{'key':_0x101c4d,..._0x5b8cc6[_0x101c4d]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x413a05,_0x4f81af){try{if(_0x4f81af)return new URL(_0x4f81af,_0x413a05)['toString']();return new URL(_0x413a05)['toString']();}catch{return null;}}export function looksLikeLoginUrl(_0x372690){try{const _0x300118=new URL(_0x372690);return LOGIN_URL_PATTERN['test'](_0x300118['pathname']);}catch{return LOGIN_URL_PATTERN['test'](_0x372690);}}export async function isCachedSessionLive(_0x26355c,_0x4613e7,_0x111bb6={},_0x29d39b={}){const _0x4ebb08=_0x2567ed,_0x280f10={'osLRH':function(_0x1b123f,_0x19f79b,_0x46ede6){return _0x1b123f(_0x19f79b,_0x46ede6);},'xubnm':'domcontentloaded','YiVhU':function(_0x4e089d,_0x5322d2){return _0x4e089d(_0x5322d2);}},_0x51d431=_0x280f10[_0x4ebb08(0x1a6)](buildSessionCheckUrl,_0x4613e7,_0x111bb6['sessionCheckPath']);if(!_0x51d431)return!![];if(!_0x29d39b['launchBrowser'])return!![];let _0x1bcf85=null;try{_0x1bcf85=await _0x29d39b['launchBrowser']();const _0x5c2773=await _0x1bcf85['newContext']({'storageState':_0x26355c,'ignoreHTTPSErrors':!![],..._0x111bb6[_0x4ebb08(0x1c7)]?{'extraHTTPHeaders':_0x111bb6['setupHeaders']}:{}}),_0x41cc04=await _0x5c2773[_0x4ebb08(0x1bf)](),_0x525412=await _0x41cc04['goto'](_0x51d431,{'waitUntil':_0x280f10[_0x4ebb08(0x1b3)],'timeout':0x3a98}),_0x313372=_0x525412?.[_0x4ebb08(0x1c2)]();if(_0x313372===0x191||_0x313372===0x193)return![];const _0x5d2427=_0x41cc04[_0x4ebb08(0x1c5)]();if(_0x280f10['YiVhU'](looksLikeLoginUrl,_0x5d2427))return![];return!![];}catch{return![];}finally{if(_0x1bcf85)await _0x1bcf85['close']()[_0x4ebb08(0x1c8)](()=>{});}}
@@ -1 +1 @@
1
- (function(_0x410e83,_0xd072de){const _0x23f0ce=_0x5a0b,_0x4e181b=_0x410e83();while(!![]){try{const _0x3e0a7c=-parseInt(_0x23f0ce(0x1a6))/0x1+-parseInt(_0x23f0ce(0x1a8))/0x2+parseInt(_0x23f0ce(0x1aa))/0x3+parseInt(_0x23f0ce(0x1ab))/0x4*(-parseInt(_0x23f0ce(0x1a2))/0x5)+-parseInt(_0x23f0ce(0x19e))/0x6+-parseInt(_0x23f0ce(0x19b))/0x7*(-parseInt(_0x23f0ce(0x1a5))/0x8)+parseInt(_0x23f0ce(0x1a4))/0x9;if(_0x3e0a7c===_0xd072de)break;else _0x4e181b['push'](_0x4e181b['shift']());}catch(_0xbd4ce6){_0x4e181b['push'](_0x4e181b['shift']());}}}(_0x57dc,0x3bbee));function _0x5a0b(_0x3fd901,_0x25b65f){_0x3fd901=_0x3fd901-0x19b;const _0x57dc87=_0x57dc();let _0x5a0b4d=_0x57dc87[_0x3fd901];return _0x5a0b4d;}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0x57dc(){const _0x34f726=['final','5pcRCDs','mZXOq','7416270QxfUmu','209192nvLOYA','6977tVhVbM','concat','283078SzVrnl','utf8','314508dsSknO','1917436MSGSAF','UocSC','35wivuJs','update','yYVLf','1122108AjIQVH','subarray','getAuthTag'];_0x57dc=function(){return _0x34f726;};return _0x57dc();}const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x41eaeb){const _0x5d9d73={'mGNEg':function(_0x45a043,_0x2d23ef,_0x3cf402,_0x5b2e02,_0xc8449b,_0x10295f){return _0x45a043(_0x2d23ef,_0x3cf402,_0x5b2e02,_0xc8449b,_0x10295f);}};return _0x5d9d73['mGNEg'](pbkdf2Sync,_0x41eaeb,SALT,0x186a0,KEY_LENGTH,'sha256');}export function encrypt(_0x3cfe30,_0x1d3571){const _0x353263=_0x5a0b,_0x283c24={'yYVLf':function(_0x67b95b,_0x115a2b){return _0x67b95b(_0x115a2b);},'lnlXS':function(_0x276248,_0x58d826,_0x2fdbd5,_0x3655d9){return _0x276248(_0x58d826,_0x2fdbd5,_0x3655d9);},'mZXOq':_0x353263(0x1a9)},_0x354e36=_0x283c24['yYVLf'](deriveKey,_0x1d3571),_0x4d71f9=_0x283c24[_0x353263(0x19d)](randomBytes,IV_LENGTH),_0x11b069=_0x283c24['lnlXS'](createCipheriv,ALGORITHM,_0x354e36,_0x4d71f9),_0xe23d73=Buffer[_0x353263(0x1a7)]([_0x11b069[_0x353263(0x19c)](_0x3cfe30,_0x283c24[_0x353263(0x1a3)]),_0x11b069[_0x353263(0x1a1)]()]),_0x2a5fd0=_0x11b069[_0x353263(0x1a0)]();return Buffer[_0x353263(0x1a7)]([_0x4d71f9,_0x2a5fd0,_0xe23d73]);}export function decrypt(_0x378a6d,_0x418d1f){const _0x2c83be=_0x5a0b,_0x5b8c53={'SPSvy':function(_0x155897,_0x2df7e1){return _0x155897(_0x2df7e1);},'UocSC':function(_0x1d8ef0,_0xa79161){return _0x1d8ef0+_0xa79161;},'zSlfS':function(_0x520f62,_0x266618,_0x206c63,_0x1dc97b){return _0x520f62(_0x266618,_0x206c63,_0x1dc97b);},'DVzMw':function(_0x14da45,_0x432099){return _0x14da45+_0x432099;}},_0xdc9ead=_0x5b8c53['SPSvy'](deriveKey,_0x418d1f),_0x82e9fa=_0x378a6d['subarray'](0x0,IV_LENGTH),_0x1af989=_0x378a6d[_0x2c83be(0x19f)](IV_LENGTH,_0x5b8c53[_0x2c83be(0x1ac)](IV_LENGTH,TAG_LENGTH)),_0x173db9=_0x378a6d[_0x2c83be(0x19f)](_0x5b8c53[_0x2c83be(0x1ac)](IV_LENGTH,TAG_LENGTH)),_0x4a9acb=_0x5b8c53['zSlfS'](createDecipheriv,ALGORITHM,_0xdc9ead,_0x82e9fa);return _0x4a9acb['setAuthTag'](_0x1af989),_0x5b8c53['DVzMw'](_0x4a9acb[_0x2c83be(0x19c)](_0x173db9),_0x4a9acb['final']('utf8'));}
1
+ function _0xb476(_0x304a0b,_0x3bd5c7){_0x304a0b=_0x304a0b-0x18a;const _0xfb3cda=_0xfb3c();let _0xb476d0=_0xfb3cda[_0x304a0b];return _0xb476d0;}const _0x5dc212=_0xb476;(function(_0xa24d74,_0x506180){const _0x3c09af=_0xb476,_0x2a8e0a=_0xa24d74();while(!![]){try{const _0xc64e6d=-parseInt(_0x3c09af(0x193))/0x1+-parseInt(_0x3c09af(0x18a))/0x2+-parseInt(_0x3c09af(0x192))/0x3*(parseInt(_0x3c09af(0x18b))/0x4)+-parseInt(_0x3c09af(0x18f))/0x5+-parseInt(_0x3c09af(0x18d))/0x6+-parseInt(_0x3c09af(0x195))/0x7+parseInt(_0x3c09af(0x198))/0x8;if(_0xc64e6d===_0x506180)break;else _0x2a8e0a['push'](_0x2a8e0a['shift']());}catch(_0x10b1ae){_0x2a8e0a['push'](_0x2a8e0a['shift']());}}}(_0xfb3c,0x5cbb4));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0xfb3c(){const _0x2b93b0=['2446759nRNfjA','ranger-auth-encryption','utf8','27377136xeiLuX','sZPWw','1488272zILyxr','16zNwucF','setAuthTag','3619776JODSZW','AkIyV','2016965nQHfTC','WbHgj','tfChW','175359BRBviE','708140kjltQf','subarray'];_0xfb3c=function(){return _0x2b93b0;};return _0xfb3c();}const ALGORITHM='aes-256-gcm',SALT=_0x5dc212(0x196),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x4231d5){const _0x1a1dab={'htUFN':'sha256'};return pbkdf2Sync(_0x4231d5,SALT,0x186a0,KEY_LENGTH,_0x1a1dab['htUFN']);}export function encrypt(_0x459dd8,_0xa6bae){const _0x68c5ce=_0x5dc212,_0x23d3f4={'Ebejh':function(_0x328810,_0x26f0aa){return _0x328810(_0x26f0aa);},'sZPWw':'utf8'},_0x27122c=_0x23d3f4['Ebejh'](deriveKey,_0xa6bae),_0x194c7f=randomBytes(IV_LENGTH),_0x592bb2=createCipheriv(ALGORITHM,_0x27122c,_0x194c7f),_0x479595=Buffer['concat']([_0x592bb2['update'](_0x459dd8,_0x23d3f4[_0x68c5ce(0x199)]),_0x592bb2['final']()]),_0x385a47=_0x592bb2['getAuthTag']();return Buffer['concat']([_0x194c7f,_0x385a47,_0x479595]);}export function decrypt(_0x2cc248,_0x7e8e8){const _0x4f807d=_0x5dc212,_0x5a2d85={'tfChW':function(_0x2bd897,_0x54cfb4){return _0x2bd897(_0x54cfb4);},'AkIyV':function(_0x37fa65,_0x48340b){return _0x37fa65+_0x48340b;},'WbHgj':function(_0x85d755,_0x4be6f5,_0xbd90d6,_0x210935){return _0x85d755(_0x4be6f5,_0xbd90d6,_0x210935);},'OYRcH':_0x4f807d(0x197)},_0x252ddc=_0x5a2d85[_0x4f807d(0x191)](deriveKey,_0x7e8e8),_0x1404d1=_0x2cc248[_0x4f807d(0x194)](0x0,IV_LENGTH),_0x29a972=_0x2cc248['subarray'](IV_LENGTH,_0x5a2d85[_0x4f807d(0x18e)](IV_LENGTH,TAG_LENGTH)),_0x440f94=_0x2cc248[_0x4f807d(0x194)](IV_LENGTH+TAG_LENGTH),_0x34b23d=_0x5a2d85[_0x4f807d(0x190)](createDecipheriv,ALGORITHM,_0x252ddc,_0x1404d1);return _0x34b23d[_0x4f807d(0x18c)](_0x29a972),_0x34b23d['update'](_0x440f94)+_0x34b23d['final'](_0x5a2d85['OYRcH']);}
@@ -1 +1 @@
1
- const _0x1ed7ff=_0x42c2;(function(_0xefcc5d,_0x3831d2){const _0x237728=_0x42c2,_0x2cd97d=_0xefcc5d();while(!![]){try{const _0x568d12=-parseInt(_0x237728(0x12c))/0x1*(parseInt(_0x237728(0x14b))/0x2)+-parseInt(_0x237728(0x136))/0x3*(parseInt(_0x237728(0x147))/0x4)+-parseInt(_0x237728(0x130))/0x5+-parseInt(_0x237728(0x145))/0x6*(-parseInt(_0x237728(0x15d))/0x7)+-parseInt(_0x237728(0x163))/0x8+parseInt(_0x237728(0x15f))/0x9*(parseInt(_0x237728(0x164))/0xa)+parseInt(_0x237728(0x148))/0xb*(parseInt(_0x237728(0x14a))/0xc);if(_0x568d12===_0x3831d2)break;else _0x2cd97d['push'](_0x2cd97d['shift']());}catch(_0x366604){_0x2cd97d['push'](_0x2cd97d['shift']());}}}(_0x146e,0x9c4fe));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x1ed7ff(0x14c),'-t',_0x1ed7ff(0x15b),'--api-key',_0x1ed7ff(0x153),_0x1ed7ff(0x132),_0x1ed7ff(0x140),_0x1ed7ff(0x14d),_0x1ed7ff(0x14f),'--authorization',_0x1ed7ff(0x138),'--cookie',_0x1ed7ff(0x12a)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x471c9d){const _0x45b0ca=_0x1ed7ff;return TOKEN_PATTERNS[_0x45b0ca(0x15a)](_0xcc7e0a=>_0xcc7e0a['test'](_0x471c9d));}export function sanitizeArgs(_0x401195){const _0x53fb7b=_0x1ed7ff,_0x25bd40={'SyJaN':function(_0x2a89cb,_0x42130d){return _0x2a89cb<_0x42130d;},'LifXY':'[REDACTED]'},_0x3e82f6=[];let _0x4925db=![];for(let _0x57426f=0x0;_0x25bd40['SyJaN'](_0x57426f,_0x401195['length']);_0x57426f++){const _0x1386d7=_0x401195[_0x57426f];if(_0x4925db){_0x3e82f6['push'](_0x25bd40['LifXY']),_0x4925db=![];continue;}if(_0x1386d7['startsWith']('--')||_0x1386d7['startsWith']('-')){const _0x16aa93=_0x1386d7[_0x53fb7b(0x144)]('=');if(_0x16aa93!==-0x1){const _0x46f0c6=_0x1386d7[_0x53fb7b(0x13a)](0x0,_0x16aa93)['toLowerCase']();if(SENSITIVE_FLAGS['has'](_0x46f0c6)){_0x3e82f6[_0x53fb7b(0x12f)](_0x1386d7['slice'](0x0,_0x16aa93)+_0x53fb7b(0x150));continue;}}else{const _0x26d2c4=_0x1386d7[_0x53fb7b(0x134)]();SENSITIVE_FLAGS[_0x53fb7b(0x142)](_0x26d2c4)&&(_0x4925db=!![]);}_0x3e82f6['push'](_0x1386d7);}else looksLikeToken(_0x1386d7)?_0x3e82f6['push'](_0x25bd40['LifXY']):_0x3e82f6[_0x53fb7b(0x12f)](_0x1386d7);}return _0x3e82f6[_0x53fb7b(0x15c)]('\x20');}function _0x42c2(_0x3e38f0,_0x398785){_0x3e38f0=_0x3e38f0-0x127;const _0x146e60=_0x146e();let _0x42c2c8=_0x146e60[_0x3e38f0];return _0x42c2c8;}function _0x146e(){const _0x5e32b1=['unknown','--credentials','errorMessage','13QfwGuB','Not\x20enough\x20non-option\x20arguments','catch','push','4644235BBJdGi','runtime_error','--key','jMtjo','toLowerCase','missing_required_argument','324IqMEjH','stringify','--header','unknown_argument','slice','Bearer\x20','wUsIi','Unknown\x20argument','ZwreT','isTTY','--password','[desire-path]\x20Failed\x20to\x20send:\x20','has','[desire-path]\x20Sending\x20log\x20to\x20','indexOf','258744rvxMFR','invalid_option_value','26584Lbskga','4867687KtgOLm','has_token','60dxPmim','74082pgnqCZ','--token','--pass','includes','--auth','=[REDACTED]','JbXUd','rawCommand','--apikey','error','errorType','sessionId','Uodee','[desire-path]\x20Payload:\x20','featureId','some','--secret','join','189YDOPst','unknown_command','9awlplQ','stdout','/api/v1/mcp/desire-path-logs','uaHXg','6835064ZZEJUu','2458520qYfgEn','Invalid\x20values','env'];_0x146e=function(){return _0x5e32b1;};return _0x146e();}export async function logDesirePath(_0x105d10){const _0x19c286=_0x1ed7ff,_0x2a36b7={'jMtjo':function(_0x4a7c67){return _0x4a7c67();},'wUsIi':_0x19c286(0x149),'CVwvI':'application/json','uaHXg':'Authorization'};try{const _0x23fdff=await _0x2a36b7[_0x19c286(0x133)](getToken)[_0x19c286(0x12e)](()=>null),_0x2a61d8=_0x2a36b7['jMtjo'](getApiBaseUrl),_0x47e01b=getCurrentVersion(),_0x342594=_0x23fdff?_0x2a36b7[_0x19c286(0x13c)]:'no_token',_0x4d64fc={..._0x105d10['metadata'],'authStatus':_0x342594,'isTty':process[_0x19c286(0x160)][_0x19c286(0x13f)]??![]},_0x1dd502={'Content-Type':_0x2a36b7['CVwvI']};_0x23fdff&&(_0x1dd502[_0x2a36b7[_0x19c286(0x162)]]=_0x19c286(0x13b)+_0x23fdff);const _0x4cea67={'rawCommand':_0x105d10[_0x19c286(0x152)],'errorMessage':_0x105d10[_0x19c286(0x12b)],'errorType':_0x105d10[_0x19c286(0x155)],'featureId':_0x105d10[_0x19c286(0x159)],'sessionId':_0x105d10[_0x19c286(0x156)],'metadata':_0x4d64fc,'cliVersion':_0x47e01b};process['env']['DEBUG']&&(console[_0x19c286(0x154)](_0x19c286(0x143)+_0x2a61d8+_0x19c286(0x161)),console['error'](_0x19c286(0x158)+JSON['stringify'](_0x4cea67,null,0x2))),await fetch(_0x2a61d8+'/api/v1/mcp/desire-path-logs',{'method':'POST','headers':_0x1dd502,'body':JSON[_0x19c286(0x137)](_0x4cea67)});}catch(_0x14ac9f){process[_0x19c286(0x128)]['DEBUG']&&console[_0x19c286(0x154)](_0x19c286(0x141)+_0x14ac9f);}}export function getErrorType(_0x513c42,_0x111bbf){const _0x246b40=_0x1ed7ff,_0x947fd3={'KKNPT':_0x246b40(0x129),'NJFMx':'Unknown\x20command','ZwreT':_0x246b40(0x13d),'JbXUd':_0x246b40(0x135),'Obmlt':_0x246b40(0x127),'Uodee':'Missing\x20required\x20argument','RVLmn':'missing_option'};if(_0x111bbf)return _0x246b40(0x131);if(!_0x513c42)return _0x947fd3['KKNPT'];if(_0x513c42['includes'](_0x947fd3['NJFMx']))return _0x246b40(0x15e);if(_0x513c42[_0x246b40(0x14e)](_0x947fd3[_0x246b40(0x13e)]))return _0x246b40(0x139);if(_0x513c42['includes'](_0x246b40(0x12d)))return _0x947fd3[_0x246b40(0x151)];if(_0x513c42['includes'](_0x947fd3['Obmlt']))return _0x246b40(0x146);if(_0x513c42['includes'](_0x947fd3[_0x246b40(0x157)]))return _0x947fd3['RVLmn'];return'syntax_error';}
1
+ const _0x23463e=_0x167f;(function(_0x48cbf9,_0x3f2220){const _0x1399a4=_0x167f,_0x5e05db=_0x48cbf9();while(!![]){try{const _0x5a3bbf=-parseInt(_0x1399a4(0xac))/0x1*(parseInt(_0x1399a4(0xaf))/0x2)+-parseInt(_0x1399a4(0x84))/0x3+-parseInt(_0x1399a4(0xa9))/0x4*(parseInt(_0x1399a4(0x97))/0x5)+-parseInt(_0x1399a4(0x92))/0x6+parseInt(_0x1399a4(0x8b))/0x7*(parseInt(_0x1399a4(0x88))/0x8)+parseInt(_0x1399a4(0xa3))/0x9*(-parseInt(_0x1399a4(0xa2))/0xa)+parseInt(_0x1399a4(0x87))/0xb;if(_0x5a3bbf===_0x3f2220)break;else _0x5e05db['push'](_0x5e05db['shift']());}catch(_0x5cc673){_0x5e05db['push'](_0x5e05db['shift']());}}}(_0x3be7,0x53557));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x3be7(){const _0x30fff2=['588681yRFDwA','includes','errorMessage','18730514XZANOU','16lqiCPQ','missing_required_argument','--token','1476265TvrADp','push','GYwka','toLowerCase','startsWith','--api-key','/api/v1/mcp/desire-path-logs','3445728LqqwGw','DEBUG','Missing\x20required\x20argument','CcYTR','--apikey','15nkUdBu','--cookie','--pass','featureId','Authorization','env','[desire-path]\x20Sending\x20log\x20to\x20','XIyIU','application/json','stdout','--password','21130HYtJyN','2151FFZBTT','--header','has','DQjNc','--secret','unknown','440904CCKLcR','=[REDACTED]','indexOf','177029Swgqpl','Unknown\x20argument','[desire-path]\x20Payload:\x20','2KLKvQl'];_0x3be7=function(){return _0x30fff2;};return _0x3be7();}function _0x167f(_0xe10a28,_0x5a0701){_0xe10a28=_0xe10a28-0x84;const _0x3be7c5=_0x3be7();let _0x167f3f=_0x3be7c5[_0xe10a28];return _0x167f3f;}import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x23463e(0x8a),'-t',_0x23463e(0xa7),_0x23463e(0x90),_0x23463e(0x96),'--key',_0x23463e(0xa1),_0x23463e(0x99),'--auth','--authorization',_0x23463e(0xa4),_0x23463e(0x98),'--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(_0x212a51){return TOKEN_PATTERNS['some'](_0x4beed3=>_0x4beed3['test'](_0x212a51));}export function sanitizeArgs(_0x380876){const _0x583a7e=_0x23463e,_0x115135={'VSwBW':function(_0x4c4f29,_0x423f83){return _0x4c4f29!==_0x423f83;},'dcCZg':function(_0x4805fc,_0x59cc80){return _0x4805fc(_0x59cc80);}},_0x4400e4=[];let _0x5b8ea7=![];for(let _0x1502f2=0x0;_0x1502f2<_0x380876['length'];_0x1502f2++){const _0x21ce53=_0x380876[_0x1502f2];if(_0x5b8ea7){_0x4400e4['push']('[REDACTED]'),_0x5b8ea7=![];continue;}if(_0x21ce53[_0x583a7e(0x8f)]('--')||_0x21ce53[_0x583a7e(0x8f)]('-')){const _0x213bb1=_0x21ce53[_0x583a7e(0xab)]('=');if(_0x115135['VSwBW'](_0x213bb1,-0x1)){const _0x381474=_0x21ce53['slice'](0x0,_0x213bb1)['toLowerCase']();if(SENSITIVE_FLAGS[_0x583a7e(0xa5)](_0x381474)){_0x4400e4[_0x583a7e(0x8c)](_0x21ce53['slice'](0x0,_0x213bb1)+_0x583a7e(0xaa));continue;}}else{const _0x1ba24e=_0x21ce53[_0x583a7e(0x8e)]();SENSITIVE_FLAGS[_0x583a7e(0xa5)](_0x1ba24e)&&(_0x5b8ea7=!![]);}_0x4400e4['push'](_0x21ce53);}else _0x115135['dcCZg'](looksLikeToken,_0x21ce53)?_0x4400e4[_0x583a7e(0x8c)]('[REDACTED]'):_0x4400e4['push'](_0x21ce53);}return _0x4400e4['join']('\x20');}export async function logDesirePath(_0x10b0b0){const _0x46e34d=_0x23463e,_0x57a614={'IQwqK':function(_0x2a8444){return _0x2a8444();},'XIyIU':'has_token','DQjNc':_0x46e34d(0x9b),'GYwka':function(_0x1e87c4,_0x82961b,_0x28232a){return _0x1e87c4(_0x82961b,_0x28232a);}};try{const _0x47e474=await getToken()['catch'](()=>null),_0x2d43d4=getApiBaseUrl(),_0x4ed352=_0x57a614['IQwqK'](getCurrentVersion),_0x25373d=_0x47e474?_0x57a614[_0x46e34d(0x9e)]:'no_token',_0x25f7c3={..._0x10b0b0['metadata'],'authStatus':_0x25373d,'isTty':process[_0x46e34d(0xa0)]['isTTY']??![]},_0x359b11={'Content-Type':_0x46e34d(0x9f)};_0x47e474&&(_0x359b11[_0x57a614[_0x46e34d(0xa6)]]='Bearer\x20'+_0x47e474);const _0x4745eb={'rawCommand':_0x10b0b0['rawCommand'],'errorMessage':_0x10b0b0[_0x46e34d(0x86)],'errorType':_0x10b0b0['errorType'],'featureId':_0x10b0b0[_0x46e34d(0x9a)],'sessionId':_0x10b0b0['sessionId'],'metadata':_0x25f7c3,'cliVersion':_0x4ed352};process['env']['DEBUG']&&(console['error'](_0x46e34d(0x9d)+_0x2d43d4+_0x46e34d(0x91)),console['error'](_0x46e34d(0xae)+JSON['stringify'](_0x4745eb,null,0x2))),await _0x57a614[_0x46e34d(0x8d)](fetch,_0x2d43d4+'/api/v1/mcp/desire-path-logs',{'method':'POST','headers':_0x359b11,'body':JSON['stringify'](_0x4745eb)});}catch(_0x4d91a9){process[_0x46e34d(0x9c)][_0x46e34d(0x93)]&&console['error']('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x4d91a9);}}export function getErrorType(_0x2994bd,_0x529df6){const _0x3b299c=_0x23463e,_0x242385={'LjzNB':_0x3b299c(0xa8),'NoQwI':_0x3b299c(0xad),'mjQec':'Invalid\x20values','Wmbpo':'invalid_option_value','CcYTR':'syntax_error'};if(_0x529df6)return'runtime_error';if(!_0x2994bd)return _0x242385['LjzNB'];if(_0x2994bd['includes']('Unknown\x20command'))return'unknown_command';if(_0x2994bd['includes'](_0x242385['NoQwI']))return'unknown_argument';if(_0x2994bd[_0x3b299c(0x85)]('Not\x20enough\x20non-option\x20arguments'))return _0x3b299c(0x89);if(_0x2994bd['includes'](_0x242385['mjQec']))return _0x242385['Wmbpo'];if(_0x2994bd[_0x3b299c(0x85)](_0x3b299c(0x94)))return'missing_option';return _0x242385[_0x3b299c(0x95)];}
@@ -1 +1 @@
1
- const _0x4e2228=_0x46f9;(function(_0x54397c,_0x15e094){const _0x2bcb6e=_0x46f9,_0x279416=_0x54397c();while(!![]){try{const _0x365244=-parseInt(_0x2bcb6e(0x96))/0x1+-parseInt(_0x2bcb6e(0xae))/0x2+parseInt(_0x2bcb6e(0xa6))/0x3*(parseInt(_0x2bcb6e(0xba))/0x4)+parseInt(_0x2bcb6e(0xcd))/0x5*(-parseInt(_0x2bcb6e(0xd9))/0x6)+-parseInt(_0x2bcb6e(0xa0))/0x7*(-parseInt(_0x2bcb6e(0xce))/0x8)+-parseInt(_0x2bcb6e(0xb5))/0x9*(parseInt(_0x2bcb6e(0xd5))/0xa)+parseInt(_0x2bcb6e(0xca))/0xb;if(_0x365244===_0x15e094)break;else _0x279416['push'](_0x279416['shift']());}catch(_0x1d71a0){_0x279416['push'](_0x279416['shift']());}}}(_0x5954,0x98519));import{spawn}from'child_process';import _0x222c6e 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=_0x4e2228(0xbd);export async function requestDeviceCode(_0x2c924b){const _0x3e0b6c=_0x4e2228,_0x4907b6={'NKpFj':'POST','rEWgC':'application/x-www-form-urlencoded'},_0xf2ac2f=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x4907b6[_0x3e0b6c(0xa4)],'headers':{'Content-Type':_0x4907b6[_0x3e0b6c(0xd4)]},'body':new URLSearchParams({'client_id':_0x2c924b})});if(!_0xf2ac2f['ok']){const _0x5316b5=await _0xf2ac2f[_0x3e0b6c(0xcf)]();throw new Error(_0x3e0b6c(0x94)+_0xf2ac2f['status']+'\x20'+_0x5316b5);}return _0xf2ac2f[_0x3e0b6c(0x9f)]();}export async function pollForTokens(_0xa1ad80,_0x51538e,_0x10298e,_0x2ef9b8){const _0x46beaf=_0x4e2228,_0x1f9329={'vylha':function(_0x3a604b,_0x273390){return _0x3a604b*_0x273390;},'MnAyY':function(_0x4f0f9d,_0x5ec381){return _0x4f0f9d*_0x5ec381;},'aQQQd':function(_0x882884,_0x4f3b77){return _0x882884<_0x4f3b77;},'JCyUC':_0x46beaf(0x9c),'Hxdip':'urn:ietf:params:oauth:grant-type:device_code','PcMHC':'slow_down','ZnYdq':'Authentication\x20failed'},_0x422d45=Date[_0x46beaf(0xd3)]()+_0x1f9329['vylha'](_0x2ef9b8,0x3e8);let _0x230425=_0x1f9329[_0x46beaf(0xd6)](_0x10298e,0x3e8);while(_0x1f9329['aQQQd'](Date['now'](),_0x422d45)){await sleep(_0x230425);const _0x48b97f=await fetch(WORKOS_TOKEN_URL,{'method':_0x46beaf(0xc9),'headers':{'Content-Type':_0x1f9329[_0x46beaf(0xd2)]},'body':new URLSearchParams({'client_id':_0xa1ad80,'device_code':_0x51538e,'grant_type':_0x1f9329[_0x46beaf(0x9d)]})});if(_0x48b97f['ok'])return _0x48b97f['json']();const _0x340f85=await _0x48b97f['json']();if(_0x340f85[_0x46beaf(0xa3)]===_0x46beaf(0xad))continue;if(_0x340f85[_0x46beaf(0xa3)]===_0x1f9329['PcMHC']){_0x230425+=0x3e8;continue;}throw new Error(_0x340f85[_0x46beaf(0xbc)]||_0x340f85['error']||_0x1f9329['ZnYdq']);}throw new Error('Device\x20authorization\x20timed\x20out');}function _0x5954(){const _0x1cb05f=['ignore','access_token','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','POST','5966686IqlfgV','\x27s\x20CLI\x20Key','toString','322555glGlXk','93272WJIirl','text','map','status','JCyUC','now','rEWgC','2750sXurBo','MnAyY','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','isTTY','12JQqcox','/organization/my-memberships','workosClientId','utf-8','Code:\x20','ckQIq','PYICL','Failed\x20to\x20request\x20device\x20code:\x20','IgwOr','725689BpnOhX','log','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','darwin','write','Failed\x20to\x20create\x20organization:\x20','application/x-www-form-urlencoded','Hxdip','MxaKt','json','693EespQN','HRVvs','Invalid\x20JWT\x20format','error','NKpFj','vIUFP','3DeuCdS','application/json','ofRhd','organizationId','JwdWt','refresh_token','JJRbj','authorization_pending','627262EgoPqR','device_code','win32','MvSVA','doPvS','stdin','parse','3483ndItbf','apiKey','filter','wZSPM','start','807988cuibeB','AyTtF','error_description','https://api.workos.com/user_management/authenticate','Waiting\x20for\x20authentication...','length','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','cmd','GET','/cli-auth/token','name','stdout'];_0x5954=function(){return _0x1cb05f;};return _0x5954();}async function fetchUserProfile(_0x144e61){const _0x40b4c1={'DdiSo':function(_0x23ddaf,_0xe6dfe6,_0x41be4b){return _0x23ddaf(_0xe6dfe6,_0x41be4b);}},_0x34a09b=getApiBaseUrl();try{const _0x41043d=await _0x40b4c1['DdiSo'](fetch,_0x34a09b+'/organization/me',{'method':'GET','headers':{'workos-token':_0x144e61}});if(_0x41043d['ok'])return _0x41043d['json']();}catch{}return null;}function _0x46f9(_0x531612,_0x3a1d0b){_0x531612=_0x531612-0x90;const _0x5954b6=_0x5954();let _0x46f9ce=_0x5954b6[_0x531612];return _0x46f9ce;}function buildKeyName(_0x4cc8f8,_0x389af4){const _0x5d36df=_0x4e2228,_0x494c62=_0x389af4[_0x5d36df(0xb7)](_0x5e47f2=>_0x5e47f2['name']===_0x4cc8f8||_0x5e47f2[_0x5d36df(0xc4)]['startsWith'](_0x4cc8f8+'\x20('));if(_0x494c62['length']===0x0)return _0x4cc8f8;return _0x4cc8f8+'\x20('+(_0x494c62['length']+0x1)+')';}export async function provisionApiKey(_0x26ae9f){const _0x35262f=_0x4e2228,_0x24ae35={'CJOsM':function(_0x9aec99){return _0x9aec99();},'vIUFP':function(_0x165acf,_0x4d1f66,_0x4c96ca){return _0x165acf(_0x4d1f66,_0x4c96ca);},'Edyun':'GET'},_0x56e651=_0x24ae35['CJOsM'](getApiBaseUrl),_0x3b1d96={'Content-Type':_0x35262f(0xa7),'workos-token':_0x26ae9f},_0xcbacf7=await fetchUserProfile(_0x26ae9f),_0x4efc71=_0xcbacf7?.['firstName']||_0xcbacf7?.['email']?.['split']('@')[0x0],_0x4d5c2e=_0x4efc71?_0x4efc71+_0x35262f(0xcb):'CLI\x20Key';let _0x7e20e0=[];try{const _0x21ec13=await _0x24ae35[_0x35262f(0xa5)](fetch,_0x56e651+'/api-keys',{'method':_0x24ae35['Edyun'],'headers':_0x3b1d96});if(_0x21ec13['ok']){const _0x1de0a5=await _0x21ec13[_0x35262f(0x9f)]();_0x7e20e0=_0x1de0a5['apiKeys'];}}catch{}const _0x472147=buildKeyName(_0x4d5c2e,_0x7e20e0),_0x5c204e=await fetch(_0x56e651+'/api-keys',{'method':_0x35262f(0xc9),'headers':_0x3b1d96,'body':JSON['stringify']({'name':_0x472147,'scope':'mcp:write'})});if(!_0x5c204e['ok']){const _0x1bd1bb=await _0x5c204e['text']();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x5c204e['status']+'\x20'+_0x1bd1bb);}const _0x4d3b5c=await _0x5c204e['json']();return _0x4d3b5c[_0x35262f(0xb6)]['token'];}export function openBrowser(_0x44f4a0){const _0x561f70=_0x4e2228,_0x4e9ca6={'PYICL':function(_0x337148,_0x438c03){return _0x337148===_0x438c03;},'NrBNN':'open','vHYqz':function(_0x34b18d,_0x20c7ee,_0x9e7c2f,_0x20242c){return _0x34b18d(_0x20c7ee,_0x9e7c2f,_0x20242c);}};try{if(_0x4e9ca6[_0x561f70(0x93)](process['platform'],_0x561f70(0xb0))){const _0x57c14c=spawn(_0x561f70(0xc1),['/c',_0x561f70(0xb9),'',_0x44f4a0],{'detached':!![],'stdio':_0x561f70(0xc6),'windowsHide':!![]});_0x57c14c['unref']();return;}const _0x234315=_0x4e9ca6['PYICL'](process['platform'],_0x561f70(0x99))?_0x4e9ca6['NrBNN']:'xdg-open',_0x323a44=_0x4e9ca6['vHYqz'](spawn,_0x234315,[_0x44f4a0],{'detached':!![],'stdio':_0x561f70(0xc6)});_0x323a44['unref']();}catch{}}function decodeJwtPayload(_0x40f598){const _0xe1085a=_0x4e2228,_0x3d7fc2={'IgwOr':function(_0x28a098,_0x51b631){return _0x28a098!==_0x51b631;},'xeYZb':'base64url','XbepT':_0xe1085a(0x90)},_0x7899b6=_0x40f598['split']('.');if(_0x3d7fc2[_0xe1085a(0x95)](_0x7899b6[_0xe1085a(0xbf)],0x3))throw new Error(_0xe1085a(0xa2));const _0x53a558=Buffer['from'](_0x7899b6[0x1],_0x3d7fc2['xeYZb'])[_0xe1085a(0xcc)](_0x3d7fc2['XbepT']);return JSON[_0xe1085a(0xb4)](_0x53a558);}async function selfServeSignup(_0x12a075){const _0x1781a9=_0x4e2228,_0x49cc3a={'KKsEw':function(_0x211847,_0x4340f3,_0x23decf){return _0x211847(_0x4340f3,_0x23decf);},'zdZLp':_0x1781a9(0xc9),'wZSPM':'application/json'},_0x217950=getApiBaseUrl(),_0xb71912=await _0x49cc3a['KKsEw'](fetch,_0x217950+'/organization/self-serve-signup',{'method':_0x49cc3a['zdZLp'],'headers':{'Content-Type':_0x49cc3a[_0x1781a9(0xb8)],'workos-token':_0x12a075}});if(!_0xb71912['ok']){const _0x715d55=await _0xb71912['text']();throw new Error(_0x1781a9(0x9b)+_0xb71912['status']+'\x20'+_0x715d55);}return _0xb71912[_0x1781a9(0x9f)]();}async function fetchMyMemberships(_0x577cce){const _0x53c9a4=_0x4e2228,_0x211874={'AIuUe':function(_0x49d409){return _0x49d409();},'JJRbj':_0x53c9a4(0xc2)},_0xc4e201=_0x211874['AIuUe'](getApiBaseUrl),_0x17d717=await fetch(_0xc4e201+_0x53c9a4(0xda),{'method':_0x211874[_0x53c9a4(0xac)],'headers':{'workos-token':_0x577cce}});if(!_0x17d717['ok']){const _0xf69642=await _0x17d717[_0x53c9a4(0xcf)]();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x17d717[_0x53c9a4(0xd1)]+'\x20'+_0xf69642);}const _0x5e9443=await _0x17d717[_0x53c9a4(0x9f)]();return _0x5e9443['memberships'];}async function refreshTokenWithOrg(_0x1f25fc,_0xc108bf,_0x3317c6){const _0xf2b20d=_0x4e2228,_0x2dfae8={'MxaKt':function(_0x58a9b4,_0x1f904d,_0x1e4b81){return _0x58a9b4(_0x1f904d,_0x1e4b81);},'GUlYN':_0xf2b20d(0xc9),'pBoon':'application/x-www-form-urlencoded'},_0x46fe56=await _0x2dfae8[_0xf2b20d(0x9e)](fetch,WORKOS_TOKEN_URL,{'method':_0x2dfae8['GUlYN'],'headers':{'Content-Type':_0x2dfae8['pBoon']},'body':new URLSearchParams({'client_id':_0x1f25fc,'grant_type':'refresh_token','refresh_token':_0xc108bf,'organization_id':_0x3317c6})});if(!_0x46fe56['ok']){const _0x1185d5=await _0x46fe56['text']();throw new Error(_0xf2b20d(0xc8)+_0x46fe56[_0xf2b20d(0xd1)]+'\x20'+_0x1185d5);}return _0x46fe56['json']();}async function provisionCliToken(_0x13cef4){const _0x577e93=_0x4e2228,_0x20aa80={'doPvS':_0x577e93(0xc9),'MvSVA':_0x577e93(0xa7)},_0x5bdba6=getApiBaseUrl(),_0x26f7d5=await fetch(_0x5bdba6+_0x577e93(0xc3),{'method':_0x20aa80[_0x577e93(0xb2)],'headers':{'Content-Type':_0x20aa80[_0x577e93(0xb1)],'workos-token':_0x13cef4}});if(!_0x26f7d5['ok']){const _0x8d4236=await _0x26f7d5['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x26f7d5[_0x577e93(0xd1)]+'\x20'+_0x8d4236);}return _0x26f7d5[_0x577e93(0x9f)]();}export async function runDeviceAuthFlow(){const _0x2e2995=_0x4e2228,_0x6334d7={'ofRhd':function(_0x12f291,_0x5a83ee){return _0x12f291(_0x5a83ee);},'AyTtF':'\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','JwdWt':function(_0x3f9b18,_0x5c1be4){return _0x3f9b18(_0x5c1be4);},'WofiM':function(_0x1ef9c5,_0x3392f2){return _0x1ef9c5===_0x3392f2;},'ckQIq':'Setting\x20up\x20your\x20organization...','HRVvs':'list','DuFFx':'selected','fxlac':function(_0x1e7229,_0x20f7e6,_0x26f8c1,_0x21856d){return _0x1e7229(_0x20f7e6,_0x26f8c1,_0x21856d);},'ZrMQH':function(_0x981d5a,_0x4d41ee){return _0x981d5a(_0x4d41ee);}},_0x27357a=getCurrentEnvironment(),_0x1abccd=ENVIRONMENT_CONFIGS[_0x27357a][_0x2e2995(0xdb)],_0x1284f5=await _0x6334d7[_0x2e2995(0xa8)](requestDeviceCode,_0x1abccd);console[_0x2e2995(0x97)](_0x6334d7[_0x2e2995(0xbb)]),console[_0x2e2995(0x97)](_0x2e2995(0xd7)),_0x6334d7['ofRhd'](openBrowser,_0x1284f5['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x1284f5['verification_uri_complete']),console[_0x2e2995(0x97)](_0x2e2995(0x91)+_0x1284f5['user_code']+'\x0a'),process[_0x2e2995(0xc5)][_0x2e2995(0x9a)](_0x2e2995(0xbe));let _0x12bc69=await pollForTokens(_0x1abccd,_0x1284f5[_0x2e2995(0xaf)],_0x1284f5['interval'],_0x1284f5['expires_in']);console['log']('\x20✓');const _0x496b84=_0x6334d7[_0x2e2995(0xaa)](decodeJwtPayload,_0x12bc69['access_token']);if(!_0x496b84['org_id']){const _0x419186=await fetchMyMemberships(_0x12bc69['access_token']);let _0x7f59c8;if(_0x6334d7['WofiM'](_0x419186[_0x2e2995(0xbf)],0x0)){process['stdout'][_0x2e2995(0x9a)](_0x6334d7[_0x2e2995(0x92)]);const _0x2677b9=await _0x6334d7[_0x2e2995(0xaa)](selfServeSignup,_0x12bc69[_0x2e2995(0xc7)]);_0x7f59c8=_0x2677b9[_0x2e2995(0xa9)],console[_0x2e2995(0x97)]('\x20✓');}else{if(_0x419186['length']===0x1)_0x7f59c8=_0x419186[0x0][_0x2e2995(0xa9)],console[_0x2e2995(0x97)]('Using\x20organization:\x20'+_0x419186[0x0]['name']);else{const _0x193f6b=process[_0x2e2995(0xb3)][_0x2e2995(0xd8)]&&process[_0x2e2995(0xc5)][_0x2e2995(0xd8)];if(!_0x193f6b)throw new Error(_0x2e2995(0x98)+_0x2e2995(0xc0));const {selected:_0x56f215}=await _0x222c6e['prompt']([{'type':_0x6334d7[_0x2e2995(0xa1)],'name':_0x6334d7['DuFFx'],'message':'Select\x20an\x20organization:','choices':_0x419186[_0x2e2995(0xd0)](_0x4fe42b=>({'name':_0x4fe42b[_0x2e2995(0xc4)],'value':_0x4fe42b[_0x2e2995(0xa9)]}))}]);_0x7f59c8=_0x56f215;}}_0x12bc69=await _0x6334d7['fxlac'](refreshTokenWithOrg,_0x1abccd,_0x12bc69['refresh_token'],_0x7f59c8);}process['stdout']['write']('Provisioning\x20CLI\x20token...');const _0x5b4919=await provisionCliToken(_0x12bc69['access_token']);return console['log']('\x20✓'),await _0x6334d7[_0x2e2995(0xaa)](storeToken,_0x5b4919['token']),_0x12bc69[_0x2e2995(0xab)]&&await _0x6334d7['ZrMQH'](storeRefreshToken,_0x12bc69['refresh_token']),_0x5b4919['token'];}function sleep(_0x1aadef){return new Promise(_0x4252a0=>setTimeout(_0x4252a0,_0x1aadef));}
1
+ (function(_0x524be5,_0x18e164){const _0x55b2dd=_0x5bea,_0x1abaec=_0x524be5();while(!![]){try{const _0x399b13=parseInt(_0x55b2dd(0x184))/0x1+-parseInt(_0x55b2dd(0x1a0))/0x2+-parseInt(_0x55b2dd(0x15d))/0x3+-parseInt(_0x55b2dd(0x15e))/0x4*(-parseInt(_0x55b2dd(0x16a))/0x5)+-parseInt(_0x55b2dd(0x198))/0x6*(-parseInt(_0x55b2dd(0x161))/0x7)+parseInt(_0x55b2dd(0x19d))/0x8+-parseInt(_0x55b2dd(0x194))/0x9;if(_0x399b13===_0x18e164)break;else _0x1abaec['push'](_0x1abaec['shift']());}catch(_0x5b0a4c){_0x1abaec['push'](_0x1abaec['shift']());}}}(_0x134e,0x9f63f));import{spawn}from'child_process';import _0x3ecf9a from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';function _0x5bea(_0x166c7f,_0x4e4a4d){_0x166c7f=_0x166c7f-0x15a;const _0x134e44=_0x134e();let _0x5bea2d=_0x134e44[_0x166c7f];return _0x5bea2d;}import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0xb7aba){const _0x182034=_0x5bea,_0x13e353=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':'POST','headers':{'Content-Type':_0x182034(0x163)},'body':new URLSearchParams({'client_id':_0xb7aba})});if(!_0x13e353['ok']){const _0x5a22fb=await _0x13e353['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x13e353['status']+'\x20'+_0x5a22fb);}return _0x13e353[_0x182034(0x188)]();}export async function pollForTokens(_0x1a0917,_0x161ec5,_0x25fca5,_0x5e14f6){const _0xf427e5=_0x5bea,_0x7948f5={'zeyJk':function(_0x143bac,_0x3ce8ba){return _0x143bac*_0x3ce8ba;},'uBFWP':function(_0x9afacf,_0x5a4a3d,_0x42017a){return _0x9afacf(_0x5a4a3d,_0x42017a);},'ZDhPg':'urn:ietf:params:oauth:grant-type:device_code','dQCeb':'authorization_pending','erYsl':function(_0x51aadb,_0x37e3f8){return _0x51aadb===_0x37e3f8;},'wqnMj':'slow_down','ujaOW':_0xf427e5(0x18a),'HLQAw':'Device\x20authorization\x20timed\x20out'},_0x228ed7=Date['now']()+_0x5e14f6*0x3e8;let _0x176d7d=_0x7948f5[_0xf427e5(0x172)](_0x25fca5,0x3e8);while(Date[_0xf427e5(0x17e)]()<_0x228ed7){await sleep(_0x176d7d);const _0x2a49d9=await _0x7948f5[_0xf427e5(0x1a3)](fetch,WORKOS_TOKEN_URL,{'method':_0xf427e5(0x17c),'headers':{'Content-Type':_0xf427e5(0x163)},'body':new URLSearchParams({'client_id':_0x1a0917,'device_code':_0x161ec5,'grant_type':_0x7948f5[_0xf427e5(0x171)]})});if(_0x2a49d9['ok'])return _0x2a49d9[_0xf427e5(0x188)]();const _0x24a1da=await _0x2a49d9['json']();if(_0x24a1da[_0xf427e5(0x1a1)]===_0x7948f5['dQCeb'])continue;if(_0x7948f5[_0xf427e5(0x16e)](_0x24a1da['error'],_0x7948f5[_0xf427e5(0x174)])){_0x176d7d+=0x3e8;continue;}throw new Error(_0x24a1da[_0xf427e5(0x197)]||_0x24a1da['error']||_0x7948f5[_0xf427e5(0x166)]);}throw new Error(_0x7948f5['HLQAw']);}async function fetchUserProfile(_0x418205){const _0x257d16=_0x5bea,_0x155400={'Prkov':function(_0xb760a5,_0x5eb937,_0x236f3c){return _0xb760a5(_0x5eb937,_0x236f3c);},'ovfSJ':_0x257d16(0x18b)},_0x448bbf=getApiBaseUrl();try{const _0x54e1e2=await _0x155400[_0x257d16(0x186)](fetch,_0x448bbf+_0x257d16(0x173),{'method':_0x155400['ovfSJ'],'headers':{'workos-token':_0x418205}});if(_0x54e1e2['ok'])return _0x54e1e2['json']();}catch{}return null;}function buildKeyName(_0xf70f99,_0x1a0239){const _0x4afdc9=_0x5bea,_0x44e691={'eWSsw':function(_0x138358,_0x5820b6){return _0x138358===_0x5820b6;},'ARwAI':function(_0x4e52de,_0x207bb3){return _0x4e52de+_0x207bb3;}},_0x8ae2a6=_0x1a0239[_0x4afdc9(0x15c)](_0x17f641=>_0x17f641[_0x4afdc9(0x164)]===_0xf70f99||_0x17f641['name'][_0x4afdc9(0x181)](_0xf70f99+'\x20('));if(_0x44e691['eWSsw'](_0x8ae2a6[_0x4afdc9(0x17d)],0x0))return _0xf70f99;return _0xf70f99+'\x20('+_0x44e691['ARwAI'](_0x8ae2a6[_0x4afdc9(0x17d)],0x1)+')';}export async function provisionApiKey(_0x2971cf){const _0x4fa7aa=_0x5bea,_0x1c8845={'DwsOA':function(_0x1ba9c4){return _0x1ba9c4();},'tVybd':function(_0x1542b7,_0x1b1ce0,_0x204836){return _0x1542b7(_0x1b1ce0,_0x204836);},'FCozf':function(_0x26c524,_0x528021,_0x3fe34d){return _0x26c524(_0x528021,_0x3fe34d);},'seWYM':_0x4fa7aa(0x17c)},_0x1da4de=_0x1c8845['DwsOA'](getApiBaseUrl),_0x41137c={'Content-Type':'application/json','workos-token':_0x2971cf},_0xd2e7f6=await fetchUserProfile(_0x2971cf),_0x338e30=_0xd2e7f6?.['firstName']||_0xd2e7f6?.['email']?.['split']('@')[0x0],_0x560514=_0x338e30?_0x338e30+_0x4fa7aa(0x193):'CLI\x20Key';let _0x4d399d=[];try{const _0x15d107=await _0x1c8845['tVybd'](fetch,_0x1da4de+'/api-keys',{'method':'GET','headers':_0x41137c});if(_0x15d107['ok']){const _0xdea6d3=await _0x15d107['json']();_0x4d399d=_0xdea6d3['apiKeys'];}}catch{}const _0x52ede6=_0x1c8845[_0x4fa7aa(0x17f)](buildKeyName,_0x560514,_0x4d399d),_0x4a3be8=await _0x1c8845['FCozf'](fetch,_0x1da4de+_0x4fa7aa(0x17b),{'method':_0x1c8845['seWYM'],'headers':_0x41137c,'body':JSON['stringify']({'name':_0x52ede6,'scope':_0x4fa7aa(0x167)})});if(!_0x4a3be8['ok']){const _0x1a1e99=await _0x4a3be8['text']();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x4a3be8['status']+'\x20'+_0x1a1e99);}const _0xaf84a3=await _0x4a3be8[_0x4fa7aa(0x188)]();return _0xaf84a3[_0x4fa7aa(0x1a5)][_0x4fa7aa(0x19e)];}function _0x134e(){const _0x103e17=['access_token','9837504qVGkOe','token','darwin','2607200knpDKs','error','workosClientId','uBFWP','win32','apiKey','isTTY','stdout','open','toString','ignore','parse','pivmN','filter','1568403NiRGgI','1128532STwYiy','utf-8','memberships','5012224tOxJQd','lIQJE','application/x-www-form-urlencoded','name','Using\x20organization:\x20','ujaOW','mcp:write','log','verification_uri_complete','5keDVXV','status','nXRPU','write','erYsl','eNJlp','KpScj','ZDhPg','zeyJk','/organization/me','wqnMj','list','/organization/my-memberships','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','prompt','Provisioning\x20CLI\x20token...','Failed\x20to\x20provision\x20CLI\x20token:\x20','/api-keys','POST','length','now','tVybd','cmd','startsWith','vvWrR','base64url','1252430TaRjLv','Invalid\x20JWT\x20format','Prkov','eqZNR','json','refresh_token','Authentication\x20failed','GET','text','device_code','/organization/self-serve-signup','tGlbH','organizationId','xdg-open','Waiting\x20for\x20authentication...','\x27s\x20CLI\x20Key','9009171yLWGhN','interval','dIEGA','error_description','6XxIMfy','expires_in','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','Shppd'];_0x134e=function(){return _0x103e17;};return _0x134e();}export function openBrowser(_0x4e243e){const _0x12bd7a=_0x5bea,_0x28e25b={'Kcsyj':function(_0x5be525,_0x13e4ae){return _0x5be525===_0x13e4ae;},'OUfrY':function(_0x120b9b,_0x531aef,_0x31e57f,_0x5be701){return _0x120b9b(_0x531aef,_0x31e57f,_0x5be701);},'kwsXd':_0x12bd7a(0x180),'JxXGw':function(_0xe5c490,_0x5acf69){return _0xe5c490===_0x5acf69;},'SPPJY':_0x12bd7a(0x19f),'vvWrR':'ignore'};try{if(_0x28e25b['Kcsyj'](process['platform'],_0x12bd7a(0x1a4))){const _0x2ea98d=_0x28e25b['OUfrY'](spawn,_0x28e25b['kwsXd'],['/c','start','',_0x4e243e],{'detached':!![],'stdio':_0x12bd7a(0x1aa),'windowsHide':!![]});_0x2ea98d['unref']();return;}const _0x586c9c=_0x28e25b['JxXGw'](process['platform'],_0x28e25b['SPPJY'])?_0x12bd7a(0x1a8):_0x12bd7a(0x191),_0x58e1ad=spawn(_0x586c9c,[_0x4e243e],{'detached':!![],'stdio':_0x28e25b[_0x12bd7a(0x182)]});_0x58e1ad['unref']();}catch{}}function decodeJwtPayload(_0x5e2b6a){const _0x381cb0=_0x5bea,_0x17bd2a={'rlhjg':function(_0x15a400,_0x625766){return _0x15a400!==_0x625766;},'eNJlp':_0x381cb0(0x185),'Shppd':_0x381cb0(0x183),'bbuSc':_0x381cb0(0x15f)},_0x4c2bc1=_0x5e2b6a['split']('.');if(_0x17bd2a['rlhjg'](_0x4c2bc1[_0x381cb0(0x17d)],0x3))throw new Error(_0x17bd2a[_0x381cb0(0x16f)]);const _0x2ee714=Buffer['from'](_0x4c2bc1[0x1],_0x17bd2a[_0x381cb0(0x19b)])[_0x381cb0(0x1a9)](_0x17bd2a['bbuSc']);return JSON[_0x381cb0(0x15a)](_0x2ee714);}async function selfServeSignup(_0x531b29){const _0x16f3c7=_0x5bea,_0x1ae806={'eqZNR':function(_0x2a57f2){return _0x2a57f2();},'KpScj':function(_0x4cf516,_0x1bdf6e,_0x54a79e){return _0x4cf516(_0x1bdf6e,_0x54a79e);},'AnIYm':'application/json'},_0x3e5892=_0x1ae806[_0x16f3c7(0x187)](getApiBaseUrl),_0xeef524=await _0x1ae806[_0x16f3c7(0x170)](fetch,_0x3e5892+_0x16f3c7(0x18e),{'method':'POST','headers':{'Content-Type':_0x1ae806['AnIYm'],'workos-token':_0x531b29}});if(!_0xeef524['ok']){const _0x2031b6=await _0xeef524[_0x16f3c7(0x18c)]();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0xeef524[_0x16f3c7(0x16b)]+'\x20'+_0x2031b6);}return _0xeef524[_0x16f3c7(0x188)]();}async function fetchMyMemberships(_0x19ee43){const _0x35ac2d=_0x5bea,_0x3fce7c={'Gcwse':function(_0x5a7257){return _0x5a7257();},'ESqxL':_0x35ac2d(0x18b)},_0x586e26=_0x3fce7c['Gcwse'](getApiBaseUrl),_0x2f2bff=await fetch(_0x586e26+_0x35ac2d(0x176),{'method':_0x3fce7c['ESqxL'],'headers':{'workos-token':_0x19ee43}});if(!_0x2f2bff['ok']){const _0x37ac78=await _0x2f2bff['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x2f2bff[_0x35ac2d(0x16b)]+'\x20'+_0x37ac78);}const _0x554094=await _0x2f2bff['json']();return _0x554094[_0x35ac2d(0x160)];}async function refreshTokenWithOrg(_0x1e1495,_0x4497c6,_0x559929){const _0x120e2c=_0x5bea,_0x14daa9=await fetch(WORKOS_TOKEN_URL,{'method':_0x120e2c(0x17c),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x1e1495,'grant_type':'refresh_token','refresh_token':_0x4497c6,'organization_id':_0x559929})});if(!_0x14daa9['ok']){const _0x1f145d=await _0x14daa9['text']();throw new Error(_0x120e2c(0x177)+_0x14daa9[_0x120e2c(0x16b)]+'\x20'+_0x1f145d);}return _0x14daa9[_0x120e2c(0x188)]();}async function provisionCliToken(_0x32f8ef){const _0x1788ba=_0x5bea,_0x4c67d6={'pivmN':function(_0x2c4656){return _0x2c4656();}},_0x46796a=_0x4c67d6[_0x1788ba(0x15b)](getApiBaseUrl),_0x3cb181=await fetch(_0x46796a+'/cli-auth/token',{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x32f8ef}});if(!_0x3cb181['ok']){const _0x42fc78=await _0x3cb181['text']();throw new Error(_0x1788ba(0x17a)+_0x3cb181[_0x1788ba(0x16b)]+'\x20'+_0x42fc78);}return _0x3cb181[_0x1788ba(0x188)]();}export async function runDeviceAuthFlow(){const _0x281299=_0x5bea,_0x1daa71={'tGlbH':function(_0x487563){return _0x487563();},'VKsWj':'\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','cRonq':function(_0xafe4c2,_0x56245d,_0x756428,_0x2eb7f2,_0x56911c){return _0xafe4c2(_0x56245d,_0x756428,_0x2eb7f2,_0x56911c);},'dIEGA':function(_0x40b0b5,_0x1d4a85){return _0x40b0b5===_0x1d4a85;},'nXRPU':function(_0x2ee52d,_0x36a096){return _0x2ee52d(_0x36a096);},'UJHDP':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','KXxAE':function(_0x41078c,_0xe10349,_0x433adf,_0x4a8b3b){return _0x41078c(_0xe10349,_0x433adf,_0x4a8b3b);},'lIQJE':_0x281299(0x179)},_0x12c4b5=_0x1daa71[_0x281299(0x18f)](getCurrentEnvironment),_0x265c35=ENVIRONMENT_CONFIGS[_0x12c4b5][_0x281299(0x1a2)],_0x53a095=await requestDeviceCode(_0x265c35);console['log'](_0x1daa71['VKsWj']),console['log']('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),openBrowser(_0x53a095[_0x281299(0x169)]),console[_0x281299(0x168)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x53a095['verification_uri_complete']),console[_0x281299(0x168)]('Code:\x20'+_0x53a095['user_code']+'\x0a'),process[_0x281299(0x1a7)][_0x281299(0x16d)](_0x281299(0x192));let _0x1b4dd7=await _0x1daa71['cRonq'](pollForTokens,_0x265c35,_0x53a095[_0x281299(0x18d)],_0x53a095[_0x281299(0x195)],_0x53a095[_0x281299(0x199)]);console[_0x281299(0x168)]('\x20✓');const _0x554981=decodeJwtPayload(_0x1b4dd7['access_token']);if(!_0x554981['org_id']){const _0x140591=await fetchMyMemberships(_0x1b4dd7[_0x281299(0x19c)]);let _0x19de69;if(_0x1daa71[_0x281299(0x196)](_0x140591['length'],0x0)){process[_0x281299(0x1a7)][_0x281299(0x16d)]('Setting\x20up\x20your\x20organization...');const _0xd25d7b=await _0x1daa71[_0x281299(0x16c)](selfServeSignup,_0x1b4dd7[_0x281299(0x19c)]);_0x19de69=_0xd25d7b[_0x281299(0x190)],console['log']('\x20✓');}else{if(_0x1daa71['dIEGA'](_0x140591['length'],0x1))_0x19de69=_0x140591[0x0]['organizationId'],console[_0x281299(0x168)](_0x281299(0x165)+_0x140591[0x0]['name']);else{const _0x38dbc0=process['stdin']['isTTY']&&process['stdout'][_0x281299(0x1a6)];if(!_0x38dbc0)throw new Error(_0x281299(0x19a)+_0x1daa71['UJHDP']);const {selected:_0x41ee3a}=await _0x3ecf9a[_0x281299(0x178)]([{'type':_0x281299(0x175),'name':'selected','message':'Select\x20an\x20organization:','choices':_0x140591['map'](_0x45b215=>({'name':_0x45b215['name'],'value':_0x45b215['organizationId']}))}]);_0x19de69=_0x41ee3a;}}_0x1b4dd7=await _0x1daa71['KXxAE'](refreshTokenWithOrg,_0x265c35,_0x1b4dd7['refresh_token'],_0x19de69);}process['stdout'][_0x281299(0x16d)](_0x1daa71[_0x281299(0x162)]);const _0x102da4=await provisionCliToken(_0x1b4dd7[_0x281299(0x19c)]);return console[_0x281299(0x168)]('\x20✓'),await _0x1daa71['nXRPU'](storeToken,_0x102da4['token']),_0x1b4dd7['refresh_token']&&await storeRefreshToken(_0x1b4dd7[_0x281299(0x189)]),_0x102da4['token'];}function sleep(_0x3988fd){return new Promise(_0x236b6a=>setTimeout(_0x236b6a,_0x3988fd));}
@@ -1 +1 @@
1
- const _0x2d5421=_0x381e;(function(_0x53fb9a,_0x41ddfc){const _0xe064bf=_0x381e,_0x1bc902=_0x53fb9a();while(!![]){try{const _0x295c38=parseInt(_0xe064bf(0x153))/0x1+-parseInt(_0xe064bf(0x13a))/0x2+-parseInt(_0xe064bf(0x151))/0x3+parseInt(_0xe064bf(0x141))/0x4+-parseInt(_0xe064bf(0x137))/0x5*(-parseInt(_0xe064bf(0x147))/0x6)+-parseInt(_0xe064bf(0x14f))/0x7+parseInt(_0xe064bf(0x146))/0x8;if(_0x295c38===_0x41ddfc)break;else _0x1bc902['push'](_0x1bc902['shift']());}catch(_0x5f2d4f){_0x1bc902['push'](_0x1bc902['shift']());}}}(_0xf8ae,0x31cf9));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x2d5421(0x13e),'workosClientId':_0x2d5421(0x13d),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':_0x2d5421(0x14b)},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':_0x2d5421(0x14e),'aiProxyUrl':'https://ai-proxy-301751771437.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':_0x2d5421(0x14c),'workosClientId':_0x2d5421(0x14e),'aiProxyUrl':_0x2d5421(0x14d),'mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT=_0x2d5421(0x145);export function isValidEnvironment(_0x39948c){const _0x319449=_0x2d5421,_0x5af67a={'tDgba':function(_0x106ee1,_0x17b150){return _0x106ee1===_0x17b150;},'fsyUg':'prod','XhZFH':function(_0x33d309,_0x2c6df1){return _0x33d309===_0x2c6df1;},'ykkdu':'staging'};return _0x5af67a['tDgba'](_0x39948c,_0x5af67a[_0x319449(0x148)])||_0x5af67a[_0x319449(0x13b)](_0x39948c,_0x5af67a[_0x319449(0x152)])||_0x5af67a[_0x319449(0x142)](_0x39948c,_0x319449(0x13f));}function _0xf8ae(){const _0x24a264=['aiProxyUrl','client_01J9CBYM7M5ZETCF7G6614DXR2','https://api.ranger.net','local','RANGER_CLI_ENV','1553896UcrbBB','tDgba','RANGER_DISABLE_MCP','RANGER_BYOK','prod','1306608BCKnzo','151770CKdPgO','fsyUg','CTWyh','UlXWR','https://mcp-auth.ranger.net/mcp','http://localhost:8080','http://localhost:8090','client_01J9CBYM2DKWV9HM17D95Z540K','449260sRSEGr','Dpxty','1172508oBpwaj','ykkdu','96697KDMupi','ajrKV','env','25XuzBIA','true','mcp','231862IhInyM','XhZFH'];_0xf8ae=function(){return _0x24a264;};return _0xf8ae();}function _0x381e(_0x39bc44,_0x293b1c){_0x39bc44=_0x39bc44-0x136;const _0xf8ae7=_0xf8ae();let _0x381ef6=_0xf8ae7[_0x39bc44];return _0x381ef6;}export function getCurrentEnvironment(){const _0x2bcb39=_0x2d5421,_0x5aa096={'POJzR':function(_0x5d34e6,_0x53e4db){return _0x5d34e6(_0x53e4db);}},_0xc4a5d8=process['env'][_0x2bcb39(0x140)];if(_0xc4a5d8&&_0x5aa096['POJzR'](isValidEnvironment,_0xc4a5d8))return _0xc4a5d8;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x34fdd4=_0x2d5421,_0x38249e={'CTWyh':function(_0x5f0d94){return _0x5f0d94();}};return ENVIRONMENT_CONFIGS[_0x38249e[_0x34fdd4(0x149)](getCurrentEnvironment)]['apiBaseUrl'];}export function getAiProxyUrl(){const _0x55a441=_0x2d5421;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x55a441(0x13c)];}export function getMcpAuthUrl(){return process['env']['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['mcpAuthUrl'];}export function isByokEnabled(){const _0x5dcd8d=_0x2d5421,_0x57c3f4={'FlwwT':function(_0x37baea,_0x52f0fb){return _0x37baea===_0x52f0fb;},'Dpxty':'true'};return _0x57c3f4['FlwwT'](process[_0x5dcd8d(0x136)][_0x5dcd8d(0x144)],_0x57c3f4[_0x5dcd8d(0x150)]);}export function isMcpDisabled(){const _0x390191=_0x2d5421,_0xdaf5dc={'UlXWR':function(_0x53c9b2,_0x563bfa){return _0x53c9b2===_0x563bfa;},'Gkifh':_0x390191(0x138)};return _0xdaf5dc[_0x390191(0x14a)](process['env'][_0x390191(0x143)],_0xdaf5dc['Gkifh']);}export function getVerificationTransport(){const _0x2f3301=_0x2d5421,_0x2dbb2f={'ajrKV':function(_0x455888){return _0x455888();},'Zwtfd':_0x2f3301(0x139)};return _0x2dbb2f[_0x2f3301(0x154)](isMcpDisabled)?'playwright-cli':_0x2dbb2f['Zwtfd'];}
1
+ function _0x1f2d(_0x2a30e8,_0x4d8f3f){_0x2a30e8=_0x2a30e8-0x1e6;const _0x9ec805=_0x9ec8();let _0x1f2df9=_0x9ec805[_0x2a30e8];return _0x1f2df9;}const _0x593cd7=_0x1f2d;(function(_0x45b7e2,_0x31a683){const _0x2cb2dc=_0x1f2d,_0x30adaf=_0x45b7e2();while(!![]){try{const _0xe69f1c=-parseInt(_0x2cb2dc(0x1e8))/0x1+-parseInt(_0x2cb2dc(0x1f4))/0x2+-parseInt(_0x2cb2dc(0x1eb))/0x3*(parseInt(_0x2cb2dc(0x1e9))/0x4)+parseInt(_0x2cb2dc(0x1ff))/0x5*(parseInt(_0x2cb2dc(0x1f5))/0x6)+-parseInt(_0x2cb2dc(0x1ea))/0x7+-parseInt(_0x2cb2dc(0x203))/0x8*(-parseInt(_0x2cb2dc(0x208))/0x9)+-parseInt(_0x2cb2dc(0x205))/0xa*(-parseInt(_0x2cb2dc(0x202))/0xb);if(_0xe69f1c===_0x31a683)break;else _0x30adaf['push'](_0x30adaf['shift']());}catch(_0x58f719){_0x30adaf['push'](_0x30adaf['shift']());}}}(_0x9ec8,0x67366));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':'client_01J9CBYM7M5ZETCF7G6614DXR2','aiProxyUrl':_0x593cd7(0x1fa),'mcpAuthUrl':_0x593cd7(0x1f6)},'staging':{'apiBaseUrl':_0x593cd7(0x200),'workosClientId':_0x593cd7(0x1ee),'aiProxyUrl':_0x593cd7(0x1ec),'mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':_0x593cd7(0x209),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x593cd7(0x1f3),'mcpAuthUrl':_0x593cd7(0x1fb)}};export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x387627){const _0x4d1794=_0x593cd7,_0x492ba0={'esKJJ':'prod','WqlrQ':function(_0x21612e,_0x482073){return _0x21612e===_0x482073;},'LgwHn':_0x4d1794(0x1f2),'teVAI':'local'};return _0x387627===_0x492ba0['esKJJ']||_0x492ba0[_0x4d1794(0x1e6)](_0x387627,_0x492ba0[_0x4d1794(0x1fd)])||_0x387627===_0x492ba0['teVAI'];}export function getCurrentEnvironment(){const _0x43bfec=_0x593cd7,_0x41b2d9={'WpjbG':function(_0x395b2f,_0x566ff5){return _0x395b2f(_0x566ff5);}},_0x57d440=process[_0x43bfec(0x1fe)][_0x43bfec(0x1ef)];if(_0x57d440&&_0x41b2d9[_0x43bfec(0x1e7)](isValidEnvironment,_0x57d440))return _0x57d440;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x421cad=_0x593cd7,_0x500552={'vJfjy':function(_0x12e005){return _0x12e005();}};return ENVIRONMENT_CONFIGS[_0x500552[_0x421cad(0x206)](getCurrentEnvironment)][_0x421cad(0x1f9)];}export function getAiProxyUrl(){const _0x27a63c={'xgawy':function(_0x2241be){return _0x2241be();}};return ENVIRONMENT_CONFIGS[_0x27a63c['xgawy'](getCurrentEnvironment)]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x2b96eb=_0x593cd7;return process[_0x2b96eb(0x1fe)]['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['mcpAuthUrl'];}function _0x9ec8(){const _0x54723e=['93012YiWzHA','https://ai-proxy-301751771437.us-central1.run.app','mcp','client_01J9CBYM2DKWV9HM17D95Z540K','RANGER_CLI_ENV','FIJyh','RANGER_BYOK','staging','http://localhost:8090','1678470ciDbqi','3502806oPbxOH','https://mcp-auth.ranger.net/mcp','playwright-cli','IbiUQ','apiBaseUrl','https://ai-proxy-716115358910.us-central1.run.app','http://localhost:8080/mcp','true','LgwHn','env','5YaGvRt','https://api.staging.ranger.net','KnLtV','143WpiWqA','8MRitWi','OnNqi','1926010aWJYXh','vJfjy','MpefM','2159991tJqVbJ','http://localhost:8080','WqlrQ','WpjbG','770071KUKXLa','68YQNvya','5379367EFNRbK'];_0x9ec8=function(){return _0x54723e;};return _0x9ec8();}export function isByokEnabled(){const _0x311d88=_0x593cd7,_0x399df1={'IbiUQ':function(_0x27cceb,_0x4a5350){return _0x27cceb===_0x4a5350;},'KnLtV':_0x311d88(0x1fc)};return _0x399df1[_0x311d88(0x1f8)](process[_0x311d88(0x1fe)][_0x311d88(0x1f1)],_0x399df1[_0x311d88(0x201)]);}export function isMcpDisabled(){const _0x4f5568=_0x593cd7,_0x3946de={'MpefM':_0x4f5568(0x1fc)};return process['env']['RANGER_DISABLE_MCP']===_0x3946de[_0x4f5568(0x207)];}export function getVerificationTransport(){const _0x2d9664=_0x593cd7,_0xbfe5b={'QmtKx':function(_0x2bdb28){return _0x2bdb28();},'OnNqi':_0x2d9664(0x1f7),'FIJyh':_0x2d9664(0x1ed)};return _0xbfe5b['QmtKx'](isMcpDisabled)?_0xbfe5b[_0x2d9664(0x204)]:_0xbfe5b[_0x2d9664(0x1f0)];}
@@ -1 +1 @@
1
- (function(_0x56537a,_0x41475a){const _0x2052ae=_0x4401,_0x278920=_0x56537a();while(!![]){try{const _0x5486a7=-parseInt(_0x2052ae(0x148))/0x1+-parseInt(_0x2052ae(0x119))/0x2*(-parseInt(_0x2052ae(0x137))/0x3)+-parseInt(_0x2052ae(0x12c))/0x4*(parseInt(_0x2052ae(0x14b))/0x5)+parseInt(_0x2052ae(0x127))/0x6*(-parseInt(_0x2052ae(0x124))/0x7)+parseInt(_0x2052ae(0x134))/0x8+parseInt(_0x2052ae(0x13d))/0x9*(-parseInt(_0x2052ae(0x146))/0xa)+parseInt(_0x2052ae(0x11b))/0xb;if(_0x5486a7===_0x41475a)break;else _0x278920['push'](_0x278920['shift']());}catch(_0x2eac27){_0x278920['push'](_0x278920['shift']());}}}(_0x457c,0xdd085));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x314d1a){const _0x79d3f5=_0x4401,_0x273243={'dqznQ':function(_0x3fac56){return _0x3fac56();},'Fxdqp':'POST','EzJZm':'https://dashboard.ranger.net/billing'},_0x4a3da2=await getToken();if(!_0x4a3da2)throw new Error(_0x79d3f5(0x149));const _0x54881c=_0x273243[_0x79d3f5(0x11a)](getApiBaseUrl),_0x5bf3ae=await fetch(_0x54881c+_0x79d3f5(0x10e),{'method':_0x273243[_0x79d3f5(0x13f)],'headers':{'Authorization':_0x79d3f5(0x12d)+_0x4a3da2,'Content-Type':'application/json'},'body':JSON[_0x79d3f5(0x135)](_0x314d1a)});if(!_0x5bf3ae['ok']){if(_0x5bf3ae['status']===0x192){const _0x11372f=await _0x5bf3ae[_0x79d3f5(0x10f)](),_0x35ea14=_0x11372f['billingUrl']||_0x273243['EzJZm'];throw new Error((_0x11372f[_0x79d3f5(0x11f)]||'Feature\x20limit\x20exceeded')+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x35ea14);}const _0x28730b=await _0x5bf3ae['text']();throw new Error(_0x79d3f5(0x132)+_0x28730b);}return _0x5bf3ae[_0x79d3f5(0x10f)]();}export async function listFeatures(_0x2538b7){const _0x2ac2e1=_0x4401,_0x514ef8={'hXDEj':function(_0x1e7b35){return _0x1e7b35();},'ODsEc':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','SbLed':_0x2ac2e1(0x114),'nEjFJ':'gitBranch','QcLbR':'limit','mKjzZ':'offset','dUNAY':'includeDeleted'},_0x41dffd=await _0x514ef8[_0x2ac2e1(0x133)](getToken);if(!_0x41dffd)throw new Error(_0x514ef8['ODsEc']);const _0x37b25c=_0x514ef8['hXDEj'](getApiBaseUrl),_0x12152e=new URLSearchParams();if(_0x2538b7?.[_0x2ac2e1(0x114)])_0x12152e['set'](_0x514ef8['SbLed'],_0x2538b7[_0x2ac2e1(0x114)]);if(_0x2538b7?.['gitBranch'])_0x12152e['set'](_0x514ef8['nEjFJ'],_0x2538b7[_0x2ac2e1(0x141)]);if(_0x2538b7?.['limit'])_0x12152e[_0x2ac2e1(0x11e)](_0x514ef8['QcLbR'],_0x2538b7[_0x2ac2e1(0x143)]['toString']());if(_0x2538b7?.['offset'])_0x12152e[_0x2ac2e1(0x11e)](_0x514ef8[_0x2ac2e1(0x12a)],_0x2538b7[_0x2ac2e1(0x147)]['toString']());if(_0x2538b7?.[_0x2ac2e1(0x116)])_0x12152e['set'](_0x514ef8[_0x2ac2e1(0x131)],'true');const _0x4984c4=_0x37b25c+'/api/v1/mcp/features'+(_0x12152e['toString']()?'?'+_0x12152e['toString']():''),_0x5ee29e=await fetch(_0x4984c4,{'method':'GET','headers':{'Authorization':_0x2ac2e1(0x12d)+_0x41dffd}});if(!_0x5ee29e['ok']){const _0x278f3b=await _0x5ee29e['text']();throw new Error(_0x2ac2e1(0x10a)+_0x278f3b);}return _0x5ee29e['json']();}export async function getFeature(_0x587a49){const _0x4d859b=_0x4401,_0x57d225={'akwbm':_0x4d859b(0x149),'yPZcb':function(_0x2c9f90){return _0x2c9f90();}},_0x5409e2=await getToken();if(!_0x5409e2)throw new Error(_0x57d225[_0x4d859b(0x118)]);const _0x3e9e1a=_0x57d225[_0x4d859b(0x12f)](getApiBaseUrl),_0x5b50c6=await fetch(_0x3e9e1a+'/api/v1/mcp/features/'+_0x587a49,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x5409e2}});if(!_0x5b50c6['ok']){const _0x52d925=await _0x5b50c6[_0x4d859b(0x130)]();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x52d925);}return _0x5b50c6[_0x4d859b(0x10f)]();}export async function updateFeature(_0x5111ec,_0xc9b7d1){const _0x2a2951=_0x4401,_0x355fd6={'rpZJB':_0x2a2951(0x149),'TTixq':function(_0x7dab11){return _0x7dab11();},'iQZlW':function(_0x57f4d3,_0x33ff8b,_0x4376cc){return _0x57f4d3(_0x33ff8b,_0x4376cc);},'eZWbm':_0x2a2951(0x129),'MMTeo':_0x2a2951(0x10d)},_0x502a06=await getToken();if(!_0x502a06)throw new Error(_0x355fd6['rpZJB']);const _0x13ea01=_0x355fd6[_0x2a2951(0x10b)](getApiBaseUrl),_0x5e7e37=await _0x355fd6['iQZlW'](fetch,_0x13ea01+_0x2a2951(0x126)+_0x5111ec,{'method':_0x355fd6['eZWbm'],'headers':{'Authorization':'Bearer\x20'+_0x502a06,'Content-Type':_0x355fd6['MMTeo']},'body':JSON[_0x2a2951(0x135)](_0xc9b7d1)});if(!_0x5e7e37['ok']){const _0x43aa4c=await _0x5e7e37['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x43aa4c);}return _0x5e7e37['json']();}export async function createChecklistItem(_0x3c97e9,_0x17a2ef,_0x3f3e8c){const _0x51f93d=_0x4401,_0x2d7c62={'KJlEQ':_0x51f93d(0x149),'LscxN':function(_0x3642b6){return _0x3642b6();},'qCMSc':'POST'},_0x511f2e=await getToken();if(!_0x511f2e)throw new Error(_0x2d7c62[_0x51f93d(0x13e)]);const _0x1b30db=_0x2d7c62[_0x51f93d(0x142)](getApiBaseUrl),_0x1620ad=await fetch(_0x1b30db+_0x51f93d(0x126)+_0x3c97e9+'/checklist',{'method':_0x2d7c62[_0x51f93d(0x138)],'headers':{'Authorization':'Bearer\x20'+_0x511f2e,'Content-Type':'application/json'},'body':JSON[_0x51f93d(0x135)]({'description':_0x17a2ef,'position':_0x3f3e8c})});if(!_0x1620ad['ok']){const _0x5941c3=await _0x1620ad['text']();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x5941c3);}return _0x1620ad['json']();}export async function updateChecklistItem(_0x3c5918,_0xab17e4,_0x193a01){const _0x3eab7f=_0x4401,_0x1366b6={'Aliiz':_0x3eab7f(0x149),'skAgL':_0x3eab7f(0x10d),'LkBmB':'updateChecklistItem'};return withRetry(async()=>{const _0x521d84=_0x3eab7f,_0x6ddf46=await getToken();if(!_0x6ddf46)throw new Error(_0x1366b6[_0x521d84(0x122)]);const _0x544b39=getApiBaseUrl(),_0x52332c=await fetch(_0x544b39+'/api/v1/mcp/features/'+_0x3c5918+'/checklist/'+_0xab17e4,{'method':'PATCH','headers':{'Authorization':_0x521d84(0x12d)+_0x6ddf46,'Content-Type':_0x1366b6[_0x521d84(0x12e)]},'body':JSON['stringify'](_0x193a01)});if(!_0x52332c['ok']){const _0x5a426a=await _0x52332c[_0x521d84(0x130)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x5a426a);}return _0x52332c[_0x521d84(0x10f)]();},{'label':_0x1366b6[_0x3eab7f(0x112)]});}export async function getFeatureReport(_0x409303){const _0x4f66c8=_0x4401,_0x4011b8={'BQFAb':_0x4f66c8(0x149),'qRFiI':function(_0x4ee3d7){return _0x4ee3d7();},'kHDTk':function(_0x16c549,_0xc1bbd1,_0x279443){return _0x16c549(_0xc1bbd1,_0x279443);}},_0x5ba606=await getToken();if(!_0x5ba606)throw new Error(_0x4011b8[_0x4f66c8(0x140)]);const _0x1702f8=_0x4011b8[_0x4f66c8(0x14c)](getApiBaseUrl),_0x391209=await _0x4011b8['kHDTk'](fetch,_0x1702f8+_0x4f66c8(0x126)+_0x409303+_0x4f66c8(0x113),{'method':_0x4f66c8(0x139),'headers':{'Authorization':'Bearer\x20'+_0x5ba606}});if(!_0x391209['ok']){const _0x4d7532=await _0x391209['text']();throw new Error(_0x4f66c8(0x144)+_0x4d7532);}return _0x391209[_0x4f66c8(0x10f)]();}export async function getFeatureReportMarkdown(_0x4fb366,_0x287ffb){const _0x2c7281=_0x4401,_0x3b9f3e={'mWryR':_0x2c7281(0x149),'wPRLk':function(_0x593a23){return _0x593a23();},'veNQF':function(_0x38c82b,_0x2d9417){return _0x38c82b>_0x2d9417;},'HZqeX':'itemIds','zBrLe':function(_0x12fecf,_0x4dbacc){return _0x12fecf&&_0x4dbacc;},'agfZG':'style','MbEhY':function(_0x2a378c,_0x364a02,_0x509108){return _0x2a378c(_0x364a02,_0x509108);}},_0x3df1a7=await getToken();if(!_0x3df1a7)throw new Error(_0x3b9f3e['mWryR']);const _0x53ded9=_0x3b9f3e['wPRLk'](getApiBaseUrl),_0x2b8c28=new URLSearchParams(),_0x5f089a=_0x3b9f3e['veNQF'](_0x287ffb?.['itemIds']?.['length']??0x0,0x0),_0x5e1853=Boolean(_0x287ffb?.['sessionId']);_0x5f089a&&_0x287ffb?.[_0x2c7281(0x13c)]&&_0x2b8c28[_0x2c7281(0x11e)](_0x3b9f3e['HZqeX'],_0x287ffb[_0x2c7281(0x13c)]['join'](','));_0x5e1853&&_0x287ffb?.[_0x2c7281(0x123)]&&_0x2b8c28[_0x2c7281(0x11e)]('sessionId',_0x287ffb[_0x2c7281(0x123)]);_0x3b9f3e[_0x2c7281(0x13a)](!_0x5f089a,!_0x5e1853)&&_0x287ffb?.['style']&&_0x2b8c28[_0x2c7281(0x11e)](_0x3b9f3e['agfZG'],_0x287ffb['style']);const _0x48e6f8=_0x53ded9+'/api/v1/mcp/features/'+_0x4fb366+'/report/markdown',_0x1d74a6=''+_0x48e6f8+(_0x2b8c28['toString']()?'?'+_0x2b8c28[_0x2c7281(0x120)]():''),_0x14b35a=await _0x3b9f3e[_0x2c7281(0x145)](fetch,_0x1d74a6,{'method':_0x2c7281(0x139),'headers':{'Authorization':_0x2c7281(0x12d)+_0x3df1a7}});if(!_0x14b35a['ok']){const _0x304a85=await _0x14b35a[_0x2c7281(0x130)]();throw new Error(_0x2c7281(0x111)+_0x304a85);}return _0x14b35a['text']();}export async function listFeatureSessions(_0x29e096){const _0x3d948f=_0x4401,_0xe9f7c7={'voSKa':'GET'},_0x5df144=await getToken();if(!_0x5df144)throw new Error(_0x3d948f(0x149));const _0x3736e1=getApiBaseUrl(),_0x268bed=await fetch(_0x3736e1+'/api/v1/mcp/features/'+_0x29e096+'/sessions',{'method':_0xe9f7c7[_0x3d948f(0x125)],'headers':{'Authorization':'Bearer\x20'+_0x5df144}});if(!_0x268bed['ok']){const _0x4498ce=await _0x268bed['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x4498ce);}return _0x268bed['json']();}export async function startSession(_0x10cef4,_0x5f1893){const _0x32935a=_0x4401,_0x508990={'lONig':function(_0x128f01){return _0x128f01();},'eFwNP':function(_0x130f23,_0x2e0cb3,_0x936373){return _0x130f23(_0x2e0cb3,_0x936373);},'ktBcU':'POST'},_0x31a173=await _0x508990['lONig'](getToken);if(!_0x31a173)throw new Error(_0x32935a(0x149));const _0x4f4d5e=getApiBaseUrl(),_0x2a0c40=await _0x508990['eFwNP'](fetch,_0x4f4d5e+_0x32935a(0x126)+_0x10cef4+_0x32935a(0x121)+_0x5f1893+_0x32935a(0x14a),{'method':_0x508990['ktBcU'],'headers':{'Authorization':'Bearer\x20'+_0x31a173}});if(!_0x2a0c40['ok']){const _0x31c458=await _0x2a0c40['text']();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x31c458);}return _0x2a0c40[_0x32935a(0x10f)]();}export async function concludeSession(_0x331ae5,_0x1feadb){const _0x1f478a=_0x4401,_0x4464b5={'wnLDf':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','csqOj':function(_0x3ba6ed){return _0x3ba6ed();},'mOSQe':'POST'},_0x2d080e=await getToken();if(!_0x2d080e)throw new Error(_0x4464b5['wnLDf']);const _0x57f20a=_0x4464b5[_0x1f478a(0x115)](getApiBaseUrl),_0x2ce638=await fetch(_0x57f20a+_0x1f478a(0x126)+_0x331ae5+'/sessions/'+_0x1feadb+'/conclude',{'method':_0x4464b5[_0x1f478a(0x117)],'headers':{'Authorization':_0x1f478a(0x12d)+_0x2d080e}});if(!_0x2ce638['ok']){const _0xbaa58=await _0x2ce638['text']();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0xbaa58);}return _0x2ce638['json']();}export async function getActionItems(_0x50b8ec){const _0x4f7a87=_0x4401,_0x2666c4={'FWtYy':function(_0x110989){return _0x110989();},'HJFBA':function(_0x3bfb41){return _0x3bfb41();},'vamHP':'GET'},_0xcf1a78=await _0x2666c4['FWtYy'](getToken);if(!_0xcf1a78)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x47d201=_0x2666c4[_0x4f7a87(0x110)](getApiBaseUrl),_0x202ed5=await fetch(_0x47d201+'/api/v1/mcp/features/'+_0x50b8ec+'/action-items',{'method':_0x2666c4[_0x4f7a87(0x12b)],'headers':{'Authorization':'Bearer\x20'+_0xcf1a78}});if(!_0x202ed5['ok']){const _0x5477be=await _0x202ed5[_0x4f7a87(0x130)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x5477be);}return _0x202ed5[_0x4f7a87(0x10f)]();}function _0x4401(_0x2843bd,_0x33de7d){_0x2843bd=_0x2843bd-0x109;const _0x457c0e=_0x457c();let _0x4401a4=_0x457c0e[_0x2843bd];return _0x4401a4;}export async function getItemFeedback(_0x2a9a70,_0x2f253a){const _0x3403f7=_0x4401,_0x3f1872={'HWsAT':_0x3403f7(0x149),'ZFniu':function(_0x34925d){return _0x34925d();},'sOcKd':_0x3403f7(0x139)},_0x215894=await getToken();if(!_0x215894)throw new Error(_0x3f1872[_0x3403f7(0x128)]);const _0x1ca4f8=_0x3f1872['ZFniu'](getApiBaseUrl),_0x44098d=await fetch(_0x1ca4f8+'/api/v1/mcp/features/'+_0x2a9a70+'/checklist-items/'+_0x2f253a+'/feedback',{'method':_0x3f1872['sOcKd'],'headers':{'Authorization':'Bearer\x20'+_0x215894}});if(!_0x44098d['ok']){const _0x1b4e6d=await _0x44098d[_0x3403f7(0x130)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x1b4e6d);}return _0x44098d['json']();}export async function markCommentsAddressed(_0x5af0fd,_0x52e17a,_0x18802e){const _0x50cea2=_0x4401,_0x1052dd={'ISbZj':function(_0x49890a){return _0x49890a();},'UoGvF':'application/json'},_0x223bb9=await getToken();if(!_0x223bb9)throw new Error(_0x50cea2(0x149));const _0x85c468=_0x1052dd[_0x50cea2(0x10c)](getApiBaseUrl),_0x43f0dc=await fetch(_0x85c468+_0x50cea2(0x126)+_0x5af0fd+_0x50cea2(0x136),{'method':_0x50cea2(0x11d),'headers':{'Authorization':_0x50cea2(0x12d)+_0x223bb9,'Content-Type':_0x1052dd['UoGvF']},'body':JSON['stringify']({'checklistItemId':_0x52e17a,'commentIds':_0x18802e})});if(!_0x43f0dc['ok']){const _0x4a79ae=await _0x43f0dc[_0x50cea2(0x130)]();throw new Error(_0x50cea2(0x11c)+_0x4a79ae);}}export async function softDeleteFeature(_0x36e807){const _0x37ae94=_0x4401,_0x497e35={'vvylt':function(_0x4206ae){return _0x4206ae();},'zUmeg':function(_0x1b39d6,_0x29cee9,_0x1e6d4c){return _0x1b39d6(_0x29cee9,_0x1e6d4c);},'NRXcZ':'DELETE'},_0x364259=await getToken();if(!_0x364259)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x287576=_0x497e35['vvylt'](getApiBaseUrl),_0x9d2526=await _0x497e35['zUmeg'](fetch,_0x287576+'/api/v1/mcp/features/'+_0x36e807,{'method':_0x497e35[_0x37ae94(0x13b)],'headers':{'Authorization':_0x37ae94(0x12d)+_0x364259}});if(!_0x9d2526['ok']){const _0x1fc949=await _0x9d2526['text']();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x1fc949);}}function _0x457c(){const _0x2b1e0c=['/api/v1/mcp/features/','2451828fcwUOu','HWsAT','PATCH','mKjzZ','vamHP','168vzmwnk','Bearer\x20','skAgL','yPZcb','text','dUNAY','Failed\x20to\x20create\x20feature\x20review:\x20','hXDEj','4987776PEHDLn','stringify','/comments/address','3NlnzpE','qCMSc','GET','zBrLe','NRXcZ','itemIds','910287vrkvHv','KJlEQ','Fxdqp','BQFAb','gitBranch','LscxN','limit','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','MbEhY','20NcyGwK','offset','52420UjDvzG','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','/start','55825CbhQpC','qRFiI','YGRzx','Failed\x20to\x20list\x20feature\x20reviews:\x20','TTixq','ISbZj','application/json','/api/v1/mcp/features','json','HJFBA','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','LkBmB','/report','gitRepoUrl','csqOj','includeDeleted','mOSQe','akwbm','974062fAzygF','dqznQ','19188356AnhHWo','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','POST','set','message','toString','/sessions/','Aliiz','sessionId','21jchvSK','voSKa'];_0x457c=function(){return _0x2b1e0c;};return _0x457c();}export async function restoreFeature(_0x4e1c28){const _0x5c9647=_0x4401,_0x1eba17={'YGRzx':function(_0x23e55e){return _0x23e55e();},'RrIKy':_0x5c9647(0x11d)},_0x5e779d=await getToken();if(!_0x5e779d)throw new Error(_0x5c9647(0x149));const _0x136cc0=_0x1eba17[_0x5c9647(0x109)](getApiBaseUrl),_0x349490=await fetch(_0x136cc0+'/api/v1/mcp/features/'+_0x4e1c28+'/restore',{'method':_0x1eba17['RrIKy'],'headers':{'Authorization':_0x5c9647(0x12d)+_0x5e779d}});if(!_0x349490['ok']){const _0x3b6fe7=await _0x349490['text']();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x3b6fe7);}}
1
+ (function(_0x4fed12,_0x4c0767){const _0x454de2=_0x354b,_0x4f6cc2=_0x4fed12();while(!![]){try{const _0x4d6b55=-parseInt(_0x454de2(0x112))/0x1*(-parseInt(_0x454de2(0x115))/0x2)+parseInt(_0x454de2(0x151))/0x3+parseInt(_0x454de2(0x137))/0x4+-parseInt(_0x454de2(0x136))/0x5+parseInt(_0x454de2(0x135))/0x6*(parseInt(_0x454de2(0x10b))/0x7)+parseInt(_0x454de2(0x11b))/0x8+parseInt(_0x454de2(0x129))/0x9*(-parseInt(_0x454de2(0x11e))/0xa);if(_0x4d6b55===_0x4c0767)break;else _0x4f6cc2['push'](_0x4f6cc2['shift']());}catch(_0x367d46){_0x4f6cc2['push'](_0x4f6cc2['shift']());}}}(_0x4d65,0x5a7e5));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x416dad){const _0x508917=_0x354b,_0x5879a2={'hGJrM':function(_0x55e6b4){return _0x55e6b4();},'hLkMl':_0x508917(0x141),'zYfap':'application/json','avzjj':function(_0x56e4f4,_0x22b752){return _0x56e4f4===_0x22b752;},'uTdrO':'https://dashboard.ranger.net/billing'},_0xd1ae43=await _0x5879a2[_0x508917(0x103)](getToken);if(!_0xd1ae43)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3004db=getApiBaseUrl(),_0x22fd06=await fetch(_0x3004db+_0x508917(0x111),{'method':_0x5879a2[_0x508917(0x144)],'headers':{'Authorization':'Bearer\x20'+_0xd1ae43,'Content-Type':_0x5879a2[_0x508917(0x12e)]},'body':JSON['stringify'](_0x416dad)});if(!_0x22fd06['ok']){if(_0x5879a2['avzjj'](_0x22fd06[_0x508917(0x123)],0x192)){const _0x2f5274=await _0x22fd06[_0x508917(0x147)](),_0x16f225=_0x2f5274['billingUrl']||_0x5879a2['uTdrO'];throw new Error((_0x2f5274[_0x508917(0x13f)]||'Feature\x20limit\x20exceeded')+_0x508917(0x106)+_0x16f225);}const _0x2516b1=await _0x22fd06[_0x508917(0x122)]();throw new Error(_0x508917(0x118)+_0x2516b1);}return _0x22fd06['json']();}export async function listFeatures(_0x4b89d2){const _0x1754f1=_0x354b,_0x2cf7fd={'RfZuy':function(_0x2f292c){return _0x2f292c();},'gsluP':_0x1754f1(0x108),'aIDTs':_0x1754f1(0x12a),'kkdyM':_0x1754f1(0x143),'GZsbe':'includeDeleted','KosaP':'true','WduQQ':_0x1754f1(0x110)},_0x371add=await _0x2cf7fd[_0x1754f1(0x12c)](getToken);if(!_0x371add)throw new Error(_0x2cf7fd[_0x1754f1(0x116)]);const _0x467423=getApiBaseUrl(),_0x3836af=new URLSearchParams();if(_0x4b89d2?.[_0x1754f1(0x117)])_0x3836af['set']('gitRepoUrl',_0x4b89d2[_0x1754f1(0x117)]);if(_0x4b89d2?.['gitBranch'])_0x3836af[_0x1754f1(0x13d)](_0x1754f1(0x119),_0x4b89d2[_0x1754f1(0x119)]);if(_0x4b89d2?.['limit'])_0x3836af[_0x1754f1(0x13d)](_0x2cf7fd[_0x1754f1(0x13a)],_0x4b89d2['limit']['toString']());if(_0x4b89d2?.['offset'])_0x3836af['set'](_0x2cf7fd['kkdyM'],_0x4b89d2['offset'][_0x1754f1(0x146)]());if(_0x4b89d2?.['includeDeleted'])_0x3836af['set'](_0x2cf7fd[_0x1754f1(0x13b)],_0x2cf7fd[_0x1754f1(0x148)]);const _0x5346cc=_0x467423+'/api/v1/mcp/features'+(_0x3836af['toString']()?'?'+_0x3836af['toString']():''),_0x3f8cf3=await fetch(_0x5346cc,{'method':_0x2cf7fd['WduQQ'],'headers':{'Authorization':_0x1754f1(0x11c)+_0x371add}});if(!_0x3f8cf3['ok']){const _0x1bbfda=await _0x3f8cf3['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x1bbfda);}return _0x3f8cf3[_0x1754f1(0x147)]();}export async function getFeature(_0x265bf5){const _0x4c893a=_0x354b,_0x5f117e={'NNMdm':function(_0x42af3e,_0x58a534,_0xbdb6a6){return _0x42af3e(_0x58a534,_0xbdb6a6);}},_0xf99126=await getToken();if(!_0xf99126)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x54dc28=getApiBaseUrl(),_0x48e691=await _0x5f117e[_0x4c893a(0x101)](fetch,_0x54dc28+'/api/v1/mcp/features/'+_0x265bf5,{'method':'GET','headers':{'Authorization':_0x4c893a(0x11c)+_0xf99126}});if(!_0x48e691['ok']){const _0x28dd68=await _0x48e691[_0x4c893a(0x122)]();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x28dd68);}return _0x48e691['json']();}export async function updateFeature(_0x340728,_0x369362){const _0x13018e=_0x354b,_0x991063={'EhzMY':function(_0x350674){return _0x350674();},'hGzHe':_0x13018e(0x108),'EJjXz':function(_0x1e0439){return _0x1e0439();},'GeLTt':function(_0x432f22,_0x158972,_0x3ec113){return _0x432f22(_0x158972,_0x3ec113);},'RNWdo':'PATCH'},_0x5a7b35=await _0x991063['EhzMY'](getToken);if(!_0x5a7b35)throw new Error(_0x991063['hGzHe']);const _0x1feb28=_0x991063['EJjXz'](getApiBaseUrl),_0x47f190=await _0x991063['GeLTt'](fetch,_0x1feb28+_0x13018e(0x12d)+_0x340728,{'method':_0x991063[_0x13018e(0x105)],'headers':{'Authorization':'Bearer\x20'+_0x5a7b35,'Content-Type':_0x13018e(0x140)},'body':JSON['stringify'](_0x369362)});if(!_0x47f190['ok']){const _0x3e4370=await _0x47f190['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x3e4370);}return _0x47f190['json']();}export async function createChecklistItem(_0x5cca4a,_0x29004b,_0x2d6156){const _0xb92107=_0x354b,_0x38808f={'WkrkZ':function(_0x2f7530){return _0x2f7530();},'flupg':function(_0x269e8c,_0x89dda8,_0x30ad5b){return _0x269e8c(_0x89dda8,_0x30ad5b);}},_0x29bd87=await _0x38808f['WkrkZ'](getToken);if(!_0x29bd87)throw new Error(_0xb92107(0x108));const _0x4d6114=getApiBaseUrl(),_0x11fbfc=await _0x38808f[_0xb92107(0x12f)](fetch,_0x4d6114+'/api/v1/mcp/features/'+_0x5cca4a+_0xb92107(0x14b),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x29bd87,'Content-Type':'application/json'},'body':JSON[_0xb92107(0x11d)]({'description':_0x29004b,'position':_0x2d6156})});if(!_0x11fbfc['ok']){const _0x1c152f=await _0x11fbfc['text']();throw new Error(_0xb92107(0x130)+_0x1c152f);}return _0x11fbfc[_0xb92107(0x147)]();}export async function updateChecklistItem(_0x44c353,_0x28700d,_0x1c99f2){const _0x212e82=_0x354b,_0x20c962={'sfpdr':function(_0x169b70){return _0x169b70();},'CblbE':function(_0x27d20c,_0x495050,_0x584ce9){return _0x27d20c(_0x495050,_0x584ce9);}};return _0x20c962[_0x212e82(0x125)](withRetry,async()=>{const _0x412fd2=_0x212e82,_0x2f91bd=await getToken();if(!_0x2f91bd)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x139b1f=_0x20c962[_0x412fd2(0x149)](getApiBaseUrl),_0x4a29b7=await fetch(_0x139b1f+_0x412fd2(0x12d)+_0x44c353+_0x412fd2(0x10d)+_0x28700d,{'method':_0x412fd2(0x121),'headers':{'Authorization':'Bearer\x20'+_0x2f91bd,'Content-Type':'application/json'},'body':JSON['stringify'](_0x1c99f2)});if(!_0x4a29b7['ok']){const _0xad0e59=await _0x4a29b7['text']();throw new Error(_0x412fd2(0x145)+_0xad0e59);}return _0x4a29b7[_0x412fd2(0x147)]();},{'label':_0x212e82(0x14c)});}export async function getFeatureReport(_0x4fffa1){const _0xa22171=_0x354b,_0x2ccaf8={'TMLAa':function(_0x5419b3){return _0x5419b3();},'FtxGM':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x4a40e0=await _0x2ccaf8['TMLAa'](getToken);if(!_0x4a40e0)throw new Error(_0x2ccaf8[_0xa22171(0x11f)]);const _0x24a474=getApiBaseUrl(),_0x53d54c=await fetch(_0x24a474+_0xa22171(0x12d)+_0x4fffa1+'/report',{'method':_0xa22171(0x110),'headers':{'Authorization':_0xa22171(0x11c)+_0x4a40e0}});if(!_0x53d54c['ok']){const _0x7fad29=await _0x53d54c['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x7fad29);}return _0x53d54c['json']();}export async function getFeatureReportMarkdown(_0x583e9b,_0x35bc03){const _0x552a74=_0x354b,_0x5103ed={'GKQbM':function(_0x3779cd){return _0x3779cd();},'DMUVc':_0x552a74(0x108),'MQPly':function(_0x29ac9e,_0x488f89){return _0x29ac9e>_0x488f89;},'zcNLJ':function(_0x1481b4,_0x272572){return _0x1481b4(_0x272572);},'iwowy':'sessionId','yYlPr':function(_0x40fb49,_0x3cc799){return _0x40fb49&&_0x3cc799;},'XCHMc':'style','eyWiu':function(_0x567188,_0x175652,_0x2757f0){return _0x567188(_0x175652,_0x2757f0);}},_0x144456=await _0x5103ed['GKQbM'](getToken);if(!_0x144456)throw new Error(_0x5103ed[_0x552a74(0x113)]);const _0x36379f=_0x5103ed['GKQbM'](getApiBaseUrl),_0x6efee1=new URLSearchParams(),_0x31bdb0=_0x5103ed['MQPly'](_0x35bc03?.[_0x552a74(0x13c)]?.[_0x552a74(0x134)]??0x0,0x0),_0x5d7991=_0x5103ed[_0x552a74(0x114)](Boolean,_0x35bc03?.['sessionId']);_0x31bdb0&&_0x35bc03?.[_0x552a74(0x13c)]&&_0x6efee1['set']('itemIds',_0x35bc03['itemIds'][_0x552a74(0x128)](','));_0x5d7991&&_0x35bc03?.[_0x552a74(0x102)]&&_0x6efee1[_0x552a74(0x13d)](_0x5103ed['iwowy'],_0x35bc03['sessionId']);_0x5103ed['yYlPr'](!_0x31bdb0,!_0x5d7991)&&_0x35bc03?.['style']&&_0x6efee1['set'](_0x5103ed[_0x552a74(0x14e)],_0x35bc03[_0x552a74(0x120)]);const _0x3624f3=_0x36379f+'/api/v1/mcp/features/'+_0x583e9b+_0x552a74(0x138),_0x5458ba=''+_0x3624f3+(_0x6efee1['toString']()?'?'+_0x6efee1['toString']():''),_0x2717d4=await _0x5103ed[_0x552a74(0x109)](fetch,_0x5458ba,{'method':'GET','headers':{'Authorization':_0x552a74(0x11c)+_0x144456}});if(!_0x2717d4['ok']){const _0x20ee72=await _0x2717d4['text']();throw new Error(_0x552a74(0x132)+_0x20ee72);}return _0x2717d4[_0x552a74(0x122)]();}export async function listFeatureSessions(_0x418dd8){const _0x1a71fe=_0x354b,_0x1b1c24={'NPhij':function(_0x2f7ffc){return _0x2f7ffc();},'aCoDF':_0x1a71fe(0x108),'UVyVH':'GET'},_0x119004=await _0x1b1c24[_0x1a71fe(0x127)](getToken);if(!_0x119004)throw new Error(_0x1b1c24[_0x1a71fe(0x12b)]);const _0x44a7cf=_0x1b1c24[_0x1a71fe(0x127)](getApiBaseUrl),_0x16dfa0=await fetch(_0x44a7cf+_0x1a71fe(0x12d)+_0x418dd8+_0x1a71fe(0x142),{'method':_0x1b1c24[_0x1a71fe(0x11a)],'headers':{'Authorization':_0x1a71fe(0x11c)+_0x119004}});if(!_0x16dfa0['ok']){const _0x139aad=await _0x16dfa0['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x139aad);}return _0x16dfa0['json']();}function _0x4d65(){const _0x1939a7=['rvFMg','dAFAE','GET','/api/v1/mcp/features','1ZPDvuQ','DMUVc','zcNLJ','1271494NWWIHd','gsluP','gitRepoUrl','Failed\x20to\x20create\x20feature\x20review:\x20','gitBranch','UVyVH','2816288WnszDR','Bearer\x20','stringify','10oCsREH','FtxGM','style','PATCH','text','status','mxXbZ','CblbE','Failed\x20to\x20get\x20action\x20items:\x20','NPhij','join','5432202XvyRfk','limit','aCoDF','RfZuy','/api/v1/mcp/features/','zYfap','flupg','Failed\x20to\x20create\x20scenario:\x20','Failed\x20to\x20get\x20item\x20feedback:\x20','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','Failed\x20to\x20start\x20session:\x20','length','1794FxNjbr','2747910JaoAzl','1110648CnlFiN','/report/markdown','Failed\x20to\x20delete\x20feature\x20review:\x20','aIDTs','GZsbe','itemIds','set','tmCpk','message','application/json','POST','/sessions','offset','hLkMl','Failed\x20to\x20update\x20scenario:\x20','toString','json','KosaP','sfpdr','aPyVO','/checklist','updateChecklistItem','SlUKP','XCHMc','LhQck','/checklist-items/','210915PNzAyy','Failed\x20to\x20conclude\x20session:\x20','NNMdm','sessionId','hGJrM','/conclude','RNWdo','\x0a\x0aUpgrade\x20your\x20plan:\x20','zOMOV','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','eyWiu','/sessions/','4403EDiXdk','/comments/address','/checklist/'];_0x4d65=function(){return _0x1939a7;};return _0x4d65();}export async function startSession(_0x325ecb,_0x4b86a1){const _0x5a01d9=_0x354b,_0x3ee621={'tmCpk':_0x5a01d9(0x108),'sIsEB':function(_0x52fc77){return _0x52fc77();},'gmPAm':'POST'},_0xd9ef78=await getToken();if(!_0xd9ef78)throw new Error(_0x3ee621[_0x5a01d9(0x13e)]);const _0x5748e9=_0x3ee621['sIsEB'](getApiBaseUrl),_0x258ade=await fetch(_0x5748e9+_0x5a01d9(0x12d)+_0x325ecb+_0x5a01d9(0x10a)+_0x4b86a1+'/start',{'method':_0x3ee621['gmPAm'],'headers':{'Authorization':_0x5a01d9(0x11c)+_0xd9ef78}});if(!_0x258ade['ok']){const _0x53110b=await _0x258ade['text']();throw new Error(_0x5a01d9(0x133)+_0x53110b);}return _0x258ade['json']();}export async function concludeSession(_0x183240,_0x3d70d9){const _0x38cd69=_0x354b,_0x55dd93={'aPyVO':function(_0x229c84){return _0x229c84();},'BSafM':function(_0x4d16a5,_0x8082ec,_0x39c7ab){return _0x4d16a5(_0x8082ec,_0x39c7ab);}},_0x4d3db6=await _0x55dd93[_0x38cd69(0x14a)](getToken);if(!_0x4d3db6)throw new Error(_0x38cd69(0x108));const _0x388bfe=getApiBaseUrl(),_0x57a171=await _0x55dd93['BSafM'](fetch,_0x388bfe+'/api/v1/mcp/features/'+_0x183240+_0x38cd69(0x10a)+_0x3d70d9+_0x38cd69(0x104),{'method':_0x38cd69(0x141),'headers':{'Authorization':_0x38cd69(0x11c)+_0x4d3db6}});if(!_0x57a171['ok']){const _0x34979b=await _0x57a171[_0x38cd69(0x122)]();throw new Error(_0x38cd69(0x152)+_0x34979b);}return _0x57a171[_0x38cd69(0x147)]();}export async function getActionItems(_0x372c24){const _0x4abae9=_0x354b,_0x1a8aaa={'dAFAE':function(_0x5b24bf){return _0x5b24bf();},'SlUKP':'GET'},_0x27346d=await getToken();if(!_0x27346d)throw new Error(_0x4abae9(0x108));const _0x50fb28=_0x1a8aaa[_0x4abae9(0x10f)](getApiBaseUrl),_0x131070=await fetch(_0x50fb28+'/api/v1/mcp/features/'+_0x372c24+'/action-items',{'method':_0x1a8aaa[_0x4abae9(0x14d)],'headers':{'Authorization':'Bearer\x20'+_0x27346d}});if(!_0x131070['ok']){const _0x344463=await _0x131070[_0x4abae9(0x122)]();throw new Error(_0x4abae9(0x126)+_0x344463);}return _0x131070['json']();}export async function getItemFeedback(_0x3b8690,_0x586d1d){const _0x2b7e4e=_0x354b,_0x2fa2a0={'zOMOV':function(_0x12f6e2){return _0x12f6e2();},'ycsDt':'GET'},_0x19dbba=await _0x2fa2a0['zOMOV'](getToken);if(!_0x19dbba)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x332419=_0x2fa2a0[_0x2b7e4e(0x107)](getApiBaseUrl),_0x3d0c2d=await fetch(_0x332419+'/api/v1/mcp/features/'+_0x3b8690+_0x2b7e4e(0x150)+_0x586d1d+'/feedback',{'method':_0x2fa2a0['ycsDt'],'headers':{'Authorization':'Bearer\x20'+_0x19dbba}});if(!_0x3d0c2d['ok']){const _0x384146=await _0x3d0c2d['text']();throw new Error(_0x2b7e4e(0x131)+_0x384146);}return _0x3d0c2d[_0x2b7e4e(0x147)]();}export async function markCommentsAddressed(_0x362611,_0x1c9de1,_0x11b1b8){const _0x44d068=_0x354b,_0x5d8759={'ajUCl':function(_0x3e7107){return _0x3e7107();},'rvFMg':function(_0x226c26){return _0x226c26();},'XhMcc':'POST'},_0x18288c=await _0x5d8759['ajUCl'](getToken);if(!_0x18288c)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3f91ac=_0x5d8759[_0x44d068(0x10e)](getApiBaseUrl),_0x1118a4=await fetch(_0x3f91ac+'/api/v1/mcp/features/'+_0x362611+_0x44d068(0x10c),{'method':_0x5d8759['XhMcc'],'headers':{'Authorization':_0x44d068(0x11c)+_0x18288c,'Content-Type':_0x44d068(0x140)},'body':JSON['stringify']({'checklistItemId':_0x1c9de1,'commentIds':_0x11b1b8})});if(!_0x1118a4['ok']){const _0xb7a9a7=await _0x1118a4[_0x44d068(0x122)]();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0xb7a9a7);}}function _0x354b(_0x3bb6c4,_0x3836c5){_0x3bb6c4=_0x3bb6c4-0x101;const _0x4d655c=_0x4d65();let _0x354bd=_0x4d655c[_0x3bb6c4];return _0x354bd;}export async function softDeleteFeature(_0x441347){const _0x8075b2=_0x354b,_0x5b0277={'besGK':_0x8075b2(0x108),'vMEfu':'DELETE'},_0x5e9c95=await getToken();if(!_0x5e9c95)throw new Error(_0x5b0277['besGK']);const _0x2cc4a9=getApiBaseUrl(),_0x1a383d=await fetch(_0x2cc4a9+'/api/v1/mcp/features/'+_0x441347,{'method':_0x5b0277['vMEfu'],'headers':{'Authorization':'Bearer\x20'+_0x5e9c95}});if(!_0x1a383d['ok']){const _0x2a4bee=await _0x1a383d[_0x8075b2(0x122)]();throw new Error(_0x8075b2(0x139)+_0x2a4bee);}}export async function restoreFeature(_0x4883b2){const _0x2e9e87=_0x354b,_0x2c0f7a={'LhQck':function(_0x41a5b8){return _0x41a5b8();},'mxXbZ':function(_0x25081f,_0x22414c,_0x1e36fc){return _0x25081f(_0x22414c,_0x1e36fc);}},_0x2aad12=await _0x2c0f7a[_0x2e9e87(0x14f)](getToken);if(!_0x2aad12)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x59abff=_0x2c0f7a['LhQck'](getApiBaseUrl),_0x1b06c=await _0x2c0f7a[_0x2e9e87(0x124)](fetch,_0x59abff+'/api/v1/mcp/features/'+_0x4883b2+'/restore',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x2aad12}});if(!_0x1b06c['ok']){const _0x292c98=await _0x1b06c['text']();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x292c98);}}
@@ -1 +1 @@
1
- const _0x27a57d=_0x2473;(function(_0xfeb088,_0xec0907){const _0x3d6fa4=_0x2473,_0x3f9e5f=_0xfeb088();while(!![]){try{const _0x1f3f37=-parseInt(_0x3d6fa4(0xf2))/0x1*(-parseInt(_0x3d6fa4(0xee))/0x2)+parseInt(_0x3d6fa4(0xfc))/0x3*(-parseInt(_0x3d6fa4(0x105))/0x4)+-parseInt(_0x3d6fa4(0x117))/0x5*(-parseInt(_0x3d6fa4(0x10f))/0x6)+-parseInt(_0x3d6fa4(0x113))/0x7+parseInt(_0x3d6fa4(0x10c))/0x8+parseInt(_0x3d6fa4(0xef))/0x9+parseInt(_0x3d6fa4(0xed))/0xa*(-parseInt(_0x3d6fa4(0x109))/0xb);if(_0x1f3f37===_0xec0907)break;else _0x3f9e5f['push'](_0x3f9e5f['shift']());}catch(_0x46bc58){_0x3f9e5f['push'](_0x3f9e5f['shift']());}}}(_0x30e4,0xdbfda));import{readFileSync,writeFileSync}from'fs';const ID_SEGMENT=0x18538067,ID_INFO=0x1549a966,ID_TIMESTAMP_SCALE=0x2ad7b1,ID_DURATION=0x4489,ID_VOID=0xec,ID_CLUSTER=0x1f43b675,ID_TIMESTAMP=0xe7,ID_SIMPLE_BLOCK=0xa3;function _0x2473(_0x14d277,_0x20995b){_0x14d277=_0x14d277-0xd8;const _0x30e4b2=_0x30e4();let _0x2473c1=_0x30e4b2[_0x14d277];return _0x2473c1;}function readVint(_0x131847,_0x300970){const _0x1dc23a=_0x2473,_0x121680={'eHdMZ':function(_0x49dd35,_0x4ff762){return _0x49dd35&_0x4ff762;},'gCwnA':function(_0x1b83c1,_0x2f5619){return _0x1b83c1-_0x2f5619;},'dVpbF':function(_0x3940e1,_0x32c1e3){return _0x3940e1<_0x32c1e3;},'KnEyO':function(_0x4b1a74,_0x2ada7e){return _0x4b1a74+_0x2ada7e;}};if(_0x300970>=_0x131847['length'])return[0x0,0x0];const _0x18b3e2=_0x131847[_0x300970];let _0x3812af=0x1,_0x4bdfc2=0x80;while(_0x3812af<=0x8&&!(_0x18b3e2&_0x4bdfc2)){_0x3812af++,_0x4bdfc2>>=0x1;}if(_0x300970+_0x3812af>_0x131847['length'])return[0x0,0x0];let _0x435696=_0x121680[_0x1dc23a(0xe7)](_0x18b3e2,_0x121680[_0x1dc23a(0x100)](_0x4bdfc2,0x1));for(let _0x4a9293=0x1;_0x121680['dVpbF'](_0x4a9293,_0x3812af);_0x4a9293++){_0x435696=_0x121680['KnEyO'](_0x435696*0x100,_0x131847[_0x121680[_0x1dc23a(0xfd)](_0x300970,_0x4a9293)]);}return[_0x435696,_0x3812af];}function readId(_0xde6bd7,_0x5135bf){const _0x5818ec=_0x2473,_0x54ba33={'qcIAW':function(_0x231874,_0x306d73){return _0x231874>=_0x306d73;},'vNHCL':function(_0x59a8ae,_0x43aadf){return _0x59a8ae>=_0x43aadf;},'HWWJZ':function(_0x4408fd,_0x5ddaab){return _0x4408fd>_0x5ddaab;},'UXBQw':function(_0x3d56ba,_0x3a853a){return _0x3d56ba<_0x3a853a;}};if(_0x54ba33['qcIAW'](_0x5135bf,_0xde6bd7[_0x5818ec(0xf1)]))return[0x0,0x0];const _0x5aa1dd=_0xde6bd7[_0x5135bf];let _0x297d8a;if(_0x54ba33['vNHCL'](_0x5aa1dd,0x80))_0x297d8a=0x1;else{if(_0x5aa1dd>=0x40)_0x297d8a=0x2;else{if(_0x5aa1dd>=0x20)_0x297d8a=0x3;else{if(_0x54ba33['qcIAW'](_0x5aa1dd,0x10))_0x297d8a=0x4;else return[_0x5aa1dd,0x1];}}}if(_0x54ba33[_0x5818ec(0xe6)](_0x5135bf+_0x297d8a,_0xde6bd7[_0x5818ec(0xf1)]))return[0x0,0x0];let _0x5e9ede=0x0;for(let _0xce8e3e=0x0;_0x54ba33[_0x5818ec(0x107)](_0xce8e3e,_0x297d8a);_0xce8e3e++){_0x5e9ede=_0x5e9ede*0x100+_0xde6bd7[_0x5135bf+_0xce8e3e];}return[_0x5e9ede,_0x297d8a];}function readUint(_0x249dab,_0x55f6e3,_0x2ae9ac){const _0xf83cab=_0x2473,_0x5717ea={'ozsuE':function(_0x21e083,_0x30552b){return _0x21e083<_0x30552b;},'DsCsc':function(_0x5743ef,_0x46825f){return _0x5743ef+_0x46825f;},'eGzgo':function(_0x2ddf57,_0x3d6a37){return _0x2ddf57*_0x3d6a37;}};let _0x10c7b6=0x0;for(let _0x17659d=0x0;_0x5717ea[_0xf83cab(0xea)](_0x17659d,_0x2ae9ac);_0x17659d++){_0x10c7b6=_0x5717ea[_0xf83cab(0xe3)](_0x5717ea['eGzgo'](_0x10c7b6,0x100),_0x249dab[_0x55f6e3+_0x17659d]);}return _0x10c7b6;}function _0x30e4(){const _0xbdb3b4=['ozsuE','xFnMN','dataSize','129070PNfRZE','34gLWFuX','13054842fsqqyg','OQBFx','length','102147zTpCNz','dataOffset','Usvod','argv','qAyMy','xpjtN','IeOQy','tfwxg','TOwdk','jmRtC','4647IFVTwk','KnEyO','mqlIF','concat','gCwnA','exit','readInt16BE','rGBxI','from','1336BFczkZ','fmhTK','UXBQw','log','2299saVYwr','EPXPg','hLJml','815624WPpagc','ytQNJ','slice','1284636lLtFwP','HVvZk','fsLWm','pow','4702047JQFliZ','eHiSW','fixWebmDuration.ts','Ncxsh','35oYtACO','dNkZK','HxnLs','Kczpd','hSNqs','KyPfN','iHhsj','floor','AguKF','alloc','Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','TBCTm','yRxGw','offset','endsWith','qVLPr','JEPme','kVysK','quPMS','DsCsc','YXLEL','idLen','HWWJZ','eHdMZ','sizeLen','Fixed:\x20'];_0x30e4=function(){return _0xbdb3b4;};return _0x30e4();}function isUnknownSize(_0x4a854b,_0x5008ca){const _0x56426f=_0x2473,_0x5517af={'iHhsj':function(_0x22e8dd,_0x5dd5a7){return _0x22e8dd*_0x5dd5a7;}};return _0x4a854b===Math['pow'](0x2,_0x5517af[_0x56426f(0x11d)](0x7,_0x5008ca))-0x1;}function writeId(_0x524c13){const _0x470bd2=_0x2473,_0xe63e8={'OQBFx':function(_0x832da8,_0x4745fe){return _0x832da8>>_0x4745fe;},'zwiJI':function(_0x41f762,_0x386389){return _0x41f762&_0x386389;},'AguKF':function(_0xe40d6,_0xec9bc6){return _0xe40d6>>_0xec9bc6;},'HVvZk':function(_0x32cfa0,_0x1f6e41){return _0x32cfa0&_0x1f6e41;}};if(_0x524c13<=0xff)return Buffer['from']([_0x524c13]);if(_0x524c13<=0xffff)return Buffer['from']([_0xe63e8[_0x470bd2(0xf0)](_0x524c13,0x8)&0xff,_0x524c13&0xff]);if(_0x524c13<=0xffffff)return Buffer[_0x470bd2(0x104)]([_0xe63e8[_0x470bd2(0xf0)](_0x524c13,0x10)&0xff,_0xe63e8['zwiJI'](_0xe63e8[_0x470bd2(0xd8)](_0x524c13,0x8),0xff),_0x524c13&0xff]);return Buffer['from']([_0xe63e8['zwiJI'](_0x524c13>>0x18,0xff),_0x524c13>>0x10&0xff,_0xe63e8['zwiJI'](_0xe63e8[_0x470bd2(0xf0)](_0x524c13,0x8),0xff),_0xe63e8[_0x470bd2(0x110)](_0x524c13,0xff)]);}function writeVint(_0x3171f2,_0x1e45bb){const _0xa483c4=_0x2473,_0x1873ee={'sEaLj':function(_0x5e078e,_0x4ded2f){return _0x5e078e-_0x4ded2f;},'Ncxsh':function(_0x1adf09,_0x190772){return _0x1adf09*_0x190772;},'eHiSW':function(_0x41ac9a,_0x4ac69a){return _0x41ac9a>=_0x4ac69a;}};let _0x4fcc3e=_0x1e45bb||0x1;while(_0x1873ee['sEaLj'](Math[_0xa483c4(0x112)](0x2,_0x1873ee[_0xa483c4(0x116)](0x7,_0x4fcc3e)),0x2)<_0x3171f2)_0x4fcc3e++;const _0x421ad0=Buffer['alloc'](_0x4fcc3e);for(let _0x45db6c=_0x4fcc3e-0x1;_0x1873ee[_0xa483c4(0x114)](_0x45db6c,0x0);_0x45db6c--){_0x421ad0[_0x45db6c]=_0x3171f2&0xff,_0x3171f2=Math[_0xa483c4(0x11e)](_0x3171f2/0x100);}return _0x421ad0[0x0]|=0x1<<_0x1873ee['sEaLj'](0x8,_0x4fcc3e),_0x421ad0;}function writeFloat64(_0x39e6c9){const _0x38cd8c=_0x2473,_0x2aec60=Buffer[_0x38cd8c(0xd9)](0x8);return _0x2aec60['writeDoubleBE'](_0x39e6c9,0x0),_0x2aec60;}function writeVoid(_0x15279d){const _0x1b3d0e=_0x2473,_0x156ae7={'gAKja':function(_0x2e3bb8,_0xe09fb3){return _0x2e3bb8-_0xe09fb3;},'KyPfN':function(_0x160ce7,_0x1c4c79){return _0x160ce7-_0x1c4c79;},'TBCTm':function(_0x430539,_0x1ee928){return _0x430539-_0x1ee928;},'txdgO':function(_0x54e432,_0x5ec5e4,_0x959ae1){return _0x54e432(_0x5ec5e4,_0x959ae1);}};for(let _0x3793db=0x1;_0x3793db<=0x8;_0x3793db++){const _0x13c604=_0x156ae7['gAKja'](_0x156ae7[_0x1b3d0e(0x11c)](_0x15279d,0x1),_0x3793db);if(_0x13c604>=0x0&&_0x13c604<=_0x156ae7[_0x1b3d0e(0xdb)](Math['pow'](0x2,0x7*_0x3793db),0x2))return Buffer['concat']([Buffer[_0x1b3d0e(0x104)]([ID_VOID]),_0x156ae7['txdgO'](writeVint,_0x13c604,_0x3793db),Buffer[_0x1b3d0e(0xd9)](_0x13c604)]);}return Buffer[_0x1b3d0e(0xd9)](0x0);}function findElement(_0x4de9f9,_0x327fa8,_0x253339,_0x5dea40){const _0x278ff2=_0x2473,_0x3bd09e={'IeOQy':function(_0x409b11,_0x5a4f7c,_0x220622){return _0x409b11(_0x5a4f7c,_0x220622);},'HpXyh':function(_0x963f86,_0x173f25,_0x130029){return _0x963f86(_0x173f25,_0x130029);},'fmhTK':function(_0x2fac0e,_0x2f7ba9){return _0x2fac0e+_0x2f7ba9;},'tfwxg':function(_0x2548b1,_0x516f5f){return _0x2548b1===_0x516f5f;},'mqlIF':function(_0x4ddf5a,_0x3e2e3c){return _0x4ddf5a+_0x3e2e3c;}};let _0x86eadc=_0x327fa8;while(_0x86eadc<_0x253339){const [_0x237047,_0x159ebf]=_0x3bd09e[_0x278ff2(0xf8)](readId,_0x4de9f9,_0x86eadc),[_0x24d060,_0x56094d]=_0x3bd09e['HpXyh'](readVint,_0x4de9f9,_0x3bd09e[_0x278ff2(0x106)](_0x86eadc,_0x159ebf));if(_0x3bd09e[_0x278ff2(0xf9)](_0x237047,_0x5dea40))return{'offset':_0x86eadc,'idLen':_0x159ebf,'sizeLen':_0x56094d,'dataSize':_0x24d060,'dataOffset':_0x3bd09e[_0x278ff2(0xfe)](_0x86eadc,_0x159ebf)+_0x56094d};if(_0x3bd09e[_0x278ff2(0xf8)](isUnknownSize,_0x24d060,_0x56094d))break;_0x86eadc+=_0x159ebf+_0x56094d+_0x24d060;}return null;}function computeDurationMs(_0xf17248,_0x52c57a){const _0x3225ce=_0x2473,_0x578947={'TOwdk':function(_0x5a9446,_0x282e13){return _0x5a9446<_0x282e13;},'EPXPg':function(_0x501c73,_0xe60bb3,_0x3918c8){return _0x501c73(_0xe60bb3,_0x3918c8);},'dNkZK':function(_0x18cbd2,_0x327764){return _0x18cbd2!==_0x327764;},'qAyMy':function(_0x364b08,_0x50aa1d){return _0x364b08+_0x50aa1d;},'Kczpd':function(_0x14182c,_0x3dacba,_0x798db6){return _0x14182c(_0x3dacba,_0x798db6);},'MQldJ':function(_0x28d8c6,_0xdf9de3){return _0x28d8c6-_0xdf9de3;},'Usvod':function(_0x4c2fee,_0x12f689,_0x2a8f50){return _0x4c2fee(_0x12f689,_0x2a8f50);},'quPMS':function(_0x108b30,_0x102a02){return _0x108b30===_0x102a02;},'Rktjg':function(_0x1dd271,_0x3e2c7e,_0x140ed6){return _0x1dd271(_0x3e2c7e,_0x140ed6);},'xpjtN':function(_0x206957,_0xb04f6d,_0x3d66a2){return _0x206957(_0xb04f6d,_0x3d66a2);},'oRYXj':function(_0x22d766,_0x331a1b){return _0x22d766===_0x331a1b;},'hSNqs':function(_0x2c90e5,_0x5732a9){return _0x2c90e5+_0x5732a9;},'jmRtC':function(_0x43435e,_0x369835){return _0x43435e>=_0x369835;},'DiFDS':function(_0x5e755d,_0x40387a){return _0x5e755d+_0x40387a;},'gnNwV':function(_0x2ad567,_0x31ae82){return _0x2ad567/_0x31ae82;},'LIcmM':function(_0x5c88a5,_0x58ebda){return _0x5c88a5*_0x58ebda;},'UhmXs':function(_0x5ec5c5,_0x41a5e0){return _0x5ec5c5>_0x41a5e0;}};let _0x1b1d7a=0x0;const _0x2b65e7=Buffer['from']([0x1f,0x43,0xb6,0x75]);let _0x2648ae=_0xf17248['indexOf'](_0x2b65e7);if(_0x2648ae===-0x1)return 0x0;while(_0x578947['TOwdk'](_0x2648ae,_0xf17248[_0x3225ce(0xf1)])){const [_0x5438eb,_0xdce821]=_0x578947[_0x3225ce(0x10a)](readId,_0xf17248,_0x2648ae);if(_0x578947[_0x3225ce(0x118)](_0x5438eb,ID_CLUSTER))break;const [_0x57e164,_0x8d1e7]=_0x578947[_0x3225ce(0x10a)](readVint,_0xf17248,_0x2648ae+_0xdce821),_0x3482b5=_0x578947['qAyMy'](_0x578947['qAyMy'](_0x2648ae,_0xdce821),_0x8d1e7),_0x28c59d=_0x578947['Kczpd'](isUnknownSize,_0x57e164,_0x8d1e7);let _0x1e690e;if(_0x28c59d){let _0x14a158=_0x3482b5;while(_0x578947['TOwdk'](_0x14a158,_0x578947['MQldJ'](_0xf17248[_0x3225ce(0xf1)],0x4))){const [_0x5d42d2,_0x15c144]=_0x578947[_0x3225ce(0xf4)](readId,_0xf17248,_0x14a158);if(_0x578947[_0x3225ce(0xe2)](_0x5d42d2,ID_CLUSTER)){_0x1e690e=_0x14a158;break;}const [_0x3980e9,_0x38c01d]=_0x578947[_0x3225ce(0x11a)](readVint,_0xf17248,_0x578947[_0x3225ce(0xf6)](_0x14a158,_0x15c144));if(_0x578947['Rktjg'](isUnknownSize,_0x3980e9,_0x38c01d)){_0x1e690e=_0xf17248['length'];break;}_0x14a158+=_0x15c144+_0x38c01d+_0x3980e9;}_0x1e690e??=_0xf17248[_0x3225ce(0xf1)];}else _0x1e690e=_0x3482b5+_0x57e164;let _0x13e389=0x0,_0x5d05c9=_0x3482b5;while(_0x578947[_0x3225ce(0xfa)](_0x5d05c9,_0x1e690e)){const [_0x4ee6d5,_0x13e81f]=_0x578947['xpjtN'](readId,_0xf17248,_0x5d05c9),[_0x45a2ad,_0x18c79a]=readVint(_0xf17248,_0x578947['qAyMy'](_0x5d05c9,_0x13e81f));if(_0x578947['oRYXj'](_0x4ee6d5,ID_TIMESTAMP))_0x13e389=readUint(_0xf17248,_0x578947[_0x3225ce(0x11b)](_0x5d05c9,_0x13e81f)+_0x18c79a,_0x45a2ad);else{if(_0x4ee6d5===ID_SIMPLE_BLOCK&&_0x578947[_0x3225ce(0xfb)](_0x45a2ad,0x4)){const _0x3f71b5=_0x5d05c9+_0x13e81f+_0x18c79a,[,_0x4fa814]=_0x578947[_0x3225ce(0xf7)](readVint,_0xf17248,_0x3f71b5),_0x3bbdda=_0xf17248[_0x3225ce(0x102)](_0x578947['DiFDS'](_0x3f71b5,_0x4fa814)),_0x328b16=_0x578947['gnNwV'](_0x578947['LIcmM'](_0x13e389+_0x3bbdda,_0x52c57a),0xf4240);_0x578947['UhmXs'](_0x328b16,_0x1b1d7a)&&(_0x1b1d7a=_0x328b16);}else{if(_0x4ee6d5===ID_CLUSTER)break;}}if(isUnknownSize(_0x45a2ad,_0x18c79a))break;_0x5d05c9+=_0x578947['DiFDS'](_0x578947['qAyMy'](_0x13e81f,_0x18c79a),_0x45a2ad);}_0x2648ae=_0x1e690e;}return _0x1b1d7a;}export function fixWebmDuration(_0x38b757,_0x15719c){const _0x4301ec=_0x2473,_0x128b6e={'rGBxI':function(_0xd48ac7,_0x11d7df,_0xe09a25){return _0xd48ac7(_0x11d7df,_0xe09a25);},'aMXvb':function(_0x547a09,_0x423e28,_0x57c37a){return _0x547a09(_0x423e28,_0x57c37a);},'HxnLs':function(_0x521400,_0x34af76){return _0x521400+_0x34af76;},'ZVpgU':function(_0x31b7ff,_0x13f85e){return _0x31b7ff!==_0x13f85e;},'xFnMN':function(_0x5baf22,_0x3f53fd){return _0x5baf22+_0x3f53fd;},'JOpGr':function(_0x1c7282,_0x4c3c39){return _0x1c7282+_0x4c3c39;},'fsLWm':function(_0x2f14e6,_0x300438,_0xccf362){return _0x2f14e6(_0x300438,_0xccf362);},'YXLEL':function(_0x1f7141,_0x3d8936){return _0x1f7141===_0x3d8936;},'HGPKN':function(_0x3affc4,_0x2caedd){return _0x3affc4+_0x2caedd;},'kVysK':function(_0x111733,_0x13e0c2){return _0x111733+_0x13e0c2;},'yRxGw':function(_0x261bfa,_0x549df5,_0x1976f8,_0x46cd0e,_0xdd7c4e){return _0x261bfa(_0x549df5,_0x1976f8,_0x46cd0e,_0xdd7c4e);},'bKOcR':function(_0x2a26f9,_0x2d0046){return _0x2a26f9+_0x2d0046;},'JEPme':function(_0x47d08c,_0x1c0a1d,_0x115cb0,_0x3b702d){return _0x47d08c(_0x1c0a1d,_0x115cb0,_0x3b702d);},'pVexz':function(_0x2698dc,_0x3bcece){return _0x2698dc<=_0x3bcece;},'QqLHO':function(_0x158ecb,_0x16b022){return _0x158ecb/_0x16b022;},'imtTL':function(_0x2d5756,_0x1a6e1d){return _0x2d5756*_0x1a6e1d;},'ytQNJ':function(_0x489b8c,_0x54544a){return _0x489b8c(_0x54544a);},'cEdpH':function(_0x4b4d6f,_0x3a7da1){return _0x4b4d6f+_0x3a7da1;},'bcRTc':function(_0x1b1b88,_0x559294){return _0x1b1b88+_0x559294;},'KOuHF':function(_0x6f8f6d,_0x40ab2f){return _0x6f8f6d-_0x40ab2f;},'rtRpc':function(_0x23e504,_0x630e22,_0x48977c,_0x4f40ae,_0x181e1c,_0x10cd77,_0x3b9390){return _0x23e504(_0x630e22,_0x48977c,_0x4f40ae,_0x181e1c,_0x10cd77,_0x3b9390);},'CKbPr':function(_0x486eec,_0x5d3ef7){return _0x486eec+_0x5d3ef7;}},_0x17cf5a=readFileSync(_0x38b757);let _0x365d71=0x0;const [_0x10606f,_0x35919f]=_0x128b6e[_0x4301ec(0x103)](readId,_0x17cf5a,_0x365d71),[_0x27dc46,_0x530f81]=_0x128b6e['aMXvb'](readVint,_0x17cf5a,_0x365d71+_0x35919f);_0x365d71+=_0x128b6e['HxnLs'](_0x35919f,_0x530f81)+_0x27dc46;const [_0x4c9a1a,_0x5958c2]=readId(_0x17cf5a,_0x365d71);if(_0x128b6e['ZVpgU'](_0x4c9a1a,ID_SEGMENT))return console['error'](_0x4301ec(0xda)),![];const [,_0x261443]=readVint(_0x17cf5a,_0x128b6e[_0x4301ec(0xeb)](_0x365d71,_0x5958c2)),_0x124609=_0x128b6e['JOpGr'](_0x365d71+_0x5958c2,_0x261443);let _0x19c636=_0x124609;const _0x4dadbe=Math['min'](_0x17cf5a['length'],_0x128b6e[_0x4301ec(0x119)](_0x124609,0x2710));let _0xdb3efe=null,_0x53f8e2=null;while(_0x19c636<_0x4dadbe){const [_0x5b6465,_0x107c11]=_0x128b6e[_0x4301ec(0x111)](readId,_0x17cf5a,_0x19c636),[_0x137f6e,_0x326643]=readVint(_0x17cf5a,_0x19c636+_0x107c11);_0x128b6e[_0x4301ec(0xe4)](_0x5b6465,ID_VOID)&&!_0xdb3efe&&(_0xdb3efe={'offset':_0x19c636,'idLen':_0x107c11,'sizeLen':_0x326643,'dataSize':_0x137f6e,'dataOffset':_0x128b6e['HGPKN'](_0x128b6e[_0x4301ec(0xe1)](_0x19c636,_0x107c11),_0x326643)});if(_0x5b6465===ID_INFO){_0x53f8e2={'offset':_0x19c636,'idLen':_0x107c11,'sizeLen':_0x326643,'dataSize':_0x137f6e,'dataOffset':_0x128b6e['xFnMN'](_0x19c636,_0x107c11)+_0x326643};break;}if(_0x5b6465===ID_CLUSTER)break;if(_0x128b6e['rGBxI'](isUnknownSize,_0x137f6e,_0x326643))break;_0x19c636+=_0x107c11+_0x326643+_0x137f6e;}if(!_0x53f8e2)return console['error']('Could\x20not\x20find\x20Info\x20element'),![];const _0x2bbd04=findElement(_0x17cf5a,_0x53f8e2[_0x4301ec(0xf3)],_0x128b6e[_0x4301ec(0xe1)](_0x53f8e2['dataOffset'],_0x53f8e2['dataSize']),ID_DURATION);if(_0x2bbd04)return![];const _0x84dfc4=_0x128b6e[_0x4301ec(0xdc)](findElement,_0x17cf5a,_0x53f8e2['dataOffset'],_0x128b6e['bKOcR'](_0x53f8e2['dataOffset'],_0x53f8e2[_0x4301ec(0xec)]),ID_TIMESTAMP_SCALE);let _0x11cf5f=0xf4240;_0x84dfc4&&(_0x11cf5f=_0x128b6e[_0x4301ec(0xe0)](readUint,_0x17cf5a,_0x84dfc4[_0x4301ec(0xf3)],_0x84dfc4[_0x4301ec(0xec)]));const _0x32054b=computeDurationMs(_0x17cf5a,_0x11cf5f);if(_0x128b6e['pVexz'](_0x32054b,0x0))return console['error']('Could\x20not\x20compute\x20duration'),![];const _0x59a4bb=_0x128b6e['QqLHO'](_0x128b6e['imtTL'](_0x32054b,0xf4240),_0x11cf5f),_0x5a1e45=Buffer['concat']([writeId(ID_DURATION),writeVint(0x8),_0x128b6e[_0x4301ec(0x10d)](writeFloat64,_0x59a4bb)]),_0x47acd8=_0x5a1e45[_0x4301ec(0xf1)];if(!_0xdb3efe||_0xdb3efe['offset']<_0x53f8e2[_0x4301ec(0xdd)]){if(_0xdb3efe){const _0x2348d5=_0x128b6e['cEdpH'](_0x128b6e['bcRTc'](_0xdb3efe[_0x4301ec(0xe5)],_0xdb3efe['sizeLen']),_0xdb3efe['dataSize']),_0x313b8d=_0x128b6e['KOuHF'](_0x2348d5,_0x47acd8);if(_0x313b8d<0x2)return _0x128b6e['rtRpc'](rewriteFile,_0x17cf5a,_0x53f8e2,_0x5a1e45,_0x11cf5f,_0x32054b,_0x15719c);const _0x4206ee=_0x128b6e['CKbPr'](_0x53f8e2['dataSize'],_0x47acd8),_0x44d4ba=Buffer[_0x4301ec(0xff)]([writeId(ID_INFO),writeVint(_0x4206ee,_0x53f8e2['sizeLen'])]),_0x52fcdf=_0x17cf5a['slice'](_0x53f8e2['dataOffset'],_0x53f8e2[_0x4301ec(0xf3)]+_0x53f8e2[_0x4301ec(0xec)]),_0x45e198=writeVoid(_0x313b8d),_0x40666e=_0x17cf5a['slice'](0x0,_0xdb3efe[_0x4301ec(0xdd)]),_0x2fc4b3=_0x17cf5a['slice'](_0x128b6e['HxnLs'](_0x53f8e2['dataOffset'],_0x53f8e2['dataSize']));return writeFileSync(_0x15719c,Buffer[_0x4301ec(0xff)]([_0x40666e,_0x45e198,_0x44d4ba,_0x52fcdf,_0x5a1e45,_0x2fc4b3])),!![];}}return rewriteFile(_0x17cf5a,_0x53f8e2,_0x5a1e45,_0x11cf5f,_0x32054b,_0x15719c);}function rewriteFile(_0x4eb4cd,_0x344714,_0x19bb64,_0x56a61f,_0x2f81d4,_0x6d0dce){const _0x49c665=_0x2473,_0x536792={'hLJml':function(_0x46a178,_0x37ba62){return _0x46a178+_0x37ba62;},'qVLPr':function(_0x180780,_0x3cfa9d){return _0x180780(_0x3cfa9d);}},_0x45b33f=_0x536792[_0x49c665(0x10b)](_0x344714[_0x49c665(0xec)],_0x19bb64['length']),_0xe96a74=Buffer['concat']([_0x536792[_0x49c665(0xdf)](writeId,ID_INFO),_0x536792['qVLPr'](writeVint,_0x45b33f)]),_0xe7f737=_0x536792[_0x49c665(0x10b)](_0x344714['idLen'],_0x344714[_0x49c665(0xe8)]),_0x47ec9f=_0x4eb4cd['slice'](0x0,_0x344714['offset']),_0x3278a5=_0x4eb4cd[_0x49c665(0x10e)](_0x344714['dataOffset'],_0x344714[_0x49c665(0xf3)]+_0x344714[_0x49c665(0xec)]),_0x1a27ab=_0x4eb4cd['slice'](_0x536792['hLJml'](_0x344714[_0x49c665(0xdd)]+_0xe7f737,_0x344714['dataSize']));return writeFileSync(_0x6d0dce,Buffer['concat']([_0x47ec9f,_0xe96a74,_0x3278a5,_0x19bb64,_0x1a27ab])),!![];}if(process[_0x27a57d(0xf5)][0x1]?.[_0x27a57d(0xde)](_0x27a57d(0x115))||process['argv'][0x1]?.['endsWith']('fixWebmDuration.js')){const input=process[_0x27a57d(0xf5)][0x2],output=process[_0x27a57d(0xf5)][0x3];(!input||!output)&&(console['error']('Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>'),process[_0x27a57d(0x101)](0x1));const fixed=fixWebmDuration(input,output);fixed?console['log'](_0x27a57d(0xe9)+output):console[_0x27a57d(0x108)]('File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.');}
1
+ const _0xaaf154=_0x4ccf;(function(_0x491272,_0x5c12de){const _0x37201a=_0x4ccf,_0x17f93e=_0x491272();while(!![]){try{const _0x1b3832=parseInt(_0x37201a(0x1be))/0x1+parseInt(_0x37201a(0x19f))/0x2+-parseInt(_0x37201a(0x1a6))/0x3*(-parseInt(_0x37201a(0x1c3))/0x4)+parseInt(_0x37201a(0x1b5))/0x5+parseInt(_0x37201a(0x19b))/0x6*(-parseInt(_0x37201a(0x1c1))/0x7)+-parseInt(_0x37201a(0x1ac))/0x8*(-parseInt(_0x37201a(0x1ab))/0x9)+-parseInt(_0x37201a(0x1bc))/0xa;if(_0x1b3832===_0x5c12de)break;else _0x17f93e['push'](_0x17f93e['shift']());}catch(_0x1be84e){_0x17f93e['push'](_0x17f93e['shift']());}}}(_0x558c,0x20505));function _0x4ccf(_0x38c1f7,_0x36065){_0x38c1f7=_0x38c1f7-0x189;const _0x558c34=_0x558c();let _0x4ccf82=_0x558c34[_0x38c1f7];return _0x4ccf82;}import{readFileSync,writeFileSync}from'fs';const ID_SEGMENT=0x18538067,ID_INFO=0x1549a966,ID_TIMESTAMP_SCALE=0x2ad7b1,ID_DURATION=0x4489,ID_VOID=0xec,ID_CLUSTER=0x1f43b675,ID_TIMESTAMP=0xe7,ID_SIMPLE_BLOCK=0xa3;function readVint(_0x13cac5,_0x1b20c8){const _0x19a1d6=_0x4ccf,_0xf52ac6={'QBPVA':function(_0x4b48a2,_0x3d9f03){return _0x4b48a2>=_0x3d9f03;},'nmGyI':function(_0x375b8b,_0x17d1a9){return _0x375b8b>_0x17d1a9;},'xPUev':function(_0x43e4f0,_0xd5e9f1){return _0x43e4f0+_0xd5e9f1;},'iQqKe':function(_0x3d2fc9,_0xd997e5){return _0x3d2fc9-_0xd997e5;},'NCRZh':function(_0x478023,_0x32ee9f){return _0x478023<_0x32ee9f;},'ERuGY':function(_0x216964,_0x2925f1){return _0x216964*_0x2925f1;}};if(_0xf52ac6[_0x19a1d6(0x19a)](_0x1b20c8,_0x13cac5[_0x19a1d6(0x1c7)]))return[0x0,0x0];const _0x2304e9=_0x13cac5[_0x1b20c8];let _0x218fa3=0x1,_0x2bdef7=0x80;while(_0x218fa3<=0x8&&!(_0x2304e9&_0x2bdef7)){_0x218fa3++,_0x2bdef7>>=0x1;}if(_0xf52ac6[_0x19a1d6(0x1d2)](_0xf52ac6['xPUev'](_0x1b20c8,_0x218fa3),_0x13cac5['length']))return[0x0,0x0];let _0x1da7a9=_0x2304e9&_0xf52ac6[_0x19a1d6(0x192)](_0x2bdef7,0x1);for(let _0x100827=0x1;_0xf52ac6['NCRZh'](_0x100827,_0x218fa3);_0x100827++){_0x1da7a9=_0xf52ac6[_0x19a1d6(0x1cf)](_0x1da7a9,0x100)+_0x13cac5[_0x1b20c8+_0x100827];}return[_0x1da7a9,_0x218fa3];}function readId(_0x3111f8,_0x3af2b3){const _0x5b8b3d=_0x4ccf,_0x51c204={'GWEId':function(_0x105abb,_0x3a90f2){return _0x105abb>=_0x3a90f2;},'bIrHA':function(_0x45bf8f,_0x5353eb){return _0x45bf8f>=_0x5353eb;},'rxJXZ':function(_0x5f5807,_0x1698b1){return _0x5f5807>=_0x1698b1;},'pCtKu':function(_0x5ba079,_0x5348a8){return _0x5ba079>_0x5348a8;},'afdop':function(_0x4c9ba7,_0x2d278b){return _0x4c9ba7<_0x2d278b;},'whOIE':function(_0x4b02c0,_0x219a40){return _0x4b02c0+_0x219a40;}};if(_0x3af2b3>=_0x3111f8['length'])return[0x0,0x0];const _0x22572a=_0x3111f8[_0x3af2b3];let _0x9df6e1;if(_0x51c204[_0x5b8b3d(0x1c5)](_0x22572a,0x80))_0x9df6e1=0x1;else{if(_0x51c204['bIrHA'](_0x22572a,0x40))_0x9df6e1=0x2;else{if(_0x51c204['rxJXZ'](_0x22572a,0x20))_0x9df6e1=0x3;else{if(_0x51c204['bIrHA'](_0x22572a,0x10))_0x9df6e1=0x4;else return[_0x22572a,0x1];}}}if(_0x51c204['pCtKu'](_0x3af2b3+_0x9df6e1,_0x3111f8[_0x5b8b3d(0x1c7)]))return[0x0,0x0];let _0x74e0b9=0x0;for(let _0x1914c2=0x0;_0x51c204[_0x5b8b3d(0x198)](_0x1914c2,_0x9df6e1);_0x1914c2++){_0x74e0b9=_0x51c204[_0x5b8b3d(0x195)](_0x74e0b9*0x100,_0x3111f8[_0x3af2b3+_0x1914c2]);}return[_0x74e0b9,_0x9df6e1];}function readUint(_0x53077d,_0x40fa25,_0x2944aa){let _0x43db4c=0x0;for(let _0x445885=0x0;_0x445885<_0x2944aa;_0x445885++){_0x43db4c=_0x43db4c*0x100+_0x53077d[_0x40fa25+_0x445885];}return _0x43db4c;}function isUnknownSize(_0x167894,_0x1252d0){const _0x390f8e=_0x4ccf,_0x39a944={'xAYIc':function(_0x5709db,_0x4027f2){return _0x5709db===_0x4027f2;},'FWvJy':function(_0x5c1f96,_0x343d0b){return _0x5c1f96*_0x343d0b;}};return _0x39a944['xAYIc'](_0x167894,Math['pow'](0x2,_0x39a944[_0x390f8e(0x1b0)](0x7,_0x1252d0))-0x1);}function _0x558c(){const _0x4bdf3e=['Could\x20not\x20compute\x20duration','File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.','indexOf','VqwcL','pRsgK','wzUbR','9255770jatfwU','fhkVV','239837EPbmUj','xHipN','GCYln','14BVdUXi','from','66456lHOTCz','fixWebmDuration.js','GWEId','argv','length','hhhZX','fiFsy','Fixed:\x20','offset','KNDCS','zBNwr','readInt16BE','ERuGY','slice','QJbik','nmGyI','AYFVs','obttT','floor','exit','RJCAF','sizeLen','vQqml','wBCZe','JytYF','MDMud','iQqKe','FpHlZ','UyLIE','whOIE','cRLcX','error','afdop','alloc','QBPVA','420468NHLZvZ','SpFhZ','AxyuC','idLen','477570karDhE','hkxZo','YIzhm','pow','concat','OIzeC','oOqnb','39DhvDdv','dataOffset','aITvh','PREpe','mwXAX','7893MZMbUP','2184LJfQRL','FWSvH','qUjQI','aRMsS','FWvJy','min','dataSize','vkpCB','bwQzA','1320325MrtCCu'];_0x558c=function(){return _0x4bdf3e;};return _0x558c();}function writeId(_0x52450d){const _0x306494=_0x4ccf,_0x22cada={'aITvh':function(_0x385138,_0x44e78e){return _0x385138&_0x44e78e;},'kBIlP':function(_0x54a8d6,_0x58b68d){return _0x54a8d6>>_0x58b68d;},'jRcdx':function(_0x2b3edb,_0xbc63ce){return _0x2b3edb<=_0xbc63ce;},'FWSvH':function(_0x237223,_0x2aaf01){return _0x237223&_0x2aaf01;},'obttT':function(_0x5253be,_0x52e563){return _0x5253be>>_0x52e563;}};if(_0x52450d<=0xff)return Buffer[_0x306494(0x1c2)]([_0x52450d]);if(_0x52450d<=0xffff)return Buffer[_0x306494(0x1c2)]([_0x22cada[_0x306494(0x1a8)](_0x22cada['kBIlP'](_0x52450d,0x8),0xff),_0x22cada['aITvh'](_0x52450d,0xff)]);if(_0x22cada['jRcdx'](_0x52450d,0xffffff))return Buffer[_0x306494(0x1c2)]([_0x22cada['kBIlP'](_0x52450d,0x10)&0xff,_0x22cada['aITvh'](_0x52450d>>0x8,0xff),_0x22cada['FWSvH'](_0x52450d,0xff)]);return Buffer['from']([_0x52450d>>0x18&0xff,_0x22cada[_0x306494(0x1ad)](_0x52450d>>0x10,0xff),_0x22cada[_0x306494(0x189)](_0x52450d,0x8)&0xff,_0x22cada['aITvh'](_0x52450d,0xff)]);}function writeVint(_0x361f06,_0x10fd81){const _0x5c4414=_0x4ccf,_0x52b805={'sGnPV':function(_0x3ba780,_0x3f7229){return _0x3ba780||_0x3f7229;},'UtsXn':function(_0x5d4eb3,_0x920491){return _0x5d4eb3-_0x920491;},'OIzeC':function(_0x37043b,_0x4283b1){return _0x37043b>=_0x4283b1;},'BkAuf':function(_0x10c9fd,_0x3b4f05){return _0x10c9fd&_0x3b4f05;},'pRsgK':function(_0x15bd2f,_0xf7d171){return _0x15bd2f<<_0xf7d171;}};let _0x4f8187=_0x52b805['sGnPV'](_0x10fd81,0x1);while(Math[_0x5c4414(0x1a2)](0x2,0x7*_0x4f8187)-0x2<_0x361f06)_0x4f8187++;const _0x355e80=Buffer[_0x5c4414(0x199)](_0x4f8187);for(let _0x5c3ff1=_0x52b805['UtsXn'](_0x4f8187,0x1);_0x52b805[_0x5c4414(0x1a4)](_0x5c3ff1,0x0);_0x5c3ff1--){_0x355e80[_0x5c3ff1]=_0x52b805['BkAuf'](_0x361f06,0xff),_0x361f06=Math[_0x5c4414(0x18a)](_0x361f06/0x100);}return _0x355e80[0x0]|=_0x52b805[_0x5c4414(0x1ba)](0x1,0x8-_0x4f8187),_0x355e80;}function writeFloat64(_0x2982b1){const _0x30a5f3=Buffer['alloc'](0x8);return _0x30a5f3['writeDoubleBE'](_0x2982b1,0x0),_0x30a5f3;}function writeVoid(_0x506f3c){const _0x9f1112=_0x4ccf,_0x3e6d75={'bwQzA':function(_0xabb5d7,_0x141882){return _0xabb5d7<=_0x141882;},'fxKDE':function(_0x58bde1,_0x57f2d6){return _0x58bde1>=_0x57f2d6;},'PREpe':function(_0x3dcb49,_0x34e08a){return _0x3dcb49-_0x34e08a;}};for(let _0x32274e=0x1;_0x3e6d75['bwQzA'](_0x32274e,0x8);_0x32274e++){const _0x4a5c38=_0x506f3c-0x1-_0x32274e;if(_0x3e6d75['fxKDE'](_0x4a5c38,0x0)&&_0x3e6d75[_0x9f1112(0x1b4)](_0x4a5c38,_0x3e6d75[_0x9f1112(0x1a9)](Math[_0x9f1112(0x1a2)](0x2,0x7*_0x32274e),0x2)))return Buffer[_0x9f1112(0x1a3)]([Buffer[_0x9f1112(0x1c2)]([ID_VOID]),writeVint(_0x4a5c38,_0x32274e),Buffer[_0x9f1112(0x199)](_0x4a5c38)]);}return Buffer[_0x9f1112(0x199)](0x0);}function findElement(_0x4faef9,_0x922efa,_0x34f300,_0x1fecef){const _0x1c3b89=_0x4ccf,_0x40c338={'VqwcL':function(_0x24d25e,_0x37ffea){return _0x24d25e<_0x37ffea;},'Vynct':function(_0x8c23a8,_0x55ec55,_0x56d237){return _0x8c23a8(_0x55ec55,_0x56d237);},'AxyuC':function(_0x3a58b1,_0x57d09b,_0x3e7d5f){return _0x3a58b1(_0x57d09b,_0x3e7d5f);},'vKMIs':function(_0x1a0ebf,_0x165703){return _0x1a0ebf+_0x165703;},'AYFVs':function(_0xd8a715,_0x26a51c){return _0xd8a715+_0x26a51c;},'wzUbR':function(_0x4f902e,_0x36a62b){return _0x4f902e+_0x36a62b;}};let _0x25656f=_0x922efa;while(_0x40c338[_0x1c3b89(0x1b9)](_0x25656f,_0x34f300)){const [_0x2afa63,_0x1b73ef]=_0x40c338['Vynct'](readId,_0x4faef9,_0x25656f),[_0x27e281,_0x480f8a]=_0x40c338[_0x1c3b89(0x19d)](readVint,_0x4faef9,_0x40c338['vKMIs'](_0x25656f,_0x1b73ef));if(_0x2afa63===_0x1fecef)return{'offset':_0x25656f,'idLen':_0x1b73ef,'sizeLen':_0x480f8a,'dataSize':_0x27e281,'dataOffset':_0x40c338['vKMIs'](_0x25656f+_0x1b73ef,_0x480f8a)};if(_0x40c338['AxyuC'](isUnknownSize,_0x27e281,_0x480f8a))break;_0x25656f+=_0x40c338[_0x1c3b89(0x1d3)](_0x40c338[_0x1c3b89(0x1bb)](_0x1b73ef,_0x480f8a),_0x27e281);}return null;}function computeDurationMs(_0x54e968,_0x1112f6){const _0x1854bb=_0x4ccf,_0x37b1bb={'HNFrW':function(_0x5768ec,_0x21a290){return _0x5768ec===_0x21a290;},'fiFsy':function(_0x2a67a6,_0x3faffb){return _0x2a67a6!==_0x3faffb;},'hkxZo':function(_0x57fae5,_0x16eafd,_0x4f451b){return _0x57fae5(_0x16eafd,_0x4f451b);},'xHipN':function(_0x41c1b9,_0x49cf4e){return _0x41c1b9+_0x49cf4e;},'YIzhm':function(_0x1264e8,_0x10a7f4){return _0x1264e8+_0x10a7f4;},'mwXAX':function(_0x2438d4,_0x335ba6,_0x3236b4){return _0x2438d4(_0x335ba6,_0x3236b4);},'qUjQI':function(_0x5c3ed4,_0x105388){return _0x5c3ed4+_0x105388;},'TfeUB':function(_0x387488,_0x5b47f2,_0x233b6a){return _0x387488(_0x5b47f2,_0x233b6a);},'SpFhZ':function(_0xf18f5e,_0x46879e){return _0xf18f5e<_0x46879e;},'GCYln':function(_0xca17b,_0xf5e7f7,_0x4cb969,_0x533f86){return _0xca17b(_0xf5e7f7,_0x4cb969,_0x533f86);},'hiWyF':function(_0x49db2a,_0x3a68e2){return _0x49db2a+_0x3a68e2;},'oOqnb':function(_0x3b3095,_0x54e292){return _0x3b3095===_0x54e292;},'cRLcX':function(_0x209a77,_0x38f45e){return _0x209a77>=_0x38f45e;},'aRMsS':function(_0x2004a9,_0x33a188){return _0x2004a9+_0x33a188;},'fhkVV':function(_0x206bc5,_0x37061c){return _0x206bc5/_0x37061c;},'zBNwr':function(_0x2a8258,_0x1740f0){return _0x2a8258*_0x1740f0;},'RJCAF':function(_0x42edf4,_0xa98baa,_0x43efc9){return _0x42edf4(_0xa98baa,_0x43efc9);}};let _0x162cba=0x0;const _0x42b383=Buffer[_0x1854bb(0x1c2)]([0x1f,0x43,0xb6,0x75]);let _0x4d2442=_0x54e968[_0x1854bb(0x1b8)](_0x42b383);if(_0x37b1bb['HNFrW'](_0x4d2442,-0x1))return 0x0;while(_0x4d2442<_0x54e968[_0x1854bb(0x1c7)]){const [_0x51c377,_0x2eb547]=readId(_0x54e968,_0x4d2442);if(_0x37b1bb[_0x1854bb(0x1c9)](_0x51c377,ID_CLUSTER))break;const [_0x112b93,_0x52110c]=_0x37b1bb['hkxZo'](readVint,_0x54e968,_0x37b1bb[_0x1854bb(0x1bf)](_0x4d2442,_0x2eb547)),_0x3f0d9a=_0x37b1bb['xHipN'](_0x37b1bb[_0x1854bb(0x1a1)](_0x4d2442,_0x2eb547),_0x52110c),_0x3f03b2=isUnknownSize(_0x112b93,_0x52110c);let _0x4e9775;if(_0x3f03b2){let _0x339bed=_0x3f0d9a;while(_0x339bed<_0x54e968[_0x1854bb(0x1c7)]-0x4){const [_0x5aa32c,_0x3bc8a0]=readId(_0x54e968,_0x339bed);if(_0x37b1bb['HNFrW'](_0x5aa32c,ID_CLUSTER)){_0x4e9775=_0x339bed;break;}const [_0x1df765,_0x445a86]=_0x37b1bb[_0x1854bb(0x1aa)](readVint,_0x54e968,_0x37b1bb[_0x1854bb(0x1ae)](_0x339bed,_0x3bc8a0));if(_0x37b1bb['TfeUB'](isUnknownSize,_0x1df765,_0x445a86)){_0x4e9775=_0x54e968[_0x1854bb(0x1c7)];break;}_0x339bed+=_0x37b1bb['xHipN'](_0x37b1bb['YIzhm'](_0x3bc8a0,_0x445a86),_0x1df765);}_0x4e9775??=_0x54e968['length'];}else _0x4e9775=_0x37b1bb[_0x1854bb(0x1ae)](_0x3f0d9a,_0x112b93);let _0x5c75e6=0x0,_0xb07ac1=_0x3f0d9a;while(_0x37b1bb[_0x1854bb(0x19c)](_0xb07ac1,_0x4e9775)){const [_0x22f453,_0x460966]=_0x37b1bb['hkxZo'](readId,_0x54e968,_0xb07ac1),[_0xec2b6f,_0x129b18]=_0x37b1bb[_0x1854bb(0x1a0)](readVint,_0x54e968,_0xb07ac1+_0x460966);if(_0x37b1bb['HNFrW'](_0x22f453,ID_TIMESTAMP))_0x5c75e6=_0x37b1bb[_0x1854bb(0x1c0)](readUint,_0x54e968,_0x37b1bb['hiWyF'](_0xb07ac1+_0x460966,_0x129b18),_0xec2b6f);else{if(_0x37b1bb[_0x1854bb(0x1a5)](_0x22f453,ID_SIMPLE_BLOCK)&&_0x37b1bb[_0x1854bb(0x196)](_0xec2b6f,0x4)){const _0x430c1d=_0x37b1bb['aRMsS'](_0xb07ac1+_0x460966,_0x129b18),[,_0x572a12]=readVint(_0x54e968,_0x430c1d),_0x4d8e0f=_0x54e968[_0x1854bb(0x1ce)](_0x37b1bb[_0x1854bb(0x1af)](_0x430c1d,_0x572a12)),_0x50dcd9=_0x37b1bb[_0x1854bb(0x1bd)](_0x37b1bb[_0x1854bb(0x1cd)](_0x5c75e6+_0x4d8e0f,_0x1112f6),0xf4240);_0x50dcd9>_0x162cba&&(_0x162cba=_0x50dcd9);}else{if(_0x22f453===ID_CLUSTER)break;}}if(_0x37b1bb[_0x1854bb(0x18c)](isUnknownSize,_0xec2b6f,_0x129b18))break;_0xb07ac1+=_0x37b1bb['xHipN'](_0x460966+_0x129b18,_0xec2b6f);}_0x4d2442=_0x4e9775;}return _0x162cba;}export function fixWebmDuration(_0x37eb38,_0x55dcbd){const _0x7b47f4=_0x4ccf,_0x3ebe23={'CSJFB':function(_0x4a4634,_0x1ba844){return _0x4a4634(_0x1ba844);},'JytYF':function(_0xc7a57e,_0x573b98,_0x300be5){return _0xc7a57e(_0x573b98,_0x300be5);},'MDMud':function(_0x28101b,_0x496bf4){return _0x28101b+_0x496bf4;},'FpHlZ':function(_0x3d63f6,_0x120d98){return _0x3d63f6+_0x120d98;},'vkpCB':function(_0x38a456,_0x528d1c,_0x42e15b){return _0x38a456(_0x528d1c,_0x42e15b);},'oLrpQ':function(_0x33c995,_0x432e39){return _0x33c995+_0x432e39;},'vlJSl':function(_0x4f5c4f,_0xc36a60){return _0x4f5c4f+_0xc36a60;},'aPOSA':function(_0x1b75f2,_0x2d182d,_0x834ba,_0x3e5dbc,_0x5581f0){return _0x1b75f2(_0x2d182d,_0x834ba,_0x3e5dbc,_0x5581f0);},'UyLIE':function(_0x15efb3,_0x973bbe){return _0x15efb3+_0x973bbe;},'QJbik':function(_0x188f6c,_0x1deccb){return _0x188f6c<=_0x1deccb;},'PfsNn':_0x7b47f4(0x1b6),'yCyXz':function(_0x168f66,_0x2e4d77){return _0x168f66/_0x2e4d77;},'VcIZp':function(_0x534e87,_0x3370ff){return _0x534e87*_0x3370ff;},'wBCZe':function(_0x499d7e,_0x1114af){return _0x499d7e<_0x1114af;},'hhhZX':function(_0x162648,_0x3fd3f0,_0x6309a3,_0x90643d,_0x3ba59a,_0xdf6d0e,_0x569c82){return _0x162648(_0x3fd3f0,_0x6309a3,_0x90643d,_0x3ba59a,_0xdf6d0e,_0x569c82);},'DCGkO':function(_0x1a5f0a,_0x439e68){return _0x1a5f0a(_0x439e68);},'KNDCS':function(_0x469db5,_0x2ea321){return _0x469db5(_0x2ea321);},'yEKMq':function(_0x5a6af8,_0x35c5fa,_0x14c282){return _0x5a6af8(_0x35c5fa,_0x14c282);}},_0x4414fe=_0x3ebe23['CSJFB'](readFileSync,_0x37eb38);let _0x2b1f87=0x0;const [_0x29a5e7,_0x10a035]=_0x3ebe23[_0x7b47f4(0x190)](readId,_0x4414fe,_0x2b1f87),[_0x522039,_0x1ed5ee]=_0x3ebe23[_0x7b47f4(0x190)](readVint,_0x4414fe,_0x3ebe23[_0x7b47f4(0x191)](_0x2b1f87,_0x10a035));_0x2b1f87+=_0x3ebe23[_0x7b47f4(0x193)](_0x10a035+_0x1ed5ee,_0x522039);const [_0x2ce538,_0x54a1fc]=readId(_0x4414fe,_0x2b1f87);if(_0x2ce538!==ID_SEGMENT)return console['error']('Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment'),![];const [,_0x4d17b3]=_0x3ebe23[_0x7b47f4(0x1b3)](readVint,_0x4414fe,_0x2b1f87+_0x54a1fc),_0xa6e43=_0x3ebe23['oLrpQ'](_0x3ebe23[_0x7b47f4(0x191)](_0x2b1f87,_0x54a1fc),_0x4d17b3);let _0x1508f5=_0xa6e43;const _0x42f529=Math[_0x7b47f4(0x1b1)](_0x4414fe[_0x7b47f4(0x1c7)],_0x3ebe23['oLrpQ'](_0xa6e43,0x2710));let _0x534312=null,_0x3c4f3f=null;while(_0x1508f5<_0x42f529){const [_0x203a32,_0x3cd903]=_0x3ebe23['JytYF'](readId,_0x4414fe,_0x1508f5),[_0x3557e6,_0x4e95d7]=_0x3ebe23['JytYF'](readVint,_0x4414fe,_0x1508f5+_0x3cd903);_0x203a32===ID_VOID&&!_0x534312&&(_0x534312={'offset':_0x1508f5,'idLen':_0x3cd903,'sizeLen':_0x4e95d7,'dataSize':_0x3557e6,'dataOffset':_0x3ebe23['oLrpQ'](_0x1508f5,_0x3cd903)+_0x4e95d7});if(_0x203a32===ID_INFO){_0x3c4f3f={'offset':_0x1508f5,'idLen':_0x3cd903,'sizeLen':_0x4e95d7,'dataSize':_0x3557e6,'dataOffset':_0x3ebe23['vlJSl'](_0x3ebe23[_0x7b47f4(0x193)](_0x1508f5,_0x3cd903),_0x4e95d7)};break;}if(_0x203a32===ID_CLUSTER)break;if(isUnknownSize(_0x3557e6,_0x4e95d7))break;_0x1508f5+=_0x3cd903+_0x4e95d7+_0x3557e6;}if(!_0x3c4f3f)return console[_0x7b47f4(0x197)]('Could\x20not\x20find\x20Info\x20element'),![];const _0x1725ee=findElement(_0x4414fe,_0x3c4f3f['dataOffset'],_0x3ebe23[_0x7b47f4(0x193)](_0x3c4f3f['dataOffset'],_0x3c4f3f['dataSize']),ID_DURATION);if(_0x1725ee)return![];const _0x456620=_0x3ebe23['aPOSA'](findElement,_0x4414fe,_0x3c4f3f[_0x7b47f4(0x1a7)],_0x3ebe23[_0x7b47f4(0x194)](_0x3c4f3f['dataOffset'],_0x3c4f3f['dataSize']),ID_TIMESTAMP_SCALE);let _0x561e6f=0xf4240;_0x456620&&(_0x561e6f=readUint(_0x4414fe,_0x456620[_0x7b47f4(0x1a7)],_0x456620['dataSize']));const _0xe27f92=computeDurationMs(_0x4414fe,_0x561e6f);if(_0x3ebe23[_0x7b47f4(0x1d1)](_0xe27f92,0x0))return console[_0x7b47f4(0x197)](_0x3ebe23['PfsNn']),![];const _0x417c8f=_0x3ebe23['yCyXz'](_0x3ebe23['VcIZp'](_0xe27f92,0xf4240),_0x561e6f),_0x1b8a18=Buffer[_0x7b47f4(0x1a3)]([writeId(ID_DURATION),writeVint(0x8),writeFloat64(_0x417c8f)]),_0x55d118=_0x1b8a18[_0x7b47f4(0x1c7)];if(!_0x534312||_0x3ebe23[_0x7b47f4(0x18f)](_0x534312['offset'],_0x3c4f3f['offset'])){if(_0x534312){const _0x20204f=_0x534312[_0x7b47f4(0x19e)]+_0x534312['sizeLen']+_0x534312['dataSize'],_0x2ed386=_0x20204f-_0x55d118;if(_0x2ed386<0x2)return _0x3ebe23[_0x7b47f4(0x1c8)](rewriteFile,_0x4414fe,_0x3c4f3f,_0x1b8a18,_0x561e6f,_0xe27f92,_0x55dcbd);const _0x76528c=_0x3c4f3f[_0x7b47f4(0x1b2)]+_0x55d118,_0x453883=Buffer['concat']([_0x3ebe23['DCGkO'](writeId,ID_INFO),writeVint(_0x76528c,_0x3c4f3f['sizeLen'])]),_0x5944fd=_0x4414fe['slice'](_0x3c4f3f[_0x7b47f4(0x1a7)],_0x3c4f3f[_0x7b47f4(0x1a7)]+_0x3c4f3f[_0x7b47f4(0x1b2)]),_0x468278=_0x3ebe23[_0x7b47f4(0x1cc)](writeVoid,_0x2ed386),_0xcd0a71=_0x4414fe['slice'](0x0,_0x534312['offset']),_0x1c0597=_0x4414fe['slice'](_0x3c4f3f[_0x7b47f4(0x1a7)]+_0x3c4f3f[_0x7b47f4(0x1b2)]);return _0x3ebe23['yEKMq'](writeFileSync,_0x55dcbd,Buffer['concat']([_0xcd0a71,_0x468278,_0x453883,_0x5944fd,_0x1b8a18,_0x1c0597])),!![];}}return _0x3ebe23[_0x7b47f4(0x1c8)](rewriteFile,_0x4414fe,_0x3c4f3f,_0x1b8a18,_0x561e6f,_0xe27f92,_0x55dcbd);}function rewriteFile(_0x2a123f,_0x35ee0,_0x38504a,_0x29687f,_0x2e18f3,_0x120d3a){const _0x5aad31=_0x4ccf,_0x26fc4e={'vQqml':function(_0x49ca97,_0x4649ae){return _0x49ca97(_0x4649ae);},'QRXBq':function(_0x436d8a,_0x1d78cb){return _0x436d8a+_0x1d78cb;},'wngZA':function(_0x3eb278,_0x185e4c){return _0x3eb278+_0x185e4c;}},_0x54898b=_0x35ee0[_0x5aad31(0x1b2)]+_0x38504a['length'],_0x2b703c=Buffer[_0x5aad31(0x1a3)]([_0x26fc4e[_0x5aad31(0x18e)](writeId,ID_INFO),_0x26fc4e['vQqml'](writeVint,_0x54898b)]),_0x2370d1=_0x26fc4e['QRXBq'](_0x35ee0['idLen'],_0x35ee0[_0x5aad31(0x18d)]),_0x599676=_0x2a123f['slice'](0x0,_0x35ee0[_0x5aad31(0x1cb)]),_0x143f4f=_0x2a123f['slice'](_0x35ee0['dataOffset'],_0x26fc4e['QRXBq'](_0x35ee0[_0x5aad31(0x1a7)],_0x35ee0[_0x5aad31(0x1b2)])),_0x14d5d2=_0x2a123f[_0x5aad31(0x1d0)](_0x26fc4e['wngZA'](_0x35ee0[_0x5aad31(0x1cb)],_0x2370d1)+_0x35ee0['dataSize']);return writeFileSync(_0x120d3a,Buffer['concat']([_0x599676,_0x2b703c,_0x143f4f,_0x38504a,_0x14d5d2])),!![];}if(process['argv'][0x1]?.['endsWith']('fixWebmDuration.ts')||process[_0xaaf154(0x1c6)][0x1]?.['endsWith'](_0xaaf154(0x1c4))){const input=process[_0xaaf154(0x1c6)][0x2],output=process['argv'][0x3];(!input||!output)&&(console[_0xaaf154(0x197)]('Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>'),process[_0xaaf154(0x18b)](0x1));const fixed=fixWebmDuration(input,output);fixed?console['log'](_0xaaf154(0x1ca)+output):console['log'](_0xaaf154(0x1b7));}
@@ -1 +1 @@
1
- (function(_0x22d030,_0x5d3dfd){const _0x13c178=_0x33cc,_0x5ee21f=_0x22d030();while(!![]){try{const _0x1ec005=parseInt(_0x13c178(0xd1))/0x1+-parseInt(_0x13c178(0xcb))/0x2*(parseInt(_0x13c178(0xd0))/0x3)+parseInt(_0x13c178(0xcd))/0x4*(parseInt(_0x13c178(0xd8))/0x5)+parseInt(_0x13c178(0xce))/0x6*(parseInt(_0x13c178(0xca))/0x7)+-parseInt(_0x13c178(0xd2))/0x8+-parseInt(_0x13c178(0xd6))/0x9*(-parseInt(_0x13c178(0xcf))/0xa)+parseInt(_0x13c178(0xcc))/0xb*(parseInt(_0x13c178(0xd7))/0xc);if(_0x1ec005===_0x5d3dfd)break;else _0x5ee21f['push'](_0x5ee21f['shift']());}catch(_0x5f5c5f){_0x5ee21f['push'](_0x5ee21f['shift']());}}}(_0x3eec,0xcce94));import{execFile as _0x52e4df}from'child_process';import{promisify}from'util';const execFile=promisify(_0x52e4df);export async function isPathGitTracked(_0x5367d5){const _0x179148=_0x33cc,_0x119d32={'QoSWS':_0x179148(0xd4),'lKVRY':'ls-files','cqbkS':_0x179148(0xd3)};try{return await execFile(_0x119d32['QoSWS'],[_0x119d32[_0x179148(0xd5)],_0x119d32['cqbkS'],_0x5367d5],{'cwd':process['cwd']()}),!![];}catch{return![];}}function _0x33cc(_0x1d36ba,_0x8a60){_0x1d36ba=_0x1d36ba-0xca;const _0x3eec15=_0x3eec();let _0x33cc7c=_0x3eec15[_0x1d36ba];return _0x33cc7c;}function _0x3eec(){const _0x37ef40=['git','lKVRY','45iYLDng','11244GQCTfc','1433710mWANSA','7538587eUVCKz','38jnKWOg','7997lfjZVg','4PdFBlK','6SUssHd','214610wJJyFZ','173901IaNOTn','595447cceEzS','6455560vrPxND','--error-unmatch'];_0x3eec=function(){return _0x37ef40;};return _0x3eec();}
1
+ function _0x2c4a(_0x746e64,_0x530087){_0x746e64=_0x746e64-0xaa;const _0x3a6c3b=_0x3a6c();let _0x2c4a4c=_0x3a6c3b[_0x746e64];return _0x2c4a4c;}(function(_0x218a0c,_0x49bfea){const _0x420509=_0x2c4a,_0x50b46c=_0x218a0c();while(!![]){try{const _0x3ec62c=-parseInt(_0x420509(0xae))/0x1+-parseInt(_0x420509(0xab))/0x2+-parseInt(_0x420509(0xb5))/0x3*(-parseInt(_0x420509(0xad))/0x4)+parseInt(_0x420509(0xaf))/0x5+-parseInt(_0x420509(0xac))/0x6*(-parseInt(_0x420509(0xb3))/0x7)+-parseInt(_0x420509(0xb0))/0x8+parseInt(_0x420509(0xb1))/0x9*(parseInt(_0x420509(0xb4))/0xa);if(_0x3ec62c===_0x49bfea)break;else _0x50b46c['push'](_0x50b46c['shift']());}catch(_0xf243b8){_0x50b46c['push'](_0x50b46c['shift']());}}}(_0x3a6c,0x768dc));import{execFile as _0x318209}from'child_process';import{promisify}from'util';function _0x3a6c(){const _0x1cdb97=['4330gtukRa','610137vCzDJS','--error-unmatch','794552xAwUTB','1644sFLbsc','4HsqzEm','178682tziUyy','4555300ZpPPSP','5395200VZrxUO','1323JNufvU','ls-files','14252jokqkD'];_0x3a6c=function(){return _0x1cdb97;};return _0x3a6c();}const execFile=promisify(_0x318209);export async function isPathGitTracked(_0x3ae914){const _0x59de86=_0x2c4a,_0x5c960d={'MhpiE':'git','fgNIO':_0x59de86(0xb2)};try{return await execFile(_0x5c960d['MhpiE'],[_0x5c960d['fgNIO'],_0x59de86(0xaa),_0x3ae914],{'cwd':process['cwd']()}),!![];}catch{return![];}}