@ranger-testing/ranger-cli 3.0.1-alpha.aab0a1c-26 → 3.0.1-alpha.f6aba6c-32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -0
  60. package/build/commands/utils/playwrightCli.js +1 -1
  61. package/build/commands/utils/profileMessages.js +1 -1
  62. package/build/commands/utils/profileSetupBanner.js +1 -1
  63. package/build/commands/utils/projectsConfig.js +1 -1
  64. package/build/commands/utils/rangerConfig.js +1 -1
  65. package/build/commands/utils/rangerRoot.js +1 -1
  66. package/build/commands/utils/rangerwrightCli.js +1 -0
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/sessionCache.js +1 -1
  71. package/build/commands/utils/settings.js +1 -1
  72. package/build/commands/utils/skillContent.js +1 -1
  73. package/build/commands/utils/skills.js +1 -1
  74. package/build/commands/utils/stitchWebmFiles.js +1 -1
  75. package/build/commands/utils/telemetry.js +1 -1
  76. package/build/commands/utils/tokenRefresh.js +1 -1
  77. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  78. package/build/commands/utils/userApi.js +1 -1
  79. package/build/commands/utils/version.js +1 -1
  80. package/build/commands/verifyFeature.js +1 -1
  81. package/build/commands/verifyFeatureCli.js +1 -1
  82. package/build/commands/verifyFeatureNovaCli.js +1 -1
  83. package/build/commands/verifyFeatureRangerwrightCli.js +1 -0
  84. package/package.json +3 -2
@@ -1 +1 @@
1
- const _0x497ea4=_0x2db1;(function(_0x2f9389,_0x24f5ae){const _0x14d2ee=_0x2db1,_0x109009=_0x2f9389();while(!![]){try{const _0x207970=parseInt(_0x14d2ee(0x1d8))/0x1*(parseInt(_0x14d2ee(0x1eb))/0x2)+-parseInt(_0x14d2ee(0x1e4))/0x3+parseInt(_0x14d2ee(0x1f5))/0x4*(-parseInt(_0x14d2ee(0x1a1))/0x5)+-parseInt(_0x14d2ee(0x218))/0x6+parseInt(_0x14d2ee(0x203))/0x7*(parseInt(_0x14d2ee(0x1a6))/0x8)+-parseInt(_0x14d2ee(0x1d0))/0x9*(parseInt(_0x14d2ee(0x1e8))/0xa)+parseInt(_0x14d2ee(0x1a4))/0xb;if(_0x207970===_0x24f5ae)break;else _0x109009['push'](_0x109009['shift']());}catch(_0x17cae6){_0x109009['push'](_0x109009['shift']());}}}(_0x4030,0x875a5));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x4030(){const _0x736175=['CUEzC','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','HmEdd','Cloud\x20profile\x20\x22','name','24164LiOPql','code','clientIp','string','RANGER_TEST_PASSWORD','/api/v1/profiles/','\x22,\x20cached\x20locally','/login','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','SQjuM','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','env','\x22,\x20attempting\x20login...','JFJAD','eLsDC','close','Browser\x20login\x20timed\x20out\x20before\x20completion.','session_state','qRxHS','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','5770254KOZikQ','application/json','save','CEQlx','not_configured','5OaigRL','environment_key','userAgent','26320393JxEsbt','username','688eLoCxO','browserOptions','/api/v1/profiles','password','\x22\x20not\x20found.','shfFK','about:blank','ALuNh','HmohA','HovPY','error','RANGER_TEST_USERNAME','POST','settings','fdKTw','iDLJL','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','\x20\x20Cached\x20session\x20for\x20\x22','PUT','Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.','/session','ptehg','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','):\x20','json','setupHeaders','confirm','isArray','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','DELETE','environmentKey','ATuXS','message','launch','defaultEnvironmentKey','stringify','success','join','wpnRU','jNWbj','bDXHh','sessionState','81gMEXeF','xpMvi','prompt','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','YrWQT','Browser\x20login\x20timed\x20out\x20after\x20','test_output','status','13PJyLuC','toISOString','rDnXG','auth_config','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','length','\x22.\x0a','push','domains','/api/v1/profiles/auth-config','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','gJSZv','3115473VOcfao','organizationId','LqKYR','WFYOg','105080wWwTnN','\x20\x20No\x20live\x20session\x20for\x20\x22','profiles','152952HVUrNv','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','cookies','zBsHV','log','sXFAp','catch','GXliM','snHdV','4138584TncdCB','xPsyI','\x20\x20Cloud\x20session\x20for\x20\x22','gOjfK','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ruaaS','storageStatePath','etIoV','QgvbA'];_0x4030=function(){return _0x736175;};return _0x4030();}import _0x15ca36 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 _0x2323c5=_0x2db1,_0x56774d=await getToken();if(!_0x56774d)throw new Error(_0x2323c5(0x1f9));return _0x56774d;}async function apiRequest(_0xe683,_0x22add2={}){const _0xd64ff=_0x2db1,_0x253061={'XCPpd':function(_0x1a9d6f,_0x2093fd,_0x5074cb){return _0x1a9d6f(_0x2093fd,_0x5074cb);},'xpMvi':_0xd64ff(0x19d),'jJAxR':function(_0x39f573,_0x4f2882){return _0x39f573===_0x4f2882;},'bDXHh':_0xd64ff(0x206),'etIoV':function(_0x5c4d87,_0x416036){return _0x5c4d87===_0x416036;}},_0x4b3562=await requireToken(),_0x1797c9=getApiBaseUrl(),_0x17060c=await _0x253061['XCPpd'](fetch,''+_0x1797c9+_0xe683,{..._0x22add2,'headers':{'Authorization':'Bearer\x20'+_0x4b3562,'Content-Type':_0x253061[_0xd64ff(0x1d1)],..._0x22add2['headers']??{}}});if(!_0x17060c['ok']){let _0x22dfd3='',_0x4789c2;try{const _0x4e3564=await _0x17060c[_0xd64ff(0x1be)]();_0x22dfd3=(_0x253061['jJAxR'](typeof _0x4e3564[_0xd64ff(0x1b0)],_0x253061[_0xd64ff(0x1ce)])?_0x4e3564[_0xd64ff(0x1b0)]:undefined)??JSON['stringify'](_0x4e3564);if(typeof _0x4e3564['code']===_0xd64ff(0x206))_0x4789c2=_0x4e3564[_0xd64ff(0x204)];}catch{_0x22dfd3=_0x17060c['statusText'];}throw new ApiError('API\x20request\x20'+_0xe683+'\x20failed\x20('+_0x17060c[_0xd64ff(0x1d7)]+_0xd64ff(0x1bd)+_0x22dfd3,_0x17060c[_0xd64ff(0x1d7)],_0x22dfd3,_0x4789c2);}if(_0x253061[_0xd64ff(0x1fc)](_0x17060c['status'],0xcc))return undefined;return _0x17060c[_0xd64ff(0x1be)]();}export class ApiError extends Error{[_0x497ea4(0x1d7)];['detail'];[_0x497ea4(0x204)];constructor(_0x26eb56,_0x5811a6,_0x261a1e,_0x5e765a){const _0x5629e6=_0x497ea4,_0x1a68ec={'gOjfK':'ApiError'};super(_0x26eb56),this[_0x5629e6(0x1d7)]=_0x5811a6,this['detail']=_0x261a1e,this['code']=_0x5e765a,this[_0x5629e6(0x202)]=_0x1a68ec[_0x5629e6(0x1f8)];}}export async function fetchCloudProfile(_0xed9172){const _0x52ff52=_0x497ea4,_0x5a709f={'xPsyI':function(_0x3d6991,_0x5220f9){return _0x3d6991 instanceof _0x5220f9;},'ptehg':function(_0x4ff37c,_0x21978a){return _0x4ff37c===_0x21978a;}};try{return await apiRequest(_0x52ff52(0x208)+encodeURIComponent(_0xed9172));}catch(_0x27c123){if(_0x5a709f[_0x52ff52(0x1f6)](_0x27c123,ApiError)&&_0x5a709f[_0x52ff52(0x1bb)](_0x27c123['status'],0x194))return null;throw _0x27c123;}}export async function listCloudProfiles(){const _0x2ecf57=_0x497ea4,_0x3691e5={'CUEzC':'/api/v1/profiles'},_0x137665=await apiRequest(_0x3691e5[_0x2ecf57(0x1fe)]);return _0x137665[_0x2ecf57(0x1ea)];}export async function deleteCloudProfile(_0x38c159){const _0x4ceed0=_0x497ea4,_0x4e5345={'ZdMvU':function(_0x5a4419,_0x5bd2d4,_0x39d1ee){return _0x5a4419(_0x5bd2d4,_0x39d1ee);},'qRxHS':function(_0x5bd22d,_0x1d3440){return _0x5bd22d===_0x1d3440;}};try{await _0x4e5345['ZdMvU'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x38c159),{'method':_0x4ceed0(0x1c3)});}catch(_0x122993){if(_0x122993 instanceof ApiError&&_0x4e5345[_0x4ceed0(0x216)](_0x122993[_0x4ceed0(0x1d7)],0x194))throw new Error(_0x4ceed0(0x201)+_0x38c159+_0x4ceed0(0x1aa));throw _0x122993;}}export async function createCloudProfile(_0x2a10ac,_0x739060,_0x2e3c94={}){const _0x14dd80=_0x497ea4,_0x2de2b3={'QQIdy':function(_0x183c7f,_0x8f8f35,_0x28e2ed){return _0x183c7f(_0x8f8f35,_0x28e2ed);}},_0x1d09c8={'name':_0x2a10ac};if(_0x739060)_0x1d09c8[_0x14dd80(0x1a2)]=_0x739060;_0x2e3c94['settings']&&Object['keys'](_0x2e3c94['settings'])['length']>0x0&&(_0x1d09c8['settings']=_0x2e3c94[_0x14dd80(0x1b3)]);if(_0x2e3c94['username'])_0x1d09c8['username']=_0x2e3c94['username'];if(_0x2e3c94[_0x14dd80(0x1a9)])_0x1d09c8[_0x14dd80(0x1a9)]=_0x2e3c94[_0x14dd80(0x1a9)];return await _0x2de2b3['QQIdy'](apiRequest,_0x14dd80(0x1a8),{'method':'POST','body':JSON['stringify'](_0x1d09c8)});}export async function uploadCloudProfileSession(_0x22e63d,_0x221f7d){const _0x1dca20=_0x497ea4;return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x22e63d)+_0x1dca20(0x1ba),{'method':'POST','body':JSON['stringify']({'session_state':_0x221f7d})});}function _0x2db1(_0x127f5d,_0x5ee485){_0x127f5d=_0x127f5d-0x19d;const _0x40301b=_0x4030();let _0x2db118=_0x40301b[_0x127f5d];return _0x2db118;}export async function saveCloudProfileCredentials(_0x3de776,_0x5c26a0,_0x2b52bd){const _0x5b9f4e=_0x497ea4,_0x19de56={'wpnRU':function(_0x396a96,_0x576027){return _0x396a96(_0x576027);},'uqsOp':'PUT'};await apiRequest('/api/v1/profiles/'+_0x19de56[_0x5b9f4e(0x1cc)](encodeURIComponent,_0x3de776),{'method':_0x19de56['uqsOp'],'body':JSON['stringify']({'username':_0x5c26a0,'password':_0x2b52bd})});}export async function fetchAuthConfig(){const _0x53a7f2=_0x497ea4;try{const _0xe79fec=await apiRequest(_0x53a7f2(0x1e1));return _0xe79fec[_0x53a7f2(0x1db)];}catch(_0x79cbf7){return _0x79cbf7 instanceof ApiError&&_0x79cbf7[_0x53a7f2(0x1d7)]!==0x194&&console[_0x53a7f2(0x1b0)]('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x79cbf7['message']),null;}}export function pickAdHocEnvKey(_0x4cf0d9){const _0x35f290=_0x497ea4,_0x366bc0={'jNWbj':function(_0x277946,_0x182040){return _0x277946===_0x182040;}};if(!_0x4cf0d9)return null;if(_0x4cf0d9['defaultEnvironmentKey'])return _0x4cf0d9[_0x35f290(0x1c8)];const _0xe3ce32=Object['keys'](_0x4cf0d9['environments']??{});if(_0x366bc0[_0x35f290(0x1cd)](_0xe3ce32['length'],0x1))return _0xe3ce32[0x0];if(_0x366bc0['jNWbj'](_0xe3ce32[_0x35f290(0x1dd)],0x0))return null;throw new Error(_0x35f290(0x1ed)+_0xe3ce32[_0x35f290(0x1cb)](',\x20')+').\x20'+_0x35f290(0x1b9));}export async function resolveAdHocProfile(_0x30c18c=process[_0x497ea4(0x20f)]){const _0xa3411=_0x497ea4,_0x27afc2={'CEQlx':function(_0x565d11){return _0x565d11();}},_0x1868dc=_0x30c18c[_0xa3411(0x1b1)];if(!_0x1868dc)return null;const _0x4a62ad=await fetchCloudProfile(_0x1868dc);if(_0x4a62ad)return{'name':_0x4a62ad[_0xa3411(0x202)],'profile':_0x4a62ad};const _0x30c03d=await _0x27afc2[_0xa3411(0x19f)](fetchAuthConfig),_0x323ec6=pickAdHocEnvKey(_0x30c03d),_0x5d4a60=_0x30c18c[_0xa3411(0x207)],_0x436ba8=await createCloudProfile(_0x1868dc,_0x323ec6??undefined,{'username':_0x1868dc,'password':_0x5d4a60});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x436ba8['name']+'\x22\x20for\x20'+_0x1868dc),{'name':_0x436ba8['name'],'profile':_0x436ba8};}export async function writeSessionToLocalCache(_0x1868c0,_0xd6b627,_0x59e2c3,_0x35445e,_0x41df1f,_0x4ec363,_0xd22db9){const _0x22001f=_0x497ea4,_0x4ebaa6={'ATuXS':function(_0x574317,_0x31c991,_0x38a58c){return _0x574317(_0x31c991,_0x38a58c);},'zBsHV':function(_0x3c9359){return _0x3c9359();},'rNxEm':'auth','udJpM':function(_0x52656c,_0x4b361f,_0x2e48df){return _0x52656c(_0x4b361f,_0x2e48df);},'HmEdd':function(_0xcc7404,_0x369cf5){return _0xcc7404>_0x369cf5;},'bisgh':function(_0x3b973a,_0x536144,_0x27a17f){return _0x3b973a(_0x536144,_0x27a17f);},'eLsDC':function(_0x5898f3,_0x2ab9c5){return _0x5898f3(_0x2ab9c5);}},_0x26400e=sessionCacheHash({'orgId':_0xd6b627,'profileName':_0x1868c0,'effectiveBaseUrl':_0x59e2c3,'setupHeaders':_0x35445e,'invalidateOn':_0xd22db9?.['invalidateOn'],'userAgent':_0xd22db9?.['userAgent'],'clientIp':_0xd22db9?.['clientIp']}),_0x3c4f66=_0x4ebaa6[_0x22001f(0x1c5)](getSessionCachePath,_0x26400e,_0x1868c0),_0x5d154c=_0x4ebaa6['ATuXS'](join,_0x4ebaa6[_0x22001f(0x1ef)](getRangerHomeDir),_0x4ebaa6['rNxEm']);!existsSync(_0x5d154c)&&await _0x4ebaa6['udJpM'](mkdir,_0x5d154c,{'recursive':!![]});const _0xb9f13f={..._0x41df1f};_0x4ec363&&_0x4ebaa6[_0x22001f(0x200)](_0x4ec363[_0x22001f(0x1dd)],0x0)&&Array[_0x22001f(0x1c1)](_0xb9f13f[_0x22001f(0x1ee)])&&(_0xb9f13f[_0x22001f(0x1ee)]=_0x4ebaa6['bisgh'](duplicateCookiesForDomains,_0xb9f13f[_0x22001f(0x1ee)],_0x4ec363));const _0x4db359={'cached_at':new Date()[_0x22001f(0x1d9)](),'session_state':_0xb9f13f};await _0x4ebaa6['ATuXS'](writeFile,_0x3c4f66,JSON['stringify'](_0x4db359,null,0x2));const _0x550ed8=_0x4ebaa6[_0x22001f(0x212)](getStorageStatePath,_0x3c4f66);return await _0x4ebaa6['udJpM'](writeFile,_0x550ed8,JSON[_0x22001f(0x1c9)](_0xb9f13f,null,0x2)),_0x550ed8;}export async function checkLocalCache(_0x5e934a,_0x1bd1d4,_0x57f2e8,_0xc9198f,_0x5f540c){const _0x47719c=_0x497ea4,_0x2bcd02={'HmohA':function(_0x3333f2,_0x46ff16){return _0x3333f2(_0x46ff16);},'TkyNn':function(_0x4cd1b7,_0x5cc3cb){return _0x4cd1b7(_0x5cc3cb);},'CSaAh':function(_0x465ea6,_0x57e9c8){return _0x465ea6(_0x57e9c8);}},_0x353807=_0x2bcd02[_0x47719c(0x1ae)](sessionCacheHash,{'orgId':_0x1bd1d4,'profileName':_0x5e934a,'effectiveBaseUrl':_0x57f2e8,'setupHeaders':_0xc9198f,'invalidateOn':_0x5f540c?.['invalidateOn'],'userAgent':_0x5f540c?.[_0x47719c(0x1a3)],'clientIp':_0x5f540c?.[_0x47719c(0x205)]}),_0x814f30=getSessionCachePath(_0x353807,_0x5e934a),_0x16b350=_0x2bcd02['TkyNn'](getStorageStatePath,_0x814f30);if(!existsSync(_0x814f30)||!_0x2bcd02['CSaAh'](existsSync,_0x16b350))return null;try{const _0x4c5ffb=await readFile(_0x814f30,'utf-8');return JSON['parse'](_0x4c5ffb),{'storageStatePath':_0x16b350};}catch{return null;}}function launchRealBrowser(){const _0x3b7d85=_0x497ea4;return chromium[_0x3b7d85(0x1c7)]({'headless':!![]});}function emitSessionValidationHint(_0x4e125d,_0x11150a){const _0x52e9b2=_0x497ea4,_0x4c7b4e={'SQjuM':function(_0x4995c2,_0x342002){return _0x4995c2===_0x342002;},'xBrfL':function(_0x6200d2,_0x1be783){return _0x6200d2+_0x1be783;}};if(!_0x11150a||!_0x11150a[_0x52e9b2(0x1e0)]?.[_0x52e9b2(0x1dd)])return;let _0x1d115b;try{_0x1d115b=new URL(_0x4e125d);}catch{return;}const _0x3da4f0=[];for(const _0x1dec39 of _0x11150a[_0x52e9b2(0x1e0)]){try{_0x3da4f0[_0x52e9b2(0x1df)]({'raw':_0x1dec39,'url':new URL(_0x1dec39)});}catch{}}if(_0x4c7b4e[_0x52e9b2(0x20c)](_0x3da4f0['length'],0x0))return;if(_0x3da4f0['some'](_0x57470c=>_0x57470c['url']['origin']===_0x1d115b['origin']))return;const _0x15919b=_0x3da4f0['map'](_0x363cec=>'\x22'+_0x363cec['raw']+'\x22')[_0x52e9b2(0x1cb)](',\x20');console['log'](_0x4c7b4e['xBrfL'](_0x52e9b2(0x20b)+_0x15919b+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x4e125d+_0x52e9b2(0x1ec))+'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.');}export async function serverSideLogin(_0x2faf37,_0x2501ab){const _0xccb569=_0x497ea4,_0x1783d3={'WRDrz':function(_0x4c9139,_0x422daf,_0x37595a){return _0x4c9139(_0x422daf,_0x37595a);},'ruaaS':function(_0x4c12f8,_0x18d372){return _0x4c12f8===_0x18d372;},'WFYOg':_0xccb569(0x1a0)},_0x48bb9e=process[_0xccb569(0x20f)]['RANGER_TEST_USERNAME'],_0x46673b=process[_0xccb569(0x20f)][_0xccb569(0x207)],_0x5bb4ef={};if(_0x48bb9e)_0x5bb4ef['username']=_0x48bb9e;if(_0x46673b)_0x5bb4ef[_0xccb569(0x1a9)]=_0x46673b;if(_0x2501ab?.['force'])_0x5bb4ef['force']=!![];try{return await _0x1783d3['WRDrz'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x2faf37)+_0xccb569(0x20a),{'method':'POST','body':JSON[_0xccb569(0x1c9)](_0x5bb4ef)});}catch(_0xf5ee12){if(_0xf5ee12 instanceof ApiError&&_0x1783d3[_0xccb569(0x1fa)](_0xf5ee12['status'],0x190)&&_0x1783d3[_0xccb569(0x1fa)](_0xf5ee12[_0xccb569(0x204)],_0x1783d3[_0xccb569(0x1e7)]))return{'status':_0xccb569(0x1a0),'error':_0xf5ee12['detail']};throw _0xf5ee12;}}export async function manualBrowserLogin(_0xe14c39,_0x3bf0a4){const _0x12e951=_0x497ea4,_0x189cbe={'eUorV':function(_0x30c5b6,_0x332553){return _0x30c5b6/_0x332553;},'snHdV':function(_0x2b7cc0){return _0x2b7cc0();},'MFTMp':function(_0x396910,_0x7deb97){return _0x396910(_0x7deb97);},'YrWQT':function(_0x24a2a2,_0x426f8e,_0x25dbc3){return _0x24a2a2(_0x426f8e,_0x25dbc3);},'WOYby':_0x12e951(0x213),'LqKYR':function(_0x4d6911){return _0x4d6911();},'ALuNh':function(_0x16dd89,_0x11f1ae){return _0x16dd89+_0x11f1ae;},'iAjaV':function(_0x436cdb,_0x58e2ac){return _0x436cdb+_0x58e2ac;},'bCDel':_0x12e951(0x1ac),'vTRXt':_0x12e951(0x1e2),'HovPY':_0x12e951(0x1ff),'wTVzX':function(_0x461944,_0x55976f){return _0x461944&&_0x55976f;},'rDnXG':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','iDLJL':_0x12e951(0x1b2),'sXFAp':'cli:manual-login'};if(!_0x189cbe[_0x12e951(0x1e6)](isInteractive))throw new Error(_0x189cbe[_0x12e951(0x1ad)](_0x189cbe['iAjaV'](_0x12e951(0x217)+_0xe14c39[_0x12e951(0x202)]+_0x12e951(0x1de),'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20'),_0x12e951(0x1dc)));const _0x32f32d=_0x3bf0a4&&_0x3bf0a4['domains'][_0x12e951(0x1dd)]>0x0?_0x3bf0a4['domains'][0x0]:_0x189cbe['bCDel'];console[_0x12e951(0x1f0)](_0x189cbe['vTRXt']),console['log'](_0x189cbe[_0x12e951(0x1af)]),await new Promise(_0x541fac=>setTimeout(_0x541fac,0x7d0));const _0x4103e6=await chromium[_0x12e951(0x1c7)]({'headless':![]});let _0x28b7dc=null;try{const _0x223ac4={'ignoreHTTPSErrors':!![]};_0x3bf0a4?.[_0x12e951(0x1bf)]&&(_0x223ac4['extraHTTPHeaders']=_0x3bf0a4['setupHeaders']);const _0x21838a=await _0x4103e6['newContext'](_0x223ac4);await addProfileSetupBanner(_0x21838a);const _0x3630b3=await _0x21838a['newPage']();await _0x3630b3['goto'](_0x32f32d);let _0x3abeb8=![];await new Promise(_0x38e090=>{const _0x545455=_0x12e951,_0xb5206b={'xfoRR':function(_0x4cb40e,_0x141ffb){return _0x189cbe['MFTMp'](_0x4cb40e,_0x141ffb);}},_0x1caddc=_0x189cbe[_0x545455(0x1d4)](setTimeout,()=>{const _0x30157f=_0x545455;_0x3abeb8=!![],console['error'](_0x30157f(0x1d5)+_0x189cbe['eUorV'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x189cbe[_0x30157f(0x1f4)](_0x38e090);},MANUAL_LOGIN_TIMEOUT_MS);_0x3630b3['on'](_0x189cbe['WOYby'],async()=>{_0xb5206b['xfoRR'](clearTimeout,_0x1caddc);try{const _0x57341a=await _0x21838a['storageState']();_0x28b7dc=_0x57341a;}catch{}_0x38e090();});});if(_0x189cbe['wTVzX'](_0x3abeb8,!_0x28b7dc))throw new Error(_0x12e951(0x214));}finally{await _0x4103e6[_0x12e951(0x213)]()[_0x12e951(0x1f2)](()=>{});}if(!_0x28b7dc)throw new Error(_0x189cbe[_0x12e951(0x1da)]);return await _0x189cbe[_0x12e951(0x1d4)](apiRequest,'/api/v1/profiles/'+_0x189cbe['MFTMp'](encodeURIComponent,_0xe14c39['name'])+'/session',{'method':_0x189cbe[_0x12e951(0x1b5)],'body':JSON[_0x12e951(0x1c9)]({'session_state':_0x28b7dc,'updated_by':_0x189cbe[_0x12e951(0x1f1)]})}),{'sessionState':_0x28b7dc};}export async function promptSaveCredentials(_0x468db2){const _0x13a285=_0x497ea4,_0x3fc9f4={'MDYDC':function(_0x5c2a8a,_0x68f22b){return _0x5c2a8a||_0x68f22b;},'tNgJh':function(_0x59de7f){return _0x59de7f();},'JFJAD':_0x13a285(0x20e),'FKjAC':function(_0x29d552,_0x1e33fa,_0x198e84){return _0x29d552(_0x1e33fa,_0x198e84);},'rvCGL':function(_0xbe48b4,_0x5c0208){return _0xbe48b4(_0x5c0208);}},_0x4f0758=process['env']['RANGER_TEST_USERNAME'],_0x572b22=process['env']['RANGER_TEST_PASSWORD'];if(_0x3fc9f4['MDYDC'](!_0x4f0758,!_0x572b22))return;if(!_0x3fc9f4['tNgJh'](isInteractive))return;const {save:_0x21f8d0}=await _0x15ca36[_0x13a285(0x1d2)]([{'type':_0x13a285(0x1c0),'name':_0x13a285(0x19e),'message':_0x3fc9f4[_0x13a285(0x211)],'default':![]}]);if(!_0x21f8d0)return;await _0x3fc9f4['FKjAC'](apiRequest,'/api/v1/profiles/'+_0x3fc9f4['rvCGL'](encodeURIComponent,_0x468db2),{'method':_0x13a285(0x1b8),'body':JSON['stringify']({'username':_0x4f0758,'password':_0x572b22})}),console[_0x13a285(0x1f0)](_0x13a285(0x1b6));}export async function resolveCloudProfileSession(_0x37c830,_0x596ffb={}){const _0x526c8d=_0x497ea4,_0xa6b18e={'jyJhw':function(_0xe0b77b,_0x47e555,_0x36908d,_0x3d5b59,_0x420735,_0x57a508){return _0xe0b77b(_0x47e555,_0x36908d,_0x3d5b59,_0x420735,_0x57a508);},'ZROpC':function(_0x52b937,_0x2f82ce,_0x12f08e){return _0x52b937(_0x2f82ce,_0x12f08e);},'shfFK':function(_0x14e53c,_0x4390ae,_0x334c71,_0x84db87,_0x4949df,_0x45b135,_0x5c3abb,_0x1da124){return _0x14e53c(_0x4390ae,_0x334c71,_0x84db87,_0x4949df,_0x45b135,_0x5c3abb,_0x1da124);},'SsJsq':function(_0x329af5,_0x341a2a,_0x4ad216,_0x2f9621,_0x59cf03){return _0x329af5(_0x341a2a,_0x4ad216,_0x2f9621,_0x59cf03);},'GXliM':function(_0x43cc51,_0x524b4a,_0x2a7753){return _0x43cc51(_0x524b4a,_0x2a7753);},'gJSZv':function(_0x2ca79b,_0x2159b7){return _0x2ca79b(_0x2159b7);},'QLaSy':function(_0x1dc120,_0x9fabb0){return _0x1dc120(_0x9fabb0);},'QgvbA':function(_0x415054,_0x443a74){return _0x415054||_0x443a74;},'JiypU':'not_configured','fdKTw':function(_0x28a273,_0x57a82e){return _0x28a273===_0x57a82e;},'nKQur':_0x526c8d(0x1ca),'sqtsk':'\x20\x20Login\x20successful.\x20Session\x20cached.','aebxx':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','JxwtI':_0x526c8d(0x1bc)},_0x5e76fd=_0x37c830['settings']??{},_0x4e5651=await fetchAuthConfig(),_0x5538af=_0x4e5651?resolveAuthEnvironmentLocally(_0x4e5651,_0x37c830[_0x526c8d(0x1c4)]):null,_0x5bbe1f=_0x5538af?.['domains'],_0x13df7f=_0x5e76fd['setupHeaders'],_0x56ea55=_0x13df7f??_0x5538af?.[_0x526c8d(0x1bf)],_0x17c2a2=_0x596ffb['effectiveBaseUrl']??_0x5e76fd['baseUrl']??(_0x5bbe1f&&_0x5bbe1f[_0x526c8d(0x1dd)]>0x0?_0x5bbe1f[0x0]:''),_0x5020e0={'invalidateOn':_0x5538af?.['invalidateOn'],'userAgent':_0x5538af?.[_0x526c8d(0x1a7)]?.[_0x526c8d(0x1a3)]??_0x5e76fd['userAgent']},_0x5d92a9=await _0xa6b18e['jyJhw'](checkLocalCache,_0x37c830['name'],_0x37c830[_0x526c8d(0x1e5)],_0x17c2a2,_0x56ea55,_0x5020e0);if(_0x5d92a9){if(_0x17c2a2){const _0x41ce79=await isCachedSessionLive(_0x5d92a9[_0x526c8d(0x1fb)],_0x17c2a2,{'sessionCheckPath':_0x5538af?.['sessionCheckPath'],'setupHeaders':_0x56ea55},{'launchBrowser':launchRealBrowser});if(_0x41ce79)return console[_0x526c8d(0x1f0)](_0x526c8d(0x1d3)+_0x37c830[_0x526c8d(0x202)]+'\x22'),{'authPath':_0x5d92a9[_0x526c8d(0x1fb)],'settings':_0x5e76fd,'resolvedEnv':_0x5538af};console['log'](_0x526c8d(0x1b7)+_0x37c830['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0xa6b18e['ZROpC'](emitSessionValidationHint,_0x17c2a2,_0x5538af);}else return{'authPath':_0x5d92a9[_0x526c8d(0x1fb)],'settings':_0x5e76fd,'resolvedEnv':_0x5538af};}if(_0x37c830[_0x526c8d(0x1cf)]){const _0x28d99f=await _0xa6b18e[_0x526c8d(0x1ab)](writeSessionToLocalCache,_0x37c830['name'],_0x37c830[_0x526c8d(0x1e5)],_0x17c2a2,_0x56ea55,_0x37c830['sessionState'],_0x5bbe1f,_0x5020e0);if(_0x17c2a2){const _0x62d852=await _0xa6b18e['SsJsq'](isCachedSessionLive,_0x28d99f,_0x17c2a2,{'sessionCheckPath':_0x5538af?.['sessionCheckPath'],'setupHeaders':_0x56ea55},{'launchBrowser':launchRealBrowser});if(_0x62d852)return console['log'](_0x526c8d(0x1c2)+_0x37c830[_0x526c8d(0x202)]+_0x526c8d(0x209)),{'authPath':_0x28d99f,'settings':_0x5e76fd,'resolvedEnv':_0x5538af};console['log'](_0x526c8d(0x1f7)+_0x37c830['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),_0xa6b18e[_0x526c8d(0x1f3)](emitSessionValidationHint,_0x17c2a2,_0x5538af);}else return{'authPath':_0x28d99f,'settings':_0x5e76fd,'resolvedEnv':_0x5538af};}console['log'](_0x526c8d(0x1e9)+_0x37c830['name']+_0x526c8d(0x210));const _0x18775e=_0xa6b18e['gJSZv'](Boolean,process['env'][_0x526c8d(0x1b1)])&&Boolean(process[_0x526c8d(0x20f)][_0x526c8d(0x207)]),_0x41072c=_0xa6b18e['QLaSy'](Boolean,_0x37c830[_0x526c8d(0x1a5)]);if(_0xa6b18e[_0x526c8d(0x1fd)](_0x18775e,_0x41072c))try{const _0x317c06=await _0xa6b18e[_0x526c8d(0x1e3)](serverSideLogin,_0x37c830['name']);if(_0x317c06[_0x526c8d(0x1d7)]===_0xa6b18e['JiypU'])console[_0x526c8d(0x1f0)](_0x526c8d(0x20d));else{if(_0xa6b18e[_0x526c8d(0x1b4)](_0x317c06[_0x526c8d(0x1d7)],_0xa6b18e['nKQur'])&&_0x317c06[_0x526c8d(0x215)]){console['log'](_0xa6b18e['sqtsk']);const _0x51ac90=await writeSessionToLocalCache(_0x37c830[_0x526c8d(0x202)],_0x37c830[_0x526c8d(0x1e5)],_0x17c2a2,_0x56ea55,_0x317c06[_0x526c8d(0x215)],_0x5bbe1f,_0x5020e0);return _0x18775e&&!_0x41072c&&await promptSaveCredentials(_0x37c830['name']),{'authPath':_0x51ac90,'settings':_0x5e76fd,'resolvedEnv':_0x5538af};}else _0x317c06['test_output']&&(console['log'](_0xa6b18e['aebxx']),console['log'](_0x317c06[_0x526c8d(0x1d6)])),console['log'](_0xa6b18e['JxwtI']);}}catch(_0x48649a){console[_0x526c8d(0x1f0)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x48649a instanceof Error?_0x48649a[_0x526c8d(0x1c6)]:String(_0x48649a))),console[_0x526c8d(0x1f0)](_0xa6b18e['JxwtI']);}const {sessionState:_0xf5ab54}=await manualBrowserLogin(_0x37c830,_0x5538af),_0x1632ff=await writeSessionToLocalCache(_0x37c830['name'],_0x37c830['organizationId'],_0x17c2a2,_0x56ea55,_0xf5ab54,_0x5bbe1f,_0x5020e0);return{'authPath':_0x1632ff,'settings':_0x5e76fd,'resolvedEnv':_0x5538af};}
1
+ const _0x315adf=_0x1074;function _0x1074(_0x54eb06,_0x2ffd39){_0x54eb06=_0x54eb06-0x137;const _0xb6feff=_0xb6fe();let _0x10747d=_0xb6feff[_0x54eb06];return _0x10747d;}(function(_0x3e9fa3,_0x3efa08){const _0x2a3816=_0x1074,_0x4c4d9c=_0x3e9fa3();while(!![]){try{const _0x2b44b5=parseInt(_0x2a3816(0x183))/0x1*(-parseInt(_0x2a3816(0x1ad))/0x2)+parseInt(_0x2a3816(0x1a5))/0x3*(parseInt(_0x2a3816(0x196))/0x4)+-parseInt(_0x2a3816(0x15e))/0x5*(parseInt(_0x2a3816(0x1ae))/0x6)+parseInt(_0x2a3816(0x190))/0x7*(-parseInt(_0x2a3816(0x180))/0x8)+-parseInt(_0x2a3816(0x157))/0x9+parseInt(_0x2a3816(0x177))/0xa+parseInt(_0x2a3816(0x161))/0xb;if(_0x2b44b5===_0x3efa08)break;else _0x4c4d9c['push'](_0x4c4d9c['shift']());}catch(_0x4a3192){_0x4c4d9c['push'](_0x4c4d9c['shift']());}}}(_0xb6fe,0x1f814));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x4beffa 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 _0x3749a2={'DVAxv':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x10028c=await getToken();if(!_0x10028c)throw new Error(_0x3749a2['DVAxv']);return _0x10028c;}async function apiRequest(_0x37d2dc,_0x42d2a3={}){const _0x47155e=_0x1074,_0x539087={'mdkSK':function(_0x48c8a3){return _0x48c8a3();}},_0x3eb5d0=await _0x539087[_0x47155e(0x148)](requireToken),_0x28bed3=getApiBaseUrl(),_0x2d61ac=await fetch(''+_0x28bed3+_0x37d2dc,{..._0x42d2a3,'headers':{'Authorization':'Bearer\x20'+_0x3eb5d0,'Content-Type':_0x47155e(0x169),..._0x42d2a3['headers']??{}}});if(!_0x2d61ac['ok']){let _0x23ab55='',_0x4eaea2;try{const _0x5885f9=await _0x2d61ac['json']();_0x23ab55=(typeof _0x5885f9[_0x47155e(0x17a)]==='string'?_0x5885f9[_0x47155e(0x17a)]:undefined)??JSON['stringify'](_0x5885f9);if(typeof _0x5885f9[_0x47155e(0x141)]===_0x47155e(0x19f))_0x4eaea2=_0x5885f9['code'];}catch{_0x23ab55=_0x2d61ac[_0x47155e(0x1af)];}throw new ApiError(_0x47155e(0x16b)+_0x37d2dc+_0x47155e(0x138)+_0x2d61ac[_0x47155e(0x16d)]+_0x47155e(0x145)+_0x23ab55,_0x2d61ac[_0x47155e(0x16d)],_0x23ab55,_0x4eaea2);}if(_0x2d61ac[_0x47155e(0x16d)]===0xcc)return undefined;return _0x2d61ac['json']();}export class ApiError extends Error{[_0x315adf(0x16d)];[_0x315adf(0x1a1)];['code'];constructor(_0x357505,_0x346e8c,_0x44efd6,_0x68dfb5){const _0x2a6ab0=_0x315adf,_0x44c0b6={'JOdYS':_0x2a6ab0(0x172)};super(_0x357505),this[_0x2a6ab0(0x16d)]=_0x346e8c,this[_0x2a6ab0(0x1a1)]=_0x44efd6,this['code']=_0x68dfb5,this[_0x2a6ab0(0x19e)]=_0x44c0b6[_0x2a6ab0(0x174)];}}export async function fetchCloudProfile(_0x5dc9dd){const _0x57340f=_0x315adf,_0x3ad3fe={'Yfctp':function(_0x3a6d35,_0x183815){return _0x3a6d35(_0x183815);},'eNgOX':function(_0x5c31a2,_0x274a89){return _0x5c31a2 instanceof _0x274a89;}};try{return await _0x3ad3fe['Yfctp'](apiRequest,_0x57340f(0x176)+encodeURIComponent(_0x5dc9dd));}catch(_0x493d7b){if(_0x3ad3fe[_0x57340f(0x184)](_0x493d7b,ApiError)&&_0x493d7b['status']===0x194)return null;throw _0x493d7b;}}export async function listCloudProfiles(){const _0x12f273=_0x315adf,_0x8ea989=await apiRequest(_0x12f273(0x19d));return _0x8ea989[_0x12f273(0x186)];}export async function deleteCloudProfile(_0x5e89fd){const _0x4d21b0=_0x315adf,_0x2464eb={'jfNeL':function(_0x4d024b,_0x5e0a49,_0x514bce){return _0x4d024b(_0x5e0a49,_0x514bce);},'UPRWr':function(_0x1e0af0,_0x52b4d1){return _0x1e0af0(_0x52b4d1);},'YqrEl':_0x4d21b0(0x18e),'bmwSK':function(_0x321d76,_0x4b10b9){return _0x321d76===_0x4b10b9;}};try{await _0x2464eb['jfNeL'](apiRequest,_0x4d21b0(0x176)+_0x2464eb['UPRWr'](encodeURIComponent,_0x5e89fd),{'method':_0x2464eb['YqrEl']});}catch(_0x5b2b4e){if(_0x5b2b4e instanceof ApiError&&_0x2464eb[_0x4d21b0(0x165)](_0x5b2b4e['status'],0x194))throw new Error('Cloud\x20profile\x20\x22'+_0x5e89fd+'\x22\x20not\x20found.');throw _0x5b2b4e;}}export async function createCloudProfile(_0x5121ed,_0x46b863,_0x3d1b79={}){const _0xb96092=_0x315adf,_0x2d7db1={'name':_0x5121ed};if(_0x46b863)_0x2d7db1[_0xb96092(0x1a7)]=_0x46b863;_0x3d1b79[_0xb96092(0x14c)]&&Object[_0xb96092(0x13f)](_0x3d1b79[_0xb96092(0x14c)])['length']>0x0&&(_0x2d7db1[_0xb96092(0x14c)]=_0x3d1b79[_0xb96092(0x14c)]);if(_0x3d1b79[_0xb96092(0x167)])_0x2d7db1['username']=_0x3d1b79[_0xb96092(0x167)];if(_0x3d1b79[_0xb96092(0x13a)])_0x2d7db1[_0xb96092(0x13a)]=_0x3d1b79['password'];return await apiRequest(_0xb96092(0x19d),{'method':'POST','body':JSON['stringify'](_0x2d7db1)});}export async function uploadCloudProfileSession(_0x817fd9,_0x301a70){const _0xc88e99=_0x315adf,_0x4eee0b={'NsvtT':function(_0x4d6ce2,_0x29c650,_0x57d805){return _0x4d6ce2(_0x29c650,_0x57d805);},'vKebu':_0xc88e99(0x1b0)};return await _0x4eee0b['NsvtT'](apiRequest,_0xc88e99(0x176)+encodeURIComponent(_0x817fd9)+'/session',{'method':_0x4eee0b[_0xc88e99(0x151)],'body':JSON['stringify']({'session_state':_0x301a70})});}export async function saveCloudProfileCredentials(_0x1d8372,_0x48bad8,_0x3c0ff9){const _0x15f387=_0x315adf,_0x1a5710={'lLfnv':function(_0x29cdc5,_0x2f90c2,_0x41e1){return _0x29cdc5(_0x2f90c2,_0x41e1);},'xhguM':function(_0x45cea5,_0xb37103){return _0x45cea5(_0xb37103);}};await _0x1a5710[_0x15f387(0x168)](apiRequest,_0x15f387(0x176)+_0x1a5710[_0x15f387(0x15a)](encodeURIComponent,_0x1d8372),{'method':_0x15f387(0x162),'body':JSON['stringify']({'username':_0x48bad8,'password':_0x3c0ff9})});}export async function fetchAuthConfig(){const _0x40d91a=_0x315adf,_0x3f405c={'pbFQo':function(_0x29870f,_0x40d8f8){return _0x29870f instanceof _0x40d8f8;},'YuRhE':function(_0xaefc6f,_0x5c8d4b){return _0xaefc6f!==_0x5c8d4b;}};try{const _0x51a802=await apiRequest('/api/v1/profiles/auth-config');return _0x51a802[_0x40d91a(0x147)];}catch(_0x331c54){return _0x3f405c['pbFQo'](_0x331c54,ApiError)&&_0x3f405c[_0x40d91a(0x158)](_0x331c54['status'],0x194)&&console['error']('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x331c54['message']),null;}}export function pickAdHocEnvKey(_0x8dfbcd){const _0x28121e=_0x315adf,_0x2ae096={'mFIeL':function(_0x2beea7,_0x4c1822){return _0x2beea7===_0x4c1822;},'DuLlm':function(_0x57ba33,_0x4d8cc1){return _0x57ba33+_0x4d8cc1;}};if(!_0x8dfbcd)return null;if(_0x8dfbcd[_0x28121e(0x164)])return _0x8dfbcd['defaultEnvironmentKey'];const _0x54aae4=Object['keys'](_0x8dfbcd[_0x28121e(0x149)]??{});if(_0x54aae4[_0x28121e(0x17c)]===0x1)return _0x54aae4[0x0];if(_0x2ae096[_0x28121e(0x18a)](_0x54aae4[_0x28121e(0x17c)],0x0))return null;throw new Error(_0x2ae096['DuLlm'](_0x28121e(0x194)+_0x54aae4[_0x28121e(0x19a)](',\x20')+_0x28121e(0x199),'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(_0x1a5eb8=process['env']){const _0x1bb4cd=_0x315adf,_0x26d562={'WFhyK':function(_0xe7ab5e,_0x31ddf7){return _0xe7ab5e(_0x31ddf7);},'HQOdC':function(_0x30da12){return _0x30da12();},'ZvSlq':function(_0xba023d,_0x4900b1,_0x17a001,_0x81f225){return _0xba023d(_0x4900b1,_0x17a001,_0x81f225);},'fydDC':function(_0x54edc9,_0x2547d8){return _0x54edc9??_0x2547d8;}},_0xb052ac=_0x1a5eb8['RANGER_TEST_USERNAME'];if(!_0xb052ac)return null;const _0x3f5561=await _0x26d562[_0x1bb4cd(0x18d)](fetchCloudProfile,_0xb052ac);if(_0x3f5561)return{'name':_0x3f5561[_0x1bb4cd(0x19e)],'profile':_0x3f5561};const _0x33390a=await _0x26d562['HQOdC'](fetchAuthConfig),_0x18693b=pickAdHocEnvKey(_0x33390a),_0x4660dc=_0x1a5eb8[_0x1bb4cd(0x163)],_0x2a8bc5=await _0x26d562[_0x1bb4cd(0x159)](createCloudProfile,_0xb052ac,_0x26d562[_0x1bb4cd(0x171)](_0x18693b,undefined),{'username':_0xb052ac,'password':_0x4660dc});return console[_0x1bb4cd(0x192)]('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x2a8bc5['name']+'\x22\x20for\x20'+_0xb052ac),{'name':_0x2a8bc5['name'],'profile':_0x2a8bc5};}export async function writeSessionToLocalCache(_0xce10f4,_0x538edf,_0x1acda2,_0x37dbd9,_0x5f29f0,_0xc52809,_0x410c74){const _0x2f2e63=_0x315adf,_0x1002ba={'jHVOw':function(_0x41b6e2){return _0x41b6e2();},'xHItb':'auth','lGZEb':function(_0x590f8d,_0x3e0f1b){return _0x590f8d(_0x3e0f1b);},'qnrmV':function(_0xc91544,_0x5e8f4a,_0x1bc7d3){return _0xc91544(_0x5e8f4a,_0x1bc7d3);},'Tpyqa':function(_0x552bbe,_0x48227e,_0x423780){return _0x552bbe(_0x48227e,_0x423780);}},_0x13b932=sessionCacheHash({'orgId':_0x538edf,'profileName':_0xce10f4,'effectiveBaseUrl':_0x1acda2,'setupHeaders':_0x37dbd9,'invalidateOn':_0x410c74?.['invalidateOn'],'userAgent':_0x410c74?.[_0x2f2e63(0x14f)],'clientIp':_0x410c74?.['clientIp']}),_0x2685ec=getSessionCachePath(_0x13b932,_0xce10f4),_0x234bb5=join(_0x1002ba['jHVOw'](getRangerHomeDir),_0x1002ba[_0x2f2e63(0x1a0)]);!_0x1002ba['lGZEb'](existsSync,_0x234bb5)&&await mkdir(_0x234bb5,{'recursive':!![]});const _0x4c65b2={..._0x5f29f0};_0xc52809&&_0xc52809[_0x2f2e63(0x17c)]>0x0&&Array['isArray'](_0x4c65b2[_0x2f2e63(0x155)])&&(_0x4c65b2['cookies']=_0x1002ba[_0x2f2e63(0x1ac)](duplicateCookiesForDomains,_0x4c65b2[_0x2f2e63(0x155)],_0xc52809));const _0x341c71={'cached_at':new Date()[_0x2f2e63(0x14d)](),'session_state':_0x4c65b2};await _0x1002ba[_0x2f2e63(0x144)](writeFile,_0x2685ec,JSON['stringify'](_0x341c71,null,0x2));const _0x32a4f9=getStorageStatePath(_0x2685ec);return await writeFile(_0x32a4f9,JSON['stringify'](_0x4c65b2,null,0x2)),_0x32a4f9;}export async function checkLocalCache(_0x1516ef,_0x21c4c9,_0x3de57b,_0x58e4fb,_0x17e045){const _0x962b63=_0x315adf,_0x53baa7={'hALFK':function(_0x5d017a,_0x22861b){return _0x5d017a(_0x22861b);},'KnLaw':function(_0x4ff9df,_0x4828ce){return _0x4ff9df(_0x4828ce);}},_0x56d52a=_0x53baa7[_0x962b63(0x197)](sessionCacheHash,{'orgId':_0x21c4c9,'profileName':_0x1516ef,'effectiveBaseUrl':_0x3de57b,'setupHeaders':_0x58e4fb,'invalidateOn':_0x17e045?.[_0x962b63(0x140)],'userAgent':_0x17e045?.['userAgent'],'clientIp':_0x17e045?.['clientIp']}),_0x32af86=getSessionCachePath(_0x56d52a,_0x1516ef),_0x42d7bd=_0x53baa7['hALFK'](getStorageStatePath,_0x32af86);if(!existsSync(_0x32af86)||!_0x53baa7['KnLaw'](existsSync,_0x42d7bd))return null;try{const _0x4f4306=await readFile(_0x32af86,_0x962b63(0x1a4));return JSON[_0x962b63(0x1a2)](_0x4f4306),{'storageStatePath':_0x42d7bd};}catch{return null;}}function launchRealBrowser(){const _0x27e6d7=_0x315adf;return chromium[_0x27e6d7(0x153)]({'headless':!![]});}function emitSessionValidationHint(_0x23b656,_0x23160d){const _0x1dac29=_0x315adf,_0x100500={'MBZqj':function(_0x5743fb,_0x2d02f4){return _0x5743fb+_0x2d02f4;}};if(!_0x23160d||!_0x23160d['domains']?.['length'])return;let _0x1295d5;try{_0x1295d5=new URL(_0x23b656);}catch{return;}const _0x4a1333=[];for(const _0x2a6b6f of _0x23160d[_0x1dac29(0x187)]){try{_0x4a1333[_0x1dac29(0x193)]({'raw':_0x2a6b6f,'url':new URL(_0x2a6b6f)});}catch{}}if(_0x4a1333['length']===0x0)return;if(_0x4a1333['some'](_0x539212=>_0x539212[_0x1dac29(0x179)]['origin']===_0x1295d5[_0x1dac29(0x13d)]))return;const _0x3c7933=_0x4a1333[_0x1dac29(0x175)](_0x4f7e3c=>'\x22'+_0x4f7e3c[_0x1dac29(0x170)]+'\x22')[_0x1dac29(0x19a)](',\x20');console[_0x1dac29(0x192)](_0x100500['MBZqj']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x3c7933+';\x20'+(_0x1dac29(0x16e)+_0x23b656+_0x1dac29(0x14a)),'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.'));}export async function serverSideLogin(_0x54d656,_0x16fb22){const _0x35827b=_0x315adf,_0x2a5d53={'kaADs':'POST','VTJQo':function(_0x5d877d,_0x48f5fb){return _0x5d877d instanceof _0x48f5fb;}},_0x462a5d=process[_0x35827b(0x152)][_0x35827b(0x195)],_0x1e7f58=process['env']['RANGER_TEST_PASSWORD'],_0x30403b={};if(_0x462a5d)_0x30403b[_0x35827b(0x167)]=_0x462a5d;if(_0x1e7f58)_0x30403b['password']=_0x1e7f58;if(_0x16fb22?.[_0x35827b(0x15b)])_0x30403b[_0x35827b(0x15b)]=!![];try{return await apiRequest(_0x35827b(0x176)+encodeURIComponent(_0x54d656)+_0x35827b(0x160),{'method':_0x2a5d53['kaADs'],'body':JSON['stringify'](_0x30403b)});}catch(_0xfe4db4){if(_0x2a5d53[_0x35827b(0x146)](_0xfe4db4,ApiError)&&_0xfe4db4[_0x35827b(0x16d)]===0x190&&_0xfe4db4[_0x35827b(0x141)]===_0x35827b(0x14b))return{'status':_0x35827b(0x14b),'error':_0xfe4db4[_0x35827b(0x1a1)]};throw _0xfe4db4;}}function _0xb6fe(){const _0x2c623b=['password','save','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','origin','FMmOy','keys','invalidateOn','code','DvsgN','\x22,\x20cached\x20locally','Tpyqa','):\x20','VTJQo','auth_config','mdkSK','environments','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','not_configured','settings','toISOString','organizationId','userAgent','stringify','vKebu','env','launch','environmentKey','cookies','extraHTTPHeaders','1888776uZhXFS','YuRhE','ZvSlq','xhguM','force','storageState','close','20kDCsCU','loginInstructions','/login','6740019SKVGAJ','PUT','RANGER_TEST_PASSWORD','defaultEnvironmentKey','bmwSK','QIfwk','username','lLfnv','application/json','about:blank','API\x20request\x20','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','status','you\x27re\x20now\x20at\x20\x22','confirm','raw','fydDC','ApiError','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','JOdYS','map','/api/v1/profiles/','844000ttJJel','baseUrl','url','error','storageStatePath','length','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','newPage','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','16SLksnr','sessionState','success','18427scXfmw','eNgOX','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','profiles','domains','setupHeaders','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','mFIeL','test_output','wkrjJ','WFhyK','DELETE','catch','848596iSHFjS','Browser\x20login\x20timed\x20out\x20after\x20','log','push','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','RANGER_TEST_USERNAME','62596AcHQuI','hALFK','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20',').\x20','join','tZivD','FXFSW','/api/v1/profiles','name','string','xHItb','detail','parse','trim','utf-8','39EKmUkK','VqROV','environment_key','MEYeU','\x22,\x20attempting\x20login...','bUPpf','/session','qnrmV','20bxKMRg','202398cbTWAP','statusText','POST','umCFc','RqOmM','\x20failed\x20(','DBRNZ'];_0xb6fe=function(){return _0x2c623b;};return _0xb6fe();}export async function manualBrowserLogin(_0x16feee,_0x446f53){const _0x1b686e=_0x315adf,_0x30d91a={'sXCli':function(_0x55a40f){return _0x55a40f();},'TKxfr':function(_0x4328d9,_0x2ee085){return _0x4328d9+_0x2ee085;},'VqROV':'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','YjgWY':'\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','FMmOy':function(_0x1cd8d6,_0x462ae3){return _0x1cd8d6(_0x462ae3);},'OWWjd':function(_0x103a81,_0x519ecd){return _0x103a81&&_0x519ecd;},'TjRZZ':_0x1b686e(0x13c),'xYRtB':'cli:manual-login'};if(!isInteractive())throw new Error(_0x30d91a['TKxfr']('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x16feee[_0x1b686e(0x19e)]+'\x22.\x0a'+_0x1b686e(0x198),_0x30d91a[_0x1b686e(0x1a6)]));const _0x57061e=_0x446f53&&_0x446f53[_0x1b686e(0x187)][_0x1b686e(0x17c)]>0x0?_0x446f53[_0x1b686e(0x187)][0x0]:_0x1b686e(0x16a);console['log']('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console['log'](_0x30d91a['YjgWY']),await new Promise(_0x42a822=>setTimeout(_0x42a822,0x7d0));const _0x3a631a=await chromium[_0x1b686e(0x153)]({'headless':![]});let _0x47f29d=null;try{const _0x45927f={'ignoreHTTPSErrors':!![]};_0x446f53?.['setupHeaders']&&(_0x45927f[_0x1b686e(0x156)]=_0x446f53[_0x1b686e(0x188)]);const _0x52f37e=await _0x3a631a['newContext'](_0x45927f);await _0x30d91a[_0x1b686e(0x13e)](addProfileSetupBanner,_0x52f37e);const _0x1b85e1=await _0x52f37e[_0x1b686e(0x17e)]();await _0x1b85e1['goto'](_0x57061e);let _0x4ddbec=![];await new Promise(_0x54b9b9=>{const _0x14f9c5={'RqOmM':function(_0x56e425,_0x151f79){return _0x56e425/_0x151f79;},'gRrhh':function(_0x3a73fa){return _0x30d91a['sXCli'](_0x3a73fa);}},_0x23b33f=setTimeout(()=>{const _0x4b779e=_0x1074;_0x4ddbec=!![],console['error'](_0x4b779e(0x191)+_0x14f9c5[_0x4b779e(0x137)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x4b779e(0x16c)),_0x14f9c5['gRrhh'](_0x54b9b9);},MANUAL_LOGIN_TIMEOUT_MS);_0x1b85e1['on']('close',async()=>{const _0x1b3de3=_0x1074;clearTimeout(_0x23b33f);try{const _0x3172a3=await _0x52f37e[_0x1b3de3(0x15c)]();_0x47f29d=_0x3172a3;}catch{}_0x14f9c5['gRrhh'](_0x54b9b9);});});if(_0x30d91a['OWWjd'](_0x4ddbec,!_0x47f29d))throw new Error('Browser\x20login\x20timed\x20out\x20before\x20completion.');}finally{await _0x3a631a[_0x1b686e(0x15d)]()[_0x1b686e(0x18f)](()=>{});}if(!_0x47f29d)throw new Error(_0x30d91a['TjRZZ']);return await apiRequest('/api/v1/profiles/'+_0x30d91a['FMmOy'](encodeURIComponent,_0x16feee[_0x1b686e(0x19e)])+_0x1b686e(0x1ab),{'method':'POST','body':JSON[_0x1b686e(0x150)]({'session_state':_0x47f29d,'updated_by':_0x30d91a['xYRtB']})}),{'sessionState':_0x47f29d};}export async function promptSaveCredentials(_0x49c491){const _0x220c8b=_0x315adf,_0x7831a={'FXFSW':_0x220c8b(0x16f),'ouQfL':_0x220c8b(0x13b),'wkrjJ':'PUT','uBiJa':'\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.'},_0x391d25=process[_0x220c8b(0x152)]['RANGER_TEST_USERNAME'],_0x345aec=process['env'][_0x220c8b(0x163)];if(!_0x391d25||!_0x345aec)return;if(!isInteractive())return;const {save:_0x4c3e4b}=await _0x4beffa['prompt']([{'type':_0x7831a[_0x220c8b(0x19c)],'name':_0x7831a['ouQfL'],'message':_0x220c8b(0x189),'default':![]}]);if(!_0x4c3e4b)return;await apiRequest(_0x220c8b(0x176)+encodeURIComponent(_0x49c491),{'method':_0x7831a[_0x220c8b(0x18c)],'body':JSON[_0x220c8b(0x150)]({'username':_0x391d25,'password':_0x345aec})}),console[_0x220c8b(0x192)](_0x7831a['uBiJa']);}export async function resolveCloudProfileSession(_0x54894e,_0xf4bcd2={}){const _0x44a981=_0x315adf,_0x3a41cf={'dpyDC':function(_0x3902d0){return _0x3902d0();},'bUPpf':function(_0x32fbbf,_0x31235a){return _0x32fbbf===_0x31235a;},'DBRNZ':function(_0x7a6d22,_0x5791ed){return _0x7a6d22===_0x5791ed;},'umCFc':function(_0x3886cb,_0x29b4e5,_0x308615){return _0x3886cb(_0x29b4e5,_0x308615);},'FJShN':function(_0x3a85a4,_0x253697,_0x2af7be,_0x3b9adb,_0x2196d1,_0x259705,_0x30a880,_0x481ce2){return _0x3a85a4(_0x253697,_0x2af7be,_0x3b9adb,_0x2196d1,_0x259705,_0x30a880,_0x481ce2);},'eABYG':function(_0x1cca53,_0x49cf7b){return _0x1cca53(_0x49cf7b);},'MEYeU':function(_0x14574e,_0x393f84){return _0x14574e(_0x393f84);},'FLekg':_0x44a981(0x14b),'CXVZP':function(_0x3fb5c9,_0x263a5a){return _0x3fb5c9===_0x263a5a;},'tZivD':_0x44a981(0x182),'DvsgN':function(_0xc73303,_0x317488){return _0xc73303&&_0x317488;},'TlUKV':_0x44a981(0x17f),'QIfwk':_0x44a981(0x173)},_0x4e0b74=_0x54894e['settings']??{},_0x459deb=await _0x3a41cf['dpyDC'](fetchAuthConfig),_0x28af67=_0x459deb?resolveAuthEnvironmentLocally(_0x459deb,_0x54894e[_0x44a981(0x154)]):null,_0x3e21cd=_0x3a41cf[_0x44a981(0x1aa)](typeof _0x28af67?.[_0x44a981(0x15f)],_0x44a981(0x19f))&&_0x28af67[_0x44a981(0x15f)]['trim']()?_0x28af67[_0x44a981(0x15f)]:undefined,_0xc68751=_0x3a41cf[_0x44a981(0x139)](typeof _0x4e0b74['loginInstructions'],'string')&&_0x4e0b74[_0x44a981(0x15f)][_0x44a981(0x1a3)]()?_0x4e0b74['loginInstructions']:undefined,_0x388901=_0xc68751||!_0x3e21cd?_0x4e0b74:{..._0x4e0b74,'loginInstructions':_0x3e21cd},_0x5466fb=Boolean(_0x388901['loginInstructions']?.[_0x44a981(0x1a3)]()),_0xa598c7=_0x28af67?.['domains'],_0xb64c8f=_0x4e0b74[_0x44a981(0x188)],_0x135178=_0xb64c8f??_0x28af67?.['setupHeaders'],_0x5046dc=_0xf4bcd2['effectiveBaseUrl']??_0x4e0b74[_0x44a981(0x178)]??(_0xa598c7&&_0xa598c7['length']>0x0?_0xa598c7[0x0]:''),_0x3fecbc={'invalidateOn':_0x28af67?.[_0x44a981(0x140)],'userAgent':_0x28af67?.['browserOptions']?.[_0x44a981(0x14f)]??_0x4e0b74['userAgent']},_0x10859d=await checkLocalCache(_0x54894e[_0x44a981(0x19e)],_0x54894e[_0x44a981(0x14e)],_0x5046dc,_0x135178,_0x3fecbc);if(_0x10859d){if(_0x5046dc){const _0x37300e=await isCachedSessionLive(_0x10859d[_0x44a981(0x17b)],_0x5046dc,{'sessionCheckPath':_0x28af67?.['sessionCheckPath'],'setupHeaders':_0x135178},{'launchBrowser':launchRealBrowser});if(_0x37300e)return console[_0x44a981(0x192)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x54894e['name']+'\x22'),{'authPath':_0x10859d['storageStatePath'],'settings':_0x388901,'resolvedEnv':_0x28af67};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x54894e['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x3a41cf[_0x44a981(0x1b1)](emitSessionValidationHint,_0x5046dc,_0x28af67);}else return{'authPath':_0x10859d['storageStatePath'],'settings':_0x388901,'resolvedEnv':_0x28af67};}if(_0x54894e[_0x44a981(0x181)]){const _0x531992=await _0x3a41cf['FJShN'](writeSessionToLocalCache,_0x54894e[_0x44a981(0x19e)],_0x54894e[_0x44a981(0x14e)],_0x5046dc,_0x135178,_0x54894e['sessionState'],_0xa598c7,_0x3fecbc);if(_0x5046dc){const _0x1cde14=await isCachedSessionLive(_0x531992,_0x5046dc,{'sessionCheckPath':_0x28af67?.['sessionCheckPath'],'setupHeaders':_0x135178},{'launchBrowser':launchRealBrowser});if(_0x1cde14)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x54894e['name']+_0x44a981(0x143)),{'authPath':_0x531992,'settings':_0x388901,'resolvedEnv':_0x28af67};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x54894e['name']+_0x44a981(0x185)),emitSessionValidationHint(_0x5046dc,_0x28af67);}else return{'authPath':_0x531992,'settings':_0x388901,'resolvedEnv':_0x28af67};}if(_0x5466fb)return console[_0x44a981(0x192)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x54894e['name']+'\x22;\x20proceeding\x20with\x20loginInstructions.'),{'authPath':undefined,'settings':_0x388901,'resolvedEnv':_0x28af67};console['log']('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x54894e[_0x44a981(0x19e)]+_0x44a981(0x1a9));const _0x413fef=_0x3a41cf['eABYG'](Boolean,process[_0x44a981(0x152)][_0x44a981(0x195)])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x135b20=_0x3a41cf['MEYeU'](Boolean,_0x54894e[_0x44a981(0x167)]);if(_0x413fef||_0x135b20)try{const _0x8bc632=await serverSideLogin(_0x54894e['name']);if(_0x8bc632['status']===_0x3a41cf['FLekg'])console[_0x44a981(0x192)](_0x44a981(0x17d));else{if(_0x3a41cf['CXVZP'](_0x8bc632[_0x44a981(0x16d)],_0x3a41cf[_0x44a981(0x19b)])&&_0x8bc632['session_state']){console[_0x44a981(0x192)]('\x20\x20Login\x20successful.\x20Session\x20cached.');const _0x2168ca=await writeSessionToLocalCache(_0x54894e[_0x44a981(0x19e)],_0x54894e[_0x44a981(0x14e)],_0x5046dc,_0x135178,_0x8bc632['session_state'],_0xa598c7,_0x3fecbc);return _0x3a41cf[_0x44a981(0x142)](_0x413fef,!_0x135b20)&&await _0x3a41cf[_0x44a981(0x1a8)](promptSaveCredentials,_0x54894e[_0x44a981(0x19e)]),{'authPath':_0x2168ca,'settings':_0x388901,'resolvedEnv':_0x28af67};}else _0x8bc632[_0x44a981(0x18b)]&&(console['log'](_0x3a41cf['TlUKV']),console[_0x44a981(0x192)](_0x8bc632[_0x44a981(0x18b)])),console[_0x44a981(0x192)](_0x3a41cf[_0x44a981(0x166)]);}}catch(_0x58654c){console[_0x44a981(0x192)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x58654c instanceof Error?_0x58654c['message']:String(_0x58654c))),console['log'](_0x3a41cf['QIfwk']);}const {sessionState:_0x146ec4}=await manualBrowserLogin(_0x54894e,_0x28af67),_0x150767=await writeSessionToLocalCache(_0x54894e[_0x44a981(0x19e)],_0x54894e[_0x44a981(0x14e)],_0x5046dc,_0x135178,_0x146ec4,_0xa598c7,_0x3fecbc);return{'authPath':_0x150767,'settings':_0x388901,'resolvedEnv':_0x28af67};}
@@ -1 +1 @@
1
- const _0xfb76c4=_0x5b43;function _0x46cc(){const _0x4dda3d=['close','has','add','stdout','replace','sort','hostname','zuXOh','effectiveBaseUrl','test','hex','221672DyMAXZ','15291152dImyzX','1250JCViCN','newContext','isTTY','.json','Favyo','3198272qyMkdp','fZJEa','url','profileName','KDAtW','defaultEnvironmentKey','localhost.','env','auth','length','uSiDZ','100290QYoFRS','.storageState.json','1347321mJfmGN','396JYLWJk','userAgent','668604ASZsfQ','digest','keys','slice','setupHeaders','catch','launchBrowser','LVOVG','port'];_0x46cc=function(){return _0x4dda3d;};return _0x46cc();}(function(_0x1b63ef,_0x2f9edf){const _0x12c0f4=_0x5b43,_0x5a454e=_0x1b63ef();while(!![]){try{const _0x33d34b=-parseInt(_0x12c0f4(0xe7))/0x1+parseInt(_0x12c0f4(0xe2))/0x2+-parseInt(_0x12c0f4(0xe4))/0x3+parseInt(_0x12c0f4(0xd0))/0x4+-parseInt(_0x12c0f4(0xd2))/0x5*(parseInt(_0x12c0f4(0xe5))/0x6)+-parseInt(_0x12c0f4(0xd7))/0x7+parseInt(_0x12c0f4(0xd1))/0x8;if(_0x33d34b===_0x2f9edf)break;else _0x5a454e['push'](_0x5a454e['shift']());}catch(_0x3d3d60){_0x5a454e['push'](_0x5a454e['shift']());}}}(_0x46cc,0x67f7a));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x28476f=process[_0xfb76c4(0xde)],_0x5d63d2={'stdin':process['stdin'],'stdout':process[_0xfb76c4(0xc8)]}){const _0x56e556=_0xfb76c4,_0x2c24f8={'zuXOh':function(_0x3bf459,_0x19a453){return _0x3bf459(_0x19a453);},'xnVAQ':function(_0x47e775,_0x2b2a3d){return _0x47e775(_0x2b2a3d);}};if(_0x28476f['CI'])return![];return _0x2c24f8[_0x56e556(0xcc)](Boolean,_0x5d63d2['stdin']['isTTY'])&&_0x2c24f8['xnVAQ'](Boolean,_0x5d63d2[_0x56e556(0xc8)][_0x56e556(0xd4)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x1d4414){const _0x59cc8f=_0xfb76c4,_0x5a87bb={'KhAoF':'baseUrl','gCMEW':'setupHeaders','JKpHL':_0x59cc8f(0xe6),'ARhRf':function(_0x3abfcf,_0x28345a){return _0x3abfcf!==_0x28345a;},'fZJEa':function(_0x359c23,_0x7b09eb){return _0x359c23!==_0x7b09eb;},'XveRY':function(_0x1a1055,_0x179a5d){return _0x1a1055(_0x179a5d);}},_0x171ba2=new Set(_0x1d4414['invalidateOn']??DEFAULT_INVALIDATE_ON),_0x5d8636={'orgId':_0x1d4414['orgId'],'profileName':_0x1d4414[_0x59cc8f(0xda)]};return _0x171ba2[_0x59cc8f(0xc6)](_0x5a87bb['KhAoF'])&&(_0x5d8636[_0x59cc8f(0xcd)]=_0x1d4414['effectiveBaseUrl']),_0x171ba2[_0x59cc8f(0xc6)](_0x5a87bb['gCMEW'])&&(_0x5d8636[_0x59cc8f(0xc0)]=_0x1d4414['setupHeaders']?sortObjectKeys(_0x1d4414['setupHeaders']):_0x1d4414['setupHeaders']),_0x171ba2['has'](_0x59cc8f(0xc4))&&(_0x5d8636[_0x59cc8f(0xc4)]=extractPort(_0x1d4414[_0x59cc8f(0xcd)])),_0x171ba2[_0x59cc8f(0xc6)](_0x5a87bb['JKpHL'])&&_0x5a87bb['ARhRf'](_0x1d4414[_0x59cc8f(0xe6)],undefined)&&(_0x5d8636['userAgent']=_0x1d4414['userAgent']),_0x171ba2['has']('clientIp')&&_0x5a87bb[_0x59cc8f(0xd8)](_0x1d4414['clientIp'],undefined)&&(_0x5d8636['clientIp']=_0x1d4414['clientIp']),_0x5a87bb['XveRY'](createHash,'sha256')['update'](JSON['stringify'](_0x5d8636))[_0x59cc8f(0xbd)](_0x59cc8f(0xcf))[_0x59cc8f(0xbf)](0x0,0xc);}function extractPort(_0x22ea94){const _0x2ebebd=_0xfb76c4;try{return new URL(_0x22ea94)[_0x2ebebd(0xc4)];}catch{return'';}}function sortObjectKeys(_0x1a1f84){const _0x598c82=_0xfb76c4,_0x510331={};for(const _0x52b454 of Object[_0x598c82(0xbe)](_0x1a1f84)[_0x598c82(0xca)]()){_0x510331[_0x52b454]=_0x1a1f84[_0x52b454];}return _0x510331;}function _0x5b43(_0x10a5df,_0x5f05af){_0x10a5df=_0x10a5df-0xbd;const _0x46cc28=_0x46cc();let _0x5b43ef=_0x46cc28[_0x10a5df];return _0x5b43ef;}export function getSessionCachePath(_0x112dd1,_0x41f200){const _0x2031fa=_0xfb76c4,_0x1a2912={'LVOVG':function(_0x263ed5,_0x4c8a31,_0xd4e9ca,_0x502464){return _0x263ed5(_0x4c8a31,_0xd4e9ca,_0x502464);}};return _0x1a2912[_0x2031fa(0xc3)](join,getRangerHomeDir(),_0x2031fa(0xdf),_0x112dd1+'-'+_0x41f200+_0x2031fa(0xd5));}export function getStorageStatePath(_0x1cbf4a){const _0x5c1eac=_0xfb76c4;return _0x1cbf4a[_0x5c1eac(0xc9)](/\.json$/,_0x5c1eac(0xe3));}export function needsTunnel(_0x1020b6){const _0x25f46f=_0xfb76c4,_0x3980ed={'fvpFE':function(_0x3d5e0a,_0x4a3f04){return _0x3d5e0a===_0x4a3f04;},'Favyo':'localhost'};let _0x23bda2;try{_0x23bda2=new URL(_0x1020b6)[_0x25f46f(0xcb)];}catch{return![];}if(_0x3980ed['fvpFE'](_0x23bda2,_0x3980ed[_0x25f46f(0xd6)])||_0x23bda2==='127.0.0.1')return!![];if(_0x23bda2['endsWith']('.localhost'))return!![];if(_0x23bda2['includes'](_0x25f46f(0xdd)))return!![];return![];}export function hostnameOf(_0x4c391e){const _0x417297=_0xfb76c4;return new URL(_0x4c391e)[_0x417297(0xcb)];}export function duplicateCookiesForDomains(_0x4281c7,_0xc5c501){const _0xc6d24e=_0xfb76c4,_0x5a588d={'zpaMt':function(_0x1c3920,_0x83151a){return _0x1c3920(_0x83151a);}},_0x571dc6=[..._0x4281c7],_0x3098a8=new Set(_0x4281c7['map'](_0x5254b9=>_0x5254b9['domain']));for(const _0x1a0d95 of _0xc5c501){let _0x24e584;try{_0x24e584=_0x5a588d['zpaMt'](hostnameOf,_0x1a0d95);}catch{continue;}if(!_0x24e584)continue;const _0x299a39=_0x24e584['startsWith']('.')?_0x24e584:'.'+_0x24e584;if(_0x3098a8['has'](_0x24e584)||_0x3098a8['has'](_0x299a39))continue;for(const _0x29097a of _0x4281c7){_0x571dc6['push']({..._0x29097a,'domain':_0x299a39});}_0x3098a8[_0xc6d24e(0xc7)](_0x299a39);}return _0x571dc6;}export function resolveAuthEnvironmentLocally(_0x27bdf5,_0x238af3){const _0x360084=_0xfb76c4,_0x20be98={'slVSl':function(_0x182829,_0x21f401){return _0x182829===_0x21f401;}},_0x17e0a2=_0x27bdf5['environments'];if(_0x238af3){const _0x427bbd=_0x17e0a2[_0x238af3];if(!_0x427bbd)return null;return{'key':_0x238af3,..._0x427bbd};}if(_0x27bdf5[_0x360084(0xdc)]){const _0x1c6071=_0x17e0a2[_0x27bdf5['defaultEnvironmentKey']];if(!_0x1c6071)return null;return{'key':_0x27bdf5['defaultEnvironmentKey'],..._0x1c6071};}const _0x249693=Object[_0x360084(0xbe)](_0x17e0a2);if(_0x20be98['slVSl'](_0x249693[_0x360084(0xe0)],0x1)){const _0x26d649=_0x249693[0x0];return{'key':_0x26d649,..._0x17e0a2[_0x26d649]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0xa0881c,_0x56f72a){try{if(_0x56f72a)return new URL(_0x56f72a,_0xa0881c)['toString']();return new URL(_0xa0881c)['toString']();}catch{return null;}}export function looksLikeLoginUrl(_0x3466d4){const _0x53ed0c=_0xfb76c4;try{const _0x260f54=new URL(_0x3466d4);return LOGIN_URL_PATTERN['test'](_0x260f54['pathname']);}catch{return LOGIN_URL_PATTERN[_0x53ed0c(0xce)](_0x3466d4);}}export async function isCachedSessionLive(_0x3276be,_0x5a1af2,_0x790f0a={},_0x9cdab5={}){const _0x234b5c=_0xfb76c4,_0x1274e1={'KDAtW':function(_0x14e8d5,_0x181bcf,_0x4efae3){return _0x14e8d5(_0x181bcf,_0x4efae3);},'uhzsu':function(_0x11d2c0,_0x28239c){return _0x11d2c0===_0x28239c;},'uSiDZ':function(_0x3a73b9,_0x5aa130){return _0x3a73b9===_0x5aa130;}},_0x5ba43f=_0x1274e1[_0x234b5c(0xdb)](buildSessionCheckUrl,_0x5a1af2,_0x790f0a['sessionCheckPath']);if(!_0x5ba43f)return!![];if(!_0x9cdab5[_0x234b5c(0xc2)])return!![];let _0x2d5b3c=null;try{_0x2d5b3c=await _0x9cdab5[_0x234b5c(0xc2)]();const _0x528e46=await _0x2d5b3c[_0x234b5c(0xd3)]({'storageState':_0x3276be,'ignoreHTTPSErrors':!![],..._0x790f0a['setupHeaders']?{'extraHTTPHeaders':_0x790f0a[_0x234b5c(0xc0)]}:{}}),_0x4e2316=await _0x528e46['newPage'](),_0x5f1ea1=await _0x4e2316['goto'](_0x5ba43f,{'waitUntil':'domcontentloaded','timeout':0x3a98}),_0x12a871=_0x5f1ea1?.['status']();if(_0x1274e1['uhzsu'](_0x12a871,0x191)||_0x1274e1[_0x234b5c(0xe1)](_0x12a871,0x193))return![];const _0x2b1d2a=_0x4e2316[_0x234b5c(0xd9)]();if(looksLikeLoginUrl(_0x2b1d2a))return![];return!![];}catch{return![];}finally{if(_0x2d5b3c)await _0x2d5b3c[_0x234b5c(0xc5)]()[_0x234b5c(0xc1)](()=>{});}}
1
+ const _0x1ab1e9=_0x455d;(function(_0x1a2beb,_0x206f45){const _0x201322=_0x455d,_0x286efb=_0x1a2beb();while(!![]){try{const _0x5dc01c=parseInt(_0x201322(0x11e))/0x1*(-parseInt(_0x201322(0x123))/0x2)+-parseInt(_0x201322(0x139))/0x3+-parseInt(_0x201322(0x135))/0x4+-parseInt(_0x201322(0x13e))/0x5*(parseInt(_0x201322(0x13c))/0x6)+-parseInt(_0x201322(0x137))/0x7+parseInt(_0x201322(0x13f))/0x8+parseInt(_0x201322(0x12c))/0x9;if(_0x5dc01c===_0x206f45)break;else _0x286efb['push'](_0x286efb['shift']());}catch(_0x235aa5){_0x286efb['push'](_0x286efb['shift']());}}}(_0x41ad,0x74a94));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x360cc7=process[_0x1ab1e9(0x131)],_0x4223f4={'stdin':process[_0x1ab1e9(0x12b)],'stdout':process[_0x1ab1e9(0x129)]}){const _0x4f30b2=_0x1ab1e9,_0x21da96={'cnpZz':function(_0x5a5e46,_0x370aa3){return _0x5a5e46(_0x370aa3);},'WASlG':function(_0x2df46d,_0x3aa486){return _0x2df46d(_0x3aa486);}};if(_0x360cc7['CI'])return![];return _0x21da96[_0x4f30b2(0x121)](Boolean,_0x4223f4[_0x4f30b2(0x12b)][_0x4f30b2(0x130)])&&_0x21da96['WASlG'](Boolean,_0x4223f4['stdout'][_0x4f30b2(0x130)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x4c21de){const _0x1c525e=_0x1ab1e9,_0x26554f={'GGfqi':_0x1c525e(0x122),'yKYQx':function(_0x33348e,_0x4c170c){return _0x33348e(_0x4c170c);},'vkXyl':function(_0x25dbed,_0x5b6a23){return _0x25dbed!==_0x5b6a23;},'HaLFI':function(_0x2475be,_0x21c994){return _0x2475be(_0x21c994);}},_0x218778=new Set(_0x4c21de['invalidateOn']??DEFAULT_INVALIDATE_ON),_0x1af816={'orgId':_0x4c21de[_0x1c525e(0x134)],'profileName':_0x4c21de['profileName']};return _0x218778['has']('baseUrl')&&(_0x1af816[_0x1c525e(0x11d)]=_0x4c21de[_0x1c525e(0x11d)]),_0x218778['has'](_0x26554f['GGfqi'])&&(_0x1af816[_0x1c525e(0x122)]=_0x4c21de['setupHeaders']?_0x26554f['yKYQx'](sortObjectKeys,_0x4c21de['setupHeaders']):_0x4c21de[_0x1c525e(0x122)]),_0x218778[_0x1c525e(0x11b)](_0x1c525e(0x12d))&&(_0x1af816[_0x1c525e(0x12d)]=_0x26554f['yKYQx'](extractPort,_0x4c21de['effectiveBaseUrl'])),_0x218778['has']('userAgent')&&_0x26554f['vkXyl'](_0x4c21de['userAgent'],undefined)&&(_0x1af816['userAgent']=_0x4c21de[_0x1c525e(0x146)]),_0x218778[_0x1c525e(0x11b)]('clientIp')&&_0x4c21de['clientIp']!==undefined&&(_0x1af816['clientIp']=_0x4c21de[_0x1c525e(0x126)]),_0x26554f['HaLFI'](createHash,'sha256')['update'](JSON['stringify'](_0x1af816))[_0x1c525e(0x133)]('hex')['slice'](0x0,0xc);}function extractPort(_0x26ef35){try{return new URL(_0x26ef35)['port'];}catch{return'';}}function sortObjectKeys(_0xac760){const _0x3d5d5f=_0x1ab1e9,_0x4a64f7={};for(const _0x22e704 of Object[_0x3d5d5f(0x138)](_0xac760)['sort']()){_0x4a64f7[_0x22e704]=_0xac760[_0x22e704];}return _0x4a64f7;}export function getSessionCachePath(_0x58dc00,_0x575f45){const _0x395cbe=_0x1ab1e9,_0x2604d5={'Gcfix':function(_0x576b90,_0x3c1c1e,_0x3e8d4c,_0x43a288){return _0x576b90(_0x3c1c1e,_0x3e8d4c,_0x43a288);},'MmScd':function(_0x539f8a){return _0x539f8a();}};return _0x2604d5['Gcfix'](join,_0x2604d5[_0x395cbe(0x142)](getRangerHomeDir),'auth',_0x58dc00+'-'+_0x575f45+_0x395cbe(0x11a));}function _0x455d(_0x37b999,_0x52d1be){_0x37b999=_0x37b999-0x119;const _0x41ad4e=_0x41ad();let _0x455df8=_0x41ad4e[_0x37b999];return _0x455df8;}export function getStorageStatePath(_0x2eac75){const _0x107d13=_0x1ab1e9,_0x55cef5={'xMaie':'.storageState.json'};return _0x2eac75[_0x107d13(0x132)](/\.json$/,_0x55cef5[_0x107d13(0x13a)]);}export function needsTunnel(_0x42b3f6){const _0xda2b5a=_0x1ab1e9,_0x3b8187={'Jnqwc':'localhost','anTnp':_0xda2b5a(0x12f),'dhOAN':_0xda2b5a(0x127)};let _0x547c40;try{_0x547c40=new URL(_0x42b3f6)[_0xda2b5a(0x119)];}catch{return![];}if(_0x547c40===_0x3b8187[_0xda2b5a(0x143)]||_0x547c40===_0x3b8187['anTnp'])return!![];if(_0x547c40['endsWith'](_0x3b8187['dhOAN']))return!![];if(_0x547c40[_0xda2b5a(0x13b)](_0xda2b5a(0x144)))return!![];return![];}export function hostnameOf(_0x46d188){return new URL(_0x46d188)['hostname'];}export function duplicateCookiesForDomains(_0x51e2b1,_0x1cc5b4){const _0x240556=_0x1ab1e9,_0x3c4656=[..._0x51e2b1],_0x5ad062=new Set(_0x51e2b1[_0x240556(0x145)](_0x1fa751=>_0x1fa751[_0x240556(0x11c)]));for(const _0x4c315e of _0x1cc5b4){let _0x114e26;try{_0x114e26=hostnameOf(_0x4c315e);}catch{continue;}if(!_0x114e26)continue;const _0x10edd0=_0x114e26['startsWith']('.')?_0x114e26:'.'+_0x114e26;if(_0x5ad062['has'](_0x114e26)||_0x5ad062['has'](_0x10edd0))continue;for(const _0x539d7d of _0x51e2b1){_0x3c4656['push']({..._0x539d7d,'domain':_0x10edd0});}_0x5ad062['add'](_0x10edd0);}return _0x3c4656;}export function resolveAuthEnvironmentLocally(_0x56cec1,_0x9e8c69){const _0x589afa=_0x1ab1e9,_0x3bf1c0={'nWCdd':function(_0x4ac2bc,_0x4d7291){return _0x4ac2bc===_0x4d7291;}},_0x2928e4=_0x56cec1['environments'];if(_0x9e8c69){const _0x356258=_0x2928e4[_0x9e8c69];if(!_0x356258)return null;return{'key':_0x9e8c69,..._0x356258};}if(_0x56cec1['defaultEnvironmentKey']){const _0x1d33b7=_0x2928e4[_0x56cec1['defaultEnvironmentKey']];if(!_0x1d33b7)return null;return{'key':_0x56cec1['defaultEnvironmentKey'],..._0x1d33b7};}const _0x45516a=Object[_0x589afa(0x138)](_0x2928e4);if(_0x3bf1c0[_0x589afa(0x140)](_0x45516a['length'],0x1)){const _0x12d925=_0x45516a[0x0];return{'key':_0x12d925,..._0x2928e4[_0x12d925]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x32bba0,_0x1d884d){const _0x16df18=_0x1ab1e9;try{if(_0x1d884d)return new URL(_0x1d884d,_0x32bba0)[_0x16df18(0x141)]();return new URL(_0x32bba0)['toString']();}catch{return null;}}function _0x41ad(){const _0x405fa8=['ZtcbC','catch','clientIp','.localhost','newContext','stdout','newPage','stdin','28466406fRfZNY','port','status','127.0.0.1','isTTY','env','replace','digest','orgId','1977924IEfFsc','close','1696072IyGVKC','keys','2299209nvXNfw','xMaie','includes','112242enRPop','dBuEz','245oITPUS','393592iORvHs','nWCdd','toString','MmScd','Jnqwc','localhost.','map','userAgent','hostname','.json','has','domain','effectiveBaseUrl','6xpAugp','JMebV','domcontentloaded','cnpZz','setupHeaders','104822binGlU'];_0x41ad=function(){return _0x405fa8;};return _0x41ad();}export function looksLikeLoginUrl(_0x207f53){try{const _0x3d3cb9=new URL(_0x207f53);return LOGIN_URL_PATTERN['test'](_0x3d3cb9['pathname']);}catch{return LOGIN_URL_PATTERN['test'](_0x207f53);}}export async function isCachedSessionLive(_0x17efe8,_0x5eb205,_0x267408={},_0x16ab22={}){const _0x49c3f2=_0x1ab1e9,_0x54dacb={'dBuEz':function(_0x44ca48,_0x3f517b,_0x2228c1){return _0x44ca48(_0x3f517b,_0x2228c1);},'ZtcbC':_0x49c3f2(0x120),'auMgv':function(_0xc052b9,_0x329bda){return _0xc052b9===_0x329bda;},'JMebV':function(_0x17191b,_0x373a0e){return _0x17191b(_0x373a0e);}},_0x5541ac=_0x54dacb[_0x49c3f2(0x13d)](buildSessionCheckUrl,_0x5eb205,_0x267408['sessionCheckPath']);if(!_0x5541ac)return!![];if(!_0x16ab22['launchBrowser'])return!![];let _0x65cf5=null;try{_0x65cf5=await _0x16ab22['launchBrowser']();const _0xbb2316=await _0x65cf5[_0x49c3f2(0x128)]({'storageState':_0x17efe8,'ignoreHTTPSErrors':!![],..._0x267408[_0x49c3f2(0x122)]?{'extraHTTPHeaders':_0x267408['setupHeaders']}:{}}),_0x288400=await _0xbb2316[_0x49c3f2(0x12a)](),_0x421075=await _0x288400['goto'](_0x5541ac,{'waitUntil':_0x54dacb[_0x49c3f2(0x124)],'timeout':0x3a98}),_0x141d67=_0x421075?.[_0x49c3f2(0x12e)]();if(_0x54dacb['auMgv'](_0x141d67,0x191)||_0x141d67===0x193)return![];const _0x3ef7bb=_0x288400['url']();if(_0x54dacb[_0x49c3f2(0x11f)](looksLikeLoginUrl,_0x3ef7bb))return![];return!![];}catch{return![];}finally{if(_0x65cf5)await _0x65cf5[_0x49c3f2(0x136)]()[_0x49c3f2(0x125)](()=>{});}}
@@ -1 +1 @@
1
- (function(_0x53c68a,_0x475a43){const _0x1bf040=_0x3c8d,_0x41ef21=_0x53c68a();while(!![]){try{const _0x480d1d=-parseInt(_0x1bf040(0x9a))/0x1*(-parseInt(_0x1bf040(0xa7))/0x2)+-parseInt(_0x1bf040(0xa5))/0x3+-parseInt(_0x1bf040(0x9c))/0x4*(-parseInt(_0x1bf040(0xa4))/0x5)+-parseInt(_0x1bf040(0x9f))/0x6+-parseInt(_0x1bf040(0xa1))/0x7+-parseInt(_0x1bf040(0xa3))/0x8+parseInt(_0x1bf040(0x9e))/0x9;if(_0x480d1d===_0x475a43)break;else _0x41ef21['push'](_0x41ef21['shift']());}catch(_0x3f85fa){_0x41ef21['push'](_0x41ef21['shift']());}}}(_0x2200,0x9184e));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0x3c8d(_0x17279a,_0x1f114b){_0x17279a=_0x17279a-0x99;const _0x220012=_0x2200();let _0x3c8db0=_0x220012[_0x17279a];return _0x3c8db0;}const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0x2200(){const _0x3a020b=['final','4nENTKx','subarray','Gcabz','468353dabViC','utf8','3084xhRTaa','MDSJX','13414509MoYjBE','5308128qIfxPW','sha256','5348287grpotm','concat','3633264YONZvf','4975XJriyC','1486257qRvuNw'];_0x2200=function(){return _0x3a020b;};return _0x2200();}export function deriveKey(_0x4f6230){const _0x1c7ac0=_0x3c8d,_0x1c793b={'tseLV':function(_0x4d3853,_0x17f57b,_0x3eaa46,_0x4ceee2,_0x4f7e64,_0x22f53c){return _0x4d3853(_0x17f57b,_0x3eaa46,_0x4ceee2,_0x4f7e64,_0x22f53c);}};return _0x1c793b['tseLV'](pbkdf2Sync,_0x4f6230,SALT,0x186a0,KEY_LENGTH,_0x1c7ac0(0xa0));}export function encrypt(_0x1c7fbf,_0x34a816){const _0x4862e1=_0x3c8d,_0x123055={'HQtAI':function(_0x15b21a,_0x2248ec){return _0x15b21a(_0x2248ec);},'jaYbV':function(_0x4fbc7e,_0x38233a){return _0x4fbc7e(_0x38233a);},'MDSJX':function(_0x7c8494,_0x52ec5f,_0x4f4ccc,_0x51e397){return _0x7c8494(_0x52ec5f,_0x4f4ccc,_0x51e397);}},_0x23c570=_0x123055['HQtAI'](deriveKey,_0x34a816),_0x3127f9=_0x123055['jaYbV'](randomBytes,IV_LENGTH),_0x5cb0ab=_0x123055[_0x4862e1(0x9d)](createCipheriv,ALGORITHM,_0x23c570,_0x3127f9),_0x441199=Buffer['concat']([_0x5cb0ab['update'](_0x1c7fbf,'utf8'),_0x5cb0ab['final']()]),_0x4e09b3=_0x5cb0ab['getAuthTag']();return Buffer[_0x4862e1(0xa2)]([_0x3127f9,_0x4e09b3,_0x441199]);}export function decrypt(_0x44795e,_0x580d1f){const _0x555383=_0x3c8d,_0x39b4ad={'SjKWl':function(_0x42feca,_0xf4c716){return _0x42feca(_0xf4c716);},'NoCCQ':function(_0x264a88,_0x663943,_0x2f0bc7,_0x4ec690){return _0x264a88(_0x663943,_0x2f0bc7,_0x4ec690);},'Gcabz':function(_0x2afac9,_0x2002b9){return _0x2afac9+_0x2002b9;}},_0x908529=_0x39b4ad['SjKWl'](deriveKey,_0x580d1f),_0x3abea5=_0x44795e['subarray'](0x0,IV_LENGTH),_0x28a423=_0x44795e['subarray'](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x1dc6ac=_0x44795e[_0x555383(0xa8)](IV_LENGTH+TAG_LENGTH),_0x518c35=_0x39b4ad['NoCCQ'](createDecipheriv,ALGORITHM,_0x908529,_0x3abea5);return _0x518c35['setAuthTag'](_0x28a423),_0x39b4ad[_0x555383(0x99)](_0x518c35['update'](_0x1dc6ac),_0x518c35[_0x555383(0xa6)](_0x555383(0x9b)));}
1
+ function _0x4c70(_0x156ef9,_0xccbe09){_0x156ef9=_0x156ef9-0xb3;const _0x2de220=_0x2de2();let _0x4c7000=_0x2de220[_0x156ef9];return _0x4c7000;}const _0x13d1cf=_0x4c70;(function(_0x4805d6,_0xddc1f6){const _0x17338e=_0x4c70,_0x5da877=_0x4805d6();while(!![]){try{const _0x53a09b=-parseInt(_0x17338e(0xb3))/0x1*(-parseInt(_0x17338e(0xbb))/0x2)+-parseInt(_0x17338e(0xbc))/0x3*(-parseInt(_0x17338e(0xb9))/0x4)+-parseInt(_0x17338e(0xb8))/0x5+parseInt(_0x17338e(0xbf))/0x6*(parseInt(_0x17338e(0xc6))/0x7)+parseInt(_0x17338e(0xb5))/0x8*(parseInt(_0x17338e(0xbd))/0x9)+-parseInt(_0x17338e(0xb4))/0xa*(parseInt(_0x17338e(0xc4))/0xb)+-parseInt(_0x17338e(0xc0))/0xc;if(_0x53a09b===_0xddc1f6)break;else _0x5da877['push'](_0x5da877['shift']());}catch(_0x1dd1f3){_0x5da877['push'](_0x5da877['shift']());}}}(_0x2de2,0xdbb80));function _0x2de2(){const _0x37db38=['NRVYH','4194625OMOIdu','1864dyUQTj','utf8','456728NRQNvn','10524XIeBux','9rWSwqv','setAuthTag','792PYvTdb','23659524yvirOi','concat','IsQtr','ranger-auth-encryption','982993HHlvLh','final','33537RYZqAX','4dfVymd','50uYqUnX','7813912rpvscj','GLRwc'];_0x2de2=function(){return _0x37db38;};return _0x2de2();}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT=_0x13d1cf(0xc3),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0xe6fabd){const _0x4a0395=_0x13d1cf,_0x3b2512={'GLRwc':function(_0x10b938,_0x35607f,_0xd6f5a0,_0x28cb65,_0x212824,_0x5a0d71){return _0x10b938(_0x35607f,_0xd6f5a0,_0x28cb65,_0x212824,_0x5a0d71);}};return _0x3b2512[_0x4a0395(0xb6)](pbkdf2Sync,_0xe6fabd,SALT,0x186a0,KEY_LENGTH,'sha256');}export function encrypt(_0x1729ee,_0x44b008){const _0xf973ce=_0x13d1cf,_0x539cd7={'IsQtr':function(_0xce5bc4,_0x20885c){return _0xce5bc4(_0x20885c);}},_0x1965f8=_0x539cd7[_0xf973ce(0xc2)](deriveKey,_0x44b008),_0xefb227=randomBytes(IV_LENGTH),_0x2c0218=createCipheriv(ALGORITHM,_0x1965f8,_0xefb227),_0x472c27=Buffer[_0xf973ce(0xc1)]([_0x2c0218['update'](_0x1729ee,'utf8'),_0x2c0218[_0xf973ce(0xc5)]()]),_0x375910=_0x2c0218['getAuthTag']();return Buffer[_0xf973ce(0xc1)]([_0xefb227,_0x375910,_0x472c27]);}export function decrypt(_0x9d83ee,_0x145e52){const _0x5d1e8a=_0x13d1cf,_0x324b22={'NRVYH':function(_0xec90e0,_0x1a4295){return _0xec90e0+_0x1a4295;},'TwXwS':function(_0xab1ba0,_0x160f44){return _0xab1ba0+_0x160f44;}},_0x1d2cd6=deriveKey(_0x145e52),_0x2f61b0=_0x9d83ee['subarray'](0x0,IV_LENGTH),_0x564b39=_0x9d83ee['subarray'](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x5c5739=_0x9d83ee['subarray'](_0x324b22[_0x5d1e8a(0xb7)](IV_LENGTH,TAG_LENGTH)),_0x5d1a4d=createDecipheriv(ALGORITHM,_0x1d2cd6,_0x2f61b0);return _0x5d1a4d[_0x5d1e8a(0xbe)](_0x564b39),_0x324b22['TwXwS'](_0x5d1a4d['update'](_0x5c5739),_0x5d1a4d[_0x5d1e8a(0xc5)](_0x5d1e8a(0xba)));}
@@ -1 +1 @@
1
- const _0x24bbb9=_0x5b68;function _0x5b68(_0x513ee8,_0x104190){_0x513ee8=_0x513ee8-0x69;const _0xc9234b=_0xc923();let _0x5b68b6=_0xc9234b[_0x513ee8];return _0x5b68b6;}function _0xc923(){const _0x34b6ec=['1323XPgBdA','1656yVlvNp','15495777rZXqNM','Unknown\x20argument','error','missing_required_argument','featureId','--credentials','--header','runtime_error','--pass','CXFsX','qapSV','8buJoBS','[desire-path]\x20Failed\x20to\x20send:\x20','--key','missing_option','--secret','/api/v1/mcp/desire-path-logs','1404474zCsPzu','12pbNgCg','Authorization','gPYZU','2904945nXEblj','12dYLRJb','[desire-path]\x20Sending\x20log\x20to\x20','push','isTTY','invalid_option_value','stringify','metadata','Not\x20enough\x20non-option\x20arguments','--authorization','13887SNJbvb','--cookie','DEBUG','[REDACTED]','has_token','ytull','application/json','includes','sYnec','MpqjW','8290gWDBbq','aTyKa','startsWith','=[REDACTED]','no_token','test','POST','env','some','--apikey','unknown','slice','bpLYS','Invalid\x20values','956445OlEIpm','6414hiuCGm','--token','has'];_0xc923=function(){return _0x34b6ec;};return _0xc923();}(function(_0x234010,_0x272646){const _0x2ae42a=_0x5b68,_0x18baf7=_0x234010();while(!![]){try{const _0x3dd05a=parseInt(_0x2ae42a(0x74))/0x1+parseInt(_0x2ae42a(0x8b))/0x2+parseInt(_0x2ae42a(0x75))/0x3*(-parseInt(_0x2ae42a(0x85))/0x4)+-parseInt(_0x2ae42a(0x8f))/0x5*(parseInt(_0x2ae42a(0x8c))/0x6)+-parseInt(_0x2ae42a(0x78))/0x7*(-parseInt(_0x2ae42a(0x79))/0x8)+-parseInt(_0x2ae42a(0x99))/0x9*(parseInt(_0x2ae42a(0xa3))/0xa)+-parseInt(_0x2ae42a(0x7a))/0xb*(-parseInt(_0x2ae42a(0x90))/0xc);if(_0x3dd05a===_0x272646)break;else _0x18baf7['push'](_0x18baf7['shift']());}catch(_0x15baf9){_0x18baf7['push'](_0x18baf7['shift']());}}}(_0xc923,0xa1677));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x24bbb9(0x76),'-t',_0x24bbb9(0x89),'--api-key',_0x24bbb9(0x6f),_0x24bbb9(0x87),'--password',_0x24bbb9(0x82),'--auth',_0x24bbb9(0x98),_0x24bbb9(0x80),_0x24bbb9(0x9a),_0x24bbb9(0x7f)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x1e9fae){const _0x3b3766=_0x24bbb9;return TOKEN_PATTERNS[_0x3b3766(0x6e)](_0x128802=>_0x128802[_0x3b3766(0x6b)](_0x1e9fae));}export function sanitizeArgs(_0x50eba8){const _0x4024c0=_0x24bbb9,_0x1fadd1={'CXFsX':function(_0x517c6a,_0x3a1e37){return _0x517c6a<_0x3a1e37;},'UbKvt':_0x4024c0(0x9c),'ytull':function(_0x1a9c0e,_0xcadcc7){return _0x1a9c0e!==_0xcadcc7;},'aTyKa':function(_0x1bbca6,_0x14e415){return _0x1bbca6(_0x14e415);}},_0x36bf22=[];let _0x4981cc=![];for(let _0x209f66=0x0;_0x1fadd1[_0x4024c0(0x83)](_0x209f66,_0x50eba8['length']);_0x209f66++){const _0xed4b94=_0x50eba8[_0x209f66];if(_0x4981cc){_0x36bf22[_0x4024c0(0x92)](_0x1fadd1['UbKvt']),_0x4981cc=![];continue;}if(_0xed4b94[_0x4024c0(0xa5)]('--')||_0xed4b94['startsWith']('-')){const _0x1df0c3=_0xed4b94['indexOf']('=');if(_0x1fadd1[_0x4024c0(0x9e)](_0x1df0c3,-0x1)){const _0x49cd72=_0xed4b94[_0x4024c0(0x71)](0x0,_0x1df0c3)['toLowerCase']();if(SENSITIVE_FLAGS[_0x4024c0(0x77)](_0x49cd72)){_0x36bf22['push'](_0xed4b94[_0x4024c0(0x71)](0x0,_0x1df0c3)+_0x4024c0(0x69));continue;}}else{const _0x159656=_0xed4b94['toLowerCase']();SENSITIVE_FLAGS[_0x4024c0(0x77)](_0x159656)&&(_0x4981cc=!![]);}_0x36bf22[_0x4024c0(0x92)](_0xed4b94);}else _0x1fadd1[_0x4024c0(0xa4)](looksLikeToken,_0xed4b94)?_0x36bf22['push']('[REDACTED]'):_0x36bf22['push'](_0xed4b94);}return _0x36bf22['join']('\x20');}export async function logDesirePath(_0xf2b877){const _0x530f04=_0x24bbb9,_0x31abd7={'RIfTo':_0x530f04(0x9d),'DcZGL':_0x530f04(0x6a),'gPYZU':_0x530f04(0x8d),'bpLYS':_0x530f04(0x6c)};try{const _0x1b4963=await getToken()['catch'](()=>null),_0x3b6f3f=getApiBaseUrl(),_0x48318e=getCurrentVersion(),_0x53ab13=_0x1b4963?_0x31abd7['RIfTo']:_0x31abd7['DcZGL'],_0x24fa91={..._0xf2b877[_0x530f04(0x96)],'authStatus':_0x53ab13,'isTty':process['stdout'][_0x530f04(0x93)]??![]},_0x2e7172={'Content-Type':_0x530f04(0x9f)};_0x1b4963&&(_0x2e7172[_0x31abd7[_0x530f04(0x8e)]]='Bearer\x20'+_0x1b4963);const _0xbe3ddc={'rawCommand':_0xf2b877['rawCommand'],'errorMessage':_0xf2b877['errorMessage'],'errorType':_0xf2b877['errorType'],'featureId':_0xf2b877[_0x530f04(0x7e)],'sessionId':_0xf2b877['sessionId'],'metadata':_0x24fa91,'cliVersion':_0x48318e};process['env']['DEBUG']&&(console['error'](_0x530f04(0x91)+_0x3b6f3f+_0x530f04(0x8a)),console[_0x530f04(0x7c)]('[desire-path]\x20Payload:\x20'+JSON['stringify'](_0xbe3ddc,null,0x2))),await fetch(_0x3b6f3f+'/api/v1/mcp/desire-path-logs',{'method':_0x31abd7[_0x530f04(0x72)],'headers':_0x2e7172,'body':JSON[_0x530f04(0x95)](_0xbe3ddc)});}catch(_0x13077e){process[_0x530f04(0x6d)][_0x530f04(0x9b)]&&console['error'](_0x530f04(0x86)+_0x13077e);}}export function getErrorType(_0x2a82a4,_0x2d1831){const _0x64b8bb=_0x24bbb9,_0x16c0da={'qapSV':_0x64b8bb(0x81),'sYnec':_0x64b8bb(0x7b),'sdfng':_0x64b8bb(0x73),'uRGHl':'Missing\x20required\x20argument','MpqjW':_0x64b8bb(0x88)};if(_0x2d1831)return _0x16c0da[_0x64b8bb(0x84)];if(!_0x2a82a4)return _0x64b8bb(0x70);if(_0x2a82a4['includes']('Unknown\x20command'))return'unknown_command';if(_0x2a82a4[_0x64b8bb(0xa0)](_0x16c0da[_0x64b8bb(0xa1)]))return'unknown_argument';if(_0x2a82a4['includes'](_0x64b8bb(0x97)))return _0x64b8bb(0x7d);if(_0x2a82a4['includes'](_0x16c0da['sdfng']))return _0x64b8bb(0x94);if(_0x2a82a4['includes'](_0x16c0da['uRGHl']))return _0x16c0da[_0x64b8bb(0xa2)];return'syntax_error';}
1
+ const _0x1d5de0=_0x4743;(function(_0x51805d,_0x4b3669){const _0x24d3c8=_0x4743,_0x1f572f=_0x51805d();while(!![]){try{const _0x5aa3cd=parseInt(_0x24d3c8(0x1ed))/0x1+-parseInt(_0x24d3c8(0x1fd))/0x2*(-parseInt(_0x24d3c8(0x208))/0x3)+parseInt(_0x24d3c8(0x216))/0x4*(-parseInt(_0x24d3c8(0x20f))/0x5)+-parseInt(_0x24d3c8(0x210))/0x6*(-parseInt(_0x24d3c8(0x1ee))/0x7)+parseInt(_0x24d3c8(0x20e))/0x8*(parseInt(_0x24d3c8(0x200))/0x9)+parseInt(_0x24d3c8(0x1fe))/0xa+-parseInt(_0x24d3c8(0x1ea))/0xb;if(_0x5aa3cd===_0x4b3669)break;else _0x1f572f['push'](_0x1f572f['shift']());}catch(_0x349bc9){_0x1f572f['push'](_0x1f572f['shift']());}}}(_0x26bb,0x68704));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t',_0x1d5de0(0x1eb),_0x1d5de0(0x206),_0x1d5de0(0x1fc),_0x1d5de0(0x20b),_0x1d5de0(0x1e6),_0x1d5de0(0x1f9),_0x1d5de0(0x1f3),'--authorization','--header','--cookie',_0x1d5de0(0x20c)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x2e4085){const _0x51b36f=_0x1d5de0;return TOKEN_PATTERNS['some'](_0x782429=>_0x782429[_0x51b36f(0x1e8)](_0x2e4085));}export function sanitizeArgs(_0x516e26){const _0x1e0c11=_0x1d5de0,_0x49bbf6={'KATun':function(_0x3d9c11,_0x423c13){return _0x3d9c11<_0x423c13;},'kyogc':function(_0x442e03,_0x2909a7){return _0x442e03!==_0x2909a7;}},_0x41cbd9=[];let _0x171090=![];for(let _0x56d3cc=0x0;_0x49bbf6['KATun'](_0x56d3cc,_0x516e26[_0x1e0c11(0x213)]);_0x56d3cc++){const _0x397a8e=_0x516e26[_0x56d3cc];if(_0x171090){_0x41cbd9[_0x1e0c11(0x1f0)](_0x1e0c11(0x215)),_0x171090=![];continue;}if(_0x397a8e['startsWith']('--')||_0x397a8e['startsWith']('-')){const _0x65dc92=_0x397a8e[_0x1e0c11(0x201)]('=');if(_0x49bbf6['kyogc'](_0x65dc92,-0x1)){const _0x4336ae=_0x397a8e['slice'](0x0,_0x65dc92)['toLowerCase']();if(SENSITIVE_FLAGS['has'](_0x4336ae)){_0x41cbd9['push'](_0x397a8e['slice'](0x0,_0x65dc92)+_0x1e0c11(0x217));continue;}}else{const _0x2b36da=_0x397a8e[_0x1e0c11(0x1ec)]();SENSITIVE_FLAGS[_0x1e0c11(0x203)](_0x2b36da)&&(_0x171090=!![]);}_0x41cbd9['push'](_0x397a8e);}else looksLikeToken(_0x397a8e)?_0x41cbd9['push']('[REDACTED]'):_0x41cbd9[_0x1e0c11(0x1f0)](_0x397a8e);}return _0x41cbd9['join']('\x20');}function _0x26bb(){const _0x554450=['--pass','stdout','stringify','--apikey','62fOlxDb','3083950cIswIt','includes','2132478jPYkei','indexOf','invalid_option_value','has','[desire-path]\x20Payload:\x20','Invalid\x20values','--api-key','caGkI','21183wTinwx','sYdeh','no_token','--key','--credentials','[desire-path]\x20Sending\x20log\x20to\x20','24afJhaH','35ukcxVX','3012LTiQRi','error','sessionId','length','cvVbS','[REDACTED]','461884Lqafyi','=[REDACTED]','POST','PTOOV','gLvSk','--password','env','test','Unknown\x20command','5462655furSQq','--secret','toLowerCase','458928HHkMLR','497nZtMYz','Bearer\x20','push','Not\x20enough\x20non-option\x20arguments','catch','--auth','featureId','application/json','DEBUG','runtime_error','has_token'];_0x26bb=function(){return _0x554450;};return _0x26bb();}function _0x4743(_0x448ff9,_0x267437){_0x448ff9=_0x448ff9-0x1e3;const _0x26bb57=_0x26bb();let _0x474358=_0x26bb57[_0x448ff9];return _0x474358;}export async function logDesirePath(_0x4ada24){const _0x27e43a=_0x1d5de0,_0x58316d={'caGkI':function(_0x150999){return _0x150999();},'gLvSk':_0x27e43a(0x20a),'cvVbS':_0x27e43a(0x1f5)};try{const _0x3f0f95=await _0x58316d['caGkI'](getToken)[_0x27e43a(0x1f2)](()=>null),_0x51209d=_0x58316d[_0x27e43a(0x207)](getApiBaseUrl),_0x269d69=_0x58316d['caGkI'](getCurrentVersion),_0x26d80f=_0x3f0f95?_0x27e43a(0x1f8):_0x58316d[_0x27e43a(0x1e5)],_0x4edc6f={..._0x4ada24['metadata'],'authStatus':_0x26d80f,'isTty':process[_0x27e43a(0x1fa)]['isTTY']??![]},_0x23d677={'Content-Type':_0x58316d[_0x27e43a(0x214)]};_0x3f0f95&&(_0x23d677['Authorization']=_0x27e43a(0x1ef)+_0x3f0f95);const _0x11a107={'rawCommand':_0x4ada24['rawCommand'],'errorMessage':_0x4ada24['errorMessage'],'errorType':_0x4ada24['errorType'],'featureId':_0x4ada24[_0x27e43a(0x1f4)],'sessionId':_0x4ada24[_0x27e43a(0x212)],'metadata':_0x4edc6f,'cliVersion':_0x269d69};process[_0x27e43a(0x1e7)][_0x27e43a(0x1f6)]&&(console[_0x27e43a(0x211)](_0x27e43a(0x20d)+_0x51209d+'/api/v1/mcp/desire-path-logs'),console['error'](_0x27e43a(0x204)+JSON['stringify'](_0x11a107,null,0x2))),await fetch(_0x51209d+'/api/v1/mcp/desire-path-logs',{'method':_0x27e43a(0x1e3),'headers':_0x23d677,'body':JSON[_0x27e43a(0x1fb)](_0x11a107)});}catch(_0x17f24e){process[_0x27e43a(0x1e7)][_0x27e43a(0x1f6)]&&console[_0x27e43a(0x211)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x17f24e);}}export function getErrorType(_0x287fcc,_0x235785){const _0x3f7f40=_0x1d5de0,_0x3b6468={'PTOOV':'4|1|2|5|6|3|7|0','owRsO':'syntax_error','iDaiU':'unknown','XWjTz':_0x3f7f40(0x1e9),'TArZc':_0x3f7f40(0x205),'VKLwQ':_0x3f7f40(0x202),'ouvkj':_0x3f7f40(0x1f7),'DrSbH':'Unknown\x20argument','sYdeh':'unknown_argument'},_0x221dcc=_0x3b6468[_0x3f7f40(0x1e4)]['split']('|');let _0x4c6f07=0x0;while(!![]){switch(_0x221dcc[_0x4c6f07++]){case'0':return _0x3b6468['owRsO'];case'1':if(!_0x287fcc)return _0x3b6468['iDaiU'];continue;case'2':if(_0x287fcc['includes'](_0x3b6468['XWjTz']))return'unknown_command';continue;case'3':if(_0x287fcc['includes'](_0x3b6468['TArZc']))return _0x3b6468['VKLwQ'];continue;case'4':if(_0x235785)return _0x3b6468['ouvkj'];continue;case'5':if(_0x287fcc[_0x3f7f40(0x1ff)](_0x3b6468['DrSbH']))return _0x3b6468[_0x3f7f40(0x209)];continue;case'6':if(_0x287fcc['includes'](_0x3f7f40(0x1f1)))return'missing_required_argument';continue;case'7':if(_0x287fcc[_0x3f7f40(0x1ff)]('Missing\x20required\x20argument'))return'missing_option';continue;}break;}}
@@ -1 +1 @@
1
- const _0x37ffa5=_0x3966;(function(_0x1c629e,_0x57f3b8){const _0x4274ba=_0x3966,_0x2fc414=_0x1c629e();while(!![]){try{const _0x166245=parseInt(_0x4274ba(0x1b0))/0x1*(parseInt(_0x4274ba(0x1bc))/0x2)+parseInt(_0x4274ba(0x1ac))/0x3+-parseInt(_0x4274ba(0x1af))/0x4*(-parseInt(_0x4274ba(0x1ae))/0x5)+-parseInt(_0x4274ba(0x1c6))/0x6*(parseInt(_0x4274ba(0x1a7))/0x7)+-parseInt(_0x4274ba(0x1dd))/0x8+parseInt(_0x4274ba(0x1c4))/0x9*(parseInt(_0x4274ba(0x1d6))/0xa)+parseInt(_0x4274ba(0x1cd))/0xb;if(_0x166245===_0x57f3b8)break;else _0x2fc414['push'](_0x2fc414['shift']());}catch(_0x2e705a){_0x2fc414['push'](_0x2fc414['shift']());}}}(_0x33c4,0x66eb0));import{spawn}from'child_process';import _0x4a770f 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=_0x37ffa5(0x1bf);export async function requestDeviceCode(_0x47f5e){const _0x5c182b=_0x37ffa5,_0x911c85={'hNYHH':'POST'},_0x1922c6=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x911c85[_0x5c182b(0x196)],'headers':{'Content-Type':_0x5c182b(0x18f)},'body':new URLSearchParams({'client_id':_0x47f5e})});if(!_0x1922c6['ok']){const _0x2c8b6f=await _0x1922c6['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x1922c6['status']+'\x20'+_0x2c8b6f);}return _0x1922c6[_0x5c182b(0x1d4)]();}export async function pollForTokens(_0xf14de1,_0x373f79,_0x5e599e,_0x2c9425){const _0x20d8ca=_0x37ffa5,_0x6e5418={'czpgy':function(_0x1d3a5e,_0x17374a){return _0x1d3a5e<_0x17374a;},'KTyjq':function(_0x16c073,_0x57b670,_0x372d42){return _0x16c073(_0x57b670,_0x372d42);},'rZBJN':'POST','JXWTs':'authorization_pending','CXwDH':function(_0x43170e,_0x3bc7f9){return _0x43170e===_0x3bc7f9;},'cCnLo':_0x20d8ca(0x19b),'mHDPN':'Device\x20authorization\x20timed\x20out'},_0x589f9a=Date[_0x20d8ca(0x19d)]()+_0x2c9425*0x3e8;let _0x1df2a2=_0x5e599e*0x3e8;while(_0x6e5418['czpgy'](Date[_0x20d8ca(0x19d)](),_0x589f9a)){await sleep(_0x1df2a2);const _0xa2db0b=await _0x6e5418[_0x20d8ca(0x1be)](fetch,WORKOS_TOKEN_URL,{'method':_0x6e5418['rZBJN'],'headers':{'Content-Type':_0x20d8ca(0x18f)},'body':new URLSearchParams({'client_id':_0xf14de1,'device_code':_0x373f79,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0xa2db0b['ok'])return _0xa2db0b[_0x20d8ca(0x1d4)]();const _0x1cda44=await _0xa2db0b[_0x20d8ca(0x1d4)]();if(_0x1cda44[_0x20d8ca(0x195)]===_0x6e5418[_0x20d8ca(0x19f)])continue;if(_0x6e5418[_0x20d8ca(0x1a3)](_0x1cda44[_0x20d8ca(0x195)],_0x6e5418['cCnLo'])){_0x1df2a2+=0x3e8;continue;}throw new Error(_0x1cda44['error_description']||_0x1cda44['error']||'Authentication\x20failed');}throw new Error(_0x6e5418[_0x20d8ca(0x1cf)]);}async function fetchUserProfile(_0x1f7b5d){const _0x348109=_0x37ffa5,_0x53e8a7={'qHWMr':'GET'},_0x327ad4=getApiBaseUrl();try{const _0x310d7e=await fetch(_0x327ad4+_0x348109(0x1e3),{'method':_0x53e8a7[_0x348109(0x1e1)],'headers':{'workos-token':_0x1f7b5d}});if(_0x310d7e['ok'])return _0x310d7e[_0x348109(0x1d4)]();}catch{}return null;}function buildKeyName(_0x2f6e31,_0x3c136e){const _0x1d1a0f=_0x37ffa5,_0x41758d={'rUMee':function(_0x25954c,_0x21abb0){return _0x25954c===_0x21abb0;}},_0x3fef5d=_0x3c136e['filter'](_0x440b30=>_0x440b30[_0x1d1a0f(0x1cb)]===_0x2f6e31||_0x440b30[_0x1d1a0f(0x1cb)]['startsWith'](_0x2f6e31+'\x20('));if(_0x41758d[_0x1d1a0f(0x1e6)](_0x3fef5d['length'],0x0))return _0x2f6e31;return _0x2f6e31+'\x20('+(_0x3fef5d['length']+0x1)+')';}export async function provisionApiKey(_0x40bd5f){const _0x3f2a7b=_0x37ffa5,_0x4c0a19={'CvXMM':function(_0xbab9ba){return _0xbab9ba();},'IEUpI':_0x3f2a7b(0x1b8),'enVNZ':function(_0xabc4ab,_0x2c779f){return _0xabc4ab(_0x2c779f);},'ytYps':function(_0x1f6690,_0x1efa98,_0x22ebd8){return _0x1f6690(_0x1efa98,_0x22ebd8);},'uBpMh':_0x3f2a7b(0x1c9)},_0x18d6b7=_0x4c0a19['CvXMM'](getApiBaseUrl),_0x1a711b={'Content-Type':_0x4c0a19['IEUpI'],'workos-token':_0x40bd5f},_0x520711=await _0x4c0a19[_0x3f2a7b(0x1ca)](fetchUserProfile,_0x40bd5f),_0x4ca189=_0x520711?.[_0x3f2a7b(0x1cc)]||_0x520711?.[_0x3f2a7b(0x190)]?.['split']('@')[0x0],_0x4fdf29=_0x4ca189?_0x4ca189+_0x3f2a7b(0x1ad):'CLI\x20Key';let _0x3ca531=[];try{const _0x4d07ac=await _0x4c0a19[_0x3f2a7b(0x1b6)](fetch,_0x18d6b7+'/api-keys',{'method':'GET','headers':_0x1a711b});if(_0x4d07ac['ok']){const _0x35afcd=await _0x4d07ac['json']();_0x3ca531=_0x35afcd[_0x3f2a7b(0x1ce)];}}catch{}const _0x509d88=buildKeyName(_0x4fdf29,_0x3ca531),_0x55380d=await _0x4c0a19[_0x3f2a7b(0x1b6)](fetch,_0x18d6b7+'/api-keys',{'method':_0x4c0a19[_0x3f2a7b(0x1a0)],'headers':_0x1a711b,'body':JSON['stringify']({'name':_0x509d88,'scope':_0x3f2a7b(0x1c5)})});if(!_0x55380d['ok']){const _0x366443=await _0x55380d['text']();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x55380d['status']+'\x20'+_0x366443);}const _0x155bbe=await _0x55380d['json']();return _0x155bbe[_0x3f2a7b(0x1e8)]['token'];}export function openBrowser(_0x2ec5cc){const _0xc5a93b=_0x37ffa5,_0x54ed7d={'bKZmq':_0xc5a93b(0x1a4),'RMGWL':_0xc5a93b(0x1e7),'sldgn':'open'};try{if(process[_0xc5a93b(0x1a2)]==='win32'){const _0x394f1f=spawn(_0xc5a93b(0x194),['/c',_0x54ed7d[_0xc5a93b(0x1d1)],'',_0x2ec5cc],{'detached':!![],'stdio':_0xc5a93b(0x198),'windowsHide':!![]});_0x394f1f[_0xc5a93b(0x1d5)]();return;}const _0x3d6667=process[_0xc5a93b(0x1a2)]===_0x54ed7d[_0xc5a93b(0x1a5)]?_0x54ed7d[_0xc5a93b(0x1d2)]:'xdg-open',_0x2d89d1=spawn(_0x3d6667,[_0x2ec5cc],{'detached':!![],'stdio':'ignore'});_0x2d89d1[_0xc5a93b(0x1d5)]();}catch{}}function _0x33c4(){const _0x22197c=['list','cmd','error','hNYHH','xsGwo','ignore','Digzj','Using\x20organization:\x20','slow_down','/cli-auth/token','now','/organization/self-serve-signup','JXWTs','uBpMh','pLFPd','platform','CXwDH','start','RMGWL','zXwgb','7tpbzqa','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','WKCmR','org_id','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','1295172OVUQbC','\x27s\x20CLI\x20Key','607345VYgXJc','4Qukfvr','17233QwpoKE','XYxRU','length','isTTY','bWZBs','Failed\x20to\x20create\x20organization:\x20','ytYps','user_code','application/json','EQmXS','organizationId','fLAxg','42MreXre','Invalid\x20JWT\x20format','KTyjq','https://api.workos.com/user_management/authenticate','Select\x20an\x20organization:','write','Code:\x20','/organization/my-memberships','82269iulxzn','mcp:write','4077180anzNtC','stdout','Failed\x20to\x20provision\x20CLI\x20token:\x20','POST','enVNZ','name','firstName','2278430CdJIKf','apiKeys','mHDPN','split','bKZmq','sldgn','MPmpg','json','unref','490xckXqp','Setting\x20up\x20your\x20organization...','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','toString','device_code','Waiting\x20for\x20authentication...','wdTlp','3752344MKNQzx','map','log','access_token','qHWMr','ufVge','/organization/me','base64url','text','rUMee','darwin','apiKey','application/x-www-form-urlencoded','email','status','token'];_0x33c4=function(){return _0x22197c;};return _0x33c4();}function decodeJwtPayload(_0x48c130){const _0xdfefd2=_0x37ffa5,_0x3396fe={'TRJzQ':_0xdfefd2(0x1bd),'xsGwo':_0xdfefd2(0x1e4),'cqQBv':'utf-8'},_0x559f11=_0x48c130[_0xdfefd2(0x1d0)]('.');if(_0x559f11[_0xdfefd2(0x1b2)]!==0x3)throw new Error(_0x3396fe['TRJzQ']);const _0x1e3420=Buffer['from'](_0x559f11[0x1],_0x3396fe[_0xdfefd2(0x197)])[_0xdfefd2(0x1d9)](_0x3396fe['cqQBv']);return JSON['parse'](_0x1e3420);}function _0x3966(_0x26be31,_0x54253e){_0x26be31=_0x26be31-0x18f;const _0x33c4e5=_0x33c4();let _0x396611=_0x33c4e5[_0x26be31];return _0x396611;}async function selfServeSignup(_0x249204){const _0x2ce64b=_0x37ffa5,_0x26dadc={'fLAxg':'POST'},_0x34da7e=getApiBaseUrl(),_0x1cf316=await fetch(_0x34da7e+_0x2ce64b(0x19e),{'method':_0x26dadc[_0x2ce64b(0x1bb)],'headers':{'Content-Type':_0x2ce64b(0x1b8),'workos-token':_0x249204}});if(!_0x1cf316['ok']){const _0x1a4bac=await _0x1cf316[_0x2ce64b(0x1e5)]();throw new Error(_0x2ce64b(0x1b5)+_0x1cf316['status']+'\x20'+_0x1a4bac);}return _0x1cf316[_0x2ce64b(0x1d4)]();}async function fetchMyMemberships(_0x2efb6a){const _0x110eee=_0x37ffa5,_0x4f9b1a={'MDWdA':function(_0x586317,_0x2ce2d3,_0x1f2da2){return _0x586317(_0x2ce2d3,_0x1f2da2);},'wdTlp':'GET'},_0x2dbd10=getApiBaseUrl(),_0x4b1645=await _0x4f9b1a['MDWdA'](fetch,_0x2dbd10+_0x110eee(0x1c3),{'method':_0x4f9b1a[_0x110eee(0x1dc)],'headers':{'workos-token':_0x2efb6a}});if(!_0x4b1645['ok']){const _0x41621c=await _0x4b1645['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x4b1645[_0x110eee(0x191)]+'\x20'+_0x41621c);}const _0x242778=await _0x4b1645['json']();return _0x242778['memberships'];}async function refreshTokenWithOrg(_0x2511f3,_0x477826,_0x272c7f){const _0x35e7bb=_0x37ffa5,_0x30296b={'TCvWL':function(_0x146c95,_0xdb4a83,_0x8ebfdd){return _0x146c95(_0xdb4a83,_0x8ebfdd);},'zXwgb':_0x35e7bb(0x1c9)},_0xf7286a=await _0x30296b['TCvWL'](fetch,WORKOS_TOKEN_URL,{'method':_0x30296b[_0x35e7bb(0x1a6)],'headers':{'Content-Type':_0x35e7bb(0x18f)},'body':new URLSearchParams({'client_id':_0x2511f3,'grant_type':'refresh_token','refresh_token':_0x477826,'organization_id':_0x272c7f})});if(!_0xf7286a['ok']){const _0x432b7b=await _0xf7286a['text']();throw new Error(_0x35e7bb(0x1d8)+_0xf7286a[_0x35e7bb(0x191)]+'\x20'+_0x432b7b);}return _0xf7286a['json']();}async function provisionCliToken(_0x37d435){const _0xd74130=_0x37ffa5,_0x1243ef={'bWZBs':function(_0x1bed05,_0x2d4e3d,_0x6389ac){return _0x1bed05(_0x2d4e3d,_0x6389ac);},'pLFPd':_0xd74130(0x1c9)},_0x637fa9=getApiBaseUrl(),_0x1ae829=await _0x1243ef[_0xd74130(0x1b4)](fetch,_0x637fa9+_0xd74130(0x19c),{'method':_0x1243ef[_0xd74130(0x1a1)],'headers':{'Content-Type':_0xd74130(0x1b8),'workos-token':_0x37d435}});if(!_0x1ae829['ok']){const _0x19b4bc=await _0x1ae829['text']();throw new Error(_0xd74130(0x1c8)+_0x1ae829[_0xd74130(0x191)]+'\x20'+_0x19b4bc);}return _0x1ae829['json']();}export async function runDeviceAuthFlow(){const _0x452587=_0x37ffa5,_0x35de7c={'XYxRU':function(_0x4fdf44,_0x751ad5){return _0x4fdf44(_0x751ad5);},'EQmXS':_0x452587(0x1ab),'Digzj':_0x452587(0x1a8),'MPmpg':function(_0x2851d9,_0x76689d){return _0x2851d9===_0x76689d;},'ufVge':_0x452587(0x1d7),'GsSJg':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','STROv':_0x452587(0x193),'WKCmR':'Provisioning\x20CLI\x20token...'},_0x4bf7ab=getCurrentEnvironment(),_0x565060=ENVIRONMENT_CONFIGS[_0x4bf7ab]['workosClientId'],_0x4f7277=await _0x35de7c[_0x452587(0x1b1)](requestDeviceCode,_0x565060);console['log'](_0x35de7c[_0x452587(0x1b9)]),console['log'](_0x35de7c[_0x452587(0x199)]),openBrowser(_0x4f7277['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x4f7277['verification_uri_complete']),console['log'](_0x452587(0x1c2)+_0x4f7277[_0x452587(0x1b7)]+'\x0a'),process[_0x452587(0x1c7)]['write'](_0x452587(0x1db));let _0x1d0e21=await pollForTokens(_0x565060,_0x4f7277[_0x452587(0x1da)],_0x4f7277['interval'],_0x4f7277['expires_in']);console['log']('\x20✓');const _0x40ae23=_0x35de7c[_0x452587(0x1b1)](decodeJwtPayload,_0x1d0e21[_0x452587(0x1e0)]);if(!_0x40ae23[_0x452587(0x1aa)]){const _0x3e159d=await fetchMyMemberships(_0x1d0e21['access_token']);let _0x50f4ef;if(_0x35de7c[_0x452587(0x1d3)](_0x3e159d['length'],0x0)){process[_0x452587(0x1c7)][_0x452587(0x1c1)](_0x35de7c[_0x452587(0x1e2)]);const _0x2a3919=await _0x35de7c[_0x452587(0x1b1)](selfServeSignup,_0x1d0e21['access_token']);_0x50f4ef=_0x2a3919['organizationId'],console[_0x452587(0x1df)]('\x20✓');}else{if(_0x3e159d[_0x452587(0x1b2)]===0x1)_0x50f4ef=_0x3e159d[0x0][_0x452587(0x1ba)],console[_0x452587(0x1df)](_0x452587(0x19a)+_0x3e159d[0x0]['name']);else{const _0xa0440d=process['stdin'][_0x452587(0x1b3)]&&process['stdout']['isTTY'];if(!_0xa0440d)throw new Error('Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a'+_0x35de7c['GsSJg']);const {selected:_0x43c907}=await _0x4a770f['prompt']([{'type':_0x35de7c['STROv'],'name':'selected','message':_0x452587(0x1c0),'choices':_0x3e159d[_0x452587(0x1de)](_0x4b11a3=>({'name':_0x4b11a3[_0x452587(0x1cb)],'value':_0x4b11a3['organizationId']}))}]);_0x50f4ef=_0x43c907;}}_0x1d0e21=await refreshTokenWithOrg(_0x565060,_0x1d0e21['refresh_token'],_0x50f4ef);}process[_0x452587(0x1c7)][_0x452587(0x1c1)](_0x35de7c[_0x452587(0x1a9)]);const _0x18832=await provisionCliToken(_0x1d0e21[_0x452587(0x1e0)]);return console['log']('\x20✓'),await _0x35de7c['XYxRU'](storeToken,_0x18832[_0x452587(0x192)]),_0x1d0e21['refresh_token']&&await storeRefreshToken(_0x1d0e21['refresh_token']),_0x18832[_0x452587(0x192)];}function sleep(_0xcb4b86){return new Promise(_0x4a516c=>setTimeout(_0x4a516c,_0xcb4b86));}
1
+ const _0x3c3172=_0x2d4d;(function(_0x1fe4cd,_0x553429){const _0x196fa3=_0x2d4d,_0x15b5a2=_0x1fe4cd();while(!![]){try{const _0x2cf60c=-parseInt(_0x196fa3(0xb5))/0x1+parseInt(_0x196fa3(0xf1))/0x2+parseInt(_0x196fa3(0xf5))/0x3+parseInt(_0x196fa3(0xfd))/0x4*(-parseInt(_0x196fa3(0xc5))/0x5)+-parseInt(_0x196fa3(0xd6))/0x6+parseInt(_0x196fa3(0xdf))/0x7+parseInt(_0x196fa3(0xd7))/0x8*(parseInt(_0x196fa3(0xb4))/0x9);if(_0x2cf60c===_0x553429)break;else _0x15b5a2['push'](_0x15b5a2['shift']());}catch(_0x4491cc){_0x15b5a2['push'](_0x15b5a2['shift']());}}}(_0x432e,0x99cde));import{spawn}from'child_process';function _0x2d4d(_0x4d1012,_0x1b678c){_0x4d1012=_0x4d1012-0xb2;const _0x432eca=_0x432e();let _0x2d4df3=_0x432eca[_0x4d1012];return _0x2d4df3;}import _0x1f87d5 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=_0x3c3172(0xea);export async function requestDeviceCode(_0x1d11e4){const _0x3cbb49=_0x3c3172,_0x1af667={'TLdKW':'application/x-www-form-urlencoded'},_0x96959c=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x3cbb49(0xb7),'headers':{'Content-Type':_0x1af667[_0x3cbb49(0xfb)]},'body':new URLSearchParams({'client_id':_0x1d11e4})});if(!_0x96959c['ok']){const _0x22d740=await _0x96959c['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x96959c['status']+'\x20'+_0x22d740);}return _0x96959c[_0x3cbb49(0xe1)]();}export async function pollForTokens(_0x374213,_0x33a927,_0x55ba29,_0x3683f5){const _0x6ce067=_0x3c3172,_0x561ac2={'maEcc':function(_0x2ddeef,_0x593b99){return _0x2ddeef*_0x593b99;},'SbMdR':function(_0x2a3e66,_0x25bc0a){return _0x2a3e66<_0x25bc0a;},'iirOT':function(_0x13e771,_0x7cf31a){return _0x13e771(_0x7cf31a);},'qlpty':function(_0x47b4f8,_0x3e4ac1,_0x236cbf){return _0x47b4f8(_0x3e4ac1,_0x236cbf);},'jSHgs':'application/x-www-form-urlencoded','KeMEb':function(_0x126445,_0x56bb72){return _0x126445===_0x56bb72;},'vIEpo':_0x6ce067(0xb2),'ABTRY':_0x6ce067(0xc4)},_0x491ca3=Date[_0x6ce067(0xbb)]()+_0x561ac2['maEcc'](_0x3683f5,0x3e8);let _0x1ed411=_0x55ba29*0x3e8;while(_0x561ac2['SbMdR'](Date[_0x6ce067(0xbb)](),_0x491ca3)){await _0x561ac2['iirOT'](sleep,_0x1ed411);const _0x51f3ed=await _0x561ac2['qlpty'](fetch,WORKOS_TOKEN_URL,{'method':_0x6ce067(0xb7),'headers':{'Content-Type':_0x561ac2['jSHgs']},'body':new URLSearchParams({'client_id':_0x374213,'device_code':_0x33a927,'grant_type':_0x6ce067(0xd8)})});if(_0x51f3ed['ok'])return _0x51f3ed[_0x6ce067(0xe1)]();const _0x287153=await _0x51f3ed[_0x6ce067(0xe1)]();if(_0x561ac2[_0x6ce067(0xb8)](_0x287153['error'],_0x561ac2['vIEpo']))continue;if(_0x561ac2['KeMEb'](_0x287153['error'],_0x561ac2['ABTRY'])){_0x1ed411+=0x3e8;continue;}throw new Error(_0x287153[_0x6ce067(0xd2)]||_0x287153[_0x6ce067(0xbf)]||_0x6ce067(0xef));}throw new Error(_0x6ce067(0x101));}async function fetchUserProfile(_0x6c4527){const _0x290596=_0x3c3172,_0x347b19={'Yabpw':function(_0x5a08a,_0x2f5c1a,_0x964f1c){return _0x5a08a(_0x2f5c1a,_0x964f1c);},'ViJkj':'GET'},_0x351488=getApiBaseUrl();try{const _0x41b05e=await _0x347b19['Yabpw'](fetch,_0x351488+'/organization/me',{'method':_0x347b19[_0x290596(0xf3)],'headers':{'workos-token':_0x6c4527}});if(_0x41b05e['ok'])return _0x41b05e['json']();}catch{}return null;}function buildKeyName(_0x4eab35,_0x5a6c54){const _0xda95ea=_0x3c3172,_0x23b1af={'rHqAF':function(_0x15d720,_0x157262){return _0x15d720===_0x157262;}},_0x287562=_0x5a6c54['filter'](_0xa24245=>_0xa24245[_0xda95ea(0xf7)]===_0x4eab35||_0xa24245['name'][_0xda95ea(0xde)](_0x4eab35+'\x20('));if(_0x23b1af[_0xda95ea(0xc6)](_0x287562[_0xda95ea(0xbe)],0x0))return _0x4eab35;return _0x4eab35+'\x20('+(_0x287562[_0xda95ea(0xbe)]+0x1)+')';}export async function provisionApiKey(_0x102568){const _0x46aa2f=_0x3c3172,_0x3956b2={'nUjNc':function(_0x16dbc7,_0x4f225b){return _0x16dbc7(_0x4f225b);},'XjjqE':'CLI\x20Key','QJRuB':function(_0xaea8e2,_0x42c3a1,_0x14b92f){return _0xaea8e2(_0x42c3a1,_0x14b92f);},'jsExY':_0x46aa2f(0xcb),'lbqpA':_0x46aa2f(0xb7),'cBGBR':_0x46aa2f(0xce)},_0x63632d=getApiBaseUrl(),_0x2213e8={'Content-Type':'application/json','workos-token':_0x102568},_0x3706bb=await _0x3956b2[_0x46aa2f(0xd4)](fetchUserProfile,_0x102568),_0x57ef58=_0x3706bb?.[_0x46aa2f(0xc8)]||_0x3706bb?.[_0x46aa2f(0xd3)]?.[_0x46aa2f(0xc9)]('@')[0x0],_0x394d82=_0x57ef58?_0x57ef58+'\x27s\x20CLI\x20Key':_0x3956b2['XjjqE'];let _0x48ba91=[];try{const _0x189173=await _0x3956b2[_0x46aa2f(0xd5)](fetch,_0x63632d+'/api-keys',{'method':_0x3956b2[_0x46aa2f(0xcd)],'headers':_0x2213e8});if(_0x189173['ok']){const _0x2d5162=await _0x189173['json']();_0x48ba91=_0x2d5162[_0x46aa2f(0xba)];}}catch{}const _0x4bb57e=buildKeyName(_0x394d82,_0x48ba91),_0x3fd3f6=await fetch(_0x63632d+'/api-keys',{'method':_0x3956b2['lbqpA'],'headers':_0x2213e8,'body':JSON[_0x46aa2f(0xb6)]({'name':_0x4bb57e,'scope':_0x3956b2[_0x46aa2f(0x100)]})});if(!_0x3fd3f6['ok']){const _0x4ab9fe=await _0x3fd3f6[_0x46aa2f(0xf2)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x3fd3f6['status']+'\x20'+_0x4ab9fe);}const _0x2fafa0=await _0x3fd3f6[_0x46aa2f(0xe1)]();return _0x2fafa0['apiKey']['token'];}export function openBrowser(_0x26b924){const _0x1c8667=_0x3c3172,_0x2a40a9={'sXXgf':_0x1c8667(0xe4),'HeBMS':_0x1c8667(0xd9),'SOGim':function(_0x53d2dc,_0x1fa00b){return _0x53d2dc===_0x1fa00b;},'qNraI':_0x1c8667(0xed),'kjUZL':'xdg-open','EiJRJ':function(_0x2d42e7,_0x23917a,_0x1315a9,_0x13bb1f){return _0x2d42e7(_0x23917a,_0x1315a9,_0x13bb1f);}};try{if(process['platform']==='win32'){const _0x1e1b04=spawn(_0x2a40a9[_0x1c8667(0xe0)],['/c',_0x2a40a9['HeBMS'],'',_0x26b924],{'detached':!![],'stdio':_0x1c8667(0xf0),'windowsHide':!![]});_0x1e1b04[_0x1c8667(0xff)]();return;}const _0x2a75ee=_0x2a40a9['SOGim'](process[_0x1c8667(0xc3)],_0x2a40a9['qNraI'])?'open':_0x2a40a9['kjUZL'],_0x41a08c=_0x2a40a9[_0x1c8667(0xec)](spawn,_0x2a75ee,[_0x26b924],{'detached':!![],'stdio':'ignore'});_0x41a08c['unref']();}catch{}}function decodeJwtPayload(_0xad6ee8){const _0x12ac92=_0x3c3172,_0x2f8d9e={'WFajI':'base64url','syiJp':'utf-8'},_0x3aafe1=_0xad6ee8['split']('.');if(_0x3aafe1[_0x12ac92(0xbe)]!==0x3)throw new Error(_0x12ac92(0xf9));const _0x18c1fa=Buffer['from'](_0x3aafe1[0x1],_0x2f8d9e[_0x12ac92(0xb9)])[_0x12ac92(0xca)](_0x2f8d9e[_0x12ac92(0xbc)]);return JSON['parse'](_0x18c1fa);}async function selfServeSignup(_0xa38ccd){const _0x49be5d=_0x3c3172,_0x1fdb29={'lyZca':function(_0xf6a5db){return _0xf6a5db();},'HFmHp':function(_0x463544,_0xa36e45,_0x1899d0){return _0x463544(_0xa36e45,_0x1899d0);},'nYJfE':'POST','mKYJi':_0x49be5d(0xe8)},_0x48e849=_0x1fdb29['lyZca'](getApiBaseUrl),_0x49a7c4=await _0x1fdb29[_0x49be5d(0xfe)](fetch,_0x48e849+'/organization/self-serve-signup',{'method':_0x1fdb29[_0x49be5d(0xcc)],'headers':{'Content-Type':_0x1fdb29[_0x49be5d(0xd1)],'workos-token':_0xa38ccd}});if(!_0x49a7c4['ok']){const _0x3bd89c=await _0x49a7c4['text']();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x49a7c4[_0x49be5d(0xc0)]+'\x20'+_0x3bd89c);}return _0x49a7c4[_0x49be5d(0xe1)]();}async function fetchMyMemberships(_0xf6f3dc){const _0x2ebb3c=_0x3c3172,_0x5bcb6b={'BlZHJ':_0x2ebb3c(0xcb)},_0x1811a8=getApiBaseUrl(),_0x59a88d=await fetch(_0x1811a8+_0x2ebb3c(0xc7),{'method':_0x5bcb6b['BlZHJ'],'headers':{'workos-token':_0xf6f3dc}});if(!_0x59a88d['ok']){const _0x39c1d2=await _0x59a88d['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x59a88d['status']+'\x20'+_0x39c1d2);}const _0x930ead=await _0x59a88d['json']();return _0x930ead['memberships'];}async function refreshTokenWithOrg(_0x5d22e0,_0x678e5a,_0x20ccc4){const _0xcbfd1a=_0x3c3172,_0x455d18={'ChMfi':_0xcbfd1a(0xb7)},_0x2975c0=await fetch(WORKOS_TOKEN_URL,{'method':_0x455d18['ChMfi'],'headers':{'Content-Type':_0xcbfd1a(0xe6)},'body':new URLSearchParams({'client_id':_0x5d22e0,'grant_type':_0xcbfd1a(0xfc),'refresh_token':_0x678e5a,'organization_id':_0x20ccc4})});if(!_0x2975c0['ok']){const _0x26bdea=await _0x2975c0['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x2975c0['status']+'\x20'+_0x26bdea);}return _0x2975c0[_0xcbfd1a(0xe1)]();}async function provisionCliToken(_0x5c6d35){const _0xe9365d=_0x3c3172,_0x29031d={'ySJVp':function(_0x1d600e){return _0x1d600e();},'DSvYc':function(_0x36efab,_0x1064f4,_0x3cdcf0){return _0x36efab(_0x1064f4,_0x3cdcf0);},'bAROR':_0xe9365d(0xb7),'HjylF':_0xe9365d(0xe8)},_0x297c79=_0x29031d['ySJVp'](getApiBaseUrl),_0x3a3883=await _0x29031d[_0xe9365d(0xda)](fetch,_0x297c79+'/cli-auth/token',{'method':_0x29031d['bAROR'],'headers':{'Content-Type':_0x29031d[_0xe9365d(0xe2)],'workos-token':_0x5c6d35}});if(!_0x3a3883['ok']){const _0x401a6c=await _0x3a3883['text']();throw new Error(_0xe9365d(0xd0)+_0x3a3883['status']+'\x20'+_0x401a6c);}return _0x3a3883[_0xe9365d(0xe1)]();}export async function runDeviceAuthFlow(){const _0x36161c=_0x3c3172,_0x484a44={'Hnywu':function(_0xc3dbf8,_0x505caf){return _0xc3dbf8(_0x505caf);},'VWbjZ':'\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','pkbeP':'\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','bAyZj':function(_0x2a5da1,_0x17df5e){return _0x2a5da1(_0x17df5e);},'HnNcb':'Waiting\x20for\x20authentication...','dyTKv':function(_0x5a2bd0,_0x160d95,_0x129ad7,_0x365256,_0x1ce4c8){return _0x5a2bd0(_0x160d95,_0x129ad7,_0x365256,_0x1ce4c8);},'NfjDU':function(_0x5756b1,_0x4a5aab){return _0x5756b1+_0x4a5aab;},'Vzkps':_0x36161c(0xfa),'mIJwM':_0x36161c(0xcf),'DZnBV':_0x36161c(0xe3)},_0x591e91=getCurrentEnvironment(),_0x35e2ec=ENVIRONMENT_CONFIGS[_0x591e91]['workosClientId'],_0x27de4e=await _0x484a44['Hnywu'](requestDeviceCode,_0x35e2ec);console['log'](_0x484a44['VWbjZ']),console['log'](_0x484a44['pkbeP']),_0x484a44['bAyZj'](openBrowser,_0x27de4e['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x27de4e['verification_uri_complete']),console['log'](_0x36161c(0xf4)+_0x27de4e[_0x36161c(0xb3)]+'\x0a'),process['stdout']['write'](_0x484a44['HnNcb']);let _0x4b55c9=await _0x484a44[_0x36161c(0xe9)](pollForTokens,_0x35e2ec,_0x27de4e[_0x36161c(0xe5)],_0x27de4e[_0x36161c(0xdd)],_0x27de4e['expires_in']);console['log']('\x20✓');const _0x564cb6=decodeJwtPayload(_0x4b55c9[_0x36161c(0xeb)]);if(!_0x564cb6['org_id']){const _0x29afa5=await fetchMyMemberships(_0x4b55c9['access_token']);let _0x57c803;if(_0x29afa5[_0x36161c(0xbe)]===0x0){process['stdout'][_0x36161c(0xdb)]('Setting\x20up\x20your\x20organization...');const _0x137a9b=await selfServeSignup(_0x4b55c9['access_token']);_0x57c803=_0x137a9b[_0x36161c(0xf6)],console['log']('\x20✓');}else{if(_0x29afa5[_0x36161c(0xbe)]===0x1)_0x57c803=_0x29afa5[0x0]['organizationId'],console[_0x36161c(0xc2)]('Using\x20organization:\x20'+_0x29afa5[0x0]['name']);else{const _0x3d8636=process['stdin'][_0x36161c(0xdc)]&&process['stdout']['isTTY'];if(!_0x3d8636)throw new Error(_0x484a44['NfjDU'](_0x484a44['Vzkps'],_0x484a44['mIJwM']));const {selected:_0x2ef108}=await _0x1f87d5[_0x36161c(0xee)]([{'type':'list','name':_0x36161c(0xf8),'message':_0x484a44['DZnBV'],'choices':_0x29afa5[_0x36161c(0xc1)](_0x1c1897=>({'name':_0x1c1897[_0x36161c(0xf7)],'value':_0x1c1897['organizationId']}))}]);_0x57c803=_0x2ef108;}}_0x4b55c9=await refreshTokenWithOrg(_0x35e2ec,_0x4b55c9['refresh_token'],_0x57c803);}process['stdout'][_0x36161c(0xdb)]('Provisioning\x20CLI\x20token...');const _0x245a8d=await provisionCliToken(_0x4b55c9['access_token']);return console['log']('\x20✓'),await _0x484a44['Hnywu'](storeToken,_0x245a8d['token']),_0x4b55c9['refresh_token']&&await _0x484a44[_0x36161c(0xbd)](storeRefreshToken,_0x4b55c9[_0x36161c(0xfc)]),_0x245a8d[_0x36161c(0xe7)];}function sleep(_0x482808){return new Promise(_0x4a5919=>setTimeout(_0x4a5919,_0x482808));}function _0x432e(){const _0x35bb93=['HFmHp','unref','cBGBR','Device\x20authorization\x20timed\x20out','authorization_pending','user_code','75177UvKLNZ','770797kpgsRU','stringify','POST','KeMEb','WFajI','apiKeys','now','syiJp','Hnywu','length','error','status','map','log','platform','slow_down','628885XPmOib','rHqAF','/organization/my-memberships','firstName','split','toString','GET','nYJfE','jsExY','mcp:write','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','Failed\x20to\x20provision\x20CLI\x20token:\x20','mKYJi','error_description','email','nUjNc','QJRuB','5903184mgrddl','1312lhSKhi','urn:ietf:params:oauth:grant-type:device_code','start','DSvYc','write','isTTY','interval','startsWith','3793300tbZvsg','sXXgf','json','HjylF','Select\x20an\x20organization:','cmd','device_code','application/x-www-form-urlencoded','token','application/json','dyTKv','https://api.workos.com/user_management/authenticate','access_token','EiJRJ','darwin','prompt','Authentication\x20failed','ignore','20186VcDOTe','text','ViJkj','Code:\x20','1765605DLyhqn','organizationId','name','selected','Invalid\x20JWT\x20format','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','TLdKW','refresh_token','4eOyXnE'];_0x432e=function(){return _0x35bb93;};return _0x432e();}
@@ -1 +1 @@
1
- const _0x458b53=_0x343b;(function(_0x43dcd3,_0x4d7230){const _0x111890=_0x343b,_0x248fac=_0x43dcd3();while(!![]){try{const _0x4e4ebf=-parseInt(_0x111890(0x90))/0x1+-parseInt(_0x111890(0x8f))/0x2+parseInt(_0x111890(0x91))/0x3+parseInt(_0x111890(0x86))/0x4*(-parseInt(_0x111890(0x8a))/0x5)+parseInt(_0x111890(0x87))/0x6+-parseInt(_0x111890(0x9b))/0x7+parseInt(_0x111890(0x84))/0x8*(parseInt(_0x111890(0x94))/0x9);if(_0x4e4ebf===_0x4d7230)break;else _0x248fac['push'](_0x248fac['shift']());}catch(_0x53f47f){_0x248fac['push'](_0x248fac['shift']());}}}(_0x2088,0x47123));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0x458b53(0x85),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':_0x458b53(0x81)},'staging':{'apiBaseUrl':_0x458b53(0x9a),'workosClientId':_0x458b53(0x82),'aiProxyUrl':_0x458b53(0x9f),'mcpAuthUrl':_0x458b53(0x96)},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x458b53(0x9d),'mcpAuthUrl':_0x458b53(0x92)}};function _0x343b(_0x4f6035,_0x1ef8b2){_0x4f6035=_0x4f6035-0x80;const _0x2088a8=_0x2088();let _0x343be4=_0x2088a8[_0x4f6035];return _0x343be4;}export const DEFAULT_ENVIRONMENT=_0x458b53(0x97);export function isValidEnvironment(_0x2ed122){const _0x42b4d8=_0x458b53,_0x450fdb={'RFgvk':function(_0xef1e2d,_0x32ca0f){return _0xef1e2d===_0x32ca0f;},'yaCHn':'prod','VoPPu':_0x42b4d8(0x9c),'zWFgu':function(_0x113a3b,_0x49b3c1){return _0x113a3b===_0x49b3c1;},'HMoav':_0x42b4d8(0x8d)};return _0x450fdb['RFgvk'](_0x2ed122,_0x450fdb['yaCHn'])||_0x2ed122===_0x450fdb['VoPPu']||_0x450fdb[_0x42b4d8(0x95)](_0x2ed122,_0x450fdb['HMoav']);}export function getCurrentEnvironment(){const _0x3d82be=_0x458b53,_0x1d8c5b=process['env'][_0x3d82be(0x9e)];if(_0x1d8c5b&&isValidEnvironment(_0x1d8c5b))return _0x1d8c5b;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['apiBaseUrl'];}export function getAiProxyUrl(){const _0x1671bb=_0x458b53,_0x2d5aef={'LzgwG':function(_0xa57ef8){return _0xa57ef8();}};return ENVIRONMENT_CONFIGS[_0x2d5aef[_0x1671bb(0xa0)](getCurrentEnvironment)]['aiProxyUrl'];}function _0x2088(){const _0x3870c5=['mcp','https://mcp-auth.ranger.net/mcp','client_01J9CBYM2DKWV9HM17D95Z540K','uHXlU','84464VcWKVz','client_01J9CBYM7M5ZETCF7G6614DXR2','2372fUGxsM','310074jZvSiI','env','\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20or\x20RANGER_TRANSPORT=nova-act-cli.','3355qTvhzO','nova-act-cli','true','local','RANGER_TRANSPORT','480498MCwyoy','460072FsWnpE','1164420OZemyH','http://localhost:8080/mcp','find','1053zUDfus','zWFgu','https://mcp-auth.staging.ranger.net/mcp','prod','htvDu','RANGER_MCP_AUTH_URL','https://api.staging.ranger.net','2000418xtwSdK','staging','http://localhost:8090','RANGER_CLI_ENV','https://ai-proxy-301751771437.us-central1.run.app','LzgwG'];_0x2088=function(){return _0x3870c5;};return _0x2088();}export function getMcpAuthUrl(){const _0x57d62d=_0x458b53;return process[_0x57d62d(0x88)][_0x57d62d(0x99)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['mcpAuthUrl'];}export function isByokEnabled(){const _0x34b7e7=_0x458b53,_0x2fed8b={'uHXlU':function(_0x29df99,_0x10a934){return _0x29df99===_0x10a934;}};return _0x2fed8b[_0x34b7e7(0x83)](process['env']['RANGER_BYOK'],_0x34b7e7(0x8c));}function isVerificationTransport(_0x59fa78){const _0x43c40e=_0x458b53,_0x4ae46a={'jPhSh':function(_0x4e91a4,_0x272a34){return _0x4e91a4===_0x272a34;},'amjxn':'mcp','KuEqR':'playwright-cli','jHsDY':_0x43c40e(0x8b)};return _0x4ae46a['jPhSh'](_0x59fa78,_0x4ae46a['amjxn'])||_0x59fa78===_0x4ae46a['KuEqR']||_0x59fa78===_0x4ae46a['jHsDY'];}const LEGACY_TRANSPORT_ENV_VARS=['RANGER_USE_NOVA_ACT','RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x1545b1=_0x458b53,_0x1498b5={'htvDu':_0x1545b1(0x80)},_0x560268=process['env'][_0x1545b1(0x8e)]?.['trim']();if(_0x560268){if(isVerificationTransport(_0x560268))return _0x560268;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x560268+'\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli.');}const _0x4268c8=LEGACY_TRANSPORT_ENV_VARS[_0x1545b1(0x93)](_0x405179=>process[_0x1545b1(0x88)][_0x405179]);if(_0x4268c8)throw new Error(_0x4268c8+_0x1545b1(0x89));return _0x1498b5[_0x1545b1(0x98)];}
1
+ const _0x3e13ce=_0x49b3;(function(_0x2a1966,_0x4461a8){const _0x20b5cc=_0x49b3,_0x532a13=_0x2a1966();while(!![]){try{const _0x71bfcf=parseInt(_0x20b5cc(0x1d5))/0x1*(-parseInt(_0x20b5cc(0x1db))/0x2)+parseInt(_0x20b5cc(0x1e5))/0x3*(parseInt(_0x20b5cc(0x1d8))/0x4)+parseInt(_0x20b5cc(0x1ef))/0x5+parseInt(_0x20b5cc(0x1f2))/0x6*(-parseInt(_0x20b5cc(0x1e3))/0x7)+-parseInt(_0x20b5cc(0x1e1))/0x8+-parseInt(_0x20b5cc(0x1f0))/0x9*(parseInt(_0x20b5cc(0x1dc))/0xa)+parseInt(_0x20b5cc(0x1e9))/0xb;if(_0x71bfcf===_0x4461a8)break;else _0x532a13['push'](_0x532a13['shift']());}catch(_0xf11ecc){_0x532a13['push'](_0x532a13['shift']());}}}(_0x132f,0x9c6ca));function _0x132f(){const _0x84644a=['mcpAuthUrl','client_01J9CBYM2DKWV9HM17D95Z540K','44pikNQv','client_01J9CBYM7M5ZETCF7G6614DXR2','https://mcp-auth.staging.ranger.net/mcp','1186IcRkxE','20dBpLCl','mcp','prod','http://localhost:8080/mcp','find','9241664qvElsQ','PXoSk','14PhQrmv','RANGER_CLI_ENV','343503eQSuAu','RANGER_TRANSPORT','Vezjr','\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.','14025924bwidyn','PGJjM','AKHpv','RANGER_MCP_AUTH_URL','qTBoI','https://ai-proxy-716115358910.us-central1.run.app','3694370meksdA','777744QSTFpJ','RJRZp','1763334xUUCLm','lIBsd','RANGER_BYOK','env','nHwQz','true','1209wkRLlj'];_0x132f=function(){return _0x84644a;};return _0x132f();}export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0x3e13ce(0x1d9),'aiProxyUrl':_0x3e13ce(0x1ee),'mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'https://ai-proxy-301751771437.us-central1.run.app','mcpAuthUrl':_0x3e13ce(0x1da)},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':_0x3e13ce(0x1d7),'aiProxyUrl':'http://localhost:8090','mcpAuthUrl':_0x3e13ce(0x1df)}};export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x454866){const _0x984db7=_0x3e13ce,_0x36fcf5={'lIBsd':function(_0x510651,_0x50d511){return _0x510651===_0x50d511;},'PGJjM':function(_0x577f53,_0x2d5b3d){return _0x577f53===_0x2d5b3d;}};return _0x36fcf5['lIBsd'](_0x454866,_0x984db7(0x1de))||_0x36fcf5[_0x984db7(0x1f3)](_0x454866,'staging')||_0x36fcf5[_0x984db7(0x1ea)](_0x454866,'local');}export function getCurrentEnvironment(){const _0x2b60c4=_0x3e13ce,_0x38b9fc=process[_0x2b60c4(0x1d2)][_0x2b60c4(0x1e4)];if(_0x38b9fc&&isValidEnvironment(_0x38b9fc))return _0x38b9fc;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['apiBaseUrl'];}export function getAiProxyUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x4dad8b=_0x3e13ce;return process[_0x4dad8b(0x1d2)][_0x4dad8b(0x1ec)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x4dad8b(0x1d6)];}export function isByokEnabled(){const _0xa94844=_0x3e13ce,_0x15de54={'AKHpv':_0xa94844(0x1d4)};return process['env'][_0xa94844(0x1d1)]===_0x15de54[_0xa94844(0x1eb)];}function isVerificationTransport(_0x2bb4f4){const _0x1981ee=_0x3e13ce,_0x2aa062={'RJRZp':_0x1981ee(0x1dd),'nHwQz':function(_0x22ca10,_0x14fc8f){return _0x22ca10===_0x14fc8f;},'qTBoI':'playwright-cli','PXoSk':'rangerwright-cli'};return _0x2bb4f4===_0x2aa062[_0x1981ee(0x1f1)]||_0x2aa062[_0x1981ee(0x1d3)](_0x2bb4f4,_0x2aa062[_0x1981ee(0x1ed)])||_0x2bb4f4==='nova-act-cli'||_0x2aa062['nHwQz'](_0x2bb4f4,_0x2aa062[_0x1981ee(0x1e2)]);}const LEGACY_TRANSPORT_ENV_VARS=['RANGER_USE_NOVA_ACT','RANGER_DISABLE_MCP'];function _0x49b3(_0x286503,_0x5c4031){_0x286503=_0x286503-0x1d1;const _0x132fec=_0x132f();let _0x49b3f0=_0x132fec[_0x286503];return _0x49b3f0;}export function getVerificationTransport(){const _0x5cc78c=_0x3e13ce,_0x48e44d={'Vezjr':function(_0xe689d2,_0x4b95be){return _0xe689d2(_0x4b95be);}},_0x564a6f=process[_0x5cc78c(0x1d2)][_0x5cc78c(0x1e6)]?.['trim']();if(_0x564a6f){if(_0x48e44d[_0x5cc78c(0x1e7)](isVerificationTransport,_0x564a6f))return _0x564a6f;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x564a6f+'\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.');}const _0x367624=LEGACY_TRANSPORT_ENV_VARS[_0x5cc78c(0x1e0)](_0x133eb7=>process['env'][_0x133eb7]);if(_0x367624)throw new Error(_0x367624+_0x5cc78c(0x1e8));return _0x5cc78c(0x1dd);}
@@ -1 +1 @@
1
- (function(_0x3a19c3,_0x4e291){const _0x1ecb33=_0x5437,_0x3df7d7=_0x3a19c3();while(!![]){try{const _0x2de7b6=parseInt(_0x1ecb33(0xc1))/0x1+parseInt(_0x1ecb33(0xbc))/0x2+-parseInt(_0x1ecb33(0xa7))/0x3+parseInt(_0x1ecb33(0x9a))/0x4*(parseInt(_0x1ecb33(0xa3))/0x5)+parseInt(_0x1ecb33(0x94))/0x6+parseInt(_0x1ecb33(0x8c))/0x7+-parseInt(_0x1ecb33(0xac))/0x8;if(_0x2de7b6===_0x4e291)break;else _0x3df7d7['push'](_0x3df7d7['shift']());}catch(_0x2de0f3){_0x3df7d7['push'](_0x3df7d7['shift']());}}}(_0x2b3a,0xe204f));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x2af939){const _0xe85363=_0x5437,_0x5f2444={'vcQTw':function(_0xc28d8b){return _0xc28d8b();},'zRRkv':function(_0x4f4f79,_0x3248ad,_0xe87588){return _0x4f4f79(_0x3248ad,_0xe87588);},'DmLGp':function(_0x896efb,_0x298024){return _0x896efb===_0x298024;}},_0x2c7f57=await _0x5f2444['vcQTw'](getToken);if(!_0x2c7f57)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x21a202=getApiBaseUrl(),_0x16b8e5=await _0x5f2444['zRRkv'](fetch,_0x21a202+_0xe85363(0xb3),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x2c7f57,'Content-Type':'application/json'},'body':JSON['stringify'](_0x2af939)});if(!_0x16b8e5['ok']){if(_0x5f2444['DmLGp'](_0x16b8e5['status'],0x192)){const _0x8e6b4f=await _0x16b8e5['json'](),_0x4f31af=_0x8e6b4f['billingUrl']||_0xe85363(0xcb);throw new Error((_0x8e6b4f[_0xe85363(0x89)]||_0xe85363(0xa4))+_0xe85363(0xc7)+_0x4f31af);}const _0x430236=await _0x16b8e5[_0xe85363(0xae)]();throw new Error('Failed\x20to\x20create\x20feature\x20review:\x20'+_0x430236);}return _0x16b8e5['json']();}export async function listFeatures(_0x447bb6){const _0x4dda27=_0x5437,_0xc0b4b4={'EfkXK':function(_0x204b0a){return _0x204b0a();},'JGPly':'gitRepoUrl','iuJwm':'gitBranch','bzEfM':'limit','KURvp':_0x4dda27(0xaf),'JtyJU':function(_0x5b7f76,_0x84a1b9,_0x289027){return _0x5b7f76(_0x84a1b9,_0x289027);},'HfJou':'GET'},_0x274aa7=await _0xc0b4b4[_0x4dda27(0xba)](getToken);if(!_0x274aa7)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1432f4=getApiBaseUrl(),_0x5fde0f=new URLSearchParams();if(_0x447bb6?.['gitRepoUrl'])_0x5fde0f[_0x4dda27(0xc2)](_0xc0b4b4['JGPly'],_0x447bb6[_0x4dda27(0xbd)]);if(_0x447bb6?.['gitBranch'])_0x5fde0f[_0x4dda27(0xc2)](_0xc0b4b4[_0x4dda27(0x9b)],_0x447bb6['gitBranch']);if(_0x447bb6?.['limit'])_0x5fde0f['set'](_0xc0b4b4['bzEfM'],_0x447bb6[_0x4dda27(0xb1)][_0x4dda27(0xa6)]());if(_0x447bb6?.[_0x4dda27(0xaf)])_0x5fde0f[_0x4dda27(0xc2)](_0xc0b4b4[_0x4dda27(0xbe)],_0x447bb6[_0x4dda27(0xaf)][_0x4dda27(0xa6)]());if(_0x447bb6?.[_0x4dda27(0xc5)])_0x5fde0f['set']('includeDeleted',_0x4dda27(0x86));const _0x1efa35=_0x1432f4+_0x4dda27(0xb3)+(_0x5fde0f[_0x4dda27(0xa6)]()?'?'+_0x5fde0f['toString']():''),_0x1aee3f=await _0xc0b4b4[_0x4dda27(0xc0)](fetch,_0x1efa35,{'method':_0xc0b4b4[_0x4dda27(0x92)],'headers':{'Authorization':'Bearer\x20'+_0x274aa7}});if(!_0x1aee3f['ok']){const _0xe259e7=await _0x1aee3f['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0xe259e7);}return _0x1aee3f[_0x4dda27(0x96)]();}export async function getFeature(_0x12be5e){const _0x300f3d=_0x5437,_0x1d6b3e={'PwJQK':function(_0xdc861){return _0xdc861();},'NrSBc':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0xd0e764=await _0x1d6b3e['PwJQK'](getToken);if(!_0xd0e764)throw new Error(_0x1d6b3e[_0x300f3d(0xc8)]);const _0x42e6bf=getApiBaseUrl(),_0x4bd27f=await fetch(_0x42e6bf+'/api/v1/mcp/features/'+_0x12be5e,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0xd0e764}});if(!_0x4bd27f['ok']){const _0x3073a5=await _0x4bd27f['text']();throw new Error(_0x300f3d(0x8f)+_0x3073a5);}return _0x4bd27f['json']();}export async function updateFeature(_0x110622,_0x5c060e){const _0x8a2bc0=_0x5437,_0x24e11a={'nFudW':function(_0x56742b){return _0x56742b();},'bqsUv':_0x8a2bc0(0xb8)},_0x584edc=await getToken();if(!_0x584edc)throw new Error(_0x8a2bc0(0x91));const _0x4eb1d4=_0x24e11a['nFudW'](getApiBaseUrl),_0x1b1b17=await fetch(_0x4eb1d4+_0x8a2bc0(0x99)+_0x110622,{'method':'PATCH','headers':{'Authorization':_0x8a2bc0(0x9f)+_0x584edc,'Content-Type':_0x24e11a[_0x8a2bc0(0x97)]},'body':JSON['stringify'](_0x5c060e)});if(!_0x1b1b17['ok']){const _0x4bd557=await _0x1b1b17[_0x8a2bc0(0xae)]();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x4bd557);}return _0x1b1b17[_0x8a2bc0(0x96)]();}function _0x5437(_0x1e353f,_0x46ce71){_0x1e353f=_0x1e353f-0x84;const _0x2b3a6e=_0x2b3a();let _0x543741=_0x2b3a6e[_0x1e353f];return _0x543741;}function _0x2b3a(){const _0x5351a8=['/checklist/','JtyJU','1580498GCEdYY','set','Failed\x20to\x20restore\x20feature\x20review:\x20','CWUGE','includeDeleted','POST','\x0a\x0aUpgrade\x20your\x20plan:\x20','NrSBc','pqICm','/sessions/','https://dashboard.ranger.net/billing','FOhiF','Failed\x20to\x20get\x20action\x20items:\x20','true','stringify','/checklist-items/','message','IurzL','SrLVp','11094741btwocY','length','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','Failed\x20to\x20get\x20feature\x20review:\x20','xpYOA','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','HfJou','/restore','6000834ArTMFw','/start','json','bqsUv','Failed\x20to\x20create\x20scenario:\x20','/api/v1/mcp/features/','164OqwMcM','iuJwm','Failed\x20to\x20update\x20scenario:\x20','LvADy','Failed\x20to\x20delete\x20feature\x20review:\x20','Bearer\x20','RFTUv','esyDL','style','42945fKnXph','Feature\x20limit\x20exceeded','Failed\x20to\x20conclude\x20session:\x20','toString','2693802LGTCft','mUXfp','sessionId','Xxdrs','Failed\x20to\x20start\x20session:\x20','30190336beYdOU','lTqnV','text','offset','GET','limit','ihqon','/api/v1/mcp/features','itemIds','psoMB','/comments/address','/action-items','application/json','/feedback','EfkXK','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','2159504fILjPS','gitRepoUrl','KURvp'];_0x2b3a=function(){return _0x5351a8;};return _0x2b3a();}export async function createChecklistItem(_0x13ea32,_0x10d5cf,_0x4e0537){const _0x2fecdf=_0x5437,_0x20eafb={'ihqon':function(_0x42dbc8){return _0x42dbc8();},'syzCA':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','psoMB':function(_0x19943a){return _0x19943a();},'MHEcM':_0x2fecdf(0xb8)},_0x36c906=await _0x20eafb[_0x2fecdf(0xb2)](getToken);if(!_0x36c906)throw new Error(_0x20eafb['syzCA']);const _0x3de04b=_0x20eafb[_0x2fecdf(0xb5)](getApiBaseUrl),_0x3dcd83=await fetch(_0x3de04b+_0x2fecdf(0x99)+_0x13ea32+'/checklist',{'method':_0x2fecdf(0xc6),'headers':{'Authorization':_0x2fecdf(0x9f)+_0x36c906,'Content-Type':_0x20eafb['MHEcM']},'body':JSON['stringify']({'description':_0x10d5cf,'position':_0x4e0537})});if(!_0x3dcd83['ok']){const _0x58addb=await _0x3dcd83[_0x2fecdf(0xae)]();throw new Error(_0x2fecdf(0x98)+_0x58addb);}return _0x3dcd83['json']();}export async function updateChecklistItem(_0x5f1b1c,_0x5762ba,_0x5d7bb3){const _0x30a22b={'kxNrO':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','LZXqA':function(_0x44504a,_0x56af50,_0x1fb313){return _0x44504a(_0x56af50,_0x1fb313);},'TbSvR':function(_0xbec893,_0x55ffd5,_0x165e37){return _0xbec893(_0x55ffd5,_0x165e37);},'Rykik':'updateChecklistItem'};return _0x30a22b['TbSvR'](withRetry,async()=>{const _0x1ca29c=_0x5437,_0x5150eb=await getToken();if(!_0x5150eb)throw new Error(_0x30a22b['kxNrO']);const _0x2b7ce4=getApiBaseUrl(),_0xf98f72=await _0x30a22b['LZXqA'](fetch,_0x2b7ce4+'/api/v1/mcp/features/'+_0x5f1b1c+_0x1ca29c(0xbf)+_0x5762ba,{'method':'PATCH','headers':{'Authorization':'Bearer\x20'+_0x5150eb,'Content-Type':_0x1ca29c(0xb8)},'body':JSON[_0x1ca29c(0x87)](_0x5d7bb3)});if(!_0xf98f72['ok']){const _0x54eb34=await _0xf98f72[_0x1ca29c(0xae)]();throw new Error(_0x1ca29c(0x9c)+_0x54eb34);}return _0xf98f72[_0x1ca29c(0x96)]();},{'label':_0x30a22b['Rykik']});}export async function getFeatureReport(_0x5bdb7b){const _0x44a634=_0x5437,_0x18cd6d={'lTqnV':function(_0x4f223c){return _0x4f223c();}},_0x4cc893=await _0x18cd6d[_0x44a634(0xad)](getToken);if(!_0x4cc893)throw new Error(_0x44a634(0x91));const _0x19e796=getApiBaseUrl(),_0x29081e=await fetch(_0x19e796+_0x44a634(0x99)+_0x5bdb7b+'/report',{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x4cc893}});if(!_0x29081e['ok']){const _0x1510bb=await _0x29081e[_0x44a634(0xae)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x1510bb);}return _0x29081e[_0x44a634(0x96)]();}export async function getFeatureReportMarkdown(_0x4f7a02,_0x1ec50a){const _0x23854a=_0x5437,_0xfe53ba={'FOhiF':function(_0x31be7a,_0x52914e){return _0x31be7a>_0x52914e;},'mUXfp':function(_0x5dd21f,_0x39cc6e){return _0x5dd21f(_0x39cc6e);},'GwSxi':_0x23854a(0xb4),'YwanA':_0x23854a(0xa9),'DekrN':'GET'},_0x549727=await getToken();if(!_0x549727)throw new Error(_0x23854a(0x91));const _0x16ce5c=getApiBaseUrl(),_0x481911=new URLSearchParams(),_0x49610=_0xfe53ba[_0x23854a(0x84)](_0x1ec50a?.[_0x23854a(0xb4)]?.[_0x23854a(0x8d)]??0x0,0x0),_0x47e82f=_0xfe53ba[_0x23854a(0xa8)](Boolean,_0x1ec50a?.['sessionId']);_0x49610&&_0x1ec50a?.[_0x23854a(0xb4)]&&_0x481911[_0x23854a(0xc2)](_0xfe53ba['GwSxi'],_0x1ec50a['itemIds']['join'](','));_0x47e82f&&_0x1ec50a?.['sessionId']&&_0x481911['set'](_0xfe53ba['YwanA'],_0x1ec50a['sessionId']);!_0x49610&&!_0x47e82f&&_0x1ec50a?.[_0x23854a(0xa2)]&&_0x481911['set']('style',_0x1ec50a['style']);const _0x2c7a17=_0x16ce5c+_0x23854a(0x99)+_0x4f7a02+'/report/markdown',_0xe93dae=''+_0x2c7a17+(_0x481911['toString']()?'?'+_0x481911['toString']():''),_0x4b763d=await fetch(_0xe93dae,{'method':_0xfe53ba['DekrN'],'headers':{'Authorization':'Bearer\x20'+_0x549727}});if(!_0x4b763d['ok']){const _0x16b06f=await _0x4b763d[_0x23854a(0xae)]();throw new Error(_0x23854a(0xbb)+_0x16b06f);}return _0x4b763d['text']();}export async function listFeatureSessions(_0x5561de){const _0x5159cd=_0x5437,_0x12c692={'IurzL':function(_0x490133){return _0x490133();},'xQrch':function(_0x3c004a,_0x30017c,_0x3d21ba){return _0x3c004a(_0x30017c,_0x3d21ba);},'lcLSa':'GET'},_0x1e626a=await _0x12c692[_0x5159cd(0x8a)](getToken);if(!_0x1e626a)throw new Error(_0x5159cd(0x91));const _0x5cf8a0=getApiBaseUrl(),_0x183d15=await _0x12c692['xQrch'](fetch,_0x5cf8a0+_0x5159cd(0x99)+_0x5561de+'/sessions',{'method':_0x12c692['lcLSa'],'headers':{'Authorization':'Bearer\x20'+_0x1e626a}});if(!_0x183d15['ok']){const _0x2a31c6=await _0x183d15['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x2a31c6);}return _0x183d15[_0x5159cd(0x96)]();}export async function startSession(_0x71936c,_0x275ae2){const _0x1e0d85=_0x5437,_0x53742f={'kHwHA':function(_0x5c0579){return _0x5c0579();},'SrLVp':function(_0x38f5f4,_0x1eaadb,_0x48b5b9){return _0x38f5f4(_0x1eaadb,_0x48b5b9);}},_0x459f6b=await getToken();if(!_0x459f6b)throw new Error(_0x1e0d85(0x91));const _0x37f202=_0x53742f['kHwHA'](getApiBaseUrl),_0x4a6a1f=await _0x53742f[_0x1e0d85(0x8b)](fetch,_0x37f202+_0x1e0d85(0x99)+_0x71936c+'/sessions/'+_0x275ae2+_0x1e0d85(0x95),{'method':_0x1e0d85(0xc6),'headers':{'Authorization':_0x1e0d85(0x9f)+_0x459f6b}});if(!_0x4a6a1f['ok']){const _0x3039ab=await _0x4a6a1f[_0x1e0d85(0xae)]();throw new Error(_0x1e0d85(0xab)+_0x3039ab);}return _0x4a6a1f[_0x1e0d85(0x96)]();}export async function concludeSession(_0x9691c7,_0x4f5a0c){const _0x1ccd41=_0x5437,_0x275f14={'xpYOA':function(_0x80ade4){return _0x80ade4();},'Xxdrs':function(_0x36fb60,_0x497354,_0x6f9e06){return _0x36fb60(_0x497354,_0x6f9e06);},'pqICm':_0x1ccd41(0xc6)},_0x2f8abe=await _0x275f14['xpYOA'](getToken);if(!_0x2f8abe)throw new Error(_0x1ccd41(0x91));const _0x574afc=_0x275f14[_0x1ccd41(0x90)](getApiBaseUrl),_0x35f215=await _0x275f14[_0x1ccd41(0xaa)](fetch,_0x574afc+_0x1ccd41(0x99)+_0x9691c7+_0x1ccd41(0xca)+_0x4f5a0c+'/conclude',{'method':_0x275f14[_0x1ccd41(0xc9)],'headers':{'Authorization':'Bearer\x20'+_0x2f8abe}});if(!_0x35f215['ok']){const _0x2a3b9c=await _0x35f215[_0x1ccd41(0xae)]();throw new Error(_0x1ccd41(0xa5)+_0x2a3b9c);}return _0x35f215['json']();}export async function getActionItems(_0x448e6d){const _0x50252c=_0x5437,_0x4524ae={'Mlpfv':function(_0x5c9c3f){return _0x5c9c3f();},'RFTUv':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','CWUGE':_0x50252c(0xb0)},_0x222f40=await _0x4524ae['Mlpfv'](getToken);if(!_0x222f40)throw new Error(_0x4524ae[_0x50252c(0xa0)]);const _0x418910=getApiBaseUrl(),_0x5e263b=await fetch(_0x418910+_0x50252c(0x99)+_0x448e6d+_0x50252c(0xb7),{'method':_0x4524ae[_0x50252c(0xc4)],'headers':{'Authorization':'Bearer\x20'+_0x222f40}});if(!_0x5e263b['ok']){const _0xd471ca=await _0x5e263b['text']();throw new Error(_0x50252c(0x85)+_0xd471ca);}return _0x5e263b[_0x50252c(0x96)]();}export async function getItemFeedback(_0x1f03f9,_0x5b6ab9){const _0x3859cd=_0x5437,_0xa8dd2d={'TDtfo':function(_0x6558c1){return _0x6558c1();},'LvADy':_0x3859cd(0xb0)},_0x9fa933=await _0xa8dd2d['TDtfo'](getToken);if(!_0x9fa933)throw new Error(_0x3859cd(0x91));const _0x221d99=_0xa8dd2d['TDtfo'](getApiBaseUrl),_0x5b6991=await fetch(_0x221d99+'/api/v1/mcp/features/'+_0x1f03f9+_0x3859cd(0x88)+_0x5b6ab9+_0x3859cd(0xb9),{'method':_0xa8dd2d[_0x3859cd(0x9d)],'headers':{'Authorization':'Bearer\x20'+_0x9fa933}});if(!_0x5b6991['ok']){const _0x91a1b0=await _0x5b6991['text']();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x91a1b0);}return _0x5b6991[_0x3859cd(0x96)]();}export async function markCommentsAddressed(_0x5356cf,_0x47a8e5,_0x1e72fb){const _0x44a593=_0x5437,_0x53a27e={'GOAzy':function(_0x371c7c){return _0x371c7c();},'hsQVz':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','OesiB':'application/json'},_0x39ec85=await _0x53a27e['GOAzy'](getToken);if(!_0x39ec85)throw new Error(_0x53a27e['hsQVz']);const _0x431781=getApiBaseUrl(),_0x40c825=await fetch(_0x431781+_0x44a593(0x99)+_0x5356cf+_0x44a593(0xb6),{'method':'POST','headers':{'Authorization':_0x44a593(0x9f)+_0x39ec85,'Content-Type':_0x53a27e['OesiB']},'body':JSON[_0x44a593(0x87)]({'checklistItemId':_0x47a8e5,'commentIds':_0x1e72fb})});if(!_0x40c825['ok']){const _0x34320c=await _0x40c825['text']();throw new Error(_0x44a593(0x8e)+_0x34320c);}}export async function softDeleteFeature(_0x4c1776){const _0x18529f=_0x5437,_0x3f88d4={'esyDL':function(_0x1d929f){return _0x1d929f();},'RENoL':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','qjfBs':function(_0x3c14de,_0x17e396,_0x442b1f){return _0x3c14de(_0x17e396,_0x442b1f);}},_0x76afb=await _0x3f88d4[_0x18529f(0xa1)](getToken);if(!_0x76afb)throw new Error(_0x3f88d4['RENoL']);const _0x127aa4=getApiBaseUrl(),_0x192ceb=await _0x3f88d4['qjfBs'](fetch,_0x127aa4+_0x18529f(0x99)+_0x4c1776,{'method':'DELETE','headers':{'Authorization':'Bearer\x20'+_0x76afb}});if(!_0x192ceb['ok']){const _0x29be34=await _0x192ceb['text']();throw new Error(_0x18529f(0x9e)+_0x29be34);}}export async function restoreFeature(_0x98bf67){const _0x33a69c=_0x5437,_0x19389e={'NEczO':_0x33a69c(0x91),'zJTnn':function(_0x1299dc){return _0x1299dc();},'XErUW':function(_0x372e0a,_0x54d75b,_0x87b128){return _0x372e0a(_0x54d75b,_0x87b128);}},_0x3d3d3c=await getToken();if(!_0x3d3d3c)throw new Error(_0x19389e['NEczO']);const _0x38c604=_0x19389e['zJTnn'](getApiBaseUrl),_0x28218c=await _0x19389e['XErUW'](fetch,_0x38c604+_0x33a69c(0x99)+_0x98bf67+_0x33a69c(0x93),{'method':_0x33a69c(0xc6),'headers':{'Authorization':'Bearer\x20'+_0x3d3d3c}});if(!_0x28218c['ok']){const _0x274cc5=await _0x28218c['text']();throw new Error(_0x33a69c(0xc3)+_0x274cc5);}}
1
+ (function(_0x38d978,_0x4cebda){const _0x48619a=_0x951c,_0x582168=_0x38d978();while(!![]){try{const _0x407d08=parseInt(_0x48619a(0x151))/0x1*(parseInt(_0x48619a(0x132))/0x2)+parseInt(_0x48619a(0x10a))/0x3*(parseInt(_0x48619a(0x11e))/0x4)+-parseInt(_0x48619a(0x144))/0x5*(-parseInt(_0x48619a(0x105))/0x6)+-parseInt(_0x48619a(0x136))/0x7+parseInt(_0x48619a(0x119))/0x8*(parseInt(_0x48619a(0x145))/0x9)+parseInt(_0x48619a(0x113))/0xa*(-parseInt(_0x48619a(0x10e))/0xb)+parseInt(_0x48619a(0x127))/0xc;if(_0x407d08===_0x4cebda)break;else _0x582168['push'](_0x582168['shift']());}catch(_0x32d723){_0x582168['push'](_0x582168['shift']());}}}(_0x3e5a,0x36da8));function _0x3e5a(){const _0x349c16=['Bearer\x20','Failed\x20to\x20get\x20action\x20items:\x20','hwDSz','itemIds','Failed\x20to\x20update\x20feature\x20review:\x20','24PpuOeV','kmhlF','bPkqw','AjVlf','json','5816UvLyWp','kYfoK','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','set','EVPma','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','xGHdj','/comments/address','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','5688204VMMeIq','/sessions/','XCgTr','sessionId','qdUzR','Failed\x20to\x20restore\x20feature\x20review:\x20','offset','lXVWb','/start','pYSEk','qpscu','40bDGEKY','join','toString','/api/v1/mcp/features','1562477CXrCdu','/sessions','oxpCC','Failed\x20to\x20create\x20feature\x20review:\x20','TpRhx','Zcppy','Feature\x20limit\x20exceeded','FliRb','dYoue','YUfXg','VNOYD','/api/v1/mcp/features/','Failed\x20to\x20conclude\x20session:\x20','gitBranch','156305SQYkFS','190692lmtTGq','text','Failed\x20to\x20update\x20scenario:\x20','Failed\x20to\x20get\x20feature\x20review:\x20','hbCEO','style','PATCH','status','limit','/conclude','Failed\x20to\x20start\x20session:\x20','niVxK','1979OgWAmJ','42dUXbqx','POST','mKfao','bBkbH','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','207QccVrf','PrIsJ','application/json','stringify','11JtyvAe','length','billingUrl','TncBb','GET','4484230TEwcAy'];_0x3e5a=function(){return _0x349c16;};return _0x3e5a();}import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';function _0x951c(_0x2ec3b1,_0x702528){_0x2ec3b1=_0x2ec3b1-0x105;const _0x3e5a97=_0x3e5a();let _0x951cee=_0x3e5a97[_0x2ec3b1];return _0x951cee;}export async function createFeature(_0x190fd6){const _0x2b38a7=_0x951c,_0x21b8d3={'bPkqw':function(_0x1c404e){return _0x1c404e();},'QLHyN':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','DJMXY':'https://dashboard.ranger.net/billing','hwDSz':_0x2b38a7(0x13c)},_0x2cfece=await _0x21b8d3[_0x2b38a7(0x11b)](getToken);if(!_0x2cfece)throw new Error(_0x21b8d3['QLHyN']);const _0x13a683=_0x21b8d3[_0x2b38a7(0x11b)](getApiBaseUrl),_0x36abf0=await fetch(_0x13a683+_0x2b38a7(0x135),{'method':_0x2b38a7(0x106),'headers':{'Authorization':_0x2b38a7(0x114)+_0x2cfece,'Content-Type':'application/json'},'body':JSON['stringify'](_0x190fd6)});if(!_0x36abf0['ok']){if(_0x36abf0[_0x2b38a7(0x14c)]===0x192){const _0x3f5b0e=await _0x36abf0[_0x2b38a7(0x11d)](),_0x1b9ec7=_0x3f5b0e[_0x2b38a7(0x110)]||_0x21b8d3['DJMXY'];throw new Error((_0x3f5b0e['message']||_0x21b8d3[_0x2b38a7(0x116)])+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x1b9ec7);}const _0x10edf8=await _0x36abf0['text']();throw new Error(_0x2b38a7(0x139)+_0x10edf8);}return _0x36abf0[_0x2b38a7(0x11d)]();}export async function listFeatures(_0x36a943){const _0x24d048=_0x951c,_0x159629=await getToken();if(!_0x159629)throw new Error(_0x24d048(0x109));const _0x272ae1=getApiBaseUrl(),_0x4653ec=new URLSearchParams();if(_0x36a943?.['gitRepoUrl'])_0x4653ec['set']('gitRepoUrl',_0x36a943['gitRepoUrl']);if(_0x36a943?.[_0x24d048(0x143)])_0x4653ec['set'](_0x24d048(0x143),_0x36a943[_0x24d048(0x143)]);if(_0x36a943?.['limit'])_0x4653ec['set'](_0x24d048(0x14d),_0x36a943['limit'][_0x24d048(0x134)]());if(_0x36a943?.[_0x24d048(0x12d)])_0x4653ec['set'](_0x24d048(0x12d),_0x36a943['offset'][_0x24d048(0x134)]());if(_0x36a943?.['includeDeleted'])_0x4653ec[_0x24d048(0x121)]('includeDeleted','true');const _0x51d63d=_0x272ae1+'/api/v1/mcp/features'+(_0x4653ec['toString']()?'?'+_0x4653ec[_0x24d048(0x134)]():''),_0x4cf4a0=await fetch(_0x51d63d,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x159629}});if(!_0x4cf4a0['ok']){const _0x3abcb0=await _0x4cf4a0[_0x24d048(0x146)]();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x3abcb0);}return _0x4cf4a0['json']();}export async function getFeature(_0x25864b){const _0x23d536=_0x951c,_0xa69ae7={'TTJYV':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','pYSEk':function(_0x18c2bd){return _0x18c2bd();},'oBooP':function(_0x3758e8,_0x21f59b,_0x4a7d1a){return _0x3758e8(_0x21f59b,_0x4a7d1a);}},_0x2a94b2=await getToken();if(!_0x2a94b2)throw new Error(_0xa69ae7['TTJYV']);const _0x1e9fd5=_0xa69ae7[_0x23d536(0x130)](getApiBaseUrl),_0x6c3df1=await _0xa69ae7['oBooP'](fetch,_0x1e9fd5+_0x23d536(0x141)+_0x25864b,{'method':'GET','headers':{'Authorization':_0x23d536(0x114)+_0x2a94b2}});if(!_0x6c3df1['ok']){const _0x12a4ff=await _0x6c3df1[_0x23d536(0x146)]();throw new Error(_0x23d536(0x148)+_0x12a4ff);}return _0x6c3df1[_0x23d536(0x11d)]();}export async function updateFeature(_0x3d2fd7,_0x4cc37a){const _0x121ede=_0x951c,_0x56fd07={'uYMiw':function(_0x26ecb9){return _0x26ecb9();},'oxpCC':function(_0x1f43d1,_0x14810d,_0x33d96a){return _0x1f43d1(_0x14810d,_0x33d96a);},'FliRb':'PATCH'},_0x21ca2f=await _0x56fd07['uYMiw'](getToken);if(!_0x21ca2f)throw new Error(_0x121ede(0x109));const _0x31a1b9=getApiBaseUrl(),_0x2523cd=await _0x56fd07[_0x121ede(0x138)](fetch,_0x31a1b9+'/api/v1/mcp/features/'+_0x3d2fd7,{'method':_0x56fd07[_0x121ede(0x13d)],'headers':{'Authorization':_0x121ede(0x114)+_0x21ca2f,'Content-Type':'application/json'},'body':JSON[_0x121ede(0x10d)](_0x4cc37a)});if(!_0x2523cd['ok']){const _0x54fe1d=await _0x2523cd['text']();throw new Error(_0x121ede(0x118)+_0x54fe1d);}return _0x2523cd['json']();}export async function createChecklistItem(_0x2032e3,_0x265828,_0x570380){const _0x312624=_0x951c,_0x3dc530={'AjVlf':function(_0x358487){return _0x358487();},'hbCEO':function(_0x383c27,_0x52e28e,_0x28a671){return _0x383c27(_0x52e28e,_0x28a671);},'YUfXg':'POST'},_0xf93556=await _0x3dc530[_0x312624(0x11c)](getToken);if(!_0xf93556)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3c1d1d=_0x3dc530[_0x312624(0x11c)](getApiBaseUrl),_0x38e573=await _0x3dc530[_0x312624(0x149)](fetch,_0x3c1d1d+_0x312624(0x141)+_0x2032e3+'/checklist',{'method':_0x3dc530[_0x312624(0x13f)],'headers':{'Authorization':'Bearer\x20'+_0xf93556,'Content-Type':'application/json'},'body':JSON['stringify']({'description':_0x265828,'position':_0x570380})});if(!_0x38e573['ok']){const _0x551852=await _0x38e573['text']();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x551852);}return _0x38e573[_0x312624(0x11d)]();}export async function updateChecklistItem(_0x12f257,_0x19dcd9,_0x408a83){const _0x5ca030=_0x951c,_0x4594eb={'TncBb':function(_0x38be85){return _0x38be85();},'lXVWb':_0x5ca030(0x109),'tdfMX':function(_0x3cb469){return _0x3cb469();}};return withRetry(async()=>{const _0x293098=_0x5ca030,_0x5b6bb8=await _0x4594eb[_0x293098(0x111)](getToken);if(!_0x5b6bb8)throw new Error(_0x4594eb[_0x293098(0x12e)]);const _0x1da1e9=_0x4594eb['tdfMX'](getApiBaseUrl),_0x32c3ac=await fetch(_0x1da1e9+'/api/v1/mcp/features/'+_0x12f257+'/checklist/'+_0x19dcd9,{'method':_0x293098(0x14b),'headers':{'Authorization':_0x293098(0x114)+_0x5b6bb8,'Content-Type':_0x293098(0x10c)},'body':JSON[_0x293098(0x10d)](_0x408a83)});if(!_0x32c3ac['ok']){const _0x4fd8ee=await _0x32c3ac[_0x293098(0x146)]();throw new Error(_0x293098(0x147)+_0x4fd8ee);}return _0x32c3ac[_0x293098(0x11d)]();},{'label':'updateChecklistItem'});}export async function getFeatureReport(_0x2cf6c6){const _0x21d94f=_0x951c,_0x5ad24e={'XCgTr':function(_0x47c45b){return _0x47c45b();},'WwhOe':_0x21d94f(0x112)},_0x3999b8=await _0x5ad24e[_0x21d94f(0x129)](getToken);if(!_0x3999b8)throw new Error(_0x21d94f(0x109));const _0x5563f2=getApiBaseUrl(),_0x239496=await fetch(_0x5563f2+_0x21d94f(0x141)+_0x2cf6c6+'/report',{'method':_0x5ad24e['WwhOe'],'headers':{'Authorization':_0x21d94f(0x114)+_0x3999b8}});if(!_0x239496['ok']){const _0x692870=await _0x239496[_0x21d94f(0x146)]();throw new Error(_0x21d94f(0x120)+_0x692870);}return _0x239496['json']();}export async function getFeatureReportMarkdown(_0x2650b8,_0x85677b){const _0x38c3b2=_0x951c,_0x14cb2f={'AXxRP':_0x38c3b2(0x109),'hsvvL':function(_0x190062){return _0x190062();},'KqTsa':function(_0x289c91,_0x32294b){return _0x289c91>_0x32294b;},'xGHdj':_0x38c3b2(0x12a),'qdUzR':'style'},_0x4ae781=await getToken();if(!_0x4ae781)throw new Error(_0x14cb2f['AXxRP']);const _0xa055d6=_0x14cb2f['hsvvL'](getApiBaseUrl),_0x300205=new URLSearchParams(),_0x49ea69=_0x14cb2f['KqTsa'](_0x85677b?.[_0x38c3b2(0x117)]?.[_0x38c3b2(0x10f)]??0x0,0x0),_0x17ba1b=Boolean(_0x85677b?.[_0x38c3b2(0x12a)]);_0x49ea69&&_0x85677b?.[_0x38c3b2(0x117)]&&_0x300205[_0x38c3b2(0x121)]('itemIds',_0x85677b['itemIds'][_0x38c3b2(0x133)](','));_0x17ba1b&&_0x85677b?.['sessionId']&&_0x300205[_0x38c3b2(0x121)](_0x14cb2f[_0x38c3b2(0x124)],_0x85677b['sessionId']);!_0x49ea69&&!_0x17ba1b&&_0x85677b?.[_0x38c3b2(0x14a)]&&_0x300205['set'](_0x14cb2f[_0x38c3b2(0x12b)],_0x85677b['style']);const _0x513c43=_0xa055d6+_0x38c3b2(0x141)+_0x2650b8+'/report/markdown',_0x9cc59f=''+_0x513c43+(_0x300205['toString']()?'?'+_0x300205['toString']():''),_0xf4f316=await fetch(_0x9cc59f,{'method':_0x38c3b2(0x112),'headers':{'Authorization':_0x38c3b2(0x114)+_0x4ae781}});if(!_0xf4f316['ok']){const _0xd1a057=await _0xf4f316[_0x38c3b2(0x146)]();throw new Error(_0x38c3b2(0x126)+_0xd1a057);}return _0xf4f316['text']();}export async function listFeatureSessions(_0x3a8db8){const _0x34b75e=_0x951c,_0x32c575={'dYoue':function(_0xbe93c6){return _0xbe93c6();},'RdeXu':_0x34b75e(0x109),'qpscu':function(_0x331e3e,_0x58485e,_0x30a352){return _0x331e3e(_0x58485e,_0x30a352);},'bBkbH':_0x34b75e(0x112)},_0x691827=await _0x32c575[_0x34b75e(0x13e)](getToken);if(!_0x691827)throw new Error(_0x32c575['RdeXu']);const _0x25b692=getApiBaseUrl(),_0x3f4b0b=await _0x32c575[_0x34b75e(0x131)](fetch,_0x25b692+_0x34b75e(0x141)+_0x3a8db8+_0x34b75e(0x137),{'method':_0x32c575[_0x34b75e(0x108)],'headers':{'Authorization':_0x34b75e(0x114)+_0x691827}});if(!_0x3f4b0b['ok']){const _0x17a3c8=await _0x3f4b0b['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x17a3c8);}return _0x3f4b0b[_0x34b75e(0x11d)]();}export async function startSession(_0x363b58,_0x4f04bb){const _0xd6e623=_0x951c,_0x4ae348={'PrIsJ':function(_0x3a272a){return _0x3a272a();},'VNOYD':_0xd6e623(0x106)},_0x28af1b=await _0x4ae348[_0xd6e623(0x10b)](getToken);if(!_0x28af1b)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x17bf6c=getApiBaseUrl(),_0x301466=await fetch(_0x17bf6c+'/api/v1/mcp/features/'+_0x363b58+_0xd6e623(0x128)+_0x4f04bb+_0xd6e623(0x12f),{'method':_0x4ae348[_0xd6e623(0x140)],'headers':{'Authorization':'Bearer\x20'+_0x28af1b}});if(!_0x301466['ok']){const _0x3b2d3e=await _0x301466[_0xd6e623(0x146)]();throw new Error(_0xd6e623(0x14f)+_0x3b2d3e);}return _0x301466[_0xd6e623(0x11d)]();}export async function concludeSession(_0x3a62df,_0x258d4e){const _0x4a4685=_0x951c,_0x4efb2a={'Zcppy':function(_0x44bf09){return _0x44bf09();},'ulgLA':function(_0x416cd8){return _0x416cd8();},'mKfao':function(_0x35a8d3,_0x55a581,_0x23d70a){return _0x35a8d3(_0x55a581,_0x23d70a);}},_0x1802de=await _0x4efb2a[_0x4a4685(0x13b)](getToken);if(!_0x1802de)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x46a75f=_0x4efb2a['ulgLA'](getApiBaseUrl),_0x240a2e=await _0x4efb2a[_0x4a4685(0x107)](fetch,_0x46a75f+'/api/v1/mcp/features/'+_0x3a62df+_0x4a4685(0x128)+_0x258d4e+_0x4a4685(0x14e),{'method':_0x4a4685(0x106),'headers':{'Authorization':'Bearer\x20'+_0x1802de}});if(!_0x240a2e['ok']){const _0x81cda3=await _0x240a2e['text']();throw new Error(_0x4a4685(0x142)+_0x81cda3);}return _0x240a2e['json']();}export async function getActionItems(_0x464fba){const _0xb8c1c7=_0x951c,_0x5e5eef={'dXIsZ':function(_0x11f331){return _0x11f331();},'kYfoK':_0xb8c1c7(0x112)},_0x567c32=await getToken();if(!_0x567c32)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x6f0cd=_0x5e5eef['dXIsZ'](getApiBaseUrl),_0xd81811=await fetch(_0x6f0cd+_0xb8c1c7(0x141)+_0x464fba+'/action-items',{'method':_0x5e5eef[_0xb8c1c7(0x11f)],'headers':{'Authorization':_0xb8c1c7(0x114)+_0x567c32}});if(!_0xd81811['ok']){const _0x97098=await _0xd81811['text']();throw new Error(_0xb8c1c7(0x115)+_0x97098);}return _0xd81811['json']();}export async function getItemFeedback(_0x20054b,_0x3fc8f5){const _0x1d85d3=_0x951c,_0x15a2d9={'TpRhx':function(_0x35aa1e){return _0x35aa1e();},'xGFwW':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','nhupD':function(_0x518850,_0x4695c8,_0x403b06){return _0x518850(_0x4695c8,_0x403b06);}},_0x6e60cf=await _0x15a2d9['TpRhx'](getToken);if(!_0x6e60cf)throw new Error(_0x15a2d9['xGFwW']);const _0x2291cb=_0x15a2d9[_0x1d85d3(0x13a)](getApiBaseUrl),_0x4cd9b5=await _0x15a2d9['nhupD'](fetch,_0x2291cb+_0x1d85d3(0x141)+_0x20054b+'/checklist-items/'+_0x3fc8f5+'/feedback',{'method':_0x1d85d3(0x112),'headers':{'Authorization':'Bearer\x20'+_0x6e60cf}});if(!_0x4cd9b5['ok']){const _0x5585c4=await _0x4cd9b5['text']();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x5585c4);}return _0x4cd9b5[_0x1d85d3(0x11d)]();}export async function markCommentsAddressed(_0x4e86a7,_0x52f010,_0x162f48){const _0x952f97=_0x951c,_0x5438d9={'EVPma':function(_0x51985a){return _0x51985a();},'kmhlF':'POST','LPWbi':'application/json'},_0x31a7ef=await getToken();if(!_0x31a7ef)throw new Error(_0x952f97(0x109));const _0x77ba4=_0x5438d9[_0x952f97(0x122)](getApiBaseUrl),_0x17bf0b=await fetch(_0x77ba4+'/api/v1/mcp/features/'+_0x4e86a7+_0x952f97(0x125),{'method':_0x5438d9[_0x952f97(0x11a)],'headers':{'Authorization':_0x952f97(0x114)+_0x31a7ef,'Content-Type':_0x5438d9['LPWbi']},'body':JSON[_0x952f97(0x10d)]({'checklistItemId':_0x52f010,'commentIds':_0x162f48})});if(!_0x17bf0b['ok']){const _0x2d0b56=await _0x17bf0b[_0x952f97(0x146)]();throw new Error(_0x952f97(0x123)+_0x2d0b56);}}export async function softDeleteFeature(_0x39f42c){const _0x2d5da4=_0x951c,_0x1fe540=await getToken();if(!_0x1fe540)throw new Error(_0x2d5da4(0x109));const _0x290f24=getApiBaseUrl(),_0x3e2d8c=await fetch(_0x290f24+_0x2d5da4(0x141)+_0x39f42c,{'method':'DELETE','headers':{'Authorization':_0x2d5da4(0x114)+_0x1fe540}});if(!_0x3e2d8c['ok']){const _0x2b1ef7=await _0x3e2d8c['text']();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x2b1ef7);}}export async function restoreFeature(_0x255d74){const _0x3cb63f=_0x951c,_0x121e67={'niVxK':function(_0x535d8b){return _0x535d8b();}},_0x1f5e76=await getToken();if(!_0x1f5e76)throw new Error(_0x3cb63f(0x109));const _0x310361=_0x121e67[_0x3cb63f(0x150)](getApiBaseUrl),_0x164984=await fetch(_0x310361+_0x3cb63f(0x141)+_0x255d74+'/restore',{'method':'POST','headers':{'Authorization':_0x3cb63f(0x114)+_0x1f5e76}});if(!_0x164984['ok']){const _0x399f93=await _0x164984[_0x3cb63f(0x146)]();throw new Error(_0x3cb63f(0x12c)+_0x399f93);}}
@@ -1 +1 @@
1
- function _0x5555(){const _0x21d302=['zlxBW','hibVs','YXfLw','584nxjrbC','UWvqu','alloc','min','MDTmz','CCwDc','Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','XeYQR','fvfvf','CARRy','idLen','CqMqO','cdWEe','180XJLKol','writeDoubleBE','iWYFO','mDWXZ','nfALs','jsdbY','abuok','205102VYnUpP','1455BQTZca','fHTcS','QcvYE','GOuha','VqXnn','sizeLen','Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>','geEvM','slice','QLqgJ','argv','PBDBe','JMwqa','from','dataSize','mwuSt','VKMAv','FauBK','aBsKU','ldXMT','pow','82243GcSdqe','2112456igAVVI','fixWebmDuration.js','error','readInt16BE','qVADU','Could\x20not\x20compute\x20duration','13551970jvxhpF','offset','log','Could\x20not\x20find\x20Info\x20element','5799450mraSsW','length','7577154DYjkGW','yIPdE','fJJQD','wcodu','4rPkUhK','ucBAP','RwLyE','dataOffset','bQGFN','XIBbx','concat','XxZSP','fkfXQ'];_0x5555=function(){return _0x21d302;};return _0x5555();}const _0x18d6f8=_0x3321;(function(_0x18ee5f,_0x228723){const _0x1be284=_0x3321,_0x8b76c9=_0x18ee5f();while(!![]){try{const _0x24a499=parseInt(_0x1be284(0x135))/0x1*(-parseInt(_0x1be284(0x155))/0x2)+parseInt(_0x1be284(0x16c))/0x3+parseInt(_0x1be284(0x14e))/0x4*(-parseInt(_0x1be284(0x156))/0x5)+-parseInt(_0x1be284(0x12f))/0x6+-parseInt(_0x1be284(0x16b))/0x7*(-parseInt(_0x1be284(0x141))/0x8)+-parseInt(_0x1be284(0x131))/0x9+parseInt(_0x1be284(0x172))/0xa;if(_0x24a499===_0x228723)break;else _0x8b76c9['push'](_0x8b76c9['shift']());}catch(_0x917675){_0x8b76c9['push'](_0x8b76c9['shift']());}}}(_0x5555,0xa74be));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(_0x1edfd8,_0x265cc4){const _0x3821e4=_0x3321,_0x39bfc9={'YXfLw':function(_0xd092a,_0x3d0ae8){return _0xd092a>=_0x3d0ae8;},'AIITa':function(_0x2256a3,_0x12823a){return _0x2256a3&_0x12823a;},'mDWXZ':function(_0x1248bd,_0x3d09fc){return _0x1248bd-_0x3d09fc;},'jsdbY':function(_0x34bee0,_0x5c6efb){return _0x34bee0+_0x5c6efb;},'PKzKd':function(_0x3805d5,_0x40772d){return _0x3805d5*_0x40772d;}};if(_0x39bfc9[_0x3821e4(0x140)](_0x265cc4,_0x1edfd8['length']))return[0x0,0x0];const _0x41bcc0=_0x1edfd8[_0x265cc4];let _0x13874b=0x1,_0x21c94e=0x80;while(_0x13874b<=0x8&&!_0x39bfc9['AIITa'](_0x41bcc0,_0x21c94e)){_0x13874b++,_0x21c94e>>=0x1;}if(_0x265cc4+_0x13874b>_0x1edfd8['length'])return[0x0,0x0];let _0x31ff4c=_0x39bfc9['AIITa'](_0x41bcc0,_0x39bfc9[_0x3821e4(0x151)](_0x21c94e,0x1));for(let _0x290175=0x1;_0x290175<_0x13874b;_0x290175++){_0x31ff4c=_0x39bfc9[_0x3821e4(0x153)](_0x39bfc9['PKzKd'](_0x31ff4c,0x100),_0x1edfd8[_0x265cc4+_0x290175]);}return[_0x31ff4c,_0x13874b];}function readId(_0x56a47d,_0x405385){const _0x237f87=_0x3321,_0x27923a={'BXNwB':function(_0x17b874,_0x449d7d){return _0x17b874>=_0x449d7d;},'bQGFN':function(_0x1b43ec,_0x4e9640){return _0x1b43ec<_0x4e9640;},'AkTpz':function(_0x12f3bb,_0x32ae16){return _0x12f3bb+_0x32ae16;}};if(_0x405385>=_0x56a47d[_0x237f87(0x130)])return[0x0,0x0];const _0x3e6b0f=_0x56a47d[_0x405385];let _0x2945ac;if(_0x3e6b0f>=0x80)_0x2945ac=0x1;else{if(_0x27923a['BXNwB'](_0x3e6b0f,0x40))_0x2945ac=0x2;else{if(_0x3e6b0f>=0x20)_0x2945ac=0x3;else{if(_0x3e6b0f>=0x10)_0x2945ac=0x4;else return[_0x3e6b0f,0x1];}}}if(_0x405385+_0x2945ac>_0x56a47d[_0x237f87(0x130)])return[0x0,0x0];let _0x7e0477=0x0;for(let _0x1c16a2=0x0;_0x27923a[_0x237f87(0x139)](_0x1c16a2,_0x2945ac);_0x1c16a2++){_0x7e0477=_0x27923a['AkTpz'](_0x7e0477*0x100,_0x56a47d[_0x27923a['AkTpz'](_0x405385,_0x1c16a2)]);}return[_0x7e0477,_0x2945ac];}function readUint(_0x320f1a,_0x243949,_0x147946){const _0x1f68fc=_0x3321,_0x4461a7={'CARRy':function(_0x412884,_0x37770d){return _0x412884<_0x37770d;},'LKALg':function(_0x381563,_0x5dcf62){return _0x381563*_0x5dcf62;}};let _0x1cf27c=0x0;for(let _0x52da7b=0x0;_0x4461a7[_0x1f68fc(0x14a)](_0x52da7b,_0x147946);_0x52da7b++){_0x1cf27c=_0x4461a7['LKALg'](_0x1cf27c,0x100)+_0x320f1a[_0x243949+_0x52da7b];}return _0x1cf27c;}function isUnknownSize(_0x55c993,_0x5894a9){return _0x55c993===Math['pow'](0x2,0x7*_0x5894a9)-0x1;}function _0x3321(_0x40fe76,_0x4ff09b){_0x40fe76=_0x40fe76-0x12c;const _0x5555a1=_0x5555();let _0x33210e=_0x5555a1[_0x40fe76];return _0x33210e;}function writeId(_0x3950e2){const _0x2b2cfb=_0x3321,_0x30a773={'revhM':function(_0x578eda,_0x256359){return _0x578eda<=_0x256359;},'hibVs':function(_0x53ddcc,_0x50020e){return _0x53ddcc>>_0x50020e;},'AHKQk':function(_0xa38ffa,_0x34aa84){return _0xa38ffa&_0x34aa84;},'VYhwk':function(_0x4510e6,_0x4ef667){return _0x4510e6<=_0x4ef667;},'cdWEe':function(_0x459715,_0x5c9d5e){return _0x459715&_0x5c9d5e;},'BiPOY':function(_0x5cfec6,_0x1bf459){return _0x5cfec6>>_0x1bf459;},'HUWUJ':function(_0x23de38,_0x4f94af){return _0x23de38&_0x4f94af;}};if(_0x30a773['revhM'](_0x3950e2,0xff))return Buffer[_0x2b2cfb(0x163)]([_0x3950e2]);if(_0x3950e2<=0xffff)return Buffer[_0x2b2cfb(0x163)]([_0x30a773[_0x2b2cfb(0x13f)](_0x3950e2,0x8)&0xff,_0x30a773['AHKQk'](_0x3950e2,0xff)]);if(_0x30a773['VYhwk'](_0x3950e2,0xffffff))return Buffer[_0x2b2cfb(0x163)]([_0x30a773['cdWEe'](_0x30a773['BiPOY'](_0x3950e2,0x10),0xff),_0x30a773['BiPOY'](_0x3950e2,0x8)&0xff,_0x3950e2&0xff]);return Buffer[_0x2b2cfb(0x163)]([_0x3950e2>>0x18&0xff,_0x3950e2>>0x10&0xff,_0x30a773[_0x2b2cfb(0x14d)](_0x3950e2>>0x8,0xff),_0x30a773['HUWUJ'](_0x3950e2,0xff)]);}function writeVint(_0x268520,_0x16b565){const _0x5cc9aa=_0x3321,_0x5f0d62={'yIPdE':function(_0x1a7712,_0x53f003){return _0x1a7712||_0x53f003;},'XIBbx':function(_0x10a6b1,_0x53b5de){return _0x10a6b1-_0x53b5de;},'SYuFa':function(_0x4a3e5b,_0x5114ef){return _0x4a3e5b>=_0x5114ef;},'ldXMT':function(_0x41b111,_0x42ad5f){return _0x41b111&_0x42ad5f;},'plBPt':function(_0x24f967,_0x458dbc){return _0x24f967<<_0x458dbc;}};let _0x17e0ac=_0x5f0d62[_0x5cc9aa(0x132)](_0x16b565,0x1);while(_0x5f0d62[_0x5cc9aa(0x13a)](Math[_0x5cc9aa(0x16a)](0x2,0x7*_0x17e0ac),0x2)<_0x268520)_0x17e0ac++;const _0x333718=Buffer[_0x5cc9aa(0x143)](_0x17e0ac);for(let _0x5c39fe=_0x17e0ac-0x1;_0x5f0d62['SYuFa'](_0x5c39fe,0x0);_0x5c39fe--){_0x333718[_0x5c39fe]=_0x5f0d62[_0x5cc9aa(0x169)](_0x268520,0xff),_0x268520=Math['floor'](_0x268520/0x100);}return _0x333718[0x0]|=_0x5f0d62['plBPt'](0x1,0x8-_0x17e0ac),_0x333718;}function writeFloat64(_0x212d97){const _0xb46e7e=_0x3321,_0x31c68a=Buffer['alloc'](0x8);return _0x31c68a[_0xb46e7e(0x14f)](_0x212d97,0x0),_0x31c68a;}function writeVoid(_0x502080){const _0x204d42=_0x3321,_0x40b86={'MDTmz':function(_0x287a31,_0x4ce68d){return _0x287a31-_0x4ce68d;},'GPFHt':function(_0x12be14,_0x3843b1){return _0x12be14*_0x3843b1;}};for(let _0x2cfd90=0x1;_0x2cfd90<=0x8;_0x2cfd90++){const _0x5053cb=_0x502080-0x1-_0x2cfd90;if(_0x5053cb>=0x0&&_0x5053cb<=_0x40b86[_0x204d42(0x145)](Math[_0x204d42(0x16a)](0x2,_0x40b86['GPFHt'](0x7,_0x2cfd90)),0x2))return Buffer['concat']([Buffer[_0x204d42(0x163)]([ID_VOID]),writeVint(_0x5053cb,_0x2cfd90),Buffer[_0x204d42(0x143)](_0x5053cb)]);}return Buffer[_0x204d42(0x143)](0x0);}function findElement(_0xad56c5,_0x11cd3,_0x94051f,_0xb0545e){const _0x53b9b2=_0x3321,_0x242a76={'fvfvf':function(_0x60fd35,_0x5d8c08,_0x5ee99a){return _0x60fd35(_0x5d8c08,_0x5ee99a);},'VKMAv':function(_0x25e8dd,_0x57fffd){return _0x25e8dd+_0x57fffd;},'CCwDc':function(_0x405c6e,_0xe6e2dd,_0x5c2e60){return _0x405c6e(_0xe6e2dd,_0x5c2e60);}};let _0x2197b0=_0x11cd3;while(_0x2197b0<_0x94051f){const [_0x49165a,_0x236ae0]=_0x242a76[_0x53b9b2(0x149)](readId,_0xad56c5,_0x2197b0),[_0x146613,_0x2131d6]=readVint(_0xad56c5,_0x2197b0+_0x236ae0);if(_0x49165a===_0xb0545e)return{'offset':_0x2197b0,'idLen':_0x236ae0,'sizeLen':_0x2131d6,'dataSize':_0x146613,'dataOffset':_0x242a76[_0x53b9b2(0x166)](_0x2197b0,_0x236ae0)+_0x2131d6};if(_0x242a76[_0x53b9b2(0x146)](isUnknownSize,_0x146613,_0x2131d6))break;_0x2197b0+=_0x242a76[_0x53b9b2(0x166)](_0x236ae0+_0x2131d6,_0x146613);}return null;}function computeDurationMs(_0x45bb3c,_0x433b09){const _0x2de665=_0x3321,_0x93bbba={'aBsKU':function(_0x26e666,_0x2b7de8){return _0x26e666===_0x2b7de8;},'XxZSP':function(_0x5ddd45,_0x2ef292){return _0x5ddd45!==_0x2ef292;},'abuok':function(_0x562a77,_0x4d87e5,_0x1357b7){return _0x562a77(_0x4d87e5,_0x1357b7);},'PBDBe':function(_0x2cbcdb,_0x50e984){return _0x2cbcdb<_0x50e984;},'UWvqu':function(_0x163c78,_0x438048){return _0x163c78+_0x438048;},'CqMqO':function(_0x26d4c8,_0x4e9fe2,_0x3daca7){return _0x26d4c8(_0x4e9fe2,_0x3daca7);},'XeYQR':function(_0xb8c7ad,_0x56ef87){return _0xb8c7ad+_0x56ef87;},'qVADU':function(_0x16b3e4,_0x2b6a97){return _0x16b3e4>=_0x2b6a97;},'VqXnn':function(_0x297540,_0x3e2c3d,_0x2626de){return _0x297540(_0x3e2c3d,_0x2626de);},'oASHe':function(_0x104ae4,_0x487c24){return _0x104ae4*_0x487c24;},'geEvM':function(_0x4eb32c,_0x11f89d){return _0x4eb32c===_0x11f89d;},'YFRLc':function(_0x135fc0,_0x3793ee){return _0x135fc0+_0x3793ee;},'WKPmw':function(_0x2d79f9,_0x51328c){return _0x2d79f9+_0x51328c;}};let _0x31ce6c=0x0;const _0x26710d=Buffer[_0x2de665(0x163)]([0x1f,0x43,0xb6,0x75]);let _0x3d0bd1=_0x45bb3c['indexOf'](_0x26710d);if(_0x93bbba[_0x2de665(0x168)](_0x3d0bd1,-0x1))return 0x0;while(_0x3d0bd1<_0x45bb3c[_0x2de665(0x130)]){const [_0x364c77,_0x1a79bb]=readId(_0x45bb3c,_0x3d0bd1);if(_0x93bbba[_0x2de665(0x13c)](_0x364c77,ID_CLUSTER))break;const [_0xe0994,_0x4e581c]=_0x93bbba['abuok'](readVint,_0x45bb3c,_0x3d0bd1+_0x1a79bb),_0x22debd=_0x3d0bd1+_0x1a79bb+_0x4e581c,_0x178ed9=isUnknownSize(_0xe0994,_0x4e581c);let _0x42ab41;if(_0x178ed9){let _0x516155=_0x22debd;while(_0x93bbba['PBDBe'](_0x516155,_0x45bb3c['length']-0x4)){const [_0x3603dd,_0xe3f202]=readId(_0x45bb3c,_0x516155);if(_0x93bbba[_0x2de665(0x168)](_0x3603dd,ID_CLUSTER)){_0x42ab41=_0x516155;break;}const [_0x594a22,_0x4cac43]=_0x93bbba[_0x2de665(0x154)](readVint,_0x45bb3c,_0x93bbba['UWvqu'](_0x516155,_0xe3f202));if(_0x93bbba[_0x2de665(0x14c)](isUnknownSize,_0x594a22,_0x4cac43)){_0x42ab41=_0x45bb3c[_0x2de665(0x130)];break;}_0x516155+=_0x93bbba['UWvqu'](_0x93bbba[_0x2de665(0x148)](_0xe3f202,_0x4cac43),_0x594a22);}_0x42ab41??=_0x45bb3c['length'];}else _0x42ab41=_0x93bbba[_0x2de665(0x142)](_0x22debd,_0xe0994);let _0x26c0f1=0x0,_0x4653df=_0x22debd;while(_0x93bbba[_0x2de665(0x161)](_0x4653df,_0x42ab41)){const [_0x2b183c,_0x40fe95]=readId(_0x45bb3c,_0x4653df),[_0x3f11ab,_0x342d5d]=readVint(_0x45bb3c,_0x4653df+_0x40fe95);if(_0x2b183c===ID_TIMESTAMP)_0x26c0f1=readUint(_0x45bb3c,_0x4653df+_0x40fe95+_0x342d5d,_0x3f11ab);else{if(_0x2b183c===ID_SIMPLE_BLOCK&&_0x93bbba[_0x2de665(0x170)](_0x3f11ab,0x4)){const _0x4a2659=_0x4653df+_0x40fe95+_0x342d5d,[,_0x4a8ec7]=_0x93bbba[_0x2de665(0x15a)](readVint,_0x45bb3c,_0x4a2659),_0x2d165f=_0x45bb3c[_0x2de665(0x16f)](_0x4a2659+_0x4a8ec7),_0x460580=_0x93bbba['oASHe'](_0x26c0f1+_0x2d165f,_0x433b09)/0xf4240;_0x460580>_0x31ce6c&&(_0x31ce6c=_0x460580);}else{if(_0x93bbba[_0x2de665(0x15d)](_0x2b183c,ID_CLUSTER))break;}}if(isUnknownSize(_0x3f11ab,_0x342d5d))break;_0x4653df+=_0x93bbba['YFRLc'](_0x93bbba['WKPmw'](_0x40fe95,_0x342d5d),_0x3f11ab);}_0x3d0bd1=_0x42ab41;}return _0x31ce6c;}export function fixWebmDuration(_0xa8151,_0x4fee62){const _0x3f38f3=_0x3321,_0x23d73d={'zlxBW':function(_0x4cdff0,_0x27d3c1){return _0x4cdff0(_0x27d3c1);},'QLqgJ':function(_0x111a94,_0x58ba72,_0x5aa353){return _0x111a94(_0x58ba72,_0x5aa353);},'JMwqa':function(_0x4556d2,_0xe059b9){return _0x4556d2+_0xe059b9;},'fJJQD':function(_0x43f3c0,_0x5e87b6){return _0x43f3c0+_0x5e87b6;},'QcvYE':function(_0x6f2bc7,_0x30a216){return _0x6f2bc7+_0x30a216;},'GOuha':function(_0x52f166,_0x289a6f){return _0x52f166+_0x289a6f;},'FauBK':function(_0x154331,_0xc80217,_0x27614c){return _0x154331(_0xc80217,_0x27614c);},'PIwFx':function(_0x343776,_0x32da04){return _0x343776===_0x32da04;},'fHTcS':function(_0x51d70d,_0x477921){return _0x51d70d+_0x477921;},'mwuSt':function(_0x27459f,_0x3b498b){return _0x27459f+_0x3b498b;},'RwLyE':function(_0x10a443,_0x44a827,_0x5afcfe,_0x788a0,_0x198d51){return _0x10a443(_0x44a827,_0x5afcfe,_0x788a0,_0x198d51);},'nfALs':function(_0xfb577,_0x2f5cbd){return _0xfb577<=_0x2f5cbd;},'TJEVK':function(_0x160837,_0x1e2197){return _0x160837/_0x1e2197;},'UGVcM':function(_0x5318fa,_0x7a30d7){return _0x5318fa(_0x7a30d7);},'fkfXQ':function(_0x439006,_0x521454){return _0x439006-_0x521454;},'iWYFO':function(_0x13241d,_0xdc3132){return _0x13241d<_0xdc3132;}},_0x2b1dbd=_0x23d73d[_0x3f38f3(0x13e)](readFileSync,_0xa8151);let _0x24c53e=0x0;const [_0x591e4d,_0x26eb39]=readId(_0x2b1dbd,_0x24c53e),[_0xaa1e0b,_0x31550e]=_0x23d73d[_0x3f38f3(0x15f)](readVint,_0x2b1dbd,_0x23d73d[_0x3f38f3(0x162)](_0x24c53e,_0x26eb39));_0x24c53e+=_0x23d73d[_0x3f38f3(0x133)](_0x23d73d[_0x3f38f3(0x158)](_0x26eb39,_0x31550e),_0xaa1e0b);const [_0x1a7c3a,_0x44cf20]=_0x23d73d[_0x3f38f3(0x15f)](readId,_0x2b1dbd,_0x24c53e);if(_0x1a7c3a!==ID_SEGMENT)return console[_0x3f38f3(0x16e)](_0x3f38f3(0x147)),![];const [,_0x23637e]=readVint(_0x2b1dbd,_0x24c53e+_0x44cf20),_0x2ae038=_0x23d73d[_0x3f38f3(0x159)](_0x24c53e+_0x44cf20,_0x23637e);let _0x4efcaf=_0x2ae038;const _0x5af2ff=Math[_0x3f38f3(0x144)](_0x2b1dbd['length'],_0x2ae038+0x2710);let _0x571662=null,_0x92d345=null;while(_0x4efcaf<_0x5af2ff){const [_0x5f35e5,_0x75044d]=readId(_0x2b1dbd,_0x4efcaf),[_0x336604,_0x149f68]=_0x23d73d[_0x3f38f3(0x167)](readVint,_0x2b1dbd,_0x23d73d['fJJQD'](_0x4efcaf,_0x75044d));_0x23d73d['PIwFx'](_0x5f35e5,ID_VOID)&&!_0x571662&&(_0x571662={'offset':_0x4efcaf,'idLen':_0x75044d,'sizeLen':_0x149f68,'dataSize':_0x336604,'dataOffset':_0x23d73d[_0x3f38f3(0x157)](_0x23d73d[_0x3f38f3(0x133)](_0x4efcaf,_0x75044d),_0x149f68)});if(_0x5f35e5===ID_INFO){_0x92d345={'offset':_0x4efcaf,'idLen':_0x75044d,'sizeLen':_0x149f68,'dataSize':_0x336604,'dataOffset':_0x23d73d[_0x3f38f3(0x165)](_0x4efcaf,_0x75044d)+_0x149f68};break;}if(_0x23d73d['PIwFx'](_0x5f35e5,ID_CLUSTER))break;if(isUnknownSize(_0x336604,_0x149f68))break;_0x4efcaf+=_0x75044d+_0x149f68+_0x336604;}if(!_0x92d345)return console[_0x3f38f3(0x16e)](_0x3f38f3(0x12e)),![];const _0x1a1ab4=_0x23d73d['RwLyE'](findElement,_0x2b1dbd,_0x92d345['dataOffset'],_0x23d73d[_0x3f38f3(0x158)](_0x92d345['dataOffset'],_0x92d345['dataSize']),ID_DURATION);if(_0x1a1ab4)return![];const _0x3b63fc=_0x23d73d[_0x3f38f3(0x137)](findElement,_0x2b1dbd,_0x92d345[_0x3f38f3(0x138)],_0x92d345[_0x3f38f3(0x138)]+_0x92d345['dataSize'],ID_TIMESTAMP_SCALE);let _0x26f43d=0xf4240;_0x3b63fc&&(_0x26f43d=readUint(_0x2b1dbd,_0x3b63fc[_0x3f38f3(0x138)],_0x3b63fc['dataSize']));const _0x3a61e=computeDurationMs(_0x2b1dbd,_0x26f43d);if(_0x23d73d[_0x3f38f3(0x152)](_0x3a61e,0x0))return console['error'](_0x3f38f3(0x171)),![];const _0x9e91d=_0x23d73d['TJEVK'](_0x3a61e*0xf4240,_0x26f43d),_0x5f2a0e=Buffer[_0x3f38f3(0x13b)]([writeId(ID_DURATION),_0x23d73d['UGVcM'](writeVint,0x8),writeFloat64(_0x9e91d)]),_0xd50b30=_0x5f2a0e['length'];if(!_0x571662||_0x571662['offset']<_0x92d345[_0x3f38f3(0x12c)]){if(_0x571662){const _0x57d41b=_0x571662[_0x3f38f3(0x14b)]+_0x571662[_0x3f38f3(0x15b)]+_0x571662[_0x3f38f3(0x164)],_0x40c4a4=_0x23d73d[_0x3f38f3(0x13d)](_0x57d41b,_0xd50b30);if(_0x23d73d[_0x3f38f3(0x150)](_0x40c4a4,0x2))return rewriteFile(_0x2b1dbd,_0x92d345,_0x5f2a0e,_0x26f43d,_0x3a61e,_0x4fee62);const _0x4677f3=_0x92d345[_0x3f38f3(0x164)]+_0xd50b30,_0x1dff10=Buffer[_0x3f38f3(0x13b)]([writeId(ID_INFO),_0x23d73d[_0x3f38f3(0x167)](writeVint,_0x4677f3,_0x92d345['sizeLen'])]),_0x5d12e8=_0x2b1dbd[_0x3f38f3(0x15e)](_0x92d345['dataOffset'],_0x23d73d['JMwqa'](_0x92d345['dataOffset'],_0x92d345[_0x3f38f3(0x164)])),_0x13ed2a=writeVoid(_0x40c4a4),_0x69bf3e=_0x2b1dbd['slice'](0x0,_0x571662['offset']),_0x18a6dc=_0x2b1dbd[_0x3f38f3(0x15e)](_0x23d73d[_0x3f38f3(0x158)](_0x92d345['dataOffset'],_0x92d345[_0x3f38f3(0x164)]));return _0x23d73d['FauBK'](writeFileSync,_0x4fee62,Buffer['concat']([_0x69bf3e,_0x13ed2a,_0x1dff10,_0x5d12e8,_0x5f2a0e,_0x18a6dc])),!![];}}return rewriteFile(_0x2b1dbd,_0x92d345,_0x5f2a0e,_0x26f43d,_0x3a61e,_0x4fee62);}function rewriteFile(_0xf4244b,_0x57687e,_0x39477d,_0x59c4df,_0x3e7f7d,_0x4c97e7){const _0x4adda4=_0x3321,_0x3f5f72={'ucBAP':function(_0x4c4188,_0x50e075){return _0x4c4188(_0x50e075);},'wcodu':function(_0x50ada4,_0x4192d6){return _0x50ada4+_0x4192d6;}},_0xf36b9c=_0x57687e[_0x4adda4(0x164)]+_0x39477d[_0x4adda4(0x130)],_0x308d93=Buffer['concat']([_0x3f5f72[_0x4adda4(0x136)](writeId,ID_INFO),writeVint(_0xf36b9c)]),_0x4edd2d=_0x57687e[_0x4adda4(0x14b)]+_0x57687e['sizeLen'],_0x2ceb74=_0xf4244b['slice'](0x0,_0x57687e[_0x4adda4(0x12c)]),_0x5c5787=_0xf4244b['slice'](_0x57687e[_0x4adda4(0x138)],_0x57687e['dataOffset']+_0x57687e[_0x4adda4(0x164)]),_0x26510f=_0xf4244b[_0x4adda4(0x15e)](_0x3f5f72[_0x4adda4(0x134)](_0x57687e[_0x4adda4(0x12c)]+_0x4edd2d,_0x57687e[_0x4adda4(0x164)]));return writeFileSync(_0x4c97e7,Buffer['concat']([_0x2ceb74,_0x308d93,_0x5c5787,_0x39477d,_0x26510f])),!![];}if(process[_0x18d6f8(0x160)][0x1]?.['endsWith']('fixWebmDuration.ts')||process['argv'][0x1]?.['endsWith'](_0x18d6f8(0x16d))){const input=process[_0x18d6f8(0x160)][0x2],output=process[_0x18d6f8(0x160)][0x3];(!input||!output)&&(console['error'](_0x18d6f8(0x15c)),process['exit'](0x1));const fixed=fixWebmDuration(input,output);fixed?console[_0x18d6f8(0x12d)]('Fixed:\x20'+output):console['log']('File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.');}
1
+ const _0x215ce7=_0x43c0;(function(_0x2fccaa,_0xbbfc8a){const _0x42fad3=_0x43c0,_0x229cd4=_0x2fccaa();while(!![]){try{const _0x44803f=parseInt(_0x42fad3(0xbc))/0x1*(-parseInt(_0x42fad3(0xec))/0x2)+-parseInt(_0x42fad3(0xbe))/0x3*(parseInt(_0x42fad3(0xcc))/0x4)+parseInt(_0x42fad3(0xbb))/0x5+parseInt(_0x42fad3(0xc1))/0x6*(parseInt(_0x42fad3(0xbd))/0x7)+-parseInt(_0x42fad3(0xb9))/0x8+parseInt(_0x42fad3(0xcb))/0x9*(parseInt(_0x42fad3(0xeb))/0xa)+parseInt(_0x42fad3(0xe3))/0xb;if(_0x44803f===_0xbbfc8a)break;else _0x229cd4['push'](_0x229cd4['shift']());}catch(_0x307f6e){_0x229cd4['push'](_0x229cd4['shift']());}}}(_0xee51,0xb1fdc));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(_0x5162f8,_0x508370){const _0x49e42e=_0x43c0,_0x9ebb3e={'nufKB':function(_0x2c9e9a,_0xb3bbdf){return _0x2c9e9a<=_0xb3bbdf;},'lFFUQ':function(_0x3afa9c,_0xc1a0e5){return _0x3afa9c&_0xc1a0e5;},'mSLfs':function(_0x1f01db,_0x189e82){return _0x1f01db>_0x189e82;},'VEIiz':function(_0x2edee5,_0xd604d7){return _0x2edee5+_0xd604d7;},'sIHTd':function(_0x3f0aba,_0x964f56){return _0x3f0aba&_0x964f56;},'dHYsJ':function(_0x25ca28,_0x3694e3){return _0x25ca28<_0x3694e3;},'YgeUx':function(_0x15b204,_0x5b08da){return _0x15b204+_0x5b08da;}};if(_0x508370>=_0x5162f8[_0x49e42e(0xb5)])return[0x0,0x0];const _0x516a82=_0x5162f8[_0x508370];let _0x2f0a8a=0x1,_0x51a0a1=0x80;while(_0x9ebb3e['nufKB'](_0x2f0a8a,0x8)&&!_0x9ebb3e['lFFUQ'](_0x516a82,_0x51a0a1)){_0x2f0a8a++,_0x51a0a1>>=0x1;}if(_0x9ebb3e['mSLfs'](_0x9ebb3e['VEIiz'](_0x508370,_0x2f0a8a),_0x5162f8['length']))return[0x0,0x0];let _0x35b1de=_0x9ebb3e[_0x49e42e(0xc6)](_0x516a82,_0x51a0a1-0x1);for(let _0x1e2188=0x1;_0x9ebb3e['dHYsJ'](_0x1e2188,_0x2f0a8a);_0x1e2188++){_0x35b1de=_0x9ebb3e[_0x49e42e(0xde)](_0x35b1de*0x100,_0x5162f8[_0x9ebb3e[_0x49e42e(0xd3)](_0x508370,_0x1e2188)]);}return[_0x35b1de,_0x2f0a8a];}function readId(_0x11bf77,_0x58aabc){const _0x521b26=_0x43c0,_0x72745={'JCxtc':function(_0x211531,_0x34c25e){return _0x211531>=_0x34c25e;},'GjnCX':function(_0x35a8b9,_0x20b45e){return _0x35a8b9+_0x20b45e;}};if(_0x58aabc>=_0x11bf77[_0x521b26(0xb5)])return[0x0,0x0];const _0x563169=_0x11bf77[_0x58aabc];let _0x2fe463;if(_0x72745[_0x521b26(0xb8)](_0x563169,0x80))_0x2fe463=0x1;else{if(_0x72745['JCxtc'](_0x563169,0x40))_0x2fe463=0x2;else{if(_0x563169>=0x20)_0x2fe463=0x3;else{if(_0x563169>=0x10)_0x2fe463=0x4;else return[_0x563169,0x1];}}}if(_0x58aabc+_0x2fe463>_0x11bf77[_0x521b26(0xb5)])return[0x0,0x0];let _0x5b2d3b=0x0;for(let _0x3adcfb=0x0;_0x3adcfb<_0x2fe463;_0x3adcfb++){_0x5b2d3b=_0x72745[_0x521b26(0xea)](_0x5b2d3b*0x100,_0x11bf77[_0x58aabc+_0x3adcfb]);}return[_0x5b2d3b,_0x2fe463];}function readUint(_0xfe2767,_0x39e03f,_0x406945){const _0x5351f2=_0x43c0,_0x299d25={'cAeGL':function(_0x968381,_0x52b272){return _0x968381<_0x52b272;},'zvhWS':function(_0x2c1cc4,_0x232580){return _0x2c1cc4+_0x232580;}};let _0x1da9f9=0x0;for(let _0x3d6ae8=0x0;_0x299d25['cAeGL'](_0x3d6ae8,_0x406945);_0x3d6ae8++){_0x1da9f9=_0x299d25[_0x5351f2(0xd0)](_0x1da9f9*0x100,_0xfe2767[_0x299d25[_0x5351f2(0xd0)](_0x39e03f,_0x3d6ae8)]);}return _0x1da9f9;}function _0x43c0(_0x2b705b,_0x31e866){_0x2b705b=_0x2b705b-0xb0;const _0xee51f8=_0xee51();let _0x43c0ea=_0xee51f8[_0x2b705b];return _0x43c0ea;}function isUnknownSize(_0x3dfb09,_0xb84723){const _0x3c86b8={'ngytX':function(_0x210802,_0x2d5904){return _0x210802*_0x2d5904;}};return _0x3dfb09===Math['pow'](0x2,_0x3c86b8['ngytX'](0x7,_0xb84723))-0x1;}function writeId(_0x54afce){const _0x254c02=_0x43c0,_0xa59969={'YLvFW':function(_0x5b4055,_0x4a51e1){return _0x5b4055<=_0x4a51e1;},'jupRg':function(_0x1d68cd,_0x4c05ec){return _0x1d68cd<=_0x4c05ec;},'VZyAM':function(_0x314440,_0x38a184){return _0x314440&_0x38a184;},'oPBit':function(_0x27cccc,_0x4347a3){return _0x27cccc<=_0x4347a3;},'mRoEh':function(_0x57bd1d,_0x550713){return _0x57bd1d>>_0x550713;},'bWBec':function(_0x38148e,_0x5d86f7){return _0x38148e>>_0x5d86f7;},'IYdFa':function(_0xe5c83a,_0x2cc2a5){return _0xe5c83a&_0x2cc2a5;},'ExqdF':function(_0x159dc3,_0x1bbd11){return _0x159dc3&_0x1bbd11;}};if(_0xa59969['YLvFW'](_0x54afce,0xff))return Buffer['from']([_0x54afce]);if(_0xa59969[_0x254c02(0xd6)](_0x54afce,0xffff))return Buffer[_0x254c02(0xcf)]([_0xa59969['VZyAM'](_0x54afce>>0x8,0xff),_0x54afce&0xff]);if(_0xa59969['oPBit'](_0x54afce,0xffffff))return Buffer[_0x254c02(0xcf)]([_0xa59969['mRoEh'](_0x54afce,0x10)&0xff,_0x54afce>>0x8&0xff,_0x54afce&0xff]);return Buffer[_0x254c02(0xcf)]([_0xa59969['bWBec'](_0x54afce,0x18)&0xff,_0xa59969['IYdFa'](_0x54afce>>0x10,0xff),_0x54afce>>0x8&0xff,_0xa59969['ExqdF'](_0x54afce,0xff)]);}function writeVint(_0xcec047,_0x38cfba){const _0x13fe85=_0x43c0,_0x23e2cf={'uXlcc':function(_0x4edd17,_0x19384a){return _0x4edd17-_0x19384a;},'sjwvo':function(_0x2bd2ac,_0x26c2ea){return _0x2bd2ac*_0x26c2ea;},'GikMw':function(_0xaee58a,_0xc23189){return _0xaee58a&_0xc23189;},'SItIX':function(_0xb336f3,_0x47af21){return _0xb336f3-_0x47af21;}};let _0x1be227=_0x38cfba||0x1;while(_0x23e2cf[_0x13fe85(0xc7)](Math[_0x13fe85(0xd2)](0x2,_0x23e2cf['sjwvo'](0x7,_0x1be227)),0x2)<_0xcec047)_0x1be227++;const _0x127b34=Buffer['alloc'](_0x1be227);for(let _0x28c03f=_0x1be227-0x1;_0x28c03f>=0x0;_0x28c03f--){_0x127b34[_0x28c03f]=_0x23e2cf[_0x13fe85(0xee)](_0xcec047,0xff),_0xcec047=Math['floor'](_0xcec047/0x100);}return _0x127b34[0x0]|=0x1<<_0x23e2cf[_0x13fe85(0xb0)](0x8,_0x1be227),_0x127b34;}function writeFloat64(_0x4b9bba){const _0x4c4663=_0x43c0,_0x2a1f91=Buffer['alloc'](0x8);return _0x2a1f91[_0x4c4663(0xce)](_0x4b9bba,0x0),_0x2a1f91;}function _0xee51(){const _0x34eb86=['1466GpoKnz','readInt16BE','GikMw','SItIX','dataOffset','eVymh','sizeLen','concat','length','Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','offset','JCxtc','7117784GgTTOo','argv','3906370piTUYo','905ZGCGpX','973952SdKeaw','343203UPuvBg','LIQJZ','Could\x20not\x20compute\x20duration','48YKUKdJ','OjkQJ','gItMu','SuJLG','pWpIe','sIHTd','uXlcc','RfroS','BEhAf','tHZWn','2043FlrqQO','4mZJqbh','cffAf','writeDoubleBE','from','zvhWS','slice','pow','YgeUx','Could\x20not\x20find\x20Info\x20element','exit','jupRg','WWkVA','oKxxH','PajeQ','xfqmX','alloc','VxPlL','nGNzI','VEIiz','uasKz','ABfth','OSibf','nHlSE','5116958oDnMSi','dataSize','rVZJy','yKURn','log','AgSyp','VHCoM','GjnCX','1630LJzfJs'];_0xee51=function(){return _0x34eb86;};return _0xee51();}function writeVoid(_0x44f21b){const _0x381fed=_0x43c0,_0x14ea99={'VHCoM':function(_0x491d03,_0x2c82ac){return _0x491d03<=_0x2c82ac;},'gncQw':function(_0x4821e9,_0x1bace9){return _0x4821e9-_0x1bace9;},'JhtNR':function(_0x36b2d1,_0x5cf248){return _0x36b2d1*_0x5cf248;}};for(let _0x232c0b=0x1;_0x14ea99[_0x381fed(0xe9)](_0x232c0b,0x8);_0x232c0b++){const _0x209b43=_0x14ea99['gncQw'](_0x44f21b,0x1)-_0x232c0b;if(_0x209b43>=0x0&&_0x14ea99['VHCoM'](_0x209b43,Math['pow'](0x2,_0x14ea99['JhtNR'](0x7,_0x232c0b))-0x2))return Buffer[_0x381fed(0xb4)]([Buffer['from']([ID_VOID]),writeVint(_0x209b43,_0x232c0b),Buffer['alloc'](_0x209b43)]);}return Buffer[_0x381fed(0xdb)](0x0);}function findElement(_0x38d4e4,_0x1632a2,_0x2b2f52,_0x241e78){const _0x7b6d77=_0x43c0,_0x1ff8b7={'LLeMT':function(_0x35f707,_0x31f8fd){return _0x35f707<_0x31f8fd;},'WWkVA':function(_0x492ce5,_0x27a1fc,_0x26bb34){return _0x492ce5(_0x27a1fc,_0x26bb34);},'hVaXI':function(_0x402899,_0x40de04){return _0x402899===_0x40de04;},'SuJLG':function(_0x59f081,_0x501194){return _0x59f081+_0x501194;},'KKzuY':function(_0x36f60a,_0x3e136e){return _0x36f60a+_0x3e136e;}};let _0x7a5693=_0x1632a2;while(_0x1ff8b7['LLeMT'](_0x7a5693,_0x2b2f52)){const [_0x1966f2,_0x261ab8]=_0x1ff8b7[_0x7b6d77(0xd7)](readId,_0x38d4e4,_0x7a5693),[_0x322a2d,_0x2ffdd7]=readVint(_0x38d4e4,_0x7a5693+_0x261ab8);if(_0x1ff8b7['hVaXI'](_0x1966f2,_0x241e78))return{'offset':_0x7a5693,'idLen':_0x261ab8,'sizeLen':_0x2ffdd7,'dataSize':_0x322a2d,'dataOffset':_0x1ff8b7[_0x7b6d77(0xc4)](_0x7a5693,_0x261ab8)+_0x2ffdd7};if(isUnknownSize(_0x322a2d,_0x2ffdd7))break;_0x7a5693+=_0x1ff8b7['KKzuY'](_0x261ab8,_0x2ffdd7)+_0x322a2d;}return null;}function computeDurationMs(_0x443ba6,_0x5424f4){const _0x483a24=_0x43c0,_0x552e2e={'OjkQJ':function(_0x5a88c5,_0x3289e8,_0x30e109){return _0x5a88c5(_0x3289e8,_0x30e109);},'ElbJP':function(_0x2bc937,_0x59a547){return _0x2bc937+_0x59a547;},'ZRwqK':function(_0x2f7799,_0x52ee01){return _0x2f7799<_0x52ee01;},'nHlSE':function(_0x4a0c95,_0x378499,_0x51650e){return _0x4a0c95(_0x378499,_0x51650e);},'OSibf':function(_0x4a1d5f,_0x293f11){return _0x4a1d5f+_0x293f11;},'RfroS':function(_0x400c19,_0x47f285){return _0x400c19+_0x47f285;},'gItMu':function(_0x3d8207,_0x200a9c,_0x48bce5,_0x30be27){return _0x3d8207(_0x200a9c,_0x48bce5,_0x30be27);},'tHZWn':function(_0xcee0d,_0x198eeb){return _0xcee0d===_0x198eeb;},'MZCfi':function(_0x4efd00,_0x29cb81){return _0x4efd00/_0x29cb81;},'LIQJZ':function(_0x145a15,_0x13e6f8){return _0x145a15*_0x13e6f8;},'pWpIe':function(_0x4342f1,_0x57c046){return _0x4342f1===_0x57c046;}};let _0x316cfd=0x0;const _0x2ae643=Buffer[_0x483a24(0xcf)]([0x1f,0x43,0xb6,0x75]);let _0x2f0178=_0x443ba6['indexOf'](_0x2ae643);if(_0x2f0178===-0x1)return 0x0;while(_0x2f0178<_0x443ba6['length']){const [_0x45db5a,_0x5e206b]=readId(_0x443ba6,_0x2f0178);if(_0x45db5a!==ID_CLUSTER)break;const [_0x2c4ee6,_0x255925]=_0x552e2e[_0x483a24(0xc2)](readVint,_0x443ba6,_0x552e2e['ElbJP'](_0x2f0178,_0x5e206b)),_0x3d9d66=_0x2f0178+_0x5e206b+_0x255925,_0x812ff0=isUnknownSize(_0x2c4ee6,_0x255925);let _0x18a283;if(_0x812ff0){let _0x33fb4b=_0x3d9d66;while(_0x552e2e['ZRwqK'](_0x33fb4b,_0x443ba6[_0x483a24(0xb5)]-0x4)){const [_0x49c5fa,_0x1117a5]=readId(_0x443ba6,_0x33fb4b);if(_0x49c5fa===ID_CLUSTER){_0x18a283=_0x33fb4b;break;}const [_0x5ae995,_0x212ea8]=_0x552e2e[_0x483a24(0xe2)](readVint,_0x443ba6,_0x552e2e[_0x483a24(0xe1)](_0x33fb4b,_0x1117a5));if(isUnknownSize(_0x5ae995,_0x212ea8)){_0x18a283=_0x443ba6[_0x483a24(0xb5)];break;}_0x33fb4b+=_0x552e2e[_0x483a24(0xc8)](_0x552e2e['ElbJP'](_0x1117a5,_0x212ea8),_0x5ae995);}_0x18a283??=_0x443ba6[_0x483a24(0xb5)];}else _0x18a283=_0x3d9d66+_0x2c4ee6;let _0x382d2d=0x0,_0x4da229=_0x3d9d66;while(_0x4da229<_0x18a283){const [_0x318192,_0x2ac180]=readId(_0x443ba6,_0x4da229),[_0x3f8684,_0x2bd883]=readVint(_0x443ba6,_0x4da229+_0x2ac180);if(_0x318192===ID_TIMESTAMP)_0x382d2d=_0x552e2e[_0x483a24(0xc3)](readUint,_0x443ba6,_0x552e2e['ElbJP'](_0x4da229+_0x2ac180,_0x2bd883),_0x3f8684);else{if(_0x552e2e[_0x483a24(0xca)](_0x318192,ID_SIMPLE_BLOCK)&&_0x3f8684>=0x4){const _0x449e18=_0x4da229+_0x2ac180+_0x2bd883,[,_0xf217c0]=readVint(_0x443ba6,_0x449e18),_0x3782fa=_0x443ba6[_0x483a24(0xed)](_0x449e18+_0xf217c0),_0x51e9bd=_0x552e2e['MZCfi'](_0x552e2e[_0x483a24(0xbf)](_0x382d2d+_0x3782fa,_0x5424f4),0xf4240);_0x51e9bd>_0x316cfd&&(_0x316cfd=_0x51e9bd);}else{if(_0x552e2e[_0x483a24(0xc5)](_0x318192,ID_CLUSTER))break;}}if(_0x552e2e[_0x483a24(0xe2)](isUnknownSize,_0x3f8684,_0x2bd883))break;_0x4da229+=_0x552e2e['OSibf'](_0x552e2e['RfroS'](_0x2ac180,_0x2bd883),_0x3f8684);}_0x2f0178=_0x18a283;}return _0x316cfd;}export function fixWebmDuration(_0x378121,_0x98ae91){const _0x190e50=_0x43c0,_0xd1f252={'yKURn':function(_0x438694,_0x181408){return _0x438694(_0x181408);},'nGNzI':function(_0x224e7c,_0x579760,_0x37bbc7){return _0x224e7c(_0x579760,_0x37bbc7);},'xfqmX':function(_0x53f724,_0x3fea3c){return _0x53f724+_0x3fea3c;},'cffAf':function(_0x30233c,_0x253649){return _0x30233c+_0x253649;},'WmRqF':function(_0x3d04c3,_0x28bcd1){return _0x3d04c3!==_0x28bcd1;},'gNcST':_0x190e50(0xb6),'VxPlL':function(_0x22fe1d,_0x22c116){return _0x22fe1d+_0x22c116;},'EVJnK':function(_0xbe69f9,_0x5339a0){return _0xbe69f9<_0x5339a0;},'RjCCL':function(_0x499e00,_0x1e7ab4,_0xdfbb4f){return _0x499e00(_0x1e7ab4,_0xdfbb4f);},'MqCqa':function(_0x34c71f,_0x83e97b){return _0x34c71f===_0x83e97b;},'sRyzh':function(_0x9f5c65,_0x19e6c3){return _0x9f5c65+_0x19e6c3;},'rVZJy':function(_0x4dfa22,_0x499838){return _0x4dfa22+_0x499838;},'BEhAf':function(_0x57bebc,_0x252f40,_0x469cf1,_0x10e03d,_0x455088){return _0x57bebc(_0x252f40,_0x469cf1,_0x10e03d,_0x455088);},'ABfth':function(_0x653c52,_0x4015cc){return _0x653c52/_0x4015cc;},'AgSyp':function(_0x53579a,_0x1700bd){return _0x53579a*_0x1700bd;},'PajeQ':function(_0x4d7076,_0x4c3a36){return _0x4d7076+_0x4c3a36;},'lwbLl':function(_0x3f1da1,_0x5452c4){return _0x3f1da1+_0x5452c4;},'UXsCP':function(_0x2ea350,_0x471569){return _0x2ea350(_0x471569);},'eVymh':function(_0x17ca02,_0xff8f28,_0x139c6c){return _0x17ca02(_0xff8f28,_0x139c6c);},'oKxxH':function(_0x4d8a9b,_0x216985,_0x58b31e,_0x4628f1,_0x26a6f1,_0x3267e6,_0x4ea8df){return _0x4d8a9b(_0x216985,_0x58b31e,_0x4628f1,_0x26a6f1,_0x3267e6,_0x4ea8df);}},_0x13a8c0=_0xd1f252[_0x190e50(0xe6)](readFileSync,_0x378121);let _0x32ccc6=0x0;const [_0x50f613,_0xb9c899]=_0xd1f252[_0x190e50(0xdd)](readId,_0x13a8c0,_0x32ccc6),[_0x2d5046,_0x23ac17]=_0xd1f252[_0x190e50(0xdd)](readVint,_0x13a8c0,_0xd1f252[_0x190e50(0xda)](_0x32ccc6,_0xb9c899));_0x32ccc6+=_0xd1f252[_0x190e50(0xcd)](_0xb9c899+_0x23ac17,_0x2d5046);const [_0x13a6ed,_0x141d20]=_0xd1f252['nGNzI'](readId,_0x13a8c0,_0x32ccc6);if(_0xd1f252['WmRqF'](_0x13a6ed,ID_SEGMENT))return console['error'](_0xd1f252['gNcST']),![];const [,_0x17a769]=readVint(_0x13a8c0,_0x32ccc6+_0x141d20),_0x4861f7=_0xd1f252[_0x190e50(0xdc)](_0x32ccc6,_0x141d20)+_0x17a769;let _0x41436e=_0x4861f7;const _0x21bfeb=Math['min'](_0x13a8c0['length'],_0xd1f252['VxPlL'](_0x4861f7,0x2710));let _0x4f7f11=null,_0x363729=null;while(_0xd1f252['EVJnK'](_0x41436e,_0x21bfeb)){const [_0x875227,_0x2863c5]=readId(_0x13a8c0,_0x41436e),[_0x41b49b,_0x142198]=_0xd1f252['RjCCL'](readVint,_0x13a8c0,_0xd1f252[_0x190e50(0xda)](_0x41436e,_0x2863c5));_0x875227===ID_VOID&&!_0x4f7f11&&(_0x4f7f11={'offset':_0x41436e,'idLen':_0x2863c5,'sizeLen':_0x142198,'dataSize':_0x41b49b,'dataOffset':_0xd1f252['VxPlL'](_0x41436e,_0x2863c5)+_0x142198});if(_0xd1f252['MqCqa'](_0x875227,ID_INFO)){_0x363729={'offset':_0x41436e,'idLen':_0x2863c5,'sizeLen':_0x142198,'dataSize':_0x41b49b,'dataOffset':_0xd1f252['sRyzh'](_0x41436e,_0x2863c5)+_0x142198};break;}if(_0x875227===ID_CLUSTER)break;if(isUnknownSize(_0x41b49b,_0x142198))break;_0x41436e+=_0xd1f252[_0x190e50(0xe5)](_0x2863c5+_0x142198,_0x41b49b);}if(!_0x363729)return console['error'](_0x190e50(0xd4)),![];const _0x2acd4d=findElement(_0x13a8c0,_0x363729[_0x190e50(0xb1)],_0xd1f252['sRyzh'](_0x363729['dataOffset'],_0x363729['dataSize']),ID_DURATION);if(_0x2acd4d)return![];const _0x28a861=_0xd1f252[_0x190e50(0xc9)](findElement,_0x13a8c0,_0x363729['dataOffset'],_0x363729[_0x190e50(0xb1)]+_0x363729[_0x190e50(0xe4)],ID_TIMESTAMP_SCALE);let _0x503d60=0xf4240;_0x28a861&&(_0x503d60=readUint(_0x13a8c0,_0x28a861['dataOffset'],_0x28a861[_0x190e50(0xe4)]));const _0x42b856=computeDurationMs(_0x13a8c0,_0x503d60);if(_0x42b856<=0x0)return console['error'](_0x190e50(0xc0)),![];const _0x76d2db=_0xd1f252[_0x190e50(0xe0)](_0xd1f252[_0x190e50(0xe8)](_0x42b856,0xf4240),_0x503d60),_0x438f5c=Buffer[_0x190e50(0xb4)]([_0xd1f252['yKURn'](writeId,ID_DURATION),_0xd1f252['yKURn'](writeVint,0x8),writeFloat64(_0x76d2db)]),_0x480a38=_0x438f5c[_0x190e50(0xb5)];if(!_0x4f7f11||_0x4f7f11['offset']<_0x363729['offset']){if(_0x4f7f11){const _0x3ae157=_0xd1f252[_0x190e50(0xd9)](_0xd1f252['lwbLl'](_0x4f7f11['idLen'],_0x4f7f11['sizeLen']),_0x4f7f11[_0x190e50(0xe4)]),_0x37bcd0=_0x3ae157-_0x480a38;if(_0x37bcd0<0x2)return rewriteFile(_0x13a8c0,_0x363729,_0x438f5c,_0x503d60,_0x42b856,_0x98ae91);const _0x590838=_0xd1f252['sRyzh'](_0x363729[_0x190e50(0xe4)],_0x480a38),_0x287f35=Buffer[_0x190e50(0xb4)]([_0xd1f252['UXsCP'](writeId,ID_INFO),_0xd1f252['RjCCL'](writeVint,_0x590838,_0x363729[_0x190e50(0xb3)])]),_0x35836b=_0x13a8c0[_0x190e50(0xd1)](_0x363729['dataOffset'],_0x363729[_0x190e50(0xb1)]+_0x363729['dataSize']),_0xda5bc3=writeVoid(_0x37bcd0),_0x44b07c=_0x13a8c0[_0x190e50(0xd1)](0x0,_0x4f7f11['offset']),_0x47ec7a=_0x13a8c0['slice'](_0x363729['dataOffset']+_0x363729[_0x190e50(0xe4)]);return _0xd1f252[_0x190e50(0xb2)](writeFileSync,_0x98ae91,Buffer[_0x190e50(0xb4)]([_0x44b07c,_0xda5bc3,_0x287f35,_0x35836b,_0x438f5c,_0x47ec7a])),!![];}}return _0xd1f252[_0x190e50(0xd8)](rewriteFile,_0x13a8c0,_0x363729,_0x438f5c,_0x503d60,_0x42b856,_0x98ae91);}function rewriteFile(_0x1bb95d,_0x330423,_0x4d8e10,_0x58561e,_0x3832a2,_0xb8d26e){const _0x4f3114=_0x43c0,_0x341ce5={'uasKz':function(_0x38af4e,_0x5e79f6){return _0x38af4e+_0x5e79f6;},'BMqaE':function(_0x7c1509,_0x2938de){return _0x7c1509(_0x2938de);}},_0x265c2b=_0x341ce5['uasKz'](_0x330423['dataSize'],_0x4d8e10['length']),_0x23fddd=Buffer['concat']([_0x341ce5['BMqaE'](writeId,ID_INFO),writeVint(_0x265c2b)]),_0x1c66cb=_0x341ce5['uasKz'](_0x330423['idLen'],_0x330423[_0x4f3114(0xb3)]),_0xfe43b3=_0x1bb95d[_0x4f3114(0xd1)](0x0,_0x330423[_0x4f3114(0xb7)]),_0x574071=_0x1bb95d[_0x4f3114(0xd1)](_0x330423[_0x4f3114(0xb1)],_0x330423['dataOffset']+_0x330423[_0x4f3114(0xe4)]),_0x17e3b9=_0x1bb95d['slice'](_0x341ce5[_0x4f3114(0xdf)](_0x330423[_0x4f3114(0xb7)],_0x1c66cb)+_0x330423[_0x4f3114(0xe4)]);return writeFileSync(_0xb8d26e,Buffer['concat']([_0xfe43b3,_0x23fddd,_0x574071,_0x4d8e10,_0x17e3b9])),!![];}if(process[_0x215ce7(0xba)][0x1]?.['endsWith']('fixWebmDuration.ts')||process[_0x215ce7(0xba)][0x1]?.['endsWith']('fixWebmDuration.js')){const input=process['argv'][0x2],output=process[_0x215ce7(0xba)][0x3];(!input||!output)&&(console['error']('Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>'),process[_0x215ce7(0xd5)](0x1));const fixed=fixWebmDuration(input,output);fixed?console[_0x215ce7(0xe7)]('Fixed:\x20'+output):console['log']('File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.');}