@leofcoin/messages 1.1.1 → 1.2.0

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.
package/dist/messages.esm CHANGED
@@ -1,593 +1,1376 @@
1
1
  /******/ var __webpack_modules__ = ({
2
2
 
3
- /***/ 7187:
4
- /***/ ((module) => {
5
-
6
- // Copyright Joyent, Inc. and other Node contributors.
7
- //
8
- // Permission is hereby granted, free of charge, to any person obtaining a
9
- // copy of this software and associated documentation files (the
10
- // "Software"), to deal in the Software without restriction, including
11
- // without limitation the rights to use, copy, modify, merge, publish,
12
- // distribute, sublicense, and/or sell copies of the Software, and to permit
13
- // persons to whom the Software is furnished to do so, subject to the
14
- // following conditions:
15
- //
16
- // The above copyright notice and this permission notice shall be included
17
- // in all copies or substantial portions of the Software.
18
- //
19
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
22
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
23
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
26
-
27
-
28
-
29
- var R = typeof Reflect === 'object' ? Reflect : null
30
- var ReflectApply = R && typeof R.apply === 'function'
31
- ? R.apply
32
- : function ReflectApply(target, receiver, args) {
33
- return Function.prototype.apply.call(target, receiver, args);
34
- }
35
-
36
- var ReflectOwnKeys
37
- if (R && typeof R.ownKeys === 'function') {
38
- ReflectOwnKeys = R.ownKeys
39
- } else if (Object.getOwnPropertySymbols) {
40
- ReflectOwnKeys = function ReflectOwnKeys(target) {
41
- return Object.getOwnPropertyNames(target)
42
- .concat(Object.getOwnPropertySymbols(target));
43
- };
44
- } else {
45
- ReflectOwnKeys = function ReflectOwnKeys(target) {
46
- return Object.getOwnPropertyNames(target);
47
- };
48
- }
3
+ /***/ 427:
4
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
49
5
 
50
- function ProcessEmitWarning(warning) {
51
- if (console && console.warn) console.warn(warning);
52
- }
6
+ var __webpack_unused_export__;
53
7
 
54
- var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
55
- return value !== value;
56
- }
57
8
 
58
- function EventEmitter() {
59
- EventEmitter.init.call(this);
60
- }
61
- module.exports = EventEmitter;
62
- module.exports.once = once;
9
+ __webpack_unused_export__ = ({ value: true });
63
10
 
64
- // Backwards-compat with node 0.10.x
65
- EventEmitter.EventEmitter = EventEmitter;
11
+ var bs32 = __webpack_require__(894);
12
+ var bs58 = __webpack_require__(158);
13
+ var isHex = __webpack_require__(187);
14
+ var varint = __webpack_require__(676);
15
+ var createKeccakHash = __webpack_require__(811);
66
16
 
67
- EventEmitter.prototype._events = undefined;
68
- EventEmitter.prototype._eventsCount = 0;
69
- EventEmitter.prototype._maxListeners = undefined;
17
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
70
18
 
71
- // By default EventEmitters will print a warning if more than 10 listeners are
72
- // added to it. This is a useful default which helps finding memory leaks.
73
- var defaultMaxListeners = 10;
19
+ var bs32__default = /*#__PURE__*/_interopDefaultLegacy(bs32);
20
+ var bs58__default = /*#__PURE__*/_interopDefaultLegacy(bs58);
21
+ var isHex__default = /*#__PURE__*/_interopDefaultLegacy(isHex);
22
+ var varint__default = /*#__PURE__*/_interopDefaultLegacy(varint);
23
+ var createKeccakHash__default = /*#__PURE__*/_interopDefaultLegacy(createKeccakHash);
74
24
 
75
- function checkListener(listener) {
76
- if (typeof listener !== 'function') {
77
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
78
- }
25
+ class BasicInterface$1 {
26
+ handleDecode() {
27
+ if (!this.decode) throw new Error('bad implementation: needs decode func')
28
+ return this.decode()
29
+ }
30
+
31
+ handleEncode() {
32
+ if (!this.encode) throw new Error('bad implementation: needs encode func')
33
+ return this.encode()
34
+ }
35
+ isHex(string) {
36
+ return isHex__default["default"](string)
37
+ }
38
+ isBase32(string) {
39
+ return bs32__default["default"].isBase32(string)
40
+ }
41
+ isBase58(string) {
42
+ return bs58__default["default"].isBase58(string)
43
+ }
44
+ /**
45
+ * @param {String} encoded
46
+ */
47
+ fromBs32(encoded) {
48
+ this.encoded = bs32__default["default"].decode(encoded);
49
+ return this.handleDecode()
50
+ }
51
+
52
+ /**
53
+ * @param {String} encoded
54
+ */
55
+ fromBs58(encoded) {
56
+ this.encoded = bs58__default["default"].decode(encoded);
57
+ return this.handleDecode()
58
+ }
59
+
60
+ async toArray() {
61
+ const array = [];
62
+ for await (const value of this.encoded.values()) {
63
+ array.push(value);
64
+ }
65
+ return array
66
+ }
67
+
68
+ fromString(string) {
69
+ this.encoded = new Uint8Array(string.split(','));
70
+ return this.handleDecode()
71
+ }
72
+
73
+ fromArray(array) {
74
+ this.encoded = new Uint8Array([...array]);
75
+ return this.handleDecode()
76
+ }
77
+
78
+ /**
79
+ * @param {Buffer} encoded
80
+ */
81
+ fromEncoded(encoded) {
82
+ this.encoded = encoded;
83
+ return this.handleDecode()
84
+ }
85
+
86
+ /**
87
+ * @param {String} encoded
88
+ */
89
+ fromHex(encoded) {
90
+ this.encoded = Buffer.from(encoded, 'hex');
91
+ return this.handleDecode()
92
+ }
93
+
94
+ async toString(encoding = 'utf8') {
95
+ if (!this.encoded) await this.handleEncode();
96
+ return this.encoded.toString(encoding)
97
+ }
98
+
99
+ /**
100
+ * @return {String} encoded
101
+ */
102
+ toHex() {
103
+ return this.toString('hex')
104
+ }
105
+
106
+ /**
107
+ * @return {String} encoded
108
+ */
109
+ async toBs32() {
110
+ if (!this.encoded) await this.handleEncode();
111
+ return bs32__default["default"].encode(this.encoded)
112
+ }
113
+
114
+ /**
115
+ * @return {String} encoded
116
+ */
117
+ async toBs58() {
118
+ if (!this.encoded) await this.handleEncode();
119
+ return bs58__default["default"].encode(this.encoded)
120
+ }
121
+
122
+ /**
123
+ * @param {Object} data
124
+ */
125
+ create(data) {
126
+ const decoded = {};
127
+ if (this.keys?.length > 0) {
128
+ for (const key of this.keys) {
129
+ Object.defineProperties(decoded, {
130
+ [key]: {
131
+ enumerable: true,
132
+ configurable: true,
133
+ set: (val) => value = data[key],
134
+ get: () => data[key]
135
+ }
136
+ });
137
+ }
138
+
139
+ this.decoded = decoded;
140
+ return this.encode()
141
+ }
142
+ }
79
143
  }
80
144
 
81
- Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
82
- enumerable: true,
83
- get: function() {
84
- return defaultMaxListeners;
85
- },
86
- set: function(arg) {
87
- if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
88
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
89
- }
90
- defaultMaxListeners = arg;
91
- }
92
- });
93
-
94
- EventEmitter.init = function() {
145
+ var codecs = {
146
+ // just a hash
147
+ 'disco-hash': {
148
+ codec: parseInt('30', 16),
149
+ hashAlg: 'dbl-keccak-256', // ,
150
+ // testnet: 'olivia'
151
+ },
152
+ 'peernet-peer-response': {
153
+ codec: parseInt('707072', 16),
154
+ hashAlg: 'keccak-256',
155
+ },
156
+ 'peernet-peer': {
157
+ codec: parseInt('7070', 16),
158
+ hashAlg: 'keccak-256',
159
+ },
160
+ 'peernet-dht': {
161
+ codec: parseInt('706468', 16),
162
+ hashAlg: 'keccak-256',
163
+ },
164
+ 'peernet-dht-response': {
165
+ codec: parseInt('706472', 16),
166
+ hashAlg: 'keccak-256',
167
+ },
168
+ // data
169
+ 'peernet-data': {
170
+ codec: parseInt('706461', 16),
171
+ hashAlg: 'keccak-256',
172
+ },
173
+ 'peernet-data-response': {
174
+ codec: parseInt('70646172', 16),
175
+ hashAlg: 'keccak-256',
176
+ },
177
+ // message
178
+ 'peernet-message': {
179
+ codec: parseInt('706d65', 16),
180
+ hashAlg: 'keccak-256',
181
+ },
182
+ // pubsub
183
+ 'peernet-ps': {
184
+ codec: parseInt('707073', 16),
185
+ hashAlg: 'keccak-256',
186
+ },
187
+ 'peernet-response': {
188
+ codec: parseInt('7072', 16),
189
+ hashAlg: 'keccak-256',
190
+ },
191
+ 'peernet-request': {
192
+ codec: parseInt('707271', 16),
193
+ hashAlg: 'keccak-256',
194
+ },
195
+ // normal block
196
+ 'leofcoin-block': {
197
+ codec: parseInt('6c62', 16),
198
+ hashAlg: 'dbl-keccak-512', // ,
199
+ // testnet: 'olivia'
200
+ },
201
+ 'leofcoin-tx': {
202
+ codec: parseInt('6c74', 16),
203
+ hashAlg: 'dbl-keccak-512', // ,
204
+ // testnet: 'olivia'
205
+ },
206
+ // itx
207
+ 'leofcoin-itx': {
208
+ codec: parseInt('6c69', 16),
209
+ hashAlg: 'keccak-512', // ,
210
+ // testnet: 'olivia'
211
+ },
212
+ // peer reputation
213
+ 'leofcoin-pr': {
214
+ codec: parseInt('6c70', 16),
215
+ hashAlg: 'keccak-256', // ,
216
+ // testnet: 'olivia'
217
+ },
218
+ // chat message
219
+ 'chat-message': {
220
+ codec: parseInt('636d', 16),
221
+ hashAlg: 'dbl-keccak-256',
222
+ },
223
+ 'peernet-file' : {
224
+ codec: parseInt('7066', 16),
225
+ hashAlg: 'keccak-256',
226
+ },
227
+ 'peernet-file-response' : {
228
+ codec: parseInt('706672', 16),
229
+ hashAlg: 'keccak-256',
230
+ }
231
+ };
95
232
 
96
- if (this._events === undefined ||
97
- this._events === Object.getPrototypeOf(this)._events) {
98
- this._events = Object.create(null);
99
- this._eventsCount = 0;
100
- }
101
-
102
- this._maxListeners = this._maxListeners || undefined;
103
- };
104
-
105
- // Obviously not all Emitters should be limited to 10. This function allows
106
- // that to be increased. Set to zero for unlimited.
107
- EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
108
- if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
109
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
110
- }
111
- this._maxListeners = n;
112
- return this;
113
- };
233
+ class PeernetCodec extends BasicInterface$1 {
234
+ get codecs() {
235
+ return {...globalThis.peernet.codecs, ...codecs}
236
+ }
237
+ constructor(buffer) {
238
+ super();
239
+ if (buffer) {
240
+ if (buffer instanceof Uint8Array) {
241
+ const codec = varint__default["default"].decode(buffer);
242
+ const name = this.getCodecName(codec);
243
+ if (name) {
244
+ this.name = name;
245
+ this.encoded = buffer;
246
+ this.decode(buffer);
247
+ } else {
248
+ this.encode(buffer);
249
+ }
250
+ } else if (buffer instanceof ArrayBuffer) {
251
+ const encoded = new Uint8Array(buffer.byteLength);
252
+
253
+ for (let i = 0; i < buffer.byteLength; i++) {
254
+ encoded[i] = buffer[i];
255
+ }
256
+ this.encoded = encoded;
257
+ // this.encoded = new Uint8Array(buffer, buffer.byteOffset, buffer.byteLength)
258
+ this.decode(buffer);
259
+ return
260
+ }
261
+ if (typeof buffer === 'string') {
262
+ if (this.codecs[buffer]) this.fromName(buffer);
263
+ else if (this.isHex(buffer)) this.fromHex(buffer);
264
+ else if (this.isBase32(buffer)) this.fromBs32(buffer);
265
+ else if (this.isBase58(buffer)) this.fromBs58(buffer);
266
+ else throw new Error(`unsupported string ${buffer}`)
267
+ }
268
+ if (!isNaN(buffer)) if (this.codecs[this.getCodecName(buffer)]) this.fromCodec(buffer);
269
+ }
270
+ }
271
+
272
+ fromEncoded(encoded) {
273
+ const codec = varint__default["default"].decode(encoded);
274
+ const name = this.getCodecName(codec);
275
+ this.name = name;
276
+ this.encoded = encoded;
277
+ this.decode(encoded);
278
+ }
279
+
280
+ getCodec(name) {
281
+ return this.codecs[name].codec
282
+ }
283
+
284
+ getCodecName(codec) {
285
+ return Object.keys(this.codecs).reduce((p, c) => {
286
+ const item = this.codecs[c];
287
+ if (item.codec === codec) return c;
288
+ else return p;
289
+ }, undefined)
290
+ }
291
+
292
+ getHashAlg(name) {
293
+ return this.codecs[name].hashAlg
294
+ }
295
+
296
+ fromCodec(codec) {
297
+ this.name = this.getCodecName(codec);
298
+ this.hashAlg = this.getHashAlg(this.name);
299
+
300
+ this.codec = this.getCodec(this.name);
301
+ this.codecBuffer = varint__default["default"].encode(codec);
302
+ }
303
+
304
+ fromName(name) {
305
+ const codec = this.getCodec(name);
306
+ this.name = name;
307
+ this.codec = codec;
308
+ this.hashAlg = this.getHashAlg(name);
309
+ this.codecBuffer = varint__default["default"].encode(codec);
310
+ }
311
+
312
+ decode() {
313
+ const codec = varint__default["default"].decode(this.encoded);
314
+ this.fromCodec(codec);
315
+ }
316
+
317
+ encode() {
318
+ const codec = varint__default["default"].encode(this.decoded);
319
+ this.encoded = codec;
320
+ return this.encoded
321
+ }
322
+ }
114
323
 
115
- function _getMaxListeners(that) {
116
- if (that._maxListeners === undefined)
117
- return EventEmitter.defaultMaxListeners;
118
- return that._maxListeners;
324
+ class CodecHash$1 extends BasicInterface$1 {
325
+ constructor(buffer, options = {}) {
326
+ super();
327
+ if (options.name) this.name = options.name;
328
+ else this.name = 'disco-hash';
329
+ if (options.codecs) this.codecs = options.codecs;
330
+ if (buffer) {
331
+ if (buffer instanceof Uint8Array) {
332
+ this.discoCodec = new PeernetCodec(buffer, this.codecs);
333
+ const name = this.discoCodec.name;
334
+
335
+ if (name) {
336
+ this.name = name;
337
+ this.decode(buffer);
338
+ } else {
339
+ this.encode(buffer);
340
+ }
341
+ }
342
+
343
+ if (typeof buffer === 'string') {
344
+ if (this.isHex(buffer)) this.fromHex(buffer);
345
+ if (this.isBase32(buffer)) this.fromBs32(buffer);
346
+ else if (this.isBase58(buffer)) this.fromBs58(buffer);
347
+ else throw new Error(`unsupported string ${buffer}`)
348
+ } else if (typeof buffer === 'object') this.fromJSON(buffer);
349
+ }
350
+ }
351
+
352
+ get prefix() {
353
+ const length = this.length;
354
+ const uint8Array = new Uint8Array(length.length + this.discoCodec.codecBuffer.length);
355
+ uint8Array.set(length);
356
+ uint8Array.set(this.discoCodec.codecBuffer, length.length);
357
+
358
+ return uint8Array
359
+ }
360
+
361
+ get length() {
362
+ return varint__default["default"].encode(this.size)
363
+ }
364
+
365
+ get buffer() {
366
+ return this.encoded
367
+ }
368
+
369
+ get hash() {
370
+ return this.encoded
371
+ }
372
+
373
+ fromJSON(json) {
374
+ return this.encode(Buffer.from(JSON.stringify(json)))
375
+ }
376
+
377
+ encode(buffer, name) {
378
+ if (!this.name && name) this.name = name;
379
+ if (!buffer) buffer = this.buffer;
380
+ this.discoCodec = new PeernetCodec(this.name, this.codecs);
381
+ this.discoCodec.fromName(this.name);
382
+ let hashAlg = this.discoCodec.hashAlg;
383
+ if (hashAlg.includes('dbl')) {
384
+ hashAlg = hashAlg.replace('dbl-', '');
385
+ buffer = createKeccakHash__default["default"](hashAlg.replace('-', '')).update(buffer).digest();
386
+ }
387
+ this.digest = createKeccakHash__default["default"](hashAlg.replace('-', '')).update(buffer).digest();
388
+ this.size = this.digest.length;
389
+
390
+ this.codec = this.discoCodec.encode();
391
+ this.codec = this.discoCodec.codecBuffer;
392
+ const uint8Array = new Uint8Array(this.digest.length + this.prefix.length);
393
+ uint8Array.set(this.prefix);
394
+ uint8Array.set(this.digest, this.prefix.length);
395
+
396
+ this.encoded = uint8Array;
397
+
398
+ return this.encoded
399
+ }
400
+
401
+ validate(buffer) {
402
+ if (Buffer.isBuffer(buffer)) {
403
+ const codec = varint__default["default"].decode(buffer);
404
+ if (this.codecs[codec]) {
405
+ this.decode(buffer);
406
+ } else {
407
+ this.encode(buffer);
408
+ }
409
+ }
410
+ if (typeof buffer === 'string') {
411
+ if (this.isHex(buffer)) this.fromHex(buffer);
412
+ if (this.isBase32(buffer)) this.fromBs32(buffer);
413
+ }
414
+ if (typeof buffer === 'object') this.fromJSON(buffer);
415
+ }
416
+
417
+ decode(buffer) {
418
+ this.encoded = buffer;
419
+ const codec = varint__default["default"].decode(buffer);
420
+
421
+ this.discoCodec = new PeernetCodec(codec, this.codecs);
422
+ // TODO: validate codec
423
+ buffer = buffer.slice(varint__default["default"].decode.bytes);
424
+ this.size = varint__default["default"].decode(buffer);
425
+ this.digest = buffer.slice(varint__default["default"].decode.bytes);
426
+ if (this.digest.length !== this.size) {
427
+ throw new Error(`hash length inconsistent: 0x${this.encoded.toString('hex')}`)
428
+ }
429
+
430
+ // const discoCodec = new Codec(codec, this.codecs)
431
+
432
+ this.name = this.discoCodec.name;
433
+
434
+
435
+ this.size = this.digest.length;
436
+
437
+ return {
438
+ codec: this.codec,
439
+ name: this.name,
440
+ size: this.size,
441
+ length: this.length,
442
+ digest: this.digest,
443
+ }
444
+ }
119
445
  }
120
446
 
121
- EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
122
- return _getMaxListeners(this);
123
- };
447
+ class FormatInterface$1 extends BasicInterface$1 {
448
+
449
+ async protoEncode(data) {
450
+ // check schema
451
+ return new TextEncoder().encode(data)
452
+ }
453
+
454
+ async protoDecode(data) {
455
+ // check schema
456
+ return new TextDecoder().decode(data)
457
+ }
458
+
459
+ async init(buffer) {
460
+ if (buffer instanceof Uint8Array) await this.fromUint8Array(buffer);
461
+ else if (buffer instanceof ArrayBuffer) await this.fromArrayBuffer(buffer);
462
+ else if (buffer?.name === this.name) return buffer
463
+ else if (buffer instanceof String) {
464
+ if (this.isHex(buffer)) await this.fromHex(buffer);
465
+ else if (this.isBase32(buffer)) await this.fromBs32(buffer);
466
+ else if (this.isBase58(buffer)) await this.fromBs58(buffer);
467
+ else throw new Error(`unsupported string ${buffer}`)
468
+ } else {
469
+ await this.create(buffer);
470
+ }
471
+ return this
472
+ }
473
+
474
+ /**
475
+ * @param {Buffer|String|Object} buffer - data - The data needed to create the desired message
476
+ * @param {Object} proto - {encode, decode}
477
+ * @param {Object} options - {hashFormat, name}
478
+ */
479
+ constructor(buffer, proto, options = {}) {
480
+ super();
481
+ this.proto = proto;
482
+ this.hashFormat = options.hashFormat || 'bs32';
483
+ if (options.name) this.name = options.name;
484
+ return this.init(buffer)
485
+ }
486
+
487
+ /**
488
+ * @return {PeernetHash}
489
+ */
490
+ get peernetHash() {
491
+ return new CodecHash$1(this.decoded, {name: this.name})
492
+ }
493
+
494
+ /**
495
+ * @return {peernetHash}
496
+ */
497
+ get hash() {
498
+ const upper = this.hashFormat.charAt(0).toUpperCase();
499
+ const format = `${upper}${this.hashFormat.substring(1, this.hashFormat.length)}`;
500
+ return this.peernetHash[`to${format}`]()
501
+ }
502
+
503
+ /**
504
+ * @return {Object}
505
+ */
506
+ async decode() {
507
+ let encoded = this.encoded;
508
+ const discoCodec = new PeernetCodec(this.encoded);
509
+ encoded = encoded.slice(discoCodec.codecBuffer.length);
510
+ this.name = discoCodec.name;
511
+ this.decoded = await this.protoDecode(encoded);
512
+ try {
513
+ this.decoded = JSON.parse(this.decoded);
514
+ } catch {
515
+
516
+ }
517
+ return this.decoded
518
+ }
519
+
520
+ /**
521
+ * @return {Buffer}
522
+ */
523
+ async encode(decoded) {
524
+ let encoded;
525
+ if (!decoded) decoded = this.decoded;
526
+ const codec = new PeernetCodec(this.name);
527
+
528
+ if (decoded instanceof Uint8Array) encoded = decoded;
529
+ else encoded = await this.protoEncode(typeof decoded === 'object' ? JSON.stringify(decoded) : decoded);
530
+
531
+ const uint8Array = new Uint8Array(encoded.length + codec.codecBuffer.length);
532
+ uint8Array.set(codec.codecBuffer);
533
+ uint8Array.set(encoded, codec.codecBuffer.length);
534
+
535
+ this.encoded = uint8Array;
536
+ return this.encoded
537
+ }
538
+
539
+ hasCodec() {
540
+ if (!this.encoded) return false
541
+ const codec = new PeernetCodec(this.encoded);
542
+ if (codec.name) return true
543
+ }
544
+
545
+ fromUint8Array(buffer) {
546
+ this.encoded = buffer;
547
+ return this.hasCodec() ? this.decode() : this.create(
548
+ JSON.parse(new TextDecoder().decode(this.encoded))
549
+ )
550
+ }
551
+
552
+ fromArrayBuffer(buffer) {
553
+ this.encoded = new Uint8Array(buffer, buffer.byteOffset, buffer.byteLength);
554
+ return this.hasCodec() ? this.decode() : this.create(
555
+ JSON.parse(new TextDecoder().decode(this.encoded))
556
+ )
557
+ }
558
+ }
124
559
 
125
- EventEmitter.prototype.emit = function emit(type) {
126
- var args = [];
127
- for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
128
- var doError = (type === 'error');
560
+ const BasicInterface = BasicInterface$1;
561
+ const FormatInterface = FormatInterface$1;
562
+ const CodecHash = CodecHash$1;
563
+ const Codec = PeernetCodec;
564
+ const Codecs = codecs;
129
565
 
130
- var events = this._events;
131
- if (events !== undefined)
132
- doError = (doError && events.error === undefined);
133
- else if (!doError)
134
- return false;
566
+ __webpack_unused_export__ = BasicInterface;
567
+ __webpack_unused_export__ = Codec;
568
+ __webpack_unused_export__ = CodecHash;
569
+ __webpack_unused_export__ = Codecs;
570
+ exports.L1 = FormatInterface;
135
571
 
136
- // If there is no 'error' event listener then throw.
137
- if (doError) {
138
- var er;
139
- if (args.length > 0)
140
- er = args[0];
141
- if (er instanceof Error) {
142
- // Note: The comments on the `throw` lines are intentional, they show
143
- // up in Node's output if this results in an unhandled exception.
144
- throw er; // Unhandled 'error' event
145
- }
146
- // At least give some kind of context to the user
147
- var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
148
- err.context = er;
149
- throw err; // Unhandled 'error' event
150
- }
151
572
 
152
- var handler = events[type];
573
+ /***/ }),
153
574
 
154
- if (handler === undefined)
155
- return false;
575
+ /***/ 353:
576
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
156
577
 
157
- if (typeof handler === 'function') {
158
- ReflectApply(handler, this, args);
159
- } else {
160
- var len = handler.length;
161
- var listeners = arrayClone(handler, len);
162
- for (var i = 0; i < len; ++i)
163
- ReflectApply(listeners[i], this, args);
164
- }
578
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
579
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
580
+ /* harmony export */ });
581
+ // base-x encoding / decoding
582
+ // Copyright (c) 2018 base-x contributors
583
+ // Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
584
+ // Distributed under the MIT software license, see the accompanying
585
+ // file LICENSE or http://www.opensource.org/licenses/mit-license.php.
586
+ const base = ALPHABET => {
587
+ if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
588
+ const BASE_MAP = new Uint8Array(256)
589
+ for (let j = 0; j < BASE_MAP.length; j++) {
590
+ BASE_MAP[j] = 255
591
+ }
592
+ for (let i = 0; i < ALPHABET.length; i++) {
593
+ const x = ALPHABET.charAt(i)
594
+ const xc = x.charCodeAt(0)
595
+ if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
596
+ BASE_MAP[xc] = i
597
+ }
598
+ const BASE = ALPHABET.length
599
+ const LEADER = ALPHABET.charAt(0)
600
+ const FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up
601
+ const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up
602
+
603
+ const encode = source => {
604
+ if (source instanceof Uint8Array) {
605
+ } else if (ArrayBuffer.isView(source)) {
606
+ source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)
607
+ } else if (Array.isArray(source)) {
608
+ source = Uint8Array.from(source)
609
+ }
610
+ if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
611
+ if (source.length === 0) { return '' }
612
+ // Skip & count leading zeroes.
613
+ let zeroes = 0
614
+ let length = 0
615
+ let pbegin = 0
616
+ const pend = source.length
617
+ while (pbegin !== pend && source[pbegin] === 0) {
618
+ pbegin++
619
+ zeroes++
620
+ }
621
+ // Allocate enough space in big-endian base58 representation.
622
+ const size = ((pend - pbegin) * iFACTOR + 1) >>> 0
623
+ const b58 = new Uint8Array(size)
624
+ // Process the bytes.
625
+ while (pbegin !== pend) {
626
+ let carry = source[pbegin]
627
+ // Apply "b58 = b58 * 256 + ch".
628
+ let i = 0
629
+ for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
630
+ carry += (256 * b58[it1]) >>> 0
631
+ b58[it1] = (carry % BASE) >>> 0
632
+ carry = (carry / BASE) >>> 0
633
+ }
634
+ if (carry !== 0) { throw new Error('Non-zero carry') }
635
+ length = i
636
+ pbegin++
637
+ }
638
+ // Skip leading zeroes in base58 result.
639
+ let it2 = size - length
640
+ while (it2 !== size && b58[it2] === 0) {
641
+ it2++
642
+ }
643
+ // Translate the result into a string.
644
+ let str = LEADER.repeat(zeroes)
645
+ for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }
646
+ return str
647
+ }
648
+ const decodeUnsafe = source => {
649
+ if (typeof source !== 'string') { throw new TypeError('Expected String') }
650
+ if (source.length === 0) { return new Uint8Array() }
651
+ let psz = 0
652
+ // Skip and count leading '1's.
653
+ let zeroes = 0
654
+ let length = 0
655
+ while (source[psz] === LEADER) {
656
+ zeroes++
657
+ psz++
658
+ }
659
+ // Allocate enough space in big-endian base256 representation.
660
+ const size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.
661
+ let b256 = new Uint8Array(size)
662
+ // Process the characters.
663
+ while (source[psz]) {
664
+ // Decode character
665
+ let carry = BASE_MAP[source.charCodeAt(psz)]
666
+ // Invalid character
667
+ if (carry === 255) { return }
668
+ let i = 0
669
+ for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
670
+ carry += (BASE * b256[it3]) >>> 0
671
+ b256[it3] = (carry % 256) >>> 0
672
+ carry = (carry / 256) >>> 0
673
+ }
674
+ if (carry !== 0) { throw new Error('Non-zero carry') }
675
+ length = i
676
+ psz++
677
+ }
678
+ // Skip leading zeroes in b256.
679
+ let it4 = size - length
680
+ while (it4 !== size && b256[it4] === 0) {
681
+ it4++
682
+ }
683
+ let vch = new Uint8Array(zeroes + (size - it4))
684
+ let j = zeroes
685
+ while (it4 !== size) {
686
+ vch[j++] = b256[it4++]
687
+ }
688
+ return vch
689
+ }
690
+ const decode = string => {
691
+ const buffer = decodeUnsafe(string)
692
+ if (buffer) { return buffer }
693
+ throw new Error('Non-base' + BASE + ' character')
694
+ }
695
+ return {
696
+ encode: encode,
697
+ decodeUnsafe: decodeUnsafe,
698
+ decode: decode
699
+ }
700
+ }
701
+
702
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (base);
165
703
 
166
- return true;
167
- };
168
704
 
169
- function _addListener(target, type, listener, prepend) {
170
- var m;
171
- var events;
172
- var existing;
705
+ /***/ }),
173
706
 
174
- checkListener(listener);
707
+ /***/ 894:
708
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
175
709
 
176
- events = target._events;
177
- if (events === undefined) {
178
- events = target._events = Object.create(null);
179
- target._eventsCount = 0;
180
- } else {
181
- // To avoid recursion in the case that type === "newListener"! Before
182
- // adding it to the listeners, first emit "newListener".
183
- if (events.newListener !== undefined) {
184
- target.emit('newListener', type,
185
- listener.listener ? listener.listener : listener);
710
+ __webpack_require__.r(__webpack_exports__);
711
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
712
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
713
+ /* harmony export */ });
714
+ /* harmony import */ var _vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(353);
186
715
 
187
- // Re-assign `events` because a newListener handler could have caused the
188
- // this._events to be assigned to a new object
189
- events = target._events;
190
- }
191
- existing = events[type];
192
- }
193
716
 
194
- if (existing === undefined) {
195
- // Optimize the case of one listener. Don't need the extra array object.
196
- existing = events[type] = listener;
197
- ++target._eventsCount;
198
- } else {
199
- if (typeof existing === 'function') {
200
- // Adding the second element, need to change to array.
201
- existing = events[type] =
202
- prepend ? [listener, existing] : [existing, listener];
203
- // If we've already got an array, just append.
204
- } else if (prepend) {
205
- existing.unshift(listener);
206
- } else {
207
- existing.push(listener);
208
- }
717
+ const base32 = 'abcdefghijklmnopqrstuvwxyz234567'
718
+ const base32Hex = '0123456789abcdefghijklmnopqrstuv'
209
719
 
210
- // Check for listener leak
211
- m = _getMaxListeners(target);
212
- if (m > 0 && existing.length > m && !existing.warned) {
213
- existing.warned = true;
214
- // No error code for this since it is a Warning
215
- // eslint-disable-next-line no-restricted-syntax
216
- var w = new Error('Possible EventEmitter memory leak detected. ' +
217
- existing.length + ' ' + String(type) + ' listeners ' +
218
- 'added. Use emitter.setMaxListeners() to ' +
219
- 'increase limit');
220
- w.name = 'MaxListenersExceededWarning';
221
- w.emitter = target;
222
- w.type = type;
223
- w.count = existing.length;
224
- ProcessEmitWarning(w);
720
+ const decode = (uint8Array, hex = false) => {
721
+ const decoder = hex ? (0,_vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(base32Hex) : (0,_vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(base32)
722
+ return decoder.decode(uint8Array)
723
+ }
724
+
725
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
726
+ encode: (uint8Array, hex = false) => {
727
+ const encoder = hex ? (0,_vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(base32Hex) : (0,_vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(base32)
728
+ return encoder.encode(uint8Array)
729
+ },
730
+ decode,
731
+ isBase32: (uint8Array, hex = false) => {
732
+ try {
733
+ decode(uint8Array, hex)
734
+ return true;
735
+ } catch (e) {
736
+ return false;
225
737
  }
226
738
  }
739
+ });
227
740
 
228
- return target;
229
- }
230
741
 
231
- EventEmitter.prototype.addListener = function addListener(type, listener) {
232
- return _addListener(this, type, listener, false);
233
- };
742
+ /***/ }),
234
743
 
235
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
744
+ /***/ 158:
745
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
236
746
 
237
- EventEmitter.prototype.prependListener =
238
- function prependListener(type, listener) {
239
- return _addListener(this, type, listener, true);
240
- };
747
+ __webpack_require__.r(__webpack_exports__);
748
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
749
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
750
+ /* harmony export */ });
751
+ /* harmony import */ var _vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(353);
241
752
 
242
- function onceWrapper() {
243
- if (!this.fired) {
244
- this.target.removeListener(this.type, this.wrapFn);
245
- this.fired = true;
246
- if (arguments.length === 0)
247
- return this.listener.call(this.target);
248
- return this.listener.apply(this.target, arguments);
753
+
754
+ const base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
755
+
756
+ const decode = uint8Array => (0,_vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(base58).decode(uint8Array)
757
+
758
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
759
+ encode: uint8Array => (0,_vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(base58).encode(uint8Array),
760
+ decode,
761
+ isBase58: uint8Array => {
762
+ try {
763
+ decode(uint8Array)
764
+ return true
765
+ } catch (e) {
766
+ return false
767
+ }
249
768
  }
250
- }
769
+ });
251
770
 
252
- function _onceWrap(target, type, listener) {
253
- var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
254
- var wrapped = onceWrapper.bind(state);
255
- wrapped.listener = listener;
256
- state.wrapFn = wrapped;
257
- return wrapped;
258
- }
259
771
 
260
- EventEmitter.prototype.once = function once(type, listener) {
261
- checkListener(listener);
262
- this.on(type, _onceWrap(this, type, listener));
263
- return this;
264
- };
772
+ /***/ }),
265
773
 
266
- EventEmitter.prototype.prependOnceListener =
267
- function prependOnceListener(type, listener) {
268
- checkListener(listener);
269
- this.prependListener(type, _onceWrap(this, type, listener));
270
- return this;
271
- };
774
+ /***/ 187:
775
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
272
776
 
273
- // Emits a 'removeListener' event if and only if the listener was removed.
274
- EventEmitter.prototype.removeListener =
275
- function removeListener(type, listener) {
276
- var list, events, position, i, originalListener;
777
+ __webpack_require__.r(__webpack_exports__);
778
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
779
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
780
+ /* harmony export */ });
781
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (string => /^[A-F0-9]+$/i.test(string));
277
782
 
278
- checkListener(listener);
279
783
 
280
- events = this._events;
281
- if (events === undefined)
282
- return this;
784
+ /***/ }),
283
785
 
284
- list = events[type];
285
- if (list === undefined)
286
- return this;
287
-
288
- if (list === listener || list.listener === listener) {
289
- if (--this._eventsCount === 0)
290
- this._events = Object.create(null);
291
- else {
292
- delete events[type];
293
- if (events.removeListener)
294
- this.emit('removeListener', type, list.listener || listener);
295
- }
296
- } else if (typeof list !== 'function') {
297
- position = -1;
298
-
299
- for (i = list.length - 1; i >= 0; i--) {
300
- if (list[i] === listener || list[i].listener === listener) {
301
- originalListener = list[i].listener;
302
- position = i;
303
- break;
304
- }
305
- }
786
+ /***/ 370:
787
+ /***/ ((module) => {
306
788
 
307
- if (position < 0)
308
- return this;
789
+ // Copyright Joyent, Inc. and other Node contributors.
790
+ //
791
+ // Permission is hereby granted, free of charge, to any person obtaining a
792
+ // copy of this software and associated documentation files (the
793
+ // "Software"), to deal in the Software without restriction, including
794
+ // without limitation the rights to use, copy, modify, merge, publish,
795
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
796
+ // persons to whom the Software is furnished to do so, subject to the
797
+ // following conditions:
798
+ //
799
+ // The above copyright notice and this permission notice shall be included
800
+ // in all copies or substantial portions of the Software.
801
+ //
802
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
803
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
804
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
805
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
806
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
807
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
808
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
309
809
 
310
- if (position === 0)
311
- list.shift();
312
- else {
313
- spliceOne(list, position);
314
- }
315
810
 
316
- if (list.length === 1)
317
- events[type] = list[0];
318
811
 
319
- if (events.removeListener !== undefined)
320
- this.emit('removeListener', type, originalListener || listener);
321
- }
812
+ var R = typeof Reflect === 'object' ? Reflect : null
813
+ var ReflectApply = R && typeof R.apply === 'function'
814
+ ? R.apply
815
+ : function ReflectApply(target, receiver, args) {
816
+ return Function.prototype.apply.call(target, receiver, args);
817
+ }
322
818
 
323
- return this;
324
- };
819
+ var ReflectOwnKeys
820
+ if (R && typeof R.ownKeys === 'function') {
821
+ ReflectOwnKeys = R.ownKeys
822
+ } else if (Object.getOwnPropertySymbols) {
823
+ ReflectOwnKeys = function ReflectOwnKeys(target) {
824
+ return Object.getOwnPropertyNames(target)
825
+ .concat(Object.getOwnPropertySymbols(target));
826
+ };
827
+ } else {
828
+ ReflectOwnKeys = function ReflectOwnKeys(target) {
829
+ return Object.getOwnPropertyNames(target);
830
+ };
831
+ }
325
832
 
326
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
833
+ function ProcessEmitWarning(warning) {
834
+ if (console && console.warn) console.warn(warning);
835
+ }
327
836
 
328
- EventEmitter.prototype.removeAllListeners =
329
- function removeAllListeners(type) {
330
- var listeners, events, i;
837
+ var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
838
+ return value !== value;
839
+ }
331
840
 
332
- events = this._events;
333
- if (events === undefined)
334
- return this;
841
+ function EventEmitter() {
842
+ EventEmitter.init.call(this);
843
+ }
844
+ module.exports = EventEmitter;
845
+ module.exports.once = once;
335
846
 
336
- // not listening for removeListener, no need to emit
337
- if (events.removeListener === undefined) {
338
- if (arguments.length === 0) {
339
- this._events = Object.create(null);
340
- this._eventsCount = 0;
341
- } else if (events[type] !== undefined) {
342
- if (--this._eventsCount === 0)
343
- this._events = Object.create(null);
344
- else
345
- delete events[type];
346
- }
347
- return this;
348
- }
847
+ // Backwards-compat with node 0.10.x
848
+ EventEmitter.EventEmitter = EventEmitter;
349
849
 
350
- // emit removeListener for all listeners on all events
351
- if (arguments.length === 0) {
352
- var keys = Object.keys(events);
353
- var key;
354
- for (i = 0; i < keys.length; ++i) {
355
- key = keys[i];
356
- if (key === 'removeListener') continue;
357
- this.removeAllListeners(key);
358
- }
359
- this.removeAllListeners('removeListener');
360
- this._events = Object.create(null);
361
- this._eventsCount = 0;
362
- return this;
363
- }
850
+ EventEmitter.prototype._events = undefined;
851
+ EventEmitter.prototype._eventsCount = 0;
852
+ EventEmitter.prototype._maxListeners = undefined;
364
853
 
365
- listeners = events[type];
854
+ // By default EventEmitters will print a warning if more than 10 listeners are
855
+ // added to it. This is a useful default which helps finding memory leaks.
856
+ var defaultMaxListeners = 10;
366
857
 
367
- if (typeof listeners === 'function') {
368
- this.removeListener(type, listeners);
369
- } else if (listeners !== undefined) {
370
- // LIFO order
371
- for (i = listeners.length - 1; i >= 0; i--) {
372
- this.removeListener(type, listeners[i]);
373
- }
374
- }
858
+ function checkListener(listener) {
859
+ if (typeof listener !== 'function') {
860
+ throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
861
+ }
862
+ }
375
863
 
376
- return this;
377
- };
864
+ Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
865
+ enumerable: true,
866
+ get: function() {
867
+ return defaultMaxListeners;
868
+ },
869
+ set: function(arg) {
870
+ if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
871
+ throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
872
+ }
873
+ defaultMaxListeners = arg;
874
+ }
875
+ });
378
876
 
379
- function _listeners(target, type, unwrap) {
380
- var events = target._events;
877
+ EventEmitter.init = function() {
381
878
 
382
- if (events === undefined)
383
- return [];
879
+ if (this._events === undefined ||
880
+ this._events === Object.getPrototypeOf(this)._events) {
881
+ this._events = Object.create(null);
882
+ this._eventsCount = 0;
883
+ }
384
884
 
385
- var evlistener = events[type];
386
- if (evlistener === undefined)
387
- return [];
885
+ this._maxListeners = this._maxListeners || undefined;
886
+ };
388
887
 
389
- if (typeof evlistener === 'function')
390
- return unwrap ? [evlistener.listener || evlistener] : [evlistener];
888
+ // Obviously not all Emitters should be limited to 10. This function allows
889
+ // that to be increased. Set to zero for unlimited.
890
+ EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
891
+ if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
892
+ throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
893
+ }
894
+ this._maxListeners = n;
895
+ return this;
896
+ };
391
897
 
392
- return unwrap ?
393
- unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
898
+ function _getMaxListeners(that) {
899
+ if (that._maxListeners === undefined)
900
+ return EventEmitter.defaultMaxListeners;
901
+ return that._maxListeners;
394
902
  }
395
903
 
396
- EventEmitter.prototype.listeners = function listeners(type) {
397
- return _listeners(this, type, true);
398
- };
399
-
400
- EventEmitter.prototype.rawListeners = function rawListeners(type) {
401
- return _listeners(this, type, false);
904
+ EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
905
+ return _getMaxListeners(this);
402
906
  };
403
907
 
404
- EventEmitter.listenerCount = function(emitter, type) {
405
- if (typeof emitter.listenerCount === 'function') {
406
- return emitter.listenerCount(type);
407
- } else {
408
- return listenerCount.call(emitter, type);
409
- }
410
- };
908
+ EventEmitter.prototype.emit = function emit(type) {
909
+ var args = [];
910
+ for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
911
+ var doError = (type === 'error');
411
912
 
412
- EventEmitter.prototype.listenerCount = listenerCount;
413
- function listenerCount(type) {
414
913
  var events = this._events;
914
+ if (events !== undefined)
915
+ doError = (doError && events.error === undefined);
916
+ else if (!doError)
917
+ return false;
415
918
 
416
- if (events !== undefined) {
417
- var evlistener = events[type];
418
-
419
- if (typeof evlistener === 'function') {
420
- return 1;
421
- } else if (evlistener !== undefined) {
422
- return evlistener.length;
919
+ // If there is no 'error' event listener then throw.
920
+ if (doError) {
921
+ var er;
922
+ if (args.length > 0)
923
+ er = args[0];
924
+ if (er instanceof Error) {
925
+ // Note: The comments on the `throw` lines are intentional, they show
926
+ // up in Node's output if this results in an unhandled exception.
927
+ throw er; // Unhandled 'error' event
423
928
  }
929
+ // At least give some kind of context to the user
930
+ var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
931
+ err.context = er;
932
+ throw err; // Unhandled 'error' event
424
933
  }
425
934
 
426
- return 0;
427
- }
935
+ var handler = events[type];
428
936
 
429
- EventEmitter.prototype.eventNames = function eventNames() {
430
- return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
431
- };
937
+ if (handler === undefined)
938
+ return false;
432
939
 
433
- function arrayClone(arr, n) {
434
- var copy = new Array(n);
435
- for (var i = 0; i < n; ++i)
436
- copy[i] = arr[i];
437
- return copy;
438
- }
940
+ if (typeof handler === 'function') {
941
+ ReflectApply(handler, this, args);
942
+ } else {
943
+ var len = handler.length;
944
+ var listeners = arrayClone(handler, len);
945
+ for (var i = 0; i < len; ++i)
946
+ ReflectApply(listeners[i], this, args);
947
+ }
439
948
 
440
- function spliceOne(list, index) {
441
- for (; index + 1 < list.length; index++)
442
- list[index] = list[index + 1];
443
- list.pop();
444
- }
949
+ return true;
950
+ };
445
951
 
446
- function unwrapListeners(arr) {
447
- var ret = new Array(arr.length);
448
- for (var i = 0; i < ret.length; ++i) {
449
- ret[i] = arr[i].listener || arr[i];
450
- }
451
- return ret;
452
- }
952
+ function _addListener(target, type, listener, prepend) {
953
+ var m;
954
+ var events;
955
+ var existing;
453
956
 
454
- function once(emitter, name) {
455
- return new Promise(function (resolve, reject) {
456
- function errorListener(err) {
457
- emitter.removeListener(name, resolver);
458
- reject(err);
459
- }
957
+ checkListener(listener);
460
958
 
461
- function resolver() {
462
- if (typeof emitter.removeListener === 'function') {
463
- emitter.removeListener('error', errorListener);
464
- }
465
- resolve([].slice.call(arguments));
466
- };
959
+ events = target._events;
960
+ if (events === undefined) {
961
+ events = target._events = Object.create(null);
962
+ target._eventsCount = 0;
963
+ } else {
964
+ // To avoid recursion in the case that type === "newListener"! Before
965
+ // adding it to the listeners, first emit "newListener".
966
+ if (events.newListener !== undefined) {
967
+ target.emit('newListener', type,
968
+ listener.listener ? listener.listener : listener);
467
969
 
468
- eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
469
- if (name !== 'error') {
470
- addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
970
+ // Re-assign `events` because a newListener handler could have caused the
971
+ // this._events to be assigned to a new object
972
+ events = target._events;
471
973
  }
472
- });
473
- }
474
-
475
- function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
476
- if (typeof emitter.on === 'function') {
477
- eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
974
+ existing = events[type];
478
975
  }
479
- }
480
976
 
481
- function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
482
- if (typeof emitter.on === 'function') {
483
- if (flags.once) {
484
- emitter.once(name, listener);
977
+ if (existing === undefined) {
978
+ // Optimize the case of one listener. Don't need the extra array object.
979
+ existing = events[type] = listener;
980
+ ++target._eventsCount;
981
+ } else {
982
+ if (typeof existing === 'function') {
983
+ // Adding the second element, need to change to array.
984
+ existing = events[type] =
985
+ prepend ? [listener, existing] : [existing, listener];
986
+ // If we've already got an array, just append.
987
+ } else if (prepend) {
988
+ existing.unshift(listener);
485
989
  } else {
486
- emitter.on(name, listener);
990
+ existing.push(listener);
991
+ }
992
+
993
+ // Check for listener leak
994
+ m = _getMaxListeners(target);
995
+ if (m > 0 && existing.length > m && !existing.warned) {
996
+ existing.warned = true;
997
+ // No error code for this since it is a Warning
998
+ // eslint-disable-next-line no-restricted-syntax
999
+ var w = new Error('Possible EventEmitter memory leak detected. ' +
1000
+ existing.length + ' ' + String(type) + ' listeners ' +
1001
+ 'added. Use emitter.setMaxListeners() to ' +
1002
+ 'increase limit');
1003
+ w.name = 'MaxListenersExceededWarning';
1004
+ w.emitter = target;
1005
+ w.type = type;
1006
+ w.count = existing.length;
1007
+ ProcessEmitWarning(w);
487
1008
  }
488
- } else if (typeof emitter.addEventListener === 'function') {
489
- // EventTarget does not have `error` event semantics like Node
490
- // EventEmitters, we do not listen for `error` events here.
491
- emitter.addEventListener(name, function wrapListener(arg) {
492
- // IE does not have builtin `{ once: true }` support so we
493
- // have to do it manually.
494
- if (flags.once) {
495
- emitter.removeEventListener(name, wrapListener);
496
- }
497
- listener(arg);
498
- });
499
- } else {
500
- throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
501
1009
  }
1010
+
1011
+ return target;
502
1012
  }
503
1013
 
1014
+ EventEmitter.prototype.addListener = function addListener(type, listener) {
1015
+ return _addListener(this, type, listener, false);
1016
+ };
504
1017
 
505
- /***/ }),
1018
+ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
506
1019
 
507
- /***/ 5717:
508
- /***/ ((module) => {
1020
+ EventEmitter.prototype.prependListener =
1021
+ function prependListener(type, listener) {
1022
+ return _addListener(this, type, listener, true);
1023
+ };
509
1024
 
510
- if (typeof Object.create === 'function') {
511
- // implementation from standard node.js 'util' module
512
- module.exports = function inherits(ctor, superCtor) {
513
- if (superCtor) {
514
- ctor.super_ = superCtor
515
- ctor.prototype = Object.create(superCtor.prototype, {
516
- constructor: {
517
- value: ctor,
518
- enumerable: false,
519
- writable: true,
520
- configurable: true
521
- }
522
- })
523
- }
524
- };
525
- } else {
526
- // old school shim for old browsers
527
- module.exports = function inherits(ctor, superCtor) {
528
- if (superCtor) {
529
- ctor.super_ = superCtor
530
- var TempCtor = function () {}
531
- TempCtor.prototype = superCtor.prototype
532
- ctor.prototype = new TempCtor()
533
- ctor.prototype.constructor = ctor
534
- }
1025
+ function onceWrapper() {
1026
+ if (!this.fired) {
1027
+ this.target.removeListener(this.type, this.wrapFn);
1028
+ this.fired = true;
1029
+ if (arguments.length === 0)
1030
+ return this.listener.call(this.target);
1031
+ return this.listener.apply(this.target, arguments);
535
1032
  }
536
1033
  }
537
1034
 
1035
+ function _onceWrap(target, type, listener) {
1036
+ var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
1037
+ var wrapped = onceWrapper.bind(state);
1038
+ wrapped.listener = listener;
1039
+ state.wrapFn = wrapped;
1040
+ return wrapped;
1041
+ }
538
1042
 
539
- /***/ }),
1043
+ EventEmitter.prototype.once = function once(type, listener) {
1044
+ checkListener(listener);
1045
+ this.on(type, _onceWrap(this, type, listener));
1046
+ return this;
1047
+ };
540
1048
 
541
- /***/ 5811:
542
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1049
+ EventEmitter.prototype.prependOnceListener =
1050
+ function prependOnceListener(type, listener) {
1051
+ checkListener(listener);
1052
+ this.prependListener(type, _onceWrap(this, type, listener));
1053
+ return this;
1054
+ };
543
1055
 
544
- module.exports = __webpack_require__(6066)(__webpack_require__(9653))
1056
+ // Emits a 'removeListener' event if and only if the listener was removed.
1057
+ EventEmitter.prototype.removeListener =
1058
+ function removeListener(type, listener) {
1059
+ var list, events, position, i, originalListener;
545
1060
 
1061
+ checkListener(listener);
546
1062
 
547
- /***/ }),
1063
+ events = this._events;
1064
+ if (events === undefined)
1065
+ return this;
548
1066
 
549
- /***/ 6066:
550
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1067
+ list = events[type];
1068
+ if (list === undefined)
1069
+ return this;
551
1070
 
552
- const createKeccak = __webpack_require__(7016)
553
- const createShake = __webpack_require__(5675)
1071
+ if (list === listener || list.listener === listener) {
1072
+ if (--this._eventsCount === 0)
1073
+ this._events = Object.create(null);
1074
+ else {
1075
+ delete events[type];
1076
+ if (events.removeListener)
1077
+ this.emit('removeListener', type, list.listener || listener);
1078
+ }
1079
+ } else if (typeof list !== 'function') {
1080
+ position = -1;
554
1081
 
555
- module.exports = function (KeccakState) {
556
- const Keccak = createKeccak(KeccakState)
557
- const Shake = createShake(KeccakState)
1082
+ for (i = list.length - 1; i >= 0; i--) {
1083
+ if (list[i] === listener || list[i].listener === listener) {
1084
+ originalListener = list[i].listener;
1085
+ position = i;
1086
+ break;
1087
+ }
1088
+ }
558
1089
 
559
- return function (algorithm, options) {
560
- const hash = typeof algorithm === 'string' ? algorithm.toLowerCase() : algorithm
561
- switch (hash) {
562
- case 'keccak224': return new Keccak(1152, 448, null, 224, options)
563
- case 'keccak256': return new Keccak(1088, 512, null, 256, options)
564
- case 'keccak384': return new Keccak(832, 768, null, 384, options)
565
- case 'keccak512': return new Keccak(576, 1024, null, 512, options)
1090
+ if (position < 0)
1091
+ return this;
566
1092
 
567
- case 'sha3-224': return new Keccak(1152, 448, 0x06, 224, options)
568
- case 'sha3-256': return new Keccak(1088, 512, 0x06, 256, options)
569
- case 'sha3-384': return new Keccak(832, 768, 0x06, 384, options)
570
- case 'sha3-512': return new Keccak(576, 1024, 0x06, 512, options)
1093
+ if (position === 0)
1094
+ list.shift();
1095
+ else {
1096
+ spliceOne(list, position);
1097
+ }
571
1098
 
572
- case 'shake128': return new Shake(1344, 256, 0x1f, options)
573
- case 'shake256': return new Shake(1088, 512, 0x1f, options)
1099
+ if (list.length === 1)
1100
+ events[type] = list[0];
574
1101
 
575
- default: throw new Error('Invald algorithm: ' + algorithm)
576
- }
577
- }
578
- }
1102
+ if (events.removeListener !== undefined)
1103
+ this.emit('removeListener', type, originalListener || listener);
1104
+ }
579
1105
 
1106
+ return this;
1107
+ };
580
1108
 
581
- /***/ }),
1109
+ EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
582
1110
 
583
- /***/ 7016:
584
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1111
+ EventEmitter.prototype.removeAllListeners =
1112
+ function removeAllListeners(type) {
1113
+ var listeners, events, i;
585
1114
 
586
- const { Transform } = __webpack_require__(8473)
1115
+ events = this._events;
1116
+ if (events === undefined)
1117
+ return this;
587
1118
 
588
- module.exports = (KeccakState) => class Keccak extends Transform {
589
- constructor (rate, capacity, delimitedSuffix, hashBitLength, options) {
590
- super(options)
1119
+ // not listening for removeListener, no need to emit
1120
+ if (events.removeListener === undefined) {
1121
+ if (arguments.length === 0) {
1122
+ this._events = Object.create(null);
1123
+ this._eventsCount = 0;
1124
+ } else if (events[type] !== undefined) {
1125
+ if (--this._eventsCount === 0)
1126
+ this._events = Object.create(null);
1127
+ else
1128
+ delete events[type];
1129
+ }
1130
+ return this;
1131
+ }
1132
+
1133
+ // emit removeListener for all listeners on all events
1134
+ if (arguments.length === 0) {
1135
+ var keys = Object.keys(events);
1136
+ var key;
1137
+ for (i = 0; i < keys.length; ++i) {
1138
+ key = keys[i];
1139
+ if (key === 'removeListener') continue;
1140
+ this.removeAllListeners(key);
1141
+ }
1142
+ this.removeAllListeners('removeListener');
1143
+ this._events = Object.create(null);
1144
+ this._eventsCount = 0;
1145
+ return this;
1146
+ }
1147
+
1148
+ listeners = events[type];
1149
+
1150
+ if (typeof listeners === 'function') {
1151
+ this.removeListener(type, listeners);
1152
+ } else if (listeners !== undefined) {
1153
+ // LIFO order
1154
+ for (i = listeners.length - 1; i >= 0; i--) {
1155
+ this.removeListener(type, listeners[i]);
1156
+ }
1157
+ }
1158
+
1159
+ return this;
1160
+ };
1161
+
1162
+ function _listeners(target, type, unwrap) {
1163
+ var events = target._events;
1164
+
1165
+ if (events === undefined)
1166
+ return [];
1167
+
1168
+ var evlistener = events[type];
1169
+ if (evlistener === undefined)
1170
+ return [];
1171
+
1172
+ if (typeof evlistener === 'function')
1173
+ return unwrap ? [evlistener.listener || evlistener] : [evlistener];
1174
+
1175
+ return unwrap ?
1176
+ unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
1177
+ }
1178
+
1179
+ EventEmitter.prototype.listeners = function listeners(type) {
1180
+ return _listeners(this, type, true);
1181
+ };
1182
+
1183
+ EventEmitter.prototype.rawListeners = function rawListeners(type) {
1184
+ return _listeners(this, type, false);
1185
+ };
1186
+
1187
+ EventEmitter.listenerCount = function(emitter, type) {
1188
+ if (typeof emitter.listenerCount === 'function') {
1189
+ return emitter.listenerCount(type);
1190
+ } else {
1191
+ return listenerCount.call(emitter, type);
1192
+ }
1193
+ };
1194
+
1195
+ EventEmitter.prototype.listenerCount = listenerCount;
1196
+ function listenerCount(type) {
1197
+ var events = this._events;
1198
+
1199
+ if (events !== undefined) {
1200
+ var evlistener = events[type];
1201
+
1202
+ if (typeof evlistener === 'function') {
1203
+ return 1;
1204
+ } else if (evlistener !== undefined) {
1205
+ return evlistener.length;
1206
+ }
1207
+ }
1208
+
1209
+ return 0;
1210
+ }
1211
+
1212
+ EventEmitter.prototype.eventNames = function eventNames() {
1213
+ return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
1214
+ };
1215
+
1216
+ function arrayClone(arr, n) {
1217
+ var copy = new Array(n);
1218
+ for (var i = 0; i < n; ++i)
1219
+ copy[i] = arr[i];
1220
+ return copy;
1221
+ }
1222
+
1223
+ function spliceOne(list, index) {
1224
+ for (; index + 1 < list.length; index++)
1225
+ list[index] = list[index + 1];
1226
+ list.pop();
1227
+ }
1228
+
1229
+ function unwrapListeners(arr) {
1230
+ var ret = new Array(arr.length);
1231
+ for (var i = 0; i < ret.length; ++i) {
1232
+ ret[i] = arr[i].listener || arr[i];
1233
+ }
1234
+ return ret;
1235
+ }
1236
+
1237
+ function once(emitter, name) {
1238
+ return new Promise(function (resolve, reject) {
1239
+ function errorListener(err) {
1240
+ emitter.removeListener(name, resolver);
1241
+ reject(err);
1242
+ }
1243
+
1244
+ function resolver() {
1245
+ if (typeof emitter.removeListener === 'function') {
1246
+ emitter.removeListener('error', errorListener);
1247
+ }
1248
+ resolve([].slice.call(arguments));
1249
+ };
1250
+
1251
+ eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
1252
+ if (name !== 'error') {
1253
+ addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
1254
+ }
1255
+ });
1256
+ }
1257
+
1258
+ function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
1259
+ if (typeof emitter.on === 'function') {
1260
+ eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
1261
+ }
1262
+ }
1263
+
1264
+ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
1265
+ if (typeof emitter.on === 'function') {
1266
+ if (flags.once) {
1267
+ emitter.once(name, listener);
1268
+ } else {
1269
+ emitter.on(name, listener);
1270
+ }
1271
+ } else if (typeof emitter.addEventListener === 'function') {
1272
+ // EventTarget does not have `error` event semantics like Node
1273
+ // EventEmitters, we do not listen for `error` events here.
1274
+ emitter.addEventListener(name, function wrapListener(arg) {
1275
+ // IE does not have builtin `{ once: true }` support so we
1276
+ // have to do it manually.
1277
+ if (flags.once) {
1278
+ emitter.removeEventListener(name, wrapListener);
1279
+ }
1280
+ listener(arg);
1281
+ });
1282
+ } else {
1283
+ throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
1284
+ }
1285
+ }
1286
+
1287
+
1288
+ /***/ }),
1289
+
1290
+ /***/ 717:
1291
+ /***/ ((module) => {
1292
+
1293
+ if (typeof Object.create === 'function') {
1294
+ // implementation from standard node.js 'util' module
1295
+ module.exports = function inherits(ctor, superCtor) {
1296
+ if (superCtor) {
1297
+ ctor.super_ = superCtor
1298
+ ctor.prototype = Object.create(superCtor.prototype, {
1299
+ constructor: {
1300
+ value: ctor,
1301
+ enumerable: false,
1302
+ writable: true,
1303
+ configurable: true
1304
+ }
1305
+ })
1306
+ }
1307
+ };
1308
+ } else {
1309
+ // old school shim for old browsers
1310
+ module.exports = function inherits(ctor, superCtor) {
1311
+ if (superCtor) {
1312
+ ctor.super_ = superCtor
1313
+ var TempCtor = function () {}
1314
+ TempCtor.prototype = superCtor.prototype
1315
+ ctor.prototype = new TempCtor()
1316
+ ctor.prototype.constructor = ctor
1317
+ }
1318
+ }
1319
+ }
1320
+
1321
+
1322
+ /***/ }),
1323
+
1324
+ /***/ 811:
1325
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1326
+
1327
+ module.exports = __webpack_require__(66)(__webpack_require__(653))
1328
+
1329
+
1330
+ /***/ }),
1331
+
1332
+ /***/ 66:
1333
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1334
+
1335
+ const createKeccak = __webpack_require__(16)
1336
+ const createShake = __webpack_require__(675)
1337
+
1338
+ module.exports = function (KeccakState) {
1339
+ const Keccak = createKeccak(KeccakState)
1340
+ const Shake = createShake(KeccakState)
1341
+
1342
+ return function (algorithm, options) {
1343
+ const hash = typeof algorithm === 'string' ? algorithm.toLowerCase() : algorithm
1344
+ switch (hash) {
1345
+ case 'keccak224': return new Keccak(1152, 448, null, 224, options)
1346
+ case 'keccak256': return new Keccak(1088, 512, null, 256, options)
1347
+ case 'keccak384': return new Keccak(832, 768, null, 384, options)
1348
+ case 'keccak512': return new Keccak(576, 1024, null, 512, options)
1349
+
1350
+ case 'sha3-224': return new Keccak(1152, 448, 0x06, 224, options)
1351
+ case 'sha3-256': return new Keccak(1088, 512, 0x06, 256, options)
1352
+ case 'sha3-384': return new Keccak(832, 768, 0x06, 384, options)
1353
+ case 'sha3-512': return new Keccak(576, 1024, 0x06, 512, options)
1354
+
1355
+ case 'shake128': return new Shake(1344, 256, 0x1f, options)
1356
+ case 'shake256': return new Shake(1088, 512, 0x1f, options)
1357
+
1358
+ default: throw new Error('Invald algorithm: ' + algorithm)
1359
+ }
1360
+ }
1361
+ }
1362
+
1363
+
1364
+ /***/ }),
1365
+
1366
+ /***/ 16:
1367
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1368
+
1369
+ const { Transform } = __webpack_require__(473)
1370
+
1371
+ module.exports = (KeccakState) => class Keccak extends Transform {
1372
+ constructor (rate, capacity, delimitedSuffix, hashBitLength, options) {
1373
+ super(options)
591
1374
 
592
1375
  this._rate = rate
593
1376
  this._capacity = capacity
@@ -664,10 +1447,10 @@ module.exports = (KeccakState) => class Keccak extends Transform {
664
1447
 
665
1448
  /***/ }),
666
1449
 
667
- /***/ 5675:
1450
+ /***/ 675:
668
1451
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
669
1452
 
670
- const { Transform } = __webpack_require__(8473)
1453
+ const { Transform } = __webpack_require__(473)
671
1454
 
672
1455
  module.exports = (KeccakState) => class Shake extends Transform {
673
1456
  constructor (rate, capacity, delimitedSuffix, options) {
@@ -739,7 +1522,7 @@ module.exports = (KeccakState) => class Shake extends Transform {
739
1522
 
740
1523
  /***/ }),
741
1524
 
742
- /***/ 4040:
1525
+ /***/ 40:
743
1526
  /***/ ((__unused_webpack_module, exports) => {
744
1527
 
745
1528
  const P1600_ROUND_CONSTANTS = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648]
@@ -932,10 +1715,10 @@ exports.p1600 = function (s) {
932
1715
 
933
1716
  /***/ }),
934
1717
 
935
- /***/ 9653:
1718
+ /***/ 653:
936
1719
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
937
1720
 
938
- const keccakState = __webpack_require__(4040)
1721
+ const keccakState = __webpack_require__(40)
939
1722
 
940
1723
  function Keccak () {
941
1724
  // much faster than `new Array(50)`
@@ -1007,7 +1790,7 @@ module.exports = Keccak
1007
1790
 
1008
1791
  /***/ }),
1009
1792
 
1010
- /***/ 4281:
1793
+ /***/ 281:
1011
1794
  /***/ ((module) => {
1012
1795
 
1013
1796
 
@@ -1141,7 +1924,7 @@ module.exports.q = codes;
1141
1924
 
1142
1925
  /***/ }),
1143
1926
 
1144
- /***/ 6753:
1927
+ /***/ 753:
1145
1928
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1146
1929
 
1147
1930
  // Copyright Joyent, Inc. and other Node contributors.
@@ -1185,11 +1968,11 @@ var objectKeys = Object.keys || function (obj) {
1185
1968
 
1186
1969
  module.exports = Duplex;
1187
1970
 
1188
- var Readable = __webpack_require__(9481);
1971
+ var Readable = __webpack_require__(481);
1189
1972
 
1190
- var Writable = __webpack_require__(4229);
1973
+ var Writable = __webpack_require__(229);
1191
1974
 
1192
- __webpack_require__(5717)(Duplex, Readable);
1975
+ __webpack_require__(717)(Duplex, Readable);
1193
1976
 
1194
1977
  {
1195
1978
  // Allow the keys array to be GC'ed.
@@ -1286,7 +2069,7 @@ Object.defineProperty(Duplex.prototype, 'destroyed', {
1286
2069
 
1287
2070
  /***/ }),
1288
2071
 
1289
- /***/ 2725:
2072
+ /***/ 725:
1290
2073
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1291
2074
 
1292
2075
  // Copyright Joyent, Inc. and other Node contributors.
@@ -1316,9 +2099,9 @@ Object.defineProperty(Duplex.prototype, 'destroyed', {
1316
2099
 
1317
2100
  module.exports = PassThrough;
1318
2101
 
1319
- var Transform = __webpack_require__(4605);
2102
+ var Transform = __webpack_require__(605);
1320
2103
 
1321
- __webpack_require__(5717)(PassThrough, Transform);
2104
+ __webpack_require__(717)(PassThrough, Transform);
1322
2105
 
1323
2106
  function PassThrough(options) {
1324
2107
  if (!(this instanceof PassThrough)) return new PassThrough(options);
@@ -1331,7 +2114,7 @@ PassThrough.prototype._transform = function (chunk, encoding, cb) {
1331
2114
 
1332
2115
  /***/ }),
1333
2116
 
1334
- /***/ 9481:
2117
+ /***/ 481:
1335
2118
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1336
2119
 
1337
2120
  // Copyright Joyent, Inc. and other Node contributors.
@@ -1365,7 +2148,7 @@ var Duplex;
1365
2148
  Readable.ReadableState = ReadableState;
1366
2149
  /*<replacement>*/
1367
2150
 
1368
- var EE = (__webpack_require__(7187).EventEmitter);
2151
+ var EE = (__webpack_require__(370).EventEmitter);
1369
2152
 
1370
2153
  var EElistenerCount = function EElistenerCount(emitter, type) {
1371
2154
  return emitter.listeners(type).length;
@@ -1375,11 +2158,11 @@ var EElistenerCount = function EElistenerCount(emitter, type) {
1375
2158
  /*<replacement>*/
1376
2159
 
1377
2160
 
1378
- var Stream = __webpack_require__(2503);
2161
+ var Stream = __webpack_require__(503);
1379
2162
  /*</replacement>*/
1380
2163
 
1381
2164
 
1382
- var Buffer = (__webpack_require__(5291).Buffer);
2165
+ var Buffer = (__webpack_require__(291).Buffer);
1383
2166
 
1384
2167
  var OurUint8Array = __webpack_require__.g.Uint8Array || function () {};
1385
2168
 
@@ -1393,7 +2176,7 @@ function _isUint8Array(obj) {
1393
2176
  /*<replacement>*/
1394
2177
 
1395
2178
 
1396
- var debugUtil = __webpack_require__(4616);
2179
+ var debugUtil = __webpack_require__(616);
1397
2180
 
1398
2181
  var debug;
1399
2182
 
@@ -1405,14 +2188,14 @@ if (debugUtil && debugUtil.debuglog) {
1405
2188
  /*</replacement>*/
1406
2189
 
1407
2190
 
1408
- var BufferList = __webpack_require__(7327);
2191
+ var BufferList = __webpack_require__(327);
1409
2192
 
1410
- var destroyImpl = __webpack_require__(1195);
2193
+ var destroyImpl = __webpack_require__(195);
1411
2194
 
1412
- var _require = __webpack_require__(2457),
2195
+ var _require = __webpack_require__(457),
1413
2196
  getHighWaterMark = _require.getHighWaterMark;
1414
2197
 
1415
- var _require$codes = (__webpack_require__(4281)/* .codes */ .q),
2198
+ var _require$codes = (__webpack_require__(281)/* .codes */ .q),
1416
2199
  ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
1417
2200
  ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
1418
2201
  ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
@@ -1423,7 +2206,7 @@ var StringDecoder;
1423
2206
  var createReadableStreamAsyncIterator;
1424
2207
  var from;
1425
2208
 
1426
- __webpack_require__(5717)(Readable, Stream);
2209
+ __webpack_require__(717)(Readable, Stream);
1427
2210
 
1428
2211
  var errorOrDestroy = destroyImpl.errorOrDestroy;
1429
2212
  var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
@@ -1440,7 +2223,7 @@ function prependListener(emitter, event, fn) {
1440
2223
  }
1441
2224
 
1442
2225
  function ReadableState(options, stream, isDuplex) {
1443
- Duplex = Duplex || __webpack_require__(6753);
2226
+ Duplex = Duplex || __webpack_require__(753);
1444
2227
  options = options || {}; // Duplex streams are both readable and writable, but share
1445
2228
  // the same options object.
1446
2229
  // However, some cases require setting options to different
@@ -1496,14 +2279,14 @@ function ReadableState(options, stream, isDuplex) {
1496
2279
  this.encoding = null;
1497
2280
 
1498
2281
  if (options.encoding) {
1499
- if (!StringDecoder) StringDecoder = (__webpack_require__(2553)/* .StringDecoder */ .s);
2282
+ if (!StringDecoder) StringDecoder = (__webpack_require__(553)/* .StringDecoder */ .s);
1500
2283
  this.decoder = new StringDecoder(options.encoding);
1501
2284
  this.encoding = options.encoding;
1502
2285
  }
1503
2286
  }
1504
2287
 
1505
2288
  function Readable(options) {
1506
- Duplex = Duplex || __webpack_require__(6753);
2289
+ Duplex = Duplex || __webpack_require__(753);
1507
2290
  if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside
1508
2291
  // the ReadableState constructor, at least with V8 6.5
1509
2292
 
@@ -1658,7 +2441,7 @@ Readable.prototype.isPaused = function () {
1658
2441
 
1659
2442
 
1660
2443
  Readable.prototype.setEncoding = function (enc) {
1661
- if (!StringDecoder) StringDecoder = (__webpack_require__(2553)/* .StringDecoder */ .s);
2444
+ if (!StringDecoder) StringDecoder = (__webpack_require__(553)/* .StringDecoder */ .s);
1662
2445
  var decoder = new StringDecoder(enc);
1663
2446
  this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8
1664
2447
 
@@ -2342,7 +3125,7 @@ Readable.prototype.wrap = function (stream) {
2342
3125
  if (typeof Symbol === 'function') {
2343
3126
  Readable.prototype[Symbol.asyncIterator] = function () {
2344
3127
  if (createReadableStreamAsyncIterator === undefined) {
2345
- createReadableStreamAsyncIterator = __webpack_require__(5850);
3128
+ createReadableStreamAsyncIterator = __webpack_require__(850);
2346
3129
  }
2347
3130
 
2348
3131
  return createReadableStreamAsyncIterator(this);
@@ -2444,7 +3227,7 @@ function endReadableNT(state, stream) {
2444
3227
  if (typeof Symbol === 'function') {
2445
3228
  Readable.from = function (iterable, opts) {
2446
3229
  if (from === undefined) {
2447
- from = __webpack_require__(5167);
3230
+ from = __webpack_require__(167);
2448
3231
  }
2449
3232
 
2450
3233
  return from(Readable, iterable, opts);
@@ -2461,7 +3244,7 @@ function indexOf(xs, x) {
2461
3244
 
2462
3245
  /***/ }),
2463
3246
 
2464
- /***/ 4605:
3247
+ /***/ 605:
2465
3248
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2466
3249
 
2467
3250
  // Copyright Joyent, Inc. and other Node contributors.
@@ -2529,15 +3312,15 @@ function indexOf(xs, x) {
2529
3312
 
2530
3313
  module.exports = Transform;
2531
3314
 
2532
- var _require$codes = (__webpack_require__(4281)/* .codes */ .q),
3315
+ var _require$codes = (__webpack_require__(281)/* .codes */ .q),
2533
3316
  ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
2534
3317
  ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
2535
3318
  ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,
2536
3319
  ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
2537
3320
 
2538
- var Duplex = __webpack_require__(6753);
3321
+ var Duplex = __webpack_require__(753);
2539
3322
 
2540
- __webpack_require__(5717)(Transform, Duplex);
3323
+ __webpack_require__(717)(Transform, Duplex);
2541
3324
 
2542
3325
  function afterTransform(er, data) {
2543
3326
  var ts = this._transformState;
@@ -2668,7 +3451,7 @@ function done(stream, er, data) {
2668
3451
 
2669
3452
  /***/ }),
2670
3453
 
2671
- /***/ 4229:
3454
+ /***/ 229:
2672
3455
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2673
3456
 
2674
3457
  // Copyright Joyent, Inc. and other Node contributors.
@@ -2730,17 +3513,17 @@ Writable.WritableState = WritableState;
2730
3513
  /*<replacement>*/
2731
3514
 
2732
3515
  var internalUtil = {
2733
- deprecate: __webpack_require__(4927)
3516
+ deprecate: __webpack_require__(927)
2734
3517
  };
2735
3518
  /*</replacement>*/
2736
3519
 
2737
3520
  /*<replacement>*/
2738
3521
 
2739
- var Stream = __webpack_require__(2503);
3522
+ var Stream = __webpack_require__(503);
2740
3523
  /*</replacement>*/
2741
3524
 
2742
3525
 
2743
- var Buffer = (__webpack_require__(5291).Buffer);
3526
+ var Buffer = (__webpack_require__(291).Buffer);
2744
3527
 
2745
3528
  var OurUint8Array = __webpack_require__.g.Uint8Array || function () {};
2746
3529
 
@@ -2752,12 +3535,12 @@ function _isUint8Array(obj) {
2752
3535
  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
2753
3536
  }
2754
3537
 
2755
- var destroyImpl = __webpack_require__(1195);
3538
+ var destroyImpl = __webpack_require__(195);
2756
3539
 
2757
- var _require = __webpack_require__(2457),
3540
+ var _require = __webpack_require__(457),
2758
3541
  getHighWaterMark = _require.getHighWaterMark;
2759
3542
 
2760
- var _require$codes = (__webpack_require__(4281)/* .codes */ .q),
3543
+ var _require$codes = (__webpack_require__(281)/* .codes */ .q),
2761
3544
  ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
2762
3545
  ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
2763
3546
  ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
@@ -2769,12 +3552,12 @@ var _require$codes = (__webpack_require__(4281)/* .codes */ .q),
2769
3552
 
2770
3553
  var errorOrDestroy = destroyImpl.errorOrDestroy;
2771
3554
 
2772
- __webpack_require__(5717)(Writable, Stream);
3555
+ __webpack_require__(717)(Writable, Stream);
2773
3556
 
2774
3557
  function nop() {}
2775
3558
 
2776
3559
  function WritableState(options, stream, isDuplex) {
2777
- Duplex = Duplex || __webpack_require__(6753);
3560
+ Duplex = Duplex || __webpack_require__(753);
2778
3561
  options = options || {}; // Duplex streams are both readable and writable, but share
2779
3562
  // the same options object.
2780
3563
  // However, some cases require setting options to different
@@ -2900,7 +3683,7 @@ if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.protot
2900
3683
  }
2901
3684
 
2902
3685
  function Writable(options) {
2903
- Duplex = Duplex || __webpack_require__(6753); // Writable ctor is applied to Duplexes, too.
3686
+ Duplex = Duplex || __webpack_require__(753); // Writable ctor is applied to Duplexes, too.
2904
3687
  // `realHasInstance` is necessary because using plain `instanceof`
2905
3688
  // would return false, as no `_writableState` property is attached.
2906
3689
  // Trying to use the custom `instanceof` for Writable here will also break the
@@ -3371,7 +4154,7 @@ Writable.prototype._destroy = function (err, cb) {
3371
4154
 
3372
4155
  /***/ }),
3373
4156
 
3374
- /***/ 5850:
4157
+ /***/ 850:
3375
4158
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3376
4159
 
3377
4160
 
@@ -3380,7 +4163,7 @@ var _Object$setPrototypeO;
3380
4163
 
3381
4164
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3382
4165
 
3383
- var finished = __webpack_require__(8610);
4166
+ var finished = __webpack_require__(610);
3384
4167
 
3385
4168
  var kLastResolve = Symbol('lastResolve');
3386
4169
  var kLastReject = Symbol('lastReject');
@@ -3584,7 +4367,7 @@ module.exports = createReadableStreamAsyncIterator;
3584
4367
 
3585
4368
  /***/ }),
3586
4369
 
3587
- /***/ 7327:
4370
+ /***/ 327:
3588
4371
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3589
4372
 
3590
4373
 
@@ -3601,10 +4384,10 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
3601
4384
 
3602
4385
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
3603
4386
 
3604
- var _require = __webpack_require__(5291),
4387
+ var _require = __webpack_require__(291),
3605
4388
  Buffer = _require.Buffer;
3606
4389
 
3607
- var _require2 = __webpack_require__(2361),
4390
+ var _require2 = __webpack_require__(361),
3608
4391
  inspect = _require2.inspect;
3609
4392
 
3610
4393
  var custom = inspect && inspect.custom || 'inspect';
@@ -3800,7 +4583,7 @@ function () {
3800
4583
 
3801
4584
  /***/ }),
3802
4585
 
3803
- /***/ 1195:
4586
+ /***/ 195:
3804
4587
  /***/ ((module) => {
3805
4588
 
3806
4589
  // undocumented cb() API, needed for core, not for public API
@@ -3911,14 +4694,14 @@ module.exports = {
3911
4694
 
3912
4695
  /***/ }),
3913
4696
 
3914
- /***/ 8610:
4697
+ /***/ 610:
3915
4698
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3916
4699
 
3917
4700
  // Ported from https://github.com/mafintosh/end-of-stream with
3918
4701
  // permission from the author, Mathias Buus (@mafintosh).
3919
4702
 
3920
4703
 
3921
- var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(4281)/* .codes.ERR_STREAM_PREMATURE_CLOSE */ .q.ERR_STREAM_PREMATURE_CLOSE);
4704
+ var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(281)/* .codes.ERR_STREAM_PREMATURE_CLOSE */ .q.ERR_STREAM_PREMATURE_CLOSE);
3922
4705
 
3923
4706
  function once(callback) {
3924
4707
  var called = false;
@@ -4021,7 +4804,7 @@ module.exports = eos;
4021
4804
 
4022
4805
  /***/ }),
4023
4806
 
4024
- /***/ 5167:
4807
+ /***/ 167:
4025
4808
  /***/ ((module) => {
4026
4809
 
4027
4810
  module.exports = function () {
@@ -4031,7 +4814,7 @@ module.exports = function () {
4031
4814
 
4032
4815
  /***/ }),
4033
4816
 
4034
- /***/ 9946:
4817
+ /***/ 946:
4035
4818
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4036
4819
 
4037
4820
  // Ported from https://github.com/mafintosh/pump with
@@ -4049,7 +4832,7 @@ function once(callback) {
4049
4832
  };
4050
4833
  }
4051
4834
 
4052
- var _require$codes = (__webpack_require__(4281)/* .codes */ .q),
4835
+ var _require$codes = (__webpack_require__(281)/* .codes */ .q),
4053
4836
  ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
4054
4837
  ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
4055
4838
 
@@ -4068,7 +4851,7 @@ function destroyer(stream, reading, writing, callback) {
4068
4851
  stream.on('close', function () {
4069
4852
  closed = true;
4070
4853
  });
4071
- if (eos === undefined) eos = __webpack_require__(8610);
4854
+ if (eos === undefined) eos = __webpack_require__(610);
4072
4855
  eos(stream, {
4073
4856
  readable: reading,
4074
4857
  writable: writing
@@ -4134,12 +4917,12 @@ module.exports = pipeline;
4134
4917
 
4135
4918
  /***/ }),
4136
4919
 
4137
- /***/ 2457:
4920
+ /***/ 457:
4138
4921
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4139
4922
 
4140
4923
 
4141
4924
 
4142
- var ERR_INVALID_OPT_VALUE = (__webpack_require__(4281)/* .codes.ERR_INVALID_OPT_VALUE */ .q.ERR_INVALID_OPT_VALUE);
4925
+ var ERR_INVALID_OPT_VALUE = (__webpack_require__(281)/* .codes.ERR_INVALID_OPT_VALUE */ .q.ERR_INVALID_OPT_VALUE);
4143
4926
 
4144
4927
  function highWaterMarkFrom(options, isDuplex, duplexKey) {
4145
4928
  return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
@@ -4167,36 +4950,36 @@ module.exports = {
4167
4950
 
4168
4951
  /***/ }),
4169
4952
 
4170
- /***/ 2503:
4953
+ /***/ 503:
4171
4954
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4172
4955
 
4173
- module.exports = __webpack_require__(7187).EventEmitter;
4956
+ module.exports = __webpack_require__(370).EventEmitter;
4174
4957
 
4175
4958
 
4176
4959
  /***/ }),
4177
4960
 
4178
- /***/ 8473:
4961
+ /***/ 473:
4179
4962
  /***/ ((module, exports, __webpack_require__) => {
4180
4963
 
4181
- exports = module.exports = __webpack_require__(9481);
4964
+ exports = module.exports = __webpack_require__(481);
4182
4965
  exports.Stream = exports;
4183
4966
  exports.Readable = exports;
4184
- exports.Writable = __webpack_require__(4229);
4185
- exports.Duplex = __webpack_require__(6753);
4186
- exports.Transform = __webpack_require__(4605);
4187
- exports.PassThrough = __webpack_require__(2725);
4188
- exports.finished = __webpack_require__(8610);
4189
- exports.pipeline = __webpack_require__(9946);
4967
+ exports.Writable = __webpack_require__(229);
4968
+ exports.Duplex = __webpack_require__(753);
4969
+ exports.Transform = __webpack_require__(605);
4970
+ exports.PassThrough = __webpack_require__(725);
4971
+ exports.finished = __webpack_require__(610);
4972
+ exports.pipeline = __webpack_require__(946);
4190
4973
 
4191
4974
 
4192
4975
  /***/ }),
4193
4976
 
4194
- /***/ 9509:
4977
+ /***/ 509:
4195
4978
  /***/ ((module, exports, __webpack_require__) => {
4196
4979
 
4197
4980
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
4198
4981
  /* eslint-disable node/no-deprecated-api */
4199
- var buffer = __webpack_require__(5291)
4982
+ var buffer = __webpack_require__(291)
4200
4983
  var Buffer = buffer.Buffer
4201
4984
 
4202
4985
  // alternative to using Object.keys for old browsers
@@ -4263,7 +5046,7 @@ SafeBuffer.allocUnsafeSlow = function (size) {
4263
5046
 
4264
5047
  /***/ }),
4265
5048
 
4266
- /***/ 2553:
5049
+ /***/ 553:
4267
5050
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4268
5051
 
4269
5052
  // Copyright Joyent, Inc. and other Node contributors.
@@ -4291,7 +5074,7 @@ SafeBuffer.allocUnsafeSlow = function (size) {
4291
5074
 
4292
5075
  /*<replacement>*/
4293
5076
 
4294
- var Buffer = (__webpack_require__(9509).Buffer);
5077
+ var Buffer = (__webpack_require__(509).Buffer);
4295
5078
  /*</replacement>*/
4296
5079
 
4297
5080
  var isEncoding = Buffer.isEncoding || function (encoding) {
@@ -4565,7 +5348,7 @@ function simpleEnd(buf) {
4565
5348
 
4566
5349
  /***/ }),
4567
5350
 
4568
- /***/ 4927:
5351
+ /***/ 927:
4569
5352
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4570
5353
 
4571
5354
 
@@ -4639,7 +5422,7 @@ function config (name) {
4639
5422
 
4640
5423
  /***/ }),
4641
5424
 
4642
- /***/ 6988:
5425
+ /***/ 988:
4643
5426
  /***/ ((module) => {
4644
5427
 
4645
5428
  module.exports = read
@@ -4675,7 +5458,7 @@ function read(buf, offset) {
4675
5458
 
4676
5459
  /***/ }),
4677
5460
 
4678
- /***/ 1312:
5461
+ /***/ 312:
4679
5462
  /***/ ((module) => {
4680
5463
 
4681
5464
  module.exports = encode
@@ -4712,12 +5495,12 @@ function encode(num, out, offset) {
4712
5495
 
4713
5496
  /***/ }),
4714
5497
 
4715
- /***/ 4676:
5498
+ /***/ 676:
4716
5499
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4717
5500
 
4718
5501
  module.exports = {
4719
- encode: __webpack_require__(1312)
4720
- , decode: __webpack_require__(6988)
5502
+ encode: __webpack_require__(312)
5503
+ , decode: __webpack_require__(988)
4721
5504
  , encodingLength: __webpack_require__(82)
4722
5505
  }
4723
5506
 
@@ -4756,7 +5539,7 @@ module.exports = function (value) {
4756
5539
 
4757
5540
  /***/ }),
4758
5541
 
4759
- /***/ 5277:
5542
+ /***/ 277:
4760
5543
  /***/ ((__unused_webpack_module, exports) => {
4761
5544
 
4762
5545
 
@@ -4886,9 +5669,7 @@ function fromByteArray (uint8) {
4886
5669
 
4887
5670
  // go through the array every three bytes, we'll deal with trailing stuff later
4888
5671
  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
4889
- parts.push(encodeChunk(
4890
- uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
4891
- ))
5672
+ parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
4892
5673
  }
4893
5674
 
4894
5675
  // pad the end with zeros, but make sure to not forget the extra bytes
@@ -4915,7 +5696,7 @@ function fromByteArray (uint8) {
4915
5696
 
4916
5697
  /***/ }),
4917
5698
 
4918
- /***/ 5291:
5699
+ /***/ 291:
4919
5700
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4920
5701
 
4921
5702
  /*!
@@ -4928,11 +5709,11 @@ function fromByteArray (uint8) {
4928
5709
 
4929
5710
 
4930
5711
 
4931
- var base64 = __webpack_require__(5277)
4932
- var ieee754 = __webpack_require__(2608)
5712
+ var base64 = __webpack_require__(277)
5713
+ var ieee754 = __webpack_require__(608)
4933
5714
  var customInspectSymbol =
4934
- (typeof Symbol === 'function' && typeof Symbol.for === 'function')
4935
- ? Symbol.for('nodejs.util.inspect.custom')
5715
+ (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
5716
+ ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
4936
5717
  : null
4937
5718
 
4938
5719
  exports.Buffer = Buffer
@@ -5036,7 +5817,7 @@ function from (value, encodingOrOffset, length) {
5036
5817
  }
5037
5818
 
5038
5819
  if (ArrayBuffer.isView(value)) {
5039
- return fromArrayLike(value)
5820
+ return fromArrayView(value)
5040
5821
  }
5041
5822
 
5042
5823
  if (value == null) {
@@ -5117,7 +5898,7 @@ function alloc (size, fill, encoding) {
5117
5898
  if (fill !== undefined) {
5118
5899
  // Only pay attention to encoding if it's a string. This
5119
5900
  // prevents accidentally sending in a number that would
5120
- // be interpretted as a start offset.
5901
+ // be interpreted as a start offset.
5121
5902
  return typeof encoding === 'string'
5122
5903
  ? createBuffer(size).fill(fill, encoding)
5123
5904
  : createBuffer(size).fill(fill)
@@ -5184,6 +5965,14 @@ function fromArrayLike (array) {
5184
5965
  return buf
5185
5966
  }
5186
5967
 
5968
+ function fromArrayView (arrayView) {
5969
+ if (isInstance(arrayView, Uint8Array)) {
5970
+ var copy = new Uint8Array(arrayView)
5971
+ return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)
5972
+ }
5973
+ return fromArrayLike(arrayView)
5974
+ }
5975
+
5187
5976
  function fromArrayBuffer (array, byteOffset, length) {
5188
5977
  if (byteOffset < 0 || array.byteLength < byteOffset) {
5189
5978
  throw new RangeError('"offset" is outside of buffer bounds')
@@ -5323,12 +6112,20 @@ Buffer.concat = function concat (list, length) {
5323
6112
  for (i = 0; i < list.length; ++i) {
5324
6113
  var buf = list[i]
5325
6114
  if (isInstance(buf, Uint8Array)) {
5326
- buf = Buffer.from(buf)
5327
- }
5328
- if (!Buffer.isBuffer(buf)) {
6115
+ if (pos + buf.length > buffer.length) {
6116
+ Buffer.from(buf).copy(buffer, pos)
6117
+ } else {
6118
+ Uint8Array.prototype.set.call(
6119
+ buffer,
6120
+ buf,
6121
+ pos
6122
+ )
6123
+ }
6124
+ } else if (!Buffer.isBuffer(buf)) {
5329
6125
  throw new TypeError('"list" argument must be an Array of Buffers')
6126
+ } else {
6127
+ buf.copy(buffer, pos)
5330
6128
  }
5331
- buf.copy(buffer, pos)
5332
6129
  pos += buf.length
5333
6130
  }
5334
6131
  return buffer
@@ -5410,7 +6207,7 @@ function slowToString (encoding, start, end) {
5410
6207
  return ''
5411
6208
  }
5412
6209
 
5413
- // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
6210
+ // Force coercion to uint32. This will also coerce falsey/NaN values to 0.
5414
6211
  end >>>= 0
5415
6212
  start >>>= 0
5416
6213
 
@@ -5761,10 +6558,6 @@ function asciiWrite (buf, string, offset, length) {
5761
6558
  return blitBuffer(asciiToBytes(string), buf, offset, length)
5762
6559
  }
5763
6560
 
5764
- function latin1Write (buf, string, offset, length) {
5765
- return asciiWrite(buf, string, offset, length)
5766
- }
5767
-
5768
6561
  function base64Write (buf, string, offset, length) {
5769
6562
  return blitBuffer(base64ToBytes(string), buf, offset, length)
5770
6563
  }
@@ -5820,11 +6613,9 @@ Buffer.prototype.write = function write (string, offset, length, encoding) {
5820
6613
  return utf8Write(this, string, offset, length)
5821
6614
 
5822
6615
  case 'ascii':
5823
- return asciiWrite(this, string, offset, length)
5824
-
5825
6616
  case 'latin1':
5826
6617
  case 'binary':
5827
- return latin1Write(this, string, offset, length)
6618
+ return asciiWrite(this, string, offset, length)
5828
6619
 
5829
6620
  case 'base64':
5830
6621
  // Warning: maxLength not taken into account in base64Write
@@ -5867,10 +6658,13 @@ function utf8Slice (buf, start, end) {
5867
6658
  while (i < end) {
5868
6659
  var firstByte = buf[i]
5869
6660
  var codePoint = null
5870
- var bytesPerSequence = (firstByte > 0xEF) ? 4
5871
- : (firstByte > 0xDF) ? 3
5872
- : (firstByte > 0xBF) ? 2
5873
- : 1
6661
+ var bytesPerSequence = (firstByte > 0xEF)
6662
+ ? 4
6663
+ : (firstByte > 0xDF)
6664
+ ? 3
6665
+ : (firstByte > 0xBF)
6666
+ ? 2
6667
+ : 1
5874
6668
 
5875
6669
  if (i + bytesPerSequence <= end) {
5876
6670
  var secondByte, thirdByte, fourthByte, tempCodePoint
@@ -5991,7 +6785,8 @@ function hexSlice (buf, start, end) {
5991
6785
  function utf16leSlice (buf, start, end) {
5992
6786
  var bytes = buf.slice(start, end)
5993
6787
  var res = ''
5994
- for (var i = 0; i < bytes.length; i += 2) {
6788
+ // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)
6789
+ for (var i = 0; i < bytes.length - 1; i += 2) {
5995
6790
  res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
5996
6791
  }
5997
6792
  return res
@@ -6033,6 +6828,7 @@ function checkOffset (offset, ext, length) {
6033
6828
  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
6034
6829
  }
6035
6830
 
6831
+ Buffer.prototype.readUintLE =
6036
6832
  Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
6037
6833
  offset = offset >>> 0
6038
6834
  byteLength = byteLength >>> 0
@@ -6048,6 +6844,7 @@ Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert)
6048
6844
  return val
6049
6845
  }
6050
6846
 
6847
+ Buffer.prototype.readUintBE =
6051
6848
  Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
6052
6849
  offset = offset >>> 0
6053
6850
  byteLength = byteLength >>> 0
@@ -6064,24 +6861,28 @@ Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert)
6064
6861
  return val
6065
6862
  }
6066
6863
 
6864
+ Buffer.prototype.readUint8 =
6067
6865
  Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
6068
6866
  offset = offset >>> 0
6069
6867
  if (!noAssert) checkOffset(offset, 1, this.length)
6070
6868
  return this[offset]
6071
6869
  }
6072
6870
 
6871
+ Buffer.prototype.readUint16LE =
6073
6872
  Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
6074
6873
  offset = offset >>> 0
6075
6874
  if (!noAssert) checkOffset(offset, 2, this.length)
6076
6875
  return this[offset] | (this[offset + 1] << 8)
6077
6876
  }
6078
6877
 
6878
+ Buffer.prototype.readUint16BE =
6079
6879
  Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
6080
6880
  offset = offset >>> 0
6081
6881
  if (!noAssert) checkOffset(offset, 2, this.length)
6082
6882
  return (this[offset] << 8) | this[offset + 1]
6083
6883
  }
6084
6884
 
6885
+ Buffer.prototype.readUint32LE =
6085
6886
  Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
6086
6887
  offset = offset >>> 0
6087
6888
  if (!noAssert) checkOffset(offset, 4, this.length)
@@ -6092,6 +6893,7 @@ Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
6092
6893
  (this[offset + 3] * 0x1000000)
6093
6894
  }
6094
6895
 
6896
+ Buffer.prototype.readUint32BE =
6095
6897
  Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
6096
6898
  offset = offset >>> 0
6097
6899
  if (!noAssert) checkOffset(offset, 4, this.length)
@@ -6209,6 +7011,7 @@ function checkInt (buf, value, offset, ext, max, min) {
6209
7011
  if (offset + ext > buf.length) throw new RangeError('Index out of range')
6210
7012
  }
6211
7013
 
7014
+ Buffer.prototype.writeUintLE =
6212
7015
  Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
6213
7016
  value = +value
6214
7017
  offset = offset >>> 0
@@ -6228,6 +7031,7 @@ Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength,
6228
7031
  return offset + byteLength
6229
7032
  }
6230
7033
 
7034
+ Buffer.prototype.writeUintBE =
6231
7035
  Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
6232
7036
  value = +value
6233
7037
  offset = offset >>> 0
@@ -6247,6 +7051,7 @@ Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength,
6247
7051
  return offset + byteLength
6248
7052
  }
6249
7053
 
7054
+ Buffer.prototype.writeUint8 =
6250
7055
  Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
6251
7056
  value = +value
6252
7057
  offset = offset >>> 0
@@ -6255,6 +7060,7 @@ Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
6255
7060
  return offset + 1
6256
7061
  }
6257
7062
 
7063
+ Buffer.prototype.writeUint16LE =
6258
7064
  Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
6259
7065
  value = +value
6260
7066
  offset = offset >>> 0
@@ -6264,6 +7070,7 @@ Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert
6264
7070
  return offset + 2
6265
7071
  }
6266
7072
 
7073
+ Buffer.prototype.writeUint16BE =
6267
7074
  Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
6268
7075
  value = +value
6269
7076
  offset = offset >>> 0
@@ -6273,6 +7080,7 @@ Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert
6273
7080
  return offset + 2
6274
7081
  }
6275
7082
 
7083
+ Buffer.prototype.writeUint32LE =
6276
7084
  Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
6277
7085
  value = +value
6278
7086
  offset = offset >>> 0
@@ -6284,6 +7092,7 @@ Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert
6284
7092
  return offset + 4
6285
7093
  }
6286
7094
 
7095
+ Buffer.prototype.writeUint32BE =
6287
7096
  Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
6288
7097
  value = +value
6289
7098
  offset = offset >>> 0
@@ -6463,11 +7272,6 @@ Buffer.prototype.copy = function copy (target, targetStart, start, end) {
6463
7272
  if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
6464
7273
  // Use built-in when available, missing from IE11
6465
7274
  this.copyWithin(targetStart, start, end)
6466
- } else if (this === target && start < targetStart && targetStart < end) {
6467
- // descending copy from end
6468
- for (var i = len - 1; i >= 0; --i) {
6469
- target[i + targetStart] = this[i + start]
6470
- }
6471
7275
  } else {
6472
7276
  Uint8Array.prototype.set.call(
6473
7277
  target,
@@ -6716,9 +7520,10 @@ var hexSliceLookupTable = (function () {
6716
7520
 
6717
7521
  /***/ }),
6718
7522
 
6719
- /***/ 2608:
7523
+ /***/ 608:
6720
7524
  /***/ ((__unused_webpack_module, exports) => {
6721
7525
 
7526
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
6722
7527
  exports.read = function (buffer, offset, isLE, mLen, nBytes) {
6723
7528
  var e, m
6724
7529
  var eLen = (nBytes * 8) - mLen - 1
@@ -6807,14 +7612,14 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
6807
7612
 
6808
7613
  /***/ }),
6809
7614
 
6810
- /***/ 2361:
7615
+ /***/ 361:
6811
7616
  /***/ (() => {
6812
7617
 
6813
7618
  /* (ignored) */
6814
7619
 
6815
7620
  /***/ }),
6816
7621
 
6817
- /***/ 4616:
7622
+ /***/ 616:
6818
7623
  /***/ (() => {
6819
7624
 
6820
7625
  /* (ignored) */
@@ -6847,1039 +7652,77 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
6847
7652
  /******/ return module.exports;
6848
7653
  /******/ }
6849
7654
  /******/
6850
- /******/ // expose the modules object (__webpack_modules__)
6851
- /******/ __webpack_require__.m = __webpack_modules__;
6852
- /******/
6853
7655
  /************************************************************************/
6854
- /******/ /* webpack/runtime/compat get default export */
6855
- /******/ (() => {
6856
- /******/ // getDefaultExport function for compatibility with non-harmony modules
6857
- /******/ __webpack_require__.n = (module) => {
6858
- /******/ var getter = module && module.__esModule ?
6859
- /******/ () => (module['default']) :
6860
- /******/ () => (module);
6861
- /******/ __webpack_require__.d(getter, { a: getter });
6862
- /******/ return getter;
6863
- /******/ };
6864
- /******/ })();
6865
- /******/
6866
- /******/ /* webpack/runtime/create fake namespace object */
6867
- /******/ (() => {
6868
- /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
6869
- /******/ var leafPrototypes;
6870
- /******/ // create a fake namespace object
6871
- /******/ // mode & 1: value is a module id, require it
6872
- /******/ // mode & 2: merge all properties of value into the ns
6873
- /******/ // mode & 4: return value when already ns object
6874
- /******/ // mode & 16: return value when it's Promise-like
6875
- /******/ // mode & 8|1: behave like require
6876
- /******/ __webpack_require__.t = function(value, mode) {
6877
- /******/ if(mode & 1) value = this(value);
6878
- /******/ if(mode & 8) return value;
6879
- /******/ if(typeof value === 'object' && value) {
6880
- /******/ if((mode & 4) && value.__esModule) return value;
6881
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
6882
- /******/ }
6883
- /******/ var ns = Object.create(null);
6884
- /******/ __webpack_require__.r(ns);
6885
- /******/ var def = {};
6886
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
6887
- /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
6888
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
6889
- /******/ }
6890
- /******/ def['default'] = () => (value);
6891
- /******/ __webpack_require__.d(ns, def);
6892
- /******/ return ns;
6893
- /******/ };
6894
- /******/ })();
6895
- /******/
6896
7656
  /******/ /* webpack/runtime/define property getters */
6897
- /******/ (() => {
6898
- /******/ // define getter functions for harmony exports
6899
- /******/ __webpack_require__.d = (exports, definition) => {
6900
- /******/ for(var key in definition) {
6901
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
6902
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
6903
- /******/ }
6904
- /******/ }
6905
- /******/ };
6906
- /******/ })();
6907
- /******/
6908
- /******/ /* webpack/runtime/ensure chunk */
6909
- /******/ (() => {
6910
- /******/ __webpack_require__.f = {};
6911
- /******/ // This file contains only the entry chunk.
6912
- /******/ // The chunk loading function for additional chunks
6913
- /******/ __webpack_require__.e = (chunkId) => {
6914
- /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
6915
- /******/ __webpack_require__.f[key](chunkId, promises);
6916
- /******/ return promises;
6917
- /******/ }, []));
6918
- /******/ };
6919
- /******/ })();
6920
- /******/
6921
- /******/ /* webpack/runtime/get javascript chunk filename */
6922
- /******/ (() => {
6923
- /******/ // This function allow to reference async chunks
6924
- /******/ __webpack_require__.u = (chunkId) => {
6925
- /******/ // return url for filenames based on template
6926
- /******/ return "" + "protons" + ".esm";
6927
- /******/ };
6928
- /******/ })();
6929
- /******/
6930
- /******/ /* webpack/runtime/global */
6931
- /******/ (() => {
6932
- /******/ __webpack_require__.g = (function() {
6933
- /******/ if (typeof globalThis === 'object') return globalThis;
6934
- /******/ try {
6935
- /******/ return this || new Function('return this')();
6936
- /******/ } catch (e) {
6937
- /******/ if (typeof window === 'object') return window;
6938
- /******/ }
6939
- /******/ })();
6940
- /******/ })();
6941
- /******/
6942
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
6943
- /******/ (() => {
6944
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
6945
- /******/ })();
6946
- /******/
6947
- /******/ /* webpack/runtime/load script */
6948
- /******/ (() => {
6949
- /******/ var inProgress = {};
6950
- /******/ var dataWebpackPrefix = "@leofcoin/messages:";
6951
- /******/ // loadScript function to load a script via script tag
6952
- /******/ __webpack_require__.l = (url, done, key, chunkId) => {
6953
- /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
6954
- /******/ var script, needAttach;
6955
- /******/ if(key !== undefined) {
6956
- /******/ var scripts = document.getElementsByTagName("script");
6957
- /******/ for(var i = 0; i < scripts.length; i++) {
6958
- /******/ var s = scripts[i];
6959
- /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
6960
- /******/ }
6961
- /******/ }
6962
- /******/ if(!script) {
6963
- /******/ needAttach = true;
6964
- /******/ script = document.createElement('script');
6965
- /******/ script.type = "module";
6966
- /******/ script.charset = 'utf-8';
6967
- /******/ script.timeout = 120;
6968
- /******/ if (__webpack_require__.nc) {
6969
- /******/ script.setAttribute("nonce", __webpack_require__.nc);
6970
- /******/ }
6971
- /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
6972
- /******/ script.src = url;
6973
- /******/ }
6974
- /******/ inProgress[url] = [done];
6975
- /******/ var onScriptComplete = (prev, event) => {
6976
- /******/ // avoid mem leaks in IE.
6977
- /******/ script.onerror = script.onload = null;
6978
- /******/ clearTimeout(timeout);
6979
- /******/ var doneFns = inProgress[url];
6980
- /******/ delete inProgress[url];
6981
- /******/ script.parentNode && script.parentNode.removeChild(script);
6982
- /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
6983
- /******/ if(prev) return prev(event);
6984
- /******/ }
6985
- /******/ ;
6986
- /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
6987
- /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
6988
- /******/ script.onload = onScriptComplete.bind(null, script.onload);
6989
- /******/ needAttach && document.head.appendChild(script);
6990
- /******/ };
6991
- /******/ })();
6992
- /******/
6993
- /******/ /* webpack/runtime/make namespace object */
6994
- /******/ (() => {
6995
- /******/ // define __esModule on exports
6996
- /******/ __webpack_require__.r = (exports) => {
6997
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
6998
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6999
- /******/ }
7000
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
7001
- /******/ };
7002
- /******/ })();
7003
- /******/
7004
- /******/ /* webpack/runtime/publicPath */
7005
- /******/ (() => {
7006
- /******/ var scriptUrl;
7007
- /******/ if (typeof import.meta.url === "string") scriptUrl = import.meta.url
7008
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
7009
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
7010
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
7011
- /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
7012
- /******/ __webpack_require__.p = scriptUrl;
7013
- /******/ })();
7014
- /******/
7015
- /******/ /* webpack/runtime/jsonp chunk loading */
7016
- /******/ (() => {
7017
- /******/ // no baseURI
7018
- /******/
7019
- /******/ // object to store loaded and loading chunks
7020
- /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
7021
- /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
7022
- /******/ var installedChunks = {
7023
- /******/ 158: 0
7024
- /******/ };
7025
- /******/
7026
- /******/ __webpack_require__.f.j = (chunkId, promises) => {
7027
- /******/ // JSONP chunk loading for javascript
7028
- /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
7029
- /******/ if(installedChunkData !== 0) { // 0 means "already installed".
7030
- /******/
7031
- /******/ // a Promise means "currently loading".
7032
- /******/ if(installedChunkData) {
7033
- /******/ promises.push(installedChunkData[2]);
7034
- /******/ } else {
7035
- /******/ if(true) { // all chunks have JS
7036
- /******/ // setup Promise in chunk cache
7037
- /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
7038
- /******/ promises.push(installedChunkData[2] = promise);
7039
- /******/
7040
- /******/ // start chunk loading
7041
- /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
7042
- /******/ // create error before stack unwound to get useful stacktrace later
7043
- /******/ var error = new Error();
7044
- /******/ var loadingEnded = (event) => {
7045
- /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
7046
- /******/ installedChunkData = installedChunks[chunkId];
7047
- /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
7048
- /******/ if(installedChunkData) {
7049
- /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
7050
- /******/ var realSrc = event && event.target && event.target.src;
7051
- /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
7052
- /******/ error.name = 'ChunkLoadError';
7053
- /******/ error.type = errorType;
7054
- /******/ error.request = realSrc;
7055
- /******/ installedChunkData[1](error);
7056
- /******/ }
7057
- /******/ }
7058
- /******/ };
7059
- /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
7060
- /******/ } else installedChunks[chunkId] = 0;
7061
- /******/ }
7062
- /******/ }
7063
- /******/ };
7064
- /******/
7065
- /******/ // no prefetching
7066
- /******/
7067
- /******/ // no preloaded
7068
- /******/
7069
- /******/ // no HMR
7070
- /******/
7071
- /******/ // no HMR manifest
7072
- /******/
7073
- /******/ // no on chunks loaded
7074
- /******/
7075
- /******/ // install a JSONP callback for chunk loading
7076
- /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
7077
- /******/ var [chunkIds, moreModules, runtime] = data;
7078
- /******/ // add "moreModules" to the modules object,
7079
- /******/ // then flag all "chunkIds" as loaded and fire callback
7080
- /******/ var moduleId, chunkId, i = 0;
7081
- /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
7082
- /******/ for(moduleId in moreModules) {
7083
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
7084
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
7085
- /******/ }
7086
- /******/ }
7087
- /******/ if(runtime) var result = runtime(__webpack_require__);
7088
- /******/ }
7089
- /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
7090
- /******/ for(;i < chunkIds.length; i++) {
7091
- /******/ chunkId = chunkIds[i];
7092
- /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
7093
- /******/ installedChunks[chunkId][0]();
7094
- /******/ }
7095
- /******/ installedChunks[chunkId] = 0;
7096
- /******/ }
7097
- /******/
7098
- /******/ }
7099
- /******/
7100
- /******/ var chunkLoadingGlobal = self["webpackChunk_leofcoin_messages"] = self["webpackChunk_leofcoin_messages"] || [];
7101
- /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
7102
- /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
7103
- /******/ })();
7104
- /******/
7105
- /************************************************************************/
7106
- var __webpack_exports__ = {};
7107
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
7108
- (() => {
7109
-
7110
- // EXPORTS
7111
- __webpack_require__.d(__webpack_exports__, {
7112
- "pK": () => (/* reexport */ BWMessage),
7113
- "iP": () => (/* reexport */ BWRequestMessage),
7114
- "NH": () => (/* reexport */ BlockMessage),
7115
- "VJ": () => (/* reexport */ ContractMessage),
7116
- "$Z": () => (/* reexport */ TransactionMessage)
7117
- });
7118
-
7119
- ;// CONCATENATED MODULE: ./src/protos/block.proto.js
7120
- /* harmony default export */ const block_proto = (`
7121
- message ValidatorMessage {
7122
- required string address = 1;
7123
- required string reward = 2;
7124
- }
7125
-
7126
- message Transaction {
7127
- required string hash = 1;
7128
- required uint64 timestamp = 2;
7129
- required string from = 3;
7130
- required string to = 4;
7131
- required uint64 nonce = 5;
7132
- required string method = 6;
7133
- repeated string params = 7;
7134
- }
7135
-
7136
- message BlockMessage {
7137
- required uint64 index = 1;
7138
- required string previousHash = 3;
7139
- required uint64 timestamp = 4;
7140
- required uint64 reward = 5;
7141
- required string fees = 6;
7142
- repeated Transaction transactions = 7;
7143
- repeated ValidatorMessage validators = 8;
7144
- }
7145
- `);
7146
-
7147
- ;// CONCATENATED MODULE: ./node_modules/@vandeurenglenn/base-x/src/base-x.js
7148
- // base-x encoding / decoding
7149
- // Copyright (c) 2018 base-x contributors
7150
- // Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
7151
- // Distributed under the MIT software license, see the accompanying
7152
- // file LICENSE or http://www.opensource.org/licenses/mit-license.php.
7153
- const base = ALPHABET => {
7154
- if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
7155
- const BASE_MAP = new Uint8Array(256)
7156
- for (let j = 0; j < BASE_MAP.length; j++) {
7157
- BASE_MAP[j] = 255
7158
- }
7159
- for (let i = 0; i < ALPHABET.length; i++) {
7160
- const x = ALPHABET.charAt(i)
7161
- const xc = x.charCodeAt(0)
7162
- if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
7163
- BASE_MAP[xc] = i
7164
- }
7165
- const BASE = ALPHABET.length
7166
- const LEADER = ALPHABET.charAt(0)
7167
- const FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up
7168
- const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up
7169
-
7170
- const encode = source => {
7171
- if (source instanceof Uint8Array) {
7172
- } else if (ArrayBuffer.isView(source)) {
7173
- source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)
7174
- } else if (Array.isArray(source)) {
7175
- source = Uint8Array.from(source)
7176
- }
7177
- if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
7178
- if (source.length === 0) { return '' }
7179
- // Skip & count leading zeroes.
7180
- let zeroes = 0
7181
- let length = 0
7182
- let pbegin = 0
7183
- const pend = source.length
7184
- while (pbegin !== pend && source[pbegin] === 0) {
7185
- pbegin++
7186
- zeroes++
7187
- }
7188
- // Allocate enough space in big-endian base58 representation.
7189
- const size = ((pend - pbegin) * iFACTOR + 1) >>> 0
7190
- const b58 = new Uint8Array(size)
7191
- // Process the bytes.
7192
- while (pbegin !== pend) {
7193
- let carry = source[pbegin]
7194
- // Apply "b58 = b58 * 256 + ch".
7195
- let i = 0
7196
- for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
7197
- carry += (256 * b58[it1]) >>> 0
7198
- b58[it1] = (carry % BASE) >>> 0
7199
- carry = (carry / BASE) >>> 0
7200
- }
7201
- if (carry !== 0) { throw new Error('Non-zero carry') }
7202
- length = i
7203
- pbegin++
7204
- }
7205
- // Skip leading zeroes in base58 result.
7206
- let it2 = size - length
7207
- while (it2 !== size && b58[it2] === 0) {
7208
- it2++
7209
- }
7210
- // Translate the result into a string.
7211
- let str = LEADER.repeat(zeroes)
7212
- for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }
7213
- return str
7214
- }
7215
- const decodeUnsafe = source => {
7216
- if (typeof source !== 'string') { throw new TypeError('Expected String') }
7217
- if (source.length === 0) { return new Uint8Array() }
7218
- let psz = 0
7219
- // Skip and count leading '1's.
7220
- let zeroes = 0
7221
- let length = 0
7222
- while (source[psz] === LEADER) {
7223
- zeroes++
7224
- psz++
7225
- }
7226
- // Allocate enough space in big-endian base256 representation.
7227
- const size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.
7228
- let b256 = new Uint8Array(size)
7229
- // Process the characters.
7230
- while (source[psz]) {
7231
- // Decode character
7232
- let carry = BASE_MAP[source.charCodeAt(psz)]
7233
- // Invalid character
7234
- if (carry === 255) { return }
7235
- let i = 0
7236
- for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
7237
- carry += (BASE * b256[it3]) >>> 0
7238
- b256[it3] = (carry % 256) >>> 0
7239
- carry = (carry / 256) >>> 0
7240
- }
7241
- if (carry !== 0) { throw new Error('Non-zero carry') }
7242
- length = i
7243
- psz++
7244
- }
7245
- // Skip leading zeroes in b256.
7246
- let it4 = size - length
7247
- while (it4 !== size && b256[it4] === 0) {
7248
- it4++
7249
- }
7250
- let vch = new Uint8Array(zeroes + (size - it4))
7251
- let j = zeroes
7252
- while (it4 !== size) {
7253
- vch[j++] = b256[it4++]
7254
- }
7255
- return vch
7256
- }
7257
- const decode = string => {
7258
- const buffer = decodeUnsafe(string)
7259
- if (buffer) { return buffer }
7260
- throw new Error('Non-base' + BASE + ' character')
7261
- }
7262
- return {
7263
- encode: encode,
7264
- decodeUnsafe: decodeUnsafe,
7265
- decode: decode
7266
- }
7267
- }
7268
-
7269
- /* harmony default export */ const base_x = (base);
7270
-
7271
- ;// CONCATENATED MODULE: ./node_modules/@vandeurenglenn/base32/src/base32.js
7272
-
7273
-
7274
- const base32_base32 = 'abcdefghijklmnopqrstuvwxyz234567'
7275
- const base32Hex = '0123456789abcdefghijklmnopqrstuv'
7276
-
7277
- const decode = (uint8Array, hex = false) => {
7278
- const decoder = hex ? base_x(base32Hex) : base_x(base32_base32)
7279
- return decoder.decode(uint8Array)
7280
- }
7281
-
7282
- /* harmony default export */ const src_base32 = ({
7283
- encode: (uint8Array, hex = false) => {
7284
- const encoder = hex ? base_x(base32Hex) : base_x(base32_base32)
7285
- return encoder.encode(uint8Array)
7286
- },
7287
- decode,
7288
- isBase32: (uint8Array, hex = false) => {
7289
- try {
7290
- decode(uint8Array, hex)
7291
- return true;
7292
- } catch (e) {
7293
- return false;
7294
- }
7295
- }
7296
- });
7297
-
7298
- ;// CONCATENATED MODULE: ./node_modules/@vandeurenglenn/base58/src/base58.js
7299
-
7300
-
7301
- const base58_base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
7302
-
7303
- const base58_decode = uint8Array => base_x(base58_base58).decode(uint8Array)
7304
-
7305
- /* harmony default export */ const src_base58 = ({
7306
- encode: uint8Array => base_x(base58_base58).encode(uint8Array),
7307
- decode: base58_decode,
7308
- isBase58: uint8Array => {
7309
- try {
7310
- base58_decode(uint8Array)
7311
- return true
7312
- } catch (e) {
7313
- return false
7314
- }
7315
- }
7316
- });
7317
-
7318
- ;// CONCATENATED MODULE: ./node_modules/@vandeurenglenn/is-hex/is-hex.js
7319
- /* harmony default export */ const is_hex = (string => /^[A-F0-9]+$/i.test(string));
7320
-
7321
- ;// CONCATENATED MODULE: ./node_modules/@leofcoin/codec-format-interface/src/basic-interface.js
7322
-
7323
-
7324
-
7325
-
7326
- class BasicInterface {
7327
- #handleDecode() {
7328
- if (!this.decode) throw new Error('bad implementation: needs decode func')
7329
- return this.decode()
7330
- }
7331
-
7332
- #handleEncode() {
7333
- if (!this.encode) throw new Error('bad implementation: needs encode func')
7334
- return this.encode()
7335
- }
7336
- isHex(string) {
7337
- return is_hex(string)
7338
- }
7339
- isBase32(string) {
7340
- return base32.isBase32(string)
7341
- }
7342
- isBase58(string) {
7343
- return base58.isBase32(string)
7344
- }
7345
- /**
7346
- * @param {String} encoded
7347
- */
7348
- fromBs32(encoded) {
7349
- this.encoded = src_base32.decode(encoded)
7350
- return this.#handleDecode()
7351
- }
7352
-
7353
- /**
7354
- * @param {String} encoded
7355
- */
7356
- fromBs58(encoded) {
7357
- this.encoded = src_base58.decode(encoded)
7358
- return this.#handleDecode()
7359
- }
7360
-
7361
- async toArray() {
7362
- const array = []
7363
- for await (const value of this.encoded.values()) {
7364
- array.push(value)
7365
- }
7366
- return array
7367
- }
7368
-
7369
- fromString(string) {
7370
- this.encoded = new Uint8Array(string.split(','))
7371
- return this.#handleDecode()
7372
- }
7373
-
7374
- fromArray(array) {
7375
- this.encoded = new Uint8Array([...array])
7376
- return this.#handleDecode()
7377
- }
7378
-
7379
- /**
7380
- * @param {Buffer} encoded
7381
- */
7382
- fromEncoded(encoded) {
7383
- this.encoded = encoded
7384
- return this.#handleDecode()
7385
- }
7386
-
7387
- /**
7388
- * @param {String} encoded
7389
- */
7390
- fromHex(encoded) {
7391
- this.encoded = Buffer.from(encoded, 'hex')
7392
- return this.#handleDecode()
7393
- }
7394
-
7395
- async toString(encoding = 'utf8') {
7396
- if (!this.encoded) await this.#handleEncode()
7397
- return this.encoded.toString(encoding)
7398
- }
7399
-
7400
- /**
7401
- * @return {String} encoded
7402
- */
7403
- toHex() {
7404
- return this.toString('hex')
7405
- }
7406
-
7407
- /**
7408
- * @return {String} encoded
7409
- */
7410
- async toBs32() {
7411
- if (!this.encoded) await this.#handleEncode()
7412
- return src_base32.encode(this.encoded)
7413
- }
7414
-
7415
- /**
7416
- * @return {String} encoded
7417
- */
7418
- async toBs58() {
7419
- if (!this.encoded) await this.#handleEncode()
7420
- return src_base58.encode(this.encoded)
7421
- }
7422
-
7423
- /**
7424
- * @param {Object} data
7425
- */
7426
- create(data) {
7427
- const decoded = {}
7428
- if (this.keys?.length > 0) {
7429
- for (const key of this.keys) {
7430
- Object.defineProperties(decoded, {
7431
- [key]: {
7432
- enumerable: true,
7433
- configurable: true,
7434
- set: (val) => value = data[key],
7435
- get: () => data[key]
7436
- }
7437
- })
7438
- }
7439
-
7440
- this.decoded = decoded
7441
- return this.encode()
7442
- }
7443
- }
7444
- }
7445
-
7446
- // EXTERNAL MODULE: ./node_modules/varint/index.js
7447
- var varint = __webpack_require__(4676);
7448
- var varint_default = /*#__PURE__*/__webpack_require__.n(varint);
7449
- ;// CONCATENATED MODULE: ./node_modules/@leofcoin/codec-format-interface/src/codecs.js
7450
- /* harmony default export */ const codecs = ({
7451
- // just a hash
7452
- 'disco-hash': {
7453
- codec: parseInt('30', 16),
7454
- hashAlg: 'dbl-keccak-256', // ,
7455
- // testnet: 'olivia'
7456
- },
7457
- 'peernet-peer-response': {
7458
- codec: parseInt('707072', 16),
7459
- hashAlg: 'keccak-256',
7460
- },
7461
- 'peernet-peer': {
7462
- codec: parseInt('7070', 16),
7463
- hashAlg: 'keccak-256',
7464
- },
7465
- 'peernet-dht': {
7466
- codec: parseInt('706468', 16),
7467
- hashAlg: 'keccak-256',
7468
- },
7469
- 'peernet-dht-response': {
7470
- codec: parseInt('706472', 16),
7471
- hashAlg: 'keccak-256',
7472
- },
7473
- // data
7474
- 'peernet-data': {
7475
- codec: parseInt('706461', 16),
7476
- hashAlg: 'keccak-256',
7477
- },
7478
- 'peernet-data-response': {
7479
- codec: parseInt('70646172', 16),
7480
- hashAlg: 'keccak-256',
7481
- },
7482
- // message
7483
- 'peernet-message': {
7484
- codec: parseInt('706d65', 16),
7485
- hashAlg: 'keccak-256',
7486
- },
7487
- // pubsub
7488
- 'peernet-ps': {
7489
- codec: parseInt('707073', 16),
7490
- hashAlg: 'keccak-256',
7491
- },
7492
- 'peernet-response': {
7493
- codec: parseInt('7072', 16),
7494
- hashAlg: 'keccak-256',
7495
- },
7496
- 'peernet-request': {
7497
- codec: parseInt('707271', 16),
7498
- hashAlg: 'keccak-256',
7499
- },
7500
- // normal block
7501
- 'leofcoin-block': {
7502
- codec: parseInt('6c62', 16),
7503
- hashAlg: 'dbl-keccak-512', // ,
7504
- // testnet: 'olivia'
7505
- },
7506
- 'leofcoin-tx': {
7507
- codec: parseInt('6c74', 16),
7508
- hashAlg: 'dbl-keccak-512', // ,
7509
- // testnet: 'olivia'
7510
- },
7511
- // itx
7512
- 'leofcoin-itx': {
7513
- codec: parseInt('6c69', 16),
7514
- hashAlg: 'keccak-512', // ,
7515
- // testnet: 'olivia'
7516
- },
7517
- // peer reputation
7518
- 'leofcoin-pr': {
7519
- codec: parseInt('6c70', 16),
7520
- hashAlg: 'keccak-256', // ,
7521
- // testnet: 'olivia'
7522
- },
7523
- // chat message
7524
- 'chat-message': {
7525
- codec: parseInt('636d', 16),
7526
- hashAlg: 'dbl-keccak-256',
7527
- },
7528
- });
7529
-
7530
- ;// CONCATENATED MODULE: ./node_modules/@leofcoin/codec-format-interface/src/codec.js
7531
-
7532
-
7533
-
7534
-
7535
- class PeernetCodec extends BasicInterface {
7536
- get codecs() {
7537
- return {...globalThis.peernet.codecs, ...codecs}
7538
- }
7539
- constructor(buffer) {
7540
- super()
7541
- if (buffer) {
7542
- if (buffer instanceof Uint8Array) {
7543
- const codec = varint_default().decode(buffer);
7544
- const name = this.getCodecName(codec)
7545
- if (name) {
7546
- this.name = name
7547
- this.encoded = buffer
7548
- this.decode(buffer)
7549
- } else {
7550
- this.encode(buffer)
7551
- }
7552
- } else if (buffer instanceof ArrayBuffer) {
7553
- const encoded = new Uint8Array(buffer.byteLength)
7554
-
7555
- for (let i = 0; i < buffer.byteLength; i++) {
7556
- encoded[i] = buffer[i]
7557
- }
7558
- this.encoded = encoded
7559
- // this.encoded = new Uint8Array(buffer, buffer.byteOffset, buffer.byteLength)
7560
- this.decode(buffer)
7561
- return
7562
- }
7563
- if (typeof buffer === 'string') {
7564
- if (this.codecs[buffer]) this.fromName(buffer)
7565
- else if (this.isHex(buffer)) this.fromHex(buffer)
7566
- else if (this.isBase32(buffer)) this.fromBs32(buffer)
7567
- else if (this.isBase58(buffer)) this.fromBs58(buffer)
7568
- else throw new Error(`unsupported string ${buffer}`)
7569
- }
7570
- if (!isNaN(buffer)) if (this.codecs[this.getCodecName(buffer)]) this.fromCodec(buffer)
7571
- }
7572
- }
7573
-
7574
- fromEncoded(encoded) {
7575
- const codec = varint_default().decode(encoded);
7576
- const name = this.getCodecName(codec)
7577
- this.name = name
7578
- this.encoded = encoded
7579
- this.decode(encoded)
7580
- }
7581
-
7582
- getCodec(name) {
7583
- return this.codecs[name].codec
7584
- }
7585
-
7586
- getCodecName(codec) {
7587
- return Object.keys(this.codecs).reduce((p, c) => {
7588
- const item = this.codecs[c]
7589
- if (item.codec === codec) return c;
7590
- else return p;
7591
- }, undefined)
7592
- }
7593
-
7594
- getHashAlg(name) {
7595
- return this.codecs[name].hashAlg
7596
- }
7597
-
7598
- fromCodec(codec) {
7599
- this.name = this.getCodecName(codec)
7600
- this.hashAlg = this.getHashAlg(this.name)
7601
-
7602
- this.codec = this.getCodec(this.name)
7603
- this.codecBuffer = varint_default().encode(codec)
7604
- }
7605
-
7606
- fromName(name) {
7607
- const codec = this.getCodec(name)
7608
- this.name = name
7609
- this.codec = codec
7610
- this.hashAlg = this.getHashAlg(name)
7611
- this.codecBuffer = varint_default().encode(codec)
7612
- }
7613
-
7614
- decode() {
7615
- const codec = varint_default().decode(this.encoded);
7616
- this.fromCodec(codec)
7617
- }
7618
-
7619
- encode() {
7620
- const codec = varint_default().encode(this.decoded)
7621
- this.encoded = codec
7622
- return this.encoded
7623
- }
7624
- }
7657
+ /******/ (() => {
7658
+ /******/ // define getter functions for harmony exports
7659
+ /******/ __webpack_require__.d = (exports, definition) => {
7660
+ /******/ for(var key in definition) {
7661
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
7662
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
7663
+ /******/ }
7664
+ /******/ }
7665
+ /******/ };
7666
+ /******/ })();
7667
+ /******/
7668
+ /******/ /* webpack/runtime/global */
7669
+ /******/ (() => {
7670
+ /******/ __webpack_require__.g = (function() {
7671
+ /******/ if (typeof globalThis === 'object') return globalThis;
7672
+ /******/ try {
7673
+ /******/ return this || new Function('return this')();
7674
+ /******/ } catch (e) {
7675
+ /******/ if (typeof window === 'object') return window;
7676
+ /******/ }
7677
+ /******/ })();
7678
+ /******/ })();
7679
+ /******/
7680
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
7681
+ /******/ (() => {
7682
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
7683
+ /******/ })();
7684
+ /******/
7685
+ /******/ /* webpack/runtime/make namespace object */
7686
+ /******/ (() => {
7687
+ /******/ // define __esModule on exports
7688
+ /******/ __webpack_require__.r = (exports) => {
7689
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
7690
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
7691
+ /******/ }
7692
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
7693
+ /******/ };
7694
+ /******/ })();
7695
+ /******/
7696
+ /************************************************************************/
7697
+ var __webpack_exports__ = {};
7698
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
7699
+ (() => {
7625
7700
 
7626
- // EXTERNAL MODULE: ./node_modules/keccak/js.js
7627
- var js = __webpack_require__(5811);
7628
- var js_default = /*#__PURE__*/__webpack_require__.n(js);
7629
- ;// CONCATENATED MODULE: ./node_modules/@leofcoin/codec-format-interface/src/codec-hash.js
7630
-
7631
-
7632
-
7633
-
7634
-
7635
- class CodecHash extends BasicInterface {
7636
- constructor(buffer, options = {}) {
7637
- super()
7638
- if (options.name) this.name = options.name
7639
- else this.name = 'disco-hash'
7640
- if (options.codecs) this.codecs = options.codecs
7641
- if (buffer) {
7642
- if (buffer instanceof Uint8Array) {
7643
- this.discoCodec = new PeernetCodec(buffer, this.codecs)
7644
- const name = this.discoCodec.name
7645
-
7646
- if (name) {
7647
- this.name = name
7648
- this.decode(buffer)
7649
- } else {
7650
- this.encode(buffer)
7651
- }
7652
- }
7653
-
7654
- if (typeof buffer === 'string') {
7655
- if (this.isHex(buffer)) this.fromHex(buffer)
7656
- if (this.isBase32(buffer)) this.fromBs32(buffer)
7657
- else if (this.isBase58(buffer)) this.fromBs58(buffer)
7658
- else throw new Error(`unsupported string ${buffer}`)
7659
- } else if (typeof buffer === 'object') this.fromJSON(buffer)
7660
- }
7661
- }
7662
-
7663
- get prefix() {
7664
- const length = this.length
7665
- const uint8Array = new Uint8Array(length.length + this.discoCodec.codecBuffer.length)
7666
- uint8Array.set(length)
7667
- uint8Array.set(this.discoCodec.codecBuffer, length.length)
7668
-
7669
- return uint8Array
7670
- }
7671
-
7672
- get length() {
7673
- return varint_default().encode(this.size)
7674
- }
7675
-
7676
- get buffer() {
7677
- return this.encoded
7678
- }
7679
-
7680
- get hash() {
7681
- return this.encoded
7682
- }
7683
-
7684
- fromJSON(json) {
7685
- return this.encode(Buffer.from(JSON.stringify(json)))
7686
- }
7687
-
7688
- encode(buffer, name) {
7689
- if (!this.name && name) this.name = name;
7690
- if (!buffer) buffer = this.buffer;
7691
- this.discoCodec = new PeernetCodec(this.name, this.codecs)
7692
- this.discoCodec.fromName(this.name)
7693
- let hashAlg = this.discoCodec.hashAlg
7694
- if (hashAlg.includes('dbl')) {
7695
- hashAlg = hashAlg.replace('dbl-', '')
7696
- buffer = js_default()(hashAlg.replace('-', '')).update(buffer).digest()
7697
- }
7698
- this.digest = js_default()(hashAlg.replace('-', '')).update(buffer).digest()
7699
- this.size = this.digest.length
7700
-
7701
- this.codec = this.discoCodec.encode();
7702
- this.codec = this.discoCodec.codecBuffer
7703
- const uint8Array = new Uint8Array(this.digest.length + this.prefix.length)
7704
- uint8Array.set(this.prefix)
7705
- uint8Array.set(this.digest, this.prefix.length)
7706
-
7707
- this.encoded = uint8Array
7708
-
7709
- return this.encoded
7710
- }
7711
-
7712
- validate(buffer) {
7713
- if (Buffer.isBuffer(buffer)) {
7714
- const codec = varint_default().decode(buffer);
7715
- if (this.codecs[codec]) {
7716
- this.decode(buffer)
7717
- } else {
7718
- this.encode(buffer)
7719
- }
7720
- }
7721
- if (typeof buffer === 'string') {
7722
- if (this.isHex(buffer)) this.fromHex(buffer)
7723
- if (this.isBase32(buffer)) this.fromBs32(buffer)
7724
- }
7725
- if (typeof buffer === 'object') this.fromJSON(buffer)
7726
- }
7727
-
7728
- decode(buffer) {
7729
- this.encoded = buffer
7730
- const codec = varint_default().decode(buffer);
7731
-
7732
- this.discoCodec = new PeernetCodec(codec, this.codecs)
7733
- // TODO: validate codec
7734
- buffer = buffer.slice((varint_default()).decode.bytes);
7735
- this.size = varint_default().decode(buffer);
7736
- this.digest = buffer.slice((varint_default()).decode.bytes);
7737
- if (this.digest.length !== this.size) {
7738
- throw new Error(`hash length inconsistent: 0x${this.encoded.toString('hex')}`)
7739
- }
7740
-
7741
- // const discoCodec = new Codec(codec, this.codecs)
7742
-
7743
- this.name = this.discoCodec.name
7744
-
7745
-
7746
- this.size = this.digest.length
7747
-
7748
- return {
7749
- codec: this.codec,
7750
- name: this.name,
7751
- size: this.size,
7752
- length: this.length,
7753
- digest: this.digest,
7754
- }
7755
- }
7756
- }
7701
+ // EXPORTS
7702
+ __webpack_require__.d(__webpack_exports__, {
7703
+ "pK": () => (/* reexport */ BWMessage),
7704
+ "iP": () => (/* reexport */ BWRequestMessage),
7705
+ "NH": () => (/* reexport */ BlockMessage),
7706
+ "VJ": () => (/* reexport */ ContractMessage),
7707
+ "$Z": () => (/* reexport */ TransactionMessage)
7708
+ });
7757
7709
 
7758
- ;// CONCATENATED MODULE: ./node_modules/@leofcoin/codec-format-interface/src/codec-format-interface.js
7759
-
7760
-
7761
-
7762
- let protons
7763
-
7764
- class FormatInterface extends BasicInterface {
7765
- async #importProtons() {
7766
- let importee = await __webpack_require__.e(/* import() | protons */ 397).then(__webpack_require__.t.bind(__webpack_require__, 7160, 23))
7767
- return importee.default
7768
- }
7769
-
7770
- async protoEncode(data) {
7771
- if (!protons) protons = await this.#importProtons()
7772
- return protons(this.proto)[this.messageName].encode(data)
7773
- }
7774
-
7775
- async protoDecode(data) {
7776
- if (!protons) protons = await this.#importProtons()
7777
- return protons(this.proto)[this.messageName].decode(data)
7778
- }
7779
-
7780
- async #init(buffer) {
7781
- if (buffer instanceof Uint8Array) await this.fromUint8Array(buffer)
7782
- else if (buffer instanceof ArrayBuffer) await this.fromArrayBuffer(buffer)
7783
- else if (buffer?.name === this.name) return buffer
7784
- else if (buffer instanceof String) {
7785
- if (this.isHex(buffer)) await this.fromHex(buffer)
7786
- else if (this.isBase32(buffer)) await this.fromBs32(buffer)
7787
- else if (this.isBase58(buffer)) await this.fromBs58(buffer)
7788
- else throw new Error(`unsupported string ${buffer}`)
7789
- } else {
7790
- await this.create(buffer)
7791
- }
7792
- return this
7793
- }
7794
-
7795
- /**
7796
- * @param {Buffer|String|Object} buffer - data - The data needed to create the desired message
7797
- * @param {Object} proto - {encode, decode}
7798
- * @param {Object} options - {hashFormat, name}
7799
- */
7800
- constructor(buffer, proto, options = {}) {
7801
- super()
7802
- this.proto = proto
7803
- this.hashFormat = options.hashFormat || 'bs32'
7804
- if (options.name) this.name = options.name
7805
- return this.#init(buffer)
7806
- }
7807
-
7808
- /**
7809
- * @return {PeernetHash}
7810
- */
7811
- get peernetHash() {
7812
- return new CodecHash(this.decoded, {name: this.name})
7813
- }
7814
-
7815
- /**
7816
- * @return {peernetHash}
7817
- */
7818
- get hash() {
7819
- const upper = this.hashFormat.charAt(0).toUpperCase()
7820
- const format = `${upper}${this.hashFormat.substring(1, this.hashFormat.length)}`
7821
- return this.peernetHash[`to${format}`]()
7822
- }
7823
-
7824
- /**
7825
- * @return {Object}
7826
- */
7827
- async decode() {
7828
- let encoded = this.encoded;
7829
- const discoCodec = new PeernetCodec(this.encoded)
7830
- encoded = encoded.slice(discoCodec.codecBuffer.length)
7831
- this.name = discoCodec.name
7832
- this.decoded = await this.protoDecode(encoded)
7833
- return this.decoded
7834
- }
7835
-
7836
- /**
7837
- * @return {Buffer}
7838
- */
7839
- async encode(decoded) {
7840
- if (!decoded) decoded = this.decoded;
7841
- const codec = new PeernetCodec(this.name)
7842
- const encoded = await this.protoEncode(decoded)
7843
- const uint8Array = new Uint8Array(encoded.length + codec.codecBuffer.length)
7844
- uint8Array.set(codec.codecBuffer)
7845
- uint8Array.set(encoded, codec.codecBuffer.length)
7846
- this.encoded = uint8Array
7847
- return this.encoded
7848
- }
7849
-
7850
- hasCodec() {
7851
- if (!this.encoded) return false
7852
- const codec = new PeernetCodec(this.encoded)
7853
- if (codec.name) return true
7854
- }
7855
-
7856
- fromUint8Array(buffer) {
7857
- this.encoded = buffer
7858
- return this.hasCodec() ? this.decode() : this.create(
7859
- JSON.parse(new TextDecoder().decode(this.encoded))
7860
- )
7861
- }
7862
-
7863
- fromArrayBuffer(buffer) {
7864
- this.encoded = new Uint8Array(buffer, buffer.byteOffset, buffer.byteLength)
7865
- return this.hasCodec() ? this.decode() : this.create(
7866
- JSON.parse(new TextDecoder().decode(this.encoded))
7867
- )
7868
- }
7710
+ ;// CONCATENATED MODULE: ./src/protos/contract.proto.js
7711
+ /* harmony default export */ const contract_proto = (`
7712
+ message ContractMessage {
7713
+ required string creator = 1;
7714
+ required bytes contract = 2;
7715
+ repeated string constructorParameters = 3;
7869
7716
  }
7717
+ `);
7870
7718
 
7871
- ;// CONCATENATED MODULE: ./node_modules/@leofcoin/codec-format-interface/src/index.js
7872
-
7873
-
7874
-
7875
-
7876
-
7877
-
7719
+ // EXTERNAL MODULE: ./node_modules/@leofcoin/codec-format-interface/dist/index.js
7720
+ var dist = __webpack_require__(427);
7878
7721
  ;// CONCATENATED MODULE: ./src/messages/contract.js
7879
7722
 
7880
7723
 
7881
7724
 
7882
- class ContractMessage extends FormatInterface {
7725
+ class ContractMessage extends dist/* FormatInterface */.L1 {
7883
7726
  get keys() {
7884
7727
  return ['creator', 'contract', 'constructorParameters']
7885
7728
  }
@@ -7889,17 +7732,31 @@ class ContractMessage extends FormatInterface {
7889
7732
  }
7890
7733
 
7891
7734
  constructor(buffer) {
7892
- super(buffer, block_proto, {name: 'contract-message'})
7735
+ super(buffer, contract_proto, {name: 'contract-message'})
7893
7736
  }
7894
7737
  }
7895
7738
 
7739
+ ;// CONCATENATED MODULE: ./src/protos/transaction.proto.js
7740
+ /* harmony default export */ const transaction_proto = (`
7741
+
7742
+ message TransactionMessage {
7743
+ required uint64 timestamp = 1;
7744
+ required string from = 2;
7745
+ required string to = 3;
7746
+ required uint64 nonce = 4;
7747
+ required string method = 5;
7748
+ repeated string params = 6;
7749
+ required string signature = 7;
7750
+ }
7751
+ `);
7752
+
7896
7753
  ;// CONCATENATED MODULE: ./src/messages/transaction.js
7897
7754
 
7898
7755
 
7899
7756
 
7900
- class TransactionMessage extends FormatInterface {
7757
+ class TransactionMessage extends dist/* FormatInterface */.L1 {
7901
7758
  get keys() {
7902
- return ['timestamp', 'from', 'to', 'nonce', 'method', 'params']
7759
+ return ['timestamp', 'from', 'to', 'nonce', 'method', 'params', 'signature']
7903
7760
  }
7904
7761
 
7905
7762
  get messageName() {
@@ -7908,15 +7765,43 @@ class TransactionMessage extends FormatInterface {
7908
7765
 
7909
7766
  constructor(buffer) {
7910
7767
  const name = 'transaction-message'
7911
- super(buffer, block_proto, {name})
7768
+ super(buffer, transaction_proto, {name})
7912
7769
  }
7913
7770
  }
7914
7771
 
7772
+ ;// CONCATENATED MODULE: ./src/protos/block.proto.js
7773
+ /* harmony default export */ const block_proto = (`
7774
+ message ValidatorMessage {
7775
+ required string address = 1;
7776
+ required string reward = 2;
7777
+ }
7778
+
7779
+ message Transaction {
7780
+ required string hash = 1;
7781
+ required uint64 timestamp = 2;
7782
+ required string from = 3;
7783
+ required string to = 4;
7784
+ required uint64 nonce = 5;
7785
+ required string method = 6;
7786
+ repeated string params = 7;
7787
+ }
7788
+
7789
+ message BlockMessage {
7790
+ required uint64 index = 1;
7791
+ required string previousHash = 3;
7792
+ required uint64 timestamp = 4;
7793
+ required uint64 reward = 5;
7794
+ required string fees = 6;
7795
+ repeated Transaction transactions = 7;
7796
+ repeated ValidatorMessage validators = 8;
7797
+ }
7798
+ `);
7799
+
7915
7800
  ;// CONCATENATED MODULE: ./src/messages/block.js
7916
7801
 
7917
7802
 
7918
7803
 
7919
- class BlockMessage extends FormatInterface {
7804
+ class BlockMessage extends dist/* FormatInterface */.L1 {
7920
7805
  get keys() {
7921
7806
  return ['index', 'previousHash', 'timestamp', 'reward', 'fees', 'transactions', 'validators']
7922
7807
  }
@@ -7931,11 +7816,20 @@ class BlockMessage extends FormatInterface {
7931
7816
  }
7932
7817
  }
7933
7818
 
7819
+ ;// CONCATENATED MODULE: ./src/protos/bw.proto.js
7820
+ /* harmony default export */ const bw_proto = (`
7821
+
7822
+ message BWMessage {
7823
+ required uint64 up = 1;
7824
+ required uint64 down = 2;
7825
+ }
7826
+ `);
7827
+
7934
7828
  ;// CONCATENATED MODULE: ./src/messages/bw.js
7935
7829
 
7936
7830
 
7937
7831
 
7938
- class BWMessage extends FormatInterface {
7832
+ class BWMessage extends dist/* FormatInterface */.L1 {
7939
7833
  get keys() {
7940
7834
  return ['up', 'down']
7941
7835
  }
@@ -7946,15 +7840,22 @@ class BWMessage extends FormatInterface {
7946
7840
 
7947
7841
  constructor(buffer) {
7948
7842
  const name = 'bw-message'
7949
- super(buffer, block_proto, {name})
7843
+ super(buffer, bw_proto, {name})
7950
7844
  }
7951
7845
  }
7952
7846
 
7847
+ ;// CONCATENATED MODULE: ./src/protos/bw-request.proto.js
7848
+ /* harmony default export */ const bw_request_proto = (`
7849
+
7850
+ message BWRequestMessage {
7851
+ }
7852
+ `);
7853
+
7953
7854
  ;// CONCATENATED MODULE: ./src/messages/bw-request.js
7954
7855
 
7955
7856
 
7956
7857
 
7957
- class BWRequestMessage extends FormatInterface {
7858
+ class BWRequestMessage extends dist/* FormatInterface */.L1 {
7958
7859
  get keys() {
7959
7860
  return []
7960
7861
  }
@@ -7965,7 +7866,7 @@ class BWRequestMessage extends FormatInterface {
7965
7866
 
7966
7867
  constructor(buffer) {
7967
7868
  const name = 'bw-request-message'
7968
- super(buffer, block_proto, {name})
7869
+ super(buffer, bw_request_proto, {name})
7969
7870
  }
7970
7871
  }
7971
7872