export function chooseLatestActivityPreviewItem({currentPreview:_0x148b65,nextItem:_0x1bd634,replayComplete:_0x4b9e25}){if(!_0x4b9e25&&_0x148b65?.['isSnapshot']&&!_0x1bd634?.['isSnapshot'])return _0x148b65;return _0x1bd634||null;}export function findLatestAgentItemForPreview({latestItem:_0x1ae326,activityItems:activityItems=[],taskStatus:taskStatus='',replayLoading:replayLoading=![]}){if(_0x1ae326?.['isSnapshot']&&replayLoading)return _0x1ae326;const _0x3ef1bf=taskStatus==='running',_0x122ab1=_0x1ae326?.['action']==='Follow-Up';if(_0x3ef1bf&&_0x122ab1)return null;if(activityItems['length'])for(let _0x5063af=activityItems['length']-0x1;_0x5063af>=0x0;_0x5063af-=0x1){const _0x9a9ee6=activityItems[_0x5063af];if(_0x9a9ee6['isUserMessage'])break;if(_0x9a9ee6['isAgentResponse']||_0x9a9ee6['action']==='Response')return _0x9a9ee6;}if(_0x1ae326&&!_0x1ae326['isUserMessage'])return _0x1ae326;for(let _0x2b28d1=activityItems['length']-0x1;_0x2b28d1>=0x0;_0x2b28d1-=0x1){const _0xee5ffb=activityItems[_0x2b28d1];if(!_0xee5ffb['isUserMessage'])return _0xee5ffb;}return null;}export function setLatestActivityLoadingIndicator(_0x4583e0,_0x1b5354){const _0x52d460=_0x4583e0?.['getElementById']?.('latest-activity-loading');if(!_0x52d460)return;_0x52d460['hidden']=!_0x1b5354;}