const{c:e}=require("hyperschema/runtime");let d=41;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)})},r={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)})},t={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>=37&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const r=(c.encryptionKey?1:0)|(c.fastForwardTo?2:0)|(d>=37&&c.bootFrom?4:0);e.fixed32.encode(n,c.key),e.uint.encode(n,r),c.encryptionKey&&e.buffer.encode(n,c.encryptionKey),c.fastForwardTo&&e.fixed32.encode(n,c.fastForwardTo),d>=37&&c.bootFrom&&o.encode(n,c.bootFrom)},decode(n){const c=e.fixed32.decode(n),r=e.uint.decode(n);return{key:c,encryptionKey:1&r?e.buffer.decode(n):null,fastForwardTo:2&r?e.fixed32.decode(n):null,bootFrom:d>=37&&4&r?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)})},l=e.frame(s),p={preencode(d,o){d.end++,o.name&&e.string.preencode(d,o.name),o.mimetype&&e.string.preencode(d,o.mimetype),o.dimensions&&l.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&&l.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?l.decode(d):null,userdata:8&o?e.buffer.decode(d):null,duration:16&o?e.uint.decode(d):0,isPreview:!!(32&o)}}},u={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(u),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>=37&&n.bee&&_i.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>=37&&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>=37&&n.bee&&_i.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>=37&&16&n?_i.decode(o):null}}},x=e.frame(b),v=e.frame(p),g={preencode(d,o){x.preencode(d,o.pointer),d.end++,o.metadata&&v.preencode(d,o.metadata),o.preview&&Us.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&&v.encode(d,o.metadata),o.preview&&Us.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?v.decode(d):null,preview:2&n?Us.decode(d):null,hash:4&n?e.fixed32.decode(d):null}}},k=e.frame(g),K=k,h=k,w={preencode(e,d){e.end++,d.small&&k.preencode(e,d.small),d.medium&&K.preencode(e,d.medium),d.large&&h.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&&k.encode(d,o.small),o.medium&&K.encode(d,o.medium),o.large&&h.encode(d,o.large)},decode(d){const o=e.uint.decode(d);return{small:1&o?k.decode(d):null,medium:2&o?K.decode(d):null,large:4&o?h.decode(d):null}}},R={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))})},P=e.frame(R),T=k,A={preencode(o,c){e.uint.preencode(o,c.id),n.preencode(o,c.oplog),P.preencode(o,c.status),T.preencode(o,c.file),o.end++,d>=22&&c.version&&e.uint.preencode(o,c.version)},encode(o,c){const r=d>=22&&c.version?1:0;e.uint.encode(o,c.id),n.encode(o,c.oplog),P.encode(o,c.status),T.encode(o,c.file),e.uint.encode(o,r),d>=22&&c.version&&e.uint.encode(o,c.version)},decode(o){const c=e.uint.decode(o),r=n.decode(o),t=P.decode(o),i=T.decode(o),a=o.start<o.end?e.uint.decode(o):0;return{id:c,oplog:r,status:t,file:i,version:d>=22&&1&a?e.uint.decode(o):0}}},M={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)}}},S={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>=19&&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>=19&&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>=19&&!!(128&n)}}},I={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)})},V={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)})},H={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)})},F={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>=24&&n.flagsClock&&e.uint.preencode(o,n.flagsClock)},encode(o,n){const c=d>=24&&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>=24&&n.flagsClock&&e.uint.encode(o,n.flagsClock)},decode(o){const n=e.uint.decode(o),c=e.uint.decode(o),r=e.uint.decode(o),t=e.uint.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{clock:n,pinned:c,threads:r,timestamp:t,flagsClock:d>=24&&1&i?e.uint.decode(o):0}}},D={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(V),j=e.frame(H),q=e.frame(F),B=e.frame(D),E={preencode(e,o){L.preencode(e,o.devices),j.preencode(e,o.members),q.preencode(e,o.chat),B.preencode(e,o.files),e.end++,d>=36&&o.calls&&Js.preencode(e,o.calls)},encode(o,n){const c=d>=36&&n.calls?1:0;L.encode(o,n.devices),j.encode(o,n.members),q.encode(o,n.chat),B.encode(o,n.files),e.uint.encode(o,c),d>=36&&n.calls&&Js.encode(o,n.calls)},decode(o){const n=L.decode(o),c=j.decode(o),r=q.decode(o),t=B.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{devices:n,members:c,chat:r,files:t,calls:d>=36&&1&i?Js.decode(o):null}}},z={Default:1,Broadcast:2,DirectMessage:3},O={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)},N={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>=28&&n.isAttachmentsDisabled?64:0)|(d>=28&&n.isLinksDisabled?128:0)|(d>=29&&n.buildType?256:0)|(d>=33&&n.isRoomInviteHidden?512:0);e.uint.preencode(o,c),n.roomType&&O.preencode(o,n.roomType),d>=29&&n.buildType&&xi.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>=28&&n.isAttachmentsDisabled?64:0)|(d>=28&&n.isLinksDisabled?128:0)|(d>=29&&n.buildType?256:0)|(d>=33&&n.isRoomInviteHidden?512:0);e.uint.encode(o,c),n.roomType&&O.encode(o,n.roomType),d>=29&&n.buildType&&xi.encode(o,n.buildType)},decode(o){const n=e.uint.decode(o);return{roomType:1&n?O.decode(o):0,isExperimental:!!(2&n),isJoiningDisabled:!!(4&n),isAppendingDisabled:!!(8&n),isCallingDisabled:!!(16&n),isMembershipEventsDisabled:!!(32&n),isAttachmentsDisabled:d>=28&&!!(64&n),isLinksDisabled:d>=28&&!!(128&n),buildType:d>=29&&256&n?xi.decode(o):null,isRoomInviteHidden:d>=33&&!!(512&n)}}},U=e.frame(C),J=e.frame(N),W={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)})},G={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)})},Q={preencode(d,o){c.preencode(d,o.mailboxKeyPair),r.preencode(d,o.discoveryKeyPair),e.fixed32.preencode(d,o.wakeupTopic),e.fixed32.preencode(d,o.swarmTopic)},encode(d,o){c.encode(d,o.mailboxKeyPair),r.encode(d,o.discoveryKeyPair),e.fixed32.encode(d,o.wakeupTopic),e.fixed32.encode(d,o.swarmTopic)},decode:d=>({mailboxKeyPair:c.decode(d),discoveryKeyPair:r.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&&Ws.preencode(o,n.avatar),n.description&&e.string.preencode(o,n.description),d>=17&&n.supportedLanguages&&Gs.preencode(o,n.supportedLanguages),d>=19&&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>=17&&n.supportedLanguages?8:0)|(d>=19&&n.blindPeers?16:0);e.uint.encode(o,c),n.title&&e.string.encode(o,n.title),n.avatar&&Ws.encode(o,n.avatar),n.description&&e.string.encode(o,n.description),d>=17&&n.supportedLanguages&&Gs.encode(o,n.supportedLanguages),d>=19&&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?Ws.decode(o):null,description:4&n?e.string.decode(o):null,supportedLanguages:d>=17&&8&n?Gs.decode(o):null,blindPeers:d>=19&&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)})},re=e.frame(M),te=e.frame(ce),ie={preencode(d,o){e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.memberKey),re.preencode(d,o.status),Qs.preencode(d,o.profile),d.end++,o.invitation&&te.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),re.encode(d,o.status),Qs.encode(d,o.profile),e.uint.encode(d,n),o.invitation&&te.encode(d,o.invitation)},decode:d=>({key:e.fixed32.decode(d),memberKey:e.fixed32.decode(d),status:re.decode(d),profile:Qs.decode(d),invitation:1&e.uint.decode(d)?te.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&&Xs.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&&Xs.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?Xs.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>=29&&n.buildType&&xi.preencode(o,n.buildType)},encode(o,n){const c=(n.swarmKey?1:0)|(n.name?2:0)|(n.isMobile?4:0)|(d>=29&&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>=29&&n.buildType&&xi.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>=29&&8&n?xi.decode(o):null}}},le=e.frame(ae),pe={preencode(e,d){le.preencode(e,d.profile),ne.preencode(e,d.attestation)},encode(e,d){le.encode(e,d.profile),ne.encode(e,d.attestation)},decode:e=>({profile:le.decode(e),attestation:ne.decode(e)})},ue={preencode(e,d){Ys.preencode(e,d.profile),ne.preencode(e,d.attestation)},encode(e,d){Ys.encode(e,d.profile),ne.encode(e,d.attestation)},decode:e=>({profile:Ys.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(ue),xe=e.frame(pe),ve=e.frame(me),ge={preencode(n,c){e.fixed32.preencode(n,c.deviceKey),r.preencode(n,c.keyPair),be.preencode(n,c.device),xe.preencode(n,c.member),n.end++,c.identity&&ve.preencode(n,c.identity),d>=37&&c.link&&o.preencode(n,c.link)},encode(n,c){const t=(c.identity?1:0)|(d>=37&&c.link?2:0);e.fixed32.encode(n,c.deviceKey),r.encode(n,c.keyPair),be.encode(n,c.device),xe.encode(n,c.member),e.uint.encode(n,t),c.identity&&ve.encode(n,c.identity),d>=37&&c.link&&o.encode(n,c.link)},decode(n){const c=e.fixed32.decode(n),t=r.decode(n),i=be.decode(n),a=xe.decode(n),s=e.uint.decode(n);return{deviceKey:c,keyPair:t,device:i,member:a,identity:1&s?ve.decode(n):null,link:d>=37&&2&s?o.decode(n):null}}},ke=e.frame(ge),Ke={preencode(d,o){e.fixed32.preencode(d,o.id),ke.preencode(d,o.request),e.buffer.preencode(d,o.signature)},encode(d,o){e.fixed32.encode(d,o.id),ke.encode(d,o.request),e.buffer.encode(d,o.signature)},decode:d=>({id:e.fixed32.decode(d),request:ke.decode(d),signature:e.buffer.decode(d)})},he=be,we=xe,Re={preencode(e,d){he.preencode(e,d.device),e.end++,d.member&&we.preencode(e,d.member)},encode(d,o){const n=o.member?1:0;he.encode(d,o.device),e.uint.encode(d,n),o.member&&we.encode(d,o.member)},decode:d=>({device:he.decode(d),member:1&e.uint.decode(d)?we.decode(d):null})},Pe=e.frame(Ke),Te=e.frame(Re),Ae={preencode(e,d){e.end++,d.withInvitation&&Pe.preencode(e,d.withInvitation),d.withMemberProof&&Te.preencode(e,d.withMemberProof)},encode(d,o){const n=(o.withInvitation?1:0)|(o.withMemberProof?2:0);e.uint.encode(d,n),o.withInvitation&&Pe.encode(d,o.withInvitation),o.withMemberProof&&Te.encode(d,o.withMemberProof)},decode(d){const o=e.uint.decode(d);return{withInvitation:1&o?Pe.decode(d):null,withMemberProof:2&o?Te.decode(d):null}}},Me=e.frame(fe),Se=e.frame(ye),Ie={preencode(e,d){Me.preencode(e,d.signedKeys),e.end++,d.identity&&Se.preencode(e,d.identity)},encode(d,o){const n=o.identity?1:0;Me.encode(d,o.signedKeys),e.uint.encode(d,n),o.identity&&Se.encode(d,o.identity)},decode:d=>({signedKeys:Me.decode(d),identity:1&e.uint.decode(d)?Se.decode(d):null})},Ce={preencode(o,n){o.end++,n.expiration&&e.uint.preencode(o,n.expiration),d>=29&&n.buildType&&xi.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>=29&&n.buildType?16:0);e.uint.encode(o,c),n.expiration&&e.uint.encode(o,n.expiration),d>=29&&n.buildType&&xi.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>=29&&16&n?xi.decode(o):null}}},Ve=Me,He=e.frame(Ce),Fe={preencode(d,n){e.fixed32.preencode(d,n.id),Ve.preencode(d,n.response),He.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),Ve.encode(d,n.response),He.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=Ve.decode(d),r=He.decode(d),t=e.uint.decode(d);return{id:n,response:c,metadata:r,anchor:1&t?o.decode(d):null,isActive:!!(2&t)}}},De=$,Le=e.frame(Fe),je={preencode(e,d){De.preencode(e,d.header),Le.preencode(e,d.invitation)},encode(e,d){De.encode(e,d.header),Le.encode(e,d.invitation)},decode:e=>({header:De.decode(e),invitation:Le.decode(e)})},qe=$,Be={preencode(d,o){qe.preencode(d,o.header),e.fixed32.preencode(d,o.id)},encode(d,o){qe.encode(d,o.header),e.fixed32.encode(d,o.id)},decode:d=>({header:qe.decode(d),id:e.fixed32.decode(d)})},Ee={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)})},ze={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)})},Oe={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)})},Ne=e.frame(Ee),Ue=e.frame(ze),Je=e.frame(Oe),We=e.array(e.ipv4Address),Ge={preencode(e,o){e.end++,o.room&&Ne.preencode(e,o.room),o.identity&&Ue.preencode(e,o.identity),o.contact&&Je.preencode(e,o.contact),d>=9&&o.readonly&&Zs.preencode(e,o.readonly),d>=17&&o.additionalNodes&&We.preencode(e,o.additionalNodes),d>=29&&o.buildType&&xi.preencode(e,o.buildType),d>=37&&o["readonly-v2"]&&$s.preencode(e,o["readonly-v2"])},encode(o,n){const c=(n.room?1:0)|(n.identity?2:0)|(n.contact?4:0)|(d>=9&&n.readonly?8:0)|(d>=17&&n.additionalNodes?16:0)|(d>=29&&n.buildType?32:0)|(d>=37&&n["readonly-v2"]?64:0);e.uint.encode(o,c),n.room&&Ne.encode(o,n.room),n.identity&&Ue.encode(o,n.identity),n.contact&&Je.encode(o,n.contact),d>=9&&n.readonly&&Zs.encode(o,n.readonly),d>=17&&n.additionalNodes&&We.encode(o,n.additionalNodes),d>=29&&n.buildType&&xi.encode(o,n.buildType),d>=37&&n["readonly-v2"]&&$s.encode(o,n["readonly-v2"])},decode(o){const n=e.uint.decode(o);return{room:1&n?Ne.decode(o):null,identity:2&n?Ue.decode(o):null,contact:4&n?Je.decode(o):null,readonly:d>=9&&8&n?Zs.decode(o):null,additionalNodes:d>=17&&16&n?We.decode(o):null,buildType:d>=29&&32&n?xi.decode(o):null,"readonly-v2":d>=37&&64&n?$s.decode(o):null}}},Qe=$,Xe={preencode(d,o){Qe.preencode(d,o.header),e.buffer.preencode(d,o.blindRequest)},encode(d,o){Qe.encode(d,o.header),e.buffer.encode(d,o.blindRequest)},decode:d=>({header:Qe.decode(d),blindRequest:e.buffer.decode(d)})},Ye=$,Ze={preencode(o,n){Ye.preencode(o,n.header),o.end++,n.profile&&_s.preencode(o,n.profile),d>=34&&n.key&&e.fixed32.preencode(o,n.key)},encode(o,n){const c=(n.profile?1:0)|(d>=34&&n.key?2:0);Ye.encode(o,n.header),e.uint.encode(o,c),n.profile&&_s.encode(o,n.profile),d>=34&&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?_s.decode(o):null,key:d>=34&&2&c?e.fixed32.decode(o):null}}},$e={preencode(e,d){},encode(e,d){},decode:e=>({})},_e=$e,ed=ke,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=Se,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})},rd=$,td={preencode(d,o){rd.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey)},encode(d,o){rd.encode(d,o.header),e.fixed32.encode(d,o.deviceKey)},decode:d=>({header:rd.decode(d),deviceKey:e.fixed32.decode(d)})},id=e.frame(S),ad=le,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)})},ld=id,pd=le,ud={preencode(d,o){e.fixed32.preencode(d,o.key),ld.preencode(d,o.status),pd.preencode(d,o.profile),d.end++,o.proofs&&el.preencode(d,o.proofs)},encode(d,o){const n=o.proofs?1:0;e.fixed32.encode(d,o.key),ld.encode(d,o.status),pd.encode(d,o.profile),e.uint.encode(d,n),o.proofs&&el.encode(d,o.proofs)},decode:d=>({key:e.fixed32.decode(d),status:ld.decode(d),profile:pd.decode(d),proofs:1&e.uint.decode(d)?el.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=$,vd=e.frame(I),gd={preencode(d,o){xd.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.key),vd.preencode(d,o.status)},encode(d,o){xd.encode(d,o.header),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.key),vd.encode(d,o.status)},decode:d=>({header:xd.decode(d),memberKey:e.fixed32.decode(d),key:e.uint.decode(d),status:vd.decode(d)})},kd=$,Kd={preencode(d,o){kd.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);kd.encode(d,o.header),e.fixed32.encode(d,o.key),e.uint.encode(d,n)},decode(d){const o=kd.decode(d),n=e.fixed32.decode(d),c=e.uint.decode(d);return{header:o,key:n,isModerator:!!(1&c),isAdmin:!!(2&c)}}},hd=$,wd={preencode(d,o){hd.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){hd.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:hd.decode(d),key:e.fixed32.decode(d)})},Rd={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)})},Pd={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})},Td=Pd,Ad={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}}},Md=e.frame(Pd),Sd=e.frame(Td),Id=e.frame(Ad),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>=4&&n.roomAvatarChanged?64:0)|(d>=4&&n.invitationCreated?128:0)|(d>=4&&n.memberRemoved?256:0)|(d>=27&&n.locationShared?512:0);e.uint.preencode(o,c),n.memberJoined&&Md.preencode(o,n.memberJoined),n.memberLeft&&Sd.preencode(o,n.memberLeft),n.titleChanged&&Id.preencode(o,n.titleChanged),d>=4&&n.memberRemoved&&dl.preencode(o,n.memberRemoved),d>=27&&n.locationShared&&ol.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>=4&&n.roomAvatarChanged?64:0)|(d>=4&&n.invitationCreated?128:0)|(d>=4&&n.memberRemoved?256:0)|(d>=27&&n.locationShared?512:0);e.uint.encode(o,c),n.memberJoined&&Md.encode(o,n.memberJoined),n.memberLeft&&Sd.encode(o,n.memberLeft),n.titleChanged&&Id.encode(o,n.titleChanged),d>=4&&n.memberRemoved&&dl.encode(o,n.memberRemoved),d>=27&&n.locationShared&&ol.encode(o,n.locationShared)},decode(o){const n=e.uint.decode(o);return{memberJoined:1&n?Md.decode(o):null,memberLeft:2&n?Sd.decode(o):null,titleChanged:4&n?Id.decode(o):null,callStarted:!!(8&n),callHangup:!!(16&n),callMissed:!!(32&n),roomAvatarChanged:d>=4&&!!(64&n),invitationCreated:d>=4&&!!(128&n),memberRemoved:d>=4&&256&n?dl.decode(o):null,locationShared:d>=27&&512&n?ol.decode(o):null}}},Vd={preencode(e,o){e.end++,d>=27&&o.locationShared&&nl.preencode(e,o.locationShared)},encode(o,n){const c=(n.callStarted?1:0)|(n.callHangup?2:0)|(n.callMissed?4:0)|(d>=27&&n.locationShared?8:0);e.uint.encode(o,c),d>=27&&n.locationShared&&nl.encode(o,n.locationShared)},decode(o){const n=e.uint.decode(o);return{callStarted:!!(1&n),callHangup:!!(2&n),callMissed:!!(4&n),locationShared:d>=27&&8&n?nl.decode(o):null}}},Hd={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)})},Fd=e.frame(Hd),Dd={preencode(d,o){Fd.preencode(d,o.range),e.string.preencode(d,o.content)},encode(d,o){Fd.encode(d,o.range),e.string.encode(d,o.content)},decode:d=>({range:Fd.decode(d),content:e.string.decode(d)})},Ld=Fd,jd={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)})},qd=k,Bd=e.array(e.uint),Ed={preencode(o,n){o.end++,n.title&&e.string.preencode(o,n.title),n.description&&e.string.preencode(o,n.description),n.file&&qd.preencode(o,n.file),d>=12&&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>=12&&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&&qd.encode(o,n.file),d>=12&&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?qd.decode(o):null,files:d>=12&&8&n?Bd.decode(o):null}}},zd=Fd,Od=e.frame(Ed),Nd={preencode(d,o){zd.preencode(d,o.range),e.string.preencode(d,o.url),d.end++,o.preview&&Od.preencode(d,o.preview)},encode(d,o){const n=o.preview?1:0;zd.encode(d,o.range),e.string.encode(d,o.url),e.uint.encode(d,n),o.preview&&Od.encode(d,o.preview)},decode:d=>({range:zd.decode(d),url:e.string.decode(d),preview:1&e.uint.decode(d)?Od.decode(d):null})},Ud=e.array(e.frame(jd)),Jd=e.array(e.frame(Nd)),Wd=Jd,Gd=e.array(e.frame(Hd)),Qd=Gd,Xd=Gd,Yd=e.array(e.frame(Dd)),Zd=Gd,$d=Gd,_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>=17&&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&&Wd.preencode(o,n.pearLink),n.bold&&Gd.preencode(o,n.bold),n.italic&&Qd.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>=17&&n.translation&&cl.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>=17&&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&&Wd.encode(o,n.pearLink),n.bold&&Gd.encode(o,n.bold),n.italic&&Qd.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>=17&&n.translation&&cl.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?Wd.decode(o):null,bold:8&n?Gd.decode(o):null,italic:16&n?Qd.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>=17&&512&n?cl.decode(o):null}}},eo=e.array(e.frame(g)),oo=e.frame(_d),no=e.frame(Vd),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 r=(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>=27&&c.forwarded?64:0);e.uint.encode(o,r),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>=27&&!!(64&c)}}},ro=Bd,to=oo,io={preencode(d,o){d.end++,o.text&&e.string.preencode(d,o.text),o.files&&ro.preencode(d,o.files),o.display&&to.preencode(d,o.display),o.replyTo&&n.preencode(d,o.replyTo),o.parent&&n.preencode(d,o.parent)},encode(o,c){const r=(c.text?1:0)|(c.files?2:0)|(c.display?4:0)|(c.replyTo?8:0)|(c.parent?16:0)|(d>=27&&c.forwarded?32:0);e.uint.encode(o,r),c.text&&e.string.encode(o,c.text),c.files&&ro.encode(o,c.files),c.display&&to.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?ro.decode(o):null,display:4&c?to.decode(o):null,replyTo:8&c?n.decode(o):null,parent:16&c?n.decode(o):null,forwarded:d>=27&&!!(32&c)}}},ao=eo,so=oo,lo={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 r=(c.text?1:0)|(c.files?2:0)|(c.display?4:0)|(c.replyTo?8:0)|(c.parent?16:0)|(d>=27&&c.forwarded?32:0);e.uint.encode(o,r),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>=27&&!!(32&c)}}},po={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)}}},uo={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(E),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),r=e.uint.decode(d);return{id:o,count:c,parent:1&r?n.decode(d):null,stats:2&r?fo.decode(d):null}}},yo=e.frame(po),bo=e.frame(io),xo=e.frame(Cd),vo={preencode(d,o){uo.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);uo.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=uo.decode(d),c=n.decode(d),r=e.uint.decode(d),t=e.uint.decode(d),i=e.uint.decode(d);return{id:o,oplog:c,clock:r,timestamp:t,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}}},go=yo,ko=e.frame(lo),Ko=xo,ho={preencode(d,o){uo.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),go.preencode(d,o.status),o.message&&ko.preencode(d,o.message),o.event&&Ko.preencode(d,o.event)},encode(d,o){const c=(o.editedAt?1:0)|(o.message?2:0)|(o.event?4:0);uo.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),go.encode(d,o.status),o.message&&ko.encode(d,o.message),o.event&&Ko.encode(d,o.event)},decode(d){const o=uo.decode(d),c=n.decode(d),r=e.uint.decode(d),t=e.uint.decode(d),i=e.uint.decode(d);return{id:o,oplog:c,clock:r,timestamp:t,editedAt:1&i?e.uint.decode(d):0,status:go.decode(d),message:2&i?ko.decode(d):null,event:4&i?Ko.decode(d):null}}},wo=$,Ro=e.frame(co),Po={preencode(e,d){wo.preencode(e,d.header),Ro.preencode(e,d.message)},encode(e,d){wo.encode(e,d.header),Ro.encode(e,d.message)},decode:e=>({header:wo.decode(e),message:Ro.decode(e)})},To=$,Ao={preencode(e,d){To.preencode(e,d.header),n.preencode(e,d.oplog)},encode(e,d){To.encode(e,d.header),n.encode(e,d.oplog)},decode:e=>({header:To.decode(e),oplog:n.decode(e)})},Mo=$,So=Ro,Io={preencode(e,d){Mo.preencode(e,d.header),n.preencode(e,d.oplog),So.preencode(e,d.message)},encode(e,d){Mo.encode(e,d.header),n.encode(e,d.oplog),So.encode(e,d.message)},decode:e=>({header:Mo.decode(e),oplog:n.decode(e),message:So.decode(e)})},Co=$,Vo={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))})},Ho={preencode(d,o){uo.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){uo.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:uo.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),reaction:e.string.decode(d)})},Fo={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)})},Do=e.array(e.frame(Fo)),Lo={preencode(o,n){uo.preencode(o,n.id),e.uint.preencode(o,n.total),Do.preencode(o,n.reactions),o.end++,d>=17&&n.editedAt&&e.uint.preencode(o,n.editedAt)},encode(o,n){const c=d>=17&&n.editedAt?1:0;uo.encode(o,n.id),e.uint.encode(o,n.total),Do.encode(o,n.reactions),e.uint.encode(o,c),d>=17&&n.editedAt&&e.uint.encode(o,n.editedAt)},decode(o){const n=uo.decode(o),c=e.uint.decode(o),r=Do.decode(o),t=o.start<o.end?e.uint.decode(o):0;return{id:n,total:c,reactions:r,editedAt:d>=17&&1&t?e.uint.decode(o):0}}},jo=$,qo={preencode(d,o){jo.preencode(d,o.header),n.preencode(d,o.oplog),e.string.preencode(d,o.reaction)},encode(d,o){jo.encode(d,o.header),n.encode(d,o.oplog),e.string.encode(d,o.reaction)},decode:d=>({header:jo.decode(d),oplog:n.decode(d),reaction:e.string.decode(d)})},Bo=$,Eo={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)})},zo=$,Oo=e.frame(Y),No={preencode(d,o){zo.preencode(d,o.header),e.uint.preencode(d,o.key),Oo.preencode(d,o.config)},encode(d,o){zo.encode(d,o.header),e.uint.encode(d,o.key),Oo.encode(d,o.config)},decode:d=>({header:zo.decode(d),key:e.uint.decode(d),config:Oo.decode(d)})},Uo={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.string.preencode(d,o.displayName),d.end++,o.avatar&&rl.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&&rl.encode(d,o.avatar)},decode:d=>({memberKey:e.fixed32.decode(d),displayName:e.string.decode(d),avatar:1&e.uint.decode(d)?rl.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})},Wo=e.frame(Jo),Go={preencode(d,o){e.fixed32.preencode(d,o.publicKey),d.end++,o.discoveryCoreKey&&e.fixed32.preencode(d,o.discoveryCoreKey),o.userRegistry&&Wo.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&&Wo.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?Wo.decode(d):null}}},Qo=$,Xo=e.frame(W),Yo=e.frame(G),Zo=Oo,$o=e.frame(Go),_o=be,en=e.array(e.frame(pe)),dn={preencode(e,d){Qo.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);Qo.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=Qo.decode(d),n=Xo.decode(d),c=Yo.decode(d),r=e.uint.decode(d);return{header:o,digest:n,capabilities:c,config:1&r?Zo.decode(d):null,identity:2&r?$o.decode(d):null,bootstrapDevice:4&r?_o.decode(d):null,initialMembers:8&r?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=$,rn=J,tn={preencode(d,o){cn.preencode(d,o.header),e.uint.preencode(d,o.key),rn.preencode(d,o.settings)},encode(d,o){cn.encode(d,o.header),e.uint.encode(d,o.key),rn.encode(d,o.settings)},decode:d=>({header:cn.decode(d),key:e.uint.decode(d),settings:rn.decode(d)})},an={preencode(o,n){e.fixed32.preencode(o,n.memberKey),tl.preencode(o,n.status),o.end++,n.mailbox&&e.fixed32.preencode(o,n.mailbox),n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=32&&n.contactInfo&&il.preencode(o,n.contactInfo),d>=32&&n.version&&e.uint.preencode(o,n.version),d>=34&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=(n.mailbox?1:0)|(n.roomKey?2:0)|(d>=32&&n.contactInfo?4:0)|(d>=32&&n.version?8:0)|(d>=34&&n.alias?16:0);e.fixed32.encode(o,n.memberKey),tl.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>=32&&n.contactInfo&&il.encode(o,n.contactInfo),d>=32&&n.version&&e.uint.encode(o,n.version),d>=34&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=e.fixed32.decode(o),c=tl.decode(o),r=e.uint.decode(o);return{memberKey:n,status:c,mailbox:1&r?e.fixed32.decode(o):null,roomKey:2&r?e.fixed32.decode(o):null,contactInfo:d>=32&&4&r?il.decode(o):null,version:d>=32&&8&r?e.uint.decode(o):0,alias:d>=34&&16&r?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)})},ln=e.array(e.frame(sn)),pn=X,un={preencode(e,d){ln.preencode(e,d.sharedRooms),pn.preencode(e,d.blockedContacts)},encode(e,d){ln.encode(e,d.sharedRooms),pn.encode(e,d.blockedContacts)},decode:e=>({sharedRooms:ln.decode(e),blockedContacts:pn.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)})},vn={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)})},gn=e.frame(vn),kn={preencode(n,c){e.fixed32.preencode(n,c.id),e.fixed32.preencode(n,c.invitationSeed),e.fixed32.preencode(n,c.mailbox),r.preencode(n,c.responseKeyPair),o.preencode(n,c.initiator),o.preencode(n,c.inviter),n.end++,c.identity&&gn.preencode(n,c.identity),d>=29&&c.buildType&&xi.preencode(n,c.buildType),d>=37&&c.link&&o.preencode(n,c.link)},encode(n,c){const t=(c.identity?1:0)|(d>=29&&c.buildType?2:0)|(d>=37&&c.link?4:0);e.fixed32.encode(n,c.id),e.fixed32.encode(n,c.invitationSeed),e.fixed32.encode(n,c.mailbox),r.encode(n,c.responseKeyPair),o.encode(n,c.initiator),o.encode(n,c.inviter),e.uint.encode(n,t),c.identity&&gn.encode(n,c.identity),d>=29&&c.buildType&&xi.encode(n,c.buildType),d>=37&&c.link&&o.encode(n,c.link)},decode(n){const c=e.fixed32.decode(n),t=e.fixed32.decode(n),i=e.fixed32.decode(n),a=r.decode(n),s=o.decode(n),l=o.decode(n),p=e.uint.decode(n);return{id:c,invitationSeed:t,mailbox:i,responseKeyPair:a,initiator:s,inviter:l,identity:1&p?gn.decode(n):null,buildType:d>=29&&2&p?xi.decode(n):null,link:d>=37&&4&p?o.decode(n):null}}},Kn=$,hn={preencode(d,o){Kn.preencode(d,o.header),e.buffer.preencode(d,o.blindResponse)},encode(d,o){Kn.encode(d,o.header),e.buffer.encode(d,o.blindResponse)},decode:d=>({header:Kn.decode(d),blindResponse:e.buffer.decode(d)})},wn=$,Rn=e.frame(kn),Pn={preencode(e,d){wn.preencode(e,d.header),Rn.preencode(e,d.invitation)},encode(e,d){wn.encode(e,d.header),Rn.encode(e,d.invitation)},decode:e=>({header:wn.decode(e),invitation:Rn.decode(e)})},Tn=$,An={preencode(d,o){Tn.preencode(d,o.header),e.fixed32.preencode(d,o.id)},encode(d,o){Tn.encode(d,o.header),e.fixed32.encode(d,o.id)},decode:d=>({header:Tn.decode(d),id:e.fixed32.decode(d)})},Mn={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&&r.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&&r.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?r.decode(d):null,deviceProof:e.buffer.decode(d)}}},Sn={preencode(o,n){o.end++,d>=35&&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>=14&&n.isReadOnly?8:0)|(d>=27&&n.isFavorite?16:0)|(d>=31&&n.isUnread?32:0)|(d>=35&&n.roomSnoozeTime?64:0);e.uint.encode(o,c),d>=35&&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>=14&&!!(8&n),isFavorite:d>=27&&!!(16&n),isUnread:d>=31&&!!(32&n),roomSnoozeTime:d>=35&&64&n?e.uint.decode(o):0}}},In=e.frame(Sn),Cn=e.frame(Mn),Vn=gn,Hn={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.mailbox),In.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>=9&&c.identitySwapV2&&Vn.preencode(n,c.identitySwapV2),d>=15&&c.contact&&e.fixed32.preencode(n,c.contact),d>=37&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=39&&c.activeClock&&e.uint.preencode(n,c.activeClock)},encode(n,c){const r=(c.initiator?1:0)|(c.fastForwardTo?2:0)|(c.identitySwap?4:0)|(d>=9&&c.identitySwapV2?8:0)|(d>=15&&c.contact?16:0)|(d>=37&&c.bootFrom?32:0)|(d>=39&&c.activeClock?64:0);e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),In.encode(n,c.status),e.uint.encode(n,c.clock),e.uint.encode(n,r),c.initiator&&o.encode(n,c.initiator),c.fastForwardTo&&e.fixed32.encode(n,c.fastForwardTo),c.identitySwap&&Cn.encode(n,c.identitySwap),d>=9&&c.identitySwapV2&&Vn.encode(n,c.identitySwapV2),d>=15&&c.contact&&e.fixed32.encode(n,c.contact),d>=37&&c.bootFrom&&o.encode(n,c.bootFrom),d>=39&&c.activeClock&&e.uint.encode(n,c.activeClock)},decode(n){const c=e.fixed32.decode(n),r=e.buffer.decode(n),t=e.fixed32.decode(n),i=In.decode(n),a=e.uint.decode(n),s=e.uint.decode(n);return{roomKey:c,encryptionKey:r,mailbox:t,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>=9&&8&s?Vn.decode(n):null,contact:d>=15&&16&s?e.fixed32.decode(n):null,bootFrom:d>=37&&32&s?o.decode(n):null,activeClock:d>=39&&64&s?e.uint.decode(n):0}}},Fn=$,Dn={preencode(d,n){Fn.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 r=(c.fastForwardTo?1:0)|(c.initiator?2:0)|(c.dm?4:0)|(d>=14&&c.isReadOnly?8:0);Fn.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,r),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=Fn.decode(n),r=e.fixed32.decode(n),t=e.buffer.decode(n),i=e.fixed32.decode(n),a=e.uint.decode(n);return{header:c,roomKey:r,encryptionKey:t,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>=14&&!!(8&a)}}},Ln=$,jn={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)})},qn=$,Bn=In,En={preencode(d,o){qn.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.key),Bn.preencode(d,o.status)},encode(d,o){qn.encode(d,o.header),e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.key),Bn.encode(d,o.status)},decode:d=>({header:qn.decode(d),roomKey:e.fixed32.decode(d),key:e.uint.decode(d),status:Bn.decode(d)})},zn={preencode(e,d){e.end++},encode(o,n){const c=(n.isBlocked?1:0)|(d>=32&&n.isActive?2:0);e.uint.encode(o,c)},decode(o){const n=e.uint.decode(o);return{isBlocked:!!(1&n),isActive:d>=32&&!!(2&n)}}},On={preencode(o,n){e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.clock),al.preencode(o,n.status),o.end++,n.mailbox&&e.fixed32.preencode(o,n.mailbox),n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=32&&n.contactInfo&&sl.preencode(o,n.contactInfo),d>=34&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=(n.mailbox?1:0)|(n.roomKey?2:0)|(d>=32&&n.contactInfo?4:0)|(d>=34&&n.alias?8:0);e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.clock),al.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>=32&&n.contactInfo&&sl.encode(o,n.contactInfo),d>=34&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),r=al.decode(o),t=e.uint.decode(o);return{memberKey:n,clock:c,status:r,mailbox:1&t?e.fixed32.decode(o):null,roomKey:2&t?e.fixed32.decode(o):null,contactInfo:d>=32&&4&t?sl.decode(o):null,alias:d>=34&&8&t?e.string.decode(o):null}}},Nn=$,Un=e.frame(an),Jn={preencode(e,d){Nn.preencode(e,d.header),Un.preencode(e,d.contact)},encode(e,d){Nn.encode(e,d.header),Un.encode(e,d.contact)},decode:e=>({header:Nn.decode(e),contact:Un.decode(e)})},Wn=$,Gn={preencode(d,o){Wn.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.key),ll.preencode(d,o.status)},encode(d,o){Wn.encode(d,o.header),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.key),ll.encode(d,o.status)},decode:d=>({header:Wn.decode(d),memberKey:e.fixed32.decode(d),key:e.uint.decode(d),status:ll.decode(d)})},Qn=$,Xn={preencode(d,o){Qn.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey)},encode(d,o){Qn.encode(d,o.header),e.fixed32.encode(d,o.memberKey)},decode:d=>({header:Qn.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(t),_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>=41&&n.recipientProof&&e.buffer.preencode(o,n.recipientProof)},encode(o,n){const c=d>=41&&n.recipientProof?1:0;ec.encode(o,n.body),ne.encode(o,n.attestation),e.uint.encode(o,c),d>=41&&n.recipientProof&&e.buffer.encode(o,n.recipientProof)},decode(o){const n=ec.decode(o),c=ne.decode(o),r=o.start<o.end?e.uint.decode(o):0;return{body:n,attestation:c,recipientProof:d>=41&&1&r?e.buffer.decode(o):null}}},oc=le,nc=e.frame(Yn),cc=$n,rc={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>=17&&n.sentAt&&e.uint.preencode(o,n.sentAt),d>=32&&n.contactInfo&&pl.preencode(o,n.contactInfo)},encode(o,n){const c=(n.message?1:0)|(d>=17&&n.sentAt?2:0)|(d>=32&&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>=17&&n.sentAt&&e.uint.encode(o,n.sentAt),d>=32&&n.contactInfo&&pl.encode(o,n.contactInfo)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),r=oc.decode(o),t=nc.decode(o),i=cc.decode(o),a=e.fixed32.decode(o),s=e.uint.decode(o);return{memberKey:n,clock:c,sender:r,status:t,keys:i,mailbox:a,message:1&s?e.string.decode(o):null,sentAt:d>=17&&2&s?e.uint.decode(o):0,contactInfo:d>=32&&4&s?pl.decode(o):null}}},tc=$,ic={preencode(d,o){tc.preencode(d,o.header),e.buffer.preencode(d,o.blindRequest)},encode(d,o){tc.encode(d,o.header),e.buffer.encode(d,o.blindRequest)},decode:d=>({header:tc.decode(d),blindRequest:e.buffer.decode(d)})},ac=$,sc=nc,lc={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>=15&&n.roomKey&&e.fixed32.preencode(o,n.roomKey)},encode(o,n){const c=d>=15&&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>=15&&n.roomKey&&e.fixed32.encode(o,n.roomKey)},decode(o){const n=ac.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o),t=sc.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{header:n,memberKey:c,key:r,status:t,roomKey:d>=15&&1&i?e.fixed32.decode(o):null}}},pc={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)})},uc={preencode(d,o){const n=o.version??1;switch(e.uint.preencode(d,n),n){case 0:case 1:pc.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:pc.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=pc.decode(d);return e.version=o,e}default:throw new Error("Unsupported version")}}},fc={preencode(d,o){e.fixed32.preencode(d,o.discoveryPublicKey),e.uint.preencode(d,o.timestamp),d.end++,o.lastSynced&&e.uint.preencode(d,o.lastSynced)},encode(d,o){const n=(o.lastSynced?1:0)|(o.dirty?2:0);e.fixed32.encode(d,o.discoveryPublicKey),e.uint.encode(d,o.timestamp),e.uint.encode(d,n),o.lastSynced&&e.uint.encode(d,o.lastSynced)},decode(d){const o=e.fixed32.decode(d),n=e.uint.decode(d),c=e.uint.decode(d);return{discoveryPublicKey:o,timestamp:n,lastSynced:1&c?e.uint.decode(d):0,dirty:!!(2&c)}}},mc={preencode(d,o){e.uint.preencode(d,o.rooms),e.uint.preencode(d,o.activeRooms)},encode(d,o){e.uint.encode(d,o.rooms),e.uint.encode(d,o.activeRooms)},decode:d=>({rooms:e.uint.decode(d),activeRooms:e.uint.decode(d)})},yc=C,bc=X,xc={preencode(e,d){e.end++,d.blockedMembers&&bc.preencode(e,d.blockedMembers)},encode(d,o){const n=o.blockedMembers?1:0;e.uint.encode(d,n),o.blockedMembers&&bc.encode(d,o.blockedMembers)},decode:d=>({blockedMembers:1&e.uint.decode(d)?bc.decode(d):null})},vc=e.frame(Q),gc=e.frame(xc),kc={preencode(d,n){e.buffer.preencode(d,n.encryptionKey),e.fixed32.preencode(d,n.seed),vc.preencode(d,n.capabilities),o.preencode(d,n.initiator),e.fixed32.preencode(d,n.fastForwardTo),d.end++,n.privateProfile&&gc.preencode(d,n.privateProfile)},encode(d,n){const c=n.privateProfile?1:0;e.buffer.encode(d,n.encryptionKey),e.fixed32.encode(d,n.seed),vc.encode(d,n.capabilities),o.encode(d,n.initiator),e.fixed32.encode(d,n.fastForwardTo),e.uint.encode(d,c),n.privateProfile&&gc.encode(d,n.privateProfile)},decode:d=>({encryptionKey:e.buffer.decode(d),seed:e.fixed32.decode(d),capabilities:vc.decode(d),initiator:o.decode(d),fastForwardTo:e.fixed32.decode(d),privateProfile:1&e.uint.decode(d)?gc.decode(d):null})},Kc={preencode(d,o){d.end++,o.count&&e.uint.preencode(d,o.count)},encode(d,o){const n=o.count?1:0;e.uint.encode(d,n),o.count&&e.uint.encode(d,o.count)},decode:d=>({count:1&e.uint.decode(d)?e.uint.decode(d):0})},hc=e.frame(kc),wc={preencode(o,n){e.fixed32.preencode(o,n.roomKey),e.uint.preencode(o,n.priority),o.end++,n.v3&&hc.preencode(o,n.v3),d>=5&&n.timestamp&&e.uint.preencode(o,n.timestamp)},encode(o,n){const c=(n.v3?1:0)|(d>=3&&n.errored?2:0)|(d>=5&&n.timestamp?4:0);e.fixed32.encode(o,n.roomKey),e.uint.encode(o,n.priority),e.uint.encode(o,c),n.v3&&hc.encode(o,n.v3),d>=5&&n.timestamp&&e.uint.encode(o,n.timestamp)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),r=e.uint.decode(o);return{roomKey:n,priority:c,v3:1&r?hc.decode(o):null,errored:d>=3&&!!(2&r),timestamp:d>=5&&4&r?e.uint.decode(o):0}}},Rc={preencode(e,d){e.end++},encode(d,o){const n=o.isConfirmed?1:0;e.uint.encode(d,n)},decode:d=>({isConfirmed:!!(1&e.uint.decode(d))})},Pc=e.frame(Rc),Tc=Cn,Ac={preencode(o,n){e.fixed32.preencode(o,n.publicKey),e.fixed32.preencode(o,n.privateProfileKey),r.preencode(o,n.deviceKeyPair),e.buffer.preencode(o,n.deviceProof),Pc.preencode(o,n.status),o.end++,n.entropy&&e.buffer.preencode(o,n.entropy),n.swap&&Tc.preencode(o,n.swap),d>=9&&n.swapV2&&ul.preencode(o,n.swapV2),d>=31&&n.proofShortenedAt&&e.uint.preencode(o,n.proofShortenedAt)},encode(o,n){const c=(n.entropy?1:0)|(n.swap?2:0)|(d>=9&&n.swapV2?4:0)|(d>=31&&n.proofShortenedAt?8:0);e.fixed32.encode(o,n.publicKey),e.fixed32.encode(o,n.privateProfileKey),r.encode(o,n.deviceKeyPair),e.buffer.encode(o,n.deviceProof),Pc.encode(o,n.status),e.uint.encode(o,c),n.entropy&&e.buffer.encode(o,n.entropy),n.swap&&Tc.encode(o,n.swap),d>=9&&n.swapV2&&ul.encode(o,n.swapV2),d>=31&&n.proofShortenedAt&&e.uint.encode(o,n.proofShortenedAt)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),t=r.decode(o),i=e.buffer.decode(o),a=Pc.decode(o),s=e.uint.decode(o);return{publicKey:n,privateProfileKey:c,deviceKeyPair:t,deviceProof:i,status:a,entropy:1&s?e.buffer.decode(o):null,swap:2&s?Tc.decode(o):null,swapV2:d>=9&&4&s?ul.decode(o):null,proofShortenedAt:d>=31&&8&s?e.uint.decode(o):0}}},Mc={RestoreIdentity:1,CreateRoom:2,LeaveRoom:3,ClearRoom:4,JoinRoomInvitation:5,JoinRoomKeys:6,JoinRoomResponse:7,SendContactRequest:8,TestFastTask:9,TestSlowTask:10,TestErrorTask:11},Sc={preencode(e,d){e.end++},encode(d,o){if(o>11)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},Ic={preencode(d,n){e.fixed32.preencode(d,n.roomKey),e.buffer.preencode(d,n.encryptionKey),d.end++,n.fastForwardTo&&e.fixed32.preencode(d,n.fastForwardTo),n.initiator&&o.preencode(d,n.initiator)},encode(d,n){const c=(n.fastForwardTo?1:0)|(n.initiator?2:0);e.fixed32.encode(d,n.roomKey),e.buffer.encode(d,n.encryptionKey),e.uint.encode(d,c),n.fastForwardTo&&e.fixed32.encode(d,n.fastForwardTo),n.initiator&&o.encode(d,n.initiator)},decode(d){const n=e.fixed32.decode(d),c=e.buffer.decode(d),r=e.uint.decode(d);return{roomKey:n,encryptionKey:c,fastForwardTo:1&r?e.fixed32.decode(d):null,initiator:2&r?o.decode(d):null}}},Cc=Rn,Vc={preencode(e,d){Cc.preencode(e,d.invitation)},encode(e,d){Cc.encode(e,d.invitation)},decode:e=>({invitation:Cc.decode(e)})},Hc={preencode(d,o){e.fixed32.preencode(d,o.mailbox),r.preencode(d,o.keyPair),e.buffer.preencode(d,o.response)},encode(d,o){e.fixed32.encode(d,o.mailbox),r.encode(d,o.keyPair),e.buffer.encode(d,o.response)},decode:d=>({mailbox:e.fixed32.decode(d),keyPair:r.decode(d),response:e.buffer.decode(d)})},Fc=Z,Dc={preencode(d,n){e.fixed32.preencode(d,n.roomKey),e.buffer.preencode(d,n.encryptionKey),d.end++,n.fastForwardTo&&e.fixed32.preencode(d,n.fastForwardTo),n.initiator&&o.preencode(d,n.initiator),n.mailbox&&e.fixed32.preencode(d,n.mailbox)},encode(d,n){const c=(n.fastForwardTo?1:0)|(n.initiator?2:0)|(n.mailbox?4:0);e.fixed32.encode(d,n.roomKey),e.buffer.encode(d,n.encryptionKey),e.uint.encode(d,c),n.fastForwardTo&&e.fixed32.encode(d,n.fastForwardTo),n.initiator&&o.encode(d,n.initiator),n.mailbox&&e.fixed32.encode(d,n.mailbox)},decode(d){const n=e.fixed32.decode(d),c=e.buffer.decode(d),r=e.uint.decode(d);return{roomKey:n,encryptionKey:c,fastForwardTo:1&r?e.fixed32.decode(d):null,initiator:2&r?o.decode(d):null,mailbox:4&r?e.fixed32.decode(d):null}}},Lc=e.frame(Dc),jc={preencode(o,n){Lc.preencode(o,n.keys),o.end++,d>=39&&n.activeClock&&e.uint.preencode(o,n.activeClock)},encode(o,n){const c=(d>=39&&n.activeClock?1:0)|(d>=39&&n.isReadOnly?2:0);Lc.encode(o,n.keys),e.uint.encode(o,c),d>=39&&n.activeClock&&e.uint.encode(o,n.activeClock)},decode(o){const n=Lc.decode(o),c=o.start<o.end?e.uint.decode(o):0;return{keys:n,activeClock:d>=39&&1&c?e.uint.decode(o):0,isReadOnly:d>=39&&!!(2&c)}}},qc=e.frame(dn),Bc={preencode(d,n){e.fixed32.preencode(d,n.roomKey),e.buffer.preencode(d,n.encryptionKey),d.end++,n.fastForwardTo&&e.fixed32.preencode(d,n.fastForwardTo),n.initiator&&o.preencode(d,n.initiator),n.mailbox&&e.fixed32.preencode(d,n.mailbox),n.keyPair&&r.preencode(d,n.keyPair),n.genesis&&qc.preencode(d,n.genesis)},encode(d,n){const c=(n.fastForwardTo?1:0)|(n.initiator?2:0)|(n.mailbox?4:0)|(n.keyPair?8:0)|(n.genesis?16:0)|(n.isPrivateProfile?32:0);e.fixed32.encode(d,n.roomKey),e.buffer.encode(d,n.encryptionKey),e.uint.encode(d,c),n.fastForwardTo&&e.fixed32.encode(d,n.fastForwardTo),n.initiator&&o.encode(d,n.initiator),n.mailbox&&e.fixed32.encode(d,n.mailbox),n.keyPair&&r.encode(d,n.keyPair),n.genesis&&qc.encode(d,n.genesis)},decode(d){const n=e.fixed32.decode(d),c=e.buffer.decode(d),t=e.uint.decode(d);return{roomKey:n,encryptionKey:c,fastForwardTo:1&t?e.fixed32.decode(d):null,initiator:2&t?o.decode(d):null,mailbox:4&t?e.fixed32.decode(d):null,keyPair:8&t?r.decode(d):null,genesis:16&t?qc.decode(d):null,isPrivateProfile:!!(32&t)}}},Ec={preencode(d,o){e.fixed32.preencode(d,o.roomKey),d.end++},encode(d,o){const n=o.isGossiped?1:0;e.fixed32.encode(d,o.roomKey),e.uint.encode(d,n)},decode:d=>({roomKey:e.fixed32.decode(d),isGossiped:!!(1&e.uint.decode(d))})},zc={preencode(d,o){e.fixed32.preencode(d,o.roomKey)},encode(d,o){e.fixed32.encode(d,o.roomKey)},decode:d=>({roomKey:e.fixed32.decode(d)})},Oc={preencode(d,o){e.string.preencode(d,o.mnemonic),d.end++,o.profileDiscoveryTimeout&&e.uint.preencode(d,o.profileDiscoveryTimeout)},encode(d,o){const n=(o.profileDiscoveryTimeout?1:0)|(o.recover?2:0);e.string.encode(d,o.mnemonic),e.uint.encode(d,n),o.profileDiscoveryTimeout&&e.uint.encode(d,o.profileDiscoveryTimeout)},decode(d){const o=e.string.decode(d),n=e.uint.decode(d);return{mnemonic:o,profileDiscoveryTimeout:1&n?e.uint.decode(d):0,recover:!!(2&n)}}},Nc={preencode(o,n){e.fixed32.preencode(o,n.roomKey),e.fixed32.preencode(o,n.memberKey),o.end++,n.message&&e.string.preencode(o,n.message),d>=6&&n.contactInfo&&fl.preencode(o,n.contactInfo)},encode(o,n){const c=(n.message?1:0)|(d>=6&&n.contactInfo?2:0);e.fixed32.encode(o,n.roomKey),e.fixed32.encode(o,n.memberKey),e.uint.encode(o,c),n.message&&e.string.encode(o,n.message),d>=6&&n.contactInfo&&fl.encode(o,n.contactInfo)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{roomKey:n,memberKey:c,message:1&r?e.string.decode(o):null,contactInfo:d>=6&&2&r?fl.decode(o):null}}},Uc={preencode(d,o){e.fixed32.preencode(d,o.key),d.end++},encode(d,o){const n=o.isPrivateProfile?1:0;e.fixed32.encode(d,o.key),e.uint.encode(d,n)},decode:d=>({key:e.fixed32.decode(d),isPrivateProfile:!!(1&e.uint.decode(d))})},Jc=e.frame(Oc),Wc=e.frame(Bc),Gc=e.frame(Ec),Qc=e.frame(zc),Xc=e.frame(Vc),Yc=e.frame(jc),Zc=e.frame(Hc),$c=e.frame(Nc),_c=e.frame(Uc),er={preencode(d,o){const n=(o.restoreIdentity?1:0)|(o.createRoom?2:0)|(o.leaveRoom?4:0)|(o.clearRoom?8:0)|(o.joinRoomInvitation?16:0)|(o.joinRoomKeys?32:0)|(o.joinRoomResponse?64:0)|(o.sendContactRequest?128:0)|(o.migrateV2Room?256:0);e.fixed32.preencode(d,o.discoveryKey),e.uint.preencode(d,o.priority),e.uint.preencode(d,o.timestamp),e.uint.preencode(d,o.type),e.uint.preencode(d,n),o.restoreIdentity&&Jc.preencode(d,o.restoreIdentity),o.createRoom&&Wc.preencode(d,o.createRoom),o.leaveRoom&&Gc.preencode(d,o.leaveRoom),o.clearRoom&&Qc.preencode(d,o.clearRoom),o.joinRoomInvitation&&Xc.preencode(d,o.joinRoomInvitation),o.joinRoomKeys&&Yc.preencode(d,o.joinRoomKeys),o.joinRoomResponse&&Zc.preencode(d,o.joinRoomResponse),o.sendContactRequest&&$c.preencode(d,o.sendContactRequest),o.migrateV2Room&&_c.preencode(d,o.migrateV2Room)},encode(d,o){const n=(o.restoreIdentity?1:0)|(o.createRoom?2:0)|(o.leaveRoom?4:0)|(o.clearRoom?8:0)|(o.joinRoomInvitation?16:0)|(o.joinRoomKeys?32:0)|(o.joinRoomResponse?64:0)|(o.sendContactRequest?128:0)|(o.migrateV2Room?256:0);e.fixed32.encode(d,o.discoveryKey),e.uint.encode(d,o.priority),e.uint.encode(d,o.timestamp),e.uint.encode(d,o.type),e.uint.encode(d,n),o.restoreIdentity&&Jc.encode(d,o.restoreIdentity),o.createRoom&&Wc.encode(d,o.createRoom),o.leaveRoom&&Gc.encode(d,o.leaveRoom),o.clearRoom&&Qc.encode(d,o.clearRoom),o.joinRoomInvitation&&Xc.encode(d,o.joinRoomInvitation),o.joinRoomKeys&&Yc.encode(d,o.joinRoomKeys),o.joinRoomResponse&&Zc.encode(d,o.joinRoomResponse),o.sendContactRequest&&$c.encode(d,o.sendContactRequest),o.migrateV2Room&&_c.encode(d,o.migrateV2Room)},decode(d){const o=e.fixed32.decode(d),n=e.uint.decode(d),c=e.uint.decode(d),r=e.uint.decode(d),t=e.uint.decode(d);return{discoveryKey:o,priority:n,timestamp:c,type:r,restoreIdentity:1&t?Jc.decode(d):null,createRoom:2&t?Wc.decode(d):null,leaveRoom:4&t?Gc.decode(d):null,clearRoom:8&t?Qc.decode(d):null,joinRoomInvitation:16&t?Xc.decode(d):null,joinRoomKeys:32&t?Yc.decode(d):null,joinRoomResponse:64&t?Zc.decode(d):null,sendContactRequest:128&t?$c.decode(d):null,migrateV2Room:256&t?_c.decode(d):null}}},dr=Le,or={preencode(d,o){e.buffer.preencode(d,o.seed),dr.preencode(d,o.invitation)},encode(d,o){e.buffer.encode(d,o.seed),dr.encode(d,o.invitation)},decode:d=>({seed:e.buffer.decode(d),invitation:dr.decode(d)})},nr={preencode(e,d){e.end++},encode(o,n){const c=(n.isWritable?1:0)|(n.isReadable?2:0)|(n.isPrivateProfile?4:0)|(d>=8&&n.isRemoved?8:0);e.uint.encode(o,c)},decode(o){const n=e.uint.decode(o);return{isWritable:!!(1&n),isReadable:!!(2&n),isPrivateProfile:!!(4&n),isRemoved:d>=8&&!!(8&n)}}},cr={preencode(d,o){e.uint.preencode(d,o.creation),e.uint.preencode(d,o.latestSync),e.uint.preencode(d,o.latestChatMessage)},encode(d,o){e.uint.encode(d,o.creation),e.uint.encode(d,o.latestSync),e.uint.encode(d,o.latestChatMessage)},decode:d=>({creation:e.uint.decode(d),latestSync:e.uint.decode(d),latestChatMessage:e.uint.decode(d)})},rr=Xo,tr=fo,ir=e.frame(cr),ar=vc,sr=e.frame(nr),lr=e.frame(ie),pr=e.frame(ud),ur=Oo,fr=$o,mr=e.frame(ho),yr=X,br=e.frame(sd),xr=In,vr={preencode(o,n){const c=(n.selfDevice?1:0)|(n.selfMember?2:0)|(n.config?4:0)|(n.identity?8:0)|(n.lastMessage?16:0)|(n.dm?32:0)|(d>=19&&n.readLengths?64:0)|(d>=19&&n.lastMember?128:0)|(d>=21&&n.version?256:0)|(d>=27&&n.preferences?512:0)|(d>=28&&n.activeCall?1024:0)|(d>=32&&n.lastMessageLabels?2048:0)|(d>=33&&n.settings?4096:0)|(d>=37&&n.system?8192:0)|(d>=37&&n.processed?16384:0);e.fixed32.preencode(o,n.roomKey),e.fixed32.preencode(o,n.discoveryKey),e.buffer.preencode(o,n.encryptionKey),rr.preencode(o,n.digest),tr.preencode(o,n.stats),ir.preencode(o,n.timestamps),e.uint.preencode(o,n.fork),e.uint.preencode(o,n.length),e.fixed32.preencode(o,n.seed),ar.preencode(o,n.capabilities),sr.preencode(o,n.status),e.uint.preencode(o,c),n.selfDevice&&lr.preencode(o,n.selfDevice),n.selfMember&&pr.preencode(o,n.selfMember),n.config&&ur.preencode(o,n.config),n.identity&&fr.preencode(o,n.identity),n.lastMessage&&mr.preencode(o,n.lastMessage),n.dm&&yr.preencode(o,n.dm),d>=19&&n.readLengths&&ml.preencode(o,n.readLengths),d>=19&&n.lastMember&&br.preencode(o,n.lastMember),d>=21&&n.version&&e.uint.preencode(o,n.version),d>=27&&n.preferences&&xr.preencode(o,n.preferences),d>=28&&n.activeCall&&yl.preencode(o,n.activeCall),d>=32&&n.lastMessageLabels&&bl.preencode(o,n.lastMessageLabels),d>=33&&n.settings&&xl.preencode(o,n.settings),d>=37&&n.system&&vl.preencode(o,n.system),d>=37&&n.processed&&gl.preencode(o,n.processed)},encode(o,n){const c=(n.selfDevice?1:0)|(n.selfMember?2:0)|(n.config?4:0)|(n.identity?8:0)|(n.lastMessage?16:0)|(n.dm?32:0)|(d>=19&&n.readLengths?64:0)|(d>=19&&n.lastMember?128:0)|(d>=21&&n.version?256:0)|(d>=27&&n.preferences?512:0)|(d>=28&&n.activeCall?1024:0)|(d>=32&&n.lastMessageLabels?2048:0)|(d>=33&&n.settings?4096:0)|(d>=37&&n.system?8192:0)|(d>=37&&n.processed?16384:0);e.fixed32.encode(o,n.roomKey),e.fixed32.encode(o,n.discoveryKey),e.buffer.encode(o,n.encryptionKey),rr.encode(o,n.digest),tr.encode(o,n.stats),ir.encode(o,n.timestamps),e.uint.encode(o,n.fork),e.uint.encode(o,n.length),e.fixed32.encode(o,n.seed),ar.encode(o,n.capabilities),sr.encode(o,n.status),e.uint.encode(o,c),n.selfDevice&&lr.encode(o,n.selfDevice),n.selfMember&&pr.encode(o,n.selfMember),n.config&&ur.encode(o,n.config),n.identity&&fr.encode(o,n.identity),n.lastMessage&&mr.encode(o,n.lastMessage),n.dm&&yr.encode(o,n.dm),d>=19&&n.readLengths&&ml.encode(o,n.readLengths),d>=19&&n.lastMember&&br.encode(o,n.lastMember),d>=21&&n.version&&e.uint.encode(o,n.version),d>=27&&n.preferences&&xr.encode(o,n.preferences),d>=28&&n.activeCall&&yl.encode(o,n.activeCall),d>=32&&n.lastMessageLabels&&bl.encode(o,n.lastMessageLabels),d>=33&&n.settings&&xl.encode(o,n.settings),d>=37&&n.system&&vl.encode(o,n.system),d>=37&&n.processed&&gl.encode(o,n.processed)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.buffer.decode(o),t=rr.decode(o),i=tr.decode(o),a=ir.decode(o),s=e.uint.decode(o),l=e.uint.decode(o),p=e.fixed32.decode(o),u=ar.decode(o),f=sr.decode(o),m=e.uint.decode(o);return{roomKey:n,discoveryKey:c,encryptionKey:r,digest:t,stats:i,timestamps:a,fork:s,length:l,seed:p,capabilities:u,status:f,selfDevice:1&m?lr.decode(o):null,selfMember:2&m?pr.decode(o):null,config:4&m?ur.decode(o):null,identity:8&m?fr.decode(o):null,lastMessage:16&m?mr.decode(o):null,dm:32&m?yr.decode(o):null,readLengths:d>=19&&64&m?ml.decode(o):null,lastMember:d>=19&&128&m?br.decode(o):null,version:d>=21&&256&m?e.uint.decode(o):0,preferences:d>=27&&512&m?xr.decode(o):null,activeCall:d>=28&&1024&m?yl.decode(o):null,lastMessageLabels:d>=32&&2048&m?bl.decode(o):null,settings:d>=33&&4096&m?xl.decode(o):null,system:d>=37&&8192&m?vl.decode(o):null,processed:d>=37&&16384&m?gl.decode(o):null}}},gr=In,kr={preencode(d,o){e.fixed32.preencode(d,o.roomKey),gr.preencode(d,o.status)},encode(d,o){e.fixed32.encode(d,o.roomKey),gr.encode(d,o.status)},decode:d=>({roomKey:e.fixed32.decode(d),status:gr.decode(d)})},Kr={preencode(o,n){e.fixed32.preencode(o,n.mailbox),e.fixed32.preencode(o,n.key),o.end++,n.roomKey&&e.fixed32.preencode(o,n.roomKey),n.keyPair&&r.preencode(o,n.keyPair),n.responseKeyPair&&r.preencode(o,n.responseKeyPair),d>=39&&n.activeClock&&e.uint.preencode(o,n.activeClock)},encode(o,n){const c=(n.roomKey?1:0)|(n.keyPair?2:0)|(n.responseKeyPair?4:0)|(d>=38&&n.pending?8:0)|(d>=39&&n.activeClock?16:0);e.fixed32.encode(o,n.mailbox),e.fixed32.encode(o,n.key),e.uint.encode(o,c),n.roomKey&&e.fixed32.encode(o,n.roomKey),n.keyPair&&r.encode(o,n.keyPair),n.responseKeyPair&&r.encode(o,n.responseKeyPair),d>=39&&n.activeClock&&e.uint.encode(o,n.activeClock)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),t=e.uint.decode(o);return{mailbox:n,key:c,roomKey:1&t?e.fixed32.decode(o):null,keyPair:2&t?r.decode(o):null,responseKeyPair:4&t?r.decode(o):null,pending:d>=38&&!!(8&t),activeClock:d>=39&&16&t?e.uint.decode(o):0}}},hr=le,wr={preencode(d,o){e.fixed32.preencode(d,o.key),hr.preencode(d,o.profile)},encode(d,o){e.fixed32.encode(d,o.key),hr.encode(d,o.profile)},decode:d=>({key:e.fixed32.decode(d),profile:hr.decode(d)})},Rr=lr,Pr={preencode(d,o){e.fixed32.preencode(d,o.roomKey),Rr.preencode(d,o.device)},encode(d,o){e.fixed32.encode(d,o.roomKey),Rr.encode(d,o.device)},decode:d=>({roomKey:e.fixed32.decode(d),device:Rr.decode(d)})},Tr=k,Ar={preencode(o,n){Tr.preencode(o,n.file),e.fixed32.preencode(o,n.roomKey),o.end++,n.encryptionKey&&e.buffer.preencode(o,n.encryptionKey),d>=28&&n.lastAccessed&&e.uint.preencode(o,n.lastAccessed),d>=28&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(n.encryptionKey?1:0)|(n.cleared?2:0)|(n.own?4:0)|(d>=28&&n.lastAccessed?8:0)|(d>=28&&n.version?16:0);Tr.encode(o,n.file),e.fixed32.encode(o,n.roomKey),e.uint.encode(o,c),n.encryptionKey&&e.buffer.encode(o,n.encryptionKey),d>=28&&n.lastAccessed&&e.uint.encode(o,n.lastAccessed),d>=28&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=Tr.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{file:n,roomKey:c,encryptionKey:1&r?e.buffer.decode(o):null,cleared:!!(2&r),own:!!(4&r),lastAccessed:d>=28&&8&r?e.uint.decode(o):0,version:d>=28&&16&r?e.uint.decode(o):0}}},Mr=$,Sr={preencode(o,c){Mr.preencode(o,c.header),n.preencode(o,c.oplog),e.uint.preencode(o,c.index),kl.preencode(o,c.preview),o.end++,d>=12&&c.displayType&&Gr.preencode(o,c.displayType)},encode(o,c){const r=d>=12&&c.displayType?1:0;Mr.encode(o,c.header),n.encode(o,c.oplog),e.uint.encode(o,c.index),kl.encode(o,c.preview),e.uint.encode(o,r),d>=12&&c.displayType&&Gr.encode(o,c.displayType)},decode(o){const c=Mr.decode(o),r=n.decode(o),t=e.uint.decode(o),i=kl.decode(o),a=o.start<o.end?e.uint.decode(o):0;return{header:c,oplog:r,index:t,preview:i,displayType:d>=12&&1&a?Gr.decode(o):0}}},Ir={preencode(o,n){o.end++,d>=4&&n.memberKey&&e.fixed32.preencode(o,n.memberKey)},encode(o,n){const c=d>=4&&n.memberKey?1:0;e.uint.encode(o,c),d>=4&&n.memberKey&&e.fixed32.encode(o,n.memberKey)},decode(o){const n=e.uint.decode(o);return{memberKey:d>=4&&1&n?e.fixed32.decode(o):null}}},Cr=le,Vr={preencode(e,d){Cr.preencode(e,d.profile),ne.preencode(e,d.attestation)},encode(e,d){Cr.encode(e,d.profile),ne.encode(e,d.attestation)},decode:e=>({profile:Cr.decode(e),attestation:ne.decode(e)})},Hr=$,Fr={preencode(d,o){Hr.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){Hr.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:Hr.decode(d),key:e.fixed32.decode(d)})},Dr={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)})},Lr={preencode(o,n){e.fixed32.preencode(o,n.roomKey),e.fixed32.preencode(o,n.encryptionKey),e.fixed32.preencode(o,n.seed),o.end++,d>=9&&n.fastForwardTo&&e.fixed32.preencode(o,n.fastForwardTo)},encode(o,n){const c=d>=9&&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>=9&&n.fastForwardTo&&e.fixed32.encode(o,n.fastForwardTo)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.fixed32.decode(o),t=e.uint.decode(o);return{roomKey:n,encryptionKey:c,seed:r,fastForwardTo:d>=9&&1&t?e.fixed32.decode(o):null}}},jr={preencode(o,n){e.fixed32.preencode(o,n.publicKey),e.fixed32.preencode(o,n.writerKey),e.fixed32.preencode(o,n.devicePublicKey),o.end++,d>=9&&n.privateProfileKey&&e.fixed32.preencode(o,n.privateProfileKey)},encode(o,n){const c=d>=9&&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>=9&&n.privateProfileKey&&e.fixed32.encode(o,n.privateProfileKey)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.fixed32.decode(o),t=e.uint.decode(o);return{publicKey:n,writerKey:c,devicePublicKey:r,privateProfileKey:d>=9&&1&t?e.fixed32.decode(o):null}}},qr=$,Br={preencode(d,o){qr.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey)},encode(d,o){qr.encode(d,o.header),e.fixed32.encode(d,o.memberKey)},decode:d=>({header:qr.decode(d),memberKey:e.fixed32.decode(d)})},Er={preencode(d,o){e.fixed32.preencode(d,o.privateProfileKey)},encode(d,o){e.fixed32.encode(d,o.privateProfileKey)},decode:d=>({privateProfileKey:e.fixed32.decode(d)})},zr={preencode(d,o){e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.responsePublicKey)},encode(d,o){e.fixed32.encode(d,o.key),e.fixed32.encode(d,o.responsePublicKey)},decode:d=>({key:e.fixed32.decode(d),responsePublicKey:e.fixed32.decode(d)})},Or={preencode(o,n){e.fixed32.preencode(o,n.roomKey),o.end++,d>=10&&n.repairs&&e.uint.preencode(o,n.repairs)},encode(o,n){const c=d>=10&&n.repairs?1:0;e.fixed32.encode(o,n.roomKey),e.uint.encode(o,c),d>=10&&n.repairs&&e.uint.encode(o,n.repairs)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o);return{roomKey:n,repairs:d>=10&&1&c?e.uint.decode(o):0}}},Nr={preencode(o,n){o.end++,d>=11&&n.key&&e.string.preencode(o,n.key),d>=11&&n.description&&e.string.preencode(o,n.description)},encode(o,n){const c=(d>=11&&n.key?1:0)|(d>=11&&n.value?2:0)|(d>=11&&n.description?4:0);e.uint.encode(o,c),d>=11&&n.key&&e.string.encode(o,n.key),d>=11&&n.description&&e.string.encode(o,n.description)},decode(o){const n=e.uint.decode(o);return{key:d>=11&&1&n?e.string.decode(o):null,value:d>=11&&!!(2&n),description:d>=11&&4&n?e.string.decode(o):null}}},Ur=e.array(e.frame(Nr)),Jr={preencode(e,o){e.end++,d>=11&&o.flags&&Ur.preencode(e,o.flags)},encode(o,n){const c=d>=11&&n.flags?1:0;e.uint.encode(o,c),d>=11&&n.flags&&Ur.encode(o,n.flags)},decode(o){const n=e.uint.decode(o);return{flags:d>=11&&1&n?Ur.decode(o):null}}},Wr={HttpLink:1,PearLink:2},Gr={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)},Qr=$,Xr={preencode(d,o){Qr.preencode(d,o.header),e.uint.preencode(d,o.value)},encode(d,o){Qr.encode(d,o.header),e.uint.encode(d,o.value)},decode:d=>({header:Qr.decode(d),value:e.uint.decode(d)})},Yr={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)})},Zr=$,$r={preencode(o,n){Zr.preencode(o,n.header),e.uint.preencode(o,n.from),e.uint.preencode(o,n.to),o.end++,d>=29&&n.buildType&&xi.preencode(o,n.buildType)},encode(o,n){const c=d>=29&&n.buildType?1:0;Zr.encode(o,n.header),e.uint.encode(o,n.from),e.uint.encode(o,n.to),e.uint.encode(o,c),d>=29&&n.buildType&&xi.encode(o,n.buildType)},decode(o){const n=Zr.decode(o),c=e.uint.decode(o),r=e.uint.decode(o),t=o.start<o.end?e.uint.decode(o):0;return{header:n,from:c,to:r,buildType:d>=29&&1&t?xi.decode(o):null}}},_r={RoomType:1,IsExperimental:2,IsJoiningDisabled:3,IsAppendingDisabled:4,IsCallingDisabled:5,IsMembershipEventsDisabled:6,IsAttachmentsDisabled:7,IsLinksDisabled:8,IsRoomInviteHidden:9},et={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)},dt=We,ot={preencode(o,n){o.end++,d>=16&&n.nodes&&dt.preencode(o,n.nodes),d>=24&&n.concurrency&&e.uint.preencode(o,n.concurrency),d>=24&&n.maxWindow&&e.uint.preencode(o,n.maxWindow),d>=24&&n.randomPunchInterval&&e.uint.preencode(o,n.randomPunchInterval),d>=24&&n.connectionKeepAlive&&e.uint.preencode(o,n.connectionKeepAlive)},encode(o,n){const c=(d>=16&&n.nodes?1:0)|(d>=24&&n.concurrency?2:0)|(d>=24&&n.maxWindow?4:0)|(d>=24&&n.randomPunchInterval?8:0)|(d>=24&&n.connectionKeepAlive?16:0);e.uint.encode(o,c),d>=16&&n.nodes&&dt.encode(o,n.nodes),d>=24&&n.concurrency&&e.uint.encode(o,n.concurrency),d>=24&&n.maxWindow&&e.uint.encode(o,n.maxWindow),d>=24&&n.randomPunchInterval&&e.uint.encode(o,n.randomPunchInterval),d>=24&&n.connectionKeepAlive&&e.uint.encode(o,n.connectionKeepAlive)},decode(o){const n=e.uint.decode(o);return{nodes:d>=16&&1&n?dt.decode(o):null,concurrency:d>=24&&2&n?e.uint.decode(o):0,maxWindow:d>=24&&4&n?e.uint.decode(o):0,randomPunchInterval:d>=24&&8&n?e.uint.decode(o):0,connectionKeepAlive:d>=24&&16&n?e.uint.decode(o):0}}},nt={en:"en",it:"it",ru:"ru",es:"es",de:"de"},ct={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}}},rt=Fd,tt={preencode(d,o){rt.preencode(d,o.range),ct.preencode(d,o.language),e.string.preencode(d,o.text)},encode(d,o){rt.encode(d,o.range),ct.encode(d,o.language),e.string.encode(d,o.text)},decode:d=>({range:rt.decode(d),language:ct.decode(d),text:e.string.decode(d)})},it={preencode(d,o){e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.count)},encode(d,o){e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.count)},decode:d=>({roomKey:e.fixed32.decode(d),count:e.uint.decode(d)})},at={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)})},st=$,lt={preencode(d,o){st.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){st.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:st.decode(d),key:e.fixed32.decode(d)})},pt=$,ut={preencode(d,o){pt.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){pt.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:pt.decode(d),key:e.fixed32.decode(d)})},ft={Flag:1},mt={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)},yt={preencode(d,o){uo.preencode(d,o.id),e.fixed32.preencode(d,o.sender),e.uint.preencode(d,o.clock),mt.preencode(d,o.label)},encode(d,o){uo.encode(d,o.id),e.fixed32.encode(d,o.sender),e.uint.encode(d,o.clock),mt.encode(d,o.label)},decode:d=>({id:uo.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),label:mt.decode(d)})},bt=$,xt={preencode(e,d){bt.preencode(e,d.header),n.preencode(e,d.oplog),mt.preencode(e,d.label)},encode(e,d){bt.encode(e,d.header),n.encode(e,d.oplog),mt.encode(e,d.label)},decode:e=>({header:bt.decode(e),oplog:n.decode(e),label:mt.decode(e)})},vt=$,gt={preencode(e,d){vt.preencode(e,d.header),n.preencode(e,d.oplog),mt.preencode(e,d.label)},encode(e,d){vt.encode(e,d.header),n.encode(e,d.oplog),mt.encode(e,d.label)},decode:e=>({header:vt.decode(e),oplog:n.decode(e),label:mt.decode(e)})},kt={preencode(d,o){mt.preencode(d,o.label),e.uint.preencode(d,o.count)},encode(d,o){mt.encode(d,o.label),e.uint.encode(d,o.count)},decode:d=>({label:mt.decode(d),count:e.uint.decode(d)})},Kt=e.array(e.frame(kt)),ht={preencode(o,n){uo.preencode(o,n.id),e.uint.preencode(o,n.total),Kt.preencode(o,n.labels),e.uint.preencode(o,n.editedAt),o.end++,d>=24&&n.flagsClock&&e.uint.preencode(o,n.flagsClock),d>=24&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(d>=24&&n.flagsClock?1:0)|(d>=24&&n.version?2:0)|(d>=25&&n.isDeleted?4:0);uo.encode(o,n.id),e.uint.encode(o,n.total),Kt.encode(o,n.labels),e.uint.encode(o,n.editedAt),e.uint.encode(o,c),d>=24&&n.flagsClock&&e.uint.encode(o,n.flagsClock),d>=24&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=uo.decode(o),c=e.uint.decode(o),r=Kt.decode(o),t=e.uint.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{id:n,total:c,labels:r,editedAt:t,flagsClock:d>=24&&1&i?e.uint.decode(o):0,version:d>=24&&2&i?e.uint.decode(o):0,isDeleted:d>=25&&!!(4&i)}}},wt=$,Rt={preencode(d,o){wt.preencode(d,o.header),e.uint.preencode(d,o.length)},encode(d,o){wt.encode(d,o.header),e.uint.encode(d,o.length)},decode:d=>({header:wt.decode(d),length:e.uint.decode(d)})},Pt={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)})},Tt=Z,At={preencode(o,n){o.end++,d>=33&&n.profileSnoozeTime&&e.uint.preencode(o,n.profileSnoozeTime)},encode(o,n){const c=(d>=19&&n.disableReadReceipts?1:0)|(d>=31&&n.stripAttachmentMetadata?2:0)|(d>=33&&n.profileSnoozeTime?4:0);e.uint.encode(o,c),d>=33&&n.profileSnoozeTime&&e.uint.encode(o,n.profileSnoozeTime)},decode(o){const n=e.uint.decode(o);return{disableReadReceipts:d>=19&&!!(1&n),stripAttachmentMetadata:d>=31&&!!(2&n),profileSnoozeTime:d>=33&&4&n?e.uint.decode(o):0}}},Mt={disableReadReceipts:"disableReadReceipts",stripAttachmentMetadata:"stripAttachmentMetadata",profileSnoozeTime:"profileSnoozeTime"},St={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}}},It=$,Ct=e.frame(At),Vt={preencode(e,d){It.preencode(e,d.header),St.preencode(e,d.key),Ct.preencode(e,d.settings)},encode(e,d){It.encode(e,d.header),St.encode(e,d.key),Ct.encode(e,d.settings)},decode:e=>({header:It.decode(e),key:St.decode(e),settings:Ct.decode(e)})},Ht={preencode(o,n){o.end++,d>=20&&n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=23&&n.coreKey&&e.fixed32.preencode(o,n.coreKey)},encode(o,n){const c=(d>=20&&n.roomKey?1:0)|(d>=23&&n.coreKey?2:0);e.uint.encode(o,c),d>=20&&n.roomKey&&e.fixed32.encode(o,n.roomKey),d>=23&&n.coreKey&&e.fixed32.encode(o,n.coreKey)},decode(o){const n=e.uint.decode(o);return{roomKey:d>=20&&1&n?e.fixed32.decode(o):null,coreKey:d>=23&&2&n?e.fixed32.decode(o):null}}},Ft=e.frame(Ht),Dt={preencode(o,n){e.string.preencode(o,n.code),e.string.preencode(o,n.message),e.string.preencode(o,n.stack),e.uint.preencode(o,n.timestamp),o.end++,d>=20&&n.details&&Ft.preencode(o,n.details)},encode(o,n){const c=d>=20&&n.details?1:0;e.string.encode(o,n.code),e.string.encode(o,n.message),e.string.encode(o,n.stack),e.uint.encode(o,n.timestamp),e.uint.encode(o,c),d>=20&&n.details&&Ft.encode(o,n.details)},decode(o){const n=e.string.decode(o),c=e.string.decode(o),r=e.string.decode(o),t=e.uint.decode(o),i=e.uint.decode(o);return{code:n,message:c,stack:r,timestamp:t,details:d>=20&&1&i?Ft.decode(o):null}}},Lt={RESUME:1,WAKEUP:2,PRESUSPEND:3,SUSPEND:4},jt={preencode(e,d){e.end++},encode(d,o){if(o>4)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},qt={preencode(d,o){e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.total)},encode(d,o){e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.total)},decode:d=>({roomKey:e.fixed32.decode(d),total:e.uint.decode(d)})},Bt={Flag:1},Et={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)},zt={preencode(d,o){e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.sender),e.uint.preencode(d,o.clock),Et.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),Et.encode(d,o.label)},decode:d=>({key:e.fixed32.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),label:Et.decode(d)})},Ot=$,Nt={preencode(d,o){Ot.preencode(d,o.header),e.fixed32.preencode(d,o.key),Et.preencode(d,o.label)},encode(d,o){Ot.encode(d,o.header),e.fixed32.encode(d,o.key),Et.encode(d,o.label)},decode:d=>({header:Ot.decode(d),key:e.fixed32.decode(d),label:Et.decode(d)})},Ut={preencode(d,o){Et.preencode(d,o.label),e.uint.preencode(d,o.count)},encode(d,o){Et.encode(d,o.label),e.uint.encode(d,o.count)},decode:d=>({label:Et.decode(d),count:e.uint.decode(d)})},Jt=e.array(e.frame(Ut)),Wt={preencode(d,o){e.fixed32.preencode(d,o.key),e.uint.preencode(d,o.total),Jt.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),Jt.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:Jt.decode(d),editedAt:e.uint.decode(d),flagsClock:e.uint.decode(d)})},Gt={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)})},Qt=$,Xt={preencode(d,o){Qt.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey),e.fixed32.preencode(d,o.fromDeviceKey)},encode(d,o){Qt.encode(d,o.header),e.fixed32.encode(d,o.deviceKey),e.fixed32.encode(d,o.fromDeviceKey)},decode:d=>({header:Qt.decode(d),deviceKey:e.fixed32.decode(d),fromDeviceKey:e.fixed32.decode(d)})},Yt=$,Zt=X,$t={preencode(o,n){Yt.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),e.buffer.preencode(o,n.encryptionKey),o.end++,d>=28&&n.streams&&Zt.preencode(o,n.streams),d>=28&&n.discoveryKey&&e.fixed32.preencode(o,n.discoveryKey),d>=28&&n.version&&e.uint.preencode(o,n.version),d>=36&&n.streamInputs&&Kl.preencode(o,n.streamInputs),d>=36&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey)},encode(o,n){const c=(d>=28&&n.streams?1:0)|(d>=28&&n.discoveryKey?2:0)|(d>=28&&n.version?4:0)|(d>=36&&n.streamInputs?8:0)|(d>=36&&n.swarmKey?16:0);Yt.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.buffer.encode(o,n.encryptionKey),e.uint.encode(o,c),d>=28&&n.streams&&Zt.encode(o,n.streams),d>=28&&n.discoveryKey&&e.fixed32.encode(o,n.discoveryKey),d>=28&&n.version&&e.uint.encode(o,n.version),d>=36&&n.streamInputs&&Kl.encode(o,n.streamInputs),d>=36&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey)},decode(o){const n=Yt.decode(o),c=e.fixed32.decode(o),r=e.buffer.decode(o),t=e.uint.decode(o);return{header:n,callKey:c,encryptionKey:r,streams:d>=28&&1&t?Zt.decode(o):null,discoveryKey:d>=28&&2&t?e.fixed32.decode(o):null,version:d>=28&&4&t?e.uint.decode(o):0,streamInputs:d>=36&&8&t?Kl.decode(o):null,swarmKey:d>=36&&16&t?e.fixed32.decode(o):null}}},_t=$,ei=X,di={preencode(o,n){_t.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),o.end++,d>=28&&n.streams&&ei.preencode(o,n.streams),d>=36&&n.streamInputs&&hl.preencode(o,n.streamInputs),d>=36&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey)},encode(o,n){const c=(d>=28&&n.streams?1:0)|(d>=36&&n.streamInputs?2:0)|(d>=36&&n.swarmKey?4:0);_t.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.uint.encode(o,c),d>=28&&n.streams&&ei.encode(o,n.streams),d>=36&&n.streamInputs&&hl.encode(o,n.streamInputs),d>=36&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey)},decode(o){const n=_t.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{header:n,callKey:c,streams:d>=28&&1&r?ei.decode(o):null,streamInputs:d>=36&&2&r?hl.decode(o):null,swarmKey:d>=36&&4&r?e.fixed32.decode(o):null}}},oi=$,ni={preencode(d,o){oi.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){oi.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:oi.decode(d),callKey:e.fixed32.decode(d)})},ci=$,ri={preencode(d,o){ci.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){ci.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:ci.decode(d),callKey:e.fixed32.decode(d)})},ti=$,ii={preencode(o,n){ti.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),e.fixed32.preencode(o,n.streamKey),o.end++,d>=36&&n.mediaStreamId&&e.string.preencode(o,n.mediaStreamId),d>=36&&n.type&&e.string.preencode(o,n.type)},encode(o,n){const c=(d>=36&&n.mediaStreamId?1:0)|(d>=36&&n.type?2:0)|(d>=36&&n.muted?4:0);ti.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.fixed32.encode(o,n.streamKey),e.uint.encode(o,c),d>=36&&n.mediaStreamId&&e.string.encode(o,n.mediaStreamId),d>=36&&n.type&&e.string.encode(o,n.type)},decode(o){const n=ti.decode(o),c=e.fixed32.decode(o),r=e.fixed32.decode(o),t=o.start<o.end?e.uint.decode(o):0;return{header:n,callKey:c,streamKey:r,mediaStreamId:d>=36&&1&t?e.string.decode(o):null,type:d>=36&&2&t?e.string.decode(o):null,muted:d>=36&&!!(4&t)}}},ai=$,si={preencode(d,o){ai.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.streamKey)},encode(d,o){ai.encode(d,o.header),e.fixed32.encode(d,o.callKey),e.fixed32.encode(d,o.streamKey)},decode:d=>({header:ai.decode(d),callKey:e.fixed32.decode(d),streamKey:e.fixed32.decode(d)})},li={preencode(o,n){e.fixed32.preencode(o,n.callKey),e.buffer.preencode(o,n.encryptionKey),e.uint.preencode(o,n.createdAt),o.end++,d>=28&&n.endedAt&&e.uint.preencode(o,n.endedAt),d>=28&&n.discoveryKey&&e.fixed32.preencode(o,n.discoveryKey),d>=28&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(d>=28&&n.endedAt?1:0)|(d>=28&&n.discoveryKey?2:0)|(d>=28&&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>=28&&n.endedAt&&e.uint.encode(o,n.endedAt),d>=28&&n.discoveryKey&&e.fixed32.encode(o,n.discoveryKey),d>=28&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=e.fixed32.decode(o),c=e.buffer.decode(o),r=e.uint.decode(o),t=e.uint.decode(o);return{callKey:n,encryptionKey:c,createdAt:r,endedAt:d>=28&&1&t?e.uint.decode(o):0,discoveryKey:d>=28&&2&t?e.fixed32.decode(o):null,version:d>=28&&4&t?e.uint.decode(o):0}}},pi={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)})},ui={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>=28&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey),d>=32&&n.lastHeartbeatAt&&e.uint.preencode(o,n.lastHeartbeatAt)},encode(o,n){const c=(d>=28&&n.swarmKey?1:0)|(d>=32&&n.lastHeartbeatAt?2:0)|(d>=33&&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>=28&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey),d>=32&&n.lastHeartbeatAt&&e.uint.encode(o,n.lastHeartbeatAt)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.fixed32.decode(o),t=e.uint.decode(o),i=e.uint.decode(o);return{callKey:n,deviceKey:c,memberKey:r,createdAt:t,swarmKey:d>=28&&1&i?e.fixed32.decode(o):null,lastHeartbeatAt:d>=32&&2&i?e.uint.decode(o):0,isRecording:d>=33&&!!(4&i)}}},fi={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>=36&&n.mediaStreamId&&e.string.preencode(o,n.mediaStreamId),d>=36&&n.type&&e.string.preencode(o,n.type),d>=36&&n.statusKey&&e.uint.preencode(o,n.statusKey)},encode(o,n){const c=(d>=36&&n.mediaStreamId?1:0)|(d>=36&&n.type?2:0)|(d>=36&&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>=36&&n.mediaStreamId&&e.string.encode(o,n.mediaStreamId),d>=36&&n.type&&e.string.encode(o,n.type),d>=36&&n.statusKey&&e.uint.encode(o,n.statusKey)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.buffer.decode(o),t=e.uint.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{callKey:n,deviceKey:c,streamKey:r,createdAt:t,mediaStreamId:d>=36&&1&i?e.string.decode(o):null,type:d>=36&&2&i?e.string.decode(o):null,statusKey:d>=36&&4&i?e.uint.decode(o):0}}},mi={preencode(o,n){e.fixed32.preencode(o,n.callKey),o.end++,d>=28&&n.selfDeviceKey&&e.fixed32.preencode(o,n.selfDeviceKey),d>=36&&n.createdAt&&e.uint.preencode(o,n.createdAt)},encode(o,n){const c=(d>=28&&n.selfDeviceKey?1:0)|(d>=36&&n.createdAt?2:0);e.fixed32.encode(o,n.callKey),e.uint.encode(o,c),d>=28&&n.selfDeviceKey&&e.fixed32.encode(o,n.selfDeviceKey),d>=36&&n.createdAt&&e.uint.encode(o,n.createdAt)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o);return{callKey:n,selfDeviceKey:d>=28&&1&c?e.fixed32.decode(o):null,createdAt:d>=36&&2&c?e.uint.decode(o):0}}},yi={preencode(d,o){e.uint.preencode(d,o.lastCleared)},encode(d,o){e.uint.encode(d,o.lastCleared)},decode:d=>({lastCleared:e.uint.decode(d)})},bi={Nightly:"Nightly",Internal:"Internal",Production:"Production"},xi={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}}},vi=$,gi={preencode(e,d){vi.preencode(e,d.header)},encode(e,d){vi.encode(e,d.header)},decode:e=>({header:vi.decode(e)})},ki=$,Ki={preencode(e,d){ki.preencode(e,d.header)},encode(e,d){ki.encode(e,d.header)},decode:e=>({header:ki.decode(e)})},hi={preencode(o,n){xi.preencode(o,n.buildType),o.end++,d>=30&&n.latestOfflineAbi&&e.uint.preencode(o,n.latestOfflineAbi)},encode(o,n){const c=d>=30&&n.latestOfflineAbi?1:0;xi.encode(o,n.buildType),e.uint.encode(o,c),d>=30&&n.latestOfflineAbi&&e.uint.encode(o,n.latestOfflineAbi)},decode(o){const n=xi.decode(o),c=o.start<o.end?e.uint.decode(o):0;return{buildType:n,latestOfflineAbi:d>=30&&1&c?e.uint.decode(o):0}}},wi=$,Ri={preencode(d,o){wi.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){wi.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:wi.decode(d),deviceKey:e.fixed32.decode(d),deviceProof:e.buffer.decode(d),writerProof:e.buffer.decode(d)})},Pi={preencode(o,n){o.end++,d>=31&&n.otaResyncPrivateProfileBump&&e.uint.preencode(o,n.otaResyncPrivateProfileBump)},encode(o,n){const c=d>=31&&n.otaResyncPrivateProfileBump?1:0;e.uint.encode(o,c),d>=31&&n.otaResyncPrivateProfileBump&&e.uint.encode(o,n.otaResyncPrivateProfileBump)},decode(o){const n=e.uint.decode(o);return{otaResyncPrivateProfileBump:d>=31&&1&n?e.uint.decode(o):0}}},Ti={preencode(d,o){e.fixed32.preencode(d,o.deviceKey),e.buffer.preencode(d,o.proof),e.uint.preencode(d,o.createdAt)},encode(d,o){e.fixed32.encode(d,o.deviceKey),e.buffer.encode(d,o.proof),e.uint.encode(d,o.createdAt)},decode:d=>({deviceKey:e.fixed32.decode(d),proof:e.buffer.decode(d),createdAt:e.uint.decode(d)})},Ai=$,Mi={preencode(d,o){Ai.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Ai.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Ai.decode(d),callKey:e.fixed32.decode(d)})},Si=$,Ii={preencode(d,o){Si.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.deviceKey)},encode(d,o){Si.encode(d,o.header),e.fixed32.encode(d,o.callKey),e.fixed32.encode(d,o.deviceKey)},decode:d=>({header:Si.decode(d),callKey:e.fixed32.decode(d),deviceKey:e.fixed32.decode(d)})},Ci=e.frame(ht),Vi=e.array(e.frame(yt)),Hi={preencode(e,d){Ci.preencode(e,d.digest),Vi.preencode(e,d.mine)},encode(e,d){Ci.encode(e,d.digest),Vi.encode(e,d.mine)},decode:e=>({digest:Ci.decode(e),mine:Vi.decode(e)})},Fi=$,Di={preencode(d,o){Fi.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Fi.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Fi.decode(d),callKey:e.fixed32.decode(d)})},Li=$,ji={preencode(d,o){Li.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Li.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Li.decode(d),callKey:e.fixed32.decode(d)})},qi={preencode(o,n){o.end++,d>=33&&n.profileSnoozeTime&&e.uint.preencode(o,n.profileSnoozeTime)},encode(o,n){const c=(d>=33&&n.disableReadReceipts?1:0)|(d>=33&&n.stripAttachmentMetadata?2:0)|(d>=33&&n.profileSnoozeTime?4:0);e.uint.encode(o,c),d>=33&&n.profileSnoozeTime&&e.uint.encode(o,n.profileSnoozeTime)},decode(o){const n=e.uint.decode(o);return{disableReadReceipts:d>=33&&!!(1&n),stripAttachmentMetadata:d>=33&&!!(2&n),profileSnoozeTime:d>=33&&4&n?e.uint.decode(o):0}}},Bi={preencode(o,n){o.end++,d>=33&&n.maxPeers&&e.uint.preencode(o,n.maxPeers)},encode(o,n){const c=d>=33&&n.maxPeers?1:0;e.uint.encode(o,c),d>=33&&n.maxPeers&&e.uint.encode(o,n.maxPeers)},decode(o){const n=e.uint.decode(o);return{maxPeers:d>=33&&1&n?e.uint.decode(o):0}}},Ei=$,zi={preencode(e,d){Ei.preencode(e,d.header),n.preencode(e,d.oplog)},encode(e,d){Ei.encode(e,d.header),n.encode(e,d.oplog)},decode:e=>({header:Ei.decode(e),oplog:n.decode(e)})},Oi=$,Ni={preencode(e,d){Oi.preencode(e,d.header)},encode(e,d){Oi.encode(e,d.header)},decode:e=>({header:Oi.decode(e)})},Ui={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)})},Ji=$,Wi={preencode(o,n){Ji.preencode(o,n.header),e.fixed32.preencode(o,n.memberKey),o.end++,d>=34&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=d>=34&&n.alias?1:0;Ji.encode(o,n.header),e.fixed32.encode(o,n.memberKey),e.uint.encode(o,c),d>=34&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=Ji.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{header:n,memberKey:c,alias:d>=34&&1&r?e.string.decode(o):null}}},Gi={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)})},Qi={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>=36&&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),r=e.string.decode(o),t=e.uint.decode(o);return{streamKey:n,mediaStreamId:c,type:r,muted:d>=36&&!!(1&t)}}},Xi=$,Yi={preencode(d,o){Xi.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.streamKey),d.end++},encode(o,n){const c=d>=36&&n.muted?1:0;Xi.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=Xi.decode(o),c=e.fixed32.decode(o),r=e.fixed32.decode(o),t=e.uint.decode(o);return{header:n,callKey:c,streamKey:r,muted:d>=36&&!!(1&t)}}},Zi={preencode(d,o){e.uint.preencode(d,o.statusKey),d.end++},encode(o,n){const c=d>=36&&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>=36&&!!(1&c)}}},$i={preencode(n,c){e.fixed32.preencode(n,c.key),n.end++,d>=37&&c.encryptionKey&&e.buffer.preencode(n,c.encryptionKey),d>=37&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const r=(d>=37&&c.encryptionKey?1:0)|(d>=37&&c.bootFrom?2:0);e.fixed32.encode(n,c.key),e.uint.encode(n,r),d>=37&&c.encryptionKey&&e.buffer.encode(n,c.encryptionKey),d>=37&&c.bootFrom&&o.encode(n,c.bootFrom)},decode(n){const c=e.fixed32.decode(n),r=e.uint.decode(n);return{key:c,encryptionKey:d>=37&&1&r?e.buffer.decode(n):null,bootFrom:d>=37&&2&r?o.decode(n):null}}},_i={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)})},ea={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)})},da={preencode(n,c){o.preencode(n,c.autobeeMigrationHead),n.end++,d>=37&&c.legacyViewHead&&o.preencode(n,c.legacyViewHead),d>=37&&c.dbViewHead&&o.preencode(n,c.dbViewHead),d>=37&&c.blobsViewHead&&o.preencode(n,c.blobsViewHead),e.uint.preencode(n,c.createdAt)},encode(n,c){const r=(d>=37&&c.legacyViewHead?1:0)|(d>=37&&c.dbViewHead?2:0)|(d>=37&&c.blobsViewHead?4:0);o.encode(n,c.autobeeMigrationHead),e.uint.encode(n,r),d>=37&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=37&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=37&&c.blobsViewHead&&o.encode(n,c.blobsViewHead),e.uint.encode(n,c.createdAt)},decode(n){const c=o.decode(n),r=e.uint.decode(n);return{autobeeMigrationHead:c,legacyViewHead:d>=37&&1&r?o.decode(n):null,dbViewHead:d>=37&&2&r?o.decode(n):null,blobsViewHead:d>=37&&4&r?o.decode(n):null,createdAt:e.uint.decode(n)}}},oa=$,na={preencode(e,n){oa.preencode(e,n.header),o.preencode(e,n.head),e.end++,d>=37&&n.legacyViewHead&&o.preencode(e,n.legacyViewHead),d>=37&&n.dbViewHead&&o.preencode(e,n.dbViewHead),d>=37&&n.blobsViewHead&&o.preencode(e,n.blobsViewHead)},encode(n,c){const r=(d>=37&&c.legacyViewHead?1:0)|(d>=37&&c.dbViewHead?2:0)|(d>=37&&c.blobsViewHead?4:0);oa.encode(n,c.header),o.encode(n,c.head),e.uint.encode(n,r),d>=37&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=37&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=37&&c.blobsViewHead&&o.encode(n,c.blobsViewHead)},decode(n){const c=oa.decode(n),r=o.decode(n),t=e.uint.decode(n);return{header:c,head:r,legacyViewHead:d>=37&&1&t?o.decode(n):null,dbViewHead:d>=37&&2&t?o.decode(n):null,blobsViewHead:d>=37&&4&t?o.decode(n):null}}},ca={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.fixed32.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.seed),n.end++,d>=37&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const r=d>=37&&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,r),d>=37&&c.bootFrom&&o.encode(n,c.bootFrom)},decode(n){const c=e.fixed32.decode(n),r=e.fixed32.decode(n),t=e.fixed32.decode(n),i=e.uint.decode(n);return{roomKey:c,encryptionKey:r,seed:t,bootFrom:d>=37&&1&i?o.decode(n):null}}},ra=id,ta={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),ra.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),ra.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:ra.decode(d)})},ia={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)})},aa=In,sa=Cn,la=gn,pa={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.mailbox),aa.preencode(n,c.status),e.uint.preencode(n,c.clock),n.end++,d>=37&&c.initiator&&o.preencode(n,c.initiator),d>=37&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=37&&c.identitySwap&&sa.preencode(n,c.identitySwap),d>=37&&c.identitySwapV2&&la.preencode(n,c.identitySwapV2),d>=37&&c.contact&&e.fixed32.preencode(n,c.contact)},encode(n,c){const r=(d>=37&&c.initiator?1:0)|(d>=37&&c.bootFrom?2:0)|(d>=37&&c.identitySwap?4:0)|(d>=37&&c.identitySwapV2?8:0)|(d>=37&&c.contact?16:0);e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),aa.encode(n,c.status),e.uint.encode(n,c.clock),e.uint.encode(n,r),d>=37&&c.initiator&&o.encode(n,c.initiator),d>=37&&c.bootFrom&&o.encode(n,c.bootFrom),d>=37&&c.identitySwap&&sa.encode(n,c.identitySwap),d>=37&&c.identitySwapV2&&la.encode(n,c.identitySwapV2),d>=37&&c.contact&&e.fixed32.encode(n,c.contact)},decode(n){const c=e.fixed32.decode(n),r=e.buffer.decode(n),t=e.fixed32.decode(n),i=aa.decode(n),a=e.uint.decode(n),s=e.uint.decode(n);return{roomKey:c,encryptionKey:r,mailbox:t,status:i,clock:a,initiator:d>=37&&1&s?o.decode(n):null,bootFrom:d>=37&&2&s?o.decode(n):null,identitySwap:d>=37&&4&s?sa.decode(n):null,identitySwapV2:d>=37&&8&s?la.decode(n):null,contact:d>=37&&16&s?e.fixed32.decode(n):null}}},ua=$,fa={preencode(n,c){ua.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>=37&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=37&&c.initiator&&o.preencode(n,c.initiator),d>=37&&c.dm&&e.fixed32.preencode(n,c.dm)},encode(n,c){const r=(d>=37&&c.bootFrom?1:0)|(d>=37&&c.initiator?2:0)|(d>=37&&c.dm?4:0)|(d>=37&&c.isReadOnly?8:0);ua.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,r),d>=37&&c.bootFrom&&o.encode(n,c.bootFrom),d>=37&&c.initiator&&o.encode(n,c.initiator),d>=37&&c.dm&&e.fixed32.encode(n,c.dm)},decode(n){const c=ua.decode(n),r=e.fixed32.decode(n),t=e.buffer.decode(n),i=e.fixed32.decode(n),a=e.uint.decode(n);return{header:c,roomKey:r,encryptionKey:t,mailbox:i,bootFrom:d>=37&&1&a?o.decode(n):null,initiator:d>=37&&2&a?o.decode(n):null,dm:d>=37&&4&a?e.fixed32.decode(n):null,isReadOnly:d>=37&&!!(8&a)}}},ma={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),n.end++,d>=37&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=37&&c.initiator&&o.preencode(n,c.initiator)},encode(n,c){const r=(d>=37&&c.bootFrom?1:0)|(d>=37&&c.initiator?2:0);e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.uint.encode(n,r),d>=37&&c.bootFrom&&o.encode(n,c.bootFrom),d>=37&&c.initiator&&o.encode(n,c.initiator)},decode(n){const c=e.fixed32.decode(n),r=e.buffer.decode(n),t=e.uint.decode(n);return{roomKey:c,encryptionKey:r,bootFrom:d>=37&&1&t?o.decode(n):null,initiator:d>=37&&2&t?o.decode(n):null}}},ya={preencode(d,o){e.fixed32.preencode(d,o.roomKey),wl.preencode(d,o.head),e.uint.preencode(d,o.timestamp),d.end++},encode(o,n){const c=d>=37&&n.incremental?1:0;e.fixed32.encode(o,n.roomKey),wl.encode(o,n.head),e.uint.encode(o,n.timestamp),e.uint.encode(o,c)},decode(o){const n=e.fixed32.decode(o),c=wl.decode(o),r=e.uint.decode(o),t=e.uint.decode(o);return{roomKey:n,head:c,timestamp:r,incremental:d>=37&&!!(1&t)}}},ba={preencode(o,n){o.end++,d>=37&&n.key&&e.fixed32.preencode(o,n.key),e.uint.preencode(o,n.length)},encode(o,n){const c=d>=37&&n.key?1:0;e.uint.encode(o,c),d>=37&&n.key&&e.fixed32.encode(o,n.key),e.uint.encode(o,n.length)},decode(o){const n=e.uint.decode(o);return{key:d>=37&&1&n?e.fixed32.decode(o):null,length:e.uint.decode(o)}}},xa={preencode(n,c){e.fixed32.preencode(n,c.roomKey),n.end++,d>=37&&c.legacyViewHead&&o.preencode(n,c.legacyViewHead),d>=37&&c.dbViewHead&&o.preencode(n,c.dbViewHead),d>=37&&c.blobsViewHead&&o.preencode(n,c.blobsViewHead),d>=37&&c.autobeeMigrationHead&&o.preencode(n,c.autobeeMigrationHead)},encode(n,c){const r=(d>=37&&c.legacyViewHead?1:0)|(d>=37&&c.dbViewHead?2:0)|(d>=37&&c.blobsViewHead?4:0)|(d>=37&&c.autobeeMigrationHead?8:0);e.fixed32.encode(n,c.roomKey),e.uint.encode(n,r),d>=37&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=37&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=37&&c.blobsViewHead&&o.encode(n,c.blobsViewHead),d>=37&&c.autobeeMigrationHead&&o.encode(n,c.autobeeMigrationHead)},decode(n){const c=e.fixed32.decode(n),r=e.uint.decode(n);return{roomKey:c,legacyViewHead:d>=37&&1&r?o.decode(n):null,dbViewHead:d>=37&&2&r?o.decode(n):null,blobsViewHead:d>=37&&4&r?o.decode(n):null,autobeeMigrationHead:d>=37&&8&r?o.decode(n):null}}},va={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)})},ga=$,ka={preencode(d,o){ga.preencode(d,o.header),e.buffer.preencode(d,o.blindResponse)},encode(d,o){ga.encode(d,o.header),e.buffer.encode(d,o.blindResponse)},decode:d=>({header:ga.decode(d),blindResponse:e.buffer.decode(d)})},Ka=e.frame(Ac),ha={preencode(o,n){e.string.preencode(o,n.mnemonic),o.end++,d>=39&&n.profileDiscoveryTimeout&&e.uint.preencode(o,n.profileDiscoveryTimeout),d>=39&&n.privateProfileKey&&e.fixed32.preencode(o,n.privateProfileKey),d>=39&&n.identity&&Ka.preencode(o,n.identity)},encode(o,n){const c=(d>=39&&n.profileDiscoveryTimeout?1:0)|(d>=39&&n.privateProfileKey?2:0)|(d>=39&&n.identity?4:0);e.string.encode(o,n.mnemonic),e.uint.encode(o,c),d>=39&&n.profileDiscoveryTimeout&&e.uint.encode(o,n.profileDiscoveryTimeout),d>=39&&n.privateProfileKey&&e.fixed32.encode(o,n.privateProfileKey),d>=39&&n.identity&&Ka.encode(o,n.identity)},decode(o){const n=e.string.decode(o),c=e.uint.decode(o);return{mnemonic:n,profileDiscoveryTimeout:d>=39&&1&c?e.uint.decode(o):0,privateProfileKey:d>=39&&2&c?e.fixed32.decode(o):null,identity:d>=39&&4&c?Ka.decode(o):null}}},wa=$,Ra={preencode(e,d){wa.preencode(e,d.header)},encode(e,d){wa.encode(e,d.header)},decode:e=>({header:wa.decode(e)})},Pa=$,Ta={preencode(o,c){Pa.preencode(o,c.header),n.preencode(o,c.oplog),e.uint.preencode(o,c.index),o.end++,d>=40&&c.displayType&&Gr.preencode(o,c.displayType)},encode(o,c){const r=d>=40&&c.displayType?1:0;Pa.encode(o,c.header),n.encode(o,c.oplog),e.uint.encode(o,c.index),e.uint.encode(o,r),d>=40&&c.displayType&&Gr.encode(o,c.displayType)},decode(o){const c=Pa.decode(o),r=n.decode(o),t=e.uint.decode(o),i=e.uint.decode(o);return{header:c,oplog:r,index:t,displayType:d>=40&&1&i?Gr.decode(o):0}}},Aa=$,Ma=Od,Sa={preencode(d,o){Aa.preencode(d,o.header),n.preencode(d,o.oplog),Gr.preencode(d,o.displayType),e.uint.preencode(d,o.index),Ma.preencode(d,o.preview)},encode(d,o){Aa.encode(d,o.header),n.encode(d,o.oplog),Gr.encode(d,o.displayType),e.uint.encode(d,o.index),Ma.encode(d,o.preview)},decode:d=>({header:Aa.decode(d),oplog:n.decode(d),displayType:Gr.decode(d),index:e.uint.decode(d),preview:Ma.decode(d)})},Ia=$,Ca={preencode(d,o){Ia.preencode(d,o.header),n.preencode(d,o.oplog),Gr.preencode(d,o.displayType),e.uint.preencode(d,o.index)},encode(d,o){Ia.encode(d,o.header),n.encode(d,o.oplog),Gr.encode(d,o.displayType),e.uint.encode(d,o.index)},decode:d=>({header:Ia.decode(d),oplog:n.decode(d),displayType:Gr.decode(d),index:e.uint.decode(d)})},Va=hc,Ha={preencode(o,n){e.uint.preencode(o,n.priority),o.end++,n.v3&&Va.preencode(o,n.v3),d>=5&&n.timestamp&&e.uint.preencode(o,n.timestamp)},encode(o,n){const c=(n.v3?1:0)|(d>=3&&n.errored?2:0)|(d>=5&&n.timestamp?4:0);e.uint.encode(o,n.priority),e.uint.encode(o,c),n.v3&&Va.encode(o,n.v3),d>=5&&n.timestamp&&e.uint.encode(o,n.timestamp)},decode(o){const n=e.uint.decode(o),c=e.uint.decode(o);return{roomKey:null,priority:n,v3:1&c?Va.decode(o):null,errored:d>=3&&!!(2&c),timestamp:d>=5&&4&c?e.uint.decode(o):0}}},Fa=Xo,Da=fo,La=ir,ja=vc,qa=sr,Ba=lr,Ea=pr,za=Oo,Oa=$o,Na=mr,Ua=X,Ja=br,Wa=In,Ga={preencode(o,n){const c=(n.selfDevice?1:0)|(n.selfMember?2:0)|(n.config?4:0)|(n.identity?8:0)|(n.lastMessage?16:0)|(n.dm?32:0)|(d>=19&&n.readLengths?64:0)|(d>=19&&n.lastMember?128:0)|(d>=21&&n.version?256:0)|(d>=27&&n.preferences?512:0)|(d>=28&&n.activeCall?1024:0)|(d>=32&&n.lastMessageLabels?2048:0)|(d>=33&&n.settings?4096:0)|(d>=37&&n.system?8192:0)|(d>=37&&n.processed?16384:0);e.fixed32.preencode(o,n.discoveryKey),e.buffer.preencode(o,n.encryptionKey),Fa.preencode(o,n.digest),Da.preencode(o,n.stats),La.preencode(o,n.timestamps),e.uint.preencode(o,n.fork),e.uint.preencode(o,n.length),e.fixed32.preencode(o,n.seed),ja.preencode(o,n.capabilities),qa.preencode(o,n.status),e.uint.preencode(o,c),n.selfDevice&&Ba.preencode(o,n.selfDevice),n.selfMember&&Ea.preencode(o,n.selfMember),n.config&&za.preencode(o,n.config),n.identity&&Oa.preencode(o,n.identity),n.lastMessage&&Na.preencode(o,n.lastMessage),n.dm&&Ua.preencode(o,n.dm),d>=19&&n.readLengths&&Rl.preencode(o,n.readLengths),d>=19&&n.lastMember&&Ja.preencode(o,n.lastMember),d>=21&&n.version&&e.uint.preencode(o,n.version),d>=27&&n.preferences&&Wa.preencode(o,n.preferences),d>=28&&n.activeCall&&Pl.preencode(o,n.activeCall),d>=32&&n.lastMessageLabels&&Tl.preencode(o,n.lastMessageLabels),d>=33&&n.settings&&Al.preencode(o,n.settings),d>=37&&n.system&&Ml.preencode(o,n.system),d>=37&&n.processed&&Sl.preencode(o,n.processed)},encode(o,n){const c=(n.selfDevice?1:0)|(n.selfMember?2:0)|(n.config?4:0)|(n.identity?8:0)|(n.lastMessage?16:0)|(n.dm?32:0)|(d>=19&&n.readLengths?64:0)|(d>=19&&n.lastMember?128:0)|(d>=21&&n.version?256:0)|(d>=27&&n.preferences?512:0)|(d>=28&&n.activeCall?1024:0)|(d>=32&&n.lastMessageLabels?2048:0)|(d>=33&&n.settings?4096:0)|(d>=37&&n.system?8192:0)|(d>=37&&n.processed?16384:0);e.fixed32.encode(o,n.discoveryKey),e.buffer.encode(o,n.encryptionKey),Fa.encode(o,n.digest),Da.encode(o,n.stats),La.encode(o,n.timestamps),e.uint.encode(o,n.fork),e.uint.encode(o,n.length),e.fixed32.encode(o,n.seed),ja.encode(o,n.capabilities),qa.encode(o,n.status),e.uint.encode(o,c),n.selfDevice&&Ba.encode(o,n.selfDevice),n.selfMember&&Ea.encode(o,n.selfMember),n.config&&za.encode(o,n.config),n.identity&&Oa.encode(o,n.identity),n.lastMessage&&Na.encode(o,n.lastMessage),n.dm&&Ua.encode(o,n.dm),d>=19&&n.readLengths&&Rl.encode(o,n.readLengths),d>=19&&n.lastMember&&Ja.encode(o,n.lastMember),d>=21&&n.version&&e.uint.encode(o,n.version),d>=27&&n.preferences&&Wa.encode(o,n.preferences),d>=28&&n.activeCall&&Pl.encode(o,n.activeCall),d>=32&&n.lastMessageLabels&&Tl.encode(o,n.lastMessageLabels),d>=33&&n.settings&&Al.encode(o,n.settings),d>=37&&n.system&&Ml.encode(o,n.system),d>=37&&n.processed&&Sl.encode(o,n.processed)},decode(o){const n=e.fixed32.decode(o),c=e.buffer.decode(o),r=Fa.decode(o),t=Da.decode(o),i=La.decode(o),a=e.uint.decode(o),s=e.uint.decode(o),l=e.fixed32.decode(o),p=ja.decode(o),u=qa.decode(o),f=e.uint.decode(o);return{roomKey:null,discoveryKey:n,encryptionKey:c,digest:r,stats:t,timestamps:i,fork:a,length:s,seed:l,capabilities:p,status:u,selfDevice:1&f?Ba.decode(o):null,selfMember:2&f?Ea.decode(o):null,config:4&f?za.decode(o):null,identity:8&f?Oa.decode(o):null,lastMessage:16&f?Na.decode(o):null,dm:32&f?Ua.decode(o):null,readLengths:d>=19&&64&f?Rl.decode(o):null,lastMember:d>=19&&128&f?Ja.decode(o):null,version:d>=21&&256&f?e.uint.decode(o):0,preferences:d>=27&&512&f?Wa.decode(o):null,activeCall:d>=28&&1024&f?Pl.decode(o):null,lastMessageLabels:d>=32&&2048&f?Tl.decode(o):null,settings:d>=33&&4096&f?Al.decode(o):null,system:d>=37&&8192&f?Ml.decode(o):null,processed:d>=37&&16384&f?Sl.decode(o):null}}},Qa=In,Xa={preencode(e,d){Qa.preencode(e,d.status)},encode(e,d){Qa.encode(e,d.status)},decode:e=>({roomKey:null,status:Qa.decode(e)})},Ya={preencode(o,n){e.fixed32.preencode(o,n.key),o.end++,n.roomKey&&e.fixed32.preencode(o,n.roomKey),n.keyPair&&r.preencode(o,n.keyPair),n.responseKeyPair&&r.preencode(o,n.responseKeyPair),d>=39&&n.activeClock&&e.uint.preencode(o,n.activeClock)},encode(o,n){const c=(n.roomKey?1:0)|(n.keyPair?2:0)|(n.responseKeyPair?4:0)|(d>=38&&n.pending?8:0)|(d>=39&&n.activeClock?16:0);e.fixed32.encode(o,n.key),e.uint.encode(o,c),n.roomKey&&e.fixed32.encode(o,n.roomKey),n.keyPair&&r.encode(o,n.keyPair),n.responseKeyPair&&r.encode(o,n.responseKeyPair),d>=39&&n.activeClock&&e.uint.encode(o,n.activeClock)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o);return{mailbox:null,key:n,roomKey:1&c?e.fixed32.decode(o):null,keyPair:2&c?r.decode(o):null,responseKeyPair:4&c?r.decode(o):null,pending:d>=38&&!!(8&c),activeClock:d>=39&&16&c?e.uint.decode(o):0}}},Za=le,$a={preencode(e,d){Za.preencode(e,d.profile)},encode(e,d){Za.encode(e,d.profile)},decode:e=>({key:null,profile:Za.decode(e)})},_a=re,es=te,ds={preencode(d,o){e.fixed32.preencode(d,o.memberKey),_a.preencode(d,o.status),Il.preencode(d,o.profile),d.end++,o.invitation&&es.preencode(d,o.invitation)},encode(d,o){const n=o.invitation?1:0;e.fixed32.encode(d,o.memberKey),_a.encode(d,o.status),Il.encode(d,o.profile),e.uint.encode(d,n),o.invitation&&es.encode(d,o.invitation)},decode:d=>({key:null,memberKey:e.fixed32.decode(d),status:_a.decode(d),profile:Il.decode(d),invitation:1&e.uint.decode(d)?es.decode(d):null})},os=lr,ns={preencode(d,o){e.fixed32.preencode(d,o.roomKey),os.preencode(d,o.device)},encode(d,o){e.fixed32.encode(d,o.roomKey),os.encode(d,o.device)},decode:d=>({roomKey:e.fixed32.decode(d),device:os.decode(d)})},cs={preencode(o,n){Cl.preencode(o,n.status),o.end++,n.mailbox&&e.fixed32.preencode(o,n.mailbox),n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=32&&n.contactInfo&&Vl.preencode(o,n.contactInfo),d>=32&&n.version&&e.uint.preencode(o,n.version),d>=34&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=(n.mailbox?1:0)|(n.roomKey?2:0)|(d>=32&&n.contactInfo?4:0)|(d>=32&&n.version?8:0)|(d>=34&&n.alias?16:0);Cl.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>=32&&n.contactInfo&&Vl.encode(o,n.contactInfo),d>=32&&n.version&&e.uint.encode(o,n.version),d>=34&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=Cl.decode(o),c=e.uint.decode(o);return{memberKey:null,status:n,mailbox:1&c?e.fixed32.decode(o):null,roomKey:2&c?e.fixed32.decode(o):null,contactInfo:d>=32&&4&c?Vl.decode(o):null,version:d>=32&&8&c?e.uint.decode(o):0,alias:d>=34&&16&c?e.string.decode(o):null}}},rs=Jc,ts=Wc,is=Gc,as=Qc,ss=Xc,ls=Yc,ps=Zc,us=$c,fs=_c,ms={preencode(d,o){const n=(o.restoreIdentity?1:0)|(o.createRoom?2:0)|(o.leaveRoom?4:0)|(o.clearRoom?8:0)|(o.joinRoomInvitation?16:0)|(o.joinRoomKeys?32:0)|(o.joinRoomResponse?64:0)|(o.sendContactRequest?128:0)|(o.migrateV2Room?256:0);e.uint.preencode(d,n),o.restoreIdentity&&rs.preencode(d,o.restoreIdentity),o.createRoom&&ts.preencode(d,o.createRoom),o.leaveRoom&&is.preencode(d,o.leaveRoom),o.clearRoom&&as.preencode(d,o.clearRoom),o.joinRoomInvitation&&ss.preencode(d,o.joinRoomInvitation),o.joinRoomKeys&&ls.preencode(d,o.joinRoomKeys),o.joinRoomResponse&&ps.preencode(d,o.joinRoomResponse),o.sendContactRequest&&us.preencode(d,o.sendContactRequest),o.migrateV2Room&&fs.preencode(d,o.migrateV2Room)},encode(d,o){const n=(o.restoreIdentity?1:0)|(o.createRoom?2:0)|(o.leaveRoom?4:0)|(o.clearRoom?8:0)|(o.joinRoomInvitation?16:0)|(o.joinRoomKeys?32:0)|(o.joinRoomResponse?64:0)|(o.sendContactRequest?128:0)|(o.migrateV2Room?256:0);e.uint.encode(d,n),o.restoreIdentity&&rs.encode(d,o.restoreIdentity),o.createRoom&&ts.encode(d,o.createRoom),o.leaveRoom&&is.encode(d,o.leaveRoom),o.clearRoom&&as.encode(d,o.clearRoom),o.joinRoomInvitation&&ss.encode(d,o.joinRoomInvitation),o.joinRoomKeys&&ls.encode(d,o.joinRoomKeys),o.joinRoomResponse&&ps.encode(d,o.joinRoomResponse),o.sendContactRequest&&us.encode(d,o.sendContactRequest),o.migrateV2Room&&fs.encode(d,o.migrateV2Room)},decode(d){const o=e.uint.decode(d);return{discoveryKey:null,priority:0,timestamp:0,type:0,restoreIdentity:1&o?rs.decode(d):null,createRoom:2&o?ts.decode(d):null,leaveRoom:4&o?is.decode(d):null,clearRoom:8&o?as.decode(d):null,joinRoomInvitation:16&o?ss.decode(d):null,joinRoomKeys:32&o?ls.decode(d):null,joinRoomResponse:64&o?ps.decode(d):null,sendContactRequest:128&o?us.decode(d):null,migrateV2Room:256&o?fs.decode(d):null}}},ys={preencode(d,o){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.blockLength),e.uint.encode(d,o.byteOffset),e.uint.encode(d,o.byteLength)},decode:d=>({blockOffset:0,blockLength:e.uint.decode(d),byteOffset:e.uint.decode(d),byteLength:e.uint.decode(d)})},bs={preencode(e,d){a.preencode(e,d.blob)},encode(e,d){a.encode(e,d.blob)},decode:e=>({key:null,blob:a.decode(e)})},xs=m,vs=y,gs={preencode(o,n){o.end++,n.inlined&&e.buffer.preencode(o,n.inlined),n.blob&&a.preencode(o,n.blob),n.externalBlob&&xs.preencode(o,n.externalBlob),n.externalDrive&&vs.preencode(o,n.externalDrive),d>=37&&n.bee&&_i.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>=37&&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&&xs.encode(o,n.externalBlob),n.externalDrive&&vs.encode(o,n.externalDrive),d>=37&&n.bee&&_i.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?xs.decode(o):null,externalDrive:8&n?vs.decode(o):null,bee:d>=37&&16&n?_i.decode(o):null}}},ks=x,Ks=v,hs={preencode(d,o){ks.preencode(d,o.pointer),d.end++,o.metadata&&Ks.preencode(d,o.metadata),o.preview&&Hl.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);ks.encode(d,o.pointer),e.uint.encode(d,n),o.metadata&&Ks.encode(d,o.metadata),o.preview&&Hl.encode(d,o.preview),o.hash&&e.fixed32.encode(d,o.hash)},decode(d){const o=ks.decode(d),n=e.uint.decode(d);return{pointer:o,metadata:1&n?Ks.decode(d):null,preview:2&n?Hl.decode(d):null,hash:4&n?e.fixed32.decode(d):null}}},ws=k,Rs={preencode(o,n){ws.preencode(o,n.file),e.fixed32.preencode(o,n.roomKey),o.end++,n.encryptionKey&&e.buffer.preencode(o,n.encryptionKey),d>=28&&n.lastAccessed&&e.uint.preencode(o,n.lastAccessed),d>=28&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(n.encryptionKey?1:0)|(n.cleared?2:0)|(n.own?4:0)|(d>=28&&n.lastAccessed?8:0)|(d>=28&&n.version?16:0);ws.encode(o,n.file),e.fixed32.encode(o,n.roomKey),e.uint.encode(o,c),n.encryptionKey&&e.buffer.encode(o,n.encryptionKey),d>=28&&n.lastAccessed&&e.uint.encode(o,n.lastAccessed),d>=28&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=ws.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{file:n,roomKey:c,encryptionKey:1&r?e.buffer.decode(o):null,cleared:!!(2&r),own:!!(4&r),lastAccessed:d>=28&&8&r?e.uint.decode(o):0,version:d>=28&&16&r?e.uint.decode(o):0}}},Ps={preencode(d,o){e.uint.preencode(d,o.size)},encode(d,o){e.uint.encode(d,o.size)},decode:d=>({key:null,path:null,version:0,size:e.uint.decode(d)})},Ts=m,As=y,Ms={preencode(o,n){o.end++,n.inlined&&e.buffer.preencode(o,n.inlined),n.blob&&a.preencode(o,n.blob),n.externalBlob&&Ts.preencode(o,n.externalBlob),n.externalDrive&&As.preencode(o,n.externalDrive),d>=37&&n.bee&&_i.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>=37&&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&&Ts.encode(o,n.externalBlob),n.externalDrive&&As.encode(o,n.externalDrive),d>=37&&n.bee&&_i.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?Ts.decode(o):null,externalDrive:8&n?As.decode(o):null,bee:d>=37&&16&n?_i.decode(o):null}}},Ss=x,Is=v,Cs={preencode(d,o){Ss.preencode(d,o.pointer),d.end++,o.metadata&&Is.preencode(d,o.metadata),o.preview&&Fl.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);Ss.encode(d,o.pointer),e.uint.encode(d,n),o.metadata&&Is.encode(d,o.metadata),o.preview&&Fl.encode(d,o.preview),o.hash&&e.fixed32.encode(d,o.hash)},decode(d){const o=Ss.decode(d),n=e.uint.decode(d);return{pointer:o,metadata:1&n?Is.decode(d):null,preview:2&n?Fl.decode(d):null,hash:4&n?e.fixed32.decode(d):null}}},Vs=k,Hs={preencode(o,n){Vs.preencode(o,n.file),e.fixed32.preencode(o,n.roomKey),o.end++,n.encryptionKey&&e.buffer.preencode(o,n.encryptionKey),d>=28&&n.lastAccessed&&e.uint.preencode(o,n.lastAccessed),d>=28&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(n.encryptionKey?1:0)|(n.cleared?2:0)|(n.own?4:0)|(d>=28&&n.lastAccessed?8:0)|(d>=28&&n.version?16:0);Vs.encode(o,n.file),e.fixed32.encode(o,n.roomKey),e.uint.encode(o,c),n.encryptionKey&&e.buffer.encode(o,n.encryptionKey),d>=28&&n.lastAccessed&&e.uint.encode(o,n.lastAccessed),d>=28&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=Vs.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{file:n,roomKey:c,encryptionKey:1&r?e.buffer.decode(o):null,cleared:!!(2&r),own:!!(4&r),lastAccessed:d>=28&&8&r?e.uint.decode(o):0,version:d>=28&&16&r?e.uint.decode(o):0}}},Fs={preencode(d,o){e.uint.preencode(d,o.timestamp),d.end++,o.lastSynced&&e.uint.preencode(d,o.lastSynced)},encode(d,o){const n=(o.lastSynced?1:0)|(o.dirty?2:0);e.uint.encode(d,o.timestamp),e.uint.encode(d,n),o.lastSynced&&e.uint.encode(d,o.lastSynced)},decode(d){const o=e.uint.decode(d),n=e.uint.decode(d);return{discoveryPublicKey:null,timestamp:o,lastSynced:1&n?e.uint.decode(d):0,dirty:!!(2&n)}}},Ds={preencode(e,d){},encode(e,d){},decode:e=>({key:null,responsePublicKey:null})},Ls={preencode(o,n){o.end++,d>=10&&n.repairs&&e.uint.preencode(o,n.repairs)},encode(o,n){const c=d>=10&&n.repairs?1:0;e.uint.encode(o,c),d>=10&&n.repairs&&e.uint.encode(o,n.repairs)},decode(o){const n=e.uint.decode(o);return{roomKey:null,repairs:d>=10&&1&n?e.uint.decode(o):0}}},js={preencode(d,o){e.uint.preencode(d,o.count)},encode(d,o){e.uint.encode(d,o.count)},decode:d=>({roomKey:null,count:e.uint.decode(d)})},qs=Ft,Bs={preencode(o,n){e.string.preencode(o,n.code),e.string.preencode(o,n.message),e.string.preencode(o,n.stack),o.end++,d>=20&&n.details&&qs.preencode(o,n.details)},encode(o,n){const c=d>=20&&n.details?1:0;e.string.encode(o,n.code),e.string.encode(o,n.message),e.string.encode(o,n.stack),e.uint.encode(o,c),d>=20&&n.details&&qs.encode(o,n.details)},decode(o){const n=e.string.decode(o),c=e.string.decode(o),r=e.string.decode(o),t=e.uint.decode(o);return{code:n,message:c,stack:r,timestamp:0,details:d>=20&&1&t?qs.decode(o):null}}},Es={preencode(d,o){e.uint.preencode(d,o.total)},encode(d,o){e.uint.encode(d,o.total)},decode:d=>({roomKey:null,total:e.uint.decode(d)})},zs={preencode(d,o){e.buffer.preencode(d,o.proof),e.uint.preencode(d,o.createdAt)},encode(d,o){e.buffer.encode(d,o.proof),e.uint.encode(d,o.createdAt)},decode:d=>({deviceKey:null,proof:e.buffer.decode(d),createdAt:e.uint.decode(d)})},Os={preencode(d,o){Dl.preencode(d,o.head),e.uint.preencode(d,o.timestamp),d.end++},encode(o,n){const c=d>=37&&n.incremental?1:0;Dl.encode(o,n.head),e.uint.encode(o,n.timestamp),e.uint.encode(o,c)},decode(o){const n=Dl.decode(o),c=e.uint.decode(o),r=e.uint.decode(o);return{roomKey:null,head:n,timestamp:c,incremental:d>=37&&!!(1&r)}}},Ns={preencode(e,n){e.end++,d>=37&&n.legacyViewHead&&o.preencode(e,n.legacyViewHead),d>=37&&n.dbViewHead&&o.preencode(e,n.dbViewHead),d>=37&&n.blobsViewHead&&o.preencode(e,n.blobsViewHead),d>=37&&n.autobeeMigrationHead&&o.preencode(e,n.autobeeMigrationHead)},encode(n,c){const r=(d>=37&&c.legacyViewHead?1:0)|(d>=37&&c.dbViewHead?2:0)|(d>=37&&c.blobsViewHead?4:0)|(d>=37&&c.autobeeMigrationHead?8:0);e.uint.encode(n,r),d>=37&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=37&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=37&&c.blobsViewHead&&o.encode(n,c.blobsViewHead),d>=37&&c.autobeeMigrationHead&&o.encode(n,c.autobeeMigrationHead)},decode(n){const c=e.uint.decode(n);return{roomKey:null,legacyViewHead:d>=37&&1&c?o.decode(n):null,dbViewHead:d>=37&&2&c?o.decode(n):null,blobsViewHead:d>=37&&4&c?o.decode(n):null,autobeeMigrationHead:d>=37&&8&c?o.decode(n):null}}},Us=e.frame(w),Js=e.frame(Gi),Ws=Us,Gs=e.array(ct),Qs=e.frame(se),Xs=Us,Ys=Qs,Zs=e.frame(Lr),$s=e.frame(ca),_s=Qs,el=e.frame(fd),dl=e.frame(Ir),ol=e.frame(Gt),nl=ol,cl=e.array(e.frame(tt)),rl=Us,tl=e.frame(zn),il=e.frame(Vr),al=tl,sl=il,ll=tl,pl=il,ul=e.frame(jr),fl=il,ml=e.array(e.frame(Pt)),yl=e.frame(mi),bl=e.frame(Hi),xl=e.frame(qi),vl=e.frame(ba),gl=vl,kl=Us,Kl=e.array(e.frame(Qi)),hl=Kl,wl=vl,Rl=ml,Pl=yl,Tl=bl,Al=xl,Ml=vl,Sl=vl,Il=Qs,Cl=tl,Vl=il,Hl=Us,Fl=Us,Dl=vl;function Ll(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 r;case"@keet/room-keys":return t;case"@keet/operation-header":return i;case"@keet/blob-pointer":return a;case"@keet/file-dimensions":return s;case"@keet/file-metadata":return p;case"@keet/external-drive-pointer":return u;case"@keet/external-blob-pointer":return f;case"@keet/file-pointer":return b;case"@keet/file":return g;case"@keet/image-file":return w;case"@keet/file-status":return R;case"@keet/file-record":return A;case"@keet/device-status":return M;case"@keet/member-status":return S;case"@keet/member-moderation-status":return I;case"@keet/abi":return C;case"@keet/device-stats":return V;case"@keet/member-stats":return H;case"@keet/chat-stats":return F;case"@keet/file-stats":return D;case"@keet/stats":return E;case"@keet/room-type":return O;case"@keet/system-settings":return N;case"@keet/system-digest":return W;case"@keet/room-seed":return G;case"@keet/room-capabilities":return Q;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 pe;case"@keet/device-update":return ue;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 ge;case"@keet/device-request-with-invitation-and-proof":return Ke;case"@keet/device-request-with-member-proof":return Re;case"@keet/device-request":return Ae;case"@keet/device-response":return Ie;case"@keet/invitation-metadata":return Ce;case"@keet/invitation":return Fe;case"@keet/add-invitation-operation":return je;case"@keet/remove-invitation-operation":return Be;case"@keet/sendable-room-invitation":return Ee;case"@keet/sendable-identity-invitation":return ze;case"@keet/sendable-contact-invitation":return Oe;case"@keet/sendable-invitation":return Ge;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 td;case"@keet/member":return sd;case"@keet/full-member":return ud;case"@keet/member-proofs":return fd;case"@keet/update-member-operation":return bd;case"@keet/change-member-status-operation":return gd;case"@keet/change-member-role-operation":return Kd;case"@keet/remove-member-operation":return wd;case"@keet/member-activity":return Rd;case"@keet/member-joined-event":return Pd;case"@keet/member-left-event":return Td;case"@keet/title-changed-chat-event":return Ad;case"@keet/chat-event":return Cd;case"@keet/sendable-event":return Vd;case"@keet/display-range":return Hd;case"@keet/display-content-range":return Dd;case"@keet/mention-display-item":return jd;case"@keet/link-preview":return Ed;case"@keet/display-link-item":return Nd;case"@keet/display":return _d;case"@keet/oplog-message":return co;case"@keet/index-message":return io;case"@keet/full-index-message":return lo;case"@keet/message-status":return po;case"@keet/message-index-id":return uo;case"@keet/thread":return mo;case"@keet/chat-message-record":return vo;case"@keet/full-chat-message-record":return ho;case"@keet/add-chat-message-operation":return Po;case"@keet/remove-chat-message-operation":return Ao;case"@keet/update-chat-message-operation":return Io;case"@keet/pin-chat-message-operation":return Vo;case"@keet/reaction":return Ho;case"@keet/reactions-summary":return Fo;case"@keet/reactions-digest":return Lo;case"@keet/add-reaction-operation":return qo;case"@keet/remove-reaction-operation":return Eo;case"@keet/update-room-config-operation":return No;case"@keet/group-member":return Uo;case"@keet/user-registry-info":return Jo;case"@keet/room-identity":return Go;case"@keet/genesis-operation":return dn;case"@keet/upgrade-operation":return nn;case"@keet/update-system-settings-operation":return tn;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 un;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 vn;case"@keet-private-id/pending-invitation":return kn;case"@keet-private-id/resolve-pending-invitation-operation":return hn;case"@keet-private-id/add-pending-invitation-operation":return Pn;case"@keet-private-id/remove-pending-invitation-operation":return An;case"@keet-private-id/identity-swap":return Mn;case"@keet-private-id/room-status":return Sn;case"@keet-private-id/room":return Hn;case"@keet-private-id/add-room-operation":return Dn;case"@keet-private-id/remove-room-operation":return jn;case"@keet-private-id/update-room-status-operation":return En;case"@keet-private-id/contact-status":return zn;case"@keet-private-id/contact-record":return On;case"@keet-private-id/add-contact-operation":return Jn;case"@keet-private-id/update-contact-status-operation":return Gn;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 rc;case"@keet-private-id/add-contact-request-operation":return ic;case"@keet-private-id/update-contact-request-status-operation":return lc;case"@keet-private-id/profile-discovery-record-v1":return pc;case"@keet-private-id/profile-discovery-record":return uc;case"@local/background-sync-room":return fc;case"@local/stats":return mc;case"@local/migration-status":return yc;case"@local/v3-private-profile-migration":return xc;case"@local/v3-room-migration":return kc;case"@local/room-migration-stats":return Kc;case"@local/room-migration":return wc;case"@local/identity-status":return Rc;case"@local/identity-record":return Ac;case"@local/tasks":return Sc;case"@local/room-keys":return Ic;case"@local/join-room-invitation-task":return Vc;case"@local/join-room-response-task":return Hc;case"@local/fast-forward-to":return Fc;case"@local/add-room-fields":return Dc;case"@local/join-room-keys-task":return jc;case"@local/create-room-task":return Bc;case"@local/leave-room-task":return Ec;case"@local/clear-room-task":return zc;case"@local/restore-identity-task":return Oc;case"@local/send-contact-request-task":return Nc;case"@local/migrate-v2-room-task":return Uc;case"@local/task":return er;case"@local/shared-invitation":return or;case"@local/room-status":return nr;case"@local/room-timestamps":return cr;case"@local/room":return vr;case"@local/room-preferences":return kr;case"@local/writer":return Kr;case"@local/member":return wr;case"@local/device":return Pr;case"@local/file":return Ar;case"@keet/add-file-preview-operation":return Sr;case"@keet/member-removed-event":return Ir;case"@keet/member-contact-info":return Vr;case"@keet/remove-device-operation":return Fr;case"@keet/device-identity":return Dr;case"@keet/readonly-room-invitation":return Lr;case"@keet-private-id/identity-swap-v2":return jr;case"@keet-private-id/activate-contact-room-operation":return Br;case"@local/identity-swap":return Er;case"@local/writer-append":return zr;case"@local/room-metadata":return Or;case"@local/debug-flag":return Nr;case"@local/debug":return Jr;case"@keet/display-type":return Gr;case"@keet/test-increment-operation":return Xr;case"@keet/test-collection-record-1":return Yr;case"@keet/migrate-abi-operation":return $r;case"@keet/system-settings-keys":return et;case"@local/hyperdht-record":return ot;case"@keet/room-supported-language":return ct;case"@keet/translation-display-item":return tt;case"@local/unread":return it;case"@keet-private-id/unreads":return at;case"@keet-private-id/add-unreads-key-operation":return lt;case"@keet-private-id/remove-unreads-key-operation":return ut;case"@keet/label-type":return mt;case"@keet/chat-label":return yt;case"@keet/add-chat-label-operation":return xt;case"@keet/remove-chat-label-operation":return gt;case"@keet/chat-label-summary":return kt;case"@keet/chat-label-digest":return ht;case"@keet/update-read-length-operation":return Rt;case"@keet/read-length":return Pt;case"@keet/tmp-removed-member":return Tt;case"@keet-private-id/settings":return At;case"@keet-private-id/user-settings-key":return St;case"@keet-private-id/update-settings-operation":return Vt;case"@local/error-record-details":return Ht;case"@local/error-record":return Dt;case"@local/keet-state":return jt;case"@local/file-stats":return qt;case"@keet/member-label-type":return Et;case"@keet/member-label":return zt;case"@keet/add-member-label-operation":return Nt;case"@keet/member-label-summary":return Ut;case"@keet/member-label-digest":return Wt;case"@keet/location-shared-event":return Gt;case"@keet/move-indexer-operation":return Xt;case"@keet/start-call":return $t;case"@keet/join-call":return di;case"@keet/leave-call":return ni;case"@keet/end-call":return ri;case"@keet/add-call-stream":return ii;case"@keet/remove-call-stream":return si;case"@keet/call-record":return li;case"@keet/call-member-record":return pi;case"@keet/call-device-record":return ui;case"@keet/call-stream-record":return fi;case"@local/active-call":return mi;case"@local/file-gc-info":return yi;case"@keet/build-type":return xi;case"@keet/test-crash-operation":return gi;case"@keet/test-dispatch-error-operation":return Ki;case"@local/environment-record":return hi;case"@keet-private-id/shorten-device-attestation-operation":return Ri;case"@local/ota-actions":return Pi;case"@local/device-attestation":return Ti;case"@keet/call-device-heartbeat":return Mi;case"@keet/remove-call-device":return Ii;case"@local/chat-labels":return Hi;case"@keet/start-call-recording":return Di;case"@keet/stop-call-recording":return ji;case"@local/settings":return qi;case"@local/hyperswarm-record":return Bi;case"@keet/dismiss-chat-reports-operation":return zi;case"@keet/update-typing-indicator-operation":return Ni;case"@keet/typing-indicator":return Ui;case"@keet-private-id/update-contact-alias-operation":return Wi;case"@keet/call-stats":return Gi;case"@keet/call-stream-input":return Qi;case"@keet/update-call-stream":return Yi;case"@keet/call-stream-status-record":return Zi;case"@keet/room-keys-v2":return $i;case"@keet/blob-pointer-v2":return _i;case"@keet/blob":return ea;case"@keet/autobee-migration":return da;case"@keet/autobee-migration-operation":return na;case"@keet/readonly-room-invitation-v2":return ca;case"@keet/admin-last-seen":return ta;case"@keet/blob-record":return ia;case"@keet-private-id/room-v2":return pa;case"@keet-private-id/add-room-operation-v2":return fa;case"@local/room-keys/v2":return ma;case"@local/room-update":return ya;case"@local/view-head":return ba;case"@local/autobee-migration":return xa;case"@keet-private-id/pending-invitation-response":return va;case"@keet-private-id/resolve-pending-invitation-operation-v2":return ka;case"@local/pending-recovery":return ha;case"@keet/claim-admin-devices-operation":return Ra;case"@keet/remove-file-preview-operation":return Ta;case"@keet/add-link-preview-operation":return Sa;case"@keet/remove-link-preview-operation":return Ca;case"@local/room-migration/hyperdb#3":return Ha;case"@local/room/hyperdb#6":return Ga;case"@local/room-preferences/hyperdb#13":return Xa;case"@local/writer/hyperdb#14":return Ya;case"@local/member/hyperdb#17":return $a;case"@keet/device/hyperdb#18":return ds;case"@local/device/hyperdb#18":return ns;case"@keet-private-id/contact/hyperdb#19":return cs;case"@local/task/hyperdb#21":return ms;case"@keet/blob-pointer/hyperdb#23":return ys;case"@keet/external-blob-pointer/hyperdb#23":return bs;case"@keet/file-pointer/hyperdb#23":return gs;case"@keet/file/hyperdb#23":return hs;case"@local/file/hyperdb#23":return Rs;case"@keet/external-drive-pointer/hyperdb#24":return Ps;case"@keet/file-pointer/hyperdb#24":return Ms;case"@keet/file/hyperdb#24":return Cs;case"@local/file/hyperdb#24":return Hs;case"@local/background-sync-room/hyperdb#27":return Fs;case"@local/writer-append/hyperdb#29":return Ds;case"@local/room-metadata/hyperdb#30":return Ls;case"@local/unread/hyperdb#33":return js;case"@local/error-record/hyperdb#35":return Bs;case"@local/file-stats/hyperdb#37":return Es;case"@local/device-attestation/hyperdb#44":return zs;case"@local/room-update/hyperdb#48":return Os;case"@local/autobee-migration/hyperdb#50":return Ns;default:throw new Error("Encoder not found "+e)}}function jl(e,o=41){const n=Ll(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 ql=jl;module.exports={resolveStruct:ql,getStruct:jl,getEnum:function(e){switch(e){case"@keet/room-type":return z;case"@local/tasks":return Mc;case"@keet/display-type":return Wr;case"@keet/system-settings-keys":return _r;case"@keet/room-supported-language":return nt;case"@keet/label-type":return ft;case"@keet-private-id/user-settings-key":return Mt;case"@local/keet-state":return Lt;case"@keet/member-label-type":return Bt;case"@keet/build-type":return bi;default:throw new Error("Enum not found "+e)}},getEncoding:Ll,encode:function(o,n,c=41){return d=c,e.encode(Ll(o),n)},decode:function(o,n,c=41){return d=c,e.decode(Ll(o),n)},setVersion:function(e){d=e},version:d};