export function isJudgeTaskEntry(_0xbd1bfe){return _0xbd1bfe?.['isJudgeTask']===!![]||_0xbd1bfe?.['taskType']==='judge'||_0xbd1bfe?.['task_type']==='judge';}export function getDisplayTaskVariants(_0x2b026b){if(!Array['isArray'](_0x2b026b))return[];const _0x3948c2=_0x2b026b['filter'](_0x2e3866=>!isJudgeTaskEntry(_0x2e3866));return _0x3948c2['length']>0x0?_0x3948c2:_0x2b026b;}export function getDisplayTaskVariantCount(_0x243727){return getDisplayTaskVariants(_0x243727)['length'];}export function isDisplayTaskGroup(_0x5b43d9){return getDisplayTaskVariantCount(_0x5b43d9)>0x1;}export function getAggregateTaskStatus(_0x8d0b9d,{fallback:fallback='unknown'}={}){const _0x18a53d=Array['isArray'](_0x8d0b9d)?_0x8d0b9d['filter'](Boolean):[];if(_0x18a53d['length']===0x0)return fallback;const _0x146787=_0x18a53d['map'](_0x2a478d=>_0x2a478d?.['status']||'unknown'),_0xcb3887=_0x8bd096=>_0x146787['every'](_0x568c20=>_0x568c20===_0x8bd096),_0x55bd4c=_0x53cc13=>_0x146787['some'](_0x1e19fd=>_0x1e19fd===_0x53cc13);if(_0xcb3887('staged'))return'staged';if(_0xcb3887('queued'))return'queued';if(_0x55bd4c('running'))return'running';if(_0x55bd4c('queued'))return'queued';if(_0x55bd4c('failed'))return'failed';if(_0xcb3887('interrupted'))return'interrupted';if(_0x55bd4c('completed'))return'completed';return fallback;}export function getTaskTileStatus({primary:_0x55ea9f,variants:_0x1632f2,isGroup:isGroup=![]}={}){const _0x3347a3=_0x55ea9f?.['status']||'unknown',_0x580aab=Array['isArray'](_0x1632f2)?_0x1632f2['filter'](Boolean):[],_0x25c787=_0x580aab['some'](_0x46149b=>_0x46149b?.['taskId']!==_0x55ea9f?.['taskId']&&isJudgeTaskEntry(_0x46149b));if(!isGroup&&!_0x25c787)return _0x3347a3;return getAggregateTaskStatus(_0x580aab['length']>0x0?_0x580aab:[_0x55ea9f],{'fallback':_0x3347a3});}export function getTaskTileStatusLabel({primary:_0x684bdc,variants:_0x11710a,isGroup:isGroup=![]}={}){const _0x1e9fc4=getTaskTileStatus({'primary':_0x684bdc,'variants':_0x11710a,'isGroup':isGroup});if(_0x1e9fc4!=='running'){const _0x5afc69={'interrupted':'Interrupted','failed':'Failed','staged':'Staged','queued':'Queued'};return _0x5afc69[_0x1e9fc4]||'';}const _0x1ff7d5=Array['isArray'](_0x11710a)&&_0x11710a['length']>0x0?_0x11710a['filter'](Boolean):[_0x684bdc]['filter'](Boolean),_0x485d08=_0x1ff7d5['filter'](_0x51cff8=>_0x51cff8?.['status']==='running'),_0x2b818b=_0x485d08['length']>0x0&&_0x485d08['every'](isJudgeTaskEntry);if(!_0x2b818b)return'Running';return _0x485d08['every'](_0x51fe6a=>_0x51fe6a?.['judgeMode']==='review')?'Reviewing':'Judging';}export function getTaskActivityTime(_0x545c94){const _0x1d8c88=_0x545c94?.['lastActivityTimestamp']||_0x545c94?.['lastActivity']||_0x545c94?.['updatedAt']||_0x545c94?.['createdAt'],_0x3e2382=_0x1d8c88?new Date(_0x1d8c88)['getTime']():0x0;return Number['isFinite'](_0x3e2382)?_0x3e2382:0x0;}export function hasLiveTaskStatusDetail(_0x3f80bf){return Boolean(_0x3f80bf?.['status']==='running'&&(_0x3f80bf['lastActivityAction']||typeof _0x3f80bf['progress']==='number'||_0x3f80bf['currentPhase']));}export function getDashboardStatusDetailTask(_0x529d03,_0x432e85,_0x458837,{displayVariants:displayVariants=null}={}){if(!_0x458837)return _0x529d03;if(hasLiveTaskStatusDetail(_0x529d03))return _0x529d03;const _0x97b5ac=Array['isArray'](_0x432e85)?_0x432e85['filter'](Boolean):[],_0x5cf691=Array['isArray'](displayVariants)&&displayVariants['length']>0x0?displayVariants['filter'](Boolean):_0x97b5ac,_0x459409=_0x5cf691['filter'](hasLiveTaskStatusDetail);if(_0x459409['length']>0x0)return _0x459409['sort']((_0x2960f8,_0xd1c7a)=>getTaskActivityTime(_0xd1c7a)-getTaskActivityTime(_0x2960f8))[0x0];if(_0x529d03?.['status']==='queued'&&_0x529d03['queuePosition'])return _0x529d03;return _0x5cf691['find'](_0x383d44=>_0x383d44?.['status']==='queued'&&_0x383d44['queuePosition'])||_0x529d03;}