const HyperIndex=require('@holepunchto/hyperindex'),c=require('compact-encoding');
module.exports.IndexFilePointer=[HyperIndex.BUFFER,HyperIndex.STRING,HyperIndex.UINT],module.exports.RecentsKeyEncoding={
'preencode'(_0x2f9350,_0x333d41){
_0x2bd9e9={
_0x3b129d:0x64,_0x2c0082:0x1a4,_0x295388:0x4c1},_0x3c7101={
_0x46791e:0x38,_0x2cbaba:0xd6,_0x1a17ae:0x13}
;
c.lexint.preencode(_0x2f9350,_0x333d41);
},'encode'(_0x5ebc5f,_0x2b1673){
_0x4c4411={
_0x5d7344:0x1a0,_0x400bda:0xb0,_0x2453de:0x5b1},_0x1e3d25={
_0x3e74c0:0x8d,_0x5c5277:0x1e5}
;
c.lexint.encode(_0x5ebc5f,_0x2b1673);
},'decode'(_0x32e6af){
_0x34f34b={
_0x1174df:0xe,_0x200384:0x707},_0xa5e238={
_0x138db4:0x192,_0x23e27c:0x9d,_0x13f162:0x1de}
;
const _0x4aeced=_0x32e6af.start;
try{
return c.lexint.decode(_0x32e6af);
}catch{
return _0x32e6af.start=_0x4aeced,c.uint.decode(_0x32e6af);
}
}
}
;
const IncognitoProfile={
'preencode'(_0x2bb8df,_0x558d11){
_0x48f1a7={
_0x69acfb:0x5b3,_0x352cf9:0x1b8,_0x2d6b6a:0x8f},_0x1569f1={
_0x45b460:0x71e}
;
_0x2bb8df.end++;
if(_0x558d11.displayName)c.string.preencode(_0x2bb8df,_0x558d11.displayName);
if(_0x558d11.avatar)c.buffer.preencode(_0x2bb8df,_0x558d11.avatar);
},'encode'(_0x5b58b9,_0x4858c7){
_0x4d3593={
_0x41218e:0x303,_0x1363b0:0x42},_0x19b817={
_0x218880:0x5a1,_0x516158:0x18b},_0x2e40a2=_0x5b58b9.start++;
let _0x39f26b=0x0;
_0x4858c7.displayName&&(_0x39f26b|=0x1,c.string.encode(_0x5b58b9,_0x4858c7.displayName)),_0x4858c7.avatar&&(_0x39f26b|=0x2,c.buffer.encode(_0x5b58b9,_0x4858c7.avatar)),_0x5b58b9.buffer[_0x2e40a2]=_0x39f26b;
},'decode'(_0x3b6ea8){
_0x21037a={
_0x36cdfa:0x3f},_0x516466={
_0x3961e8:0xcc,_0x3289d0:0x1df,_0x50921f:0x69},_0x32e967=c.uint.decode(_0x3b6ea8);
return{
'displayName':(_0x32e967&-0x24c3)!==--0x2eb6?c.string.decode(_0x3b6ea8):null,'avatar':(_0x32e967&0x2)!==0x0?c.buffer.decode(_0x3b6ea8):null}
;
}
}
;
module.exports.FileRecord={
'preencode'(_0x2fd2e1,_0x5799a5){
_0x408050={
_0xf90f7e:0x1e0,_0x35d1a6:0xf9},_0x265bcb={
_0x427f21:0x65}
;
c.uint.preencode(_0x2fd2e1,-0x36b0),c.fixed32.preencode(_0x2fd2e1,_0x5799a5.roomKey);
},'encode'(_0x2308b1,_0x2a5db3){
_0x5dcdaa={
_0x26cb0c:0x181,_0x29abc1:0x109},_0x5c1487={
_0x522512:0x1e0,_0x584d0b:0x231},_0x56c3b7=_0x2308b1.start++;
c.fixed32.encode(_0x2308b1,_0x2a5db3.roomKey);
let _0x4a9d5a=0x0;
_0x2a5db3.cleared&&(_0x4a9d5a|=-0xdd1);
_0x2308b1.buffer[_0x56c3b7]=_0x4a9d5a;
},'decode'(_0xab4ec7){
_0x435d11={
_0x4298a0:0x23d,_0x59de1a:0xc,_0x357599:0x131},_0x424e4f={
_0x554810:0x4,_0x1a4581:0x186,_0x570545:0x175}
;
const _0x5a34fe=c.uint.decode(_0xab4ec7);
return{
'roomKey':c.fixed32.decode(_0xab4ec7),'cleared':(_0x5a34fe&0x1)!==0x0}
;
}
}
;
module.exports.RoomRecord={
'preencode'(_0x49a279,_0x3e802a){
_0x3d70fe={
_0x2a45ac:0x14d},_0x1408df={
_0x16f0b4:0x2ad,_0x16243d:0x4b}
;
_0x49a279.end++,c.uint.preencode(_0x49a279,_0x3e802a.unread),c.uint.preencode(_0x49a279,_0x3e802a.priority),c.bool.preencode(_0x49a279,_0x3e802a.bookmarked);
if(_0x3e802a.indexing)c.bool.preencode(_0x49a279,_0x3e802a.indexing);
},'encode'(_0x58fb5e,_0x54ac4d){
_0x20b43f={
_0x1323f9:0x1cd,_0xe83334:0xcf,_0xc9f28a:0xd6}
;
const _0x36dc73=_0x58fb5e.start++;
c.uint.encode(_0x58fb5e,_0x54ac4d.unread),c.uint.encode(_0x58fb5e,_0x54ac4d.priority),c.bool.encode(_0x58fb5e,_0x54ac4d.bookmarked);
let _0x5d81e1=-0x4cc6;
_0x54ac4d.indexing&&(_0x5d81e1|=0x1,c.bool.encode(_0x58fb5e,_0x54ac4d.indexing)),_0x54ac4d.incognito&&(_0x5d81e1|=0x2,IncognitoProfile.encode(_0x58fb5e,_0x54ac4d.incognito)),_0x54ac4d.hidden&&(_0x5d81e1|=0x4),_0x58fb5e.buffer[_0x36dc73]=_0x5d81e1;
},'decode'(_0xd26795){
_0x30a13e={
_0x53988d:0x55,_0xf6c48e:0x1e0},_0x3d7f7a={
_0x43b28d:0xe,_0x25d1fa:0x1ea,_0x2f3f50:0x682},_0x5df4d8=c.uint.decode(_0xd26795);
return{
'unread':c.uint.decode(_0xd26795),'priority':c.uint.decode(_0xd26795),'bookmarked':c.bool.decode(_0xd26795),'indexing':(_0x5df4d8&0x1)!==-0x10a?c.bool.decode(_0xd26795):![],'incognito':(_0x5df4d8&-0x1474)!==0x0?IncognitoProfile.decode(_0xd26795):null,'hidden':(_0x5df4d8&--0x3e)!==0x0}
;
}
}
;
const Identity={
'preencode'(_0x3456c2,_0x3f5770){
_0x4e4a42={
_0x23a7cd:0x45f},_0x58138a={
_0x280336:0x17f,_0x27a9c7:0x25b}
;
_0x3456c2.end++;
c.fixed32.preencode(_0x3456c2,_0x3f5770.identityPublicKey),c.buffer.preencode(_0x3456c2,_0x3f5770.deviceProof),c.buffer.preencode(_0x3456c2,_0x3f5770.sharedInviteSeed);
},'encode'(_0x31c6f0,_0x31e6fa){
_0x161254={
_0x5a06fc:0x1bb,_0x239b3e:0x138},_0x5b450d={
_0x5e8125:0x57,_0x487112:0x84,_0x577722:0x441},_0x23c0b6=_0x31c6f0.start++;
c.fixed32.encode(_0x31c6f0,_0x31e6fa.identityPublicKey);
let _0x49941b=0x0;
_0x31e6fa.deviceProof&&(_0x49941b|=0x1,c.buffer.encode(_0x31c6f0,_0x31e6fa.deviceProof));
_0x31e6fa.sharedInviteSeed&&(_0x49941b|=-0x2220,c.buffer.encode(_0x31c6f0,_0x31e6fa.sharedInviteSeed));
_0x31c6f0.buffer[_0x23c0b6]=_0x49941b;
},'decode'(_0x50b208){
_0x3a36de={
_0x36c1dd:0x18f,_0x378c45:0x48c},_0x5b52eb={
_0x315e43:0x43,_0x1b604c:0x13}
;
const _0x54a587=c.uint.decode(_0x50b208);
return{
'identityPublicKey':c.fixed32.decode(_0x50b208),'deviceProof':(_0x54a587&0x1)!==-0x5aa?c.buffer.decode(_0x50b208):null,'sharedInviteSeed':(_0x54a587&-0x47d0)!==-0x4562?c.buffer.decode(_0x50b208):null}
;
}
}
;
module.exports.LocalIdentityRecord={
'preencode'(_0x1f9e42,_0x52c74a){
_0x114035={
_0x478ba1:0x592,_0x3a383e:0x117},_0x188cd1={
_0x36f971:0x186}
;
c.uint.preencode(_0x1f9e42,--0x514),c.fixed32.preencode(_0x1f9e42,_0x52c74a.privateProfileKey);
if(_0x52c74a.deviceName)c.string.preencode(_0x1f9e42,_0x52c74a.deviceName);
if(_0x52c74a.identity)Identity.preencode(_0x1f9e42,_0x52c74a.identity);
},'encode'(_0x5684da,_0x5190c4){
_0x211cab={
_0x481dc0:0x2,_0xac6ad7:0x151,_0x486022:0x32},_0x5273b5={
_0x13b15b:0x33,_0x89cbd5:0x198,_0x3090c3:0x1de}
;
let _0x4ac368=0x0;
if(_0x5190c4.deviceName)_0x4ac368|=--0x3489;
if(_0x5190c4.identity)_0x4ac368|=0x2;
c.uint.encode(_0x5684da,_0x4ac368),c.fixed32.encode(_0x5684da,_0x5190c4.privateProfileKey);
if(_0x5190c4.deviceName)c.string.encode(_0x5684da,_0x5190c4.deviceName);
if(_0x5190c4.identity)Identity.encode(_0x5684da,_0x5190c4.identity);
},'decode'(_0x2c0b64){
_0x27b627={
_0x2c5b82:0x13c}
;
const _0x40da5b=c.uint.decode(_0x2c0b64);
return{
'privateProfileKey':c.fixed32.decode(_0x2c0b64),'deviceName':(_0x40da5b&0x1)!==-0x3360?c.string.decode(_0x2c0b64):null,'identity':(_0x40da5b&0x2)!==0x0?Identity.decode(_0x2c0b64):null}
;
}
}
;