@aseppxyzz12/baileys 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +2579 -0
  3. package/WAProto/AICommon/AICommon.js +19396 -0
  4. package/WAProto/AICommon/AICommon.proto +820 -0
  5. package/WAProto/Adv/Adv.js +1137 -0
  6. package/WAProto/Adv/Adv.proto +42 -0
  7. package/WAProto/BotMetadata/BotMetadata.js +8975 -0
  8. package/WAProto/BotMetadata/BotMetadata.proto +484 -0
  9. package/WAProto/Cert/Cert.js +893 -0
  10. package/WAProto/Cert/Cert.proto +30 -0
  11. package/WAProto/ChatLockSettings/ChatLockSettings.js +673 -0
  12. package/WAProto/ChatLockSettings/ChatLockSettings.proto +9 -0
  13. package/WAProto/CompanionReg/CompanionReg.js +2457 -0
  14. package/WAProto/CompanionReg/CompanionReg.proto +103 -0
  15. package/WAProto/DeviceCapabilities/DeviceCapabilities.js +846 -0
  16. package/WAProto/DeviceCapabilities/DeviceCapabilities.proto +38 -0
  17. package/WAProto/E2E/E2E.js +78728 -0
  18. package/WAProto/E2E/E2E.proto +1970 -0
  19. package/WAProto/Ephemeral/Ephemeral.js +143 -0
  20. package/WAProto/Ephemeral/Ephemeral.proto +7 -0
  21. package/WAProto/HistorySync/HistorySync.js +95931 -0
  22. package/WAProto/HistorySync/HistorySync.proto +229 -0
  23. package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.js +414 -0
  24. package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.proto +13 -0
  25. package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.js +980 -0
  26. package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.proto +38 -0
  27. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +81185 -0
  28. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.proto +88 -0
  29. package/WAProto/MmsRetry/MmsRetry.js +310 -0
  30. package/WAProto/MmsRetry/MmsRetry.proto +19 -0
  31. package/WAProto/Protocol/Protocol.js +399 -0
  32. package/WAProto/Protocol/Protocol.proto +22 -0
  33. package/WAProto/Reporting/Reporting.js +535 -0
  34. package/WAProto/Reporting/Reporting.proto +22 -0
  35. package/WAProto/ServerSync/ServerSync.js +1830 -0
  36. package/WAProto/ServerSync/ServerSync.proto +70 -0
  37. package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.js +3267 -0
  38. package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.proto +95 -0
  39. package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.js +1140 -0
  40. package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.proto +44 -0
  41. package/WAProto/StatusAttributions/StatusAttributions.js +1604 -0
  42. package/WAProto/StatusAttributions/StatusAttributions.proto +89 -0
  43. package/WAProto/SyncAction/SyncAction.js +17424 -0
  44. package/WAProto/SyncAction/SyncAction.proto +663 -0
  45. package/WAProto/UserPassword/UserPassword.js +544 -0
  46. package/WAProto/UserPassword/UserPassword.proto +28 -0
  47. package/WAProto/VnameCert/VnameCert.js +1466 -0
  48. package/WAProto/VnameCert/VnameCert.proto +65 -0
  49. package/WAProto/Wa6/Wa6.js +4601 -0
  50. package/WAProto/Wa6/Wa6.proto +241 -0
  51. package/WAProto/Web/Web.js +90819 -0
  52. package/WAProto/Web/Web.proto +605 -0
  53. package/WAProto/index.js +30 -0
  54. package/engine-requirements.js +9 -0
  55. package/lib/Defaults/baileys-version.json +3 -0
  56. package/lib/Defaults/connection.js +39 -0
  57. package/lib/Defaults/constants.js +50 -0
  58. package/lib/Defaults/history.js +13 -0
  59. package/lib/Defaults/index.js +36 -0
  60. package/lib/Defaults/media.js +43 -0
  61. package/lib/Defaults/phonenumber-mcc.json +223 -0
  62. package/lib/Defaults/prefix.js +12 -0
  63. package/lib/Function/Download/tiktok.js +19 -0
  64. package/lib/Function/Tools/bypass.js +19 -0
  65. package/lib/Function/index.js +13 -0
  66. package/lib/Signal/Group/ciphertext-message.js +14 -0
  67. package/lib/Signal/Group/group-session-builder.js +46 -0
  68. package/lib/Signal/Group/group_cipher.js +104 -0
  69. package/lib/Signal/Group/index.js +42 -0
  70. package/lib/Signal/Group/keyhelper.js +21 -0
  71. package/lib/Signal/Group/queue-job.js +57 -0
  72. package/lib/Signal/Group/sender-chain-key.js +34 -0
  73. package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
  74. package/lib/Signal/Group/sender-key-message.js +78 -0
  75. package/lib/Signal/Group/sender-key-name.js +49 -0
  76. package/lib/Signal/Group/sender-key-record.js +45 -0
  77. package/lib/Signal/Group/sender-key-state.js +100 -0
  78. package/lib/Signal/Group/sender-message-key.js +28 -0
  79. package/lib/Signal/libsignal.js +364 -0
  80. package/lib/Signal/lid-mapping.js +164 -0
  81. package/lib/Socket/Client/abstract-socket-client.js +13 -0
  82. package/lib/Socket/Client/index.js +31 -0
  83. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  84. package/lib/Socket/Client/types.js +12 -0
  85. package/lib/Socket/Client/web-socket-client.js +62 -0
  86. package/lib/Socket/Client/websocket.js +67 -0
  87. package/lib/Socket/business.js +291 -0
  88. package/lib/Socket/chats.js +874 -0
  89. package/lib/Socket/community.js +454 -0
  90. package/lib/Socket/dugong.js +658 -0
  91. package/lib/Socket/groups.js +357 -0
  92. package/lib/Socket/index.js +13 -0
  93. package/lib/Socket/messages-recv.js +1509 -0
  94. package/lib/Socket/messages-send.js +1505 -0
  95. package/lib/Socket/mex.js +54 -0
  96. package/lib/Socket/newsletter.js +171 -0
  97. package/lib/Socket/registration.js +167 -0
  98. package/lib/Socket/rich-content.js +279 -0
  99. package/lib/Socket/socket.js +905 -0
  100. package/lib/Socket/username.js +157 -0
  101. package/lib/Socket/usync.js +70 -0
  102. package/lib/Store/index.js +37 -0
  103. package/lib/Store/keyed-db.js +114 -0
  104. package/lib/Store/make-cache-manager-store.js +77 -0
  105. package/lib/Store/make-in-memory-store.js +423 -0
  106. package/lib/Store/make-ordered-dictionary.js +78 -0
  107. package/lib/Store/object-repository.js +26 -0
  108. package/lib/Types/Auth.js +2 -0
  109. package/lib/Types/Bussines.js +2 -0
  110. package/lib/Types/Call.js +2 -0
  111. package/lib/Types/Chat.js +10 -0
  112. package/lib/Types/Contact.js +2 -0
  113. package/lib/Types/Events.js +2 -0
  114. package/lib/Types/GroupMetadata.js +2 -0
  115. package/lib/Types/Label.js +25 -0
  116. package/lib/Types/LabelAssociation.js +4 -0
  117. package/lib/Types/Message.js +11 -0
  118. package/lib/Types/Mex.js +40 -0
  119. package/lib/Types/MexUpdates.js +15 -0
  120. package/lib/Types/Newsletter.js +32 -0
  121. package/lib/Types/Product.js +2 -0
  122. package/lib/Types/Signal.js +2 -0
  123. package/lib/Types/Socket.js +2 -0
  124. package/lib/Types/State.js +9 -0
  125. package/lib/Types/USync.js +2 -0
  126. package/lib/Types/index.js +60 -0
  127. package/lib/Utils/auth-utils.js +256 -0
  128. package/lib/Utils/baileys-event-stream.js +63 -0
  129. package/lib/Utils/bot-toolkit.js +455 -0
  130. package/lib/Utils/browser-utils.js +29 -0
  131. package/lib/Utils/business.js +233 -0
  132. package/lib/Utils/chat-utils.js +904 -0
  133. package/lib/Utils/companion-reg-client-utils.js +41 -0
  134. package/lib/Utils/crypto.js +144 -0
  135. package/lib/Utils/decode-wa-message.js +305 -0
  136. package/lib/Utils/event-buffer.js +555 -0
  137. package/lib/Utils/generics.js +411 -0
  138. package/lib/Utils/history.js +100 -0
  139. package/lib/Utils/identity-change-handler.js +53 -0
  140. package/lib/Utils/index.js +57 -0
  141. package/lib/Utils/link-preview.js +76 -0
  142. package/lib/Utils/logger.js +4 -0
  143. package/lib/Utils/lt-hash.js +45 -0
  144. package/lib/Utils/make-mutex.js +33 -0
  145. package/lib/Utils/message-composer.js +289 -0
  146. package/lib/Utils/message-retry-manager.js +134 -0
  147. package/lib/Utils/messages-media.js +806 -0
  148. package/lib/Utils/messages.js +1908 -0
  149. package/lib/Utils/noise-handler.js +157 -0
  150. package/lib/Utils/offline-node-processor.js +42 -0
  151. package/lib/Utils/pre-key-manager.js +86 -0
  152. package/lib/Utils/process-message.js +814 -0
  153. package/lib/Utils/reporting-utils.js +264 -0
  154. package/lib/Utils/signal.js +183 -0
  155. package/lib/Utils/stanza-ack.js +36 -0
  156. package/lib/Utils/sync-action-utils.js +52 -0
  157. package/lib/Utils/tc-token-utils.js +167 -0
  158. package/lib/Utils/use-multi-file-auth-state.js +104 -0
  159. package/lib/Utils/validate-connection.js +229 -0
  160. package/lib/Utils/vialeys-event-stream.js +41 -0
  161. package/lib/WABinary/constants.js +1308 -0
  162. package/lib/WABinary/decode.js +233 -0
  163. package/lib/WABinary/encode.js +212 -0
  164. package/lib/WABinary/generic-utils.js +124 -0
  165. package/lib/WABinary/index.js +36 -0
  166. package/lib/WABinary/jid-utils.js +101 -0
  167. package/lib/WABinary/types.js +2 -0
  168. package/lib/WAM/BinaryInfo.js +12 -0
  169. package/lib/WAM/constants.js +20491 -0
  170. package/lib/WAM/encode.js +148 -0
  171. package/lib/WAM/index.js +34 -0
  172. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +62 -0
  173. package/lib/WAUSync/Protocols/USyncContactProtocol.js +38 -0
  174. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +50 -0
  175. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +25 -0
  176. package/lib/WAUSync/Protocols/USyncLIDProtocol.js +24 -0
  177. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +32 -0
  178. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +24 -0
  179. package/lib/WAUSync/Protocols/index.js +38 -0
  180. package/lib/WAUSync/USyncQuery.js +97 -0
  181. package/lib/WAUSync/USyncUser.js +33 -0
  182. package/lib/WAUSync/index.js +34 -0
  183. package/lib/index.js +113 -0
  184. package/lib/messages-send.js +1496 -0
  185. package/package.json +100 -0
@@ -0,0 +1,4601 @@
1
+ "use strict";
2
+ var $protobuf = require("protobufjs/minimal");
3
+ var $Reader = $protobuf.Reader,
4
+ $Writer = $protobuf.Writer,
5
+ $util = $protobuf.util;
6
+ var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
7
+ $root.Wa6 = (function () {
8
+ var Wa6 = {};
9
+ Wa6.ClientPayload = (function () {
10
+ function ClientPayload(properties) {
11
+ this.shards = [];
12
+ if (properties)
13
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
14
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
15
+ }
16
+ ClientPayload.prototype.username = null;
17
+ ClientPayload.prototype.passive = null;
18
+ ClientPayload.prototype.userAgent = null;
19
+ ClientPayload.prototype.webInfo = null;
20
+ ClientPayload.prototype.pushName = null;
21
+ ClientPayload.prototype.sessionId = null;
22
+ ClientPayload.prototype.shortConnect = null;
23
+ ClientPayload.prototype.connectType = null;
24
+ ClientPayload.prototype.connectReason = null;
25
+ ClientPayload.prototype.shards = $util.emptyArray;
26
+ ClientPayload.prototype.dnsSource = null;
27
+ ClientPayload.prototype.connectAttemptCount = null;
28
+ ClientPayload.prototype.device = null;
29
+ ClientPayload.prototype.devicePairingData = null;
30
+ ClientPayload.prototype.product = null;
31
+ ClientPayload.prototype.fbCat = null;
32
+ ClientPayload.prototype.fbUserAgent = null;
33
+ ClientPayload.prototype.oc = null;
34
+ ClientPayload.prototype.lc = null;
35
+ ClientPayload.prototype.iosAppExtension = null;
36
+ ClientPayload.prototype.fbAppId = null;
37
+ ClientPayload.prototype.fbDeviceId = null;
38
+ ClientPayload.prototype.pull = null;
39
+ ClientPayload.prototype.paddingBytes = null;
40
+ ClientPayload.prototype.yearClass = null;
41
+ ClientPayload.prototype.memClass = null;
42
+ ClientPayload.prototype.interopData = null;
43
+ ClientPayload.prototype.trafficAnonymization = null;
44
+ ClientPayload.prototype.lidDbMigrated = null;
45
+ ClientPayload.prototype.accountType = null;
46
+ ClientPayload.prototype.connectionSequenceInfo = null;
47
+ ClientPayload.prototype.paaLink = null;
48
+ ClientPayload.prototype.preacksCount = null;
49
+ ClientPayload.prototype.processingQueueSize = null;
50
+ var $oneOfFields;
51
+ Object.defineProperty(ClientPayload.prototype, "_username", {
52
+ get: $util.oneOfGetter(($oneOfFields = ["username"])),
53
+ set: $util.oneOfSetter($oneOfFields),
54
+ });
55
+ Object.defineProperty(ClientPayload.prototype, "_passive", {
56
+ get: $util.oneOfGetter(($oneOfFields = ["passive"])),
57
+ set: $util.oneOfSetter($oneOfFields),
58
+ });
59
+ Object.defineProperty(ClientPayload.prototype, "_userAgent", {
60
+ get: $util.oneOfGetter(($oneOfFields = ["userAgent"])),
61
+ set: $util.oneOfSetter($oneOfFields),
62
+ });
63
+ Object.defineProperty(ClientPayload.prototype, "_webInfo", {
64
+ get: $util.oneOfGetter(($oneOfFields = ["webInfo"])),
65
+ set: $util.oneOfSetter($oneOfFields),
66
+ });
67
+ Object.defineProperty(ClientPayload.prototype, "_pushName", {
68
+ get: $util.oneOfGetter(($oneOfFields = ["pushName"])),
69
+ set: $util.oneOfSetter($oneOfFields),
70
+ });
71
+ Object.defineProperty(ClientPayload.prototype, "_sessionId", {
72
+ get: $util.oneOfGetter(($oneOfFields = ["sessionId"])),
73
+ set: $util.oneOfSetter($oneOfFields),
74
+ });
75
+ Object.defineProperty(ClientPayload.prototype, "_shortConnect", {
76
+ get: $util.oneOfGetter(($oneOfFields = ["shortConnect"])),
77
+ set: $util.oneOfSetter($oneOfFields),
78
+ });
79
+ Object.defineProperty(ClientPayload.prototype, "_connectType", {
80
+ get: $util.oneOfGetter(($oneOfFields = ["connectType"])),
81
+ set: $util.oneOfSetter($oneOfFields),
82
+ });
83
+ Object.defineProperty(ClientPayload.prototype, "_connectReason", {
84
+ get: $util.oneOfGetter(($oneOfFields = ["connectReason"])),
85
+ set: $util.oneOfSetter($oneOfFields),
86
+ });
87
+ Object.defineProperty(ClientPayload.prototype, "_dnsSource", {
88
+ get: $util.oneOfGetter(($oneOfFields = ["dnsSource"])),
89
+ set: $util.oneOfSetter($oneOfFields),
90
+ });
91
+ Object.defineProperty(ClientPayload.prototype, "_connectAttemptCount", {
92
+ get: $util.oneOfGetter(($oneOfFields = ["connectAttemptCount"])),
93
+ set: $util.oneOfSetter($oneOfFields),
94
+ });
95
+ Object.defineProperty(ClientPayload.prototype, "_device", {
96
+ get: $util.oneOfGetter(($oneOfFields = ["device"])),
97
+ set: $util.oneOfSetter($oneOfFields),
98
+ });
99
+ Object.defineProperty(ClientPayload.prototype, "_devicePairingData", {
100
+ get: $util.oneOfGetter(($oneOfFields = ["devicePairingData"])),
101
+ set: $util.oneOfSetter($oneOfFields),
102
+ });
103
+ Object.defineProperty(ClientPayload.prototype, "_product", {
104
+ get: $util.oneOfGetter(($oneOfFields = ["product"])),
105
+ set: $util.oneOfSetter($oneOfFields),
106
+ });
107
+ Object.defineProperty(ClientPayload.prototype, "_fbCat", {
108
+ get: $util.oneOfGetter(($oneOfFields = ["fbCat"])),
109
+ set: $util.oneOfSetter($oneOfFields),
110
+ });
111
+ Object.defineProperty(ClientPayload.prototype, "_fbUserAgent", {
112
+ get: $util.oneOfGetter(($oneOfFields = ["fbUserAgent"])),
113
+ set: $util.oneOfSetter($oneOfFields),
114
+ });
115
+ Object.defineProperty(ClientPayload.prototype, "_oc", {
116
+ get: $util.oneOfGetter(($oneOfFields = ["oc"])),
117
+ set: $util.oneOfSetter($oneOfFields),
118
+ });
119
+ Object.defineProperty(ClientPayload.prototype, "_lc", {
120
+ get: $util.oneOfGetter(($oneOfFields = ["lc"])),
121
+ set: $util.oneOfSetter($oneOfFields),
122
+ });
123
+ Object.defineProperty(ClientPayload.prototype, "_iosAppExtension", {
124
+ get: $util.oneOfGetter(($oneOfFields = ["iosAppExtension"])),
125
+ set: $util.oneOfSetter($oneOfFields),
126
+ });
127
+ Object.defineProperty(ClientPayload.prototype, "_fbAppId", {
128
+ get: $util.oneOfGetter(($oneOfFields = ["fbAppId"])),
129
+ set: $util.oneOfSetter($oneOfFields),
130
+ });
131
+ Object.defineProperty(ClientPayload.prototype, "_fbDeviceId", {
132
+ get: $util.oneOfGetter(($oneOfFields = ["fbDeviceId"])),
133
+ set: $util.oneOfSetter($oneOfFields),
134
+ });
135
+ Object.defineProperty(ClientPayload.prototype, "_pull", {
136
+ get: $util.oneOfGetter(($oneOfFields = ["pull"])),
137
+ set: $util.oneOfSetter($oneOfFields),
138
+ });
139
+ Object.defineProperty(ClientPayload.prototype, "_paddingBytes", {
140
+ get: $util.oneOfGetter(($oneOfFields = ["paddingBytes"])),
141
+ set: $util.oneOfSetter($oneOfFields),
142
+ });
143
+ Object.defineProperty(ClientPayload.prototype, "_yearClass", {
144
+ get: $util.oneOfGetter(($oneOfFields = ["yearClass"])),
145
+ set: $util.oneOfSetter($oneOfFields),
146
+ });
147
+ Object.defineProperty(ClientPayload.prototype, "_memClass", {
148
+ get: $util.oneOfGetter(($oneOfFields = ["memClass"])),
149
+ set: $util.oneOfSetter($oneOfFields),
150
+ });
151
+ Object.defineProperty(ClientPayload.prototype, "_interopData", {
152
+ get: $util.oneOfGetter(($oneOfFields = ["interopData"])),
153
+ set: $util.oneOfSetter($oneOfFields),
154
+ });
155
+ Object.defineProperty(ClientPayload.prototype, "_trafficAnonymization", {
156
+ get: $util.oneOfGetter(($oneOfFields = ["trafficAnonymization"])),
157
+ set: $util.oneOfSetter($oneOfFields),
158
+ });
159
+ Object.defineProperty(ClientPayload.prototype, "_lidDbMigrated", {
160
+ get: $util.oneOfGetter(($oneOfFields = ["lidDbMigrated"])),
161
+ set: $util.oneOfSetter($oneOfFields),
162
+ });
163
+ Object.defineProperty(ClientPayload.prototype, "_accountType", {
164
+ get: $util.oneOfGetter(($oneOfFields = ["accountType"])),
165
+ set: $util.oneOfSetter($oneOfFields),
166
+ });
167
+ Object.defineProperty(ClientPayload.prototype, "_connectionSequenceInfo", {
168
+ get: $util.oneOfGetter(($oneOfFields = ["connectionSequenceInfo"])),
169
+ set: $util.oneOfSetter($oneOfFields),
170
+ });
171
+ Object.defineProperty(ClientPayload.prototype, "_paaLink", {
172
+ get: $util.oneOfGetter(($oneOfFields = ["paaLink"])),
173
+ set: $util.oneOfSetter($oneOfFields),
174
+ });
175
+ Object.defineProperty(ClientPayload.prototype, "_preacksCount", {
176
+ get: $util.oneOfGetter(($oneOfFields = ["preacksCount"])),
177
+ set: $util.oneOfSetter($oneOfFields),
178
+ });
179
+ Object.defineProperty(ClientPayload.prototype, "_processingQueueSize", {
180
+ get: $util.oneOfGetter(($oneOfFields = ["processingQueueSize"])),
181
+ set: $util.oneOfSetter($oneOfFields),
182
+ });
183
+ ClientPayload.create = function create(properties) {
184
+ return new ClientPayload(properties);
185
+ };
186
+ ClientPayload.encode = function encode(message, writer) {
187
+ if (!writer) writer = $Writer.create();
188
+ if (message.username != null && Object.hasOwnProperty.call(message, "username"))
189
+ writer.uint32(8).uint64(message.username);
190
+ if (message.passive != null && Object.hasOwnProperty.call(message, "passive"))
191
+ writer.uint32(24).bool(message.passive);
192
+ if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent"))
193
+ $root.Wa6.ClientPayload.UserAgent.encode(
194
+ message.userAgent,
195
+ writer.uint32(42).fork()
196
+ ).ldelim();
197
+ if (message.webInfo != null && Object.hasOwnProperty.call(message, "webInfo"))
198
+ $root.Wa6.ClientPayload.WebInfo.encode(
199
+ message.webInfo,
200
+ writer.uint32(50).fork()
201
+ ).ldelim();
202
+ if (message.pushName != null && Object.hasOwnProperty.call(message, "pushName"))
203
+ writer.uint32(58).string(message.pushName);
204
+ if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId"))
205
+ writer.uint32(77).sfixed32(message.sessionId);
206
+ if (message.shortConnect != null && Object.hasOwnProperty.call(message, "shortConnect"))
207
+ writer.uint32(80).bool(message.shortConnect);
208
+ if (message.connectType != null && Object.hasOwnProperty.call(message, "connectType"))
209
+ writer.uint32(96).int32(message.connectType);
210
+ if (
211
+ message.connectReason != null &&
212
+ Object.hasOwnProperty.call(message, "connectReason")
213
+ )
214
+ writer.uint32(104).int32(message.connectReason);
215
+ if (message.shards != null && message.shards.length) {
216
+ writer.uint32(114).fork();
217
+ for (var i = 0; i < message.shards.length; ++i) writer.int32(message.shards[i]);
218
+ writer.ldelim();
219
+ }
220
+ if (message.dnsSource != null && Object.hasOwnProperty.call(message, "dnsSource"))
221
+ $root.Wa6.ClientPayload.DNSSource.encode(
222
+ message.dnsSource,
223
+ writer.uint32(122).fork()
224
+ ).ldelim();
225
+ if (
226
+ message.connectAttemptCount != null &&
227
+ Object.hasOwnProperty.call(message, "connectAttemptCount")
228
+ )
229
+ writer.uint32(128).uint32(message.connectAttemptCount);
230
+ if (message.device != null && Object.hasOwnProperty.call(message, "device"))
231
+ writer.uint32(144).uint32(message.device);
232
+ if (
233
+ message.devicePairingData != null &&
234
+ Object.hasOwnProperty.call(message, "devicePairingData")
235
+ )
236
+ $root.Wa6.ClientPayload.DevicePairingRegistrationData.encode(
237
+ message.devicePairingData,
238
+ writer.uint32(154).fork()
239
+ ).ldelim();
240
+ if (message.product != null && Object.hasOwnProperty.call(message, "product"))
241
+ writer.uint32(160).int32(message.product);
242
+ if (message.fbCat != null && Object.hasOwnProperty.call(message, "fbCat"))
243
+ writer.uint32(170).bytes(message.fbCat);
244
+ if (message.fbUserAgent != null && Object.hasOwnProperty.call(message, "fbUserAgent"))
245
+ writer.uint32(178).bytes(message.fbUserAgent);
246
+ if (message.oc != null && Object.hasOwnProperty.call(message, "oc"))
247
+ writer.uint32(184).bool(message.oc);
248
+ if (message.lc != null && Object.hasOwnProperty.call(message, "lc"))
249
+ writer.uint32(192).int32(message.lc);
250
+ if (
251
+ message.iosAppExtension != null &&
252
+ Object.hasOwnProperty.call(message, "iosAppExtension")
253
+ )
254
+ writer.uint32(240).int32(message.iosAppExtension);
255
+ if (message.fbAppId != null && Object.hasOwnProperty.call(message, "fbAppId"))
256
+ writer.uint32(248).uint64(message.fbAppId);
257
+ if (message.fbDeviceId != null && Object.hasOwnProperty.call(message, "fbDeviceId"))
258
+ writer.uint32(258).bytes(message.fbDeviceId);
259
+ if (message.pull != null && Object.hasOwnProperty.call(message, "pull"))
260
+ writer.uint32(264).bool(message.pull);
261
+ if (message.paddingBytes != null && Object.hasOwnProperty.call(message, "paddingBytes"))
262
+ writer.uint32(274).bytes(message.paddingBytes);
263
+ if (message.yearClass != null && Object.hasOwnProperty.call(message, "yearClass"))
264
+ writer.uint32(288).int32(message.yearClass);
265
+ if (message.memClass != null && Object.hasOwnProperty.call(message, "memClass"))
266
+ writer.uint32(296).int32(message.memClass);
267
+ if (message.interopData != null && Object.hasOwnProperty.call(message, "interopData"))
268
+ $root.Wa6.ClientPayload.InteropData.encode(
269
+ message.interopData,
270
+ writer.uint32(306).fork()
271
+ ).ldelim();
272
+ if (
273
+ message.trafficAnonymization != null &&
274
+ Object.hasOwnProperty.call(message, "trafficAnonymization")
275
+ )
276
+ writer.uint32(320).int32(message.trafficAnonymization);
277
+ if (
278
+ message.lidDbMigrated != null &&
279
+ Object.hasOwnProperty.call(message, "lidDbMigrated")
280
+ )
281
+ writer.uint32(328).bool(message.lidDbMigrated);
282
+ if (message.accountType != null && Object.hasOwnProperty.call(message, "accountType"))
283
+ writer.uint32(336).int32(message.accountType);
284
+ if (
285
+ message.connectionSequenceInfo != null &&
286
+ Object.hasOwnProperty.call(message, "connectionSequenceInfo")
287
+ )
288
+ writer.uint32(349).sfixed32(message.connectionSequenceInfo);
289
+ if (message.paaLink != null && Object.hasOwnProperty.call(message, "paaLink"))
290
+ writer.uint32(352).bool(message.paaLink);
291
+ if (message.preacksCount != null && Object.hasOwnProperty.call(message, "preacksCount"))
292
+ writer.uint32(360).int32(message.preacksCount);
293
+ if (
294
+ message.processingQueueSize != null &&
295
+ Object.hasOwnProperty.call(message, "processingQueueSize")
296
+ )
297
+ writer.uint32(368).int32(message.processingQueueSize);
298
+ return writer;
299
+ };
300
+ ClientPayload.encodeDelimited = function encodeDelimited(message, writer) {
301
+ return this.encode(message, writer).ldelim();
302
+ };
303
+ ClientPayload.decode = function decode(reader, length, error) {
304
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
305
+ var end = length === undefined ? reader.len : reader.pos + length,
306
+ message = new $root.Wa6.ClientPayload();
307
+ while (reader.pos < end) {
308
+ var tag = reader.uint32();
309
+ if (tag === error) break;
310
+ switch (tag >>> 3) {
311
+ case 1: {
312
+ message.username = reader.uint64();
313
+ break;
314
+ }
315
+ case 3: {
316
+ message.passive = reader.bool();
317
+ break;
318
+ }
319
+ case 5: {
320
+ message.userAgent = $root.Wa6.ClientPayload.UserAgent.decode(
321
+ reader,
322
+ reader.uint32()
323
+ );
324
+ break;
325
+ }
326
+ case 6: {
327
+ message.webInfo = $root.Wa6.ClientPayload.WebInfo.decode(
328
+ reader,
329
+ reader.uint32()
330
+ );
331
+ break;
332
+ }
333
+ case 7: {
334
+ message.pushName = reader.string();
335
+ break;
336
+ }
337
+ case 9: {
338
+ message.sessionId = reader.sfixed32();
339
+ break;
340
+ }
341
+ case 10: {
342
+ message.shortConnect = reader.bool();
343
+ break;
344
+ }
345
+ case 12: {
346
+ message.connectType = reader.int32();
347
+ break;
348
+ }
349
+ case 13: {
350
+ message.connectReason = reader.int32();
351
+ break;
352
+ }
353
+ case 14: {
354
+ if (!(message.shards && message.shards.length)) message.shards = [];
355
+ if ((tag & 7) === 2) {
356
+ var end2 = reader.uint32() + reader.pos;
357
+ while (reader.pos < end2) message.shards.push(reader.int32());
358
+ } else message.shards.push(reader.int32());
359
+ break;
360
+ }
361
+ case 15: {
362
+ message.dnsSource = $root.Wa6.ClientPayload.DNSSource.decode(
363
+ reader,
364
+ reader.uint32()
365
+ );
366
+ break;
367
+ }
368
+ case 16: {
369
+ message.connectAttemptCount = reader.uint32();
370
+ break;
371
+ }
372
+ case 18: {
373
+ message.device = reader.uint32();
374
+ break;
375
+ }
376
+ case 19: {
377
+ message.devicePairingData =
378
+ $root.Wa6.ClientPayload.DevicePairingRegistrationData.decode(
379
+ reader,
380
+ reader.uint32()
381
+ );
382
+ break;
383
+ }
384
+ case 20: {
385
+ message.product = reader.int32();
386
+ break;
387
+ }
388
+ case 21: {
389
+ message.fbCat = reader.bytes();
390
+ break;
391
+ }
392
+ case 22: {
393
+ message.fbUserAgent = reader.bytes();
394
+ break;
395
+ }
396
+ case 23: {
397
+ message.oc = reader.bool();
398
+ break;
399
+ }
400
+ case 24: {
401
+ message.lc = reader.int32();
402
+ break;
403
+ }
404
+ case 30: {
405
+ message.iosAppExtension = reader.int32();
406
+ break;
407
+ }
408
+ case 31: {
409
+ message.fbAppId = reader.uint64();
410
+ break;
411
+ }
412
+ case 32: {
413
+ message.fbDeviceId = reader.bytes();
414
+ break;
415
+ }
416
+ case 33: {
417
+ message.pull = reader.bool();
418
+ break;
419
+ }
420
+ case 34: {
421
+ message.paddingBytes = reader.bytes();
422
+ break;
423
+ }
424
+ case 36: {
425
+ message.yearClass = reader.int32();
426
+ break;
427
+ }
428
+ case 37: {
429
+ message.memClass = reader.int32();
430
+ break;
431
+ }
432
+ case 38: {
433
+ message.interopData = $root.Wa6.ClientPayload.InteropData.decode(
434
+ reader,
435
+ reader.uint32()
436
+ );
437
+ break;
438
+ }
439
+ case 40: {
440
+ message.trafficAnonymization = reader.int32();
441
+ break;
442
+ }
443
+ case 41: {
444
+ message.lidDbMigrated = reader.bool();
445
+ break;
446
+ }
447
+ case 42: {
448
+ message.accountType = reader.int32();
449
+ break;
450
+ }
451
+ case 43: {
452
+ message.connectionSequenceInfo = reader.sfixed32();
453
+ break;
454
+ }
455
+ case 44: {
456
+ message.paaLink = reader.bool();
457
+ break;
458
+ }
459
+ case 45: {
460
+ message.preacksCount = reader.int32();
461
+ break;
462
+ }
463
+ case 46: {
464
+ message.processingQueueSize = reader.int32();
465
+ break;
466
+ }
467
+ default:
468
+ reader.skipType(tag & 7);
469
+ break;
470
+ }
471
+ }
472
+ return message;
473
+ };
474
+ ClientPayload.decodeDelimited = function decodeDelimited(reader) {
475
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
476
+ return this.decode(reader, reader.uint32());
477
+ };
478
+ ClientPayload.verify = function verify(message) {
479
+ if (typeof message !== "object" || message === null) return "object expected";
480
+ var properties = {};
481
+ if (message.username != null && message.hasOwnProperty("username")) {
482
+ properties._username = 1;
483
+ if (
484
+ !$util.isInteger(message.username) &&
485
+ !(
486
+ message.username &&
487
+ $util.isInteger(message.username.low) &&
488
+ $util.isInteger(message.username.high)
489
+ )
490
+ )
491
+ return "username: integer|Long expected";
492
+ }
493
+ if (message.passive != null && message.hasOwnProperty("passive")) {
494
+ properties._passive = 1;
495
+ if (typeof message.passive !== "boolean") return "passive: boolean expected";
496
+ }
497
+ if (message.userAgent != null && message.hasOwnProperty("userAgent")) {
498
+ properties._userAgent = 1;
499
+ {
500
+ var error = $root.Wa6.ClientPayload.UserAgent.verify(message.userAgent);
501
+ if (error) return "userAgent." + error;
502
+ }
503
+ }
504
+ if (message.webInfo != null && message.hasOwnProperty("webInfo")) {
505
+ properties._webInfo = 1;
506
+ {
507
+ var error = $root.Wa6.ClientPayload.WebInfo.verify(message.webInfo);
508
+ if (error) return "webInfo." + error;
509
+ }
510
+ }
511
+ if (message.pushName != null && message.hasOwnProperty("pushName")) {
512
+ properties._pushName = 1;
513
+ if (!$util.isString(message.pushName)) return "pushName: string expected";
514
+ }
515
+ if (message.sessionId != null && message.hasOwnProperty("sessionId")) {
516
+ properties._sessionId = 1;
517
+ if (!$util.isInteger(message.sessionId)) return "sessionId: integer expected";
518
+ }
519
+ if (message.shortConnect != null && message.hasOwnProperty("shortConnect")) {
520
+ properties._shortConnect = 1;
521
+ if (typeof message.shortConnect !== "boolean")
522
+ return "shortConnect: boolean expected";
523
+ }
524
+ if (message.connectType != null && message.hasOwnProperty("connectType")) {
525
+ properties._connectType = 1;
526
+ switch (message.connectType) {
527
+ default:
528
+ return "connectType: enum value expected";
529
+ case 0:
530
+ case 1:
531
+ case 100:
532
+ case 101:
533
+ case 102:
534
+ case 103:
535
+ case 104:
536
+ case 105:
537
+ case 106:
538
+ case 107:
539
+ case 108:
540
+ case 109:
541
+ case 110:
542
+ case 111:
543
+ case 112:
544
+ break;
545
+ }
546
+ }
547
+ if (message.connectReason != null && message.hasOwnProperty("connectReason")) {
548
+ properties._connectReason = 1;
549
+ switch (message.connectReason) {
550
+ default:
551
+ return "connectReason: enum value expected";
552
+ case 0:
553
+ case 1:
554
+ case 2:
555
+ case 3:
556
+ case 4:
557
+ case 5:
558
+ case 6:
559
+ break;
560
+ }
561
+ }
562
+ if (message.shards != null && message.hasOwnProperty("shards")) {
563
+ if (!Array.isArray(message.shards)) return "shards: array expected";
564
+ for (var i = 0; i < message.shards.length; ++i)
565
+ if (!$util.isInteger(message.shards[i])) return "shards: integer[] expected";
566
+ }
567
+ if (message.dnsSource != null && message.hasOwnProperty("dnsSource")) {
568
+ properties._dnsSource = 1;
569
+ {
570
+ var error = $root.Wa6.ClientPayload.DNSSource.verify(message.dnsSource);
571
+ if (error) return "dnsSource." + error;
572
+ }
573
+ }
574
+ if (
575
+ message.connectAttemptCount != null &&
576
+ message.hasOwnProperty("connectAttemptCount")
577
+ ) {
578
+ properties._connectAttemptCount = 1;
579
+ if (!$util.isInteger(message.connectAttemptCount))
580
+ return "connectAttemptCount: integer expected";
581
+ }
582
+ if (message.device != null && message.hasOwnProperty("device")) {
583
+ properties._device = 1;
584
+ if (!$util.isInteger(message.device)) return "device: integer expected";
585
+ }
586
+ if (message.devicePairingData != null && message.hasOwnProperty("devicePairingData")) {
587
+ properties._devicePairingData = 1;
588
+ {
589
+ var error = $root.Wa6.ClientPayload.DevicePairingRegistrationData.verify(
590
+ message.devicePairingData
591
+ );
592
+ if (error) return "devicePairingData." + error;
593
+ }
594
+ }
595
+ if (message.product != null && message.hasOwnProperty("product")) {
596
+ properties._product = 1;
597
+ switch (message.product) {
598
+ default:
599
+ return "product: enum value expected";
600
+ case 0:
601
+ case 1:
602
+ case 2:
603
+ case 3:
604
+ case 4:
605
+ break;
606
+ }
607
+ }
608
+ if (message.fbCat != null && message.hasOwnProperty("fbCat")) {
609
+ properties._fbCat = 1;
610
+ if (
611
+ !(
612
+ (message.fbCat && typeof message.fbCat.length === "number") ||
613
+ $util.isString(message.fbCat)
614
+ )
615
+ )
616
+ return "fbCat: buffer expected";
617
+ }
618
+ if (message.fbUserAgent != null && message.hasOwnProperty("fbUserAgent")) {
619
+ properties._fbUserAgent = 1;
620
+ if (
621
+ !(
622
+ (message.fbUserAgent && typeof message.fbUserAgent.length === "number") ||
623
+ $util.isString(message.fbUserAgent)
624
+ )
625
+ )
626
+ return "fbUserAgent: buffer expected";
627
+ }
628
+ if (message.oc != null && message.hasOwnProperty("oc")) {
629
+ properties._oc = 1;
630
+ if (typeof message.oc !== "boolean") return "oc: boolean expected";
631
+ }
632
+ if (message.lc != null && message.hasOwnProperty("lc")) {
633
+ properties._lc = 1;
634
+ if (!$util.isInteger(message.lc)) return "lc: integer expected";
635
+ }
636
+ if (message.iosAppExtension != null && message.hasOwnProperty("iosAppExtension")) {
637
+ properties._iosAppExtension = 1;
638
+ switch (message.iosAppExtension) {
639
+ default:
640
+ return "iosAppExtension: enum value expected";
641
+ case 0:
642
+ case 1:
643
+ case 2:
644
+ break;
645
+ }
646
+ }
647
+ if (message.fbAppId != null && message.hasOwnProperty("fbAppId")) {
648
+ properties._fbAppId = 1;
649
+ if (
650
+ !$util.isInteger(message.fbAppId) &&
651
+ !(
652
+ message.fbAppId &&
653
+ $util.isInteger(message.fbAppId.low) &&
654
+ $util.isInteger(message.fbAppId.high)
655
+ )
656
+ )
657
+ return "fbAppId: integer|Long expected";
658
+ }
659
+ if (message.fbDeviceId != null && message.hasOwnProperty("fbDeviceId")) {
660
+ properties._fbDeviceId = 1;
661
+ if (
662
+ !(
663
+ (message.fbDeviceId && typeof message.fbDeviceId.length === "number") ||
664
+ $util.isString(message.fbDeviceId)
665
+ )
666
+ )
667
+ return "fbDeviceId: buffer expected";
668
+ }
669
+ if (message.pull != null && message.hasOwnProperty("pull")) {
670
+ properties._pull = 1;
671
+ if (typeof message.pull !== "boolean") return "pull: boolean expected";
672
+ }
673
+ if (message.paddingBytes != null && message.hasOwnProperty("paddingBytes")) {
674
+ properties._paddingBytes = 1;
675
+ if (
676
+ !(
677
+ (message.paddingBytes && typeof message.paddingBytes.length === "number") ||
678
+ $util.isString(message.paddingBytes)
679
+ )
680
+ )
681
+ return "paddingBytes: buffer expected";
682
+ }
683
+ if (message.yearClass != null && message.hasOwnProperty("yearClass")) {
684
+ properties._yearClass = 1;
685
+ if (!$util.isInteger(message.yearClass)) return "yearClass: integer expected";
686
+ }
687
+ if (message.memClass != null && message.hasOwnProperty("memClass")) {
688
+ properties._memClass = 1;
689
+ if (!$util.isInteger(message.memClass)) return "memClass: integer expected";
690
+ }
691
+ if (message.interopData != null && message.hasOwnProperty("interopData")) {
692
+ properties._interopData = 1;
693
+ {
694
+ var error = $root.Wa6.ClientPayload.InteropData.verify(message.interopData);
695
+ if (error) return "interopData." + error;
696
+ }
697
+ }
698
+ if (
699
+ message.trafficAnonymization != null &&
700
+ message.hasOwnProperty("trafficAnonymization")
701
+ ) {
702
+ properties._trafficAnonymization = 1;
703
+ switch (message.trafficAnonymization) {
704
+ default:
705
+ return "trafficAnonymization: enum value expected";
706
+ case 0:
707
+ case 1:
708
+ break;
709
+ }
710
+ }
711
+ if (message.lidDbMigrated != null && message.hasOwnProperty("lidDbMigrated")) {
712
+ properties._lidDbMigrated = 1;
713
+ if (typeof message.lidDbMigrated !== "boolean")
714
+ return "lidDbMigrated: boolean expected";
715
+ }
716
+ if (message.accountType != null && message.hasOwnProperty("accountType")) {
717
+ properties._accountType = 1;
718
+ switch (message.accountType) {
719
+ default:
720
+ return "accountType: enum value expected";
721
+ case 0:
722
+ case 1:
723
+ break;
724
+ }
725
+ }
726
+ if (
727
+ message.connectionSequenceInfo != null &&
728
+ message.hasOwnProperty("connectionSequenceInfo")
729
+ ) {
730
+ properties._connectionSequenceInfo = 1;
731
+ if (!$util.isInteger(message.connectionSequenceInfo))
732
+ return "connectionSequenceInfo: integer expected";
733
+ }
734
+ if (message.paaLink != null && message.hasOwnProperty("paaLink")) {
735
+ properties._paaLink = 1;
736
+ if (typeof message.paaLink !== "boolean") return "paaLink: boolean expected";
737
+ }
738
+ if (message.preacksCount != null && message.hasOwnProperty("preacksCount")) {
739
+ properties._preacksCount = 1;
740
+ if (!$util.isInteger(message.preacksCount)) return "preacksCount: integer expected";
741
+ }
742
+ if (
743
+ message.processingQueueSize != null &&
744
+ message.hasOwnProperty("processingQueueSize")
745
+ ) {
746
+ properties._processingQueueSize = 1;
747
+ if (!$util.isInteger(message.processingQueueSize))
748
+ return "processingQueueSize: integer expected";
749
+ }
750
+ return null;
751
+ };
752
+ ClientPayload.fromObject = function fromObject(object) {
753
+ if (object instanceof $root.Wa6.ClientPayload) return object;
754
+ var message = new $root.Wa6.ClientPayload();
755
+ if (object.username != null)
756
+ if ($util.Long)
757
+ (message.username = $util.Long.fromValue(object.username)).unsigned = true;
758
+ else if (typeof object.username === "string")
759
+ message.username = parseInt(object.username, 10);
760
+ else if (typeof object.username === "number") message.username = object.username;
761
+ else if (typeof object.username === "object")
762
+ message.username = new $util.LongBits(
763
+ object.username.low >>> 0,
764
+ object.username.high >>> 0
765
+ ).toNumber(true);
766
+ if (object.passive != null) message.passive = Boolean(object.passive);
767
+ if (object.userAgent != null) {
768
+ if (typeof object.userAgent !== "object")
769
+ throw TypeError(".Wa6.ClientPayload.userAgent: object expected");
770
+ message.userAgent = $root.Wa6.ClientPayload.UserAgent.fromObject(object.userAgent);
771
+ }
772
+ if (object.webInfo != null) {
773
+ if (typeof object.webInfo !== "object")
774
+ throw TypeError(".Wa6.ClientPayload.webInfo: object expected");
775
+ message.webInfo = $root.Wa6.ClientPayload.WebInfo.fromObject(object.webInfo);
776
+ }
777
+ if (object.pushName != null) message.pushName = String(object.pushName);
778
+ if (object.sessionId != null) message.sessionId = object.sessionId | 0;
779
+ if (object.shortConnect != null) message.shortConnect = Boolean(object.shortConnect);
780
+ switch (object.connectType) {
781
+ default:
782
+ if (typeof object.connectType === "number") {
783
+ message.connectType = object.connectType;
784
+ break;
785
+ }
786
+ break;
787
+ case "CELLULAR_UNKNOWN":
788
+ case 0:
789
+ message.connectType = 0;
790
+ break;
791
+ case "WIFI_UNKNOWN":
792
+ case 1:
793
+ message.connectType = 1;
794
+ break;
795
+ case "CELLULAR_EDGE":
796
+ case 100:
797
+ message.connectType = 100;
798
+ break;
799
+ case "CELLULAR_IDEN":
800
+ case 101:
801
+ message.connectType = 101;
802
+ break;
803
+ case "CELLULAR_UMTS":
804
+ case 102:
805
+ message.connectType = 102;
806
+ break;
807
+ case "CELLULAR_EVDO":
808
+ case 103:
809
+ message.connectType = 103;
810
+ break;
811
+ case "CELLULAR_GPRS":
812
+ case 104:
813
+ message.connectType = 104;
814
+ break;
815
+ case "CELLULAR_HSDPA":
816
+ case 105:
817
+ message.connectType = 105;
818
+ break;
819
+ case "CELLULAR_HSUPA":
820
+ case 106:
821
+ message.connectType = 106;
822
+ break;
823
+ case "CELLULAR_HSPA":
824
+ case 107:
825
+ message.connectType = 107;
826
+ break;
827
+ case "CELLULAR_CDMA":
828
+ case 108:
829
+ message.connectType = 108;
830
+ break;
831
+ case "CELLULAR_1XRTT":
832
+ case 109:
833
+ message.connectType = 109;
834
+ break;
835
+ case "CELLULAR_EHRPD":
836
+ case 110:
837
+ message.connectType = 110;
838
+ break;
839
+ case "CELLULAR_LTE":
840
+ case 111:
841
+ message.connectType = 111;
842
+ break;
843
+ case "CELLULAR_HSPAP":
844
+ case 112:
845
+ message.connectType = 112;
846
+ break;
847
+ }
848
+ switch (object.connectReason) {
849
+ default:
850
+ if (typeof object.connectReason === "number") {
851
+ message.connectReason = object.connectReason;
852
+ break;
853
+ }
854
+ break;
855
+ case "PUSH":
856
+ case 0:
857
+ message.connectReason = 0;
858
+ break;
859
+ case "USER_ACTIVATED":
860
+ case 1:
861
+ message.connectReason = 1;
862
+ break;
863
+ case "SCHEDULED":
864
+ case 2:
865
+ message.connectReason = 2;
866
+ break;
867
+ case "ERROR_RECONNECT":
868
+ case 3:
869
+ message.connectReason = 3;
870
+ break;
871
+ case "NETWORK_SWITCH":
872
+ case 4:
873
+ message.connectReason = 4;
874
+ break;
875
+ case "PING_RECONNECT":
876
+ case 5:
877
+ message.connectReason = 5;
878
+ break;
879
+ case "UNKNOWN":
880
+ case 6:
881
+ message.connectReason = 6;
882
+ break;
883
+ }
884
+ if (object.shards) {
885
+ if (!Array.isArray(object.shards))
886
+ throw TypeError(".Wa6.ClientPayload.shards: array expected");
887
+ message.shards = [];
888
+ for (var i = 0; i < object.shards.length; ++i)
889
+ message.shards[i] = object.shards[i] | 0;
890
+ }
891
+ if (object.dnsSource != null) {
892
+ if (typeof object.dnsSource !== "object")
893
+ throw TypeError(".Wa6.ClientPayload.dnsSource: object expected");
894
+ message.dnsSource = $root.Wa6.ClientPayload.DNSSource.fromObject(object.dnsSource);
895
+ }
896
+ if (object.connectAttemptCount != null)
897
+ message.connectAttemptCount = object.connectAttemptCount >>> 0;
898
+ if (object.device != null) message.device = object.device >>> 0;
899
+ if (object.devicePairingData != null) {
900
+ if (typeof object.devicePairingData !== "object")
901
+ throw TypeError(".Wa6.ClientPayload.devicePairingData: object expected");
902
+ message.devicePairingData =
903
+ $root.Wa6.ClientPayload.DevicePairingRegistrationData.fromObject(
904
+ object.devicePairingData
905
+ );
906
+ }
907
+ switch (object.product) {
908
+ default:
909
+ if (typeof object.product === "number") {
910
+ message.product = object.product;
911
+ break;
912
+ }
913
+ break;
914
+ case "WHATSAPP":
915
+ case 0:
916
+ message.product = 0;
917
+ break;
918
+ case "MESSENGER":
919
+ case 1:
920
+ message.product = 1;
921
+ break;
922
+ case "INTEROP":
923
+ case 2:
924
+ message.product = 2;
925
+ break;
926
+ case "INTEROP_MSGR":
927
+ case 3:
928
+ message.product = 3;
929
+ break;
930
+ case "WHATSAPP_LID":
931
+ case 4:
932
+ message.product = 4;
933
+ break;
934
+ }
935
+ if (object.fbCat != null)
936
+ if (typeof object.fbCat === "string")
937
+ $util.base64.decode(
938
+ object.fbCat,
939
+ (message.fbCat = $util.newBuffer($util.base64.length(object.fbCat))),
940
+ 0
941
+ );
942
+ else if (object.fbCat.length >= 0) message.fbCat = object.fbCat;
943
+ if (object.fbUserAgent != null)
944
+ if (typeof object.fbUserAgent === "string")
945
+ $util.base64.decode(
946
+ object.fbUserAgent,
947
+ (message.fbUserAgent = $util.newBuffer(
948
+ $util.base64.length(object.fbUserAgent)
949
+ )),
950
+ 0
951
+ );
952
+ else if (object.fbUserAgent.length >= 0) message.fbUserAgent = object.fbUserAgent;
953
+ if (object.oc != null) message.oc = Boolean(object.oc);
954
+ if (object.lc != null) message.lc = object.lc | 0;
955
+ switch (object.iosAppExtension) {
956
+ default:
957
+ if (typeof object.iosAppExtension === "number") {
958
+ message.iosAppExtension = object.iosAppExtension;
959
+ break;
960
+ }
961
+ break;
962
+ case "SHARE_EXTENSION":
963
+ case 0:
964
+ message.iosAppExtension = 0;
965
+ break;
966
+ case "SERVICE_EXTENSION":
967
+ case 1:
968
+ message.iosAppExtension = 1;
969
+ break;
970
+ case "INTENTS_EXTENSION":
971
+ case 2:
972
+ message.iosAppExtension = 2;
973
+ break;
974
+ }
975
+ if (object.fbAppId != null)
976
+ if ($util.Long)
977
+ (message.fbAppId = $util.Long.fromValue(object.fbAppId)).unsigned = true;
978
+ else if (typeof object.fbAppId === "string")
979
+ message.fbAppId = parseInt(object.fbAppId, 10);
980
+ else if (typeof object.fbAppId === "number") message.fbAppId = object.fbAppId;
981
+ else if (typeof object.fbAppId === "object")
982
+ message.fbAppId = new $util.LongBits(
983
+ object.fbAppId.low >>> 0,
984
+ object.fbAppId.high >>> 0
985
+ ).toNumber(true);
986
+ if (object.fbDeviceId != null)
987
+ if (typeof object.fbDeviceId === "string")
988
+ $util.base64.decode(
989
+ object.fbDeviceId,
990
+ (message.fbDeviceId = $util.newBuffer(
991
+ $util.base64.length(object.fbDeviceId)
992
+ )),
993
+ 0
994
+ );
995
+ else if (object.fbDeviceId.length >= 0) message.fbDeviceId = object.fbDeviceId;
996
+ if (object.pull != null) message.pull = Boolean(object.pull);
997
+ if (object.paddingBytes != null)
998
+ if (typeof object.paddingBytes === "string")
999
+ $util.base64.decode(
1000
+ object.paddingBytes,
1001
+ (message.paddingBytes = $util.newBuffer(
1002
+ $util.base64.length(object.paddingBytes)
1003
+ )),
1004
+ 0
1005
+ );
1006
+ else if (object.paddingBytes.length >= 0)
1007
+ message.paddingBytes = object.paddingBytes;
1008
+ if (object.yearClass != null) message.yearClass = object.yearClass | 0;
1009
+ if (object.memClass != null) message.memClass = object.memClass | 0;
1010
+ if (object.interopData != null) {
1011
+ if (typeof object.interopData !== "object")
1012
+ throw TypeError(".Wa6.ClientPayload.interopData: object expected");
1013
+ message.interopData = $root.Wa6.ClientPayload.InteropData.fromObject(
1014
+ object.interopData
1015
+ );
1016
+ }
1017
+ switch (object.trafficAnonymization) {
1018
+ default:
1019
+ if (typeof object.trafficAnonymization === "number") {
1020
+ message.trafficAnonymization = object.trafficAnonymization;
1021
+ break;
1022
+ }
1023
+ break;
1024
+ case "OFF":
1025
+ case 0:
1026
+ message.trafficAnonymization = 0;
1027
+ break;
1028
+ case "STANDARD":
1029
+ case 1:
1030
+ message.trafficAnonymization = 1;
1031
+ break;
1032
+ }
1033
+ if (object.lidDbMigrated != null) message.lidDbMigrated = Boolean(object.lidDbMigrated);
1034
+ switch (object.accountType) {
1035
+ default:
1036
+ if (typeof object.accountType === "number") {
1037
+ message.accountType = object.accountType;
1038
+ break;
1039
+ }
1040
+ break;
1041
+ case "DEFAULT":
1042
+ case 0:
1043
+ message.accountType = 0;
1044
+ break;
1045
+ case "GUEST":
1046
+ case 1:
1047
+ message.accountType = 1;
1048
+ break;
1049
+ }
1050
+ if (object.connectionSequenceInfo != null)
1051
+ message.connectionSequenceInfo = object.connectionSequenceInfo | 0;
1052
+ if (object.paaLink != null) message.paaLink = Boolean(object.paaLink);
1053
+ if (object.preacksCount != null) message.preacksCount = object.preacksCount | 0;
1054
+ if (object.processingQueueSize != null)
1055
+ message.processingQueueSize = object.processingQueueSize | 0;
1056
+ return message;
1057
+ };
1058
+ ClientPayload.toObject = function toObject(message, options) {
1059
+ if (!options) options = {};
1060
+ var object = {};
1061
+ if (options.arrays || options.defaults) object.shards = [];
1062
+ if (message.username != null && message.hasOwnProperty("username")) {
1063
+ if (typeof message.username === "number")
1064
+ object.username =
1065
+ options.longs === String ? String(message.username) : message.username;
1066
+ else
1067
+ object.username =
1068
+ options.longs === String
1069
+ ? $util.Long.prototype.toString.call(message.username)
1070
+ : options.longs === Number
1071
+ ? new $util.LongBits(
1072
+ message.username.low >>> 0,
1073
+ message.username.high >>> 0
1074
+ ).toNumber(true)
1075
+ : message.username;
1076
+ if (options.oneofs) object._username = "username";
1077
+ }
1078
+ if (message.passive != null && message.hasOwnProperty("passive")) {
1079
+ object.passive = message.passive;
1080
+ if (options.oneofs) object._passive = "passive";
1081
+ }
1082
+ if (message.userAgent != null && message.hasOwnProperty("userAgent")) {
1083
+ object.userAgent = $root.Wa6.ClientPayload.UserAgent.toObject(
1084
+ message.userAgent,
1085
+ options
1086
+ );
1087
+ if (options.oneofs) object._userAgent = "userAgent";
1088
+ }
1089
+ if (message.webInfo != null && message.hasOwnProperty("webInfo")) {
1090
+ object.webInfo = $root.Wa6.ClientPayload.WebInfo.toObject(message.webInfo, options);
1091
+ if (options.oneofs) object._webInfo = "webInfo";
1092
+ }
1093
+ if (message.pushName != null && message.hasOwnProperty("pushName")) {
1094
+ object.pushName = message.pushName;
1095
+ if (options.oneofs) object._pushName = "pushName";
1096
+ }
1097
+ if (message.sessionId != null && message.hasOwnProperty("sessionId")) {
1098
+ object.sessionId = message.sessionId;
1099
+ if (options.oneofs) object._sessionId = "sessionId";
1100
+ }
1101
+ if (message.shortConnect != null && message.hasOwnProperty("shortConnect")) {
1102
+ object.shortConnect = message.shortConnect;
1103
+ if (options.oneofs) object._shortConnect = "shortConnect";
1104
+ }
1105
+ if (message.connectType != null && message.hasOwnProperty("connectType")) {
1106
+ object.connectType =
1107
+ options.enums === String
1108
+ ? $root.Wa6.ClientPayload.ConnectType[message.connectType] === undefined
1109
+ ? message.connectType
1110
+ : $root.Wa6.ClientPayload.ConnectType[message.connectType]
1111
+ : message.connectType;
1112
+ if (options.oneofs) object._connectType = "connectType";
1113
+ }
1114
+ if (message.connectReason != null && message.hasOwnProperty("connectReason")) {
1115
+ object.connectReason =
1116
+ options.enums === String
1117
+ ? $root.Wa6.ClientPayload.ConnectReason[message.connectReason] === undefined
1118
+ ? message.connectReason
1119
+ : $root.Wa6.ClientPayload.ConnectReason[message.connectReason]
1120
+ : message.connectReason;
1121
+ if (options.oneofs) object._connectReason = "connectReason";
1122
+ }
1123
+ if (message.shards && message.shards.length) {
1124
+ object.shards = [];
1125
+ for (var j = 0; j < message.shards.length; ++j)
1126
+ object.shards[j] = message.shards[j];
1127
+ }
1128
+ if (message.dnsSource != null && message.hasOwnProperty("dnsSource")) {
1129
+ object.dnsSource = $root.Wa6.ClientPayload.DNSSource.toObject(
1130
+ message.dnsSource,
1131
+ options
1132
+ );
1133
+ if (options.oneofs) object._dnsSource = "dnsSource";
1134
+ }
1135
+ if (
1136
+ message.connectAttemptCount != null &&
1137
+ message.hasOwnProperty("connectAttemptCount")
1138
+ ) {
1139
+ object.connectAttemptCount = message.connectAttemptCount;
1140
+ if (options.oneofs) object._connectAttemptCount = "connectAttemptCount";
1141
+ }
1142
+ if (message.device != null && message.hasOwnProperty("device")) {
1143
+ object.device = message.device;
1144
+ if (options.oneofs) object._device = "device";
1145
+ }
1146
+ if (message.devicePairingData != null && message.hasOwnProperty("devicePairingData")) {
1147
+ object.devicePairingData =
1148
+ $root.Wa6.ClientPayload.DevicePairingRegistrationData.toObject(
1149
+ message.devicePairingData,
1150
+ options
1151
+ );
1152
+ if (options.oneofs) object._devicePairingData = "devicePairingData";
1153
+ }
1154
+ if (message.product != null && message.hasOwnProperty("product")) {
1155
+ object.product =
1156
+ options.enums === String
1157
+ ? $root.Wa6.ClientPayload.Product[message.product] === undefined
1158
+ ? message.product
1159
+ : $root.Wa6.ClientPayload.Product[message.product]
1160
+ : message.product;
1161
+ if (options.oneofs) object._product = "product";
1162
+ }
1163
+ if (message.fbCat != null && message.hasOwnProperty("fbCat")) {
1164
+ object.fbCat =
1165
+ options.bytes === String
1166
+ ? $util.base64.encode(message.fbCat, 0, message.fbCat.length)
1167
+ : options.bytes === Array
1168
+ ? Array.prototype.slice.call(message.fbCat)
1169
+ : message.fbCat;
1170
+ if (options.oneofs) object._fbCat = "fbCat";
1171
+ }
1172
+ if (message.fbUserAgent != null && message.hasOwnProperty("fbUserAgent")) {
1173
+ object.fbUserAgent =
1174
+ options.bytes === String
1175
+ ? $util.base64.encode(message.fbUserAgent, 0, message.fbUserAgent.length)
1176
+ : options.bytes === Array
1177
+ ? Array.prototype.slice.call(message.fbUserAgent)
1178
+ : message.fbUserAgent;
1179
+ if (options.oneofs) object._fbUserAgent = "fbUserAgent";
1180
+ }
1181
+ if (message.oc != null && message.hasOwnProperty("oc")) {
1182
+ object.oc = message.oc;
1183
+ if (options.oneofs) object._oc = "oc";
1184
+ }
1185
+ if (message.lc != null && message.hasOwnProperty("lc")) {
1186
+ object.lc = message.lc;
1187
+ if (options.oneofs) object._lc = "lc";
1188
+ }
1189
+ if (message.iosAppExtension != null && message.hasOwnProperty("iosAppExtension")) {
1190
+ object.iosAppExtension =
1191
+ options.enums === String
1192
+ ? $root.Wa6.ClientPayload.IOSAppExtension[message.iosAppExtension] ===
1193
+ undefined
1194
+ ? message.iosAppExtension
1195
+ : $root.Wa6.ClientPayload.IOSAppExtension[message.iosAppExtension]
1196
+ : message.iosAppExtension;
1197
+ if (options.oneofs) object._iosAppExtension = "iosAppExtension";
1198
+ }
1199
+ if (message.fbAppId != null && message.hasOwnProperty("fbAppId")) {
1200
+ if (typeof message.fbAppId === "number")
1201
+ object.fbAppId =
1202
+ options.longs === String ? String(message.fbAppId) : message.fbAppId;
1203
+ else
1204
+ object.fbAppId =
1205
+ options.longs === String
1206
+ ? $util.Long.prototype.toString.call(message.fbAppId)
1207
+ : options.longs === Number
1208
+ ? new $util.LongBits(
1209
+ message.fbAppId.low >>> 0,
1210
+ message.fbAppId.high >>> 0
1211
+ ).toNumber(true)
1212
+ : message.fbAppId;
1213
+ if (options.oneofs) object._fbAppId = "fbAppId";
1214
+ }
1215
+ if (message.fbDeviceId != null && message.hasOwnProperty("fbDeviceId")) {
1216
+ object.fbDeviceId =
1217
+ options.bytes === String
1218
+ ? $util.base64.encode(message.fbDeviceId, 0, message.fbDeviceId.length)
1219
+ : options.bytes === Array
1220
+ ? Array.prototype.slice.call(message.fbDeviceId)
1221
+ : message.fbDeviceId;
1222
+ if (options.oneofs) object._fbDeviceId = "fbDeviceId";
1223
+ }
1224
+ if (message.pull != null && message.hasOwnProperty("pull")) {
1225
+ object.pull = message.pull;
1226
+ if (options.oneofs) object._pull = "pull";
1227
+ }
1228
+ if (message.paddingBytes != null && message.hasOwnProperty("paddingBytes")) {
1229
+ object.paddingBytes =
1230
+ options.bytes === String
1231
+ ? $util.base64.encode(message.paddingBytes, 0, message.paddingBytes.length)
1232
+ : options.bytes === Array
1233
+ ? Array.prototype.slice.call(message.paddingBytes)
1234
+ : message.paddingBytes;
1235
+ if (options.oneofs) object._paddingBytes = "paddingBytes";
1236
+ }
1237
+ if (message.yearClass != null && message.hasOwnProperty("yearClass")) {
1238
+ object.yearClass = message.yearClass;
1239
+ if (options.oneofs) object._yearClass = "yearClass";
1240
+ }
1241
+ if (message.memClass != null && message.hasOwnProperty("memClass")) {
1242
+ object.memClass = message.memClass;
1243
+ if (options.oneofs) object._memClass = "memClass";
1244
+ }
1245
+ if (message.interopData != null && message.hasOwnProperty("interopData")) {
1246
+ object.interopData = $root.Wa6.ClientPayload.InteropData.toObject(
1247
+ message.interopData,
1248
+ options
1249
+ );
1250
+ if (options.oneofs) object._interopData = "interopData";
1251
+ }
1252
+ if (
1253
+ message.trafficAnonymization != null &&
1254
+ message.hasOwnProperty("trafficAnonymization")
1255
+ ) {
1256
+ object.trafficAnonymization =
1257
+ options.enums === String
1258
+ ? $root.Wa6.ClientPayload.TrafficAnonymization[
1259
+ message.trafficAnonymization
1260
+ ] === undefined
1261
+ ? message.trafficAnonymization
1262
+ : $root.Wa6.ClientPayload.TrafficAnonymization[
1263
+ message.trafficAnonymization
1264
+ ]
1265
+ : message.trafficAnonymization;
1266
+ if (options.oneofs) object._trafficAnonymization = "trafficAnonymization";
1267
+ }
1268
+ if (message.lidDbMigrated != null && message.hasOwnProperty("lidDbMigrated")) {
1269
+ object.lidDbMigrated = message.lidDbMigrated;
1270
+ if (options.oneofs) object._lidDbMigrated = "lidDbMigrated";
1271
+ }
1272
+ if (message.accountType != null && message.hasOwnProperty("accountType")) {
1273
+ object.accountType =
1274
+ options.enums === String
1275
+ ? $root.Wa6.ClientPayload.AccountType[message.accountType] === undefined
1276
+ ? message.accountType
1277
+ : $root.Wa6.ClientPayload.AccountType[message.accountType]
1278
+ : message.accountType;
1279
+ if (options.oneofs) object._accountType = "accountType";
1280
+ }
1281
+ if (
1282
+ message.connectionSequenceInfo != null &&
1283
+ message.hasOwnProperty("connectionSequenceInfo")
1284
+ ) {
1285
+ object.connectionSequenceInfo = message.connectionSequenceInfo;
1286
+ if (options.oneofs) object._connectionSequenceInfo = "connectionSequenceInfo";
1287
+ }
1288
+ if (message.paaLink != null && message.hasOwnProperty("paaLink")) {
1289
+ object.paaLink = message.paaLink;
1290
+ if (options.oneofs) object._paaLink = "paaLink";
1291
+ }
1292
+ if (message.preacksCount != null && message.hasOwnProperty("preacksCount")) {
1293
+ object.preacksCount = message.preacksCount;
1294
+ if (options.oneofs) object._preacksCount = "preacksCount";
1295
+ }
1296
+ if (
1297
+ message.processingQueueSize != null &&
1298
+ message.hasOwnProperty("processingQueueSize")
1299
+ ) {
1300
+ object.processingQueueSize = message.processingQueueSize;
1301
+ if (options.oneofs) object._processingQueueSize = "processingQueueSize";
1302
+ }
1303
+ return object;
1304
+ };
1305
+ ClientPayload.prototype.toJSON = function toJSON() {
1306
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1307
+ };
1308
+ ClientPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1309
+ if (typeUrlPrefix === undefined) {
1310
+ typeUrlPrefix = "type.googleapis.com";
1311
+ }
1312
+ return typeUrlPrefix + "/Wa6.ClientPayload";
1313
+ };
1314
+ ClientPayload.AccountType = (function () {
1315
+ var valuesById = {},
1316
+ values = Object.create(valuesById);
1317
+ values[(valuesById[0] = "DEFAULT")] = 0;
1318
+ values[(valuesById[1] = "GUEST")] = 1;
1319
+ return values;
1320
+ })();
1321
+ ClientPayload.ConnectReason = (function () {
1322
+ var valuesById = {},
1323
+ values = Object.create(valuesById);
1324
+ values[(valuesById[0] = "PUSH")] = 0;
1325
+ values[(valuesById[1] = "USER_ACTIVATED")] = 1;
1326
+ values[(valuesById[2] = "SCHEDULED")] = 2;
1327
+ values[(valuesById[3] = "ERROR_RECONNECT")] = 3;
1328
+ values[(valuesById[4] = "NETWORK_SWITCH")] = 4;
1329
+ values[(valuesById[5] = "PING_RECONNECT")] = 5;
1330
+ values[(valuesById[6] = "UNKNOWN")] = 6;
1331
+ return values;
1332
+ })();
1333
+ ClientPayload.ConnectType = (function () {
1334
+ var valuesById = {},
1335
+ values = Object.create(valuesById);
1336
+ values[(valuesById[0] = "CELLULAR_UNKNOWN")] = 0;
1337
+ values[(valuesById[1] = "WIFI_UNKNOWN")] = 1;
1338
+ values[(valuesById[100] = "CELLULAR_EDGE")] = 100;
1339
+ values[(valuesById[101] = "CELLULAR_IDEN")] = 101;
1340
+ values[(valuesById[102] = "CELLULAR_UMTS")] = 102;
1341
+ values[(valuesById[103] = "CELLULAR_EVDO")] = 103;
1342
+ values[(valuesById[104] = "CELLULAR_GPRS")] = 104;
1343
+ values[(valuesById[105] = "CELLULAR_HSDPA")] = 105;
1344
+ values[(valuesById[106] = "CELLULAR_HSUPA")] = 106;
1345
+ values[(valuesById[107] = "CELLULAR_HSPA")] = 107;
1346
+ values[(valuesById[108] = "CELLULAR_CDMA")] = 108;
1347
+ values[(valuesById[109] = "CELLULAR_1XRTT")] = 109;
1348
+ values[(valuesById[110] = "CELLULAR_EHRPD")] = 110;
1349
+ values[(valuesById[111] = "CELLULAR_LTE")] = 111;
1350
+ values[(valuesById[112] = "CELLULAR_HSPAP")] = 112;
1351
+ return values;
1352
+ })();
1353
+ ClientPayload.DNSSource = (function () {
1354
+ function DNSSource(properties) {
1355
+ if (properties)
1356
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1357
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
1358
+ }
1359
+ DNSSource.prototype.dnsMethod = null;
1360
+ DNSSource.prototype.appCached = null;
1361
+ var $oneOfFields;
1362
+ Object.defineProperty(DNSSource.prototype, "_dnsMethod", {
1363
+ get: $util.oneOfGetter(($oneOfFields = ["dnsMethod"])),
1364
+ set: $util.oneOfSetter($oneOfFields),
1365
+ });
1366
+ Object.defineProperty(DNSSource.prototype, "_appCached", {
1367
+ get: $util.oneOfGetter(($oneOfFields = ["appCached"])),
1368
+ set: $util.oneOfSetter($oneOfFields),
1369
+ });
1370
+ DNSSource.create = function create(properties) {
1371
+ return new DNSSource(properties);
1372
+ };
1373
+ DNSSource.encode = function encode(message, writer) {
1374
+ if (!writer) writer = $Writer.create();
1375
+ if (message.dnsMethod != null && Object.hasOwnProperty.call(message, "dnsMethod"))
1376
+ writer.uint32(120).int32(message.dnsMethod);
1377
+ if (message.appCached != null && Object.hasOwnProperty.call(message, "appCached"))
1378
+ writer.uint32(128).bool(message.appCached);
1379
+ return writer;
1380
+ };
1381
+ DNSSource.encodeDelimited = function encodeDelimited(message, writer) {
1382
+ return this.encode(message, writer).ldelim();
1383
+ };
1384
+ DNSSource.decode = function decode(reader, length, error) {
1385
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
1386
+ var end = length === undefined ? reader.len : reader.pos + length,
1387
+ message = new $root.Wa6.ClientPayload.DNSSource();
1388
+ while (reader.pos < end) {
1389
+ var tag = reader.uint32();
1390
+ if (tag === error) break;
1391
+ switch (tag >>> 3) {
1392
+ case 15: {
1393
+ message.dnsMethod = reader.int32();
1394
+ break;
1395
+ }
1396
+ case 16: {
1397
+ message.appCached = reader.bool();
1398
+ break;
1399
+ }
1400
+ default:
1401
+ reader.skipType(tag & 7);
1402
+ break;
1403
+ }
1404
+ }
1405
+ return message;
1406
+ };
1407
+ DNSSource.decodeDelimited = function decodeDelimited(reader) {
1408
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1409
+ return this.decode(reader, reader.uint32());
1410
+ };
1411
+ DNSSource.verify = function verify(message) {
1412
+ if (typeof message !== "object" || message === null) return "object expected";
1413
+ var properties = {};
1414
+ if (message.dnsMethod != null && message.hasOwnProperty("dnsMethod")) {
1415
+ properties._dnsMethod = 1;
1416
+ switch (message.dnsMethod) {
1417
+ default:
1418
+ return "dnsMethod: enum value expected";
1419
+ case 0:
1420
+ case 1:
1421
+ case 2:
1422
+ case 3:
1423
+ case 4:
1424
+ case 5:
1425
+ break;
1426
+ }
1427
+ }
1428
+ if (message.appCached != null && message.hasOwnProperty("appCached")) {
1429
+ properties._appCached = 1;
1430
+ if (typeof message.appCached !== "boolean")
1431
+ return "appCached: boolean expected";
1432
+ }
1433
+ return null;
1434
+ };
1435
+ DNSSource.fromObject = function fromObject(object) {
1436
+ if (object instanceof $root.Wa6.ClientPayload.DNSSource) return object;
1437
+ var message = new $root.Wa6.ClientPayload.DNSSource();
1438
+ switch (object.dnsMethod) {
1439
+ default:
1440
+ if (typeof object.dnsMethod === "number") {
1441
+ message.dnsMethod = object.dnsMethod;
1442
+ break;
1443
+ }
1444
+ break;
1445
+ case "SYSTEM":
1446
+ case 0:
1447
+ message.dnsMethod = 0;
1448
+ break;
1449
+ case "GOOGLE":
1450
+ case 1:
1451
+ message.dnsMethod = 1;
1452
+ break;
1453
+ case "HARDCODED":
1454
+ case 2:
1455
+ message.dnsMethod = 2;
1456
+ break;
1457
+ case "OVERRIDE":
1458
+ case 3:
1459
+ message.dnsMethod = 3;
1460
+ break;
1461
+ case "FALLBACK":
1462
+ case 4:
1463
+ message.dnsMethod = 4;
1464
+ break;
1465
+ case "MNS":
1466
+ case 5:
1467
+ message.dnsMethod = 5;
1468
+ break;
1469
+ }
1470
+ if (object.appCached != null) message.appCached = Boolean(object.appCached);
1471
+ return message;
1472
+ };
1473
+ DNSSource.toObject = function toObject(message, options) {
1474
+ if (!options) options = {};
1475
+ var object = {};
1476
+ if (message.dnsMethod != null && message.hasOwnProperty("dnsMethod")) {
1477
+ object.dnsMethod =
1478
+ options.enums === String
1479
+ ? $root.Wa6.ClientPayload.DNSSource.DNSResolutionMethod[
1480
+ message.dnsMethod
1481
+ ] === undefined
1482
+ ? message.dnsMethod
1483
+ : $root.Wa6.ClientPayload.DNSSource.DNSResolutionMethod[
1484
+ message.dnsMethod
1485
+ ]
1486
+ : message.dnsMethod;
1487
+ if (options.oneofs) object._dnsMethod = "dnsMethod";
1488
+ }
1489
+ if (message.appCached != null && message.hasOwnProperty("appCached")) {
1490
+ object.appCached = message.appCached;
1491
+ if (options.oneofs) object._appCached = "appCached";
1492
+ }
1493
+ return object;
1494
+ };
1495
+ DNSSource.prototype.toJSON = function toJSON() {
1496
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1497
+ };
1498
+ DNSSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1499
+ if (typeUrlPrefix === undefined) {
1500
+ typeUrlPrefix = "type.googleapis.com";
1501
+ }
1502
+ return typeUrlPrefix + "/Wa6.ClientPayload.DNSSource";
1503
+ };
1504
+ DNSSource.DNSResolutionMethod = (function () {
1505
+ var valuesById = {},
1506
+ values = Object.create(valuesById);
1507
+ values[(valuesById[0] = "SYSTEM")] = 0;
1508
+ values[(valuesById[1] = "GOOGLE")] = 1;
1509
+ values[(valuesById[2] = "HARDCODED")] = 2;
1510
+ values[(valuesById[3] = "OVERRIDE")] = 3;
1511
+ values[(valuesById[4] = "FALLBACK")] = 4;
1512
+ values[(valuesById[5] = "MNS")] = 5;
1513
+ return values;
1514
+ })();
1515
+ return DNSSource;
1516
+ })();
1517
+ ClientPayload.DevicePairingRegistrationData = (function () {
1518
+ function DevicePairingRegistrationData(properties) {
1519
+ if (properties)
1520
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1521
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
1522
+ }
1523
+ DevicePairingRegistrationData.prototype.eRegid = null;
1524
+ DevicePairingRegistrationData.prototype.eKeytype = null;
1525
+ DevicePairingRegistrationData.prototype.eIdent = null;
1526
+ DevicePairingRegistrationData.prototype.eSkeyId = null;
1527
+ DevicePairingRegistrationData.prototype.eSkeyVal = null;
1528
+ DevicePairingRegistrationData.prototype.eSkeySig = null;
1529
+ DevicePairingRegistrationData.prototype.buildHash = null;
1530
+ DevicePairingRegistrationData.prototype.deviceProps = null;
1531
+ var $oneOfFields;
1532
+ Object.defineProperty(DevicePairingRegistrationData.prototype, "_eRegid", {
1533
+ get: $util.oneOfGetter(($oneOfFields = ["eRegid"])),
1534
+ set: $util.oneOfSetter($oneOfFields),
1535
+ });
1536
+ Object.defineProperty(DevicePairingRegistrationData.prototype, "_eKeytype", {
1537
+ get: $util.oneOfGetter(($oneOfFields = ["eKeytype"])),
1538
+ set: $util.oneOfSetter($oneOfFields),
1539
+ });
1540
+ Object.defineProperty(DevicePairingRegistrationData.prototype, "_eIdent", {
1541
+ get: $util.oneOfGetter(($oneOfFields = ["eIdent"])),
1542
+ set: $util.oneOfSetter($oneOfFields),
1543
+ });
1544
+ Object.defineProperty(DevicePairingRegistrationData.prototype, "_eSkeyId", {
1545
+ get: $util.oneOfGetter(($oneOfFields = ["eSkeyId"])),
1546
+ set: $util.oneOfSetter($oneOfFields),
1547
+ });
1548
+ Object.defineProperty(DevicePairingRegistrationData.prototype, "_eSkeyVal", {
1549
+ get: $util.oneOfGetter(($oneOfFields = ["eSkeyVal"])),
1550
+ set: $util.oneOfSetter($oneOfFields),
1551
+ });
1552
+ Object.defineProperty(DevicePairingRegistrationData.prototype, "_eSkeySig", {
1553
+ get: $util.oneOfGetter(($oneOfFields = ["eSkeySig"])),
1554
+ set: $util.oneOfSetter($oneOfFields),
1555
+ });
1556
+ Object.defineProperty(DevicePairingRegistrationData.prototype, "_buildHash", {
1557
+ get: $util.oneOfGetter(($oneOfFields = ["buildHash"])),
1558
+ set: $util.oneOfSetter($oneOfFields),
1559
+ });
1560
+ Object.defineProperty(DevicePairingRegistrationData.prototype, "_deviceProps", {
1561
+ get: $util.oneOfGetter(($oneOfFields = ["deviceProps"])),
1562
+ set: $util.oneOfSetter($oneOfFields),
1563
+ });
1564
+ DevicePairingRegistrationData.create = function create(properties) {
1565
+ return new DevicePairingRegistrationData(properties);
1566
+ };
1567
+ DevicePairingRegistrationData.encode = function encode(message, writer) {
1568
+ if (!writer) writer = $Writer.create();
1569
+ if (message.eRegid != null && Object.hasOwnProperty.call(message, "eRegid"))
1570
+ writer.uint32(10).bytes(message.eRegid);
1571
+ if (message.eKeytype != null && Object.hasOwnProperty.call(message, "eKeytype"))
1572
+ writer.uint32(18).bytes(message.eKeytype);
1573
+ if (message.eIdent != null && Object.hasOwnProperty.call(message, "eIdent"))
1574
+ writer.uint32(26).bytes(message.eIdent);
1575
+ if (message.eSkeyId != null && Object.hasOwnProperty.call(message, "eSkeyId"))
1576
+ writer.uint32(34).bytes(message.eSkeyId);
1577
+ if (message.eSkeyVal != null && Object.hasOwnProperty.call(message, "eSkeyVal"))
1578
+ writer.uint32(42).bytes(message.eSkeyVal);
1579
+ if (message.eSkeySig != null && Object.hasOwnProperty.call(message, "eSkeySig"))
1580
+ writer.uint32(50).bytes(message.eSkeySig);
1581
+ if (message.buildHash != null && Object.hasOwnProperty.call(message, "buildHash"))
1582
+ writer.uint32(58).bytes(message.buildHash);
1583
+ if (
1584
+ message.deviceProps != null &&
1585
+ Object.hasOwnProperty.call(message, "deviceProps")
1586
+ )
1587
+ writer.uint32(66).bytes(message.deviceProps);
1588
+ return writer;
1589
+ };
1590
+ DevicePairingRegistrationData.encodeDelimited = function encodeDelimited(
1591
+ message,
1592
+ writer
1593
+ ) {
1594
+ return this.encode(message, writer).ldelim();
1595
+ };
1596
+ DevicePairingRegistrationData.decode = function decode(reader, length, error) {
1597
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
1598
+ var end = length === undefined ? reader.len : reader.pos + length,
1599
+ message = new $root.Wa6.ClientPayload.DevicePairingRegistrationData();
1600
+ while (reader.pos < end) {
1601
+ var tag = reader.uint32();
1602
+ if (tag === error) break;
1603
+ switch (tag >>> 3) {
1604
+ case 1: {
1605
+ message.eRegid = reader.bytes();
1606
+ break;
1607
+ }
1608
+ case 2: {
1609
+ message.eKeytype = reader.bytes();
1610
+ break;
1611
+ }
1612
+ case 3: {
1613
+ message.eIdent = reader.bytes();
1614
+ break;
1615
+ }
1616
+ case 4: {
1617
+ message.eSkeyId = reader.bytes();
1618
+ break;
1619
+ }
1620
+ case 5: {
1621
+ message.eSkeyVal = reader.bytes();
1622
+ break;
1623
+ }
1624
+ case 6: {
1625
+ message.eSkeySig = reader.bytes();
1626
+ break;
1627
+ }
1628
+ case 7: {
1629
+ message.buildHash = reader.bytes();
1630
+ break;
1631
+ }
1632
+ case 8: {
1633
+ message.deviceProps = reader.bytes();
1634
+ break;
1635
+ }
1636
+ default:
1637
+ reader.skipType(tag & 7);
1638
+ break;
1639
+ }
1640
+ }
1641
+ return message;
1642
+ };
1643
+ DevicePairingRegistrationData.decodeDelimited = function decodeDelimited(reader) {
1644
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1645
+ return this.decode(reader, reader.uint32());
1646
+ };
1647
+ DevicePairingRegistrationData.verify = function verify(message) {
1648
+ if (typeof message !== "object" || message === null) return "object expected";
1649
+ var properties = {};
1650
+ if (message.eRegid != null && message.hasOwnProperty("eRegid")) {
1651
+ properties._eRegid = 1;
1652
+ if (
1653
+ !(
1654
+ (message.eRegid && typeof message.eRegid.length === "number") ||
1655
+ $util.isString(message.eRegid)
1656
+ )
1657
+ )
1658
+ return "eRegid: buffer expected";
1659
+ }
1660
+ if (message.eKeytype != null && message.hasOwnProperty("eKeytype")) {
1661
+ properties._eKeytype = 1;
1662
+ if (
1663
+ !(
1664
+ (message.eKeytype && typeof message.eKeytype.length === "number") ||
1665
+ $util.isString(message.eKeytype)
1666
+ )
1667
+ )
1668
+ return "eKeytype: buffer expected";
1669
+ }
1670
+ if (message.eIdent != null && message.hasOwnProperty("eIdent")) {
1671
+ properties._eIdent = 1;
1672
+ if (
1673
+ !(
1674
+ (message.eIdent && typeof message.eIdent.length === "number") ||
1675
+ $util.isString(message.eIdent)
1676
+ )
1677
+ )
1678
+ return "eIdent: buffer expected";
1679
+ }
1680
+ if (message.eSkeyId != null && message.hasOwnProperty("eSkeyId")) {
1681
+ properties._eSkeyId = 1;
1682
+ if (
1683
+ !(
1684
+ (message.eSkeyId && typeof message.eSkeyId.length === "number") ||
1685
+ $util.isString(message.eSkeyId)
1686
+ )
1687
+ )
1688
+ return "eSkeyId: buffer expected";
1689
+ }
1690
+ if (message.eSkeyVal != null && message.hasOwnProperty("eSkeyVal")) {
1691
+ properties._eSkeyVal = 1;
1692
+ if (
1693
+ !(
1694
+ (message.eSkeyVal && typeof message.eSkeyVal.length === "number") ||
1695
+ $util.isString(message.eSkeyVal)
1696
+ )
1697
+ )
1698
+ return "eSkeyVal: buffer expected";
1699
+ }
1700
+ if (message.eSkeySig != null && message.hasOwnProperty("eSkeySig")) {
1701
+ properties._eSkeySig = 1;
1702
+ if (
1703
+ !(
1704
+ (message.eSkeySig && typeof message.eSkeySig.length === "number") ||
1705
+ $util.isString(message.eSkeySig)
1706
+ )
1707
+ )
1708
+ return "eSkeySig: buffer expected";
1709
+ }
1710
+ if (message.buildHash != null && message.hasOwnProperty("buildHash")) {
1711
+ properties._buildHash = 1;
1712
+ if (
1713
+ !(
1714
+ (message.buildHash && typeof message.buildHash.length === "number") ||
1715
+ $util.isString(message.buildHash)
1716
+ )
1717
+ )
1718
+ return "buildHash: buffer expected";
1719
+ }
1720
+ if (message.deviceProps != null && message.hasOwnProperty("deviceProps")) {
1721
+ properties._deviceProps = 1;
1722
+ if (
1723
+ !(
1724
+ (message.deviceProps &&
1725
+ typeof message.deviceProps.length === "number") ||
1726
+ $util.isString(message.deviceProps)
1727
+ )
1728
+ )
1729
+ return "deviceProps: buffer expected";
1730
+ }
1731
+ return null;
1732
+ };
1733
+ DevicePairingRegistrationData.fromObject = function fromObject(object) {
1734
+ if (object instanceof $root.Wa6.ClientPayload.DevicePairingRegistrationData)
1735
+ return object;
1736
+ var message = new $root.Wa6.ClientPayload.DevicePairingRegistrationData();
1737
+ if (object.eRegid != null)
1738
+ if (typeof object.eRegid === "string")
1739
+ $util.base64.decode(
1740
+ object.eRegid,
1741
+ (message.eRegid = $util.newBuffer($util.base64.length(object.eRegid))),
1742
+ 0
1743
+ );
1744
+ else if (object.eRegid.length >= 0) message.eRegid = object.eRegid;
1745
+ if (object.eKeytype != null)
1746
+ if (typeof object.eKeytype === "string")
1747
+ $util.base64.decode(
1748
+ object.eKeytype,
1749
+ (message.eKeytype = $util.newBuffer(
1750
+ $util.base64.length(object.eKeytype)
1751
+ )),
1752
+ 0
1753
+ );
1754
+ else if (object.eKeytype.length >= 0) message.eKeytype = object.eKeytype;
1755
+ if (object.eIdent != null)
1756
+ if (typeof object.eIdent === "string")
1757
+ $util.base64.decode(
1758
+ object.eIdent,
1759
+ (message.eIdent = $util.newBuffer($util.base64.length(object.eIdent))),
1760
+ 0
1761
+ );
1762
+ else if (object.eIdent.length >= 0) message.eIdent = object.eIdent;
1763
+ if (object.eSkeyId != null)
1764
+ if (typeof object.eSkeyId === "string")
1765
+ $util.base64.decode(
1766
+ object.eSkeyId,
1767
+ (message.eSkeyId = $util.newBuffer(
1768
+ $util.base64.length(object.eSkeyId)
1769
+ )),
1770
+ 0
1771
+ );
1772
+ else if (object.eSkeyId.length >= 0) message.eSkeyId = object.eSkeyId;
1773
+ if (object.eSkeyVal != null)
1774
+ if (typeof object.eSkeyVal === "string")
1775
+ $util.base64.decode(
1776
+ object.eSkeyVal,
1777
+ (message.eSkeyVal = $util.newBuffer(
1778
+ $util.base64.length(object.eSkeyVal)
1779
+ )),
1780
+ 0
1781
+ );
1782
+ else if (object.eSkeyVal.length >= 0) message.eSkeyVal = object.eSkeyVal;
1783
+ if (object.eSkeySig != null)
1784
+ if (typeof object.eSkeySig === "string")
1785
+ $util.base64.decode(
1786
+ object.eSkeySig,
1787
+ (message.eSkeySig = $util.newBuffer(
1788
+ $util.base64.length(object.eSkeySig)
1789
+ )),
1790
+ 0
1791
+ );
1792
+ else if (object.eSkeySig.length >= 0) message.eSkeySig = object.eSkeySig;
1793
+ if (object.buildHash != null)
1794
+ if (typeof object.buildHash === "string")
1795
+ $util.base64.decode(
1796
+ object.buildHash,
1797
+ (message.buildHash = $util.newBuffer(
1798
+ $util.base64.length(object.buildHash)
1799
+ )),
1800
+ 0
1801
+ );
1802
+ else if (object.buildHash.length >= 0) message.buildHash = object.buildHash;
1803
+ if (object.deviceProps != null)
1804
+ if (typeof object.deviceProps === "string")
1805
+ $util.base64.decode(
1806
+ object.deviceProps,
1807
+ (message.deviceProps = $util.newBuffer(
1808
+ $util.base64.length(object.deviceProps)
1809
+ )),
1810
+ 0
1811
+ );
1812
+ else if (object.deviceProps.length >= 0)
1813
+ message.deviceProps = object.deviceProps;
1814
+ return message;
1815
+ };
1816
+ DevicePairingRegistrationData.toObject = function toObject(message, options) {
1817
+ if (!options) options = {};
1818
+ var object = {};
1819
+ if (message.eRegid != null && message.hasOwnProperty("eRegid")) {
1820
+ object.eRegid =
1821
+ options.bytes === String
1822
+ ? $util.base64.encode(message.eRegid, 0, message.eRegid.length)
1823
+ : options.bytes === Array
1824
+ ? Array.prototype.slice.call(message.eRegid)
1825
+ : message.eRegid;
1826
+ if (options.oneofs) object._eRegid = "eRegid";
1827
+ }
1828
+ if (message.eKeytype != null && message.hasOwnProperty("eKeytype")) {
1829
+ object.eKeytype =
1830
+ options.bytes === String
1831
+ ? $util.base64.encode(message.eKeytype, 0, message.eKeytype.length)
1832
+ : options.bytes === Array
1833
+ ? Array.prototype.slice.call(message.eKeytype)
1834
+ : message.eKeytype;
1835
+ if (options.oneofs) object._eKeytype = "eKeytype";
1836
+ }
1837
+ if (message.eIdent != null && message.hasOwnProperty("eIdent")) {
1838
+ object.eIdent =
1839
+ options.bytes === String
1840
+ ? $util.base64.encode(message.eIdent, 0, message.eIdent.length)
1841
+ : options.bytes === Array
1842
+ ? Array.prototype.slice.call(message.eIdent)
1843
+ : message.eIdent;
1844
+ if (options.oneofs) object._eIdent = "eIdent";
1845
+ }
1846
+ if (message.eSkeyId != null && message.hasOwnProperty("eSkeyId")) {
1847
+ object.eSkeyId =
1848
+ options.bytes === String
1849
+ ? $util.base64.encode(message.eSkeyId, 0, message.eSkeyId.length)
1850
+ : options.bytes === Array
1851
+ ? Array.prototype.slice.call(message.eSkeyId)
1852
+ : message.eSkeyId;
1853
+ if (options.oneofs) object._eSkeyId = "eSkeyId";
1854
+ }
1855
+ if (message.eSkeyVal != null && message.hasOwnProperty("eSkeyVal")) {
1856
+ object.eSkeyVal =
1857
+ options.bytes === String
1858
+ ? $util.base64.encode(message.eSkeyVal, 0, message.eSkeyVal.length)
1859
+ : options.bytes === Array
1860
+ ? Array.prototype.slice.call(message.eSkeyVal)
1861
+ : message.eSkeyVal;
1862
+ if (options.oneofs) object._eSkeyVal = "eSkeyVal";
1863
+ }
1864
+ if (message.eSkeySig != null && message.hasOwnProperty("eSkeySig")) {
1865
+ object.eSkeySig =
1866
+ options.bytes === String
1867
+ ? $util.base64.encode(message.eSkeySig, 0, message.eSkeySig.length)
1868
+ : options.bytes === Array
1869
+ ? Array.prototype.slice.call(message.eSkeySig)
1870
+ : message.eSkeySig;
1871
+ if (options.oneofs) object._eSkeySig = "eSkeySig";
1872
+ }
1873
+ if (message.buildHash != null && message.hasOwnProperty("buildHash")) {
1874
+ object.buildHash =
1875
+ options.bytes === String
1876
+ ? $util.base64.encode(message.buildHash, 0, message.buildHash.length)
1877
+ : options.bytes === Array
1878
+ ? Array.prototype.slice.call(message.buildHash)
1879
+ : message.buildHash;
1880
+ if (options.oneofs) object._buildHash = "buildHash";
1881
+ }
1882
+ if (message.deviceProps != null && message.hasOwnProperty("deviceProps")) {
1883
+ object.deviceProps =
1884
+ options.bytes === String
1885
+ ? $util.base64.encode(
1886
+ message.deviceProps,
1887
+ 0,
1888
+ message.deviceProps.length
1889
+ )
1890
+ : options.bytes === Array
1891
+ ? Array.prototype.slice.call(message.deviceProps)
1892
+ : message.deviceProps;
1893
+ if (options.oneofs) object._deviceProps = "deviceProps";
1894
+ }
1895
+ return object;
1896
+ };
1897
+ DevicePairingRegistrationData.prototype.toJSON = function toJSON() {
1898
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1899
+ };
1900
+ DevicePairingRegistrationData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1901
+ if (typeUrlPrefix === undefined) {
1902
+ typeUrlPrefix = "type.googleapis.com";
1903
+ }
1904
+ return typeUrlPrefix + "/Wa6.ClientPayload.DevicePairingRegistrationData";
1905
+ };
1906
+ return DevicePairingRegistrationData;
1907
+ })();
1908
+ ClientPayload.IOSAppExtension = (function () {
1909
+ var valuesById = {},
1910
+ values = Object.create(valuesById);
1911
+ values[(valuesById[0] = "SHARE_EXTENSION")] = 0;
1912
+ values[(valuesById[1] = "SERVICE_EXTENSION")] = 1;
1913
+ values[(valuesById[2] = "INTENTS_EXTENSION")] = 2;
1914
+ return values;
1915
+ })();
1916
+ ClientPayload.InteropData = (function () {
1917
+ function InteropData(properties) {
1918
+ if (properties)
1919
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1920
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
1921
+ }
1922
+ InteropData.prototype.accountId = null;
1923
+ InteropData.prototype.token = null;
1924
+ InteropData.prototype.enableReadReceipts = null;
1925
+ var $oneOfFields;
1926
+ Object.defineProperty(InteropData.prototype, "_accountId", {
1927
+ get: $util.oneOfGetter(($oneOfFields = ["accountId"])),
1928
+ set: $util.oneOfSetter($oneOfFields),
1929
+ });
1930
+ Object.defineProperty(InteropData.prototype, "_token", {
1931
+ get: $util.oneOfGetter(($oneOfFields = ["token"])),
1932
+ set: $util.oneOfSetter($oneOfFields),
1933
+ });
1934
+ Object.defineProperty(InteropData.prototype, "_enableReadReceipts", {
1935
+ get: $util.oneOfGetter(($oneOfFields = ["enableReadReceipts"])),
1936
+ set: $util.oneOfSetter($oneOfFields),
1937
+ });
1938
+ InteropData.create = function create(properties) {
1939
+ return new InteropData(properties);
1940
+ };
1941
+ InteropData.encode = function encode(message, writer) {
1942
+ if (!writer) writer = $Writer.create();
1943
+ if (message.accountId != null && Object.hasOwnProperty.call(message, "accountId"))
1944
+ writer.uint32(8).uint64(message.accountId);
1945
+ if (message.token != null && Object.hasOwnProperty.call(message, "token"))
1946
+ writer.uint32(18).bytes(message.token);
1947
+ if (
1948
+ message.enableReadReceipts != null &&
1949
+ Object.hasOwnProperty.call(message, "enableReadReceipts")
1950
+ )
1951
+ writer.uint32(24).bool(message.enableReadReceipts);
1952
+ return writer;
1953
+ };
1954
+ InteropData.encodeDelimited = function encodeDelimited(message, writer) {
1955
+ return this.encode(message, writer).ldelim();
1956
+ };
1957
+ InteropData.decode = function decode(reader, length, error) {
1958
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
1959
+ var end = length === undefined ? reader.len : reader.pos + length,
1960
+ message = new $root.Wa6.ClientPayload.InteropData();
1961
+ while (reader.pos < end) {
1962
+ var tag = reader.uint32();
1963
+ if (tag === error) break;
1964
+ switch (tag >>> 3) {
1965
+ case 1: {
1966
+ message.accountId = reader.uint64();
1967
+ break;
1968
+ }
1969
+ case 2: {
1970
+ message.token = reader.bytes();
1971
+ break;
1972
+ }
1973
+ case 3: {
1974
+ message.enableReadReceipts = reader.bool();
1975
+ break;
1976
+ }
1977
+ default:
1978
+ reader.skipType(tag & 7);
1979
+ break;
1980
+ }
1981
+ }
1982
+ return message;
1983
+ };
1984
+ InteropData.decodeDelimited = function decodeDelimited(reader) {
1985
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1986
+ return this.decode(reader, reader.uint32());
1987
+ };
1988
+ InteropData.verify = function verify(message) {
1989
+ if (typeof message !== "object" || message === null) return "object expected";
1990
+ var properties = {};
1991
+ if (message.accountId != null && message.hasOwnProperty("accountId")) {
1992
+ properties._accountId = 1;
1993
+ if (
1994
+ !$util.isInteger(message.accountId) &&
1995
+ !(
1996
+ message.accountId &&
1997
+ $util.isInteger(message.accountId.low) &&
1998
+ $util.isInteger(message.accountId.high)
1999
+ )
2000
+ )
2001
+ return "accountId: integer|Long expected";
2002
+ }
2003
+ if (message.token != null && message.hasOwnProperty("token")) {
2004
+ properties._token = 1;
2005
+ if (
2006
+ !(
2007
+ (message.token && typeof message.token.length === "number") ||
2008
+ $util.isString(message.token)
2009
+ )
2010
+ )
2011
+ return "token: buffer expected";
2012
+ }
2013
+ if (
2014
+ message.enableReadReceipts != null &&
2015
+ message.hasOwnProperty("enableReadReceipts")
2016
+ ) {
2017
+ properties._enableReadReceipts = 1;
2018
+ if (typeof message.enableReadReceipts !== "boolean")
2019
+ return "enableReadReceipts: boolean expected";
2020
+ }
2021
+ return null;
2022
+ };
2023
+ InteropData.fromObject = function fromObject(object) {
2024
+ if (object instanceof $root.Wa6.ClientPayload.InteropData) return object;
2025
+ var message = new $root.Wa6.ClientPayload.InteropData();
2026
+ if (object.accountId != null)
2027
+ if ($util.Long)
2028
+ (message.accountId = $util.Long.fromValue(object.accountId)).unsigned =
2029
+ true;
2030
+ else if (typeof object.accountId === "string")
2031
+ message.accountId = parseInt(object.accountId, 10);
2032
+ else if (typeof object.accountId === "number")
2033
+ message.accountId = object.accountId;
2034
+ else if (typeof object.accountId === "object")
2035
+ message.accountId = new $util.LongBits(
2036
+ object.accountId.low >>> 0,
2037
+ object.accountId.high >>> 0
2038
+ ).toNumber(true);
2039
+ if (object.token != null)
2040
+ if (typeof object.token === "string")
2041
+ $util.base64.decode(
2042
+ object.token,
2043
+ (message.token = $util.newBuffer($util.base64.length(object.token))),
2044
+ 0
2045
+ );
2046
+ else if (object.token.length >= 0) message.token = object.token;
2047
+ if (object.enableReadReceipts != null)
2048
+ message.enableReadReceipts = Boolean(object.enableReadReceipts);
2049
+ return message;
2050
+ };
2051
+ InteropData.toObject = function toObject(message, options) {
2052
+ if (!options) options = {};
2053
+ var object = {};
2054
+ if (message.accountId != null && message.hasOwnProperty("accountId")) {
2055
+ if (typeof message.accountId === "number")
2056
+ object.accountId =
2057
+ options.longs === String
2058
+ ? String(message.accountId)
2059
+ : message.accountId;
2060
+ else
2061
+ object.accountId =
2062
+ options.longs === String
2063
+ ? $util.Long.prototype.toString.call(message.accountId)
2064
+ : options.longs === Number
2065
+ ? new $util.LongBits(
2066
+ message.accountId.low >>> 0,
2067
+ message.accountId.high >>> 0
2068
+ ).toNumber(true)
2069
+ : message.accountId;
2070
+ if (options.oneofs) object._accountId = "accountId";
2071
+ }
2072
+ if (message.token != null && message.hasOwnProperty("token")) {
2073
+ object.token =
2074
+ options.bytes === String
2075
+ ? $util.base64.encode(message.token, 0, message.token.length)
2076
+ : options.bytes === Array
2077
+ ? Array.prototype.slice.call(message.token)
2078
+ : message.token;
2079
+ if (options.oneofs) object._token = "token";
2080
+ }
2081
+ if (
2082
+ message.enableReadReceipts != null &&
2083
+ message.hasOwnProperty("enableReadReceipts")
2084
+ ) {
2085
+ object.enableReadReceipts = message.enableReadReceipts;
2086
+ if (options.oneofs) object._enableReadReceipts = "enableReadReceipts";
2087
+ }
2088
+ return object;
2089
+ };
2090
+ InteropData.prototype.toJSON = function toJSON() {
2091
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2092
+ };
2093
+ InteropData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2094
+ if (typeUrlPrefix === undefined) {
2095
+ typeUrlPrefix = "type.googleapis.com";
2096
+ }
2097
+ return typeUrlPrefix + "/Wa6.ClientPayload.InteropData";
2098
+ };
2099
+ return InteropData;
2100
+ })();
2101
+ ClientPayload.Product = (function () {
2102
+ var valuesById = {},
2103
+ values = Object.create(valuesById);
2104
+ values[(valuesById[0] = "WHATSAPP")] = 0;
2105
+ values[(valuesById[1] = "MESSENGER")] = 1;
2106
+ values[(valuesById[2] = "INTEROP")] = 2;
2107
+ values[(valuesById[3] = "INTEROP_MSGR")] = 3;
2108
+ values[(valuesById[4] = "WHATSAPP_LID")] = 4;
2109
+ return values;
2110
+ })();
2111
+ ClientPayload.TrafficAnonymization = (function () {
2112
+ var valuesById = {},
2113
+ values = Object.create(valuesById);
2114
+ values[(valuesById[0] = "OFF")] = 0;
2115
+ values[(valuesById[1] = "STANDARD")] = 1;
2116
+ return values;
2117
+ })();
2118
+ ClientPayload.UserAgent = (function () {
2119
+ function UserAgent(properties) {
2120
+ if (properties)
2121
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2122
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
2123
+ }
2124
+ UserAgent.prototype.platform = null;
2125
+ UserAgent.prototype.appVersion = null;
2126
+ UserAgent.prototype.mcc = null;
2127
+ UserAgent.prototype.mnc = null;
2128
+ UserAgent.prototype.osVersion = null;
2129
+ UserAgent.prototype.manufacturer = null;
2130
+ UserAgent.prototype.device = null;
2131
+ UserAgent.prototype.osBuildNumber = null;
2132
+ UserAgent.prototype.phoneId = null;
2133
+ UserAgent.prototype.releaseChannel = null;
2134
+ UserAgent.prototype.localeLanguageIso6391 = null;
2135
+ UserAgent.prototype.localeCountryIso31661Alpha2 = null;
2136
+ UserAgent.prototype.deviceBoard = null;
2137
+ UserAgent.prototype.deviceExpId = null;
2138
+ UserAgent.prototype.deviceType = null;
2139
+ UserAgent.prototype.deviceModelType = null;
2140
+ var $oneOfFields;
2141
+ Object.defineProperty(UserAgent.prototype, "_platform", {
2142
+ get: $util.oneOfGetter(($oneOfFields = ["platform"])),
2143
+ set: $util.oneOfSetter($oneOfFields),
2144
+ });
2145
+ Object.defineProperty(UserAgent.prototype, "_appVersion", {
2146
+ get: $util.oneOfGetter(($oneOfFields = ["appVersion"])),
2147
+ set: $util.oneOfSetter($oneOfFields),
2148
+ });
2149
+ Object.defineProperty(UserAgent.prototype, "_mcc", {
2150
+ get: $util.oneOfGetter(($oneOfFields = ["mcc"])),
2151
+ set: $util.oneOfSetter($oneOfFields),
2152
+ });
2153
+ Object.defineProperty(UserAgent.prototype, "_mnc", {
2154
+ get: $util.oneOfGetter(($oneOfFields = ["mnc"])),
2155
+ set: $util.oneOfSetter($oneOfFields),
2156
+ });
2157
+ Object.defineProperty(UserAgent.prototype, "_osVersion", {
2158
+ get: $util.oneOfGetter(($oneOfFields = ["osVersion"])),
2159
+ set: $util.oneOfSetter($oneOfFields),
2160
+ });
2161
+ Object.defineProperty(UserAgent.prototype, "_manufacturer", {
2162
+ get: $util.oneOfGetter(($oneOfFields = ["manufacturer"])),
2163
+ set: $util.oneOfSetter($oneOfFields),
2164
+ });
2165
+ Object.defineProperty(UserAgent.prototype, "_device", {
2166
+ get: $util.oneOfGetter(($oneOfFields = ["device"])),
2167
+ set: $util.oneOfSetter($oneOfFields),
2168
+ });
2169
+ Object.defineProperty(UserAgent.prototype, "_osBuildNumber", {
2170
+ get: $util.oneOfGetter(($oneOfFields = ["osBuildNumber"])),
2171
+ set: $util.oneOfSetter($oneOfFields),
2172
+ });
2173
+ Object.defineProperty(UserAgent.prototype, "_phoneId", {
2174
+ get: $util.oneOfGetter(($oneOfFields = ["phoneId"])),
2175
+ set: $util.oneOfSetter($oneOfFields),
2176
+ });
2177
+ Object.defineProperty(UserAgent.prototype, "_releaseChannel", {
2178
+ get: $util.oneOfGetter(($oneOfFields = ["releaseChannel"])),
2179
+ set: $util.oneOfSetter($oneOfFields),
2180
+ });
2181
+ Object.defineProperty(UserAgent.prototype, "_localeLanguageIso6391", {
2182
+ get: $util.oneOfGetter(($oneOfFields = ["localeLanguageIso6391"])),
2183
+ set: $util.oneOfSetter($oneOfFields),
2184
+ });
2185
+ Object.defineProperty(UserAgent.prototype, "_localeCountryIso31661Alpha2", {
2186
+ get: $util.oneOfGetter(($oneOfFields = ["localeCountryIso31661Alpha2"])),
2187
+ set: $util.oneOfSetter($oneOfFields),
2188
+ });
2189
+ Object.defineProperty(UserAgent.prototype, "_deviceBoard", {
2190
+ get: $util.oneOfGetter(($oneOfFields = ["deviceBoard"])),
2191
+ set: $util.oneOfSetter($oneOfFields),
2192
+ });
2193
+ Object.defineProperty(UserAgent.prototype, "_deviceExpId", {
2194
+ get: $util.oneOfGetter(($oneOfFields = ["deviceExpId"])),
2195
+ set: $util.oneOfSetter($oneOfFields),
2196
+ });
2197
+ Object.defineProperty(UserAgent.prototype, "_deviceType", {
2198
+ get: $util.oneOfGetter(($oneOfFields = ["deviceType"])),
2199
+ set: $util.oneOfSetter($oneOfFields),
2200
+ });
2201
+ Object.defineProperty(UserAgent.prototype, "_deviceModelType", {
2202
+ get: $util.oneOfGetter(($oneOfFields = ["deviceModelType"])),
2203
+ set: $util.oneOfSetter($oneOfFields),
2204
+ });
2205
+ UserAgent.create = function create(properties) {
2206
+ return new UserAgent(properties);
2207
+ };
2208
+ UserAgent.encode = function encode(message, writer) {
2209
+ if (!writer) writer = $Writer.create();
2210
+ if (message.platform != null && Object.hasOwnProperty.call(message, "platform"))
2211
+ writer.uint32(8).int32(message.platform);
2212
+ if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion"))
2213
+ $root.Wa6.ClientPayload.UserAgent.AppVersion.encode(
2214
+ message.appVersion,
2215
+ writer.uint32(18).fork()
2216
+ ).ldelim();
2217
+ if (message.mcc != null && Object.hasOwnProperty.call(message, "mcc"))
2218
+ writer.uint32(26).string(message.mcc);
2219
+ if (message.mnc != null && Object.hasOwnProperty.call(message, "mnc"))
2220
+ writer.uint32(34).string(message.mnc);
2221
+ if (message.osVersion != null && Object.hasOwnProperty.call(message, "osVersion"))
2222
+ writer.uint32(42).string(message.osVersion);
2223
+ if (
2224
+ message.manufacturer != null &&
2225
+ Object.hasOwnProperty.call(message, "manufacturer")
2226
+ )
2227
+ writer.uint32(50).string(message.manufacturer);
2228
+ if (message.device != null && Object.hasOwnProperty.call(message, "device"))
2229
+ writer.uint32(58).string(message.device);
2230
+ if (
2231
+ message.osBuildNumber != null &&
2232
+ Object.hasOwnProperty.call(message, "osBuildNumber")
2233
+ )
2234
+ writer.uint32(66).string(message.osBuildNumber);
2235
+ if (message.phoneId != null && Object.hasOwnProperty.call(message, "phoneId"))
2236
+ writer.uint32(74).string(message.phoneId);
2237
+ if (
2238
+ message.releaseChannel != null &&
2239
+ Object.hasOwnProperty.call(message, "releaseChannel")
2240
+ )
2241
+ writer.uint32(80).int32(message.releaseChannel);
2242
+ if (
2243
+ message.localeLanguageIso6391 != null &&
2244
+ Object.hasOwnProperty.call(message, "localeLanguageIso6391")
2245
+ )
2246
+ writer.uint32(90).string(message.localeLanguageIso6391);
2247
+ if (
2248
+ message.localeCountryIso31661Alpha2 != null &&
2249
+ Object.hasOwnProperty.call(message, "localeCountryIso31661Alpha2")
2250
+ )
2251
+ writer.uint32(98).string(message.localeCountryIso31661Alpha2);
2252
+ if (
2253
+ message.deviceBoard != null &&
2254
+ Object.hasOwnProperty.call(message, "deviceBoard")
2255
+ )
2256
+ writer.uint32(106).string(message.deviceBoard);
2257
+ if (
2258
+ message.deviceExpId != null &&
2259
+ Object.hasOwnProperty.call(message, "deviceExpId")
2260
+ )
2261
+ writer.uint32(114).string(message.deviceExpId);
2262
+ if (message.deviceType != null && Object.hasOwnProperty.call(message, "deviceType"))
2263
+ writer.uint32(120).int32(message.deviceType);
2264
+ if (
2265
+ message.deviceModelType != null &&
2266
+ Object.hasOwnProperty.call(message, "deviceModelType")
2267
+ )
2268
+ writer.uint32(130).string(message.deviceModelType);
2269
+ return writer;
2270
+ };
2271
+ UserAgent.encodeDelimited = function encodeDelimited(message, writer) {
2272
+ return this.encode(message, writer).ldelim();
2273
+ };
2274
+ UserAgent.decode = function decode(reader, length, error) {
2275
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
2276
+ var end = length === undefined ? reader.len : reader.pos + length,
2277
+ message = new $root.Wa6.ClientPayload.UserAgent();
2278
+ while (reader.pos < end) {
2279
+ var tag = reader.uint32();
2280
+ if (tag === error) break;
2281
+ switch (tag >>> 3) {
2282
+ case 1: {
2283
+ message.platform = reader.int32();
2284
+ break;
2285
+ }
2286
+ case 2: {
2287
+ message.appVersion =
2288
+ $root.Wa6.ClientPayload.UserAgent.AppVersion.decode(
2289
+ reader,
2290
+ reader.uint32()
2291
+ );
2292
+ break;
2293
+ }
2294
+ case 3: {
2295
+ message.mcc = reader.string();
2296
+ break;
2297
+ }
2298
+ case 4: {
2299
+ message.mnc = reader.string();
2300
+ break;
2301
+ }
2302
+ case 5: {
2303
+ message.osVersion = reader.string();
2304
+ break;
2305
+ }
2306
+ case 6: {
2307
+ message.manufacturer = reader.string();
2308
+ break;
2309
+ }
2310
+ case 7: {
2311
+ message.device = reader.string();
2312
+ break;
2313
+ }
2314
+ case 8: {
2315
+ message.osBuildNumber = reader.string();
2316
+ break;
2317
+ }
2318
+ case 9: {
2319
+ message.phoneId = reader.string();
2320
+ break;
2321
+ }
2322
+ case 10: {
2323
+ message.releaseChannel = reader.int32();
2324
+ break;
2325
+ }
2326
+ case 11: {
2327
+ message.localeLanguageIso6391 = reader.string();
2328
+ break;
2329
+ }
2330
+ case 12: {
2331
+ message.localeCountryIso31661Alpha2 = reader.string();
2332
+ break;
2333
+ }
2334
+ case 13: {
2335
+ message.deviceBoard = reader.string();
2336
+ break;
2337
+ }
2338
+ case 14: {
2339
+ message.deviceExpId = reader.string();
2340
+ break;
2341
+ }
2342
+ case 15: {
2343
+ message.deviceType = reader.int32();
2344
+ break;
2345
+ }
2346
+ case 16: {
2347
+ message.deviceModelType = reader.string();
2348
+ break;
2349
+ }
2350
+ default:
2351
+ reader.skipType(tag & 7);
2352
+ break;
2353
+ }
2354
+ }
2355
+ return message;
2356
+ };
2357
+ UserAgent.decodeDelimited = function decodeDelimited(reader) {
2358
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
2359
+ return this.decode(reader, reader.uint32());
2360
+ };
2361
+ UserAgent.verify = function verify(message) {
2362
+ if (typeof message !== "object" || message === null) return "object expected";
2363
+ var properties = {};
2364
+ if (message.platform != null && message.hasOwnProperty("platform")) {
2365
+ properties._platform = 1;
2366
+ switch (message.platform) {
2367
+ default:
2368
+ return "platform: enum value expected";
2369
+ case 0:
2370
+ case 1:
2371
+ case 2:
2372
+ case 3:
2373
+ case 4:
2374
+ case 5:
2375
+ case 6:
2376
+ case 7:
2377
+ case 8:
2378
+ case 9:
2379
+ case 10:
2380
+ case 11:
2381
+ case 12:
2382
+ case 13:
2383
+ case 14:
2384
+ case 15:
2385
+ case 16:
2386
+ case 17:
2387
+ case 18:
2388
+ case 19:
2389
+ case 20:
2390
+ case 21:
2391
+ case 22:
2392
+ case 23:
2393
+ case 24:
2394
+ case 25:
2395
+ case 26:
2396
+ case 27:
2397
+ case 28:
2398
+ case 29:
2399
+ case 30:
2400
+ case 31:
2401
+ case 32:
2402
+ case 33:
2403
+ case 34:
2404
+ case 35:
2405
+ case 36:
2406
+ case 37:
2407
+ break;
2408
+ }
2409
+ }
2410
+ if (message.appVersion != null && message.hasOwnProperty("appVersion")) {
2411
+ properties._appVersion = 1;
2412
+ {
2413
+ var error = $root.Wa6.ClientPayload.UserAgent.AppVersion.verify(
2414
+ message.appVersion
2415
+ );
2416
+ if (error) return "appVersion." + error;
2417
+ }
2418
+ }
2419
+ if (message.mcc != null && message.hasOwnProperty("mcc")) {
2420
+ properties._mcc = 1;
2421
+ if (!$util.isString(message.mcc)) return "mcc: string expected";
2422
+ }
2423
+ if (message.mnc != null && message.hasOwnProperty("mnc")) {
2424
+ properties._mnc = 1;
2425
+ if (!$util.isString(message.mnc)) return "mnc: string expected";
2426
+ }
2427
+ if (message.osVersion != null && message.hasOwnProperty("osVersion")) {
2428
+ properties._osVersion = 1;
2429
+ if (!$util.isString(message.osVersion)) return "osVersion: string expected";
2430
+ }
2431
+ if (message.manufacturer != null && message.hasOwnProperty("manufacturer")) {
2432
+ properties._manufacturer = 1;
2433
+ if (!$util.isString(message.manufacturer))
2434
+ return "manufacturer: string expected";
2435
+ }
2436
+ if (message.device != null && message.hasOwnProperty("device")) {
2437
+ properties._device = 1;
2438
+ if (!$util.isString(message.device)) return "device: string expected";
2439
+ }
2440
+ if (message.osBuildNumber != null && message.hasOwnProperty("osBuildNumber")) {
2441
+ properties._osBuildNumber = 1;
2442
+ if (!$util.isString(message.osBuildNumber))
2443
+ return "osBuildNumber: string expected";
2444
+ }
2445
+ if (message.phoneId != null && message.hasOwnProperty("phoneId")) {
2446
+ properties._phoneId = 1;
2447
+ if (!$util.isString(message.phoneId)) return "phoneId: string expected";
2448
+ }
2449
+ if (message.releaseChannel != null && message.hasOwnProperty("releaseChannel")) {
2450
+ properties._releaseChannel = 1;
2451
+ switch (message.releaseChannel) {
2452
+ default:
2453
+ return "releaseChannel: enum value expected";
2454
+ case 0:
2455
+ case 1:
2456
+ case 2:
2457
+ case 3:
2458
+ break;
2459
+ }
2460
+ }
2461
+ if (
2462
+ message.localeLanguageIso6391 != null &&
2463
+ message.hasOwnProperty("localeLanguageIso6391")
2464
+ ) {
2465
+ properties._localeLanguageIso6391 = 1;
2466
+ if (!$util.isString(message.localeLanguageIso6391))
2467
+ return "localeLanguageIso6391: string expected";
2468
+ }
2469
+ if (
2470
+ message.localeCountryIso31661Alpha2 != null &&
2471
+ message.hasOwnProperty("localeCountryIso31661Alpha2")
2472
+ ) {
2473
+ properties._localeCountryIso31661Alpha2 = 1;
2474
+ if (!$util.isString(message.localeCountryIso31661Alpha2))
2475
+ return "localeCountryIso31661Alpha2: string expected";
2476
+ }
2477
+ if (message.deviceBoard != null && message.hasOwnProperty("deviceBoard")) {
2478
+ properties._deviceBoard = 1;
2479
+ if (!$util.isString(message.deviceBoard)) return "deviceBoard: string expected";
2480
+ }
2481
+ if (message.deviceExpId != null && message.hasOwnProperty("deviceExpId")) {
2482
+ properties._deviceExpId = 1;
2483
+ if (!$util.isString(message.deviceExpId)) return "deviceExpId: string expected";
2484
+ }
2485
+ if (message.deviceType != null && message.hasOwnProperty("deviceType")) {
2486
+ properties._deviceType = 1;
2487
+ switch (message.deviceType) {
2488
+ default:
2489
+ return "deviceType: enum value expected";
2490
+ case 0:
2491
+ case 1:
2492
+ case 2:
2493
+ case 3:
2494
+ case 4:
2495
+ break;
2496
+ }
2497
+ }
2498
+ if (message.deviceModelType != null && message.hasOwnProperty("deviceModelType")) {
2499
+ properties._deviceModelType = 1;
2500
+ if (!$util.isString(message.deviceModelType))
2501
+ return "deviceModelType: string expected";
2502
+ }
2503
+ return null;
2504
+ };
2505
+ UserAgent.fromObject = function fromObject(object) {
2506
+ if (object instanceof $root.Wa6.ClientPayload.UserAgent) return object;
2507
+ var message = new $root.Wa6.ClientPayload.UserAgent();
2508
+ switch (object.platform) {
2509
+ default:
2510
+ if (typeof object.platform === "number") {
2511
+ message.platform = object.platform;
2512
+ break;
2513
+ }
2514
+ break;
2515
+ case "ANDROID":
2516
+ case 0:
2517
+ message.platform = 0;
2518
+ break;
2519
+ case "IOS":
2520
+ case 1:
2521
+ message.platform = 1;
2522
+ break;
2523
+ case "WINDOWS_PHONE":
2524
+ case 2:
2525
+ message.platform = 2;
2526
+ break;
2527
+ case "BLACKBERRY":
2528
+ case 3:
2529
+ message.platform = 3;
2530
+ break;
2531
+ case "BLACKBERRYX":
2532
+ case 4:
2533
+ message.platform = 4;
2534
+ break;
2535
+ case "S40":
2536
+ case 5:
2537
+ message.platform = 5;
2538
+ break;
2539
+ case "S60":
2540
+ case 6:
2541
+ message.platform = 6;
2542
+ break;
2543
+ case "PYTHON_CLIENT":
2544
+ case 7:
2545
+ message.platform = 7;
2546
+ break;
2547
+ case "TIZEN":
2548
+ case 8:
2549
+ message.platform = 8;
2550
+ break;
2551
+ case "ENTERPRISE":
2552
+ case 9:
2553
+ message.platform = 9;
2554
+ break;
2555
+ case "SMB_ANDROID":
2556
+ case 10:
2557
+ message.platform = 10;
2558
+ break;
2559
+ case "KAIOS":
2560
+ case 11:
2561
+ message.platform = 11;
2562
+ break;
2563
+ case "SMB_IOS":
2564
+ case 12:
2565
+ message.platform = 12;
2566
+ break;
2567
+ case "WINDOWS":
2568
+ case 13:
2569
+ message.platform = 13;
2570
+ break;
2571
+ case "WEB":
2572
+ case 14:
2573
+ message.platform = 14;
2574
+ break;
2575
+ case "PORTAL":
2576
+ case 15:
2577
+ message.platform = 15;
2578
+ break;
2579
+ case "GREEN_ANDROID":
2580
+ case 16:
2581
+ message.platform = 16;
2582
+ break;
2583
+ case "GREEN_IPHONE":
2584
+ case 17:
2585
+ message.platform = 17;
2586
+ break;
2587
+ case "BLUE_ANDROID":
2588
+ case 18:
2589
+ message.platform = 18;
2590
+ break;
2591
+ case "BLUE_IPHONE":
2592
+ case 19:
2593
+ message.platform = 19;
2594
+ break;
2595
+ case "FBLITE_ANDROID":
2596
+ case 20:
2597
+ message.platform = 20;
2598
+ break;
2599
+ case "MLITE_ANDROID":
2600
+ case 21:
2601
+ message.platform = 21;
2602
+ break;
2603
+ case "IGLITE_ANDROID":
2604
+ case 22:
2605
+ message.platform = 22;
2606
+ break;
2607
+ case "PAGE":
2608
+ case 23:
2609
+ message.platform = 23;
2610
+ break;
2611
+ case "MACOS":
2612
+ case 24:
2613
+ message.platform = 24;
2614
+ break;
2615
+ case "OCULUS_MSG":
2616
+ case 25:
2617
+ message.platform = 25;
2618
+ break;
2619
+ case "OCULUS_CALL":
2620
+ case 26:
2621
+ message.platform = 26;
2622
+ break;
2623
+ case "MILAN":
2624
+ case 27:
2625
+ message.platform = 27;
2626
+ break;
2627
+ case "CAPI":
2628
+ case 28:
2629
+ message.platform = 28;
2630
+ break;
2631
+ case "WEAROS":
2632
+ case 29:
2633
+ message.platform = 29;
2634
+ break;
2635
+ case "ARDEVICE":
2636
+ case 30:
2637
+ message.platform = 30;
2638
+ break;
2639
+ case "VRDEVICE":
2640
+ case 31:
2641
+ message.platform = 31;
2642
+ break;
2643
+ case "BLUE_WEB":
2644
+ case 32:
2645
+ message.platform = 32;
2646
+ break;
2647
+ case "IPAD":
2648
+ case 33:
2649
+ message.platform = 33;
2650
+ break;
2651
+ case "TEST":
2652
+ case 34:
2653
+ message.platform = 34;
2654
+ break;
2655
+ case "SMART_GLASSES":
2656
+ case 35:
2657
+ message.platform = 35;
2658
+ break;
2659
+ case "BLUE_VR":
2660
+ case 36:
2661
+ message.platform = 36;
2662
+ break;
2663
+ case "AR_WRIST":
2664
+ case 37:
2665
+ message.platform = 37;
2666
+ break;
2667
+ }
2668
+ if (object.appVersion != null) {
2669
+ if (typeof object.appVersion !== "object")
2670
+ throw TypeError(".Wa6.ClientPayload.UserAgent.appVersion: object expected");
2671
+ message.appVersion = $root.Wa6.ClientPayload.UserAgent.AppVersion.fromObject(
2672
+ object.appVersion
2673
+ );
2674
+ }
2675
+ if (object.mcc != null) message.mcc = String(object.mcc);
2676
+ if (object.mnc != null) message.mnc = String(object.mnc);
2677
+ if (object.osVersion != null) message.osVersion = String(object.osVersion);
2678
+ if (object.manufacturer != null) message.manufacturer = String(object.manufacturer);
2679
+ if (object.device != null) message.device = String(object.device);
2680
+ if (object.osBuildNumber != null)
2681
+ message.osBuildNumber = String(object.osBuildNumber);
2682
+ if (object.phoneId != null) message.phoneId = String(object.phoneId);
2683
+ switch (object.releaseChannel) {
2684
+ default:
2685
+ if (typeof object.releaseChannel === "number") {
2686
+ message.releaseChannel = object.releaseChannel;
2687
+ break;
2688
+ }
2689
+ break;
2690
+ case "RELEASE":
2691
+ case 0:
2692
+ message.releaseChannel = 0;
2693
+ break;
2694
+ case "BETA":
2695
+ case 1:
2696
+ message.releaseChannel = 1;
2697
+ break;
2698
+ case "ALPHA":
2699
+ case 2:
2700
+ message.releaseChannel = 2;
2701
+ break;
2702
+ case "DEBUG":
2703
+ case 3:
2704
+ message.releaseChannel = 3;
2705
+ break;
2706
+ }
2707
+ if (object.localeLanguageIso6391 != null)
2708
+ message.localeLanguageIso6391 = String(object.localeLanguageIso6391);
2709
+ if (object.localeCountryIso31661Alpha2 != null)
2710
+ message.localeCountryIso31661Alpha2 = String(
2711
+ object.localeCountryIso31661Alpha2
2712
+ );
2713
+ if (object.deviceBoard != null) message.deviceBoard = String(object.deviceBoard);
2714
+ if (object.deviceExpId != null) message.deviceExpId = String(object.deviceExpId);
2715
+ switch (object.deviceType) {
2716
+ default:
2717
+ if (typeof object.deviceType === "number") {
2718
+ message.deviceType = object.deviceType;
2719
+ break;
2720
+ }
2721
+ break;
2722
+ case "PHONE":
2723
+ case 0:
2724
+ message.deviceType = 0;
2725
+ break;
2726
+ case "TABLET":
2727
+ case 1:
2728
+ message.deviceType = 1;
2729
+ break;
2730
+ case "DESKTOP":
2731
+ case 2:
2732
+ message.deviceType = 2;
2733
+ break;
2734
+ case "WEARABLE":
2735
+ case 3:
2736
+ message.deviceType = 3;
2737
+ break;
2738
+ case "VR":
2739
+ case 4:
2740
+ message.deviceType = 4;
2741
+ break;
2742
+ }
2743
+ if (object.deviceModelType != null)
2744
+ message.deviceModelType = String(object.deviceModelType);
2745
+ return message;
2746
+ };
2747
+ UserAgent.toObject = function toObject(message, options) {
2748
+ if (!options) options = {};
2749
+ var object = {};
2750
+ if (message.platform != null && message.hasOwnProperty("platform")) {
2751
+ object.platform =
2752
+ options.enums === String
2753
+ ? $root.Wa6.ClientPayload.UserAgent.Platform[message.platform] ===
2754
+ undefined
2755
+ ? message.platform
2756
+ : $root.Wa6.ClientPayload.UserAgent.Platform[message.platform]
2757
+ : message.platform;
2758
+ if (options.oneofs) object._platform = "platform";
2759
+ }
2760
+ if (message.appVersion != null && message.hasOwnProperty("appVersion")) {
2761
+ object.appVersion = $root.Wa6.ClientPayload.UserAgent.AppVersion.toObject(
2762
+ message.appVersion,
2763
+ options
2764
+ );
2765
+ if (options.oneofs) object._appVersion = "appVersion";
2766
+ }
2767
+ if (message.mcc != null && message.hasOwnProperty("mcc")) {
2768
+ object.mcc = message.mcc;
2769
+ if (options.oneofs) object._mcc = "mcc";
2770
+ }
2771
+ if (message.mnc != null && message.hasOwnProperty("mnc")) {
2772
+ object.mnc = message.mnc;
2773
+ if (options.oneofs) object._mnc = "mnc";
2774
+ }
2775
+ if (message.osVersion != null && message.hasOwnProperty("osVersion")) {
2776
+ object.osVersion = message.osVersion;
2777
+ if (options.oneofs) object._osVersion = "osVersion";
2778
+ }
2779
+ if (message.manufacturer != null && message.hasOwnProperty("manufacturer")) {
2780
+ object.manufacturer = message.manufacturer;
2781
+ if (options.oneofs) object._manufacturer = "manufacturer";
2782
+ }
2783
+ if (message.device != null && message.hasOwnProperty("device")) {
2784
+ object.device = message.device;
2785
+ if (options.oneofs) object._device = "device";
2786
+ }
2787
+ if (message.osBuildNumber != null && message.hasOwnProperty("osBuildNumber")) {
2788
+ object.osBuildNumber = message.osBuildNumber;
2789
+ if (options.oneofs) object._osBuildNumber = "osBuildNumber";
2790
+ }
2791
+ if (message.phoneId != null && message.hasOwnProperty("phoneId")) {
2792
+ object.phoneId = message.phoneId;
2793
+ if (options.oneofs) object._phoneId = "phoneId";
2794
+ }
2795
+ if (message.releaseChannel != null && message.hasOwnProperty("releaseChannel")) {
2796
+ object.releaseChannel =
2797
+ options.enums === String
2798
+ ? $root.Wa6.ClientPayload.UserAgent.ReleaseChannel[
2799
+ message.releaseChannel
2800
+ ] === undefined
2801
+ ? message.releaseChannel
2802
+ : $root.Wa6.ClientPayload.UserAgent.ReleaseChannel[
2803
+ message.releaseChannel
2804
+ ]
2805
+ : message.releaseChannel;
2806
+ if (options.oneofs) object._releaseChannel = "releaseChannel";
2807
+ }
2808
+ if (
2809
+ message.localeLanguageIso6391 != null &&
2810
+ message.hasOwnProperty("localeLanguageIso6391")
2811
+ ) {
2812
+ object.localeLanguageIso6391 = message.localeLanguageIso6391;
2813
+ if (options.oneofs) object._localeLanguageIso6391 = "localeLanguageIso6391";
2814
+ }
2815
+ if (
2816
+ message.localeCountryIso31661Alpha2 != null &&
2817
+ message.hasOwnProperty("localeCountryIso31661Alpha2")
2818
+ ) {
2819
+ object.localeCountryIso31661Alpha2 = message.localeCountryIso31661Alpha2;
2820
+ if (options.oneofs)
2821
+ object._localeCountryIso31661Alpha2 = "localeCountryIso31661Alpha2";
2822
+ }
2823
+ if (message.deviceBoard != null && message.hasOwnProperty("deviceBoard")) {
2824
+ object.deviceBoard = message.deviceBoard;
2825
+ if (options.oneofs) object._deviceBoard = "deviceBoard";
2826
+ }
2827
+ if (message.deviceExpId != null && message.hasOwnProperty("deviceExpId")) {
2828
+ object.deviceExpId = message.deviceExpId;
2829
+ if (options.oneofs) object._deviceExpId = "deviceExpId";
2830
+ }
2831
+ if (message.deviceType != null && message.hasOwnProperty("deviceType")) {
2832
+ object.deviceType =
2833
+ options.enums === String
2834
+ ? $root.Wa6.ClientPayload.UserAgent.DeviceType[message.deviceType] ===
2835
+ undefined
2836
+ ? message.deviceType
2837
+ : $root.Wa6.ClientPayload.UserAgent.DeviceType[message.deviceType]
2838
+ : message.deviceType;
2839
+ if (options.oneofs) object._deviceType = "deviceType";
2840
+ }
2841
+ if (message.deviceModelType != null && message.hasOwnProperty("deviceModelType")) {
2842
+ object.deviceModelType = message.deviceModelType;
2843
+ if (options.oneofs) object._deviceModelType = "deviceModelType";
2844
+ }
2845
+ return object;
2846
+ };
2847
+ UserAgent.prototype.toJSON = function toJSON() {
2848
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2849
+ };
2850
+ UserAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2851
+ if (typeUrlPrefix === undefined) {
2852
+ typeUrlPrefix = "type.googleapis.com";
2853
+ }
2854
+ return typeUrlPrefix + "/Wa6.ClientPayload.UserAgent";
2855
+ };
2856
+ UserAgent.AppVersion = (function () {
2857
+ function AppVersion(properties) {
2858
+ if (properties)
2859
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2860
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
2861
+ }
2862
+ AppVersion.prototype.primary = null;
2863
+ AppVersion.prototype.secondary = null;
2864
+ AppVersion.prototype.tertiary = null;
2865
+ AppVersion.prototype.quaternary = null;
2866
+ AppVersion.prototype.quinary = null;
2867
+ var $oneOfFields;
2868
+ Object.defineProperty(AppVersion.prototype, "_primary", {
2869
+ get: $util.oneOfGetter(($oneOfFields = ["primary"])),
2870
+ set: $util.oneOfSetter($oneOfFields),
2871
+ });
2872
+ Object.defineProperty(AppVersion.prototype, "_secondary", {
2873
+ get: $util.oneOfGetter(($oneOfFields = ["secondary"])),
2874
+ set: $util.oneOfSetter($oneOfFields),
2875
+ });
2876
+ Object.defineProperty(AppVersion.prototype, "_tertiary", {
2877
+ get: $util.oneOfGetter(($oneOfFields = ["tertiary"])),
2878
+ set: $util.oneOfSetter($oneOfFields),
2879
+ });
2880
+ Object.defineProperty(AppVersion.prototype, "_quaternary", {
2881
+ get: $util.oneOfGetter(($oneOfFields = ["quaternary"])),
2882
+ set: $util.oneOfSetter($oneOfFields),
2883
+ });
2884
+ Object.defineProperty(AppVersion.prototype, "_quinary", {
2885
+ get: $util.oneOfGetter(($oneOfFields = ["quinary"])),
2886
+ set: $util.oneOfSetter($oneOfFields),
2887
+ });
2888
+ AppVersion.create = function create(properties) {
2889
+ return new AppVersion(properties);
2890
+ };
2891
+ AppVersion.encode = function encode(message, writer) {
2892
+ if (!writer) writer = $Writer.create();
2893
+ if (message.primary != null && Object.hasOwnProperty.call(message, "primary"))
2894
+ writer.uint32(8).uint32(message.primary);
2895
+ if (
2896
+ message.secondary != null &&
2897
+ Object.hasOwnProperty.call(message, "secondary")
2898
+ )
2899
+ writer.uint32(16).uint32(message.secondary);
2900
+ if (message.tertiary != null && Object.hasOwnProperty.call(message, "tertiary"))
2901
+ writer.uint32(24).uint32(message.tertiary);
2902
+ if (
2903
+ message.quaternary != null &&
2904
+ Object.hasOwnProperty.call(message, "quaternary")
2905
+ )
2906
+ writer.uint32(32).uint32(message.quaternary);
2907
+ if (message.quinary != null && Object.hasOwnProperty.call(message, "quinary"))
2908
+ writer.uint32(40).uint32(message.quinary);
2909
+ return writer;
2910
+ };
2911
+ AppVersion.encodeDelimited = function encodeDelimited(message, writer) {
2912
+ return this.encode(message, writer).ldelim();
2913
+ };
2914
+ AppVersion.decode = function decode(reader, length, error) {
2915
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
2916
+ var end = length === undefined ? reader.len : reader.pos + length,
2917
+ message = new $root.Wa6.ClientPayload.UserAgent.AppVersion();
2918
+ while (reader.pos < end) {
2919
+ var tag = reader.uint32();
2920
+ if (tag === error) break;
2921
+ switch (tag >>> 3) {
2922
+ case 1: {
2923
+ message.primary = reader.uint32();
2924
+ break;
2925
+ }
2926
+ case 2: {
2927
+ message.secondary = reader.uint32();
2928
+ break;
2929
+ }
2930
+ case 3: {
2931
+ message.tertiary = reader.uint32();
2932
+ break;
2933
+ }
2934
+ case 4: {
2935
+ message.quaternary = reader.uint32();
2936
+ break;
2937
+ }
2938
+ case 5: {
2939
+ message.quinary = reader.uint32();
2940
+ break;
2941
+ }
2942
+ default:
2943
+ reader.skipType(tag & 7);
2944
+ break;
2945
+ }
2946
+ }
2947
+ return message;
2948
+ };
2949
+ AppVersion.decodeDelimited = function decodeDelimited(reader) {
2950
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
2951
+ return this.decode(reader, reader.uint32());
2952
+ };
2953
+ AppVersion.verify = function verify(message) {
2954
+ if (typeof message !== "object" || message === null) return "object expected";
2955
+ var properties = {};
2956
+ if (message.primary != null && message.hasOwnProperty("primary")) {
2957
+ properties._primary = 1;
2958
+ if (!$util.isInteger(message.primary)) return "primary: integer expected";
2959
+ }
2960
+ if (message.secondary != null && message.hasOwnProperty("secondary")) {
2961
+ properties._secondary = 1;
2962
+ if (!$util.isInteger(message.secondary))
2963
+ return "secondary: integer expected";
2964
+ }
2965
+ if (message.tertiary != null && message.hasOwnProperty("tertiary")) {
2966
+ properties._tertiary = 1;
2967
+ if (!$util.isInteger(message.tertiary)) return "tertiary: integer expected";
2968
+ }
2969
+ if (message.quaternary != null && message.hasOwnProperty("quaternary")) {
2970
+ properties._quaternary = 1;
2971
+ if (!$util.isInteger(message.quaternary))
2972
+ return "quaternary: integer expected";
2973
+ }
2974
+ if (message.quinary != null && message.hasOwnProperty("quinary")) {
2975
+ properties._quinary = 1;
2976
+ if (!$util.isInteger(message.quinary)) return "quinary: integer expected";
2977
+ }
2978
+ return null;
2979
+ };
2980
+ AppVersion.fromObject = function fromObject(object) {
2981
+ if (object instanceof $root.Wa6.ClientPayload.UserAgent.AppVersion)
2982
+ return object;
2983
+ var message = new $root.Wa6.ClientPayload.UserAgent.AppVersion();
2984
+ if (object.primary != null) message.primary = object.primary >>> 0;
2985
+ if (object.secondary != null) message.secondary = object.secondary >>> 0;
2986
+ if (object.tertiary != null) message.tertiary = object.tertiary >>> 0;
2987
+ if (object.quaternary != null) message.quaternary = object.quaternary >>> 0;
2988
+ if (object.quinary != null) message.quinary = object.quinary >>> 0;
2989
+ return message;
2990
+ };
2991
+ AppVersion.toObject = function toObject(message, options) {
2992
+ if (!options) options = {};
2993
+ var object = {};
2994
+ if (message.primary != null && message.hasOwnProperty("primary")) {
2995
+ object.primary = message.primary;
2996
+ if (options.oneofs) object._primary = "primary";
2997
+ }
2998
+ if (message.secondary != null && message.hasOwnProperty("secondary")) {
2999
+ object.secondary = message.secondary;
3000
+ if (options.oneofs) object._secondary = "secondary";
3001
+ }
3002
+ if (message.tertiary != null && message.hasOwnProperty("tertiary")) {
3003
+ object.tertiary = message.tertiary;
3004
+ if (options.oneofs) object._tertiary = "tertiary";
3005
+ }
3006
+ if (message.quaternary != null && message.hasOwnProperty("quaternary")) {
3007
+ object.quaternary = message.quaternary;
3008
+ if (options.oneofs) object._quaternary = "quaternary";
3009
+ }
3010
+ if (message.quinary != null && message.hasOwnProperty("quinary")) {
3011
+ object.quinary = message.quinary;
3012
+ if (options.oneofs) object._quinary = "quinary";
3013
+ }
3014
+ return object;
3015
+ };
3016
+ AppVersion.prototype.toJSON = function toJSON() {
3017
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3018
+ };
3019
+ AppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
3020
+ if (typeUrlPrefix === undefined) {
3021
+ typeUrlPrefix = "type.googleapis.com";
3022
+ }
3023
+ return typeUrlPrefix + "/Wa6.ClientPayload.UserAgent.AppVersion";
3024
+ };
3025
+ return AppVersion;
3026
+ })();
3027
+ UserAgent.DeviceType = (function () {
3028
+ var valuesById = {},
3029
+ values = Object.create(valuesById);
3030
+ values[(valuesById[0] = "PHONE")] = 0;
3031
+ values[(valuesById[1] = "TABLET")] = 1;
3032
+ values[(valuesById[2] = "DESKTOP")] = 2;
3033
+ values[(valuesById[3] = "WEARABLE")] = 3;
3034
+ values[(valuesById[4] = "VR")] = 4;
3035
+ return values;
3036
+ })();
3037
+ UserAgent.Platform = (function () {
3038
+ var valuesById = {},
3039
+ values = Object.create(valuesById);
3040
+ values[(valuesById[0] = "ANDROID")] = 0;
3041
+ values[(valuesById[1] = "IOS")] = 1;
3042
+ values[(valuesById[2] = "WINDOWS_PHONE")] = 2;
3043
+ values[(valuesById[3] = "BLACKBERRY")] = 3;
3044
+ values[(valuesById[4] = "BLACKBERRYX")] = 4;
3045
+ values[(valuesById[5] = "S40")] = 5;
3046
+ values[(valuesById[6] = "S60")] = 6;
3047
+ values[(valuesById[7] = "PYTHON_CLIENT")] = 7;
3048
+ values[(valuesById[8] = "TIZEN")] = 8;
3049
+ values[(valuesById[9] = "ENTERPRISE")] = 9;
3050
+ values[(valuesById[10] = "SMB_ANDROID")] = 10;
3051
+ values[(valuesById[11] = "KAIOS")] = 11;
3052
+ values[(valuesById[12] = "SMB_IOS")] = 12;
3053
+ values[(valuesById[13] = "WINDOWS")] = 13;
3054
+ values[(valuesById[14] = "WEB")] = 14;
3055
+ values[(valuesById[15] = "PORTAL")] = 15;
3056
+ values[(valuesById[16] = "GREEN_ANDROID")] = 16;
3057
+ values[(valuesById[17] = "GREEN_IPHONE")] = 17;
3058
+ values[(valuesById[18] = "BLUE_ANDROID")] = 18;
3059
+ values[(valuesById[19] = "BLUE_IPHONE")] = 19;
3060
+ values[(valuesById[20] = "FBLITE_ANDROID")] = 20;
3061
+ values[(valuesById[21] = "MLITE_ANDROID")] = 21;
3062
+ values[(valuesById[22] = "IGLITE_ANDROID")] = 22;
3063
+ values[(valuesById[23] = "PAGE")] = 23;
3064
+ values[(valuesById[24] = "MACOS")] = 24;
3065
+ values[(valuesById[25] = "OCULUS_MSG")] = 25;
3066
+ values[(valuesById[26] = "OCULUS_CALL")] = 26;
3067
+ values[(valuesById[27] = "MILAN")] = 27;
3068
+ values[(valuesById[28] = "CAPI")] = 28;
3069
+ values[(valuesById[29] = "WEAROS")] = 29;
3070
+ values[(valuesById[30] = "ARDEVICE")] = 30;
3071
+ values[(valuesById[31] = "VRDEVICE")] = 31;
3072
+ values[(valuesById[32] = "BLUE_WEB")] = 32;
3073
+ values[(valuesById[33] = "IPAD")] = 33;
3074
+ values[(valuesById[34] = "TEST")] = 34;
3075
+ values[(valuesById[35] = "SMART_GLASSES")] = 35;
3076
+ values[(valuesById[36] = "BLUE_VR")] = 36;
3077
+ values[(valuesById[37] = "AR_WRIST")] = 37;
3078
+ return values;
3079
+ })();
3080
+ UserAgent.ReleaseChannel = (function () {
3081
+ var valuesById = {},
3082
+ values = Object.create(valuesById);
3083
+ values[(valuesById[0] = "RELEASE")] = 0;
3084
+ values[(valuesById[1] = "BETA")] = 1;
3085
+ values[(valuesById[2] = "ALPHA")] = 2;
3086
+ values[(valuesById[3] = "DEBUG")] = 3;
3087
+ return values;
3088
+ })();
3089
+ return UserAgent;
3090
+ })();
3091
+ ClientPayload.WebInfo = (function () {
3092
+ function WebInfo(properties) {
3093
+ if (properties)
3094
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3095
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
3096
+ }
3097
+ WebInfo.prototype.refToken = null;
3098
+ WebInfo.prototype.version = null;
3099
+ WebInfo.prototype.webdPayload = null;
3100
+ WebInfo.prototype.webSubPlatform = null;
3101
+ var $oneOfFields;
3102
+ Object.defineProperty(WebInfo.prototype, "_refToken", {
3103
+ get: $util.oneOfGetter(($oneOfFields = ["refToken"])),
3104
+ set: $util.oneOfSetter($oneOfFields),
3105
+ });
3106
+ Object.defineProperty(WebInfo.prototype, "_version", {
3107
+ get: $util.oneOfGetter(($oneOfFields = ["version"])),
3108
+ set: $util.oneOfSetter($oneOfFields),
3109
+ });
3110
+ Object.defineProperty(WebInfo.prototype, "_webdPayload", {
3111
+ get: $util.oneOfGetter(($oneOfFields = ["webdPayload"])),
3112
+ set: $util.oneOfSetter($oneOfFields),
3113
+ });
3114
+ Object.defineProperty(WebInfo.prototype, "_webSubPlatform", {
3115
+ get: $util.oneOfGetter(($oneOfFields = ["webSubPlatform"])),
3116
+ set: $util.oneOfSetter($oneOfFields),
3117
+ });
3118
+ WebInfo.create = function create(properties) {
3119
+ return new WebInfo(properties);
3120
+ };
3121
+ WebInfo.encode = function encode(message, writer) {
3122
+ if (!writer) writer = $Writer.create();
3123
+ if (message.refToken != null && Object.hasOwnProperty.call(message, "refToken"))
3124
+ writer.uint32(10).string(message.refToken);
3125
+ if (message.version != null && Object.hasOwnProperty.call(message, "version"))
3126
+ writer.uint32(18).string(message.version);
3127
+ if (
3128
+ message.webdPayload != null &&
3129
+ Object.hasOwnProperty.call(message, "webdPayload")
3130
+ )
3131
+ $root.Wa6.ClientPayload.WebInfo.WebdPayload.encode(
3132
+ message.webdPayload,
3133
+ writer.uint32(26).fork()
3134
+ ).ldelim();
3135
+ if (
3136
+ message.webSubPlatform != null &&
3137
+ Object.hasOwnProperty.call(message, "webSubPlatform")
3138
+ )
3139
+ writer.uint32(32).int32(message.webSubPlatform);
3140
+ return writer;
3141
+ };
3142
+ WebInfo.encodeDelimited = function encodeDelimited(message, writer) {
3143
+ return this.encode(message, writer).ldelim();
3144
+ };
3145
+ WebInfo.decode = function decode(reader, length, error) {
3146
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
3147
+ var end = length === undefined ? reader.len : reader.pos + length,
3148
+ message = new $root.Wa6.ClientPayload.WebInfo();
3149
+ while (reader.pos < end) {
3150
+ var tag = reader.uint32();
3151
+ if (tag === error) break;
3152
+ switch (tag >>> 3) {
3153
+ case 1: {
3154
+ message.refToken = reader.string();
3155
+ break;
3156
+ }
3157
+ case 2: {
3158
+ message.version = reader.string();
3159
+ break;
3160
+ }
3161
+ case 3: {
3162
+ message.webdPayload =
3163
+ $root.Wa6.ClientPayload.WebInfo.WebdPayload.decode(
3164
+ reader,
3165
+ reader.uint32()
3166
+ );
3167
+ break;
3168
+ }
3169
+ case 4: {
3170
+ message.webSubPlatform = reader.int32();
3171
+ break;
3172
+ }
3173
+ default:
3174
+ reader.skipType(tag & 7);
3175
+ break;
3176
+ }
3177
+ }
3178
+ return message;
3179
+ };
3180
+ WebInfo.decodeDelimited = function decodeDelimited(reader) {
3181
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
3182
+ return this.decode(reader, reader.uint32());
3183
+ };
3184
+ WebInfo.verify = function verify(message) {
3185
+ if (typeof message !== "object" || message === null) return "object expected";
3186
+ var properties = {};
3187
+ if (message.refToken != null && message.hasOwnProperty("refToken")) {
3188
+ properties._refToken = 1;
3189
+ if (!$util.isString(message.refToken)) return "refToken: string expected";
3190
+ }
3191
+ if (message.version != null && message.hasOwnProperty("version")) {
3192
+ properties._version = 1;
3193
+ if (!$util.isString(message.version)) return "version: string expected";
3194
+ }
3195
+ if (message.webdPayload != null && message.hasOwnProperty("webdPayload")) {
3196
+ properties._webdPayload = 1;
3197
+ {
3198
+ var error = $root.Wa6.ClientPayload.WebInfo.WebdPayload.verify(
3199
+ message.webdPayload
3200
+ );
3201
+ if (error) return "webdPayload." + error;
3202
+ }
3203
+ }
3204
+ if (message.webSubPlatform != null && message.hasOwnProperty("webSubPlatform")) {
3205
+ properties._webSubPlatform = 1;
3206
+ switch (message.webSubPlatform) {
3207
+ default:
3208
+ return "webSubPlatform: enum value expected";
3209
+ case 0:
3210
+ case 1:
3211
+ case 2:
3212
+ case 3:
3213
+ case 4:
3214
+ case 5:
3215
+ break;
3216
+ }
3217
+ }
3218
+ return null;
3219
+ };
3220
+ WebInfo.fromObject = function fromObject(object) {
3221
+ if (object instanceof $root.Wa6.ClientPayload.WebInfo) return object;
3222
+ var message = new $root.Wa6.ClientPayload.WebInfo();
3223
+ if (object.refToken != null) message.refToken = String(object.refToken);
3224
+ if (object.version != null) message.version = String(object.version);
3225
+ if (object.webdPayload != null) {
3226
+ if (typeof object.webdPayload !== "object")
3227
+ throw TypeError(".Wa6.ClientPayload.WebInfo.webdPayload: object expected");
3228
+ message.webdPayload = $root.Wa6.ClientPayload.WebInfo.WebdPayload.fromObject(
3229
+ object.webdPayload
3230
+ );
3231
+ }
3232
+ switch (object.webSubPlatform) {
3233
+ default:
3234
+ if (typeof object.webSubPlatform === "number") {
3235
+ message.webSubPlatform = object.webSubPlatform;
3236
+ break;
3237
+ }
3238
+ break;
3239
+ case "WEB_BROWSER":
3240
+ case 0:
3241
+ message.webSubPlatform = 0;
3242
+ break;
3243
+ case "APP_STORE":
3244
+ case 1:
3245
+ message.webSubPlatform = 1;
3246
+ break;
3247
+ case "WIN_STORE":
3248
+ case 2:
3249
+ message.webSubPlatform = 2;
3250
+ break;
3251
+ case "DARWIN":
3252
+ case 3:
3253
+ message.webSubPlatform = 3;
3254
+ break;
3255
+ case "WIN32":
3256
+ case 4:
3257
+ message.webSubPlatform = 4;
3258
+ break;
3259
+ case "WIN_HYBRID":
3260
+ case 5:
3261
+ message.webSubPlatform = 5;
3262
+ break;
3263
+ }
3264
+ return message;
3265
+ };
3266
+ WebInfo.toObject = function toObject(message, options) {
3267
+ if (!options) options = {};
3268
+ var object = {};
3269
+ if (message.refToken != null && message.hasOwnProperty("refToken")) {
3270
+ object.refToken = message.refToken;
3271
+ if (options.oneofs) object._refToken = "refToken";
3272
+ }
3273
+ if (message.version != null && message.hasOwnProperty("version")) {
3274
+ object.version = message.version;
3275
+ if (options.oneofs) object._version = "version";
3276
+ }
3277
+ if (message.webdPayload != null && message.hasOwnProperty("webdPayload")) {
3278
+ object.webdPayload = $root.Wa6.ClientPayload.WebInfo.WebdPayload.toObject(
3279
+ message.webdPayload,
3280
+ options
3281
+ );
3282
+ if (options.oneofs) object._webdPayload = "webdPayload";
3283
+ }
3284
+ if (message.webSubPlatform != null && message.hasOwnProperty("webSubPlatform")) {
3285
+ object.webSubPlatform =
3286
+ options.enums === String
3287
+ ? $root.Wa6.ClientPayload.WebInfo.WebSubPlatform[
3288
+ message.webSubPlatform
3289
+ ] === undefined
3290
+ ? message.webSubPlatform
3291
+ : $root.Wa6.ClientPayload.WebInfo.WebSubPlatform[
3292
+ message.webSubPlatform
3293
+ ]
3294
+ : message.webSubPlatform;
3295
+ if (options.oneofs) object._webSubPlatform = "webSubPlatform";
3296
+ }
3297
+ return object;
3298
+ };
3299
+ WebInfo.prototype.toJSON = function toJSON() {
3300
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3301
+ };
3302
+ WebInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
3303
+ if (typeUrlPrefix === undefined) {
3304
+ typeUrlPrefix = "type.googleapis.com";
3305
+ }
3306
+ return typeUrlPrefix + "/Wa6.ClientPayload.WebInfo";
3307
+ };
3308
+ WebInfo.WebSubPlatform = (function () {
3309
+ var valuesById = {},
3310
+ values = Object.create(valuesById);
3311
+ values[(valuesById[0] = "WEB_BROWSER")] = 0;
3312
+ values[(valuesById[1] = "APP_STORE")] = 1;
3313
+ values[(valuesById[2] = "WIN_STORE")] = 2;
3314
+ values[(valuesById[3] = "DARWIN")] = 3;
3315
+ values[(valuesById[4] = "WIN32")] = 4;
3316
+ values[(valuesById[5] = "WIN_HYBRID")] = 5;
3317
+ return values;
3318
+ })();
3319
+ WebInfo.WebdPayload = (function () {
3320
+ function WebdPayload(properties) {
3321
+ if (properties)
3322
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3323
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
3324
+ }
3325
+ WebdPayload.prototype.usesParticipantInKey = null;
3326
+ WebdPayload.prototype.supportsStarredMessages = null;
3327
+ WebdPayload.prototype.supportsDocumentMessages = null;
3328
+ WebdPayload.prototype.supportsUrlMessages = null;
3329
+ WebdPayload.prototype.supportsMediaRetry = null;
3330
+ WebdPayload.prototype.supportsE2EImage = null;
3331
+ WebdPayload.prototype.supportsE2EVideo = null;
3332
+ WebdPayload.prototype.supportsE2EAudio = null;
3333
+ WebdPayload.prototype.supportsE2EDocument = null;
3334
+ WebdPayload.prototype.documentTypes = null;
3335
+ WebdPayload.prototype.features = null;
3336
+ var $oneOfFields;
3337
+ Object.defineProperty(WebdPayload.prototype, "_usesParticipantInKey", {
3338
+ get: $util.oneOfGetter(($oneOfFields = ["usesParticipantInKey"])),
3339
+ set: $util.oneOfSetter($oneOfFields),
3340
+ });
3341
+ Object.defineProperty(WebdPayload.prototype, "_supportsStarredMessages", {
3342
+ get: $util.oneOfGetter(($oneOfFields = ["supportsStarredMessages"])),
3343
+ set: $util.oneOfSetter($oneOfFields),
3344
+ });
3345
+ Object.defineProperty(WebdPayload.prototype, "_supportsDocumentMessages", {
3346
+ get: $util.oneOfGetter(($oneOfFields = ["supportsDocumentMessages"])),
3347
+ set: $util.oneOfSetter($oneOfFields),
3348
+ });
3349
+ Object.defineProperty(WebdPayload.prototype, "_supportsUrlMessages", {
3350
+ get: $util.oneOfGetter(($oneOfFields = ["supportsUrlMessages"])),
3351
+ set: $util.oneOfSetter($oneOfFields),
3352
+ });
3353
+ Object.defineProperty(WebdPayload.prototype, "_supportsMediaRetry", {
3354
+ get: $util.oneOfGetter(($oneOfFields = ["supportsMediaRetry"])),
3355
+ set: $util.oneOfSetter($oneOfFields),
3356
+ });
3357
+ Object.defineProperty(WebdPayload.prototype, "_supportsE2EImage", {
3358
+ get: $util.oneOfGetter(($oneOfFields = ["supportsE2EImage"])),
3359
+ set: $util.oneOfSetter($oneOfFields),
3360
+ });
3361
+ Object.defineProperty(WebdPayload.prototype, "_supportsE2EVideo", {
3362
+ get: $util.oneOfGetter(($oneOfFields = ["supportsE2EVideo"])),
3363
+ set: $util.oneOfSetter($oneOfFields),
3364
+ });
3365
+ Object.defineProperty(WebdPayload.prototype, "_supportsE2EAudio", {
3366
+ get: $util.oneOfGetter(($oneOfFields = ["supportsE2EAudio"])),
3367
+ set: $util.oneOfSetter($oneOfFields),
3368
+ });
3369
+ Object.defineProperty(WebdPayload.prototype, "_supportsE2EDocument", {
3370
+ get: $util.oneOfGetter(($oneOfFields = ["supportsE2EDocument"])),
3371
+ set: $util.oneOfSetter($oneOfFields),
3372
+ });
3373
+ Object.defineProperty(WebdPayload.prototype, "_documentTypes", {
3374
+ get: $util.oneOfGetter(($oneOfFields = ["documentTypes"])),
3375
+ set: $util.oneOfSetter($oneOfFields),
3376
+ });
3377
+ Object.defineProperty(WebdPayload.prototype, "_features", {
3378
+ get: $util.oneOfGetter(($oneOfFields = ["features"])),
3379
+ set: $util.oneOfSetter($oneOfFields),
3380
+ });
3381
+ WebdPayload.create = function create(properties) {
3382
+ return new WebdPayload(properties);
3383
+ };
3384
+ WebdPayload.encode = function encode(message, writer) {
3385
+ if (!writer) writer = $Writer.create();
3386
+ if (
3387
+ message.usesParticipantInKey != null &&
3388
+ Object.hasOwnProperty.call(message, "usesParticipantInKey")
3389
+ )
3390
+ writer.uint32(8).bool(message.usesParticipantInKey);
3391
+ if (
3392
+ message.supportsStarredMessages != null &&
3393
+ Object.hasOwnProperty.call(message, "supportsStarredMessages")
3394
+ )
3395
+ writer.uint32(16).bool(message.supportsStarredMessages);
3396
+ if (
3397
+ message.supportsDocumentMessages != null &&
3398
+ Object.hasOwnProperty.call(message, "supportsDocumentMessages")
3399
+ )
3400
+ writer.uint32(24).bool(message.supportsDocumentMessages);
3401
+ if (
3402
+ message.supportsUrlMessages != null &&
3403
+ Object.hasOwnProperty.call(message, "supportsUrlMessages")
3404
+ )
3405
+ writer.uint32(32).bool(message.supportsUrlMessages);
3406
+ if (
3407
+ message.supportsMediaRetry != null &&
3408
+ Object.hasOwnProperty.call(message, "supportsMediaRetry")
3409
+ )
3410
+ writer.uint32(40).bool(message.supportsMediaRetry);
3411
+ if (
3412
+ message.supportsE2EImage != null &&
3413
+ Object.hasOwnProperty.call(message, "supportsE2EImage")
3414
+ )
3415
+ writer.uint32(48).bool(message.supportsE2EImage);
3416
+ if (
3417
+ message.supportsE2EVideo != null &&
3418
+ Object.hasOwnProperty.call(message, "supportsE2EVideo")
3419
+ )
3420
+ writer.uint32(56).bool(message.supportsE2EVideo);
3421
+ if (
3422
+ message.supportsE2EAudio != null &&
3423
+ Object.hasOwnProperty.call(message, "supportsE2EAudio")
3424
+ )
3425
+ writer.uint32(64).bool(message.supportsE2EAudio);
3426
+ if (
3427
+ message.supportsE2EDocument != null &&
3428
+ Object.hasOwnProperty.call(message, "supportsE2EDocument")
3429
+ )
3430
+ writer.uint32(72).bool(message.supportsE2EDocument);
3431
+ if (
3432
+ message.documentTypes != null &&
3433
+ Object.hasOwnProperty.call(message, "documentTypes")
3434
+ )
3435
+ writer.uint32(82).string(message.documentTypes);
3436
+ if (message.features != null && Object.hasOwnProperty.call(message, "features"))
3437
+ writer.uint32(90).bytes(message.features);
3438
+ return writer;
3439
+ };
3440
+ WebdPayload.encodeDelimited = function encodeDelimited(message, writer) {
3441
+ return this.encode(message, writer).ldelim();
3442
+ };
3443
+ WebdPayload.decode = function decode(reader, length, error) {
3444
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
3445
+ var end = length === undefined ? reader.len : reader.pos + length,
3446
+ message = new $root.Wa6.ClientPayload.WebInfo.WebdPayload();
3447
+ while (reader.pos < end) {
3448
+ var tag = reader.uint32();
3449
+ if (tag === error) break;
3450
+ switch (tag >>> 3) {
3451
+ case 1: {
3452
+ message.usesParticipantInKey = reader.bool();
3453
+ break;
3454
+ }
3455
+ case 2: {
3456
+ message.supportsStarredMessages = reader.bool();
3457
+ break;
3458
+ }
3459
+ case 3: {
3460
+ message.supportsDocumentMessages = reader.bool();
3461
+ break;
3462
+ }
3463
+ case 4: {
3464
+ message.supportsUrlMessages = reader.bool();
3465
+ break;
3466
+ }
3467
+ case 5: {
3468
+ message.supportsMediaRetry = reader.bool();
3469
+ break;
3470
+ }
3471
+ case 6: {
3472
+ message.supportsE2EImage = reader.bool();
3473
+ break;
3474
+ }
3475
+ case 7: {
3476
+ message.supportsE2EVideo = reader.bool();
3477
+ break;
3478
+ }
3479
+ case 8: {
3480
+ message.supportsE2EAudio = reader.bool();
3481
+ break;
3482
+ }
3483
+ case 9: {
3484
+ message.supportsE2EDocument = reader.bool();
3485
+ break;
3486
+ }
3487
+ case 10: {
3488
+ message.documentTypes = reader.string();
3489
+ break;
3490
+ }
3491
+ case 11: {
3492
+ message.features = reader.bytes();
3493
+ break;
3494
+ }
3495
+ default:
3496
+ reader.skipType(tag & 7);
3497
+ break;
3498
+ }
3499
+ }
3500
+ return message;
3501
+ };
3502
+ WebdPayload.decodeDelimited = function decodeDelimited(reader) {
3503
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
3504
+ return this.decode(reader, reader.uint32());
3505
+ };
3506
+ WebdPayload.verify = function verify(message) {
3507
+ if (typeof message !== "object" || message === null) return "object expected";
3508
+ var properties = {};
3509
+ if (
3510
+ message.usesParticipantInKey != null &&
3511
+ message.hasOwnProperty("usesParticipantInKey")
3512
+ ) {
3513
+ properties._usesParticipantInKey = 1;
3514
+ if (typeof message.usesParticipantInKey !== "boolean")
3515
+ return "usesParticipantInKey: boolean expected";
3516
+ }
3517
+ if (
3518
+ message.supportsStarredMessages != null &&
3519
+ message.hasOwnProperty("supportsStarredMessages")
3520
+ ) {
3521
+ properties._supportsStarredMessages = 1;
3522
+ if (typeof message.supportsStarredMessages !== "boolean")
3523
+ return "supportsStarredMessages: boolean expected";
3524
+ }
3525
+ if (
3526
+ message.supportsDocumentMessages != null &&
3527
+ message.hasOwnProperty("supportsDocumentMessages")
3528
+ ) {
3529
+ properties._supportsDocumentMessages = 1;
3530
+ if (typeof message.supportsDocumentMessages !== "boolean")
3531
+ return "supportsDocumentMessages: boolean expected";
3532
+ }
3533
+ if (
3534
+ message.supportsUrlMessages != null &&
3535
+ message.hasOwnProperty("supportsUrlMessages")
3536
+ ) {
3537
+ properties._supportsUrlMessages = 1;
3538
+ if (typeof message.supportsUrlMessages !== "boolean")
3539
+ return "supportsUrlMessages: boolean expected";
3540
+ }
3541
+ if (
3542
+ message.supportsMediaRetry != null &&
3543
+ message.hasOwnProperty("supportsMediaRetry")
3544
+ ) {
3545
+ properties._supportsMediaRetry = 1;
3546
+ if (typeof message.supportsMediaRetry !== "boolean")
3547
+ return "supportsMediaRetry: boolean expected";
3548
+ }
3549
+ if (
3550
+ message.supportsE2EImage != null &&
3551
+ message.hasOwnProperty("supportsE2EImage")
3552
+ ) {
3553
+ properties._supportsE2EImage = 1;
3554
+ if (typeof message.supportsE2EImage !== "boolean")
3555
+ return "supportsE2EImage: boolean expected";
3556
+ }
3557
+ if (
3558
+ message.supportsE2EVideo != null &&
3559
+ message.hasOwnProperty("supportsE2EVideo")
3560
+ ) {
3561
+ properties._supportsE2EVideo = 1;
3562
+ if (typeof message.supportsE2EVideo !== "boolean")
3563
+ return "supportsE2EVideo: boolean expected";
3564
+ }
3565
+ if (
3566
+ message.supportsE2EAudio != null &&
3567
+ message.hasOwnProperty("supportsE2EAudio")
3568
+ ) {
3569
+ properties._supportsE2EAudio = 1;
3570
+ if (typeof message.supportsE2EAudio !== "boolean")
3571
+ return "supportsE2EAudio: boolean expected";
3572
+ }
3573
+ if (
3574
+ message.supportsE2EDocument != null &&
3575
+ message.hasOwnProperty("supportsE2EDocument")
3576
+ ) {
3577
+ properties._supportsE2EDocument = 1;
3578
+ if (typeof message.supportsE2EDocument !== "boolean")
3579
+ return "supportsE2EDocument: boolean expected";
3580
+ }
3581
+ if (message.documentTypes != null && message.hasOwnProperty("documentTypes")) {
3582
+ properties._documentTypes = 1;
3583
+ if (!$util.isString(message.documentTypes))
3584
+ return "documentTypes: string expected";
3585
+ }
3586
+ if (message.features != null && message.hasOwnProperty("features")) {
3587
+ properties._features = 1;
3588
+ if (
3589
+ !(
3590
+ (message.features && typeof message.features.length === "number") ||
3591
+ $util.isString(message.features)
3592
+ )
3593
+ )
3594
+ return "features: buffer expected";
3595
+ }
3596
+ return null;
3597
+ };
3598
+ WebdPayload.fromObject = function fromObject(object) {
3599
+ if (object instanceof $root.Wa6.ClientPayload.WebInfo.WebdPayload)
3600
+ return object;
3601
+ var message = new $root.Wa6.ClientPayload.WebInfo.WebdPayload();
3602
+ if (object.usesParticipantInKey != null)
3603
+ message.usesParticipantInKey = Boolean(object.usesParticipantInKey);
3604
+ if (object.supportsStarredMessages != null)
3605
+ message.supportsStarredMessages = Boolean(object.supportsStarredMessages);
3606
+ if (object.supportsDocumentMessages != null)
3607
+ message.supportsDocumentMessages = Boolean(object.supportsDocumentMessages);
3608
+ if (object.supportsUrlMessages != null)
3609
+ message.supportsUrlMessages = Boolean(object.supportsUrlMessages);
3610
+ if (object.supportsMediaRetry != null)
3611
+ message.supportsMediaRetry = Boolean(object.supportsMediaRetry);
3612
+ if (object.supportsE2EImage != null)
3613
+ message.supportsE2EImage = Boolean(object.supportsE2EImage);
3614
+ if (object.supportsE2EVideo != null)
3615
+ message.supportsE2EVideo = Boolean(object.supportsE2EVideo);
3616
+ if (object.supportsE2EAudio != null)
3617
+ message.supportsE2EAudio = Boolean(object.supportsE2EAudio);
3618
+ if (object.supportsE2EDocument != null)
3619
+ message.supportsE2EDocument = Boolean(object.supportsE2EDocument);
3620
+ if (object.documentTypes != null)
3621
+ message.documentTypes = String(object.documentTypes);
3622
+ if (object.features != null)
3623
+ if (typeof object.features === "string")
3624
+ $util.base64.decode(
3625
+ object.features,
3626
+ (message.features = $util.newBuffer(
3627
+ $util.base64.length(object.features)
3628
+ )),
3629
+ 0
3630
+ );
3631
+ else if (object.features.length >= 0) message.features = object.features;
3632
+ return message;
3633
+ };
3634
+ WebdPayload.toObject = function toObject(message, options) {
3635
+ if (!options) options = {};
3636
+ var object = {};
3637
+ if (
3638
+ message.usesParticipantInKey != null &&
3639
+ message.hasOwnProperty("usesParticipantInKey")
3640
+ ) {
3641
+ object.usesParticipantInKey = message.usesParticipantInKey;
3642
+ if (options.oneofs) object._usesParticipantInKey = "usesParticipantInKey";
3643
+ }
3644
+ if (
3645
+ message.supportsStarredMessages != null &&
3646
+ message.hasOwnProperty("supportsStarredMessages")
3647
+ ) {
3648
+ object.supportsStarredMessages = message.supportsStarredMessages;
3649
+ if (options.oneofs)
3650
+ object._supportsStarredMessages = "supportsStarredMessages";
3651
+ }
3652
+ if (
3653
+ message.supportsDocumentMessages != null &&
3654
+ message.hasOwnProperty("supportsDocumentMessages")
3655
+ ) {
3656
+ object.supportsDocumentMessages = message.supportsDocumentMessages;
3657
+ if (options.oneofs)
3658
+ object._supportsDocumentMessages = "supportsDocumentMessages";
3659
+ }
3660
+ if (
3661
+ message.supportsUrlMessages != null &&
3662
+ message.hasOwnProperty("supportsUrlMessages")
3663
+ ) {
3664
+ object.supportsUrlMessages = message.supportsUrlMessages;
3665
+ if (options.oneofs) object._supportsUrlMessages = "supportsUrlMessages";
3666
+ }
3667
+ if (
3668
+ message.supportsMediaRetry != null &&
3669
+ message.hasOwnProperty("supportsMediaRetry")
3670
+ ) {
3671
+ object.supportsMediaRetry = message.supportsMediaRetry;
3672
+ if (options.oneofs) object._supportsMediaRetry = "supportsMediaRetry";
3673
+ }
3674
+ if (
3675
+ message.supportsE2EImage != null &&
3676
+ message.hasOwnProperty("supportsE2EImage")
3677
+ ) {
3678
+ object.supportsE2EImage = message.supportsE2EImage;
3679
+ if (options.oneofs) object._supportsE2EImage = "supportsE2EImage";
3680
+ }
3681
+ if (
3682
+ message.supportsE2EVideo != null &&
3683
+ message.hasOwnProperty("supportsE2EVideo")
3684
+ ) {
3685
+ object.supportsE2EVideo = message.supportsE2EVideo;
3686
+ if (options.oneofs) object._supportsE2EVideo = "supportsE2EVideo";
3687
+ }
3688
+ if (
3689
+ message.supportsE2EAudio != null &&
3690
+ message.hasOwnProperty("supportsE2EAudio")
3691
+ ) {
3692
+ object.supportsE2EAudio = message.supportsE2EAudio;
3693
+ if (options.oneofs) object._supportsE2EAudio = "supportsE2EAudio";
3694
+ }
3695
+ if (
3696
+ message.supportsE2EDocument != null &&
3697
+ message.hasOwnProperty("supportsE2EDocument")
3698
+ ) {
3699
+ object.supportsE2EDocument = message.supportsE2EDocument;
3700
+ if (options.oneofs) object._supportsE2EDocument = "supportsE2EDocument";
3701
+ }
3702
+ if (message.documentTypes != null && message.hasOwnProperty("documentTypes")) {
3703
+ object.documentTypes = message.documentTypes;
3704
+ if (options.oneofs) object._documentTypes = "documentTypes";
3705
+ }
3706
+ if (message.features != null && message.hasOwnProperty("features")) {
3707
+ object.features =
3708
+ options.bytes === String
3709
+ ? $util.base64.encode(message.features, 0, message.features.length)
3710
+ : options.bytes === Array
3711
+ ? Array.prototype.slice.call(message.features)
3712
+ : message.features;
3713
+ if (options.oneofs) object._features = "features";
3714
+ }
3715
+ return object;
3716
+ };
3717
+ WebdPayload.prototype.toJSON = function toJSON() {
3718
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3719
+ };
3720
+ WebdPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
3721
+ if (typeUrlPrefix === undefined) {
3722
+ typeUrlPrefix = "type.googleapis.com";
3723
+ }
3724
+ return typeUrlPrefix + "/Wa6.ClientPayload.WebInfo.WebdPayload";
3725
+ };
3726
+ return WebdPayload;
3727
+ })();
3728
+ return WebInfo;
3729
+ })();
3730
+ return ClientPayload;
3731
+ })();
3732
+ Wa6.HandshakeMessage = (function () {
3733
+ function HandshakeMessage(properties) {
3734
+ if (properties)
3735
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3736
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
3737
+ }
3738
+ HandshakeMessage.prototype.clientHello = null;
3739
+ HandshakeMessage.prototype.serverHello = null;
3740
+ HandshakeMessage.prototype.clientFinish = null;
3741
+ var $oneOfFields;
3742
+ Object.defineProperty(HandshakeMessage.prototype, "_clientHello", {
3743
+ get: $util.oneOfGetter(($oneOfFields = ["clientHello"])),
3744
+ set: $util.oneOfSetter($oneOfFields),
3745
+ });
3746
+ Object.defineProperty(HandshakeMessage.prototype, "_serverHello", {
3747
+ get: $util.oneOfGetter(($oneOfFields = ["serverHello"])),
3748
+ set: $util.oneOfSetter($oneOfFields),
3749
+ });
3750
+ Object.defineProperty(HandshakeMessage.prototype, "_clientFinish", {
3751
+ get: $util.oneOfGetter(($oneOfFields = ["clientFinish"])),
3752
+ set: $util.oneOfSetter($oneOfFields),
3753
+ });
3754
+ HandshakeMessage.create = function create(properties) {
3755
+ return new HandshakeMessage(properties);
3756
+ };
3757
+ HandshakeMessage.encode = function encode(message, writer) {
3758
+ if (!writer) writer = $Writer.create();
3759
+ if (message.clientHello != null && Object.hasOwnProperty.call(message, "clientHello"))
3760
+ $root.Wa6.HandshakeMessage.ClientHello.encode(
3761
+ message.clientHello,
3762
+ writer.uint32(18).fork()
3763
+ ).ldelim();
3764
+ if (message.serverHello != null && Object.hasOwnProperty.call(message, "serverHello"))
3765
+ $root.Wa6.HandshakeMessage.ServerHello.encode(
3766
+ message.serverHello,
3767
+ writer.uint32(26).fork()
3768
+ ).ldelim();
3769
+ if (message.clientFinish != null && Object.hasOwnProperty.call(message, "clientFinish"))
3770
+ $root.Wa6.HandshakeMessage.ClientFinish.encode(
3771
+ message.clientFinish,
3772
+ writer.uint32(34).fork()
3773
+ ).ldelim();
3774
+ return writer;
3775
+ };
3776
+ HandshakeMessage.encodeDelimited = function encodeDelimited(message, writer) {
3777
+ return this.encode(message, writer).ldelim();
3778
+ };
3779
+ HandshakeMessage.decode = function decode(reader, length, error) {
3780
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
3781
+ var end = length === undefined ? reader.len : reader.pos + length,
3782
+ message = new $root.Wa6.HandshakeMessage();
3783
+ while (reader.pos < end) {
3784
+ var tag = reader.uint32();
3785
+ if (tag === error) break;
3786
+ switch (tag >>> 3) {
3787
+ case 2: {
3788
+ message.clientHello = $root.Wa6.HandshakeMessage.ClientHello.decode(
3789
+ reader,
3790
+ reader.uint32()
3791
+ );
3792
+ break;
3793
+ }
3794
+ case 3: {
3795
+ message.serverHello = $root.Wa6.HandshakeMessage.ServerHello.decode(
3796
+ reader,
3797
+ reader.uint32()
3798
+ );
3799
+ break;
3800
+ }
3801
+ case 4: {
3802
+ message.clientFinish = $root.Wa6.HandshakeMessage.ClientFinish.decode(
3803
+ reader,
3804
+ reader.uint32()
3805
+ );
3806
+ break;
3807
+ }
3808
+ default:
3809
+ reader.skipType(tag & 7);
3810
+ break;
3811
+ }
3812
+ }
3813
+ return message;
3814
+ };
3815
+ HandshakeMessage.decodeDelimited = function decodeDelimited(reader) {
3816
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
3817
+ return this.decode(reader, reader.uint32());
3818
+ };
3819
+ HandshakeMessage.verify = function verify(message) {
3820
+ if (typeof message !== "object" || message === null) return "object expected";
3821
+ var properties = {};
3822
+ if (message.clientHello != null && message.hasOwnProperty("clientHello")) {
3823
+ properties._clientHello = 1;
3824
+ {
3825
+ var error = $root.Wa6.HandshakeMessage.ClientHello.verify(message.clientHello);
3826
+ if (error) return "clientHello." + error;
3827
+ }
3828
+ }
3829
+ if (message.serverHello != null && message.hasOwnProperty("serverHello")) {
3830
+ properties._serverHello = 1;
3831
+ {
3832
+ var error = $root.Wa6.HandshakeMessage.ServerHello.verify(message.serverHello);
3833
+ if (error) return "serverHello." + error;
3834
+ }
3835
+ }
3836
+ if (message.clientFinish != null && message.hasOwnProperty("clientFinish")) {
3837
+ properties._clientFinish = 1;
3838
+ {
3839
+ var error = $root.Wa6.HandshakeMessage.ClientFinish.verify(
3840
+ message.clientFinish
3841
+ );
3842
+ if (error) return "clientFinish." + error;
3843
+ }
3844
+ }
3845
+ return null;
3846
+ };
3847
+ HandshakeMessage.fromObject = function fromObject(object) {
3848
+ if (object instanceof $root.Wa6.HandshakeMessage) return object;
3849
+ var message = new $root.Wa6.HandshakeMessage();
3850
+ if (object.clientHello != null) {
3851
+ if (typeof object.clientHello !== "object")
3852
+ throw TypeError(".Wa6.HandshakeMessage.clientHello: object expected");
3853
+ message.clientHello = $root.Wa6.HandshakeMessage.ClientHello.fromObject(
3854
+ object.clientHello
3855
+ );
3856
+ }
3857
+ if (object.serverHello != null) {
3858
+ if (typeof object.serverHello !== "object")
3859
+ throw TypeError(".Wa6.HandshakeMessage.serverHello: object expected");
3860
+ message.serverHello = $root.Wa6.HandshakeMessage.ServerHello.fromObject(
3861
+ object.serverHello
3862
+ );
3863
+ }
3864
+ if (object.clientFinish != null) {
3865
+ if (typeof object.clientFinish !== "object")
3866
+ throw TypeError(".Wa6.HandshakeMessage.clientFinish: object expected");
3867
+ message.clientFinish = $root.Wa6.HandshakeMessage.ClientFinish.fromObject(
3868
+ object.clientFinish
3869
+ );
3870
+ }
3871
+ return message;
3872
+ };
3873
+ HandshakeMessage.toObject = function toObject(message, options) {
3874
+ if (!options) options = {};
3875
+ var object = {};
3876
+ if (message.clientHello != null && message.hasOwnProperty("clientHello")) {
3877
+ object.clientHello = $root.Wa6.HandshakeMessage.ClientHello.toObject(
3878
+ message.clientHello,
3879
+ options
3880
+ );
3881
+ if (options.oneofs) object._clientHello = "clientHello";
3882
+ }
3883
+ if (message.serverHello != null && message.hasOwnProperty("serverHello")) {
3884
+ object.serverHello = $root.Wa6.HandshakeMessage.ServerHello.toObject(
3885
+ message.serverHello,
3886
+ options
3887
+ );
3888
+ if (options.oneofs) object._serverHello = "serverHello";
3889
+ }
3890
+ if (message.clientFinish != null && message.hasOwnProperty("clientFinish")) {
3891
+ object.clientFinish = $root.Wa6.HandshakeMessage.ClientFinish.toObject(
3892
+ message.clientFinish,
3893
+ options
3894
+ );
3895
+ if (options.oneofs) object._clientFinish = "clientFinish";
3896
+ }
3897
+ return object;
3898
+ };
3899
+ HandshakeMessage.prototype.toJSON = function toJSON() {
3900
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3901
+ };
3902
+ HandshakeMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
3903
+ if (typeUrlPrefix === undefined) {
3904
+ typeUrlPrefix = "type.googleapis.com";
3905
+ }
3906
+ return typeUrlPrefix + "/Wa6.HandshakeMessage";
3907
+ };
3908
+ HandshakeMessage.ClientFinish = (function () {
3909
+ function ClientFinish(properties) {
3910
+ if (properties)
3911
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3912
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
3913
+ }
3914
+ ClientFinish.prototype["static"] = null;
3915
+ ClientFinish.prototype.payload = null;
3916
+ ClientFinish.prototype.extendedCiphertext = null;
3917
+ var $oneOfFields;
3918
+ Object.defineProperty(ClientFinish.prototype, "_static", {
3919
+ get: $util.oneOfGetter(($oneOfFields = ["static"])),
3920
+ set: $util.oneOfSetter($oneOfFields),
3921
+ });
3922
+ Object.defineProperty(ClientFinish.prototype, "_payload", {
3923
+ get: $util.oneOfGetter(($oneOfFields = ["payload"])),
3924
+ set: $util.oneOfSetter($oneOfFields),
3925
+ });
3926
+ Object.defineProperty(ClientFinish.prototype, "_extendedCiphertext", {
3927
+ get: $util.oneOfGetter(($oneOfFields = ["extendedCiphertext"])),
3928
+ set: $util.oneOfSetter($oneOfFields),
3929
+ });
3930
+ ClientFinish.create = function create(properties) {
3931
+ return new ClientFinish(properties);
3932
+ };
3933
+ ClientFinish.encode = function encode(message, writer) {
3934
+ if (!writer) writer = $Writer.create();
3935
+ if (message["static"] != null && Object.hasOwnProperty.call(message, "static"))
3936
+ writer.uint32(10).bytes(message["static"]);
3937
+ if (message.payload != null && Object.hasOwnProperty.call(message, "payload"))
3938
+ writer.uint32(18).bytes(message.payload);
3939
+ if (
3940
+ message.extendedCiphertext != null &&
3941
+ Object.hasOwnProperty.call(message, "extendedCiphertext")
3942
+ )
3943
+ writer.uint32(26).bytes(message.extendedCiphertext);
3944
+ return writer;
3945
+ };
3946
+ ClientFinish.encodeDelimited = function encodeDelimited(message, writer) {
3947
+ return this.encode(message, writer).ldelim();
3948
+ };
3949
+ ClientFinish.decode = function decode(reader, length, error) {
3950
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
3951
+ var end = length === undefined ? reader.len : reader.pos + length,
3952
+ message = new $root.Wa6.HandshakeMessage.ClientFinish();
3953
+ while (reader.pos < end) {
3954
+ var tag = reader.uint32();
3955
+ if (tag === error) break;
3956
+ switch (tag >>> 3) {
3957
+ case 1: {
3958
+ message["static"] = reader.bytes();
3959
+ break;
3960
+ }
3961
+ case 2: {
3962
+ message.payload = reader.bytes();
3963
+ break;
3964
+ }
3965
+ case 3: {
3966
+ message.extendedCiphertext = reader.bytes();
3967
+ break;
3968
+ }
3969
+ default:
3970
+ reader.skipType(tag & 7);
3971
+ break;
3972
+ }
3973
+ }
3974
+ return message;
3975
+ };
3976
+ ClientFinish.decodeDelimited = function decodeDelimited(reader) {
3977
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
3978
+ return this.decode(reader, reader.uint32());
3979
+ };
3980
+ ClientFinish.verify = function verify(message) {
3981
+ if (typeof message !== "object" || message === null) return "object expected";
3982
+ var properties = {};
3983
+ if (message["static"] != null && message.hasOwnProperty("static")) {
3984
+ properties._static = 1;
3985
+ if (
3986
+ !(
3987
+ (message["static"] && typeof message["static"].length === "number") ||
3988
+ $util.isString(message["static"])
3989
+ )
3990
+ )
3991
+ return "static: buffer expected";
3992
+ }
3993
+ if (message.payload != null && message.hasOwnProperty("payload")) {
3994
+ properties._payload = 1;
3995
+ if (
3996
+ !(
3997
+ (message.payload && typeof message.payload.length === "number") ||
3998
+ $util.isString(message.payload)
3999
+ )
4000
+ )
4001
+ return "payload: buffer expected";
4002
+ }
4003
+ if (
4004
+ message.extendedCiphertext != null &&
4005
+ message.hasOwnProperty("extendedCiphertext")
4006
+ ) {
4007
+ properties._extendedCiphertext = 1;
4008
+ if (
4009
+ !(
4010
+ (message.extendedCiphertext &&
4011
+ typeof message.extendedCiphertext.length === "number") ||
4012
+ $util.isString(message.extendedCiphertext)
4013
+ )
4014
+ )
4015
+ return "extendedCiphertext: buffer expected";
4016
+ }
4017
+ return null;
4018
+ };
4019
+ ClientFinish.fromObject = function fromObject(object) {
4020
+ if (object instanceof $root.Wa6.HandshakeMessage.ClientFinish) return object;
4021
+ var message = new $root.Wa6.HandshakeMessage.ClientFinish();
4022
+ if (object["static"] != null)
4023
+ if (typeof object["static"] === "string")
4024
+ $util.base64.decode(
4025
+ object["static"],
4026
+ (message["static"] = $util.newBuffer(
4027
+ $util.base64.length(object["static"])
4028
+ )),
4029
+ 0
4030
+ );
4031
+ else if (object["static"].length >= 0) message["static"] = object["static"];
4032
+ if (object.payload != null)
4033
+ if (typeof object.payload === "string")
4034
+ $util.base64.decode(
4035
+ object.payload,
4036
+ (message.payload = $util.newBuffer(
4037
+ $util.base64.length(object.payload)
4038
+ )),
4039
+ 0
4040
+ );
4041
+ else if (object.payload.length >= 0) message.payload = object.payload;
4042
+ if (object.extendedCiphertext != null)
4043
+ if (typeof object.extendedCiphertext === "string")
4044
+ $util.base64.decode(
4045
+ object.extendedCiphertext,
4046
+ (message.extendedCiphertext = $util.newBuffer(
4047
+ $util.base64.length(object.extendedCiphertext)
4048
+ )),
4049
+ 0
4050
+ );
4051
+ else if (object.extendedCiphertext.length >= 0)
4052
+ message.extendedCiphertext = object.extendedCiphertext;
4053
+ return message;
4054
+ };
4055
+ ClientFinish.toObject = function toObject(message, options) {
4056
+ if (!options) options = {};
4057
+ var object = {};
4058
+ if (message["static"] != null && message.hasOwnProperty("static")) {
4059
+ object["static"] =
4060
+ options.bytes === String
4061
+ ? $util.base64.encode(message["static"], 0, message["static"].length)
4062
+ : options.bytes === Array
4063
+ ? Array.prototype.slice.call(message["static"])
4064
+ : message["static"];
4065
+ if (options.oneofs) object._static = "static";
4066
+ }
4067
+ if (message.payload != null && message.hasOwnProperty("payload")) {
4068
+ object.payload =
4069
+ options.bytes === String
4070
+ ? $util.base64.encode(message.payload, 0, message.payload.length)
4071
+ : options.bytes === Array
4072
+ ? Array.prototype.slice.call(message.payload)
4073
+ : message.payload;
4074
+ if (options.oneofs) object._payload = "payload";
4075
+ }
4076
+ if (
4077
+ message.extendedCiphertext != null &&
4078
+ message.hasOwnProperty("extendedCiphertext")
4079
+ ) {
4080
+ object.extendedCiphertext =
4081
+ options.bytes === String
4082
+ ? $util.base64.encode(
4083
+ message.extendedCiphertext,
4084
+ 0,
4085
+ message.extendedCiphertext.length
4086
+ )
4087
+ : options.bytes === Array
4088
+ ? Array.prototype.slice.call(message.extendedCiphertext)
4089
+ : message.extendedCiphertext;
4090
+ if (options.oneofs) object._extendedCiphertext = "extendedCiphertext";
4091
+ }
4092
+ return object;
4093
+ };
4094
+ ClientFinish.prototype.toJSON = function toJSON() {
4095
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
4096
+ };
4097
+ ClientFinish.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
4098
+ if (typeUrlPrefix === undefined) {
4099
+ typeUrlPrefix = "type.googleapis.com";
4100
+ }
4101
+ return typeUrlPrefix + "/Wa6.HandshakeMessage.ClientFinish";
4102
+ };
4103
+ return ClientFinish;
4104
+ })();
4105
+ HandshakeMessage.ClientHello = (function () {
4106
+ function ClientHello(properties) {
4107
+ if (properties)
4108
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
4109
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
4110
+ }
4111
+ ClientHello.prototype.ephemeral = null;
4112
+ ClientHello.prototype["static"] = null;
4113
+ ClientHello.prototype.payload = null;
4114
+ ClientHello.prototype.useExtended = null;
4115
+ ClientHello.prototype.extendedCiphertext = null;
4116
+ var $oneOfFields;
4117
+ Object.defineProperty(ClientHello.prototype, "_ephemeral", {
4118
+ get: $util.oneOfGetter(($oneOfFields = ["ephemeral"])),
4119
+ set: $util.oneOfSetter($oneOfFields),
4120
+ });
4121
+ Object.defineProperty(ClientHello.prototype, "_static", {
4122
+ get: $util.oneOfGetter(($oneOfFields = ["static"])),
4123
+ set: $util.oneOfSetter($oneOfFields),
4124
+ });
4125
+ Object.defineProperty(ClientHello.prototype, "_payload", {
4126
+ get: $util.oneOfGetter(($oneOfFields = ["payload"])),
4127
+ set: $util.oneOfSetter($oneOfFields),
4128
+ });
4129
+ Object.defineProperty(ClientHello.prototype, "_useExtended", {
4130
+ get: $util.oneOfGetter(($oneOfFields = ["useExtended"])),
4131
+ set: $util.oneOfSetter($oneOfFields),
4132
+ });
4133
+ Object.defineProperty(ClientHello.prototype, "_extendedCiphertext", {
4134
+ get: $util.oneOfGetter(($oneOfFields = ["extendedCiphertext"])),
4135
+ set: $util.oneOfSetter($oneOfFields),
4136
+ });
4137
+ ClientHello.create = function create(properties) {
4138
+ return new ClientHello(properties);
4139
+ };
4140
+ ClientHello.encode = function encode(message, writer) {
4141
+ if (!writer) writer = $Writer.create();
4142
+ if (message.ephemeral != null && Object.hasOwnProperty.call(message, "ephemeral"))
4143
+ writer.uint32(10).bytes(message.ephemeral);
4144
+ if (message["static"] != null && Object.hasOwnProperty.call(message, "static"))
4145
+ writer.uint32(18).bytes(message["static"]);
4146
+ if (message.payload != null && Object.hasOwnProperty.call(message, "payload"))
4147
+ writer.uint32(26).bytes(message.payload);
4148
+ if (
4149
+ message.useExtended != null &&
4150
+ Object.hasOwnProperty.call(message, "useExtended")
4151
+ )
4152
+ writer.uint32(32).bool(message.useExtended);
4153
+ if (
4154
+ message.extendedCiphertext != null &&
4155
+ Object.hasOwnProperty.call(message, "extendedCiphertext")
4156
+ )
4157
+ writer.uint32(42).bytes(message.extendedCiphertext);
4158
+ return writer;
4159
+ };
4160
+ ClientHello.encodeDelimited = function encodeDelimited(message, writer) {
4161
+ return this.encode(message, writer).ldelim();
4162
+ };
4163
+ ClientHello.decode = function decode(reader, length, error) {
4164
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
4165
+ var end = length === undefined ? reader.len : reader.pos + length,
4166
+ message = new $root.Wa6.HandshakeMessage.ClientHello();
4167
+ while (reader.pos < end) {
4168
+ var tag = reader.uint32();
4169
+ if (tag === error) break;
4170
+ switch (tag >>> 3) {
4171
+ case 1: {
4172
+ message.ephemeral = reader.bytes();
4173
+ break;
4174
+ }
4175
+ case 2: {
4176
+ message["static"] = reader.bytes();
4177
+ break;
4178
+ }
4179
+ case 3: {
4180
+ message.payload = reader.bytes();
4181
+ break;
4182
+ }
4183
+ case 4: {
4184
+ message.useExtended = reader.bool();
4185
+ break;
4186
+ }
4187
+ case 5: {
4188
+ message.extendedCiphertext = reader.bytes();
4189
+ break;
4190
+ }
4191
+ default:
4192
+ reader.skipType(tag & 7);
4193
+ break;
4194
+ }
4195
+ }
4196
+ return message;
4197
+ };
4198
+ ClientHello.decodeDelimited = function decodeDelimited(reader) {
4199
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
4200
+ return this.decode(reader, reader.uint32());
4201
+ };
4202
+ ClientHello.verify = function verify(message) {
4203
+ if (typeof message !== "object" || message === null) return "object expected";
4204
+ var properties = {};
4205
+ if (message.ephemeral != null && message.hasOwnProperty("ephemeral")) {
4206
+ properties._ephemeral = 1;
4207
+ if (
4208
+ !(
4209
+ (message.ephemeral && typeof message.ephemeral.length === "number") ||
4210
+ $util.isString(message.ephemeral)
4211
+ )
4212
+ )
4213
+ return "ephemeral: buffer expected";
4214
+ }
4215
+ if (message["static"] != null && message.hasOwnProperty("static")) {
4216
+ properties._static = 1;
4217
+ if (
4218
+ !(
4219
+ (message["static"] && typeof message["static"].length === "number") ||
4220
+ $util.isString(message["static"])
4221
+ )
4222
+ )
4223
+ return "static: buffer expected";
4224
+ }
4225
+ if (message.payload != null && message.hasOwnProperty("payload")) {
4226
+ properties._payload = 1;
4227
+ if (
4228
+ !(
4229
+ (message.payload && typeof message.payload.length === "number") ||
4230
+ $util.isString(message.payload)
4231
+ )
4232
+ )
4233
+ return "payload: buffer expected";
4234
+ }
4235
+ if (message.useExtended != null && message.hasOwnProperty("useExtended")) {
4236
+ properties._useExtended = 1;
4237
+ if (typeof message.useExtended !== "boolean")
4238
+ return "useExtended: boolean expected";
4239
+ }
4240
+ if (
4241
+ message.extendedCiphertext != null &&
4242
+ message.hasOwnProperty("extendedCiphertext")
4243
+ ) {
4244
+ properties._extendedCiphertext = 1;
4245
+ if (
4246
+ !(
4247
+ (message.extendedCiphertext &&
4248
+ typeof message.extendedCiphertext.length === "number") ||
4249
+ $util.isString(message.extendedCiphertext)
4250
+ )
4251
+ )
4252
+ return "extendedCiphertext: buffer expected";
4253
+ }
4254
+ return null;
4255
+ };
4256
+ ClientHello.fromObject = function fromObject(object) {
4257
+ if (object instanceof $root.Wa6.HandshakeMessage.ClientHello) return object;
4258
+ var message = new $root.Wa6.HandshakeMessage.ClientHello();
4259
+ if (object.ephemeral != null)
4260
+ if (typeof object.ephemeral === "string")
4261
+ $util.base64.decode(
4262
+ object.ephemeral,
4263
+ (message.ephemeral = $util.newBuffer(
4264
+ $util.base64.length(object.ephemeral)
4265
+ )),
4266
+ 0
4267
+ );
4268
+ else if (object.ephemeral.length >= 0) message.ephemeral = object.ephemeral;
4269
+ if (object["static"] != null)
4270
+ if (typeof object["static"] === "string")
4271
+ $util.base64.decode(
4272
+ object["static"],
4273
+ (message["static"] = $util.newBuffer(
4274
+ $util.base64.length(object["static"])
4275
+ )),
4276
+ 0
4277
+ );
4278
+ else if (object["static"].length >= 0) message["static"] = object["static"];
4279
+ if (object.payload != null)
4280
+ if (typeof object.payload === "string")
4281
+ $util.base64.decode(
4282
+ object.payload,
4283
+ (message.payload = $util.newBuffer(
4284
+ $util.base64.length(object.payload)
4285
+ )),
4286
+ 0
4287
+ );
4288
+ else if (object.payload.length >= 0) message.payload = object.payload;
4289
+ if (object.useExtended != null) message.useExtended = Boolean(object.useExtended);
4290
+ if (object.extendedCiphertext != null)
4291
+ if (typeof object.extendedCiphertext === "string")
4292
+ $util.base64.decode(
4293
+ object.extendedCiphertext,
4294
+ (message.extendedCiphertext = $util.newBuffer(
4295
+ $util.base64.length(object.extendedCiphertext)
4296
+ )),
4297
+ 0
4298
+ );
4299
+ else if (object.extendedCiphertext.length >= 0)
4300
+ message.extendedCiphertext = object.extendedCiphertext;
4301
+ return message;
4302
+ };
4303
+ ClientHello.toObject = function toObject(message, options) {
4304
+ if (!options) options = {};
4305
+ var object = {};
4306
+ if (message.ephemeral != null && message.hasOwnProperty("ephemeral")) {
4307
+ object.ephemeral =
4308
+ options.bytes === String
4309
+ ? $util.base64.encode(message.ephemeral, 0, message.ephemeral.length)
4310
+ : options.bytes === Array
4311
+ ? Array.prototype.slice.call(message.ephemeral)
4312
+ : message.ephemeral;
4313
+ if (options.oneofs) object._ephemeral = "ephemeral";
4314
+ }
4315
+ if (message["static"] != null && message.hasOwnProperty("static")) {
4316
+ object["static"] =
4317
+ options.bytes === String
4318
+ ? $util.base64.encode(message["static"], 0, message["static"].length)
4319
+ : options.bytes === Array
4320
+ ? Array.prototype.slice.call(message["static"])
4321
+ : message["static"];
4322
+ if (options.oneofs) object._static = "static";
4323
+ }
4324
+ if (message.payload != null && message.hasOwnProperty("payload")) {
4325
+ object.payload =
4326
+ options.bytes === String
4327
+ ? $util.base64.encode(message.payload, 0, message.payload.length)
4328
+ : options.bytes === Array
4329
+ ? Array.prototype.slice.call(message.payload)
4330
+ : message.payload;
4331
+ if (options.oneofs) object._payload = "payload";
4332
+ }
4333
+ if (message.useExtended != null && message.hasOwnProperty("useExtended")) {
4334
+ object.useExtended = message.useExtended;
4335
+ if (options.oneofs) object._useExtended = "useExtended";
4336
+ }
4337
+ if (
4338
+ message.extendedCiphertext != null &&
4339
+ message.hasOwnProperty("extendedCiphertext")
4340
+ ) {
4341
+ object.extendedCiphertext =
4342
+ options.bytes === String
4343
+ ? $util.base64.encode(
4344
+ message.extendedCiphertext,
4345
+ 0,
4346
+ message.extendedCiphertext.length
4347
+ )
4348
+ : options.bytes === Array
4349
+ ? Array.prototype.slice.call(message.extendedCiphertext)
4350
+ : message.extendedCiphertext;
4351
+ if (options.oneofs) object._extendedCiphertext = "extendedCiphertext";
4352
+ }
4353
+ return object;
4354
+ };
4355
+ ClientHello.prototype.toJSON = function toJSON() {
4356
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
4357
+ };
4358
+ ClientHello.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
4359
+ if (typeUrlPrefix === undefined) {
4360
+ typeUrlPrefix = "type.googleapis.com";
4361
+ }
4362
+ return typeUrlPrefix + "/Wa6.HandshakeMessage.ClientHello";
4363
+ };
4364
+ return ClientHello;
4365
+ })();
4366
+ HandshakeMessage.ServerHello = (function () {
4367
+ function ServerHello(properties) {
4368
+ if (properties)
4369
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
4370
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
4371
+ }
4372
+ ServerHello.prototype.ephemeral = null;
4373
+ ServerHello.prototype["static"] = null;
4374
+ ServerHello.prototype.payload = null;
4375
+ ServerHello.prototype.extendedStatic = null;
4376
+ var $oneOfFields;
4377
+ Object.defineProperty(ServerHello.prototype, "_ephemeral", {
4378
+ get: $util.oneOfGetter(($oneOfFields = ["ephemeral"])),
4379
+ set: $util.oneOfSetter($oneOfFields),
4380
+ });
4381
+ Object.defineProperty(ServerHello.prototype, "_static", {
4382
+ get: $util.oneOfGetter(($oneOfFields = ["static"])),
4383
+ set: $util.oneOfSetter($oneOfFields),
4384
+ });
4385
+ Object.defineProperty(ServerHello.prototype, "_payload", {
4386
+ get: $util.oneOfGetter(($oneOfFields = ["payload"])),
4387
+ set: $util.oneOfSetter($oneOfFields),
4388
+ });
4389
+ Object.defineProperty(ServerHello.prototype, "_extendedStatic", {
4390
+ get: $util.oneOfGetter(($oneOfFields = ["extendedStatic"])),
4391
+ set: $util.oneOfSetter($oneOfFields),
4392
+ });
4393
+ ServerHello.create = function create(properties) {
4394
+ return new ServerHello(properties);
4395
+ };
4396
+ ServerHello.encode = function encode(message, writer) {
4397
+ if (!writer) writer = $Writer.create();
4398
+ if (message.ephemeral != null && Object.hasOwnProperty.call(message, "ephemeral"))
4399
+ writer.uint32(10).bytes(message.ephemeral);
4400
+ if (message["static"] != null && Object.hasOwnProperty.call(message, "static"))
4401
+ writer.uint32(18).bytes(message["static"]);
4402
+ if (message.payload != null && Object.hasOwnProperty.call(message, "payload"))
4403
+ writer.uint32(26).bytes(message.payload);
4404
+ if (
4405
+ message.extendedStatic != null &&
4406
+ Object.hasOwnProperty.call(message, "extendedStatic")
4407
+ )
4408
+ writer.uint32(34).bytes(message.extendedStatic);
4409
+ return writer;
4410
+ };
4411
+ ServerHello.encodeDelimited = function encodeDelimited(message, writer) {
4412
+ return this.encode(message, writer).ldelim();
4413
+ };
4414
+ ServerHello.decode = function decode(reader, length, error) {
4415
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
4416
+ var end = length === undefined ? reader.len : reader.pos + length,
4417
+ message = new $root.Wa6.HandshakeMessage.ServerHello();
4418
+ while (reader.pos < end) {
4419
+ var tag = reader.uint32();
4420
+ if (tag === error) break;
4421
+ switch (tag >>> 3) {
4422
+ case 1: {
4423
+ message.ephemeral = reader.bytes();
4424
+ break;
4425
+ }
4426
+ case 2: {
4427
+ message["static"] = reader.bytes();
4428
+ break;
4429
+ }
4430
+ case 3: {
4431
+ message.payload = reader.bytes();
4432
+ break;
4433
+ }
4434
+ case 4: {
4435
+ message.extendedStatic = reader.bytes();
4436
+ break;
4437
+ }
4438
+ default:
4439
+ reader.skipType(tag & 7);
4440
+ break;
4441
+ }
4442
+ }
4443
+ return message;
4444
+ };
4445
+ ServerHello.decodeDelimited = function decodeDelimited(reader) {
4446
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
4447
+ return this.decode(reader, reader.uint32());
4448
+ };
4449
+ ServerHello.verify = function verify(message) {
4450
+ if (typeof message !== "object" || message === null) return "object expected";
4451
+ var properties = {};
4452
+ if (message.ephemeral != null && message.hasOwnProperty("ephemeral")) {
4453
+ properties._ephemeral = 1;
4454
+ if (
4455
+ !(
4456
+ (message.ephemeral && typeof message.ephemeral.length === "number") ||
4457
+ $util.isString(message.ephemeral)
4458
+ )
4459
+ )
4460
+ return "ephemeral: buffer expected";
4461
+ }
4462
+ if (message["static"] != null && message.hasOwnProperty("static")) {
4463
+ properties._static = 1;
4464
+ if (
4465
+ !(
4466
+ (message["static"] && typeof message["static"].length === "number") ||
4467
+ $util.isString(message["static"])
4468
+ )
4469
+ )
4470
+ return "static: buffer expected";
4471
+ }
4472
+ if (message.payload != null && message.hasOwnProperty("payload")) {
4473
+ properties._payload = 1;
4474
+ if (
4475
+ !(
4476
+ (message.payload && typeof message.payload.length === "number") ||
4477
+ $util.isString(message.payload)
4478
+ )
4479
+ )
4480
+ return "payload: buffer expected";
4481
+ }
4482
+ if (message.extendedStatic != null && message.hasOwnProperty("extendedStatic")) {
4483
+ properties._extendedStatic = 1;
4484
+ if (
4485
+ !(
4486
+ (message.extendedStatic &&
4487
+ typeof message.extendedStatic.length === "number") ||
4488
+ $util.isString(message.extendedStatic)
4489
+ )
4490
+ )
4491
+ return "extendedStatic: buffer expected";
4492
+ }
4493
+ return null;
4494
+ };
4495
+ ServerHello.fromObject = function fromObject(object) {
4496
+ if (object instanceof $root.Wa6.HandshakeMessage.ServerHello) return object;
4497
+ var message = new $root.Wa6.HandshakeMessage.ServerHello();
4498
+ if (object.ephemeral != null)
4499
+ if (typeof object.ephemeral === "string")
4500
+ $util.base64.decode(
4501
+ object.ephemeral,
4502
+ (message.ephemeral = $util.newBuffer(
4503
+ $util.base64.length(object.ephemeral)
4504
+ )),
4505
+ 0
4506
+ );
4507
+ else if (object.ephemeral.length >= 0) message.ephemeral = object.ephemeral;
4508
+ if (object["static"] != null)
4509
+ if (typeof object["static"] === "string")
4510
+ $util.base64.decode(
4511
+ object["static"],
4512
+ (message["static"] = $util.newBuffer(
4513
+ $util.base64.length(object["static"])
4514
+ )),
4515
+ 0
4516
+ );
4517
+ else if (object["static"].length >= 0) message["static"] = object["static"];
4518
+ if (object.payload != null)
4519
+ if (typeof object.payload === "string")
4520
+ $util.base64.decode(
4521
+ object.payload,
4522
+ (message.payload = $util.newBuffer(
4523
+ $util.base64.length(object.payload)
4524
+ )),
4525
+ 0
4526
+ );
4527
+ else if (object.payload.length >= 0) message.payload = object.payload;
4528
+ if (object.extendedStatic != null)
4529
+ if (typeof object.extendedStatic === "string")
4530
+ $util.base64.decode(
4531
+ object.extendedStatic,
4532
+ (message.extendedStatic = $util.newBuffer(
4533
+ $util.base64.length(object.extendedStatic)
4534
+ )),
4535
+ 0
4536
+ );
4537
+ else if (object.extendedStatic.length >= 0)
4538
+ message.extendedStatic = object.extendedStatic;
4539
+ return message;
4540
+ };
4541
+ ServerHello.toObject = function toObject(message, options) {
4542
+ if (!options) options = {};
4543
+ var object = {};
4544
+ if (message.ephemeral != null && message.hasOwnProperty("ephemeral")) {
4545
+ object.ephemeral =
4546
+ options.bytes === String
4547
+ ? $util.base64.encode(message.ephemeral, 0, message.ephemeral.length)
4548
+ : options.bytes === Array
4549
+ ? Array.prototype.slice.call(message.ephemeral)
4550
+ : message.ephemeral;
4551
+ if (options.oneofs) object._ephemeral = "ephemeral";
4552
+ }
4553
+ if (message["static"] != null && message.hasOwnProperty("static")) {
4554
+ object["static"] =
4555
+ options.bytes === String
4556
+ ? $util.base64.encode(message["static"], 0, message["static"].length)
4557
+ : options.bytes === Array
4558
+ ? Array.prototype.slice.call(message["static"])
4559
+ : message["static"];
4560
+ if (options.oneofs) object._static = "static";
4561
+ }
4562
+ if (message.payload != null && message.hasOwnProperty("payload")) {
4563
+ object.payload =
4564
+ options.bytes === String
4565
+ ? $util.base64.encode(message.payload, 0, message.payload.length)
4566
+ : options.bytes === Array
4567
+ ? Array.prototype.slice.call(message.payload)
4568
+ : message.payload;
4569
+ if (options.oneofs) object._payload = "payload";
4570
+ }
4571
+ if (message.extendedStatic != null && message.hasOwnProperty("extendedStatic")) {
4572
+ object.extendedStatic =
4573
+ options.bytes === String
4574
+ ? $util.base64.encode(
4575
+ message.extendedStatic,
4576
+ 0,
4577
+ message.extendedStatic.length
4578
+ )
4579
+ : options.bytes === Array
4580
+ ? Array.prototype.slice.call(message.extendedStatic)
4581
+ : message.extendedStatic;
4582
+ if (options.oneofs) object._extendedStatic = "extendedStatic";
4583
+ }
4584
+ return object;
4585
+ };
4586
+ ServerHello.prototype.toJSON = function toJSON() {
4587
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
4588
+ };
4589
+ ServerHello.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
4590
+ if (typeUrlPrefix === undefined) {
4591
+ typeUrlPrefix = "type.googleapis.com";
4592
+ }
4593
+ return typeUrlPrefix + "/Wa6.HandshakeMessage.ServerHello";
4594
+ };
4595
+ return ServerHello;
4596
+ })();
4597
+ return HandshakeMessage;
4598
+ })();
4599
+ return Wa6;
4600
+ })();
4601
+ module.exports = $root;