const{c:e}=require("hyperschema/runtime");let d=31;const o={preencode(d,o){e.fixed32.preencode(d,o.key),e.uint.preencode(d,o.length)},encode(d,o){e.fixed32.encode(d,o.key),e.uint.encode(d,o.length)},decode:d=>({key:e.fixed32.decode(d),length:e.uint.decode(d)})},n={preencode(d,o){e.fixed32.preencode(d,o.key),e.uint.preencode(d,o.seq)},encode(d,o){e.fixed32.encode(d,o.key),e.uint.encode(d,o.seq)},decode:d=>({key:e.fixed32.decode(d),seq:e.uint.decode(d)})},c={preencode(d,o){e.fixed32.preencode(d,o.publicKey),e.fixed32.preencode(d,o.secretKey)},encode(d,o){e.fixed32.encode(d,o.publicKey),e.fixed32.encode(d,o.secretKey)},decode:d=>({publicKey:e.fixed32.decode(d),secretKey:e.fixed32.decode(d)})},t={preencode(d,o){e.fixed32.preencode(d,o.publicKey),e.fixed64.preencode(d,o.secretKey)},encode(d,o){e.fixed32.encode(d,o.publicKey),e.fixed64.encode(d,o.secretKey)},decode:d=>({publicKey:e.fixed32.decode(d),secretKey:e.fixed64.decode(d)})},r={preencode(n,c){e.fixed32.preencode(n,c.key),n.end++,c.encryptionKey&&e.buffer.preencode(n,c.encryptionKey),c.fastForwardTo&&e.fixed32.preencode(n,c.fastForwardTo),d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const t=(c.encryptionKey?1:0)|(c.fastForwardTo?2:0)|(d>=27&&c.bootFrom?4:0);e.fixed32.encode(n,c.key),e.uint.encode(n,t),c.encryptionKey&&e.buffer.encode(n,c.encryptionKey),c.fastForwardTo&&e.fixed32.encode(n,c.fastForwardTo),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom)},decode(n){const c=e.fixed32.decode(n),t=e.uint.decode(n);return{key:c,encryptionKey:1&t?e.buffer.decode(n):null,fastForwardTo:2&t?e.fixed32.decode(n):null,bootFrom:d>=27&&4&t?o.decode(n):null}}},i={preencode(d,o){e.uint.preencode(d,o.timestamp)},encode(d,o){e.uint.encode(d,o.timestamp)},decode:d=>({timestamp:e.uint.decode(d)})},a={preencode(d,o){e.uint.preencode(d,o.blockOffset),e.uint.preencode(d,o.blockLength),e.uint.preencode(d,o.byteOffset),e.uint.preencode(d,o.byteLength)},encode(d,o){e.uint.encode(d,o.blockOffset),e.uint.encode(d,o.blockLength),e.uint.encode(d,o.byteOffset),e.uint.encode(d,o.byteLength)},decode:d=>({blockOffset:e.uint.decode(d),blockLength:e.uint.decode(d),byteOffset:e.uint.decode(d),byteLength:e.uint.decode(d)})},s={preencode(d,o){e.uint.preencode(d,o.width),e.uint.preencode(d,o.height)},encode(d,o){e.uint.encode(d,o.width),e.uint.encode(d,o.height)},decode:d=>({width:e.uint.decode(d),height:e.uint.decode(d)})},p=e.frame(s),u={preencode(d,o){d.end++,o.name&&e.string.preencode(d,o.name),o.mimetype&&e.string.preencode(d,o.mimetype),o.dimensions&&p.preencode(d,o.dimensions),o.userdata&&e.buffer.preencode(d,o.userdata),o.duration&&e.uint.preencode(d,o.duration)},encode(d,o){const n=(o.name?1:0)|(o.mimetype?2:0)|(o.dimensions?4:0)|(o.userdata?8:0)|(o.duration?16:0)|(o.isPreview?32:0);e.uint.encode(d,n),o.name&&e.string.encode(d,o.name),o.mimetype&&e.string.encode(d,o.mimetype),o.dimensions&&p.encode(d,o.dimensions),o.userdata&&e.buffer.encode(d,o.userdata),o.duration&&e.uint.encode(d,o.duration)},decode(d){const o=e.uint.decode(d);return{name:1&o?e.string.decode(d):null,mimetype:2&o?e.string.decode(d):null,dimensions:4&o?p.decode(d):null,userdata:8&o?e.buffer.decode(d):null,duration:16&o?e.uint.decode(d):0,isPreview:!!(32&o)}}},l={preencode(d,o){e.fixed32.preencode(d,o.key),e.string.preencode(d,o.path),e.uint.preencode(d,o.version),e.uint.preencode(d,o.size)},encode(d,o){e.fixed32.encode(d,o.key),e.string.encode(d,o.path),e.uint.encode(d,o.version),e.uint.encode(d,o.size)},decode:d=>({key:e.fixed32.decode(d),path:e.string.decode(d),version:e.uint.decode(d),size:e.uint.decode(d)})},f={preencode(d,o){e.fixed32.preencode(d,o.key),a.preencode(d,o.blob)},encode(d,o){e.fixed32.encode(d,o.key),a.encode(d,o.blob)},decode:d=>({key:e.fixed32.decode(d),blob:a.decode(d)})},m=e.frame(f),y=e.frame(l),b={preencode(o,n){o.end++,n.inlined&&e.buffer.preencode(o,n.inlined),n.blob&&a.preencode(o,n.blob),n.externalBlob&&m.preencode(o,n.externalBlob),n.externalDrive&&y.preencode(o,n.externalDrive),d>=27&&n.bee&&fr.preencode(o,n.bee)},encode(o,n){const c=(n.inlined?1:0)|(n.blob?2:0)|(n.externalBlob?4:0)|(n.externalDrive?8:0)|(d>=27&&n.bee?16:0);e.uint.encode(o,c),n.inlined&&e.buffer.encode(o,n.inlined),n.blob&&a.encode(o,n.blob),n.externalBlob&&m.encode(o,n.externalBlob),n.externalDrive&&y.encode(o,n.externalDrive),d>=27&&n.bee&&fr.encode(o,n.bee)},decode(o){const n=e.uint.decode(o);return{inlined:1&n?e.buffer.decode(o):null,blob:2&n?a.decode(o):null,externalBlob:4&n?m.decode(o):null,externalDrive:8&n?y.decode(o):null,bee:d>=27&&16&n?fr.decode(o):null}}},x=e.frame(b),k=e.frame(u),v={preencode(d,o){x.preencode(d,o.pointer),d.end++,o.metadata&&k.preencode(d,o.metadata),o.preview&&da.preencode(d,o.preview),o.hash&&e.fixed32.preencode(d,o.hash)},encode(d,o){const n=(o.metadata?1:0)|(o.preview?2:0)|(o.hash?4:0);x.encode(d,o.pointer),e.uint.encode(d,n),o.metadata&&k.encode(d,o.metadata),o.preview&&da.encode(d,o.preview),o.hash&&e.fixed32.encode(d,o.hash)},decode(d){const o=x.decode(d),n=e.uint.decode(d);return{pointer:o,metadata:1&n?k.decode(d):null,preview:2&n?da.decode(d):null,hash:4&n?e.fixed32.decode(d):null}}},g=e.frame(v),h=g,K=g,w={preencode(e,d){e.end++,d.small&&g.preencode(e,d.small),d.medium&&h.preencode(e,d.medium),d.large&&K.preencode(e,d.large)},encode(d,o){const n=(o.small?1:0)|(o.medium?2:0)|(o.large?4:0);e.uint.encode(d,n),o.small&&g.encode(d,o.small),o.medium&&h.encode(d,o.medium),o.large&&K.encode(d,o.large)},decode(d){const o=e.uint.decode(d);return{small:1&o?g.decode(d):null,medium:2&o?h.decode(d):null,large:4&o?K.decode(d):null}}},A={preencode(e,d){e.end++},encode(d,o){const n=o.isDeleted?1:0;e.uint.encode(d,n)},decode:d=>({isDeleted:!!(1&e.uint.decode(d))})},T=e.frame(A),S=g,P={preencode(o,c){e.uint.preencode(o,c.id),n.preencode(o,c.oplog),T.preencode(o,c.status),S.preencode(o,c.file),o.end++,d>=14&&c.version&&e.uint.preencode(o,c.version)},encode(o,c){const t=d>=14&&c.version?1:0;e.uint.encode(o,c.id),n.encode(o,c.oplog),T.encode(o,c.status),S.encode(o,c.file),e.uint.encode(o,t),d>=14&&c.version&&e.uint.encode(o,c.version)},decode(o){const c=e.uint.decode(o),t=n.decode(o),r=T.decode(o),i=S.decode(o),a=o.start<o.end?e.uint.decode(o):0;return{id:c,oplog:t,status:r,file:i,version:d>=14&&1&a?e.uint.decode(o):0}}},I={preencode(e,d){e.end++},encode(d,o){const n=(o.isActive?1:0)|(o.isIndexing?2:0);e.uint.encode(d,n)},decode(d){const o=e.uint.decode(d);return{isActive:!!(1&o),isIndexing:!!(2&o)}}},F={preencode(o,n){const c=(n.isAdmin?1:0)|(n.isModerator?2:0)|(n.isPending?4:0)|(n.isActive?8:0)|(n.isMuted?16:0)|(n.isBanned?32:0)|(n.isShadowBanned?64:0)|(d>=13&&n.isRemoved?128:0);e.uint.preencode(o,c)},encode(o,n){const c=(n.isAdmin?1:0)|(n.isModerator?2:0)|(n.isPending?4:0)|(n.isActive?8:0)|(n.isMuted?16:0)|(n.isBanned?32:0)|(n.isShadowBanned?64:0)|(d>=13&&n.isRemoved?128:0);e.uint.encode(o,c)},decode(o){const n=e.uint.decode(o);return{isAdmin:!!(1&n),isModerator:!!(2&n),isPending:!!(4&n),isActive:!!(8&n),isMuted:!!(16&n),isBanned:!!(32&n),isShadowBanned:!!(64&n),isRemoved:d>=13&&!!(128&n)}}},R={preencode(e,d){e.end++},encode(d,o){const n=(o.isMuted?1:0)|(o.isBanned?2:0)|(o.isShadowBanned?4:0);e.uint.encode(d,n)},decode(d){const o=e.uint.decode(d);return{isMuted:!!(1&o),isBanned:!!(2&o),isShadowBanned:!!(4&o)}}},C={preencode(d,o){e.uint.preencode(d,o.version)},encode(d,o){e.uint.encode(d,o.version)},decode:d=>({version:e.uint.decode(d)})},H={preencode(d,o){e.uint.preencode(d,o.total),e.uint.preencode(d,o.active)},encode(d,o){e.uint.encode(d,o.total),e.uint.encode(d,o.active)},decode:d=>({total:e.uint.decode(d),active:e.uint.decode(d)})},V={preencode(d,o){e.uint.preencode(d,o.total),e.uint.preencode(d,o.active),e.uint.preencode(d,o.pending)},encode(d,o){e.uint.encode(d,o.total),e.uint.encode(d,o.active),e.uint.encode(d,o.pending)},decode:d=>({total:e.uint.decode(d),active:e.uint.decode(d),pending:e.uint.decode(d)})},D={preencode(o,n){e.uint.preencode(o,n.clock),e.uint.preencode(o,n.pinned),e.uint.preencode(o,n.threads),e.uint.preencode(o,n.timestamp),o.end++,d>=15&&n.flagsClock&&e.uint.preencode(o,n.flagsClock)},encode(o,n){const c=d>=15&&n.flagsClock?1:0;e.uint.encode(o,n.clock),e.uint.encode(o,n.pinned),e.uint.encode(o,n.threads),e.uint.encode(o,n.timestamp),e.uint.encode(o,c),d>=15&&n.flagsClock&&e.uint.encode(o,n.flagsClock)},decode(o){const n=e.uint.decode(o),c=e.uint.decode(o),t=e.uint.decode(o),r=e.uint.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{clock:n,pinned:c,threads:t,timestamp:r,flagsClock:d>=15&&1&i?e.uint.decode(o):0}}},M={preencode(d,o){e.uint.preencode(d,o.clock)},encode(d,o){e.uint.encode(d,o.clock)},decode:d=>({clock:e.uint.decode(d)})},L=e.frame(H),q=e.frame(V),E=e.frame(D),B=e.frame(M),z={preencode(e,o){L.preencode(e,o.devices),q.preencode(e,o.members),E.preencode(e,o.chat),B.preencode(e,o.files),e.end++,d>=26&&o.calls&&oa.preencode(e,o.calls)},encode(o,n){const c=d>=26&&n.calls?1:0;L.encode(o,n.devices),q.encode(o,n.members),E.encode(o,n.chat),B.encode(o,n.files),e.uint.encode(o,c),d>=26&&n.calls&&oa.encode(o,n.calls)},decode(o){const n=L.decode(o),c=q.decode(o),t=E.decode(o),r=B.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{devices:n,members:c,chat:t,files:r,calls:d>=26&&1&i?oa.decode(o):null}}},N={Default:1,Broadcast:2,DirectMessage:3},j={preencode(e,d){e.end++},encode(d,o){if(o>3)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},O={preencode(o,n){const c=(n.roomType?1:0)|(n.isExperimental?2:0)|(n.isJoiningDisabled?4:0)|(n.isAppendingDisabled?8:0)|(n.isCallingDisabled?16:0)|(n.isMembershipEventsDisabled?32:0)|(d>=19&&n.isAttachmentsDisabled?64:0)|(d>=19&&n.isLinksDisabled?128:0)|(d>=20&&n.buildType?256:0)|(d>=23&&n.isRoomInviteHidden?512:0);e.uint.preencode(o,c),n.roomType&&j.preencode(o,n.roomType),d>=20&&n.buildType&&Bt.preencode(o,n.buildType)},encode(o,n){const c=(n.roomType?1:0)|(n.isExperimental?2:0)|(n.isJoiningDisabled?4:0)|(n.isAppendingDisabled?8:0)|(n.isCallingDisabled?16:0)|(n.isMembershipEventsDisabled?32:0)|(d>=19&&n.isAttachmentsDisabled?64:0)|(d>=19&&n.isLinksDisabled?128:0)|(d>=20&&n.buildType?256:0)|(d>=23&&n.isRoomInviteHidden?512:0);e.uint.encode(o,c),n.roomType&&j.encode(o,n.roomType),d>=20&&n.buildType&&Bt.encode(o,n.buildType)},decode(o){const n=e.uint.decode(o);return{roomType:1&n?j.decode(o):0,isExperimental:!!(2&n),isJoiningDisabled:!!(4&n),isAppendingDisabled:!!(8&n),isCallingDisabled:!!(16&n),isMembershipEventsDisabled:!!(32&n),isAttachmentsDisabled:d>=19&&!!(64&n),isLinksDisabled:d>=19&&!!(128&n),buildType:d>=20&&256&n?Bt.decode(o):null,isRoomInviteHidden:d>=23&&!!(512&n)}}},U=e.frame(C),J=e.frame(O),G={preencode(d,o){U.preencode(d,o.abi),J.preencode(d,o.settings),e.uint.preencode(d,o.creationTime)},encode(d,o){U.encode(d,o.abi),J.encode(d,o.settings),e.uint.encode(d,o.creationTime)},decode:d=>({abi:U.decode(d),settings:J.decode(d),creationTime:e.uint.decode(d)})},Q={preencode(d,o){e.fixed32.preencode(d,o.seed)},encode(d,o){e.fixed32.encode(d,o.seed)},decode:d=>({seed:e.fixed32.decode(d)})},W={preencode(d,o){c.preencode(d,o.mailboxKeyPair),t.preencode(d,o.discoveryKeyPair),e.fixed32.preencode(d,o.wakeupTopic),e.fixed32.preencode(d,o.swarmTopic)},encode(d,o){c.encode(d,o.mailboxKeyPair),t.encode(d,o.discoveryKeyPair),e.fixed32.encode(d,o.wakeupTopic),e.fixed32.encode(d,o.swarmTopic)},decode:d=>({mailboxKeyPair:c.decode(d),discoveryKeyPair:t.decode(d),wakeupTopic:e.fixed32.decode(d),swarmTopic:e.fixed32.decode(d)})},X=e.array(e.fixed32),Y={preencode(o,n){o.end++,n.title&&e.string.preencode(o,n.title),n.avatar&&na.preencode(o,n.avatar),n.description&&e.string.preencode(o,n.description),d>=11&&n.supportedLanguages&&ca.preencode(o,n.supportedLanguages),d>=13&&n.blindPeers&&X.preencode(o,n.blindPeers)},encode(o,n){const c=(n.title?1:0)|(n.avatar?2:0)|(n.description?4:0)|(d>=11&&n.supportedLanguages?8:0)|(d>=13&&n.blindPeers?16:0);e.uint.encode(o,c),n.title&&e.string.encode(o,n.title),n.avatar&&na.encode(o,n.avatar),n.description&&e.string.encode(o,n.description),d>=11&&n.supportedLanguages&&ca.encode(o,n.supportedLanguages),d>=13&&n.blindPeers&&X.encode(o,n.blindPeers)},decode(o){const n=e.uint.decode(o);return{title:1&n?e.string.decode(o):null,avatar:2&n?na.decode(o):null,description:4&n?e.string.decode(o):null,supportedLanguages:d>=11&&8&n?ca.decode(o):null,blindPeers:d>=13&&16&n?X.decode(o):null}}},Z={preencode(d,o){e.fixed32.preencode(d,o.key)},encode(d,o){e.fixed32.encode(d,o.key)},decode:d=>({key:e.fixed32.decode(d)})},$=e.frame(i),_=e.frame(Z),ee={preencode(e,d){$.preencode(e,d.header),_.preencode(e,d.peer)},encode(e,d){$.encode(e,d.header),_.encode(e,d.peer)},decode:e=>({header:$.decode(e),peer:_.decode(e)})},de=$,oe={preencode(d,o){de.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){de.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:de.decode(d),key:e.fixed32.decode(d)})},ne={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.buffer.preencode(d,o.proof)},encode(d,o){e.fixed32.encode(d,o.memberKey),e.buffer.encode(d,o.proof)},decode:d=>({memberKey:e.fixed32.decode(d),proof:e.buffer.decode(d)})},ce={preencode(d,o){e.fixed32.preencode(d,o.id),e.buffer.preencode(d,o.response)},encode(d,o){e.fixed32.encode(d,o.id),e.buffer.encode(d,o.response)},decode:d=>({id:e.fixed32.decode(d),response:e.buffer.decode(d)})},te=e.frame(I),re=e.frame(ce),ie={preencode(d,o){e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.memberKey),te.preencode(d,o.status),ta.preencode(d,o.profile),d.end++,o.invitation&&re.preencode(d,o.invitation)},encode(d,o){const n=o.invitation?1:0;e.fixed32.encode(d,o.key),e.fixed32.encode(d,o.memberKey),te.encode(d,o.status),ta.encode(d,o.profile),e.uint.encode(d,n),o.invitation&&re.encode(d,o.invitation)},decode:d=>({key:e.fixed32.decode(d),memberKey:e.fixed32.decode(d),status:te.decode(d),profile:ta.decode(d),invitation:1&e.uint.decode(d)?re.decode(d):null})},ae={preencode(d,o){e.uint.preencode(d,o.timestamp),d.end++,o.mailbox&&e.fixed32.preencode(d,o.mailbox),o.displayName&&e.string.preencode(d,o.displayName),o.avatar&&ra.preencode(d,o.avatar),o.username&&e.string.preencode(d,o.username)},encode(d,o){const n=(o.mailbox?1:0)|(o.displayName?2:0)|(o.avatar?4:0)|(o.username?8:0);e.uint.encode(d,o.timestamp),e.uint.encode(d,n),o.mailbox&&e.fixed32.encode(d,o.mailbox),o.displayName&&e.string.encode(d,o.displayName),o.avatar&&ra.encode(d,o.avatar),o.username&&e.string.encode(d,o.username)},decode(d){const o=e.uint.decode(d),n=e.uint.decode(d);return{timestamp:o,mailbox:1&n?e.fixed32.decode(d):null,displayName:2&n?e.string.decode(d):null,avatar:4&n?ra.decode(d):null,username:8&n?e.string.decode(d):null}}},se={preencode(o,n){o.end++,n.swarmKey&&e.fixed32.preencode(o,n.swarmKey),n.name&&e.string.preencode(o,n.name),d>=20&&n.buildType&&Bt.preencode(o,n.buildType)},encode(o,n){const c=(n.swarmKey?1:0)|(n.name?2:0)|(n.isMobile?4:0)|(d>=20&&n.buildType?8:0);e.uint.encode(o,c),n.swarmKey&&e.fixed32.encode(o,n.swarmKey),n.name&&e.string.encode(o,n.name),d>=20&&n.buildType&&Bt.encode(o,n.buildType)},decode(o){const n=e.uint.decode(o);return{swarmKey:1&n?e.fixed32.decode(o):null,name:2&n?e.string.decode(o):null,isMobile:!!(4&n),buildType:d>=20&&8&n?Bt.decode(o):null}}},pe=e.frame(ae),ue={preencode(e,d){pe.preencode(e,d.profile),ne.preencode(e,d.attestation)},encode(e,d){pe.encode(e,d.profile),ne.encode(e,d.attestation)},decode:e=>({profile:pe.decode(e),attestation:ne.decode(e)})},le={preencode(e,d){ia.preencode(e,d.profile),ne.preencode(e,d.attestation)},encode(e,d){ia.encode(e,d.profile),ne.encode(e,d.attestation)},decode:e=>({profile:ia.decode(e),attestation:ne.decode(e)})},fe={preencode(d,o){e.fixed32.preencode(d,o.id),e.buffer.preencode(d,o.data),e.buffer.preencode(d,o.signature)},encode(d,o){e.fixed32.encode(d,o.id),e.buffer.encode(d,o.data),e.buffer.encode(d,o.signature)},decode:d=>({id:e.fixed32.decode(d),data:e.buffer.decode(d),signature:e.buffer.decode(d)})},me={preencode(d,o){e.fixed32.preencode(d,o.devicePublicKey)},encode(d,o){e.fixed32.encode(d,o.devicePublicKey)},decode:d=>({devicePublicKey:e.fixed32.decode(d)})},ye={preencode(d,o){ne.preencode(d,o.privateProfileIdentity),e.buffer.preencode(d,o.deviceProof)},encode(d,o){ne.encode(d,o.privateProfileIdentity),e.buffer.encode(d,o.deviceProof)},decode:d=>({privateProfileIdentity:ne.decode(d),deviceProof:e.buffer.decode(d)})},be=e.frame(le),xe=e.frame(ue),ke=e.frame(me),ve={preencode(n,c){e.fixed32.preencode(n,c.deviceKey),t.preencode(n,c.keyPair),be.preencode(n,c.device),xe.preencode(n,c.member),n.end++,c.identity&&ke.preencode(n,c.identity),d>=27&&c.link&&o.preencode(n,c.link)},encode(n,c){const r=(c.identity?1:0)|(d>=27&&c.link?2:0);e.fixed32.encode(n,c.deviceKey),t.encode(n,c.keyPair),be.encode(n,c.device),xe.encode(n,c.member),e.uint.encode(n,r),c.identity&&ke.encode(n,c.identity),d>=27&&c.link&&o.encode(n,c.link)},decode(n){const c=e.fixed32.decode(n),r=t.decode(n),i=be.decode(n),a=xe.decode(n),s=e.uint.decode(n);return{deviceKey:c,keyPair:r,device:i,member:a,identity:1&s?ke.decode(n):null,link:d>=27&&2&s?o.decode(n):null}}},ge=e.frame(ve),he={preencode(d,o){e.fixed32.preencode(d,o.id),ge.preencode(d,o.request),e.buffer.preencode(d,o.signature)},encode(d,o){e.fixed32.encode(d,o.id),ge.encode(d,o.request),e.buffer.encode(d,o.signature)},decode:d=>({id:e.fixed32.decode(d),request:ge.decode(d),signature:e.buffer.decode(d)})},Ke=be,we=xe,Ae={preencode(e,d){Ke.preencode(e,d.device),e.end++,d.member&&we.preencode(e,d.member)},encode(d,o){const n=o.member?1:0;Ke.encode(d,o.device),e.uint.encode(d,n),o.member&&we.encode(d,o.member)},decode:d=>({device:Ke.decode(d),member:1&e.uint.decode(d)?we.decode(d):null})},Te=e.frame(he),Se=e.frame(Ae),Pe={preencode(e,d){e.end++,d.withInvitation&&Te.preencode(e,d.withInvitation),d.withMemberProof&&Se.preencode(e,d.withMemberProof)},encode(d,o){const n=(o.withInvitation?1:0)|(o.withMemberProof?2:0);e.uint.encode(d,n),o.withInvitation&&Te.encode(d,o.withInvitation),o.withMemberProof&&Se.encode(d,o.withMemberProof)},decode(d){const o=e.uint.decode(d);return{withInvitation:1&o?Te.decode(d):null,withMemberProof:2&o?Se.decode(d):null}}},Ie=e.frame(fe),Fe=e.frame(ye),Re={preencode(e,d){Ie.preencode(e,d.signedKeys),e.end++,d.identity&&Fe.preencode(e,d.identity)},encode(d,o){const n=o.identity?1:0;Ie.encode(d,o.signedKeys),e.uint.encode(d,n),o.identity&&Fe.encode(d,o.identity)},decode:d=>({signedKeys:Ie.decode(d),identity:1&e.uint.decode(d)?Fe.decode(d):null})},Ce={preencode(o,n){o.end++,n.expiration&&e.uint.preencode(o,n.expiration),d>=20&&n.buildType&&Bt.preencode(o,n.buildType)},encode(o,n){const c=(n.expiration?1:0)|(n.requiresConfirmation?2:0)|(n.canModerate?4:0)|(n.canAdmin?8:0)|(d>=20&&n.buildType?16:0);e.uint.encode(o,c),n.expiration&&e.uint.encode(o,n.expiration),d>=20&&n.buildType&&Bt.encode(o,n.buildType)},decode(o){const n=e.uint.decode(o);return{expiration:1&n?e.uint.decode(o):0,requiresConfirmation:!!(2&n),canModerate:!!(4&n),canAdmin:!!(8&n),buildType:d>=20&&16&n?Bt.decode(o):null}}},He=Ie,Ve=e.frame(Ce),De={preencode(d,n){e.fixed32.preencode(d,n.id),He.preencode(d,n.response),Ve.preencode(d,n.metadata),d.end++,n.anchor&&o.preencode(d,n.anchor)},encode(d,n){const c=(n.anchor?1:0)|(n.isActive?2:0);e.fixed32.encode(d,n.id),He.encode(d,n.response),Ve.encode(d,n.metadata),e.uint.encode(d,c),n.anchor&&o.encode(d,n.anchor)},decode(d){const n=e.fixed32.decode(d),c=He.decode(d),t=Ve.decode(d),r=e.uint.decode(d);return{id:n,response:c,metadata:t,anchor:1&r?o.decode(d):null,isActive:!!(2&r)}}},Me=$,Le=e.frame(De),qe={preencode(e,d){Me.preencode(e,d.header),Le.preencode(e,d.invitation)},encode(e,d){Me.encode(e,d.header),Le.encode(e,d.invitation)},decode:e=>({header:Me.decode(e),invitation:Le.decode(e)})},Ee=$,Be={preencode(d,o){Ee.preencode(d,o.header),e.fixed32.preencode(d,o.id)},encode(d,o){Ee.encode(d,o.header),e.fixed32.encode(d,o.id)},decode:d=>({header:Ee.decode(d),id:e.fixed32.decode(d)})},ze={preencode(d,n){e.fixed32.preencode(d,n.mailbox),e.fixed32.preencode(d,n.invitationSeed),o.preencode(d,n.anchor)},encode(d,n){e.fixed32.encode(d,n.mailbox),e.fixed32.encode(d,n.invitationSeed),o.encode(d,n.anchor)},decode:d=>({mailbox:e.fixed32.decode(d),invitationSeed:e.fixed32.decode(d),anchor:o.decode(d)})},Ne={preencode(d,n){e.fixed32.preencode(d,n.mailbox),e.fixed32.preencode(d,n.invitationSeed),o.preencode(d,n.anchor),e.fixed32.preencode(d,n.identityPublicKey)},encode(d,n){e.fixed32.encode(d,n.mailbox),e.fixed32.encode(d,n.invitationSeed),o.encode(d,n.anchor),e.fixed32.encode(d,n.identityPublicKey)},decode:d=>({mailbox:e.fixed32.decode(d),invitationSeed:e.fixed32.decode(d),anchor:o.decode(d),identityPublicKey:e.fixed32.decode(d)})},je={preencode(d,o){e.fixed32.preencode(d,o.mailbox)},encode(d,o){e.fixed32.encode(d,o.mailbox)},decode:d=>({mailbox:e.fixed32.decode(d)})},Oe=e.frame(ze),Ue=e.frame(Ne),Je=e.frame(je),Ge=e.array(e.ipv4Address),Qe={preencode(e,o){e.end++,o.room&&Oe.preencode(e,o.room),o.identity&&Ue.preencode(e,o.identity),o.contact&&Je.preencode(e,o.contact),d>=6&&o.readonly&&aa.preencode(e,o.readonly),d>=11&&o.additionalNodes&&Ge.preencode(e,o.additionalNodes),d>=20&&o.buildType&&Bt.preencode(e,o.buildType),d>=27&&o["readonly-v2"]&&sa.preencode(e,o["readonly-v2"])},encode(o,n){const c=(n.room?1:0)|(n.identity?2:0)|(n.contact?4:0)|(d>=6&&n.readonly?8:0)|(d>=11&&n.additionalNodes?16:0)|(d>=20&&n.buildType?32:0)|(d>=27&&n["readonly-v2"]?64:0);e.uint.encode(o,c),n.room&&Oe.encode(o,n.room),n.identity&&Ue.encode(o,n.identity),n.contact&&Je.encode(o,n.contact),d>=6&&n.readonly&&aa.encode(o,n.readonly),d>=11&&n.additionalNodes&&Ge.encode(o,n.additionalNodes),d>=20&&n.buildType&&Bt.encode(o,n.buildType),d>=27&&n["readonly-v2"]&&sa.encode(o,n["readonly-v2"])},decode(o){const n=e.uint.decode(o);return{room:1&n?Oe.decode(o):null,identity:2&n?Ue.decode(o):null,contact:4&n?Je.decode(o):null,readonly:d>=6&&8&n?aa.decode(o):null,additionalNodes:d>=11&&16&n?Ge.decode(o):null,buildType:d>=20&&32&n?Bt.decode(o):null,"readonly-v2":d>=27&&64&n?sa.decode(o):null}}},We=$,Xe={preencode(d,o){We.preencode(d,o.header),e.buffer.preencode(d,o.blindRequest)},encode(d,o){We.encode(d,o.header),e.buffer.encode(d,o.blindRequest)},decode:d=>({header:We.decode(d),blindRequest:e.buffer.decode(d)})},Ye=$,Ze={preencode(o,n){Ye.preencode(o,n.header),o.end++,n.profile&&pa.preencode(o,n.profile),d>=24&&n.key&&e.fixed32.preencode(o,n.key)},encode(o,n){const c=(n.profile?1:0)|(d>=24&&n.key?2:0);Ye.encode(o,n.header),e.uint.encode(o,c),n.profile&&pa.encode(o,n.profile),d>=24&&n.key&&e.fixed32.encode(o,n.key)},decode(o){const n=Ye.decode(o),c=e.uint.decode(o);return{header:n,profile:1&c?pa.decode(o):null,key:d>=24&&2&c?e.fixed32.decode(o):null}}},$e={preencode(e,d){},encode(e,d){},decode:e=>({})},_e=$e,ed=ge,dd={preencode(d,o){e.fixed32.preencode(d,o.deviceKey),e.fixed32.preencode(d,o.id),ed.preencode(d,o.request)},encode(d,o){e.fixed32.encode(d,o.deviceKey),e.fixed32.encode(d,o.id),ed.encode(d,o.request)},decode:d=>({deviceKey:e.fixed32.decode(d),id:e.fixed32.decode(d),request:ed.decode(d)})},od=$,nd=Fe,cd={preencode(d,o){od.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey),d.end++,o.identity&&nd.preencode(d,o.identity)},encode(d,o){const n=o.identity?1:0;od.encode(d,o.header),e.fixed32.encode(d,o.deviceKey),e.uint.encode(d,n),o.identity&&nd.encode(d,o.identity)},decode:d=>({header:od.decode(d),deviceKey:e.fixed32.decode(d),identity:1&e.uint.decode(d)?nd.decode(d):null})},td=$,rd={preencode(d,o){td.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey)},encode(d,o){td.encode(d,o.header),e.fixed32.encode(d,o.deviceKey)},decode:d=>({header:td.decode(d),deviceKey:e.fixed32.decode(d)})},id=e.frame(F),ad=pe,sd={preencode(d,o){e.fixed32.preencode(d,o.key),id.preencode(d,o.status),ad.preencode(d,o.profile)},encode(d,o){e.fixed32.encode(d,o.key),id.encode(d,o.status),ad.encode(d,o.profile)},decode:d=>({key:e.fixed32.decode(d),status:id.decode(d),profile:ad.decode(d)})},pd=id,ud=pe,ld={preencode(d,o){e.fixed32.preencode(d,o.key),pd.preencode(d,o.status),ud.preencode(d,o.profile),d.end++,o.proofs&&ua.preencode(d,o.proofs)},encode(d,o){const n=o.proofs?1:0;e.fixed32.encode(d,o.key),pd.encode(d,o.status),ud.encode(d,o.profile),e.uint.encode(d,n),o.proofs&&ua.encode(d,o.proofs)},decode:d=>({key:e.fixed32.decode(d),status:pd.decode(d),profile:ud.decode(d),proofs:1&e.uint.decode(d)?ua.decode(d):null})},fd={preencode(d,o){e.fixed32.preencode(d,o.key),d.end++,o.profileAttestation&&e.buffer.preencode(d,o.profileAttestation),o.latestReceipt&&e.buffer.preencode(d,o.latestReceipt)},encode(d,o){const n=(o.profileAttestation?1:0)|(o.latestReceipt?2:0);e.fixed32.encode(d,o.key),e.uint.encode(d,n),o.profileAttestation&&e.buffer.encode(d,o.profileAttestation),o.latestReceipt&&e.buffer.encode(d,o.latestReceipt)},decode(d){const o=e.fixed32.decode(d),n=e.uint.decode(d);return{key:o,profileAttestation:1&n?e.buffer.decode(d):null,latestReceipt:2&n?e.buffer.decode(d):null}}},md=$,yd=xe,bd={preencode(e,d){md.preencode(e,d.header),yd.preencode(e,d.member)},encode(e,d){md.encode(e,d.header),yd.encode(e,d.member)},decode:e=>({header:md.decode(e),member:yd.decode(e)})},xd=$,kd=e.frame(R),vd={preencode(d,o){xd.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.key),kd.preencode(d,o.status)},encode(d,o){xd.encode(d,o.header),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.key),kd.encode(d,o.status)},decode:d=>({header:xd.decode(d),memberKey:e.fixed32.decode(d),key:e.uint.decode(d),status:kd.decode(d)})},gd=$,hd={preencode(d,o){gd.preencode(d,o.header),e.fixed32.preencode(d,o.key),d.end++},encode(d,o){const n=(o.isModerator?1:0)|(o.isAdmin?2:0);gd.encode(d,o.header),e.fixed32.encode(d,o.key),e.uint.encode(d,n)},decode(d){const o=gd.decode(d),n=e.fixed32.decode(d),c=e.uint.decode(d);return{header:o,key:n,isModerator:!!(1&c),isAdmin:!!(2&c)}}},Kd=$,wd={preencode(d,o){Kd.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){Kd.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:Kd.decode(d),key:e.fixed32.decode(d)})},Ad={preencode(d,o){e.fixed32.preencode(d,o.key),e.uint.preencode(d,o.mentions)},encode(d,o){e.fixed32.encode(d,o.key),e.uint.encode(d,o.mentions)},decode:d=>({key:e.fixed32.decode(d),mentions:e.uint.decode(d)})},Td={preencode(d,o){d.end++,o.memberKey&&e.fixed32.preencode(d,o.memberKey)},encode(d,o){const n=o.memberKey?1:0;e.uint.encode(d,n),o.memberKey&&e.fixed32.encode(d,o.memberKey)},decode:d=>({memberKey:1&e.uint.decode(d)?e.fixed32.decode(d):null})},Sd=Td,Pd={preencode(d,o){d.end++,o.from&&e.string.preencode(d,o.from),o.to&&e.string.preencode(d,o.to)},encode(d,o){const n=(o.from?1:0)|(o.to?2:0);e.uint.encode(d,n),o.from&&e.string.encode(d,o.from),o.to&&e.string.encode(d,o.to)},decode(d){const o=e.uint.decode(d);return{from:1&o?e.string.decode(d):null,to:2&o?e.string.decode(d):null}}},Id=e.frame(Td),Fd=e.frame(Sd),Rd=e.frame(Pd),Cd={preencode(o,n){const c=(n.memberJoined?1:0)|(n.memberLeft?2:0)|(n.titleChanged?4:0)|(n.callStarted?8:0)|(n.callHangup?16:0)|(n.callMissed?32:0)|(d>=3&&n.roomAvatarChanged?64:0)|(d>=3&&n.invitationCreated?128:0)|(d>=3&&n.memberRemoved?256:0)|(d>=18&&n.locationShared?512:0);e.uint.preencode(o,c),n.memberJoined&&Id.preencode(o,n.memberJoined),n.memberLeft&&Fd.preencode(o,n.memberLeft),n.titleChanged&&Rd.preencode(o,n.titleChanged),d>=3&&n.memberRemoved&&la.preencode(o,n.memberRemoved),d>=18&&n.locationShared&&fa.preencode(o,n.locationShared)},encode(o,n){const c=(n.memberJoined?1:0)|(n.memberLeft?2:0)|(n.titleChanged?4:0)|(n.callStarted?8:0)|(n.callHangup?16:0)|(n.callMissed?32:0)|(d>=3&&n.roomAvatarChanged?64:0)|(d>=3&&n.invitationCreated?128:0)|(d>=3&&n.memberRemoved?256:0)|(d>=18&&n.locationShared?512:0);e.uint.encode(o,c),n.memberJoined&&Id.encode(o,n.memberJoined),n.memberLeft&&Fd.encode(o,n.memberLeft),n.titleChanged&&Rd.encode(o,n.titleChanged),d>=3&&n.memberRemoved&&la.encode(o,n.memberRemoved),d>=18&&n.locationShared&&fa.encode(o,n.locationShared)},decode(o){const n=e.uint.decode(o);return{memberJoined:1&n?Id.decode(o):null,memberLeft:2&n?Fd.decode(o):null,titleChanged:4&n?Rd.decode(o):null,callStarted:!!(8&n),callHangup:!!(16&n),callMissed:!!(32&n),roomAvatarChanged:d>=3&&!!(64&n),invitationCreated:d>=3&&!!(128&n),memberRemoved:d>=3&&256&n?la.decode(o):null,locationShared:d>=18&&512&n?fa.decode(o):null}}},Hd={preencode(e,o){e.end++,d>=18&&o.locationShared&&ma.preencode(e,o.locationShared)},encode(o,n){const c=(n.callStarted?1:0)|(n.callHangup?2:0)|(n.callMissed?4:0)|(d>=18&&n.locationShared?8:0);e.uint.encode(o,c),d>=18&&n.locationShared&&ma.encode(o,n.locationShared)},decode(o){const n=e.uint.decode(o);return{callStarted:!!(1&n),callHangup:!!(2&n),callMissed:!!(4&n),locationShared:d>=18&&8&n?ma.decode(o):null}}},Vd={preencode(d,o){e.uint.preencode(d,o.start),e.uint.preencode(d,o.length)},encode(d,o){e.uint.encode(d,o.start),e.uint.encode(d,o.length)},decode:d=>({start:e.uint.decode(d),length:e.uint.decode(d)})},Dd=e.frame(Vd),Md={preencode(d,o){Dd.preencode(d,o.range),e.string.preencode(d,o.content)},encode(d,o){Dd.encode(d,o.range),e.string.encode(d,o.content)},decode:d=>({range:Dd.decode(d),content:e.string.decode(d)})},Ld=Dd,qd={preencode(d,o){Ld.preencode(d,o.range),e.fixed32.preencode(d,o.memberKey)},encode(d,o){Ld.encode(d,o.range),e.fixed32.encode(d,o.memberKey)},decode:d=>({range:Ld.decode(d),memberKey:e.fixed32.decode(d)})},Ed=g,Bd=e.array(e.uint),zd={preencode(o,n){o.end++,n.title&&e.string.preencode(o,n.title),n.description&&e.string.preencode(o,n.description),n.file&&Ed.preencode(o,n.file),d>=7&&n.files&&Bd.preencode(o,n.files)},encode(o,n){const c=(n.title?1:0)|(n.description?2:0)|(n.file?4:0)|(d>=7&&n.files?8:0);e.uint.encode(o,c),n.title&&e.string.encode(o,n.title),n.description&&e.string.encode(o,n.description),n.file&&Ed.encode(o,n.file),d>=7&&n.files&&Bd.encode(o,n.files)},decode(o){const n=e.uint.decode(o);return{title:1&n?e.string.decode(o):null,description:2&n?e.string.decode(o):null,file:4&n?Ed.decode(o):null,files:d>=7&&8&n?Bd.decode(o):null}}},Nd=Dd,jd=e.frame(zd),Od={preencode(d,o){Nd.preencode(d,o.range),e.string.preencode(d,o.url),d.end++,o.preview&&jd.preencode(d,o.preview)},encode(d,o){const n=o.preview?1:0;Nd.encode(d,o.range),e.string.encode(d,o.url),e.uint.encode(d,n),o.preview&&jd.encode(d,o.preview)},decode:d=>({range:Nd.decode(d),url:e.string.decode(d),preview:1&e.uint.decode(d)?jd.decode(d):null})},Ud=e.array(e.frame(qd)),Jd=e.array(e.frame(Od)),Gd=Jd,Qd=e.array(e.frame(Vd)),Wd=Qd,Xd=Qd,Yd=e.array(e.frame(Md)),Zd=Qd,$d=Qd,_d={preencode(o,n){const c=(n.mention?1:0)|(n.httpLink?2:0)|(n.pearLink?4:0)|(n.bold?8:0)|(n.italic?16:0)|(n.code?32:0)|(n.emoji?64:0)|(n.codeBlock?128:0)|(n.strike?256:0)|(d>=11&&n.translation?512:0);e.uint.preencode(o,c),n.mention&&Ud.preencode(o,n.mention),n.httpLink&&Jd.preencode(o,n.httpLink),n.pearLink&&Gd.preencode(o,n.pearLink),n.bold&&Qd.preencode(o,n.bold),n.italic&&Wd.preencode(o,n.italic),n.code&&Xd.preencode(o,n.code),n.emoji&&Yd.preencode(o,n.emoji),n.codeBlock&&Zd.preencode(o,n.codeBlock),n.strike&&$d.preencode(o,n.strike),d>=11&&n.translation&&ya.preencode(o,n.translation)},encode(o,n){const c=(n.mention?1:0)|(n.httpLink?2:0)|(n.pearLink?4:0)|(n.bold?8:0)|(n.italic?16:0)|(n.code?32:0)|(n.emoji?64:0)|(n.codeBlock?128:0)|(n.strike?256:0)|(d>=11&&n.translation?512:0);e.uint.encode(o,c),n.mention&&Ud.encode(o,n.mention),n.httpLink&&Jd.encode(o,n.httpLink),n.pearLink&&Gd.encode(o,n.pearLink),n.bold&&Qd.encode(o,n.bold),n.italic&&Wd.encode(o,n.italic),n.code&&Xd.encode(o,n.code),n.emoji&&Yd.encode(o,n.emoji),n.codeBlock&&Zd.encode(o,n.codeBlock),n.strike&&$d.encode(o,n.strike),d>=11&&n.translation&&ya.encode(o,n.translation)},decode(o){const n=e.uint.decode(o);return{mention:1&n?Ud.decode(o):null,httpLink:2&n?Jd.decode(o):null,pearLink:4&n?Gd.decode(o):null,bold:8&n?Qd.decode(o):null,italic:16&n?Wd.decode(o):null,code:32&n?Xd.decode(o):null,emoji:64&n?Yd.decode(o):null,codeBlock:128&n?Zd.decode(o):null,strike:256&n?$d.decode(o):null,translation:d>=11&&512&n?ya.decode(o):null}}},eo=e.array(e.frame(v)),oo=e.frame(_d),no=e.frame(Hd),co={preencode(d,o){d.end++,o.text&&e.string.preencode(d,o.text),o.files&&eo.preencode(d,o.files),o.display&&oo.preencode(d,o.display),o.replyTo&&n.preencode(d,o.replyTo),o.parent&&n.preencode(d,o.parent),o.event&&no.preencode(d,o.event)},encode(o,c){const t=(c.text?1:0)|(c.files?2:0)|(c.display?4:0)|(c.replyTo?8:0)|(c.parent?16:0)|(c.event?32:0)|(d>=18&&c.forwarded?64:0);e.uint.encode(o,t),c.text&&e.string.encode(o,c.text),c.files&&eo.encode(o,c.files),c.display&&oo.encode(o,c.display),c.replyTo&&n.encode(o,c.replyTo),c.parent&&n.encode(o,c.parent),c.event&&no.encode(o,c.event)},decode(o){const c=e.uint.decode(o);return{text:1&c?e.string.decode(o):null,files:2&c?eo.decode(o):null,display:4&c?oo.decode(o):null,replyTo:8&c?n.decode(o):null,parent:16&c?n.decode(o):null,event:32&c?no.decode(o):null,forwarded:d>=18&&!!(64&c)}}},to=Bd,ro=oo,io={preencode(d,o){d.end++,o.text&&e.string.preencode(d,o.text),o.files&&to.preencode(d,o.files),o.display&&ro.preencode(d,o.display),o.replyTo&&n.preencode(d,o.replyTo),o.parent&&n.preencode(d,o.parent)},encode(o,c){const t=(c.text?1:0)|(c.files?2:0)|(c.display?4:0)|(c.replyTo?8:0)|(c.parent?16:0)|(d>=18&&c.forwarded?32:0);e.uint.encode(o,t),c.text&&e.string.encode(o,c.text),c.files&&to.encode(o,c.files),c.display&&ro.encode(o,c.display),c.replyTo&&n.encode(o,c.replyTo),c.parent&&n.encode(o,c.parent)},decode(o){const c=e.uint.decode(o);return{text:1&c?e.string.decode(o):null,files:2&c?to.decode(o):null,display:4&c?ro.decode(o):null,replyTo:8&c?n.decode(o):null,parent:16&c?n.decode(o):null,forwarded:d>=18&&!!(32&c)}}},ao=eo,so=oo,po={preencode(d,o){d.end++,o.text&&e.string.preencode(d,o.text),o.files&&ao.preencode(d,o.files),o.display&&so.preencode(d,o.display),o.replyTo&&n.preencode(d,o.replyTo),o.parent&&n.preencode(d,o.parent)},encode(o,c){const t=(c.text?1:0)|(c.files?2:0)|(c.display?4:0)|(c.replyTo?8:0)|(c.parent?16:0)|(d>=18&&c.forwarded?32:0);e.uint.encode(o,t),c.text&&e.string.encode(o,c.text),c.files&&ao.encode(o,c.files),c.display&&so.encode(o,c.display),c.replyTo&&n.encode(o,c.replyTo),c.parent&&n.encode(o,c.parent)},decode(o){const c=e.uint.decode(o);return{text:1&c?e.string.decode(o):null,files:2&c?ao.decode(o):null,display:4&c?so.decode(o):null,replyTo:8&c?n.decode(o):null,parent:16&c?n.decode(o):null,forwarded:d>=18&&!!(32&c)}}},uo={preencode(e,d){e.end++},encode(d,o){const n=(o.isEdited?1:0)|(o.isDeleted?2:0)|(o.isPinned?4:0);e.uint.encode(d,n)},decode(d){const o=e.uint.decode(d);return{isEdited:!!(1&o),isDeleted:!!(2&o),isPinned:!!(4&o)}}},lo={preencode(d,o){e.uint.preencode(d,o.thread),e.uint.preencode(d,o.index)},encode(d,o){e.uint.encode(d,o.thread),e.uint.encode(d,o.index)},decode:d=>({thread:e.uint.decode(d),index:e.uint.decode(d)})},fo=e.frame(z),mo={preencode(d,o){e.uint.preencode(d,o.id),e.uint.preencode(d,o.count),d.end++,o.parent&&n.preencode(d,o.parent),o.stats&&fo.preencode(d,o.stats)},encode(d,o){const c=(o.parent?1:0)|(o.stats?2:0);e.uint.encode(d,o.id),e.uint.encode(d,o.count),e.uint.encode(d,c),o.parent&&n.encode(d,o.parent),o.stats&&fo.encode(d,o.stats)},decode(d){const o=e.uint.decode(d),c=e.uint.decode(d),t=e.uint.decode(d);return{id:o,count:c,parent:1&t?n.decode(d):null,stats:2&t?fo.decode(d):null}}},yo=e.frame(uo),bo=e.frame(io),xo=e.frame(Cd),ko={preencode(d,o){lo.preencode(d,o.id),n.preencode(d,o.oplog),e.uint.preencode(d,o.clock),e.uint.preencode(d,o.timestamp),d.end++,o.editedAt&&e.uint.preencode(d,o.editedAt),yo.preencode(d,o.status),o.message&&bo.preencode(d,o.message),o.event&&xo.preencode(d,o.event)},encode(d,o){const c=(o.editedAt?1:0)|(o.message?2:0)|(o.event?4:0);lo.encode(d,o.id),n.encode(d,o.oplog),e.uint.encode(d,o.clock),e.uint.encode(d,o.timestamp),e.uint.encode(d,c),o.editedAt&&e.uint.encode(d,o.editedAt),yo.encode(d,o.status),o.message&&bo.encode(d,o.message),o.event&&xo.encode(d,o.event)},decode(d){const o=lo.decode(d),c=n.decode(d),t=e.uint.decode(d),r=e.uint.decode(d),i=e.uint.decode(d);return{id:o,oplog:c,clock:t,timestamp:r,editedAt:1&i?e.uint.decode(d):0,status:yo.decode(d),message:2&i?bo.decode(d):null,event:4&i?xo.decode(d):null}}},vo=yo,go=e.frame(po),ho=xo,Ko={preencode(d,o){lo.preencode(d,o.id),n.preencode(d,o.oplog),e.uint.preencode(d,o.clock),e.uint.preencode(d,o.timestamp),d.end++,o.editedAt&&e.uint.preencode(d,o.editedAt),vo.preencode(d,o.status),o.message&&go.preencode(d,o.message),o.event&&ho.preencode(d,o.event)},encode(d,o){const c=(o.editedAt?1:0)|(o.message?2:0)|(o.event?4:0);lo.encode(d,o.id),n.encode(d,o.oplog),e.uint.encode(d,o.clock),e.uint.encode(d,o.timestamp),e.uint.encode(d,c),o.editedAt&&e.uint.encode(d,o.editedAt),vo.encode(d,o.status),o.message&&go.encode(d,o.message),o.event&&ho.encode(d,o.event)},decode(d){const o=lo.decode(d),c=n.decode(d),t=e.uint.decode(d),r=e.uint.decode(d),i=e.uint.decode(d);return{id:o,oplog:c,clock:t,timestamp:r,editedAt:1&i?e.uint.decode(d):0,status:vo.decode(d),message:2&i?go.decode(d):null,event:4&i?ho.decode(d):null}}},wo=$,Ao=e.frame(co),To={preencode(e,d){wo.preencode(e,d.header),Ao.preencode(e,d.message)},encode(e,d){wo.encode(e,d.header),Ao.encode(e,d.message)},decode:e=>({header:wo.decode(e),message:Ao.decode(e)})},So=$,Po={preencode(e,d){So.preencode(e,d.header),n.preencode(e,d.oplog)},encode(e,d){So.encode(e,d.header),n.encode(e,d.oplog)},decode:e=>({header:So.decode(e),oplog:n.decode(e)})},Io=$,Fo=Ao,Ro={preencode(e,d){Io.preencode(e,d.header),n.preencode(e,d.oplog),Fo.preencode(e,d.message)},encode(e,d){Io.encode(e,d.header),n.encode(e,d.oplog),Fo.encode(e,d.message)},decode:e=>({header:Io.decode(e),oplog:n.decode(e),message:Fo.decode(e)})},Co=$,Ho={preencode(e,d){Co.preencode(e,d.header),n.preencode(e,d.oplog),e.end++},encode(d,o){const c=o.isPinned?1:0;Co.encode(d,o.header),n.encode(d,o.oplog),e.uint.encode(d,c)},decode:d=>({header:Co.decode(d),oplog:n.decode(d),isPinned:!!(1&e.uint.decode(d))})},Vo={preencode(d,o){lo.preencode(d,o.id),e.fixed32.preencode(d,o.sender),e.uint.preencode(d,o.clock),e.string.preencode(d,o.reaction)},encode(d,o){lo.encode(d,o.id),e.fixed32.encode(d,o.sender),e.uint.encode(d,o.clock),e.string.encode(d,o.reaction)},decode:d=>({id:lo.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),reaction:e.string.decode(d)})},Do={preencode(d,o){e.string.preencode(d,o.text),e.uint.preencode(d,o.count)},encode(d,o){e.string.encode(d,o.text),e.uint.encode(d,o.count)},decode:d=>({text:e.string.decode(d),count:e.uint.decode(d)})},Mo=e.array(e.frame(Do)),Lo={preencode(o,n){lo.preencode(o,n.id),e.uint.preencode(o,n.total),Mo.preencode(o,n.reactions),o.end++,d>=11&&n.editedAt&&e.uint.preencode(o,n.editedAt)},encode(o,n){const c=d>=11&&n.editedAt?1:0;lo.encode(o,n.id),e.uint.encode(o,n.total),Mo.encode(o,n.reactions),e.uint.encode(o,c),d>=11&&n.editedAt&&e.uint.encode(o,n.editedAt)},decode(o){const n=lo.decode(o),c=e.uint.decode(o),t=Mo.decode(o),r=o.start<o.end?e.uint.decode(o):0;return{id:n,total:c,reactions:t,editedAt:d>=11&&1&r?e.uint.decode(o):0}}},qo=$,Eo={preencode(d,o){qo.preencode(d,o.header),n.preencode(d,o.oplog),e.string.preencode(d,o.reaction)},encode(d,o){qo.encode(d,o.header),n.encode(d,o.oplog),e.string.encode(d,o.reaction)},decode:d=>({header:qo.decode(d),oplog:n.decode(d),reaction:e.string.decode(d)})},Bo=$,zo={preencode(d,o){Bo.preencode(d,o.header),n.preencode(d,o.oplog),e.string.preencode(d,o.reaction)},encode(d,o){Bo.encode(d,o.header),n.encode(d,o.oplog),e.string.encode(d,o.reaction)},decode:d=>({header:Bo.decode(d),oplog:n.decode(d),reaction:e.string.decode(d)})},No=$,jo=e.frame(Y),Oo={preencode(d,o){No.preencode(d,o.header),e.uint.preencode(d,o.key),jo.preencode(d,o.config)},encode(d,o){No.encode(d,o.header),e.uint.encode(d,o.key),jo.encode(d,o.config)},decode:d=>({header:No.decode(d),key:e.uint.decode(d),config:jo.decode(d)})},Uo={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.string.preencode(d,o.displayName),d.end++,o.avatar&&ba.preencode(d,o.avatar)},encode(d,o){const n=o.avatar?1:0;e.fixed32.encode(d,o.memberKey),e.string.encode(d,o.displayName),e.uint.encode(d,n),o.avatar&&ba.encode(d,o.avatar)},decode:d=>({memberKey:e.fixed32.decode(d),displayName:e.string.decode(d),avatar:1&e.uint.decode(d)?ba.decode(d):null})},Jo={preencode(d,o){e.fixed32.preencode(d,o.key),d.end++,o.username&&e.string.preencode(d,o.username)},encode(d,o){const n=o.username?1:0;e.fixed32.encode(d,o.key),e.uint.encode(d,n),o.username&&e.string.encode(d,o.username)},decode:d=>({key:e.fixed32.decode(d),username:1&e.uint.decode(d)?e.string.decode(d):null})},Go=e.frame(Jo),Qo={preencode(d,o){e.fixed32.preencode(d,o.publicKey),d.end++,o.discoveryCoreKey&&e.fixed32.preencode(d,o.discoveryCoreKey),o.userRegistry&&Go.preencode(d,o.userRegistry)},encode(d,o){const n=(o.discoveryCoreKey?1:0)|(o.userRegistry?2:0);e.fixed32.encode(d,o.publicKey),e.uint.encode(d,n),o.discoveryCoreKey&&e.fixed32.encode(d,o.discoveryCoreKey),o.userRegistry&&Go.encode(d,o.userRegistry)},decode(d){const o=e.fixed32.decode(d),n=e.uint.decode(d);return{publicKey:o,discoveryCoreKey:1&n?e.fixed32.decode(d):null,userRegistry:2&n?Go.decode(d):null}}},Wo=$,Xo=e.frame(G),Yo=e.frame(Q),Zo=jo,$o=e.frame(Qo),_o=be,en=e.array(e.frame(ue)),dn={preencode(e,d){Wo.preencode(e,d.header),Xo.preencode(e,d.digest),Yo.preencode(e,d.capabilities),e.end++,d.config&&Zo.preencode(e,d.config),d.identity&&$o.preencode(e,d.identity),d.bootstrapDevice&&_o.preencode(e,d.bootstrapDevice),d.initialMembers&&en.preencode(e,d.initialMembers)},encode(d,o){const n=(o.config?1:0)|(o.identity?2:0)|(o.bootstrapDevice?4:0)|(o.initialMembers?8:0);Wo.encode(d,o.header),Xo.encode(d,o.digest),Yo.encode(d,o.capabilities),e.uint.encode(d,n),o.config&&Zo.encode(d,o.config),o.identity&&$o.encode(d,o.identity),o.bootstrapDevice&&_o.encode(d,o.bootstrapDevice),o.initialMembers&&en.encode(d,o.initialMembers)},decode(d){const o=Wo.decode(d),n=Xo.decode(d),c=Yo.decode(d),t=e.uint.decode(d);return{header:o,digest:n,capabilities:c,config:1&t?Zo.decode(d):null,identity:2&t?$o.decode(d):null,bootstrapDevice:4&t?_o.decode(d):null,initialMembers:8&t?en.decode(d):null}}},on=$,nn={preencode(d,o){on.preencode(d,o.header),e.uint.preencode(d,o.version)},encode(d,o){on.encode(d,o.header),e.uint.encode(d,o.version)},decode:d=>({header:on.decode(d),version:e.uint.decode(d)})},cn=$,tn=J,rn={preencode(d,o){cn.preencode(d,o.header),e.uint.preencode(d,o.key),tn.preencode(d,o.settings)},encode(d,o){cn.encode(d,o.header),e.uint.encode(d,o.key),tn.encode(d,o.settings)},decode:d=>({header:cn.decode(d),key:e.uint.decode(d),settings:tn.decode(d)})},an={preencode(o,n){e.fixed32.preencode(o,n.memberKey),xa.preencode(o,n.status),o.end++,n.mailbox&&e.fixed32.preencode(o,n.mailbox),n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=22&&n.contactInfo&&ka.preencode(o,n.contactInfo),d>=22&&n.version&&e.uint.preencode(o,n.version),d>=24&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=(n.mailbox?1:0)|(n.roomKey?2:0)|(d>=22&&n.contactInfo?4:0)|(d>=22&&n.version?8:0)|(d>=24&&n.alias?16:0);e.fixed32.encode(o,n.memberKey),xa.encode(o,n.status),e.uint.encode(o,c),n.mailbox&&e.fixed32.encode(o,n.mailbox),n.roomKey&&e.fixed32.encode(o,n.roomKey),d>=22&&n.contactInfo&&ka.encode(o,n.contactInfo),d>=22&&n.version&&e.uint.encode(o,n.version),d>=24&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=e.fixed32.decode(o),c=xa.decode(o),t=e.uint.decode(o);return{memberKey:n,status:c,mailbox:1&t?e.fixed32.decode(o):null,roomKey:2&t?e.fixed32.decode(o):null,contactInfo:d>=22&&4&t?ka.decode(o):null,version:d>=22&&8&t?e.uint.decode(o):0,alias:d>=24&&16&t?e.string.decode(o):null}}},sn={preencode(d,n){e.fixed32.preencode(d,n.roomKey),e.buffer.preencode(d,n.encryptionKey),e.fixed32.preencode(d,n.seed),o.preencode(d,n.initiator),e.fixed32.preencode(d,n.fastForwardTo)},encode(d,n){e.fixed32.encode(d,n.roomKey),e.buffer.encode(d,n.encryptionKey),e.fixed32.encode(d,n.seed),o.encode(d,n.initiator),e.fixed32.encode(d,n.fastForwardTo)},decode:d=>({roomKey:e.fixed32.decode(d),encryptionKey:e.buffer.decode(d),seed:e.fixed32.decode(d),initiator:o.decode(d),fastForwardTo:e.fixed32.decode(d)})},pn=e.array(e.frame(sn)),un=X,ln={preencode(e,d){pn.preencode(e,d.sharedRooms),un.preencode(e,d.blockedContacts)},encode(e,d){pn.encode(e,d.sharedRooms),un.encode(e,d.blockedContacts)},decode:e=>({sharedRooms:pn.decode(e),blockedContacts:un.decode(e)})},fn=$o,mn={preencode(e,d){fn.preencode(e,d.identity)},encode(e,d){fn.encode(e,d.identity)},decode:e=>({identity:fn.decode(e)})},yn={preencode(d,o){e.uint.preencode(d,o.rooms),e.uint.preencode(d,o.contacts)},encode(d,o){e.uint.encode(d,o.rooms),e.uint.encode(d,o.contacts)},decode:d=>({rooms:e.uint.decode(d),contacts:e.uint.decode(d)})},bn={preencode(d,o){e.uint.preencode(d,o.rooms),e.uint.preencode(d,o.contactRequests)},encode(d,o){e.uint.encode(d,o.rooms),e.uint.encode(d,o.contactRequests)},decode:d=>({rooms:e.uint.decode(d),contactRequests:e.uint.decode(d)})},xn={preencode(d,o){e.buffer.preencode(d,o.entropy)},encode(d,o){e.buffer.encode(d,o.entropy)},decode:d=>({entropy:e.buffer.decode(d)})},kn={preencode(d,o){e.fixed32.preencode(d,o.publicKey),e.fixed32.preencode(d,o.devicePublicKey),e.fixed32.preencode(d,o.writerKey)},encode(d,o){e.fixed32.encode(d,o.publicKey),e.fixed32.encode(d,o.devicePublicKey),e.fixed32.encode(d,o.writerKey)},decode:d=>({publicKey:e.fixed32.decode(d),devicePublicKey:e.fixed32.decode(d),writerKey:e.fixed32.decode(d)})},vn=e.frame(kn),gn={preencode(n,c){e.fixed32.preencode(n,c.id),e.fixed32.preencode(n,c.invitationSeed),e.fixed32.preencode(n,c.mailbox),t.preencode(n,c.responseKeyPair),o.preencode(n,c.initiator),o.preencode(n,c.inviter),n.end++,c.identity&&vn.preencode(n,c.identity),d>=20&&c.buildType&&Bt.preencode(n,c.buildType),d>=27&&c.link&&o.preencode(n,c.link)},encode(n,c){const r=(c.identity?1:0)|(d>=20&&c.buildType?2:0)|(d>=27&&c.link?4:0);e.fixed32.encode(n,c.id),e.fixed32.encode(n,c.invitationSeed),e.fixed32.encode(n,c.mailbox),t.encode(n,c.responseKeyPair),o.encode(n,c.initiator),o.encode(n,c.inviter),e.uint.encode(n,r),c.identity&&vn.encode(n,c.identity),d>=20&&c.buildType&&Bt.encode(n,c.buildType),d>=27&&c.link&&o.encode(n,c.link)},decode(n){const c=e.fixed32.decode(n),r=e.fixed32.decode(n),i=e.fixed32.decode(n),a=t.decode(n),s=o.decode(n),p=o.decode(n),u=e.uint.decode(n);return{id:c,invitationSeed:r,mailbox:i,responseKeyPair:a,initiator:s,inviter:p,identity:1&u?vn.decode(n):null,buildType:d>=20&&2&u?Bt.decode(n):null,link:d>=27&&4&u?o.decode(n):null}}},hn=$,Kn={preencode(d,o){hn.preencode(d,o.header),e.buffer.preencode(d,o.blindResponse)},encode(d,o){hn.encode(d,o.header),e.buffer.encode(d,o.blindResponse)},decode:d=>({header:hn.decode(d),blindResponse:e.buffer.decode(d)})},wn=$,An=e.frame(gn),Tn={preencode(e,d){wn.preencode(e,d.header),An.preencode(e,d.invitation)},encode(e,d){wn.encode(e,d.header),An.encode(e,d.invitation)},decode:e=>({header:wn.decode(e),invitation:An.decode(e)})},Sn=$,Pn={preencode(d,o){Sn.preencode(d,o.header),e.fixed32.preencode(d,o.id)},encode(d,o){Sn.encode(d,o.header),e.fixed32.encode(d,o.id)},decode:d=>({header:Sn.decode(d),id:e.fixed32.decode(d)})},In={preencode(d,o){e.fixed32.preencode(d,o.publicKey),e.fixed32.preencode(d,o.devicePublicKey),d.end++,o.privateProfileKey&&e.fixed32.preencode(d,o.privateProfileKey),o.deviceKeyPair&&t.preencode(d,o.deviceKeyPair),e.buffer.preencode(d,o.deviceProof)},encode(d,o){const n=(o.privateProfileKey?1:0)|(o.deviceKeyPair?2:0);e.fixed32.encode(d,o.publicKey),e.fixed32.encode(d,o.devicePublicKey),e.uint.encode(d,n),o.privateProfileKey&&e.fixed32.encode(d,o.privateProfileKey),o.deviceKeyPair&&t.encode(d,o.deviceKeyPair),e.buffer.encode(d,o.deviceProof)},decode(d){const o=e.fixed32.decode(d),n=e.fixed32.decode(d),c=e.uint.decode(d);return{publicKey:o,devicePublicKey:n,privateProfileKey:1&c?e.fixed32.decode(d):null,deviceKeyPair:2&c?t.decode(d):null,deviceProof:e.buffer.decode(d)}}},Fn={preencode(o,n){o.end++,d>=25&&n.roomSnoozeTime&&e.uint.preencode(o,n.roomSnoozeTime)},encode(o,n){const c=(n.isActive?1:0)|(n.isFullyMuted?2:0)|(n.isMentionsOnlyMuted?4:0)|(d>=9&&n.isReadOnly?8:0)|(d>=18&&n.isFavorite?16:0)|(d>=21&&n.isUnread?32:0)|(d>=25&&n.roomSnoozeTime?64:0);e.uint.encode(o,c),d>=25&&n.roomSnoozeTime&&e.uint.encode(o,n.roomSnoozeTime)},decode(o){const n=e.uint.decode(o);return{isActive:!!(1&n),isFullyMuted:!!(2&n),isMentionsOnlyMuted:!!(4&n),isReadOnly:d>=9&&!!(8&n),isFavorite:d>=18&&!!(16&n),isUnread:d>=21&&!!(32&n),roomSnoozeTime:d>=25&&64&n?e.uint.decode(o):0}}},Rn=e.frame(Fn),Cn=e.frame(In),Hn=vn,Vn={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.mailbox),Rn.preencode(n,c.status),e.uint.preencode(n,c.clock),n.end++,c.initiator&&o.preencode(n,c.initiator),c.fastForwardTo&&e.fixed32.preencode(n,c.fastForwardTo),c.identitySwap&&Cn.preencode(n,c.identitySwap),d>=6&&c.identitySwapV2&&Hn.preencode(n,c.identitySwapV2),d>=10&&c.contact&&e.fixed32.preencode(n,c.contact),d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=29&&c.activeClock&&e.uint.preencode(n,c.activeClock)},encode(n,c){const t=(c.initiator?1:0)|(c.fastForwardTo?2:0)|(c.identitySwap?4:0)|(d>=6&&c.identitySwapV2?8:0)|(d>=10&&c.contact?16:0)|(d>=27&&c.bootFrom?32:0)|(d>=29&&c.activeClock?64:0);e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),Rn.encode(n,c.status),e.uint.encode(n,c.clock),e.uint.encode(n,t),c.initiator&&o.encode(n,c.initiator),c.fastForwardTo&&e.fixed32.encode(n,c.fastForwardTo),c.identitySwap&&Cn.encode(n,c.identitySwap),d>=6&&c.identitySwapV2&&Hn.encode(n,c.identitySwapV2),d>=10&&c.contact&&e.fixed32.encode(n,c.contact),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom),d>=29&&c.activeClock&&e.uint.encode(n,c.activeClock)},decode(n){const c=e.fixed32.decode(n),t=e.buffer.decode(n),r=e.fixed32.decode(n),i=Rn.decode(n),a=e.uint.decode(n),s=e.uint.decode(n);return{roomKey:c,encryptionKey:t,mailbox:r,status:i,clock:a,initiator:1&s?o.decode(n):null,fastForwardTo:2&s?e.fixed32.decode(n):null,identitySwap:4&s?Cn.decode(n):null,identitySwapV2:d>=6&&8&s?Hn.decode(n):null,contact:d>=10&&16&s?e.fixed32.decode(n):null,bootFrom:d>=27&&32&s?o.decode(n):null,activeClock:d>=29&&64&s?e.uint.decode(n):0}}},Dn=$,Mn={preencode(d,n){Dn.preencode(d,n.header),e.fixed32.preencode(d,n.roomKey),e.buffer.preencode(d,n.encryptionKey),e.fixed32.preencode(d,n.mailbox),d.end++,n.fastForwardTo&&e.fixed32.preencode(d,n.fastForwardTo),n.initiator&&o.preencode(d,n.initiator),n.dm&&e.fixed32.preencode(d,n.dm)},encode(n,c){const t=(c.fastForwardTo?1:0)|(c.initiator?2:0)|(c.dm?4:0)|(d>=9&&c.isReadOnly?8:0);Dn.encode(n,c.header),e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),e.uint.encode(n,t),c.fastForwardTo&&e.fixed32.encode(n,c.fastForwardTo),c.initiator&&o.encode(n,c.initiator),c.dm&&e.fixed32.encode(n,c.dm)},decode(n){const c=Dn.decode(n),t=e.fixed32.decode(n),r=e.buffer.decode(n),i=e.fixed32.decode(n),a=e.uint.decode(n);return{header:c,roomKey:t,encryptionKey:r,mailbox:i,fastForwardTo:1&a?e.fixed32.decode(n):null,initiator:2&a?o.decode(n):null,dm:4&a?e.fixed32.decode(n):null,isReadOnly:d>=9&&!!(8&a)}}},Ln=$,qn={preencode(d,o){Ln.preencode(d,o.header),e.fixed32.preencode(d,o.discoveryKey)},encode(d,o){Ln.encode(d,o.header),e.fixed32.encode(d,o.discoveryKey)},decode:d=>({header:Ln.decode(d),discoveryKey:e.fixed32.decode(d)})},En=$,Bn=Rn,zn={preencode(d,o){En.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.key),Bn.preencode(d,o.status)},encode(d,o){En.encode(d,o.header),e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.key),Bn.encode(d,o.status)},decode:d=>({header:En.decode(d),roomKey:e.fixed32.decode(d),key:e.uint.decode(d),status:Bn.decode(d)})},Nn={preencode(e,d){e.end++},encode(o,n){const c=(n.isBlocked?1:0)|(d>=22&&n.isActive?2:0);e.uint.encode(o,c)},decode(o){const n=e.uint.decode(o);return{isBlocked:!!(1&n),isActive:d>=22&&!!(2&n)}}},jn={preencode(o,n){e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.clock),va.preencode(o,n.status),o.end++,n.mailbox&&e.fixed32.preencode(o,n.mailbox),n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=22&&n.contactInfo&&ga.preencode(o,n.contactInfo),d>=24&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=(n.mailbox?1:0)|(n.roomKey?2:0)|(d>=22&&n.contactInfo?4:0)|(d>=24&&n.alias?8:0);e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.clock),va.encode(o,n.status),e.uint.encode(o,c),n.mailbox&&e.fixed32.encode(o,n.mailbox),n.roomKey&&e.fixed32.encode(o,n.roomKey),d>=22&&n.contactInfo&&ga.encode(o,n.contactInfo),d>=24&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),t=va.decode(o),r=e.uint.decode(o);return{memberKey:n,clock:c,status:t,mailbox:1&r?e.fixed32.decode(o):null,roomKey:2&r?e.fixed32.decode(o):null,contactInfo:d>=22&&4&r?ga.decode(o):null,alias:d>=24&&8&r?e.string.decode(o):null}}},On=$,Un=e.frame(an),Jn={preencode(e,d){On.preencode(e,d.header),Un.preencode(e,d.contact)},encode(e,d){On.encode(e,d.header),Un.encode(e,d.contact)},decode:e=>({header:On.decode(e),contact:Un.decode(e)})},Gn=$,Qn={preencode(d,o){Gn.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.key),ha.preencode(d,o.status)},encode(d,o){Gn.encode(d,o.header),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.key),ha.encode(d,o.status)},decode:d=>({header:Gn.decode(d),memberKey:e.fixed32.decode(d),key:e.uint.decode(d),status:ha.decode(d)})},Wn=$,Xn={preencode(d,o){Wn.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey)},encode(d,o){Wn.encode(d,o.header),e.fixed32.encode(d,o.memberKey)},decode:d=>({header:Wn.decode(d),memberKey:e.fixed32.decode(d)})},Yn={preencode(e,d){e.end++},encode(d,o){const n=(o.isPending?1:0)|(o.isAccepted?2:0)|(o.isRejected?4:0)|(o.isDiscarded?8:0)|(o.isSeen?16:0);e.uint.encode(d,n)},decode(d){const o=e.uint.decode(d);return{isPending:!!(1&o),isAccepted:!!(2&o),isRejected:!!(4&o),isDiscarded:!!(8&o),isSeen:!!(16&o)}}},Zn=xe,$n=e.frame(r),_n={preencode(d,o){Zn.preencode(d,o.sender),$n.preencode(d,o.keys),e.fixed32.preencode(d,o.mailbox),d.end++,o.message&&e.string.preencode(d,o.message)},encode(d,o){const n=o.message?1:0;Zn.encode(d,o.sender),$n.encode(d,o.keys),e.fixed32.encode(d,o.mailbox),e.uint.encode(d,n),o.message&&e.string.encode(d,o.message)},decode:d=>({sender:Zn.decode(d),keys:$n.decode(d),mailbox:e.fixed32.decode(d),message:1&e.uint.decode(d)?e.string.decode(d):null})},ec=e.frame(_n),dc={preencode(o,n){ec.preencode(o,n.body),ne.preencode(o,n.attestation),o.end++,d>=31&&n.recipientProof&&e.buffer.preencode(o,n.recipientProof)},encode(o,n){const c=d>=31&&n.recipientProof?1:0;ec.encode(o,n.body),ne.encode(o,n.attestation),e.uint.encode(o,c),d>=31&&n.recipientProof&&e.buffer.encode(o,n.recipientProof)},decode(o){const n=ec.decode(o),c=ne.decode(o),t=o.start<o.end?e.uint.decode(o):0;return{body:n,attestation:c,recipientProof:d>=31&&1&t?e.buffer.decode(o):null}}},oc=pe,nc=e.frame(Yn),cc=$n,tc={preencode(o,n){e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.clock),oc.preencode(o,n.sender),nc.preencode(o,n.status),cc.preencode(o,n.keys),e.fixed32.preencode(o,n.mailbox),o.end++,n.message&&e.string.preencode(o,n.message),d>=11&&n.sentAt&&e.uint.preencode(o,n.sentAt),d>=22&&n.contactInfo&&Ka.preencode(o,n.contactInfo)},encode(o,n){const c=(n.message?1:0)|(d>=11&&n.sentAt?2:0)|(d>=22&&n.contactInfo?4:0);e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.clock),oc.encode(o,n.sender),nc.encode(o,n.status),cc.encode(o,n.keys),e.fixed32.encode(o,n.mailbox),e.uint.encode(o,c),n.message&&e.string.encode(o,n.message),d>=11&&n.sentAt&&e.uint.encode(o,n.sentAt),d>=22&&n.contactInfo&&Ka.encode(o,n.contactInfo)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),t=oc.decode(o),r=nc.decode(o),i=cc.decode(o),a=e.fixed32.decode(o),s=e.uint.decode(o);return{memberKey:n,clock:c,sender:t,status:r,keys:i,mailbox:a,message:1&s?e.string.decode(o):null,sentAt:d>=11&&2&s?e.uint.decode(o):0,contactInfo:d>=22&&4&s?Ka.decode(o):null}}},rc=$,ic={preencode(d,o){rc.preencode(d,o.header),e.buffer.preencode(d,o.blindRequest)},encode(d,o){rc.encode(d,o.header),e.buffer.encode(d,o.blindRequest)},decode:d=>({header:rc.decode(d),blindRequest:e.buffer.decode(d)})},ac=$,sc=nc,pc={preencode(o,n){ac.preencode(o,n.header),e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.key),sc.preencode(o,n.status),o.end++,d>=10&&n.roomKey&&e.fixed32.preencode(o,n.roomKey)},encode(o,n){const c=d>=10&&n.roomKey?1:0;ac.encode(o,n.header),e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.key),sc.encode(o,n.status),e.uint.encode(o,c),d>=10&&n.roomKey&&e.fixed32.encode(o,n.roomKey)},decode(o){const n=ac.decode(o),c=e.fixed32.decode(o),t=e.uint.decode(o),r=sc.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{header:n,memberKey:c,key:t,status:r,roomKey:d>=10&&1&i?e.fixed32.decode(o):null}}},uc={preencode(d,o){e.uint.preencode(d,o.timestamp),e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.mailbox)},encode(d,o){e.uint.encode(d,o.timestamp),e.fixed32.encode(d,o.key),e.fixed32.encode(d,o.mailbox)},decode:d=>({version:0,timestamp:e.uint.decode(d),key:e.fixed32.decode(d),mailbox:e.fixed32.decode(d)})},lc={preencode(d,o){const n=o.version??1;switch(e.uint.preencode(d,n),n){case 0:case 1:uc.preencode(d,o);break;default:throw new Error("Unsupported version")}},encode(d,o){const n=o.version??1;switch(e.uint.encode(d,n),n){case 0:case 1:uc.encode(d,o);break;default:throw new Error("Unsupported version")}},decode(d){const o=e.uint.decode(d);switch(o){case 0:case 1:{const e=uc.decode(d);return e.version=o,e}default:throw new Error("Unsupported version")}}},fc=$,mc={preencode(o,c){fc.preencode(o,c.header),n.preencode(o,c.oplog),e.uint.preencode(o,c.index),wa.preencode(o,c.preview),o.end++,d>=7&&c.displayType&&Sc.preencode(o,c.displayType)},encode(o,c){const t=d>=7&&c.displayType?1:0;fc.encode(o,c.header),n.encode(o,c.oplog),e.uint.encode(o,c.index),wa.encode(o,c.preview),e.uint.encode(o,t),d>=7&&c.displayType&&Sc.encode(o,c.displayType)},decode(o){const c=fc.decode(o),t=n.decode(o),r=e.uint.decode(o),i=wa.decode(o),a=o.start<o.end?e.uint.decode(o):0;return{header:c,oplog:t,index:r,preview:i,displayType:d>=7&&1&a?Sc.decode(o):0}}},yc={preencode(o,n){o.end++,d>=3&&n.memberKey&&e.fixed32.preencode(o,n.memberKey)},encode(o,n){const c=d>=3&&n.memberKey?1:0;e.uint.encode(o,c),d>=3&&n.memberKey&&e.fixed32.encode(o,n.memberKey)},decode(o){const n=e.uint.decode(o);return{memberKey:d>=3&&1&n?e.fixed32.decode(o):null}}},bc=pe,xc={preencode(e,d){bc.preencode(e,d.profile),ne.preencode(e,d.attestation)},encode(e,d){bc.encode(e,d.profile),ne.encode(e,d.attestation)},decode:e=>({profile:bc.decode(e),attestation:ne.decode(e)})},kc=$,vc={preencode(d,o){kc.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){kc.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:kc.decode(d),key:e.fixed32.decode(d)})},gc={preencode(d,o){e.fixed32.preencode(d,o.deviceKey),ne.preencode(d,o.privateProfileIdentity),e.buffer.preencode(d,o.deviceProof)},encode(d,o){e.fixed32.encode(d,o.deviceKey),ne.encode(d,o.privateProfileIdentity),e.buffer.encode(d,o.deviceProof)},decode:d=>({deviceKey:e.fixed32.decode(d),privateProfileIdentity:ne.decode(d),deviceProof:e.buffer.decode(d)})},hc={preencode(o,n){e.fixed32.preencode(o,n.roomKey),e.fixed32.preencode(o,n.encryptionKey),e.fixed32.preencode(o,n.seed),o.end++,d>=6&&n.fastForwardTo&&e.fixed32.preencode(o,n.fastForwardTo)},encode(o,n){const c=d>=6&&n.fastForwardTo?1:0;e.fixed32.encode(o,n.roomKey),e.fixed32.encode(o,n.encryptionKey),e.fixed32.encode(o,n.seed),e.uint.encode(o,c),d>=6&&n.fastForwardTo&&e.fixed32.encode(o,n.fastForwardTo)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),t=e.fixed32.decode(o),r=e.uint.decode(o);return{roomKey:n,encryptionKey:c,seed:t,fastForwardTo:d>=6&&1&r?e.fixed32.decode(o):null}}},Kc={preencode(o,n){e.fixed32.preencode(o,n.publicKey),e.fixed32.preencode(o,n.writerKey),e.fixed32.preencode(o,n.devicePublicKey),o.end++,d>=6&&n.privateProfileKey&&e.fixed32.preencode(o,n.privateProfileKey)},encode(o,n){const c=d>=6&&n.privateProfileKey?1:0;e.fixed32.encode(o,n.publicKey),e.fixed32.encode(o,n.writerKey),e.fixed32.encode(o,n.devicePublicKey),e.uint.encode(o,c),d>=6&&n.privateProfileKey&&e.fixed32.encode(o,n.privateProfileKey)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),t=e.fixed32.decode(o),r=e.uint.decode(o);return{publicKey:n,writerKey:c,devicePublicKey:t,privateProfileKey:d>=6&&1&r?e.fixed32.decode(o):null}}},wc=$,Ac={preencode(d,o){wc.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey)},encode(d,o){wc.encode(d,o.header),e.fixed32.encode(d,o.memberKey)},decode:d=>({header:wc.decode(d),memberKey:e.fixed32.decode(d)})},Tc={HttpLink:1,PearLink:2},Sc={preencode(e,d){e.end++},encode(d,o){if(o>2)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},Pc=$,Ic={preencode(d,o){Pc.preencode(d,o.header),e.uint.preencode(d,o.value)},encode(d,o){Pc.encode(d,o.header),e.uint.encode(d,o.value)},decode:d=>({header:Pc.decode(d),value:e.uint.decode(d)})},Fc={preencode(d,o){e.uint.preencode(d,o.key),e.uint.preencode(d,o.value)},encode(d,o){e.uint.encode(d,o.key),e.uint.encode(d,o.value)},decode:d=>({key:e.uint.decode(d),value:e.uint.decode(d)})},Rc=$,Cc={preencode(o,n){Rc.preencode(o,n.header),e.uint.preencode(o,n.from),e.uint.preencode(o,n.to),o.end++,d>=20&&n.buildType&&Bt.preencode(o,n.buildType)},encode(o,n){const c=d>=20&&n.buildType?1:0;Rc.encode(o,n.header),e.uint.encode(o,n.from),e.uint.encode(o,n.to),e.uint.encode(o,c),d>=20&&n.buildType&&Bt.encode(o,n.buildType)},decode(o){const n=Rc.decode(o),c=e.uint.decode(o),t=e.uint.decode(o),r=o.start<o.end?e.uint.decode(o):0;return{header:n,from:c,to:t,buildType:d>=20&&1&r?Bt.decode(o):null}}},Hc={RoomType:1,IsExperimental:2,IsJoiningDisabled:3,IsAppendingDisabled:4,IsCallingDisabled:5,IsMembershipEventsDisabled:6,IsAttachmentsDisabled:7,IsLinksDisabled:8,IsRoomInviteHidden:9},Vc={preencode(e,d){e.end++},encode(d,o){if(o>9)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},Dc={en:"en",it:"it",ru:"ru",es:"es",de:"de"},Mc={preencode(e,d){e.end++},encode(d,o){switch(o){case"en":e.uint.encode(d,1);break;case"it":e.uint.encode(d,2);break;case"ru":e.uint.encode(d,3);break;case"es":e.uint.encode(d,4);break;case"de":e.uint.encode(d,5);break;default:throw new Error("Unknown enum")}},decode(d){switch(e.uint.decode(d)){case 1:return"en";case 2:return"it";case 3:return"ru";case 4:return"es";case 5:return"de";default:return null}}},Lc=Dd,qc={preencode(d,o){Lc.preencode(d,o.range),Mc.preencode(d,o.language),e.string.preencode(d,o.text)},encode(d,o){Lc.encode(d,o.range),Mc.encode(d,o.language),e.string.encode(d,o.text)},decode:d=>({range:Lc.decode(d),language:Mc.decode(d),text:e.string.decode(d)})},Ec={preencode(d,o){e.fixed32.preencode(d,o.deviceKey),e.fixed32.preencode(d,o.key)},encode(d,o){e.fixed32.encode(d,o.deviceKey),e.fixed32.encode(d,o.key)},decode:d=>({deviceKey:e.fixed32.decode(d),key:e.fixed32.decode(d)})},Bc=$,zc={preencode(d,o){Bc.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){Bc.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:Bc.decode(d),key:e.fixed32.decode(d)})},Nc=$,jc={preencode(d,o){Nc.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){Nc.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:Nc.decode(d),key:e.fixed32.decode(d)})},Oc={Flag:1},Uc={preencode(e,d){e.end++},encode(d,o){if(o>1)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},Jc={preencode(d,o){lo.preencode(d,o.id),e.fixed32.preencode(d,o.sender),e.uint.preencode(d,o.clock),Uc.preencode(d,o.label)},encode(d,o){lo.encode(d,o.id),e.fixed32.encode(d,o.sender),e.uint.encode(d,o.clock),Uc.encode(d,o.label)},decode:d=>({id:lo.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),label:Uc.decode(d)})},Gc=$,Qc={preencode(e,d){Gc.preencode(e,d.header),n.preencode(e,d.oplog),Uc.preencode(e,d.label)},encode(e,d){Gc.encode(e,d.header),n.encode(e,d.oplog),Uc.encode(e,d.label)},decode:e=>({header:Gc.decode(e),oplog:n.decode(e),label:Uc.decode(e)})},Wc=$,Xc={preencode(e,d){Wc.preencode(e,d.header),n.preencode(e,d.oplog),Uc.preencode(e,d.label)},encode(e,d){Wc.encode(e,d.header),n.encode(e,d.oplog),Uc.encode(e,d.label)},decode:e=>({header:Wc.decode(e),oplog:n.decode(e),label:Uc.decode(e)})},Yc={preencode(d,o){Uc.preencode(d,o.label),e.uint.preencode(d,o.count)},encode(d,o){Uc.encode(d,o.label),e.uint.encode(d,o.count)},decode:d=>({label:Uc.decode(d),count:e.uint.decode(d)})},Zc=e.array(e.frame(Yc)),$c={preencode(o,n){lo.preencode(o,n.id),e.uint.preencode(o,n.total),Zc.preencode(o,n.labels),e.uint.preencode(o,n.editedAt),o.end++,d>=15&&n.flagsClock&&e.uint.preencode(o,n.flagsClock),d>=15&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(d>=15&&n.flagsClock?1:0)|(d>=15&&n.version?2:0)|(d>=16&&n.isDeleted?4:0);lo.encode(o,n.id),e.uint.encode(o,n.total),Zc.encode(o,n.labels),e.uint.encode(o,n.editedAt),e.uint.encode(o,c),d>=15&&n.flagsClock&&e.uint.encode(o,n.flagsClock),d>=15&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=lo.decode(o),c=e.uint.decode(o),t=Zc.decode(o),r=e.uint.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{id:n,total:c,labels:t,editedAt:r,flagsClock:d>=15&&1&i?e.uint.decode(o):0,version:d>=15&&2&i?e.uint.decode(o):0,isDeleted:d>=16&&!!(4&i)}}},_c=$,et={preencode(d,o){_c.preencode(d,o.header),e.uint.preencode(d,o.length)},encode(d,o){_c.encode(d,o.header),e.uint.encode(d,o.length)},decode:d=>({header:_c.decode(d),length:e.uint.decode(d)})},dt={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.length)},encode(d,o){e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.length)},decode:d=>({memberKey:e.fixed32.decode(d),length:e.uint.decode(d)})},ot=Z,nt={preencode(o,n){o.end++,d>=23&&n.profileSnoozeTime&&e.uint.preencode(o,n.profileSnoozeTime)},encode(o,n){const c=(d>=13&&n.disableReadReceipts?1:0)|(d>=21&&n.stripAttachmentMetadata?2:0)|(d>=23&&n.profileSnoozeTime?4:0);e.uint.encode(o,c),d>=23&&n.profileSnoozeTime&&e.uint.encode(o,n.profileSnoozeTime)},decode(o){const n=e.uint.decode(o);return{disableReadReceipts:d>=13&&!!(1&n),stripAttachmentMetadata:d>=21&&!!(2&n),profileSnoozeTime:d>=23&&4&n?e.uint.decode(o):0}}},ct={disableReadReceipts:"disableReadReceipts",stripAttachmentMetadata:"stripAttachmentMetadata",profileSnoozeTime:"profileSnoozeTime"},tt={preencode(e,d){e.end++},encode(d,o){switch(o){case"disableReadReceipts":e.uint.encode(d,1);break;case"stripAttachmentMetadata":e.uint.encode(d,2);break;case"profileSnoozeTime":e.uint.encode(d,3);break;default:throw new Error("Unknown enum")}},decode(d){switch(e.uint.decode(d)){case 1:return"disableReadReceipts";case 2:return"stripAttachmentMetadata";case 3:return"profileSnoozeTime";default:return null}}},rt=$,it=e.frame(nt),at={preencode(e,d){rt.preencode(e,d.header),tt.preencode(e,d.key),it.preencode(e,d.settings)},encode(e,d){rt.encode(e,d.header),tt.encode(e,d.key),it.encode(e,d.settings)},decode:e=>({header:rt.decode(e),key:tt.decode(e),settings:it.decode(e)})},st={Flag:1},pt={preencode(e,d){e.end++},encode(d,o){if(o>1)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},ut={preencode(d,o){e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.sender),e.uint.preencode(d,o.clock),pt.preencode(d,o.label)},encode(d,o){e.fixed32.encode(d,o.key),e.fixed32.encode(d,o.sender),e.uint.encode(d,o.clock),pt.encode(d,o.label)},decode:d=>({key:e.fixed32.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),label:pt.decode(d)})},lt=$,ft={preencode(d,o){lt.preencode(d,o.header),e.fixed32.preencode(d,o.key),pt.preencode(d,o.label)},encode(d,o){lt.encode(d,o.header),e.fixed32.encode(d,o.key),pt.encode(d,o.label)},decode:d=>({header:lt.decode(d),key:e.fixed32.decode(d),label:pt.decode(d)})},mt={preencode(d,o){pt.preencode(d,o.label),e.uint.preencode(d,o.count)},encode(d,o){pt.encode(d,o.label),e.uint.encode(d,o.count)},decode:d=>({label:pt.decode(d),count:e.uint.decode(d)})},yt=e.array(e.frame(mt)),bt={preencode(d,o){e.fixed32.preencode(d,o.key),e.uint.preencode(d,o.total),yt.preencode(d,o.labels),e.uint.preencode(d,o.editedAt),e.uint.preencode(d,o.flagsClock)},encode(d,o){e.fixed32.encode(d,o.key),e.uint.encode(d,o.total),yt.encode(d,o.labels),e.uint.encode(d,o.editedAt),e.uint.encode(d,o.flagsClock)},decode:d=>({key:e.fixed32.decode(d),total:e.uint.decode(d),labels:yt.decode(d),editedAt:e.uint.decode(d),flagsClock:e.uint.decode(d)})},xt={preencode(d,o){e.float64.preencode(d,o.latitude),e.float64.preencode(d,o.longitude)},encode(d,o){e.float64.encode(d,o.latitude),e.float64.encode(d,o.longitude)},decode:d=>({latitude:e.float64.decode(d),longitude:e.float64.decode(d)})},kt=$,vt={preencode(d,o){kt.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey),e.fixed32.preencode(d,o.fromDeviceKey)},encode(d,o){kt.encode(d,o.header),e.fixed32.encode(d,o.deviceKey),e.fixed32.encode(d,o.fromDeviceKey)},decode:d=>({header:kt.decode(d),deviceKey:e.fixed32.decode(d),fromDeviceKey:e.fixed32.decode(d)})},gt=$,ht=X,Kt={preencode(o,n){gt.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),e.buffer.preencode(o,n.encryptionKey),o.end++,d>=19&&n.streams&&ht.preencode(o,n.streams),d>=19&&n.discoveryKey&&e.fixed32.preencode(o,n.discoveryKey),d>=19&&n.version&&e.uint.preencode(o,n.version),d>=26&&n.streamInputs&&Aa.preencode(o,n.streamInputs),d>=26&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey)},encode(o,n){const c=(d>=19&&n.streams?1:0)|(d>=19&&n.discoveryKey?2:0)|(d>=19&&n.version?4:0)|(d>=26&&n.streamInputs?8:0)|(d>=26&&n.swarmKey?16:0);gt.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.buffer.encode(o,n.encryptionKey),e.uint.encode(o,c),d>=19&&n.streams&&ht.encode(o,n.streams),d>=19&&n.discoveryKey&&e.fixed32.encode(o,n.discoveryKey),d>=19&&n.version&&e.uint.encode(o,n.version),d>=26&&n.streamInputs&&Aa.encode(o,n.streamInputs),d>=26&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey)},decode(o){const n=gt.decode(o),c=e.fixed32.decode(o),t=e.buffer.decode(o),r=e.uint.decode(o);return{header:n,callKey:c,encryptionKey:t,streams:d>=19&&1&r?ht.decode(o):null,discoveryKey:d>=19&&2&r?e.fixed32.decode(o):null,version:d>=19&&4&r?e.uint.decode(o):0,streamInputs:d>=26&&8&r?Aa.decode(o):null,swarmKey:d>=26&&16&r?e.fixed32.decode(o):null}}},wt=$,At=X,Tt={preencode(o,n){wt.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),o.end++,d>=19&&n.streams&&At.preencode(o,n.streams),d>=26&&n.streamInputs&&Ta.preencode(o,n.streamInputs),d>=26&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey)},encode(o,n){const c=(d>=19&&n.streams?1:0)|(d>=26&&n.streamInputs?2:0)|(d>=26&&n.swarmKey?4:0);wt.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.uint.encode(o,c),d>=19&&n.streams&&At.encode(o,n.streams),d>=26&&n.streamInputs&&Ta.encode(o,n.streamInputs),d>=26&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey)},decode(o){const n=wt.decode(o),c=e.fixed32.decode(o),t=e.uint.decode(o);return{header:n,callKey:c,streams:d>=19&&1&t?At.decode(o):null,streamInputs:d>=26&&2&t?Ta.decode(o):null,swarmKey:d>=26&&4&t?e.fixed32.decode(o):null}}},St=$,Pt={preencode(d,o){St.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){St.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:St.decode(d),callKey:e.fixed32.decode(d)})},It=$,Ft={preencode(d,o){It.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){It.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:It.decode(d),callKey:e.fixed32.decode(d)})},Rt=$,Ct={preencode(o,n){Rt.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),e.fixed32.preencode(o,n.streamKey),o.end++,d>=26&&n.mediaStreamId&&e.string.preencode(o,n.mediaStreamId),d>=26&&n.type&&e.string.preencode(o,n.type)},encode(o,n){const c=(d>=26&&n.mediaStreamId?1:0)|(d>=26&&n.type?2:0)|(d>=26&&n.muted?4:0);Rt.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.fixed32.encode(o,n.streamKey),e.uint.encode(o,c),d>=26&&n.mediaStreamId&&e.string.encode(o,n.mediaStreamId),d>=26&&n.type&&e.string.encode(o,n.type)},decode(o){const n=Rt.decode(o),c=e.fixed32.decode(o),t=e.fixed32.decode(o),r=o.start<o.end?e.uint.decode(o):0;return{header:n,callKey:c,streamKey:t,mediaStreamId:d>=26&&1&r?e.string.decode(o):null,type:d>=26&&2&r?e.string.decode(o):null,muted:d>=26&&!!(4&r)}}},Ht=$,Vt={preencode(d,o){Ht.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.streamKey)},encode(d,o){Ht.encode(d,o.header),e.fixed32.encode(d,o.callKey),e.fixed32.encode(d,o.streamKey)},decode:d=>({header:Ht.decode(d),callKey:e.fixed32.decode(d),streamKey:e.fixed32.decode(d)})},Dt={preencode(o,n){e.fixed32.preencode(o,n.callKey),e.buffer.preencode(o,n.encryptionKey),e.uint.preencode(o,n.createdAt),o.end++,d>=19&&n.endedAt&&e.uint.preencode(o,n.endedAt),d>=19&&n.discoveryKey&&e.fixed32.preencode(o,n.discoveryKey),d>=19&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(d>=19&&n.endedAt?1:0)|(d>=19&&n.discoveryKey?2:0)|(d>=19&&n.version?4:0);e.fixed32.encode(o,n.callKey),e.buffer.encode(o,n.encryptionKey),e.uint.encode(o,n.createdAt),e.uint.encode(o,c),d>=19&&n.endedAt&&e.uint.encode(o,n.endedAt),d>=19&&n.discoveryKey&&e.fixed32.encode(o,n.discoveryKey),d>=19&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=e.fixed32.decode(o),c=e.buffer.decode(o),t=e.uint.decode(o),r=e.uint.decode(o);return{callKey:n,encryptionKey:c,createdAt:t,endedAt:d>=19&&1&r?e.uint.decode(o):0,discoveryKey:d>=19&&2&r?e.fixed32.decode(o):null,version:d>=19&&4&r?e.uint.decode(o):0}}},Mt={preencode(d,o){e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.createdAt)},encode(d,o){e.fixed32.encode(d,o.callKey),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.createdAt)},decode:d=>({callKey:e.fixed32.decode(d),memberKey:e.fixed32.decode(d),createdAt:e.uint.decode(d)})},Lt={preencode(o,n){e.fixed32.preencode(o,n.callKey),e.fixed32.preencode(o,n.deviceKey),e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.createdAt),o.end++,d>=19&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey),d>=22&&n.lastHeartbeatAt&&e.uint.preencode(o,n.lastHeartbeatAt)},encode(o,n){const c=(d>=19&&n.swarmKey?1:0)|(d>=22&&n.lastHeartbeatAt?2:0)|(d>=23&&n.isRecording?4:0);e.fixed32.encode(o,n.callKey),e.fixed32.encode(o,n.deviceKey),e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.createdAt),e.uint.encode(o,c),d>=19&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey),d>=22&&n.lastHeartbeatAt&&e.uint.encode(o,n.lastHeartbeatAt)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),t=e.fixed32.decode(o),r=e.uint.decode(o),i=e.uint.decode(o);return{callKey:n,deviceKey:c,memberKey:t,createdAt:r,swarmKey:d>=19&&1&i?e.fixed32.decode(o):null,lastHeartbeatAt:d>=22&&2&i?e.uint.decode(o):0,isRecording:d>=23&&!!(4&i)}}},qt={preencode(o,n){e.fixed32.preencode(o,n.callKey),e.fixed32.preencode(o,n.deviceKey),e.buffer.preencode(o,n.streamKey),e.uint.preencode(o,n.createdAt),o.end++,d>=26&&n.mediaStreamId&&e.string.preencode(o,n.mediaStreamId),d>=26&&n.type&&e.string.preencode(o,n.type),d>=26&&n.statusKey&&e.uint.preencode(o,n.statusKey)},encode(o,n){const c=(d>=26&&n.mediaStreamId?1:0)|(d>=26&&n.type?2:0)|(d>=26&&n.statusKey?4:0);e.fixed32.encode(o,n.callKey),e.fixed32.encode(o,n.deviceKey),e.buffer.encode(o,n.streamKey),e.uint.encode(o,n.createdAt),e.uint.encode(o,c),d>=26&&n.mediaStreamId&&e.string.encode(o,n.mediaStreamId),d>=26&&n.type&&e.string.encode(o,n.type),d>=26&&n.statusKey&&e.uint.encode(o,n.statusKey)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),t=e.buffer.decode(o),r=e.uint.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{callKey:n,deviceKey:c,streamKey:t,createdAt:r,mediaStreamId:d>=26&&1&i?e.string.decode(o):null,type:d>=26&&2&i?e.string.decode(o):null,statusKey:d>=26&&4&i?e.uint.decode(o):0}}},Et={Nightly:"Nightly",Internal:"Internal",Production:"Production"},Bt={preencode(e,d){e.end++},encode(d,o){switch(o){case"Nightly":e.uint.encode(d,1);break;case"Internal":e.uint.encode(d,2);break;case"Production":e.uint.encode(d,3);break;default:throw new Error("Unknown enum")}},decode(d){switch(e.uint.decode(d)){case 1:return"Nightly";case 2:return"Internal";case 3:return"Production";default:return null}}},zt=$,Nt={preencode(e,d){zt.preencode(e,d.header)},encode(e,d){zt.encode(e,d.header)},decode:e=>({header:zt.decode(e)})},jt=$,Ot={preencode(e,d){jt.preencode(e,d.header)},encode(e,d){jt.encode(e,d.header)},decode:e=>({header:jt.decode(e)})},Ut=$,Jt={preencode(d,o){Ut.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey),e.buffer.preencode(d,o.deviceProof),e.buffer.preencode(d,o.writerProof)},encode(d,o){Ut.encode(d,o.header),e.fixed32.encode(d,o.deviceKey),e.buffer.encode(d,o.deviceProof),e.buffer.encode(d,o.writerProof)},decode:d=>({header:Ut.decode(d),deviceKey:e.fixed32.decode(d),deviceProof:e.buffer.decode(d),writerProof:e.buffer.decode(d)})},Gt=$,Qt={preencode(d,o){Gt.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Gt.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Gt.decode(d),callKey:e.fixed32.decode(d)})},Wt=$,Xt={preencode(d,o){Wt.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.deviceKey)},encode(d,o){Wt.encode(d,o.header),e.fixed32.encode(d,o.callKey),e.fixed32.encode(d,o.deviceKey)},decode:d=>({header:Wt.decode(d),callKey:e.fixed32.decode(d),deviceKey:e.fixed32.decode(d)})},Yt=$,Zt={preencode(d,o){Yt.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Yt.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Yt.decode(d),callKey:e.fixed32.decode(d)})},$t=$,_t={preencode(d,o){$t.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){$t.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:$t.decode(d),callKey:e.fixed32.decode(d)})},er=$,dr={preencode(e,d){er.preencode(e,d.header),n.preencode(e,d.oplog)},encode(e,d){er.encode(e,d.header),n.encode(e,d.oplog)},decode:e=>({header:er.decode(e),oplog:n.decode(e)})},or=$,nr={preencode(e,d){or.preencode(e,d.header)},encode(e,d){or.encode(e,d.header)},decode:e=>({header:or.decode(e)})},cr={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.timestamp)},encode(d,o){e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.timestamp)},decode:d=>({memberKey:e.fixed32.decode(d),timestamp:e.uint.decode(d)})},tr=$,rr={preencode(o,n){tr.preencode(o,n.header),e.fixed32.preencode(o,n.memberKey),o.end++,d>=24&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=d>=24&&n.alias?1:0;tr.encode(o,n.header),e.fixed32.encode(o,n.memberKey),e.uint.encode(o,c),d>=24&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=tr.decode(o),c=e.fixed32.decode(o),t=e.uint.decode(o);return{header:n,memberKey:c,alias:d>=24&&1&t?e.string.decode(o):null}}},ir={preencode(d,o){e.uint.preencode(d,o.streams)},encode(d,o){e.uint.encode(d,o.streams)},decode:d=>({streams:e.uint.decode(d)})},ar={preencode(d,o){e.fixed32.preencode(d,o.streamKey),e.string.preencode(d,o.mediaStreamId),e.string.preencode(d,o.type),d.end++},encode(o,n){const c=d>=26&&n.muted?1:0;e.fixed32.encode(o,n.streamKey),e.string.encode(o,n.mediaStreamId),e.string.encode(o,n.type),e.uint.encode(o,c)},decode(o){const n=e.fixed32.decode(o),c=e.string.decode(o),t=e.string.decode(o),r=e.uint.decode(o);return{streamKey:n,mediaStreamId:c,type:t,muted:d>=26&&!!(1&r)}}},sr=$,pr={preencode(d,o){sr.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.streamKey),d.end++},encode(o,n){const c=d>=26&&n.muted?1:0;sr.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.fixed32.encode(o,n.streamKey),e.uint.encode(o,c)},decode(o){const n=sr.decode(o),c=e.fixed32.decode(o),t=e.fixed32.decode(o),r=e.uint.decode(o);return{header:n,callKey:c,streamKey:t,muted:d>=26&&!!(1&r)}}},ur={preencode(d,o){e.uint.preencode(d,o.statusKey),d.end++},encode(o,n){const c=d>=26&&n.muted?1:0;e.uint.encode(o,n.statusKey),e.uint.encode(o,c)},decode(o){const n=e.uint.decode(o),c=e.uint.decode(o);return{statusKey:n,muted:d>=26&&!!(1&c)}}},lr={preencode(n,c){e.fixed32.preencode(n,c.key),n.end++,d>=27&&c.encryptionKey&&e.buffer.preencode(n,c.encryptionKey),d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const t=(d>=27&&c.encryptionKey?1:0)|(d>=27&&c.bootFrom?2:0);e.fixed32.encode(n,c.key),e.uint.encode(n,t),d>=27&&c.encryptionKey&&e.buffer.encode(n,c.encryptionKey),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom)},decode(n){const c=e.fixed32.decode(n),t=e.uint.decode(n);return{key:c,encryptionKey:d>=27&&1&t?e.buffer.decode(n):null,bootFrom:d>=27&&2&t?o.decode(n):null}}},fr={preencode(d,o){e.fixed32.preencode(d,o.hash)},encode(d,o){e.fixed32.encode(d,o.hash)},decode:d=>({hash:e.fixed32.decode(d)})},mr={preencode(d,o){e.fixed32.preencode(d,o.hash),e.buffer.preencode(d,o.data)},encode(d,o){e.fixed32.encode(d,o.hash),e.buffer.encode(d,o.data)},decode:d=>({hash:e.fixed32.decode(d),data:e.buffer.decode(d)})},yr={preencode(n,c){o.preencode(n,c.autobeeMigrationHead),n.end++,d>=27&&c.legacyViewHead&&o.preencode(n,c.legacyViewHead),d>=27&&c.dbViewHead&&o.preencode(n,c.dbViewHead),d>=27&&c.blobsViewHead&&o.preencode(n,c.blobsViewHead),e.uint.preencode(n,c.createdAt)},encode(n,c){const t=(d>=27&&c.legacyViewHead?1:0)|(d>=27&&c.dbViewHead?2:0)|(d>=27&&c.blobsViewHead?4:0);o.encode(n,c.autobeeMigrationHead),e.uint.encode(n,t),d>=27&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=27&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=27&&c.blobsViewHead&&o.encode(n,c.blobsViewHead),e.uint.encode(n,c.createdAt)},decode(n){const c=o.decode(n),t=e.uint.decode(n);return{autobeeMigrationHead:c,legacyViewHead:d>=27&&1&t?o.decode(n):null,dbViewHead:d>=27&&2&t?o.decode(n):null,blobsViewHead:d>=27&&4&t?o.decode(n):null,createdAt:e.uint.decode(n)}}},br=$,xr={preencode(e,n){br.preencode(e,n.header),o.preencode(e,n.head),e.end++,d>=27&&n.legacyViewHead&&o.preencode(e,n.legacyViewHead),d>=27&&n.dbViewHead&&o.preencode(e,n.dbViewHead),d>=27&&n.blobsViewHead&&o.preencode(e,n.blobsViewHead)},encode(n,c){const t=(d>=27&&c.legacyViewHead?1:0)|(d>=27&&c.dbViewHead?2:0)|(d>=27&&c.blobsViewHead?4:0);br.encode(n,c.header),o.encode(n,c.head),e.uint.encode(n,t),d>=27&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=27&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=27&&c.blobsViewHead&&o.encode(n,c.blobsViewHead)},decode(n){const c=br.decode(n),t=o.decode(n),r=e.uint.decode(n);return{header:c,head:t,legacyViewHead:d>=27&&1&r?o.decode(n):null,dbViewHead:d>=27&&2&r?o.decode(n):null,blobsViewHead:d>=27&&4&r?o.decode(n):null}}},kr={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.fixed32.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.seed),n.end++,d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const t=d>=27&&c.bootFrom?1:0;e.fixed32.encode(n,c.roomKey),e.fixed32.encode(n,c.encryptionKey),e.fixed32.encode(n,c.seed),e.uint.encode(n,t),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom)},decode(n){const c=e.fixed32.decode(n),t=e.fixed32.decode(n),r=e.fixed32.decode(n),i=e.uint.decode(n);return{roomKey:c,encryptionKey:t,seed:r,bootFrom:d>=27&&1&i?o.decode(n):null}}},vr=id,gr={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.fixed32.preencode(d,o.deviceKey),e.uint.preencode(d,o.deviceLength),e.uint.preencode(d,o.clock),vr.preencode(d,o.status)},encode(d,o){e.fixed32.encode(d,o.memberKey),e.fixed32.encode(d,o.deviceKey),e.uint.encode(d,o.deviceLength),e.uint.encode(d,o.clock),vr.encode(d,o.status)},decode:d=>({memberKey:e.fixed32.decode(d),deviceKey:e.fixed32.decode(d),deviceLength:e.uint.decode(d),clock:e.uint.decode(d),status:vr.decode(d)})},hr={preencode(d,o){e.fixed32.preencode(d,o.hash),e.buffer.preencode(d,o.blob)},encode(d,o){e.fixed32.encode(d,o.hash),e.buffer.encode(d,o.blob)},decode:d=>({hash:e.fixed32.decode(d),blob:e.buffer.decode(d)})},Kr=Rn,wr=Cn,Ar=vn,Tr={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.mailbox),Kr.preencode(n,c.status),e.uint.preencode(n,c.clock),n.end++,d>=27&&c.initiator&&o.preencode(n,c.initiator),d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=27&&c.identitySwap&&wr.preencode(n,c.identitySwap),d>=27&&c.identitySwapV2&&Ar.preencode(n,c.identitySwapV2),d>=27&&c.contact&&e.fixed32.preencode(n,c.contact)},encode(n,c){const t=(d>=27&&c.initiator?1:0)|(d>=27&&c.bootFrom?2:0)|(d>=27&&c.identitySwap?4:0)|(d>=27&&c.identitySwapV2?8:0)|(d>=27&&c.contact?16:0);e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),Kr.encode(n,c.status),e.uint.encode(n,c.clock),e.uint.encode(n,t),d>=27&&c.initiator&&o.encode(n,c.initiator),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom),d>=27&&c.identitySwap&&wr.encode(n,c.identitySwap),d>=27&&c.identitySwapV2&&Ar.encode(n,c.identitySwapV2),d>=27&&c.contact&&e.fixed32.encode(n,c.contact)},decode(n){const c=e.fixed32.decode(n),t=e.buffer.decode(n),r=e.fixed32.decode(n),i=Kr.decode(n),a=e.uint.decode(n),s=e.uint.decode(n);return{roomKey:c,encryptionKey:t,mailbox:r,status:i,clock:a,initiator:d>=27&&1&s?o.decode(n):null,bootFrom:d>=27&&2&s?o.decode(n):null,identitySwap:d>=27&&4&s?wr.decode(n):null,identitySwapV2:d>=27&&8&s?Ar.decode(n):null,contact:d>=27&&16&s?e.fixed32.decode(n):null}}},Sr=$,Pr={preencode(n,c){Sr.preencode(n,c.header),e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.mailbox),n.end++,d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=27&&c.initiator&&o.preencode(n,c.initiator),d>=27&&c.dm&&e.fixed32.preencode(n,c.dm)},encode(n,c){const t=(d>=27&&c.bootFrom?1:0)|(d>=27&&c.initiator?2:0)|(d>=27&&c.dm?4:0)|(d>=27&&c.isReadOnly?8:0);Sr.encode(n,c.header),e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),e.uint.encode(n,t),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom),d>=27&&c.initiator&&o.encode(n,c.initiator),d>=27&&c.dm&&e.fixed32.encode(n,c.dm)},decode(n){const c=Sr.decode(n),t=e.fixed32.decode(n),r=e.buffer.decode(n),i=e.fixed32.decode(n),a=e.uint.decode(n);return{header:c,roomKey:t,encryptionKey:r,mailbox:i,bootFrom:d>=27&&1&a?o.decode(n):null,initiator:d>=27&&2&a?o.decode(n):null,dm:d>=27&&4&a?e.fixed32.decode(n):null,isReadOnly:d>=27&&!!(8&a)}}},Ir={preencode(d,o){e.fixed32.preencode(d,o.id),e.fixed32.preencode(d,o.writerKey),e.buffer.preencode(d,o.blindResponse)},encode(d,o){e.fixed32.encode(d,o.id),e.fixed32.encode(d,o.writerKey),e.buffer.encode(d,o.blindResponse)},decode:d=>({id:e.fixed32.decode(d),writerKey:e.fixed32.decode(d),blindResponse:e.buffer.decode(d)})},Fr=$,Rr={preencode(d,o){Fr.preencode(d,o.header),e.buffer.preencode(d,o.blindResponse)},encode(d,o){Fr.encode(d,o.header),e.buffer.encode(d,o.blindResponse)},decode:d=>({header:Fr.decode(d),blindResponse:e.buffer.decode(d)})},Cr=$,Hr={preencode(e,d){Cr.preencode(e,d.header)},encode(e,d){Cr.encode(e,d.header)},decode:e=>({header:Cr.decode(e)})},Vr=$,Dr={preencode(o,c){Vr.preencode(o,c.header),n.preencode(o,c.oplog),e.uint.preencode(o,c.index),o.end++,d>=30&&c.displayType&&Sc.preencode(o,c.displayType)},encode(o,c){const t=d>=30&&c.displayType?1:0;Vr.encode(o,c.header),n.encode(o,c.oplog),e.uint.encode(o,c.index),e.uint.encode(o,t),d>=30&&c.displayType&&Sc.encode(o,c.displayType)},decode(o){const c=Vr.decode(o),t=n.decode(o),r=e.uint.decode(o),i=e.uint.decode(o);return{header:c,oplog:t,index:r,displayType:d>=30&&1&i?Sc.decode(o):0}}},Mr=$,Lr=jd,qr={preencode(d,o){Mr.preencode(d,o.header),n.preencode(d,o.oplog),Sc.preencode(d,o.displayType),e.uint.preencode(d,o.index),Lr.preencode(d,o.preview)},encode(d,o){Mr.encode(d,o.header),n.encode(d,o.oplog),Sc.encode(d,o.displayType),e.uint.encode(d,o.index),Lr.encode(d,o.preview)},decode:d=>({header:Mr.decode(d),oplog:n.decode(d),displayType:Sc.decode(d),index:e.uint.decode(d),preview:Lr.decode(d)})},Er=$,Br={preencode(d,o){Er.preencode(d,o.header),n.preencode(d,o.oplog),Sc.preencode(d,o.displayType),e.uint.preencode(d,o.index)},encode(d,o){Er.encode(d,o.header),n.encode(d,o.oplog),Sc.encode(d,o.displayType),e.uint.encode(d,o.index)},decode:d=>({header:Er.decode(d),oplog:n.decode(d),displayType:Sc.decode(d),index:e.uint.decode(d)})},zr={preencode(e,d){},encode(e,d){},decode:e=>({key:null})},Nr=ge,jr={preencode(d,o){e.fixed32.preencode(d,o.id),Nr.preencode(d,o.request)},encode(d,o){e.fixed32.encode(d,o.id),Nr.encode(d,o.request)},decode:d=>({deviceKey:null,id:e.fixed32.decode(d),request:Nr.decode(d)})},Or=te,Ur=re,Jr={preencode(d,o){e.fixed32.preencode(d,o.memberKey),Or.preencode(d,o.status),Sa.preencode(d,o.profile),d.end++,o.invitation&&Ur.preencode(d,o.invitation)},encode(d,o){const n=o.invitation?1:0;e.fixed32.encode(d,o.memberKey),Or.encode(d,o.status),Sa.encode(d,o.profile),e.uint.encode(d,n),o.invitation&&Ur.encode(d,o.invitation)},decode:d=>({key:null,memberKey:e.fixed32.decode(d),status:Or.decode(d),profile:Sa.decode(d),invitation:1&e.uint.decode(d)?Ur.decode(d):null})},Gr={preencode(d,o){d.end++,o.profileAttestation&&e.buffer.preencode(d,o.profileAttestation),o.latestReceipt&&e.buffer.preencode(d,o.latestReceipt)},encode(d,o){const n=(o.profileAttestation?1:0)|(o.latestReceipt?2:0);e.uint.encode(d,n),o.profileAttestation&&e.buffer.encode(d,o.profileAttestation),o.latestReceipt&&e.buffer.encode(d,o.latestReceipt)},decode(d){const o=e.uint.decode(d);return{key:null,profileAttestation:1&o?e.buffer.decode(d):null,latestReceipt:2&o?e.buffer.decode(d):null}}},Qr=id,Wr=pe,Xr={preencode(e,d){Qr.preencode(e,d.status),Wr.preencode(e,d.profile)},encode(e,d){Qr.encode(e,d.status),Wr.encode(e,d.profile)},decode:e=>({key:null,status:Qr.decode(e),profile:Wr.decode(e)})},Yr={preencode(d,o){e.uint.preencode(d,o.mentions)},encode(d,o){e.uint.encode(d,o.mentions)},decode:d=>({key:null,mentions:e.uint.decode(d)})},Zr=Ie,$r=Ve,_r={preencode(e,d){Zr.preencode(e,d.response),$r.preencode(e,d.metadata),e.end++,d.anchor&&o.preencode(e,d.anchor)},encode(d,n){const c=(n.anchor?1:0)|(n.isActive?2:0);Zr.encode(d,n.response),$r.encode(d,n.metadata),e.uint.encode(d,c),n.anchor&&o.encode(d,n.anchor)},decode(d){const n=Zr.decode(d),c=$r.decode(d),t=e.uint.decode(d);return{id:null,response:n,metadata:c,anchor:1&t?o.decode(d):null,isActive:!!(2&t)}}},ei=fo,di={preencode(d,o){e.uint.preencode(d,o.count),d.end++,o.parent&&n.preencode(d,o.parent),o.stats&&ei.preencode(d,o.stats)},encode(d,o){const c=(o.parent?1:0)|(o.stats?2:0);e.uint.encode(d,o.count),e.uint.encode(d,c),o.parent&&n.encode(d,o.parent),o.stats&&ei.encode(d,o.stats)},decode(d){const o=e.uint.decode(d),c=e.uint.decode(d);return{id:0,count:o,parent:1&c?n.decode(d):null,stats:2&c?ei.decode(d):null}}},oi={preencode(e,d){},encode(e,d){},decode:e=>({thread:0,index:0})},ni=yo,ci=bo,ti=xo,ri={preencode(d,o){lo.preencode(d,o.id),n.preencode(d,o.oplog),e.uint.preencode(d,o.clock),e.uint.preencode(d,o.timestamp),d.end++,o.editedAt&&e.uint.preencode(d,o.editedAt),ni.preencode(d,o.status),o.message&&ci.preencode(d,o.message),o.event&&ti.preencode(d,o.event)},encode(d,o){const c=(o.editedAt?1:0)|(o.message?2:0)|(o.event?4:0);lo.encode(d,o.id),n.encode(d,o.oplog),e.uint.encode(d,o.clock),e.uint.encode(d,o.timestamp),e.uint.encode(d,c),o.editedAt&&e.uint.encode(d,o.editedAt),ni.encode(d,o.status),o.message&&ci.encode(d,o.message),o.event&&ti.encode(d,o.event)},decode(d){const o=lo.decode(d),c=n.decode(d),t=e.uint.decode(d),r=e.uint.decode(d),i=e.uint.decode(d);return{id:o,oplog:c,clock:t,timestamp:r,editedAt:1&i?e.uint.decode(d):0,status:ni.decode(d),message:2&i?ci.decode(d):null,event:4&i?ti.decode(d):null}}},ii=oi,ai=Mo,si={preencode(o,n){lo.preencode(o,n.id),e.uint.preencode(o,n.total),ai.preencode(o,n.reactions),o.end++,d>=11&&n.editedAt&&e.uint.preencode(o,n.editedAt)},encode(o,n){const c=d>=11&&n.editedAt?1:0;lo.encode(o,n.id),e.uint.encode(o,n.total),ai.encode(o,n.reactions),e.uint.encode(o,c),d>=11&&n.editedAt&&e.uint.encode(o,n.editedAt)},decode(o){const n=lo.decode(o),c=e.uint.decode(o),t=ai.decode(o),r=o.start<o.end?e.uint.decode(o):0;return{id:n,total:c,reactions:t,editedAt:d>=11&&1&r?e.uint.decode(o):0}}},pi=oi,ui={preencode(d,o){lo.preencode(d,o.id),e.uint.preencode(d,o.clock)},encode(d,o){lo.encode(d,o.id),e.uint.encode(d,o.clock)},decode:d=>({id:lo.decode(d),sender:null,clock:e.uint.decode(d),reaction:null})},li=T,fi=g,mi={preencode(o,c){n.preencode(o,c.oplog),li.preencode(o,c.status),fi.preencode(o,c.file),o.end++,d>=14&&c.version&&e.uint.preencode(o,c.version)},encode(o,c){const t=d>=14&&c.version?1:0;n.encode(o,c.oplog),li.encode(o,c.status),fi.encode(o,c.file),e.uint.encode(o,t),d>=14&&c.version&&e.uint.encode(o,c.version)},decode(o){const c=n.decode(o),t=li.decode(o),r=fi.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{id:0,oplog:c,status:t,file:r,version:d>=14&&1&i?e.uint.decode(o):0}}},yi=vn,bi={preencode(n,c){e.fixed32.preencode(n,c.invitationSeed),e.fixed32.preencode(n,c.mailbox),t.preencode(n,c.responseKeyPair),o.preencode(n,c.initiator),o.preencode(n,c.inviter),n.end++,c.identity&&yi.preencode(n,c.identity),d>=20&&c.buildType&&Bt.preencode(n,c.buildType),d>=27&&c.link&&o.preencode(n,c.link)},encode(n,c){const r=(c.identity?1:0)|(d>=20&&c.buildType?2:0)|(d>=27&&c.link?4:0);e.fixed32.encode(n,c.invitationSeed),e.fixed32.encode(n,c.mailbox),t.encode(n,c.responseKeyPair),o.encode(n,c.initiator),o.encode(n,c.inviter),e.uint.encode(n,r),c.identity&&yi.encode(n,c.identity),d>=20&&c.buildType&&Bt.encode(n,c.buildType),d>=27&&c.link&&o.encode(n,c.link)},decode(n){const c=e.fixed32.decode(n),r=e.fixed32.decode(n),i=t.decode(n),a=o.decode(n),s=o.decode(n),p=e.uint.decode(n);return{id:null,invitationSeed:c,mailbox:r,responseKeyPair:i,initiator:a,inviter:s,identity:1&p?yi.decode(n):null,buildType:d>=20&&2&p?Bt.decode(n):null,link:d>=27&&4&p?o.decode(n):null}}},xi=Rn,ki=Cn,vi=vn,gi={preencode(n,c){e.buffer.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.mailbox),xi.preencode(n,c.status),e.uint.preencode(n,c.clock),n.end++,c.initiator&&o.preencode(n,c.initiator),c.fastForwardTo&&e.fixed32.preencode(n,c.fastForwardTo),c.identitySwap&&ki.preencode(n,c.identitySwap),d>=6&&c.identitySwapV2&&vi.preencode(n,c.identitySwapV2),d>=10&&c.contact&&e.fixed32.preencode(n,c.contact),d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=29&&c.activeClock&&e.uint.preencode(n,c.activeClock)},encode(n,c){const t=(c.initiator?1:0)|(c.fastForwardTo?2:0)|(c.identitySwap?4:0)|(d>=6&&c.identitySwapV2?8:0)|(d>=10&&c.contact?16:0)|(d>=27&&c.bootFrom?32:0)|(d>=29&&c.activeClock?64:0);e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),xi.encode(n,c.status),e.uint.encode(n,c.clock),e.uint.encode(n,t),c.initiator&&o.encode(n,c.initiator),c.fastForwardTo&&e.fixed32.encode(n,c.fastForwardTo),c.identitySwap&&ki.encode(n,c.identitySwap),d>=6&&c.identitySwapV2&&vi.encode(n,c.identitySwapV2),d>=10&&c.contact&&e.fixed32.encode(n,c.contact),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom),d>=29&&c.activeClock&&e.uint.encode(n,c.activeClock)},decode(n){const c=e.buffer.decode(n),t=e.fixed32.decode(n),r=xi.decode(n),i=e.uint.decode(n),a=e.uint.decode(n);return{roomKey:null,encryptionKey:c,mailbox:t,status:r,clock:i,initiator:1&a?o.decode(n):null,fastForwardTo:2&a?e.fixed32.decode(n):null,identitySwap:4&a?ki.decode(n):null,identitySwapV2:d>=6&&8&a?vi.decode(n):null,contact:d>=10&&16&a?e.fixed32.decode(n):null,bootFrom:d>=27&&32&a?o.decode(n):null,activeClock:d>=29&&64&a?e.uint.decode(n):0}}},hi={preencode(o,n){e.uint.preencode(o,n.clock),Pa.preencode(o,n.status),o.end++,n.mailbox&&e.fixed32.preencode(o,n.mailbox),n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=22&&n.contactInfo&&Ia.preencode(o,n.contactInfo),d>=24&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=(n.mailbox?1:0)|(n.roomKey?2:0)|(d>=22&&n.contactInfo?4:0)|(d>=24&&n.alias?8:0);e.uint.encode(o,n.clock),Pa.encode(o,n.status),e.uint.encode(o,c),n.mailbox&&e.fixed32.encode(o,n.mailbox),n.roomKey&&e.fixed32.encode(o,n.roomKey),d>=22&&n.contactInfo&&Ia.encode(o,n.contactInfo),d>=24&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=e.uint.decode(o),c=Pa.decode(o),t=e.uint.decode(o);return{memberKey:null,clock:n,status:c,mailbox:1&t?e.fixed32.decode(o):null,roomKey:2&t?e.fixed32.decode(o):null,contactInfo:d>=22&&4&t?Ia.decode(o):null,alias:d>=24&&8&t?e.string.decode(o):null}}},Ki=pe,wi=nc,Ai=$n,Ti={preencode(o,n){e.uint.preencode(o,n.clock),Ki.preencode(o,n.sender),wi.preencode(o,n.status),Ai.preencode(o,n.keys),e.fixed32.preencode(o,n.mailbox),o.end++,n.message&&e.string.preencode(o,n.message),d>=11&&n.sentAt&&e.uint.preencode(o,n.sentAt),d>=22&&n.contactInfo&&Fa.preencode(o,n.contactInfo)},encode(o,n){const c=(n.message?1:0)|(d>=11&&n.sentAt?2:0)|(d>=22&&n.contactInfo?4:0);e.uint.encode(o,n.clock),Ki.encode(o,n.sender),wi.encode(o,n.status),Ai.encode(o,n.keys),e.fixed32.encode(o,n.mailbox),e.uint.encode(o,c),n.message&&e.string.encode(o,n.message),d>=11&&n.sentAt&&e.uint.encode(o,n.sentAt),d>=22&&n.contactInfo&&Fa.encode(o,n.contactInfo)},decode(o){const n=e.uint.decode(o),c=Ki.decode(o),t=wi.decode(o),r=Ai.decode(o),i=e.fixed32.decode(o),a=e.uint.decode(o);return{memberKey:null,clock:n,sender:c,status:t,keys:r,mailbox:i,message:1&a?e.string.decode(o):null,sentAt:d>=11&&2&a?e.uint.decode(o):0,contactInfo:d>=22&&4&a?Fa.decode(o):null}}},Si={preencode(d,o){e.uint.preencode(d,o.value)},encode(d,o){e.uint.encode(d,o.value)},decode:d=>({key:0,value:e.uint.decode(d)})},Pi={preencode(d,o){ne.preencode(d,o.privateProfileIdentity),e.buffer.preencode(d,o.deviceProof)},encode(d,o){ne.encode(d,o.privateProfileIdentity),e.buffer.encode(d,o.deviceProof)},decode:d=>({deviceKey:null,privateProfileIdentity:ne.decode(d),deviceProof:e.buffer.decode(d)})},Ii={preencode(n,c){n.end++,c.encryptionKey&&e.buffer.preencode(n,c.encryptionKey),c.fastForwardTo&&e.fixed32.preencode(n,c.fastForwardTo),d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const t=(c.encryptionKey?1:0)|(c.fastForwardTo?2:0)|(d>=27&&c.bootFrom?4:0);e.uint.encode(n,t),c.encryptionKey&&e.buffer.encode(n,c.encryptionKey),c.fastForwardTo&&e.fixed32.encode(n,c.fastForwardTo),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom)},decode(n){const c=e.uint.decode(n);return{key:null,encryptionKey:1&c?e.buffer.decode(n):null,fastForwardTo:2&c?e.fixed32.decode(n):null,bootFrom:d>=27&&4&c?o.decode(n):null}}},Fi=pe,Ri=nc,Ci=$n,Hi={preencode(o,n){e.uint.preencode(o,n.clock),Fi.preencode(o,n.sender),Ri.preencode(o,n.status),Ci.preencode(o,n.keys),e.fixed32.preencode(o,n.mailbox),o.end++,n.message&&e.string.preencode(o,n.message),d>=11&&n.sentAt&&e.uint.preencode(o,n.sentAt),d>=22&&n.contactInfo&&Ra.preencode(o,n.contactInfo)},encode(o,n){const c=(n.message?1:0)|(d>=11&&n.sentAt?2:0)|(d>=22&&n.contactInfo?4:0);e.uint.encode(o,n.clock),Fi.encode(o,n.sender),Ri.encode(o,n.status),Ci.encode(o,n.keys),e.fixed32.encode(o,n.mailbox),e.uint.encode(o,c),n.message&&e.string.encode(o,n.message),d>=11&&n.sentAt&&e.uint.encode(o,n.sentAt),d>=22&&n.contactInfo&&Ra.encode(o,n.contactInfo)},decode(o){const n=e.uint.decode(o),c=Fi.decode(o),t=Ri.decode(o),r=Ci.decode(o),i=e.fixed32.decode(o),a=e.uint.decode(o);return{memberKey:null,clock:n,sender:c,status:t,keys:r,mailbox:i,message:1&a?e.string.decode(o):null,sentAt:d>=11&&2&a?e.uint.decode(o):0,contactInfo:d>=22&&4&a?Ra.decode(o):null}}},Vi={preencode(d,o){e.fixed32.preencode(d,o.key)},encode(d,o){e.fixed32.encode(d,o.key)},decode:d=>({deviceKey:null,key:e.fixed32.decode(d)})},Di=oi,Mi={preencode(d,o){lo.preencode(d,o.id),e.uint.preencode(d,o.clock)},encode(d,o){lo.encode(d,o.id),e.uint.encode(d,o.clock)},decode:d=>({id:lo.decode(d),sender:null,clock:e.uint.decode(d),label:0})},Li=oi,qi=Zc,Ei={preencode(o,n){lo.preencode(o,n.id),e.uint.preencode(o,n.total),qi.preencode(o,n.labels),e.uint.preencode(o,n.editedAt),o.end++,d>=15&&n.flagsClock&&e.uint.preencode(o,n.flagsClock),d>=15&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(d>=15&&n.flagsClock?1:0)|(d>=15&&n.version?2:0)|(d>=16&&n.isDeleted?4:0);lo.encode(o,n.id),e.uint.encode(o,n.total),qi.encode(o,n.labels),e.uint.encode(o,n.editedAt),e.uint.encode(o,c),d>=15&&n.flagsClock&&e.uint.encode(o,n.flagsClock),d>=15&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=lo.decode(o),c=e.uint.decode(o),t=qi.decode(o),r=e.uint.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{id:n,total:c,labels:t,editedAt:r,flagsClock:d>=15&&1&i?e.uint.decode(o):0,version:d>=15&&2&i?e.uint.decode(o):0,isDeleted:d>=16&&!!(4&i)}}},Bi={preencode(d,o){e.uint.preencode(d,o.length)},encode(d,o){e.uint.encode(d,o.length)},decode:d=>({memberKey:null,length:e.uint.decode(d)})},zi=zr,Ni={preencode(d,o){e.uint.preencode(d,o.clock)},encode(d,o){e.uint.encode(d,o.clock)},decode:d=>({key:null,sender:null,clock:e.uint.decode(d),label:0})},ji=yt,Oi={preencode(d,o){e.uint.preencode(d,o.total),ji.preencode(d,o.labels),e.uint.preencode(d,o.editedAt),e.uint.preencode(d,o.flagsClock)},encode(d,o){e.uint.encode(d,o.total),ji.encode(d,o.labels),e.uint.encode(d,o.editedAt),e.uint.encode(d,o.flagsClock)},decode:d=>({key:null,total:e.uint.decode(d),labels:ji.decode(d),editedAt:e.uint.decode(d),flagsClock:e.uint.decode(d)})},Ui={preencode(o,n){e.buffer.preencode(o,n.encryptionKey),e.uint.preencode(o,n.createdAt),o.end++,d>=19&&n.endedAt&&e.uint.preencode(o,n.endedAt),d>=19&&n.discoveryKey&&e.fixed32.preencode(o,n.discoveryKey),d>=19&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(d>=19&&n.endedAt?1:0)|(d>=19&&n.discoveryKey?2:0)|(d>=19&&n.version?4:0);e.buffer.encode(o,n.encryptionKey),e.uint.encode(o,n.createdAt),e.uint.encode(o,c),d>=19&&n.endedAt&&e.uint.encode(o,n.endedAt),d>=19&&n.discoveryKey&&e.fixed32.encode(o,n.discoveryKey),d>=19&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=e.buffer.decode(o),c=e.uint.decode(o),t=e.uint.decode(o);return{callKey:null,encryptionKey:n,createdAt:c,endedAt:d>=19&&1&t?e.uint.decode(o):0,discoveryKey:d>=19&&2&t?e.fixed32.decode(o):null,version:d>=19&&4&t?e.uint.decode(o):0}}},Ji={preencode(d,o){e.uint.preencode(d,o.createdAt)},encode(d,o){e.uint.encode(d,o.createdAt)},decode:d=>({callKey:null,memberKey:null,createdAt:e.uint.decode(d)})},Gi={preencode(o,n){e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.createdAt),o.end++,d>=19&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey),d>=22&&n.lastHeartbeatAt&&e.uint.preencode(o,n.lastHeartbeatAt)},encode(o,n){const c=(d>=19&&n.swarmKey?1:0)|(d>=22&&n.lastHeartbeatAt?2:0)|(d>=23&&n.isRecording?4:0);e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.createdAt),e.uint.encode(o,c),d>=19&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey),d>=22&&n.lastHeartbeatAt&&e.uint.encode(o,n.lastHeartbeatAt)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),t=e.uint.decode(o);return{callKey:null,deviceKey:null,memberKey:n,createdAt:c,swarmKey:d>=19&&1&t?e.fixed32.decode(o):null,lastHeartbeatAt:d>=22&&2&t?e.uint.decode(o):0,isRecording:d>=23&&!!(4&t)}}},Qi={preencode(o,n){e.fixed32.preencode(o,n.deviceKey),e.uint.preencode(o,n.createdAt),o.end++,d>=26&&n.mediaStreamId&&e.string.preencode(o,n.mediaStreamId),d>=26&&n.type&&e.string.preencode(o,n.type),d>=26&&n.statusKey&&e.uint.preencode(o,n.statusKey)},encode(o,n){const c=(d>=26&&n.mediaStreamId?1:0)|(d>=26&&n.type?2:0)|(d>=26&&n.statusKey?4:0);e.fixed32.encode(o,n.deviceKey),e.uint.encode(o,n.createdAt),e.uint.encode(o,c),d>=26&&n.mediaStreamId&&e.string.encode(o,n.mediaStreamId),d>=26&&n.type&&e.string.encode(o,n.type),d>=26&&n.statusKey&&e.uint.encode(o,n.statusKey)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),t=o.start<o.end?e.uint.decode(o):0;return{callKey:null,deviceKey:n,streamKey:null,createdAt:c,mediaStreamId:d>=26&&1&t?e.string.decode(o):null,type:d>=26&&2&t?e.string.decode(o):null,statusKey:d>=26&&4&t?e.uint.decode(o):0}}},Wi=Vi,Xi={preencode(d,o){e.uint.preencode(d,o.timestamp)},encode(d,o){e.uint.encode(d,o.timestamp)},decode:d=>({memberKey:null,timestamp:e.uint.decode(d)})},Yi={preencode(e,d){e.end++},encode(o,n){const c=d>=26&&n.muted?1:0;e.uint.encode(o,c)},decode(o){const n=e.uint.decode(o);return{statusKey:0,muted:d>=26&&!!(1&n)}}},Zi=id,$i={preencode(d,o){e.fixed32.preencode(d,o.deviceKey),e.uint.preencode(d,o.deviceLength),e.uint.preencode(d,o.clock),Zi.preencode(d,o.status)},encode(d,o){e.fixed32.encode(d,o.deviceKey),e.uint.encode(d,o.deviceLength),e.uint.encode(d,o.clock),Zi.encode(d,o.status)},decode:d=>({memberKey:null,deviceKey:e.fixed32.decode(d),deviceLength:e.uint.decode(d),clock:e.uint.decode(d),status:Zi.decode(d)})},_i={preencode(d,o){e.buffer.preencode(d,o.data)},encode(d,o){e.buffer.encode(d,o.data)},decode:d=>({hash:null,data:e.buffer.decode(d)})},ea={preencode(d,o){e.fixed32.preencode(d,o.writerKey),e.buffer.preencode(d,o.blindResponse)},encode(d,o){e.fixed32.encode(d,o.writerKey),e.buffer.encode(d,o.blindResponse)},decode:d=>({id:null,writerKey:e.fixed32.decode(d),blindResponse:e.buffer.decode(d)})},da=e.frame(w),oa=e.frame(ir),na=da,ca=e.array(Mc),ta=e.frame(se),ra=da,ia=ta,aa=e.frame(hc),sa=e.frame(kr),pa=ta,ua=e.frame(fd),la=e.frame(yc),fa=e.frame(xt),ma=fa,ya=e.array(e.frame(qc)),ba=da,xa=e.frame(Nn),ka=e.frame(xc),va=xa,ga=ka,ha=xa,Ka=ka,wa=da,Aa=e.array(e.frame(ar)),Ta=Aa,Sa=ta,Pa=xa,Ia=ka,Fa=ka,Ra=ka;function Ca(e){switch(e){case"@keet/head":return o;case"@keet/oplog-id":return n;case"@keet/encryption-keypair":return c;case"@keet/signing-keypair":return t;case"@keet/room-keys":return r;case"@keet/operation-header":return i;case"@keet/blob-pointer":return a;case"@keet/file-dimensions":return s;case"@keet/file-metadata":return u;case"@keet/external-drive-pointer":return l;case"@keet/external-blob-pointer":return f;case"@keet/file-pointer":return b;case"@keet/file":return v;case"@keet/image-file":return w;case"@keet/file-status":return A;case"@keet/file-record":return P;case"@keet/device-status":return I;case"@keet/member-status":return F;case"@keet/member-moderation-status":return R;case"@keet/abi":return C;case"@keet/device-stats":return H;case"@keet/member-stats":return V;case"@keet/chat-stats":return D;case"@keet/file-stats":return M;case"@keet/stats":return z;case"@keet/room-type":return j;case"@keet/system-settings":return O;case"@keet/system-digest":return G;case"@keet/room-seed":return Q;case"@keet/room-capabilities":return W;case"@keet/room-config":return Y;case"@keet/blind-peer":return Z;case"@keet/add-blind-peer-operation":return ee;case"@keet/remove-blind-peer-operation":return oe;case"@keet/identity-attestation":return ne;case"@keet/device-invitation":return ce;case"@keet/device":return ie;case"@keet/member-profile":return ae;case"@keet/device-profile":return se;case"@keet/member-update":return ue;case"@keet/device-update":return le;case"@keet/signed-pairing-data":return fe;case"@keet/device-request-identity":return me;case"@keet/device-response-identity":return ye;case"@keet/device-request-with-invitation":return ve;case"@keet/device-request-with-invitation-and-proof":return he;case"@keet/device-request-with-member-proof":return Ae;case"@keet/device-request":return Pe;case"@keet/device-response":return Re;case"@keet/invitation-metadata":return Ce;case"@keet/invitation":return De;case"@keet/add-invitation-operation":return qe;case"@keet/remove-invitation-operation":return Be;case"@keet/sendable-room-invitation":return ze;case"@keet/sendable-identity-invitation":return Ne;case"@keet/sendable-contact-invitation":return je;case"@keet/sendable-invitation":return Qe;case"@keet/add-device-operation":return Xe;case"@keet/update-device-operation":return Ze;case"@keet/start-indexing-operation":return $e;case"@keet/stop-indexing-operation":return _e;case"@keet/join-request":return dd;case"@keet/accept-join-request-operation":return cd;case"@keet/reject-join-request-operation":return rd;case"@keet/member":return sd;case"@keet/full-member":return ld;case"@keet/member-proofs":return fd;case"@keet/update-member-operation":return bd;case"@keet/change-member-status-operation":return vd;case"@keet/change-member-role-operation":return hd;case"@keet/remove-member-operation":return wd;case"@keet/member-activity":return Ad;case"@keet/member-joined-event":return Td;case"@keet/member-left-event":return Sd;case"@keet/title-changed-chat-event":return Pd;case"@keet/chat-event":return Cd;case"@keet/sendable-event":return Hd;case"@keet/display-range":return Vd;case"@keet/display-content-range":return Md;case"@keet/mention-display-item":return qd;case"@keet/link-preview":return zd;case"@keet/display-link-item":return Od;case"@keet/display":return _d;case"@keet/oplog-message":return co;case"@keet/index-message":return io;case"@keet/full-index-message":return po;case"@keet/message-status":return uo;case"@keet/message-index-id":return lo;case"@keet/thread":return mo;case"@keet/chat-message-record":return ko;case"@keet/full-chat-message-record":return Ko;case"@keet/add-chat-message-operation":return To;case"@keet/remove-chat-message-operation":return Po;case"@keet/update-chat-message-operation":return Ro;case"@keet/pin-chat-message-operation":return Ho;case"@keet/reaction":return Vo;case"@keet/reactions-summary":return Do;case"@keet/reactions-digest":return Lo;case"@keet/add-reaction-operation":return Eo;case"@keet/remove-reaction-operation":return zo;case"@keet/update-room-config-operation":return Oo;case"@keet/group-member":return Uo;case"@keet/user-registry-info":return Jo;case"@keet/room-identity":return Qo;case"@keet/genesis-operation":return dn;case"@keet/upgrade-operation":return nn;case"@keet/update-system-settings-operation":return rn;case"@keet-private-id/contact":return an;case"@keet-private-id/v3-room-migration-info":return sn;case"@keet-private-id/run-v3-migration-operation":return ln;case"@keet-private-id/update-identity-operation":return mn;case"@keet-private-id/counters":return yn;case"@keet-private-id/stats":return bn;case"@keet-private-id/add-entropy-operation":return xn;case"@keet-private-id/pending-invitation-identity":return kn;case"@keet-private-id/pending-invitation":return gn;case"@keet-private-id/resolve-pending-invitation-operation":return Kn;case"@keet-private-id/add-pending-invitation-operation":return Tn;case"@keet-private-id/remove-pending-invitation-operation":return Pn;case"@keet-private-id/identity-swap":return In;case"@keet-private-id/room-status":return Fn;case"@keet-private-id/room":return Vn;case"@keet-private-id/add-room-operation":return Mn;case"@keet-private-id/remove-room-operation":return qn;case"@keet-private-id/update-room-status-operation":return zn;case"@keet-private-id/contact-status":return Nn;case"@keet-private-id/contact-record":return jn;case"@keet-private-id/add-contact-operation":return Jn;case"@keet-private-id/update-contact-status-operation":return Qn;case"@keet-private-id/remove-contact-operation":return Xn;case"@keet-private-id/contact-request-status":return Yn;case"@keet-private-id/contact-request-body":return _n;case"@keet-private-id/contact-request":return dc;case"@keet-private-id/contact-request-record":return tc;case"@keet-private-id/add-contact-request-operation":return ic;case"@keet-private-id/update-contact-request-status-operation":return pc;case"@keet-private-id/profile-discovery-record-v1":return uc;case"@keet-private-id/profile-discovery-record":return lc;case"@keet/add-file-preview-operation":return mc;case"@keet/member-removed-event":return yc;case"@keet/member-contact-info":return xc;case"@keet/remove-device-operation":return vc;case"@keet/device-identity":return gc;case"@keet/readonly-room-invitation":return hc;case"@keet-private-id/identity-swap-v2":return Kc;case"@keet-private-id/activate-contact-room-operation":return Ac;case"@keet/display-type":return Sc;case"@keet/test-increment-operation":return Ic;case"@keet/test-collection-record-1":return Fc;case"@keet/migrate-abi-operation":return Cc;case"@keet/system-settings-keys":return Vc;case"@keet/room-supported-language":return Mc;case"@keet/translation-display-item":return qc;case"@keet-private-id/unreads":return Ec;case"@keet-private-id/add-unreads-key-operation":return zc;case"@keet-private-id/remove-unreads-key-operation":return jc;case"@keet/label-type":return Uc;case"@keet/chat-label":return Jc;case"@keet/add-chat-label-operation":return Qc;case"@keet/remove-chat-label-operation":return Xc;case"@keet/chat-label-summary":return Yc;case"@keet/chat-label-digest":return $c;case"@keet/update-read-length-operation":return et;case"@keet/read-length":return dt;case"@keet/tmp-removed-member":return ot;case"@keet-private-id/settings":return nt;case"@keet-private-id/user-settings-key":return tt;case"@keet-private-id/update-settings-operation":return at;case"@keet/member-label-type":return pt;case"@keet/member-label":return ut;case"@keet/add-member-label-operation":return ft;case"@keet/member-label-summary":return mt;case"@keet/member-label-digest":return bt;case"@keet/location-shared-event":return xt;case"@keet/move-indexer-operation":return vt;case"@keet/start-call":return Kt;case"@keet/join-call":return Tt;case"@keet/leave-call":return Pt;case"@keet/end-call":return Ft;case"@keet/add-call-stream":return Ct;case"@keet/remove-call-stream":return Vt;case"@keet/call-record":return Dt;case"@keet/call-member-record":return Mt;case"@keet/call-device-record":return Lt;case"@keet/call-stream-record":return qt;case"@keet/build-type":return Bt;case"@keet/test-crash-operation":return Nt;case"@keet/test-dispatch-error-operation":return Ot;case"@keet-private-id/shorten-device-attestation-operation":return Jt;case"@keet/call-device-heartbeat":return Qt;case"@keet/remove-call-device":return Xt;case"@keet/start-call-recording":return Zt;case"@keet/stop-call-recording":return _t;case"@keet/dismiss-chat-reports-operation":return dr;case"@keet/update-typing-indicator-operation":return nr;case"@keet/typing-indicator":return cr;case"@keet-private-id/update-contact-alias-operation":return rr;case"@keet/call-stats":return ir;case"@keet/call-stream-input":return ar;case"@keet/update-call-stream":return pr;case"@keet/call-stream-status-record":return ur;case"@keet/room-keys-v2":return lr;case"@keet/blob-pointer-v2":return fr;case"@keet/blob":return mr;case"@keet/autobee-migration":return yr;case"@keet/autobee-migration-operation":return xr;case"@keet/readonly-room-invitation-v2":return kr;case"@keet/admin-last-seen":return gr;case"@keet/blob-record":return hr;case"@keet-private-id/room-v2":return Tr;case"@keet-private-id/add-room-operation-v2":return Pr;case"@keet-private-id/pending-invitation-response":return Ir;case"@keet-private-id/resolve-pending-invitation-operation-v2":return Rr;case"@keet/claim-admin-devices-operation":return Hr;case"@keet/remove-file-preview-operation":return Dr;case"@keet/add-link-preview-operation":return qr;case"@keet/remove-link-preview-operation":return Br;case"@keet/blind-peer/hyperdb#1":return zr;case"@keet/join-request/hyperdb#4":return jr;case"@keet/device/hyperdb#5":return Jr;case"@keet/member-proofs/hyperdb#10":return Gr;case"@keet/member/hyperdb#11":return Xr;case"@keet/member-activity/hyperdb#17":return Yr;case"@keet/invitation/hyperdb#18":return _r;case"@keet/thread/hyperdb#19":return di;case"@keet/message-index-id/hyperdb#21":return oi;case"@keet/chat-message-record/hyperdb#21":return ri;case"@keet/message-index-id/hyperdb#25":return ii;case"@keet/reactions-digest/hyperdb#25":return si;case"@keet/message-index-id/hyperdb#26":return pi;case"@keet/reaction/hyperdb#26":return ui;case"@keet/file-record/hyperdb#28":return mi;case"@keet-private-id/pending-invitation/hyperdb#35":return bi;case"@keet-private-id/room/hyperdb#36":return gi;case"@keet-private-id/contact-record/hyperdb#38":return hi;case"@keet-private-id/contact-request-record/hyperdb#40":return Ti;case"@keet/test-collection-record-1/hyperdb#46":return Si;case"@keet/device-identity/hyperdb#50":return Pi;case"@keet/room-keys/hyperdb#51":return Ii;case"@keet-private-id/contact-request-record/hyperdb#51":return Hi;case"@keet-private-id/unreads/hyperdb#59":return Vi;case"@keet/message-index-id/hyperdb#60":return Di;case"@keet/chat-label/hyperdb#60":return Mi;case"@keet/message-index-id/hyperdb#61":return Li;case"@keet/chat-label-digest/hyperdb#61":return Ei;case"@keet/read-length/hyperdb#62":return Bi;case"@keet/tmp-removed-member/hyperdb#63":return zi;case"@keet/member-label/hyperdb#66":return Ni;case"@keet/member-label-digest/hyperdb#67":return Oi;case"@keet/call-record/hyperdb#69":return Ui;case"@keet/call-member-record/hyperdb#72":return Ji;case"@keet/call-device-record/hyperdb#73":return Gi;case"@keet/call-stream-record/hyperdb#75":return Qi;case"@keet-private-id/unreads/hyperdb#77":return Wi;case"@keet/typing-indicator/hyperdb#78":return Xi;case"@keet/call-stream-status-record/hyperdb#80":return Yi;case"@keet/admin-last-seen/hyperdb#81":return $i;case"@keet/blob/hyperdb#83":return _i;case"@keet-private-id/pending-invitation-response/hyperdb#85":return ea;default:throw new Error("Encoder not found "+e)}}function Ha(e,o=31){const n=Ca(e);return{preencode(e,c){d=o,n.preencode(e,c)},encode(e,c){d=o,n.encode(e,c)},decode:e=>(d=o,n.decode(e))}}const Va=Ha;module.exports={resolveStruct:Va,getStruct:Ha,getEnum:function(e){switch(e){case"@keet/room-type":return N;case"@keet/display-type":return Tc;case"@keet/system-settings-keys":return Hc;case"@keet/room-supported-language":return Dc;case"@keet/label-type":return Oc;case"@keet-private-id/user-settings-key":return ct;case"@keet/member-label-type":return st;case"@keet/build-type":return Et;default:throw new Error("Enum not found "+e)}},getEncoding:Ca,encode:function(o,n,c=31){return d=c,e.encode(Ca(o),n)},decode:function(o,n,c=31){return d=c,e.decode(Ca(o),n)},setVersion:function(e){d=e},version:d};