@ranger-testing/ranger-cli 3.0.1-alpha.d9f4572-27 → 3.0.1-alpha.ffffb5b-28
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.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x296b05=_0x25a0;(function(_0x55a570,_0x1605e8){const _0x362b1d=_0x25a0,_0x57d756=_0x55a570();while(!![]){try{const _0x4e61c3=parseInt(_0x362b1d(0x23a))/0x1+parseInt(_0x362b1d(0x239))/0x2+parseInt(_0x362b1d(0x243))/0x3*(-parseInt(_0x362b1d(0x20c))/0x4)+-parseInt(_0x362b1d(0x242))/0x5*(parseInt(_0x362b1d(0x263))/0x6)+-parseInt(_0x362b1d(0x1f8))/0x7+parseInt(_0x362b1d(0x225))/0x8+parseInt(_0x362b1d(0x25f))/0x9;if(_0x4e61c3===_0x1605e8)break;else _0x57d756['push'](_0x57d756['shift']());}catch(_0x4ac9f3){_0x57d756['push'](_0x57d756['shift']());}}}(_0x5ebf,0x33a22));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x598102 from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x499a12=_0x25a0,_0x4bc52f={'IWbDy':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x5e9948=await getToken();if(!_0x5e9948)throw new Error(_0x4bc52f[_0x499a12(0x24d)]);return _0x5e9948;}async function apiRequest(_0x366fbf,_0xbfa0e9={}){const _0x52c11b=_0x25a0,_0x2b823c={'DOnpC':function(_0x56f964){return _0x56f964();},'wtHkk':function(_0x627530){return _0x627530();},'YnjhQ':_0x52c11b(0x272),'CSuAZ':function(_0x39e6bd,_0x51c7d2){return _0x39e6bd===_0x51c7d2;},'cZggC':'string'},_0x2391bf=await _0x2b823c[_0x52c11b(0x269)](requireToken),_0x20dc7e=_0x2b823c[_0x52c11b(0x262)](getApiBaseUrl),_0x4d7d2b=await fetch(''+_0x20dc7e+_0x366fbf,{..._0xbfa0e9,'headers':{'Authorization':'Bearer\x20'+_0x2391bf,'Content-Type':_0x2b823c[_0x52c11b(0x25e)],..._0xbfa0e9[_0x52c11b(0x266)]??{}}});if(!_0x4d7d2b['ok']){let _0x4a33eb='',_0x568208;try{const _0x3e6b38=await _0x4d7d2b[_0x52c11b(0x271)]();_0x4a33eb=(_0x2b823c[_0x52c11b(0x26a)](typeof _0x3e6b38[_0x52c11b(0x25d)],_0x2b823c['cZggC'])?_0x3e6b38[_0x52c11b(0x25d)]:undefined)??JSON['stringify'](_0x3e6b38);if(typeof _0x3e6b38['code']===_0x2b823c['cZggC'])_0x568208=_0x3e6b38[_0x52c11b(0x233)];}catch{_0x4a33eb=_0x4d7d2b['statusText'];}throw new ApiError(_0x52c11b(0x26f)+_0x366fbf+'\x20failed\x20('+_0x4d7d2b[_0x52c11b(0x201)]+_0x52c11b(0x251)+_0x4a33eb,_0x4d7d2b['status'],_0x4a33eb,_0x568208);}if(_0x4d7d2b['status']===0xcc)return undefined;return _0x4d7d2b['json']();}export class ApiError extends Error{[_0x296b05(0x201)];[_0x296b05(0x1fa)];['code'];constructor(_0x50432e,_0x4f26ae,_0x2737e4,_0x431140){const _0x1d0742=_0x296b05,_0x3f2a55='0|1|4|3|2'['split']('|');let _0x4c031e=0x0;while(!![]){switch(_0x3f2a55[_0x4c031e++]){case'0':super(_0x50432e);continue;case'1':this[_0x1d0742(0x201)]=_0x4f26ae;continue;case'2':this[_0x1d0742(0x22a)]=_0x1d0742(0x21b);continue;case'3':this['code']=_0x431140;continue;case'4':this[_0x1d0742(0x1fa)]=_0x2737e4;continue;}break;}}}export async function fetchCloudProfile(_0x2556dd){const _0x16460f=_0x296b05,_0x4cedee={'DchdO':function(_0x6c0dc5,_0x5a97d1){return _0x6c0dc5(_0x5a97d1);},'lMoQA':function(_0x589841,_0x8bbdad){return _0x589841(_0x8bbdad);},'ajrtr':function(_0x4f26c9,_0x4869ce){return _0x4f26c9===_0x4869ce;}};try{return await _0x4cedee[_0x16460f(0x226)](apiRequest,'/api/v1/profiles/'+_0x4cedee[_0x16460f(0x1ff)](encodeURIComponent,_0x2556dd));}catch(_0x2d3033){if(_0x2d3033 instanceof ApiError&&_0x4cedee[_0x16460f(0x229)](_0x2d3033['status'],0x194))return null;throw _0x2d3033;}}export async function listCloudProfiles(){const _0x446b18=_0x296b05,_0x21849b=await apiRequest('/api/v1/profiles');return _0x21849b[_0x446b18(0x270)];}export async function deleteCloudProfile(_0x549f52){const _0xf97702=_0x296b05,_0x4cd80e={'ofYGN':function(_0x6fab1,_0x4c2d7f,_0x324874){return _0x6fab1(_0x4c2d7f,_0x324874);},'yzfEL':_0xf97702(0x24f),'gNNEc':function(_0x442806,_0xa102ad){return _0x442806 instanceof _0xa102ad;},'xZqDF':function(_0x149b3f,_0x5b336e){return _0x149b3f===_0x5b336e;}};try{await _0x4cd80e[_0xf97702(0x211)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x549f52),{'method':_0x4cd80e[_0xf97702(0x255)]});}catch(_0xf587b3){if(_0x4cd80e[_0xf97702(0x231)](_0xf587b3,ApiError)&&_0x4cd80e['xZqDF'](_0xf587b3['status'],0x194))throw new Error('Cloud\x20profile\x20\x22'+_0x549f52+'\x22\x20not\x20found.');throw _0xf587b3;}}export async function createCloudProfile(_0x140300,_0x7e6861,_0x5258c8={}){const _0x39f291=_0x296b05,_0x167819={'SmKiR':'POST'},_0x2d566f={'name':_0x140300};if(_0x7e6861)_0x2d566f['environment_key']=_0x7e6861;_0x5258c8['settings']&&Object[_0x39f291(0x23d)](_0x5258c8['settings'])[_0x39f291(0x213)]>0x0&&(_0x2d566f[_0x39f291(0x24b)]=_0x5258c8['settings']);if(_0x5258c8[_0x39f291(0x1fe)])_0x2d566f['username']=_0x5258c8[_0x39f291(0x1fe)];if(_0x5258c8['password'])_0x2d566f['password']=_0x5258c8[_0x39f291(0x1f4)];return await apiRequest(_0x39f291(0x25a),{'method':_0x167819['SmKiR'],'body':JSON['stringify'](_0x2d566f)});}export async function uploadCloudProfileSession(_0x4dd71e,_0x20d335){const _0x5a22da=_0x296b05,_0x3b21c3={'kSnTB':function(_0x37cadd,_0x2abf1a,_0x362d56){return _0x37cadd(_0x2abf1a,_0x362d56);},'fPfTI':function(_0x1a6d67,_0x4e7974){return _0x1a6d67(_0x4e7974);}};return await _0x3b21c3['kSnTB'](apiRequest,'/api/v1/profiles/'+_0x3b21c3['fPfTI'](encodeURIComponent,_0x4dd71e)+'/session',{'method':_0x5a22da(0x249),'body':JSON['stringify']({'session_state':_0x20d335})});}export async function saveCloudProfileCredentials(_0x2c9131,_0x1661ba,_0x4df10e){const _0x57f19a=_0x296b05,_0x1f6af7={'IVXNV':function(_0xea06e6,_0x2ef087){return _0xea06e6(_0x2ef087);}};await apiRequest('/api/v1/profiles/'+_0x1f6af7[_0x57f19a(0x214)](encodeURIComponent,_0x2c9131),{'method':'PUT','body':JSON[_0x57f19a(0x1fd)]({'username':_0x1661ba,'password':_0x4df10e})});}export async function fetchAuthConfig(){const _0x22dcea=_0x296b05,_0x45c140={'oHmPH':function(_0x2934c1,_0x239c0b){return _0x2934c1(_0x239c0b);},'FIIjq':function(_0x5e13e9,_0x5f373c){return _0x5e13e9 instanceof _0x5f373c;}};try{const _0x10b644=await _0x45c140[_0x22dcea(0x219)](apiRequest,'/api/v1/profiles/auth-config');return _0x10b644['auth_config'];}catch(_0x10527c){return _0x45c140['FIIjq'](_0x10527c,ApiError)&&_0x10527c['status']!==0x194&&console[_0x22dcea(0x25d)]('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x10527c['message']),null;}}export function pickAdHocEnvKey(_0x4e3577){const _0x8c915d=_0x296b05;if(!_0x4e3577)return null;if(_0x4e3577[_0x8c915d(0x238)])return _0x4e3577[_0x8c915d(0x238)];const _0xe882c5=Object['keys'](_0x4e3577[_0x8c915d(0x217)]??{});if(_0xe882c5[_0x8c915d(0x213)]===0x1)return _0xe882c5[0x0];if(_0xe882c5['length']===0x0)return null;throw new Error('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0xe882c5[_0x8c915d(0x20a)](',\x20')+').\x20'+'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.');}export async function resolveAdHocProfile(_0xc12fd2=process['env']){const _0x1db1a7=_0x296b05,_0x561d6f={'bOdua':function(_0x186b4c,_0x117ea0,_0xd3f5b,_0x21c37){return _0x186b4c(_0x117ea0,_0xd3f5b,_0x21c37);}},_0x4b779c=_0xc12fd2['RANGER_TEST_USERNAME'];if(!_0x4b779c)return null;const _0x22e817=await fetchCloudProfile(_0x4b779c);if(_0x22e817)return{'name':_0x22e817['name'],'profile':_0x22e817};const _0x5d8ca0=await fetchAuthConfig(),_0xef8047=pickAdHocEnvKey(_0x5d8ca0),_0x1572fb=_0xc12fd2[_0x1db1a7(0x264)],_0x1e1e08=await _0x561d6f['bOdua'](createCloudProfile,_0x4b779c,_0xef8047??undefined,{'username':_0x4b779c,'password':_0x1572fb});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x1e1e08['name']+_0x1db1a7(0x205)+_0x4b779c),{'name':_0x1e1e08[_0x1db1a7(0x22a)],'profile':_0x1e1e08};}export async function writeSessionToLocalCache(_0x38b475,_0x220c4b,_0x211138,_0x48b6ca,_0x2084b4,_0x1e517f,_0x44c0a8){const _0x24d6d7=_0x296b05,_0x3f8223={'yAIHW':function(_0x497b4d,_0xdfe5b1,_0x31384f){return _0x497b4d(_0xdfe5b1,_0x31384f);},'TqVpU':function(_0x30a389){return _0x30a389();},'HrOTi':'auth'},_0x467786=sessionCacheHash({'orgId':_0x220c4b,'profileName':_0x38b475,'effectiveBaseUrl':_0x211138,'setupHeaders':_0x48b6ca,'invalidateOn':_0x44c0a8?.['invalidateOn'],'userAgent':_0x44c0a8?.[_0x24d6d7(0x25b)],'clientIp':_0x44c0a8?.[_0x24d6d7(0x268)]}),_0x4fd329=_0x3f8223[_0x24d6d7(0x259)](getSessionCachePath,_0x467786,_0x38b475),_0x39f56d=join(_0x3f8223[_0x24d6d7(0x236)](getRangerHomeDir),_0x3f8223['HrOTi']);!existsSync(_0x39f56d)&&await mkdir(_0x39f56d,{'recursive':!![]});const _0x2e523c={..._0x2084b4};_0x1e517f&&_0x1e517f[_0x24d6d7(0x213)]>0x0&&Array['isArray'](_0x2e523c['cookies'])&&(_0x2e523c['cookies']=_0x3f8223['yAIHW'](duplicateCookiesForDomains,_0x2e523c['cookies'],_0x1e517f));const _0x30e264={'cached_at':new Date()['toISOString'](),'session_state':_0x2e523c};await _0x3f8223['yAIHW'](writeFile,_0x4fd329,JSON['stringify'](_0x30e264,null,0x2));const _0x23a3fa=getStorageStatePath(_0x4fd329);return await _0x3f8223[_0x24d6d7(0x259)](writeFile,_0x23a3fa,JSON['stringify'](_0x2e523c,null,0x2)),_0x23a3fa;}export async function checkLocalCache(_0x3140ea,_0x1520e7,_0x1cc6d1,_0x578273,_0x56d562){const _0xed151d=_0x296b05,_0x56b26c={'mMgeu':function(_0x170584,_0x52506a){return _0x170584(_0x52506a);},'GPCEM':function(_0x21a98e,_0x2bfb86){return _0x21a98e(_0x2bfb86);},'qTBqq':_0xed151d(0x235)},_0x4bba74=_0x56b26c[_0xed151d(0x21e)](sessionCacheHash,{'orgId':_0x1520e7,'profileName':_0x3140ea,'effectiveBaseUrl':_0x1cc6d1,'setupHeaders':_0x578273,'invalidateOn':_0x56d562?.[_0xed151d(0x260)],'userAgent':_0x56d562?.[_0xed151d(0x25b)],'clientIp':_0x56d562?.['clientIp']}),_0x3b3883=getSessionCachePath(_0x4bba74,_0x3140ea),_0x680357=getStorageStatePath(_0x3b3883);if(!_0x56b26c[_0xed151d(0x246)](existsSync,_0x3b3883)||!existsSync(_0x680357))return null;try{const _0x2d08de=await readFile(_0x3b3883,_0x56b26c['qTBqq']);return JSON['parse'](_0x2d08de),{'storageStatePath':_0x680357};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x113c69,_0x565e78){const _0x1f98d7=_0x296b05,_0x1092f9={'kVKHB':function(_0x49dcda,_0x29d6f9){return _0x49dcda===_0x29d6f9;},'pyOyw':function(_0x19baea,_0x2dddc0){return _0x19baea+_0x2dddc0;},'qHnyy':function(_0x498ae7,_0x26ecf2){return _0x498ae7+_0x26ecf2;}};if(!_0x565e78||!_0x565e78['domains']?.[_0x1f98d7(0x213)])return;let _0x562929;try{_0x562929=new URL(_0x113c69);}catch{return;}const _0x46054c=[];for(const _0x57506b of _0x565e78[_0x1f98d7(0x21d)]){try{_0x46054c[_0x1f98d7(0x23c)]({'raw':_0x57506b,'url':new URL(_0x57506b)});}catch{}}if(_0x1092f9[_0x1f98d7(0x234)](_0x46054c['length'],0x0))return;if(_0x46054c['some'](_0x2507da=>_0x2507da[_0x1f98d7(0x26c)]['origin']===_0x562929['origin']))return;const _0x992358=_0x46054c['map'](_0x5e3966=>'\x22'+_0x5e3966[_0x1f98d7(0x21c)]+'\x22')[_0x1f98d7(0x20a)](',\x20');console['log'](_0x1092f9[_0x1f98d7(0x218)](_0x1092f9['qHnyy']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x992358+';\x20',_0x1f98d7(0x253)+_0x113c69+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20'),_0x1f98d7(0x206)));}export async function serverSideLogin(_0xa23899,_0x5abb03){const _0x5c45bd=_0x296b05,_0x191d5f={'jBUSY':function(_0x3509ea,_0x102dd6,_0x4ade86){return _0x3509ea(_0x102dd6,_0x4ade86);},'BWjsR':function(_0x30008c,_0x4e02cb){return _0x30008c(_0x4e02cb);},'ZBHdU':function(_0x4f8378,_0x1c0537){return _0x4f8378===_0x1c0537;},'bRhQi':'not_configured'},_0x5e2633=process[_0x5c45bd(0x224)]['RANGER_TEST_USERNAME'],_0x43f205=process[_0x5c45bd(0x224)]['RANGER_TEST_PASSWORD'],_0x2ce100={};if(_0x5e2633)_0x2ce100[_0x5c45bd(0x1fe)]=_0x5e2633;if(_0x43f205)_0x2ce100['password']=_0x43f205;if(_0x5abb03?.[_0x5c45bd(0x212)])_0x2ce100['force']=!![];try{return await _0x191d5f[_0x5c45bd(0x1f6)](apiRequest,_0x5c45bd(0x245)+_0x191d5f['BWjsR'](encodeURIComponent,_0xa23899)+'/login',{'method':'POST','body':JSON['stringify'](_0x2ce100)});}catch(_0x238a8e){if(_0x238a8e instanceof ApiError&&_0x191d5f[_0x5c45bd(0x257)](_0x238a8e[_0x5c45bd(0x201)],0x190)&&_0x191d5f[_0x5c45bd(0x257)](_0x238a8e['code'],_0x5c45bd(0x23f)))return{'status':_0x191d5f[_0x5c45bd(0x21f)],'error':_0x238a8e[_0x5c45bd(0x1fa)]};throw _0x238a8e;}}export async function manualBrowserLogin(_0x4ab5d4,_0x577f58){const _0x44501f=_0x296b05,_0x37f543={'gEyth':function(_0x571d1c,_0x61b388){return _0x571d1c/_0x61b388;},'iUEtD':function(_0x560054,_0x33cbfc,_0x26be67){return _0x560054(_0x33cbfc,_0x26be67);},'OHEMr':function(_0x27bba0,_0x55ce07){return _0x27bba0+_0x55ce07;},'zmRti':_0x44501f(0x237),'HOcYm':'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','kKCPx':function(_0x2843fd,_0x3e6a7d){return _0x2843fd>_0x3e6a7d;},'aavsu':_0x44501f(0x228),'mEMnp':'POST'};if(!isInteractive())throw new Error(_0x37f543[_0x44501f(0x250)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x4ab5d4[_0x44501f(0x22a)]+_0x44501f(0x256)+_0x37f543[_0x44501f(0x215)],_0x37f543[_0x44501f(0x240)]));const _0x5c97e0=_0x577f58&&_0x37f543[_0x44501f(0x204)](_0x577f58[_0x44501f(0x21d)]['length'],0x0)?_0x577f58['domains'][0x0]:'about:blank';console['log']('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console[_0x44501f(0x21a)]('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x1b208d=>setTimeout(_0x1b208d,0x7d0));const _0x585e89=await chromium[_0x44501f(0x20f)]({'headless':![]});let _0x5cac6e=null;try{const _0x98a1e4={'ignoreHTTPSErrors':!![]};_0x577f58?.['setupHeaders']&&(_0x98a1e4[_0x44501f(0x24a)]=_0x577f58[_0x44501f(0x20e)]);const _0x913ee0=await _0x585e89[_0x44501f(0x1f9)](_0x98a1e4);await addProfileSetupBanner(_0x913ee0);const _0x2bae51=await _0x913ee0[_0x44501f(0x1fc)]();await _0x2bae51[_0x44501f(0x22e)](_0x5c97e0);let _0x1ca089=![];await new Promise(_0x3c82d5=>{const _0x1f0223=_0x44501f,_0x39bc81={'LoilW':function(_0x443bc1,_0x530f46){const _0x14c98d=_0x25a0;return _0x37f543[_0x14c98d(0x247)](_0x443bc1,_0x530f46);}},_0x43821c=_0x37f543[_0x1f0223(0x220)](setTimeout,()=>{const _0x263e78=_0x1f0223;_0x1ca089=!![],console['error'](_0x263e78(0x232)+_0x39bc81[_0x263e78(0x25c)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x263e78(0x261)),_0x3c82d5();},MANUAL_LOGIN_TIMEOUT_MS);_0x2bae51['on']('close',async()=>{const _0x2bb2c2=_0x1f0223;clearTimeout(_0x43821c);try{const _0xfaa80e=await _0x913ee0[_0x2bb2c2(0x248)]();_0x5cac6e=_0xfaa80e;}catch{}_0x3c82d5();});});if(_0x1ca089&&!_0x5cac6e)throw new Error(_0x37f543[_0x44501f(0x223)]);}finally{await _0x585e89[_0x44501f(0x22b)]()[_0x44501f(0x207)](()=>{});}if(!_0x5cac6e)throw new Error('Browser\x20closed\x20before\x20authentication\x20was\x20saved.');return await _0x37f543['iUEtD'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x4ab5d4[_0x44501f(0x22a)])+_0x44501f(0x20b),{'method':_0x37f543['mEMnp'],'body':JSON[_0x44501f(0x1fd)]({'session_state':_0x5cac6e,'updated_by':_0x44501f(0x26b)})}),{'sessionState':_0x5cac6e};}function _0x25a0(_0x4fd24c,_0x41e1f4){_0x4fd24c=_0x4fd24c-0x1f4;const _0x5ebf63=_0x5ebf();let _0x25a06f=_0x5ebf63[_0x4fd24c];return _0x25a06f;}export async function promptSaveCredentials(_0x5b736d){const _0x3147bd=_0x296b05,_0x224e62={'jjltQ':function(_0x317b0c,_0x520470){return _0x317b0c||_0x520470;},'bWKEY':function(_0xf981){return _0xf981();},'ymPgb':'confirm','EjHIE':_0x3147bd(0x1f7),'AOapt':'PUT'},_0x1d4e9c=process['env'][_0x3147bd(0x203)],_0x3f11b4=process['env'][_0x3147bd(0x264)];if(_0x224e62[_0x3147bd(0x208)](!_0x1d4e9c,!_0x3f11b4))return;if(!_0x224e62['bWKEY'](isInteractive))return;const {save:_0x4fe3a3}=await _0x598102[_0x3147bd(0x222)]([{'type':_0x224e62['ymPgb'],'name':_0x224e62[_0x3147bd(0x221)],'message':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','default':![]}]);if(!_0x4fe3a3)return;await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x5b736d),{'method':_0x224e62['AOapt'],'body':JSON['stringify']({'username':_0x1d4e9c,'password':_0x3f11b4})}),console[_0x3147bd(0x21a)](_0x3147bd(0x267));}export async function resolveCloudProfileSession(_0x83a701,_0x12d465={}){const _0x254393=_0x296b05,_0x49ac12={'OpTwl':function(_0x377733,_0x4a563e,_0x594477){return _0x377733(_0x4a563e,_0x594477);},'zTSbR':function(_0x1ef57b,_0x368a54){return _0x1ef57b>_0x368a54;},'wSuaF':function(_0x57d84a,_0xbb5eb8,_0x2da5f0,_0x3034d2,_0x503215,_0x42f88b){return _0x57d84a(_0xbb5eb8,_0x2da5f0,_0x3034d2,_0x503215,_0x42f88b);},'RMvOd':function(_0x36d94,_0x106f90,_0x3d8ec4,_0x3408dd,_0x46c4de){return _0x36d94(_0x106f90,_0x3d8ec4,_0x3408dd,_0x46c4de);},'cPKPF':function(_0x273f66,_0x538619,_0x3d24cd){return _0x273f66(_0x538619,_0x3d24cd);},'CrOTG':function(_0x1231e6,_0x140c8f){return _0x1231e6(_0x140c8f);},'dmJte':function(_0x53a7a3,_0x11aa2d){return _0x53a7a3===_0x11aa2d;},'tPTrj':_0x254393(0x23f),'MBqVm':'\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','AVKJv':'success','VAHYD':'\x20\x20Login\x20successful.\x20Session\x20cached.','sStSF':function(_0x493232,_0xde476e){return _0x493232&&_0xde476e;},'PWDbF':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','kzKiD':_0x254393(0x23b),'pHuRc':function(_0x306ddc,_0x35dbd5){return _0x306ddc instanceof _0x35dbd5;},'IriGV':function(_0x10557a,_0x3240be){return _0x10557a(_0x3240be);},'lrFOe':function(_0x4d4985,_0xaf2751,_0x51bd08,_0x14a7b8,_0x23c1d5,_0x4e6924,_0x1032cf,_0x1aa357){return _0x4d4985(_0xaf2751,_0x51bd08,_0x14a7b8,_0x23c1d5,_0x4e6924,_0x1032cf,_0x1aa357);}},_0x5ac8c2=_0x83a701['settings']??{},_0xd7eb55=await fetchAuthConfig(),_0x4417de=_0xd7eb55?_0x49ac12['OpTwl'](resolveAuthEnvironmentLocally,_0xd7eb55,_0x83a701['environmentKey']):null,_0x1d39c4=_0x4417de?.[_0x254393(0x21d)],_0x330c77=_0x5ac8c2['setupHeaders'],_0x50abcb=_0x330c77??_0x4417de?.['setupHeaders'],_0x20494c=_0x12d465['effectiveBaseUrl']??_0x5ac8c2['baseUrl']??(_0x1d39c4&&_0x49ac12[_0x254393(0x26d)](_0x1d39c4['length'],0x0)?_0x1d39c4[0x0]:''),_0x2011b4={'invalidateOn':_0x4417de?.[_0x254393(0x260)],'userAgent':_0x4417de?.[_0x254393(0x22d)]?.[_0x254393(0x25b)]??_0x5ac8c2['userAgent']},_0x1f9ec0=await _0x49ac12[_0x254393(0x227)](checkLocalCache,_0x83a701['name'],_0x83a701['organizationId'],_0x20494c,_0x50abcb,_0x2011b4);if(_0x1f9ec0){if(_0x20494c){const _0x5bfa13=await _0x49ac12[_0x254393(0x23e)](isCachedSessionLive,_0x1f9ec0[_0x254393(0x26e)],_0x20494c,{'sessionCheckPath':_0x4417de?.[_0x254393(0x1fb)],'setupHeaders':_0x50abcb},{'launchBrowser':launchRealBrowser});if(_0x5bfa13)return console['log'](_0x254393(0x24e)+_0x83a701[_0x254393(0x22a)]+'\x22'),{'authPath':_0x1f9ec0['storageStatePath'],'settings':_0x5ac8c2,'resolvedEnv':_0x4417de};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x83a701['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x49ac12['cPKPF'](emitSessionValidationHint,_0x20494c,_0x4417de);}else return{'authPath':_0x1f9ec0[_0x254393(0x26e)],'settings':_0x5ac8c2,'resolvedEnv':_0x4417de};}if(_0x83a701[_0x254393(0x200)]){const _0x3eba4f=await writeSessionToLocalCache(_0x83a701['name'],_0x83a701[_0x254393(0x230)],_0x20494c,_0x50abcb,_0x83a701['sessionState'],_0x1d39c4,_0x2011b4);if(_0x20494c){const _0xc33ce=await isCachedSessionLive(_0x3eba4f,_0x20494c,{'sessionCheckPath':_0x4417de?.['sessionCheckPath'],'setupHeaders':_0x50abcb},{'launchBrowser':launchRealBrowser});if(_0xc33ce)return console[_0x254393(0x21a)]('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x83a701[_0x254393(0x22a)]+'\x22,\x20cached\x20locally'),{'authPath':_0x3eba4f,'settings':_0x5ac8c2,'resolvedEnv':_0x4417de};console[_0x254393(0x21a)](_0x254393(0x22f)+_0x83a701[_0x254393(0x22a)]+_0x254393(0x209)),emitSessionValidationHint(_0x20494c,_0x4417de);}else return{'authPath':_0x3eba4f,'settings':_0x5ac8c2,'resolvedEnv':_0x4417de};}console['log'](_0x254393(0x241)+_0x83a701[_0x254393(0x22a)]+'\x22,\x20attempting\x20login...');const _0x3d2f4e=_0x49ac12[_0x254393(0x258)](Boolean,process[_0x254393(0x224)]['RANGER_TEST_USERNAME'])&&_0x49ac12[_0x254393(0x258)](Boolean,process[_0x254393(0x224)]['RANGER_TEST_PASSWORD']),_0x513ff2=Boolean(_0x83a701['username']);if(_0x3d2f4e||_0x513ff2)try{const _0x4dc6f7=await serverSideLogin(_0x83a701[_0x254393(0x22a)]);if(_0x49ac12[_0x254393(0x244)](_0x4dc6f7['status'],_0x49ac12['tPTrj']))console[_0x254393(0x21a)](_0x49ac12[_0x254393(0x24c)]);else{if(_0x4dc6f7[_0x254393(0x201)]===_0x49ac12['AVKJv']&&_0x4dc6f7[_0x254393(0x216)]){console[_0x254393(0x21a)](_0x49ac12[_0x254393(0x22c)]);const _0x1c3a8d=await writeSessionToLocalCache(_0x83a701[_0x254393(0x22a)],_0x83a701[_0x254393(0x230)],_0x20494c,_0x50abcb,_0x4dc6f7[_0x254393(0x216)],_0x1d39c4,_0x2011b4);return _0x49ac12[_0x254393(0x265)](_0x3d2f4e,!_0x513ff2)&&await promptSaveCredentials(_0x83a701[_0x254393(0x22a)]),{'authPath':_0x1c3a8d,'settings':_0x5ac8c2,'resolvedEnv':_0x4417de};}else _0x4dc6f7['test_output']&&(console['log'](_0x49ac12[_0x254393(0x202)]),console[_0x254393(0x21a)](_0x4dc6f7['test_output'])),console['log'](_0x49ac12['kzKiD']);}}catch(_0x105a3f){console['log'](_0x254393(0x252)+(_0x49ac12['pHuRc'](_0x105a3f,Error)?_0x105a3f[_0x254393(0x254)]:_0x49ac12[_0x254393(0x1f5)](String,_0x105a3f))),console['log'](_0x254393(0x23b));}const {sessionState:_0x2c7ff3}=await _0x49ac12[_0x254393(0x210)](manualBrowserLogin,_0x83a701,_0x4417de),_0x4b67e5=await _0x49ac12[_0x254393(0x20d)](writeSessionToLocalCache,_0x83a701['name'],_0x83a701[_0x254393(0x230)],_0x20494c,_0x50abcb,_0x2c7ff3,_0x1d39c4,_0x2011b4);return{'authPath':_0x4b67e5,'settings':_0x5ac8c2,'resolvedEnv':_0x4417de};}function _0x5ebf(){const _0x596596=['userAgent','LoilW','error','YnjhQ','5725728jYzMnX','invalidateOn','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','wtHkk','192FvvcDK','RANGER_TEST_PASSWORD','sStSF','headers','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','clientIp','DOnpC','CSuAZ','cli:manual-login','url','zTSbR','storageStatePath','API\x20request\x20','profiles','json','application/json','password','IriGV','jBUSY','save','2785202HpsDSG','newContext','detail','sessionCheckPath','newPage','stringify','username','lMoQA','sessionState','status','PWDbF','RANGER_TEST_USERNAME','kKCPx','\x22\x20for\x20','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','catch','jjltQ','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','join','/session','44qIFJkZ','lrFOe','setupHeaders','launch','cPKPF','ofYGN','force','length','IVXNV','zmRti','session_state','environments','pyOyw','oHmPH','log','ApiError','raw','domains','mMgeu','bRhQi','iUEtD','EjHIE','prompt','aavsu','env','1171464NZEqRT','DchdO','wSuaF','Browser\x20login\x20timed\x20out\x20before\x20completion.','ajrtr','name','close','VAHYD','browserOptions','goto','\x20\x20Cloud\x20session\x20for\x20\x22','organizationId','gNNEc','Browser\x20login\x20timed\x20out\x20after\x20','code','kVKHB','utf-8','TqVpU','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','defaultEnvironmentKey','544974ADgJYs','64647YaNVLX','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','push','keys','RMvOd','not_configured','HOcYm','\x20\x20No\x20live\x20session\x20for\x20\x22','31765bRGuLo','83751lUBimD','dmJte','/api/v1/profiles/','GPCEM','gEyth','storageState','POST','extraHTTPHeaders','settings','MBqVm','IWbDy','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','DELETE','OHEMr','):\x20','\x20\x20Server-side\x20login\x20error:\x20','you\x27re\x20now\x20at\x20\x22','message','yzfEL','\x22.\x0a','ZBHdU','CrOTG','yAIHW','/api/v1/profiles'];_0x5ebf=function(){return _0x596596;};return _0x5ebf();}
|
|
1
|
+
const _0x3f30ba=_0x4b7a;(function(_0x3a8a08,_0x2f6ee3){const _0x343175=_0x4b7a,_0x3ee366=_0x3a8a08();while(!![]){try{const _0x3735ee=-parseInt(_0x343175(0x1fa))/0x1*(-parseInt(_0x343175(0x1e8))/0x2)+-parseInt(_0x343175(0x1d7))/0x3*(-parseInt(_0x343175(0x1a4))/0x4)+parseInt(_0x343175(0x195))/0x5*(-parseInt(_0x343175(0x1bc))/0x6)+parseInt(_0x343175(0x1f8))/0x7+-parseInt(_0x343175(0x1fd))/0x8+parseInt(_0x343175(0x19b))/0x9+-parseInt(_0x343175(0x19e))/0xa;if(_0x3735ee===_0x2f6ee3)break;else _0x3ee366['push'](_0x3ee366['shift']());}catch(_0x4004ee){_0x3ee366['push'](_0x3ee366['shift']());}}}(_0x5358,0xe9a44));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x175a33 from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x243729=_0x4b7a,_0x498194={'kzewl':function(_0x447093){return _0x447093();}},_0x1cc09d=await _0x498194[_0x243729(0x1cf)](getToken);if(!_0x1cc09d)throw new Error(_0x243729(0x1d9));return _0x1cc09d;}async function apiRequest(_0xfdd7c4,_0x548e53={}){const _0x5b0f3e=_0x4b7a,_0x245c3f={'OAevO':function(_0x5d453c){return _0x5d453c();},'ALwVf':function(_0xf6a140){return _0xf6a140();},'PlLbc':function(_0x33301f,_0x4721d6){return _0x33301f===_0x4721d6;},'uzsIz':function(_0xf3bb27,_0x2472d3){return _0xf3bb27===_0x2472d3;},'hvksU':_0x5b0f3e(0x1e3),'IudKW':function(_0x38a975,_0x34153e){return _0x38a975===_0x34153e;}},_0x441faa=await _0x245c3f['OAevO'](requireToken),_0x447f1a=_0x245c3f['ALwVf'](getApiBaseUrl),_0x5588f7=await fetch(''+_0x447f1a+_0xfdd7c4,{..._0x548e53,'headers':{'Authorization':'Bearer\x20'+_0x441faa,'Content-Type':'application/json',..._0x548e53['headers']??{}}});if(!_0x5588f7['ok']){let _0x2b1363='',_0x2b1d0f;try{const _0x3f025e=await _0x5588f7[_0x5b0f3e(0x199)]();_0x2b1363=(_0x245c3f[_0x5b0f3e(0x1c2)](typeof _0x3f025e['error'],'string')?_0x3f025e['error']:undefined)??JSON[_0x5b0f3e(0x1da)](_0x3f025e);if(_0x245c3f['uzsIz'](typeof _0x3f025e[_0x5b0f3e(0x1c3)],_0x245c3f['hvksU']))_0x2b1d0f=_0x3f025e['code'];}catch{_0x2b1363=_0x5588f7[_0x5b0f3e(0x198)];}throw new ApiError(_0x5b0f3e(0x1c9)+_0xfdd7c4+_0x5b0f3e(0x1b0)+_0x5588f7[_0x5b0f3e(0x19c)]+_0x5b0f3e(0x1f5)+_0x2b1363,_0x5588f7[_0x5b0f3e(0x19c)],_0x2b1363,_0x2b1d0f);}if(_0x245c3f['IudKW'](_0x5588f7['status'],0xcc))return undefined;return _0x5588f7[_0x5b0f3e(0x199)]();}export class ApiError extends Error{[_0x3f30ba(0x19c)];['detail'];[_0x3f30ba(0x1c3)];constructor(_0x3aab56,_0x4e796c,_0xe6f051,_0x1706a9){const _0x181068=_0x3f30ba,_0x17417f={'mWkFg':_0x181068(0x19d)};super(_0x3aab56),this['status']=_0x4e796c,this['detail']=_0xe6f051,this[_0x181068(0x1c3)]=_0x1706a9,this[_0x181068(0x1ff)]=_0x17417f['mWkFg'];}}export async function fetchCloudProfile(_0x2df3bd){const _0x473dac=_0x3f30ba,_0x30db36={'jCpNG':function(_0x557dbe,_0x1093d2){return _0x557dbe===_0x1093d2;}};try{return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x2df3bd));}catch(_0x263388){if(_0x263388 instanceof ApiError&&_0x30db36[_0x473dac(0x1be)](_0x263388[_0x473dac(0x19c)],0x194))return null;throw _0x263388;}}export async function listCloudProfiles(){const _0x17f88e=_0x3f30ba,_0x464b47={'LpRTD':function(_0x4492e3,_0x35c7dc){return _0x4492e3(_0x35c7dc);}},_0x39b150=await _0x464b47['LpRTD'](apiRequest,_0x17f88e(0x1db));return _0x39b150[_0x17f88e(0x1dc)];}export async function deleteCloudProfile(_0x13d414){const _0x4e7bab=_0x3f30ba,_0x1d4663={'tNkVd':function(_0xe5c1e8,_0x5de568,_0x527951){return _0xe5c1e8(_0x5de568,_0x527951);},'hHaFb':function(_0x24f6e4,_0x16a0d4){return _0x24f6e4(_0x16a0d4);},'zCXCX':'DELETE','EFrPl':function(_0x14b86a,_0x6ede1d){return _0x14b86a===_0x6ede1d;}};try{await _0x1d4663['tNkVd'](apiRequest,_0x4e7bab(0x1e4)+_0x1d4663['hHaFb'](encodeURIComponent,_0x13d414),{'method':_0x1d4663['zCXCX']});}catch(_0x461d17){if(_0x461d17 instanceof ApiError&&_0x1d4663[_0x4e7bab(0x1f9)](_0x461d17['status'],0x194))throw new Error(_0x4e7bab(0x1f0)+_0x13d414+_0x4e7bab(0x1ea));throw _0x461d17;}}export async function createCloudProfile(_0xfe11ef,_0xf2b09b,_0x3e21d9={}){const _0x117d8e=_0x3f30ba,_0x5d8230={'FWILA':function(_0x4919ba,_0x4d3a50,_0x2834ee){return _0x4919ba(_0x4d3a50,_0x2834ee);}},_0x1c6ce1={'name':_0xfe11ef};if(_0xf2b09b)_0x1c6ce1['environment_key']=_0xf2b09b;_0x3e21d9[_0x117d8e(0x1e9)]&&Object[_0x117d8e(0x1a2)](_0x3e21d9[_0x117d8e(0x1e9)])['length']>0x0&&(_0x1c6ce1['settings']=_0x3e21d9['settings']);if(_0x3e21d9['username'])_0x1c6ce1['username']=_0x3e21d9['username'];if(_0x3e21d9['password'])_0x1c6ce1['password']=_0x3e21d9[_0x117d8e(0x1b6)];return await _0x5d8230['FWILA'](apiRequest,'/api/v1/profiles',{'method':'POST','body':JSON[_0x117d8e(0x1da)](_0x1c6ce1)});}export async function uploadCloudProfileSession(_0x36ede5,_0xae8a2c){const _0x1926d4=_0x3f30ba;return await apiRequest(_0x1926d4(0x1e4)+encodeURIComponent(_0x36ede5)+_0x1926d4(0x1bb),{'method':_0x1926d4(0x1d3),'body':JSON['stringify']({'session_state':_0xae8a2c})});}export async function saveCloudProfileCredentials(_0x4170f5,_0x467d16,_0x584102){const _0xe3aeba=_0x3f30ba,_0x411b79={'qzuBb':function(_0x552eda,_0x1a8050,_0x438793){return _0x552eda(_0x1a8050,_0x438793);},'rivgF':function(_0x593026,_0x429b7b){return _0x593026(_0x429b7b);}};await _0x411b79[_0xe3aeba(0x1f3)](apiRequest,'/api/v1/profiles/'+_0x411b79[_0xe3aeba(0x1aa)](encodeURIComponent,_0x4170f5),{'method':_0xe3aeba(0x1b3),'body':JSON['stringify']({'username':_0x467d16,'password':_0x584102})});}export async function fetchAuthConfig(){const _0x7911fe=_0x3f30ba,_0x56317d={'PEuEh':function(_0xf12b40,_0x13b5b0){return _0xf12b40(_0x13b5b0);},'NzZfr':'/api/v1/profiles/auth-config','QcOUF':function(_0x4b8022,_0x29f4bf){return _0x4b8022 instanceof _0x29f4bf;}};try{const _0x4d5639=await _0x56317d['PEuEh'](apiRequest,_0x56317d['NzZfr']);return _0x4d5639['auth_config'];}catch(_0x39c4aa){return _0x56317d[_0x7911fe(0x1c4)](_0x39c4aa,ApiError)&&_0x39c4aa[_0x7911fe(0x19c)]!==0x194&&console[_0x7911fe(0x196)](_0x7911fe(0x1c8)+_0x39c4aa['message']),null;}}export function pickAdHocEnvKey(_0x3f328b){const _0x16598f=_0x3f30ba,_0x261abb={'rmXMO':function(_0x40e3fc,_0x526057){return _0x40e3fc===_0x526057;},'xlGkQ':function(_0x322ddb,_0x5a5280){return _0x322ddb+_0x5a5280;}};if(!_0x3f328b)return null;if(_0x3f328b['defaultEnvironmentKey'])return _0x3f328b[_0x16598f(0x1c1)];const _0x215dce=Object[_0x16598f(0x1a2)](_0x3f328b['environments']??{});if(_0x261abb['rmXMO'](_0x215dce[_0x16598f(0x1a9)],0x1))return _0x215dce[0x0];if(_0x215dce['length']===0x0)return null;throw new Error(_0x261abb['xlGkQ'](_0x16598f(0x1ee)+_0x215dce['join'](',\x20')+_0x16598f(0x1df),'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.'));}export async function resolveAdHocProfile(_0x24f117=process[_0x3f30ba(0x1a6)]){const _0x5c14b1=_0x3f30ba,_0xead83e={'IEkjT':function(_0x53b3ed,_0xee2e49){return _0x53b3ed(_0xee2e49);}},_0x335480=_0x24f117[_0x5c14b1(0x1ef)];if(!_0x335480)return null;const _0x3aee73=await _0xead83e['IEkjT'](fetchCloudProfile,_0x335480);if(_0x3aee73)return{'name':_0x3aee73['name'],'profile':_0x3aee73};const _0x57b0e6=await fetchAuthConfig(),_0xc8091e=pickAdHocEnvKey(_0x57b0e6),_0x3bc425=_0x24f117[_0x5c14b1(0x1b1)],_0x486e90=await createCloudProfile(_0x335480,_0xc8091e??undefined,{'username':_0x335480,'password':_0x3bc425});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x486e90[_0x5c14b1(0x1ff)]+'\x22\x20for\x20'+_0x335480),{'name':_0x486e90[_0x5c14b1(0x1ff)],'profile':_0x486e90};}export async function writeSessionToLocalCache(_0x3bad2c,_0xe61fd,_0x4877d0,_0x41149d,_0x2f7e47,_0x8d042a,_0x40520b){const _0x3f83a7=_0x3f30ba,_0x53c4df={'nVJVG':function(_0x5926e9,_0x326622,_0x4f8594){return _0x5926e9(_0x326622,_0x4f8594);},'oNrsv':function(_0xec005b){return _0xec005b();},'EfLYv':function(_0x44c9f3,_0x176c01,_0x1aba82){return _0x44c9f3(_0x176c01,_0x1aba82);},'EGPNB':function(_0x508864,_0x35d714){return _0x508864>_0x35d714;},'vDEZx':function(_0x5b6ca5,_0x26073b,_0x35eab8){return _0x5b6ca5(_0x26073b,_0x35eab8);}},_0x119c47=sessionCacheHash({'orgId':_0xe61fd,'profileName':_0x3bad2c,'effectiveBaseUrl':_0x4877d0,'setupHeaders':_0x41149d,'invalidateOn':_0x40520b?.[_0x3f83a7(0x1e7)],'userAgent':_0x40520b?.[_0x3f83a7(0x1e5)],'clientIp':_0x40520b?.[_0x3f83a7(0x1ec)]}),_0x3a8bd9=_0x53c4df['nVJVG'](getSessionCachePath,_0x119c47,_0x3bad2c),_0x1936e0=join(_0x53c4df[_0x3f83a7(0x1ac)](getRangerHomeDir),_0x3f83a7(0x1a0));!existsSync(_0x1936e0)&&await _0x53c4df[_0x3f83a7(0x1c6)](mkdir,_0x1936e0,{'recursive':!![]});const _0x4c04f1={..._0x2f7e47};_0x8d042a&&_0x53c4df[_0x3f83a7(0x200)](_0x8d042a['length'],0x0)&&Array['isArray'](_0x4c04f1[_0x3f83a7(0x1ed)])&&(_0x4c04f1['cookies']=duplicateCookiesForDomains(_0x4c04f1[_0x3f83a7(0x1ed)],_0x8d042a));const _0x2695d4={'cached_at':new Date()[_0x3f83a7(0x1bf)](),'session_state':_0x4c04f1};await _0x53c4df['vDEZx'](writeFile,_0x3a8bd9,JSON['stringify'](_0x2695d4,null,0x2));const _0x38bc3f=getStorageStatePath(_0x3a8bd9);return await _0x53c4df['vDEZx'](writeFile,_0x38bc3f,JSON[_0x3f83a7(0x1da)](_0x4c04f1,null,0x2)),_0x38bc3f;}export async function checkLocalCache(_0x19aa1d,_0x351ec7,_0x5746f6,_0x3cf955,_0xd4979d){const _0x4b679a=_0x3f30ba,_0x7d54d7={'YxhWq':function(_0x44fd83,_0x362524,_0x175f70){return _0x44fd83(_0x362524,_0x175f70);},'lKgwX':function(_0x46dd4a,_0x1ccf5c){return _0x46dd4a(_0x1ccf5c);},'IVODL':function(_0x5c8100,_0x1d44ec){return _0x5c8100(_0x1d44ec);}},_0x267681=sessionCacheHash({'orgId':_0x351ec7,'profileName':_0x19aa1d,'effectiveBaseUrl':_0x5746f6,'setupHeaders':_0x3cf955,'invalidateOn':_0xd4979d?.['invalidateOn'],'userAgent':_0xd4979d?.['userAgent'],'clientIp':_0xd4979d?.[_0x4b679a(0x1ec)]}),_0x4773c7=_0x7d54d7[_0x4b679a(0x1ad)](getSessionCachePath,_0x267681,_0x19aa1d),_0x513b44=_0x7d54d7[_0x4b679a(0x197)](getStorageStatePath,_0x4773c7);if(!existsSync(_0x4773c7)||!_0x7d54d7[_0x4b679a(0x1d6)](existsSync,_0x513b44))return null;try{const _0x346198=await readFile(_0x4773c7,_0x4b679a(0x1b7));return JSON['parse'](_0x346198),{'storageStatePath':_0x513b44};}catch{return null;}}function launchRealBrowser(){const _0x5781bd=_0x3f30ba;return chromium[_0x5781bd(0x1f6)]({'headless':!![]});}function _0x4b7a(_0x369d44,_0x4ce63b){_0x369d44=_0x369d44-0x18e;const _0x5358f3=_0x5358();let _0x4b7ab9=_0x5358f3[_0x369d44];return _0x4b7ab9;}function emitSessionValidationHint(_0x5cb8f6,_0x189d4e){const _0x216bcb=_0x3f30ba,_0x5a6653={'TFAhW':function(_0xd60ccf,_0x14f05f){return _0xd60ccf===_0x14f05f;},'LuZNe':function(_0x2c25f6,_0x5b8e83){return _0x2c25f6+_0x5b8e83;}};if(!_0x189d4e||!_0x189d4e[_0x216bcb(0x1cb)]?.[_0x216bcb(0x1a9)])return;let _0x3f48e6;try{_0x3f48e6=new URL(_0x5cb8f6);}catch{return;}const _0xc1bf20=[];for(const _0x3686a7 of _0x189d4e[_0x216bcb(0x1cb)]){try{_0xc1bf20['push']({'raw':_0x3686a7,'url':new URL(_0x3686a7)});}catch{}}if(_0x5a6653[_0x216bcb(0x1b2)](_0xc1bf20[_0x216bcb(0x1a9)],0x0))return;if(_0xc1bf20['some'](_0x18b520=>_0x18b520['url']['origin']===_0x3f48e6[_0x216bcb(0x193)]))return;const _0x2dd77c=_0xc1bf20['map'](_0x3dfd14=>'\x22'+_0x3dfd14[_0x216bcb(0x1f2)]+'\x22')['join'](',\x20');console['log'](_0x5a6653['LuZNe'](_0x5a6653['LuZNe']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x2dd77c+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x5cb8f6+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20'),'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.'));}export async function serverSideLogin(_0x30a982,_0x237dff){const _0xeb0d22=_0x3f30ba,_0x1ba0b9={'cFXJr':function(_0x2d5701,_0x11bbee){return _0x2d5701 instanceof _0x11bbee;},'kSgKO':function(_0x49c076,_0x2a5fad){return _0x49c076===_0x2a5fad;},'rkhxC':'not_configured'},_0x1925c6=process['env']['RANGER_TEST_USERNAME'],_0x284fac=process[_0xeb0d22(0x1a6)]['RANGER_TEST_PASSWORD'],_0x5c3c95={};if(_0x1925c6)_0x5c3c95[_0xeb0d22(0x1fb)]=_0x1925c6;if(_0x284fac)_0x5c3c95[_0xeb0d22(0x1b6)]=_0x284fac;if(_0x237dff?.[_0xeb0d22(0x19a)])_0x5c3c95[_0xeb0d22(0x19a)]=!![];try{return await apiRequest(_0xeb0d22(0x1e4)+encodeURIComponent(_0x30a982)+_0xeb0d22(0x19f),{'method':'POST','body':JSON[_0xeb0d22(0x1da)](_0x5c3c95)});}catch(_0x3d6d7c){if(_0x1ba0b9[_0xeb0d22(0x1de)](_0x3d6d7c,ApiError)&&_0x3d6d7c[_0xeb0d22(0x19c)]===0x190&&_0x1ba0b9['kSgKO'](_0x3d6d7c[_0xeb0d22(0x1c3)],_0x1ba0b9['rkhxC']))return{'status':_0x1ba0b9['rkhxC'],'error':_0x3d6d7c['detail']};throw _0x3d6d7c;}}export async function manualBrowserLogin(_0x598b67,_0x4273b3){const _0x42969e=_0x3f30ba,_0x1f630c={'XdcBu':function(_0x1030a2,_0x6abb6c){return _0x1030a2/_0x6abb6c;},'HGgAn':function(_0x2ae01c){return _0x2ae01c();},'HzgBa':'close','NfwLF':function(_0x5bb040,_0x49346d){return _0x5bb040+_0x49346d;},'tfISX':function(_0x3ef091,_0xdaf476){return _0x3ef091>_0xdaf476;},'PpcpA':function(_0x3079dc,_0x41f274){return _0x3079dc(_0x41f274);},'gigiM':function(_0xc8cb96,_0xdd346d){return _0xc8cb96&&_0xdd346d;},'UPLBz':_0x42969e(0x1cd),'OzyJA':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','VSYOY':function(_0x1d545a,_0x2a950b,_0x38f2c8){return _0x1d545a(_0x2a950b,_0x38f2c8);},'GhKSS':'POST','cvMPR':'cli:manual-login'};if(!isInteractive())throw new Error(_0x1f630c[_0x42969e(0x1e6)](_0x42969e(0x1d2)+_0x598b67[_0x42969e(0x1ff)]+'\x22.\x0a',_0x42969e(0x1a8))+'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.');const _0x43dbbb=_0x4273b3&&_0x1f630c[_0x42969e(0x18f)](_0x4273b3['domains']['length'],0x0)?_0x4273b3['domains'][0x0]:_0x42969e(0x194);console['log']('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console['log'](_0x42969e(0x1a1)),await new Promise(_0x13bdf5=>setTimeout(_0x13bdf5,0x7d0));const _0x27d2a5=await chromium[_0x42969e(0x1f6)]({'headless':![]});let _0x2781ea=null;try{const _0x3a9ba8={'ignoreHTTPSErrors':!![]};_0x4273b3?.[_0x42969e(0x1f7)]&&(_0x3a9ba8['extraHTTPHeaders']=_0x4273b3['setupHeaders']);const _0xbc5a01=await _0x27d2a5[_0x42969e(0x1b9)](_0x3a9ba8);await _0x1f630c[_0x42969e(0x1b8)](addProfileSetupBanner,_0xbc5a01);const _0x46128f=await _0xbc5a01['newPage']();await _0x46128f['goto'](_0x43dbbb);let _0x3d735c=![];await new Promise(_0x4ce4d7=>{const _0x51e074={'LcQpo':function(_0x23fe7b,_0x49cd5d){return _0x1f630c['XdcBu'](_0x23fe7b,_0x49cd5d);},'dtubV':function(_0x301ad9){return _0x1f630c['HGgAn'](_0x301ad9);},'JiNrH':function(_0x5e1777,_0x42fb11){return _0x5e1777(_0x42fb11);}},_0x26dd42=setTimeout(()=>{const _0x1ec9d1=_0x4b7a;_0x3d735c=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+_0x51e074[_0x1ec9d1(0x1ba)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x1ec9d1(0x1c7)),_0x51e074[_0x1ec9d1(0x1b5)](_0x4ce4d7);},MANUAL_LOGIN_TIMEOUT_MS);_0x46128f['on'](_0x1f630c['HzgBa'],async()=>{const _0x5c5012=_0x4b7a;_0x51e074[_0x5c5012(0x1a5)](clearTimeout,_0x26dd42);try{const _0x1e2830=await _0xbc5a01[_0x5c5012(0x1d0)]();_0x2781ea=_0x1e2830;}catch{}_0x4ce4d7();});});if(_0x1f630c[_0x42969e(0x1e2)](_0x3d735c,!_0x2781ea))throw new Error(_0x1f630c[_0x42969e(0x1e1)]);}finally{await _0x27d2a5['close']()['catch'](()=>{});}if(!_0x2781ea)throw new Error(_0x1f630c[_0x42969e(0x1d4)]);return await _0x1f630c[_0x42969e(0x1d8)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x598b67['name'])+'/session',{'method':_0x1f630c['GhKSS'],'body':JSON['stringify']({'session_state':_0x2781ea,'updated_by':_0x1f630c[_0x42969e(0x1e0)]})}),{'sessionState':_0x2781ea};}export async function promptSaveCredentials(_0x1761cb){const _0x4407d0=_0x3f30ba,_0x566b65={'ovnIe':function(_0x29360e,_0x50b3c7){return _0x29360e||_0x50b3c7;},'CLLdh':function(_0x1f6207){return _0x1f6207();},'qUAzn':_0x4407d0(0x1a7),'zsNFN':_0x4407d0(0x1b4),'EElsA':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','WaUUW':function(_0x57b8e7,_0xe9fb6f,_0x54be8a){return _0x57b8e7(_0xe9fb6f,_0x54be8a);},'RtNmE':_0x4407d0(0x1b3),'GyuOI':_0x4407d0(0x1bd)},_0x1db193=process['env']['RANGER_TEST_USERNAME'],_0x1fb443=process[_0x4407d0(0x1a6)][_0x4407d0(0x1b1)];if(_0x566b65['ovnIe'](!_0x1db193,!_0x1fb443))return;if(!_0x566b65[_0x4407d0(0x1ca)](isInteractive))return;const {save:_0xda8558}=await _0x175a33['prompt']([{'type':_0x566b65['qUAzn'],'name':_0x566b65[_0x4407d0(0x18e)],'message':_0x566b65['EElsA'],'default':![]}]);if(!_0xda8558)return;await _0x566b65[_0x4407d0(0x1fe)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x1761cb),{'method':_0x566b65['RtNmE'],'body':JSON[_0x4407d0(0x1da)]({'username':_0x1db193,'password':_0x1fb443})}),console['log'](_0x566b65['GyuOI']);}export async function resolveCloudProfileSession(_0x33792d,_0x1cea13={}){const _0x292dbd=_0x3f30ba,_0x5408c4={'BKFtC':function(_0x2b69c5,_0x53cf96,_0x296c9a){return _0x2b69c5(_0x53cf96,_0x296c9a);},'torFx':function(_0x59fd9d,_0x104c11,_0x22db4f){return _0x59fd9d(_0x104c11,_0x22db4f);},'rkAdj':function(_0x2f8a25,_0xd3a890,_0x577634,_0x498aa0,_0x266094){return _0x2f8a25(_0xd3a890,_0x577634,_0x498aa0,_0x266094);},'DGDkJ':function(_0xb1601e,_0x2aad3e){return _0xb1601e(_0x2aad3e);},'TfvwS':'\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','TzTYi':function(_0x5c99f3,_0x4e39df){return _0x5c99f3===_0x4e39df;},'BoZsf':function(_0x22d660,_0x32a080,_0x251907,_0x1071a4,_0x26de75,_0x4e7c66,_0x2dfd7e,_0x2a1b0f){return _0x22d660(_0x32a080,_0x251907,_0x1071a4,_0x26de75,_0x4e7c66,_0x2dfd7e,_0x2a1b0f);},'AQcAk':function(_0x3f5e2c,_0x151731){return _0x3f5e2c(_0x151731);},'VSoZY':_0x292dbd(0x191),'bQTDY':function(_0x3d152e,_0x239429,_0xf39f3a,_0x5d0402,_0x4f279e,_0x35b0a1,_0x2192df,_0x419e75){return _0x3d152e(_0x239429,_0xf39f3a,_0x5d0402,_0x4f279e,_0x35b0a1,_0x2192df,_0x419e75);}},_0x217973=_0x33792d['settings']??{},_0x568ef8=await fetchAuthConfig(),_0x46da20=_0x568ef8?_0x5408c4['BKFtC'](resolveAuthEnvironmentLocally,_0x568ef8,_0x33792d[_0x292dbd(0x1ab)]):null,_0x79e351=_0x46da20?.[_0x292dbd(0x1cb)],_0x27d1ef=_0x217973['setupHeaders'],_0x4de620=_0x27d1ef??_0x46da20?.['setupHeaders'],_0x4fc736=_0x1cea13['effectiveBaseUrl']??_0x217973[_0x292dbd(0x190)]??(_0x79e351&&_0x79e351[_0x292dbd(0x1a9)]>0x0?_0x79e351[0x0]:''),_0x47d357={'invalidateOn':_0x46da20?.['invalidateOn'],'userAgent':_0x46da20?.[_0x292dbd(0x1af)]?.['userAgent']??_0x217973['userAgent']},_0x21bae0=await checkLocalCache(_0x33792d[_0x292dbd(0x1ff)],_0x33792d[_0x292dbd(0x1fc)],_0x4fc736,_0x4de620,_0x47d357);if(_0x21bae0){if(_0x4fc736){const _0x523873=await isCachedSessionLive(_0x21bae0['storageStatePath'],_0x4fc736,{'sessionCheckPath':_0x46da20?.['sessionCheckPath'],'setupHeaders':_0x4de620},{'launchBrowser':launchRealBrowser});if(_0x523873)return console['log']('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x33792d[_0x292dbd(0x1ff)]+'\x22'),{'authPath':_0x21bae0['storageStatePath'],'settings':_0x217973,'resolvedEnv':_0x46da20};console[_0x292dbd(0x1c5)](_0x292dbd(0x192)+_0x33792d['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x5408c4['torFx'](emitSessionValidationHint,_0x4fc736,_0x46da20);}else return{'authPath':_0x21bae0['storageStatePath'],'settings':_0x217973,'resolvedEnv':_0x46da20};}if(_0x33792d['sessionState']){const _0x207542=await writeSessionToLocalCache(_0x33792d['name'],_0x33792d[_0x292dbd(0x1fc)],_0x4fc736,_0x4de620,_0x33792d['sessionState'],_0x79e351,_0x47d357);if(_0x4fc736){const _0x3f4f2f=await _0x5408c4['rkAdj'](isCachedSessionLive,_0x207542,_0x4fc736,{'sessionCheckPath':_0x46da20?.['sessionCheckPath'],'setupHeaders':_0x4de620},{'launchBrowser':launchRealBrowser});if(_0x3f4f2f)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x33792d[_0x292dbd(0x1ff)]+'\x22,\x20cached\x20locally'),{'authPath':_0x207542,'settings':_0x217973,'resolvedEnv':_0x46da20};console['log'](_0x292dbd(0x1cc)+_0x33792d['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),emitSessionValidationHint(_0x4fc736,_0x46da20);}else return{'authPath':_0x207542,'settings':_0x217973,'resolvedEnv':_0x46da20};}console['log'](_0x292dbd(0x1ae)+_0x33792d['name']+'\x22,\x20attempting\x20login...');const _0x2963d4=_0x5408c4[_0x292dbd(0x1ce)](Boolean,process[_0x292dbd(0x1a6)][_0x292dbd(0x1ef)])&&Boolean(process['env'][_0x292dbd(0x1b1)]),_0x3acff7=_0x5408c4[_0x292dbd(0x1ce)](Boolean,_0x33792d[_0x292dbd(0x1fb)]);if(_0x2963d4||_0x3acff7)try{const _0x3e4eb4=await _0x5408c4['DGDkJ'](serverSideLogin,_0x33792d['name']);if(_0x3e4eb4['status']===_0x292dbd(0x1eb))console['log'](_0x5408c4[_0x292dbd(0x1c0)]);else{if(_0x5408c4[_0x292dbd(0x1d1)](_0x3e4eb4[_0x292dbd(0x19c)],'success')&&_0x3e4eb4['session_state']){console['log'](_0x292dbd(0x1dd));const _0x5445ae=await _0x5408c4[_0x292dbd(0x1f4)](writeSessionToLocalCache,_0x33792d[_0x292dbd(0x1ff)],_0x33792d[_0x292dbd(0x1fc)],_0x4fc736,_0x4de620,_0x3e4eb4[_0x292dbd(0x1d5)],_0x79e351,_0x47d357);return _0x2963d4&&!_0x3acff7&&await _0x5408c4['AQcAk'](promptSaveCredentials,_0x33792d[_0x292dbd(0x1ff)]),{'authPath':_0x5445ae,'settings':_0x217973,'resolvedEnv':_0x46da20};}else _0x3e4eb4['test_output']&&(console[_0x292dbd(0x1c5)](_0x5408c4['VSoZY']),console[_0x292dbd(0x1c5)](_0x3e4eb4['test_output'])),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0x28bce9){console[_0x292dbd(0x1c5)](_0x292dbd(0x1a3)+(_0x28bce9 instanceof Error?_0x28bce9['message']:String(_0x28bce9))),console[_0x292dbd(0x1c5)](_0x292dbd(0x1f1));}const {sessionState:_0x4c9027}=await manualBrowserLogin(_0x33792d,_0x46da20),_0x18c0da=await _0x5408c4['bQTDY'](writeSessionToLocalCache,_0x33792d[_0x292dbd(0x1ff)],_0x33792d[_0x292dbd(0x1fc)],_0x4fc736,_0x4de620,_0x4c9027,_0x79e351,_0x47d357);return{'authPath':_0x18c0da,'settings':_0x217973,'resolvedEnv':_0x46da20};}function _0x5358(){const _0x3dff4a=['stringify','/api/v1/profiles','profiles','\x20\x20Login\x20successful.\x20Session\x20cached.','cFXJr',').\x20','cvMPR','UPLBz','gigiM','string','/api/v1/profiles/','userAgent','NfwLF','invalidateOn','92VpveOv','settings','\x22\x20not\x20found.','not_configured','clientIp','cookies','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','RANGER_TEST_USERNAME','Cloud\x20profile\x20\x22','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','raw','qzuBb','BoZsf','):\x20','launch','setupHeaders','12478998zUPLuP','EFrPl','32559rkUSfd','username','organizationId','9721896OnZxFJ','WaUUW','name','EGPNB','zsNFN','tfISX','baseUrl','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','\x20\x20Cached\x20session\x20for\x20\x22','origin','about:blank','5qSIfOd','error','lKgwX','statusText','json','force','16255197OSDvLS','status','ApiError','30594220pzSNfB','/login','auth','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','keys','\x20\x20Server-side\x20login\x20error:\x20','996gqOtpn','JiNrH','env','confirm','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','length','rivgF','environmentKey','oNrsv','YxhWq','\x20\x20No\x20live\x20session\x20for\x20\x22','browserOptions','\x20failed\x20(','RANGER_TEST_PASSWORD','TFAhW','PUT','save','dtubV','password','utf-8','PpcpA','newContext','LcQpo','/session','7386774fkGsZz','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','jCpNG','toISOString','TfvwS','defaultEnvironmentKey','PlLbc','code','QcOUF','log','EfLYv','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','API\x20request\x20','CLLdh','domains','\x20\x20Cloud\x20session\x20for\x20\x22','Browser\x20login\x20timed\x20out\x20before\x20completion.','DGDkJ','kzewl','storageState','TzTYi','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','POST','OzyJA','session_state','IVODL','16581dYszYv','VSYOY','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'];_0x5358=function(){return _0x3dff4a;};return _0x5358();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x4f0da8=_0x5be4;(function(_0x4659b8,_0x7acac){const _0x1e221c=_0x5be4,_0x2615b6=_0x4659b8();while(!![]){try{const _0x3bce52=-parseInt(_0x1e221c(0x143))/0x1*(-parseInt(_0x1e221c(0x138))/0x2)+-parseInt(_0x1e221c(0x146))/0x3+-parseInt(_0x1e221c(0x12e))/0x4*(parseInt(_0x1e221c(0x123))/0x5)+-parseInt(_0x1e221c(0x130))/0x6*(parseInt(_0x1e221c(0x114))/0x7)+-parseInt(_0x1e221c(0x11e))/0x8+-parseInt(_0x1e221c(0x127))/0x9*(parseInt(_0x1e221c(0x12d))/0xa)+parseInt(_0x1e221c(0x117))/0xb;if(_0x3bce52===_0x7acac)break;else _0x2615b6['push'](_0x2615b6['shift']());}catch(_0x367417){_0x2615b6['push'](_0x2615b6['shift']());}}}(_0x1d0c,0x19aad));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x151dce=process['env'],_0x4d6fc0={'stdin':process[_0x4f0da8(0x12c)],'stdout':process[_0x4f0da8(0x116)]}){const _0x5822e8=_0x4f0da8,_0x1c83c4={'UrfdM':function(_0x4347da,_0x2c3386){return _0x4347da(_0x2c3386);}};if(_0x151dce['CI'])return![];return _0x1c83c4['UrfdM'](Boolean,_0x4d6fc0['stdin'][_0x5822e8(0x11d)])&&Boolean(_0x4d6fc0[_0x5822e8(0x116)][_0x5822e8(0x11d)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x59280e){const _0x16b33f=_0x4f0da8,_0x52a123={'AoJDm':_0x16b33f(0x11b),'YvLbw':'userAgent','NFwnY':function(_0x194922,_0x1619b7){return _0x194922!==_0x1619b7;},'yvSBP':'clientIp','PWjOU':'hex'},_0x4d42b1=new Set(_0x59280e[_0x16b33f(0x136)]??DEFAULT_INVALIDATE_ON),_0x1d8297={'orgId':_0x59280e[_0x16b33f(0x142)],'profileName':_0x59280e[_0x16b33f(0x145)]};return _0x4d42b1[_0x16b33f(0x11f)]('baseUrl')&&(_0x1d8297[_0x16b33f(0x113)]=_0x59280e['effectiveBaseUrl']),_0x4d42b1[_0x16b33f(0x11f)](_0x16b33f(0x11c))&&(_0x1d8297['setupHeaders']=_0x59280e['setupHeaders']?sortObjectKeys(_0x59280e[_0x16b33f(0x11c)]):_0x59280e['setupHeaders']),_0x4d42b1[_0x16b33f(0x11f)](_0x52a123['AoJDm'])&&(_0x1d8297[_0x16b33f(0x11b)]=extractPort(_0x59280e[_0x16b33f(0x113)])),_0x4d42b1['has'](_0x52a123[_0x16b33f(0x13b)])&&_0x52a123['NFwnY'](_0x59280e[_0x16b33f(0x13f)],undefined)&&(_0x1d8297['userAgent']=_0x59280e['userAgent']),_0x4d42b1[_0x16b33f(0x11f)](_0x52a123[_0x16b33f(0x126)])&&_0x59280e['clientIp']!==undefined&&(_0x1d8297['clientIp']=_0x59280e[_0x16b33f(0x12a)]),createHash(_0x16b33f(0x131))['update'](JSON[_0x16b33f(0x13e)](_0x1d8297))[_0x16b33f(0x12b)](_0x52a123['PWjOU'])['slice'](0x0,0xc);}function extractPort(_0x471036){const _0x328fdd=_0x4f0da8;try{return new URL(_0x471036)[_0x328fdd(0x11b)];}catch{return'';}}function sortObjectKeys(_0x459be0){const _0x57946e=_0x4f0da8,_0x1b5a89={};for(const _0x42a483 of Object[_0x57946e(0x137)](_0x459be0)['sort']()){_0x1b5a89[_0x42a483]=_0x459be0[_0x42a483];}return _0x1b5a89;}export function getSessionCachePath(_0x469a5a,_0x5367b3){const _0x5a52a4=_0x4f0da8,_0x593992={'NddDT':function(_0x1eca68,_0x394bb2,_0xdeef44,_0xc84462){return _0x1eca68(_0x394bb2,_0xdeef44,_0xc84462);},'ZgGMc':_0x5a52a4(0x132)};return _0x593992['NddDT'](join,getRangerHomeDir(),_0x593992[_0x5a52a4(0x13c)],_0x469a5a+'-'+_0x5367b3+'.json');}export function getStorageStatePath(_0x2567f7){const _0x367c70=_0x4f0da8,_0x3fbf33={'DJwkL':'.storageState.json'};return _0x2567f7[_0x367c70(0x134)](/\.json$/,_0x3fbf33[_0x367c70(0x12f)]);}export function needsTunnel(_0x56edd7){const _0x5472af=_0x4f0da8,_0x509a4a={'qUBKi':function(_0x41bfdc,_0x51966c){return _0x41bfdc===_0x51966c;},'koUwV':_0x5472af(0x119)};let _0x21e3fa;try{_0x21e3fa=new URL(_0x56edd7)[_0x5472af(0x141)];}catch{return![];}if(_0x21e3fa==='localhost'||_0x509a4a['qUBKi'](_0x21e3fa,'127.0.0.1'))return!![];if(_0x21e3fa['endsWith']('.localhost'))return!![];if(_0x21e3fa[_0x5472af(0x129)](_0x509a4a[_0x5472af(0x115)]))return!![];return![];}export function hostnameOf(_0x15aec7){const _0x556a3b=_0x4f0da8;return new URL(_0x15aec7)[_0x556a3b(0x141)];}export function duplicateCookiesForDomains(_0x137ed4,_0x17e2af){const _0x372e1f=_0x4f0da8,_0x3d0932=[..._0x137ed4],_0x35476a=new Set(_0x137ed4['map'](_0x1f0b37=>_0x1f0b37['domain']));for(const _0x35cbe0 of _0x17e2af){let _0x1138e3;try{_0x1138e3=hostnameOf(_0x35cbe0);}catch{continue;}if(!_0x1138e3)continue;const _0x20c313=_0x1138e3['startsWith']('.')?_0x1138e3:'.'+_0x1138e3;if(_0x35476a[_0x372e1f(0x11f)](_0x1138e3)||_0x35476a[_0x372e1f(0x11f)](_0x20c313))continue;for(const _0x31171e of _0x137ed4){_0x3d0932[_0x372e1f(0x125)]({..._0x31171e,'domain':_0x20c313});}_0x35476a[_0x372e1f(0x144)](_0x20c313);}return _0x3d0932;}export function resolveAuthEnvironmentLocally(_0x2b671e,_0x44c765){const _0x4ef99c=_0x4f0da8,_0x3d6e48={'qNlsr':function(_0x51918d,_0x3e7e09){return _0x51918d===_0x3e7e09;}},_0x131952=_0x2b671e['environments'];if(_0x44c765){const _0x270909=_0x131952[_0x44c765];if(!_0x270909)return null;return{'key':_0x44c765,..._0x270909};}if(_0x2b671e[_0x4ef99c(0x13d)]){const _0x33ed2a=_0x131952[_0x2b671e[_0x4ef99c(0x13d)]];if(!_0x33ed2a)return null;return{'key':_0x2b671e[_0x4ef99c(0x13d)],..._0x33ed2a};}const _0x4bda91=Object[_0x4ef99c(0x137)](_0x131952);if(_0x3d6e48[_0x4ef99c(0x122)](_0x4bda91[_0x4ef99c(0x11a)],0x1)){const _0x4a3a47=_0x4bda91[0x0];return{'key':_0x4a3a47,..._0x131952[_0x4a3a47]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x1e0b11,_0x2cbf8a){const _0x444b5f=_0x4f0da8;try{if(_0x2cbf8a)return new URL(_0x2cbf8a,_0x1e0b11)['toString']();return new URL(_0x1e0b11)[_0x444b5f(0x118)]();}catch{return null;}}function _0x5be4(_0x1c25c7,_0x3d6b9){_0x1c25c7=_0x1c25c7-0x113;const _0x1d0c63=_0x1d0c();let _0x5be4eb=_0x1d0c63[_0x1c25c7];return _0x5be4eb;}function _0x1d0c(){const _0x16dc90=['userAgent','LVewr','hostname','orgId','2BeOIrf','add','profileName','58113HqlInk','effectiveBaseUrl','722617ZvoYSg','koUwV','stdout','8398181tukvoD','toString','localhost.','length','port','setupHeaders','isTTY','1375232kSZtHW','has','close','pathname','qNlsr','5QLQCql','newPage','push','yvSBP','5499VgIeTm','url','includes','clientIp','digest','stdin','3220zZOlBl','805936QRorpI','DJwkL','6wrGHdt','sha256','auth','catch','replace','launchBrowser','invalidateOn','keys','34394rEkFTr','status','test','YvLbw','ZgGMc','defaultEnvironmentKey','stringify'];_0x1d0c=function(){return _0x16dc90;};return _0x1d0c();}export function looksLikeLoginUrl(_0x3cb22b){const _0x1cc219=_0x4f0da8;try{const _0x16a4a8=new URL(_0x3cb22b);return LOGIN_URL_PATTERN[_0x1cc219(0x13a)](_0x16a4a8[_0x1cc219(0x121)]);}catch{return LOGIN_URL_PATTERN[_0x1cc219(0x13a)](_0x3cb22b);}}export async function isCachedSessionLive(_0x2ad26c,_0x334a65,_0x565072={},_0x41b8e5={}){const _0x361c71=_0x4f0da8,_0x362680={'LVewr':function(_0x5c67d8,_0x1138a3,_0x2b635e){return _0x5c67d8(_0x1138a3,_0x2b635e);},'ZFWKA':function(_0x11f15e,_0xcab1ab){return _0x11f15e===_0xcab1ab;}},_0x17d2c4=_0x362680[_0x361c71(0x140)](buildSessionCheckUrl,_0x334a65,_0x565072['sessionCheckPath']);if(!_0x17d2c4)return!![];if(!_0x41b8e5[_0x361c71(0x135)])return!![];let _0x4cd9cc=null;try{_0x4cd9cc=await _0x41b8e5['launchBrowser']();const _0x167492=await _0x4cd9cc['newContext']({'storageState':_0x2ad26c,'ignoreHTTPSErrors':!![],..._0x565072[_0x361c71(0x11c)]?{'extraHTTPHeaders':_0x565072['setupHeaders']}:{}}),_0xad71c=await _0x167492[_0x361c71(0x124)](),_0x1e051a=await _0xad71c['goto'](_0x17d2c4,{'waitUntil':'domcontentloaded','timeout':0x3a98}),_0x2e0f2f=_0x1e051a?.[_0x361c71(0x139)]();if(_0x362680['ZFWKA'](_0x2e0f2f,0x191)||_0x2e0f2f===0x193)return![];const _0x42f07c=_0xad71c[_0x361c71(0x128)]();if(looksLikeLoginUrl(_0x42f07c))return![];return!![];}catch{return![];}finally{if(_0x4cd9cc)await _0x4cd9cc[_0x361c71(0x120)]()[_0x361c71(0x133)](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2c6306,_0x1e1db3){const _0x3da927=_0x19f5,_0x417d6=_0x2c6306();while(!![]){try{const _0x28413d=parseInt(_0x3da927(0xcf))/0x1*(parseInt(_0x3da927(0xd9))/0x2)+-parseInt(_0x3da927(0xc8))/0x3*(-parseInt(_0x3da927(0xc5))/0x4)+parseInt(_0x3da927(0xcc))/0x5*(parseInt(_0x3da927(0xc9))/0x6)+parseInt(_0x3da927(0xd5))/0x7*(-parseInt(_0x3da927(0xd3))/0x8)+parseInt(_0x3da927(0xcb))/0x9+parseInt(_0x3da927(0xd8))/0xa+-parseInt(_0x3da927(0xd7))/0xb;if(_0x28413d===_0x1e1db3)break;else _0x417d6['push'](_0x417d6['shift']());}catch(_0x16247a){_0x417d6['push'](_0x417d6['shift']());}}}(_0x32d1,0xe8fda));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x2473ac){const _0x45b998=_0x19f5,_0x1ccb84={'Anvmq':function(_0x13a8f1,_0x29524e,_0x296ac0,_0x36dd9a,_0xf16f9b,_0xff6c78){return _0x13a8f1(_0x29524e,_0x296ac0,_0x36dd9a,_0xf16f9b,_0xff6c78);},'JoyfN':'sha256'};return _0x1ccb84[_0x45b998(0xd0)](pbkdf2Sync,_0x2473ac,SALT,0x186a0,KEY_LENGTH,_0x1ccb84[_0x45b998(0xc6)]);}function _0x19f5(_0x3466b1,_0x3cbc96){_0x3466b1=_0x3466b1-0xc4;const _0x32d170=_0x32d1();let _0x19f539=_0x32d170[_0x3466b1];return _0x19f539;}export function encrypt(_0xd1cb54,_0x27ba89){const _0x5342d3=_0x19f5,_0x1d412b={'faVGm':function(_0xedbdfa,_0x48fca5){return _0xedbdfa(_0x48fca5);}},_0x461e78=deriveKey(_0x27ba89),_0x93f5a8=_0x1d412b[_0x5342d3(0xce)](randomBytes,IV_LENGTH),_0xa07f62=createCipheriv(ALGORITHM,_0x461e78,_0x93f5a8),_0x69d3dd=Buffer['concat']([_0xa07f62['update'](_0xd1cb54,_0x5342d3(0xc7)),_0xa07f62[_0x5342d3(0xd2)]()]),_0x2850f6=_0xa07f62[_0x5342d3(0xca)]();return Buffer['concat']([_0x93f5a8,_0x2850f6,_0x69d3dd]);}function _0x32d1(){const _0x30d7c7=['3932mPJXmu','JoyfN','utf8','4704RflOSC','2082ViHeRt','getAuthTag','6199200IzuGHf','22150wWhDFX','mVLXi','faVGm','1127654eRKnQF','Anvmq','oPOuJ','final','536dGOTjp','setAuthTag','99953mhFGwR','subarray','36123769KqZAEm','2999940OLabTj','2GafzuV','ZfWKJ','zsEnl'];_0x32d1=function(){return _0x30d7c7;};return _0x32d1();}export function decrypt(_0x27687b,_0x451725){const _0x4b869f=_0x19f5,_0x47f3ad={'zsEnl':function(_0x2f2058,_0x3ef902){return _0x2f2058(_0x3ef902);},'mVLXi':function(_0x4fc1ab,_0x356037){return _0x4fc1ab+_0x356037;},'oPOuJ':function(_0x256910,_0x799867,_0x5dbc83,_0xbce26b){return _0x256910(_0x799867,_0x5dbc83,_0xbce26b);},'ShtMp':function(_0x2f2cbc,_0x3718a9){return _0x2f2cbc+_0x3718a9;},'ZfWKJ':'utf8'},_0x2d3a16=_0x47f3ad[_0x4b869f(0xc4)](deriveKey,_0x451725),_0x58769d=_0x27687b[_0x4b869f(0xd6)](0x0,IV_LENGTH),_0x48aa23=_0x27687b['subarray'](IV_LENGTH,_0x47f3ad[_0x4b869f(0xcd)](IV_LENGTH,TAG_LENGTH)),_0x37a67b=_0x27687b['subarray'](IV_LENGTH+TAG_LENGTH),_0x352158=_0x47f3ad[_0x4b869f(0xd1)](createDecipheriv,ALGORITHM,_0x2d3a16,_0x58769d);return _0x352158[_0x4b869f(0xd4)](_0x48aa23),_0x47f3ad['ShtMp'](_0x352158['update'](_0x37a67b),_0x352158['final'](_0x47f3ad[_0x4b869f(0xda)]));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x3e820b=_0x1e83;function _0x3b4d(){const _0x4a654d=['1615369UJqxgG','unknown_command','POST','10872iYcOMR','has_token','push','/api/v1/mcp/desire-path-logs','errorMessage','rawCommand','62QUydSj','[desire-path]\x20Sending\x20log\x20to\x20','1324992PQwsic','Authorization','split','--token','fHfyV','DEBUG','omnik','TPGyV','Missing\x20required\x20argument','[REDACTED]','no_token','--authorization','--cookie','has','woktQ','Unknown\x20argument','--pass','includes','syntax_error','startsWith','slice','27831xmMHLD','catch','25485GrokyX','toLowerCase','96vncCrZ','Bearer\x20','stringify','application/json','Invalid\x20values','mmivw','--auth','--key','425828WMDUjn','Unknown\x20command','ACDZf','error','runtime_error','[desire-path]\x20Payload:\x20','622350lXgcuP','env'];_0x3b4d=function(){return _0x4a654d;};return _0x3b4d();}(function(_0x26086c,_0x17eae7){const _0x12ecc1=_0x1e83,_0xe511a0=_0x26086c();while(!![]){try{const _0x2b7e68=-parseInt(_0x12ecc1(0x8c))/0x1+parseInt(_0x12ecc1(0xa7))/0x2*(-parseInt(_0x12ecc1(0x8a))/0x3)+-parseInt(_0x12ecc1(0x96))/0x4+parseInt(_0x12ecc1(0x9c))/0x5+parseInt(_0x12ecc1(0xa9))/0x6+parseInt(_0x12ecc1(0x9e))/0x7+-parseInt(_0x12ecc1(0x8e))/0x8*(-parseInt(_0x12ecc1(0xa1))/0x9);if(_0x2b7e68===_0x17eae7)break;else _0xe511a0['push'](_0xe511a0['shift']());}catch(_0x56f91d){_0xe511a0['push'](_0xe511a0['shift']());}}}(_0x3b4d,0x29c1c));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x1e83(_0x2a62d0,_0x21343d){_0x2a62d0=_0x2a62d0-0x80;const _0x3b4d19=_0x3b4d();let _0x1e839d=_0x3b4d19[_0x2a62d0];return _0x1e839d;}import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x3e820b(0xac),'-t','--secret','--api-key','--apikey',_0x3e820b(0x95),'--password',_0x3e820b(0x85),_0x3e820b(0x94),_0x3e820b(0x80),'--header',_0x3e820b(0x81),'--credentials']),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x37f573){return TOKEN_PATTERNS['some'](_0x14f3dc=>_0x14f3dc['test'](_0x37f573));}export function sanitizeArgs(_0x3b31b3){const _0x7390af=_0x3e820b,_0x136d0c={'mmivw':_0x7390af(0xb2),'omnik':function(_0x3e309b,_0x416d27){return _0x3e309b(_0x416d27);}},_0x5a2ec7=[];let _0x533213=![];for(let _0x1c86ec=0x0;_0x1c86ec<_0x3b31b3['length'];_0x1c86ec++){const _0x7bbca2=_0x3b31b3[_0x1c86ec];if(_0x533213){_0x5a2ec7['push'](_0x136d0c['mmivw']),_0x533213=![];continue;}if(_0x7bbca2[_0x7390af(0x88)]('--')||_0x7bbca2['startsWith']('-')){const _0x5c341b=_0x7bbca2['indexOf']('=');if(_0x5c341b!==-0x1){const _0xd8ca2f=_0x7bbca2['slice'](0x0,_0x5c341b)[_0x7390af(0x8d)]();if(SENSITIVE_FLAGS[_0x7390af(0x82)](_0xd8ca2f)){_0x5a2ec7[_0x7390af(0xa3)](_0x7bbca2[_0x7390af(0x89)](0x0,_0x5c341b)+'=[REDACTED]');continue;}}else{const _0x3d4f9e=_0x7bbca2['toLowerCase']();SENSITIVE_FLAGS[_0x7390af(0x82)](_0x3d4f9e)&&(_0x533213=!![]);}_0x5a2ec7['push'](_0x7bbca2);}else _0x136d0c[_0x7390af(0xaf)](looksLikeToken,_0x7bbca2)?_0x5a2ec7[_0x7390af(0xa3)](_0x136d0c[_0x7390af(0x93)]):_0x5a2ec7['push'](_0x7bbca2);}return _0x5a2ec7['join']('\x20');}export async function logDesirePath(_0x46bc58){const _0x433618=_0x3e820b,_0x577b34={'GySCd':function(_0x25ffce,_0x32cbc8,_0x5d38bf){return _0x25ffce(_0x32cbc8,_0x5d38bf);}};try{const _0x152cfb=await getToken()[_0x433618(0x8b)](()=>null),_0x4d426f=getApiBaseUrl(),_0x6499fe=getCurrentVersion(),_0x3358af=_0x152cfb?_0x433618(0xa2):_0x433618(0xb3),_0x1b5280={..._0x46bc58['metadata'],'authStatus':_0x3358af,'isTty':process['stdout']['isTTY']??![]},_0x361bbc={'Content-Type':_0x433618(0x91)};_0x152cfb&&(_0x361bbc[_0x433618(0xaa)]=_0x433618(0x8f)+_0x152cfb);const _0x16cce9={'rawCommand':_0x46bc58[_0x433618(0xa6)],'errorMessage':_0x46bc58[_0x433618(0xa5)],'errorType':_0x46bc58['errorType'],'featureId':_0x46bc58['featureId'],'sessionId':_0x46bc58['sessionId'],'metadata':_0x1b5280,'cliVersion':_0x6499fe};process[_0x433618(0x9d)][_0x433618(0xae)]&&(console['error'](_0x433618(0xa8)+_0x4d426f+_0x433618(0xa4)),console[_0x433618(0x99)](_0x433618(0x9b)+JSON['stringify'](_0x16cce9,null,0x2))),await _0x577b34['GySCd'](fetch,_0x4d426f+'/api/v1/mcp/desire-path-logs',{'method':_0x433618(0xa0),'headers':_0x361bbc,'body':JSON[_0x433618(0x90)](_0x16cce9)});}catch(_0x28d1e2){process['env']['DEBUG']&&console[_0x433618(0x99)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x28d1e2);}}export function getErrorType(_0x2d4fb9,_0x3ec130){const _0x22079b=_0x3e820b,_0x7ff855={'lXpYV':'1|2|3|5|7|0|4|6','oHeQv':_0x22079b(0x92),'TPGyV':'invalid_option_value','dZqTv':_0x22079b(0xb1),'RHVQD':'missing_option','ACDZf':_0x22079b(0x84),'fHfyV':'unknown_argument','woktQ':_0x22079b(0x87)},_0x22c431=_0x7ff855['lXpYV'][_0x22079b(0xab)]('|');let _0x2edf20=0x0;while(!![]){switch(_0x22c431[_0x2edf20++]){case'0':if(_0x2d4fb9[_0x22079b(0x86)](_0x7ff855['oHeQv']))return _0x7ff855[_0x22079b(0xb0)];continue;case'1':if(_0x3ec130)return _0x22079b(0x9a);continue;case'2':if(!_0x2d4fb9)return'unknown';continue;case'3':if(_0x2d4fb9['includes'](_0x22079b(0x97)))return _0x22079b(0x9f);continue;case'4':if(_0x2d4fb9[_0x22079b(0x86)](_0x7ff855['dZqTv']))return _0x7ff855['RHVQD'];continue;case'5':if(_0x2d4fb9[_0x22079b(0x86)](_0x7ff855[_0x22079b(0x98)]))return _0x7ff855[_0x22079b(0xad)];continue;case'6':return _0x7ff855[_0x22079b(0x83)];case'7':if(_0x2d4fb9[_0x22079b(0x86)]('Not\x20enough\x20non-option\x20arguments'))return'missing_required_argument';continue;}break;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3881a7=_0x1778;(function(_0x305205,_0x80ab5b){const _0x5b3fc4=_0x1778,_0x13ec55=_0x305205();while(!![]){try{const _0x46534b=-parseInt(_0x5b3fc4(0xe5))/0x1*(parseInt(_0x5b3fc4(0xee))/0x2)+parseInt(_0x5b3fc4(0xbf))/0x3*(parseInt(_0x5b3fc4(0xe1))/0x4)+-parseInt(_0x5b3fc4(0xbe))/0x5*(-parseInt(_0x5b3fc4(0xc9))/0x6)+-parseInt(_0x5b3fc4(0xd8))/0x7+-parseInt(_0x5b3fc4(0xcc))/0x8*(-parseInt(_0x5b3fc4(0xe3))/0x9)+parseInt(_0x5b3fc4(0xe9))/0xa+parseInt(_0x5b3fc4(0xf7))/0xb*(-parseInt(_0x5b3fc4(0xf2))/0xc);if(_0x46534b===_0x80ab5b)break;else _0x13ec55['push'](_0x13ec55['shift']());}catch(_0x574405){_0x13ec55['push'](_0x13ec55['shift']());}}}(_0x29e0,0x7be82));import{spawn}from'child_process';import _0x52b840 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=_0x3881a7(0xf9);export async function requestDeviceCode(_0x1fb895){const _0x4fd852=_0x3881a7,_0x1ee71e=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':'POST','headers':{'Content-Type':_0x4fd852(0xb6)},'body':new URLSearchParams({'client_id':_0x1fb895})});if(!_0x1ee71e['ok']){const _0x270dfc=await _0x1ee71e['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x1ee71e[_0x4fd852(0xe7)]+'\x20'+_0x270dfc);}return _0x1ee71e['json']();}export async function pollForTokens(_0x4d8974,_0x1fac1c,_0x427174,_0x317704){const _0x1e6abd=_0x3881a7,_0x3723f0={'rEMRH':function(_0x53eb6a,_0x26d86d){return _0x53eb6a+_0x26d86d;},'DddpL':'urn:ietf:params:oauth:grant-type:device_code','rpNhu':_0x1e6abd(0xde),'ElGEW':function(_0x494646,_0x3da738){return _0x494646===_0x3da738;},'xthFr':'slow_down','RUEzI':_0x1e6abd(0xea),'BCbFZ':_0x1e6abd(0xaf)},_0x2c0dbd=_0x3723f0['rEMRH'](Date[_0x1e6abd(0xae)](),_0x317704*0x3e8);let _0x142fed=_0x427174*0x3e8;while(Date[_0x1e6abd(0xae)]()<_0x2c0dbd){await sleep(_0x142fed);const _0xa4ee6d=await fetch(WORKOS_TOKEN_URL,{'method':_0x1e6abd(0xb5),'headers':{'Content-Type':_0x1e6abd(0xb6)},'body':new URLSearchParams({'client_id':_0x4d8974,'device_code':_0x1fac1c,'grant_type':_0x3723f0['DddpL']})});if(_0xa4ee6d['ok'])return _0xa4ee6d[_0x1e6abd(0xba)]();const _0x46c5a5=await _0xa4ee6d[_0x1e6abd(0xba)]();if(_0x46c5a5[_0x1e6abd(0xbc)]===_0x3723f0[_0x1e6abd(0xda)])continue;if(_0x3723f0[_0x1e6abd(0xf6)](_0x46c5a5['error'],_0x3723f0['xthFr'])){_0x142fed+=0x3e8;continue;}throw new Error(_0x46c5a5[_0x1e6abd(0xdf)]||_0x46c5a5['error']||_0x3723f0[_0x1e6abd(0xc3)]);}throw new Error(_0x3723f0[_0x1e6abd(0xbd)]);}async function fetchUserProfile(_0x828e74){const _0x3b0c74=_0x3881a7,_0x108152={'vunft':function(_0x1e49eb,_0x231f10,_0x217f73){return _0x1e49eb(_0x231f10,_0x217f73);},'AgYfB':_0x3b0c74(0xd5)},_0x38ce46=getApiBaseUrl();try{const _0xa68b7=await _0x108152['vunft'](fetch,_0x38ce46+'/organization/me',{'method':_0x108152[_0x3b0c74(0xf4)],'headers':{'workos-token':_0x828e74}});if(_0xa68b7['ok'])return _0xa68b7[_0x3b0c74(0xba)]();}catch{}return null;}function buildKeyName(_0x5071c1,_0x48d84f){const _0x51478b=_0x3881a7,_0x5d35cc=_0x48d84f[_0x51478b(0xcd)](_0x42dd7f=>_0x42dd7f[_0x51478b(0xf3)]===_0x5071c1||_0x42dd7f['name'][_0x51478b(0xb0)](_0x5071c1+'\x20('));if(_0x5d35cc[_0x51478b(0xfa)]===0x0)return _0x5071c1;return _0x5071c1+'\x20('+(_0x5d35cc['length']+0x1)+')';}export async function provisionApiKey(_0xed3e53){const _0x3e98ef=_0x3881a7,_0x56764d={'dzigK':_0x3e98ef(0xe6),'VIPxV':function(_0x9ce346,_0x523de2){return _0x9ce346(_0x523de2);},'BXrHU':function(_0x5359c3,_0x1221b3,_0x53224){return _0x5359c3(_0x1221b3,_0x53224);},'GJtya':_0x3e98ef(0xca)},_0x4f2932=getApiBaseUrl(),_0x46c8d3={'Content-Type':_0x56764d[_0x3e98ef(0xfb)],'workos-token':_0xed3e53},_0x3720da=await _0x56764d['VIPxV'](fetchUserProfile,_0xed3e53),_0x186154=_0x3720da?.['firstName']||_0x3720da?.[_0x3e98ef(0xd7)]?.['split']('@')[0x0],_0x2f6a27=_0x186154?_0x186154+'\x27s\x20CLI\x20Key':_0x3e98ef(0xb2);let _0x1c3d74=[];try{const _0x546cc7=await _0x56764d['BXrHU'](fetch,_0x4f2932+'/api-keys',{'method':'GET','headers':_0x46c8d3});if(_0x546cc7['ok']){const _0x357491=await _0x546cc7[_0x3e98ef(0xba)]();_0x1c3d74=_0x357491['apiKeys'];}}catch{}const _0x52e47e=buildKeyName(_0x2f6a27,_0x1c3d74),_0x4c08dc=await fetch(_0x4f2932+_0x3e98ef(0xd1),{'method':'POST','headers':_0x46c8d3,'body':JSON[_0x3e98ef(0xe2)]({'name':_0x52e47e,'scope':_0x56764d[_0x3e98ef(0xf8)]})});if(!_0x4c08dc['ok']){const _0x1ac65b=await _0x4c08dc[_0x3e98ef(0xd0)]();throw new Error(_0x3e98ef(0xc1)+_0x4c08dc[_0x3e98ef(0xe7)]+'\x20'+_0x1ac65b);}const _0x1bc9e7=await _0x4c08dc[_0x3e98ef(0xba)]();return _0x1bc9e7['apiKey'][_0x3e98ef(0xc8)];}export function openBrowser(_0x229770){const _0x4a753a=_0x3881a7,_0x55a549={'HbFED':function(_0x5f6c6e,_0x45498d){return _0x5f6c6e===_0x45498d;},'ODHsD':_0x4a753a(0xed),'QsbGs':function(_0x4b0fd1,_0x5c0809,_0x196152,_0x1f823d){return _0x4b0fd1(_0x5c0809,_0x196152,_0x1f823d);},'tgATg':'ignore'};try{if(_0x55a549[_0x4a753a(0xf0)](process['platform'],_0x4a753a(0xdb))){const _0x18841e=spawn('cmd',['/c',_0x4a753a(0xd4),'',_0x229770],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0x18841e['unref']();return;}const _0xe9bb5b=process['platform']==='darwin'?_0x55a549['ODHsD']:_0x4a753a(0xcb),_0x3de18c=_0x55a549['QsbGs'](spawn,_0xe9bb5b,[_0x229770],{'detached':!![],'stdio':_0x55a549[_0x4a753a(0xe4)]});_0x3de18c['unref']();}catch{}}function _0x1778(_0x95d83e,_0x1afe64){_0x95d83e=_0x95d83e-0xae;const _0x29e097=_0x29e0();let _0x177896=_0x29e097[_0x95d83e];return _0x177896;}function decodeJwtPayload(_0x256286){const _0x1cc30d=_0x3881a7,_0x23a780={'WeovI':_0x1cc30d(0xb3),'IZOJY':_0x1cc30d(0xf5)},_0x4ea615=_0x256286[_0x1cc30d(0xce)]('.');if(_0x4ea615[_0x1cc30d(0xfa)]!==0x3)throw new Error(_0x1cc30d(0xef));const _0x5544ad=Buffer['from'](_0x4ea615[0x1],_0x23a780['WeovI'])['toString'](_0x23a780[_0x1cc30d(0xd2)]);return JSON['parse'](_0x5544ad);}function _0x29e0(){const _0x51c62d=['stdout','open','160462VzvJNE','Invalid\x20JWT\x20format','HbFED','jVxHZ','144quWvIg','name','AgYfB','utf-8','ElGEW','156222PZdLHg','GJtya','https://api.workos.com/user_management/authenticate','length','dzigK','Failed\x20to\x20fetch\x20memberships:\x20','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','now','Device\x20authorization\x20timed\x20out','startsWith','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','CLI\x20Key','base64url','Code:\x20','POST','application/x-www-form-urlencoded','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','map','access_token','json','RPHoQ','error','BCbFZ','123405ujGEPD','333267xEOBYz','rlEaa','Failed\x20to\x20provision\x20API\x20key:\x20','ZdQjs','RUEzI','expires_in','workosClientId','memberships','user_code','token','216vszgNp','mcp:write','xdg-open','5271584pXrnly','filter','split','isTTY','text','/api-keys','IZOJY','Failed\x20to\x20create\x20organization:\x20','start','GET','refresh_token','email','2163707PoFFJn','organizationId','rpNhu','win32','write','log','authorization_pending','error_description','/organization/my-memberships','4NKPJzH','stringify','9iZcVVI','tgATg','12ToFdzn','application/json','status','IIPJo','2912660MzqKrE','Authentication\x20failed','kGyvd'];_0x29e0=function(){return _0x51c62d;};return _0x29e0();}async function selfServeSignup(_0xbbd0b6){const _0x2e72ac=_0x3881a7,_0xaa4e6e=getApiBaseUrl(),_0x41d20a=await fetch(_0xaa4e6e+'/organization/self-serve-signup',{'method':_0x2e72ac(0xb5),'headers':{'Content-Type':_0x2e72ac(0xe6),'workos-token':_0xbbd0b6}});if(!_0x41d20a['ok']){const _0x5a4b0f=await _0x41d20a['text']();throw new Error(_0x2e72ac(0xd3)+_0x41d20a[_0x2e72ac(0xe7)]+'\x20'+_0x5a4b0f);}return _0x41d20a['json']();}async function fetchMyMemberships(_0x9f0f5d){const _0x2ae864=_0x3881a7,_0x1bdc58={'CYQXx':function(_0x158aff){return _0x158aff();},'IIPJo':_0x2ae864(0xd5)},_0x4910ff=_0x1bdc58['CYQXx'](getApiBaseUrl),_0x301507=await fetch(_0x4910ff+_0x2ae864(0xe0),{'method':_0x1bdc58[_0x2ae864(0xe8)],'headers':{'workos-token':_0x9f0f5d}});if(!_0x301507['ok']){const _0x5665e4=await _0x301507[_0x2ae864(0xd0)]();throw new Error(_0x2ae864(0xfc)+_0x301507['status']+'\x20'+_0x5665e4);}const _0x5f1087=await _0x301507['json']();return _0x5f1087[_0x2ae864(0xc6)];}async function refreshTokenWithOrg(_0x35339c,_0x5888d3,_0x1714eb){const _0x28937c=_0x3881a7,_0x3f59a7={'tFMgM':function(_0x174acd,_0x334d66,_0x546dc8){return _0x174acd(_0x334d66,_0x546dc8);},'uPzXH':_0x28937c(0xb6)},_0x53280a=await _0x3f59a7['tFMgM'](fetch,WORKOS_TOKEN_URL,{'method':_0x28937c(0xb5),'headers':{'Content-Type':_0x3f59a7['uPzXH']},'body':new URLSearchParams({'client_id':_0x35339c,'grant_type':_0x28937c(0xd6),'refresh_token':_0x5888d3,'organization_id':_0x1714eb})});if(!_0x53280a['ok']){const _0x5c78a7=await _0x53280a[_0x28937c(0xd0)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x53280a['status']+'\x20'+_0x5c78a7);}return _0x53280a[_0x28937c(0xba)]();}async function provisionCliToken(_0x358a3a){const _0x1592f8=_0x3881a7,_0x1437e7={'AmByq':'POST'},_0x245b1c=getApiBaseUrl(),_0x57cbdb=await fetch(_0x245b1c+'/cli-auth/token',{'method':_0x1437e7['AmByq'],'headers':{'Content-Type':_0x1592f8(0xe6),'workos-token':_0x358a3a}});if(!_0x57cbdb['ok']){const _0x554456=await _0x57cbdb['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x57cbdb['status']+'\x20'+_0x554456);}return _0x57cbdb[_0x1592f8(0xba)]();}export async function runDeviceAuthFlow(){const _0x1b3b00=_0x3881a7,_0x11d3db={'kGyvd':_0x1b3b00(0xb7),'JlUlk':function(_0x24b3c3,_0x5a0688,_0x3402d0,_0x8ee318,_0x1ef6ba){return _0x24b3c3(_0x5a0688,_0x3402d0,_0x8ee318,_0x1ef6ba);},'ZdQjs':function(_0x5d2f81,_0xc3cfaa){return _0x5d2f81(_0xc3cfaa);},'bzWEV':function(_0x4de08b,_0x51d78d){return _0x4de08b+_0x51d78d;},'SGPbR':_0x1b3b00(0xfd),'jVxHZ':'list','rlEaa':'selected','DVaQE':function(_0x14fc46,_0x353e89,_0x5829d,_0x47106b){return _0x14fc46(_0x353e89,_0x5829d,_0x47106b);},'RPHoQ':function(_0x1b92a0,_0x12b8ac){return _0x1b92a0(_0x12b8ac);}},_0x951211=getCurrentEnvironment(),_0x12d4ff=ENVIRONMENT_CONFIGS[_0x951211][_0x1b3b00(0xc5)],_0x19197d=await requestDeviceCode(_0x12d4ff);console['log'](_0x1b3b00(0xb1)),console[_0x1b3b00(0xdd)](_0x11d3db[_0x1b3b00(0xeb)]),openBrowser(_0x19197d['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x19197d['verification_uri_complete']),console['log'](_0x1b3b00(0xb4)+_0x19197d[_0x1b3b00(0xc7)]+'\x0a'),process['stdout']['write']('Waiting\x20for\x20authentication...');let _0x1056ab=await _0x11d3db['JlUlk'](pollForTokens,_0x12d4ff,_0x19197d['device_code'],_0x19197d['interval'],_0x19197d[_0x1b3b00(0xc4)]);console[_0x1b3b00(0xdd)]('\x20✓');const _0x114e5f=decodeJwtPayload(_0x1056ab[_0x1b3b00(0xb9)]);if(!_0x114e5f['org_id']){const _0x418839=await fetchMyMemberships(_0x1056ab['access_token']);let _0x4571a4;if(_0x418839['length']===0x0){process[_0x1b3b00(0xec)][_0x1b3b00(0xdc)]('Setting\x20up\x20your\x20organization...');const _0x1afac2=await _0x11d3db[_0x1b3b00(0xc2)](selfServeSignup,_0x1056ab['access_token']);_0x4571a4=_0x1afac2[_0x1b3b00(0xd9)],console['log']('\x20✓');}else{if(_0x418839['length']===0x1)_0x4571a4=_0x418839[0x0]['organizationId'],console['log']('Using\x20organization:\x20'+_0x418839[0x0]['name']);else{const _0x4735f0=process['stdin'][_0x1b3b00(0xcf)]&&process['stdout']['isTTY'];if(!_0x4735f0)throw new Error(_0x11d3db['bzWEV'](_0x11d3db['SGPbR'],'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.'));const {selected:_0x263edf}=await _0x52b840['prompt']([{'type':_0x11d3db[_0x1b3b00(0xf1)],'name':_0x11d3db[_0x1b3b00(0xc0)],'message':'Select\x20an\x20organization:','choices':_0x418839[_0x1b3b00(0xb8)](_0x23564c=>({'name':_0x23564c[_0x1b3b00(0xf3)],'value':_0x23564c[_0x1b3b00(0xd9)]}))}]);_0x4571a4=_0x263edf;}}_0x1056ab=await _0x11d3db['DVaQE'](refreshTokenWithOrg,_0x12d4ff,_0x1056ab['refresh_token'],_0x4571a4);}process[_0x1b3b00(0xec)][_0x1b3b00(0xdc)]('Provisioning\x20CLI\x20token...');const _0x3dade0=await _0x11d3db[_0x1b3b00(0xbb)](provisionCliToken,_0x1056ab[_0x1b3b00(0xb9)]);return console['log']('\x20✓'),await storeToken(_0x3dade0['token']),_0x1056ab[_0x1b3b00(0xd6)]&&await storeRefreshToken(_0x1056ab[_0x1b3b00(0xd6)]),_0x3dade0['token'];}function sleep(_0x5e2baf){return new Promise(_0x279c30=>setTimeout(_0x279c30,_0x5e2baf));}
|
|
1
|
+
(function(_0x25dae4,_0x13b159){const _0x4ec695=_0x5e0a,_0x4a5933=_0x25dae4();while(!![]){try{const _0x168fe5=parseInt(_0x4ec695(0x1f9))/0x1+-parseInt(_0x4ec695(0x1ef))/0x2*(parseInt(_0x4ec695(0x1f7))/0x3)+-parseInt(_0x4ec695(0x1de))/0x4+-parseInt(_0x4ec695(0x1e2))/0x5+parseInt(_0x4ec695(0x1ce))/0x6+-parseInt(_0x4ec695(0x1e6))/0x7+parseInt(_0x4ec695(0x1d8))/0x8;if(_0x168fe5===_0x13b159)break;else _0x4a5933['push'](_0x4a5933['shift']());}catch(_0x51c53f){_0x4a5933['push'](_0x4a5933['shift']());}}}(_0x493e,0x2a9e0));import{spawn}from'child_process';import _0x7b549e from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x6daf20){const _0x1582fd=_0x5e0a,_0x5f079b={'wvThe':function(_0x2d4daa,_0x3a212c,_0xb5fd01){return _0x2d4daa(_0x3a212c,_0xb5fd01);},'nAgMI':_0x1582fd(0x1b9)},_0x1e4c19=await _0x5f079b[_0x1582fd(0x1bc)](fetch,WORKOS_DEVICE_AUTH_URL,{'method':_0x5f079b['nAgMI'],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x6daf20})});if(!_0x1e4c19['ok']){const _0x345a4f=await _0x1e4c19[_0x1582fd(0x1d5)]();throw new Error(_0x1582fd(0x1ea)+_0x1e4c19['status']+'\x20'+_0x345a4f);}return _0x1e4c19[_0x1582fd(0x1dc)]();}export async function pollForTokens(_0x252493,_0x4e8398,_0x132dbd,_0x166a29){const _0x497387=_0x5e0a,_0x4e92e2={'vmzSi':function(_0x569cd2,_0x1e5a34){return _0x569cd2+_0x1e5a34;},'RKSpg':function(_0x21a0a6,_0x2fa36a){return _0x21a0a6(_0x2fa36a);},'mpiOZ':function(_0x54d170,_0x517b6d,_0x245e71){return _0x54d170(_0x517b6d,_0x245e71);},'shpqG':'application/x-www-form-urlencoded','zcwRy':'authorization_pending','hHxqj':'slow_down','Oytky':'Device\x20authorization\x20timed\x20out'},_0x2447bb=_0x4e92e2['vmzSi'](Date[_0x497387(0x1d0)](),_0x166a29*0x3e8);let _0x28e1df=_0x132dbd*0x3e8;while(Date[_0x497387(0x1d0)]()<_0x2447bb){await _0x4e92e2['RKSpg'](sleep,_0x28e1df);const _0x14dbab=await _0x4e92e2[_0x497387(0x1f2)](fetch,WORKOS_TOKEN_URL,{'method':_0x497387(0x1b9),'headers':{'Content-Type':_0x4e92e2[_0x497387(0x1ff)]},'body':new URLSearchParams({'client_id':_0x252493,'device_code':_0x4e8398,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x14dbab['ok'])return _0x14dbab['json']();const _0x577f01=await _0x14dbab['json']();if(_0x577f01[_0x497387(0x1d6)]===_0x4e92e2[_0x497387(0x1d4)])continue;if(_0x577f01['error']===_0x4e92e2['hHxqj']){_0x28e1df+=0x3e8;continue;}throw new Error(_0x577f01['error_description']||_0x577f01[_0x497387(0x1d6)]||_0x497387(0x1d3));}throw new Error(_0x4e92e2['Oytky']);}async function fetchUserProfile(_0x318e3c){const _0x1d41b2=_0x5e0a,_0x2930f8={'qlZxu':function(_0x51a20c,_0x1e3fde,_0x402a8a){return _0x51a20c(_0x1e3fde,_0x402a8a);},'UxHwE':'GET'},_0x38fd45=getApiBaseUrl();try{const _0x26f500=await _0x2930f8['qlZxu'](fetch,_0x38fd45+'/organization/me',{'method':_0x2930f8[_0x1d41b2(0x1ee)],'headers':{'workos-token':_0x318e3c}});if(_0x26f500['ok'])return _0x26f500['json']();}catch{}return null;}function buildKeyName(_0x296cd6,_0x4e2aa0){const _0x2de58b=_0x5e0a,_0x5c6d36={'DjEoR':function(_0x1a56fb,_0x59ec7e){return _0x1a56fb===_0x59ec7e;},'XhXPz':function(_0x392dc2,_0x1466ae){return _0x392dc2+_0x1466ae;}},_0x5d17d5=_0x4e2aa0[_0x2de58b(0x1e0)](_0x2fa4b4=>_0x2fa4b4[_0x2de58b(0x1d1)]===_0x296cd6||_0x2fa4b4['name'][_0x2de58b(0x1bd)](_0x296cd6+'\x20('));if(_0x5c6d36['DjEoR'](_0x5d17d5['length'],0x0))return _0x296cd6;return _0x296cd6+'\x20('+_0x5c6d36[_0x2de58b(0x1f3)](_0x5d17d5['length'],0x1)+')';}function _0x493e(){const _0x118a03=['access_token','POST','GGBwT','Setting\x20up\x20your\x20organization...','wvThe','startsWith','interval','idLmb','\x27s\x20CLI\x20Key','platform','length','XilAv','firstName','LjPnd','parse','SLdvg','unref','wcUie','xdg-open','PwHlJ','split','EXJFE','1734072OAmJye','organizationId','now','name','Failed\x20to\x20provision\x20CLI\x20token:\x20','Authentication\x20failed','zcwRy','text','error','GET','3377992GZznhg','write','token','xYhDF','json','stringify','1053712BorzsK','rEiox','filter','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','345480OWMUpJ','selected','qJfgr','YNiDw','1105279sBiMfM','email','ignore','win32','Failed\x20to\x20request\x20device\x20code:\x20','start','verification_uri_complete','status','UxHwE','2HZQPTk','refresh_token','user_code','mpiOZ','XhXPz','YjepH','kjwdW','TmoPc','1028703ohzNjb','toString','296621AlpwLn','application/x-www-form-urlencoded','org_id','Using\x20organization:\x20','expires_in','utf-8','shpqG','Select\x20an\x20organization:','darwin','stdin','log','stdout','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','UiOvy','application/json','Failed\x20to\x20create\x20organization:\x20'];_0x493e=function(){return _0x118a03;};return _0x493e();}export async function provisionApiKey(_0x419b41){const _0x313afb=_0x5e0a,_0x496f06={'PWWBN':function(_0x5a1302){return _0x5a1302();},'UiOvy':function(_0x5a2188,_0x57a581){return _0x5a2188(_0x57a581);},'kjwdW':function(_0x3fcc67,_0x41951e,_0x1a9b94){return _0x3fcc67(_0x41951e,_0x1a9b94);},'XGmWq':_0x313afb(0x1b9)},_0x11a0a1=_0x496f06['PWWBN'](getApiBaseUrl),_0x399813={'Content-Type':_0x313afb(0x207),'workos-token':_0x419b41},_0x281ff0=await _0x496f06[_0x313afb(0x206)](fetchUserProfile,_0x419b41),_0x40d3d7=_0x281ff0?.[_0x313afb(0x1c4)]||_0x281ff0?.[_0x313afb(0x1e7)]?.[_0x313afb(0x1cc)]('@')[0x0],_0x113439=_0x40d3d7?_0x40d3d7+_0x313afb(0x1c0):'CLI\x20Key';let _0x11bd6f=[];try{const _0x30ef42=await fetch(_0x11a0a1+'/api-keys',{'method':_0x313afb(0x1d7),'headers':_0x399813});if(_0x30ef42['ok']){const _0x147c99=await _0x30ef42['json']();_0x11bd6f=_0x147c99['apiKeys'];}}catch{}const _0x1a067d=_0x496f06[_0x313afb(0x1f5)](buildKeyName,_0x113439,_0x11bd6f),_0x407a78=await _0x496f06[_0x313afb(0x1f5)](fetch,_0x11a0a1+'/api-keys',{'method':_0x496f06['XGmWq'],'headers':_0x399813,'body':JSON[_0x313afb(0x1dd)]({'name':_0x1a067d,'scope':'mcp:write'})});if(!_0x407a78['ok']){const _0x572f35=await _0x407a78[_0x313afb(0x1d5)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x407a78['status']+'\x20'+_0x572f35);}const _0x250d7f=await _0x407a78[_0x313afb(0x1dc)]();return _0x250d7f['apiKey'][_0x313afb(0x1da)];}export function openBrowser(_0x35f322){const _0x2b6cae=_0x5e0a,_0x5af41a={'PwHlJ':function(_0x36b49f,_0x2d8625){return _0x36b49f===_0x2d8625;},'wkOfH':_0x2b6cae(0x1e9),'RHGme':function(_0x4e7fa4,_0x46c06b,_0x4c98f6,_0x3411dd){return _0x4e7fa4(_0x46c06b,_0x4c98f6,_0x3411dd);},'YNiDw':'cmd','TzhvA':_0x2b6cae(0x1eb),'idLmb':'open','rEiox':function(_0x5c261d,_0x5a193a,_0x11cdde,_0x40fd87){return _0x5c261d(_0x5a193a,_0x11cdde,_0x40fd87);}};try{if(_0x5af41a[_0x2b6cae(0x1cb)](process[_0x2b6cae(0x1c1)],_0x5af41a['wkOfH'])){const _0x5b3f11=_0x5af41a['RHGme'](spawn,_0x5af41a[_0x2b6cae(0x1e5)],['/c',_0x5af41a['TzhvA'],'',_0x35f322],{'detached':!![],'stdio':_0x2b6cae(0x1e8),'windowsHide':!![]});_0x5b3f11[_0x2b6cae(0x1c8)]();return;}const _0x4d1486=process['platform']===_0x2b6cae(0x201)?_0x5af41a[_0x2b6cae(0x1bf)]:_0x2b6cae(0x1ca),_0x46d3c3=_0x5af41a[_0x2b6cae(0x1df)](spawn,_0x4d1486,[_0x35f322],{'detached':!![],'stdio':_0x2b6cae(0x1e8)});_0x46d3c3['unref']();}catch{}}function decodeJwtPayload(_0x586e55){const _0x5a3a5b=_0x5e0a,_0x554566={'AvYht':'base64url'},_0x2b9e14=_0x586e55[_0x5a3a5b(0x1cc)]('.');if(_0x2b9e14[_0x5a3a5b(0x1c2)]!==0x3)throw new Error('Invalid\x20JWT\x20format');const _0x34c69d=Buffer['from'](_0x2b9e14[0x1],_0x554566['AvYht'])[_0x5a3a5b(0x1f8)](_0x5a3a5b(0x1fe));return JSON[_0x5a3a5b(0x1c6)](_0x34c69d);}async function selfServeSignup(_0x40b672){const _0x243e14=_0x5e0a,_0x512247={'TmoPc':function(_0x1a45e4,_0x40c530,_0x170548){return _0x1a45e4(_0x40c530,_0x170548);}},_0x1edafc=getApiBaseUrl(),_0x4fae78=await _0x512247[_0x243e14(0x1f6)](fetch,_0x1edafc+'/organization/self-serve-signup',{'method':'POST','headers':{'Content-Type':_0x243e14(0x207),'workos-token':_0x40b672}});if(!_0x4fae78['ok']){const _0x323a2b=await _0x4fae78[_0x243e14(0x1d5)]();throw new Error(_0x243e14(0x1b7)+_0x4fae78[_0x243e14(0x1ed)]+'\x20'+_0x323a2b);}return _0x4fae78[_0x243e14(0x1dc)]();}async function fetchMyMemberships(_0x198f8a){const _0x467531=_0x5e0a,_0x41d5e0={'tlFNG':function(_0x1acc37){return _0x1acc37();},'BNGAi':function(_0x2a3787,_0x21f8f5,_0x4b347f){return _0x2a3787(_0x21f8f5,_0x4b347f);},'vQhyr':_0x467531(0x1d7)},_0x2b37f2=_0x41d5e0['tlFNG'](getApiBaseUrl),_0xbc868a=await _0x41d5e0['BNGAi'](fetch,_0x2b37f2+'/organization/my-memberships',{'method':_0x41d5e0['vQhyr'],'headers':{'workos-token':_0x198f8a}});if(!_0xbc868a['ok']){const _0x413ded=await _0xbc868a['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0xbc868a['status']+'\x20'+_0x413ded);}const _0x153619=await _0xbc868a[_0x467531(0x1dc)]();return _0x153619['memberships'];}function _0x5e0a(_0x5e347e,_0x5c7646){_0x5e347e=_0x5e347e-0x1b7;const _0x493ec0=_0x493e();let _0x5e0ac6=_0x493ec0[_0x5e347e];return _0x5e0ac6;}async function refreshTokenWithOrg(_0x30b3fa,_0x1bd092,_0x37a0e6){const _0x2ec6e7=_0x5e0a,_0x598337={'YLxez':function(_0x184091,_0x9aabcf,_0x53dea5){return _0x184091(_0x9aabcf,_0x53dea5);}},_0x53efbc=await _0x598337['YLxez'](fetch,WORKOS_TOKEN_URL,{'method':_0x2ec6e7(0x1b9),'headers':{'Content-Type':_0x2ec6e7(0x1fa)},'body':new URLSearchParams({'client_id':_0x30b3fa,'grant_type':'refresh_token','refresh_token':_0x1bd092,'organization_id':_0x37a0e6})});if(!_0x53efbc['ok']){const _0xe101eb=await _0x53efbc['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x53efbc['status']+'\x20'+_0xe101eb);}return _0x53efbc[_0x2ec6e7(0x1dc)]();}async function provisionCliToken(_0xa732e2){const _0x3c7276=_0x5e0a,_0x48a7ba=getApiBaseUrl(),_0x302693=await fetch(_0x48a7ba+'/cli-auth/token',{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0xa732e2}});if(!_0x302693['ok']){const _0x425127=await _0x302693['text']();throw new Error(_0x3c7276(0x1d2)+_0x302693[_0x3c7276(0x1ed)]+'\x20'+_0x425127);}return _0x302693[_0x3c7276(0x1dc)]();}export async function runDeviceAuthFlow(){const _0x563772=_0x5e0a,_0x1d8331={'EXJFE':function(_0x50941d){return _0x50941d();},'LjPnd':function(_0x325b85,_0x318ee5){return _0x325b85(_0x318ee5);},'qJfgr':'\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','ENJYC':function(_0x595fad,_0x98b2f2,_0x22c172,_0x1c4c6e,_0x2a1be5){return _0x595fad(_0x98b2f2,_0x22c172,_0x1c4c6e,_0x2a1be5);},'CbpDf':_0x563772(0x1bb),'wohDg':function(_0x9cb27d,_0x263cf3){return _0x9cb27d(_0x263cf3);},'CMcvn':function(_0x11d7ad,_0x3e8eaf){return _0x11d7ad===_0x3e8eaf;},'GGBwT':function(_0x55c0e6,_0x324b75){return _0x55c0e6+_0x324b75;},'wcUie':_0x563772(0x1e1),'YjepH':_0x563772(0x205),'SLdvg':function(_0x122f74,_0x444002,_0x1b83e2,_0x59076f){return _0x122f74(_0x444002,_0x1b83e2,_0x59076f);},'xYhDF':'Provisioning\x20CLI\x20token...','vinzQ':function(_0x276030,_0x49f1db){return _0x276030(_0x49f1db);},'XilAv':function(_0x430390,_0x56d2b3){return _0x430390(_0x56d2b3);}},_0x46d785=_0x1d8331[_0x563772(0x1cd)](getCurrentEnvironment),_0x55b948=ENVIRONMENT_CONFIGS[_0x46d785]['workosClientId'],_0x23cf06=await _0x1d8331[_0x563772(0x1c5)](requestDeviceCode,_0x55b948);console[_0x563772(0x203)]('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x563772(0x203)](_0x1d8331[_0x563772(0x1e4)]),openBrowser(_0x23cf06['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x23cf06[_0x563772(0x1ec)]),console[_0x563772(0x203)]('Code:\x20'+_0x23cf06[_0x563772(0x1f1)]+'\x0a'),process['stdout'][_0x563772(0x1d9)]('Waiting\x20for\x20authentication...');let _0x46a50d=await _0x1d8331['ENJYC'](pollForTokens,_0x55b948,_0x23cf06['device_code'],_0x23cf06[_0x563772(0x1be)],_0x23cf06[_0x563772(0x1fd)]);console['log']('\x20✓');const _0xba42a2=decodeJwtPayload(_0x46a50d[_0x563772(0x1b8)]);if(!_0xba42a2[_0x563772(0x1fb)]){const _0x450d40=await fetchMyMemberships(_0x46a50d[_0x563772(0x1b8)]);let _0x133809;if(_0x450d40[_0x563772(0x1c2)]===0x0){process[_0x563772(0x204)]['write'](_0x1d8331['CbpDf']);const _0x484dbf=await _0x1d8331['wohDg'](selfServeSignup,_0x46a50d[_0x563772(0x1b8)]);_0x133809=_0x484dbf['organizationId'],console['log']('\x20✓');}else{if(_0x1d8331['CMcvn'](_0x450d40[_0x563772(0x1c2)],0x1))_0x133809=_0x450d40[0x0]['organizationId'],console[_0x563772(0x203)](_0x563772(0x1fc)+_0x450d40[0x0][_0x563772(0x1d1)]);else{const _0x1fce13=process[_0x563772(0x202)]['isTTY']&&process[_0x563772(0x204)]['isTTY'];if(!_0x1fce13)throw new Error(_0x1d8331[_0x563772(0x1ba)](_0x1d8331[_0x563772(0x1c9)],_0x1d8331[_0x563772(0x1f4)]));const {selected:_0x584286}=await _0x7b549e['prompt']([{'type':'list','name':_0x563772(0x1e3),'message':_0x563772(0x200),'choices':_0x450d40['map'](_0x836424=>({'name':_0x836424[_0x563772(0x1d1)],'value':_0x836424[_0x563772(0x1cf)]}))}]);_0x133809=_0x584286;}}_0x46a50d=await _0x1d8331[_0x563772(0x1c7)](refreshTokenWithOrg,_0x55b948,_0x46a50d[_0x563772(0x1f0)],_0x133809);}process['stdout']['write'](_0x1d8331[_0x563772(0x1db)]);const _0x4ce0ed=await _0x1d8331['vinzQ'](provisionCliToken,_0x46a50d[_0x563772(0x1b8)]);return console[_0x563772(0x203)]('\x20✓'),await _0x1d8331[_0x563772(0x1c3)](storeToken,_0x4ce0ed[_0x563772(0x1da)]),_0x46a50d['refresh_token']&&await _0x1d8331[_0x563772(0x1c5)](storeRefreshToken,_0x46a50d[_0x563772(0x1f0)]),_0x4ce0ed[_0x563772(0x1da)];}function sleep(_0x4fa4cb){return new Promise(_0x53d570=>setTimeout(_0x53d570,_0x4fa4cb));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x43e2b0=_0x3089;(function(_0x3ddbb7,_0x3f2ab3){const _0x5696d6=_0x3089,_0xc6c2ad=_0x3ddbb7();while(!![]){try{const _0x1f27e1=-parseInt(_0x5696d6(0x122))/0x1*(parseInt(_0x5696d6(0xff))/0x2)+parseInt(_0x5696d6(0x108))/0x3+parseInt(_0x5696d6(0x115))/0x4*(parseInt(_0x5696d6(0x10a))/0x5)+-parseInt(_0x5696d6(0x118))/0x6*(-parseInt(_0x5696d6(0x10c))/0x7)+parseInt(_0x5696d6(0x112))/0x8+parseInt(_0x5696d6(0x103))/0x9+parseInt(_0x5696d6(0x114))/0xa*(-parseInt(_0x5696d6(0x109))/0xb);if(_0x1f27e1===_0x3f2ab3)break;else _0xc6c2ad['push'](_0xc6c2ad['shift']());}catch(_0x423353){_0xc6c2ad['push'](_0xc6c2ad['shift']());}}}(_0x1247,0x47aa9));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0x43e2b0(0x120),'aiProxyUrl':_0x43e2b0(0x11f),'mcpAuthUrl':_0x43e2b0(0x102)},'staging':{'apiBaseUrl':_0x43e2b0(0x11d),'workosClientId':_0x43e2b0(0x11c),'aiProxyUrl':_0x43e2b0(0x11a),'mcpAuthUrl':_0x43e2b0(0x110)},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x43e2b0(0x11b),'mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT='prod';function _0x1247(){const _0x497fbf=['http://localhost:8090','client_01J9CBYM2DKWV9HM17D95Z540K','https://api.staging.ranger.net','LSFQi','https://ai-proxy-716115358910.us-central1.run.app','client_01J9CBYM7M5ZETCF7G6614DXR2','find','133660ImibaE','YatjD','playwright-cli','4yWVJCa','ekcGU','LNAoN','https://mcp-auth.ranger.net/mcp','1064997lJJcLt','trim','RANGER_MCP_AUTH_URL','mcp','env','1266807WskNca','2331890FsLFMP','5caQDhy','Wudtw','189021IyAGuT','RANGER_CLI_ENV','RANGER_USE_NOVA_ACT','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli.','https://mcp-auth.staging.ranger.net/mcp','Invalid\x20RANGER_TRANSPORT=\x22','3333744KyvSXu','uZmOr','50vvGPcD','2005908xCpHyU','aiProxyUrl','staging','36HNyjgX','prod','https://ai-proxy-301751771437.us-central1.run.app'];_0x1247=function(){return _0x497fbf;};return _0x1247();}export function isValidEnvironment(_0x586e4d){const _0x35a470=_0x43e2b0,_0x40d0cd={'Wudtw':function(_0x15c392,_0x4abeca){return _0x15c392===_0x4abeca;},'LNAoN':function(_0x41af71,_0x51816e){return _0x41af71===_0x51816e;},'YatjD':function(_0x3d3d39,_0x4a294d){return _0x3d3d39===_0x4a294d;},'FwqCA':'local'};return _0x40d0cd[_0x35a470(0x10b)](_0x586e4d,_0x35a470(0x119))||_0x40d0cd[_0x35a470(0x101)](_0x586e4d,_0x35a470(0x117))||_0x40d0cd[_0x35a470(0x123)](_0x586e4d,_0x40d0cd['FwqCA']);}export function getCurrentEnvironment(){const _0x2877ed=_0x43e2b0,_0x5b7c35=process[_0x2877ed(0x107)][_0x2877ed(0x10d)];if(_0x5b7c35&&isValidEnvironment(_0x5b7c35))return _0x5b7c35;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x223a3a={'mnArs':function(_0x4816c1){return _0x4816c1();}};return ENVIRONMENT_CONFIGS[_0x223a3a['mnArs'](getCurrentEnvironment)]['apiBaseUrl'];}export function getAiProxyUrl(){const _0x403572=_0x43e2b0;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x403572(0x116)];}export function getMcpAuthUrl(){const _0x104440=_0x43e2b0;return process[_0x104440(0x107)][_0x104440(0x105)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['mcpAuthUrl'];}function _0x3089(_0xadee0a,_0x2936a9){_0xadee0a=_0xadee0a-0xff;const _0x124761=_0x1247();let _0x308982=_0x124761[_0xadee0a];return _0x308982;}export function isByokEnabled(){const _0x117314=_0x43e2b0,_0x5774fe={'sinRB':function(_0x429cf2,_0x3f84aa){return _0x429cf2===_0x3f84aa;},'LSFQi':'true'};return _0x5774fe['sinRB'](process['env']['RANGER_BYOK'],_0x5774fe[_0x117314(0x11e)]);}function isVerificationTransport(_0x51b672){const _0x5ef548=_0x43e2b0,_0x2ecc26={'ekcGU':function(_0x5df18f,_0xaf516b){return _0x5df18f===_0xaf516b;},'uZmOr':_0x5ef548(0x124)};return _0x2ecc26[_0x5ef548(0x100)](_0x51b672,'mcp')||_0x2ecc26['ekcGU'](_0x51b672,_0x2ecc26[_0x5ef548(0x113)])||_0x51b672==='nova-act-cli';}const LEGACY_TRANSPORT_ENV_VARS=[_0x43e2b0(0x10e),'RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x10eca4=_0x43e2b0,_0x154d0e={'qZbzF':function(_0x33577e,_0x5f263c){return _0x33577e(_0x5f263c);}},_0x56675b=process['env']['RANGER_TRANSPORT']?.[_0x10eca4(0x104)]();if(_0x56675b){if(_0x154d0e['qZbzF'](isVerificationTransport,_0x56675b))return _0x56675b;throw new Error(_0x10eca4(0x111)+_0x56675b+_0x10eca4(0x10f));}const _0x405fe2=LEGACY_TRANSPORT_ENV_VARS[_0x10eca4(0x121)](_0xa7825b=>process[_0x10eca4(0x107)][_0xa7825b]);if(_0x405fe2)throw new Error(_0x405fe2+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20or\x20RANGER_TRANSPORT=nova-act-cli.');return _0x10eca4(0x106);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5ea1d1,_0x21fa5f){const _0x5d8a04=_0x5d99,_0x47c900=_0x5ea1d1();while(!![]){try{const _0x482ba0=parseInt(_0x5d8a04(0x18f))/0x1*(-parseInt(_0x5d8a04(0x189))/0x2)+-parseInt(_0x5d8a04(0x1b7))/0x3*(parseInt(_0x5d8a04(0x1c2))/0x4)+parseInt(_0x5d8a04(0x1bc))/0x5+parseInt(_0x5d8a04(0x1c8))/0x6*(parseInt(_0x5d8a04(0x1c4))/0x7)+parseInt(_0x5d8a04(0x186))/0x8+-parseInt(_0x5d8a04(0x1a4))/0x9*(-parseInt(_0x5d8a04(0x1c0))/0xa)+parseInt(_0x5d8a04(0x1b1))/0xb*(-parseInt(_0x5d8a04(0x1c7))/0xc);if(_0x482ba0===_0x21fa5f)break;else _0x47c900['push'](_0x47c900['shift']());}catch(_0x35716a){_0x47c900['push'](_0x47c900['shift']());}}}(_0x1dca,0xbd8aa));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x26f33c){const _0x597caa=_0x5d99,_0x14cce6={'MUEqU':function(_0x43cacf){return _0x43cacf();},'aeMMb':_0x597caa(0x18b),'vruDQ':function(_0x549a80,_0x469e52){return _0x549a80===_0x469e52;},'oBiVO':'https://dashboard.ranger.net/billing'},_0x59d8a5=await getToken();if(!_0x59d8a5)throw new Error(_0x597caa(0x1ab));const _0x4d1467=_0x14cce6['MUEqU'](getApiBaseUrl),_0x38b330=await fetch(_0x4d1467+'/api/v1/mcp/features',{'method':_0x14cce6['aeMMb'],'headers':{'Authorization':'Bearer\x20'+_0x59d8a5,'Content-Type':_0x597caa(0x1aa)},'body':JSON[_0x597caa(0x1ca)](_0x26f33c)});if(!_0x38b330['ok']){if(_0x14cce6['vruDQ'](_0x38b330['status'],0x192)){const _0x4927a8=await _0x38b330[_0x597caa(0x1af)](),_0xf4c06f=_0x4927a8[_0x597caa(0x1cb)]||_0x14cce6['oBiVO'];throw new Error((_0x4927a8[_0x597caa(0x1ba)]||_0x597caa(0x197))+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0xf4c06f);}const _0x25ddd2=await _0x38b330[_0x597caa(0x1a8)]();throw new Error('Failed\x20to\x20create\x20feature\x20review:\x20'+_0x25ddd2);}return _0x38b330[_0x597caa(0x1af)]();}export async function listFeatures(_0x45be07){const _0x4cc1bb=_0x5d99,_0x2c97a2={'aaxKA':function(_0x49f235){return _0x49f235();},'bIsLq':function(_0x540894){return _0x540894();},'JEZEE':_0x4cc1bb(0x1b8),'UtkYX':'true','aLWty':'GET'},_0x54339c=await _0x2c97a2['aaxKA'](getToken);if(!_0x54339c)throw new Error(_0x4cc1bb(0x1ab));const _0x3fb455=_0x2c97a2[_0x4cc1bb(0x1b4)](getApiBaseUrl),_0x3c9140=new URLSearchParams();if(_0x45be07?.[_0x4cc1bb(0x1a9)])_0x3c9140[_0x4cc1bb(0x1a6)](_0x4cc1bb(0x1a9),_0x45be07[_0x4cc1bb(0x1a9)]);if(_0x45be07?.[_0x4cc1bb(0x1b3)])_0x3c9140[_0x4cc1bb(0x1a6)]('gitBranch',_0x45be07['gitBranch']);if(_0x45be07?.['limit'])_0x3c9140['set']('limit',_0x45be07[_0x4cc1bb(0x1b0)]['toString']());if(_0x45be07?.['offset'])_0x3c9140[_0x4cc1bb(0x1a6)](_0x4cc1bb(0x1ae),_0x45be07['offset']['toString']());if(_0x45be07?.[_0x4cc1bb(0x1b8)])_0x3c9140[_0x4cc1bb(0x1a6)](_0x2c97a2['JEZEE'],_0x2c97a2['UtkYX']);const _0x470bb4=_0x3fb455+'/api/v1/mcp/features'+(_0x3c9140['toString']()?'?'+_0x3c9140[_0x4cc1bb(0x1cc)]():''),_0x3e228f=await fetch(_0x470bb4,{'method':_0x2c97a2['aLWty'],'headers':{'Authorization':_0x4cc1bb(0x194)+_0x54339c}});if(!_0x3e228f['ok']){const _0x1b0875=await _0x3e228f['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x1b0875);}return _0x3e228f[_0x4cc1bb(0x1af)]();}export async function getFeature(_0x27cf5b){const _0x5031c9=_0x5d99,_0x393d66={'PWwMC':function(_0xba102){return _0xba102();},'BKwqA':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','GhGQk':function(_0xef88b0,_0x251456,_0x289a1d){return _0xef88b0(_0x251456,_0x289a1d);}},_0x524ecf=await _0x393d66[_0x5031c9(0x19f)](getToken);if(!_0x524ecf)throw new Error(_0x393d66['BKwqA']);const _0x56a8ec=getApiBaseUrl(),_0x1b8472=await _0x393d66['GhGQk'](fetch,_0x56a8ec+'/api/v1/mcp/features/'+_0x27cf5b,{'method':_0x5031c9(0x1bb),'headers':{'Authorization':_0x5031c9(0x194)+_0x524ecf}});if(!_0x1b8472['ok']){const _0x22294b=await _0x1b8472['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x22294b);}return _0x1b8472['json']();}export async function updateFeature(_0x5db0ee,_0x5ad36d){const _0x4c17ca=_0x5d99,_0xe1cfa5={'GdZtK':function(_0xa12add){return _0xa12add();},'FBBMb':function(_0x230e83,_0x1b431a,_0x54aa02){return _0x230e83(_0x1b431a,_0x54aa02);},'uzOxB':_0x4c17ca(0x1aa)},_0x3f6040=await _0xe1cfa5[_0x4c17ca(0x18c)](getToken);if(!_0x3f6040)throw new Error(_0x4c17ca(0x1ab));const _0x352bc9=getApiBaseUrl(),_0x1b4f34=await _0xe1cfa5[_0x4c17ca(0x18e)](fetch,_0x352bc9+'/api/v1/mcp/features/'+_0x5db0ee,{'method':_0x4c17ca(0x196),'headers':{'Authorization':'Bearer\x20'+_0x3f6040,'Content-Type':_0xe1cfa5[_0x4c17ca(0x188)]},'body':JSON['stringify'](_0x5ad36d)});if(!_0x1b4f34['ok']){const _0x410c0b=await _0x1b4f34['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x410c0b);}return _0x1b4f34[_0x4c17ca(0x1af)]();}function _0x1dca(){const _0x3f440e=['4135188rsGnlu','6XRCCCy','length','stringify','billingUrl','toString','xLHlm','QvYiS','5018488Dqkwdf','Failed\x20to\x20restore\x20feature\x20review:\x20','uzOxB','79654YovTfo','vjMBA','POST','GdZtK','rdPha','FBBMb','14rHtFAi','Tuagv','/checklist/','NLNPf','sessionId','Bearer\x20','/conclude','PATCH','Feature\x20limit\x20exceeded','/start','/sessions/','DzLLQ','JAKZB','style','Failed\x20to\x20get\x20item\x20feedback:\x20','Failed\x20to\x20start\x20session:\x20','PWwMC','CAMkW','xCPyN','/api/v1/mcp/features/','updateChecklistItem','110277HzcLPk','/report/markdown','set','/sessions','text','gitRepoUrl','application/json','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','itemIds','/comments/address','offset','json','limit','33CHXQOs','/report','gitBranch','bIsLq','EShae','DELETE','78102MnlPzH','includeDeleted','Failed\x20to\x20delete\x20feature\x20review:\x20','message','GET','7215670vvnyTc','/checklist','HsXhs','/restore','350vHFziJ','Fdkcy','176IvqusQ','Failed\x20to\x20list\x20sessions:\x20','7097531Okzztf','vWPgn','Failed\x20to\x20conclude\x20session:\x20'];_0x1dca=function(){return _0x3f440e;};return _0x1dca();}export async function createChecklistItem(_0x1bca62,_0x195325,_0x520581){const _0x1a629c=_0x5d99,_0x217906={'weCqI':function(_0x6aef5b){return _0x6aef5b();},'zsrhk':_0x1a629c(0x1ab),'NLNPf':_0x1a629c(0x18b)},_0x581fc2=await _0x217906['weCqI'](getToken);if(!_0x581fc2)throw new Error(_0x217906['zsrhk']);const _0x2c55b2=getApiBaseUrl(),_0x40d153=await fetch(_0x2c55b2+_0x1a629c(0x1a2)+_0x1bca62+_0x1a629c(0x1bd),{'method':_0x217906[_0x1a629c(0x192)],'headers':{'Authorization':_0x1a629c(0x194)+_0x581fc2,'Content-Type':_0x1a629c(0x1aa)},'body':JSON[_0x1a629c(0x1ca)]({'description':_0x195325,'position':_0x520581})});if(!_0x40d153['ok']){const _0xe8e83a=await _0x40d153['text']();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0xe8e83a);}return _0x40d153[_0x1a629c(0x1af)]();}export async function updateChecklistItem(_0x211c26,_0x5e06c6,_0x21ec14){const _0x39eb44=_0x5d99,_0x13cbea={'rdPha':function(_0xe66690){return _0xe66690();},'vWPgn':function(_0x12b0d8,_0x2730c8,_0xac903f){return _0x12b0d8(_0x2730c8,_0xac903f);},'CsiUz':'PATCH','YCLiB':_0x39eb44(0x1aa)};return withRetry(async()=>{const _0x16230b=_0x39eb44,_0x353721=await _0x13cbea[_0x16230b(0x18d)](getToken);if(!_0x353721)throw new Error(_0x16230b(0x1ab));const _0x341060=getApiBaseUrl(),_0x4d9827=await _0x13cbea[_0x16230b(0x1c5)](fetch,_0x341060+_0x16230b(0x1a2)+_0x211c26+_0x16230b(0x191)+_0x5e06c6,{'method':_0x13cbea['CsiUz'],'headers':{'Authorization':_0x16230b(0x194)+_0x353721,'Content-Type':_0x13cbea['YCLiB']},'body':JSON[_0x16230b(0x1ca)](_0x21ec14)});if(!_0x4d9827['ok']){const _0x98d507=await _0x4d9827[_0x16230b(0x1a8)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x98d507);}return _0x4d9827[_0x16230b(0x1af)]();},{'label':_0x39eb44(0x1a3)});}export async function getFeatureReport(_0x58a098){const _0xdc3ab2=_0x5d99,_0x138e03={'ebHMe':function(_0x4d1c54){return _0x4d1c54();},'xLHlm':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x180de3=await _0x138e03['ebHMe'](getToken);if(!_0x180de3)throw new Error(_0x138e03[_0xdc3ab2(0x1cd)]);const _0x33b5c8=getApiBaseUrl(),_0x315f7c=await fetch(_0x33b5c8+_0xdc3ab2(0x1a2)+_0x58a098+_0xdc3ab2(0x1b2),{'method':'GET','headers':{'Authorization':_0xdc3ab2(0x194)+_0x180de3}});if(!_0x315f7c['ok']){const _0x36182a=await _0x315f7c[_0xdc3ab2(0x1a8)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x36182a);}return _0x315f7c[_0xdc3ab2(0x1af)]();}export async function getFeatureReportMarkdown(_0x451540,_0x11412c){const _0x15584a=_0x5d99,_0x1e0535={'JAKZB':_0x15584a(0x1ac),'vjMBA':'sessionId','pRWCw':_0x15584a(0x19c),'EShae':function(_0x56df10,_0xd1676d,_0x54f42a){return _0x56df10(_0xd1676d,_0x54f42a);},'iwISM':_0x15584a(0x1bb)},_0x262fc6=await getToken();if(!_0x262fc6)throw new Error(_0x15584a(0x1ab));const _0x58c9f3=getApiBaseUrl(),_0x43f0e9=new URLSearchParams(),_0x481df5=(_0x11412c?.[_0x15584a(0x1ac)]?.[_0x15584a(0x1c9)]??0x0)>0x0,_0x2733cc=Boolean(_0x11412c?.[_0x15584a(0x193)]);_0x481df5&&_0x11412c?.[_0x15584a(0x1ac)]&&_0x43f0e9['set'](_0x1e0535[_0x15584a(0x19b)],_0x11412c['itemIds']['join'](','));_0x2733cc&&_0x11412c?.[_0x15584a(0x193)]&&_0x43f0e9['set'](_0x1e0535[_0x15584a(0x18a)],_0x11412c['sessionId']);!_0x481df5&&!_0x2733cc&&_0x11412c?.['style']&&_0x43f0e9['set'](_0x1e0535['pRWCw'],_0x11412c['style']);const _0x4e525c=_0x58c9f3+'/api/v1/mcp/features/'+_0x451540+_0x15584a(0x1a5),_0x2511bd=''+_0x4e525c+(_0x43f0e9['toString']()?'?'+_0x43f0e9['toString']():''),_0x111ec0=await _0x1e0535[_0x15584a(0x1b5)](fetch,_0x2511bd,{'method':_0x1e0535['iwISM'],'headers':{'Authorization':_0x15584a(0x194)+_0x262fc6}});if(!_0x111ec0['ok']){const _0x2ab1a5=await _0x111ec0['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x2ab1a5);}return _0x111ec0[_0x15584a(0x1a8)]();}export async function listFeatureSessions(_0x1abb72){const _0x2a2c0f=_0x5d99,_0x3b41b9={'PxYzO':function(_0x5ab921){return _0x5ab921();},'CAMkW':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','vQoNb':function(_0x3e0a4f){return _0x3e0a4f();}},_0xf635ef=await _0x3b41b9['PxYzO'](getToken);if(!_0xf635ef)throw new Error(_0x3b41b9[_0x2a2c0f(0x1a0)]);const _0x597b17=_0x3b41b9['vQoNb'](getApiBaseUrl),_0xcc0bb1=await fetch(_0x597b17+_0x2a2c0f(0x1a2)+_0x1abb72+_0x2a2c0f(0x1a7),{'method':_0x2a2c0f(0x1bb),'headers':{'Authorization':'Bearer\x20'+_0xf635ef}});if(!_0xcc0bb1['ok']){const _0x994184=await _0xcc0bb1[_0x2a2c0f(0x1a8)]();throw new Error(_0x2a2c0f(0x1c3)+_0x994184);}return _0xcc0bb1['json']();}function _0x5d99(_0x407522,_0x204d14){_0x407522=_0x407522-0x185;const _0x1dcafe=_0x1dca();let _0x5d9987=_0x1dcafe[_0x407522];return _0x5d9987;}export async function startSession(_0x586933,_0x306439){const _0x9139f7=_0x5d99,_0x3bf318={'QvYiS':function(_0x595ef2){return _0x595ef2();},'gPtLQ':'POST'},_0x292c54=await getToken();if(!_0x292c54)throw new Error(_0x9139f7(0x1ab));const _0x4189c4=_0x3bf318[_0x9139f7(0x185)](getApiBaseUrl),_0x4078bf=await fetch(_0x4189c4+_0x9139f7(0x1a2)+_0x586933+_0x9139f7(0x199)+_0x306439+_0x9139f7(0x198),{'method':_0x3bf318['gPtLQ'],'headers':{'Authorization':'Bearer\x20'+_0x292c54}});if(!_0x4078bf['ok']){const _0x4d0d04=await _0x4078bf['text']();throw new Error(_0x9139f7(0x19e)+_0x4d0d04);}return _0x4078bf[_0x9139f7(0x1af)]();}export async function concludeSession(_0x3693bf,_0x1a56e7){const _0x54b3a8=_0x5d99,_0x4b8d51={'NpYFt':function(_0x1cba37){return _0x1cba37();},'HsXhs':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x405dd0=await _0x4b8d51['NpYFt'](getToken);if(!_0x405dd0)throw new Error(_0x4b8d51[_0x54b3a8(0x1be)]);const _0x1ea410=getApiBaseUrl(),_0x3ab56d=await fetch(_0x1ea410+'/api/v1/mcp/features/'+_0x3693bf+'/sessions/'+_0x1a56e7+_0x54b3a8(0x195),{'method':_0x54b3a8(0x18b),'headers':{'Authorization':_0x54b3a8(0x194)+_0x405dd0}});if(!_0x3ab56d['ok']){const _0x5493c0=await _0x3ab56d['text']();throw new Error(_0x54b3a8(0x1c6)+_0x5493c0);}return _0x3ab56d[_0x54b3a8(0x1af)]();}export async function getActionItems(_0x13ab0d){const _0x57d2d7=_0x5d99,_0x37c0d9=await getToken();if(!_0x37c0d9)throw new Error(_0x57d2d7(0x1ab));const _0x35e0cf=getApiBaseUrl(),_0x474c5b=await fetch(_0x35e0cf+_0x57d2d7(0x1a2)+_0x13ab0d+'/action-items',{'method':_0x57d2d7(0x1bb),'headers':{'Authorization':_0x57d2d7(0x194)+_0x37c0d9}});if(!_0x474c5b['ok']){const _0x250a3b=await _0x474c5b[_0x57d2d7(0x1a8)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x250a3b);}return _0x474c5b[_0x57d2d7(0x1af)]();}export async function getItemFeedback(_0x323611,_0x5b0e25){const _0x3c2123=_0x5d99,_0x38543b={'oboTY':function(_0x3e7279){return _0x3e7279();},'WosSS':_0x3c2123(0x1ab),'DzLLQ':function(_0x5b36f8){return _0x5b36f8();},'LzCSo':function(_0x2c7813,_0x18760c,_0xe29aa8){return _0x2c7813(_0x18760c,_0xe29aa8);},'dHxyY':'GET'},_0x2dc7d0=await _0x38543b['oboTY'](getToken);if(!_0x2dc7d0)throw new Error(_0x38543b['WosSS']);const _0x20e8d1=_0x38543b[_0x3c2123(0x19a)](getApiBaseUrl),_0xd0e693=await _0x38543b['LzCSo'](fetch,_0x20e8d1+'/api/v1/mcp/features/'+_0x323611+'/checklist-items/'+_0x5b0e25+'/feedback',{'method':_0x38543b['dHxyY'],'headers':{'Authorization':_0x3c2123(0x194)+_0x2dc7d0}});if(!_0xd0e693['ok']){const _0x4787c9=await _0xd0e693[_0x3c2123(0x1a8)]();throw new Error(_0x3c2123(0x19d)+_0x4787c9);}return _0xd0e693[_0x3c2123(0x1af)]();}export async function markCommentsAddressed(_0x1fe847,_0x34fc1e,_0x892cf9){const _0x2c4174=_0x5d99,_0x5e431c={'xCPyN':function(_0x59c7fa){return _0x59c7fa();},'Tuagv':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','Fdkcy':_0x2c4174(0x1aa)},_0x4ab8ba=await _0x5e431c[_0x2c4174(0x1a1)](getToken);if(!_0x4ab8ba)throw new Error(_0x5e431c[_0x2c4174(0x190)]);const _0xe1e1b6=getApiBaseUrl(),_0x1bc18c=await fetch(_0xe1e1b6+'/api/v1/mcp/features/'+_0x1fe847+_0x2c4174(0x1ad),{'method':_0x2c4174(0x18b),'headers':{'Authorization':_0x2c4174(0x194)+_0x4ab8ba,'Content-Type':_0x5e431c[_0x2c4174(0x1c1)]},'body':JSON[_0x2c4174(0x1ca)]({'checklistItemId':_0x34fc1e,'commentIds':_0x892cf9})});if(!_0x1bc18c['ok']){const _0x882617=await _0x1bc18c['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x882617);}}export async function softDeleteFeature(_0x38757a){const _0x130304=_0x5d99,_0x5593af={'ugxIT':_0x130304(0x1ab),'yWYTg':function(_0x1c3d53){return _0x1c3d53();}},_0x6b7e18=await getToken();if(!_0x6b7e18)throw new Error(_0x5593af['ugxIT']);const _0x42bc2e=_0x5593af['yWYTg'](getApiBaseUrl),_0x499db0=await fetch(_0x42bc2e+_0x130304(0x1a2)+_0x38757a,{'method':_0x130304(0x1b6),'headers':{'Authorization':_0x130304(0x194)+_0x6b7e18}});if(!_0x499db0['ok']){const _0x46fbbc=await _0x499db0['text']();throw new Error(_0x130304(0x1b9)+_0x46fbbc);}}export async function restoreFeature(_0x2c6a94){const _0x548cf9=_0x5d99,_0x1da9db={'JKMDI':function(_0x458ed0,_0x2447d4,_0xc4b8c9){return _0x458ed0(_0x2447d4,_0xc4b8c9);}},_0x527957=await getToken();if(!_0x527957)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x24e200=getApiBaseUrl(),_0x518c17=await _0x1da9db['JKMDI'](fetch,_0x24e200+_0x548cf9(0x1a2)+_0x2c6a94+_0x548cf9(0x1bf),{'method':'POST','headers':{'Authorization':_0x548cf9(0x194)+_0x527957}});if(!_0x518c17['ok']){const _0x26c52a=await _0x518c17[_0x548cf9(0x1a8)]();throw new Error(_0x548cf9(0x187)+_0x26c52a);}}
|
|
1
|
+
(function(_0x3f40ed,_0x5b98e9){const _0x4e37d2=_0xe605,_0x1f8268=_0x3f40ed();while(!![]){try{const _0x57436a=-parseInt(_0x4e37d2(0x1b8))/0x1+parseInt(_0x4e37d2(0x1b1))/0x2+parseInt(_0x4e37d2(0x1c5))/0x3+-parseInt(_0x4e37d2(0x1bf))/0x4+-parseInt(_0x4e37d2(0x1b5))/0x5*(parseInt(_0x4e37d2(0x1cd))/0x6)+parseInt(_0x4e37d2(0x1ac))/0x7+-parseInt(_0x4e37d2(0x1aa))/0x8*(-parseInt(_0x4e37d2(0x1d4))/0x9);if(_0x57436a===_0x5b98e9)break;else _0x1f8268['push'](_0x1f8268['shift']());}catch(_0x154b8f){_0x1f8268['push'](_0x1f8268['shift']());}}}(_0xc5c6,0xeb697));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x2dbdd1){const _0x58accf=_0xe605,_0x136e5c={'ttLHf':function(_0x1e5764){return _0x1e5764();},'hNvEY':'https://dashboard.ranger.net/billing'},_0x12bd59=await _0x136e5c['ttLHf'](getToken);if(!_0x12bd59)throw new Error(_0x58accf(0x1c9));const _0x11d730=getApiBaseUrl(),_0x4cab46=await fetch(_0x11d730+'/api/v1/mcp/features',{'method':'POST','headers':{'Authorization':_0x58accf(0x1be)+_0x12bd59,'Content-Type':_0x58accf(0x1bd)},'body':JSON[_0x58accf(0x1e2)](_0x2dbdd1)});if(!_0x4cab46['ok']){if(_0x4cab46['status']===0x192){const _0x1ffaef=await _0x4cab46['json'](),_0x25003c=_0x1ffaef[_0x58accf(0x1a3)]||_0x136e5c[_0x58accf(0x1b6)];throw new Error((_0x1ffaef[_0x58accf(0x1d5)]||_0x58accf(0x1b0))+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x25003c);}const _0x3022fc=await _0x4cab46['text']();throw new Error(_0x58accf(0x1e4)+_0x3022fc);}return _0x4cab46[_0x58accf(0x1a7)]();}export async function listFeatures(_0x4c9009){const _0x565c7a=_0xe605,_0xb70a7f={'VltQT':function(_0x599d56){return _0x599d56();},'VJiQR':_0x565c7a(0x1cc),'uStzO':_0x565c7a(0x1cf),'bbtJQ':'GET'},_0x27a29f=await _0xb70a7f['VltQT'](getToken);if(!_0x27a29f)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5b63cc=getApiBaseUrl(),_0x1c722e=new URLSearchParams();if(_0x4c9009?.[_0x565c7a(0x1d3)])_0x1c722e['set']('gitRepoUrl',_0x4c9009[_0x565c7a(0x1d3)]);if(_0x4c9009?.['gitBranch'])_0x1c722e[_0x565c7a(0x1ae)](_0xb70a7f['VJiQR'],_0x4c9009['gitBranch']);if(_0x4c9009?.['limit'])_0x1c722e[_0x565c7a(0x1ae)](_0x565c7a(0x1cb),_0x4c9009['limit'][_0x565c7a(0x1a6)]());if(_0x4c9009?.['offset'])_0x1c722e['set']('offset',_0x4c9009['offset'][_0x565c7a(0x1a6)]());if(_0x4c9009?.[_0x565c7a(0x1e3)])_0x1c722e[_0x565c7a(0x1ae)](_0x565c7a(0x1e3),_0xb70a7f[_0x565c7a(0x1b3)]);const _0x50e373=_0x5b63cc+'/api/v1/mcp/features'+(_0x1c722e[_0x565c7a(0x1a6)]()?'?'+_0x1c722e['toString']():''),_0x36b3a6=await fetch(_0x50e373,{'method':_0xb70a7f['bbtJQ'],'headers':{'Authorization':'Bearer\x20'+_0x27a29f}});if(!_0x36b3a6['ok']){const _0x429d29=await _0x36b3a6['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x429d29);}return _0x36b3a6[_0x565c7a(0x1a7)]();}export async function getFeature(_0x53b9eb){const _0x5075fb=_0xe605,_0x244632={'QWBTb':function(_0x294c8e){return _0x294c8e();}},_0x51fa1a=await getToken();if(!_0x51fa1a)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x318a50=_0x244632['QWBTb'](getApiBaseUrl),_0x15a5ee=await fetch(_0x318a50+_0x5075fb(0x1e5)+_0x53b9eb,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x51fa1a}});if(!_0x15a5ee['ok']){const _0x13cdbf=await _0x15a5ee[_0x5075fb(0x1ce)]();throw new Error(_0x5075fb(0x1ad)+_0x13cdbf);}return _0x15a5ee[_0x5075fb(0x1a7)]();}export async function updateFeature(_0x222be5,_0x4a93b2){const _0x2f22d6=_0xe605,_0x138596={'kAaNv':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','vTOUU':function(_0x2804c0){return _0x2804c0();},'JbIIA':_0x2f22d6(0x1dc)},_0x1e6d84=await getToken();if(!_0x1e6d84)throw new Error(_0x138596['kAaNv']);const _0x1e9a67=_0x138596[_0x2f22d6(0x1e1)](getApiBaseUrl),_0x14faeb=await fetch(_0x1e9a67+_0x2f22d6(0x1e5)+_0x222be5,{'method':_0x138596[_0x2f22d6(0x1a0)],'headers':{'Authorization':_0x2f22d6(0x1be)+_0x1e6d84,'Content-Type':_0x2f22d6(0x1bd)},'body':JSON[_0x2f22d6(0x1e2)](_0x4a93b2)});if(!_0x14faeb['ok']){const _0x47c85b=await _0x14faeb['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x47c85b);}return _0x14faeb['json']();}export async function createChecklistItem(_0x4442b8,_0x2d6653,_0x8568dc){const _0xab9f54=_0xe605,_0x2358d3={'pjTsj':function(_0x47c745,_0x5caf59,_0x5ee4e8){return _0x47c745(_0x5caf59,_0x5ee4e8);},'HplaC':'POST'},_0xd6998e=await getToken();if(!_0xd6998e)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x399d47=getApiBaseUrl(),_0x555cf0=await _0x2358d3[_0xab9f54(0x1ba)](fetch,_0x399d47+_0xab9f54(0x1e5)+_0x4442b8+_0xab9f54(0x1c6),{'method':_0x2358d3[_0xab9f54(0x1c7)],'headers':{'Authorization':_0xab9f54(0x1be)+_0xd6998e,'Content-Type':_0xab9f54(0x1bd)},'body':JSON[_0xab9f54(0x1e2)]({'description':_0x2d6653,'position':_0x8568dc})});if(!_0x555cf0['ok']){const _0x2d7a58=await _0x555cf0[_0xab9f54(0x1ce)]();throw new Error(_0xab9f54(0x1c1)+_0x2d7a58);}return _0x555cf0[_0xab9f54(0x1a7)]();}export async function updateChecklistItem(_0x57b3a7,_0xedddbe,_0x2342a5){const _0x2c4840=_0xe605,_0x18d2d3={'oLzpB':_0x2c4840(0x1c9),'fKkgv':function(_0x18bca5){return _0x18bca5();},'iPPgb':function(_0x2ce2c7,_0x5cf0bb,_0x23c667){return _0x2ce2c7(_0x5cf0bb,_0x23c667);},'GrxcN':'updateChecklistItem'};return _0x18d2d3[_0x2c4840(0x1d0)](withRetry,async()=>{const _0xd0be26=_0x2c4840,_0x250b72=await getToken();if(!_0x250b72)throw new Error(_0x18d2d3[_0xd0be26(0x1b9)]);const _0x1570ad=_0x18d2d3[_0xd0be26(0x1ca)](getApiBaseUrl),_0x33db29=await fetch(_0x1570ad+'/api/v1/mcp/features/'+_0x57b3a7+'/checklist/'+_0xedddbe,{'method':'PATCH','headers':{'Authorization':'Bearer\x20'+_0x250b72,'Content-Type':_0xd0be26(0x1bd)},'body':JSON[_0xd0be26(0x1e2)](_0x2342a5)});if(!_0x33db29['ok']){const _0x8eeca8=await _0x33db29[_0xd0be26(0x1ce)]();throw new Error(_0xd0be26(0x1d8)+_0x8eeca8);}return _0x33db29['json']();},{'label':_0x18d2d3[_0x2c4840(0x1de)]});}export async function getFeatureReport(_0x541992){const _0x2fa262=_0xe605,_0x3a27ef={'uBaJO':function(_0x26195d){return _0x26195d();},'ApotS':_0x2fa262(0x1c9),'ZzJqd':function(_0x523e27){return _0x523e27();},'wKgLZ':_0x2fa262(0x1d9)},_0x416672=await _0x3a27ef['uBaJO'](getToken);if(!_0x416672)throw new Error(_0x3a27ef['ApotS']);const _0x18330e=_0x3a27ef['ZzJqd'](getApiBaseUrl),_0x78446a=await fetch(_0x18330e+_0x2fa262(0x1e5)+_0x541992+'/report',{'method':_0x3a27ef[_0x2fa262(0x1bc)],'headers':{'Authorization':_0x2fa262(0x1be)+_0x416672}});if(!_0x78446a['ok']){const _0x37bd5d=await _0x78446a[_0x2fa262(0x1ce)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x37bd5d);}return _0x78446a[_0x2fa262(0x1a7)]();}export async function getFeatureReportMarkdown(_0x1fbb9a,_0xff4cdf){const _0x1d043b=_0xe605,_0x3394ad={'NpDzh':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','UFLku':function(_0x40a60a,_0x175c25){return _0x40a60a>_0x175c25;},'DOXtH':'itemIds','Gloxz':function(_0x573480,_0x2d784a){return _0x573480&&_0x2d784a;},'aEWKZ':_0x1d043b(0x1c8),'ihvQy':function(_0x170f5b,_0xa83fde,_0x22880c){return _0x170f5b(_0xa83fde,_0x22880c);},'ZreJb':_0x1d043b(0x1d9)},_0x1f8bc4=await getToken();if(!_0x1f8bc4)throw new Error(_0x3394ad[_0x1d043b(0x1a4)]);const _0x3cc9a3=getApiBaseUrl(),_0x1489d6=new URLSearchParams(),_0x5a1199=_0x3394ad['UFLku'](_0xff4cdf?.[_0x1d043b(0x1e0)]?.[_0x1d043b(0x1da)]??0x0,0x0),_0x357615=Boolean(_0xff4cdf?.[_0x1d043b(0x1a1)]);_0x5a1199&&_0xff4cdf?.[_0x1d043b(0x1e0)]&&_0x1489d6['set'](_0x3394ad['DOXtH'],_0xff4cdf[_0x1d043b(0x1e0)][_0x1d043b(0x1bb)](','));_0x357615&&_0xff4cdf?.['sessionId']&&_0x1489d6[_0x1d043b(0x1ae)](_0x1d043b(0x1a1),_0xff4cdf[_0x1d043b(0x1a1)]);_0x3394ad[_0x1d043b(0x1a5)](!_0x5a1199,!_0x357615)&&_0xff4cdf?.[_0x1d043b(0x1c8)]&&_0x1489d6['set'](_0x3394ad[_0x1d043b(0x1d6)],_0xff4cdf['style']);const _0x4bd250=_0x3cc9a3+'/api/v1/mcp/features/'+_0x1fbb9a+'/report/markdown',_0x2a162d=''+_0x4bd250+(_0x1489d6[_0x1d043b(0x1a6)]()?'?'+_0x1489d6['toString']():''),_0x43ec21=await _0x3394ad[_0x1d043b(0x1b4)](fetch,_0x2a162d,{'method':_0x3394ad[_0x1d043b(0x1a2)],'headers':{'Authorization':_0x1d043b(0x1be)+_0x1f8bc4}});if(!_0x43ec21['ok']){const _0x4a04c0=await _0x43ec21['text']();throw new Error(_0x1d043b(0x1c0)+_0x4a04c0);}return _0x43ec21['text']();}export async function listFeatureSessions(_0x6ef58d){const _0x1b255c=_0xe605,_0x2a7a8f={'XCUAS':function(_0x5688e5){return _0x5688e5();},'FYukR':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','qNmcd':'GET'},_0x121cc2=await _0x2a7a8f['XCUAS'](getToken);if(!_0x121cc2)throw new Error(_0x2a7a8f['FYukR']);const _0x3a368b=getApiBaseUrl(),_0x1ca526=await fetch(_0x3a368b+_0x1b255c(0x1e5)+_0x6ef58d+'/sessions',{'method':_0x2a7a8f['qNmcd'],'headers':{'Authorization':'Bearer\x20'+_0x121cc2}});if(!_0x1ca526['ok']){const _0x39d9de=await _0x1ca526['text']();throw new Error(_0x1b255c(0x1b2)+_0x39d9de);}return _0x1ca526[_0x1b255c(0x1a7)]();}export async function startSession(_0x2f7c3e,_0x5ef68a){const _0x18df5d=_0xe605,_0x50e69b={'zCSWf':function(_0x1ffc97){return _0x1ffc97();},'yYjkJ':function(_0x37cd07,_0x59819c,_0x1a4fe9){return _0x37cd07(_0x59819c,_0x1a4fe9);}},_0x5f540b=await _0x50e69b[_0x18df5d(0x1b7)](getToken);if(!_0x5f540b)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x422223=getApiBaseUrl(),_0x3baf59=await _0x50e69b[_0x18df5d(0x1d2)](fetch,_0x422223+_0x18df5d(0x1e5)+_0x2f7c3e+_0x18df5d(0x1c4)+_0x5ef68a+'/start',{'method':_0x18df5d(0x1af),'headers':{'Authorization':_0x18df5d(0x1be)+_0x5f540b}});if(!_0x3baf59['ok']){const _0x2e340c=await _0x3baf59[_0x18df5d(0x1ce)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x2e340c);}return _0x3baf59[_0x18df5d(0x1a7)]();}export async function concludeSession(_0x5cc423,_0x18104b){const _0xa02795=_0xe605,_0x4c4239={'XVDnZ':function(_0x2989c9){return _0x2989c9();},'caOjI':function(_0x3adef0){return _0x3adef0();},'TDaEV':function(_0x4211a7,_0x547394,_0x2c197e){return _0x4211a7(_0x547394,_0x2c197e);}},_0x370708=await _0x4c4239['XVDnZ'](getToken);if(!_0x370708)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x25d3d9=_0x4c4239['caOjI'](getApiBaseUrl),_0x1b05ac=await _0x4c4239['TDaEV'](fetch,_0x25d3d9+'/api/v1/mcp/features/'+_0x5cc423+_0xa02795(0x1c4)+_0x18104b+'/conclude',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x370708}});if(!_0x1b05ac['ok']){const _0x502286=await _0x1b05ac[_0xa02795(0x1ce)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x502286);}return _0x1b05ac['json']();}export async function getActionItems(_0x31e205){const _0x283e16=_0xe605,_0x3484ed={'upHSL':function(_0x551b3e,_0x204875,_0x18269b){return _0x551b3e(_0x204875,_0x18269b);},'KBuZm':_0x283e16(0x1d9)},_0x515809=await getToken();if(!_0x515809)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5cd321=getApiBaseUrl(),_0x49a901=await _0x3484ed['upHSL'](fetch,_0x5cd321+'/api/v1/mcp/features/'+_0x31e205+_0x283e16(0x1df),{'method':_0x3484ed['KBuZm'],'headers':{'Authorization':_0x283e16(0x1be)+_0x515809}});if(!_0x49a901['ok']){const _0x7ead99=await _0x49a901[_0x283e16(0x1ce)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x7ead99);}return _0x49a901['json']();}export async function getItemFeedback(_0x3cadfa,_0x1184e6){const _0x594328=_0xe605,_0x2aa4fd={'HANVU':function(_0x550a0a){return _0x550a0a();},'TKIaL':function(_0x35becf,_0x30c964,_0x2cc657){return _0x35becf(_0x30c964,_0x2cc657);},'irQXz':_0x594328(0x1d9)},_0x118c70=await _0x2aa4fd['HANVU'](getToken);if(!_0x118c70)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x75d15e=getApiBaseUrl(),_0x342cb8=await _0x2aa4fd['TKIaL'](fetch,_0x75d15e+'/api/v1/mcp/features/'+_0x3cadfa+_0x594328(0x1dd)+_0x1184e6+'/feedback',{'method':_0x2aa4fd[_0x594328(0x1ab)],'headers':{'Authorization':'Bearer\x20'+_0x118c70}});if(!_0x342cb8['ok']){const _0x3d4efd=await _0x342cb8[_0x594328(0x1ce)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x3d4efd);}return _0x342cb8[_0x594328(0x1a7)]();}export async function markCommentsAddressed(_0x520c29,_0x2d264c,_0x30dd65){const _0x15b1cf=_0xe605,_0x1192de={'JKvuM':function(_0x869a2e){return _0x869a2e();},'IYrvM':'POST'},_0x584802=await _0x1192de[_0x15b1cf(0x1d1)](getToken);if(!_0x584802)throw new Error(_0x15b1cf(0x1c9));const _0x4ff116=getApiBaseUrl(),_0x506481=await fetch(_0x4ff116+_0x15b1cf(0x1e5)+_0x520c29+_0x15b1cf(0x1a8),{'method':_0x1192de[_0x15b1cf(0x1c3)],'headers':{'Authorization':_0x15b1cf(0x1be)+_0x584802,'Content-Type':'application/json'},'body':JSON['stringify']({'checklistItemId':_0x2d264c,'commentIds':_0x30dd65})});if(!_0x506481['ok']){const _0x4ebb4f=await _0x506481[_0x15b1cf(0x1ce)]();throw new Error(_0x15b1cf(0x1c2)+_0x4ebb4f);}}function _0xe605(_0x51aeb0,_0x21caed){_0x51aeb0=_0x51aeb0-0x1a0;const _0xc5c65=_0xc5c6();let _0xe6053e=_0xc5c65[_0x51aeb0];return _0xe6053e;}export async function softDeleteFeature(_0x1182a1){const _0x4767fc=_0xe605,_0x1f98b0={'FbgIe':function(_0x1e797c){return _0x1e797c();},'hUHqH':_0x4767fc(0x1c9),'RtPkG':'DELETE'},_0x488d99=await _0x1f98b0[_0x4767fc(0x1db)](getToken);if(!_0x488d99)throw new Error(_0x1f98b0['hUHqH']);const _0x2e105f=getApiBaseUrl(),_0x46b946=await fetch(_0x2e105f+_0x4767fc(0x1e5)+_0x1182a1,{'method':_0x1f98b0['RtPkG'],'headers':{'Authorization':'Bearer\x20'+_0x488d99}});if(!_0x46b946['ok']){const _0x35db87=await _0x46b946['text']();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x35db87);}}export async function restoreFeature(_0x54cf3e){const _0x344e36=_0xe605,_0x27698b={'iaPfD':function(_0x5805a6){return _0x5805a6();},'NDEqJ':function(_0xcaeeba,_0x496a89,_0x59a959){return _0xcaeeba(_0x496a89,_0x59a959);},'YEnsP':'POST'},_0x1ccce4=await getToken();if(!_0x1ccce4)throw new Error(_0x344e36(0x1c9));const _0x2c23d8=_0x27698b['iaPfD'](getApiBaseUrl),_0x11aab6=await _0x27698b[_0x344e36(0x1a9)](fetch,_0x2c23d8+_0x344e36(0x1e5)+_0x54cf3e+'/restore',{'method':_0x27698b[_0x344e36(0x1d7)],'headers':{'Authorization':'Bearer\x20'+_0x1ccce4}});if(!_0x11aab6['ok']){const _0x2b318d=await _0x11aab6['text']();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x2b318d);}}function _0xc5c6(){const _0x22841d=['530NfZVAK','hNvEY','zCSWf','239332kIZoKH','oLzpB','pjTsj','join','wKgLZ','application/json','Bearer\x20','5679080twuQev','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','Failed\x20to\x20create\x20scenario:\x20','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','IYrvM','/sessions/','1914186LYHgLW','/checklist','HplaC','style','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','fKkgv','limit','gitBranch','96948BvgJnz','text','true','iPPgb','JKvuM','yYjkJ','gitRepoUrl','18xAJYdG','message','aEWKZ','YEnsP','Failed\x20to\x20update\x20scenario:\x20','GET','length','FbgIe','PATCH','/checklist-items/','GrxcN','/action-items','itemIds','vTOUU','stringify','includeDeleted','Failed\x20to\x20create\x20feature\x20review:\x20','/api/v1/mcp/features/','JbIIA','sessionId','ZreJb','billingUrl','NpDzh','Gloxz','toString','json','/comments/address','NDEqJ','1732552uwWHxx','irQXz','10305099qbRFdJ','Failed\x20to\x20get\x20feature\x20review:\x20','set','POST','Feature\x20limit\x20exceeded','3585480mbFluN','Failed\x20to\x20list\x20sessions:\x20','uStzO','ihvQy'];_0xc5c6=function(){return _0x22841d;};return _0xc5c6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x51ab(){const _0x48caa6=['dataSize','2976phmFvW','jZQoi','from','SeSbf','XPenz','KHady','MtIRK','10568383QpDGKq','DvzhQ','8351752sSJvmh','euTsy','floor','fwMrU','lyhdh','55IgNuLL','cCyJk','GZaVG','error','9CdRVnD','yRARI','zbLZQ','offset','tjtlf','slice','zFQMr','vqIpv','foUrS','FSfIa','HKtBS','dZdBu','xUsPW','UOGTx','rDTAn','length','concat','918003MHkjAW','ltutB','endsWith','File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.','YidWB','Could\x20not\x20find\x20Info\x20element','alloc','RyfFR','pow','argv','nCQoL','9690iZlUCY','keQyI','fixWebmDuration.js','WXnrU','VtnFI','writeDoubleBE','3288210ZYCoeI','tfGZU','sizeLen','108OUHBXo','126123XUGoqY','Tnrbn','readInt16BE','veEmV','yjKUi','dataOffset','jHmTz','GCDDU','Inlsf','78050cqoldK','tVRzH'];_0x51ab=function(){return _0x48caa6;};return _0x51ab();}const _0x583f8c=_0x1e5f;(function(_0x17d24c,_0xcf3efe){const _0x4223c4=_0x1e5f,_0x3634e9=_0x17d24c();while(!![]){try{const _0x56515c=parseInt(_0x4223c4(0x1ca))/0x1+-parseInt(_0x4223c4(0x1db))/0x2+parseInt(_0x4223c4(0x1df))/0x3*(parseInt(_0x4223c4(0x1de))/0x4)+-parseInt(_0x4223c4(0x1d5))/0x5*(-parseInt(_0x4223c4(0x1a7))/0x6)+-parseInt(_0x4223c4(0x1ae))/0x7+-parseInt(_0x4223c4(0x1b0))/0x8*(-parseInt(_0x4223c4(0x1b9))/0x9)+parseInt(_0x4223c4(0x1a4))/0xa*(-parseInt(_0x4223c4(0x1b5))/0xb);if(_0x56515c===_0xcf3efe)break;else _0x3634e9['push'](_0x3634e9['shift']());}catch(_0x5788b9){_0x3634e9['push'](_0x3634e9['shift']());}}}(_0x51ab,0xd3494));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(_0x26e5d2,_0x45e795){const _0x51136e=_0x1e5f,_0x415093={'wpTSc':function(_0x308533,_0x18587c){return _0x308533>=_0x18587c;},'KZJEZ':function(_0x503ad4,_0x1e55a7){return _0x503ad4&_0x1e55a7;},'SeSbf':function(_0x52b612,_0x1ece40){return _0x52b612<_0x1ece40;},'LfzLB':function(_0x942fab,_0x391755){return _0x942fab*_0x391755;}};if(_0x415093['wpTSc'](_0x45e795,_0x26e5d2['length']))return[0x0,0x0];const _0x448635=_0x26e5d2[_0x45e795];let _0x51da00=0x1,_0x33c774=0x80;while(_0x51da00<=0x8&&!(_0x448635&_0x33c774)){_0x51da00++,_0x33c774>>=0x1;}if(_0x45e795+_0x51da00>_0x26e5d2['length'])return[0x0,0x0];let _0xe4cf6b=_0x415093['KZJEZ'](_0x448635,_0x33c774-0x1);for(let _0x1748b6=0x1;_0x415093[_0x51136e(0x1aa)](_0x1748b6,_0x51da00);_0x1748b6++){_0xe4cf6b=_0x415093['LfzLB'](_0xe4cf6b,0x100)+_0x26e5d2[_0x45e795+_0x1748b6];}return[_0xe4cf6b,_0x51da00];}function readId(_0x415c52,_0x54b722){const _0x31a0b8=_0x1e5f,_0x16e7d1={'sMhuD':function(_0xd9056c,_0x80a6bf){return _0xd9056c>_0x80a6bf;},'fwMrU':function(_0x52d929,_0x49e147){return _0x52d929+_0x49e147;},'RyfFR':function(_0x228bd5,_0x3581ad){return _0x228bd5*_0x3581ad;},'XPenz':function(_0x3914b,_0x351616){return _0x3914b+_0x351616;}};if(_0x54b722>=_0x415c52['length'])return[0x0,0x0];const _0x9dd9d4=_0x415c52[_0x54b722];let _0x125c62;if(_0x9dd9d4>=0x80)_0x125c62=0x1;else{if(_0x9dd9d4>=0x40)_0x125c62=0x2;else{if(_0x9dd9d4>=0x20)_0x125c62=0x3;else{if(_0x9dd9d4>=0x10)_0x125c62=0x4;else return[_0x9dd9d4,0x1];}}}if(_0x16e7d1['sMhuD'](_0x16e7d1[_0x31a0b8(0x1b3)](_0x54b722,_0x125c62),_0x415c52['length']))return[0x0,0x0];let _0x2a7293=0x0;for(let _0x22f694=0x0;_0x22f694<_0x125c62;_0x22f694++){_0x2a7293=_0x16e7d1[_0x31a0b8(0x1d1)](_0x2a7293,0x100)+_0x415c52[_0x16e7d1[_0x31a0b8(0x1ab)](_0x54b722,_0x22f694)];}return[_0x2a7293,_0x125c62];}function readUint(_0x2dc24a,_0x2b80b5,_0x200e3c){const _0x45197f={'ZlNWI':function(_0x1efb48,_0x48fe9e){return _0x1efb48<_0x48fe9e;},'BJNPa':function(_0x27f2ee,_0x1842d2){return _0x27f2ee+_0x1842d2;}};let _0x1c0761=0x0;for(let _0x27080d=0x0;_0x45197f['ZlNWI'](_0x27080d,_0x200e3c);_0x27080d++){_0x1c0761=_0x45197f['BJNPa'](_0x1c0761*0x100,_0x2dc24a[_0x45197f['BJNPa'](_0x2b80b5,_0x27080d)]);}return _0x1c0761;}function isUnknownSize(_0x25e4a6,_0x39306f){const _0x1f5f31=_0x1e5f,_0x2c104b={'jZQoi':function(_0x5ea1b1,_0xc6c025){return _0x5ea1b1===_0xc6c025;}};return _0x2c104b[_0x1f5f31(0x1a8)](_0x25e4a6,Math[_0x1f5f31(0x1d2)](0x2,0x7*_0x39306f)-0x1);}function writeId(_0x228079){const _0xdfed1a=_0x1e5f,_0x360004={'GZaVG':function(_0x129f6f,_0x2ee5f5){return _0x129f6f<=_0x2ee5f5;},'xKbqa':function(_0x198d47,_0x3bd4bc){return _0x198d47<=_0x3bd4bc;},'xUsPW':function(_0x32b37d,_0x279cf5){return _0x32b37d&_0x279cf5;},'euTsy':function(_0x39260b,_0x2de125){return _0x39260b>>_0x2de125;},'tfGZU':function(_0x479cfe,_0x2dc385){return _0x479cfe>>_0x2dc385;},'eBNJz':function(_0x12aa38,_0x3542fe){return _0x12aa38&_0x3542fe;}};if(_0x360004[_0xdfed1a(0x1b7)](_0x228079,0xff))return Buffer[_0xdfed1a(0x1a9)]([_0x228079]);if(_0x360004['xKbqa'](_0x228079,0xffff))return Buffer[_0xdfed1a(0x1a9)]([_0x228079>>0x8&0xff,_0x360004[_0xdfed1a(0x1c5)](_0x228079,0xff)]);if(_0x228079<=0xffffff)return Buffer['from']([_0x360004[_0xdfed1a(0x1c5)](_0x360004[_0xdfed1a(0x1b1)](_0x228079,0x10),0xff),_0x360004[_0xdfed1a(0x1c5)](_0x360004[_0xdfed1a(0x1dc)](_0x228079,0x8),0xff),_0x360004[_0xdfed1a(0x1c5)](_0x228079,0xff)]);return Buffer[_0xdfed1a(0x1a9)]([_0x360004['xUsPW'](_0x228079>>0x18,0xff),_0x228079>>0x10&0xff,_0x360004['tfGZU'](_0x228079,0x8)&0xff,_0x360004['eBNJz'](_0x228079,0xff)]);}function writeVint(_0x4bd7a1,_0x269ef2){const _0xc1253b=_0x1e5f,_0x54cb43={'FRMPY':function(_0x51dec8,_0x31ded9){return _0x51dec8||_0x31ded9;},'cCyJk':function(_0x3d4b84,_0x3e54dd){return _0x3d4b84<_0x3e54dd;},'Inlsf':function(_0x145b27,_0x857b67){return _0x145b27-_0x857b67;},'HKtBS':function(_0x4ce679,_0x1cc09b){return _0x4ce679*_0x1cc09b;},'QEFzF':function(_0x4b9474,_0xb43bbc){return _0x4b9474&_0xb43bbc;}};let _0x2e87ef=_0x54cb43['FRMPY'](_0x269ef2,0x1);while(_0x54cb43[_0xc1253b(0x1b6)](_0x54cb43[_0xc1253b(0x1a3)](Math['pow'](0x2,_0x54cb43[_0xc1253b(0x1c3)](0x7,_0x2e87ef)),0x2),_0x4bd7a1))_0x2e87ef++;const _0x37adbb=Buffer['alloc'](_0x2e87ef);for(let _0x21bff2=_0x2e87ef-0x1;_0x21bff2>=0x0;_0x21bff2--){_0x37adbb[_0x21bff2]=_0x54cb43['QEFzF'](_0x4bd7a1,0xff),_0x4bd7a1=Math[_0xc1253b(0x1b2)](_0x4bd7a1/0x100);}return _0x37adbb[0x0]|=0x1<<0x8-_0x2e87ef,_0x37adbb;}function writeFloat64(_0x57d7a1){const _0x27d57a=_0x1e5f,_0x5afd7e=Buffer[_0x27d57a(0x1d0)](0x8);return _0x5afd7e[_0x27d57a(0x1da)](_0x57d7a1,0x0),_0x5afd7e;}function writeVoid(_0x1a3a6b){const _0x527ee0=_0x1e5f,_0x480a37={'vqIpv':function(_0x933382,_0x55e13f){return _0x933382<=_0x55e13f;},'tjtlf':function(_0x1eaf4a,_0x1c9866){return _0x1eaf4a-_0x1c9866;}};for(let _0x22e7a1=0x1;_0x480a37[_0x527ee0(0x1c0)](_0x22e7a1,0x8);_0x22e7a1++){const _0x3ed523=_0x1a3a6b-0x1-_0x22e7a1;if(_0x3ed523>=0x0&&_0x3ed523<=_0x480a37[_0x527ee0(0x1bd)](Math[_0x527ee0(0x1d2)](0x2,0x7*_0x22e7a1),0x2))return Buffer['concat']([Buffer['from']([ID_VOID]),writeVint(_0x3ed523,_0x22e7a1),Buffer['alloc'](_0x3ed523)]);}return Buffer[_0x527ee0(0x1d0)](0x0);}function findElement(_0x4bf26c,_0x548dc8,_0xd99596,_0x1841d4){const _0x2ea7f1=_0x1e5f,_0x2b5fe4={'keQyI':function(_0x1aa78a,_0x2cd216){return _0x1aa78a<_0x2cd216;},'dZdBu':function(_0x5f23c6,_0x538f21){return _0x5f23c6+_0x538f21;},'nCQoL':function(_0x2002c1,_0x3c9bbd){return _0x2002c1+_0x3c9bbd;}};let _0x251141=_0x548dc8;while(_0x2b5fe4[_0x2ea7f1(0x1d6)](_0x251141,_0xd99596)){const [_0x5d2167,_0x48249d]=readId(_0x4bf26c,_0x251141),[_0x3213f7,_0x49423e]=readVint(_0x4bf26c,_0x2b5fe4[_0x2ea7f1(0x1c4)](_0x251141,_0x48249d));if(_0x5d2167===_0x1841d4)return{'offset':_0x251141,'idLen':_0x48249d,'sizeLen':_0x49423e,'dataSize':_0x3213f7,'dataOffset':_0x251141+_0x48249d+_0x49423e};if(isUnknownSize(_0x3213f7,_0x49423e))break;_0x251141+=_0x2b5fe4[_0x2ea7f1(0x1d4)](_0x48249d,_0x49423e)+_0x3213f7;}return null;}function computeDurationMs(_0xe5cc9c,_0x482f3c){const _0x2c0063=_0x1e5f,_0x52138a={'MtIRK':function(_0x5b7227,_0x583f55){return _0x5b7227===_0x583f55;},'tlDaq':function(_0x12a124,_0x5d06ae,_0x38d207){return _0x12a124(_0x5d06ae,_0x38d207);},'jHmTz':function(_0x5ec46a,_0xf19bfc){return _0x5ec46a+_0xf19bfc;},'BqKCG':function(_0x517c4c,_0x2c69c1){return _0x517c4c+_0x2c69c1;},'Tnrbn':function(_0x3c21ba,_0x5e0e3c,_0x132544){return _0x3c21ba(_0x5e0e3c,_0x132544);},'zFQMr':function(_0x2d841f,_0x5b9b03){return _0x2d841f<_0x5b9b03;},'tVRzH':function(_0x413984,_0x11c62f,_0x47c92c){return _0x413984(_0x11c62f,_0x47c92c);},'VtnFI':function(_0x305325,_0x2e1f12,_0xbda2c2){return _0x305325(_0x2e1f12,_0xbda2c2);},'yjKUi':function(_0x49f723,_0x37ca49){return _0x49f723===_0x37ca49;},'yRARI':function(_0x3be543,_0x4d5267){return _0x3be543+_0x4d5267;},'YSMdH':function(_0x3b5b6c,_0x148474,_0x559817){return _0x3b5b6c(_0x148474,_0x559817);},'WXnrU':function(_0x3bb7f3,_0x20bb9f){return _0x3bb7f3*_0x20bb9f;},'chfDf':function(_0xceccc3,_0x121303){return _0xceccc3>_0x121303;},'foUrS':function(_0x2cdfbe,_0x40a933){return _0x2cdfbe===_0x40a933;}};let _0x1717d2=0x0;const _0x1fecb6=Buffer[_0x2c0063(0x1a9)]([0x1f,0x43,0xb6,0x75]);let _0x2629ee=_0xe5cc9c['indexOf'](_0x1fecb6);if(_0x52138a[_0x2c0063(0x1ad)](_0x2629ee,-0x1))return 0x0;while(_0x2629ee<_0xe5cc9c[_0x2c0063(0x1c8)]){const [_0x13ade6,_0x2b608f]=readId(_0xe5cc9c,_0x2629ee);if(_0x13ade6!==ID_CLUSTER)break;const [_0x43383b,_0x5ef234]=_0x52138a['tlDaq'](readVint,_0xe5cc9c,_0x52138a['jHmTz'](_0x2629ee,_0x2b608f)),_0x5c915a=_0x52138a[_0x2c0063(0x1a1)](_0x52138a['BqKCG'](_0x2629ee,_0x2b608f),_0x5ef234),_0x127c39=_0x52138a[_0x2c0063(0x1e0)](isUnknownSize,_0x43383b,_0x5ef234);let _0x546af3;if(_0x127c39){let _0x39cd4d=_0x5c915a;while(_0x52138a[_0x2c0063(0x1bf)](_0x39cd4d,_0xe5cc9c[_0x2c0063(0x1c8)]-0x4)){const [_0x308459,_0xf1aa0a]=readId(_0xe5cc9c,_0x39cd4d);if(_0x308459===ID_CLUSTER){_0x546af3=_0x39cd4d;break;}const [_0x234491,_0x5d5c07]=readVint(_0xe5cc9c,_0x39cd4d+_0xf1aa0a);if(_0x52138a['tVRzH'](isUnknownSize,_0x234491,_0x5d5c07)){_0x546af3=_0xe5cc9c['length'];break;}_0x39cd4d+=_0xf1aa0a+_0x5d5c07+_0x234491;}_0x546af3??=_0xe5cc9c[_0x2c0063(0x1c8)];}else _0x546af3=_0x5c915a+_0x43383b;let _0x569166=0x0,_0x3e28ab=_0x5c915a;while(_0x3e28ab<_0x546af3){const [_0x21e9a7,_0x551a9d]=_0x52138a[_0x2c0063(0x1d9)](readId,_0xe5cc9c,_0x3e28ab),[_0x130fb4,_0x4fbfd0]=readVint(_0xe5cc9c,_0x3e28ab+_0x551a9d);if(_0x52138a['yjKUi'](_0x21e9a7,ID_TIMESTAMP))_0x569166=readUint(_0xe5cc9c,_0x3e28ab+_0x551a9d+_0x4fbfd0,_0x130fb4);else{if(_0x52138a[_0x2c0063(0x19f)](_0x21e9a7,ID_SIMPLE_BLOCK)&&_0x130fb4>=0x4){const _0x1c5435=_0x52138a[_0x2c0063(0x1ba)](_0x3e28ab+_0x551a9d,_0x4fbfd0),[,_0x548786]=_0x52138a['YSMdH'](readVint,_0xe5cc9c,_0x1c5435),_0x22b6a3=_0xe5cc9c[_0x2c0063(0x1e1)](_0x1c5435+_0x548786),_0xc76e=_0x52138a[_0x2c0063(0x1d8)](_0x569166+_0x22b6a3,_0x482f3c)/0xf4240;_0x52138a['chfDf'](_0xc76e,_0x1717d2)&&(_0x1717d2=_0xc76e);}else{if(_0x52138a[_0x2c0063(0x1c1)](_0x21e9a7,ID_CLUSTER))break;}}if(_0x52138a[_0x2c0063(0x1a5)](isUnknownSize,_0x130fb4,_0x4fbfd0))break;_0x3e28ab+=_0x52138a['jHmTz'](_0x551a9d+_0x4fbfd0,_0x130fb4);}_0x2629ee=_0x546af3;}return _0x1717d2;}export function fixWebmDuration(_0x4d8001,_0x20e6d4){const _0x24e611=_0x1e5f,_0x351301={'iPRJy':function(_0x340905,_0x1f129a){return _0x340905!==_0x1f129a;},'XaRaG':'Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','zbLZQ':function(_0x2009a1,_0x28a4a8,_0x32f0ff){return _0x2009a1(_0x28a4a8,_0x32f0ff);},'lyhdh':function(_0x4a22bd,_0x1d27e0){return _0x4a22bd+_0x1d27e0;},'KHady':function(_0x3fd75a,_0x5be6e1){return _0x3fd75a===_0x5be6e1;},'veEmV':function(_0x1f4af8,_0x473d39){return _0x1f4af8+_0x473d39;},'DvzhQ':function(_0x1e3dd2,_0x15c457){return _0x1e3dd2+_0x15c457;},'YidWB':function(_0x5a8b25,_0x31db9f,_0x26167d){return _0x5a8b25(_0x31db9f,_0x26167d);},'ltutB':function(_0x7c8b0,_0x8b9453){return _0x7c8b0+_0x8b9453;},'GCDDU':function(_0x165fd2,_0x4926a7){return _0x165fd2+_0x4926a7;},'tATCV':function(_0x5b8bc9,_0x4ca098){return _0x5b8bc9+_0x4ca098;},'FSfIa':function(_0x3597dd,_0x126d4b,_0x4a4f55){return _0x3597dd(_0x126d4b,_0x4a4f55);},'zebVs':function(_0x5cb422,_0x345c72){return _0x5cb422/_0x345c72;},'UOGTx':function(_0x3bd470,_0x528f82){return _0x3bd470(_0x528f82);},'utKZD':function(_0x19463d,_0x93f94f){return _0x19463d-_0x93f94f;},'fdyup':function(_0x1d709b,_0x248a63){return _0x1d709b<_0x248a63;},'EOXLR':function(_0x517c7d,_0x4443cb){return _0x517c7d(_0x4443cb);},'BBFlM':function(_0x5510d1,_0x14b0e2,_0x4c713d){return _0x5510d1(_0x14b0e2,_0x4c713d);},'rDTAn':function(_0x5dbcbb,_0x5c422a){return _0x5dbcbb(_0x5c422a);},'sHuaM':function(_0x3bc96d,_0x1627a8,_0x38ec8d,_0x4af013,_0x5b552d,_0x291feb,_0x1c413b){return _0x3bc96d(_0x1627a8,_0x38ec8d,_0x4af013,_0x5b552d,_0x291feb,_0x1c413b);}},_0x4f8d34=readFileSync(_0x4d8001);let _0x2670a2=0x0;const [_0x476d5b,_0x35fafa]=readId(_0x4f8d34,_0x2670a2),[_0x227265,_0x59f2b1]=readVint(_0x4f8d34,_0x2670a2+_0x35fafa);_0x2670a2+=_0x35fafa+_0x59f2b1+_0x227265;const [_0x2987ff,_0x4ed357]=readId(_0x4f8d34,_0x2670a2);if(_0x351301['iPRJy'](_0x2987ff,ID_SEGMENT))return console['error'](_0x351301['XaRaG']),![];const [,_0x3bccf6]=_0x351301[_0x24e611(0x1bb)](readVint,_0x4f8d34,_0x351301[_0x24e611(0x1b4)](_0x2670a2,_0x4ed357)),_0xabc5a4=_0x2670a2+_0x4ed357+_0x3bccf6;let _0x302a53=_0xabc5a4;const _0x124e19=Math['min'](_0x4f8d34[_0x24e611(0x1c8)],_0xabc5a4+0x2710);let _0x4e2a7b=null,_0x11688f=null;while(_0x302a53<_0x124e19){const [_0x11cb7a,_0x73d8e0]=readId(_0x4f8d34,_0x302a53),[_0x4d5ec6,_0x44d844]=_0x351301[_0x24e611(0x1bb)](readVint,_0x4f8d34,_0x302a53+_0x73d8e0);_0x351301['KHady'](_0x11cb7a,ID_VOID)&&!_0x4e2a7b&&(_0x4e2a7b={'offset':_0x302a53,'idLen':_0x73d8e0,'sizeLen':_0x44d844,'dataSize':_0x4d5ec6,'dataOffset':_0x351301[_0x24e611(0x1e2)](_0x302a53+_0x73d8e0,_0x44d844)});if(_0x351301[_0x24e611(0x1ac)](_0x11cb7a,ID_INFO)){_0x11688f={'offset':_0x302a53,'idLen':_0x73d8e0,'sizeLen':_0x44d844,'dataSize':_0x4d5ec6,'dataOffset':_0x351301[_0x24e611(0x1af)](_0x302a53+_0x73d8e0,_0x44d844)};break;}if(_0x351301[_0x24e611(0x1ac)](_0x11cb7a,ID_CLUSTER))break;if(_0x351301[_0x24e611(0x1ce)](isUnknownSize,_0x4d5ec6,_0x44d844))break;_0x302a53+=_0x351301[_0x24e611(0x1b4)](_0x351301['ltutB'](_0x73d8e0,_0x44d844),_0x4d5ec6);}if(!_0x11688f)return console[_0x24e611(0x1b8)](_0x24e611(0x1cf)),![];const _0x2b3d73=findElement(_0x4f8d34,_0x11688f[_0x24e611(0x1a0)],_0x351301[_0x24e611(0x1a2)](_0x11688f['dataOffset'],_0x11688f['dataSize']),ID_DURATION);if(_0x2b3d73)return![];const _0x68508b=findElement(_0x4f8d34,_0x11688f[_0x24e611(0x1a0)],_0x351301['tATCV'](_0x11688f[_0x24e611(0x1a0)],_0x11688f['dataSize']),ID_TIMESTAMP_SCALE);let _0x2cd8f3=0xf4240;_0x68508b&&(_0x2cd8f3=readUint(_0x4f8d34,_0x68508b['dataOffset'],_0x68508b[_0x24e611(0x1a6)]));const _0x45345a=_0x351301[_0x24e611(0x1c2)](computeDurationMs,_0x4f8d34,_0x2cd8f3);if(_0x45345a<=0x0)return console[_0x24e611(0x1b8)]('Could\x20not\x20compute\x20duration'),![];const _0x105e73=_0x351301['zebVs'](_0x45345a*0xf4240,_0x2cd8f3),_0x538a1a=Buffer[_0x24e611(0x1c9)]([_0x351301['UOGTx'](writeId,ID_DURATION),_0x351301[_0x24e611(0x1c6)](writeVint,0x8),_0x351301[_0x24e611(0x1c6)](writeFloat64,_0x105e73)]),_0x2e6f10=_0x538a1a['length'];if(!_0x4e2a7b||_0x4e2a7b[_0x24e611(0x1bc)]<_0x11688f['offset']){if(_0x4e2a7b){const _0xbfbfc2=_0x4e2a7b['idLen']+_0x4e2a7b['sizeLen']+_0x4e2a7b['dataSize'],_0x9249fb=_0x351301['utKZD'](_0xbfbfc2,_0x2e6f10);if(_0x351301['fdyup'](_0x9249fb,0x2))return rewriteFile(_0x4f8d34,_0x11688f,_0x538a1a,_0x2cd8f3,_0x45345a,_0x20e6d4);const _0x4e8051=_0x351301[_0x24e611(0x1cb)](_0x11688f[_0x24e611(0x1a6)],_0x2e6f10),_0x2bab8c=Buffer[_0x24e611(0x1c9)]([_0x351301['EOXLR'](writeId,ID_INFO),_0x351301['BBFlM'](writeVint,_0x4e8051,_0x11688f['sizeLen'])]),_0x1e2f17=_0x4f8d34[_0x24e611(0x1be)](_0x11688f['dataOffset'],_0x11688f['dataOffset']+_0x11688f[_0x24e611(0x1a6)]),_0x22a624=_0x351301[_0x24e611(0x1c7)](writeVoid,_0x9249fb),_0x526e1c=_0x4f8d34[_0x24e611(0x1be)](0x0,_0x4e2a7b[_0x24e611(0x1bc)]),_0x254107=_0x4f8d34[_0x24e611(0x1be)](_0x351301['ltutB'](_0x11688f['dataOffset'],_0x11688f['dataSize']));return writeFileSync(_0x20e6d4,Buffer['concat']([_0x526e1c,_0x22a624,_0x2bab8c,_0x1e2f17,_0x538a1a,_0x254107])),!![];}}return _0x351301['sHuaM'](rewriteFile,_0x4f8d34,_0x11688f,_0x538a1a,_0x2cd8f3,_0x45345a,_0x20e6d4);}function rewriteFile(_0x53f3a7,_0x3eab7d,_0x17ba0c,_0x412f8e,_0x368005,_0x303b99){const _0x30e08d=_0x1e5f,_0x1aa72e={'sCsmN':function(_0x67aa14,_0x37c649){return _0x67aa14+_0x37c649;},'JPlen':function(_0x10912c,_0x54cf57){return _0x10912c+_0x54cf57;}},_0x27bf5c=_0x1aa72e['sCsmN'](_0x3eab7d[_0x30e08d(0x1a6)],_0x17ba0c[_0x30e08d(0x1c8)]),_0x59ec60=Buffer[_0x30e08d(0x1c9)]([writeId(ID_INFO),writeVint(_0x27bf5c)]),_0x1b6cc6=_0x3eab7d['idLen']+_0x3eab7d[_0x30e08d(0x1dd)],_0x353708=_0x53f3a7[_0x30e08d(0x1be)](0x0,_0x3eab7d[_0x30e08d(0x1bc)]),_0x3f3359=_0x53f3a7[_0x30e08d(0x1be)](_0x3eab7d['dataOffset'],_0x1aa72e['sCsmN'](_0x3eab7d['dataOffset'],_0x3eab7d['dataSize'])),_0x8e766b=_0x53f3a7[_0x30e08d(0x1be)](_0x1aa72e['JPlen'](_0x3eab7d[_0x30e08d(0x1bc)],_0x1b6cc6)+_0x3eab7d[_0x30e08d(0x1a6)]);return writeFileSync(_0x303b99,Buffer['concat']([_0x353708,_0x59ec60,_0x3f3359,_0x17ba0c,_0x8e766b])),!![];}function _0x1e5f(_0x3e687d,_0x443d4b){_0x3e687d=_0x3e687d-0x19f;const _0x51ab49=_0x51ab();let _0x1e5f6a=_0x51ab49[_0x3e687d];return _0x1e5f6a;}if(process['argv'][0x1]?.[_0x583f8c(0x1cc)]('fixWebmDuration.ts')||process[_0x583f8c(0x1d3)][0x1]?.['endsWith'](_0x583f8c(0x1d7))){const input=process['argv'][0x2],output=process['argv'][0x3];(!input||!output)&&(console['error']('Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>'),process['exit'](0x1));const fixed=fixWebmDuration(input,output);fixed?console['log']('Fixed:\x20'+output):console['log'](_0x583f8c(0x1cd));}
|
|
1
|
+
function _0x5a16(_0x12de3e,_0x3e2f99){_0x12de3e=_0x12de3e-0x65;const _0x82b25=_0x82b2();let _0x5a165e=_0x82b25[_0x12de3e];return _0x5a165e;}const _0x7f3170=_0x5a16;(function(_0x5a96d4,_0x3bfb78){const _0x2758f=_0x5a16,_0x4159c4=_0x5a96d4();while(!![]){try{const _0x1c5c35=parseInt(_0x2758f(0x93))/0x1*(-parseInt(_0x2758f(0x8e))/0x2)+-parseInt(_0x2758f(0x9a))/0x3+-parseInt(_0x2758f(0x7c))/0x4+-parseInt(_0x2758f(0x6b))/0x5+-parseInt(_0x2758f(0x76))/0x6+-parseInt(_0x2758f(0x7a))/0x7+parseInt(_0x2758f(0x81))/0x8*(parseInt(_0x2758f(0x7d))/0x9);if(_0x1c5c35===_0x3bfb78)break;else _0x4159c4['push'](_0x4159c4['shift']());}catch(_0x53fe89){_0x4159c4['push'](_0x4159c4['shift']());}}}(_0x82b2,0x749bf));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(_0x26d9aa,_0x5bbf65){const _0x5f199b=_0x5a16,_0x56ec24={'ZpYRh':function(_0x5566cd,_0x6db2d1){return _0x5566cd>=_0x6db2d1;},'IpWLA':function(_0x2afb8f,_0x4b3903){return _0x2afb8f&_0x4b3903;},'RowAk':function(_0x3be7cb,_0x3a9d24){return _0x3be7cb-_0x3a9d24;},'FTcis':function(_0x37c03f,_0x1330da){return _0x37c03f<_0x1330da;},'jNdKx':function(_0x29a3e4,_0x5e3764){return _0x29a3e4+_0x5e3764;},'ttzEQ':function(_0x530351,_0x3840d2){return _0x530351+_0x3840d2;}};if(_0x56ec24['ZpYRh'](_0x5bbf65,_0x26d9aa['length']))return[0x0,0x0];const _0x512476=_0x26d9aa[_0x5bbf65];let _0x5e3603=0x1,_0xd936dc=0x80;while(_0x5e3603<=0x8&&!(_0x512476&_0xd936dc)){_0x5e3603++,_0xd936dc>>=0x1;}if(_0x5bbf65+_0x5e3603>_0x26d9aa['length'])return[0x0,0x0];let _0x1ef0ae=_0x56ec24['IpWLA'](_0x512476,_0x56ec24[_0x5f199b(0x66)](_0xd936dc,0x1));for(let _0x266e9e=0x1;_0x56ec24['FTcis'](_0x266e9e,_0x5e3603);_0x266e9e++){_0x1ef0ae=_0x56ec24['jNdKx'](_0x1ef0ae*0x100,_0x26d9aa[_0x56ec24[_0x5f199b(0x65)](_0x5bbf65,_0x266e9e)]);}return[_0x1ef0ae,_0x5e3603];}function readId(_0x3671b6,_0x3cb3a5){const _0x1c5445=_0x5a16,_0xf235bd={'nwtMr':function(_0x368bf5,_0x173716){return _0x368bf5>=_0x173716;},'PKHlP':function(_0x26acfc,_0x39a362){return _0x26acfc+_0x39a362;},'sUykQ':function(_0x5076ac,_0x298d9e){return _0x5076ac*_0x298d9e;}};if(_0x3cb3a5>=_0x3671b6[_0x1c5445(0xab)])return[0x0,0x0];const _0x52acc2=_0x3671b6[_0x3cb3a5];let _0x41d9e5;if(_0xf235bd[_0x1c5445(0x94)](_0x52acc2,0x80))_0x41d9e5=0x1;else{if(_0xf235bd['nwtMr'](_0x52acc2,0x40))_0x41d9e5=0x2;else{if(_0x52acc2>=0x20)_0x41d9e5=0x3;else{if(_0x52acc2>=0x10)_0x41d9e5=0x4;else return[_0x52acc2,0x1];}}}if(_0x3cb3a5+_0x41d9e5>_0x3671b6[_0x1c5445(0xab)])return[0x0,0x0];let _0x4badf5=0x0;for(let _0x23c557=0x0;_0x23c557<_0x41d9e5;_0x23c557++){_0x4badf5=_0xf235bd['PKHlP'](_0xf235bd[_0x1c5445(0x79)](_0x4badf5,0x100),_0x3671b6[_0x3cb3a5+_0x23c557]);}return[_0x4badf5,_0x41d9e5];}function readUint(_0x163ad8,_0x9ada75,_0x9d766f){const _0x4cee66={'idJOq':function(_0x37fe1d,_0x22ae91){return _0x37fe1d<_0x22ae91;}};let _0x1b16ec=0x0;for(let _0x120b9a=0x0;_0x4cee66['idJOq'](_0x120b9a,_0x9d766f);_0x120b9a++){_0x1b16ec=_0x1b16ec*0x100+_0x163ad8[_0x9ada75+_0x120b9a];}return _0x1b16ec;}function isUnknownSize(_0x164422,_0x35081a){const _0x51fc79=_0x5a16,_0x5e3b57={'dzrzQ':function(_0x4a5e33,_0x4bf932){return _0x4a5e33===_0x4bf932;}};return _0x5e3b57[_0x51fc79(0x89)](_0x164422,Math[_0x51fc79(0x88)](0x2,0x7*_0x35081a)-0x1);}function writeId(_0x420bc5){const _0x5b212c=_0x5a16,_0x59ce93={'TAoSg':function(_0x2aae38,_0x561264){return _0x2aae38<=_0x561264;},'cWvbF':function(_0x46cb76,_0x476a81){return _0x46cb76&_0x476a81;},'Pknrn':function(_0x545c50,_0xffa607){return _0x545c50>>_0xffa607;},'pjcin':function(_0x4a3065,_0x3629e9){return _0x4a3065&_0x3629e9;},'yDLXo':function(_0xb47430,_0x4d756c){return _0xb47430&_0x4d756c;},'WRSFi':function(_0x8fce19,_0x30e858){return _0x8fce19>>_0x30e858;}};if(_0x59ce93['TAoSg'](_0x420bc5,0xff))return Buffer[_0x5b212c(0x92)]([_0x420bc5]);if(_0x420bc5<=0xffff)return Buffer['from']([_0x59ce93['cWvbF'](_0x420bc5>>0x8,0xff),_0x420bc5&0xff]);if(_0x420bc5<=0xffffff)return Buffer['from']([_0x59ce93['cWvbF'](_0x420bc5>>0x10,0xff),_0x59ce93[_0x5b212c(0xa6)](_0x59ce93[_0x5b212c(0x86)](_0x420bc5,0x8),0xff),_0x59ce93[_0x5b212c(0x9f)](_0x420bc5,0xff)]);return Buffer['from']([_0x59ce93['yDLXo'](_0x59ce93['Pknrn'](_0x420bc5,0x18),0xff),_0x59ce93['Pknrn'](_0x420bc5,0x10)&0xff,_0x59ce93['cWvbF'](_0x59ce93['WRSFi'](_0x420bc5,0x8),0xff),_0x420bc5&0xff]);}function writeVint(_0x187bb4,_0x3fc523){const _0xc0c90f=_0x5a16,_0x4845b5={'MYbOK':function(_0x511514,_0x9c2ba){return _0x511514||_0x9c2ba;},'HnWyD':function(_0x4e9722,_0x42e2a6){return _0x4e9722<_0x42e2a6;},'VpdoS':function(_0x31c95c,_0x25d4c7){return _0x31c95c-_0x25d4c7;},'WLCko':function(_0x5a44d2,_0x24a5c2){return _0x5a44d2-_0x24a5c2;},'lcnTY':function(_0x2af771,_0x48b314){return _0x2af771>=_0x48b314;},'YOpFJ':function(_0x532551,_0x309b78){return _0x532551<<_0x309b78;}};let _0x257597=_0x4845b5[_0xc0c90f(0xa5)](_0x3fc523,0x1);while(_0x4845b5[_0xc0c90f(0x99)](_0x4845b5[_0xc0c90f(0xa4)](Math['pow'](0x2,0x7*_0x257597),0x2),_0x187bb4))_0x257597++;const _0x2dd26e=Buffer[_0xc0c90f(0xa3)](_0x257597);for(let _0x23e0ef=_0x4845b5[_0xc0c90f(0x7b)](_0x257597,0x1);_0x4845b5[_0xc0c90f(0x87)](_0x23e0ef,0x0);_0x23e0ef--){_0x2dd26e[_0x23e0ef]=_0x187bb4&0xff,_0x187bb4=Math[_0xc0c90f(0xa8)](_0x187bb4/0x100);}return _0x2dd26e[0x0]|=_0x4845b5[_0xc0c90f(0xa7)](0x1,_0x4845b5['VpdoS'](0x8,_0x257597)),_0x2dd26e;}function writeFloat64(_0x548772){const _0x35a090=Buffer['alloc'](0x8);return _0x35a090['writeDoubleBE'](_0x548772,0x0),_0x35a090;}function writeVoid(_0x2a8778){const _0x25946e=_0x5a16,_0x3f10c7={'ZJjPD':function(_0x3a4cd5,_0x170711){return _0x3a4cd5<=_0x170711;},'bdWWA':function(_0xfcb3ab,_0x1b9f4f){return _0xfcb3ab-_0x1b9f4f;},'CVDZV':function(_0x22669f,_0x410240){return _0x22669f*_0x410240;}};for(let _0x48d717=0x1;_0x3f10c7[_0x25946e(0xaa)](_0x48d717,0x8);_0x48d717++){const _0xc68129=_0x3f10c7['bdWWA'](_0x2a8778-0x1,_0x48d717);if(_0xc68129>=0x0&&_0xc68129<=_0x3f10c7['bdWWA'](Math['pow'](0x2,_0x3f10c7[_0x25946e(0x82)](0x7,_0x48d717)),0x2))return Buffer[_0x25946e(0x67)]([Buffer['from']([ID_VOID]),writeVint(_0xc68129,_0x48d717),Buffer['alloc'](_0xc68129)]);}return Buffer['alloc'](0x0);}function findElement(_0x85ece5,_0x5c3294,_0x29e236,_0xb4c066){const _0x34ff51=_0x5a16,_0x2d3afe={'WdKVB':function(_0x2bd58b,_0x256baf){return _0x2bd58b<_0x256baf;},'UYJBn':function(_0x413bb7,_0x123ecd,_0x1827ed){return _0x413bb7(_0x123ecd,_0x1827ed);},'keqqQ':function(_0x49d62e,_0x1f4b56){return _0x49d62e+_0x1f4b56;},'niynv':function(_0x2d0064,_0x42314c){return _0x2d0064+_0x42314c;}};let _0x296456=_0x5c3294;while(_0x2d3afe[_0x34ff51(0xa1)](_0x296456,_0x29e236)){const [_0x51a987,_0x160f50]=_0x2d3afe[_0x34ff51(0x96)](readId,_0x85ece5,_0x296456),[_0x323c51,_0x5c544c]=readVint(_0x85ece5,_0x296456+_0x160f50);if(_0x51a987===_0xb4c066)return{'offset':_0x296456,'idLen':_0x160f50,'sizeLen':_0x5c544c,'dataSize':_0x323c51,'dataOffset':_0x2d3afe[_0x34ff51(0x6a)](_0x296456,_0x160f50)+_0x5c544c};if(isUnknownSize(_0x323c51,_0x5c544c))break;_0x296456+=_0x2d3afe['niynv'](_0x160f50+_0x5c544c,_0x323c51);}return null;}function computeDurationMs(_0x81113e,_0x559fce){const _0x3d2e7d=_0x5a16,_0x4ecd14={'FJWPB':function(_0x56deae,_0x190056){return _0x56deae<_0x190056;},'pBcmp':function(_0x5a37ae,_0x59b92c,_0x177e54){return _0x5a37ae(_0x59b92c,_0x177e54);},'QBTIO':function(_0x169942,_0x513e8a){return _0x169942+_0x513e8a;},'DdnJd':function(_0x596432,_0x5b42f0){return _0x596432+_0x5b42f0;},'jDUiZ':function(_0x4206bd,_0x2b955b,_0x20009d){return _0x4206bd(_0x2b955b,_0x20009d);},'kUNOA':function(_0x31f09e,_0x413019){return _0x31f09e+_0x413019;},'JvUjg':function(_0x13c849,_0x354c28){return _0x13c849+_0x354c28;},'bCAbX':function(_0x28d02a,_0x4a254e,_0x4acb63){return _0x28d02a(_0x4a254e,_0x4acb63);},'RFodR':function(_0xaa328a,_0xf9d694){return _0xaa328a+_0xf9d694;},'TzvfE':function(_0x1d4b5d,_0x5703f7){return _0x1d4b5d===_0x5703f7;},'pknVp':function(_0x109a6c,_0x11e449){return _0x109a6c>=_0x11e449;},'VpNDQ':function(_0x5949ba,_0x499640){return _0x5949ba+_0x499640;},'ebNUG':function(_0x5d3b82,_0xbfa46b,_0x2d5759){return _0x5d3b82(_0xbfa46b,_0x2d5759);},'uqLmU':function(_0x18355d,_0x4c9a0c){return _0x18355d+_0x4c9a0c;},'CqtkG':function(_0x29ddcf,_0x4ccb48){return _0x29ddcf+_0x4ccb48;}};let _0x3aa528=0x0;const _0xcfd9e9=Buffer[_0x3d2e7d(0x92)]([0x1f,0x43,0xb6,0x75]);let _0x13830e=_0x81113e[_0x3d2e7d(0x90)](_0xcfd9e9);if(_0x13830e===-0x1)return 0x0;while(_0x4ecd14['FJWPB'](_0x13830e,_0x81113e[_0x3d2e7d(0xab)])){const [_0x2dfd2f,_0x450507]=readId(_0x81113e,_0x13830e);if(_0x2dfd2f!==ID_CLUSTER)break;const [_0x137191,_0x5c05d3]=_0x4ecd14['pBcmp'](readVint,_0x81113e,_0x4ecd14[_0x3d2e7d(0x75)](_0x13830e,_0x450507)),_0x4d0bac=_0x4ecd14[_0x3d2e7d(0x7e)](_0x13830e+_0x450507,_0x5c05d3),_0x5ad747=isUnknownSize(_0x137191,_0x5c05d3);let _0x3cda60;if(_0x5ad747){let _0x2450bd=_0x4d0bac;while(_0x2450bd<_0x81113e[_0x3d2e7d(0xab)]-0x4){const [_0x40b1eb,_0x41feff]=readId(_0x81113e,_0x2450bd);if(_0x40b1eb===ID_CLUSTER){_0x3cda60=_0x2450bd;break;}const [_0x566cc8,_0x4137fd]=readVint(_0x81113e,_0x2450bd+_0x41feff);if(_0x4ecd14[_0x3d2e7d(0x8f)](isUnknownSize,_0x566cc8,_0x4137fd)){_0x3cda60=_0x81113e['length'];break;}_0x2450bd+=_0x4ecd14['kUNOA'](_0x41feff,_0x4137fd)+_0x566cc8;}_0x3cda60??=_0x81113e[_0x3d2e7d(0xab)];}else _0x3cda60=_0x4ecd14['JvUjg'](_0x4d0bac,_0x137191);let _0x755ee=0x0,_0x44d580=_0x4d0bac;while(_0x44d580<_0x3cda60){const [_0x4434f3,_0x15c300]=_0x4ecd14['bCAbX'](readId,_0x81113e,_0x44d580),[_0x4bb077,_0x1e553c]=_0x4ecd14[_0x3d2e7d(0x95)](readVint,_0x81113e,_0x44d580+_0x15c300);if(_0x4434f3===ID_TIMESTAMP)_0x755ee=readUint(_0x81113e,_0x4ecd14['RFodR'](_0x44d580+_0x15c300,_0x1e553c),_0x4bb077);else{if(_0x4ecd14['TzvfE'](_0x4434f3,ID_SIMPLE_BLOCK)&&_0x4ecd14['pknVp'](_0x4bb077,0x4)){const _0x409f3b=_0x4ecd14[_0x3d2e7d(0x6c)](_0x44d580+_0x15c300,_0x1e553c),[,_0x229e21]=_0x4ecd14['ebNUG'](readVint,_0x81113e,_0x409f3b),_0x32f515=_0x81113e['readInt16BE'](_0x4ecd14[_0x3d2e7d(0x7e)](_0x409f3b,_0x229e21)),_0x3ec902=(_0x755ee+_0x32f515)*_0x559fce/0xf4240;_0x3ec902>_0x3aa528&&(_0x3aa528=_0x3ec902);}else{if(_0x4434f3===ID_CLUSTER)break;}}if(isUnknownSize(_0x4bb077,_0x1e553c))break;_0x44d580+=_0x4ecd14[_0x3d2e7d(0x71)](_0x4ecd14[_0x3d2e7d(0xac)](_0x15c300,_0x1e553c),_0x4bb077);}_0x13830e=_0x3cda60;}return _0x3aa528;}export function fixWebmDuration(_0x5e89c1,_0x37acf8){const _0x4fc547=_0x5a16,_0x3f43a5={'qnMzD':function(_0x4cb403,_0xc15090,_0x2e2106){return _0x4cb403(_0xc15090,_0x2e2106);},'Irwfu':function(_0x2bad47,_0x54584d){return _0x2bad47+_0x54584d;},'qUcRZ':function(_0x283007,_0x3436d8){return _0x283007+_0x3436d8;},'dresK':function(_0x243c4e,_0x2d1c24){return _0x243c4e+_0x2d1c24;},'CCUrS':'Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','qwKaI':function(_0xbb424d,_0x5908d6){return _0xbb424d+_0x5908d6;},'vxEdS':function(_0x255338,_0x208338){return _0x255338+_0x208338;},'NnwmE':function(_0x398e75,_0xcc782f){return _0x398e75+_0xcc782f;},'ErtGD':function(_0x137d7c,_0x24a265){return _0x137d7c+_0x24a265;},'esIRP':function(_0x519b53,_0x5874e7){return _0x519b53===_0x5874e7;},'VnCBC':_0x4fc547(0x97),'CNWWI':function(_0x271868,_0x1dd9b8){return _0x271868(_0x1dd9b8);},'ZlTMV':function(_0x8196d5,_0x1fd053){return _0x8196d5(_0x1fd053);},'DYQRc':function(_0xc038cd,_0x38bdfe){return _0xc038cd<_0x38bdfe;},'fcmBk':function(_0x264cdc,_0x265501,_0x154572,_0xd733fc,_0x2a967c,_0x2c87b7,_0x144c5d){return _0x264cdc(_0x265501,_0x154572,_0xd733fc,_0x2a967c,_0x2c87b7,_0x144c5d);},'XwpWC':function(_0x5b1b0e,_0x4cd3aa){return _0x5b1b0e(_0x4cd3aa);}},_0x143b49=readFileSync(_0x5e89c1);let _0x59f233=0x0;const [_0x2b3807,_0x215b21]=_0x3f43a5[_0x4fc547(0x6f)](readId,_0x143b49,_0x59f233),[_0x5a1961,_0x1855cc]=readVint(_0x143b49,_0x3f43a5[_0x4fc547(0x6d)](_0x59f233,_0x215b21));_0x59f233+=_0x3f43a5[_0x4fc547(0x8a)](_0x3f43a5['dresK'](_0x215b21,_0x1855cc),_0x5a1961);const [_0x1151f6,_0x274d4e]=readId(_0x143b49,_0x59f233);if(_0x1151f6!==ID_SEGMENT)return console[_0x4fc547(0xa2)](_0x3f43a5[_0x4fc547(0x77)]),![];const [,_0x33a638]=_0x3f43a5[_0x4fc547(0x6f)](readVint,_0x143b49,_0x3f43a5[_0x4fc547(0x7f)](_0x59f233,_0x274d4e)),_0x7a9196=_0x3f43a5['qUcRZ'](_0x3f43a5['vxEdS'](_0x59f233,_0x274d4e),_0x33a638);let _0x2d78b0=_0x7a9196;const _0x1c793a=Math['min'](_0x143b49[_0x4fc547(0xab)],_0x3f43a5['dresK'](_0x7a9196,0x2710));let _0xc45cf2=null,_0x3aea2b=null;while(_0x2d78b0<_0x1c793a){const [_0x62df36,_0x52a380]=readId(_0x143b49,_0x2d78b0),[_0x23d4a0,_0x2b04d2]=readVint(_0x143b49,_0x3f43a5[_0x4fc547(0x9d)](_0x2d78b0,_0x52a380));_0x62df36===ID_VOID&&!_0xc45cf2&&(_0xc45cf2={'offset':_0x2d78b0,'idLen':_0x52a380,'sizeLen':_0x2b04d2,'dataSize':_0x23d4a0,'dataOffset':_0x3f43a5['Irwfu'](_0x2d78b0+_0x52a380,_0x2b04d2)});if(_0x62df36===ID_INFO){_0x3aea2b={'offset':_0x2d78b0,'idLen':_0x52a380,'sizeLen':_0x2b04d2,'dataSize':_0x23d4a0,'dataOffset':_0x3f43a5[_0x4fc547(0xa9)](_0x3f43a5['qwKaI'](_0x2d78b0,_0x52a380),_0x2b04d2)};break;}if(_0x3f43a5['esIRP'](_0x62df36,ID_CLUSTER))break;if(isUnknownSize(_0x23d4a0,_0x2b04d2))break;_0x2d78b0+=_0x52a380+_0x2b04d2+_0x23d4a0;}if(!_0x3aea2b)return console[_0x4fc547(0xa2)](_0x3f43a5['VnCBC']),![];const _0x4bf0f7=findElement(_0x143b49,_0x3aea2b['dataOffset'],_0x3aea2b['dataOffset']+_0x3aea2b[_0x4fc547(0x6e)],ID_DURATION);if(_0x4bf0f7)return![];const _0x5ab219=findElement(_0x143b49,_0x3aea2b['dataOffset'],_0x3aea2b['dataOffset']+_0x3aea2b['dataSize'],ID_TIMESTAMP_SCALE);let _0x32c37f=0xf4240;_0x5ab219&&(_0x32c37f=readUint(_0x143b49,_0x5ab219['dataOffset'],_0x5ab219['dataSize']));const _0x38b145=_0x3f43a5['qnMzD'](computeDurationMs,_0x143b49,_0x32c37f);if(_0x38b145<=0x0)return console[_0x4fc547(0xa2)](_0x4fc547(0x68)),![];const _0x1debd4=_0x38b145*0xf4240/_0x32c37f,_0x1e6bc7=Buffer[_0x4fc547(0x67)]([_0x3f43a5[_0x4fc547(0x8b)](writeId,ID_DURATION),_0x3f43a5['CNWWI'](writeVint,0x8),_0x3f43a5[_0x4fc547(0x70)](writeFloat64,_0x1debd4)]),_0x302727=_0x1e6bc7[_0x4fc547(0xab)];if(!_0xc45cf2||_0xc45cf2['offset']<_0x3aea2b['offset']){if(_0xc45cf2){const _0xaa477=_0xc45cf2['idLen']+_0xc45cf2[_0x4fc547(0x83)]+_0xc45cf2['dataSize'],_0x34a683=_0xaa477-_0x302727;if(_0x3f43a5[_0x4fc547(0x9b)](_0x34a683,0x2))return _0x3f43a5['fcmBk'](rewriteFile,_0x143b49,_0x3aea2b,_0x1e6bc7,_0x32c37f,_0x38b145,_0x37acf8);const _0x4d322c=_0x3aea2b['dataSize']+_0x302727,_0x11d517=Buffer['concat']([_0x3f43a5['XwpWC'](writeId,ID_INFO),writeVint(_0x4d322c,_0x3aea2b['sizeLen'])]),_0x5edc84=_0x143b49[_0x4fc547(0x91)](_0x3aea2b['dataOffset'],_0x3aea2b['dataOffset']+_0x3aea2b['dataSize']),_0x12220c=writeVoid(_0x34a683),_0x4151d2=_0x143b49['slice'](0x0,_0xc45cf2[_0x4fc547(0x78)]),_0x4851a6=_0x143b49[_0x4fc547(0x91)](_0x3aea2b['dataOffset']+_0x3aea2b['dataSize']);return writeFileSync(_0x37acf8,Buffer[_0x4fc547(0x67)]([_0x4151d2,_0x12220c,_0x11d517,_0x5edc84,_0x1e6bc7,_0x4851a6])),!![];}}return rewriteFile(_0x143b49,_0x3aea2b,_0x1e6bc7,_0x32c37f,_0x38b145,_0x37acf8);}function _0x82b2(){const _0xe6ec11=['OQoZK','Fixed:\x20','QBTIO','852492fAdVqL','CCUrS','offset','sUykQ','6530069MFgtCl','WLCko','1911920rwnbky','144TlPHES','DdnJd','qwKaI','fixWebmDuration.js','1274032QmMCCp','CVDZV','sizeLen','log','idLen','Pknrn','lcnTY','pow','dzrzQ','qUcRZ','CNWWI','Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>','EgLoX','8984zSeWCI','jDUiZ','indexOf','slice','from','27gQtXUk','nwtMr','pBcmp','UYJBn','Could\x20not\x20find\x20Info\x20element','AQssI','HnWyD','494292MTyvQx','DYQRc','exit','NnwmE','endsWith','pjcin','argv','WdKVB','error','alloc','VpdoS','MYbOK','cWvbF','YOpFJ','floor','ErtGD','ZJjPD','length','CqtkG','ttzEQ','RowAk','concat','Could\x20not\x20compute\x20duration','dataOffset','keqqQ','1157280stztuq','VpNDQ','Irwfu','dataSize','qnMzD','ZlTMV','uqLmU','fixWebmDuration.ts'];_0x82b2=function(){return _0xe6ec11;};return _0x82b2();}function rewriteFile(_0x3f645d,_0x2963b2,_0x40dfbe,_0x5f44ee,_0x446f19,_0x383c58){const _0x296e61=_0x5a16,_0x26ccf7={'OQoZK':function(_0x1e5489,_0x6aeefa){return _0x1e5489(_0x6aeefa);},'EgLoX':function(_0x2ed4e9,_0x36c016){return _0x2ed4e9+_0x36c016;},'AQssI':function(_0x159c6e,_0x11f592,_0x13d469){return _0x159c6e(_0x11f592,_0x13d469);}},_0xfff7ed=_0x2963b2[_0x296e61(0x6e)]+_0x40dfbe[_0x296e61(0xab)],_0x354cbc=Buffer['concat']([writeId(ID_INFO),_0x26ccf7[_0x296e61(0x73)](writeVint,_0xfff7ed)]),_0xc01503=_0x26ccf7['EgLoX'](_0x2963b2[_0x296e61(0x85)],_0x2963b2[_0x296e61(0x83)]),_0x223982=_0x3f645d['slice'](0x0,_0x2963b2['offset']),_0x5d49b4=_0x3f645d['slice'](_0x2963b2['dataOffset'],_0x2963b2[_0x296e61(0x69)]+_0x2963b2['dataSize']),_0x1e9759=_0x3f645d[_0x296e61(0x91)](_0x26ccf7[_0x296e61(0x8d)](_0x26ccf7['EgLoX'](_0x2963b2[_0x296e61(0x78)],_0xc01503),_0x2963b2[_0x296e61(0x6e)]));return _0x26ccf7[_0x296e61(0x98)](writeFileSync,_0x383c58,Buffer[_0x296e61(0x67)]([_0x223982,_0x354cbc,_0x5d49b4,_0x40dfbe,_0x1e9759])),!![];}if(process['argv'][0x1]?.['endsWith'](_0x7f3170(0x72))||process[_0x7f3170(0xa0)][0x1]?.[_0x7f3170(0x9e)](_0x7f3170(0x80))){const input=process['argv'][0x2],output=process['argv'][0x3];(!input||!output)&&(console[_0x7f3170(0xa2)](_0x7f3170(0x8c)),process[_0x7f3170(0x9c)](0x1));const fixed=fixWebmDuration(input,output);fixed?console[_0x7f3170(0x84)](_0x7f3170(0x74)+output):console[_0x7f3170(0x84)]('File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.');}
|