@ranger-testing/ranger-cli 2.5.4-alpha.feb9faf-20 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 -0
- 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 -0
- 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 -0
- package/build/skills/ranger/SKILL.md +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x551773=_0x2e4a;(function(_0x1154c6,_0x2dce94){const _0x321e73=_0x2e4a,_0x195b5a=_0x1154c6();while(!![]){try{const _0x14983e=-parseInt(_0x321e73(0x225))/0x1+-parseInt(_0x321e73(0x1ce))/0x2+parseInt(_0x321e73(0x236))/0x3*(-parseInt(_0x321e73(0x233))/0x4)+parseInt(_0x321e73(0x1fa))/0x5+parseInt(_0x321e73(0x1cd))/0x6*(parseInt(_0x321e73(0x1e9))/0x7)+-parseInt(_0x321e73(0x230))/0x8*(parseInt(_0x321e73(0x1cb))/0x9)+parseInt(_0x321e73(0x231))/0xa*(parseInt(_0x321e73(0x202))/0xb);if(_0x14983e===_0x2dce94)break;else _0x195b5a['push'](_0x195b5a['shift']());}catch(_0x2bee8b){_0x195b5a['push'](_0x195b5a['shift']());}}}(_0x252b,0x62043));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0xa9d222 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 _0x34ac4d=_0x2e4a,_0x22b01b={'CWmNu':_0x34ac4d(0x1f1)},_0x3f2401=await getToken();if(!_0x3f2401)throw new Error(_0x22b01b[_0x34ac4d(0x1cf)]);return _0x3f2401;}async function apiRequest(_0x2e3114,_0x5a8d64={}){const _0x149f35=_0x2e4a,_0x409a7a={'UkZAR':function(_0xe3b455){return _0xe3b455();},'uhesh':'application/json','KzMlr':'string','hhtKW':function(_0x5e4681,_0x3db344){return _0x5e4681===_0x3db344;}},_0x29d727=await _0x409a7a['UkZAR'](requireToken),_0x3a2bc5=getApiBaseUrl(),_0x112f8f=await fetch(''+_0x3a2bc5+_0x2e3114,{..._0x5a8d64,'headers':{'Authorization':_0x149f35(0x1de)+_0x29d727,'Content-Type':_0x409a7a['uhesh'],..._0x5a8d64['headers']??{}}});if(!_0x112f8f['ok']){let _0x5dab2e='',_0x51098f;try{const _0xf1069=await _0x112f8f[_0x149f35(0x20b)]();_0x5dab2e=(typeof _0xf1069[_0x149f35(0x22c)]===_0x409a7a[_0x149f35(0x219)]?_0xf1069[_0x149f35(0x22c)]:undefined)??JSON['stringify'](_0xf1069);if(_0x409a7a['hhtKW'](typeof _0xf1069['code'],_0x149f35(0x1d7)))_0x51098f=_0xf1069[_0x149f35(0x21e)];}catch{_0x5dab2e=_0x112f8f['statusText'];}throw new ApiError(_0x149f35(0x1e5)+_0x2e3114+_0x149f35(0x1e1)+_0x112f8f['status']+_0x149f35(0x21f)+_0x5dab2e,_0x112f8f[_0x149f35(0x1d0)],_0x5dab2e,_0x51098f);}return _0x112f8f['json']();}export class ApiError extends Error{[_0x551773(0x1d0)];[_0x551773(0x1ee)];[_0x551773(0x21e)];constructor(_0x16abfc,_0x56d2c9,_0x290280,_0x182297){const _0x20ef85=_0x551773,_0x31fe0b={'wqwtE':_0x20ef85(0x1f0)},_0x23c7ff='1|2|0|3|4'['split']('|');let _0xb54ddf=0x0;while(!![]){switch(_0x23c7ff[_0xb54ddf++]){case'0':this[_0x20ef85(0x1ee)]=_0x290280;continue;case'1':super(_0x16abfc);continue;case'2':this[_0x20ef85(0x1d0)]=_0x56d2c9;continue;case'3':this[_0x20ef85(0x21e)]=_0x182297;continue;case'4':this[_0x20ef85(0x1eb)]=_0x31fe0b['wqwtE'];continue;}break;}}}function _0x2e4a(_0x68e2c8,_0xe067fd){_0x68e2c8=_0x68e2c8-0x1c5;const _0x252b94=_0x252b();let _0x2e4aa4=_0x252b94[_0x68e2c8];return _0x2e4aa4;}export async function fetchCloudProfile(_0x1b352c){const _0x5f4533=_0x551773,_0x534f59={'wpZqJ':function(_0x14092d,_0x3a1c63){return _0x14092d instanceof _0x3a1c63;},'YxhuL':function(_0x47dc36,_0x9ff10c){return _0x47dc36===_0x9ff10c;}};try{return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x1b352c));}catch(_0x18259e){if(_0x534f59['wpZqJ'](_0x18259e,ApiError)&&_0x534f59[_0x5f4533(0x1c5)](_0x18259e['status'],0x194))return null;throw _0x18259e;}}export async function listCloudProfiles(){const _0xabdf20={'XOiHG':function(_0x1030fa,_0x10403f){return _0x1030fa(_0x10403f);}},_0x1b2513=await _0xabdf20['XOiHG'](apiRequest,'/api/v1/profiles');return _0x1b2513['profiles'];}export async function createCloudProfile(_0x1a51da,_0x3aba67,_0x2528b2={}){const _0x6d5511=_0x551773,_0x3f6e6a={'Nqgyw':function(_0x2763c3,_0x2b743a,_0x586cef){return _0x2763c3(_0x2b743a,_0x586cef);},'pHeSs':'POST'},_0x1e24f9={'name':_0x1a51da};if(_0x3aba67)_0x1e24f9[_0x6d5511(0x1d9)]=_0x3aba67;_0x2528b2[_0x6d5511(0x22d)]&&Object[_0x6d5511(0x210)](_0x2528b2['settings'])['length']>0x0&&(_0x1e24f9['settings']=_0x2528b2['settings']);if(_0x2528b2['username'])_0x1e24f9['username']=_0x2528b2[_0x6d5511(0x1ed)];if(_0x2528b2[_0x6d5511(0x22a)])_0x1e24f9['password']=_0x2528b2[_0x6d5511(0x22a)];return await _0x3f6e6a[_0x6d5511(0x1d8)](apiRequest,_0x6d5511(0x1c6),{'method':_0x3f6e6a['pHeSs'],'body':JSON[_0x6d5511(0x208)](_0x1e24f9)});}export async function uploadCloudProfileSession(_0x5888f0,_0x440e34){const _0x31966e=_0x551773,_0x1f2710={'fiLQT':function(_0x4b8d74,_0x42cdd1,_0x2099b1){return _0x4b8d74(_0x42cdd1,_0x2099b1);},'elalj':function(_0x3d8543,_0x33fb24){return _0x3d8543(_0x33fb24);}};return await _0x1f2710[_0x31966e(0x1f4)](apiRequest,'/api/v1/profiles/'+_0x1f2710[_0x31966e(0x1d6)](encodeURIComponent,_0x5888f0)+'/session',{'method':'POST','body':JSON[_0x31966e(0x208)]({'session_state':_0x440e34})});}export async function saveCloudProfileCredentials(_0x432e7d,_0x1b19b1,_0x4053ce){await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x432e7d),{'method':'PUT','body':JSON['stringify']({'username':_0x1b19b1,'password':_0x4053ce})});}export async function fetchAuthConfig(){const _0x20c0c5=_0x551773,_0x1f02e7={'hXFHH':function(_0x2e73e2,_0x37428c){return _0x2e73e2(_0x37428c);},'JBGAQ':'/api/v1/profiles/auth-config'};try{const _0x1d8e40=await _0x1f02e7[_0x20c0c5(0x228)](apiRequest,_0x1f02e7[_0x20c0c5(0x234)]);return _0x1d8e40['auth_config'];}catch{return null;}}export function pickAdHocEnvKey(_0x5de556){const _0x1f23a9=_0x551773,_0x1c4231={'liFaP':function(_0xb9fa09,_0x3e0081){return _0xb9fa09===_0x3e0081;},'pJWMr':function(_0x1998ef,_0x4c51b8){return _0x1998ef+_0x4c51b8;}};if(!_0x5de556)return null;if(_0x5de556['defaultEnvironmentKey'])return _0x5de556['defaultEnvironmentKey'];const _0x48cb3e=Object['keys'](_0x5de556[_0x1f23a9(0x21a)]??{});if(_0x48cb3e[_0x1f23a9(0x1e8)]===0x1)return _0x48cb3e[0x0];if(_0x1c4231['liFaP'](_0x48cb3e[_0x1f23a9(0x1e8)],0x0))return null;throw new Error(_0x1c4231[_0x1f23a9(0x1db)]('Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20('+_0x48cb3e['join'](',\x20')+_0x1f23a9(0x1ff),'Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.'));}export async function resolveAdHocProfile(_0x28e5bd=process['env']){const _0x5b187b=_0x551773,_0x571175={'VHHRR':function(_0x1ee1f1){return _0x1ee1f1();},'TCGbI':function(_0x4245ff,_0x1f694e,_0x1d845b,_0x217345){return _0x4245ff(_0x1f694e,_0x1d845b,_0x217345);},'wiRIq':function(_0x5b229d,_0x5ec50d){return _0x5b229d??_0x5ec50d;}},_0x2c1404=_0x28e5bd['RANGER_TEST_USERNAME'];if(!_0x2c1404)return null;const _0x1db736=await fetchCloudProfile(_0x2c1404);if(_0x1db736)return{'name':_0x1db736[_0x5b187b(0x1eb)],'profile':_0x1db736};const _0x1c721b=await _0x571175[_0x5b187b(0x20a)](fetchAuthConfig),_0x285bb1=pickAdHocEnvKey(_0x1c721b),_0x5c1d4a=_0x28e5bd[_0x5b187b(0x211)],_0x4b29dd=await _0x571175[_0x5b187b(0x1cc)](createCloudProfile,_0x2c1404,_0x571175[_0x5b187b(0x1ea)](_0x285bb1,undefined),{'username':_0x2c1404,'password':_0x5c1d4a});return console[_0x5b187b(0x1fb)]('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x4b29dd[_0x5b187b(0x1eb)]+'\x22\x20for\x20'+_0x2c1404),{'name':_0x4b29dd[_0x5b187b(0x1eb)],'profile':_0x4b29dd};}export async function writeSessionToLocalCache(_0x56da44,_0x34878b,_0x42d487,_0x1938b4,_0x52a29c,_0xa0f84,_0x440fb9){const _0x5276b6=_0x551773,_0x1799fa={'WQPKf':function(_0x32b164,_0xcf963d,_0x5a514a){return _0x32b164(_0xcf963d,_0x5a514a);},'joxQs':function(_0x132f35){return _0x132f35();},'OxeWu':'auth'},_0x1d890c=sessionCacheHash({'orgId':_0x34878b,'profileName':_0x56da44,'effectiveBaseUrl':_0x42d487,'setupHeaders':_0x1938b4,'invalidateOn':_0x440fb9?.['invalidateOn'],'userAgent':_0x440fb9?.['userAgent'],'clientIp':_0x440fb9?.[_0x5276b6(0x224)]}),_0x358ad4=_0x1799fa[_0x5276b6(0x1f9)](getSessionCachePath,_0x1d890c,_0x56da44),_0x432ad1=_0x1799fa[_0x5276b6(0x1f9)](join,_0x1799fa['joxQs'](getRangerHomeDir),_0x1799fa[_0x5276b6(0x1f3)]);!existsSync(_0x432ad1)&&await mkdir(_0x432ad1,{'recursive':!![]});const _0x2fe1bf={..._0x52a29c};_0xa0f84&&_0xa0f84['length']>0x0&&Array[_0x5276b6(0x205)](_0x2fe1bf[_0x5276b6(0x1e7)])&&(_0x2fe1bf[_0x5276b6(0x1e7)]=duplicateCookiesForDomains(_0x2fe1bf[_0x5276b6(0x1e7)],_0xa0f84));const _0x19461e={'cached_at':new Date()['toISOString'](),'session_state':_0x2fe1bf};await writeFile(_0x358ad4,JSON[_0x5276b6(0x208)](_0x19461e,null,0x2));const _0x193dc7=getStorageStatePath(_0x358ad4);return await writeFile(_0x193dc7,JSON['stringify'](_0x2fe1bf,null,0x2)),_0x193dc7;}export async function checkLocalCache(_0x490bf1,_0x4e7fef,_0x48f4d4,_0x564d64,_0x485ae3){const _0x215108=_0x551773,_0x1371bd={'cdLVp':function(_0x3f3c5c,_0x138c30){return _0x3f3c5c(_0x138c30);},'aGRtj':function(_0x28a0c3,_0xb035ea,_0x4fe69f){return _0x28a0c3(_0xb035ea,_0x4fe69f);}},_0x447940=_0x1371bd[_0x215108(0x206)](sessionCacheHash,{'orgId':_0x4e7fef,'profileName':_0x490bf1,'effectiveBaseUrl':_0x48f4d4,'setupHeaders':_0x564d64,'invalidateOn':_0x485ae3?.['invalidateOn'],'userAgent':_0x485ae3?.[_0x215108(0x203)],'clientIp':_0x485ae3?.[_0x215108(0x224)]}),_0x5c9737=getSessionCachePath(_0x447940,_0x490bf1),_0x4c2973=_0x1371bd['cdLVp'](getStorageStatePath,_0x5c9737);if(!_0x1371bd[_0x215108(0x206)](existsSync,_0x5c9737)||!existsSync(_0x4c2973))return null;try{const _0x40ed7e=await _0x1371bd['aGRtj'](readFile,_0x5c9737,'utf-8');return JSON[_0x215108(0x22e)](_0x40ed7e),{'storageStatePath':_0x4c2973};}catch{return null;}}function _0x252b(){const _0x1f510e=['\x22,\x20attempting\x20login...','lXwvx','about:blank','\x20\x20Cloud\x20session\x20for\x20\x22','clientIp','83266XZMhSk','test_output','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','hXFHH','organizationId','password','/login','error','settings','parse','azWrM','5192632kkXnaE','40tpOvAz','hwRoM','108952yTCCoB','JBGAQ','launch','3cakpoC','YxhuL','/api/v1/profiles','url','setupHeaders','/api/v1/profiles/','hostname','9ynirKR','TCGbI','2825628TUusAj','776004JEcoUU','CWmNu','status','POST','/session','kpOPV','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','domains','elalj','string','Nqgyw','environment_key','force','pJWMr','wZbWX','prompt','Bearer\x20','push','UrAgS','\x20failed\x20(','dTotN','newPage','close','API\x20request\x20','\x20\x20Server-side\x20login\x20error:\x20','cookies','length','7syFkHe','wiRIq','name','KCHTH','username','detail','If\x20logins\x20keep\x20failing,\x20declare\x20`invalidateOn:\x20[\x27baseUrl\x27]`\x20on\x20your\x20org\x27s\x20auth-config\x20env\x20so\x20port/domain\x20changes\x20force\x20a\x20fresh\x20login.','ApiError','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','gYtJf','OxeWu','fiLQT','env','storageStatePath','PUT','HKgLS','WQPKf','1556870WUeuuC','log','Pqtau','confirm','join',').\x20','Jlcza','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','2108557qnXdIn','userAgent','RANGER_TEST_USERNAME','isArray','cdLVp','message','stringify','extraHTTPHeaders','VHHRR','json','some','session_state','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','origin','keys','RANGER_TEST_PASSWORD','\x22\x20failed\x20validation\x20—\x20refreshing...','sessionState','iPHvA','you\x27re\x20now\x20at\x20\x22','map','enpYA','\x22,\x20cached\x20locally','KzMlr','environments','loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','sVyYL','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','code','):\x20'];_0x252b=function(){return _0x1f510e;};return _0x252b();}function launchRealBrowser(){const _0x74f001=_0x551773;return chromium[_0x74f001(0x235)]({'headless':!![]});}function emitSessionValidationHint(_0x3ff8e3,_0x3383aa){const _0x286597=_0x551773,_0x26ea53={'zKoTP':'Your\x20org\x27s\x20auth-config\x20env\x20may\x20need\x20`invalidateOn:\x20[\x27port\x27]`\x20so\x20sessions\x20captured\x20on\x20one\x20port\x20aren\x27t\x20reused\x20on\x20another.','iPHvA':function(_0x28a8fa,_0x1e092a){return _0x28a8fa+_0x1e092a;}};if(!_0x3383aa||!_0x3383aa[_0x286597(0x1d5)]?.['length'])return;let _0x52f48f;try{_0x52f48f=new URL(_0x3ff8e3);}catch{return;}const _0x17cd19=[];for(const _0x1a9737 of _0x3383aa['domains']){try{_0x17cd19[_0x286597(0x1df)]({'raw':_0x1a9737,'url':new URL(_0x1a9737)});}catch{}}if(_0x17cd19['length']===0x0)return;if(_0x17cd19[_0x286597(0x20c)](_0x1b02eb=>_0x1b02eb['url'][_0x286597(0x20f)]===_0x52f48f[_0x286597(0x20f)]))return;const _0x1922b8=_0x17cd19['some'](_0x13e58a=>_0x52f48f[_0x286597(0x1ca)]===_0x13e58a[_0x286597(0x1c7)]['hostname']&&_0x52f48f['protocol']===_0x13e58a[_0x286597(0x1c7)]['protocol']&&_0x52f48f['port']!==_0x13e58a[_0x286597(0x1c7)]['port']),_0x1133dc=_0x1922b8?_0x26ea53['zKoTP']:_0x286597(0x1ef),_0x52e079=_0x17cd19[_0x286597(0x216)](_0x1fe1d4=>'\x22'+_0x1fe1d4['raw']+'\x22')[_0x286597(0x1fe)](',\x20');console[_0x286597(0x1fb)](_0x26ea53[_0x286597(0x214)](_0x286597(0x227)+_0x52e079+';\x20',_0x286597(0x215)+_0x3ff8e3+_0x286597(0x21d)+_0x1133dc));}export async function serverSideLogin(_0x549e0f,_0x4da5c6){const _0xb43de1=_0x551773,_0x292897={'Pqtau':function(_0x33f79d,_0x3f52a0,_0x2c36d0){return _0x33f79d(_0x3f52a0,_0x2c36d0);},'sVyYL':'not_configured'},_0x51b555=process[_0xb43de1(0x1f5)][_0xb43de1(0x204)],_0x19b665=process['env']['RANGER_TEST_PASSWORD'],_0x54be82={};if(_0x51b555)_0x54be82[_0xb43de1(0x1ed)]=_0x51b555;if(_0x19b665)_0x54be82[_0xb43de1(0x22a)]=_0x19b665;if(_0x4da5c6?.[_0xb43de1(0x1da)])_0x54be82['force']=!![];try{return await _0x292897[_0xb43de1(0x1fc)](apiRequest,_0xb43de1(0x1c9)+encodeURIComponent(_0x549e0f)+_0xb43de1(0x22b),{'method':_0xb43de1(0x1d1),'body':JSON[_0xb43de1(0x208)](_0x54be82)});}catch(_0x2e8c62){if(_0x2e8c62 instanceof ApiError&&_0x2e8c62['status']===0x190&&_0x2e8c62['code']===_0x292897[_0xb43de1(0x21c)])return{'status':_0x292897[_0xb43de1(0x21c)],'error':_0x2e8c62[_0xb43de1(0x1ee)]};throw _0x2e8c62;}}export async function manualBrowserLogin(_0x35eb18,_0xf2c224){const _0x14194b=_0x551773,_0x1eb983={'gYtJf':function(_0x249bb2){return _0x249bb2();},'hwRoM':function(_0x195935,_0x13aa20){return _0x195935(_0x13aa20);},'enpYA':function(_0x26de38,_0x26d4fe,_0x1d5d8a){return _0x26de38(_0x26d4fe,_0x1d5d8a);},'azWrM':function(_0x3a2dab,_0x258a3c){return _0x3a2dab+_0x258a3c;},'Jlcza':'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','UrAgS':function(_0x89d738,_0x5e7c5c){return _0x89d738&&_0x5e7c5c;},'liStG':'Browser\x20login\x20timed\x20out\x20before\x20completion.','KmSjz':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','kccQs':function(_0x5cb6e4,_0x20e52e,_0x1e72d){return _0x5cb6e4(_0x20e52e,_0x1e72d);}};if(!_0x1eb983[_0x14194b(0x1f2)](isInteractive))throw new Error(_0x1eb983[_0x14194b(0x22f)](_0x1eb983['azWrM']('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x35eb18['name']+'\x22.\x0a',_0x1eb983[_0x14194b(0x200)]),_0x14194b(0x21b)));const _0x46a27f=_0xf2c224&&_0xf2c224['domains'][_0x14194b(0x1e8)]>0x0?_0xf2c224[_0x14194b(0x1d5)][0x0]:_0x14194b(0x222);console[_0x14194b(0x1fb)]('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console['log']('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x3691ea=>setTimeout(_0x3691ea,0x7d0));const _0x5b65ca=await chromium[_0x14194b(0x235)]({'headless':![]});let _0x4b552d=null;try{const _0x3bd7af={'ignoreHTTPSErrors':!![]};_0xf2c224?.['setupHeaders']&&(_0x3bd7af[_0x14194b(0x209)]=_0xf2c224[_0x14194b(0x1c8)]);const _0x1df06f=await _0x5b65ca['newContext'](_0x3bd7af);await addProfileSetupBanner(_0x1df06f);const _0x5dd4f9=await _0x1df06f[_0x14194b(0x1e3)]();await _0x5dd4f9['goto'](_0x46a27f);let _0x2cf367=![];await new Promise(_0x20bfd5=>{const _0x2fc1dd=_0x14194b,_0xf43f8e={'EROmR':function(_0x5d86b7,_0x5e6a9a){const _0x171aeb=_0x2e4a;return _0x1eb983[_0x171aeb(0x232)](_0x5d86b7,_0x5e6a9a);},'YucZu':function(_0x3dd898){const _0x273d1d=_0x2e4a;return _0x1eb983[_0x273d1d(0x1f2)](_0x3dd898);}},_0x22449a=_0x1eb983[_0x2fc1dd(0x217)](setTimeout,()=>{const _0x4c2135=_0x2fc1dd;_0x2cf367=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+MANUAL_LOGIN_TIMEOUT_MS/0xea60+_0x4c2135(0x1d4)),_0x1eb983[_0x4c2135(0x1f2)](_0x20bfd5);},MANUAL_LOGIN_TIMEOUT_MS);_0x5dd4f9['on']('close',async()=>{_0xf43f8e['EROmR'](clearTimeout,_0x22449a);try{const _0x3c3f8b=await _0x1df06f['storageState']();_0x4b552d=_0x3c3f8b;}catch{}_0xf43f8e['YucZu'](_0x20bfd5);});});if(_0x1eb983[_0x14194b(0x1e0)](_0x2cf367,!_0x4b552d))throw new Error(_0x1eb983['liStG']);}finally{await _0x5b65ca[_0x14194b(0x1e4)]()['catch'](()=>{});}if(!_0x4b552d)throw new Error(_0x1eb983['KmSjz']);return await _0x1eb983['kccQs'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x35eb18[_0x14194b(0x1eb)])+_0x14194b(0x1d2),{'method':_0x14194b(0x1d1),'body':JSON[_0x14194b(0x208)]({'session_state':_0x4b552d,'updated_by':'cli:manual-login'})}),{'sessionState':_0x4b552d};}export async function promptSaveCredentials(_0x247fa3){const _0x2557c4=_0x551773,_0x26a2a2={'lXwvx':function(_0x4cff7d,_0x284d28){return _0x4cff7d||_0x284d28;},'eWoGt':_0x2557c4(0x1fd),'KCHTH':'save','dTotN':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','LKFVJ':_0x2557c4(0x20e)},_0x3ead5b=process['env']['RANGER_TEST_USERNAME'],_0xa16580=process['env'][_0x2557c4(0x211)];if(_0x26a2a2[_0x2557c4(0x221)](!_0x3ead5b,!_0xa16580))return;if(!isInteractive())return;const {save:_0x3f10b5}=await _0xa9d222[_0x2557c4(0x1dd)]([{'type':_0x26a2a2['eWoGt'],'name':_0x26a2a2[_0x2557c4(0x1ec)],'message':_0x26a2a2[_0x2557c4(0x1e2)],'default':![]}]);if(!_0x3f10b5)return;await apiRequest(_0x2557c4(0x1c9)+encodeURIComponent(_0x247fa3),{'method':_0x2557c4(0x1f7),'body':JSON[_0x2557c4(0x208)]({'username':_0x3ead5b,'password':_0xa16580})}),console[_0x2557c4(0x1fb)](_0x26a2a2['LKFVJ']);}export async function resolveCloudProfileSession(_0x4df209,_0x34dd0b={}){const _0x4b76a1=_0x551773,_0x5c4efa={'ykRaZ':function(_0x13d903,_0x4067a8,_0x181429,_0x268de5,_0x273171,_0x3bc69e,_0x102419,_0x824f26){return _0x13d903(_0x4067a8,_0x181429,_0x268de5,_0x273171,_0x3bc69e,_0x102419,_0x824f26);},'opPOh':function(_0x462353,_0x4aee02,_0x3b948c,_0x184d85,_0x51a3f7){return _0x462353(_0x4aee02,_0x3b948c,_0x184d85,_0x51a3f7);},'wZbWX':function(_0xc72e6f,_0x17580b){return _0xc72e6f(_0x17580b);},'HKgLS':function(_0x5b14b2,_0x50abf1){return _0x5b14b2(_0x50abf1);},'hDGRt':'not_configured','kpOPV':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','ZotMR':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...'},_0x23ba76=_0x4df209[_0x4b76a1(0x22d)]??{},_0x2b1e2c=await fetchAuthConfig(),_0x315507=_0x2b1e2c?resolveAuthEnvironmentLocally(_0x2b1e2c,_0x4df209['environmentKey']):null,_0xb1ff67=_0x315507?.['domains'],_0xb1e365=_0x23ba76[_0x4b76a1(0x1c8)],_0x14384a=_0xb1e365??_0x315507?.[_0x4b76a1(0x1c8)],_0x4cd4da=_0x34dd0b['effectiveBaseUrl']??_0x23ba76['baseUrl']??(_0xb1ff67&&_0xb1ff67[_0x4b76a1(0x1e8)]>0x0?_0xb1ff67[0x0]:''),_0x338337={'invalidateOn':_0x315507?.['invalidateOn'],'userAgent':_0x315507?.['browserOptions']?.['userAgent']??_0x23ba76[_0x4b76a1(0x203)]},_0x2d146d=await checkLocalCache(_0x4df209['name'],_0x4df209[_0x4b76a1(0x229)],_0x4cd4da,_0x14384a,_0x338337);if(_0x2d146d){if(_0x4cd4da){const _0x1969fe=await isCachedSessionLive(_0x2d146d[_0x4b76a1(0x1f6)],_0x4cd4da,{'sessionCheckPath':_0x315507?.['sessionCheckPath'],'setupHeaders':_0x14384a},{'launchBrowser':launchRealBrowser});if(_0x1969fe)return console['log'](_0x4b76a1(0x201)+_0x4df209['name']+'\x22'),{'authPath':_0x2d146d[_0x4b76a1(0x1f6)],'settings':_0x23ba76,'resolvedEnv':_0x315507};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x4df209[_0x4b76a1(0x1eb)]+_0x4b76a1(0x212)),emitSessionValidationHint(_0x4cd4da,_0x315507);}else return{'authPath':_0x2d146d['storageStatePath'],'settings':_0x23ba76,'resolvedEnv':_0x315507};}if(_0x4df209[_0x4b76a1(0x213)]){const _0x985c0a=await _0x5c4efa['ykRaZ'](writeSessionToLocalCache,_0x4df209['name'],_0x4df209[_0x4b76a1(0x229)],_0x4cd4da,_0x14384a,_0x4df209[_0x4b76a1(0x213)],_0xb1ff67,_0x338337);if(_0x4cd4da){const _0x433ace=await _0x5c4efa['opPOh'](isCachedSessionLive,_0x985c0a,_0x4cd4da,{'sessionCheckPath':_0x315507?.['sessionCheckPath'],'setupHeaders':_0x14384a},{'launchBrowser':launchRealBrowser});if(_0x433ace)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x4df209['name']+_0x4b76a1(0x218)),{'authPath':_0x985c0a,'settings':_0x23ba76,'resolvedEnv':_0x315507};console['log'](_0x4b76a1(0x223)+_0x4df209[_0x4b76a1(0x1eb)]+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),emitSessionValidationHint(_0x4cd4da,_0x315507);}else return{'authPath':_0x985c0a,'settings':_0x23ba76,'resolvedEnv':_0x315507};}console['log']('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x4df209[_0x4b76a1(0x1eb)]+_0x4b76a1(0x220));const _0x1d6207=_0x5c4efa[_0x4b76a1(0x1dc)](Boolean,process[_0x4b76a1(0x1f5)][_0x4b76a1(0x204)])&&Boolean(process[_0x4b76a1(0x1f5)]['RANGER_TEST_PASSWORD']),_0x376f19=Boolean(_0x4df209['username']);if(_0x1d6207||_0x376f19)try{const _0x2aa8c6=await _0x5c4efa[_0x4b76a1(0x1f8)](serverSideLogin,_0x4df209['name']);if(_0x2aa8c6['status']===_0x5c4efa['hDGRt'])console[_0x4b76a1(0x1fb)]('\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...');else{if(_0x2aa8c6[_0x4b76a1(0x1d0)]==='success'&&_0x2aa8c6[_0x4b76a1(0x20d)]){console[_0x4b76a1(0x1fb)]('\x20\x20Login\x20successful.\x20Session\x20cached.');const _0x46ac92=await writeSessionToLocalCache(_0x4df209['name'],_0x4df209[_0x4b76a1(0x229)],_0x4cd4da,_0x14384a,_0x2aa8c6['session_state'],_0xb1ff67,_0x338337);return _0x1d6207&&!_0x376f19&&await promptSaveCredentials(_0x4df209['name']),{'authPath':_0x46ac92,'settings':_0x23ba76,'resolvedEnv':_0x315507};}else _0x2aa8c6['test_output']&&(console[_0x4b76a1(0x1fb)](_0x5c4efa[_0x4b76a1(0x1d3)]),console[_0x4b76a1(0x1fb)](_0x2aa8c6[_0x4b76a1(0x226)])),console[_0x4b76a1(0x1fb)](_0x5c4efa['ZotMR']);}}catch(_0x39db82){console['log'](_0x4b76a1(0x1e6)+(_0x39db82 instanceof Error?_0x39db82[_0x4b76a1(0x207)]:String(_0x39db82))),console[_0x4b76a1(0x1fb)](_0x5c4efa['ZotMR']);}const {sessionState:_0x4a043d}=await manualBrowserLogin(_0x4df209,_0x315507),_0x1938f0=await writeSessionToLocalCache(_0x4df209[_0x4b76a1(0x1eb)],_0x4df209['organizationId'],_0x4cd4da,_0x14384a,_0x4a043d,_0xb1ff67,_0x338337);return{'authPath':_0x1938f0,'settings':_0x23ba76,'resolvedEnv':_0x315507};}
|
|
1
|
+
function _0x461d(){const _0x29e42b=['env','\x22,\x20attempting\x20login...','SAuyO','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','WJwoj','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','username','clientIp','API\x20request\x20','\x22.\x0a','force','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','CgWTR','TDcFc','xHjFU','cookies','effectiveBaseUrl','/api/v1/profiles/','sessionState','newContext','YMGwc','error','toISOString','lNRUd','657320kQcvzJ','PXKUN','string','\x20\x20No\x20live\x20session\x20for\x20\x22','FXVlg','newPage','settings','yVFmP','isArray','statusText','setupHeaders','pzjPY','xpZKQ','1486572XuijEX','PUT','not_configured','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','JFlaJ','auth_config','kiiSw','domains','defaultEnvironmentKey','\x20\x20Login\x20successful.\x20Session\x20cached.','join','SvTQq','message','test_output','vTBYj','veSTa','IPAzb','5104045pYcgnk','DELETE','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','environment_key','/session','UjbuO','LAbIw','status','storageStatePath','stringify','Cloud\x20profile\x20\x22','goto','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','headers','cli:manual-login','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','detail','2431899ibnqFo','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','ORbdR','some','code','\x20\x20Server-side\x20login\x20error:\x20','wazfo','Browser\x20login\x20timed\x20out\x20after\x20','application/json','RHAoK','STLSi','name','sessionCheckPath','profiles','RANGER_TEST_USERNAME','log','\x20failed\x20(','utf-8','PhKnU','77YWRUcr','gArYt','\x22\x20failed\x20validation\x20—\x20refreshing...','organizationId','UOZNT','userAgent','XZgOI','invalidateOn','json','\x22,\x20cached\x20locally','JBFtO','launch','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','push','baseUrl','UrDUg','success','gUWxN','YgvaA','aWsxV','origin','WEaRe','WTzjg','1638ahUWNH','8161821oQogow','length','password','RANGER_TEST_PASSWORD','kPNYn','):\x20','GcUBa','1416azAfDK','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','mTTzX','2938672wykqXz','close'];_0x461d=function(){return _0x29e42b;};return _0x461d();}const _0x2bc529=_0xf910;function _0xf910(_0x4c071b,_0x37b87a){_0x4c071b=_0x4c071b-0x1dd;const _0x461d13=_0x461d();let _0xf91049=_0x461d13[_0x4c071b];return _0xf91049;}(function(_0x4cc419,_0x2484f5){const _0x35579d=_0xf910,_0x1e0f5e=_0x4cc419();while(!![]){try{const _0x499c4c=-parseInt(_0x35579d(0x20d))/0x1*(-parseInt(_0x35579d(0x215))/0x2)+parseInt(_0x35579d(0x1e3))/0x3+-parseInt(_0x35579d(0x218))/0x4+parseInt(_0x35579d(0x250))/0x5+parseInt(_0x35579d(0x23f))/0x6+parseInt(_0x35579d(0x1f6))/0x7*(-parseInt(_0x35579d(0x232))/0x8)+-parseInt(_0x35579d(0x20e))/0x9;if(_0x499c4c===_0x2484f5)break;else _0x1e0f5e['push'](_0x1e0f5e['shift']());}catch(_0x1eb3fa){_0x1e0f5e['push'](_0x1e0f5e['shift']());}}}(_0x461d,0xa9534));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x2edc44 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 _0x324815={'TSzad':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x817e9e=await getToken();if(!_0x817e9e)throw new Error(_0x324815['TSzad']);return _0x817e9e;}async function apiRequest(_0x4eef30,_0x2fe906={}){const _0x550541=_0xf910,_0x3603a2={'CPotW':function(_0x150f5f,_0x118394,_0xa9f890){return _0x150f5f(_0x118394,_0xa9f890);},'MDBtI':function(_0x532962,_0x49dc66){return _0x532962===_0x49dc66;},'FXVlg':_0x550541(0x234)},_0x42bff7=await requireToken(),_0x1e877b=getApiBaseUrl(),_0x187212=await _0x3603a2['CPotW'](fetch,''+_0x1e877b+_0x4eef30,{..._0x2fe906,'headers':{'Authorization':'Bearer\x20'+_0x42bff7,'Content-Type':_0x550541(0x1eb),..._0x2fe906[_0x550541(0x1df)]??{}}});if(!_0x187212['ok']){let _0x57bfcc='',_0x16b3a7;try{const _0x5143ee=await _0x187212['json']();_0x57bfcc=(_0x3603a2['MDBtI'](typeof _0x5143ee[_0x550541(0x22f)],_0x3603a2[_0x550541(0x236)])?_0x5143ee['error']:undefined)??JSON['stringify'](_0x5143ee);if(typeof _0x5143ee['code']===_0x550541(0x234))_0x16b3a7=_0x5143ee['code'];}catch{_0x57bfcc=_0x187212[_0x550541(0x23b)];}throw new ApiError(_0x550541(0x222)+_0x4eef30+_0x550541(0x1f3)+_0x187212[_0x550541(0x257)]+_0x550541(0x213)+_0x57bfcc,_0x187212[_0x550541(0x257)],_0x57bfcc,_0x16b3a7);}if(_0x3603a2['MDBtI'](_0x187212[_0x550541(0x257)],0xcc))return undefined;return _0x187212[_0x550541(0x1fe)]();}export class ApiError extends Error{[_0x2bc529(0x257)];[_0x2bc529(0x1e2)];[_0x2bc529(0x1e7)];constructor(_0x5607e2,_0x3df058,_0x45430d,_0x43fbf1){const _0x1c1cd9=_0x2bc529;super(_0x5607e2),this[_0x1c1cd9(0x257)]=_0x3df058,this[_0x1c1cd9(0x1e2)]=_0x45430d,this[_0x1c1cd9(0x1e7)]=_0x43fbf1,this[_0x1c1cd9(0x1ee)]='ApiError';}}export async function fetchCloudProfile(_0x3d9b12){const _0x5812fa=_0x2bc529,_0x1fc7c6={'STLSi':function(_0x3f6969,_0x300fab){return _0x3f6969(_0x300fab);},'UjbuO':function(_0x84bbbf,_0x4c766b){return _0x84bbbf(_0x4c766b);}};try{return await _0x1fc7c6[_0x5812fa(0x1ed)](apiRequest,_0x5812fa(0x22b)+_0x1fc7c6[_0x5812fa(0x255)](encodeURIComponent,_0x3d9b12));}catch(_0x54b38f){if(_0x54b38f instanceof ApiError&&_0x54b38f[_0x5812fa(0x257)]===0x194)return null;throw _0x54b38f;}}export async function listCloudProfiles(){const _0x2bb991=_0x2bc529,_0x39c15f=await apiRequest('/api/v1/profiles');return _0x39c15f[_0x2bb991(0x1f0)];}export async function deleteCloudProfile(_0x146c29){const _0x26a1c0=_0x2bc529,_0xb8ca8c={'TLBoD':function(_0x2e5700,_0x721a92){return _0x2e5700(_0x721a92);},'mFZaL':function(_0x524b39,_0x1f4794){return _0x524b39 instanceof _0x1f4794;}};try{await apiRequest(_0x26a1c0(0x22b)+_0xb8ca8c['TLBoD'](encodeURIComponent,_0x146c29),{'method':_0x26a1c0(0x251)});}catch(_0x24b60a){if(_0xb8ca8c['mFZaL'](_0x24b60a,ApiError)&&_0x24b60a['status']===0x194)throw new Error(_0x26a1c0(0x25a)+_0x146c29+'\x22\x20not\x20found.');throw _0x24b60a;}}export async function createCloudProfile(_0x307dcf,_0x3f99da,_0x38083e={}){const _0x525d45=_0x2bc529,_0x941a59={'MAJuJ':function(_0x3596da,_0x5b72ea,_0x2499ce){return _0x3596da(_0x5b72ea,_0x2499ce);},'dHQXk':'/api/v1/profiles','kYVUI':'POST'},_0x311ed4={'name':_0x307dcf};if(_0x3f99da)_0x311ed4[_0x525d45(0x253)]=_0x3f99da;_0x38083e['settings']&&Object['keys'](_0x38083e['settings'])[_0x525d45(0x20f)]>0x0&&(_0x311ed4[_0x525d45(0x238)]=_0x38083e[_0x525d45(0x238)]);if(_0x38083e['username'])_0x311ed4['username']=_0x38083e[_0x525d45(0x220)];if(_0x38083e[_0x525d45(0x210)])_0x311ed4['password']=_0x38083e['password'];return await _0x941a59['MAJuJ'](apiRequest,_0x941a59['dHQXk'],{'method':_0x941a59['kYVUI'],'body':JSON['stringify'](_0x311ed4)});}export async function uploadCloudProfileSession(_0x2030c8,_0x7b31d8){const _0x2485b2=_0x2bc529,_0x2a5c3f={'xHjFU':function(_0x52e929,_0x3d792d,_0x46c87f){return _0x52e929(_0x3d792d,_0x46c87f);}};return await _0x2a5c3f[_0x2485b2(0x228)](apiRequest,_0x2485b2(0x22b)+encodeURIComponent(_0x2030c8)+_0x2485b2(0x254),{'method':'POST','body':JSON[_0x2485b2(0x259)]({'session_state':_0x7b31d8})});}export async function saveCloudProfileCredentials(_0x3b6fca,_0x58d542,_0x516637){const _0x5e5c81=_0x2bc529,_0x7bd087={'LAbIw':function(_0x235e50,_0x5c7dfc,_0x2379b1){return _0x235e50(_0x5c7dfc,_0x2379b1);},'wazfo':'PUT'};await _0x7bd087[_0x5e5c81(0x256)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x3b6fca),{'method':_0x7bd087[_0x5e5c81(0x1e9)],'body':JSON[_0x5e5c81(0x259)]({'username':_0x58d542,'password':_0x516637})});}export async function fetchAuthConfig(){const _0x53dff0=_0x2bc529,_0x175317={'lNRUd':'/api/v1/profiles/auth-config'};try{const _0x138a14=await apiRequest(_0x175317[_0x53dff0(0x231)]);return _0x138a14[_0x53dff0(0x244)];}catch(_0x4a4fbf){return _0x4a4fbf instanceof ApiError&&_0x4a4fbf[_0x53dff0(0x257)]!==0x194&&console['error'](_0x53dff0(0x21f)+_0x4a4fbf[_0x53dff0(0x24b)]),null;}}export function pickAdHocEnvKey(_0x350e3d){const _0x50dfc4=_0x2bc529,_0x32a4e0={'oNcHZ':function(_0x11ca56,_0x4f6819){return _0x11ca56===_0x4f6819;}};if(!_0x350e3d)return null;if(_0x350e3d[_0x50dfc4(0x247)])return _0x350e3d[_0x50dfc4(0x247)];const _0x3f0934=Object['keys'](_0x350e3d['environments']??{});if(_0x32a4e0['oNcHZ'](_0x3f0934['length'],0x1))return _0x3f0934[0x0];if(_0x32a4e0['oNcHZ'](_0x3f0934['length'],0x0))return null;throw new Error(_0x50dfc4(0x202)+_0x3f0934['join'](',\x20')+').\x20'+'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.');}export async function resolveAdHocProfile(_0x59ba7e=process[_0x2bc529(0x21a)]){const _0x1e1dd9=_0x2bc529,_0x231537={'cnzwL':function(_0x35fb74){return _0x35fb74();},'cRXtH':function(_0x72e9db,_0x12bc15){return _0x72e9db(_0x12bc15);},'zufrr':function(_0x559a39,_0x36d0e4,_0x180175,_0x4ca2c8){return _0x559a39(_0x36d0e4,_0x180175,_0x4ca2c8);},'YgvaA':function(_0x57e82e,_0x23aa8a){return _0x57e82e??_0x23aa8a;}},_0x4df4f6=_0x59ba7e['RANGER_TEST_USERNAME'];if(!_0x4df4f6)return null;const _0x34371a=await fetchCloudProfile(_0x4df4f6);if(_0x34371a)return{'name':_0x34371a['name'],'profile':_0x34371a};const _0x5782f7=await _0x231537['cnzwL'](fetchAuthConfig),_0x11ed09=_0x231537['cRXtH'](pickAdHocEnvKey,_0x5782f7),_0x11374e=_0x59ba7e[_0x1e1dd9(0x211)],_0x3508f3=await _0x231537['zufrr'](createCloudProfile,_0x4df4f6,_0x231537[_0x1e1dd9(0x208)](_0x11ed09,undefined),{'username':_0x4df4f6,'password':_0x11374e});return console[_0x1e1dd9(0x1f2)]('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x3508f3['name']+'\x22\x20for\x20'+_0x4df4f6),{'name':_0x3508f3[_0x1e1dd9(0x1ee)],'profile':_0x3508f3};}export async function writeSessionToLocalCache(_0x4dcf74,_0x1e2797,_0x21da83,_0xd36fd0,_0x2beb1b,_0x182a05,_0x31fa04){const _0x39efbb=_0x2bc529,_0x5bfd59={'kiiSw':function(_0x415629,_0x495458){return _0x415629(_0x495458);},'WJwoj':function(_0xf4a3d0,_0x2c38a1,_0x55beb7){return _0xf4a3d0(_0x2c38a1,_0x55beb7);},'mTTzX':function(_0x304598){return _0x304598();},'RHAoK':function(_0x4cfa7a,_0x145436){return _0x4cfa7a>_0x145436;},'TDcFc':function(_0x37078f,_0x391d47,_0x4c5b55){return _0x37078f(_0x391d47,_0x4c5b55);},'WTzjg':function(_0x415ba0,_0x231b6f,_0x76a263){return _0x415ba0(_0x231b6f,_0x76a263);},'grLBN':function(_0x135a3b,_0x3f82e5){return _0x135a3b(_0x3f82e5);}},_0x7d6be0=_0x5bfd59[_0x39efbb(0x245)](sessionCacheHash,{'orgId':_0x1e2797,'profileName':_0x4dcf74,'effectiveBaseUrl':_0x21da83,'setupHeaders':_0xd36fd0,'invalidateOn':_0x31fa04?.[_0x39efbb(0x1fd)],'userAgent':_0x31fa04?.[_0x39efbb(0x1fb)],'clientIp':_0x31fa04?.['clientIp']}),_0x515468=getSessionCachePath(_0x7d6be0,_0x4dcf74),_0xdb66f2=_0x5bfd59[_0x39efbb(0x21e)](join,_0x5bfd59[_0x39efbb(0x217)](getRangerHomeDir),'auth');!existsSync(_0xdb66f2)&&await mkdir(_0xdb66f2,{'recursive':!![]});const _0x350c1d={..._0x2beb1b};_0x182a05&&_0x5bfd59[_0x39efbb(0x1ec)](_0x182a05[_0x39efbb(0x20f)],0x0)&&Array[_0x39efbb(0x23a)](_0x350c1d['cookies'])&&(_0x350c1d[_0x39efbb(0x229)]=_0x5bfd59[_0x39efbb(0x227)](duplicateCookiesForDomains,_0x350c1d['cookies'],_0x182a05));const _0xf9bd6e={'cached_at':new Date()[_0x39efbb(0x230)](),'session_state':_0x350c1d};await _0x5bfd59['WTzjg'](writeFile,_0x515468,JSON['stringify'](_0xf9bd6e,null,0x2));const _0x46ad8c=_0x5bfd59['grLBN'](getStorageStatePath,_0x515468);return await _0x5bfd59[_0x39efbb(0x20c)](writeFile,_0x46ad8c,JSON['stringify'](_0x350c1d,null,0x2)),_0x46ad8c;}export async function checkLocalCache(_0x40d1c4,_0x9a106b,_0x25c4a6,_0x3fc3a6,_0x7c2df4){const _0x2f90ee=_0x2bc529,_0x3f8e4e={'yzReZ':function(_0x9e364,_0x19ba5f,_0x5d39b5){return _0x9e364(_0x19ba5f,_0x5d39b5);},'fdGJZ':function(_0x43bb51,_0x48210b){return _0x43bb51(_0x48210b);},'wNlfZ':function(_0x2f7a4e,_0x112301,_0x1ebd34){return _0x2f7a4e(_0x112301,_0x1ebd34);}},_0x1789e6=sessionCacheHash({'orgId':_0x9a106b,'profileName':_0x40d1c4,'effectiveBaseUrl':_0x25c4a6,'setupHeaders':_0x3fc3a6,'invalidateOn':_0x7c2df4?.[_0x2f90ee(0x1fd)],'userAgent':_0x7c2df4?.[_0x2f90ee(0x1fb)],'clientIp':_0x7c2df4?.[_0x2f90ee(0x221)]}),_0x1a74fa=_0x3f8e4e['yzReZ'](getSessionCachePath,_0x1789e6,_0x40d1c4),_0x1efec1=_0x3f8e4e['fdGJZ'](getStorageStatePath,_0x1a74fa);if(!existsSync(_0x1a74fa)||!existsSync(_0x1efec1))return null;try{const _0xae4c60=await _0x3f8e4e['wNlfZ'](readFile,_0x1a74fa,_0x2f90ee(0x1f4));return JSON['parse'](_0xae4c60),{'storageStatePath':_0x1efec1};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x563c28,_0x9253c3){const _0x38400d=_0x2bc529,_0x3270b1={'ptVBG':function(_0x3044c3,_0x226dca){return _0x3044c3+_0x226dca;}};if(!_0x9253c3||!_0x9253c3[_0x38400d(0x246)]?.[_0x38400d(0x20f)])return;let _0x2b4802;try{_0x2b4802=new URL(_0x563c28);}catch{return;}const _0x18aa88=[];for(const _0x556223 of _0x9253c3[_0x38400d(0x246)]){try{_0x18aa88[_0x38400d(0x203)]({'raw':_0x556223,'url':new URL(_0x556223)});}catch{}}if(_0x18aa88[_0x38400d(0x20f)]===0x0)return;if(_0x18aa88[_0x38400d(0x1e6)](_0x29ffff=>_0x29ffff['url']['origin']===_0x2b4802[_0x38400d(0x20a)]))return;const _0x544baf=_0x18aa88['map'](_0x1a38fb=>'\x22'+_0x1a38fb['raw']+'\x22')[_0x38400d(0x249)](',\x20');console['log'](_0x3270b1['ptVBG'](_0x3270b1['ptVBG']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x544baf+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x563c28+'\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(_0x2ff294,_0x73723d){const _0x3643d6=_0x2bc529,_0x5be189={'xpZKQ':function(_0x528077,_0x1fa991){return _0x528077===_0x1fa991;},'yVFmP':function(_0x4ad596,_0x9fc8d4){return _0x4ad596===_0x9fc8d4;}},_0x23c04e=process['env'][_0x3643d6(0x1f1)],_0x339ff8=process[_0x3643d6(0x21a)][_0x3643d6(0x211)],_0x2d30a8={};if(_0x23c04e)_0x2d30a8['username']=_0x23c04e;if(_0x339ff8)_0x2d30a8['password']=_0x339ff8;if(_0x73723d?.[_0x3643d6(0x224)])_0x2d30a8[_0x3643d6(0x224)]=!![];try{return await apiRequest(_0x3643d6(0x22b)+encodeURIComponent(_0x2ff294)+'/login',{'method':'POST','body':JSON['stringify'](_0x2d30a8)});}catch(_0x1df9ea){if(_0x1df9ea instanceof ApiError&&_0x5be189[_0x3643d6(0x23e)](_0x1df9ea['status'],0x190)&&_0x5be189[_0x3643d6(0x239)](_0x1df9ea[_0x3643d6(0x1e7)],_0x3643d6(0x241)))return{'status':'not_configured','error':_0x1df9ea[_0x3643d6(0x1e2)]};throw _0x1df9ea;}}export async function manualBrowserLogin(_0xe12a9,_0x37a3d1){const _0x473d9f=_0x2bc529,_0x3bed5d={'XZgOI':function(_0x3f8ad5,_0x28a058){return _0x3f8ad5/_0x28a058;},'PXKUN':function(_0x42db46){return _0x42db46();},'YMGwc':function(_0x195858,_0x59c77f){return _0x195858(_0x59c77f);},'vunOa':function(_0x1274ae){return _0x1274ae();},'lFMwU':_0x473d9f(0x219),'DGEfL':function(_0x3c901f,_0x202910){return _0x3c901f+_0x202910;},'rfmdR':'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','GcUBa':'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','HqFdC':function(_0x240728,_0x4524a6){return _0x240728&&_0x4524a6;},'JFlaJ':function(_0x3d92b5,_0x23bb9a,_0x3be806){return _0x3d92b5(_0x23bb9a,_0x3be806);},'YqmtF':function(_0x5b10e9,_0x4bdcac){return _0x5b10e9(_0x4bdcac);},'fYiYE':'POST','JBFtO':_0x473d9f(0x1e0)};if(!isInteractive())throw new Error(_0x3bed5d['DGEfL'](_0x473d9f(0x242)+_0xe12a9[_0x473d9f(0x1ee)]+_0x473d9f(0x223),_0x3bed5d['rfmdR'])+_0x3bed5d[_0x473d9f(0x214)]);const _0x1d2d46=_0x37a3d1&&_0x37a3d1['domains'][_0x473d9f(0x20f)]>0x0?_0x37a3d1[_0x473d9f(0x246)][0x0]:'about:blank';console[_0x473d9f(0x1f2)]('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console['log']('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x3a3a43=>setTimeout(_0x3a3a43,0x7d0));const _0x4f2d79=await chromium[_0x473d9f(0x201)]({'headless':![]});let _0x27cd5a=null;try{const _0x381665={'ignoreHTTPSErrors':!![]};_0x37a3d1?.[_0x473d9f(0x23c)]&&(_0x381665['extraHTTPHeaders']=_0x37a3d1['setupHeaders']);const _0x104896=await _0x4f2d79[_0x473d9f(0x22d)](_0x381665);await _0x3bed5d[_0x473d9f(0x22e)](addProfileSetupBanner,_0x104896);const _0x3f22c4=await _0x104896[_0x473d9f(0x237)]();await _0x3f22c4[_0x473d9f(0x1dd)](_0x1d2d46);let _0x60c656=![];await new Promise(_0x2f4670=>{const _0x59cdde={'CgWTR':function(_0x33dae2,_0x23c545){const _0x39c54a=_0xf910;return _0x3bed5d[_0x39c54a(0x22e)](_0x33dae2,_0x23c545);},'uRrxJ':function(_0x15a982){return _0x3bed5d['vunOa'](_0x15a982);}},_0x5e93d4=setTimeout(()=>{const _0x4bd3ea=_0xf910;_0x60c656=!![],console[_0x4bd3ea(0x22f)](_0x4bd3ea(0x1ea)+_0x3bed5d[_0x4bd3ea(0x1fc)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x4bd3ea(0x1e4)),_0x3bed5d[_0x4bd3ea(0x233)](_0x2f4670);},MANUAL_LOGIN_TIMEOUT_MS);_0x3f22c4['on'](_0x3bed5d['lFMwU'],async()=>{const _0x480841=_0xf910;_0x59cdde[_0x480841(0x226)](clearTimeout,_0x5e93d4);try{const _0x4df9af=await _0x104896['storageState']();_0x27cd5a=_0x4df9af;}catch{}_0x59cdde['uRrxJ'](_0x2f4670);});});if(_0x3bed5d['HqFdC'](_0x60c656,!_0x27cd5a))throw new Error('Browser\x20login\x20timed\x20out\x20before\x20completion.');}finally{await _0x4f2d79[_0x473d9f(0x219)]()['catch'](()=>{});}if(!_0x27cd5a)throw new Error('Browser\x20closed\x20before\x20authentication\x20was\x20saved.');return await _0x3bed5d[_0x473d9f(0x243)](apiRequest,'/api/v1/profiles/'+_0x3bed5d['YqmtF'](encodeURIComponent,_0xe12a9[_0x473d9f(0x1ee)])+'/session',{'method':_0x3bed5d['fYiYE'],'body':JSON[_0x473d9f(0x259)]({'session_state':_0x27cd5a,'updated_by':_0x3bed5d[_0x473d9f(0x200)]})}),{'sessionState':_0x27cd5a};}export async function promptSaveCredentials(_0x9aa37c){const _0x34be45=_0x2bc529,_0xc5e48c={'veSTa':function(_0x240deb,_0x4247b8){return _0x240deb||_0x4247b8;},'gUWxN':function(_0x41ce9f){return _0x41ce9f();},'pNAeR':_0x34be45(0x1e1),'gArYt':_0x34be45(0x240),'hwgcF':_0x34be45(0x252)},_0x5d52d3=process['env']['RANGER_TEST_USERNAME'],_0x366857=process[_0x34be45(0x21a)]['RANGER_TEST_PASSWORD'];if(_0xc5e48c[_0x34be45(0x24e)](!_0x5d52d3,!_0x366857))return;if(!_0xc5e48c[_0x34be45(0x207)](isInteractive))return;const {save:_0x436f4a}=await _0x2edc44['prompt']([{'type':'confirm','name':'save','message':_0xc5e48c['pNAeR'],'default':![]}]);if(!_0x436f4a)return;await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x9aa37c),{'method':_0xc5e48c[_0x34be45(0x1f7)],'body':JSON[_0x34be45(0x259)]({'username':_0x5d52d3,'password':_0x366857})}),console['log'](_0xc5e48c['hwgcF']);}export async function resolveCloudProfileSession(_0xdecb94,_0x5eb88c={}){const _0x26dcdc=_0x2bc529,_0x3d6a2a={'SAuyO':function(_0x525636,_0x46b5c1,_0x18ebd9){return _0x525636(_0x46b5c1,_0x18ebd9);},'vTBYj':function(_0x17d71b,_0x7d541f){return _0x17d71b>_0x7d541f;},'IPAzb':function(_0x45a7d4,_0x5825ed,_0x45daf1,_0x3fb82e,_0x2fb2a7,_0x520cbb){return _0x45a7d4(_0x5825ed,_0x45daf1,_0x3fb82e,_0x2fb2a7,_0x520cbb);},'KLaWV':function(_0x446569,_0x7864cb,_0x585dde,_0x10be23,_0x381b46){return _0x446569(_0x7864cb,_0x585dde,_0x10be23,_0x381b46);},'kPNYn':function(_0x4b37c7,_0x3a99c1){return _0x4b37c7(_0x3a99c1);},'SvTQq':function(_0x17198c,_0x53d42b){return _0x17198c||_0x53d42b;},'WEaRe':function(_0x45405f,_0x5663ae){return _0x45405f(_0x5663ae);},'cRWbY':_0x26dcdc(0x241),'UrDUg':_0x26dcdc(0x225),'aWsxV':_0x26dcdc(0x206),'pzjPY':_0x26dcdc(0x248),'wBMBu':function(_0x579e19,_0x4ff2ad,_0x394408,_0x537928,_0xea36ca,_0x1818e4,_0x293a7a,_0x3cc5a3){return _0x579e19(_0x4ff2ad,_0x394408,_0x537928,_0xea36ca,_0x1818e4,_0x293a7a,_0x3cc5a3);},'PhKnU':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','ORbdR':_0x26dcdc(0x216),'UOZNT':function(_0x252d2b,_0xa99d2b){return _0x252d2b instanceof _0xa99d2b;}},_0x1b4f4a=_0xdecb94['settings']??{},_0x2a85a6=await fetchAuthConfig(),_0x2c3f5b=_0x2a85a6?_0x3d6a2a[_0x26dcdc(0x21c)](resolveAuthEnvironmentLocally,_0x2a85a6,_0xdecb94['environmentKey']):null,_0x10c1ea=_0x2c3f5b?.['domains'],_0xab711e=_0x1b4f4a[_0x26dcdc(0x23c)],_0x4555b2=_0xab711e??_0x2c3f5b?.['setupHeaders'],_0x1d5369=_0x5eb88c[_0x26dcdc(0x22a)]??_0x1b4f4a[_0x26dcdc(0x204)]??(_0x10c1ea&&_0x3d6a2a[_0x26dcdc(0x24d)](_0x10c1ea[_0x26dcdc(0x20f)],0x0)?_0x10c1ea[0x0]:''),_0x264e2d={'invalidateOn':_0x2c3f5b?.[_0x26dcdc(0x1fd)],'userAgent':_0x2c3f5b?.['browserOptions']?.[_0x26dcdc(0x1fb)]??_0x1b4f4a[_0x26dcdc(0x1fb)]},_0x3794f8=await _0x3d6a2a[_0x26dcdc(0x24f)](checkLocalCache,_0xdecb94['name'],_0xdecb94[_0x26dcdc(0x1f9)],_0x1d5369,_0x4555b2,_0x264e2d);if(_0x3794f8){if(_0x1d5369){const _0xc2ef34=await _0x3d6a2a['KLaWV'](isCachedSessionLive,_0x3794f8[_0x26dcdc(0x258)],_0x1d5369,{'sessionCheckPath':_0x2c3f5b?.['sessionCheckPath'],'setupHeaders':_0x4555b2},{'launchBrowser':launchRealBrowser});if(_0xc2ef34)return console['log']('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0xdecb94['name']+'\x22'),{'authPath':_0x3794f8['storageStatePath'],'settings':_0x1b4f4a,'resolvedEnv':_0x2c3f5b};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0xdecb94['name']+_0x26dcdc(0x1f8)),emitSessionValidationHint(_0x1d5369,_0x2c3f5b);}else return{'authPath':_0x3794f8['storageStatePath'],'settings':_0x1b4f4a,'resolvedEnv':_0x2c3f5b};}if(_0xdecb94['sessionState']){const _0x39f0c6=await writeSessionToLocalCache(_0xdecb94[_0x26dcdc(0x1ee)],_0xdecb94[_0x26dcdc(0x1f9)],_0x1d5369,_0x4555b2,_0xdecb94[_0x26dcdc(0x22c)],_0x10c1ea,_0x264e2d);if(_0x1d5369){const _0x3dd579=await isCachedSessionLive(_0x39f0c6,_0x1d5369,{'sessionCheckPath':_0x2c3f5b?.[_0x26dcdc(0x1ef)],'setupHeaders':_0x4555b2},{'launchBrowser':launchRealBrowser});if(_0x3dd579)return console[_0x26dcdc(0x1f2)](_0x26dcdc(0x21d)+_0xdecb94[_0x26dcdc(0x1ee)]+_0x26dcdc(0x1ff)),{'authPath':_0x39f0c6,'settings':_0x1b4f4a,'resolvedEnv':_0x2c3f5b};console[_0x26dcdc(0x1f2)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0xdecb94['name']+_0x26dcdc(0x1de)),emitSessionValidationHint(_0x1d5369,_0x2c3f5b);}else return{'authPath':_0x39f0c6,'settings':_0x1b4f4a,'resolvedEnv':_0x2c3f5b};}console['log'](_0x26dcdc(0x235)+_0xdecb94[_0x26dcdc(0x1ee)]+_0x26dcdc(0x21b));const _0x267187=Boolean(process['env']['RANGER_TEST_USERNAME'])&&Boolean(process[_0x26dcdc(0x21a)]['RANGER_TEST_PASSWORD']),_0x55ff29=_0x3d6a2a[_0x26dcdc(0x212)](Boolean,_0xdecb94[_0x26dcdc(0x220)]);if(_0x3d6a2a[_0x26dcdc(0x24a)](_0x267187,_0x55ff29))try{const _0x264638=await _0x3d6a2a['WEaRe'](serverSideLogin,_0xdecb94['name']);if(_0x264638['status']===_0x3d6a2a['cRWbY'])console[_0x26dcdc(0x1f2)](_0x3d6a2a[_0x26dcdc(0x205)]);else{if(_0x264638['status']===_0x3d6a2a[_0x26dcdc(0x209)]&&_0x264638['session_state']){console['log'](_0x3d6a2a[_0x26dcdc(0x23d)]);const _0x4f75c0=await _0x3d6a2a['wBMBu'](writeSessionToLocalCache,_0xdecb94['name'],_0xdecb94['organizationId'],_0x1d5369,_0x4555b2,_0x264638['session_state'],_0x10c1ea,_0x264e2d);return _0x267187&&!_0x55ff29&&await promptSaveCredentials(_0xdecb94[_0x26dcdc(0x1ee)]),{'authPath':_0x4f75c0,'settings':_0x1b4f4a,'resolvedEnv':_0x2c3f5b};}else _0x264638[_0x26dcdc(0x24c)]&&(console['log'](_0x3d6a2a[_0x26dcdc(0x1f5)]),console[_0x26dcdc(0x1f2)](_0x264638['test_output'])),console['log'](_0x3d6a2a[_0x26dcdc(0x1e5)]);}}catch(_0x4fc574){console[_0x26dcdc(0x1f2)](_0x26dcdc(0x1e8)+(_0x3d6a2a[_0x26dcdc(0x1fa)](_0x4fc574,Error)?_0x4fc574[_0x26dcdc(0x24b)]:_0x3d6a2a[_0x26dcdc(0x20b)](String,_0x4fc574))),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const {sessionState:_0x361285}=await manualBrowserLogin(_0xdecb94,_0x2c3f5b),_0x35b719=await writeSessionToLocalCache(_0xdecb94['name'],_0xdecb94[_0x26dcdc(0x1f9)],_0x1d5369,_0x4555b2,_0x361285,_0x10c1ea,_0x264e2d);return{'authPath':_0x35b719,'settings':_0x1b4f4a,'resolvedEnv':_0x2c3f5b};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const _0xc3898e=_0x3c30;(function(_0x45d393,_0x349111){const _0x5cbbad=_0x3c30,_0x439144=_0x45d393();while(!![]){try{const _0x48d79a=-parseInt(_0x5cbbad(0xb8))/0x1+parseInt(_0x5cbbad(0xdb))/0x2*(parseInt(_0x5cbbad(0xbc))/0x3)+parseInt(_0x5cbbad(0xc5))/0x4*(-parseInt(_0x5cbbad(0xc9))/0x5)+parseInt(_0x5cbbad(0xa6))/0x6+parseInt(_0x5cbbad(0xa8))/0x7+-parseInt(_0x5cbbad(0xbb))/0x8*(parseInt(_0x5cbbad(0xd7))/0x9)+-parseInt(_0x5cbbad(0xcd))/0xa*(-parseInt(_0x5cbbad(0xb5))/0xb);if(_0x48d79a===_0x349111)break;else _0x439144['push'](_0x439144['shift']());}catch(_0x25a1f1){_0x439144['push'](_0x439144['shift']());}}}(_0x957a,0x5eb2c));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x331c73=process[_0xc3898e(0xdd)],_0x18760f={'stdin':process['stdin'],'stdout':process['stdout']}){const _0x870621=_0xc3898e,_0x5db3ee={'AFDHE':function(_0x414938,_0x3250b1){return _0x414938(_0x3250b1);}};if(_0x331c73['CI'])return![];return Boolean(_0x18760f[_0x870621(0xb6)][_0x870621(0xdc)])&&_0x5db3ee['AFDHE'](Boolean,_0x18760f[_0x870621(0xad)][_0x870621(0xdc)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x1a39a3){const _0x4c7f24=_0xc3898e,_0x136025={'pnmlH':function(_0x4da471,_0x1cf751){return _0x4da471(_0x1cf751);},'VJKED':'port','EvJnw':function(_0x5a4654,_0x58a5ba){return _0x5a4654(_0x58a5ba);},'kRMoO':function(_0x328a4c,_0x2156b4){return _0x328a4c!==_0x2156b4;},'VacFL':_0x4c7f24(0xcf)},_0x2e5e81=new Set(_0x1a39a3[_0x4c7f24(0xc7)]??DEFAULT_INVALIDATE_ON),_0x51c230={'orgId':_0x1a39a3['orgId'],'profileName':_0x1a39a3[_0x4c7f24(0xcc)]};return _0x2e5e81[_0x4c7f24(0xb3)](_0x4c7f24(0xd3))&&(_0x51c230['effectiveBaseUrl']=_0x1a39a3['effectiveBaseUrl']),_0x2e5e81['has'](_0x4c7f24(0xcb))&&(_0x51c230['setupHeaders']=_0x1a39a3['setupHeaders']?_0x136025['pnmlH'](sortObjectKeys,_0x1a39a3['setupHeaders']):_0x1a39a3[_0x4c7f24(0xcb)]),_0x2e5e81['has'](_0x136025['VJKED'])&&(_0x51c230[_0x4c7f24(0xca)]=_0x136025[_0x4c7f24(0xaf)](extractPort,_0x1a39a3['effectiveBaseUrl'])),_0x2e5e81['has']('userAgent')&&_0x136025[_0x4c7f24(0xc1)](_0x1a39a3[_0x4c7f24(0xa9)],undefined)&&(_0x51c230[_0x4c7f24(0xa9)]=_0x1a39a3['userAgent']),_0x2e5e81['has'](_0x4c7f24(0xc3))&&_0x1a39a3[_0x4c7f24(0xc3)]!==undefined&&(_0x51c230['clientIp']=_0x1a39a3['clientIp']),createHash(_0x4c7f24(0xd1))['update'](JSON['stringify'](_0x51c230))[_0x4c7f24(0xac)](_0x136025['VacFL'])[_0x4c7f24(0xaa)](0x0,0xc);}function extractPort(_0x7202f7){const _0x335af1=_0xc3898e;try{return new URL(_0x7202f7)[_0x335af1(0xca)];}catch{return'';}}function sortObjectKeys(_0x248e70){const _0x38034a={};for(const _0x36d078 of Object['keys'](_0x248e70)['sort']()){_0x38034a[_0x36d078]=_0x248e70[_0x36d078];}return _0x38034a;}export function getSessionCachePath(_0xbd2c4a,_0x2c24e0){const _0x153363=_0xc3898e,_0x18be70={'lIUWD':function(_0x3cfe0b,_0x5d9da5,_0x58a8ec,_0x4d9d6e){return _0x3cfe0b(_0x5d9da5,_0x58a8ec,_0x4d9d6e);},'vKAyL':function(_0x5c9dbc){return _0x5c9dbc();}};return _0x18be70[_0x153363(0xae)](join,_0x18be70[_0x153363(0xb0)](getRangerHomeDir),_0x153363(0xda),_0xbd2c4a+'-'+_0x2c24e0+'.json');}export function getStorageStatePath(_0xb3dd5e){const _0x2764af=_0xc3898e,_0x368cf9={'sPdJk':'.storageState.json'};return _0xb3dd5e['replace'](/\.json$/,_0x368cf9[_0x2764af(0xc4)]);}export function needsTunnel(_0x58f397){const _0xf76e7=_0xc3898e,_0x3da8a2={'mdGsH':_0xf76e7(0xde),'vocVP':function(_0x3d7e88,_0xa1ebda){return _0x3d7e88===_0xa1ebda;},'yxjYd':_0xf76e7(0xb7)};let _0xb398be;try{_0xb398be=new URL(_0x58f397)[_0xf76e7(0xbf)];}catch{return![];}if(_0xb398be===_0x3da8a2['mdGsH']||_0x3da8a2['vocVP'](_0xb398be,_0x3da8a2['yxjYd']))return!![];if(_0xb398be[_0xf76e7(0xd9)](_0xf76e7(0xd4)))return!![];if(_0xb398be[_0xf76e7(0xe1)](_0xf76e7(0xc6)))return!![];return![];}export function hostnameOf(_0x148518){const _0x3525e2=_0xc3898e;return new URL(_0x148518)[_0x3525e2(0xbf)];}export function duplicateCookiesForDomains(_0x556a0d,_0x5d4a1d){const _0x17970f=_0xc3898e,_0x8d6000={'qvmID':function(_0x182f00,_0x21359d){return _0x182f00(_0x21359d);}},_0x363ea1=[..._0x556a0d],_0x497dab=new Set(_0x556a0d[_0x17970f(0xdf)](_0x15fa72=>_0x15fa72[_0x17970f(0xb2)]));for(const _0x157274 of _0x5d4a1d){let _0x535ebd;try{_0x535ebd=_0x8d6000[_0x17970f(0xc0)](hostnameOf,_0x157274);}catch{continue;}if(!_0x535ebd)continue;const _0x2202d9=_0x535ebd[_0x17970f(0xd0)]('.')?_0x535ebd:'.'+_0x535ebd;if(_0x497dab['has'](_0x535ebd)||_0x497dab['has'](_0x2202d9))continue;for(const _0xd5ac59 of _0x556a0d){_0x363ea1[_0x17970f(0xb4)]({..._0xd5ac59,'domain':_0x2202d9});}_0x497dab[_0x17970f(0xc8)](_0x2202d9);}return _0x363ea1;}export function resolveAuthEnvironmentLocally(_0x797ccd,_0x1c11ef){const _0x5a1ba7=_0xc3898e,_0x142366=_0x797ccd['environments'];if(_0x1c11ef){const _0x11368f=_0x142366[_0x1c11ef];if(!_0x11368f)return null;return{'key':_0x1c11ef,..._0x11368f};}if(_0x797ccd['defaultEnvironmentKey']){const _0x2a4055=_0x142366[_0x797ccd['defaultEnvironmentKey']];if(!_0x2a4055)return null;return{'key':_0x797ccd[_0x5a1ba7(0xd8)],..._0x2a4055};}const _0x4b0d32=Object[_0x5a1ba7(0xe0)](_0x142366);if(_0x4b0d32['length']===0x1){const _0x548127=_0x4b0d32[0x0];return{'key':_0x548127,..._0x142366[_0x548127]};}return null;}function _0x957a(){const _0x337d2f=['map','keys','includes','3607656fwuIMr','pathname','911204ITzmVG','userAgent','slice','test','digest','stdout','lIUWD','EvJnw','vKAyL','newPage','domain','has','push','11LgvFEk','stdin','127.0.0.1','698697JcMeaK','status','goto','952ZBkbdn','8673QOarzk','sessionCheckPath','launchBrowser','hostname','qvmID','kRMoO','toString','clientIp','sPdJk','112BUgCwB','localhost.','invalidateOn','add','93835HEAztQ','port','setupHeaders','profileName','12653150lMVHgL','close','hex','startsWith','sha256','newContext','baseUrl','.localhost','catch','IOUyh','52272xUhkCN','defaultEnvironmentKey','endsWith','auth','212FkArUd','isTTY','env','localhost'];_0x957a=function(){return _0x337d2f;};return _0x957a();}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;function _0x3c30(_0x3c2511,_0x35292e){_0x3c2511=_0x3c2511-0xa6;const _0x957a13=_0x957a();let _0x3c301f=_0x957a13[_0x3c2511];return _0x3c301f;}export function buildSessionCheckUrl(_0x36e01e,_0x230db6){const _0x744a6f=_0xc3898e;try{if(_0x230db6)return new URL(_0x230db6,_0x36e01e)['toString']();return new URL(_0x36e01e)[_0x744a6f(0xc2)]();}catch{return null;}}export function looksLikeLoginUrl(_0x1411de){const _0x44ffa6=_0xc3898e;try{const _0x16757a=new URL(_0x1411de);return LOGIN_URL_PATTERN[_0x44ffa6(0xab)](_0x16757a[_0x44ffa6(0xa7)]);}catch{return LOGIN_URL_PATTERN['test'](_0x1411de);}}export async function isCachedSessionLive(_0x29f1a8,_0x4e65c3,_0xbc0087={},_0x486892={}){const _0x2c1975=_0xc3898e,_0x33e976={'IOUyh':function(_0xa4f093,_0x397879,_0xe4634b){return _0xa4f093(_0x397879,_0xe4634b);}},_0x2808ad=_0x33e976[_0x2c1975(0xd6)](buildSessionCheckUrl,_0x4e65c3,_0xbc0087[_0x2c1975(0xbd)]);if(!_0x2808ad)return!![];if(!_0x486892['launchBrowser'])return!![];let _0x1c195c=null;try{_0x1c195c=await _0x486892[_0x2c1975(0xbe)]();const _0x5ec116=await _0x1c195c[_0x2c1975(0xd2)]({'storageState':_0x29f1a8,'ignoreHTTPSErrors':!![],..._0xbc0087[_0x2c1975(0xcb)]?{'extraHTTPHeaders':_0xbc0087[_0x2c1975(0xcb)]}:{}}),_0x78cb1a=await _0x5ec116[_0x2c1975(0xb1)](),_0x3e6714=await _0x78cb1a[_0x2c1975(0xba)](_0x2808ad,{'waitUntil':'domcontentloaded','timeout':0x3a98}),_0x3adc0f=_0x3e6714?.[_0x2c1975(0xb9)]();if(_0x3adc0f===0x191||_0x3adc0f===0x193)return![];const _0x4c9c89=_0x78cb1a['url']();if(looksLikeLoginUrl(_0x4c9c89))return![];return!![];}catch{return![];}finally{if(_0x1c195c)await _0x1c195c[_0x2c1975(0xce)]()[_0x2c1975(0xd5)](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x40631f,_0x585e8a){const _0x9af661=_0x24af,_0x53609f=_0x40631f();while(!![]){try{const _0x5b384d=-parseInt(_0x9af661(0xd0))/0x1+parseInt(_0x9af661(0xc7))/0x2*(-parseInt(_0x9af661(0xcd))/0x3)+parseInt(_0x9af661(0xd2))/0x4*(parseInt(_0x9af661(0xda))/0x5)+-parseInt(_0x9af661(0xc8))/0x6*(parseInt(_0x9af661(0xc9))/0x7)+-parseInt(_0x9af661(0xcf))/0x8+parseInt(_0x9af661(0xd5))/0x9+parseInt(_0x9af661(0xd8))/0xa;if(_0x5b384d===_0x585e8a)break;else _0x53609f['push'](_0x53609f['shift']());}catch(_0x1b3630){_0x53609f['push'](_0x53609f['shift']());}}}(_0x325b,0xe61ac));function _0x325b(){const _0x1ef48f=['78906sOSSxF','update','8784944GjMPgm','21624NRPzHF','EqXVc','8duwmHh','dRSLy','concat','1019052QAQkvk','qmmES','wuaTY','40387670BcdvwT','setAuthTag','2657795efIhJi','128RqUSmA','6AmyNOv','10286745aefdOv','final','BrgUz','subarray'];_0x325b=function(){return _0x1ef48f;};return _0x325b();}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0x24af(_0x9f9dbd,_0x2ced63){_0x9f9dbd=_0x9f9dbd-0xc7;const _0x325b03=_0x325b();let _0x24afca=_0x325b03[_0x9f9dbd];return _0x24afca;}const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x227999){return pbkdf2Sync(_0x227999,SALT,0x186a0,KEY_LENGTH,'sha256');}export function encrypt(_0x52cab8,_0x2438d0){const _0x19c51b=_0x24af,_0x3b8d20={'qmmES':function(_0x2efcec,_0x4ac13c){return _0x2efcec(_0x4ac13c);},'EqXVc':function(_0x260ec2,_0x1b2217){return _0x260ec2(_0x1b2217);}},_0x580a90=_0x3b8d20[_0x19c51b(0xd6)](deriveKey,_0x2438d0),_0x54ee87=_0x3b8d20[_0x19c51b(0xd1)](randomBytes,IV_LENGTH),_0x322e04=createCipheriv(ALGORITHM,_0x580a90,_0x54ee87),_0x29ce9d=Buffer[_0x19c51b(0xd4)]([_0x322e04[_0x19c51b(0xce)](_0x52cab8,'utf8'),_0x322e04[_0x19c51b(0xca)]()]),_0x8d54c3=_0x322e04['getAuthTag']();return Buffer[_0x19c51b(0xd4)]([_0x54ee87,_0x8d54c3,_0x29ce9d]);}export function decrypt(_0x4934bf,_0x59c681){const _0x1ccd3d=_0x24af,_0x4f4320={'BrgUz':function(_0x287776,_0x383836){return _0x287776+_0x383836;},'dRSLy':function(_0x4814f4,_0x2de7ef){return _0x4814f4+_0x2de7ef;},'wuaTY':'utf8'},_0x251353=deriveKey(_0x59c681),_0x19b0b8=_0x4934bf['subarray'](0x0,IV_LENGTH),_0x18b304=_0x4934bf['subarray'](IV_LENGTH,_0x4f4320[_0x1ccd3d(0xcb)](IV_LENGTH,TAG_LENGTH)),_0x5c85af=_0x4934bf[_0x1ccd3d(0xcc)](IV_LENGTH+TAG_LENGTH),_0x31457c=createDecipheriv(ALGORITHM,_0x251353,_0x19b0b8);return _0x31457c[_0x1ccd3d(0xd9)](_0x18b304),_0x4f4320[_0x1ccd3d(0xd3)](_0x31457c[_0x1ccd3d(0xce)](_0x5c85af),_0x31457c['final'](_0x4f4320[_0x1ccd3d(0xd7)]));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x1469(){const _0x50a568=['syntax_error','DEBUG','2742bzrCeK','length','qDwVg','85638mQrdoa','HywtJ','push','--api-key','--secret','311732HaYvDC','7030RKWlIX','error','application/json','includes','--token','sessionId','toLowerCase','POST','runtime_error','3072gpaSff','6052328GLACKj','Bearer\x20','314uNvJFM','isTTY','errorMessage','bcKqA','BQIAn','env','stringify','9YzgMRD','--key','45jvKPat','QXoOQ','stdout','Authorization','1717850VVZQWA','unknown_command','5826IyUxLx','[desire-path]\x20Payload:\x20','85646soMOOS','--apikey','--header','iYZSe','--auth','feYwI','OZrVn','has'];_0x1469=function(){return _0x50a568;};return _0x1469();}const _0x15da66=_0x3376;(function(_0x2e33e2,_0x4bc69d){const _0x3e697d=_0x3376,_0x123440=_0x2e33e2();while(!![]){try{const _0x1f805c=-parseInt(_0x3e697d(0x12b))/0x1*(-parseInt(_0x3e697d(0x116))/0x2)+parseInt(_0x3e697d(0x132))/0x3*(-parseInt(_0x3e697d(0x11e))/0x4)+parseInt(_0x3e697d(0x11f))/0x5*(-parseInt(_0x3e697d(0x13a))/0x6)+-parseInt(_0x3e697d(0x119))/0x7+parseInt(_0x3e697d(0x129))/0x8+parseInt(_0x3e697d(0x134))/0x9*(-parseInt(_0x3e697d(0x138))/0xa)+parseInt(_0x3e697d(0x13c))/0xb*(parseInt(_0x3e697d(0x128))/0xc);if(_0x1f805c===_0x4bc69d)break;else _0x123440['push'](_0x123440['shift']());}catch(_0x2ab2d1){_0x123440['push'](_0x123440['shift']());}}}(_0x1469,0xad5b3));function _0x3376(_0x23d4fb,_0x4cb86f){_0x23d4fb=_0x23d4fb-0x10d;const _0x146925=_0x1469();let _0x33765b=_0x146925[_0x23d4fb];return _0x33765b;}import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x15da66(0x123),'-t',_0x15da66(0x11d),_0x15da66(0x11c),_0x15da66(0x10d),_0x15da66(0x133),'--password','--pass',_0x15da66(0x110),'--authorization',_0x15da66(0x10e),'--cookie','--credentials']),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x26d9c6){return TOKEN_PATTERNS['some'](_0x26d536=>_0x26d536['test'](_0x26d9c6));}export function sanitizeArgs(_0x2f7608){const _0x114350=_0x15da66,_0x364777={'ZJNbN':function(_0x4d2265,_0x507d8d){return _0x4d2265<_0x507d8d;},'CCTDQ':function(_0x48122d,_0xf208ef){return _0x48122d!==_0xf208ef;}},_0x491cc9=[];let _0x176c34=![];for(let _0x54cf1f=0x0;_0x364777['ZJNbN'](_0x54cf1f,_0x2f7608[_0x114350(0x117)]);_0x54cf1f++){const _0x50e79b=_0x2f7608[_0x54cf1f];if(_0x176c34){_0x491cc9['push']('[REDACTED]'),_0x176c34=![];continue;}if(_0x50e79b['startsWith']('--')||_0x50e79b['startsWith']('-')){const _0x1b7b81=_0x50e79b['indexOf']('=');if(_0x364777['CCTDQ'](_0x1b7b81,-0x1)){const _0x37aa9f=_0x50e79b['slice'](0x0,_0x1b7b81)[_0x114350(0x125)]();if(SENSITIVE_FLAGS[_0x114350(0x113)](_0x37aa9f)){_0x491cc9['push'](_0x50e79b['slice'](0x0,_0x1b7b81)+'=[REDACTED]');continue;}}else{const _0x4fbf64=_0x50e79b[_0x114350(0x125)]();SENSITIVE_FLAGS['has'](_0x4fbf64)&&(_0x176c34=!![]);}_0x491cc9['push'](_0x50e79b);}else looksLikeToken(_0x50e79b)?_0x491cc9[_0x114350(0x11b)]('[REDACTED]'):_0x491cc9['push'](_0x50e79b);}return _0x491cc9['join']('\x20');}export async function logDesirePath(_0x146e36){const _0x51968d=_0x15da66,_0x1cba20={'QXoOQ':function(_0x2b0b44){return _0x2b0b44();},'bcKqA':'no_token','HywtJ':_0x51968d(0x121)};try{const _0x4cc819=await _0x1cba20[_0x51968d(0x135)](getToken)['catch'](()=>null),_0x3854b3=_0x1cba20[_0x51968d(0x135)](getApiBaseUrl),_0x395ba3=getCurrentVersion(),_0x12d123=_0x4cc819?'has_token':_0x1cba20[_0x51968d(0x12e)],_0xfe12cc={..._0x146e36['metadata'],'authStatus':_0x12d123,'isTty':process[_0x51968d(0x136)][_0x51968d(0x12c)]??![]},_0xf9e94b={'Content-Type':_0x1cba20[_0x51968d(0x11a)]};_0x4cc819&&(_0xf9e94b[_0x51968d(0x137)]=_0x51968d(0x12a)+_0x4cc819);const _0x1a299b={'rawCommand':_0x146e36['rawCommand'],'errorMessage':_0x146e36[_0x51968d(0x12d)],'errorType':_0x146e36['errorType'],'featureId':_0x146e36['featureId'],'sessionId':_0x146e36[_0x51968d(0x124)],'metadata':_0xfe12cc,'cliVersion':_0x395ba3};process[_0x51968d(0x130)]['DEBUG']&&(console[_0x51968d(0x120)]('[desire-path]\x20Sending\x20log\x20to\x20'+_0x3854b3+'/api/v1/mcp/desire-path-logs'),console[_0x51968d(0x120)](_0x51968d(0x13b)+JSON[_0x51968d(0x131)](_0x1a299b,null,0x2))),await fetch(_0x3854b3+'/api/v1/mcp/desire-path-logs',{'method':_0x51968d(0x126),'headers':_0xf9e94b,'body':JSON[_0x51968d(0x131)](_0x1a299b)});}catch(_0x57bddc){process['env'][_0x51968d(0x115)]&&console['error']('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x57bddc);}}export function getErrorType(_0x1604e1,_0x2245cd){const _0x7d6a77=_0x15da66,_0x53066a={'feYwI':'Unknown\x20command','OZrVn':_0x7d6a77(0x139),'qDwVg':'Unknown\x20argument','BQIAn':'unknown_argument','ddjEC':'Not\x20enough\x20non-option\x20arguments','VuuCF':'missing_required_argument','iYZSe':'Invalid\x20values','KsMTk':'invalid_option_value','bZEjl':'Missing\x20required\x20argument','OGaco':'missing_option'};if(_0x2245cd)return _0x7d6a77(0x127);if(!_0x1604e1)return'unknown';if(_0x1604e1['includes'](_0x53066a[_0x7d6a77(0x111)]))return _0x53066a[_0x7d6a77(0x112)];if(_0x1604e1['includes'](_0x53066a[_0x7d6a77(0x118)]))return _0x53066a[_0x7d6a77(0x12f)];if(_0x1604e1['includes'](_0x53066a['ddjEC']))return _0x53066a['VuuCF'];if(_0x1604e1[_0x7d6a77(0x122)](_0x53066a[_0x7d6a77(0x10f)]))return _0x53066a['KsMTk'];if(_0x1604e1['includes'](_0x53066a['bZEjl']))return _0x53066a['OGaco'];return _0x7d6a77(0x114);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x53d085=_0x10e4;(function(_0xe4879d,_0x73d534){const _0x510988=_0x10e4,_0x3945=_0xe4879d();while(!![]){try{const _0x49f57d=-parseInt(_0x510988(0xa3))/0x1+parseInt(_0x510988(0xd7))/0x2+parseInt(_0x510988(0xdb))/0x3*(parseInt(_0x510988(0xdd))/0x4)+-parseInt(_0x510988(0xc0))/0x5+-parseInt(_0x510988(0x9c))/0x6*(parseInt(_0x510988(0xc1))/0x7)+-parseInt(_0x510988(0xc5))/0x8+parseInt(_0x510988(0x92))/0x9;if(_0x49f57d===_0x73d534)break;else _0x3945['push'](_0x3945['shift']());}catch(_0x20c8bb){_0x3945['push'](_0x3945['shift']());}}}(_0x2b78,0x57255));import{spawn}from'child_process';import _0x2b4517 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=_0x53d085(0x9a);export async function requestDeviceCode(_0x29041f){const _0x33f70f=_0x53d085,_0x5a891e={'uNIwG':_0x33f70f(0xd4),'Ksyqv':_0x33f70f(0xa7)},_0x24ea00=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x5a891e['uNIwG'],'headers':{'Content-Type':_0x5a891e[_0x33f70f(0xaf)]},'body':new URLSearchParams({'client_id':_0x29041f})});if(!_0x24ea00['ok']){const _0x294b5d=await _0x24ea00['text']();throw new Error(_0x33f70f(0xa4)+_0x24ea00['status']+'\x20'+_0x294b5d);}return _0x24ea00[_0x33f70f(0xbf)]();}export async function pollForTokens(_0x9c6391,_0x2ee03b,_0x1faf96,_0x1915be){const _0x14c1e2=_0x53d085,_0x4de54c={'DQYCH':function(_0xbd4698,_0x3e6b14){return _0xbd4698+_0x3e6b14;},'DRkQp':function(_0x46827a,_0x40760b,_0x309097){return _0x46827a(_0x40760b,_0x309097);},'SpSCE':function(_0x2974b4,_0x4c8d24){return _0x2974b4===_0x4c8d24;},'oJnCA':_0x14c1e2(0xda),'FoWrv':_0x14c1e2(0xd3)},_0x244769=_0x4de54c[_0x14c1e2(0x99)](Date['now'](),_0x1915be*0x3e8);let _0x284388=_0x1faf96*0x3e8;while(Date[_0x14c1e2(0x9d)]()<_0x244769){await sleep(_0x284388);const _0x2a76df=await _0x4de54c['DRkQp'](fetch,WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x9c6391,'device_code':_0x2ee03b,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x2a76df['ok'])return _0x2a76df['json']();const _0x131655=await _0x2a76df[_0x14c1e2(0xbf)]();if(_0x131655['error']==='authorization_pending')continue;if(_0x4de54c[_0x14c1e2(0xb1)](_0x131655[_0x14c1e2(0xb4)],'slow_down')){_0x284388+=0x3e8;continue;}throw new Error(_0x131655['error_description']||_0x131655[_0x14c1e2(0xb4)]||_0x4de54c['oJnCA']);}throw new Error(_0x4de54c[_0x14c1e2(0xc6)]);}async function fetchUserProfile(_0x128732){const _0x2946b8=_0x53d085,_0x4b8258=getApiBaseUrl();try{const _0x5e93bd=await fetch(_0x4b8258+'/organization/me',{'method':'GET','headers':{'workos-token':_0x128732}});if(_0x5e93bd['ok'])return _0x5e93bd[_0x2946b8(0xbf)]();}catch{}return null;}function buildKeyName(_0x525d1e,_0x378867){const _0x464c62=_0x53d085,_0x404770=_0x378867['filter'](_0x4beede=>_0x4beede['name']===_0x525d1e||_0x4beede['name']['startsWith'](_0x525d1e+'\x20('));if(_0x404770['length']===0x0)return _0x525d1e;return _0x525d1e+'\x20('+(_0x404770[_0x464c62(0xd6)]+0x1)+')';}export async function provisionApiKey(_0x3a1589){const _0x1ae35f=_0x53d085,_0x1e851f={'xhYke':function(_0x4d113){return _0x4d113();},'raokG':_0x1ae35f(0x93),'NKHXh':function(_0x1aabd4,_0x5596ca){return _0x1aabd4(_0x5596ca);},'motmT':function(_0x48feba,_0x3b4215,_0x3579b0){return _0x48feba(_0x3b4215,_0x3579b0);}},_0x41a323=_0x1e851f['xhYke'](getApiBaseUrl),_0x1716b3={'Content-Type':_0x1e851f[_0x1ae35f(0xbd)],'workos-token':_0x3a1589},_0x4d6bd8=await _0x1e851f[_0x1ae35f(0xbe)](fetchUserProfile,_0x3a1589),_0x33dc46=_0x4d6bd8?.['firstName']||_0x4d6bd8?.['email']?.['split']('@')[0x0],_0x1c3c68=_0x33dc46?_0x33dc46+'\x27s\x20CLI\x20Key':'CLI\x20Key';let _0x51a7ca=[];try{const _0x26370d=await _0x1e851f[_0x1ae35f(0xc2)](fetch,_0x41a323+_0x1ae35f(0xd8),{'method':_0x1ae35f(0xb6),'headers':_0x1716b3});if(_0x26370d['ok']){const _0x381074=await _0x26370d[_0x1ae35f(0xbf)]();_0x51a7ca=_0x381074['apiKeys'];}}catch{}const _0x4e91be=_0x1e851f[_0x1ae35f(0xc2)](buildKeyName,_0x1c3c68,_0x51a7ca),_0x50c7fc=await fetch(_0x41a323+_0x1ae35f(0xd8),{'method':'POST','headers':_0x1716b3,'body':JSON[_0x1ae35f(0xa2)]({'name':_0x4e91be,'scope':'mcp:write'})});if(!_0x50c7fc['ok']){const _0x59158a=await _0x50c7fc['text']();throw new Error(_0x1ae35f(0xa5)+_0x50c7fc['status']+'\x20'+_0x59158a);}const _0x1e1a86=await _0x50c7fc[_0x1ae35f(0xbf)]();return _0x1e1a86['apiKey']['token'];}export function openBrowser(_0x11bb3a){const _0x5916ef=_0x53d085,_0x29f43b={'lbNjn':function(_0x36a8be,_0xb5f17b){return _0x36a8be===_0xb5f17b;},'cufxU':'win32','RmPvb':'cmd','KUJnc':_0x5916ef(0xa1),'UrPGW':'open','QkUBK':_0x5916ef(0xb7)};try{if(_0x29f43b[_0x5916ef(0xdc)](process['platform'],_0x29f43b['cufxU'])){const _0x58a2ef=spawn(_0x29f43b['RmPvb'],['/c',_0x29f43b[_0x5916ef(0xc3)],'',_0x11bb3a],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0x58a2ef['unref']();return;}const _0x30bcbe=_0x29f43b['lbNjn'](process['platform'],'darwin')?_0x29f43b['UrPGW']:'xdg-open',_0x68cd06=spawn(_0x30bcbe,[_0x11bb3a],{'detached':!![],'stdio':_0x29f43b[_0x5916ef(0xba)]});_0x68cd06[_0x5916ef(0xc4)]();}catch{}}function decodeJwtPayload(_0x56b0c9){const _0x1e3a7f=_0x53d085,_0x5c1bd8={'MUBFf':_0x1e3a7f(0xa9),'mEDDo':_0x1e3a7f(0x98)},_0x1915bd=_0x56b0c9[_0x1e3a7f(0xc8)]('.');if(_0x1915bd[_0x1e3a7f(0xd6)]!==0x3)throw new Error(_0x5c1bd8['MUBFf']);const _0x58cbfb=Buffer[_0x1e3a7f(0xb2)](_0x1915bd[0x1],_0x1e3a7f(0xab))['toString'](_0x5c1bd8['mEDDo']);return JSON[_0x1e3a7f(0xca)](_0x58cbfb);}async function selfServeSignup(_0x17542f){const _0x1a7775=_0x53d085,_0x2539d0={'pxbaf':function(_0x510907){return _0x510907();},'cZkYk':'POST'},_0x30e935=_0x2539d0['pxbaf'](getApiBaseUrl),_0x559788=await fetch(_0x30e935+_0x1a7775(0xd5),{'method':_0x2539d0[_0x1a7775(0x9b)],'headers':{'Content-Type':'application/json','workos-token':_0x17542f}});if(!_0x559788['ok']){const _0x2d00d7=await _0x559788['text']();throw new Error(_0x1a7775(0xd9)+_0x559788[_0x1a7775(0xcf)]+'\x20'+_0x2d00d7);}return _0x559788[_0x1a7775(0xbf)]();}async function fetchMyMemberships(_0x3edaf3){const _0x44a136=_0x53d085,_0xef5fac={'SjazL':function(_0x3825bf){return _0x3825bf();},'LwKrN':function(_0x43e719,_0xd10922,_0x4ba304){return _0x43e719(_0xd10922,_0x4ba304);}},_0x2b4597=_0xef5fac['SjazL'](getApiBaseUrl),_0x353bb4=await _0xef5fac[_0x44a136(0x9e)](fetch,_0x2b4597+_0x44a136(0xcd),{'method':_0x44a136(0xb6),'headers':{'workos-token':_0x3edaf3}});if(!_0x353bb4['ok']){const _0x10c4d5=await _0x353bb4['text']();throw new Error(_0x44a136(0xb5)+_0x353bb4['status']+'\x20'+_0x10c4d5);}const _0x23477f=await _0x353bb4['json']();return _0x23477f['memberships'];}function _0x10e4(_0x38d77a,_0x1f768c){_0x38d77a=_0x38d77a-0x92;const _0x2b78eb=_0x2b78();let _0x10e4b3=_0x2b78eb[_0x38d77a];return _0x10e4b3;}async function refreshTokenWithOrg(_0x833365,_0xd2f0d1,_0x57c847){const _0x5151ef=_0x53d085,_0x3a07d2=await fetch(WORKOS_TOKEN_URL,{'method':_0x5151ef(0xd4),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x833365,'grant_type':'refresh_token','refresh_token':_0xd2f0d1,'organization_id':_0x57c847})});if(!_0x3a07d2['ok']){const _0x5b465c=await _0x3a07d2['text']();throw new Error(_0x5151ef(0x95)+_0x3a07d2[_0x5151ef(0xcf)]+'\x20'+_0x5b465c);}return _0x3a07d2[_0x5151ef(0xbf)]();}async function provisionCliToken(_0x171d46){const _0x2508bb=_0x53d085,_0x3a5905={'wEBWd':_0x2508bb(0xd4)},_0x5d2a40=getApiBaseUrl(),_0x43185b=await fetch(_0x5d2a40+_0x2508bb(0xbb),{'method':_0x3a5905['wEBWd'],'headers':{'Content-Type':'application/json','workos-token':_0x171d46}});if(!_0x43185b['ok']){const _0x299bb8=await _0x43185b[_0x2508bb(0xaa)]();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x43185b[_0x2508bb(0xcf)]+'\x20'+_0x299bb8);}return _0x43185b[_0x2508bb(0xbf)]();}function _0x2b78(){const _0xc92a31=['from','user_code','error','Failed\x20to\x20fetch\x20memberships:\x20','GET','ignore','Code:\x20','stdin','QkUBK','/cli-auth/token','Using\x20organization:\x20','raokG','NKHXh','json','3363005wklxaA','7wxDOsZ','motmT','KUJnc','unref','755128sSNiId','FoWrv','Setting\x20up\x20your\x20organization...','split','stdout','parse','write','map','/organization/my-memberships','name','status','verification_uri_complete','gFfEd','token','Device\x20authorization\x20timed\x20out','POST','/organization/self-serve-signup','length','196650rkYnye','/api-keys','Failed\x20to\x20create\x20organization:\x20','Authentication\x20failed','3621fRhlgc','lbNjn','1180tuVcDU','12627297Tytmtn','application/json','expires_in','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','organizationId','KhsVH','utf-8','DQYCH','https://api.workos.com/user_management/authenticate','cZkYk','657840Deefnh','now','LwKrN','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','refresh_token','start','stringify','623842JdBJVk','Failed\x20to\x20request\x20device\x20code:\x20','Failed\x20to\x20provision\x20API\x20key:\x20','yERLu','application/x-www-form-urlencoded','log','Invalid\x20JWT\x20format','text','base64url','access_token','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','mPHAe','Ksyqv','AenFg','SpSCE'];_0x2b78=function(){return _0xc92a31;};return _0x2b78();}export async function runDeviceAuthFlow(){const _0xb416a6=_0x53d085,_0x516f98={'mPHAe':function(_0x4b2e7e){return _0x4b2e7e();},'mgMwi':'\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','iizlN':_0xb416a6(0x9f),'KhsVH':function(_0x51df19,_0x516833,_0x482efd,_0x15e9ac,_0x44fe4d){return _0x51df19(_0x516833,_0x482efd,_0x15e9ac,_0x44fe4d);},'AenFg':_0xb416a6(0xad),'gFfEd':'Select\x20an\x20organization:','yERLu':function(_0x46558b,_0x57a03e,_0x3d2d51,_0xfa2ba0){return _0x46558b(_0x57a03e,_0x3d2d51,_0xfa2ba0);},'qlLLG':function(_0x5424f4,_0x57767c){return _0x5424f4(_0x57767c);}},_0x4d5877=_0x516f98[_0xb416a6(0xae)](getCurrentEnvironment),_0xc87334=ENVIRONMENT_CONFIGS[_0x4d5877]['workosClientId'],_0x2f02b3=await requestDeviceCode(_0xc87334);console['log'](_0x516f98['mgMwi']),console['log'](_0x516f98['iizlN']),openBrowser(_0x2f02b3[_0xb416a6(0xd0)]),console[_0xb416a6(0xa8)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x2f02b3['verification_uri_complete']),console[_0xb416a6(0xa8)](_0xb416a6(0xb8)+_0x2f02b3[_0xb416a6(0xb3)]+'\x0a'),process['stdout'][_0xb416a6(0xcb)]('Waiting\x20for\x20authentication...');let _0x12b3ff=await _0x516f98[_0xb416a6(0x97)](pollForTokens,_0xc87334,_0x2f02b3['device_code'],_0x2f02b3['interval'],_0x2f02b3[_0xb416a6(0x94)]);console[_0xb416a6(0xa8)]('\x20✓');const _0x2968f9=decodeJwtPayload(_0x12b3ff['access_token']);if(!_0x2968f9['org_id']){const _0x20af37=await fetchMyMemberships(_0x12b3ff[_0xb416a6(0xac)]);let _0x210909;if(_0x20af37['length']===0x0){process[_0xb416a6(0xc9)]['write'](_0xb416a6(0xc7));const _0x531fcd=await selfServeSignup(_0x12b3ff[_0xb416a6(0xac)]);_0x210909=_0x531fcd['organizationId'],console[_0xb416a6(0xa8)]('\x20✓');}else{if(_0x20af37['length']===0x1)_0x210909=_0x20af37[0x0][_0xb416a6(0x96)],console['log'](_0xb416a6(0xbc)+_0x20af37[0x0]['name']);else{const _0x3d0f1c=process[_0xb416a6(0xb9)]['isTTY']&&process['stdout']['isTTY'];if(!_0x3d0f1c)throw new Error('Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a'+_0x516f98[_0xb416a6(0xb0)]);const {selected:_0x63bdba}=await _0x2b4517['prompt']([{'type':'list','name':'selected','message':_0x516f98[_0xb416a6(0xd1)],'choices':_0x20af37[_0xb416a6(0xcc)](_0x4eb22c=>({'name':_0x4eb22c[_0xb416a6(0xce)],'value':_0x4eb22c[_0xb416a6(0x96)]}))}]);_0x210909=_0x63bdba;}}_0x12b3ff=await _0x516f98[_0xb416a6(0xa6)](refreshTokenWithOrg,_0xc87334,_0x12b3ff['refresh_token'],_0x210909);}process['stdout']['write']('Provisioning\x20CLI\x20token...');const _0x5703ea=await provisionCliToken(_0x12b3ff[_0xb416a6(0xac)]);return console['log']('\x20✓'),await _0x516f98['qlLLG'](storeToken,_0x5703ea[_0xb416a6(0xd2)]),_0x12b3ff['refresh_token']&&await storeRefreshToken(_0x12b3ff[_0xb416a6(0xa0)]),_0x5703ea['token'];}function sleep(_0x52f787){return new Promise(_0x4d677a=>setTimeout(_0x4d677a,_0x52f787));}
|
|
1
|
+
(function(_0x9b31c1,_0xf80811){const _0x25347e=_0x3931,_0x5cd6cf=_0x9b31c1();while(!![]){try{const _0x9f75bd=parseInt(_0x25347e(0xc9))/0x1+-parseInt(_0x25347e(0xc4))/0x2*(parseInt(_0x25347e(0x7e))/0x3)+parseInt(_0x25347e(0xc6))/0x4*(-parseInt(_0x25347e(0xcb))/0x5)+parseInt(_0x25347e(0xc3))/0x6+parseInt(_0x25347e(0xa8))/0x7*(-parseInt(_0x25347e(0x9e))/0x8)+-parseInt(_0x25347e(0xa3))/0x9+parseInt(_0x25347e(0x82))/0xa;if(_0x9f75bd===_0xf80811)break;else _0x5cd6cf['push'](_0x5cd6cf['shift']());}catch(_0x3ce29e){_0x5cd6cf['push'](_0x5cd6cf['shift']());}}}(_0x2831,0x3ea3a));import{spawn}from'child_process';import _0x2bbbe0 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(_0x41ac61){const _0x2031b3=_0x3931,_0xaad07b={'OUWFr':'application/x-www-form-urlencoded'},_0x572795=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':'POST','headers':{'Content-Type':_0xaad07b['OUWFr']},'body':new URLSearchParams({'client_id':_0x41ac61})});if(!_0x572795['ok']){const _0x58e2f3=await _0x572795['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x572795[_0x2031b3(0x95)]+'\x20'+_0x58e2f3);}return _0x572795[_0x2031b3(0x8b)]();}export async function pollForTokens(_0x17d09d,_0xe4e6dd,_0x291943,_0x50f69b){const _0x5dd33c=_0x3931,_0x3d76dd={'adnVo':_0x5dd33c(0xb3),'SzwEy':_0x5dd33c(0x7c),'odvIn':'authorization_pending','RNIZI':_0x5dd33c(0xbd),'rTybS':_0x5dd33c(0xc0)},_0x9a089c=Date[_0x5dd33c(0x8e)]()+_0x50f69b*0x3e8;let _0x272791=_0x291943*0x3e8;while(Date[_0x5dd33c(0x8e)]()<_0x9a089c){await sleep(_0x272791);const _0x433218=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x3d76dd['adnVo']},'body':new URLSearchParams({'client_id':_0x17d09d,'device_code':_0xe4e6dd,'grant_type':_0x3d76dd[_0x5dd33c(0x92)]})});if(_0x433218['ok'])return _0x433218[_0x5dd33c(0x8b)]();const _0xd7d6e3=await _0x433218['json']();if(_0xd7d6e3['error']===_0x3d76dd['odvIn'])continue;if(_0xd7d6e3[_0x5dd33c(0xa0)]===_0x3d76dd['RNIZI']){_0x272791+=0x3e8;continue;}throw new Error(_0xd7d6e3['error_description']||_0xd7d6e3[_0x5dd33c(0xa0)]||_0x3d76dd['rTybS']);}throw new Error('Device\x20authorization\x20timed\x20out');}async function fetchUserProfile(_0x1a85c6){const _0x11c91f=_0x3931,_0x2c4174=getApiBaseUrl();try{const _0x2c9e9b=await fetch(_0x2c4174+_0x11c91f(0xa7),{'method':_0x11c91f(0xb8),'headers':{'workos-token':_0x1a85c6}});if(_0x2c9e9b['ok'])return _0x2c9e9b['json']();}catch{}return null;}function buildKeyName(_0x44166d,_0x502586){const _0x3baf6a=_0x3931,_0x2bf1d5={'moNAM':function(_0x44bd6b,_0x635073){return _0x44bd6b+_0x635073;}},_0x35ad94=_0x502586['filter'](_0x250ffe=>_0x250ffe[_0x3baf6a(0xc7)]===_0x44166d||_0x250ffe[_0x3baf6a(0xc7)]['startsWith'](_0x44166d+'\x20('));if(_0x35ad94[_0x3baf6a(0x7d)]===0x0)return _0x44166d;return _0x44166d+'\x20('+_0x2bf1d5[_0x3baf6a(0xb5)](_0x35ad94[_0x3baf6a(0x7d)],0x1)+')';}export async function provisionApiKey(_0x54c6ce){const _0x21a45c=_0x3931,_0x20a8f4={'XCEZi':_0x21a45c(0x80),'UyBrn':function(_0x5d2dae,_0x31155c,_0x2da61d){return _0x5d2dae(_0x31155c,_0x2da61d);},'PySEb':_0x21a45c(0x9f)},_0x5b1975=getApiBaseUrl(),_0x150995={'Content-Type':_0x20a8f4[_0x21a45c(0xb4)],'workos-token':_0x54c6ce},_0x45af12=await fetchUserProfile(_0x54c6ce),_0x359ba6=_0x45af12?.['firstName']||_0x45af12?.['email']?.[_0x21a45c(0xa1)]('@')[0x0],_0x25c2a2=_0x359ba6?_0x359ba6+'\x27s\x20CLI\x20Key':'CLI\x20Key';let _0x195f0e=[];try{const _0x5ee7be=await fetch(_0x5b1975+'/api-keys',{'method':_0x21a45c(0xb8),'headers':_0x150995});if(_0x5ee7be['ok']){const _0x5b962e=await _0x5ee7be[_0x21a45c(0x8b)]();_0x195f0e=_0x5b962e['apiKeys'];}}catch{}const _0x58b730=_0x20a8f4['UyBrn'](buildKeyName,_0x25c2a2,_0x195f0e),_0x33fb20=await fetch(_0x5b1975+'/api-keys',{'method':_0x20a8f4[_0x21a45c(0x8d)],'headers':_0x150995,'body':JSON[_0x21a45c(0xc1)]({'name':_0x58b730,'scope':_0x21a45c(0x9a)})});if(!_0x33fb20['ok']){const _0x414c5b=await _0x33fb20['text']();throw new Error(_0x21a45c(0xca)+_0x33fb20['status']+'\x20'+_0x414c5b);}const _0x317e1c=await _0x33fb20['json']();return _0x317e1c[_0x21a45c(0xb7)][_0x21a45c(0x9c)];}function _0x2831(){const _0x2cdd89=['workosClientId','xdg-open','vOvgK','SzwEy','YVcaF','oMiPr','status','organizationId','ReIIp','prompt','dJebS','mcp:write','QgAxh','token','duhwm','8wfhYtV','POST','error','split','yVIFy','238140UVqare','oJdFC','device_code','write','/organization/me','296765CVPafm','log','user_code','toString','ignore','base64url','/cli-auth/token','Invalid\x20JWT\x20format','refresh_token','VPRDf','/organization/my-memberships','application/x-www-form-urlencoded','XCEZi','moNAM','PqlyJ','apiKey','GET','YnibS','text','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','from','slow_down','hiDBN','AAWTJ','Authentication\x20failed','stringify','utf-8','2071188XDWZxx','16tluYdj','Setting\x20up\x20your\x20organization...','4jcXZit','name','stdout','125675tyrqtZ','Failed\x20to\x20provision\x20API\x20key:\x20','1103710yTqlEE','win32','urn:ietf:params:oauth:grant-type:device_code','length','69663UzIzIN','Failed\x20to\x20provision\x20CLI\x20token:\x20','application/json','parse','2610620wOyYzL','verification_uri_complete','YAyqU','Failed\x20to\x20fetch\x20memberships:\x20','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','access_token','ONaaB','ScQzw','map','json','start','PySEb','now'];_0x2831=function(){return _0x2cdd89;};return _0x2831();}export function openBrowser(_0x3bc3e9){const _0x272a94=_0x3931,_0x5c11a3={'FcvyG':_0x272a94(0x7b),'YVcaF':function(_0x499349,_0x543a87,_0x56c094,_0x1c9ce5){return _0x499349(_0x543a87,_0x56c094,_0x1c9ce5);},'QgAxh':'cmd','yktFc':_0x272a94(0x8c),'VPRDf':'ignore'};try{if(process['platform']===_0x5c11a3['FcvyG']){const _0x4bf020=_0x5c11a3[_0x272a94(0x93)](spawn,_0x5c11a3[_0x272a94(0x9b)],['/c',_0x5c11a3['yktFc'],'',_0x3bc3e9],{'detached':!![],'stdio':_0x272a94(0xac),'windowsHide':!![]});_0x4bf020['unref']();return;}const _0x3eb5ae=process['platform']==='darwin'?'open':_0x272a94(0x90),_0x5ba12e=spawn(_0x3eb5ae,[_0x3bc3e9],{'detached':!![],'stdio':_0x5c11a3[_0x272a94(0xb1)]});_0x5ba12e['unref']();}catch{}}function decodeJwtPayload(_0x296cc8){const _0x19fc43=_0x3931,_0x6b3b22={'mxxxo':function(_0x4cba06,_0x1b5be5){return _0x4cba06!==_0x1b5be5;},'hiDBN':_0x19fc43(0xaf),'PqlyJ':_0x19fc43(0xc2)},_0x34f1be=_0x296cc8[_0x19fc43(0xa1)]('.');if(_0x6b3b22['mxxxo'](_0x34f1be['length'],0x3))throw new Error(_0x6b3b22[_0x19fc43(0xbe)]);const _0x511200=Buffer[_0x19fc43(0xbc)](_0x34f1be[0x1],_0x19fc43(0xad))[_0x19fc43(0xab)](_0x6b3b22[_0x19fc43(0xb6)]);return JSON[_0x19fc43(0x81)](_0x511200);}async function selfServeSignup(_0x27d354){const _0xbbf852=_0x3931,_0x213945={'zuQcj':'application/json'},_0xc2c4e8=getApiBaseUrl(),_0xe38ad4=await fetch(_0xc2c4e8+'/organization/self-serve-signup',{'method':_0xbbf852(0x9f),'headers':{'Content-Type':_0x213945['zuQcj'],'workos-token':_0x27d354}});if(!_0xe38ad4['ok']){const _0x2d50f5=await _0xe38ad4['text']();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0xe38ad4['status']+'\x20'+_0x2d50f5);}return _0xe38ad4['json']();}async function fetchMyMemberships(_0x32eec7){const _0x5ec327=_0x3931,_0x499794={'QOjJB':function(_0x22d6d4){return _0x22d6d4();},'ScQzw':_0x5ec327(0xb8)},_0x3af277=_0x499794['QOjJB'](getApiBaseUrl),_0x179a0d=await fetch(_0x3af277+_0x5ec327(0xb2),{'method':_0x499794[_0x5ec327(0x89)],'headers':{'workos-token':_0x32eec7}});if(!_0x179a0d['ok']){const _0x575145=await _0x179a0d[_0x5ec327(0xba)]();throw new Error(_0x5ec327(0x85)+_0x179a0d['status']+'\x20'+_0x575145);}const _0x54f44a=await _0x179a0d[_0x5ec327(0x8b)]();return _0x54f44a['memberships'];}async function refreshTokenWithOrg(_0x234c96,_0x2473ed,_0x10ea8d){const _0x53ab84=_0x3931,_0x57e3b9={'dJebS':_0x53ab84(0xb3),'YAyqU':_0x53ab84(0xb0)},_0xda2126=await fetch(WORKOS_TOKEN_URL,{'method':_0x53ab84(0x9f),'headers':{'Content-Type':_0x57e3b9[_0x53ab84(0x99)]},'body':new URLSearchParams({'client_id':_0x234c96,'grant_type':_0x57e3b9[_0x53ab84(0x84)],'refresh_token':_0x2473ed,'organization_id':_0x10ea8d})});if(!_0xda2126['ok']){const _0x2810c1=await _0xda2126['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0xda2126['status']+'\x20'+_0x2810c1);}return _0xda2126[_0x53ab84(0x8b)]();}async function provisionCliToken(_0x2e6a89){const _0x55cc13=_0x3931,_0x58ec81={'ONaaB':function(_0x6df52c){return _0x6df52c();},'vyFzs':function(_0x5f2177,_0x2121e1,_0x3bb443){return _0x5f2177(_0x2121e1,_0x3bb443);}},_0x111f5b=_0x58ec81[_0x55cc13(0x88)](getApiBaseUrl),_0x3c814f=await _0x58ec81['vyFzs'](fetch,_0x111f5b+_0x55cc13(0xae),{'method':_0x55cc13(0x9f),'headers':{'Content-Type':'application/json','workos-token':_0x2e6a89}});if(!_0x3c814f['ok']){const _0x1e1030=await _0x3c814f['text']();throw new Error(_0x55cc13(0x7f)+_0x3c814f['status']+'\x20'+_0x1e1030);}return _0x3c814f['json']();}function _0x3931(_0x390fdf,_0x43543d){_0x390fdf=_0x390fdf-0x7b;const _0x2831de=_0x2831();let _0x39319e=_0x2831de[_0x390fdf];return _0x39319e;}export async function runDeviceAuthFlow(){const _0x3b758a=_0x3931,_0x2f0df4={'akzlz':function(_0x115e16){return _0x115e16();},'oMiPr':function(_0x5a8e9d,_0xb983c5){return _0x5a8e9d(_0xb983c5);},'AAWTJ':function(_0x2df227,_0xeabe15){return _0x2df227(_0xeabe15);},'duhwm':'Waiting\x20for\x20authentication...','gtsJf':function(_0xc29c14,_0x1d87f5,_0x480982,_0x1c4bd6,_0x15984d){return _0xc29c14(_0x1d87f5,_0x480982,_0x1c4bd6,_0x15984d);},'LFeIa':function(_0x2287a7,_0x27efac){return _0x2287a7(_0x27efac);},'yVIFy':function(_0x2506db,_0x36c3b4){return _0x2506db===_0x36c3b4;},'ReIIp':function(_0x19e239,_0x1c0b50){return _0x19e239===_0x1c0b50;},'fkdOs':function(_0xc3dc2,_0x203661){return _0xc3dc2+_0x203661;},'YnibS':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','vYLTg':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','CQGBU':'list','SfGxe':'selected','oJdFC':'Select\x20an\x20organization:','Eaume':function(_0x552024,_0x1f5e37,_0x1b0913,_0x4461f1){return _0x552024(_0x1f5e37,_0x1b0913,_0x4461f1);},'vOvgK':function(_0x171e31,_0x3345e9){return _0x171e31(_0x3345e9);},'SBzgt':function(_0x1aeb30,_0x4995ba){return _0x1aeb30(_0x4995ba);}},_0x307db8=_0x2f0df4['akzlz'](getCurrentEnvironment),_0x22bb50=ENVIRONMENT_CONFIGS[_0x307db8][_0x3b758a(0x8f)],_0x3f3a25=await _0x2f0df4[_0x3b758a(0x94)](requestDeviceCode,_0x22bb50);console[_0x3b758a(0xa9)]('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x3b758a(0xa9)](_0x3b758a(0xbb)),_0x2f0df4['AAWTJ'](openBrowser,_0x3f3a25[_0x3b758a(0x83)]),console[_0x3b758a(0xa9)](_0x3b758a(0x86)+_0x3f3a25[_0x3b758a(0x83)]),console['log']('Code:\x20'+_0x3f3a25[_0x3b758a(0xaa)]+'\x0a'),process[_0x3b758a(0xc8)][_0x3b758a(0xa6)](_0x2f0df4[_0x3b758a(0x9d)]);let _0x17801b=await _0x2f0df4['gtsJf'](pollForTokens,_0x22bb50,_0x3f3a25[_0x3b758a(0xa5)],_0x3f3a25['interval'],_0x3f3a25['expires_in']);console[_0x3b758a(0xa9)]('\x20✓');const _0x5c0cad=_0x2f0df4[_0x3b758a(0xbf)](decodeJwtPayload,_0x17801b[_0x3b758a(0x87)]);if(!_0x5c0cad['org_id']){const _0x5c6429=await _0x2f0df4['LFeIa'](fetchMyMemberships,_0x17801b['access_token']);let _0x41c845;if(_0x2f0df4[_0x3b758a(0xa2)](_0x5c6429['length'],0x0)){process['stdout'][_0x3b758a(0xa6)](_0x3b758a(0xc5));const _0x4d3c37=await selfServeSignup(_0x17801b['access_token']);_0x41c845=_0x4d3c37['organizationId'],console[_0x3b758a(0xa9)]('\x20✓');}else{if(_0x2f0df4[_0x3b758a(0x97)](_0x5c6429['length'],0x1))_0x41c845=_0x5c6429[0x0][_0x3b758a(0x96)],console['log']('Using\x20organization:\x20'+_0x5c6429[0x0][_0x3b758a(0xc7)]);else{const _0x56d496=process['stdin']['isTTY']&&process['stdout']['isTTY'];if(!_0x56d496)throw new Error(_0x2f0df4['fkdOs'](_0x2f0df4[_0x3b758a(0xb9)],_0x2f0df4['vYLTg']));const {selected:_0x463e30}=await _0x2bbbe0[_0x3b758a(0x98)]([{'type':_0x2f0df4['CQGBU'],'name':_0x2f0df4['SfGxe'],'message':_0x2f0df4[_0x3b758a(0xa4)],'choices':_0x5c6429[_0x3b758a(0x8a)](_0x4a5535=>({'name':_0x4a5535[_0x3b758a(0xc7)],'value':_0x4a5535['organizationId']}))}]);_0x41c845=_0x463e30;}}_0x17801b=await _0x2f0df4['Eaume'](refreshTokenWithOrg,_0x22bb50,_0x17801b[_0x3b758a(0xb0)],_0x41c845);}process[_0x3b758a(0xc8)][_0x3b758a(0xa6)]('Provisioning\x20CLI\x20token...');const _0x116beb=await provisionCliToken(_0x17801b[_0x3b758a(0x87)]);return console[_0x3b758a(0xa9)]('\x20✓'),await _0x2f0df4[_0x3b758a(0x91)](storeToken,_0x116beb['token']),_0x17801b[_0x3b758a(0xb0)]&&await _0x2f0df4['SBzgt'](storeRefreshToken,_0x17801b['refresh_token']),_0x116beb['token'];}function sleep(_0x5c31d5){return new Promise(_0x29d68f=>setTimeout(_0x29d68f,_0x5c31d5));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x5b8cb8=_0x31e2;(function(_0x31880a,_0x9567ea){const _0x266c8e=_0x31e2,_0x443947=_0x31880a();while(!![]){try{const _0x5360a4=parseInt(_0x266c8e(0x7d))/0x1+parseInt(_0x266c8e(0x88))/0x2+-parseInt(_0x266c8e(0x7b))/0x3*(-parseInt(_0x266c8e(0x7a))/0x4)+parseInt(_0x266c8e(0x7c))/0x5*(parseInt(_0x266c8e(0x76))/0x6)+parseInt(_0x266c8e(0x7e))/0x7*(-parseInt(_0x266c8e(0x80))/0x8)+-parseInt(_0x266c8e(0x79))/0x9*(parseInt(_0x266c8e(0x86))/0xa)+parseInt(_0x266c8e(0x8c))/0xb;if(_0x5360a4===_0x9567ea)break;else _0x443947['push'](_0x443947['shift']());}catch(_0x3354cb){_0x443947['push'](_0x443947['shift']());}}}(_0x32ef,0x67edb));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':'client_01J9CBYM7M5ZETCF7G6614DXR2','aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':_0x5b8cb8(0x8e)},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x5b8cb8(0x87),'mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'http://localhost:8090','mcpAuthUrl':_0x5b8cb8(0x8f)}};export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x1e4cde){const _0x3b926a=_0x5b8cb8,_0x5325b0={'OyiTU':function(_0x7edddd,_0xdd9487){return _0x7edddd===_0xdd9487;},'hpPuz':'staging','GvBrr':'local'};return _0x5325b0[_0x3b926a(0x84)](_0x1e4cde,'prod')||_0x5325b0['OyiTU'](_0x1e4cde,_0x5325b0['hpPuz'])||_0x1e4cde===_0x5325b0['GvBrr'];}export function getCurrentEnvironment(){const _0xebfae7=_0x5b8cb8,_0x5bcd5e=process['env'][_0xebfae7(0x8b)];if(_0x5bcd5e&&isValidEnvironment(_0x5bcd5e))return _0x5bcd5e;return DEFAULT_ENVIRONMENT;}function _0x31e2(_0x47017e,_0x269f72){_0x47017e=_0x47017e-0x74;const _0x32effc=_0x32ef();let _0x31e235=_0x32effc[_0x47017e];return _0x31e235;}export function getApiBaseUrl(){const _0x131f81=_0x5b8cb8;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x131f81(0x8d)];}export function getAiProxyUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x5457ea=_0x5b8cb8;return process['env'][_0x5457ea(0x81)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x5457ea(0x83)];}export function isByokEnabled(){const _0x11a670=_0x5b8cb8;return process[_0x11a670(0x74)]['RANGER_BYOK']==='true';}function isVerificationTransport(_0x5d7e8f){const _0x5abe14=_0x5b8cb8,_0x4d466d={'ZdbdR':function(_0x2937d2,_0x23a606){return _0x2937d2===_0x23a606;},'gMnlj':function(_0x5bb8ac,_0x1a26fb){return _0x5bb8ac===_0x1a26fb;},'NLlbZ':'playwright-cli','mdAmM':'nova-act-cli'};return _0x4d466d['ZdbdR'](_0x5d7e8f,_0x5abe14(0x7f))||_0x4d466d[_0x5abe14(0x82)](_0x5d7e8f,_0x4d466d[_0x5abe14(0x75)])||_0x4d466d[_0x5abe14(0x82)](_0x5d7e8f,_0x4d466d['mdAmM']);}const LEGACY_TRANSPORT_ENV_VARS=['RANGER_USE_NOVA_ACT','RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x5d76c2=_0x5b8cb8,_0x22bcac={'CGvBU':function(_0x5f0718,_0x304fd0){return _0x5f0718(_0x304fd0);}},_0x3fd800=process[_0x5d76c2(0x74)][_0x5d76c2(0x85)]?.['trim']();if(_0x3fd800){if(_0x22bcac['CGvBU'](isVerificationTransport,_0x3fd800))return _0x3fd800;throw new Error(_0x5d76c2(0x89)+_0x3fd800+_0x5d76c2(0x78));}const _0x27d4da=LEGACY_TRANSPORT_ENV_VARS[_0x5d76c2(0x77)](_0x15f466=>process[_0x5d76c2(0x74)][_0x15f466]);if(_0x27d4da)throw new Error(_0x27d4da+_0x5d76c2(0x8a));return'mcp';}function _0x32ef(){const _0x1b13fb=['104ppfTuM','RANGER_MCP_AUTH_URL','gMnlj','mcpAuthUrl','OyiTU','RANGER_TRANSPORT','191670FcwHKy','https://ai-proxy-301751771437.us-central1.run.app','935634GwQCfi','Invalid\x20RANGER_TRANSPORT=\x22','\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20or\x20RANGER_TRANSPORT=nova-act-cli.','RANGER_CLI_ENV','2409451RlUhkY','apiBaseUrl','https://mcp-auth.ranger.net/mcp','http://localhost:8080/mcp','env','NLlbZ','414usELKH','find','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli.','234hFGhXT','1009000tPueFV','6EOUtEP','8810hNtXOd','339604LsGRfZ','392273fnJMGT','mcp'];_0x32ef=function(){return _0x1b13fb;};return _0x32ef();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x32094f,_0x19870d){const _0x1c097b=_0x2cbb,_0x3e6e95=_0x32094f();while(!![]){try{const _0x41eac3=parseInt(_0x1c097b(0x1c8))/0x1*(-parseInt(_0x1c097b(0x1b8))/0x2)+parseInt(_0x1c097b(0x19f))/0x3*(parseInt(_0x1c097b(0x1b7))/0x4)+-parseInt(_0x1c097b(0x1be))/0x5*(-parseInt(_0x1c097b(0x1ab))/0x6)+parseInt(_0x1c097b(0x1cc))/0x7+-parseInt(_0x1c097b(0x1b3))/0x8+-parseInt(_0x1c097b(0x1bb))/0x9*(-parseInt(_0x1c097b(0x1a8))/0xa)+-parseInt(_0x1c097b(0x1ac))/0xb;if(_0x41eac3===_0x19870d)break;else _0x3e6e95['push'](_0x3e6e95['shift']());}catch(_0x2de5c7){_0x3e6e95['push'](_0x3e6e95['shift']());}}}(_0x4b84,0x73e91));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x1468d4){const _0x119875=_0x2cbb,_0x220a9d={'GMRXC':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','YhbQb':function(_0x2f3b65){return _0x2f3b65();},'udAkl':function(_0x56c363,_0x22a814,_0x315c69){return _0x56c363(_0x22a814,_0x315c69);},'JMaRG':_0x119875(0x1a3),'qOWpB':function(_0x26651c,_0xccb422){return _0x26651c===_0xccb422;},'WDdMr':_0x119875(0x1a6)},_0x3343ed=await getToken();if(!_0x3343ed)throw new Error(_0x220a9d[_0x119875(0x18a)]);const _0x20ecd3=_0x220a9d['YhbQb'](getApiBaseUrl),_0x7e56a=await _0x220a9d['udAkl'](fetch,_0x20ecd3+'/api/v1/mcp/features',{'method':_0x220a9d[_0x119875(0x1ad)],'headers':{'Authorization':'Bearer\x20'+_0x3343ed,'Content-Type':'application/json'},'body':JSON['stringify'](_0x1468d4)});if(!_0x7e56a['ok']){if(_0x220a9d['qOWpB'](_0x7e56a['status'],0x192)){const _0xce392b=await _0x7e56a['json'](),_0x2e8f89=_0xce392b['billingUrl']||_0x220a9d[_0x119875(0x19b)];throw new Error((_0xce392b[_0x119875(0x190)]||'Feature\x20limit\x20exceeded')+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x2e8f89);}const _0xd40f00=await _0x7e56a[_0x119875(0x1bf)]();throw new Error(_0x119875(0x192)+_0xd40f00);}return _0x7e56a['json']();}export async function listFeatures(_0x1faa5e){const _0x46a36b=_0x2cbb,_0x22aaab={'wdAwm':_0x46a36b(0x1ca),'PKjvK':_0x46a36b(0x1c1),'ZrOWH':_0x46a36b(0x1b1),'jBHZy':_0x46a36b(0x1b9),'VpYEy':_0x46a36b(0x1d1),'PbRZE':'true','yWdYL':_0x46a36b(0x1a0)},_0x1a383b=await getToken();if(!_0x1a383b)throw new Error(_0x46a36b(0x1b2));const _0x192fae=getApiBaseUrl(),_0x537965=new URLSearchParams();if(_0x1faa5e?.['gitRepoUrl'])_0x537965['set'](_0x22aaab['wdAwm'],_0x1faa5e['gitRepoUrl']);if(_0x1faa5e?.['gitBranch'])_0x537965[_0x46a36b(0x1c0)](_0x22aaab['PKjvK'],_0x1faa5e['gitBranch']);if(_0x1faa5e?.[_0x46a36b(0x1b1)])_0x537965[_0x46a36b(0x1c0)](_0x22aaab['ZrOWH'],_0x1faa5e[_0x46a36b(0x1b1)]['toString']());if(_0x1faa5e?.['offset'])_0x537965['set'](_0x22aaab['jBHZy'],_0x1faa5e[_0x46a36b(0x1b9)][_0x46a36b(0x19a)]());if(_0x1faa5e?.['includeDeleted'])_0x537965['set'](_0x22aaab['VpYEy'],_0x22aaab['PbRZE']);const _0x572714=_0x192fae+_0x46a36b(0x1aa)+(_0x537965[_0x46a36b(0x19a)]()?'?'+_0x537965['toString']():''),_0x1bbbc2=await fetch(_0x572714,{'method':_0x22aaab['yWdYL'],'headers':{'Authorization':'Bearer\x20'+_0x1a383b}});if(!_0x1bbbc2['ok']){const _0x12c9f7=await _0x1bbbc2[_0x46a36b(0x1bf)]();throw new Error(_0x46a36b(0x18c)+_0x12c9f7);}return _0x1bbbc2[_0x46a36b(0x18e)]();}export async function getFeature(_0x16fb30){const _0x5180ad=_0x2cbb,_0x32cdfc={'RduUr':function(_0x2c41c6){return _0x2c41c6();},'NgWAD':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x59a4ea=await _0x32cdfc[_0x5180ad(0x1a1)](getToken);if(!_0x59a4ea)throw new Error(_0x32cdfc['NgWAD']);const _0x304e6c=getApiBaseUrl(),_0x2e1ceb=await fetch(_0x304e6c+'/api/v1/mcp/features/'+_0x16fb30,{'method':'GET','headers':{'Authorization':_0x5180ad(0x1a2)+_0x59a4ea}});if(!_0x2e1ceb['ok']){const _0x2fa0ff=await _0x2e1ceb['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x2fa0ff);}return _0x2e1ceb['json']();}export async function updateFeature(_0x24da4d,_0x53e3f2){const _0x234c82=_0x2cbb,_0x2f1ac9={'yjeqc':function(_0x484729){return _0x484729();},'aFeuW':_0x234c82(0x1cd)},_0x30661d=await getToken();if(!_0x30661d)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x168a08=_0x2f1ac9['yjeqc'](getApiBaseUrl),_0x150c9a=await fetch(_0x168a08+_0x234c82(0x1b0)+_0x24da4d,{'method':_0x234c82(0x1b6),'headers':{'Authorization':'Bearer\x20'+_0x30661d,'Content-Type':_0x2f1ac9['aFeuW']},'body':JSON[_0x234c82(0x1a7)](_0x53e3f2)});if(!_0x150c9a['ok']){const _0x212e84=await _0x150c9a['text']();throw new Error(_0x234c82(0x19e)+_0x212e84);}return _0x150c9a[_0x234c82(0x18e)]();}export async function createChecklistItem(_0x30dccc,_0x2397f2,_0x1410da){const _0x49bc3c=_0x2cbb,_0x1e4bbf={'bPRNH':function(_0x1e87e0){return _0x1e87e0();},'TnRqK':'POST'},_0x361123=await getToken();if(!_0x361123)throw new Error(_0x49bc3c(0x1b2));const _0x334ca2=_0x1e4bbf[_0x49bc3c(0x1cb)](getApiBaseUrl),_0x46959d=await fetch(_0x334ca2+'/api/v1/mcp/features/'+_0x30dccc+_0x49bc3c(0x1b5),{'method':_0x1e4bbf['TnRqK'],'headers':{'Authorization':_0x49bc3c(0x1a2)+_0x361123,'Content-Type':'application/json'},'body':JSON['stringify']({'description':_0x2397f2,'position':_0x1410da})});if(!_0x46959d['ok']){const _0x26654b=await _0x46959d[_0x49bc3c(0x1bf)]();throw new Error(_0x49bc3c(0x19c)+_0x26654b);}return _0x46959d[_0x49bc3c(0x18e)]();}export async function updateChecklistItem(_0x1afcd4,_0x370eb6,_0x452c32){const _0x1bca9a=_0x2cbb,_0x4c664b={'GXeXm':function(_0xf48d16){return _0xf48d16();},'KvQmE':'application/json','sIjPb':function(_0x32499b,_0x3c8829,_0x1a57b1){return _0x32499b(_0x3c8829,_0x1a57b1);},'VNKvv':_0x1bca9a(0x1d0)};return _0x4c664b[_0x1bca9a(0x1c5)](withRetry,async()=>{const _0x267ac3=_0x1bca9a,_0xe96b83=await _0x4c664b['GXeXm'](getToken);if(!_0xe96b83)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x49000d=getApiBaseUrl(),_0x4bd38b=await fetch(_0x49000d+'/api/v1/mcp/features/'+_0x1afcd4+'/checklist/'+_0x370eb6,{'method':'PATCH','headers':{'Authorization':'Bearer\x20'+_0xe96b83,'Content-Type':_0x4c664b['KvQmE']},'body':JSON[_0x267ac3(0x1a7)](_0x452c32)});if(!_0x4bd38b['ok']){const _0xc14d72=await _0x4bd38b[_0x267ac3(0x1bf)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0xc14d72);}return _0x4bd38b['json']();},{'label':_0x4c664b[_0x1bca9a(0x18d)]});}export async function getFeatureReport(_0x23f1c0){const _0xa47289=_0x2cbb,_0x3440d4={'gRcyt':function(_0x4a46d9){return _0x4a46d9();},'huvlo':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','yIfSm':function(_0x18bc1d,_0x3c5a97,_0x3b1942){return _0x18bc1d(_0x3c5a97,_0x3b1942);}},_0x188557=await _0x3440d4[_0xa47289(0x1c3)](getToken);if(!_0x188557)throw new Error(_0x3440d4[_0xa47289(0x198)]);const _0x3f431d=_0x3440d4['gRcyt'](getApiBaseUrl),_0x29bef9=await _0x3440d4['yIfSm'](fetch,_0x3f431d+_0xa47289(0x1b0)+_0x23f1c0+'/report',{'method':'GET','headers':{'Authorization':_0xa47289(0x1a2)+_0x188557}});if(!_0x29bef9['ok']){const _0x3be063=await _0x29bef9[_0xa47289(0x1bf)]();throw new Error(_0xa47289(0x1ce)+_0x3be063);}return _0x29bef9['json']();}function _0x2cbb(_0x27ad40,_0x28dadd){_0x27ad40=_0x27ad40-0x18a;const _0x4b84dd=_0x4b84();let _0x2cbb10=_0x4b84dd[_0x27ad40];return _0x2cbb10;}export async function getFeatureReportMarkdown(_0x3b5c35,_0x5eae69){const _0x22e3c9=_0x2cbb,_0xf54861={'aKOLB':function(_0x4553a9){return _0x4553a9();},'leGgP':function(_0x4fb23c,_0x1fd7fb){return _0x4fb23c(_0x1fd7fb);},'hbisv':_0x22e3c9(0x18b),'pkyYt':_0x22e3c9(0x1cf),'FHouL':_0x22e3c9(0x1a4),'yzXXt':function(_0x3fd78d,_0x1f4b25,_0x5b0dae){return _0x3fd78d(_0x1f4b25,_0x5b0dae);}},_0xf93779=await _0xf54861[_0x22e3c9(0x196)](getToken);if(!_0xf93779)throw new Error(_0x22e3c9(0x1b2));const _0x1f074e=_0xf54861['aKOLB'](getApiBaseUrl),_0x21d849=new URLSearchParams(),_0x2e70b2=(_0x5eae69?.['itemIds']?.['length']??0x0)>0x0,_0x4848b0=_0xf54861['leGgP'](Boolean,_0x5eae69?.['sessionId']);_0x2e70b2&&_0x5eae69?.['itemIds']&&_0x21d849[_0x22e3c9(0x1c0)](_0xf54861[_0x22e3c9(0x1af)],_0x5eae69['itemIds'][_0x22e3c9(0x1a9)](','));_0x4848b0&&_0x5eae69?.[_0x22e3c9(0x1cf)]&&_0x21d849[_0x22e3c9(0x1c0)](_0xf54861['pkyYt'],_0x5eae69[_0x22e3c9(0x1cf)]);!_0x2e70b2&&!_0x4848b0&&_0x5eae69?.[_0x22e3c9(0x1a4)]&&_0x21d849[_0x22e3c9(0x1c0)](_0xf54861['FHouL'],_0x5eae69['style']);const _0x4dc9ad=_0x1f074e+'/api/v1/mcp/features/'+_0x3b5c35+_0x22e3c9(0x1b4),_0x2ce120=''+_0x4dc9ad+(_0x21d849['toString']()?'?'+_0x21d849['toString']():''),_0x915a13=await _0xf54861['yzXXt'](fetch,_0x2ce120,{'method':_0x22e3c9(0x1a0),'headers':{'Authorization':_0x22e3c9(0x1a2)+_0xf93779}});if(!_0x915a13['ok']){const _0x428725=await _0x915a13['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x428725);}return _0x915a13[_0x22e3c9(0x1bf)]();}export async function listFeatureSessions(_0x2af240){const _0x23fde6=_0x2cbb,_0x35d8f0={'Garrz':function(_0x22dda3){return _0x22dda3();},'ZYYEW':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','lFWQf':'GET'},_0x379fcd=await _0x35d8f0[_0x23fde6(0x1a5)](getToken);if(!_0x379fcd)throw new Error(_0x35d8f0[_0x23fde6(0x18f)]);const _0x5057d0=getApiBaseUrl(),_0x2d6ab7=await fetch(_0x5057d0+'/api/v1/mcp/features/'+_0x2af240+_0x23fde6(0x1bc),{'method':_0x35d8f0['lFWQf'],'headers':{'Authorization':'Bearer\x20'+_0x379fcd}});if(!_0x2d6ab7['ok']){const _0x49b1f1=await _0x2d6ab7['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x49b1f1);}return _0x2d6ab7['json']();}export async function startSession(_0xa6d865,_0xde852d){const _0x37ccbb=_0x2cbb,_0x2c0d6e={'XacjN':_0x37ccbb(0x1b2),'FFjbr':function(_0x4880b7){return _0x4880b7();},'vPGTj':function(_0x4b14de,_0x30a7fd,_0x57b8aa){return _0x4b14de(_0x30a7fd,_0x57b8aa);},'sXGmt':'POST'},_0x2168d2=await getToken();if(!_0x2168d2)throw new Error(_0x2c0d6e[_0x37ccbb(0x191)]);const _0x65b84a=_0x2c0d6e['FFjbr'](getApiBaseUrl),_0x5944b0=await _0x2c0d6e[_0x37ccbb(0x1c7)](fetch,_0x65b84a+'/api/v1/mcp/features/'+_0xa6d865+_0x37ccbb(0x1bd)+_0xde852d+'/start',{'method':_0x2c0d6e['sXGmt'],'headers':{'Authorization':'Bearer\x20'+_0x2168d2}});if(!_0x5944b0['ok']){const _0x5301c1=await _0x5944b0['text']();throw new Error(_0x37ccbb(0x1ae)+_0x5301c1);}return _0x5944b0['json']();}export async function concludeSession(_0x3d1485,_0x3bbb88){const _0x1e1bb2=_0x2cbb,_0x196b6b={'kkHSM':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','beGtI':function(_0x51f818){return _0x51f818();}},_0x29b9eb=await getToken();if(!_0x29b9eb)throw new Error(_0x196b6b['kkHSM']);const _0x44efc3=_0x196b6b['beGtI'](getApiBaseUrl),_0x1df7c2=await fetch(_0x44efc3+_0x1e1bb2(0x1b0)+_0x3d1485+_0x1e1bb2(0x1bd)+_0x3bbb88+'/conclude',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x29b9eb}});if(!_0x1df7c2['ok']){const _0x48f8b3=await _0x1df7c2[_0x1e1bb2(0x1bf)]();throw new Error(_0x1e1bb2(0x19d)+_0x48f8b3);}return _0x1df7c2['json']();}export async function getActionItems(_0x3da340){const _0x21fe5d=_0x2cbb,_0x5bc1ac={'wuPwk':function(_0x4d854f){return _0x4d854f();},'mLyCj':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','wVzyK':function(_0x55b1bc,_0x5165fb,_0x331623){return _0x55b1bc(_0x5165fb,_0x331623);},'TxKqP':'GET'},_0x121d69=await _0x5bc1ac[_0x21fe5d(0x194)](getToken);if(!_0x121d69)throw new Error(_0x5bc1ac[_0x21fe5d(0x1ba)]);const _0x298a2d=_0x5bc1ac[_0x21fe5d(0x194)](getApiBaseUrl),_0x3d8e00=await _0x5bc1ac['wVzyK'](fetch,_0x298a2d+_0x21fe5d(0x1b0)+_0x3da340+_0x21fe5d(0x193),{'method':_0x5bc1ac['TxKqP'],'headers':{'Authorization':_0x21fe5d(0x1a2)+_0x121d69}});if(!_0x3d8e00['ok']){const _0x1ae4c5=await _0x3d8e00['text']();throw new Error(_0x21fe5d(0x1c6)+_0x1ae4c5);}return _0x3d8e00['json']();}export async function getItemFeedback(_0x56cb4f,_0x28e25c){const _0x245013=_0x2cbb,_0x52d7f0={'kxBQn':_0x245013(0x1b2),'bfMAH':'GET'},_0x3fb3f1=await getToken();if(!_0x3fb3f1)throw new Error(_0x52d7f0[_0x245013(0x197)]);const _0x215615=getApiBaseUrl(),_0x5cbccb=await fetch(_0x215615+'/api/v1/mcp/features/'+_0x56cb4f+_0x245013(0x1c9)+_0x28e25c+'/feedback',{'method':_0x52d7f0[_0x245013(0x1c2)],'headers':{'Authorization':'Bearer\x20'+_0x3fb3f1}});if(!_0x5cbccb['ok']){const _0x3ead93=await _0x5cbccb[_0x245013(0x1bf)]();throw new Error(_0x245013(0x195)+_0x3ead93);}return _0x5cbccb['json']();}export async function markCommentsAddressed(_0x400040,_0x41e275,_0x4989b8){const _0x5d42ad=_0x2cbb,_0x2d8c8d={'vsuEK':_0x5d42ad(0x1b2),'RKUYn':function(_0x55d711){return _0x55d711();},'dsFzB':function(_0x35f3a0,_0x3c2060,_0x10bddd){return _0x35f3a0(_0x3c2060,_0x10bddd);}},_0x4847a2=await getToken();if(!_0x4847a2)throw new Error(_0x2d8c8d[_0x5d42ad(0x1c4)]);const _0x248870=_0x2d8c8d['RKUYn'](getApiBaseUrl),_0x2ea154=await _0x2d8c8d['dsFzB'](fetch,_0x248870+_0x5d42ad(0x1b0)+_0x400040+'/comments/address',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x4847a2,'Content-Type':'application/json'},'body':JSON['stringify']({'checklistItemId':_0x41e275,'commentIds':_0x4989b8})});if(!_0x2ea154['ok']){const _0x58b5b4=await _0x2ea154['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x58b5b4);}}function _0x4b84(){const _0x576c98=['mLyCj','887823EDuMLn','/sessions','/sessions/','10WOVPxS','text','set','gitBranch','bfMAH','gRcyt','vsuEK','sIjPb','Failed\x20to\x20get\x20action\x20items:\x20','vPGTj','1HLZCMd','/checklist-items/','gitRepoUrl','bPRNH','2412039QdLKMj','application/json','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','sessionId','updateChecklistItem','includeDeleted','GMRXC','itemIds','Failed\x20to\x20list\x20feature\x20reviews:\x20','VNKvv','json','ZYYEW','message','XacjN','Failed\x20to\x20create\x20feature\x20review:\x20','/action-items','wuPwk','Failed\x20to\x20get\x20item\x20feedback:\x20','aKOLB','kxBQn','huvlo','fsaFx','toString','WDdMr','Failed\x20to\x20create\x20scenario:\x20','Failed\x20to\x20conclude\x20session:\x20','Failed\x20to\x20update\x20feature\x20review:\x20','799098JWBTJe','GET','RduUr','Bearer\x20','POST','style','Garrz','https://dashboard.ranger.net/billing','stringify','10nDEbSl','join','/api/v1/mcp/features','549210ERJJos','3975037NjhgLW','JMaRG','Failed\x20to\x20start\x20session:\x20','hbisv','/api/v1/mcp/features/','limit','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','1054056IbNnwX','/report/markdown','/checklist','PATCH','8cBdYeY','382266ahbwZH','offset'];_0x4b84=function(){return _0x576c98;};return _0x4b84();}export async function softDeleteFeature(_0xb2f5eb){const _0x4c921b=_0x2cbb,_0x331bca={'JxvvN':function(_0x469dd6){return _0x469dd6();},'fsaFx':function(_0x253663,_0x611cf9,_0x40fdd5){return _0x253663(_0x611cf9,_0x40fdd5);}},_0x2588fd=await getToken();if(!_0x2588fd)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5d08e8=_0x331bca['JxvvN'](getApiBaseUrl),_0x528b05=await _0x331bca[_0x4c921b(0x199)](fetch,_0x5d08e8+_0x4c921b(0x1b0)+_0xb2f5eb,{'method':'DELETE','headers':{'Authorization':'Bearer\x20'+_0x2588fd}});if(!_0x528b05['ok']){const _0x5541a1=await _0x528b05['text']();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x5541a1);}}export async function restoreFeature(_0x1cca8a){const _0xbdcdb9=_0x2cbb,_0x167927={'OODzi':function(_0x11cec9){return _0x11cec9();},'qxYsD':function(_0x3d8b67,_0xfecf23,_0x26f364){return _0x3d8b67(_0xfecf23,_0x26f364);},'thbhU':_0xbdcdb9(0x1a3)},_0x46a0e7=await _0x167927['OODzi'](getToken);if(!_0x46a0e7)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x166287=_0x167927['OODzi'](getApiBaseUrl),_0x5cd5fe=await _0x167927['qxYsD'](fetch,_0x166287+'/api/v1/mcp/features/'+_0x1cca8a+'/restore',{'method':_0x167927['thbhU'],'headers':{'Authorization':'Bearer\x20'+_0x46a0e7}});if(!_0x5cd5fe['ok']){const _0x58a350=await _0x5cd5fe[_0xbdcdb9(0x1bf)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x58a350);}}
|
|
1
|
+
(function(_0xb2b246,_0x58c01d){const _0xb7f1de=_0x42f3,_0x4d6c5f=_0xb2b246();while(!![]){try{const _0x3576c2=parseInt(_0xb7f1de(0x140))/0x1+parseInt(_0xb7f1de(0x143))/0x2*(parseInt(_0xb7f1de(0x157))/0x3)+parseInt(_0xb7f1de(0x135))/0x4*(parseInt(_0xb7f1de(0x154))/0x5)+-parseInt(_0xb7f1de(0x14d))/0x6+-parseInt(_0xb7f1de(0x14c))/0x7+parseInt(_0xb7f1de(0x15e))/0x8+-parseInt(_0xb7f1de(0x134))/0x9;if(_0x3576c2===_0x58c01d)break;else _0x4d6c5f['push'](_0x4d6c5f['shift']());}catch(_0x4a1092){_0x4d6c5f['push'](_0x4d6c5f['shift']());}}}(_0x22e8,0xe2329));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x42f3(_0x17db48,_0x3bfa0b){_0x17db48=_0x17db48-0x133;const _0x22e852=_0x22e8();let _0x42f3a0=_0x22e852[_0x17db48];return _0x42f3a0;}import{withRetry}from'./retry.js';export async function createFeature(_0x53944b){const _0x26c1f8=_0x42f3,_0x4bc92e={'LQQaK':function(_0x298c35){return _0x298c35();},'JbnYc':_0x26c1f8(0x14b),'lACPL':_0x26c1f8(0x172)},_0x187ebe=await _0x4bc92e['LQQaK'](getToken);if(!_0x187ebe)throw new Error(_0x26c1f8(0x16d));const _0x285200=_0x4bc92e[_0x26c1f8(0x166)](getApiBaseUrl),_0x4ac37b=await fetch(_0x285200+_0x26c1f8(0x15c),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x187ebe,'Content-Type':'application/json'},'body':JSON[_0x26c1f8(0x13e)](_0x53944b)});if(!_0x4ac37b['ok']){if(_0x4ac37b[_0x26c1f8(0x173)]===0x192){const _0x47a3d1=await _0x4ac37b[_0x26c1f8(0x13a)](),_0xa816a8=_0x47a3d1[_0x26c1f8(0x14e)]||_0x4bc92e['JbnYc'];throw new Error((_0x47a3d1[_0x26c1f8(0x145)]||_0x4bc92e['lACPL'])+_0x26c1f8(0x163)+_0xa816a8);}const _0x25f06e=await _0x4ac37b[_0x26c1f8(0x153)]();throw new Error(_0x26c1f8(0x158)+_0x25f06e);}return _0x4ac37b[_0x26c1f8(0x13a)]();}export async function listFeatures(_0x4ae37f){const _0xb04675=_0x42f3,_0x491e8e={'AGctk':function(_0x1b3503){return _0x1b3503();},'vZJli':_0xb04675(0x16d),'PzzAo':'limit','RxRYy':'offset','JszOF':'includeDeleted','QWnIZ':_0xb04675(0x17e)},_0x49a486=await _0x491e8e['AGctk'](getToken);if(!_0x49a486)throw new Error(_0x491e8e['vZJli']);const _0x180044=getApiBaseUrl(),_0xd000c1=new URLSearchParams();if(_0x4ae37f?.['gitRepoUrl'])_0xd000c1[_0xb04675(0x180)](_0xb04675(0x160),_0x4ae37f['gitRepoUrl']);if(_0x4ae37f?.[_0xb04675(0x16b)])_0xd000c1[_0xb04675(0x180)](_0xb04675(0x16b),_0x4ae37f[_0xb04675(0x16b)]);if(_0x4ae37f?.[_0xb04675(0x176)])_0xd000c1['set'](_0x491e8e[_0xb04675(0x136)],_0x4ae37f[_0xb04675(0x176)][_0xb04675(0x181)]());if(_0x4ae37f?.[_0xb04675(0x16a)])_0xd000c1['set'](_0x491e8e['RxRYy'],_0x4ae37f['offset'][_0xb04675(0x181)]());if(_0x4ae37f?.[_0xb04675(0x17f)])_0xd000c1['set'](_0x491e8e['JszOF'],_0xb04675(0x138));const _0x4b840e=_0x180044+_0xb04675(0x15c)+(_0xd000c1['toString']()?'?'+_0xd000c1[_0xb04675(0x181)]():''),_0x5847dd=await fetch(_0x4b840e,{'method':_0x491e8e[_0xb04675(0x15b)],'headers':{'Authorization':_0xb04675(0x13c)+_0x49a486}});if(!_0x5847dd['ok']){const _0x599f95=await _0x5847dd[_0xb04675(0x153)]();throw new Error(_0xb04675(0x17b)+_0x599f95);}return _0x5847dd[_0xb04675(0x13a)]();}function _0x22e8(){const _0xb4cc48=['Failed\x20to\x20start\x20session:\x20','gzaEE','LQQaK','Failed\x20to\x20update\x20scenario:\x20','application/json','/checklist/','offset','gitBranch','gpzhK','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','/sessions/','Failed\x20to\x20get\x20item\x20feedback:\x20','/action-items','lZMDv','Feature\x20limit\x20exceeded','status','ncuTJ','MpHox','limit','/checklist','quCEN','SELLz','sessionId','Failed\x20to\x20list\x20feature\x20reviews:\x20','itemIds','join','GET','includeDeleted','set','toString','uGqoZ','style','7256079EIcWMC','4mjJRQf','PzzAo','gynYd','true','/report/markdown','json','DgJrl','Bearer\x20','/conclude','stringify','Failed\x20to\x20create\x20scenario:\x20','802323JvcZVC','/api/v1/mcp/features/','DELETE','2341384qkcRjm','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','message','TwEyP','Failed\x20to\x20get\x20action\x20items:\x20','rhTJn','aaNYy','POST','https://dashboard.ranger.net/billing','5781027xpvrGZ','7177158hXPjVK','billingUrl','JySgH','rmXhP','xAesE','AUQwj','text','2748310WCgTyQ','AvdlY','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','3xcjWUs','Failed\x20to\x20create\x20feature\x20review:\x20','NDUMx','wVPtY','QWnIZ','/api/v1/mcp/features','QKfdW','9856904OKhZSS','fxbxl','gitRepoUrl','Failed\x20to\x20delete\x20feature\x20review:\x20','VGCuP','\x0a\x0aUpgrade\x20your\x20plan:\x20'];_0x22e8=function(){return _0xb4cc48;};return _0x22e8();}export async function getFeature(_0x14e3a6){const _0x189293=_0x42f3,_0x3b560a={'VGCuP':function(_0x5cd035){return _0x5cd035();},'AbWXH':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','rmXhP':function(_0x141e9d){return _0x141e9d();},'WWDxs':function(_0x3b43c3,_0x31f169,_0x38be2e){return _0x3b43c3(_0x31f169,_0x38be2e);},'QKfdW':_0x189293(0x17e)},_0x1aee73=await _0x3b560a[_0x189293(0x162)](getToken);if(!_0x1aee73)throw new Error(_0x3b560a['AbWXH']);const _0x2f2c7b=_0x3b560a[_0x189293(0x150)](getApiBaseUrl),_0x25b1eb=await _0x3b560a['WWDxs'](fetch,_0x2f2c7b+'/api/v1/mcp/features/'+_0x14e3a6,{'method':_0x3b560a[_0x189293(0x15d)],'headers':{'Authorization':'Bearer\x20'+_0x1aee73}});if(!_0x25b1eb['ok']){const _0x5dc283=await _0x25b1eb[_0x189293(0x153)]();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x5dc283);}return _0x25b1eb[_0x189293(0x13a)]();}export async function updateFeature(_0x21a04c,_0x38409f){const _0x1fe993=_0x42f3,_0x583d2d={'DgJrl':function(_0x2e68ed){return _0x2e68ed();},'EYaWc':function(_0x15edf6,_0x4be230,_0x1f82a1){return _0x15edf6(_0x4be230,_0x1f82a1);}},_0x219d3c=await _0x583d2d[_0x1fe993(0x13b)](getToken);if(!_0x219d3c)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2fe94c=_0x583d2d['DgJrl'](getApiBaseUrl),_0x1dd95c=await _0x583d2d['EYaWc'](fetch,_0x2fe94c+_0x1fe993(0x141)+_0x21a04c,{'method':'PATCH','headers':{'Authorization':_0x1fe993(0x13c)+_0x219d3c,'Content-Type':'application/json'},'body':JSON['stringify'](_0x38409f)});if(!_0x1dd95c['ok']){const _0x3424df=await _0x1dd95c['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x3424df);}return _0x1dd95c[_0x1fe993(0x13a)]();}export async function createChecklistItem(_0x1a9bc9,_0x53650e,_0x4d8162){const _0x457d0a=_0x42f3,_0x1e474e={'uGqoZ':_0x457d0a(0x16d),'aaNYy':function(_0x33dca9){return _0x33dca9();},'kHpCG':'application/json'},_0x5bef29=await getToken();if(!_0x5bef29)throw new Error(_0x1e474e[_0x457d0a(0x182)]);const _0xc2bb25=_0x1e474e[_0x457d0a(0x149)](getApiBaseUrl),_0x32dc33=await fetch(_0xc2bb25+_0x457d0a(0x141)+_0x1a9bc9+_0x457d0a(0x177),{'method':'POST','headers':{'Authorization':_0x457d0a(0x13c)+_0x5bef29,'Content-Type':_0x1e474e['kHpCG']},'body':JSON[_0x457d0a(0x13e)]({'description':_0x53650e,'position':_0x4d8162})});if(!_0x32dc33['ok']){const _0x49d50c=await _0x32dc33['text']();throw new Error(_0x457d0a(0x13f)+_0x49d50c);}return _0x32dc33[_0x457d0a(0x13a)]();}export async function updateChecklistItem(_0x90bcad,_0x491b9f,_0x4f5266){const _0x39c1e7=_0x42f3,_0x532c5b={'LOXMK':function(_0x5252b6){return _0x5252b6();},'UTBbN':_0x39c1e7(0x16d),'SELLz':'PATCH','lZMDv':_0x39c1e7(0x168),'vjlIT':'updateChecklistItem'};return withRetry(async()=>{const _0x22df1c=_0x39c1e7,_0x50f9c4=await _0x532c5b['LOXMK'](getToken);if(!_0x50f9c4)throw new Error(_0x532c5b['UTBbN']);const _0x1530be=getApiBaseUrl(),_0x2c236d=await fetch(_0x1530be+'/api/v1/mcp/features/'+_0x90bcad+_0x22df1c(0x169)+_0x491b9f,{'method':_0x532c5b[_0x22df1c(0x179)],'headers':{'Authorization':_0x22df1c(0x13c)+_0x50f9c4,'Content-Type':_0x532c5b[_0x22df1c(0x171)]},'body':JSON[_0x22df1c(0x13e)](_0x4f5266)});if(!_0x2c236d['ok']){const _0x3606a2=await _0x2c236d['text']();throw new Error(_0x22df1c(0x167)+_0x3606a2);}return _0x2c236d['json']();},{'label':_0x532c5b['vjlIT']});}export async function getFeatureReport(_0xdc50d6){const _0x4d9b91=_0x42f3,_0x1c0684={'XcUhb':_0x4d9b91(0x17e)},_0x50cac1=await getToken();if(!_0x50cac1)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x18aa04=getApiBaseUrl(),_0x4cebfb=await fetch(_0x18aa04+_0x4d9b91(0x141)+_0xdc50d6+'/report',{'method':_0x1c0684['XcUhb'],'headers':{'Authorization':_0x4d9b91(0x13c)+_0x50cac1}});if(!_0x4cebfb['ok']){const _0x201293=await _0x4cebfb['text']();throw new Error(_0x4d9b91(0x156)+_0x201293);}return _0x4cebfb['json']();}export async function getFeatureReportMarkdown(_0x370864,_0xa21a){const _0x194b8f=_0x42f3,_0x108bfb={'AvdlY':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','NDUMx':function(_0x3b9bae){return _0x3b9bae();},'wVPtY':_0x194b8f(0x17c),'VXNeh':'sessionId','TwEyP':function(_0x2a3824,_0x4d8c76){return _0x2a3824&&_0x4d8c76;},'TPunL':_0x194b8f(0x17e)},_0x13c48d=await getToken();if(!_0x13c48d)throw new Error(_0x108bfb[_0x194b8f(0x155)]);const _0x5654a7=_0x108bfb[_0x194b8f(0x159)](getApiBaseUrl),_0x17462f=new URLSearchParams(),_0xf10c9f=(_0xa21a?.[_0x194b8f(0x17c)]?.['length']??0x0)>0x0,_0x3d2d43=Boolean(_0xa21a?.[_0x194b8f(0x17a)]);_0xf10c9f&&_0xa21a?.['itemIds']&&_0x17462f['set'](_0x108bfb[_0x194b8f(0x15a)],_0xa21a[_0x194b8f(0x17c)][_0x194b8f(0x17d)](','));_0x3d2d43&&_0xa21a?.['sessionId']&&_0x17462f[_0x194b8f(0x180)](_0x108bfb['VXNeh'],_0xa21a[_0x194b8f(0x17a)]);_0x108bfb[_0x194b8f(0x146)](!_0xf10c9f,!_0x3d2d43)&&_0xa21a?.[_0x194b8f(0x133)]&&_0x17462f['set']('style',_0xa21a[_0x194b8f(0x133)]);const _0x31c65e=_0x5654a7+'/api/v1/mcp/features/'+_0x370864+_0x194b8f(0x139),_0x5b5c8b=''+_0x31c65e+(_0x17462f[_0x194b8f(0x181)]()?'?'+_0x17462f['toString']():''),_0x3c83d0=await fetch(_0x5b5c8b,{'method':_0x108bfb['TPunL'],'headers':{'Authorization':_0x194b8f(0x13c)+_0x13c48d}});if(!_0x3c83d0['ok']){const _0x2d9c43=await _0x3c83d0['text']();throw new Error(_0x194b8f(0x144)+_0x2d9c43);}return _0x3c83d0['text']();}export async function listFeatureSessions(_0x45267e){const _0x556560=_0x42f3,_0x4f34a2={'AxqzE':function(_0x77179a){return _0x77179a();},'NGqLQ':_0x556560(0x16d)},_0x33edfc=await _0x4f34a2['AxqzE'](getToken);if(!_0x33edfc)throw new Error(_0x4f34a2['NGqLQ']);const _0x11724e=getApiBaseUrl(),_0x52bc13=await fetch(_0x11724e+'/api/v1/mcp/features/'+_0x45267e+'/sessions',{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x33edfc}});if(!_0x52bc13['ok']){const _0x3ad2de=await _0x52bc13['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x3ad2de);}return _0x52bc13['json']();}export async function startSession(_0x2594bc,_0x1a807c){const _0x5bcc77=_0x42f3,_0x2ace68={'sfGIz':_0x5bcc77(0x16d),'KKQxe':_0x5bcc77(0x14a)},_0x3168ef=await getToken();if(!_0x3168ef)throw new Error(_0x2ace68['sfGIz']);const _0x5516ff=getApiBaseUrl(),_0x4ff6b7=await fetch(_0x5516ff+_0x5bcc77(0x141)+_0x2594bc+'/sessions/'+_0x1a807c+'/start',{'method':_0x2ace68['KKQxe'],'headers':{'Authorization':'Bearer\x20'+_0x3168ef}});if(!_0x4ff6b7['ok']){const _0x477890=await _0x4ff6b7['text']();throw new Error(_0x5bcc77(0x164)+_0x477890);}return _0x4ff6b7['json']();}export async function concludeSession(_0x4eef90,_0x308832){const _0x14ae25=_0x42f3,_0x104c98={'ncuTJ':function(_0x3170e0){return _0x3170e0();}},_0x4cd95b=await _0x104c98[_0x14ae25(0x174)](getToken);if(!_0x4cd95b)throw new Error(_0x14ae25(0x16d));const _0x168ef1=getApiBaseUrl(),_0x1c38cf=await fetch(_0x168ef1+_0x14ae25(0x141)+_0x4eef90+_0x14ae25(0x16e)+_0x308832+_0x14ae25(0x13d),{'method':_0x14ae25(0x14a),'headers':{'Authorization':_0x14ae25(0x13c)+_0x4cd95b}});if(!_0x1c38cf['ok']){const _0x592d3f=await _0x1c38cf[_0x14ae25(0x153)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x592d3f);}return _0x1c38cf[_0x14ae25(0x13a)]();}export async function getActionItems(_0x4230ce){const _0x5dfa88=_0x42f3,_0x70a29c={'JySgH':function(_0x52837c){return _0x52837c();},'fxbxl':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','bzTie':function(_0x43a78d,_0xbc1f1a,_0x4ea1ba){return _0x43a78d(_0xbc1f1a,_0x4ea1ba);}},_0x365014=await _0x70a29c[_0x5dfa88(0x14f)](getToken);if(!_0x365014)throw new Error(_0x70a29c[_0x5dfa88(0x15f)]);const _0x365d17=_0x70a29c['JySgH'](getApiBaseUrl),_0x47437f=await _0x70a29c['bzTie'](fetch,_0x365d17+_0x5dfa88(0x141)+_0x4230ce+_0x5dfa88(0x170),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x365014}});if(!_0x47437f['ok']){const _0x434198=await _0x47437f[_0x5dfa88(0x153)]();throw new Error(_0x5dfa88(0x147)+_0x434198);}return _0x47437f['json']();}export async function getItemFeedback(_0x23b5db,_0x9fc221){const _0xa289ec=_0x42f3,_0x459cb9={'RCmFL':_0xa289ec(0x16d),'SoVqL':'GET'},_0x3956f0=await getToken();if(!_0x3956f0)throw new Error(_0x459cb9['RCmFL']);const _0x4aef82=getApiBaseUrl(),_0x58eafb=await fetch(_0x4aef82+'/api/v1/mcp/features/'+_0x23b5db+'/checklist-items/'+_0x9fc221+'/feedback',{'method':_0x459cb9['SoVqL'],'headers':{'Authorization':'Bearer\x20'+_0x3956f0}});if(!_0x58eafb['ok']){const _0x62d66=await _0x58eafb['text']();throw new Error(_0xa289ec(0x16f)+_0x62d66);}return _0x58eafb['json']();}export async function markCommentsAddressed(_0x5a536f,_0x43d212,_0x1db4d5){const _0x2ec776=_0x42f3,_0x3c3e2e={'gynYd':function(_0x41e55b){return _0x41e55b();},'rhTJn':function(_0x15a913,_0x3b5914,_0x288686){return _0x15a913(_0x3b5914,_0x288686);},'xAesE':_0x2ec776(0x14a),'jdlsF':_0x2ec776(0x168)},_0x58b9cc=await getToken();if(!_0x58b9cc)throw new Error(_0x2ec776(0x16d));const _0x550a7e=_0x3c3e2e[_0x2ec776(0x137)](getApiBaseUrl),_0x2bc797=await _0x3c3e2e[_0x2ec776(0x148)](fetch,_0x550a7e+'/api/v1/mcp/features/'+_0x5a536f+'/comments/address',{'method':_0x3c3e2e[_0x2ec776(0x151)],'headers':{'Authorization':_0x2ec776(0x13c)+_0x58b9cc,'Content-Type':_0x3c3e2e['jdlsF']},'body':JSON[_0x2ec776(0x13e)]({'checklistItemId':_0x43d212,'commentIds':_0x1db4d5})});if(!_0x2bc797['ok']){const _0x4eb725=await _0x2bc797['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x4eb725);}}export async function softDeleteFeature(_0x5a310e){const _0x55675b=_0x42f3,_0x9c540f={'MpHox':function(_0x2bdd1b){return _0x2bdd1b();},'gpzhK':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','NIhVJ':function(_0x452551){return _0x452551();},'AUQwj':function(_0x3bb6f3,_0x51924b,_0x2d442b){return _0x3bb6f3(_0x51924b,_0x2d442b);},'quCEN':_0x55675b(0x142)},_0x3cc7dd=await _0x9c540f[_0x55675b(0x175)](getToken);if(!_0x3cc7dd)throw new Error(_0x9c540f[_0x55675b(0x16c)]);const _0x5a3669=_0x9c540f['NIhVJ'](getApiBaseUrl),_0x5c2112=await _0x9c540f[_0x55675b(0x152)](fetch,_0x5a3669+_0x55675b(0x141)+_0x5a310e,{'method':_0x9c540f[_0x55675b(0x178)],'headers':{'Authorization':'Bearer\x20'+_0x3cc7dd}});if(!_0x5c2112['ok']){const _0x4fe027=await _0x5c2112[_0x55675b(0x153)]();throw new Error(_0x55675b(0x161)+_0x4fe027);}}export async function restoreFeature(_0x106194){const _0x4a62ff=_0x42f3,_0x1bc7a2={'MrTlY':_0x4a62ff(0x16d),'gzaEE':function(_0x4f60cf,_0x28c001,_0x33f0ba){return _0x4f60cf(_0x28c001,_0x33f0ba);},'KZDvl':'POST'},_0x1743f1=await getToken();if(!_0x1743f1)throw new Error(_0x1bc7a2['MrTlY']);const _0x1a8c49=getApiBaseUrl(),_0x4de372=await _0x1bc7a2[_0x4a62ff(0x165)](fetch,_0x1a8c49+'/api/v1/mcp/features/'+_0x106194+'/restore',{'method':_0x1bc7a2['KZDvl'],'headers':{'Authorization':'Bearer\x20'+_0x1743f1}});if(!_0x4de372['ok']){const _0xe651d2=await _0x4de372['text']();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0xe651d2);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x2fd3(_0x535841,_0x118a2b){_0x535841=_0x535841-0x1dd;const _0x3a29f4=_0x3a29();let _0x2fd3c5=_0x3a29f4[_0x535841];return _0x2fd3c5;}function _0x3a29(){const _0x2d944b=['offset','jKwaF','9SHqkNH','AtyfS','Emtsw','endsWith','bvuAP','argv','floor','khtJY','log','OlgNc','UYgPh','Jnsbc','PWAEK','708624FSXluF','from','Could\x20not\x20find\x20Info\x20element','alloc','aKtcc','min','48McBWTk','IBFDy','File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.','QFlqr','2327765wUIJeN','length','error','dataOffset','NiFgY','vQuMv','sizeLen','FjhjY','101449NNeUSP','11560RmSKtw','iWxpy','LmbXZ','IpSjZ','OXKgW','3123RdQZBP','XsziR','2abDaBu','yYiKF','IqPzl','WNeUG','lnlPH','376509wdifbU','LJNjk','writeDoubleBE','ffCsr','QKnmp','dataSize','577332pCmbxr','gicfE','yUxQR','indexOf','XqNYY','6908220bpkrRk','concat','Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','UhoaI','Uttzs','AFJzp','XbqwL','Fixed:\x20','lYKbh','slice'];_0x3a29=function(){return _0x2d944b;};return _0x3a29();}const _0x57f671=_0x2fd3;(function(_0x43bf8c,_0x215dfb){const _0x141352=_0x2fd3,_0x14fe1d=_0x43bf8c();while(!![]){try{const _0x495309=-parseInt(_0x141352(0x1df))/0x1*(parseInt(_0x141352(0x1e7))/0x2)+-parseInt(_0x141352(0x203))/0x3*(parseInt(_0x141352(0x1f2))/0x4)+parseInt(_0x141352(0x21a))/0x5+-parseInt(_0x141352(0x210))/0x6+-parseInt(_0x141352(0x1ec))/0x7*(-parseInt(_0x141352(0x216))/0x8)+-parseInt(_0x141352(0x1e5))/0x9*(parseInt(_0x141352(0x1e0))/0xa)+parseInt(_0x141352(0x1f7))/0xb;if(_0x495309===_0x215dfb)break;else _0x14fe1d['push'](_0x14fe1d['shift']());}catch(_0x3dd7a5){_0x14fe1d['push'](_0x14fe1d['shift']());}}}(_0x3a29,0x58873));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(_0x545440,_0x2f39f0){const _0x5d74a5=_0x2fd3,_0x12746e={'ffCsr':function(_0x254459,_0x58facc){return _0x254459>_0x58facc;},'AtyfS':function(_0x20acdb,_0x17ee43){return _0x20acdb-_0x17ee43;},'XbqwL':function(_0x575f35,_0x65fd7){return _0x575f35+_0x65fd7;},'mRBhQ':function(_0x190e98,_0x32c8f3){return _0x190e98*_0x32c8f3;}};if(_0x2f39f0>=_0x545440['length'])return[0x0,0x0];const _0x300987=_0x545440[_0x2f39f0];let _0x4afc1c=0x1,_0x505110=0x80;while(_0x4afc1c<=0x8&&!(_0x300987&_0x505110)){_0x4afc1c++,_0x505110>>=0x1;}if(_0x12746e[_0x5d74a5(0x1ef)](_0x2f39f0+_0x4afc1c,_0x545440['length']))return[0x0,0x0];let _0x4faa88=_0x300987&_0x12746e[_0x5d74a5(0x204)](_0x505110,0x1);for(let _0x3e0dda=0x1;_0x3e0dda<_0x4afc1c;_0x3e0dda++){_0x4faa88=_0x12746e[_0x5d74a5(0x1fd)](_0x12746e['mRBhQ'](_0x4faa88,0x100),_0x545440[_0x2f39f0+_0x3e0dda]);}return[_0x4faa88,_0x4afc1c];}function readId(_0x5a66fe,_0x4b1e6b){const _0x1ffcd3=_0x2fd3,_0x12376f={'AFJzp':function(_0x158632,_0x25b428){return _0x158632>=_0x25b428;},'lhZkk':function(_0x2a0486,_0x2afc18){return _0x2a0486>_0x2afc18;},'gicfE':function(_0x22a438,_0x47e90b){return _0x22a438+_0x47e90b;},'XsziR':function(_0x3c1ddb,_0xca9893){return _0x3c1ddb<_0xca9893;},'SYyjs':function(_0x1e8bf8,_0x817de1){return _0x1e8bf8*_0x817de1;}};if(_0x12376f['AFJzp'](_0x4b1e6b,_0x5a66fe[_0x1ffcd3(0x21b)]))return[0x0,0x0];const _0x3a33c8=_0x5a66fe[_0x4b1e6b];let _0xff787b;if(_0x12376f['AFJzp'](_0x3a33c8,0x80))_0xff787b=0x1;else{if(_0x3a33c8>=0x40)_0xff787b=0x2;else{if(_0x12376f[_0x1ffcd3(0x1fc)](_0x3a33c8,0x20))_0xff787b=0x3;else{if(_0x3a33c8>=0x10)_0xff787b=0x4;else return[_0x3a33c8,0x1];}}}if(_0x12376f['lhZkk'](_0x12376f[_0x1ffcd3(0x1f3)](_0x4b1e6b,_0xff787b),_0x5a66fe['length']))return[0x0,0x0];let _0x2a0967=0x0;for(let _0x8925ca=0x0;_0x12376f[_0x1ffcd3(0x1e6)](_0x8925ca,_0xff787b);_0x8925ca++){_0x2a0967=_0x12376f['SYyjs'](_0x2a0967,0x100)+_0x5a66fe[_0x4b1e6b+_0x8925ca];}return[_0x2a0967,_0xff787b];}function readUint(_0x4d8dee,_0x158621,_0x3ab262){const _0x326865=_0x2fd3,_0x17eb53={'XVsUV':function(_0x4f73d0,_0x559f6b){return _0x4f73d0<_0x559f6b;},'tGUzu':function(_0x420bb5,_0x4c0c5e){return _0x420bb5*_0x4c0c5e;},'FjhjY':function(_0x2c6f53,_0x5c9f88){return _0x2c6f53+_0x5c9f88;}};let _0x372a5e=0x0;for(let _0x100f14=0x0;_0x17eb53['XVsUV'](_0x100f14,_0x3ab262);_0x100f14++){_0x372a5e=_0x17eb53['tGUzu'](_0x372a5e,0x100)+_0x4d8dee[_0x17eb53[_0x326865(0x1de)](_0x158621,_0x100f14)];}return _0x372a5e;}function isUnknownSize(_0x115996,_0x3747ab){const _0x57b17f={'FTcaV':function(_0x590676,_0x3b977c){return _0x590676===_0x3b977c;},'tOJAX':function(_0x526738,_0x2715e2){return _0x526738*_0x2715e2;}};return _0x57b17f['FTcaV'](_0x115996,Math['pow'](0x2,_0x57b17f['tOJAX'](0x7,_0x3747ab))-0x1);}function writeId(_0x32386d){const _0x372037=_0x2fd3,_0xdd4c66={'chtID':function(_0x5a93e5,_0xeea0d6){return _0x5a93e5&_0xeea0d6;},'mgift':function(_0x1a8f04,_0xa4e835){return _0x1a8f04>>_0xa4e835;},'UNVul':function(_0x3f339a,_0x40e6dd){return _0x3f339a>>_0x40e6dd;},'yjWcS':function(_0x40dba2,_0x4d18c0){return _0x40dba2&_0x4d18c0;},'HvEMs':function(_0x29ddc4,_0x4a8489){return _0x29ddc4&_0x4a8489;}};if(_0x32386d<=0xff)return Buffer['from']([_0x32386d]);if(_0x32386d<=0xffff)return Buffer[_0x372037(0x211)]([_0x32386d>>0x8&0xff,_0xdd4c66['chtID'](_0x32386d,0xff)]);if(_0x32386d<=0xffffff)return Buffer['from']([_0xdd4c66['mgift'](_0x32386d,0x10)&0xff,_0xdd4c66['UNVul'](_0x32386d,0x8)&0xff,_0x32386d&0xff]);return Buffer[_0x372037(0x211)]([_0xdd4c66['yjWcS'](_0xdd4c66['UNVul'](_0x32386d,0x18),0xff),_0x32386d>>0x10&0xff,_0xdd4c66['UNVul'](_0x32386d,0x8)&0xff,_0xdd4c66['HvEMs'](_0x32386d,0xff)]);}function writeVint(_0x2bd322,_0x3047ce){const _0x5fae37=_0x2fd3,_0x29ba9d={'PWAEK':function(_0x3442d5,_0x31a3a4){return _0x3442d5-_0x31a3a4;},'zOINb':function(_0x194b94,_0x374b15){return _0x194b94-_0x374b15;},'vQuMv':function(_0x9209d2,_0xb01cd0){return _0x9209d2>=_0xb01cd0;},'EnuLl':function(_0x22217a,_0x2e42d5){return _0x22217a/_0x2e42d5;},'lnlPH':function(_0x2b5ffe,_0x56dcb6){return _0x2b5ffe<<_0x56dcb6;}};let _0x363c12=_0x3047ce||0x1;while(_0x29ba9d[_0x5fae37(0x20f)](Math['pow'](0x2,0x7*_0x363c12),0x2)<_0x2bd322)_0x363c12++;const _0xb7a2ee=Buffer['alloc'](_0x363c12);for(let _0x60afc0=_0x29ba9d['zOINb'](_0x363c12,0x1);_0x29ba9d[_0x5fae37(0x21f)](_0x60afc0,0x0);_0x60afc0--){_0xb7a2ee[_0x60afc0]=_0x2bd322&0xff,_0x2bd322=Math[_0x5fae37(0x209)](_0x29ba9d['EnuLl'](_0x2bd322,0x100));}return _0xb7a2ee[0x0]|=_0x29ba9d[_0x5fae37(0x1eb)](0x1,0x8-_0x363c12),_0xb7a2ee;}function writeFloat64(_0x5479e0){const _0x9f4ba1=_0x2fd3,_0x1b7500=Buffer['alloc'](0x8);return _0x1b7500[_0x9f4ba1(0x1ee)](_0x5479e0,0x0),_0x1b7500;}function writeVoid(_0x4ae253){const _0x57b826=_0x2fd3,_0x1a076e={'rtBNF':function(_0x166f22,_0x3fde68){return _0x166f22>=_0x3fde68;},'bPAsm':function(_0x3e71f3,_0x559a70){return _0x3e71f3<=_0x559a70;},'kMuZm':function(_0x2003da,_0x3ed1a0){return _0x2003da-_0x3ed1a0;},'xXHqw':function(_0x4d9a66,_0x1f58c4,_0x11961a){return _0x4d9a66(_0x1f58c4,_0x11961a);}};for(let _0x19b8a5=0x1;_0x19b8a5<=0x8;_0x19b8a5++){const _0x4b112a=_0x4ae253-0x1-_0x19b8a5;if(_0x1a076e['rtBNF'](_0x4b112a,0x0)&&_0x1a076e['bPAsm'](_0x4b112a,_0x1a076e['kMuZm'](Math['pow'](0x2,0x7*_0x19b8a5),0x2)))return Buffer['concat']([Buffer['from']([ID_VOID]),_0x1a076e['xXHqw'](writeVint,_0x4b112a,_0x19b8a5),Buffer['alloc'](_0x4b112a)]);}return Buffer[_0x57b826(0x213)](0x0);}function findElement(_0x30fb09,_0x57f406,_0xf92113,_0x34f845){const _0x4658bb=_0x2fd3,_0x2824f8={'NiFgY':function(_0x38d7b9,_0x347793){return _0x38d7b9<_0x347793;},'QKnmp':function(_0x1a8405,_0x389430){return _0x1a8405===_0x389430;},'LmbXZ':function(_0x47e263,_0x14a297){return _0x47e263+_0x14a297;},'QEQZO':function(_0x2fc094,_0x507503,_0x45328c){return _0x2fc094(_0x507503,_0x45328c);}};let _0x5aaa68=_0x57f406;while(_0x2824f8[_0x4658bb(0x21e)](_0x5aaa68,_0xf92113)){const [_0x1fe4d8,_0x3963f4]=readId(_0x30fb09,_0x5aaa68),[_0x5cb02b,_0x63711a]=readVint(_0x30fb09,_0x5aaa68+_0x3963f4);if(_0x2824f8[_0x4658bb(0x1f0)](_0x1fe4d8,_0x34f845))return{'offset':_0x5aaa68,'idLen':_0x3963f4,'sizeLen':_0x63711a,'dataSize':_0x5cb02b,'dataOffset':_0x2824f8[_0x4658bb(0x1e2)](_0x2824f8[_0x4658bb(0x1e2)](_0x5aaa68,_0x3963f4),_0x63711a)};if(_0x2824f8['QEQZO'](isUnknownSize,_0x5cb02b,_0x63711a))break;_0x5aaa68+=_0x2824f8['LmbXZ'](_0x3963f4+_0x63711a,_0x5cb02b);}return null;}function computeDurationMs(_0x392a06,_0x58a4f6){const _0x586353=_0x2fd3,_0x1a201e={'wKjQN':function(_0x500c6e,_0x4c2cb8){return _0x500c6e<_0x4c2cb8;},'sVIrq':function(_0x3e3f4b,_0x58e1fd,_0x546e12){return _0x3e3f4b(_0x58e1fd,_0x546e12);},'LJNjk':function(_0x5b34de,_0x36dd26){return _0x5b34de+_0x36dd26;},'UYgPh':function(_0x5b0793,_0x1eb065){return _0x5b0793-_0x1eb065;},'zVXLF':function(_0x416435,_0x1f8f97,_0x5ecf54){return _0x416435(_0x1f8f97,_0x5ecf54);},'ZmwcB':function(_0x2145a5,_0x118379,_0x5795ff){return _0x2145a5(_0x118379,_0x5795ff);},'EeJdw':function(_0x19d193,_0x3db274){return _0x19d193+_0x3db274;},'aKtcc':function(_0x16b556,_0x4d644d){return _0x16b556===_0x4d644d;},'JHuld':function(_0x541307,_0xc04b72){return _0x541307/_0xc04b72;},'LByXv':function(_0x208943,_0x247cd3){return _0x208943*_0x247cd3;},'bvuAP':function(_0x321d64,_0x13d567){return _0x321d64>_0x13d567;},'UhoaI':function(_0x26c472,_0x3aabc2){return _0x26c472===_0x3aabc2;},'OlgNc':function(_0x2bdcae,_0x4c1545,_0x4bbe66){return _0x2bdcae(_0x4c1545,_0x4bbe66);}};let _0x41bc18=0x0;const _0x51f978=Buffer['from']([0x1f,0x43,0xb6,0x75]);let _0x3a2aaf=_0x392a06[_0x586353(0x1f5)](_0x51f978);if(_0x3a2aaf===-0x1)return 0x0;while(_0x1a201e['wKjQN'](_0x3a2aaf,_0x392a06[_0x586353(0x21b)])){const [_0x518c42,_0x3e1842]=readId(_0x392a06,_0x3a2aaf);if(_0x518c42!==ID_CLUSTER)break;const [_0x590762,_0x52cbba]=_0x1a201e['sVIrq'](readVint,_0x392a06,_0x1a201e[_0x586353(0x1ed)](_0x3a2aaf,_0x3e1842)),_0x5b3c52=_0x1a201e['LJNjk'](_0x3a2aaf,_0x3e1842)+_0x52cbba,_0x455fb8=_0x1a201e['sVIrq'](isUnknownSize,_0x590762,_0x52cbba);let _0x17deac;if(_0x455fb8){let _0x3af47a=_0x5b3c52;while(_0x3af47a<_0x1a201e[_0x586353(0x20d)](_0x392a06[_0x586353(0x21b)],0x4)){const [_0x36dc03,_0x5de31a]=readId(_0x392a06,_0x3af47a);if(_0x36dc03===ID_CLUSTER){_0x17deac=_0x3af47a;break;}const [_0x7a9656,_0x4ad194]=readVint(_0x392a06,_0x1a201e['LJNjk'](_0x3af47a,_0x5de31a));if(_0x1a201e['zVXLF'](isUnknownSize,_0x7a9656,_0x4ad194)){_0x17deac=_0x392a06['length'];break;}_0x3af47a+=_0x5de31a+_0x4ad194+_0x7a9656;}_0x17deac??=_0x392a06[_0x586353(0x21b)];}else _0x17deac=_0x5b3c52+_0x590762;let _0x4bd13d=0x0,_0x1a53cb=_0x5b3c52;while(_0x1a53cb<_0x17deac){const [_0x3136eb,_0x2fed73]=_0x1a201e['ZmwcB'](readId,_0x392a06,_0x1a53cb),[_0x344e6b,_0x47f5a8]=readVint(_0x392a06,_0x1a53cb+_0x2fed73);if(_0x3136eb===ID_TIMESTAMP)_0x4bd13d=readUint(_0x392a06,_0x1a201e['EeJdw'](_0x1a53cb,_0x2fed73)+_0x47f5a8,_0x344e6b);else{if(_0x1a201e[_0x586353(0x214)](_0x3136eb,ID_SIMPLE_BLOCK)&&_0x344e6b>=0x4){const _0x1b3b28=_0x1a201e[_0x586353(0x1ed)](_0x1a53cb,_0x2fed73)+_0x47f5a8,[,_0x573d17]=readVint(_0x392a06,_0x1b3b28),_0x499ffe=_0x392a06['readInt16BE'](_0x1b3b28+_0x573d17),_0x1ec287=_0x1a201e['JHuld'](_0x1a201e['LByXv'](_0x4bd13d+_0x499ffe,_0x58a4f6),0xf4240);_0x1a201e[_0x586353(0x207)](_0x1ec287,_0x41bc18)&&(_0x41bc18=_0x1ec287);}else{if(_0x1a201e[_0x586353(0x1fa)](_0x3136eb,ID_CLUSTER))break;}}if(_0x1a201e[_0x586353(0x20c)](isUnknownSize,_0x344e6b,_0x47f5a8))break;_0x1a53cb+=_0x1a201e[_0x586353(0x1ed)](_0x2fed73+_0x47f5a8,_0x344e6b);}_0x3a2aaf=_0x17deac;}return _0x41bc18;}export function fixWebmDuration(_0x1326bd,_0x4b2aa3){const _0x208d85=_0x2fd3,_0x5a144e={'yYiKF':function(_0x3f3a93,_0x3b1f39){return _0x3f3a93(_0x3b1f39);},'khtJY':function(_0x2cc5ed,_0x2a85a9){return _0x2cc5ed+_0x2a85a9;},'IBFDy':function(_0x1a0b5e,_0x17429b){return _0x1a0b5e+_0x17429b;},'Jnsbc':function(_0x4b828c,_0x5c904c){return _0x4b828c!==_0x5c904c;},'Uttzs':_0x208d85(0x1f9),'ojhyZ':function(_0x36a43d,_0x1923f4){return _0x36a43d+_0x1923f4;},'yUxQR':function(_0x396195,_0x267640){return _0x396195<_0x267640;},'XqNYY':function(_0x5ad274,_0x1ea4d5,_0x214db3){return _0x5ad274(_0x1ea4d5,_0x214db3);},'lYKbh':function(_0x51ef59,_0x36fb2f){return _0x51ef59===_0x36fb2f;},'Emtsw':function(_0x39d5be,_0x56f6ec){return _0x39d5be+_0x56f6ec;},'IpSjZ':function(_0x26541c,_0x3471e1,_0x12bbb9){return _0x26541c(_0x3471e1,_0x12bbb9);},'jKwaF':function(_0x457a34,_0x4bbd8d){return _0x457a34+_0x4bbd8d;},'OXKgW':_0x208d85(0x212),'wyxdN':function(_0x596df1,_0xf17ece,_0x5833db,_0x47de7f,_0x435753){return _0x596df1(_0xf17ece,_0x5833db,_0x47de7f,_0x435753);},'GtYYn':function(_0x43b819,_0x2a26e8){return _0x43b819+_0x2a26e8;},'QFlqr':function(_0x5e0bdf,_0x539132){return _0x5e0bdf<=_0x539132;},'WNeUG':function(_0x349ef5,_0x89fe06){return _0x349ef5+_0x89fe06;},'IqPzl':function(_0x588fbd,_0x5a1107){return _0x588fbd-_0x5a1107;},'ePcxT':function(_0x3d7665,_0x4aa186){return _0x3d7665<_0x4aa186;},'iWxpy':function(_0x2b0138,_0x31a259,_0x30f58a,_0x28368a,_0x49d65c,_0x5ef443,_0x534f2d){return _0x2b0138(_0x31a259,_0x30f58a,_0x28368a,_0x49d65c,_0x5ef443,_0x534f2d);},'BslAo':function(_0x33ec37,_0x477fe9){return _0x33ec37(_0x477fe9);},'VGUfM':function(_0xf4ac5a,_0xc6badd,_0x20f6f5,_0x239b14,_0x4a4295,_0x4507f8,_0x489b7d){return _0xf4ac5a(_0xc6badd,_0x20f6f5,_0x239b14,_0x4a4295,_0x4507f8,_0x489b7d);}},_0x27aa3e=_0x5a144e[_0x208d85(0x1e8)](readFileSync,_0x1326bd);let _0x2405c1=0x0;const [_0xff3da0,_0xc7d045]=readId(_0x27aa3e,_0x2405c1),[_0x507637,_0xe9a956]=readVint(_0x27aa3e,_0x2405c1+_0xc7d045);_0x2405c1+=_0x5a144e[_0x208d85(0x20a)](_0x5a144e[_0x208d85(0x217)](_0xc7d045,_0xe9a956),_0x507637);const [_0xcc467,_0x53bb07]=readId(_0x27aa3e,_0x2405c1);if(_0x5a144e[_0x208d85(0x20e)](_0xcc467,ID_SEGMENT))return console['error'](_0x5a144e[_0x208d85(0x1fb)]),![];const [,_0x4400ff]=readVint(_0x27aa3e,_0x5a144e['ojhyZ'](_0x2405c1,_0x53bb07)),_0x3fae46=_0x5a144e['khtJY'](_0x2405c1,_0x53bb07)+_0x4400ff;let _0x55e669=_0x3fae46;const _0x475135=Math[_0x208d85(0x215)](_0x27aa3e['length'],_0x3fae46+0x2710);let _0x44e665=null,_0x5de952=null;while(_0x5a144e[_0x208d85(0x1f4)](_0x55e669,_0x475135)){const [_0x487bb8,_0x3d569e]=_0x5a144e[_0x208d85(0x1f6)](readId,_0x27aa3e,_0x55e669),[_0xa05145,_0x49666d]=_0x5a144e[_0x208d85(0x1f6)](readVint,_0x27aa3e,_0x55e669+_0x3d569e);_0x5a144e[_0x208d85(0x1ff)](_0x487bb8,ID_VOID)&&!_0x44e665&&(_0x44e665={'offset':_0x55e669,'idLen':_0x3d569e,'sizeLen':_0x49666d,'dataSize':_0xa05145,'dataOffset':_0x55e669+_0x3d569e+_0x49666d});if(_0x487bb8===ID_INFO){_0x5de952={'offset':_0x55e669,'idLen':_0x3d569e,'sizeLen':_0x49666d,'dataSize':_0xa05145,'dataOffset':_0x5a144e['Emtsw'](_0x55e669+_0x3d569e,_0x49666d)};break;}if(_0x487bb8===ID_CLUSTER)break;if(_0x5a144e[_0x208d85(0x1e3)](isUnknownSize,_0xa05145,_0x49666d))break;_0x55e669+=_0x5a144e[_0x208d85(0x205)](_0x5a144e[_0x208d85(0x202)](_0x3d569e,_0x49666d),_0xa05145);}if(!_0x5de952)return console[_0x208d85(0x21c)](_0x5a144e[_0x208d85(0x1e4)]),![];const _0x541bce=findElement(_0x27aa3e,_0x5de952[_0x208d85(0x21d)],_0x5de952['dataOffset']+_0x5de952[_0x208d85(0x1f1)],ID_DURATION);if(_0x541bce)return![];const _0xc85e50=_0x5a144e['wyxdN'](findElement,_0x27aa3e,_0x5de952['dataOffset'],_0x5a144e['GtYYn'](_0x5de952['dataOffset'],_0x5de952['dataSize']),ID_TIMESTAMP_SCALE);let _0x4bd916=0xf4240;_0xc85e50&&(_0x4bd916=readUint(_0x27aa3e,_0xc85e50['dataOffset'],_0xc85e50[_0x208d85(0x1f1)]));const _0x5588f1=computeDurationMs(_0x27aa3e,_0x4bd916);if(_0x5a144e[_0x208d85(0x219)](_0x5588f1,0x0))return console['error']('Could\x20not\x20compute\x20duration'),![];const _0x5818b1=_0x5588f1*0xf4240/_0x4bd916,_0x447950=Buffer['concat']([writeId(ID_DURATION),_0x5a144e[_0x208d85(0x1e8)](writeVint,0x8),_0x5a144e[_0x208d85(0x1e8)](writeFloat64,_0x5818b1)]),_0x384fed=_0x447950['length'];if(!_0x44e665||_0x5a144e['yUxQR'](_0x44e665['offset'],_0x5de952[_0x208d85(0x201)])){if(_0x44e665){const _0x208c2e=_0x5a144e[_0x208d85(0x1ea)](_0x44e665['idLen'],_0x44e665['sizeLen'])+_0x44e665['dataSize'],_0x3f0094=_0x5a144e[_0x208d85(0x1e9)](_0x208c2e,_0x384fed);if(_0x5a144e['ePcxT'](_0x3f0094,0x2))return _0x5a144e[_0x208d85(0x1e1)](rewriteFile,_0x27aa3e,_0x5de952,_0x447950,_0x4bd916,_0x5588f1,_0x4b2aa3);const _0x308fc4=_0x5de952['dataSize']+_0x384fed,_0xf9cca4=Buffer[_0x208d85(0x1f8)]([_0x5a144e['BslAo'](writeId,ID_INFO),_0x5a144e[_0x208d85(0x1e3)](writeVint,_0x308fc4,_0x5de952[_0x208d85(0x1dd)])]),_0x56fd39=_0x27aa3e['slice'](_0x5de952['dataOffset'],_0x5a144e[_0x208d85(0x1ea)](_0x5de952[_0x208d85(0x21d)],_0x5de952['dataSize'])),_0xa8cb5f=writeVoid(_0x3f0094),_0x1e2a90=_0x27aa3e[_0x208d85(0x200)](0x0,_0x44e665['offset']),_0x28ae09=_0x27aa3e['slice'](_0x5a144e[_0x208d85(0x20a)](_0x5de952[_0x208d85(0x21d)],_0x5de952['dataSize']));return writeFileSync(_0x4b2aa3,Buffer[_0x208d85(0x1f8)]([_0x1e2a90,_0xa8cb5f,_0xf9cca4,_0x56fd39,_0x447950,_0x28ae09])),!![];}}return _0x5a144e['VGUfM'](rewriteFile,_0x27aa3e,_0x5de952,_0x447950,_0x4bd916,_0x5588f1,_0x4b2aa3);}function rewriteFile(_0x4af742,_0x50ffbc,_0x266630,_0x29fb1a,_0x1c2aa2,_0x31aa6a){const _0x37d944=_0x2fd3,_0x3566d9={'dzbdO':function(_0x335c2c,_0x49b0c5){return _0x335c2c(_0x49b0c5);},'eKBUS':function(_0x14b735,_0xcefd23){return _0x14b735(_0xcefd23);},'LFHCS':function(_0x3fb362,_0xa86e34){return _0x3fb362+_0xa86e34;},'wtcFr':function(_0x1830e7,_0x4ddea7,_0x3f9012){return _0x1830e7(_0x4ddea7,_0x3f9012);}},_0x5a8467=_0x50ffbc['dataSize']+_0x266630[_0x37d944(0x21b)],_0x2fd6c1=Buffer['concat']([_0x3566d9['dzbdO'](writeId,ID_INFO),_0x3566d9['eKBUS'](writeVint,_0x5a8467)]),_0x95183=_0x50ffbc['idLen']+_0x50ffbc[_0x37d944(0x1dd)],_0x4efaad=_0x4af742[_0x37d944(0x200)](0x0,_0x50ffbc['offset']),_0x570b20=_0x4af742[_0x37d944(0x200)](_0x50ffbc['dataOffset'],_0x50ffbc[_0x37d944(0x21d)]+_0x50ffbc['dataSize']),_0x483abb=_0x4af742[_0x37d944(0x200)](_0x3566d9['LFHCS'](_0x50ffbc[_0x37d944(0x201)],_0x95183)+_0x50ffbc['dataSize']);return _0x3566d9['wtcFr'](writeFileSync,_0x31aa6a,Buffer['concat']([_0x4efaad,_0x2fd6c1,_0x570b20,_0x266630,_0x483abb])),!![];}if(process['argv'][0x1]?.[_0x57f671(0x206)]('fixWebmDuration.ts')||process[_0x57f671(0x208)][0x1]?.[_0x57f671(0x206)]('fixWebmDuration.js')){const input=process['argv'][0x2],output=process['argv'][0x3];(!input||!output)&&(console[_0x57f671(0x21c)]('Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>'),process['exit'](0x1));const fixed=fixWebmDuration(input,output);fixed?console[_0x57f671(0x20b)](_0x57f671(0x1fe)+output):console[_0x57f671(0x20b)](_0x57f671(0x218));}
|
|
1
|
+
const _0x1cdc42=_0x4b33;(function(_0x19bcec,_0x5b1dff){const _0x3d7a90=_0x4b33,_0x4a85cb=_0x19bcec();while(!![]){try{const _0x5792a9=parseInt(_0x3d7a90(0xe5))/0x1*(parseInt(_0x3d7a90(0xe6))/0x2)+parseInt(_0x3d7a90(0x112))/0x3*(-parseInt(_0x3d7a90(0x118))/0x4)+parseInt(_0x3d7a90(0xf1))/0x5+parseInt(_0x3d7a90(0x105))/0x6*(parseInt(_0x3d7a90(0x107))/0x7)+-parseInt(_0x3d7a90(0x102))/0x8+parseInt(_0x3d7a90(0xe9))/0x9+parseInt(_0x3d7a90(0x109))/0xa*(-parseInt(_0x3d7a90(0x114))/0xb);if(_0x5792a9===_0x5b1dff)break;else _0x4a85cb['push'](_0x4a85cb['shift']());}catch(_0x2365bc){_0x4a85cb['push'](_0x4a85cb['shift']());}}}(_0x4179,0x4cc0c));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(_0x18a3d7,_0x1bcfb2){const _0x2ba225=_0x4b33,_0x1086af={'Szqib':function(_0xf26ba1,_0x367468){return _0xf26ba1<=_0x367468;},'tSssB':function(_0x225149,_0x28450b){return _0x225149+_0x28450b;},'RqezJ':function(_0x5314f3,_0x33651e){return _0x5314f3-_0x33651e;},'uFBbO':function(_0x40307e,_0x447223){return _0x40307e+_0x447223;},'xIvsF':function(_0x554d3b,_0x1340e7){return _0x554d3b*_0x1340e7;},'sTjsn':function(_0x5b70c0,_0x5aa9a4){return _0x5b70c0+_0x5aa9a4;}};if(_0x1bcfb2>=_0x18a3d7['length'])return[0x0,0x0];const _0x576139=_0x18a3d7[_0x1bcfb2];let _0x5b7827=0x1,_0xacb061=0x80;while(_0x1086af['Szqib'](_0x5b7827,0x8)&&!(_0x576139&_0xacb061)){_0x5b7827++,_0xacb061>>=0x1;}if(_0x1086af['tSssB'](_0x1bcfb2,_0x5b7827)>_0x18a3d7[_0x2ba225(0xf6)])return[0x0,0x0];let _0x26c273=_0x576139&_0x1086af['RqezJ'](_0xacb061,0x1);for(let _0x5a7a38=0x1;_0x5a7a38<_0x5b7827;_0x5a7a38++){_0x26c273=_0x1086af[_0x2ba225(0x117)](_0x1086af[_0x2ba225(0xe7)](_0x26c273,0x100),_0x18a3d7[_0x1086af[_0x2ba225(0x10e)](_0x1bcfb2,_0x5a7a38)]);}return[_0x26c273,_0x5b7827];}function readId(_0xa144eb,_0x43ecec){const _0x6d213b=_0x4b33,_0x5cd782={'UUdLa':function(_0x3d9a60,_0x2a8ab1){return _0x3d9a60>=_0x2a8ab1;},'JWonN':function(_0x25f0af,_0x409df7){return _0x25f0af>=_0x409df7;},'OIkDi':function(_0x4dd80c,_0x1d1d3a){return _0x4dd80c<_0x1d1d3a;},'xIGIY':function(_0x3cfbd6,_0x276219){return _0x3cfbd6+_0x276219;}};if(_0x5cd782[_0x6d213b(0xf7)](_0x43ecec,_0xa144eb['length']))return[0x0,0x0];const _0x35b4ad=_0xa144eb[_0x43ecec];let _0x5b4a6e;if(_0x35b4ad>=0x80)_0x5b4a6e=0x1;else{if(_0x5cd782[_0x6d213b(0x11a)](_0x35b4ad,0x40))_0x5b4a6e=0x2;else{if(_0x5cd782['JWonN'](_0x35b4ad,0x20))_0x5b4a6e=0x3;else{if(_0x5cd782['UUdLa'](_0x35b4ad,0x10))_0x5b4a6e=0x4;else return[_0x35b4ad,0x1];}}}if(_0x43ecec+_0x5b4a6e>_0xa144eb['length'])return[0x0,0x0];let _0x1e5d2c=0x0;for(let _0x25910c=0x0;_0x5cd782['OIkDi'](_0x25910c,_0x5b4a6e);_0x25910c++){_0x1e5d2c=_0x1e5d2c*0x100+_0xa144eb[_0x5cd782['xIGIY'](_0x43ecec,_0x25910c)];}return[_0x1e5d2c,_0x5b4a6e];}function readUint(_0xb6cb56,_0x507786,_0x33ff8a){const _0xf98a24=_0x4b33,_0x255e82={'lGqQq':function(_0xe3998f,_0x257a66){return _0xe3998f<_0x257a66;}};let _0x54352e=0x0;for(let _0x39404d=0x0;_0x255e82[_0xf98a24(0xea)](_0x39404d,_0x33ff8a);_0x39404d++){_0x54352e=_0x54352e*0x100+_0xb6cb56[_0x507786+_0x39404d];}return _0x54352e;}function isUnknownSize(_0x5e0586,_0x16964e){const _0x303813=_0x4b33;return _0x5e0586===Math[_0x303813(0xfe)](0x2,0x7*_0x16964e)-0x1;}function writeId(_0x245d04){const _0x1f30ac=_0x4b33,_0x5c7745={'COdGZ':function(_0x322955,_0x1f17b5){return _0x322955>>_0x1f17b5;},'CgXEc':function(_0x443566,_0x3d8c5f){return _0x443566<=_0x3d8c5f;},'ztcxG':function(_0x38b462,_0x5aeb27){return _0x38b462>>_0x5aeb27;},'GZMHG':function(_0x3586be,_0xaa938){return _0x3586be&_0xaa938;},'oZcqA':function(_0x576a94,_0x141383){return _0x576a94>>_0x141383;},'XcGKV':function(_0x62b808,_0x3e4156){return _0x62b808>>_0x3e4156;}};if(_0x245d04<=0xff)return Buffer['from']([_0x245d04]);if(_0x245d04<=0xffff)return Buffer[_0x1f30ac(0x10a)]([_0x5c7745['COdGZ'](_0x245d04,0x8)&0xff,_0x245d04&0xff]);if(_0x5c7745['CgXEc'](_0x245d04,0xffffff))return Buffer['from']([_0x5c7745[_0x1f30ac(0xf4)](_0x245d04,0x10)&0xff,_0x5c7745[_0x1f30ac(0xf4)](_0x245d04,0x8)&0xff,_0x245d04&0xff]);return Buffer['from']([_0x5c7745['ztcxG'](_0x245d04,0x18)&0xff,_0x5c7745['GZMHG'](_0x5c7745[_0x1f30ac(0xe3)](_0x245d04,0x10),0xff),_0x5c7745[_0x1f30ac(0xe8)](_0x5c7745[_0x1f30ac(0x11b)](_0x245d04,0x8),0xff),_0x245d04&0xff]);}function writeVint(_0x20845f,_0x547cf0){const _0x51622e=_0x4b33,_0xcc33f8={'JnKWY':function(_0x546685,_0x49592d){return _0x546685||_0x49592d;},'uJXgN':function(_0x3e4bf4,_0x38676f){return _0x3e4bf4-_0x38676f;},'szoud':function(_0x146741,_0x53c743){return _0x146741>=_0x53c743;},'MaAsQ':function(_0x2a8770,_0x35625f){return _0x2a8770&_0x35625f;},'eDNDL':function(_0x402368,_0x3d99e1){return _0x402368/_0x3d99e1;}};let _0x1ff301=_0xcc33f8['JnKWY'](_0x547cf0,0x1);while(Math[_0x51622e(0xfe)](0x2,0x7*_0x1ff301)-0x2<_0x20845f)_0x1ff301++;const _0x3a92ea=Buffer['alloc'](_0x1ff301);for(let _0x24b74e=_0xcc33f8[_0x51622e(0x110)](_0x1ff301,0x1);_0xcc33f8[_0x51622e(0x11d)](_0x24b74e,0x0);_0x24b74e--){_0x3a92ea[_0x24b74e]=_0xcc33f8['MaAsQ'](_0x20845f,0xff),_0x20845f=Math[_0x51622e(0x116)](_0xcc33f8[_0x51622e(0x113)](_0x20845f,0x100));}return _0x3a92ea[0x0]|=0x1<<_0xcc33f8['uJXgN'](0x8,_0x1ff301),_0x3a92ea;}function writeFloat64(_0xfdc3a9){const _0x3c615b=Buffer['alloc'](0x8);return _0x3c615b['writeDoubleBE'](_0xfdc3a9,0x0),_0x3c615b;}function writeVoid(_0x3f0c9b){const _0x1551fc=_0x4b33,_0x4517e1={'aYhUY':function(_0x437c61,_0xcbfdf3){return _0x437c61<=_0xcbfdf3;},'FhzRu':function(_0x5c3bf4,_0x9ca000){return _0x5c3bf4<=_0x9ca000;},'Fhmie':function(_0x5d4e28,_0x8fd7fd,_0x3f3319){return _0x5d4e28(_0x8fd7fd,_0x3f3319);}};for(let _0x8e1f9=0x1;_0x4517e1['aYhUY'](_0x8e1f9,0x8);_0x8e1f9++){const _0x2921cb=_0x3f0c9b-0x1-_0x8e1f9;if(_0x2921cb>=0x0&&_0x4517e1['FhzRu'](_0x2921cb,Math[_0x1551fc(0xfe)](0x2,0x7*_0x8e1f9)-0x2))return Buffer[_0x1551fc(0x10c)]([Buffer['from']([ID_VOID]),_0x4517e1['Fhmie'](writeVint,_0x2921cb,_0x8e1f9),Buffer[_0x1551fc(0xfd)](_0x2921cb)]);}return Buffer[_0x1551fc(0xfd)](0x0);}function findElement(_0x49efc1,_0x1cffac,_0x1d1729,_0x3dca28){const _0x203bf3={'UZSdK':function(_0x2728df,_0x38afb1,_0x5f00ed){return _0x2728df(_0x38afb1,_0x5f00ed);},'vaCvN':function(_0x74f48e,_0x51a89a,_0x5e3fdd){return _0x74f48e(_0x51a89a,_0x5e3fdd);},'lTBOV':function(_0x21a5ed,_0x1401e9){return _0x21a5ed+_0x1401e9;},'pHETx':function(_0x4c94d3,_0x409bf5){return _0x4c94d3+_0x409bf5;}};let _0x211553=_0x1cffac;while(_0x211553<_0x1d1729){const [_0x2c604b,_0x2c056d]=_0x203bf3['UZSdK'](readId,_0x49efc1,_0x211553),[_0x5880ce,_0x198b0a]=_0x203bf3['vaCvN'](readVint,_0x49efc1,_0x203bf3['lTBOV'](_0x211553,_0x2c056d));if(_0x2c604b===_0x3dca28)return{'offset':_0x211553,'idLen':_0x2c056d,'sizeLen':_0x198b0a,'dataSize':_0x5880ce,'dataOffset':_0x203bf3['pHETx'](_0x211553+_0x2c056d,_0x198b0a)};if(isUnknownSize(_0x5880ce,_0x198b0a))break;_0x211553+=_0x203bf3['lTBOV'](_0x2c056d+_0x198b0a,_0x5880ce);}return null;}function _0x4179(){const _0x59b5d6=['3398994tIlEhV','lGqQq','AHwVk','KAQpO','Could\x20not\x20compute\x20duration','fbLJl','rHuQd','LNjBl','1588305hFYFRz','indexOf','fKwUB','COdGZ','hstpv','length','UUdLa','idLen','log','argv','error','endsWith','alloc','pow','maRkF','tcYNl','slice','1783464YLNeiG','qauau','offset','941658RdmUib','ETSBm','14tSRlms','qTmxJ','10vVmLiZ','from','mNIqp','concat','Fixed:\x20','sTjsn','eLUGo','uJXgN','dataOffset','3HdKELE','eDNDL','3971495AadHHB','dataSize','floor','uFBbO','1136092ctJHhD','TurNv','JWonN','XcGKV','csPJA','szoud','IdFyY','XOGkS','aAmND','AqPrj','JaHCH','readInt16BE','Could\x20not\x20find\x20Info\x20element','FHwja','oZcqA','fixWebmDuration.js','137SphWUk','2528iiGFMP','xIvsF','GZMHG'];_0x4179=function(){return _0x59b5d6;};return _0x4179();}function computeDurationMs(_0x1bddd1,_0x22a106){const _0x47f705=_0x4b33,_0x13ffd0={'fbLJl':function(_0x2841cc,_0x51d70f){return _0x2841cc===_0x51d70f;},'tcYNl':function(_0x5f3b45,_0xedecb6){return _0x5f3b45<_0xedecb6;},'PWbSA':function(_0x3bb4ba,_0x2931d2){return _0x3bb4ba!==_0x2931d2;},'XOGkS':function(_0x5e40a9,_0x1e6f38){return _0x5e40a9+_0x1e6f38;},'csPJA':function(_0x4a86da,_0x7bbc80){return _0x4a86da+_0x7bbc80;},'FvUGT':function(_0x4ba77a,_0x555181){return _0x4ba77a-_0x555181;},'KAQpO':function(_0x346d2b,_0x15f0fe,_0xc8818){return _0x346d2b(_0x15f0fe,_0xc8818);},'rHuQd':function(_0x4c2df5,_0x2cec44){return _0x4c2df5===_0x2cec44;},'TurNv':function(_0x954dac,_0x302aef,_0x44c1da,_0x2ff58f){return _0x954dac(_0x302aef,_0x44c1da,_0x2ff58f);},'UpbPf':function(_0x1552c2,_0x7664fc){return _0x1552c2>=_0x7664fc;},'sUxBe':function(_0x5b7052,_0x43d63c){return _0x5b7052/_0x43d63c;},'oZnmh':function(_0x313cbd,_0x2b580b){return _0x313cbd>_0x2b580b;},'tAZwb':function(_0x1db8da,_0x3fe0f2){return _0x1db8da+_0x3fe0f2;}};let _0x213c2c=0x0;const _0x29180e=Buffer[_0x47f705(0x10a)]([0x1f,0x43,0xb6,0x75]);let _0x3d14c3=_0x1bddd1[_0x47f705(0xf2)](_0x29180e);if(_0x13ffd0[_0x47f705(0xee)](_0x3d14c3,-0x1))return 0x0;while(_0x13ffd0['tcYNl'](_0x3d14c3,_0x1bddd1[_0x47f705(0xf6)])){const [_0x5d3cdd,_0x36aab8]=readId(_0x1bddd1,_0x3d14c3);if(_0x13ffd0['PWbSA'](_0x5d3cdd,ID_CLUSTER))break;const [_0x25f930,_0x43d98e]=readVint(_0x1bddd1,_0x3d14c3+_0x36aab8),_0x5b3b36=_0x13ffd0['XOGkS'](_0x13ffd0['csPJA'](_0x3d14c3,_0x36aab8),_0x43d98e),_0xb07150=isUnknownSize(_0x25f930,_0x43d98e);let _0x1e54ec;if(_0xb07150){let _0x1b337c=_0x5b3b36;while(_0x13ffd0[_0x47f705(0x100)](_0x1b337c,_0x13ffd0['FvUGT'](_0x1bddd1['length'],0x4))){const [_0x1b6c42,_0x20bd96]=readId(_0x1bddd1,_0x1b337c);if(_0x1b6c42===ID_CLUSTER){_0x1e54ec=_0x1b337c;break;}const [_0xf79efd,_0x2cfab9]=_0x13ffd0[_0x47f705(0xec)](readVint,_0x1bddd1,_0x1b337c+_0x20bd96);if(isUnknownSize(_0xf79efd,_0x2cfab9)){_0x1e54ec=_0x1bddd1['length'];break;}_0x1b337c+=_0x20bd96+_0x2cfab9+_0xf79efd;}_0x1e54ec??=_0x1bddd1['length'];}else _0x1e54ec=_0x5b3b36+_0x25f930;let _0x126f25=0x0,_0x4cb08a=_0x5b3b36;while(_0x4cb08a<_0x1e54ec){const [_0x16fa03,_0x4a6209]=_0x13ffd0['KAQpO'](readId,_0x1bddd1,_0x4cb08a),[_0xefbed1,_0x3fa6e1]=readVint(_0x1bddd1,_0x4cb08a+_0x4a6209);if(_0x13ffd0[_0x47f705(0xef)](_0x16fa03,ID_TIMESTAMP))_0x126f25=_0x13ffd0[_0x47f705(0x119)](readUint,_0x1bddd1,_0x13ffd0[_0x47f705(0x11f)](_0x4cb08a,_0x4a6209)+_0x3fa6e1,_0xefbed1);else{if(_0x16fa03===ID_SIMPLE_BLOCK&&_0x13ffd0['UpbPf'](_0xefbed1,0x4)){const _0x384fb5=_0x13ffd0[_0x47f705(0x11c)](_0x4cb08a,_0x4a6209)+_0x3fa6e1,[,_0x2ac2ef]=_0x13ffd0['KAQpO'](readVint,_0x1bddd1,_0x384fb5),_0x517f6a=_0x1bddd1[_0x47f705(0xe0)](_0x384fb5+_0x2ac2ef),_0x538e0e=_0x13ffd0['sUxBe']((_0x126f25+_0x517f6a)*_0x22a106,0xf4240);_0x13ffd0['oZnmh'](_0x538e0e,_0x213c2c)&&(_0x213c2c=_0x538e0e);}else{if(_0x16fa03===ID_CLUSTER)break;}}if(_0x13ffd0['KAQpO'](isUnknownSize,_0xefbed1,_0x3fa6e1))break;_0x4cb08a+=_0x13ffd0[_0x47f705(0x11c)](_0x13ffd0['tAZwb'](_0x4a6209,_0x3fa6e1),_0xefbed1);}_0x3d14c3=_0x1e54ec;}return _0x213c2c;}export function fixWebmDuration(_0x5e9107,_0x2d9430){const _0x52fc6a=_0x4b33,_0x4e308a={'maRkF':function(_0x41f361,_0x106aff){return _0x41f361(_0x106aff);},'LNjBl':function(_0x4c89c5,_0x482df4,_0xc4bc51){return _0x4c89c5(_0x482df4,_0xc4bc51);},'JaHCH':function(_0x2323f8,_0x4b0f03,_0x1c223a){return _0x2323f8(_0x4b0f03,_0x1c223a);},'IdFyY':function(_0x46a3c8,_0x2f2c51){return _0x46a3c8+_0x2f2c51;},'aAmND':function(_0x32824f,_0x102d8a){return _0x32824f!==_0x102d8a;},'AqPrj':'Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','qauau':function(_0x34ec49,_0x5a1584){return _0x34ec49+_0x5a1584;},'mNIqp':function(_0x264d9f,_0x40463a){return _0x264d9f===_0x40463a;},'Hfvwf':_0x52fc6a(0xe1),'ETSBm':function(_0x520a22,_0x11a0ea,_0x1f6aee,_0x5cc66e){return _0x520a22(_0x11a0ea,_0x1f6aee,_0x5cc66e);},'KgWAP':function(_0x3e3e33,_0x11f560){return _0x3e3e33<=_0x11f560;},'bAjMr':_0x52fc6a(0xed),'FHwja':function(_0x3c96a5,_0x40d683){return _0x3c96a5/_0x40d683;},'sNRQn':function(_0x4fc5e3,_0x36a562){return _0x4fc5e3*_0x36a562;},'fKwUB':function(_0x5ba7cc,_0x4d53ca){return _0x5ba7cc(_0x4d53ca);},'hstpv':function(_0x38b38a,_0x1e3a03){return _0x38b38a+_0x1e3a03;},'GpeGE':function(_0x4b5f3c,_0x20e7de){return _0x4b5f3c-_0x20e7de;},'AHwVk':function(_0x24f575,_0x3c3833,_0x4e6440,_0x2dac27,_0x3a46f4,_0x53938d,_0x67d9f4){return _0x24f575(_0x3c3833,_0x4e6440,_0x2dac27,_0x3a46f4,_0x53938d,_0x67d9f4);},'FJUGp':function(_0x4064da,_0x158358,_0x11c0f7){return _0x4064da(_0x158358,_0x11c0f7);}},_0x212d90=_0x4e308a[_0x52fc6a(0xff)](readFileSync,_0x5e9107);let _0x4c3fc4=0x0;const [_0x3d0825,_0x1f7a8c]=_0x4e308a['LNjBl'](readId,_0x212d90,_0x4c3fc4),[_0x2cf56c,_0x587304]=_0x4e308a[_0x52fc6a(0xdf)](readVint,_0x212d90,_0x4c3fc4+_0x1f7a8c);_0x4c3fc4+=_0x4e308a[_0x52fc6a(0x11e)](_0x1f7a8c+_0x587304,_0x2cf56c);const [_0x121a9c,_0x18de4e]=readId(_0x212d90,_0x4c3fc4);if(_0x4e308a[_0x52fc6a(0x120)](_0x121a9c,ID_SEGMENT))return console[_0x52fc6a(0xfb)](_0x4e308a[_0x52fc6a(0xde)]),![];const [,_0x245e2d]=readVint(_0x212d90,_0x4c3fc4+_0x18de4e),_0x969563=_0x4e308a['IdFyY'](_0x4e308a[_0x52fc6a(0x11e)](_0x4c3fc4,_0x18de4e),_0x245e2d);let _0x4878c8=_0x969563;const _0x163579=Math['min'](_0x212d90['length'],_0x969563+0x2710);let _0x2dcee5=null,_0x49d98c=null;while(_0x4878c8<_0x163579){const [_0x3d1001,_0x11e494]=readId(_0x212d90,_0x4878c8),[_0x9f2404,_0xb9ab75]=_0x4e308a[_0x52fc6a(0xdf)](readVint,_0x212d90,_0x4e308a['qauau'](_0x4878c8,_0x11e494));_0x3d1001===ID_VOID&&!_0x2dcee5&&(_0x2dcee5={'offset':_0x4878c8,'idLen':_0x11e494,'sizeLen':_0xb9ab75,'dataSize':_0x9f2404,'dataOffset':_0x4e308a[_0x52fc6a(0x103)](_0x4878c8,_0x11e494)+_0xb9ab75});if(_0x4e308a[_0x52fc6a(0x10b)](_0x3d1001,ID_INFO)){_0x49d98c={'offset':_0x4878c8,'idLen':_0x11e494,'sizeLen':_0xb9ab75,'dataSize':_0x9f2404,'dataOffset':_0x4878c8+_0x11e494+_0xb9ab75};break;}if(_0x3d1001===ID_CLUSTER)break;if(isUnknownSize(_0x9f2404,_0xb9ab75))break;_0x4878c8+=_0x4e308a[_0x52fc6a(0x103)](_0x11e494,_0xb9ab75)+_0x9f2404;}if(!_0x49d98c)return console['error'](_0x4e308a['Hfvwf']),![];const _0x42f791=findElement(_0x212d90,_0x49d98c[_0x52fc6a(0x111)],_0x4e308a['qauau'](_0x49d98c['dataOffset'],_0x49d98c[_0x52fc6a(0x115)]),ID_DURATION);if(_0x42f791)return![];const _0x2c1e67=findElement(_0x212d90,_0x49d98c['dataOffset'],_0x49d98c[_0x52fc6a(0x111)]+_0x49d98c[_0x52fc6a(0x115)],ID_TIMESTAMP_SCALE);let _0x355175=0xf4240;_0x2c1e67&&(_0x355175=_0x4e308a[_0x52fc6a(0x106)](readUint,_0x212d90,_0x2c1e67['dataOffset'],_0x2c1e67['dataSize']));const _0x35e647=_0x4e308a[_0x52fc6a(0xf0)](computeDurationMs,_0x212d90,_0x355175);if(_0x4e308a['KgWAP'](_0x35e647,0x0))return console['error'](_0x4e308a['bAjMr']),![];const _0x39edb7=_0x4e308a[_0x52fc6a(0xe2)](_0x4e308a['sNRQn'](_0x35e647,0xf4240),_0x355175),_0x6b4471=Buffer[_0x52fc6a(0x10c)]([writeId(ID_DURATION),writeVint(0x8),_0x4e308a[_0x52fc6a(0xf3)](writeFloat64,_0x39edb7)]),_0x591c51=_0x6b4471['length'];if(!_0x2dcee5||_0x2dcee5['offset']<_0x49d98c[_0x52fc6a(0x104)]){if(_0x2dcee5){const _0x2b2272=_0x4e308a['IdFyY'](_0x4e308a[_0x52fc6a(0xf5)](_0x2dcee5['idLen'],_0x2dcee5['sizeLen']),_0x2dcee5['dataSize']),_0x38ecde=_0x4e308a['GpeGE'](_0x2b2272,_0x591c51);if(_0x38ecde<0x2)return _0x4e308a['AHwVk'](rewriteFile,_0x212d90,_0x49d98c,_0x6b4471,_0x355175,_0x35e647,_0x2d9430);const _0x380573=_0x49d98c['dataSize']+_0x591c51,_0x1015bc=Buffer[_0x52fc6a(0x10c)]([_0x4e308a[_0x52fc6a(0xf3)](writeId,ID_INFO),_0x4e308a['FJUGp'](writeVint,_0x380573,_0x49d98c['sizeLen'])]),_0x509c38=_0x212d90['slice'](_0x49d98c[_0x52fc6a(0x111)],_0x49d98c[_0x52fc6a(0x111)]+_0x49d98c[_0x52fc6a(0x115)]),_0x27828a=writeVoid(_0x38ecde),_0xb8a23=_0x212d90['slice'](0x0,_0x2dcee5[_0x52fc6a(0x104)]),_0x7349ee=_0x212d90[_0x52fc6a(0x101)](_0x49d98c[_0x52fc6a(0x111)]+_0x49d98c[_0x52fc6a(0x115)]);return _0x4e308a['FJUGp'](writeFileSync,_0x2d9430,Buffer['concat']([_0xb8a23,_0x27828a,_0x1015bc,_0x509c38,_0x6b4471,_0x7349ee])),!![];}}return _0x4e308a[_0x52fc6a(0xeb)](rewriteFile,_0x212d90,_0x49d98c,_0x6b4471,_0x355175,_0x35e647,_0x2d9430);}function rewriteFile(_0x55114c,_0x9014c7,_0x3c8c39,_0x3b5bed,_0x19ea67,_0x2fbc22){const _0x4ac3e3=_0x4b33,_0x57f4a2={'eLUGo':function(_0x1c15c1,_0xadd868){return _0x1c15c1+_0xadd868;},'VQNpe':function(_0x22a1fb,_0x303109){return _0x22a1fb+_0x303109;},'qTmxJ':function(_0x2e2af2,_0x314ed2,_0x341db5){return _0x2e2af2(_0x314ed2,_0x341db5);}},_0x56b11b=_0x9014c7['dataSize']+_0x3c8c39[_0x4ac3e3(0xf6)],_0x560631=Buffer[_0x4ac3e3(0x10c)]([writeId(ID_INFO),writeVint(_0x56b11b)]),_0x511eb0=_0x57f4a2[_0x4ac3e3(0x10f)](_0x9014c7[_0x4ac3e3(0xf8)],_0x9014c7['sizeLen']),_0x275fa5=_0x55114c[_0x4ac3e3(0x101)](0x0,_0x9014c7[_0x4ac3e3(0x104)]),_0x52c1f2=_0x55114c[_0x4ac3e3(0x101)](_0x9014c7[_0x4ac3e3(0x111)],_0x57f4a2['VQNpe'](_0x9014c7[_0x4ac3e3(0x111)],_0x9014c7[_0x4ac3e3(0x115)])),_0x302fac=_0x55114c['slice'](_0x57f4a2['VQNpe'](_0x9014c7['offset']+_0x511eb0,_0x9014c7[_0x4ac3e3(0x115)]));return _0x57f4a2[_0x4ac3e3(0x108)](writeFileSync,_0x2fbc22,Buffer['concat']([_0x275fa5,_0x560631,_0x52c1f2,_0x3c8c39,_0x302fac])),!![];}function _0x4b33(_0x350299,_0x21a174){_0x350299=_0x350299-0xde;const _0x417919=_0x4179();let _0x4b3363=_0x417919[_0x350299];return _0x4b3363;}if(process[_0x1cdc42(0xfa)][0x1]?.[_0x1cdc42(0xfc)]('fixWebmDuration.ts')||process['argv'][0x1]?.['endsWith'](_0x1cdc42(0xe4))){const input=process[_0x1cdc42(0xfa)][0x2],output=process[_0x1cdc42(0xfa)][0x3];(!input||!output)&&(console['error']('Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>'),process['exit'](0x1));const fixed=fixWebmDuration(input,output);fixed?console[_0x1cdc42(0xf9)](_0x1cdc42(0x10d)+output):console[_0x1cdc42(0xf9)]('File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x5cf1(_0x12b874,_0x3bf882){_0x12b874=_0x12b874-0xc6;const _0x285b22=_0x285b();let _0x5cf194=_0x285b22[_0x12b874];return _0x5cf194;}(function(_0x5eed03,_0xba08ee){const _0x11ef8b=_0x5cf1,_0x10e900=_0x5eed03();while(!![]){try{const _0xf9932c=-parseInt(_0x11ef8b(0xc7))/0x1*(parseInt(_0x11ef8b(0xce))/0x2)+-parseInt(_0x11ef8b(0xcb))/0x3+parseInt(_0x11ef8b(0xc9))/0x4*(-parseInt(_0x11ef8b(0xd2))/0x5)+-parseInt(_0x11ef8b(0xd1))/0x6*(-parseInt(_0x11ef8b(0xcc))/0x7)+-parseInt(_0x11ef8b(0xd5))/0x8+parseInt(_0x11ef8b(0xc6))/0x9*(-parseInt(_0x11ef8b(0xd0))/0xa)+parseInt(_0x11ef8b(0xd3))/0xb;if(_0xf9932c===_0xba08ee)break;else _0x10e900['push'](_0x10e900['shift']());}catch(_0x5d7cbe){_0x10e900['push'](_0x10e900['shift']());}}}(_0x285b,0xd70af));import{execFile as _0x10d472}from'child_process';import{promisify}from'util';function _0x285b(){const _0x47d405=['6qkjZJm','3259135cahuyE','56852818GSbpPy','sYSSj','12824176NEQqBZ','9DtYPdO','3542hNYHEx','ls-files','4GMhFPQ','--error-unmatch','3480387oZrsuc','11705162GjoEJT','git','922hESVtj','cwd','9119490sdFjBb'];_0x285b=function(){return _0x47d405;};return _0x285b();}const execFile=promisify(_0x10d472);export async function isPathGitTracked(_0x288869){const _0x5ccb6c=_0x5cf1,_0xf34690={'sYSSj':function(_0xaf963d,_0x929331,_0x4ef5bf,_0x40b03b){return _0xaf963d(_0x929331,_0x4ef5bf,_0x40b03b);}};try{return await _0xf34690[_0x5ccb6c(0xd4)](execFile,_0x5ccb6c(0xcd),[_0x5ccb6c(0xc8),_0x5ccb6c(0xca),_0x288869],{'cwd':process[_0x5ccb6c(0xcf)]()}),!![];}catch{return![];}}
|