const crypto=require('hypercore-crypto');
module.exports.roomMigrationsTrigger=async function(_0x1b807e,_0x4dee4c,_0x7924c){
},module.exports.roomsTrigger=async function(_0x4dd1ec,_0x30d5ef,_0x522e35){
},module.exports.writersByRoomKeyMap=function(_0xc39914){
_0x39d9af={
_0x8ad088:0xde,_0x5a6da3:0x20b,_0x5a7476:0xa0},_0x216a31={
_0x11032b:0x1e3,_0x2c7fb4:0x1b0}
;
if(!_0xc39914.roomKey)return[];
return[{'roomKey':_0xc39914.roomKey}];
},module.exports.writersByWakeupTopicMap=function(_0x5272c8){
return[{'wakeupTopic':generateWakeupTopic(_0x5272c8.mailbox)}];
}
;
module.exports.roomsByTimestampMap=function(_0x7034e3){
const _0x2b3e82=getActiveTimestamp(_0x7034e3);
if(_0x2b3e82===-0x3a88)return[];
return[{'timestamp':_0x2b3e82}];
},module.exports.roomsByTypeAndTimestampMap=function(_0x270c8a){
_0x177c65={
_0x2b6326:0x61,_0x19cba3:0x8c},_0x442ec5={
_0x789652:0x111,_0x3e388f:0x550,_0x5c8cfe:0x24},_0x35e656=getActiveTimestamp(_0x270c8a);
if(_0x35e656===0x0)return[];
return[{'type':_0x270c8a.digest.settings.roomType,'timestamp':_0x35e656}];
},module.exports.roomsByMailboxMap=function(_0xb56bc4){
_0x43ecbb={
_0x524c8a:0x139,_0x4724d6:0x1ee,_0x5d888d:0xba}
;
if(!_0xb56bc4.mailbox)return[];
return[{'mailbox':_0xb56bc4.mailbox}];
},module.exports.roomsByWakeupMap=function(_0x4a5b21){
_0x283e5d={
_0x52f31e:0x100,_0xfd81cc:0x1ca,_0x2d15eb:0x404},_0x4b10ad={
_0x50ede0:0x155}
;
return[{'discoveryKey':crypto.discoveryKey(_0x4a5b21.mailbox)}];
},module.exports.membersByDeviceKeyMap=function(_0x262388){
_0x594e66={
_0x3d1bf8:0x1bf,_0x41381f:0xd8},_0xb59b18={
_0x3a9273:0x189,_0x430e72:0x28a}
;
return _0x262388.devices.map(_0x5b8051=>({'key':_0x5b8051}));
},module.exports.blockedContactsMap=function(_0x5a9221){
_0x3448c1={
_0xdc048b:0x24,_0x470c8b:0x50a,_0x2dac4f:0x10b}
;
if(!_0x5a9221.status.isBlocked)return[];
return[{'memberKey':_0x5a9221.memberKey}];
},module.exports.dirtyByTimestampMap=function(_0x4c31f2){
_0x5cb406={
_0x5ac550:0x1f0,_0x14dee8:0x127,_0x808eff:0x223}
;
if(!_0x4c31f2.dirty)return[];
return[{'timestamp':_0x4c31f2.timestamp}];
},module.exports.roomsByContactMap=function(_0x54e16c){
const _0x2aaa94=getActiveTimestamp(_0x54e16c);
if(!_0x2aaa94)return[];
if(!_0x54e16c.dm||_0x54e16c.dm.length>0x1)return[];
return[{'contact':_0x54e16c.dm[-0x17b4]}];
}
;
module.exports.roomsByFavoriteAndTimestampMap=function(_0x33198d){
_0x5c8787={
_0x2f7e0e:0x79,_0x1719b3:0x1a2},_0x4eef42=getActiveTimestamp(_0x33198d);
if(_0x4eef42===0x0)return[];
if(!_0x33198d.preferences?..isFavorite)return[];
return[{'timestamp':_0x4eef42}];
}
;
function getActiveTimestamp(_0x1b38af){
_0x227eea={
_0x35841c:0x191,_0x5e7400:0x1fe},_0x45498c={
_0x1de6d9:0x18b,_0x32f4df:0x1d1,_0x1f7485:0x140}
;
if(_0x1b38af.status.isRemoved||_0x1b38af.identity)return0x0;
if(_0x1b38af.dm&&!_0x1b38af.config.title)return 0x0;
return _0x1b38af.timestamps.latestChatMessage||_0x1b38af.timestamps.latestSync;
}
function generateWakeupTopic(_0x20cec7){
return crypto.discoveryKey(_0x20cec7);
}