@fireproof/core 0.17.7 → 0.17.8
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -5
- package/dist/browser/fireproof.global.js +2144 -689
- package/dist/browser/fireproof.global.js.map +1 -1
- package/dist/browser/metafile-iife.json +1 -1
- package/dist/memory/fireproof.global.js +2144 -689
- package/dist/memory/fireproof.global.js.map +1 -1
- package/dist/memory/metafile-iife.json +1 -1
- package/dist/node/fireproof.global.js +2223 -768
- package/dist/node/fireproof.global.js.map +1 -1
- package/dist/node/metafile-iife.json +1 -1
- package/package.json +3 -3
@@ -35,14 +35,14 @@ var Fireproof = (() => {
|
|
35
35
|
var require_encode = __commonJS({
|
36
36
|
"../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(exports2, module2) {
|
37
37
|
"use strict";
|
38
|
-
module2.exports =
|
38
|
+
module2.exports = encode20;
|
39
39
|
var MSB4 = 128;
|
40
40
|
var REST4 = 127;
|
41
41
|
var MSBALL4 = ~REST4;
|
42
42
|
var INT4 = Math.pow(2, 31);
|
43
|
-
function
|
43
|
+
function encode20(num, out, offset) {
|
44
44
|
if (Number.MAX_SAFE_INTEGER && num > Number.MAX_SAFE_INTEGER) {
|
45
|
-
|
45
|
+
encode20.bytes = 0;
|
46
46
|
throw new RangeError("Could not encode varint");
|
47
47
|
}
|
48
48
|
out = out || [];
|
@@ -57,7 +57,7 @@ var Fireproof = (() => {
|
|
57
57
|
num >>>= 7;
|
58
58
|
}
|
59
59
|
out[offset] = num | 0;
|
60
|
-
|
60
|
+
encode20.bytes = offset - oldOffset + 1;
|
61
61
|
return out;
|
62
62
|
}
|
63
63
|
}
|
@@ -70,14 +70,14 @@ var Fireproof = (() => {
|
|
70
70
|
module2.exports = read6;
|
71
71
|
var MSB4 = 128;
|
72
72
|
var REST4 = 127;
|
73
|
-
function read6(
|
74
|
-
var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l =
|
73
|
+
function read6(buf3, offset) {
|
74
|
+
var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf3.length;
|
75
75
|
do {
|
76
76
|
if (counter >= l || shift > 49) {
|
77
77
|
read6.bytes = 0;
|
78
78
|
throw new RangeError("Could not decode varint");
|
79
79
|
}
|
80
|
-
b =
|
80
|
+
b = buf3[counter++];
|
81
81
|
res += shift < 28 ? (b & REST4) << shift : (b & REST4) * Math.pow(2, shift);
|
82
82
|
shift += 7;
|
83
83
|
} while (b >= MSB4);
|
@@ -173,11 +173,11 @@ var Fireproof = (() => {
|
|
173
173
|
for (i = 0; i < 64; )
|
174
174
|
s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;
|
175
175
|
var i;
|
176
|
-
base643.encode = function
|
176
|
+
base643.encode = function encode20(buffer3, start, end) {
|
177
177
|
var parts = null, chunk = [];
|
178
178
|
var i2 = 0, j = 0, t;
|
179
179
|
while (start < end) {
|
180
|
-
var b =
|
180
|
+
var b = buffer3[start++];
|
181
181
|
switch (j) {
|
182
182
|
case 0:
|
183
183
|
chunk[i2++] = b64[b >> 2];
|
@@ -214,7 +214,7 @@ var Fireproof = (() => {
|
|
214
214
|
return String.fromCharCode.apply(String, chunk.slice(0, i2));
|
215
215
|
};
|
216
216
|
var invalidEncoding = "invalid encoding";
|
217
|
-
base643.decode = function
|
217
|
+
base643.decode = function decode24(string3, buffer3, offset) {
|
218
218
|
var start = offset;
|
219
219
|
var j = 0, t;
|
220
220
|
for (var i2 = 0; i2 < string3.length; ) {
|
@@ -229,17 +229,17 @@ var Fireproof = (() => {
|
|
229
229
|
j = 1;
|
230
230
|
break;
|
231
231
|
case 1:
|
232
|
-
|
232
|
+
buffer3[offset++] = t << 2 | (c & 48) >> 4;
|
233
233
|
t = c;
|
234
234
|
j = 2;
|
235
235
|
break;
|
236
236
|
case 2:
|
237
|
-
|
237
|
+
buffer3[offset++] = (t & 15) << 4 | (c & 60) >> 2;
|
238
238
|
t = c;
|
239
239
|
j = 3;
|
240
240
|
break;
|
241
241
|
case 3:
|
242
|
-
|
242
|
+
buffer3[offset++] = (t & 3) << 6 | c;
|
243
243
|
j = 0;
|
244
244
|
break;
|
245
245
|
}
|
@@ -309,34 +309,34 @@ var Fireproof = (() => {
|
|
309
309
|
if (typeof Float32Array !== "undefined")
|
310
310
|
(function() {
|
311
311
|
var f322 = new Float32Array([-0]), f8b2 = new Uint8Array(f322.buffer), le = f8b2[3] === 128;
|
312
|
-
function writeFloat_f32_cpy(val,
|
312
|
+
function writeFloat_f32_cpy(val, buf3, pos) {
|
313
313
|
f322[0] = val;
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
314
|
+
buf3[pos] = f8b2[0];
|
315
|
+
buf3[pos + 1] = f8b2[1];
|
316
|
+
buf3[pos + 2] = f8b2[2];
|
317
|
+
buf3[pos + 3] = f8b2[3];
|
318
318
|
}
|
319
|
-
function writeFloat_f32_rev(val,
|
319
|
+
function writeFloat_f32_rev(val, buf3, pos) {
|
320
320
|
f322[0] = val;
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
321
|
+
buf3[pos] = f8b2[3];
|
322
|
+
buf3[pos + 1] = f8b2[2];
|
323
|
+
buf3[pos + 2] = f8b2[1];
|
324
|
+
buf3[pos + 3] = f8b2[0];
|
325
325
|
}
|
326
326
|
exports3.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;
|
327
327
|
exports3.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;
|
328
|
-
function readFloat_f32_cpy(
|
329
|
-
f8b2[0] =
|
330
|
-
f8b2[1] =
|
331
|
-
f8b2[2] =
|
332
|
-
f8b2[3] =
|
328
|
+
function readFloat_f32_cpy(buf3, pos) {
|
329
|
+
f8b2[0] = buf3[pos];
|
330
|
+
f8b2[1] = buf3[pos + 1];
|
331
|
+
f8b2[2] = buf3[pos + 2];
|
332
|
+
f8b2[3] = buf3[pos + 3];
|
333
333
|
return f322[0];
|
334
334
|
}
|
335
|
-
function readFloat_f32_rev(
|
336
|
-
f8b2[3] =
|
337
|
-
f8b2[2] =
|
338
|
-
f8b2[1] =
|
339
|
-
f8b2[0] =
|
335
|
+
function readFloat_f32_rev(buf3, pos) {
|
336
|
+
f8b2[3] = buf3[pos];
|
337
|
+
f8b2[2] = buf3[pos + 1];
|
338
|
+
f8b2[1] = buf3[pos + 2];
|
339
|
+
f8b2[0] = buf3[pos + 3];
|
340
340
|
return f322[0];
|
341
341
|
}
|
342
342
|
exports3.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;
|
@@ -344,7 +344,7 @@ var Fireproof = (() => {
|
|
344
344
|
})();
|
345
345
|
else
|
346
346
|
(function() {
|
347
|
-
function writeFloat_ieee754(writeUint, val,
|
347
|
+
function writeFloat_ieee754(writeUint, val, buf3, pos) {
|
348
348
|
var sign = val < 0 ? 1 : 0;
|
349
349
|
if (sign)
|
350
350
|
val = -val;
|
@@ -355,22 +355,22 @@ var Fireproof = (() => {
|
|
355
355
|
) : (
|
356
356
|
/* negative 0 */
|
357
357
|
2147483648
|
358
|
-
),
|
358
|
+
), buf3, pos);
|
359
359
|
else if (isNaN(val))
|
360
|
-
writeUint(2143289344,
|
360
|
+
writeUint(2143289344, buf3, pos);
|
361
361
|
else if (val > 34028234663852886e22)
|
362
|
-
writeUint((sign << 31 | 2139095040) >>> 0,
|
362
|
+
writeUint((sign << 31 | 2139095040) >>> 0, buf3, pos);
|
363
363
|
else if (val < 11754943508222875e-54)
|
364
|
-
writeUint((sign << 31 | Math.round(val / 1401298464324817e-60)) >>> 0,
|
364
|
+
writeUint((sign << 31 | Math.round(val / 1401298464324817e-60)) >>> 0, buf3, pos);
|
365
365
|
else {
|
366
366
|
var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;
|
367
|
-
writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0,
|
367
|
+
writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf3, pos);
|
368
368
|
}
|
369
369
|
}
|
370
370
|
exports3.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);
|
371
371
|
exports3.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);
|
372
|
-
function readFloat_ieee754(readUint,
|
373
|
-
var uint = readUint(
|
372
|
+
function readFloat_ieee754(readUint, buf3, pos) {
|
373
|
+
var uint = readUint(buf3, pos), sign = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607;
|
374
374
|
return exponent === 255 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 1401298464324817e-60 * mantissa : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);
|
375
375
|
}
|
376
376
|
exports3.readFloatLE = readFloat_ieee754.bind(null, readUintLE);
|
@@ -379,50 +379,50 @@ var Fireproof = (() => {
|
|
379
379
|
if (typeof Float64Array !== "undefined")
|
380
380
|
(function() {
|
381
381
|
var f642 = new Float64Array([-0]), f8b2 = new Uint8Array(f642.buffer), le = f8b2[7] === 128;
|
382
|
-
function writeDouble_f64_cpy(val,
|
382
|
+
function writeDouble_f64_cpy(val, buf3, pos) {
|
383
383
|
f642[0] = val;
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
384
|
+
buf3[pos] = f8b2[0];
|
385
|
+
buf3[pos + 1] = f8b2[1];
|
386
|
+
buf3[pos + 2] = f8b2[2];
|
387
|
+
buf3[pos + 3] = f8b2[3];
|
388
|
+
buf3[pos + 4] = f8b2[4];
|
389
|
+
buf3[pos + 5] = f8b2[5];
|
390
|
+
buf3[pos + 6] = f8b2[6];
|
391
|
+
buf3[pos + 7] = f8b2[7];
|
392
392
|
}
|
393
|
-
function writeDouble_f64_rev(val,
|
393
|
+
function writeDouble_f64_rev(val, buf3, pos) {
|
394
394
|
f642[0] = val;
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
395
|
+
buf3[pos] = f8b2[7];
|
396
|
+
buf3[pos + 1] = f8b2[6];
|
397
|
+
buf3[pos + 2] = f8b2[5];
|
398
|
+
buf3[pos + 3] = f8b2[4];
|
399
|
+
buf3[pos + 4] = f8b2[3];
|
400
|
+
buf3[pos + 5] = f8b2[2];
|
401
|
+
buf3[pos + 6] = f8b2[1];
|
402
|
+
buf3[pos + 7] = f8b2[0];
|
403
403
|
}
|
404
404
|
exports3.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;
|
405
405
|
exports3.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;
|
406
|
-
function readDouble_f64_cpy(
|
407
|
-
f8b2[0] =
|
408
|
-
f8b2[1] =
|
409
|
-
f8b2[2] =
|
410
|
-
f8b2[3] =
|
411
|
-
f8b2[4] =
|
412
|
-
f8b2[5] =
|
413
|
-
f8b2[6] =
|
414
|
-
f8b2[7] =
|
406
|
+
function readDouble_f64_cpy(buf3, pos) {
|
407
|
+
f8b2[0] = buf3[pos];
|
408
|
+
f8b2[1] = buf3[pos + 1];
|
409
|
+
f8b2[2] = buf3[pos + 2];
|
410
|
+
f8b2[3] = buf3[pos + 3];
|
411
|
+
f8b2[4] = buf3[pos + 4];
|
412
|
+
f8b2[5] = buf3[pos + 5];
|
413
|
+
f8b2[6] = buf3[pos + 6];
|
414
|
+
f8b2[7] = buf3[pos + 7];
|
415
415
|
return f642[0];
|
416
416
|
}
|
417
|
-
function readDouble_f64_rev(
|
418
|
-
f8b2[7] =
|
419
|
-
f8b2[6] =
|
420
|
-
f8b2[5] =
|
421
|
-
f8b2[4] =
|
422
|
-
f8b2[3] =
|
423
|
-
f8b2[2] =
|
424
|
-
f8b2[1] =
|
425
|
-
f8b2[0] =
|
417
|
+
function readDouble_f64_rev(buf3, pos) {
|
418
|
+
f8b2[7] = buf3[pos];
|
419
|
+
f8b2[6] = buf3[pos + 1];
|
420
|
+
f8b2[5] = buf3[pos + 2];
|
421
|
+
f8b2[4] = buf3[pos + 3];
|
422
|
+
f8b2[3] = buf3[pos + 4];
|
423
|
+
f8b2[2] = buf3[pos + 5];
|
424
|
+
f8b2[1] = buf3[pos + 6];
|
425
|
+
f8b2[0] = buf3[pos + 7];
|
426
426
|
return f642[0];
|
427
427
|
}
|
428
428
|
exports3.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;
|
@@ -430,45 +430,45 @@ var Fireproof = (() => {
|
|
430
430
|
})();
|
431
431
|
else
|
432
432
|
(function() {
|
433
|
-
function writeDouble_ieee754(writeUint, off0, off1, val,
|
433
|
+
function writeDouble_ieee754(writeUint, off0, off1, val, buf3, pos) {
|
434
434
|
var sign = val < 0 ? 1 : 0;
|
435
435
|
if (sign)
|
436
436
|
val = -val;
|
437
437
|
if (val === 0) {
|
438
|
-
writeUint(0,
|
438
|
+
writeUint(0, buf3, pos + off0);
|
439
439
|
writeUint(1 / val > 0 ? (
|
440
440
|
/* positive */
|
441
441
|
0
|
442
442
|
) : (
|
443
443
|
/* negative 0 */
|
444
444
|
2147483648
|
445
|
-
),
|
445
|
+
), buf3, pos + off1);
|
446
446
|
} else if (isNaN(val)) {
|
447
|
-
writeUint(0,
|
448
|
-
writeUint(2146959360,
|
447
|
+
writeUint(0, buf3, pos + off0);
|
448
|
+
writeUint(2146959360, buf3, pos + off1);
|
449
449
|
} else if (val > 17976931348623157e292) {
|
450
|
-
writeUint(0,
|
451
|
-
writeUint((sign << 31 | 2146435072) >>> 0,
|
450
|
+
writeUint(0, buf3, pos + off0);
|
451
|
+
writeUint((sign << 31 | 2146435072) >>> 0, buf3, pos + off1);
|
452
452
|
} else {
|
453
453
|
var mantissa;
|
454
454
|
if (val < 22250738585072014e-324) {
|
455
455
|
mantissa = val / 5e-324;
|
456
|
-
writeUint(mantissa >>> 0,
|
457
|
-
writeUint((sign << 31 | mantissa / 4294967296) >>> 0,
|
456
|
+
writeUint(mantissa >>> 0, buf3, pos + off0);
|
457
|
+
writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf3, pos + off1);
|
458
458
|
} else {
|
459
459
|
var exponent = Math.floor(Math.log(val) / Math.LN2);
|
460
460
|
if (exponent === 1024)
|
461
461
|
exponent = 1023;
|
462
462
|
mantissa = val * Math.pow(2, -exponent);
|
463
|
-
writeUint(mantissa * 4503599627370496 >>> 0,
|
464
|
-
writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0,
|
463
|
+
writeUint(mantissa * 4503599627370496 >>> 0, buf3, pos + off0);
|
464
|
+
writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf3, pos + off1);
|
465
465
|
}
|
466
466
|
}
|
467
467
|
}
|
468
468
|
exports3.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);
|
469
469
|
exports3.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);
|
470
|
-
function readDouble_ieee754(readUint, off0, off1,
|
471
|
-
var lo = readUint(
|
470
|
+
function readDouble_ieee754(readUint, off0, off1, buf3, pos) {
|
471
|
+
var lo = readUint(buf3, pos + off0), hi = readUint(buf3, pos + off1);
|
472
472
|
var sign = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo;
|
473
473
|
return exponent === 2047 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 5e-324 * mantissa : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);
|
474
474
|
}
|
@@ -477,23 +477,23 @@ var Fireproof = (() => {
|
|
477
477
|
})();
|
478
478
|
return exports3;
|
479
479
|
}
|
480
|
-
function writeUintLE(val,
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
480
|
+
function writeUintLE(val, buf3, pos) {
|
481
|
+
buf3[pos] = val & 255;
|
482
|
+
buf3[pos + 1] = val >>> 8 & 255;
|
483
|
+
buf3[pos + 2] = val >>> 16 & 255;
|
484
|
+
buf3[pos + 3] = val >>> 24;
|
485
485
|
}
|
486
|
-
function writeUintBE(val,
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
486
|
+
function writeUintBE(val, buf3, pos) {
|
487
|
+
buf3[pos] = val >>> 24;
|
488
|
+
buf3[pos + 1] = val >>> 16 & 255;
|
489
|
+
buf3[pos + 2] = val >>> 8 & 255;
|
490
|
+
buf3[pos + 3] = val & 255;
|
491
491
|
}
|
492
|
-
function readUintLE(
|
493
|
-
return (
|
492
|
+
function readUintLE(buf3, pos) {
|
493
|
+
return (buf3[pos] | buf3[pos + 1] << 8 | buf3[pos + 2] << 16 | buf3[pos + 3] << 24) >>> 0;
|
494
494
|
}
|
495
|
-
function readUintBE(
|
496
|
-
return (
|
495
|
+
function readUintBE(buf3, pos) {
|
496
|
+
return (buf3[pos] << 24 | buf3[pos + 1] << 16 | buf3[pos + 2] << 8 | buf3[pos + 3]) >>> 0;
|
497
497
|
}
|
498
498
|
}
|
499
499
|
});
|
@@ -536,23 +536,23 @@ var Fireproof = (() => {
|
|
536
536
|
}
|
537
537
|
return len;
|
538
538
|
};
|
539
|
-
utf84.read = function utf8_read(
|
539
|
+
utf84.read = function utf8_read(buffer3, start, end) {
|
540
540
|
var len = end - start;
|
541
541
|
if (len < 1)
|
542
542
|
return "";
|
543
543
|
var parts = null, chunk = [], i = 0, t;
|
544
544
|
while (start < end) {
|
545
|
-
t =
|
545
|
+
t = buffer3[start++];
|
546
546
|
if (t < 128)
|
547
547
|
chunk[i++] = t;
|
548
548
|
else if (t > 191 && t < 224)
|
549
|
-
chunk[i++] = (t & 31) << 6 |
|
549
|
+
chunk[i++] = (t & 31) << 6 | buffer3[start++] & 63;
|
550
550
|
else if (t > 239 && t < 365) {
|
551
|
-
t = ((t & 7) << 18 | (
|
551
|
+
t = ((t & 7) << 18 | (buffer3[start++] & 63) << 12 | (buffer3[start++] & 63) << 6 | buffer3[start++] & 63) - 65536;
|
552
552
|
chunk[i++] = 55296 + (t >> 10);
|
553
553
|
chunk[i++] = 56320 + (t & 1023);
|
554
554
|
} else
|
555
|
-
chunk[i++] = (t & 15) << 12 | (
|
555
|
+
chunk[i++] = (t & 15) << 12 | (buffer3[start++] & 63) << 6 | buffer3[start++] & 63;
|
556
556
|
if (i > 8191) {
|
557
557
|
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
558
558
|
i = 0;
|
@@ -565,26 +565,26 @@ var Fireproof = (() => {
|
|
565
565
|
}
|
566
566
|
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
567
567
|
};
|
568
|
-
utf84.write = function utf8_write(string3,
|
568
|
+
utf84.write = function utf8_write(string3, buffer3, offset) {
|
569
569
|
var start = offset, c1, c2;
|
570
570
|
for (var i = 0; i < string3.length; ++i) {
|
571
571
|
c1 = string3.charCodeAt(i);
|
572
572
|
if (c1 < 128) {
|
573
|
-
|
573
|
+
buffer3[offset++] = c1;
|
574
574
|
} else if (c1 < 2048) {
|
575
|
-
|
576
|
-
|
575
|
+
buffer3[offset++] = c1 >> 6 | 192;
|
576
|
+
buffer3[offset++] = c1 & 63 | 128;
|
577
577
|
} else if ((c1 & 64512) === 55296 && ((c2 = string3.charCodeAt(i + 1)) & 64512) === 56320) {
|
578
578
|
c1 = 65536 + ((c1 & 1023) << 10) + (c2 & 1023);
|
579
579
|
++i;
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
580
|
+
buffer3[offset++] = c1 >> 18 | 240;
|
581
|
+
buffer3[offset++] = c1 >> 12 & 63 | 128;
|
582
|
+
buffer3[offset++] = c1 >> 6 & 63 | 128;
|
583
|
+
buffer3[offset++] = c1 & 63 | 128;
|
584
584
|
} else {
|
585
|
-
|
586
|
-
|
587
|
-
|
585
|
+
buffer3[offset++] = c1 >> 12 | 224;
|
586
|
+
buffer3[offset++] = c1 >> 6 & 63 | 128;
|
587
|
+
buffer3[offset++] = c1 & 63 | 128;
|
588
588
|
}
|
589
589
|
}
|
590
590
|
return offset - start;
|
@@ -597,22 +597,22 @@ var Fireproof = (() => {
|
|
597
597
|
"../../node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js"(exports2, module2) {
|
598
598
|
"use strict";
|
599
599
|
module2.exports = pool2;
|
600
|
-
function pool2(
|
600
|
+
function pool2(alloc4, slice4, size) {
|
601
601
|
var SIZE = size || 8192;
|
602
602
|
var MAX = SIZE >>> 1;
|
603
603
|
var slab = null;
|
604
604
|
var offset = SIZE;
|
605
605
|
return function pool_alloc(size2) {
|
606
606
|
if (size2 < 1 || size2 > MAX)
|
607
|
-
return
|
607
|
+
return alloc4(size2);
|
608
608
|
if (offset + size2 > SIZE) {
|
609
|
-
slab =
|
609
|
+
slab = alloc4(SIZE);
|
610
610
|
offset = 0;
|
611
611
|
}
|
612
|
-
var
|
612
|
+
var buf3 = slice4.call(slab, offset, offset += size2);
|
613
613
|
if (offset & 7)
|
614
614
|
offset = (offset | 7) + 1;
|
615
|
-
return
|
615
|
+
return buf3;
|
616
616
|
};
|
617
617
|
}
|
618
618
|
}
|
@@ -935,7 +935,7 @@ var Fireproof = (() => {
|
|
935
935
|
};
|
936
936
|
};
|
937
937
|
Writer.create = create18();
|
938
|
-
Writer.alloc = function
|
938
|
+
Writer.alloc = function alloc4(size) {
|
939
939
|
return new util.Array(size);
|
940
940
|
};
|
941
941
|
if (util.Array !== Array)
|
@@ -945,15 +945,15 @@ var Fireproof = (() => {
|
|
945
945
|
this.len += len;
|
946
946
|
return this;
|
947
947
|
};
|
948
|
-
function writeByte2(val,
|
949
|
-
|
948
|
+
function writeByte2(val, buf3, pos) {
|
949
|
+
buf3[pos] = val & 255;
|
950
950
|
}
|
951
|
-
function writeVarint322(val,
|
951
|
+
function writeVarint322(val, buf3, pos) {
|
952
952
|
while (val > 127) {
|
953
|
-
|
953
|
+
buf3[pos++] = val & 127 | 128;
|
954
954
|
val >>>= 7;
|
955
955
|
}
|
956
|
-
|
956
|
+
buf3[pos] = val;
|
957
957
|
}
|
958
958
|
function VarintOp2(len, val) {
|
959
959
|
this.len = len;
|
@@ -975,17 +975,17 @@ var Fireproof = (() => {
|
|
975
975
|
Writer.prototype.sint32 = function write_sint32(value) {
|
976
976
|
return this.uint32((value << 1 ^ value >> 31) >>> 0);
|
977
977
|
};
|
978
|
-
function writeVarint642(val,
|
978
|
+
function writeVarint642(val, buf3, pos) {
|
979
979
|
while (val.hi) {
|
980
|
-
|
980
|
+
buf3[pos++] = val.lo & 127 | 128;
|
981
981
|
val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;
|
982
982
|
val.hi >>>= 7;
|
983
983
|
}
|
984
984
|
while (val.lo > 127) {
|
985
|
-
|
985
|
+
buf3[pos++] = val.lo & 127 | 128;
|
986
986
|
val.lo = val.lo >>> 7;
|
987
987
|
}
|
988
|
-
|
988
|
+
buf3[pos++] = val.lo;
|
989
989
|
}
|
990
990
|
Writer.prototype.uint64 = function write_uint64(value) {
|
991
991
|
var bits = LongBits2.from(value);
|
@@ -999,11 +999,11 @@ var Fireproof = (() => {
|
|
999
999
|
Writer.prototype.bool = function write_bool(value) {
|
1000
1000
|
return this._push(writeByte2, 1, value ? 1 : 0);
|
1001
1001
|
};
|
1002
|
-
function writeFixed322(val,
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1002
|
+
function writeFixed322(val, buf3, pos) {
|
1003
|
+
buf3[pos] = val & 255;
|
1004
|
+
buf3[pos + 1] = val >>> 8 & 255;
|
1005
|
+
buf3[pos + 2] = val >>> 16 & 255;
|
1006
|
+
buf3[pos + 3] = val >>> 24;
|
1007
1007
|
}
|
1008
1008
|
Writer.prototype.fixed32 = function write_fixed32(value) {
|
1009
1009
|
return this._push(writeFixed322, 4, value >>> 0);
|
@@ -1020,20 +1020,20 @@ var Fireproof = (() => {
|
|
1020
1020
|
Writer.prototype.double = function write_double(value) {
|
1021
1021
|
return this._push(util.float.writeDoubleLE, 8, value);
|
1022
1022
|
};
|
1023
|
-
var writeBytes3 = util.Array.prototype.set ? function writeBytes_set(val,
|
1024
|
-
|
1025
|
-
} : function writeBytes_for(val,
|
1023
|
+
var writeBytes3 = util.Array.prototype.set ? function writeBytes_set(val, buf3, pos) {
|
1024
|
+
buf3.set(val, pos);
|
1025
|
+
} : function writeBytes_for(val, buf3, pos) {
|
1026
1026
|
for (var i = 0; i < val.length; ++i)
|
1027
|
-
|
1027
|
+
buf3[pos + i] = val[i];
|
1028
1028
|
};
|
1029
1029
|
Writer.prototype.bytes = function write_bytes(value) {
|
1030
1030
|
var len = value.length >>> 0;
|
1031
1031
|
if (!len)
|
1032
1032
|
return this._push(writeByte2, 1, 0);
|
1033
1033
|
if (util.isString(value)) {
|
1034
|
-
var
|
1035
|
-
base643.decode(value,
|
1036
|
-
value =
|
1034
|
+
var buf3 = Writer.alloc(len = base643.length(value));
|
1035
|
+
base643.decode(value, buf3, 0);
|
1036
|
+
value = buf3;
|
1037
1037
|
}
|
1038
1038
|
return this.uint32(len)._push(writeBytes3, len, value);
|
1039
1039
|
};
|
@@ -1070,13 +1070,13 @@ var Fireproof = (() => {
|
|
1070
1070
|
return this;
|
1071
1071
|
};
|
1072
1072
|
Writer.prototype.finish = function finish() {
|
1073
|
-
var head = this.head.next,
|
1073
|
+
var head = this.head.next, buf3 = this.constructor.alloc(this.len), pos = 0;
|
1074
1074
|
while (head) {
|
1075
|
-
head.fn(head.val,
|
1075
|
+
head.fn(head.val, buf3, pos);
|
1076
1076
|
pos += head.len;
|
1077
1077
|
head = head.next;
|
1078
1078
|
}
|
1079
|
-
return
|
1079
|
+
return buf3;
|
1080
1080
|
};
|
1081
1081
|
Writer._configure = function(BufferWriter_) {
|
1082
1082
|
BufferWriter = BufferWriter_;
|
@@ -1099,14 +1099,14 @@ var Fireproof = (() => {
|
|
1099
1099
|
}
|
1100
1100
|
BufferWriter._configure = function() {
|
1101
1101
|
BufferWriter.alloc = util._Buffer_allocUnsafe;
|
1102
|
-
BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val,
|
1103
|
-
|
1104
|
-
} : function writeBytesBuffer_copy(val,
|
1102
|
+
BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf3, pos) {
|
1103
|
+
buf3.set(val, pos);
|
1104
|
+
} : function writeBytesBuffer_copy(val, buf3, pos) {
|
1105
1105
|
if (val.copy)
|
1106
|
-
val.copy(
|
1106
|
+
val.copy(buf3, pos, 0, val.length);
|
1107
1107
|
else
|
1108
1108
|
for (var i = 0; i < val.length; )
|
1109
|
-
|
1109
|
+
buf3[pos++] = val[i++];
|
1110
1110
|
};
|
1111
1111
|
};
|
1112
1112
|
BufferWriter.prototype.bytes = function write_bytes_buffer(value) {
|
@@ -1118,13 +1118,13 @@ var Fireproof = (() => {
|
|
1118
1118
|
this._push(BufferWriter.writeBytesBuffer, len, value);
|
1119
1119
|
return this;
|
1120
1120
|
};
|
1121
|
-
function writeStringBuffer2(val,
|
1121
|
+
function writeStringBuffer2(val, buf3, pos) {
|
1122
1122
|
if (val.length < 40)
|
1123
|
-
util.utf8.write(val,
|
1124
|
-
else if (
|
1125
|
-
|
1123
|
+
util.utf8.write(val, buf3, pos);
|
1124
|
+
else if (buf3.utf8Write)
|
1125
|
+
buf3.utf8Write(val, pos);
|
1126
1126
|
else
|
1127
|
-
|
1127
|
+
buf3.write(val, pos);
|
1128
1128
|
}
|
1129
1129
|
BufferWriter.prototype.string = function write_string_buffer(value) {
|
1130
1130
|
var len = util.Buffer.byteLength(value);
|
@@ -1149,25 +1149,25 @@ var Fireproof = (() => {
|
|
1149
1149
|
function indexOutOfRange2(reader, writeLength) {
|
1150
1150
|
return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len);
|
1151
1151
|
}
|
1152
|
-
function Reader(
|
1153
|
-
this.buf =
|
1152
|
+
function Reader(buffer3) {
|
1153
|
+
this.buf = buffer3;
|
1154
1154
|
this.pos = 0;
|
1155
|
-
this.len =
|
1155
|
+
this.len = buffer3.length;
|
1156
1156
|
}
|
1157
|
-
var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(
|
1158
|
-
if (
|
1159
|
-
return new Reader(
|
1157
|
+
var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(buffer3) {
|
1158
|
+
if (buffer3 instanceof Uint8Array || Array.isArray(buffer3))
|
1159
|
+
return new Reader(buffer3);
|
1160
1160
|
throw Error("illegal buffer");
|
1161
|
-
} : function create_array2(
|
1162
|
-
if (Array.isArray(
|
1163
|
-
return new Reader(
|
1161
|
+
} : function create_array2(buffer3) {
|
1162
|
+
if (Array.isArray(buffer3))
|
1163
|
+
return new Reader(buffer3);
|
1164
1164
|
throw Error("illegal buffer");
|
1165
1165
|
};
|
1166
1166
|
var create18 = function create19() {
|
1167
|
-
return util.Buffer ? function create_buffer_setup(
|
1168
|
-
return (Reader.create = function create_buffer(
|
1169
|
-
return util.Buffer.isBuffer(
|
1170
|
-
})(
|
1167
|
+
return util.Buffer ? function create_buffer_setup(buffer3) {
|
1168
|
+
return (Reader.create = function create_buffer(buffer4) {
|
1169
|
+
return util.Buffer.isBuffer(buffer4) ? new BufferReader(buffer4) : create_array(buffer4);
|
1170
|
+
})(buffer3);
|
1171
1171
|
} : create_array;
|
1172
1172
|
};
|
1173
1173
|
Reader.create = create18();
|
@@ -1250,8 +1250,8 @@ var Fireproof = (() => {
|
|
1250
1250
|
Reader.prototype.bool = function read_bool() {
|
1251
1251
|
return this.uint32() !== 0;
|
1252
1252
|
};
|
1253
|
-
function readFixed32_end(
|
1254
|
-
return (
|
1253
|
+
function readFixed32_end(buf3, end) {
|
1254
|
+
return (buf3[end - 4] | buf3[end - 3] << 8 | buf3[end - 2] << 16 | buf3[end - 1] << 24) >>> 0;
|
1255
1255
|
}
|
1256
1256
|
Reader.prototype.fixed32 = function read_fixed32() {
|
1257
1257
|
if (this.pos + 4 > this.len)
|
@@ -1373,8 +1373,8 @@ var Fireproof = (() => {
|
|
1373
1373
|
var Reader = require_reader();
|
1374
1374
|
(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;
|
1375
1375
|
var util = require_minimal();
|
1376
|
-
function BufferReader(
|
1377
|
-
Reader.call(this,
|
1376
|
+
function BufferReader(buffer3) {
|
1377
|
+
Reader.call(this, buffer3);
|
1378
1378
|
}
|
1379
1379
|
BufferReader._configure = function() {
|
1380
1380
|
if (util.Buffer)
|
@@ -2429,10 +2429,10 @@ var Fireproof = (() => {
|
|
2429
2429
|
}
|
2430
2430
|
exports2.factory = function(codec) {
|
2431
2431
|
return {
|
2432
|
-
encode:
|
2433
|
-
decode:
|
2432
|
+
encode: encode20,
|
2433
|
+
decode: decode24
|
2434
2434
|
};
|
2435
|
-
function
|
2435
|
+
function encode20(array) {
|
2436
2436
|
if (array === null) {
|
2437
2437
|
return "A";
|
2438
2438
|
}
|
@@ -2451,11 +2451,11 @@ var Fireproof = (() => {
|
|
2451
2451
|
}
|
2452
2452
|
function encodeItem(item) {
|
2453
2453
|
if (typeof item === "object") {
|
2454
|
-
return
|
2454
|
+
return encode20(item);
|
2455
2455
|
}
|
2456
2456
|
return escape(codec.encode(item));
|
2457
2457
|
}
|
2458
|
-
function
|
2458
|
+
function decode24(encoded) {
|
2459
2459
|
if (encoded === "A") {
|
2460
2460
|
return null;
|
2461
2461
|
}
|
@@ -2992,7 +2992,7 @@ var Fireproof = (() => {
|
|
2992
2992
|
var LEADER = ALPHABET.charAt(0);
|
2993
2993
|
var FACTOR = Math.log(BASE) / Math.log(256);
|
2994
2994
|
var iFACTOR = Math.log(256) / Math.log(BASE);
|
2995
|
-
function
|
2995
|
+
function encode20(source) {
|
2996
2996
|
if (source instanceof Uint8Array)
|
2997
2997
|
;
|
2998
2998
|
else if (ArrayBuffer.isView(source)) {
|
@@ -3090,17 +3090,17 @@ var Fireproof = (() => {
|
|
3090
3090
|
}
|
3091
3091
|
return vch;
|
3092
3092
|
}
|
3093
|
-
function
|
3094
|
-
var
|
3095
|
-
if (
|
3096
|
-
return
|
3093
|
+
function decode24(string3) {
|
3094
|
+
var buffer3 = decodeUnsafe(string3);
|
3095
|
+
if (buffer3) {
|
3096
|
+
return buffer3;
|
3097
3097
|
}
|
3098
3098
|
throw new Error(`Non-${name7} character`);
|
3099
3099
|
}
|
3100
3100
|
return {
|
3101
|
-
encode:
|
3101
|
+
encode: encode20,
|
3102
3102
|
decodeUnsafe,
|
3103
|
-
decode:
|
3103
|
+
decode: decode24
|
3104
3104
|
};
|
3105
3105
|
}
|
3106
3106
|
var src = base;
|
@@ -3287,17 +3287,17 @@ var Fireproof = (() => {
|
|
3287
3287
|
return this.decoder.decode(input);
|
3288
3288
|
}
|
3289
3289
|
};
|
3290
|
-
var from = ({ name: name7, prefix, encode:
|
3290
|
+
var from = ({ name: name7, prefix, encode: encode20, decode: decode24 }) => new Codec(name7, prefix, encode20, decode24);
|
3291
3291
|
var baseX = ({ prefix, name: name7, alphabet: alphabet3 }) => {
|
3292
|
-
const { encode:
|
3292
|
+
const { encode: encode20, decode: decode24 } = base_x_default(alphabet3, name7);
|
3293
3293
|
return from({
|
3294
3294
|
prefix,
|
3295
3295
|
name: name7,
|
3296
|
-
encode:
|
3296
|
+
encode: encode20,
|
3297
3297
|
/**
|
3298
3298
|
* @param {string} text
|
3299
3299
|
*/
|
3300
|
-
decode: (text) => coerce(
|
3300
|
+
decode: (text) => coerce(decode24(text))
|
3301
3301
|
});
|
3302
3302
|
};
|
3303
3303
|
var decode = (string3, alphabet3, bitsPerChar, name7) => {
|
@@ -3311,21 +3311,21 @@ var Fireproof = (() => {
|
|
3311
3311
|
}
|
3312
3312
|
const out = new Uint8Array(end * bitsPerChar / 8 | 0);
|
3313
3313
|
let bits = 0;
|
3314
|
-
let
|
3314
|
+
let buffer3 = 0;
|
3315
3315
|
let written = 0;
|
3316
3316
|
for (let i = 0; i < end; ++i) {
|
3317
3317
|
const value = codes[string3[i]];
|
3318
3318
|
if (value === void 0) {
|
3319
3319
|
throw new SyntaxError(`Non-${name7} character`);
|
3320
3320
|
}
|
3321
|
-
|
3321
|
+
buffer3 = buffer3 << bitsPerChar | value;
|
3322
3322
|
bits += bitsPerChar;
|
3323
3323
|
if (bits >= 8) {
|
3324
3324
|
bits -= 8;
|
3325
|
-
out[written++] = 255 &
|
3325
|
+
out[written++] = 255 & buffer3 >> bits;
|
3326
3326
|
}
|
3327
3327
|
}
|
3328
|
-
if (bits >= bitsPerChar || 255 &
|
3328
|
+
if (bits >= bitsPerChar || 255 & buffer3 << 8 - bits) {
|
3329
3329
|
throw new SyntaxError("Unexpected end of data");
|
3330
3330
|
}
|
3331
3331
|
return out;
|
@@ -3335,17 +3335,17 @@ var Fireproof = (() => {
|
|
3335
3335
|
const mask = (1 << bitsPerChar) - 1;
|
3336
3336
|
let out = "";
|
3337
3337
|
let bits = 0;
|
3338
|
-
let
|
3338
|
+
let buffer3 = 0;
|
3339
3339
|
for (let i = 0; i < data.length; ++i) {
|
3340
|
-
|
3340
|
+
buffer3 = buffer3 << 8 | data[i];
|
3341
3341
|
bits += 8;
|
3342
3342
|
while (bits > bitsPerChar) {
|
3343
3343
|
bits -= bitsPerChar;
|
3344
|
-
out += alphabet3[mask &
|
3344
|
+
out += alphabet3[mask & buffer3 >> bits];
|
3345
3345
|
}
|
3346
3346
|
}
|
3347
3347
|
if (bits) {
|
3348
|
-
out += alphabet3[mask &
|
3348
|
+
out += alphabet3[mask & buffer3 << bitsPerChar - bits];
|
3349
3349
|
}
|
3350
3350
|
if (pad) {
|
3351
3351
|
while (out.length * bitsPerChar & 7) {
|
@@ -3465,14 +3465,14 @@ var Fireproof = (() => {
|
|
3465
3465
|
var decode2 = read;
|
3466
3466
|
var MSB$1 = 128;
|
3467
3467
|
var REST$1 = 127;
|
3468
|
-
function read(
|
3469
|
-
var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l =
|
3468
|
+
function read(buf3, offset) {
|
3469
|
+
var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf3.length;
|
3470
3470
|
do {
|
3471
3471
|
if (counter >= l) {
|
3472
3472
|
read.bytes = 0;
|
3473
3473
|
throw new RangeError("Could not decode varint");
|
3474
3474
|
}
|
3475
|
-
b =
|
3475
|
+
b = buf3[counter++];
|
3476
3476
|
res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift);
|
3477
3477
|
shift += 7;
|
3478
3478
|
} while (b >= MSB$1);
|
@@ -4082,7 +4082,7 @@ var Fireproof = (() => {
|
|
4082
4082
|
};
|
4083
4083
|
var parse = (source, base4) => CID.parse(source, base4);
|
4084
4084
|
|
4085
|
-
// ../../node_modules/.pnpm/@web3-storage+pail@0.
|
4085
|
+
// ../../node_modules/.pnpm/@web3-storage+pail@0.5.0/node_modules/@web3-storage/pail/src/block.js
|
4086
4086
|
var MemoryBlockstore = class {
|
4087
4087
|
/** @type {Map<string, Uint8Array>} */
|
4088
4088
|
#blocks = /* @__PURE__ */ new Map();
|
@@ -4405,14 +4405,14 @@ var Fireproof = (() => {
|
|
4405
4405
|
typeof globalThis.Buffer.isBuffer === "function";
|
4406
4406
|
var textDecoder = new TextDecoder();
|
4407
4407
|
var textEncoder = new TextEncoder();
|
4408
|
-
function isBuffer2(
|
4409
|
-
return useBuffer && globalThis.Buffer.isBuffer(
|
4408
|
+
function isBuffer2(buf3) {
|
4409
|
+
return useBuffer && globalThis.Buffer.isBuffer(buf3);
|
4410
4410
|
}
|
4411
|
-
function asU8A(
|
4412
|
-
if (!(
|
4413
|
-
return Uint8Array.from(
|
4411
|
+
function asU8A(buf3) {
|
4412
|
+
if (!(buf3 instanceof Uint8Array)) {
|
4413
|
+
return Uint8Array.from(buf3);
|
4414
4414
|
}
|
4415
|
-
return isBuffer2(
|
4415
|
+
return isBuffer2(buf3) ? new Uint8Array(buf3.buffer, buf3.byteOffset, buf3.byteLength) : buf3;
|
4416
4416
|
}
|
4417
4417
|
var toString2 = useBuffer ? (
|
4418
4418
|
// eslint-disable-line operator-linebreak
|
@@ -4577,10 +4577,10 @@ var Fireproof = (() => {
|
|
4577
4577
|
}
|
4578
4578
|
return out;
|
4579
4579
|
}
|
4580
|
-
function utf8Slice(
|
4580
|
+
function utf8Slice(buf3, offset, end) {
|
4581
4581
|
const res = [];
|
4582
4582
|
while (offset < end) {
|
4583
|
-
const firstByte =
|
4583
|
+
const firstByte = buf3[offset];
|
4584
4584
|
let codePoint = null;
|
4585
4585
|
let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
|
4586
4586
|
if (offset + bytesPerSequence <= end) {
|
@@ -4592,7 +4592,7 @@ var Fireproof = (() => {
|
|
4592
4592
|
}
|
4593
4593
|
break;
|
4594
4594
|
case 2:
|
4595
|
-
secondByte =
|
4595
|
+
secondByte = buf3[offset + 1];
|
4596
4596
|
if ((secondByte & 192) === 128) {
|
4597
4597
|
tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
|
4598
4598
|
if (tempCodePoint > 127) {
|
@@ -4601,8 +4601,8 @@ var Fireproof = (() => {
|
|
4601
4601
|
}
|
4602
4602
|
break;
|
4603
4603
|
case 3:
|
4604
|
-
secondByte =
|
4605
|
-
thirdByte =
|
4604
|
+
secondByte = buf3[offset + 1];
|
4605
|
+
thirdByte = buf3[offset + 2];
|
4606
4606
|
if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
|
4607
4607
|
tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
|
4608
4608
|
if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {
|
@@ -4611,9 +4611,9 @@ var Fireproof = (() => {
|
|
4611
4611
|
}
|
4612
4612
|
break;
|
4613
4613
|
case 4:
|
4614
|
-
secondByte =
|
4615
|
-
thirdByte =
|
4616
|
-
fourthByte =
|
4614
|
+
secondByte = buf3[offset + 1];
|
4615
|
+
thirdByte = buf3[offset + 2];
|
4616
|
+
fourthByte = buf3[offset + 3];
|
4617
4617
|
if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
|
4618
4618
|
tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
|
4619
4619
|
if (tempCodePoint > 65535 && tempCodePoint < 1114112) {
|
@@ -4802,22 +4802,22 @@ var Fireproof = (() => {
|
|
4802
4802
|
function decodeUint64(data, pos, _minor, options) {
|
4803
4803
|
return new Token(Type.uint, readUint64(data, pos + 1, options), 9);
|
4804
4804
|
}
|
4805
|
-
function encodeUint(
|
4806
|
-
return encodeUintValue(
|
4805
|
+
function encodeUint(buf3, token) {
|
4806
|
+
return encodeUintValue(buf3, 0, token.value);
|
4807
4807
|
}
|
4808
|
-
function encodeUintValue(
|
4808
|
+
function encodeUintValue(buf3, major, uint) {
|
4809
4809
|
if (uint < uintBoundaries[0]) {
|
4810
4810
|
const nuint = Number(uint);
|
4811
|
-
|
4811
|
+
buf3.push([major | nuint]);
|
4812
4812
|
} else if (uint < uintBoundaries[1]) {
|
4813
4813
|
const nuint = Number(uint);
|
4814
|
-
|
4814
|
+
buf3.push([major | 24, nuint]);
|
4815
4815
|
} else if (uint < uintBoundaries[2]) {
|
4816
4816
|
const nuint = Number(uint);
|
4817
|
-
|
4817
|
+
buf3.push([major | 25, nuint >>> 8, nuint & 255]);
|
4818
4818
|
} else if (uint < uintBoundaries[3]) {
|
4819
4819
|
const nuint = Number(uint);
|
4820
|
-
|
4820
|
+
buf3.push([major | 26, nuint >>> 24 & 255, nuint >>> 16 & 255, nuint >>> 8 & 255, nuint & 255]);
|
4821
4821
|
} else {
|
4822
4822
|
const buint = BigInt(uint);
|
4823
4823
|
if (buint < uintBoundaries[4]) {
|
@@ -4838,7 +4838,7 @@ var Fireproof = (() => {
|
|
4838
4838
|
set3[2] = hi & 255;
|
4839
4839
|
hi = hi >> 8;
|
4840
4840
|
set3[1] = hi & 255;
|
4841
|
-
|
4841
|
+
buf3.push(set3);
|
4842
4842
|
} else {
|
4843
4843
|
throw new Error(`${decodeErrPrefix} encountered BigInt larger than allowable range`);
|
4844
4844
|
}
|
@@ -4894,10 +4894,10 @@ var Fireproof = (() => {
|
|
4894
4894
|
}
|
4895
4895
|
return new Token(Type.negint, neg1b - BigInt(int), 9);
|
4896
4896
|
}
|
4897
|
-
function encodeNegint(
|
4897
|
+
function encodeNegint(buf3, token) {
|
4898
4898
|
const negint = token.value;
|
4899
4899
|
const unsigned = typeof negint === "bigint" ? negint * neg1b - pos1b : negint * -1 - 1;
|
4900
|
-
encodeUintValue(
|
4900
|
+
encodeUintValue(buf3, token.type.majorEncoded, unsigned);
|
4901
4901
|
}
|
4902
4902
|
encodeNegint.encodedSize = function encodedSize3(token) {
|
4903
4903
|
const negint = token.value;
|
@@ -4926,8 +4926,8 @@ var Fireproof = (() => {
|
|
4926
4926
|
// ../../node_modules/.pnpm/cborg@4.0.7/node_modules/cborg/lib/2bytes.js
|
4927
4927
|
function toToken(data, pos, prefix, length5) {
|
4928
4928
|
assertEnoughData(data, pos, prefix + length5);
|
4929
|
-
const
|
4930
|
-
return new Token(Type.bytes,
|
4929
|
+
const buf3 = slice(data, pos + prefix, pos + prefix + length5);
|
4930
|
+
return new Token(Type.bytes, buf3, prefix + length5);
|
4931
4931
|
}
|
4932
4932
|
function decodeBytesCompact(data, pos, minor, _options) {
|
4933
4933
|
return toToken(data, pos, 1, minor);
|
@@ -4954,10 +4954,10 @@ var Fireproof = (() => {
|
|
4954
4954
|
}
|
4955
4955
|
return token.encodedBytes;
|
4956
4956
|
}
|
4957
|
-
function encodeBytes(
|
4957
|
+
function encodeBytes(buf3, token) {
|
4958
4958
|
const bytes = tokenBytes(token);
|
4959
|
-
encodeUintValue(
|
4960
|
-
|
4959
|
+
encodeUintValue(buf3, token.type.majorEncoded, bytes.length);
|
4960
|
+
buf3.push(bytes);
|
4961
4961
|
}
|
4962
4962
|
encodeBytes.encodedSize = function encodedSize4(token) {
|
4963
4963
|
const bytes = tokenBytes(token);
|
@@ -5030,8 +5030,8 @@ var Fireproof = (() => {
|
|
5030
5030
|
}
|
5031
5031
|
return toToken3(data, pos, 1, Infinity);
|
5032
5032
|
}
|
5033
|
-
function encodeArray(
|
5034
|
-
encodeUintValue(
|
5033
|
+
function encodeArray(buf3, token) {
|
5034
|
+
encodeUintValue(buf3, Type.array.majorEncoded, token.value);
|
5035
5035
|
}
|
5036
5036
|
encodeArray.compareTokens = encodeUint.compareTokens;
|
5037
5037
|
encodeArray.encodedSize = function encodedSize5(token) {
|
@@ -5067,8 +5067,8 @@ var Fireproof = (() => {
|
|
5067
5067
|
}
|
5068
5068
|
return toToken4(data, pos, 1, Infinity);
|
5069
5069
|
}
|
5070
|
-
function encodeMap(
|
5071
|
-
encodeUintValue(
|
5070
|
+
function encodeMap(buf3, token) {
|
5071
|
+
encodeUintValue(buf3, Type.map.majorEncoded, token.value);
|
5072
5072
|
}
|
5073
5073
|
encodeMap.compareTokens = encodeUint.compareTokens;
|
5074
5074
|
encodeMap.encodedSize = function encodedSize6(token) {
|
@@ -5091,8 +5091,8 @@ var Fireproof = (() => {
|
|
5091
5091
|
function decodeTag64(data, pos, _minor, options) {
|
5092
5092
|
return new Token(Type.tag, readUint64(data, pos + 1, options), 9);
|
5093
5093
|
}
|
5094
|
-
function encodeTag(
|
5095
|
-
encodeUintValue(
|
5094
|
+
function encodeTag(buf3, token) {
|
5095
|
+
encodeUintValue(buf3, Type.tag.majorEncoded, token.value);
|
5096
5096
|
}
|
5097
5097
|
encodeTag.compareTokens = encodeUint.compareTokens;
|
5098
5098
|
encodeTag.encodedSize = function encodedSize7(token) {
|
@@ -5138,16 +5138,16 @@ var Fireproof = (() => {
|
|
5138
5138
|
function decodeFloat64(data, pos, _minor, options) {
|
5139
5139
|
return createToken(readFloat64(data, pos + 1), 9, options);
|
5140
5140
|
}
|
5141
|
-
function encodeFloat(
|
5141
|
+
function encodeFloat(buf3, token, options) {
|
5142
5142
|
const float = token.value;
|
5143
5143
|
if (float === false) {
|
5144
|
-
|
5144
|
+
buf3.push([Type.float.majorEncoded | MINOR_FALSE]);
|
5145
5145
|
} else if (float === true) {
|
5146
|
-
|
5146
|
+
buf3.push([Type.float.majorEncoded | MINOR_TRUE]);
|
5147
5147
|
} else if (float === null) {
|
5148
|
-
|
5148
|
+
buf3.push([Type.float.majorEncoded | MINOR_NULL]);
|
5149
5149
|
} else if (float === void 0) {
|
5150
|
-
|
5150
|
+
buf3.push([Type.float.majorEncoded | MINOR_UNDEFINED]);
|
5151
5151
|
} else {
|
5152
5152
|
let decoded;
|
5153
5153
|
let success = false;
|
@@ -5156,14 +5156,14 @@ var Fireproof = (() => {
|
|
5156
5156
|
decoded = readFloat16(ui8a, 1);
|
5157
5157
|
if (float === decoded || Number.isNaN(float)) {
|
5158
5158
|
ui8a[0] = 249;
|
5159
|
-
|
5159
|
+
buf3.push(ui8a.slice(0, 3));
|
5160
5160
|
success = true;
|
5161
5161
|
} else {
|
5162
5162
|
encodeFloat32(float);
|
5163
5163
|
decoded = readFloat32(ui8a, 1);
|
5164
5164
|
if (float === decoded) {
|
5165
5165
|
ui8a[0] = 250;
|
5166
|
-
|
5166
|
+
buf3.push(ui8a.slice(0, 5));
|
5167
5167
|
success = true;
|
5168
5168
|
}
|
5169
5169
|
}
|
@@ -5172,7 +5172,7 @@ var Fireproof = (() => {
|
|
5172
5172
|
encodeFloat64(float);
|
5173
5173
|
decoded = readFloat64(ui8a, 1);
|
5174
5174
|
ui8a[0] = 251;
|
5175
|
-
|
5175
|
+
buf3.push(ui8a.slice(0, 9));
|
5176
5176
|
}
|
5177
5177
|
}
|
5178
5178
|
}
|
@@ -5227,11 +5227,11 @@ var Fireproof = (() => {
|
|
5227
5227
|
}
|
5228
5228
|
}
|
5229
5229
|
}
|
5230
|
-
function readFloat16(
|
5231
|
-
if (
|
5230
|
+
function readFloat16(ui8a3, pos) {
|
5231
|
+
if (ui8a3.length - pos < 2) {
|
5232
5232
|
throw new Error(`${decodeErrPrefix} not enough data for float16`);
|
5233
5233
|
}
|
5234
|
-
const half = (
|
5234
|
+
const half = (ui8a3[pos] << 8) + ui8a3[pos + 1];
|
5235
5235
|
if (half === 31744) {
|
5236
5236
|
return Infinity;
|
5237
5237
|
}
|
@@ -5256,22 +5256,22 @@ var Fireproof = (() => {
|
|
5256
5256
|
function encodeFloat32(inp) {
|
5257
5257
|
dataView.setFloat32(0, inp, false);
|
5258
5258
|
}
|
5259
|
-
function readFloat32(
|
5260
|
-
if (
|
5259
|
+
function readFloat32(ui8a3, pos) {
|
5260
|
+
if (ui8a3.length - pos < 4) {
|
5261
5261
|
throw new Error(`${decodeErrPrefix} not enough data for float32`);
|
5262
5262
|
}
|
5263
|
-
const offset = (
|
5264
|
-
return new DataView(
|
5263
|
+
const offset = (ui8a3.byteOffset || 0) + pos;
|
5264
|
+
return new DataView(ui8a3.buffer, offset, 4).getFloat32(0, false);
|
5265
5265
|
}
|
5266
5266
|
function encodeFloat64(inp) {
|
5267
5267
|
dataView.setFloat64(0, inp, false);
|
5268
5268
|
}
|
5269
|
-
function readFloat64(
|
5270
|
-
if (
|
5269
|
+
function readFloat64(ui8a3, pos) {
|
5270
|
+
if (ui8a3.length - pos < 8) {
|
5271
5271
|
throw new Error(`${decodeErrPrefix} not enough data for float64`);
|
5272
5272
|
}
|
5273
|
-
const offset = (
|
5274
|
-
return new DataView(
|
5273
|
+
const offset = (ui8a3.byteOffset || 0) + pos;
|
5274
|
+
return new DataView(ui8a3.buffer, offset, 8).getFloat64(0, false);
|
5275
5275
|
}
|
5276
5276
|
encodeFloat.compareTokens = encodeUint.compareTokens;
|
5277
5277
|
|
@@ -5691,13 +5691,13 @@ var Fireproof = (() => {
|
|
5691
5691
|
}
|
5692
5692
|
return tcmp;
|
5693
5693
|
}
|
5694
|
-
function tokensToEncoded(
|
5694
|
+
function tokensToEncoded(buf3, tokens, encoders, options) {
|
5695
5695
|
if (Array.isArray(tokens)) {
|
5696
5696
|
for (const token of tokens) {
|
5697
|
-
tokensToEncoded(
|
5697
|
+
tokensToEncoded(buf3, token, encoders, options);
|
5698
5698
|
}
|
5699
5699
|
} else {
|
5700
|
-
encoders[tokens.type.major](
|
5700
|
+
encoders[tokens.type.major](buf3, tokens, options);
|
5701
5701
|
}
|
5702
5702
|
}
|
5703
5703
|
function encodeCustom(data, encoders, options) {
|
@@ -5710,12 +5710,12 @@ var Fireproof = (() => {
|
|
5710
5710
|
const encoder = encoders[tokens.type.major];
|
5711
5711
|
if (encoder.encodedSize) {
|
5712
5712
|
const size = encoder.encodedSize(tokens, options);
|
5713
|
-
const
|
5714
|
-
encoder(
|
5715
|
-
if (
|
5713
|
+
const buf3 = new Bl(size);
|
5714
|
+
encoder(buf3, tokens, options);
|
5715
|
+
if (buf3.chunks.length !== 1) {
|
5716
5716
|
throw new Error(`Unexpected error: pre-calculated length for ${tokens} was wrong`);
|
5717
5717
|
}
|
5718
|
-
return asU8A(
|
5718
|
+
return asU8A(buf3.chunks[0]);
|
5719
5719
|
}
|
5720
5720
|
}
|
5721
5721
|
buf.reset();
|
@@ -5956,7 +5956,7 @@ var Fireproof = (() => {
|
|
5956
5956
|
var LEADER = ALPHABET.charAt(0);
|
5957
5957
|
var FACTOR = Math.log(BASE) / Math.log(256);
|
5958
5958
|
var iFACTOR = Math.log(256) / Math.log(BASE);
|
5959
|
-
function
|
5959
|
+
function encode20(source) {
|
5960
5960
|
if (source instanceof Uint8Array)
|
5961
5961
|
;
|
5962
5962
|
else if (ArrayBuffer.isView(source)) {
|
@@ -6054,17 +6054,17 @@ var Fireproof = (() => {
|
|
6054
6054
|
}
|
6055
6055
|
return vch;
|
6056
6056
|
}
|
6057
|
-
function
|
6058
|
-
var
|
6059
|
-
if (
|
6060
|
-
return
|
6057
|
+
function decode24(string3) {
|
6058
|
+
var buffer3 = decodeUnsafe(string3);
|
6059
|
+
if (buffer3) {
|
6060
|
+
return buffer3;
|
6061
6061
|
}
|
6062
6062
|
throw new Error(`Non-${name7} character`);
|
6063
6063
|
}
|
6064
6064
|
return {
|
6065
|
-
encode:
|
6065
|
+
encode: encode20,
|
6066
6066
|
decodeUnsafe,
|
6067
|
-
decode:
|
6067
|
+
decode: decode24
|
6068
6068
|
};
|
6069
6069
|
}
|
6070
6070
|
var src2 = base2;
|
@@ -6163,16 +6163,16 @@ var Fireproof = (() => {
|
|
6163
6163
|
return this.decoder.decode(input);
|
6164
6164
|
}
|
6165
6165
|
};
|
6166
|
-
function from2({ name: name7, prefix, encode:
|
6167
|
-
return new Codec2(name7, prefix,
|
6166
|
+
function from2({ name: name7, prefix, encode: encode20, decode: decode24 }) {
|
6167
|
+
return new Codec2(name7, prefix, encode20, decode24);
|
6168
6168
|
}
|
6169
6169
|
function baseX2({ name: name7, prefix, alphabet: alphabet3 }) {
|
6170
|
-
const { encode:
|
6170
|
+
const { encode: encode20, decode: decode24 } = base_x_default2(alphabet3, name7);
|
6171
6171
|
return from2({
|
6172
6172
|
prefix,
|
6173
6173
|
name: name7,
|
6174
|
-
encode:
|
6175
|
-
decode: (text) => coerce2(
|
6174
|
+
encode: encode20,
|
6175
|
+
decode: (text) => coerce2(decode24(text))
|
6176
6176
|
});
|
6177
6177
|
}
|
6178
6178
|
function decode6(string3, alphabet3, bitsPerChar, name7) {
|
@@ -6186,21 +6186,21 @@ var Fireproof = (() => {
|
|
6186
6186
|
}
|
6187
6187
|
const out = new Uint8Array(end * bitsPerChar / 8 | 0);
|
6188
6188
|
let bits = 0;
|
6189
|
-
let
|
6189
|
+
let buffer3 = 0;
|
6190
6190
|
let written = 0;
|
6191
6191
|
for (let i = 0; i < end; ++i) {
|
6192
6192
|
const value = codes[string3[i]];
|
6193
6193
|
if (value === void 0) {
|
6194
6194
|
throw new SyntaxError(`Non-${name7} character`);
|
6195
6195
|
}
|
6196
|
-
|
6196
|
+
buffer3 = buffer3 << bitsPerChar | value;
|
6197
6197
|
bits += bitsPerChar;
|
6198
6198
|
if (bits >= 8) {
|
6199
6199
|
bits -= 8;
|
6200
|
-
out[written++] = 255 &
|
6200
|
+
out[written++] = 255 & buffer3 >> bits;
|
6201
6201
|
}
|
6202
6202
|
}
|
6203
|
-
if (bits >= bitsPerChar || (255 &
|
6203
|
+
if (bits >= bitsPerChar || (255 & buffer3 << 8 - bits) !== 0) {
|
6204
6204
|
throw new SyntaxError("Unexpected end of data");
|
6205
6205
|
}
|
6206
6206
|
return out;
|
@@ -6210,17 +6210,17 @@ var Fireproof = (() => {
|
|
6210
6210
|
const mask = (1 << bitsPerChar) - 1;
|
6211
6211
|
let out = "";
|
6212
6212
|
let bits = 0;
|
6213
|
-
let
|
6213
|
+
let buffer3 = 0;
|
6214
6214
|
for (let i = 0; i < data.length; ++i) {
|
6215
|
-
|
6215
|
+
buffer3 = buffer3 << 8 | data[i];
|
6216
6216
|
bits += 8;
|
6217
6217
|
while (bits > bitsPerChar) {
|
6218
6218
|
bits -= bitsPerChar;
|
6219
|
-
out += alphabet3[mask &
|
6219
|
+
out += alphabet3[mask & buffer3 >> bits];
|
6220
6220
|
}
|
6221
6221
|
}
|
6222
6222
|
if (bits !== 0) {
|
6223
|
-
out += alphabet3[mask &
|
6223
|
+
out += alphabet3[mask & buffer3 << bitsPerChar - bits];
|
6224
6224
|
}
|
6225
6225
|
if (pad) {
|
6226
6226
|
while ((out.length * bitsPerChar & 7) !== 0) {
|
@@ -6340,14 +6340,14 @@ var Fireproof = (() => {
|
|
6340
6340
|
var decode7 = read2;
|
6341
6341
|
var MSB$12 = 128;
|
6342
6342
|
var REST$12 = 127;
|
6343
|
-
function read2(
|
6344
|
-
var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l =
|
6343
|
+
function read2(buf3, offset) {
|
6344
|
+
var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf3.length;
|
6345
6345
|
do {
|
6346
6346
|
if (counter >= l) {
|
6347
6347
|
read2.bytes = 0;
|
6348
6348
|
throw new RangeError("Could not decode varint");
|
6349
6349
|
}
|
6350
|
-
b =
|
6350
|
+
b = buf3[counter++];
|
6351
6351
|
res += shift < 28 ? (b & REST$12) << shift : (b & REST$12) * Math.pow(2, shift);
|
6352
6352
|
shift += 7;
|
6353
6353
|
} while (b >= MSB$12);
|
@@ -7256,14 +7256,14 @@ You can use close({ resize: true }) to resize header`);
|
|
7256
7256
|
return import_varint4.default.encodingLength(length5) + length5;
|
7257
7257
|
};
|
7258
7258
|
var headerLength = ({ roots }) => calculateHeaderLength(roots.map((cid) => cid.bytes.byteLength));
|
7259
|
-
var createWriter = (
|
7259
|
+
var createWriter = (buffer3, options = {}) => {
|
7260
7260
|
const {
|
7261
7261
|
roots = [],
|
7262
7262
|
byteOffset = 0,
|
7263
|
-
byteLength =
|
7263
|
+
byteLength = buffer3.byteLength,
|
7264
7264
|
headerSize = headerLength({ roots })
|
7265
7265
|
} = options;
|
7266
|
-
const bytes = new Uint8Array(
|
7266
|
+
const bytes = new Uint8Array(buffer3, byteOffset, byteLength);
|
7267
7267
|
const writer = new CarBufferWriter(bytes, headerSize);
|
7268
7268
|
for (const root2 of roots) {
|
7269
7269
|
writer.addRoot(root2);
|
@@ -7640,7 +7640,7 @@ You can use close({ resize: true }) to resize header`);
|
|
7640
7640
|
var import_varint5 = __toESM(require_varint(), 1);
|
7641
7641
|
|
7642
7642
|
// ../../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/src/hashes/hasher.js
|
7643
|
-
var from3 = ({ name: name7, code: code8, encode:
|
7643
|
+
var from3 = ({ name: name7, code: code8, encode: encode20 }) => new Hasher(name7, code8, encode20);
|
7644
7644
|
var Hasher = class {
|
7645
7645
|
/**
|
7646
7646
|
*
|
@@ -7648,10 +7648,10 @@ You can use close({ resize: true }) to resize header`);
|
|
7648
7648
|
* @param {Code} code
|
7649
7649
|
* @param {(input: Uint8Array) => Await<Uint8Array>} encode
|
7650
7650
|
*/
|
7651
|
-
constructor(name7, code8,
|
7651
|
+
constructor(name7, code8, encode20) {
|
7652
7652
|
this.name = name7;
|
7653
7653
|
this.code = code8;
|
7654
|
-
this.encode =
|
7654
|
+
this.encode = encode20;
|
7655
7655
|
}
|
7656
7656
|
/**
|
7657
7657
|
* @param {Uint8Array} input
|
@@ -7884,9 +7884,9 @@ You can use close({ resize: true }) to resize header`);
|
|
7884
7884
|
var decode12 = (data) => coerce(data);
|
7885
7885
|
|
7886
7886
|
// ../../node_modules/.pnpm/prolly-trees@1.0.4/node_modules/prolly-trees/esm/src/utils.js
|
7887
|
-
var readUInt32LE = (
|
7888
|
-
const offset =
|
7889
|
-
return (
|
7887
|
+
var readUInt32LE = (buffer3) => {
|
7888
|
+
const offset = buffer3.byteLength - 4;
|
7889
|
+
return (buffer3[offset] | buffer3[offset + 1] << 8 | buffer3[offset + 2] << 16) + buffer3[offset + 3] * 16777216;
|
7890
7890
|
};
|
7891
7891
|
var MAX_UINT32 = 4294967295;
|
7892
7892
|
var bf = (factor) => {
|
@@ -7978,11 +7978,11 @@ You can use close({ resize: true }) to resize header`);
|
|
7978
7978
|
this.closed = closed;
|
7979
7979
|
this.startKey = entries3[0].key;
|
7980
7980
|
}
|
7981
|
-
find(key,
|
7981
|
+
find(key, compare6) {
|
7982
7982
|
const { entries: entries3 } = this;
|
7983
7983
|
for (let i = entries3.length - 1; i > -1; i--) {
|
7984
7984
|
const entry = entries3[i];
|
7985
|
-
const comp =
|
7985
|
+
const comp = compare6(key, entry.key);
|
7986
7986
|
if (comp > -1) {
|
7987
7987
|
return [
|
7988
7988
|
i,
|
@@ -7992,11 +7992,11 @@ You can use close({ resize: true }) to resize header`);
|
|
7992
7992
|
}
|
7993
7993
|
return null;
|
7994
7994
|
}
|
7995
|
-
findMany(keys,
|
7995
|
+
findMany(keys, compare6, sorted = false, strict = false) {
|
7996
7996
|
const { entries: entries3 } = this;
|
7997
7997
|
const results = /* @__PURE__ */ new Map();
|
7998
7998
|
if (!sorted) {
|
7999
|
-
keys = keys.sort(
|
7999
|
+
keys = keys.sort(compare6);
|
8000
8000
|
} else {
|
8001
8001
|
keys = [...keys];
|
8002
8002
|
}
|
@@ -8008,7 +8008,7 @@ You can use close({ resize: true }) to resize header`);
|
|
8008
8008
|
while (keys.length) {
|
8009
8009
|
let key = keys[keys.length - 1];
|
8010
8010
|
key = key.key ? key.key : key;
|
8011
|
-
const comp =
|
8011
|
+
const comp = compare6(key, entry.key);
|
8012
8012
|
if (!strict) {
|
8013
8013
|
if (comp > -1) {
|
8014
8014
|
found.push(keys.pop());
|
@@ -8034,13 +8034,13 @@ You can use close({ resize: true }) to resize header`);
|
|
8034
8034
|
}
|
8035
8035
|
return results;
|
8036
8036
|
}
|
8037
|
-
findRange(start, end,
|
8037
|
+
findRange(start, end, compare6) {
|
8038
8038
|
const { entries: entries3 } = this;
|
8039
8039
|
let last2;
|
8040
8040
|
let first = 0;
|
8041
8041
|
for (let i = entries3.length - 1; i > -1; i--) {
|
8042
8042
|
const entry = entries3[i];
|
8043
|
-
const comp =
|
8043
|
+
const comp = compare6(end, entry.key);
|
8044
8044
|
if (comp > 0) {
|
8045
8045
|
last2 = i;
|
8046
8046
|
break;
|
@@ -8048,7 +8048,7 @@ You can use close({ resize: true }) to resize header`);
|
|
8048
8048
|
}
|
8049
8049
|
for (let i = 0; i < entries3.length; i++) {
|
8050
8050
|
const entry = entries3[i];
|
8051
|
-
const comp =
|
8051
|
+
const comp = compare6(start, entry.key);
|
8052
8052
|
if (comp === 0) {
|
8053
8053
|
first = i;
|
8054
8054
|
break;
|
@@ -8068,11 +8068,11 @@ You can use close({ resize: true }) to resize header`);
|
|
8068
8068
|
function sortBulk(bulk, opts) {
|
8069
8069
|
return bulk.sort(({ key: a }, { key: b }) => opts.compare(a, b));
|
8070
8070
|
}
|
8071
|
-
async function filterLeftmostInserts(first, bulk,
|
8071
|
+
async function filterLeftmostInserts(first, bulk, compare6) {
|
8072
8072
|
const inserts = [];
|
8073
8073
|
for (const b of bulk) {
|
8074
8074
|
const { key, del: del2 } = b;
|
8075
|
-
if (
|
8075
|
+
if (compare6(key, first) < 0) {
|
8076
8076
|
if (!del2)
|
8077
8077
|
inserts.push(b);
|
8078
8078
|
} else {
|
@@ -8081,9 +8081,9 @@ You can use close({ resize: true }) to resize header`);
|
|
8081
8081
|
}
|
8082
8082
|
return inserts;
|
8083
8083
|
}
|
8084
|
-
async function generateNewLeaves(inserts, opts, { chunker: chunker3, compare:
|
8084
|
+
async function generateNewLeaves(inserts, opts, { chunker: chunker3, compare: compare6 }) {
|
8085
8085
|
return await Node2.from({
|
8086
|
-
entries: inserts.map((insert) => new opts.LeafEntryClass(insert, opts)).sort((a, b) =>
|
8086
|
+
entries: inserts.map((insert) => new opts.LeafEntryClass(insert, opts)).sort((a, b) => compare6(a.key, b.key)),
|
8087
8087
|
chunker: chunker3,
|
8088
8088
|
NodeClass: opts.LeafClass,
|
8089
8089
|
distance: 0,
|
@@ -8168,12 +8168,12 @@ You can use close({ resize: true }) to resize header`);
|
|
8168
8168
|
}
|
8169
8169
|
}
|
8170
8170
|
var Node2 = class _Node {
|
8171
|
-
constructor({ entryList, chunker: chunker3, distance, getNode, compare:
|
8171
|
+
constructor({ entryList, chunker: chunker3, distance, getNode, compare: compare6, cache: cache4 }) {
|
8172
8172
|
this.entryList = entryList;
|
8173
8173
|
this.chunker = chunker3;
|
8174
8174
|
this.distance = distance;
|
8175
8175
|
this.getNode = getNode;
|
8176
|
-
this.compare =
|
8176
|
+
this.compare = compare6;
|
8177
8177
|
this.cache = cache4;
|
8178
8178
|
}
|
8179
8179
|
get closed() {
|
@@ -8754,9 +8754,9 @@ You can use close({ resize: true }) to resize header`);
|
|
8754
8754
|
}
|
8755
8755
|
};
|
8756
8756
|
var create5 = async function* (obj) {
|
8757
|
-
let { LeafClass: LeafClass2, LeafEntryClass, BranchClass: BranchClass2, BranchEntryClass, list, chunker: chunker3, compare:
|
8757
|
+
let { LeafClass: LeafClass2, LeafEntryClass, BranchClass: BranchClass2, BranchEntryClass, list, chunker: chunker3, compare: compare6, ...opts } = obj;
|
8758
8758
|
list = list.map((value) => new LeafEntryClass(value, opts));
|
8759
|
-
opts.compare =
|
8759
|
+
opts.compare = compare6;
|
8760
8760
|
let nodes = await Node2.from({
|
8761
8761
|
entries: list,
|
8762
8762
|
chunker: chunker3,
|
@@ -8798,8 +8798,8 @@ You can use close({ resize: true }) to resize header`);
|
|
8798
8798
|
return this.cid;
|
8799
8799
|
}
|
8800
8800
|
identity() {
|
8801
|
-
const
|
8802
|
-
return readUInt32LE(
|
8801
|
+
const buffer3 = this.cid.multihash.bytes;
|
8802
|
+
return readUInt32LE(buffer3);
|
8803
8803
|
}
|
8804
8804
|
};
|
8805
8805
|
var CIDNodeEntry = class extends Entry {
|
@@ -8894,22 +8894,22 @@ You can use close({ resize: true }) to resize header`);
|
|
8894
8894
|
/**
|
8895
8895
|
* @param {Bl} buf
|
8896
8896
|
*/
|
8897
|
-
prefix(
|
8897
|
+
prefix(buf3) {
|
8898
8898
|
const recurs = this.inRecursive[this.inRecursive.length - 1];
|
8899
8899
|
if (recurs) {
|
8900
8900
|
if (recurs.type === Type.array) {
|
8901
8901
|
recurs.elements++;
|
8902
8902
|
if (recurs.elements !== 1) {
|
8903
|
-
|
8903
|
+
buf3.push([44]);
|
8904
8904
|
}
|
8905
8905
|
}
|
8906
8906
|
if (recurs.type === Type.map) {
|
8907
8907
|
recurs.elements++;
|
8908
8908
|
if (recurs.elements !== 1) {
|
8909
8909
|
if (recurs.elements % 2 === 1) {
|
8910
|
-
|
8910
|
+
buf3.push([44]);
|
8911
8911
|
} else {
|
8912
|
-
|
8912
|
+
buf3.push([58]);
|
8913
8913
|
}
|
8914
8914
|
}
|
8915
8915
|
}
|
@@ -8919,21 +8919,21 @@ You can use close({ resize: true }) to resize header`);
|
|
8919
8919
|
* @param {Bl} buf
|
8920
8920
|
* @param {Token} token
|
8921
8921
|
*/
|
8922
|
-
[Type.uint.major](
|
8923
|
-
this.prefix(
|
8924
|
-
const
|
8922
|
+
[Type.uint.major](buf3, token) {
|
8923
|
+
this.prefix(buf3);
|
8924
|
+
const is3 = String(token.value);
|
8925
8925
|
const isa = [];
|
8926
|
-
for (let i = 0; i <
|
8927
|
-
isa[i] =
|
8926
|
+
for (let i = 0; i < is3.length; i++) {
|
8927
|
+
isa[i] = is3.charCodeAt(i);
|
8928
8928
|
}
|
8929
|
-
|
8929
|
+
buf3.push(isa);
|
8930
8930
|
}
|
8931
8931
|
/**
|
8932
8932
|
* @param {Bl} buf
|
8933
8933
|
* @param {Token} token
|
8934
8934
|
*/
|
8935
|
-
[Type.negint.major](
|
8936
|
-
this[Type.uint.major](
|
8935
|
+
[Type.negint.major](buf3, token) {
|
8936
|
+
this[Type.uint.major](buf3, token);
|
8937
8937
|
}
|
8938
8938
|
/**
|
8939
8939
|
* @param {Bl} _buf
|
@@ -8946,28 +8946,28 @@ You can use close({ resize: true }) to resize header`);
|
|
8946
8946
|
* @param {Bl} buf
|
8947
8947
|
* @param {Token} token
|
8948
8948
|
*/
|
8949
|
-
[Type.string.major](
|
8950
|
-
this.prefix(
|
8949
|
+
[Type.string.major](buf3, token) {
|
8950
|
+
this.prefix(buf3);
|
8951
8951
|
const byts = fromString2(JSON.stringify(token.value));
|
8952
|
-
|
8952
|
+
buf3.push(byts.length > 32 ? asU8A(byts) : byts);
|
8953
8953
|
}
|
8954
8954
|
/**
|
8955
8955
|
* @param {Bl} buf
|
8956
8956
|
* @param {Token} _token
|
8957
8957
|
*/
|
8958
|
-
[Type.array.major](
|
8959
|
-
this.prefix(
|
8958
|
+
[Type.array.major](buf3, _token) {
|
8959
|
+
this.prefix(buf3);
|
8960
8960
|
this.inRecursive.push({ type: Type.array, elements: 0 });
|
8961
|
-
|
8961
|
+
buf3.push([91]);
|
8962
8962
|
}
|
8963
8963
|
/**
|
8964
8964
|
* @param {Bl} buf
|
8965
8965
|
* @param {Token} _token
|
8966
8966
|
*/
|
8967
|
-
[Type.map.major](
|
8968
|
-
this.prefix(
|
8967
|
+
[Type.map.major](buf3, _token) {
|
8968
|
+
this.prefix(buf3);
|
8969
8969
|
this.inRecursive.push({ type: Type.map, elements: 0 });
|
8970
|
-
|
8970
|
+
buf3.push([123]);
|
8971
8971
|
}
|
8972
8972
|
/**
|
8973
8973
|
* @param {Bl} _buf
|
@@ -8979,14 +8979,14 @@ You can use close({ resize: true }) to resize header`);
|
|
8979
8979
|
* @param {Bl} buf
|
8980
8980
|
* @param {Token} token
|
8981
8981
|
*/
|
8982
|
-
[Type.float.major](
|
8982
|
+
[Type.float.major](buf3, token) {
|
8983
8983
|
if (token.type.name === "break") {
|
8984
8984
|
const recurs = this.inRecursive.pop();
|
8985
8985
|
if (recurs) {
|
8986
8986
|
if (recurs.type === Type.array) {
|
8987
|
-
|
8987
|
+
buf3.push([93]);
|
8988
8988
|
} else if (recurs.type === Type.map) {
|
8989
|
-
|
8989
|
+
buf3.push([125]);
|
8990
8990
|
} else {
|
8991
8991
|
throw new Error("Unexpected recursive type; this should not happen!");
|
8992
8992
|
}
|
@@ -8997,22 +8997,22 @@ You can use close({ resize: true }) to resize header`);
|
|
8997
8997
|
if (token.value === void 0) {
|
8998
8998
|
throw new Error(`${encodeErrPrefix} unsupported type: undefined`);
|
8999
8999
|
}
|
9000
|
-
this.prefix(
|
9000
|
+
this.prefix(buf3);
|
9001
9001
|
if (token.type.name === "true") {
|
9002
|
-
|
9002
|
+
buf3.push([116, 114, 117, 101]);
|
9003
9003
|
return;
|
9004
9004
|
} else if (token.type.name === "false") {
|
9005
|
-
|
9005
|
+
buf3.push([102, 97, 108, 115, 101]);
|
9006
9006
|
return;
|
9007
9007
|
} else if (token.type.name === "null") {
|
9008
|
-
|
9008
|
+
buf3.push([110, 117, 108, 108]);
|
9009
9009
|
return;
|
9010
9010
|
}
|
9011
|
-
const
|
9011
|
+
const is3 = String(token.value);
|
9012
9012
|
const isa = [];
|
9013
9013
|
let dp = false;
|
9014
|
-
for (let i = 0; i <
|
9015
|
-
isa[i] =
|
9014
|
+
for (let i = 0; i < is3.length; i++) {
|
9015
|
+
isa[i] = is3.charCodeAt(i);
|
9016
9016
|
if (!dp && (isa[i] === 46 || isa[i] === 101 || isa[i] === 69)) {
|
9017
9017
|
dp = true;
|
9018
9018
|
}
|
@@ -9021,7 +9021,7 @@ You can use close({ resize: true }) to resize header`);
|
|
9021
9021
|
isa.push(46);
|
9022
9022
|
isa.push(48);
|
9023
9023
|
}
|
9024
|
-
|
9024
|
+
buf3.push(isa);
|
9025
9025
|
}
|
9026
9026
|
};
|
9027
9027
|
function mapSorter2(e1, e2) {
|
@@ -9431,17 +9431,17 @@ You can use close({ resize: true }) to resize header`);
|
|
9431
9431
|
}
|
9432
9432
|
|
9433
9433
|
// ../../node_modules/.pnpm/multiformats@13.0.1/node_modules/multiformats/dist/src/hashes/hasher.js
|
9434
|
-
function from4({ name: name7, code: code8, encode:
|
9435
|
-
return new Hasher2(name7, code8,
|
9434
|
+
function from4({ name: name7, code: code8, encode: encode20 }) {
|
9435
|
+
return new Hasher2(name7, code8, encode20);
|
9436
9436
|
}
|
9437
9437
|
var Hasher2 = class {
|
9438
9438
|
name;
|
9439
9439
|
code;
|
9440
9440
|
encode;
|
9441
|
-
constructor(name7, code8,
|
9441
|
+
constructor(name7, code8, encode20) {
|
9442
9442
|
this.name = name7;
|
9443
9443
|
this.code = code8;
|
9444
|
-
this.encode =
|
9444
|
+
this.encode = encode20;
|
9445
9445
|
}
|
9446
9446
|
digest(input) {
|
9447
9447
|
if (input instanceof Uint8Array) {
|
@@ -9661,8 +9661,8 @@ You can use close({ resize: true }) to resize header`);
|
|
9661
9661
|
for (const { cid, bytes } of t.entries()) {
|
9662
9662
|
size += blockLength({ cid, bytes });
|
9663
9663
|
}
|
9664
|
-
const
|
9665
|
-
const writer = createWriter(
|
9664
|
+
const buffer3 = new Uint8Array(size);
|
9665
|
+
const writer = createWriter(buffer3, { headerSize });
|
9666
9666
|
for (const r of roots) {
|
9667
9667
|
writer.addRoot(r);
|
9668
9668
|
}
|
@@ -9700,11 +9700,11 @@ You can use close({ resize: true }) to resize header`);
|
|
9700
9700
|
buff[0] = value & 255;
|
9701
9701
|
return buff;
|
9702
9702
|
};
|
9703
|
-
const readUInt32LE2 = (
|
9704
|
-
const offset =
|
9705
|
-
return (
|
9703
|
+
const readUInt32LE2 = (buffer3) => {
|
9704
|
+
const offset = buffer3.byteLength - 4;
|
9705
|
+
return (buffer3[offset] | buffer3[offset + 1] << 8 | buffer3[offset + 2] << 16) + buffer3[offset + 3] * 16777216;
|
9706
9706
|
};
|
9707
|
-
const
|
9707
|
+
const concat4 = (buffers) => {
|
9708
9708
|
const uint8Arrays = buffers.map((b) => b instanceof ArrayBuffer ? new Uint8Array(b) : b);
|
9709
9709
|
const totalLength = uint8Arrays.reduce((sum, arr) => sum + arr.length, 0);
|
9710
9710
|
const result = new Uint8Array(totalLength);
|
@@ -9715,7 +9715,7 @@ You can use close({ resize: true }) to resize header`);
|
|
9715
9715
|
}
|
9716
9716
|
return result;
|
9717
9717
|
};
|
9718
|
-
const encode32 = ({ iv, bytes }) =>
|
9718
|
+
const encode32 = ({ iv, bytes }) => concat4([iv, bytes]);
|
9719
9719
|
const decode32 = (bytes) => {
|
9720
9720
|
const iv = bytes.subarray(0, 12);
|
9721
9721
|
bytes = bytes.slice(12);
|
@@ -9762,7 +9762,7 @@ You can use close({ resize: true }) to resize header`);
|
|
9762
9762
|
}) => {
|
9763
9763
|
const len = enc32(cid.bytes.byteLength);
|
9764
9764
|
const iv = randomBytes22(12);
|
9765
|
-
const msg =
|
9765
|
+
const msg = concat4([len, cid.bytes, bytes]);
|
9766
9766
|
try {
|
9767
9767
|
const cryKey = await subtleKey(key);
|
9768
9768
|
const deBytes = await crypto2.subtle.encrypt(
|
@@ -9968,7 +9968,7 @@ You can use close({ resize: true }) to resize header`);
|
|
9968
9968
|
}
|
9969
9969
|
return bytes;
|
9970
9970
|
}
|
9971
|
-
var PACKAGE_VERSION = "0.17.
|
9971
|
+
var PACKAGE_VERSION = "0.17.7";
|
9972
9972
|
var match = PACKAGE_VERSION.match(/^([^.]*\.[^.]*)/);
|
9973
9973
|
if (!match)
|
9974
9974
|
throw new Error("invalid version: " + PACKAGE_VERSION);
|
@@ -10771,7 +10771,7 @@ You can use close({ resize: true }) to resize header`);
|
|
10771
10771
|
}));
|
10772
10772
|
|
10773
10773
|
// ../encrypted-blockstore/dist/lib/store-web.js
|
10774
|
-
var PACKAGE_VERSION2 = "0.17.
|
10774
|
+
var PACKAGE_VERSION2 = "0.17.7";
|
10775
10775
|
var match2 = PACKAGE_VERSION2.match(/^([^.]*\.[^.]*)/);
|
10776
10776
|
if (!match2)
|
10777
10777
|
throw new Error("invalid version: " + PACKAGE_VERSION2);
|
@@ -11069,7 +11069,7 @@ You can use close({ resize: true }) to resize header`);
|
|
11069
11069
|
makeRemoteWAL
|
11070
11070
|
};
|
11071
11071
|
|
11072
|
-
// ../../node_modules/.pnpm/@web3-storage+pail@0.
|
11072
|
+
// ../../node_modules/.pnpm/@web3-storage+pail@0.5.0/node_modules/@web3-storage/pail/src/clock/index.js
|
11073
11073
|
var advance = async (blocks, head, event) => {
|
11074
11074
|
const events = new EventFetcher(blocks);
|
11075
11075
|
const headmap = new Map(head.map((cid) => [cid.toString(), cid]));
|
@@ -11195,10 +11195,1452 @@ You can use close({ resize: true }) to resize header`);
|
|
11195
11195
|
};
|
11196
11196
|
var shortLink = (l) => `${String(l).slice(0, 4)}..${String(l).slice(-4)}`;
|
11197
11197
|
|
11198
|
-
// ../../node_modules/.pnpm
|
11198
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/is.js
|
11199
|
+
var typeofs2 = [
|
11200
|
+
"string",
|
11201
|
+
"number",
|
11202
|
+
"bigint",
|
11203
|
+
"symbol"
|
11204
|
+
];
|
11205
|
+
var objectTypeNames2 = [
|
11206
|
+
"Function",
|
11207
|
+
"Generator",
|
11208
|
+
"AsyncGenerator",
|
11209
|
+
"GeneratorFunction",
|
11210
|
+
"AsyncGeneratorFunction",
|
11211
|
+
"AsyncFunction",
|
11212
|
+
"Observable",
|
11213
|
+
"Array",
|
11214
|
+
"Buffer",
|
11215
|
+
"Object",
|
11216
|
+
"RegExp",
|
11217
|
+
"Date",
|
11218
|
+
"Error",
|
11219
|
+
"Map",
|
11220
|
+
"Set",
|
11221
|
+
"WeakMap",
|
11222
|
+
"WeakSet",
|
11223
|
+
"ArrayBuffer",
|
11224
|
+
"SharedArrayBuffer",
|
11225
|
+
"DataView",
|
11226
|
+
"Promise",
|
11227
|
+
"URL",
|
11228
|
+
"HTMLElement",
|
11229
|
+
"Int8Array",
|
11230
|
+
"Uint8Array",
|
11231
|
+
"Uint8ClampedArray",
|
11232
|
+
"Int16Array",
|
11233
|
+
"Uint16Array",
|
11234
|
+
"Int32Array",
|
11235
|
+
"Uint32Array",
|
11236
|
+
"Float32Array",
|
11237
|
+
"Float64Array",
|
11238
|
+
"BigInt64Array",
|
11239
|
+
"BigUint64Array"
|
11240
|
+
];
|
11241
|
+
function is2(value) {
|
11242
|
+
if (value === null) {
|
11243
|
+
return "null";
|
11244
|
+
}
|
11245
|
+
if (value === void 0) {
|
11246
|
+
return "undefined";
|
11247
|
+
}
|
11248
|
+
if (value === true || value === false) {
|
11249
|
+
return "boolean";
|
11250
|
+
}
|
11251
|
+
const typeOf = typeof value;
|
11252
|
+
if (typeofs2.includes(typeOf)) {
|
11253
|
+
return typeOf;
|
11254
|
+
}
|
11255
|
+
if (typeOf === "function") {
|
11256
|
+
return "Function";
|
11257
|
+
}
|
11258
|
+
if (Array.isArray(value)) {
|
11259
|
+
return "Array";
|
11260
|
+
}
|
11261
|
+
if (isBuffer3(value)) {
|
11262
|
+
return "Buffer";
|
11263
|
+
}
|
11264
|
+
const objectType = getObjectType2(value);
|
11265
|
+
if (objectType) {
|
11266
|
+
return objectType;
|
11267
|
+
}
|
11268
|
+
return "Object";
|
11269
|
+
}
|
11270
|
+
function isBuffer3(value) {
|
11271
|
+
return value && value.constructor && value.constructor.isBuffer && value.constructor.isBuffer.call(null, value);
|
11272
|
+
}
|
11273
|
+
function getObjectType2(value) {
|
11274
|
+
const objectTypeName = Object.prototype.toString.call(value).slice(8, -1);
|
11275
|
+
if (objectTypeNames2.includes(objectTypeName)) {
|
11276
|
+
return objectTypeName;
|
11277
|
+
}
|
11278
|
+
return void 0;
|
11279
|
+
}
|
11280
|
+
|
11281
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/token.js
|
11282
|
+
var Type2 = class {
|
11283
|
+
/**
|
11284
|
+
* @param {number} major
|
11285
|
+
* @param {string} name
|
11286
|
+
* @param {boolean} terminal
|
11287
|
+
*/
|
11288
|
+
constructor(major, name7, terminal) {
|
11289
|
+
this.major = major;
|
11290
|
+
this.majorEncoded = major << 5;
|
11291
|
+
this.name = name7;
|
11292
|
+
this.terminal = terminal;
|
11293
|
+
}
|
11294
|
+
/* c8 ignore next 3 */
|
11295
|
+
toString() {
|
11296
|
+
return `Type[${this.major}].${this.name}`;
|
11297
|
+
}
|
11298
|
+
/**
|
11299
|
+
* @param {Type} typ
|
11300
|
+
* @returns {number}
|
11301
|
+
*/
|
11302
|
+
compare(typ) {
|
11303
|
+
return this.major < typ.major ? -1 : this.major > typ.major ? 1 : 0;
|
11304
|
+
}
|
11305
|
+
};
|
11306
|
+
Type2.uint = new Type2(0, "uint", true);
|
11307
|
+
Type2.negint = new Type2(1, "negint", true);
|
11308
|
+
Type2.bytes = new Type2(2, "bytes", true);
|
11309
|
+
Type2.string = new Type2(3, "string", true);
|
11310
|
+
Type2.array = new Type2(4, "array", false);
|
11311
|
+
Type2.map = new Type2(5, "map", false);
|
11312
|
+
Type2.tag = new Type2(6, "tag", false);
|
11313
|
+
Type2.float = new Type2(7, "float", true);
|
11314
|
+
Type2.false = new Type2(7, "false", true);
|
11315
|
+
Type2.true = new Type2(7, "true", true);
|
11316
|
+
Type2.null = new Type2(7, "null", true);
|
11317
|
+
Type2.undefined = new Type2(7, "undefined", true);
|
11318
|
+
Type2.break = new Type2(7, "break", true);
|
11319
|
+
var Token2 = class {
|
11320
|
+
/**
|
11321
|
+
* @param {Type} type
|
11322
|
+
* @param {any} [value]
|
11323
|
+
* @param {number} [encodedLength]
|
11324
|
+
*/
|
11325
|
+
constructor(type2, value, encodedLength2) {
|
11326
|
+
this.type = type2;
|
11327
|
+
this.value = value;
|
11328
|
+
this.encodedLength = encodedLength2;
|
11329
|
+
this.encodedBytes = void 0;
|
11330
|
+
this.byteValue = void 0;
|
11331
|
+
}
|
11332
|
+
/* c8 ignore next 3 */
|
11333
|
+
toString() {
|
11334
|
+
return `Token[${this.type}].${this.value}`;
|
11335
|
+
}
|
11336
|
+
};
|
11337
|
+
|
11338
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/byte-utils.js
|
11339
|
+
var useBuffer2 = globalThis.process && // @ts-ignore
|
11340
|
+
!globalThis.process.browser && // @ts-ignore
|
11341
|
+
globalThis.Buffer && // @ts-ignore
|
11342
|
+
typeof globalThis.Buffer.isBuffer === "function";
|
11343
|
+
var textDecoder2 = new TextDecoder();
|
11344
|
+
var textEncoder2 = new TextEncoder();
|
11345
|
+
function isBuffer4(buf3) {
|
11346
|
+
return useBuffer2 && globalThis.Buffer.isBuffer(buf3);
|
11347
|
+
}
|
11348
|
+
function asU8A2(buf3) {
|
11349
|
+
if (!(buf3 instanceof Uint8Array)) {
|
11350
|
+
return Uint8Array.from(buf3);
|
11351
|
+
}
|
11352
|
+
return isBuffer4(buf3) ? new Uint8Array(buf3.buffer, buf3.byteOffset, buf3.byteLength) : buf3;
|
11353
|
+
}
|
11354
|
+
var toString4 = useBuffer2 ? (
|
11355
|
+
// eslint-disable-line operator-linebreak
|
11356
|
+
/**
|
11357
|
+
* @param {Uint8Array} bytes
|
11358
|
+
* @param {number} start
|
11359
|
+
* @param {number} end
|
11360
|
+
*/
|
11361
|
+
(bytes, start, end) => {
|
11362
|
+
return end - start > 64 ? (
|
11363
|
+
// eslint-disable-line operator-linebreak
|
11364
|
+
// @ts-ignore
|
11365
|
+
globalThis.Buffer.from(bytes.subarray(start, end)).toString("utf8")
|
11366
|
+
) : utf8Slice2(bytes, start, end);
|
11367
|
+
}
|
11368
|
+
) : (
|
11369
|
+
// eslint-disable-line operator-linebreak
|
11370
|
+
/**
|
11371
|
+
* @param {Uint8Array} bytes
|
11372
|
+
* @param {number} start
|
11373
|
+
* @param {number} end
|
11374
|
+
*/
|
11375
|
+
(bytes, start, end) => {
|
11376
|
+
return end - start > 64 ? textDecoder2.decode(bytes.subarray(start, end)) : utf8Slice2(bytes, start, end);
|
11377
|
+
}
|
11378
|
+
);
|
11379
|
+
var fromString4 = useBuffer2 ? (
|
11380
|
+
// eslint-disable-line operator-linebreak
|
11381
|
+
/**
|
11382
|
+
* @param {string} string
|
11383
|
+
*/
|
11384
|
+
(string3) => {
|
11385
|
+
return string3.length > 64 ? (
|
11386
|
+
// eslint-disable-line operator-linebreak
|
11387
|
+
// @ts-ignore
|
11388
|
+
globalThis.Buffer.from(string3)
|
11389
|
+
) : utf8ToBytes2(string3);
|
11390
|
+
}
|
11391
|
+
) : (
|
11392
|
+
// eslint-disable-line operator-linebreak
|
11393
|
+
/**
|
11394
|
+
* @param {string} string
|
11395
|
+
*/
|
11396
|
+
(string3) => {
|
11397
|
+
return string3.length > 64 ? textEncoder2.encode(string3) : utf8ToBytes2(string3);
|
11398
|
+
}
|
11399
|
+
);
|
11400
|
+
var fromArray2 = (arr) => {
|
11401
|
+
return Uint8Array.from(arr);
|
11402
|
+
};
|
11403
|
+
var slice2 = useBuffer2 ? (
|
11404
|
+
// eslint-disable-line operator-linebreak
|
11405
|
+
/**
|
11406
|
+
* @param {Uint8Array} bytes
|
11407
|
+
* @param {number} start
|
11408
|
+
* @param {number} end
|
11409
|
+
*/
|
11410
|
+
(bytes, start, end) => {
|
11411
|
+
if (isBuffer4(bytes)) {
|
11412
|
+
return new Uint8Array(bytes.subarray(start, end));
|
11413
|
+
}
|
11414
|
+
return bytes.slice(start, end);
|
11415
|
+
}
|
11416
|
+
) : (
|
11417
|
+
// eslint-disable-line operator-linebreak
|
11418
|
+
/**
|
11419
|
+
* @param {Uint8Array} bytes
|
11420
|
+
* @param {number} start
|
11421
|
+
* @param {number} end
|
11422
|
+
*/
|
11423
|
+
(bytes, start, end) => {
|
11424
|
+
return bytes.slice(start, end);
|
11425
|
+
}
|
11426
|
+
);
|
11427
|
+
var concat2 = useBuffer2 ? (
|
11428
|
+
// eslint-disable-line operator-linebreak
|
11429
|
+
/**
|
11430
|
+
* @param {Uint8Array[]} chunks
|
11431
|
+
* @param {number} length
|
11432
|
+
* @returns {Uint8Array}
|
11433
|
+
*/
|
11434
|
+
(chunks, length5) => {
|
11435
|
+
chunks = chunks.map((c) => c instanceof Uint8Array ? c : (
|
11436
|
+
// eslint-disable-line operator-linebreak
|
11437
|
+
// @ts-ignore
|
11438
|
+
globalThis.Buffer.from(c)
|
11439
|
+
));
|
11440
|
+
return asU8A2(globalThis.Buffer.concat(chunks, length5));
|
11441
|
+
}
|
11442
|
+
) : (
|
11443
|
+
// eslint-disable-line operator-linebreak
|
11444
|
+
/**
|
11445
|
+
* @param {Uint8Array[]} chunks
|
11446
|
+
* @param {number} length
|
11447
|
+
* @returns {Uint8Array}
|
11448
|
+
*/
|
11449
|
+
(chunks, length5) => {
|
11450
|
+
const out = new Uint8Array(length5);
|
11451
|
+
let off = 0;
|
11452
|
+
for (let b of chunks) {
|
11453
|
+
if (off + b.length > out.length) {
|
11454
|
+
b = b.subarray(0, out.length - off);
|
11455
|
+
}
|
11456
|
+
out.set(b, off);
|
11457
|
+
off += b.length;
|
11458
|
+
}
|
11459
|
+
return out;
|
11460
|
+
}
|
11461
|
+
);
|
11462
|
+
var alloc2 = useBuffer2 ? (
|
11463
|
+
// eslint-disable-line operator-linebreak
|
11464
|
+
/**
|
11465
|
+
* @param {number} size
|
11466
|
+
* @returns {Uint8Array}
|
11467
|
+
*/
|
11468
|
+
(size) => {
|
11469
|
+
return globalThis.Buffer.allocUnsafe(size);
|
11470
|
+
}
|
11471
|
+
) : (
|
11472
|
+
// eslint-disable-line operator-linebreak
|
11473
|
+
/**
|
11474
|
+
* @param {number} size
|
11475
|
+
* @returns {Uint8Array}
|
11476
|
+
*/
|
11477
|
+
(size) => {
|
11478
|
+
return new Uint8Array(size);
|
11479
|
+
}
|
11480
|
+
);
|
11481
|
+
function compare3(b1, b2) {
|
11482
|
+
if (isBuffer4(b1) && isBuffer4(b2)) {
|
11483
|
+
return b1.compare(b2);
|
11484
|
+
}
|
11485
|
+
for (let i = 0; i < b1.length; i++) {
|
11486
|
+
if (b1[i] === b2[i]) {
|
11487
|
+
continue;
|
11488
|
+
}
|
11489
|
+
return b1[i] < b2[i] ? -1 : 1;
|
11490
|
+
}
|
11491
|
+
return 0;
|
11492
|
+
}
|
11493
|
+
function utf8ToBytes2(str) {
|
11494
|
+
const out = [];
|
11495
|
+
let p = 0;
|
11496
|
+
for (let i = 0; i < str.length; i++) {
|
11497
|
+
let c = str.charCodeAt(i);
|
11498
|
+
if (c < 128) {
|
11499
|
+
out[p++] = c;
|
11500
|
+
} else if (c < 2048) {
|
11501
|
+
out[p++] = c >> 6 | 192;
|
11502
|
+
out[p++] = c & 63 | 128;
|
11503
|
+
} else if ((c & 64512) === 55296 && i + 1 < str.length && (str.charCodeAt(i + 1) & 64512) === 56320) {
|
11504
|
+
c = 65536 + ((c & 1023) << 10) + (str.charCodeAt(++i) & 1023);
|
11505
|
+
out[p++] = c >> 18 | 240;
|
11506
|
+
out[p++] = c >> 12 & 63 | 128;
|
11507
|
+
out[p++] = c >> 6 & 63 | 128;
|
11508
|
+
out[p++] = c & 63 | 128;
|
11509
|
+
} else {
|
11510
|
+
out[p++] = c >> 12 | 224;
|
11511
|
+
out[p++] = c >> 6 & 63 | 128;
|
11512
|
+
out[p++] = c & 63 | 128;
|
11513
|
+
}
|
11514
|
+
}
|
11515
|
+
return out;
|
11516
|
+
}
|
11517
|
+
function utf8Slice2(buf3, offset, end) {
|
11518
|
+
const res = [];
|
11519
|
+
while (offset < end) {
|
11520
|
+
const firstByte = buf3[offset];
|
11521
|
+
let codePoint = null;
|
11522
|
+
let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
|
11523
|
+
if (offset + bytesPerSequence <= end) {
|
11524
|
+
let secondByte, thirdByte, fourthByte, tempCodePoint;
|
11525
|
+
switch (bytesPerSequence) {
|
11526
|
+
case 1:
|
11527
|
+
if (firstByte < 128) {
|
11528
|
+
codePoint = firstByte;
|
11529
|
+
}
|
11530
|
+
break;
|
11531
|
+
case 2:
|
11532
|
+
secondByte = buf3[offset + 1];
|
11533
|
+
if ((secondByte & 192) === 128) {
|
11534
|
+
tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
|
11535
|
+
if (tempCodePoint > 127) {
|
11536
|
+
codePoint = tempCodePoint;
|
11537
|
+
}
|
11538
|
+
}
|
11539
|
+
break;
|
11540
|
+
case 3:
|
11541
|
+
secondByte = buf3[offset + 1];
|
11542
|
+
thirdByte = buf3[offset + 2];
|
11543
|
+
if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
|
11544
|
+
tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
|
11545
|
+
if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {
|
11546
|
+
codePoint = tempCodePoint;
|
11547
|
+
}
|
11548
|
+
}
|
11549
|
+
break;
|
11550
|
+
case 4:
|
11551
|
+
secondByte = buf3[offset + 1];
|
11552
|
+
thirdByte = buf3[offset + 2];
|
11553
|
+
fourthByte = buf3[offset + 3];
|
11554
|
+
if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
|
11555
|
+
tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
|
11556
|
+
if (tempCodePoint > 65535 && tempCodePoint < 1114112) {
|
11557
|
+
codePoint = tempCodePoint;
|
11558
|
+
}
|
11559
|
+
}
|
11560
|
+
}
|
11561
|
+
}
|
11562
|
+
if (codePoint === null) {
|
11563
|
+
codePoint = 65533;
|
11564
|
+
bytesPerSequence = 1;
|
11565
|
+
} else if (codePoint > 65535) {
|
11566
|
+
codePoint -= 65536;
|
11567
|
+
res.push(codePoint >>> 10 & 1023 | 55296);
|
11568
|
+
codePoint = 56320 | codePoint & 1023;
|
11569
|
+
}
|
11570
|
+
res.push(codePoint);
|
11571
|
+
offset += bytesPerSequence;
|
11572
|
+
}
|
11573
|
+
return decodeCodePointsArray2(res);
|
11574
|
+
}
|
11575
|
+
var MAX_ARGUMENTS_LENGTH2 = 4096;
|
11576
|
+
function decodeCodePointsArray2(codePoints) {
|
11577
|
+
const len = codePoints.length;
|
11578
|
+
if (len <= MAX_ARGUMENTS_LENGTH2) {
|
11579
|
+
return String.fromCharCode.apply(String, codePoints);
|
11580
|
+
}
|
11581
|
+
let res = "";
|
11582
|
+
let i = 0;
|
11583
|
+
while (i < len) {
|
11584
|
+
res += String.fromCharCode.apply(
|
11585
|
+
String,
|
11586
|
+
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH2)
|
11587
|
+
);
|
11588
|
+
}
|
11589
|
+
return res;
|
11590
|
+
}
|
11591
|
+
|
11592
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/bl.js
|
11593
|
+
var defaultChunkSize2 = 256;
|
11594
|
+
var Bl2 = class {
|
11595
|
+
/**
|
11596
|
+
* @param {number} [chunkSize]
|
11597
|
+
*/
|
11598
|
+
constructor(chunkSize = defaultChunkSize2) {
|
11599
|
+
this.chunkSize = chunkSize;
|
11600
|
+
this.cursor = 0;
|
11601
|
+
this.maxCursor = -1;
|
11602
|
+
this.chunks = [];
|
11603
|
+
this._initReuseChunk = null;
|
11604
|
+
}
|
11605
|
+
reset() {
|
11606
|
+
this.cursor = 0;
|
11607
|
+
this.maxCursor = -1;
|
11608
|
+
if (this.chunks.length) {
|
11609
|
+
this.chunks = [];
|
11610
|
+
}
|
11611
|
+
if (this._initReuseChunk !== null) {
|
11612
|
+
this.chunks.push(this._initReuseChunk);
|
11613
|
+
this.maxCursor = this._initReuseChunk.length - 1;
|
11614
|
+
}
|
11615
|
+
}
|
11616
|
+
/**
|
11617
|
+
* @param {Uint8Array|number[]} bytes
|
11618
|
+
*/
|
11619
|
+
push(bytes) {
|
11620
|
+
let topChunk = this.chunks[this.chunks.length - 1];
|
11621
|
+
const newMax = this.cursor + bytes.length;
|
11622
|
+
if (newMax <= this.maxCursor + 1) {
|
11623
|
+
const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1;
|
11624
|
+
topChunk.set(bytes, chunkPos);
|
11625
|
+
} else {
|
11626
|
+
if (topChunk) {
|
11627
|
+
const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1;
|
11628
|
+
if (chunkPos < topChunk.length) {
|
11629
|
+
this.chunks[this.chunks.length - 1] = topChunk.subarray(0, chunkPos);
|
11630
|
+
this.maxCursor = this.cursor - 1;
|
11631
|
+
}
|
11632
|
+
}
|
11633
|
+
if (bytes.length < 64 && bytes.length < this.chunkSize) {
|
11634
|
+
topChunk = alloc2(this.chunkSize);
|
11635
|
+
this.chunks.push(topChunk);
|
11636
|
+
this.maxCursor += topChunk.length;
|
11637
|
+
if (this._initReuseChunk === null) {
|
11638
|
+
this._initReuseChunk = topChunk;
|
11639
|
+
}
|
11640
|
+
topChunk.set(bytes, 0);
|
11641
|
+
} else {
|
11642
|
+
this.chunks.push(bytes);
|
11643
|
+
this.maxCursor += bytes.length;
|
11644
|
+
}
|
11645
|
+
}
|
11646
|
+
this.cursor += bytes.length;
|
11647
|
+
}
|
11648
|
+
/**
|
11649
|
+
* @param {boolean} [reset]
|
11650
|
+
* @returns {Uint8Array}
|
11651
|
+
*/
|
11652
|
+
toBytes(reset = false) {
|
11653
|
+
let byts;
|
11654
|
+
if (this.chunks.length === 1) {
|
11655
|
+
const chunk = this.chunks[0];
|
11656
|
+
if (reset && this.cursor > chunk.length / 2) {
|
11657
|
+
byts = this.cursor === chunk.length ? chunk : chunk.subarray(0, this.cursor);
|
11658
|
+
this._initReuseChunk = null;
|
11659
|
+
this.chunks = [];
|
11660
|
+
} else {
|
11661
|
+
byts = slice2(chunk, 0, this.cursor);
|
11662
|
+
}
|
11663
|
+
} else {
|
11664
|
+
byts = concat2(this.chunks, this.cursor);
|
11665
|
+
}
|
11666
|
+
if (reset) {
|
11667
|
+
this.reset();
|
11668
|
+
}
|
11669
|
+
return byts;
|
11670
|
+
}
|
11671
|
+
};
|
11672
|
+
|
11673
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/common.js
|
11674
|
+
var decodeErrPrefix2 = "CBOR decode error:";
|
11675
|
+
var encodeErrPrefix2 = "CBOR encode error:";
|
11676
|
+
var uintMinorPrefixBytes2 = [];
|
11677
|
+
uintMinorPrefixBytes2[23] = 1;
|
11678
|
+
uintMinorPrefixBytes2[24] = 2;
|
11679
|
+
uintMinorPrefixBytes2[25] = 3;
|
11680
|
+
uintMinorPrefixBytes2[26] = 5;
|
11681
|
+
uintMinorPrefixBytes2[27] = 9;
|
11682
|
+
function assertEnoughData2(data, pos, need) {
|
11683
|
+
if (data.length - pos < need) {
|
11684
|
+
throw new Error(`${decodeErrPrefix2} not enough data for type`);
|
11685
|
+
}
|
11686
|
+
}
|
11687
|
+
|
11688
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/0uint.js
|
11689
|
+
var uintBoundaries2 = [24, 256, 65536, 4294967296, BigInt("18446744073709551616")];
|
11690
|
+
function readUint82(data, offset, options) {
|
11691
|
+
assertEnoughData2(data, offset, 1);
|
11692
|
+
const value = data[offset];
|
11693
|
+
if (options.strict === true && value < uintBoundaries2[0]) {
|
11694
|
+
throw new Error(`${decodeErrPrefix2} integer encoded in more bytes than necessary (strict decode)`);
|
11695
|
+
}
|
11696
|
+
return value;
|
11697
|
+
}
|
11698
|
+
function readUint162(data, offset, options) {
|
11699
|
+
assertEnoughData2(data, offset, 2);
|
11700
|
+
const value = data[offset] << 8 | data[offset + 1];
|
11701
|
+
if (options.strict === true && value < uintBoundaries2[1]) {
|
11702
|
+
throw new Error(`${decodeErrPrefix2} integer encoded in more bytes than necessary (strict decode)`);
|
11703
|
+
}
|
11704
|
+
return value;
|
11705
|
+
}
|
11706
|
+
function readUint322(data, offset, options) {
|
11707
|
+
assertEnoughData2(data, offset, 4);
|
11708
|
+
const value = data[offset] * 16777216 + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3];
|
11709
|
+
if (options.strict === true && value < uintBoundaries2[2]) {
|
11710
|
+
throw new Error(`${decodeErrPrefix2} integer encoded in more bytes than necessary (strict decode)`);
|
11711
|
+
}
|
11712
|
+
return value;
|
11713
|
+
}
|
11714
|
+
function readUint642(data, offset, options) {
|
11715
|
+
assertEnoughData2(data, offset, 8);
|
11716
|
+
const hi = data[offset] * 16777216 + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3];
|
11717
|
+
const lo = data[offset + 4] * 16777216 + (data[offset + 5] << 16) + (data[offset + 6] << 8) + data[offset + 7];
|
11718
|
+
const value = (BigInt(hi) << BigInt(32)) + BigInt(lo);
|
11719
|
+
if (options.strict === true && value < uintBoundaries2[3]) {
|
11720
|
+
throw new Error(`${decodeErrPrefix2} integer encoded in more bytes than necessary (strict decode)`);
|
11721
|
+
}
|
11722
|
+
if (value <= Number.MAX_SAFE_INTEGER) {
|
11723
|
+
return Number(value);
|
11724
|
+
}
|
11725
|
+
if (options.allowBigInt === true) {
|
11726
|
+
return value;
|
11727
|
+
}
|
11728
|
+
throw new Error(`${decodeErrPrefix2} integers outside of the safe integer range are not supported`);
|
11729
|
+
}
|
11730
|
+
function decodeUint82(data, pos, _minor, options) {
|
11731
|
+
return new Token2(Type2.uint, readUint82(data, pos + 1, options), 2);
|
11732
|
+
}
|
11733
|
+
function decodeUint162(data, pos, _minor, options) {
|
11734
|
+
return new Token2(Type2.uint, readUint162(data, pos + 1, options), 3);
|
11735
|
+
}
|
11736
|
+
function decodeUint322(data, pos, _minor, options) {
|
11737
|
+
return new Token2(Type2.uint, readUint322(data, pos + 1, options), 5);
|
11738
|
+
}
|
11739
|
+
function decodeUint642(data, pos, _minor, options) {
|
11740
|
+
return new Token2(Type2.uint, readUint642(data, pos + 1, options), 9);
|
11741
|
+
}
|
11742
|
+
function encodeUint2(buf3, token) {
|
11743
|
+
return encodeUintValue2(buf3, 0, token.value);
|
11744
|
+
}
|
11745
|
+
function encodeUintValue2(buf3, major, uint) {
|
11746
|
+
if (uint < uintBoundaries2[0]) {
|
11747
|
+
const nuint = Number(uint);
|
11748
|
+
buf3.push([major | nuint]);
|
11749
|
+
} else if (uint < uintBoundaries2[1]) {
|
11750
|
+
const nuint = Number(uint);
|
11751
|
+
buf3.push([major | 24, nuint]);
|
11752
|
+
} else if (uint < uintBoundaries2[2]) {
|
11753
|
+
const nuint = Number(uint);
|
11754
|
+
buf3.push([major | 25, nuint >>> 8, nuint & 255]);
|
11755
|
+
} else if (uint < uintBoundaries2[3]) {
|
11756
|
+
const nuint = Number(uint);
|
11757
|
+
buf3.push([major | 26, nuint >>> 24 & 255, nuint >>> 16 & 255, nuint >>> 8 & 255, nuint & 255]);
|
11758
|
+
} else {
|
11759
|
+
const buint = BigInt(uint);
|
11760
|
+
if (buint < uintBoundaries2[4]) {
|
11761
|
+
const set3 = [major | 27, 0, 0, 0, 0, 0, 0, 0];
|
11762
|
+
let lo = Number(buint & BigInt(4294967295));
|
11763
|
+
let hi = Number(buint >> BigInt(32) & BigInt(4294967295));
|
11764
|
+
set3[8] = lo & 255;
|
11765
|
+
lo = lo >> 8;
|
11766
|
+
set3[7] = lo & 255;
|
11767
|
+
lo = lo >> 8;
|
11768
|
+
set3[6] = lo & 255;
|
11769
|
+
lo = lo >> 8;
|
11770
|
+
set3[5] = lo & 255;
|
11771
|
+
set3[4] = hi & 255;
|
11772
|
+
hi = hi >> 8;
|
11773
|
+
set3[3] = hi & 255;
|
11774
|
+
hi = hi >> 8;
|
11775
|
+
set3[2] = hi & 255;
|
11776
|
+
hi = hi >> 8;
|
11777
|
+
set3[1] = hi & 255;
|
11778
|
+
buf3.push(set3);
|
11779
|
+
} else {
|
11780
|
+
throw new Error(`${decodeErrPrefix2} encountered BigInt larger than allowable range`);
|
11781
|
+
}
|
11782
|
+
}
|
11783
|
+
}
|
11784
|
+
encodeUint2.encodedSize = function encodedSize9(token) {
|
11785
|
+
return encodeUintValue2.encodedSize(token.value);
|
11786
|
+
};
|
11787
|
+
encodeUintValue2.encodedSize = function encodedSize10(uint) {
|
11788
|
+
if (uint < uintBoundaries2[0]) {
|
11789
|
+
return 1;
|
11790
|
+
}
|
11791
|
+
if (uint < uintBoundaries2[1]) {
|
11792
|
+
return 2;
|
11793
|
+
}
|
11794
|
+
if (uint < uintBoundaries2[2]) {
|
11795
|
+
return 3;
|
11796
|
+
}
|
11797
|
+
if (uint < uintBoundaries2[3]) {
|
11798
|
+
return 5;
|
11799
|
+
}
|
11800
|
+
return 9;
|
11801
|
+
};
|
11802
|
+
encodeUint2.compareTokens = function compareTokens4(tok1, tok2) {
|
11803
|
+
return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : (
|
11804
|
+
/* c8 ignore next */
|
11805
|
+
0
|
11806
|
+
);
|
11807
|
+
};
|
11808
|
+
|
11809
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/1negint.js
|
11810
|
+
function decodeNegint82(data, pos, _minor, options) {
|
11811
|
+
return new Token2(Type2.negint, -1 - readUint82(data, pos + 1, options), 2);
|
11812
|
+
}
|
11813
|
+
function decodeNegint162(data, pos, _minor, options) {
|
11814
|
+
return new Token2(Type2.negint, -1 - readUint162(data, pos + 1, options), 3);
|
11815
|
+
}
|
11816
|
+
function decodeNegint322(data, pos, _minor, options) {
|
11817
|
+
return new Token2(Type2.negint, -1 - readUint322(data, pos + 1, options), 5);
|
11818
|
+
}
|
11819
|
+
var neg1b2 = BigInt(-1);
|
11820
|
+
var pos1b2 = BigInt(1);
|
11821
|
+
function decodeNegint642(data, pos, _minor, options) {
|
11822
|
+
const int = readUint642(data, pos + 1, options);
|
11823
|
+
if (typeof int !== "bigint") {
|
11824
|
+
const value = -1 - int;
|
11825
|
+
if (value >= Number.MIN_SAFE_INTEGER) {
|
11826
|
+
return new Token2(Type2.negint, value, 9);
|
11827
|
+
}
|
11828
|
+
}
|
11829
|
+
if (options.allowBigInt !== true) {
|
11830
|
+
throw new Error(`${decodeErrPrefix2} integers outside of the safe integer range are not supported`);
|
11831
|
+
}
|
11832
|
+
return new Token2(Type2.negint, neg1b2 - BigInt(int), 9);
|
11833
|
+
}
|
11834
|
+
function encodeNegint2(buf3, token) {
|
11835
|
+
const negint = token.value;
|
11836
|
+
const unsigned = typeof negint === "bigint" ? negint * neg1b2 - pos1b2 : negint * -1 - 1;
|
11837
|
+
encodeUintValue2(buf3, token.type.majorEncoded, unsigned);
|
11838
|
+
}
|
11839
|
+
encodeNegint2.encodedSize = function encodedSize11(token) {
|
11840
|
+
const negint = token.value;
|
11841
|
+
const unsigned = typeof negint === "bigint" ? negint * neg1b2 - pos1b2 : negint * -1 - 1;
|
11842
|
+
if (unsigned < uintBoundaries2[0]) {
|
11843
|
+
return 1;
|
11844
|
+
}
|
11845
|
+
if (unsigned < uintBoundaries2[1]) {
|
11846
|
+
return 2;
|
11847
|
+
}
|
11848
|
+
if (unsigned < uintBoundaries2[2]) {
|
11849
|
+
return 3;
|
11850
|
+
}
|
11851
|
+
if (unsigned < uintBoundaries2[3]) {
|
11852
|
+
return 5;
|
11853
|
+
}
|
11854
|
+
return 9;
|
11855
|
+
};
|
11856
|
+
encodeNegint2.compareTokens = function compareTokens5(tok1, tok2) {
|
11857
|
+
return tok1.value < tok2.value ? 1 : tok1.value > tok2.value ? -1 : (
|
11858
|
+
/* c8 ignore next */
|
11859
|
+
0
|
11860
|
+
);
|
11861
|
+
};
|
11862
|
+
|
11863
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/2bytes.js
|
11864
|
+
function toToken5(data, pos, prefix, length5) {
|
11865
|
+
assertEnoughData2(data, pos, prefix + length5);
|
11866
|
+
const buf3 = slice2(data, pos + prefix, pos + prefix + length5);
|
11867
|
+
return new Token2(Type2.bytes, buf3, prefix + length5);
|
11868
|
+
}
|
11869
|
+
function decodeBytesCompact2(data, pos, minor, _options) {
|
11870
|
+
return toToken5(data, pos, 1, minor);
|
11871
|
+
}
|
11872
|
+
function decodeBytes82(data, pos, _minor, options) {
|
11873
|
+
return toToken5(data, pos, 2, readUint82(data, pos + 1, options));
|
11874
|
+
}
|
11875
|
+
function decodeBytes162(data, pos, _minor, options) {
|
11876
|
+
return toToken5(data, pos, 3, readUint162(data, pos + 1, options));
|
11877
|
+
}
|
11878
|
+
function decodeBytes322(data, pos, _minor, options) {
|
11879
|
+
return toToken5(data, pos, 5, readUint322(data, pos + 1, options));
|
11880
|
+
}
|
11881
|
+
function decodeBytes642(data, pos, _minor, options) {
|
11882
|
+
const l = readUint642(data, pos + 1, options);
|
11883
|
+
if (typeof l === "bigint") {
|
11884
|
+
throw new Error(`${decodeErrPrefix2} 64-bit integer bytes lengths not supported`);
|
11885
|
+
}
|
11886
|
+
return toToken5(data, pos, 9, l);
|
11887
|
+
}
|
11888
|
+
function tokenBytes2(token) {
|
11889
|
+
if (token.encodedBytes === void 0) {
|
11890
|
+
token.encodedBytes = token.type === Type2.string ? fromString4(token.value) : token.value;
|
11891
|
+
}
|
11892
|
+
return token.encodedBytes;
|
11893
|
+
}
|
11894
|
+
function encodeBytes2(buf3, token) {
|
11895
|
+
const bytes = tokenBytes2(token);
|
11896
|
+
encodeUintValue2(buf3, token.type.majorEncoded, bytes.length);
|
11897
|
+
buf3.push(bytes);
|
11898
|
+
}
|
11899
|
+
encodeBytes2.encodedSize = function encodedSize12(token) {
|
11900
|
+
const bytes = tokenBytes2(token);
|
11901
|
+
return encodeUintValue2.encodedSize(bytes.length) + bytes.length;
|
11902
|
+
};
|
11903
|
+
encodeBytes2.compareTokens = function compareTokens6(tok1, tok2) {
|
11904
|
+
return compareBytes2(tokenBytes2(tok1), tokenBytes2(tok2));
|
11905
|
+
};
|
11906
|
+
function compareBytes2(b1, b2) {
|
11907
|
+
return b1.length < b2.length ? -1 : b1.length > b2.length ? 1 : compare3(b1, b2);
|
11908
|
+
}
|
11909
|
+
|
11910
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/3string.js
|
11911
|
+
function toToken6(data, pos, prefix, length5, options) {
|
11912
|
+
const totLength = prefix + length5;
|
11913
|
+
assertEnoughData2(data, pos, totLength);
|
11914
|
+
const tok = new Token2(Type2.string, toString4(data, pos + prefix, pos + totLength), totLength);
|
11915
|
+
if (options.retainStringBytes === true) {
|
11916
|
+
tok.byteValue = slice2(data, pos + prefix, pos + totLength);
|
11917
|
+
}
|
11918
|
+
return tok;
|
11919
|
+
}
|
11920
|
+
function decodeStringCompact2(data, pos, minor, options) {
|
11921
|
+
return toToken6(data, pos, 1, minor, options);
|
11922
|
+
}
|
11923
|
+
function decodeString82(data, pos, _minor, options) {
|
11924
|
+
return toToken6(data, pos, 2, readUint82(data, pos + 1, options), options);
|
11925
|
+
}
|
11926
|
+
function decodeString162(data, pos, _minor, options) {
|
11927
|
+
return toToken6(data, pos, 3, readUint162(data, pos + 1, options), options);
|
11928
|
+
}
|
11929
|
+
function decodeString322(data, pos, _minor, options) {
|
11930
|
+
return toToken6(data, pos, 5, readUint322(data, pos + 1, options), options);
|
11931
|
+
}
|
11932
|
+
function decodeString642(data, pos, _minor, options) {
|
11933
|
+
const l = readUint642(data, pos + 1, options);
|
11934
|
+
if (typeof l === "bigint") {
|
11935
|
+
throw new Error(`${decodeErrPrefix2} 64-bit integer string lengths not supported`);
|
11936
|
+
}
|
11937
|
+
return toToken6(data, pos, 9, l, options);
|
11938
|
+
}
|
11939
|
+
var encodeString2 = encodeBytes2;
|
11940
|
+
|
11941
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/4array.js
|
11942
|
+
function toToken7(_data, _pos, prefix, length5) {
|
11943
|
+
return new Token2(Type2.array, length5, prefix);
|
11944
|
+
}
|
11945
|
+
function decodeArrayCompact2(data, pos, minor, _options) {
|
11946
|
+
return toToken7(data, pos, 1, minor);
|
11947
|
+
}
|
11948
|
+
function decodeArray82(data, pos, _minor, options) {
|
11949
|
+
return toToken7(data, pos, 2, readUint82(data, pos + 1, options));
|
11950
|
+
}
|
11951
|
+
function decodeArray162(data, pos, _minor, options) {
|
11952
|
+
return toToken7(data, pos, 3, readUint162(data, pos + 1, options));
|
11953
|
+
}
|
11954
|
+
function decodeArray322(data, pos, _minor, options) {
|
11955
|
+
return toToken7(data, pos, 5, readUint322(data, pos + 1, options));
|
11956
|
+
}
|
11957
|
+
function decodeArray642(data, pos, _minor, options) {
|
11958
|
+
const l = readUint642(data, pos + 1, options);
|
11959
|
+
if (typeof l === "bigint") {
|
11960
|
+
throw new Error(`${decodeErrPrefix2} 64-bit integer array lengths not supported`);
|
11961
|
+
}
|
11962
|
+
return toToken7(data, pos, 9, l);
|
11963
|
+
}
|
11964
|
+
function decodeArrayIndefinite2(data, pos, _minor, options) {
|
11965
|
+
if (options.allowIndefinite === false) {
|
11966
|
+
throw new Error(`${decodeErrPrefix2} indefinite length items not allowed`);
|
11967
|
+
}
|
11968
|
+
return toToken7(data, pos, 1, Infinity);
|
11969
|
+
}
|
11970
|
+
function encodeArray2(buf3, token) {
|
11971
|
+
encodeUintValue2(buf3, Type2.array.majorEncoded, token.value);
|
11972
|
+
}
|
11973
|
+
encodeArray2.compareTokens = encodeUint2.compareTokens;
|
11974
|
+
encodeArray2.encodedSize = function encodedSize13(token) {
|
11975
|
+
return encodeUintValue2.encodedSize(token.value);
|
11976
|
+
};
|
11977
|
+
|
11978
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/5map.js
|
11979
|
+
function toToken8(_data, _pos, prefix, length5) {
|
11980
|
+
return new Token2(Type2.map, length5, prefix);
|
11981
|
+
}
|
11982
|
+
function decodeMapCompact2(data, pos, minor, _options) {
|
11983
|
+
return toToken8(data, pos, 1, minor);
|
11984
|
+
}
|
11985
|
+
function decodeMap82(data, pos, _minor, options) {
|
11986
|
+
return toToken8(data, pos, 2, readUint82(data, pos + 1, options));
|
11987
|
+
}
|
11988
|
+
function decodeMap162(data, pos, _minor, options) {
|
11989
|
+
return toToken8(data, pos, 3, readUint162(data, pos + 1, options));
|
11990
|
+
}
|
11991
|
+
function decodeMap322(data, pos, _minor, options) {
|
11992
|
+
return toToken8(data, pos, 5, readUint322(data, pos + 1, options));
|
11993
|
+
}
|
11994
|
+
function decodeMap642(data, pos, _minor, options) {
|
11995
|
+
const l = readUint642(data, pos + 1, options);
|
11996
|
+
if (typeof l === "bigint") {
|
11997
|
+
throw new Error(`${decodeErrPrefix2} 64-bit integer map lengths not supported`);
|
11998
|
+
}
|
11999
|
+
return toToken8(data, pos, 9, l);
|
12000
|
+
}
|
12001
|
+
function decodeMapIndefinite2(data, pos, _minor, options) {
|
12002
|
+
if (options.allowIndefinite === false) {
|
12003
|
+
throw new Error(`${decodeErrPrefix2} indefinite length items not allowed`);
|
12004
|
+
}
|
12005
|
+
return toToken8(data, pos, 1, Infinity);
|
12006
|
+
}
|
12007
|
+
function encodeMap2(buf3, token) {
|
12008
|
+
encodeUintValue2(buf3, Type2.map.majorEncoded, token.value);
|
12009
|
+
}
|
12010
|
+
encodeMap2.compareTokens = encodeUint2.compareTokens;
|
12011
|
+
encodeMap2.encodedSize = function encodedSize14(token) {
|
12012
|
+
return encodeUintValue2.encodedSize(token.value);
|
12013
|
+
};
|
12014
|
+
|
12015
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/6tag.js
|
12016
|
+
function decodeTagCompact2(_data, _pos, minor, _options) {
|
12017
|
+
return new Token2(Type2.tag, minor, 1);
|
12018
|
+
}
|
12019
|
+
function decodeTag82(data, pos, _minor, options) {
|
12020
|
+
return new Token2(Type2.tag, readUint82(data, pos + 1, options), 2);
|
12021
|
+
}
|
12022
|
+
function decodeTag162(data, pos, _minor, options) {
|
12023
|
+
return new Token2(Type2.tag, readUint162(data, pos + 1, options), 3);
|
12024
|
+
}
|
12025
|
+
function decodeTag322(data, pos, _minor, options) {
|
12026
|
+
return new Token2(Type2.tag, readUint322(data, pos + 1, options), 5);
|
12027
|
+
}
|
12028
|
+
function decodeTag642(data, pos, _minor, options) {
|
12029
|
+
return new Token2(Type2.tag, readUint642(data, pos + 1, options), 9);
|
12030
|
+
}
|
12031
|
+
function encodeTag2(buf3, token) {
|
12032
|
+
encodeUintValue2(buf3, Type2.tag.majorEncoded, token.value);
|
12033
|
+
}
|
12034
|
+
encodeTag2.compareTokens = encodeUint2.compareTokens;
|
12035
|
+
encodeTag2.encodedSize = function encodedSize15(token) {
|
12036
|
+
return encodeUintValue2.encodedSize(token.value);
|
12037
|
+
};
|
12038
|
+
|
12039
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/7float.js
|
12040
|
+
var MINOR_FALSE2 = 20;
|
12041
|
+
var MINOR_TRUE2 = 21;
|
12042
|
+
var MINOR_NULL2 = 22;
|
12043
|
+
var MINOR_UNDEFINED2 = 23;
|
12044
|
+
function decodeUndefined2(_data, _pos, _minor, options) {
|
12045
|
+
if (options.allowUndefined === false) {
|
12046
|
+
throw new Error(`${decodeErrPrefix2} undefined values are not supported`);
|
12047
|
+
} else if (options.coerceUndefinedToNull === true) {
|
12048
|
+
return new Token2(Type2.null, null, 1);
|
12049
|
+
}
|
12050
|
+
return new Token2(Type2.undefined, void 0, 1);
|
12051
|
+
}
|
12052
|
+
function decodeBreak2(_data, _pos, _minor, options) {
|
12053
|
+
if (options.allowIndefinite === false) {
|
12054
|
+
throw new Error(`${decodeErrPrefix2} indefinite length items not allowed`);
|
12055
|
+
}
|
12056
|
+
return new Token2(Type2.break, void 0, 1);
|
12057
|
+
}
|
12058
|
+
function createToken2(value, bytes, options) {
|
12059
|
+
if (options) {
|
12060
|
+
if (options.allowNaN === false && Number.isNaN(value)) {
|
12061
|
+
throw new Error(`${decodeErrPrefix2} NaN values are not supported`);
|
12062
|
+
}
|
12063
|
+
if (options.allowInfinity === false && (value === Infinity || value === -Infinity)) {
|
12064
|
+
throw new Error(`${decodeErrPrefix2} Infinity values are not supported`);
|
12065
|
+
}
|
12066
|
+
}
|
12067
|
+
return new Token2(Type2.float, value, bytes);
|
12068
|
+
}
|
12069
|
+
function decodeFloat162(data, pos, _minor, options) {
|
12070
|
+
return createToken2(readFloat162(data, pos + 1), 3, options);
|
12071
|
+
}
|
12072
|
+
function decodeFloat322(data, pos, _minor, options) {
|
12073
|
+
return createToken2(readFloat322(data, pos + 1), 5, options);
|
12074
|
+
}
|
12075
|
+
function decodeFloat642(data, pos, _minor, options) {
|
12076
|
+
return createToken2(readFloat642(data, pos + 1), 9, options);
|
12077
|
+
}
|
12078
|
+
function encodeFloat2(buf3, token, options) {
|
12079
|
+
const float = token.value;
|
12080
|
+
if (float === false) {
|
12081
|
+
buf3.push([Type2.float.majorEncoded | MINOR_FALSE2]);
|
12082
|
+
} else if (float === true) {
|
12083
|
+
buf3.push([Type2.float.majorEncoded | MINOR_TRUE2]);
|
12084
|
+
} else if (float === null) {
|
12085
|
+
buf3.push([Type2.float.majorEncoded | MINOR_NULL2]);
|
12086
|
+
} else if (float === void 0) {
|
12087
|
+
buf3.push([Type2.float.majorEncoded | MINOR_UNDEFINED2]);
|
12088
|
+
} else {
|
12089
|
+
let decoded;
|
12090
|
+
let success = false;
|
12091
|
+
if (!options || options.float64 !== true) {
|
12092
|
+
encodeFloat162(float);
|
12093
|
+
decoded = readFloat162(ui8a2, 1);
|
12094
|
+
if (float === decoded || Number.isNaN(float)) {
|
12095
|
+
ui8a2[0] = 249;
|
12096
|
+
buf3.push(ui8a2.slice(0, 3));
|
12097
|
+
success = true;
|
12098
|
+
} else {
|
12099
|
+
encodeFloat322(float);
|
12100
|
+
decoded = readFloat322(ui8a2, 1);
|
12101
|
+
if (float === decoded) {
|
12102
|
+
ui8a2[0] = 250;
|
12103
|
+
buf3.push(ui8a2.slice(0, 5));
|
12104
|
+
success = true;
|
12105
|
+
}
|
12106
|
+
}
|
12107
|
+
}
|
12108
|
+
if (!success) {
|
12109
|
+
encodeFloat642(float);
|
12110
|
+
decoded = readFloat642(ui8a2, 1);
|
12111
|
+
ui8a2[0] = 251;
|
12112
|
+
buf3.push(ui8a2.slice(0, 9));
|
12113
|
+
}
|
12114
|
+
}
|
12115
|
+
}
|
12116
|
+
encodeFloat2.encodedSize = function encodedSize16(token, options) {
|
12117
|
+
const float = token.value;
|
12118
|
+
if (float === false || float === true || float === null || float === void 0) {
|
12119
|
+
return 1;
|
12120
|
+
}
|
12121
|
+
if (!options || options.float64 !== true) {
|
12122
|
+
encodeFloat162(float);
|
12123
|
+
let decoded = readFloat162(ui8a2, 1);
|
12124
|
+
if (float === decoded || Number.isNaN(float)) {
|
12125
|
+
return 3;
|
12126
|
+
}
|
12127
|
+
encodeFloat322(float);
|
12128
|
+
decoded = readFloat322(ui8a2, 1);
|
12129
|
+
if (float === decoded) {
|
12130
|
+
return 5;
|
12131
|
+
}
|
12132
|
+
}
|
12133
|
+
return 9;
|
12134
|
+
};
|
12135
|
+
var buffer2 = new ArrayBuffer(9);
|
12136
|
+
var dataView2 = new DataView(buffer2, 1);
|
12137
|
+
var ui8a2 = new Uint8Array(buffer2, 0);
|
12138
|
+
function encodeFloat162(inp) {
|
12139
|
+
if (inp === Infinity) {
|
12140
|
+
dataView2.setUint16(0, 31744, false);
|
12141
|
+
} else if (inp === -Infinity) {
|
12142
|
+
dataView2.setUint16(0, 64512, false);
|
12143
|
+
} else if (Number.isNaN(inp)) {
|
12144
|
+
dataView2.setUint16(0, 32256, false);
|
12145
|
+
} else {
|
12146
|
+
dataView2.setFloat32(0, inp);
|
12147
|
+
const valu32 = dataView2.getUint32(0);
|
12148
|
+
const exponent = (valu32 & 2139095040) >> 23;
|
12149
|
+
const mantissa = valu32 & 8388607;
|
12150
|
+
if (exponent === 255) {
|
12151
|
+
dataView2.setUint16(0, 31744, false);
|
12152
|
+
} else if (exponent === 0) {
|
12153
|
+
dataView2.setUint16(0, (inp & 2147483648) >> 16 | mantissa >> 13, false);
|
12154
|
+
} else {
|
12155
|
+
const logicalExponent = exponent - 127;
|
12156
|
+
if (logicalExponent < -24) {
|
12157
|
+
dataView2.setUint16(0, 0);
|
12158
|
+
} else if (logicalExponent < -14) {
|
12159
|
+
dataView2.setUint16(0, (valu32 & 2147483648) >> 16 | /* sign bit */
|
12160
|
+
1 << 24 + logicalExponent, false);
|
12161
|
+
} else {
|
12162
|
+
dataView2.setUint16(0, (valu32 & 2147483648) >> 16 | logicalExponent + 15 << 10 | mantissa >> 13, false);
|
12163
|
+
}
|
12164
|
+
}
|
12165
|
+
}
|
12166
|
+
}
|
12167
|
+
function readFloat162(ui8a3, pos) {
|
12168
|
+
if (ui8a3.length - pos < 2) {
|
12169
|
+
throw new Error(`${decodeErrPrefix2} not enough data for float16`);
|
12170
|
+
}
|
12171
|
+
const half = (ui8a3[pos] << 8) + ui8a3[pos + 1];
|
12172
|
+
if (half === 31744) {
|
12173
|
+
return Infinity;
|
12174
|
+
}
|
12175
|
+
if (half === 64512) {
|
12176
|
+
return -Infinity;
|
12177
|
+
}
|
12178
|
+
if (half === 32256) {
|
12179
|
+
return NaN;
|
12180
|
+
}
|
12181
|
+
const exp = half >> 10 & 31;
|
12182
|
+
const mant = half & 1023;
|
12183
|
+
let val;
|
12184
|
+
if (exp === 0) {
|
12185
|
+
val = mant * 2 ** -24;
|
12186
|
+
} else if (exp !== 31) {
|
12187
|
+
val = (mant + 1024) * 2 ** (exp - 25);
|
12188
|
+
} else {
|
12189
|
+
val = mant === 0 ? Infinity : NaN;
|
12190
|
+
}
|
12191
|
+
return half & 32768 ? -val : val;
|
12192
|
+
}
|
12193
|
+
function encodeFloat322(inp) {
|
12194
|
+
dataView2.setFloat32(0, inp, false);
|
12195
|
+
}
|
12196
|
+
function readFloat322(ui8a3, pos) {
|
12197
|
+
if (ui8a3.length - pos < 4) {
|
12198
|
+
throw new Error(`${decodeErrPrefix2} not enough data for float32`);
|
12199
|
+
}
|
12200
|
+
const offset = (ui8a3.byteOffset || 0) + pos;
|
12201
|
+
return new DataView(ui8a3.buffer, offset, 4).getFloat32(0, false);
|
12202
|
+
}
|
12203
|
+
function encodeFloat642(inp) {
|
12204
|
+
dataView2.setFloat64(0, inp, false);
|
12205
|
+
}
|
12206
|
+
function readFloat642(ui8a3, pos) {
|
12207
|
+
if (ui8a3.length - pos < 8) {
|
12208
|
+
throw new Error(`${decodeErrPrefix2} not enough data for float64`);
|
12209
|
+
}
|
12210
|
+
const offset = (ui8a3.byteOffset || 0) + pos;
|
12211
|
+
return new DataView(ui8a3.buffer, offset, 8).getFloat64(0, false);
|
12212
|
+
}
|
12213
|
+
encodeFloat2.compareTokens = encodeUint2.compareTokens;
|
12214
|
+
|
12215
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/jump.js
|
12216
|
+
function invalidMinor2(data, pos, minor) {
|
12217
|
+
throw new Error(`${decodeErrPrefix2} encountered invalid minor (${minor}) for major ${data[pos] >>> 5}`);
|
12218
|
+
}
|
12219
|
+
function errorer2(msg) {
|
12220
|
+
return () => {
|
12221
|
+
throw new Error(`${decodeErrPrefix2} ${msg}`);
|
12222
|
+
};
|
12223
|
+
}
|
12224
|
+
var jump2 = [];
|
12225
|
+
for (let i = 0; i <= 23; i++) {
|
12226
|
+
jump2[i] = invalidMinor2;
|
12227
|
+
}
|
12228
|
+
jump2[24] = decodeUint82;
|
12229
|
+
jump2[25] = decodeUint162;
|
12230
|
+
jump2[26] = decodeUint322;
|
12231
|
+
jump2[27] = decodeUint642;
|
12232
|
+
jump2[28] = invalidMinor2;
|
12233
|
+
jump2[29] = invalidMinor2;
|
12234
|
+
jump2[30] = invalidMinor2;
|
12235
|
+
jump2[31] = invalidMinor2;
|
12236
|
+
for (let i = 32; i <= 55; i++) {
|
12237
|
+
jump2[i] = invalidMinor2;
|
12238
|
+
}
|
12239
|
+
jump2[56] = decodeNegint82;
|
12240
|
+
jump2[57] = decodeNegint162;
|
12241
|
+
jump2[58] = decodeNegint322;
|
12242
|
+
jump2[59] = decodeNegint642;
|
12243
|
+
jump2[60] = invalidMinor2;
|
12244
|
+
jump2[61] = invalidMinor2;
|
12245
|
+
jump2[62] = invalidMinor2;
|
12246
|
+
jump2[63] = invalidMinor2;
|
12247
|
+
for (let i = 64; i <= 87; i++) {
|
12248
|
+
jump2[i] = decodeBytesCompact2;
|
12249
|
+
}
|
12250
|
+
jump2[88] = decodeBytes82;
|
12251
|
+
jump2[89] = decodeBytes162;
|
12252
|
+
jump2[90] = decodeBytes322;
|
12253
|
+
jump2[91] = decodeBytes642;
|
12254
|
+
jump2[92] = invalidMinor2;
|
12255
|
+
jump2[93] = invalidMinor2;
|
12256
|
+
jump2[94] = invalidMinor2;
|
12257
|
+
jump2[95] = errorer2("indefinite length bytes/strings are not supported");
|
12258
|
+
for (let i = 96; i <= 119; i++) {
|
12259
|
+
jump2[i] = decodeStringCompact2;
|
12260
|
+
}
|
12261
|
+
jump2[120] = decodeString82;
|
12262
|
+
jump2[121] = decodeString162;
|
12263
|
+
jump2[122] = decodeString322;
|
12264
|
+
jump2[123] = decodeString642;
|
12265
|
+
jump2[124] = invalidMinor2;
|
12266
|
+
jump2[125] = invalidMinor2;
|
12267
|
+
jump2[126] = invalidMinor2;
|
12268
|
+
jump2[127] = errorer2("indefinite length bytes/strings are not supported");
|
12269
|
+
for (let i = 128; i <= 151; i++) {
|
12270
|
+
jump2[i] = decodeArrayCompact2;
|
12271
|
+
}
|
12272
|
+
jump2[152] = decodeArray82;
|
12273
|
+
jump2[153] = decodeArray162;
|
12274
|
+
jump2[154] = decodeArray322;
|
12275
|
+
jump2[155] = decodeArray642;
|
12276
|
+
jump2[156] = invalidMinor2;
|
12277
|
+
jump2[157] = invalidMinor2;
|
12278
|
+
jump2[158] = invalidMinor2;
|
12279
|
+
jump2[159] = decodeArrayIndefinite2;
|
12280
|
+
for (let i = 160; i <= 183; i++) {
|
12281
|
+
jump2[i] = decodeMapCompact2;
|
12282
|
+
}
|
12283
|
+
jump2[184] = decodeMap82;
|
12284
|
+
jump2[185] = decodeMap162;
|
12285
|
+
jump2[186] = decodeMap322;
|
12286
|
+
jump2[187] = decodeMap642;
|
12287
|
+
jump2[188] = invalidMinor2;
|
12288
|
+
jump2[189] = invalidMinor2;
|
12289
|
+
jump2[190] = invalidMinor2;
|
12290
|
+
jump2[191] = decodeMapIndefinite2;
|
12291
|
+
for (let i = 192; i <= 215; i++) {
|
12292
|
+
jump2[i] = decodeTagCompact2;
|
12293
|
+
}
|
12294
|
+
jump2[216] = decodeTag82;
|
12295
|
+
jump2[217] = decodeTag162;
|
12296
|
+
jump2[218] = decodeTag322;
|
12297
|
+
jump2[219] = decodeTag642;
|
12298
|
+
jump2[220] = invalidMinor2;
|
12299
|
+
jump2[221] = invalidMinor2;
|
12300
|
+
jump2[222] = invalidMinor2;
|
12301
|
+
jump2[223] = invalidMinor2;
|
12302
|
+
for (let i = 224; i <= 243; i++) {
|
12303
|
+
jump2[i] = errorer2("simple values are not supported");
|
12304
|
+
}
|
12305
|
+
jump2[244] = invalidMinor2;
|
12306
|
+
jump2[245] = invalidMinor2;
|
12307
|
+
jump2[246] = invalidMinor2;
|
12308
|
+
jump2[247] = decodeUndefined2;
|
12309
|
+
jump2[248] = errorer2("simple values are not supported");
|
12310
|
+
jump2[249] = decodeFloat162;
|
12311
|
+
jump2[250] = decodeFloat322;
|
12312
|
+
jump2[251] = decodeFloat642;
|
12313
|
+
jump2[252] = invalidMinor2;
|
12314
|
+
jump2[253] = invalidMinor2;
|
12315
|
+
jump2[254] = invalidMinor2;
|
12316
|
+
jump2[255] = decodeBreak2;
|
12317
|
+
var quick2 = [];
|
12318
|
+
for (let i = 0; i < 24; i++) {
|
12319
|
+
quick2[i] = new Token2(Type2.uint, i, 1);
|
12320
|
+
}
|
12321
|
+
for (let i = -1; i >= -24; i--) {
|
12322
|
+
quick2[31 - i] = new Token2(Type2.negint, i, 1);
|
12323
|
+
}
|
12324
|
+
quick2[64] = new Token2(Type2.bytes, new Uint8Array(0), 1);
|
12325
|
+
quick2[96] = new Token2(Type2.string, "", 1);
|
12326
|
+
quick2[128] = new Token2(Type2.array, 0, 1);
|
12327
|
+
quick2[160] = new Token2(Type2.map, 0, 1);
|
12328
|
+
quick2[244] = new Token2(Type2.false, false, 1);
|
12329
|
+
quick2[245] = new Token2(Type2.true, true, 1);
|
12330
|
+
quick2[246] = new Token2(Type2.null, null, 1);
|
12331
|
+
function quickEncodeToken2(token) {
|
12332
|
+
switch (token.type) {
|
12333
|
+
case Type2.false:
|
12334
|
+
return fromArray2([244]);
|
12335
|
+
case Type2.true:
|
12336
|
+
return fromArray2([245]);
|
12337
|
+
case Type2.null:
|
12338
|
+
return fromArray2([246]);
|
12339
|
+
case Type2.bytes:
|
12340
|
+
if (!token.value.length) {
|
12341
|
+
return fromArray2([64]);
|
12342
|
+
}
|
12343
|
+
return;
|
12344
|
+
case Type2.string:
|
12345
|
+
if (token.value === "") {
|
12346
|
+
return fromArray2([96]);
|
12347
|
+
}
|
12348
|
+
return;
|
12349
|
+
case Type2.array:
|
12350
|
+
if (token.value === 0) {
|
12351
|
+
return fromArray2([128]);
|
12352
|
+
}
|
12353
|
+
return;
|
12354
|
+
case Type2.map:
|
12355
|
+
if (token.value === 0) {
|
12356
|
+
return fromArray2([160]);
|
12357
|
+
}
|
12358
|
+
return;
|
12359
|
+
case Type2.uint:
|
12360
|
+
if (token.value < 24) {
|
12361
|
+
return fromArray2([Number(token.value)]);
|
12362
|
+
}
|
12363
|
+
return;
|
12364
|
+
case Type2.negint:
|
12365
|
+
if (token.value >= -24) {
|
12366
|
+
return fromArray2([31 - Number(token.value)]);
|
12367
|
+
}
|
12368
|
+
}
|
12369
|
+
}
|
12370
|
+
|
12371
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/encode.js
|
12372
|
+
function makeCborEncoders2() {
|
12373
|
+
const encoders = [];
|
12374
|
+
encoders[Type2.uint.major] = encodeUint2;
|
12375
|
+
encoders[Type2.negint.major] = encodeNegint2;
|
12376
|
+
encoders[Type2.bytes.major] = encodeBytes2;
|
12377
|
+
encoders[Type2.string.major] = encodeString2;
|
12378
|
+
encoders[Type2.array.major] = encodeArray2;
|
12379
|
+
encoders[Type2.map.major] = encodeMap2;
|
12380
|
+
encoders[Type2.tag.major] = encodeTag2;
|
12381
|
+
encoders[Type2.float.major] = encodeFloat2;
|
12382
|
+
return encoders;
|
12383
|
+
}
|
12384
|
+
var cborEncoders3 = makeCborEncoders2();
|
12385
|
+
var buf2 = new Bl2();
|
12386
|
+
var Ref2 = class _Ref {
|
12387
|
+
/**
|
12388
|
+
* @param {object|any[]} obj
|
12389
|
+
* @param {Reference|undefined} parent
|
12390
|
+
*/
|
12391
|
+
constructor(obj, parent) {
|
12392
|
+
this.obj = obj;
|
12393
|
+
this.parent = parent;
|
12394
|
+
}
|
12395
|
+
/**
|
12396
|
+
* @param {object|any[]} obj
|
12397
|
+
* @returns {boolean}
|
12398
|
+
*/
|
12399
|
+
includes(obj) {
|
12400
|
+
let p = this;
|
12401
|
+
do {
|
12402
|
+
if (p.obj === obj) {
|
12403
|
+
return true;
|
12404
|
+
}
|
12405
|
+
} while (p = p.parent);
|
12406
|
+
return false;
|
12407
|
+
}
|
12408
|
+
/**
|
12409
|
+
* @param {Reference|undefined} stack
|
12410
|
+
* @param {object|any[]} obj
|
12411
|
+
* @returns {Reference}
|
12412
|
+
*/
|
12413
|
+
static createCheck(stack, obj) {
|
12414
|
+
if (stack && stack.includes(obj)) {
|
12415
|
+
throw new Error(`${encodeErrPrefix2} object contains circular references`);
|
12416
|
+
}
|
12417
|
+
return new _Ref(obj, stack);
|
12418
|
+
}
|
12419
|
+
};
|
12420
|
+
var simpleTokens2 = {
|
12421
|
+
null: new Token2(Type2.null, null),
|
12422
|
+
undefined: new Token2(Type2.undefined, void 0),
|
12423
|
+
true: new Token2(Type2.true, true),
|
12424
|
+
false: new Token2(Type2.false, false),
|
12425
|
+
emptyArray: new Token2(Type2.array, 0),
|
12426
|
+
emptyMap: new Token2(Type2.map, 0)
|
12427
|
+
};
|
12428
|
+
var typeEncoders2 = {
|
12429
|
+
/**
|
12430
|
+
* @param {any} obj
|
12431
|
+
* @param {string} _typ
|
12432
|
+
* @param {EncodeOptions} _options
|
12433
|
+
* @param {Reference} [_refStack]
|
12434
|
+
* @returns {TokenOrNestedTokens}
|
12435
|
+
*/
|
12436
|
+
number(obj, _typ, _options, _refStack) {
|
12437
|
+
if (!Number.isInteger(obj) || !Number.isSafeInteger(obj)) {
|
12438
|
+
return new Token2(Type2.float, obj);
|
12439
|
+
} else if (obj >= 0) {
|
12440
|
+
return new Token2(Type2.uint, obj);
|
12441
|
+
} else {
|
12442
|
+
return new Token2(Type2.negint, obj);
|
12443
|
+
}
|
12444
|
+
},
|
12445
|
+
/**
|
12446
|
+
* @param {any} obj
|
12447
|
+
* @param {string} _typ
|
12448
|
+
* @param {EncodeOptions} _options
|
12449
|
+
* @param {Reference} [_refStack]
|
12450
|
+
* @returns {TokenOrNestedTokens}
|
12451
|
+
*/
|
12452
|
+
bigint(obj, _typ, _options, _refStack) {
|
12453
|
+
if (obj >= BigInt(0)) {
|
12454
|
+
return new Token2(Type2.uint, obj);
|
12455
|
+
} else {
|
12456
|
+
return new Token2(Type2.negint, obj);
|
12457
|
+
}
|
12458
|
+
},
|
12459
|
+
/**
|
12460
|
+
* @param {any} obj
|
12461
|
+
* @param {string} _typ
|
12462
|
+
* @param {EncodeOptions} _options
|
12463
|
+
* @param {Reference} [_refStack]
|
12464
|
+
* @returns {TokenOrNestedTokens}
|
12465
|
+
*/
|
12466
|
+
Uint8Array(obj, _typ, _options, _refStack) {
|
12467
|
+
return new Token2(Type2.bytes, obj);
|
12468
|
+
},
|
12469
|
+
/**
|
12470
|
+
* @param {any} obj
|
12471
|
+
* @param {string} _typ
|
12472
|
+
* @param {EncodeOptions} _options
|
12473
|
+
* @param {Reference} [_refStack]
|
12474
|
+
* @returns {TokenOrNestedTokens}
|
12475
|
+
*/
|
12476
|
+
string(obj, _typ, _options, _refStack) {
|
12477
|
+
return new Token2(Type2.string, obj);
|
12478
|
+
},
|
12479
|
+
/**
|
12480
|
+
* @param {any} obj
|
12481
|
+
* @param {string} _typ
|
12482
|
+
* @param {EncodeOptions} _options
|
12483
|
+
* @param {Reference} [_refStack]
|
12484
|
+
* @returns {TokenOrNestedTokens}
|
12485
|
+
*/
|
12486
|
+
boolean(obj, _typ, _options, _refStack) {
|
12487
|
+
return obj ? simpleTokens2.true : simpleTokens2.false;
|
12488
|
+
},
|
12489
|
+
/**
|
12490
|
+
* @param {any} _obj
|
12491
|
+
* @param {string} _typ
|
12492
|
+
* @param {EncodeOptions} _options
|
12493
|
+
* @param {Reference} [_refStack]
|
12494
|
+
* @returns {TokenOrNestedTokens}
|
12495
|
+
*/
|
12496
|
+
null(_obj, _typ, _options, _refStack) {
|
12497
|
+
return simpleTokens2.null;
|
12498
|
+
},
|
12499
|
+
/**
|
12500
|
+
* @param {any} _obj
|
12501
|
+
* @param {string} _typ
|
12502
|
+
* @param {EncodeOptions} _options
|
12503
|
+
* @param {Reference} [_refStack]
|
12504
|
+
* @returns {TokenOrNestedTokens}
|
12505
|
+
*/
|
12506
|
+
undefined(_obj, _typ, _options, _refStack) {
|
12507
|
+
return simpleTokens2.undefined;
|
12508
|
+
},
|
12509
|
+
/**
|
12510
|
+
* @param {any} obj
|
12511
|
+
* @param {string} _typ
|
12512
|
+
* @param {EncodeOptions} _options
|
12513
|
+
* @param {Reference} [_refStack]
|
12514
|
+
* @returns {TokenOrNestedTokens}
|
12515
|
+
*/
|
12516
|
+
ArrayBuffer(obj, _typ, _options, _refStack) {
|
12517
|
+
return new Token2(Type2.bytes, new Uint8Array(obj));
|
12518
|
+
},
|
12519
|
+
/**
|
12520
|
+
* @param {any} obj
|
12521
|
+
* @param {string} _typ
|
12522
|
+
* @param {EncodeOptions} _options
|
12523
|
+
* @param {Reference} [_refStack]
|
12524
|
+
* @returns {TokenOrNestedTokens}
|
12525
|
+
*/
|
12526
|
+
DataView(obj, _typ, _options, _refStack) {
|
12527
|
+
return new Token2(Type2.bytes, new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength));
|
12528
|
+
},
|
12529
|
+
/**
|
12530
|
+
* @param {any} obj
|
12531
|
+
* @param {string} _typ
|
12532
|
+
* @param {EncodeOptions} options
|
12533
|
+
* @param {Reference} [refStack]
|
12534
|
+
* @returns {TokenOrNestedTokens}
|
12535
|
+
*/
|
12536
|
+
Array(obj, _typ, options, refStack) {
|
12537
|
+
if (!obj.length) {
|
12538
|
+
if (options.addBreakTokens === true) {
|
12539
|
+
return [simpleTokens2.emptyArray, new Token2(Type2.break)];
|
12540
|
+
}
|
12541
|
+
return simpleTokens2.emptyArray;
|
12542
|
+
}
|
12543
|
+
refStack = Ref2.createCheck(refStack, obj);
|
12544
|
+
const entries3 = [];
|
12545
|
+
let i = 0;
|
12546
|
+
for (const e of obj) {
|
12547
|
+
entries3[i++] = objectToTokens2(e, options, refStack);
|
12548
|
+
}
|
12549
|
+
if (options.addBreakTokens) {
|
12550
|
+
return [new Token2(Type2.array, obj.length), entries3, new Token2(Type2.break)];
|
12551
|
+
}
|
12552
|
+
return [new Token2(Type2.array, obj.length), entries3];
|
12553
|
+
},
|
12554
|
+
/**
|
12555
|
+
* @param {any} obj
|
12556
|
+
* @param {string} typ
|
12557
|
+
* @param {EncodeOptions} options
|
12558
|
+
* @param {Reference} [refStack]
|
12559
|
+
* @returns {TokenOrNestedTokens}
|
12560
|
+
*/
|
12561
|
+
Object(obj, typ, options, refStack) {
|
12562
|
+
const isMap = typ !== "Object";
|
12563
|
+
const keys = isMap ? obj.keys() : Object.keys(obj);
|
12564
|
+
const length5 = isMap ? obj.size : keys.length;
|
12565
|
+
if (!length5) {
|
12566
|
+
if (options.addBreakTokens === true) {
|
12567
|
+
return [simpleTokens2.emptyMap, new Token2(Type2.break)];
|
12568
|
+
}
|
12569
|
+
return simpleTokens2.emptyMap;
|
12570
|
+
}
|
12571
|
+
refStack = Ref2.createCheck(refStack, obj);
|
12572
|
+
const entries3 = [];
|
12573
|
+
let i = 0;
|
12574
|
+
for (const key of keys) {
|
12575
|
+
entries3[i++] = [
|
12576
|
+
objectToTokens2(key, options, refStack),
|
12577
|
+
objectToTokens2(isMap ? obj.get(key) : obj[key], options, refStack)
|
12578
|
+
];
|
12579
|
+
}
|
12580
|
+
sortMapEntries2(entries3, options);
|
12581
|
+
if (options.addBreakTokens) {
|
12582
|
+
return [new Token2(Type2.map, length5), entries3, new Token2(Type2.break)];
|
12583
|
+
}
|
12584
|
+
return [new Token2(Type2.map, length5), entries3];
|
12585
|
+
}
|
12586
|
+
};
|
12587
|
+
typeEncoders2.Map = typeEncoders2.Object;
|
12588
|
+
typeEncoders2.Buffer = typeEncoders2.Uint8Array;
|
12589
|
+
for (const typ of "Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" ")) {
|
12590
|
+
typeEncoders2[`${typ}Array`] = typeEncoders2.DataView;
|
12591
|
+
}
|
12592
|
+
function objectToTokens2(obj, options = {}, refStack) {
|
12593
|
+
const typ = is2(obj);
|
12594
|
+
const customTypeEncoder = options && options.typeEncoders && /** @type {OptionalTypeEncoder} */
|
12595
|
+
options.typeEncoders[typ] || typeEncoders2[typ];
|
12596
|
+
if (typeof customTypeEncoder === "function") {
|
12597
|
+
const tokens = customTypeEncoder(obj, typ, options, refStack);
|
12598
|
+
if (tokens != null) {
|
12599
|
+
return tokens;
|
12600
|
+
}
|
12601
|
+
}
|
12602
|
+
const typeEncoder = typeEncoders2[typ];
|
12603
|
+
if (!typeEncoder) {
|
12604
|
+
throw new Error(`${encodeErrPrefix2} unsupported type: ${typ}`);
|
12605
|
+
}
|
12606
|
+
return typeEncoder(obj, typ, options, refStack);
|
12607
|
+
}
|
12608
|
+
function sortMapEntries2(entries3, options) {
|
12609
|
+
if (options.mapSorter) {
|
12610
|
+
entries3.sort(options.mapSorter);
|
12611
|
+
}
|
12612
|
+
}
|
12613
|
+
|
12614
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/length.js
|
12615
|
+
var cborEncoders4 = makeCborEncoders2();
|
12616
|
+
var defaultEncodeOptions4 = {
|
12617
|
+
float64: false,
|
12618
|
+
quickEncodeToken: quickEncodeToken2
|
12619
|
+
};
|
12620
|
+
function tokensToLength2(tokens, encoders = cborEncoders4, options = defaultEncodeOptions4) {
|
12621
|
+
if (Array.isArray(tokens)) {
|
12622
|
+
let len = 0;
|
12623
|
+
for (const token of tokens) {
|
12624
|
+
len += tokensToLength2(token, encoders, options);
|
12625
|
+
}
|
12626
|
+
return len;
|
12627
|
+
} else {
|
12628
|
+
const encoder = encoders[tokens.type.major];
|
12629
|
+
if (encoder.encodedSize === void 0 || typeof encoder.encodedSize !== "function") {
|
12630
|
+
throw new Error(`Encoder for ${tokens.type.name} does not have an encodedSize()`);
|
12631
|
+
}
|
12632
|
+
return encoder.encodedSize(tokens, options);
|
12633
|
+
}
|
12634
|
+
}
|
12635
|
+
|
12636
|
+
// ../../node_modules/.pnpm/cborg@4.1.3/node_modules/cborg/lib/decode.js
|
12637
|
+
var DONE2 = Symbol.for("DONE");
|
12638
|
+
var BREAK2 = Symbol.for("BREAK");
|
12639
|
+
|
12640
|
+
// ../../node_modules/.pnpm/@web3-storage+pail@0.5.0/node_modules/@web3-storage/pail/src/shard.js
|
11199
12641
|
var MaxKeyLength = 64;
|
11200
12642
|
var MaxShardSize = 512 * 1024;
|
11201
|
-
var CID_TAG2 = new
|
12643
|
+
var CID_TAG2 = new Token2(Type2.tag, 42);
|
11202
12644
|
var ShardBlock = class extends Block {
|
11203
12645
|
/**
|
11204
12646
|
* @param {object} config
|
@@ -11327,7 +12769,7 @@ You can use close({ resize: true }) to resize header`);
|
|
11327
12769
|
}
|
11328
12770
|
};
|
11329
12771
|
|
11330
|
-
// ../../node_modules/.pnpm/@web3-storage+pail@0.
|
12772
|
+
// ../../node_modules/.pnpm/@web3-storage+pail@0.5.0/node_modules/@web3-storage/pail/src/index.js
|
11331
12773
|
var put = async (blocks, root2, key, value) => {
|
11332
12774
|
const shards = new ShardFetcher(blocks);
|
11333
12775
|
const rshard = await shards.get(root2);
|
@@ -11485,7 +12927,7 @@ You can use close({ resize: true }) to resize header`);
|
|
11485
12927
|
return { root: additions[additions.length - 1].cid, additions, removals };
|
11486
12928
|
};
|
11487
12929
|
var entries = async function* (blocks, root2, options = {}) {
|
11488
|
-
const { prefix } = options;
|
12930
|
+
const { prefix, gt, gte } = options;
|
11489
12931
|
const shards = new ShardFetcher(blocks);
|
11490
12932
|
const rshard = await shards.get(root2);
|
11491
12933
|
yield* (
|
@@ -11495,7 +12937,7 @@ You can use close({ resize: true }) to resize header`);
|
|
11495
12937
|
const key = shard.prefix + entry[0];
|
11496
12938
|
if (Array.isArray(entry[1])) {
|
11497
12939
|
if (entry[1][1]) {
|
11498
|
-
if (
|
12940
|
+
if (prefix && key.startsWith(prefix) || gt && key > gt || gte && key >= gte || !prefix && !gt && !gte) {
|
11499
12941
|
yield [key, entry[1][1]];
|
11500
12942
|
}
|
11501
12943
|
}
|
@@ -11506,13 +12948,26 @@ You can use close({ resize: true }) to resize header`);
|
|
11506
12948
|
if (prefix.length > key.length && !prefix.startsWith(key)) {
|
11507
12949
|
continue;
|
11508
12950
|
}
|
12951
|
+
} else if (gt) {
|
12952
|
+
if (gt.length <= key.length && !key.startsWith(gt)) {
|
12953
|
+
continue;
|
12954
|
+
}
|
12955
|
+
if (gt.length > key.length && !gt.startsWith(key)) {
|
12956
|
+
continue;
|
12957
|
+
}
|
12958
|
+
} else if (gte) {
|
12959
|
+
if (gte.length <= key.length && !key.startsWith(gte)) {
|
12960
|
+
continue;
|
12961
|
+
}
|
12962
|
+
if (gte.length > key.length && !gte.startsWith(key)) {
|
12963
|
+
continue;
|
12964
|
+
}
|
11509
12965
|
}
|
11510
12966
|
yield* ents(await shards.get(entry[1][0], key));
|
11511
12967
|
} else {
|
11512
|
-
if (prefix &&
|
11513
|
-
|
12968
|
+
if (prefix && key.startsWith(prefix) || gt && key > gt || gte && key >= gte || !prefix && !gt && !gte) {
|
12969
|
+
yield [key, entry[1]];
|
11514
12970
|
}
|
11515
|
-
yield [key, entry[1]];
|
11516
12971
|
}
|
11517
12972
|
}
|
11518
12973
|
}(rshard)
|
@@ -11530,9 +12985,9 @@ You can use close({ resize: true }) to resize header`);
|
|
11530
12985
|
return [shard];
|
11531
12986
|
};
|
11532
12987
|
|
11533
|
-
// ../../node_modules/.pnpm/@web3-storage+pail@0.
|
12988
|
+
// ../../node_modules/.pnpm/@web3-storage+pail@0.5.0/node_modules/@web3-storage/pail/src/batch/shard.js
|
11534
12989
|
var ShardLinkByteLength = 36;
|
11535
|
-
var CID_TAG3 = new
|
12990
|
+
var CID_TAG3 = new Token2(Type2.tag, 42);
|
11536
12991
|
var create8 = (init2) => ({
|
11537
12992
|
base: init2?.base,
|
11538
12993
|
prefix: init2?.prefix ?? "",
|
@@ -11545,39 +13000,39 @@ You can use close({ resize: true }) to resize header`);
|
|
11545
13000
|
entriesLength += entryEncodedLength(entry);
|
11546
13001
|
}
|
11547
13002
|
const tokens = [
|
11548
|
-
new
|
11549
|
-
new
|
11550
|
-
new
|
11551
|
-
new
|
11552
|
-
new
|
11553
|
-
new
|
11554
|
-
new
|
13003
|
+
new Token2(Type2.map, 3),
|
13004
|
+
new Token2(Type2.string, "entries"),
|
13005
|
+
new Token2(Type2.array, shard.entries.length),
|
13006
|
+
new Token2(Type2.string, "maxKeyLength"),
|
13007
|
+
new Token2(Type2.uint, shard.maxKeyLength),
|
13008
|
+
new Token2(Type2.string, "maxSize"),
|
13009
|
+
new Token2(Type2.uint, shard.maxSize)
|
11555
13010
|
];
|
11556
|
-
return
|
13011
|
+
return tokensToLength2(tokens) + entriesLength;
|
11557
13012
|
};
|
11558
13013
|
var entryEncodedLength = (entry) => {
|
11559
13014
|
const tokens = [
|
11560
|
-
new
|
11561
|
-
new
|
13015
|
+
new Token2(Type2.array, entry.length),
|
13016
|
+
new Token2(Type2.string, entry[0])
|
11562
13017
|
];
|
11563
13018
|
if (Array.isArray(entry[1])) {
|
11564
|
-
tokens.push(new
|
13019
|
+
tokens.push(new Token2(Type2.array, entry[1].length));
|
11565
13020
|
for (const item of entry[1]) {
|
11566
13021
|
tokens.push(CID_TAG3);
|
11567
13022
|
if (isLink(item)) {
|
11568
|
-
tokens.push(new
|
13023
|
+
tokens.push(new Token2(Type2.bytes, { length: item.byteLength + 1 }));
|
11569
13024
|
} else {
|
11570
|
-
tokens.push(new
|
13025
|
+
tokens.push(new Token2(Type2.bytes, { length: ShardLinkByteLength + 1 }));
|
11571
13026
|
}
|
11572
13027
|
}
|
11573
13028
|
} else {
|
11574
13029
|
tokens.push(CID_TAG3);
|
11575
|
-
tokens.push(new
|
13030
|
+
tokens.push(new Token2(Type2.bytes, { length: entry[1].byteLength + 1 }));
|
11576
13031
|
}
|
11577
|
-
return
|
13032
|
+
return tokensToLength2(tokens);
|
11578
13033
|
};
|
11579
13034
|
|
11580
|
-
// ../../node_modules/.pnpm/@web3-storage+pail@0.
|
13035
|
+
// ../../node_modules/.pnpm/@web3-storage+pail@0.5.0/node_modules/@web3-storage/pail/src/batch/index.js
|
11581
13036
|
var Batcher = class _Batcher {
|
11582
13037
|
#committed = false;
|
11583
13038
|
/**
|
@@ -11759,7 +13214,7 @@ You can use close({ resize: true }) to resize header`);
|
|
11759
13214
|
static code = "ERR_BATCH_COMMITTED";
|
11760
13215
|
};
|
11761
13216
|
|
11762
|
-
// ../../node_modules/.pnpm/@web3-storage+pail@0.
|
13217
|
+
// ../../node_modules/.pnpm/@web3-storage+pail@0.5.0/node_modules/@web3-storage/pail/src/crdt/index.js
|
11763
13218
|
var put3 = async (blocks, head, key, value) => {
|
11764
13219
|
const mblocks = new MemoryBlockstore();
|
11765
13220
|
blocks = new MultiBlockFetcher(mblocks, blocks);
|
@@ -11997,7 +13452,7 @@ You can use close({ resize: true }) to resize header`);
|
|
11997
13452
|
return acc.concat(...rest);
|
11998
13453
|
};
|
11999
13454
|
|
12000
|
-
// ../../node_modules/.pnpm/@web3-storage+pail@0.
|
13455
|
+
// ../../node_modules/.pnpm/@web3-storage+pail@0.5.0/node_modules/@web3-storage/pail/src/crdt/batch/index.js
|
12001
13456
|
var Batcher2 = class _Batcher {
|
12002
13457
|
#committed = false;
|
12003
13458
|
/**
|
@@ -12138,9 +13593,9 @@ You can use close({ resize: true }) to resize header`);
|
|
12138
13593
|
createSymlink: () => createSymlink,
|
12139
13594
|
cumulativeContentByteLength: () => cumulativeContentByteLength,
|
12140
13595
|
cumulativeDagByteLength: () => cumulativeDagByteLength,
|
12141
|
-
decode: () =>
|
13596
|
+
decode: () => decode17,
|
12142
13597
|
decodeMetadata: () => decodeMetadata,
|
12143
|
-
encode: () =>
|
13598
|
+
encode: () => encode13,
|
12144
13599
|
encodeAdvancedFile: () => encodeAdvancedFile,
|
12145
13600
|
encodeComplexFile: () => encodeComplexFile,
|
12146
13601
|
encodeDirectory: () => encodeDirectory,
|
@@ -12161,7 +13616,7 @@ You can use close({ resize: true }) to resize header`);
|
|
12161
13616
|
});
|
12162
13617
|
|
12163
13618
|
// ../../node_modules/.pnpm/@ipld+dag-pb@4.0.8/node_modules/@ipld/dag-pb/src/pb-decode.js
|
12164
|
-
var
|
13619
|
+
var textDecoder3 = new TextDecoder();
|
12165
13620
|
function decodeVarint2(bytes, offset) {
|
12166
13621
|
let v = 0;
|
12167
13622
|
for (let shift = 0; ; shift += 7) {
|
@@ -12229,7 +13684,7 @@ You can use close({ resize: true }) to resize header`);
|
|
12229
13684
|
}
|
12230
13685
|
let byts;
|
12231
13686
|
[byts, index2] = decodeBytes(bytes, index2);
|
12232
|
-
link2.Name =
|
13687
|
+
link2.Name = textDecoder3.decode(byts);
|
12233
13688
|
} else if (fieldNum === 3) {
|
12234
13689
|
if (link2.Tsize !== void 0) {
|
12235
13690
|
throw new Error("protobuf: (PBLink) duplicate Tsize section");
|
@@ -12292,7 +13747,7 @@ You can use close({ resize: true }) to resize header`);
|
|
12292
13747
|
}
|
12293
13748
|
|
12294
13749
|
// ../../node_modules/.pnpm/@ipld+dag-pb@4.0.8/node_modules/@ipld/dag-pb/src/pb-encode.js
|
12295
|
-
var
|
13750
|
+
var textEncoder3 = new TextEncoder();
|
12296
13751
|
var maxInt32 = 2 ** 32;
|
12297
13752
|
var maxUInt32 = 2 ** 31;
|
12298
13753
|
function encodeLink(link2, bytes) {
|
@@ -12308,7 +13763,7 @@ You can use close({ resize: true }) to resize header`);
|
|
12308
13763
|
bytes[i] = 24;
|
12309
13764
|
}
|
12310
13765
|
if (typeof link2.Name === "string") {
|
12311
|
-
const nameBytes =
|
13766
|
+
const nameBytes = textEncoder3.encode(link2.Name);
|
12312
13767
|
i -= nameBytes.length;
|
12313
13768
|
bytes.set(nameBytes, i);
|
12314
13769
|
i = encodeVarint(bytes, i, nameBytes.length) - 1;
|
@@ -12349,7 +13804,7 @@ You can use close({ resize: true }) to resize header`);
|
|
12349
13804
|
n += 1 + l + sov(l);
|
12350
13805
|
}
|
12351
13806
|
if (typeof link2.Name === "string") {
|
12352
|
-
const l =
|
13807
|
+
const l = textEncoder3.encode(link2.Name).length;
|
12353
13808
|
n += 1 + l + sov(l);
|
12354
13809
|
}
|
12355
13810
|
if (typeof link2.Tsize === "number") {
|
@@ -12669,13 +14124,13 @@ You can use close({ resize: true }) to resize header`);
|
|
12669
14124
|
// ../../node_modules/.pnpm/@ipld+dag-pb@4.0.8/node_modules/@ipld/dag-pb/src/util.js
|
12670
14125
|
var pbNodeProperties = ["Data", "Links"];
|
12671
14126
|
var pbLinkProperties = ["Hash", "Name", "Tsize"];
|
12672
|
-
var
|
14127
|
+
var textEncoder4 = new TextEncoder();
|
12673
14128
|
function linkComparator(a, b) {
|
12674
14129
|
if (a === b) {
|
12675
14130
|
return 0;
|
12676
14131
|
}
|
12677
|
-
const abuf = a.Name ?
|
12678
|
-
const bbuf = b.Name ?
|
14132
|
+
const abuf = a.Name ? textEncoder4.encode(a.Name) : [];
|
14133
|
+
const bbuf = b.Name ? textEncoder4.encode(b.Name) : [];
|
12679
14134
|
let x = abuf.length;
|
12680
14135
|
let y = bbuf.length;
|
12681
14136
|
for (let i = 0, len = Math.min(x, y); i < len; ++i) {
|
@@ -12740,7 +14195,7 @@ You can use close({ resize: true }) to resize header`);
|
|
12740
14195
|
const pbn = {};
|
12741
14196
|
if (node.Data !== void 0) {
|
12742
14197
|
if (typeof node.Data === "string") {
|
12743
|
-
pbn.Data =
|
14198
|
+
pbn.Data = textEncoder4.encode(node.Data);
|
12744
14199
|
} else if (node.Data instanceof Uint8Array) {
|
12745
14200
|
pbn.Data = node.Data;
|
12746
14201
|
} else {
|
@@ -12805,7 +14260,7 @@ You can use close({ resize: true }) to resize header`);
|
|
12805
14260
|
|
12806
14261
|
// ../../node_modules/.pnpm/@ipld+dag-pb@4.0.8/node_modules/@ipld/dag-pb/src/index.js
|
12807
14262
|
var code3 = 112;
|
12808
|
-
function
|
14263
|
+
function encode12(node) {
|
12809
14264
|
validate(node);
|
12810
14265
|
const pbn = {};
|
12811
14266
|
if (node.Links) {
|
@@ -12828,7 +14283,7 @@ You can use close({ resize: true }) to resize header`);
|
|
12828
14283
|
}
|
12829
14284
|
return encodeNode(pbn);
|
12830
14285
|
}
|
12831
|
-
function
|
14286
|
+
function decode16(bytes) {
|
12832
14287
|
const pbn = decodeNode(bytes);
|
12833
14288
|
const node = {};
|
12834
14289
|
if (pbn.Data) {
|
@@ -12879,7 +14334,7 @@ You can use close({ resize: true }) to resize header`);
|
|
12879
14334
|
Data3.prototype.fanout = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;
|
12880
14335
|
Data3.prototype.mode = 0;
|
12881
14336
|
Data3.prototype.mtime = null;
|
12882
|
-
Data3.encode = function
|
14337
|
+
Data3.encode = function encode20(m, w) {
|
12883
14338
|
if (!w)
|
12884
14339
|
w = $Writer.create();
|
12885
14340
|
w.uint32(8).int32(m.Type);
|
@@ -12901,7 +14356,7 @@ You can use close({ resize: true }) to resize header`);
|
|
12901
14356
|
$root.UnixTime.encode(m.mtime, w.uint32(66).fork()).ldelim();
|
12902
14357
|
return w;
|
12903
14358
|
};
|
12904
|
-
Data3.decode = function
|
14359
|
+
Data3.decode = function decode24(r, l) {
|
12905
14360
|
if (!(r instanceof $Reader))
|
12906
14361
|
r = $Reader.create(r);
|
12907
14362
|
var c = l === void 0 ? r.len : r.pos + l, m = new $root.Data();
|
@@ -13139,7 +14594,7 @@ You can use close({ resize: true }) to resize header`);
|
|
13139
14594
|
}
|
13140
14595
|
UnixTime3.prototype.Seconds = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
13141
14596
|
UnixTime3.prototype.FractionalNanoseconds = 0;
|
13142
|
-
UnixTime3.encode = function
|
14597
|
+
UnixTime3.encode = function encode20(m, w) {
|
13143
14598
|
if (!w)
|
13144
14599
|
w = $Writer.create();
|
13145
14600
|
w.uint32(8).int64(m.Seconds);
|
@@ -13147,7 +14602,7 @@ You can use close({ resize: true }) to resize header`);
|
|
13147
14602
|
w.uint32(21).fixed32(m.FractionalNanoseconds);
|
13148
14603
|
return w;
|
13149
14604
|
};
|
13150
|
-
UnixTime3.decode = function
|
14605
|
+
UnixTime3.decode = function decode24(r, l) {
|
13151
14606
|
if (!(r instanceof $Reader))
|
13152
14607
|
r = $Reader.create(r);
|
13153
14608
|
var c = l === void 0 ? r.len : r.pos + l, m = new $root.UnixTime();
|
@@ -13225,14 +14680,14 @@ You can use close({ resize: true }) to resize header`);
|
|
13225
14680
|
}
|
13226
14681
|
}
|
13227
14682
|
Metadata3.prototype.MimeType = "";
|
13228
|
-
Metadata3.encode = function
|
14683
|
+
Metadata3.encode = function encode20(m, w) {
|
13229
14684
|
if (!w)
|
13230
14685
|
w = $Writer.create();
|
13231
14686
|
if (m.MimeType != null && Object.hasOwnProperty.call(m, "MimeType"))
|
13232
14687
|
w.uint32(10).string(m.MimeType);
|
13233
14688
|
return w;
|
13234
14689
|
};
|
13235
|
-
Metadata3.decode = function
|
14690
|
+
Metadata3.decode = function decode24(r, l) {
|
13236
14691
|
if (!(r instanceof $Reader))
|
13237
14692
|
r = $Reader.create(r);
|
13238
14693
|
var c = l === void 0 ? r.len : r.pos + l, m = new $root.Metadata();
|
@@ -13289,7 +14744,7 @@ You can use close({ resize: true }) to resize header`);
|
|
13289
14744
|
var name3 = "UnixFS";
|
13290
14745
|
var encodePB = (data, links3) => {
|
13291
14746
|
Object(globalThis).debug && console.log({ data, links: links3 });
|
13292
|
-
return
|
14747
|
+
return encode12(
|
13293
14748
|
// We run through prepare as links need to be sorted by name which it will
|
13294
14749
|
// do.
|
13295
14750
|
prepare({
|
@@ -13483,7 +14938,7 @@ You can use close({ resize: true }) to resize header`);
|
|
13483
14938
|
[]
|
13484
14939
|
);
|
13485
14940
|
};
|
13486
|
-
var
|
14941
|
+
var encode13 = (node, root2 = true) => {
|
13487
14942
|
switch (node.type) {
|
13488
14943
|
case NodeType.Raw:
|
13489
14944
|
return encodeRaw(node.content);
|
@@ -13499,8 +14954,8 @@ You can use close({ resize: true }) to resize header`);
|
|
13499
14954
|
throw new Error(`Unknown node type ${Object(node).type}`);
|
13500
14955
|
}
|
13501
14956
|
};
|
13502
|
-
var
|
13503
|
-
const pb =
|
14957
|
+
var decode17 = (bytes) => {
|
14958
|
+
const pb = decode16(bytes);
|
13504
14959
|
const message2 = Data.decode(
|
13505
14960
|
/** @type {Uint8Array} */
|
13506
14961
|
pb.Data
|
@@ -14312,19 +15767,19 @@ You can use close({ resize: true }) to resize header`);
|
|
14312
15767
|
|
14313
15768
|
// ../../node_modules/.pnpm/@ipld+unixfs@2.1.2/node_modules/@ipld/unixfs/src/file/chunker/buffer.js
|
14314
15769
|
var empty3 = () => new BufferView();
|
14315
|
-
var
|
15770
|
+
var slice3 = (buffer3, startOffset = 0, endOffset = buffer3.byteLength) => {
|
14316
15771
|
const segments = [];
|
14317
|
-
const start = startOffset < 0 ?
|
14318
|
-
const end = endOffset < 0 ?
|
14319
|
-
if (start === 0 && end >=
|
14320
|
-
return
|
15772
|
+
const start = startOffset < 0 ? buffer3.byteLength - startOffset : startOffset;
|
15773
|
+
const end = endOffset < 0 ? buffer3.byteLength - endOffset : endOffset;
|
15774
|
+
if (start === 0 && end >= buffer3.byteLength) {
|
15775
|
+
return buffer3;
|
14321
15776
|
}
|
14322
|
-
if (start > end || start >
|
15777
|
+
if (start > end || start > buffer3.byteLength || end <= 0) {
|
14323
15778
|
return empty3();
|
14324
15779
|
}
|
14325
15780
|
let byteLength = 0;
|
14326
15781
|
let offset = 0;
|
14327
|
-
for (const segment of
|
15782
|
+
for (const segment of buffer3.segments) {
|
14328
15783
|
const nextOffset = offset + segment.byteLength;
|
14329
15784
|
if (byteLength === 0) {
|
14330
15785
|
if (end <= nextOffset) {
|
@@ -14348,24 +15803,24 @@ You can use close({ resize: true }) to resize header`);
|
|
14348
15803
|
}
|
14349
15804
|
offset = nextOffset;
|
14350
15805
|
}
|
14351
|
-
return new BufferView(segments,
|
15806
|
+
return new BufferView(segments, buffer3.byteOffset + start, byteLength);
|
14352
15807
|
};
|
14353
|
-
var push = (
|
15808
|
+
var push = (buffer3, part) => {
|
14354
15809
|
if (part.byteLength > 0) {
|
14355
|
-
|
15810
|
+
buffer3.segments.push(part);
|
14356
15811
|
return new BufferView(
|
14357
|
-
|
14358
|
-
|
14359
|
-
|
15812
|
+
buffer3.segments,
|
15813
|
+
buffer3.byteOffset,
|
15814
|
+
buffer3.byteLength + part.byteLength
|
14360
15815
|
);
|
14361
15816
|
} else {
|
14362
|
-
return
|
15817
|
+
return buffer3;
|
14363
15818
|
}
|
14364
15819
|
};
|
14365
|
-
var get4 = (
|
14366
|
-
if (n <
|
15820
|
+
var get4 = (buffer3, n) => {
|
15821
|
+
if (n < buffer3.byteLength) {
|
14367
15822
|
let offset = 0;
|
14368
|
-
for (const segment of
|
15823
|
+
for (const segment of buffer3.segments) {
|
14369
15824
|
if (n < offset + segment.byteLength) {
|
14370
15825
|
return segment[n - offset];
|
14371
15826
|
} else {
|
@@ -14375,16 +15830,16 @@ You can use close({ resize: true }) to resize header`);
|
|
14375
15830
|
}
|
14376
15831
|
return void 0;
|
14377
15832
|
};
|
14378
|
-
var copyTo = (
|
15833
|
+
var copyTo = (buffer3, target, byteOffset) => {
|
14379
15834
|
let offset = byteOffset;
|
14380
|
-
for (const segment of
|
15835
|
+
for (const segment of buffer3.segments) {
|
14381
15836
|
target.set(segment, offset);
|
14382
15837
|
offset += segment.byteLength;
|
14383
15838
|
}
|
14384
15839
|
return target;
|
14385
15840
|
};
|
14386
|
-
function* iterate(
|
14387
|
-
for (const part of
|
15841
|
+
function* iterate(buffer3) {
|
15842
|
+
for (const part of buffer3.segments) {
|
14388
15843
|
yield* part;
|
14389
15844
|
}
|
14390
15845
|
}
|
@@ -14411,7 +15866,7 @@ You can use close({ resize: true }) to resize header`);
|
|
14411
15866
|
slice(start, end) {
|
14412
15867
|
return (
|
14413
15868
|
/** @type {BufferView} */
|
14414
|
-
|
15869
|
+
slice3(this, start, end)
|
14415
15870
|
);
|
14416
15871
|
}
|
14417
15872
|
/**
|
@@ -14421,7 +15876,7 @@ You can use close({ resize: true }) to resize header`);
|
|
14421
15876
|
subarray(start, end) {
|
14422
15877
|
return (
|
14423
15878
|
/** @type {BufferView} */
|
14424
|
-
|
15879
|
+
slice3(this, start, end)
|
14425
15880
|
);
|
14426
15881
|
}
|
14427
15882
|
/**
|
@@ -14465,18 +15920,18 @@ You can use close({ resize: true }) to resize header`);
|
|
14465
15920
|
});
|
14466
15921
|
var write = (state, bytes) => bytes.byteLength > 0 ? split(state.config, state.buffer.push(bytes), false) : { ...state, chunks: EMPTY2 };
|
14467
15922
|
var close2 = (state) => split(state.config, state.buffer, true);
|
14468
|
-
var split = (config2,
|
15923
|
+
var split = (config2, buffer3, end) => {
|
14469
15924
|
const chunker3 = config2.chunker;
|
14470
15925
|
const chunks = [];
|
14471
15926
|
let offset = 0;
|
14472
|
-
for (const size of chunker3.cut(chunker3.context,
|
15927
|
+
for (const size of chunker3.cut(chunker3.context, buffer3, end)) {
|
14473
15928
|
if (size > 0) {
|
14474
|
-
const chunk =
|
15929
|
+
const chunk = buffer3.subarray(offset, offset + size);
|
14475
15930
|
chunks.push(chunk);
|
14476
15931
|
offset += size;
|
14477
15932
|
}
|
14478
15933
|
}
|
14479
|
-
return { config: config2, chunks, buffer:
|
15934
|
+
return { config: config2, chunks, buffer: buffer3.subarray(offset) };
|
14480
15935
|
};
|
14481
15936
|
|
14482
15937
|
// ../../node_modules/.pnpm/@ipld+unixfs@2.1.2/node_modules/@ipld/unixfs/src/file/layout/queue.js
|
@@ -14789,7 +16244,7 @@ You can use close({ resize: true }) to resize header`);
|
|
14789
16244
|
}
|
14790
16245
|
writer.write(block);
|
14791
16246
|
};
|
14792
|
-
var asUint8Array = (
|
16247
|
+
var asUint8Array = (buffer3) => buffer3 instanceof Uint8Array ? buffer3 : buffer3.copyTo(new Uint8Array(buffer3.byteLength), 0);
|
14793
16248
|
var isLeafNode = (node) => node.children == null;
|
14794
16249
|
|
14795
16250
|
// ../../node_modules/.pnpm/@ipld+unixfs@2.1.2/node_modules/@ipld/unixfs/src/file/chunker/fixed.js
|
@@ -14849,12 +16304,12 @@ You can use close({ resize: true }) to resize header`);
|
|
14849
16304
|
};
|
14850
16305
|
|
14851
16306
|
// ../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/vendor/varint.js
|
14852
|
-
var encode_13 =
|
16307
|
+
var encode_13 = encode14;
|
14853
16308
|
var MSB3 = 128;
|
14854
16309
|
var REST3 = 127;
|
14855
16310
|
var MSBALL3 = ~REST3;
|
14856
16311
|
var INT3 = Math.pow(2, 31);
|
14857
|
-
function
|
16312
|
+
function encode14(num, out, offset) {
|
14858
16313
|
out = out || [];
|
14859
16314
|
offset = offset || 0;
|
14860
16315
|
var oldOffset = offset;
|
@@ -14867,20 +16322,20 @@ You can use close({ resize: true }) to resize header`);
|
|
14867
16322
|
num >>>= 7;
|
14868
16323
|
}
|
14869
16324
|
out[offset] = num | 0;
|
14870
|
-
|
16325
|
+
encode14.bytes = offset - oldOffset + 1;
|
14871
16326
|
return out;
|
14872
16327
|
}
|
14873
|
-
var
|
16328
|
+
var decode18 = read3;
|
14874
16329
|
var MSB$13 = 128;
|
14875
16330
|
var REST$13 = 127;
|
14876
|
-
function read3(
|
14877
|
-
var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l =
|
16331
|
+
function read3(buf3, offset) {
|
16332
|
+
var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf3.length;
|
14878
16333
|
do {
|
14879
16334
|
if (counter >= l) {
|
14880
16335
|
read3.bytes = 0;
|
14881
16336
|
throw new RangeError("Could not decode varint");
|
14882
16337
|
}
|
14883
|
-
b =
|
16338
|
+
b = buf3[counter++];
|
14884
16339
|
res += shift < 28 ? (b & REST$13) << shift : (b & REST$13) * Math.pow(2, shift);
|
14885
16340
|
shift += 7;
|
14886
16341
|
} while (b >= MSB$13);
|
@@ -14901,14 +16356,14 @@ You can use close({ resize: true }) to resize header`);
|
|
14901
16356
|
};
|
14902
16357
|
var varint6 = {
|
14903
16358
|
encode: encode_13,
|
14904
|
-
decode:
|
16359
|
+
decode: decode18,
|
14905
16360
|
encodingLength: length3
|
14906
16361
|
};
|
14907
16362
|
var _brrp_varint3 = varint6;
|
14908
16363
|
var varint_default3 = _brrp_varint3;
|
14909
16364
|
|
14910
16365
|
// ../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/varint.js
|
14911
|
-
var
|
16366
|
+
var decode19 = (data, offset = 0) => {
|
14912
16367
|
const code8 = varint_default3.decode(data, offset);
|
14913
16368
|
return [code8, varint_default3.decode.bytes];
|
14914
16369
|
};
|
@@ -14931,10 +16386,10 @@ You can use close({ resize: true }) to resize header`);
|
|
14931
16386
|
bytes.set(digest3, digestOffset);
|
14932
16387
|
return new Digest3(code8, size, digest3, bytes);
|
14933
16388
|
};
|
14934
|
-
var
|
16389
|
+
var decode20 = (multihash) => {
|
14935
16390
|
const bytes = coerce3(multihash);
|
14936
|
-
const [code8, sizeOffset] =
|
14937
|
-
const [size, digestOffset] =
|
16391
|
+
const [code8, sizeOffset] = decode19(bytes);
|
16392
|
+
const [size, digestOffset] = decode19(bytes.subarray(sizeOffset));
|
14938
16393
|
const digest3 = bytes.subarray(sizeOffset + digestOffset);
|
14939
16394
|
if (digest3.byteLength !== size) {
|
14940
16395
|
throw new Error("Incorrect length");
|
@@ -14970,7 +16425,7 @@ You can use close({ resize: true }) to resize header`);
|
|
14970
16425
|
};
|
14971
16426
|
|
14972
16427
|
// ../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/hashes/hasher.js
|
14973
|
-
var from5 = ({ name: name7, code: code8, encode:
|
16428
|
+
var from5 = ({ name: name7, code: code8, encode: encode20 }) => new Hasher3(name7, code8, encode20);
|
14974
16429
|
var Hasher3 = class {
|
14975
16430
|
/**
|
14976
16431
|
*
|
@@ -14978,10 +16433,10 @@ You can use close({ resize: true }) to resize header`);
|
|
14978
16433
|
* @param {Code} code
|
14979
16434
|
* @param {(input: Uint8Array) => Await<Uint8Array>} encode
|
14980
16435
|
*/
|
14981
|
-
constructor(name7, code8,
|
16436
|
+
constructor(name7, code8, encode20) {
|
14982
16437
|
this.name = name7;
|
14983
16438
|
this.code = code8;
|
14984
|
-
this.encode =
|
16439
|
+
this.encode = encode20;
|
14985
16440
|
}
|
14986
16441
|
/**
|
14987
16442
|
* @param {Uint8Array} input
|
@@ -15036,7 +16491,7 @@ You can use close({ resize: true }) to resize header`);
|
|
15036
16491
|
var LEADER = ALPHABET.charAt(0);
|
15037
16492
|
var FACTOR = Math.log(BASE) / Math.log(256);
|
15038
16493
|
var iFACTOR = Math.log(256) / Math.log(BASE);
|
15039
|
-
function
|
16494
|
+
function encode20(source) {
|
15040
16495
|
if (source instanceof Uint8Array)
|
15041
16496
|
;
|
15042
16497
|
else if (ArrayBuffer.isView(source)) {
|
@@ -15134,17 +16589,17 @@ You can use close({ resize: true }) to resize header`);
|
|
15134
16589
|
}
|
15135
16590
|
return vch;
|
15136
16591
|
}
|
15137
|
-
function
|
15138
|
-
var
|
15139
|
-
if (
|
15140
|
-
return
|
16592
|
+
function decode24(string3) {
|
16593
|
+
var buffer3 = decodeUnsafe(string3);
|
16594
|
+
if (buffer3) {
|
16595
|
+
return buffer3;
|
15141
16596
|
}
|
15142
16597
|
throw new Error(`Non-${name7} character`);
|
15143
16598
|
}
|
15144
16599
|
return {
|
15145
|
-
encode:
|
16600
|
+
encode: encode20,
|
15146
16601
|
decodeUnsafe,
|
15147
|
-
decode:
|
16602
|
+
decode: decode24
|
15148
16603
|
};
|
15149
16604
|
}
|
15150
16605
|
var src3 = base3;
|
@@ -15286,20 +16741,20 @@ You can use close({ resize: true }) to resize header`);
|
|
15286
16741
|
return this.decoder.decode(input);
|
15287
16742
|
}
|
15288
16743
|
};
|
15289
|
-
var from6 = ({ name: name7, prefix, encode:
|
16744
|
+
var from6 = ({ name: name7, prefix, encode: encode20, decode: decode24 }) => new Codec3(name7, prefix, encode20, decode24);
|
15290
16745
|
var baseX3 = ({ prefix, name: name7, alphabet: alphabet3 }) => {
|
15291
|
-
const { encode:
|
16746
|
+
const { encode: encode20, decode: decode24 } = base_x_default3(alphabet3, name7);
|
15292
16747
|
return from6({
|
15293
16748
|
prefix,
|
15294
16749
|
name: name7,
|
15295
|
-
encode:
|
16750
|
+
encode: encode20,
|
15296
16751
|
/**
|
15297
16752
|
* @param {string} text
|
15298
16753
|
*/
|
15299
|
-
decode: (text) => coerce3(
|
16754
|
+
decode: (text) => coerce3(decode24(text))
|
15300
16755
|
});
|
15301
16756
|
};
|
15302
|
-
var
|
16757
|
+
var decode21 = (string3, alphabet3, bitsPerChar, name7) => {
|
15303
16758
|
const codes = {};
|
15304
16759
|
for (let i = 0; i < alphabet3.length; ++i) {
|
15305
16760
|
codes[alphabet3[i]] = i;
|
@@ -15310,41 +16765,41 @@ You can use close({ resize: true }) to resize header`);
|
|
15310
16765
|
}
|
15311
16766
|
const out = new Uint8Array(end * bitsPerChar / 8 | 0);
|
15312
16767
|
let bits = 0;
|
15313
|
-
let
|
16768
|
+
let buffer3 = 0;
|
15314
16769
|
let written = 0;
|
15315
16770
|
for (let i = 0; i < end; ++i) {
|
15316
16771
|
const value = codes[string3[i]];
|
15317
16772
|
if (value === void 0) {
|
15318
16773
|
throw new SyntaxError(`Non-${name7} character`);
|
15319
16774
|
}
|
15320
|
-
|
16775
|
+
buffer3 = buffer3 << bitsPerChar | value;
|
15321
16776
|
bits += bitsPerChar;
|
15322
16777
|
if (bits >= 8) {
|
15323
16778
|
bits -= 8;
|
15324
|
-
out[written++] = 255 &
|
16779
|
+
out[written++] = 255 & buffer3 >> bits;
|
15325
16780
|
}
|
15326
16781
|
}
|
15327
|
-
if (bits >= bitsPerChar || 255 &
|
16782
|
+
if (bits >= bitsPerChar || 255 & buffer3 << 8 - bits) {
|
15328
16783
|
throw new SyntaxError("Unexpected end of data");
|
15329
16784
|
}
|
15330
16785
|
return out;
|
15331
16786
|
};
|
15332
|
-
var
|
16787
|
+
var encode15 = (data, alphabet3, bitsPerChar) => {
|
15333
16788
|
const pad = alphabet3[alphabet3.length - 1] === "=";
|
15334
16789
|
const mask = (1 << bitsPerChar) - 1;
|
15335
16790
|
let out = "";
|
15336
16791
|
let bits = 0;
|
15337
|
-
let
|
16792
|
+
let buffer3 = 0;
|
15338
16793
|
for (let i = 0; i < data.length; ++i) {
|
15339
|
-
|
16794
|
+
buffer3 = buffer3 << 8 | data[i];
|
15340
16795
|
bits += 8;
|
15341
16796
|
while (bits > bitsPerChar) {
|
15342
16797
|
bits -= bitsPerChar;
|
15343
|
-
out += alphabet3[mask &
|
16798
|
+
out += alphabet3[mask & buffer3 >> bits];
|
15344
16799
|
}
|
15345
16800
|
}
|
15346
16801
|
if (bits) {
|
15347
|
-
out += alphabet3[mask &
|
16802
|
+
out += alphabet3[mask & buffer3 << bitsPerChar - bits];
|
15348
16803
|
}
|
15349
16804
|
if (pad) {
|
15350
16805
|
while (out.length * bitsPerChar & 7) {
|
@@ -15358,10 +16813,10 @@ You can use close({ resize: true }) to resize header`);
|
|
15358
16813
|
prefix,
|
15359
16814
|
name: name7,
|
15360
16815
|
encode(input) {
|
15361
|
-
return
|
16816
|
+
return encode15(input, alphabet3, bitsPerChar);
|
15362
16817
|
},
|
15363
16818
|
decode(input) {
|
15364
|
-
return
|
16819
|
+
return decode21(input, alphabet3, bitsPerChar, name7);
|
15365
16820
|
}
|
15366
16821
|
});
|
15367
16822
|
};
|
@@ -15640,7 +17095,7 @@ You can use close({ resize: true }) to resize header`);
|
|
15640
17095
|
const { version, multihash, code: code8 } = value;
|
15641
17096
|
const digest3 = (
|
15642
17097
|
/** @type {API.MultihashDigest<Alg>} */
|
15643
|
-
|
17098
|
+
decode20(multihash)
|
15644
17099
|
);
|
15645
17100
|
return _CID.create(version, code8, digest3);
|
15646
17101
|
} else {
|
@@ -15791,7 +17246,7 @@ You can use close({ resize: true }) to resize header`);
|
|
15791
17246
|
static inspectBytes(initialBytes) {
|
15792
17247
|
let offset = 0;
|
15793
17248
|
const next = () => {
|
15794
|
-
const [i, length5] =
|
17249
|
+
const [i, length5] = decode19(initialBytes.subarray(offset));
|
15795
17250
|
offset += length5;
|
15796
17251
|
return i;
|
15797
17252
|
};
|
@@ -16474,11 +17929,11 @@ You can use close({ resize: true }) to resize header`);
|
|
16474
17929
|
});
|
16475
17930
|
var code6 = 0;
|
16476
17931
|
var name5 = "identity";
|
16477
|
-
var
|
17932
|
+
var encode16 = coerce2;
|
16478
17933
|
function digest(input) {
|
16479
|
-
return create2(code6,
|
17934
|
+
return create2(code6, encode16(input));
|
16480
17935
|
}
|
16481
|
-
var identity = { code: code6, name: name5, encode:
|
17936
|
+
var identity = { code: code6, name: name5, encode: encode16, digest };
|
16482
17937
|
|
16483
17938
|
// ../../node_modules/.pnpm/ipfs-unixfs-exporter@13.2.5/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js
|
16484
17939
|
var import_err_code = __toESM(require_err_code(), 1);
|
@@ -16600,13 +18055,13 @@ You can use close({ resize: true }) to resize header`);
|
|
16600
18055
|
var rawContent = (node) => {
|
16601
18056
|
async function* contentGenerator(options = {}) {
|
16602
18057
|
const { start, end } = validate_offset_and_length_default(node.length, options.offset, options.length);
|
16603
|
-
const
|
18058
|
+
const buf3 = extract_data_from_block_default(node, 0n, start, end);
|
16604
18059
|
options.onProgress?.(new CustomProgressEvent("unixfs:exporter:progress:identity", {
|
16605
|
-
bytesRead: BigInt(
|
18060
|
+
bytesRead: BigInt(buf3.byteLength),
|
16606
18061
|
totalBytes: end - start,
|
16607
18062
|
fileSize: BigInt(node.byteLength)
|
16608
18063
|
}));
|
16609
|
-
yield
|
18064
|
+
yield buf3;
|
16610
18065
|
}
|
16611
18066
|
return contentGenerator;
|
16612
18067
|
};
|
@@ -16614,17 +18069,17 @@ You can use close({ resize: true }) to resize header`);
|
|
16614
18069
|
if (toResolve.length > 0) {
|
16615
18070
|
throw (0, import_err_code3.default)(new Error(`No link named ${path} found in raw node ${cid}`), "ERR_NOT_FOUND");
|
16616
18071
|
}
|
16617
|
-
const
|
18072
|
+
const buf3 = decode9(cid.multihash.bytes);
|
16618
18073
|
return {
|
16619
18074
|
entry: {
|
16620
18075
|
type: "identity",
|
16621
18076
|
name: name7,
|
16622
18077
|
path,
|
16623
18078
|
cid,
|
16624
|
-
content: rawContent(
|
18079
|
+
content: rawContent(buf3.digest),
|
16625
18080
|
depth,
|
16626
|
-
size: BigInt(
|
16627
|
-
node:
|
18081
|
+
size: BigInt(buf3.digest.length),
|
18082
|
+
node: buf3.digest
|
16628
18083
|
}
|
16629
18084
|
};
|
16630
18085
|
};
|
@@ -16635,13 +18090,13 @@ You can use close({ resize: true }) to resize header`);
|
|
16635
18090
|
var rawContent2 = (node) => {
|
16636
18091
|
async function* contentGenerator(options = {}) {
|
16637
18092
|
const { start, end } = validate_offset_and_length_default(node.length, options.offset, options.length);
|
16638
|
-
const
|
18093
|
+
const buf3 = extract_data_from_block_default(node, 0n, start, end);
|
16639
18094
|
options.onProgress?.(new CustomProgressEvent("unixfs:exporter:progress:raw", {
|
16640
|
-
bytesRead: BigInt(
|
18095
|
+
bytesRead: BigInt(buf3.byteLength),
|
16641
18096
|
totalBytes: end - start,
|
16642
18097
|
fileSize: BigInt(node.byteLength)
|
16643
18098
|
}));
|
16644
|
-
yield
|
18099
|
+
yield buf3;
|
16645
18100
|
}
|
16646
18101
|
return contentGenerator;
|
16647
18102
|
};
|
@@ -16674,42 +18129,42 @@ You can use close({ resize: true }) to resize header`);
|
|
16674
18129
|
// ../../node_modules/.pnpm/protons-runtime@5.2.2/node_modules/protons-runtime/dist/src/utils/float.js
|
16675
18130
|
var f32 = new Float32Array([-0]);
|
16676
18131
|
var f8b = new Uint8Array(f32.buffer);
|
16677
|
-
function writeFloatLE(val,
|
18132
|
+
function writeFloatLE(val, buf3, pos) {
|
16678
18133
|
f32[0] = val;
|
16679
|
-
|
16680
|
-
|
16681
|
-
|
16682
|
-
|
16683
|
-
}
|
16684
|
-
function readFloatLE(
|
16685
|
-
f8b[0] =
|
16686
|
-
f8b[1] =
|
16687
|
-
f8b[2] =
|
16688
|
-
f8b[3] =
|
18134
|
+
buf3[pos] = f8b[0];
|
18135
|
+
buf3[pos + 1] = f8b[1];
|
18136
|
+
buf3[pos + 2] = f8b[2];
|
18137
|
+
buf3[pos + 3] = f8b[3];
|
18138
|
+
}
|
18139
|
+
function readFloatLE(buf3, pos) {
|
18140
|
+
f8b[0] = buf3[pos];
|
18141
|
+
f8b[1] = buf3[pos + 1];
|
18142
|
+
f8b[2] = buf3[pos + 2];
|
18143
|
+
f8b[3] = buf3[pos + 3];
|
16689
18144
|
return f32[0];
|
16690
18145
|
}
|
16691
18146
|
var f64 = new Float64Array([-0]);
|
16692
18147
|
var d8b = new Uint8Array(f64.buffer);
|
16693
|
-
function writeDoubleLE(val,
|
18148
|
+
function writeDoubleLE(val, buf3, pos) {
|
16694
18149
|
f64[0] = val;
|
16695
|
-
|
16696
|
-
|
16697
|
-
|
16698
|
-
|
16699
|
-
|
16700
|
-
|
16701
|
-
|
16702
|
-
|
16703
|
-
}
|
16704
|
-
function readDoubleLE(
|
16705
|
-
d8b[0] =
|
16706
|
-
d8b[1] =
|
16707
|
-
d8b[2] =
|
16708
|
-
d8b[3] =
|
16709
|
-
d8b[4] =
|
16710
|
-
d8b[5] =
|
16711
|
-
d8b[6] =
|
16712
|
-
d8b[7] =
|
18150
|
+
buf3[pos] = d8b[0];
|
18151
|
+
buf3[pos + 1] = d8b[1];
|
18152
|
+
buf3[pos + 2] = d8b[2];
|
18153
|
+
buf3[pos + 3] = d8b[3];
|
18154
|
+
buf3[pos + 4] = d8b[4];
|
18155
|
+
buf3[pos + 5] = d8b[5];
|
18156
|
+
buf3[pos + 6] = d8b[6];
|
18157
|
+
buf3[pos + 7] = d8b[7];
|
18158
|
+
}
|
18159
|
+
function readDoubleLE(buf3, pos) {
|
18160
|
+
d8b[0] = buf3[pos];
|
18161
|
+
d8b[1] = buf3[pos + 1];
|
18162
|
+
d8b[2] = buf3[pos + 2];
|
18163
|
+
d8b[3] = buf3[pos + 3];
|
18164
|
+
d8b[4] = buf3[pos + 4];
|
18165
|
+
d8b[5] = buf3[pos + 5];
|
18166
|
+
d8b[6] = buf3[pos + 6];
|
18167
|
+
d8b[7] = buf3[pos + 7];
|
16713
18168
|
return f64[0];
|
16714
18169
|
}
|
16715
18170
|
|
@@ -16887,7 +18342,7 @@ You can use close({ resize: true }) to resize header`);
|
|
16887
18342
|
}
|
16888
18343
|
return len;
|
16889
18344
|
}
|
16890
|
-
function read5(
|
18345
|
+
function read5(buffer3, start, end) {
|
16891
18346
|
const len = end - start;
|
16892
18347
|
if (len < 1) {
|
16893
18348
|
return "";
|
@@ -16897,17 +18352,17 @@ You can use close({ resize: true }) to resize header`);
|
|
16897
18352
|
let i = 0;
|
16898
18353
|
let t;
|
16899
18354
|
while (start < end) {
|
16900
|
-
t =
|
18355
|
+
t = buffer3[start++];
|
16901
18356
|
if (t < 128) {
|
16902
18357
|
chunk[i++] = t;
|
16903
18358
|
} else if (t > 191 && t < 224) {
|
16904
|
-
chunk[i++] = (t & 31) << 6 |
|
18359
|
+
chunk[i++] = (t & 31) << 6 | buffer3[start++] & 63;
|
16905
18360
|
} else if (t > 239 && t < 365) {
|
16906
|
-
t = ((t & 7) << 18 | (
|
18361
|
+
t = ((t & 7) << 18 | (buffer3[start++] & 63) << 12 | (buffer3[start++] & 63) << 6 | buffer3[start++] & 63) - 65536;
|
16907
18362
|
chunk[i++] = 55296 + (t >> 10);
|
16908
18363
|
chunk[i++] = 56320 + (t & 1023);
|
16909
18364
|
} else {
|
16910
|
-
chunk[i++] = (t & 15) << 12 | (
|
18365
|
+
chunk[i++] = (t & 15) << 12 | (buffer3[start++] & 63) << 6 | buffer3[start++] & 63;
|
16911
18366
|
}
|
16912
18367
|
if (i > 8191) {
|
16913
18368
|
(parts ?? (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
@@ -16922,28 +18377,28 @@ You can use close({ resize: true }) to resize header`);
|
|
16922
18377
|
}
|
16923
18378
|
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
16924
18379
|
}
|
16925
|
-
function write5(string3,
|
18380
|
+
function write5(string3, buffer3, offset) {
|
16926
18381
|
const start = offset;
|
16927
18382
|
let c1;
|
16928
18383
|
let c2;
|
16929
18384
|
for (let i = 0; i < string3.length; ++i) {
|
16930
18385
|
c1 = string3.charCodeAt(i);
|
16931
18386
|
if (c1 < 128) {
|
16932
|
-
|
18387
|
+
buffer3[offset++] = c1;
|
16933
18388
|
} else if (c1 < 2048) {
|
16934
|
-
|
16935
|
-
|
18389
|
+
buffer3[offset++] = c1 >> 6 | 192;
|
18390
|
+
buffer3[offset++] = c1 & 63 | 128;
|
16936
18391
|
} else if ((c1 & 64512) === 55296 && ((c2 = string3.charCodeAt(i + 1)) & 64512) === 56320) {
|
16937
18392
|
c1 = 65536 + ((c1 & 1023) << 10) + (c2 & 1023);
|
16938
18393
|
++i;
|
16939
|
-
|
16940
|
-
|
16941
|
-
|
16942
|
-
|
18394
|
+
buffer3[offset++] = c1 >> 18 | 240;
|
18395
|
+
buffer3[offset++] = c1 >> 12 & 63 | 128;
|
18396
|
+
buffer3[offset++] = c1 >> 6 & 63 | 128;
|
18397
|
+
buffer3[offset++] = c1 & 63 | 128;
|
16943
18398
|
} else {
|
16944
|
-
|
16945
|
-
|
16946
|
-
|
18399
|
+
buffer3[offset++] = c1 >> 12 | 224;
|
18400
|
+
buffer3[offset++] = c1 >> 6 & 63 | 128;
|
18401
|
+
buffer3[offset++] = c1 & 63 | 128;
|
16947
18402
|
}
|
16948
18403
|
}
|
16949
18404
|
return offset - start;
|
@@ -16953,18 +18408,18 @@ You can use close({ resize: true }) to resize header`);
|
|
16953
18408
|
function indexOutOfRange(reader, writeLength) {
|
16954
18409
|
return RangeError(`index out of range: ${reader.pos} + ${writeLength ?? 1} > ${reader.len}`);
|
16955
18410
|
}
|
16956
|
-
function readFixed32End(
|
16957
|
-
return (
|
18411
|
+
function readFixed32End(buf3, end) {
|
18412
|
+
return (buf3[end - 4] | buf3[end - 3] << 8 | buf3[end - 2] << 16 | buf3[end - 1] << 24) >>> 0;
|
16958
18413
|
}
|
16959
18414
|
var Uint8ArrayReader = class {
|
16960
18415
|
buf;
|
16961
18416
|
pos;
|
16962
18417
|
len;
|
16963
18418
|
_slice = Uint8Array.prototype.subarray;
|
16964
|
-
constructor(
|
16965
|
-
this.buf =
|
18419
|
+
constructor(buffer3) {
|
18420
|
+
this.buf = buffer3;
|
16966
18421
|
this.pos = 0;
|
16967
|
-
this.len =
|
18422
|
+
this.len = buffer3.length;
|
16968
18423
|
}
|
16969
18424
|
/**
|
16970
18425
|
* Reads a varint as an unsigned 32 bit value
|
@@ -17271,22 +18726,22 @@ You can use close({ resize: true }) to resize header`);
|
|
17271
18726
|
return this.readFixed64().toString();
|
17272
18727
|
}
|
17273
18728
|
};
|
17274
|
-
function createReader(
|
17275
|
-
return new Uint8ArrayReader(
|
18729
|
+
function createReader(buf3) {
|
18730
|
+
return new Uint8ArrayReader(buf3 instanceof Uint8Array ? buf3 : buf3.subarray());
|
17276
18731
|
}
|
17277
18732
|
|
17278
18733
|
// ../../node_modules/.pnpm/protons-runtime@5.2.2/node_modules/protons-runtime/dist/src/decode.js
|
17279
|
-
function decodeMessage(
|
17280
|
-
const reader = createReader(
|
18734
|
+
function decodeMessage(buf3, codec) {
|
18735
|
+
const reader = createReader(buf3);
|
17281
18736
|
return codec.decode(reader);
|
17282
18737
|
}
|
17283
18738
|
|
17284
18739
|
// ../../node_modules/.pnpm/uint8arrays@5.0.1/node_modules/uint8arrays/dist/src/util/as-uint8array.js
|
17285
|
-
function asUint8Array2(
|
18740
|
+
function asUint8Array2(buf3) {
|
17286
18741
|
if (globalThis.Buffer != null) {
|
17287
|
-
return new Uint8Array(
|
18742
|
+
return new Uint8Array(buf3.buffer, buf3.byteOffset, buf3.byteLength);
|
17288
18743
|
}
|
17289
|
-
return
|
18744
|
+
return buf3;
|
17290
18745
|
}
|
17291
18746
|
|
17292
18747
|
// ../../node_modules/.pnpm/uint8arrays@5.0.1/node_modules/uint8arrays/dist/src/alloc.js
|
@@ -17353,13 +18808,13 @@ You can use close({ resize: true }) to resize header`);
|
|
17353
18808
|
p[c.codePointAt(0)] = i;
|
17354
18809
|
return p;
|
17355
18810
|
}, []);
|
17356
|
-
function
|
18811
|
+
function encode17(data) {
|
17357
18812
|
return data.reduce((p, c) => {
|
17358
18813
|
p += alphabetBytesToChars[c];
|
17359
18814
|
return p;
|
17360
18815
|
}, "");
|
17361
18816
|
}
|
17362
|
-
function
|
18817
|
+
function decode22(str) {
|
17363
18818
|
const byts = [];
|
17364
18819
|
for (const char of str) {
|
17365
18820
|
const byt = alphabetCharsToBytes[char.codePointAt(0)];
|
@@ -17373,8 +18828,8 @@ You can use close({ resize: true }) to resize header`);
|
|
17373
18828
|
var base256emoji = from2({
|
17374
18829
|
prefix: "\u{1F680}",
|
17375
18830
|
name: "base256emoji",
|
17376
|
-
encode:
|
17377
|
-
decode:
|
18831
|
+
encode: encode17,
|
18832
|
+
decode: decode22
|
17378
18833
|
});
|
17379
18834
|
|
17380
18835
|
// ../../node_modules/.pnpm/multiformats@13.0.1/node_modules/multiformats/dist/src/bases/base36.js
|
@@ -17414,13 +18869,13 @@ You can use close({ resize: true }) to resize header`);
|
|
17414
18869
|
var identity2 = from2({
|
17415
18870
|
prefix: "\0",
|
17416
18871
|
name: "identity",
|
17417
|
-
encode: (
|
18872
|
+
encode: (buf3) => toString3(buf3),
|
17418
18873
|
decode: (str) => fromString3(str)
|
17419
18874
|
});
|
17420
18875
|
|
17421
18876
|
// ../../node_modules/.pnpm/multiformats@13.0.1/node_modules/multiformats/dist/src/codecs/json.js
|
17422
|
-
var
|
17423
|
-
var
|
18877
|
+
var textEncoder5 = new TextEncoder();
|
18878
|
+
var textDecoder4 = new TextDecoder();
|
17424
18879
|
|
17425
18880
|
// ../../node_modules/.pnpm/multiformats@13.0.1/node_modules/multiformats/dist/src/hashes/sha2-browser.js
|
17426
18881
|
var sha2_browser_exports2 = {};
|
@@ -17447,40 +18902,40 @@ You can use close({ resize: true }) to resize header`);
|
|
17447
18902
|
var hashes = { ...sha2_browser_exports2, ...identity_exports };
|
17448
18903
|
|
17449
18904
|
// ../../node_modules/.pnpm/uint8arrays@5.0.1/node_modules/uint8arrays/dist/src/util/bases.js
|
17450
|
-
function createCodec(name7, prefix,
|
18905
|
+
function createCodec(name7, prefix, encode20, decode24) {
|
17451
18906
|
return {
|
17452
18907
|
name: name7,
|
17453
18908
|
prefix,
|
17454
18909
|
encoder: {
|
17455
18910
|
name: name7,
|
17456
18911
|
prefix,
|
17457
|
-
encode:
|
18912
|
+
encode: encode20
|
17458
18913
|
},
|
17459
18914
|
decoder: {
|
17460
|
-
decode:
|
18915
|
+
decode: decode24
|
17461
18916
|
}
|
17462
18917
|
};
|
17463
18918
|
}
|
17464
|
-
var string = createCodec("utf8", "u", (
|
18919
|
+
var string = createCodec("utf8", "u", (buf3) => {
|
17465
18920
|
const decoder = new TextDecoder("utf8");
|
17466
|
-
return "u" + decoder.decode(
|
18921
|
+
return "u" + decoder.decode(buf3);
|
17467
18922
|
}, (str) => {
|
17468
18923
|
const encoder = new TextEncoder();
|
17469
18924
|
return encoder.encode(str.substring(1));
|
17470
18925
|
});
|
17471
|
-
var ascii = createCodec("ascii", "a", (
|
18926
|
+
var ascii = createCodec("ascii", "a", (buf3) => {
|
17472
18927
|
let string3 = "a";
|
17473
|
-
for (let i = 0; i <
|
17474
|
-
string3 += String.fromCharCode(
|
18928
|
+
for (let i = 0; i < buf3.length; i++) {
|
18929
|
+
string3 += String.fromCharCode(buf3[i]);
|
17475
18930
|
}
|
17476
18931
|
return string3;
|
17477
18932
|
}, (str) => {
|
17478
18933
|
str = str.substring(1);
|
17479
|
-
const
|
18934
|
+
const buf3 = allocUnsafe(str.length);
|
17480
18935
|
for (let i = 0; i < str.length; i++) {
|
17481
|
-
|
18936
|
+
buf3[i] = str.charCodeAt(i);
|
17482
18937
|
}
|
17483
|
-
return
|
18938
|
+
return buf3;
|
17484
18939
|
});
|
17485
18940
|
var BASES = {
|
17486
18941
|
utf8: string,
|
@@ -17494,7 +18949,7 @@ You can use close({ resize: true }) to resize header`);
|
|
17494
18949
|
var bases_default = BASES;
|
17495
18950
|
|
17496
18951
|
// ../../node_modules/.pnpm/uint8arrays@5.0.1/node_modules/uint8arrays/dist/src/from-string.js
|
17497
|
-
function
|
18952
|
+
function fromString5(string3, encoding = "utf8") {
|
17498
18953
|
const base4 = bases_default[encoding];
|
17499
18954
|
if (base4 == null) {
|
17500
18955
|
throw new Error(`Unsupported encoding "${encoding}"`);
|
@@ -17519,11 +18974,11 @@ You can use close({ resize: true }) to resize header`);
|
|
17519
18974
|
slab = allocUnsafe(SIZE);
|
17520
18975
|
offset = 0;
|
17521
18976
|
}
|
17522
|
-
const
|
18977
|
+
const buf3 = slab.subarray(offset, offset += size2);
|
17523
18978
|
if ((offset & 7) !== 0) {
|
17524
18979
|
offset = (offset | 7) + 1;
|
17525
18980
|
}
|
17526
|
-
return
|
18981
|
+
return buf3;
|
17527
18982
|
};
|
17528
18983
|
}
|
17529
18984
|
|
@@ -17579,7 +19034,7 @@ You can use close({ resize: true }) to resize header`);
|
|
17579
19034
|
}
|
17580
19035
|
};
|
17581
19036
|
var bufferPool = pool();
|
17582
|
-
function
|
19037
|
+
function alloc3(size) {
|
17583
19038
|
if (globalThis.Buffer != null) {
|
17584
19039
|
return allocUnsafe(size);
|
17585
19040
|
}
|
@@ -17827,25 +19282,25 @@ You can use close({ resize: true }) to resize header`);
|
|
17827
19282
|
*/
|
17828
19283
|
finish() {
|
17829
19284
|
let head = this.head.next;
|
17830
|
-
const
|
19285
|
+
const buf3 = alloc3(this.len);
|
17831
19286
|
let pos = 0;
|
17832
19287
|
while (head != null) {
|
17833
|
-
head.fn(head.val,
|
19288
|
+
head.fn(head.val, buf3, pos);
|
17834
19289
|
pos += head.len;
|
17835
19290
|
head = head.next;
|
17836
19291
|
}
|
17837
|
-
return
|
19292
|
+
return buf3;
|
17838
19293
|
}
|
17839
19294
|
};
|
17840
|
-
function writeByte(val,
|
17841
|
-
|
19295
|
+
function writeByte(val, buf3, pos) {
|
19296
|
+
buf3[pos] = val & 255;
|
17842
19297
|
}
|
17843
|
-
function writeVarint32(val,
|
19298
|
+
function writeVarint32(val, buf3, pos) {
|
17844
19299
|
while (val > 127) {
|
17845
|
-
|
19300
|
+
buf3[pos++] = val & 127 | 128;
|
17846
19301
|
val >>>= 7;
|
17847
19302
|
}
|
17848
|
-
|
19303
|
+
buf3[pos] = val;
|
17849
19304
|
}
|
17850
19305
|
var VarintOp = class extends Op {
|
17851
19306
|
next;
|
@@ -17854,26 +19309,26 @@ You can use close({ resize: true }) to resize header`);
|
|
17854
19309
|
this.next = void 0;
|
17855
19310
|
}
|
17856
19311
|
};
|
17857
|
-
function writeVarint64(val,
|
19312
|
+
function writeVarint64(val, buf3, pos) {
|
17858
19313
|
while (val.hi !== 0) {
|
17859
|
-
|
19314
|
+
buf3[pos++] = val.lo & 127 | 128;
|
17860
19315
|
val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;
|
17861
19316
|
val.hi >>>= 7;
|
17862
19317
|
}
|
17863
19318
|
while (val.lo > 127) {
|
17864
|
-
|
19319
|
+
buf3[pos++] = val.lo & 127 | 128;
|
17865
19320
|
val.lo = val.lo >>> 7;
|
17866
19321
|
}
|
17867
|
-
|
19322
|
+
buf3[pos++] = val.lo;
|
17868
19323
|
}
|
17869
|
-
function writeFixed32(val,
|
17870
|
-
|
17871
|
-
|
17872
|
-
|
17873
|
-
|
19324
|
+
function writeFixed32(val, buf3, pos) {
|
19325
|
+
buf3[pos] = val & 255;
|
19326
|
+
buf3[pos + 1] = val >>> 8 & 255;
|
19327
|
+
buf3[pos + 2] = val >>> 16 & 255;
|
19328
|
+
buf3[pos + 3] = val >>> 24;
|
17874
19329
|
}
|
17875
|
-
function writeBytes2(val,
|
17876
|
-
|
19330
|
+
function writeBytes2(val, buf3, pos) {
|
19331
|
+
buf3.set(val, pos);
|
17877
19332
|
}
|
17878
19333
|
if (globalThis.Buffer != null) {
|
17879
19334
|
Uint8ArrayWriter.prototype.bytes = function(value) {
|
@@ -17893,16 +19348,16 @@ You can use close({ resize: true }) to resize header`);
|
|
17893
19348
|
return this;
|
17894
19349
|
};
|
17895
19350
|
}
|
17896
|
-
function writeBytesBuffer(val,
|
17897
|
-
|
19351
|
+
function writeBytesBuffer(val, buf3, pos) {
|
19352
|
+
buf3.set(val, pos);
|
17898
19353
|
}
|
17899
|
-
function writeStringBuffer(val,
|
19354
|
+
function writeStringBuffer(val, buf3, pos) {
|
17900
19355
|
if (val.length < 40) {
|
17901
|
-
write5(val,
|
17902
|
-
} else if (
|
17903
|
-
|
19356
|
+
write5(val, buf3, pos);
|
19357
|
+
} else if (buf3.utf8Write != null) {
|
19358
|
+
buf3.utf8Write(val, pos);
|
17904
19359
|
} else {
|
17905
|
-
|
19360
|
+
buf3.set(fromString5(val), pos);
|
17906
19361
|
}
|
17907
19362
|
}
|
17908
19363
|
function createWriter3() {
|
@@ -17928,12 +19383,12 @@ You can use close({ resize: true }) to resize header`);
|
|
17928
19383
|
CODEC_TYPES2[CODEC_TYPES2["END_GROUP"] = 4] = "END_GROUP";
|
17929
19384
|
CODEC_TYPES2[CODEC_TYPES2["BIT32"] = 5] = "BIT32";
|
17930
19385
|
})(CODEC_TYPES || (CODEC_TYPES = {}));
|
17931
|
-
function createCodec2(name7, type2,
|
19386
|
+
function createCodec2(name7, type2, encode20, decode24) {
|
17932
19387
|
return {
|
17933
19388
|
name: name7,
|
17934
19389
|
type: type2,
|
17935
|
-
encode:
|
17936
|
-
decode:
|
19390
|
+
encode: encode20,
|
19391
|
+
decode: decode24
|
17937
19392
|
};
|
17938
19393
|
}
|
17939
19394
|
|
@@ -17945,20 +19400,20 @@ You can use close({ resize: true }) to resize header`);
|
|
17945
19400
|
}
|
17946
19401
|
return v[val];
|
17947
19402
|
}
|
17948
|
-
const
|
19403
|
+
const encode20 = function enumEncode(val, writer) {
|
17949
19404
|
const enumValue = findValue(val);
|
17950
19405
|
writer.int32(enumValue);
|
17951
19406
|
};
|
17952
|
-
const
|
19407
|
+
const decode24 = function enumDecode(reader) {
|
17953
19408
|
const val = reader.int32();
|
17954
19409
|
return findValue(val);
|
17955
19410
|
};
|
17956
|
-
return createCodec2("enum", CODEC_TYPES.VARINT,
|
19411
|
+
return createCodec2("enum", CODEC_TYPES.VARINT, encode20, decode24);
|
17957
19412
|
}
|
17958
19413
|
|
17959
19414
|
// ../../node_modules/.pnpm/protons-runtime@5.2.2/node_modules/protons-runtime/dist/src/codecs/message.js
|
17960
|
-
function message(
|
17961
|
-
return createCodec2("message", CODEC_TYPES.LENGTH_DELIMITED,
|
19415
|
+
function message(encode20, decode24) {
|
19416
|
+
return createCodec2("message", CODEC_TYPES.LENGTH_DELIMITED, encode20, decode24);
|
17962
19417
|
}
|
17963
19418
|
|
17964
19419
|
// ../../node_modules/.pnpm/ipfs-unixfs@11.1.2/node_modules/ipfs-unixfs/dist/src/unixfs.js
|
@@ -18076,8 +19531,8 @@ You can use close({ resize: true }) to resize header`);
|
|
18076
19531
|
Data3.encode = (obj) => {
|
18077
19532
|
return encodeMessage(obj, Data3.codec());
|
18078
19533
|
};
|
18079
|
-
Data3.decode = (
|
18080
|
-
return decodeMessage(
|
19534
|
+
Data3.decode = (buf3) => {
|
19535
|
+
return decodeMessage(buf3, Data3.codec());
|
18081
19536
|
};
|
18082
19537
|
})(Data2 || (Data2 = {}));
|
18083
19538
|
var UnixTime2;
|
@@ -18125,8 +19580,8 @@ You can use close({ resize: true }) to resize header`);
|
|
18125
19580
|
UnixTime3.encode = (obj) => {
|
18126
19581
|
return encodeMessage(obj, UnixTime3.codec());
|
18127
19582
|
};
|
18128
|
-
UnixTime3.decode = (
|
18129
|
-
return decodeMessage(
|
19583
|
+
UnixTime3.decode = (buf3) => {
|
19584
|
+
return decodeMessage(buf3, UnixTime3.codec());
|
18130
19585
|
};
|
18131
19586
|
})(UnixTime2 || (UnixTime2 = {}));
|
18132
19587
|
var Metadata2;
|
@@ -18167,8 +19622,8 @@ You can use close({ resize: true }) to resize header`);
|
|
18167
19622
|
Metadata3.encode = (obj) => {
|
18168
19623
|
return encodeMessage(obj, Metadata3.codec());
|
18169
19624
|
};
|
18170
|
-
Metadata3.decode = (
|
18171
|
-
return decodeMessage(
|
19625
|
+
Metadata3.decode = (buf3) => {
|
19626
|
+
return decodeMessage(buf3, Metadata3.codec());
|
18172
19627
|
};
|
18173
19628
|
})(Metadata2 || (Metadata2 = {}));
|
18174
19629
|
|
@@ -18334,11 +19789,11 @@ You can use close({ resize: true }) to resize header`);
|
|
18334
19789
|
var import_sparse_array = __toESM(require_sparse_array(), 1);
|
18335
19790
|
|
18336
19791
|
// ../../node_modules/.pnpm/uint8arrays@4.0.10/node_modules/uint8arrays/dist/src/util/as-uint8array.js
|
18337
|
-
function asUint8Array3(
|
19792
|
+
function asUint8Array3(buf3) {
|
18338
19793
|
if (globalThis.Buffer != null) {
|
18339
|
-
return new Uint8Array(
|
19794
|
+
return new Uint8Array(buf3.buffer, buf3.byteOffset, buf3.byteLength);
|
18340
19795
|
}
|
18341
|
-
return
|
19796
|
+
return buf3;
|
18342
19797
|
}
|
18343
19798
|
|
18344
19799
|
// ../../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/src/bases/base10.js
|
@@ -18414,13 +19869,13 @@ You can use close({ resize: true }) to resize header`);
|
|
18414
19869
|
[]
|
18415
19870
|
)
|
18416
19871
|
);
|
18417
|
-
function
|
19872
|
+
function encode18(data) {
|
18418
19873
|
return data.reduce((p, c) => {
|
18419
19874
|
p += alphabetBytesToChars2[c];
|
18420
19875
|
return p;
|
18421
19876
|
}, "");
|
18422
19877
|
}
|
18423
|
-
function
|
19878
|
+
function decode23(str) {
|
18424
19879
|
const byts = [];
|
18425
19880
|
for (const char of str) {
|
18426
19881
|
const byt = alphabetCharsToBytes2[
|
@@ -18437,8 +19892,8 @@ You can use close({ resize: true }) to resize header`);
|
|
18437
19892
|
var base256emoji2 = from({
|
18438
19893
|
prefix: "\u{1F680}",
|
18439
19894
|
name: "base256emoji",
|
18440
|
-
encode:
|
18441
|
-
decode:
|
19895
|
+
encode: encode18,
|
19896
|
+
decode: decode23
|
18442
19897
|
});
|
18443
19898
|
|
18444
19899
|
// ../../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/src/bases/base36.js
|
@@ -18511,13 +19966,13 @@ You can use close({ resize: true }) to resize header`);
|
|
18511
19966
|
var identity3 = from({
|
18512
19967
|
prefix: "\0",
|
18513
19968
|
name: "identity",
|
18514
|
-
encode: (
|
19969
|
+
encode: (buf3) => toString(buf3),
|
18515
19970
|
decode: (str) => fromString(str)
|
18516
19971
|
});
|
18517
19972
|
|
18518
19973
|
// ../../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/src/codecs/json.js
|
18519
|
-
var
|
18520
|
-
var
|
19974
|
+
var textEncoder6 = new TextEncoder();
|
19975
|
+
var textDecoder5 = new TextDecoder();
|
18521
19976
|
|
18522
19977
|
// ../../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/src/hashes/identity.js
|
18523
19978
|
var identity_exports4 = {};
|
@@ -18526,9 +19981,9 @@ You can use close({ resize: true }) to resize header`);
|
|
18526
19981
|
});
|
18527
19982
|
var code7 = 0;
|
18528
19983
|
var name6 = "identity";
|
18529
|
-
var
|
18530
|
-
var digest2 = (input) => create(code7,
|
18531
|
-
var identity4 = { code: code7, name: name6, encode:
|
19984
|
+
var encode19 = coerce;
|
19985
|
+
var digest2 = (input) => create(code7, encode19(input));
|
19986
|
+
var identity4 = { code: code7, name: name6, encode: encode19, digest: digest2 };
|
18532
19987
|
|
18533
19988
|
// ../../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/src/basics.js
|
18534
19989
|
var bases2 = { ...identity_exports3, ...base2_exports2, ...base8_exports2, ...base10_exports2, ...base16_exports2, ...base32_exports, ...base36_exports2, ...base58_exports, ...base64_exports2, ...base256emoji_exports2 };
|
@@ -18543,40 +19998,40 @@ You can use close({ resize: true }) to resize header`);
|
|
18543
19998
|
}
|
18544
19999
|
|
18545
20000
|
// ../../node_modules/.pnpm/uint8arrays@4.0.10/node_modules/uint8arrays/dist/src/util/bases.js
|
18546
|
-
function createCodec3(name7, prefix,
|
20001
|
+
function createCodec3(name7, prefix, encode20, decode24) {
|
18547
20002
|
return {
|
18548
20003
|
name: name7,
|
18549
20004
|
prefix,
|
18550
20005
|
encoder: {
|
18551
20006
|
name: name7,
|
18552
20007
|
prefix,
|
18553
|
-
encode:
|
20008
|
+
encode: encode20
|
18554
20009
|
},
|
18555
20010
|
decoder: {
|
18556
|
-
decode:
|
20011
|
+
decode: decode24
|
18557
20012
|
}
|
18558
20013
|
};
|
18559
20014
|
}
|
18560
|
-
var string2 = createCodec3("utf8", "u", (
|
20015
|
+
var string2 = createCodec3("utf8", "u", (buf3) => {
|
18561
20016
|
const decoder = new TextDecoder("utf8");
|
18562
|
-
return "u" + decoder.decode(
|
20017
|
+
return "u" + decoder.decode(buf3);
|
18563
20018
|
}, (str) => {
|
18564
20019
|
const encoder = new TextEncoder();
|
18565
20020
|
return encoder.encode(str.substring(1));
|
18566
20021
|
});
|
18567
|
-
var ascii2 = createCodec3("ascii", "a", (
|
20022
|
+
var ascii2 = createCodec3("ascii", "a", (buf3) => {
|
18568
20023
|
let string3 = "a";
|
18569
|
-
for (let i = 0; i <
|
18570
|
-
string3 += String.fromCharCode(
|
20024
|
+
for (let i = 0; i < buf3.length; i++) {
|
20025
|
+
string3 += String.fromCharCode(buf3[i]);
|
18571
20026
|
}
|
18572
20027
|
return string3;
|
18573
20028
|
}, (str) => {
|
18574
20029
|
str = str.substring(1);
|
18575
|
-
const
|
20030
|
+
const buf3 = allocUnsafe2(str.length);
|
18576
20031
|
for (let i = 0; i < str.length; i++) {
|
18577
|
-
|
20032
|
+
buf3[i] = str.charCodeAt(i);
|
18578
20033
|
}
|
18579
|
-
return
|
20034
|
+
return buf3;
|
18580
20035
|
});
|
18581
20036
|
var BASES2 = {
|
18582
20037
|
utf8: string2,
|
@@ -18590,7 +20045,7 @@ You can use close({ resize: true }) to resize header`);
|
|
18590
20045
|
var bases_default2 = BASES2;
|
18591
20046
|
|
18592
20047
|
// ../../node_modules/.pnpm/uint8arrays@4.0.10/node_modules/uint8arrays/dist/src/from-string.js
|
18593
|
-
function
|
20048
|
+
function fromString6(string3, encoding = "utf8") {
|
18594
20049
|
const base4 = bases_default2[encoding];
|
18595
20050
|
if (base4 == null) {
|
18596
20051
|
throw new Error(`Unsupported encoding "${encoding}"`);
|
@@ -18689,7 +20144,7 @@ You can use close({ resize: true }) to resize header`);
|
|
18689
20144
|
}
|
18690
20145
|
}
|
18691
20146
|
async _findPlace(key) {
|
18692
|
-
const hashValue = this._options.hash(typeof key === "string" ?
|
20147
|
+
const hashValue = this._options.hash(typeof key === "string" ? fromString6(key) : key);
|
18693
20148
|
const index2 = await hashValue.take(this._options.bits);
|
18694
20149
|
const child = this._children.get(index2);
|
18695
20150
|
if (child instanceof _Bucket) {
|
@@ -18855,7 +20310,7 @@ You can use close({ resize: true }) to resize header`);
|
|
18855
20310
|
}
|
18856
20311
|
|
18857
20312
|
// ../../node_modules/.pnpm/uint8arrays@4.0.10/node_modules/uint8arrays/dist/src/concat.js
|
18858
|
-
function
|
20313
|
+
function concat3(arrays, length5) {
|
18859
20314
|
if (length5 == null) {
|
18860
20315
|
length5 = arrays.reduce((acc, curr) => acc + curr.length, 0);
|
18861
20316
|
}
|
@@ -18926,11 +20381,11 @@ You can use close({ resize: true }) to resize header`);
|
|
18926
20381
|
}
|
18927
20382
|
async _produceMoreBits() {
|
18928
20383
|
this._depth++;
|
18929
|
-
const value = this._depth > 0 ?
|
20384
|
+
const value = this._depth > 0 ? concat3([this._value, Uint8Array.from([this._depth])]) : this._value;
|
18930
20385
|
const hashValue = await this._hashFn(value);
|
18931
|
-
const
|
18932
|
-
this._buffers.push(
|
18933
|
-
this._availableBits +=
|
20386
|
+
const buffer3 = new ConsumableBuffer(hashValue);
|
20387
|
+
this._buffers.push(buffer3);
|
20388
|
+
this._availableBits += buffer3.availableBits();
|
18934
20389
|
}
|
18935
20390
|
};
|
18936
20391
|
|
@@ -18947,8 +20402,8 @@ You can use close({ resize: true }) to resize header`);
|
|
18947
20402
|
}
|
18948
20403
|
|
18949
20404
|
// ../../node_modules/.pnpm/ipfs-unixfs-exporter@13.2.5/node_modules/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js
|
18950
|
-
var hashFn = async function(
|
18951
|
-
return (await murmur3128.encode(
|
20405
|
+
var hashFn = async function(buf3) {
|
20406
|
+
return (await murmur3128.encode(buf3)).slice(0, 8).reverse();
|
18952
20407
|
};
|
18953
20408
|
var addLinksToHamtBucket = async (links3, bucket, rootBucket) => {
|
18954
20409
|
const padLength = (bucket.tableSize() - 1).toString(16).length;
|
@@ -19038,7 +20493,7 @@ You can use close({ resize: true }) to resize header`);
|
|
19038
20493
|
}
|
19039
20494
|
context2.hamtDepth++;
|
19040
20495
|
const block = await blockstore.get(link2.Hash, options);
|
19041
|
-
node =
|
20496
|
+
node = decode16(block);
|
19042
20497
|
return findShardCid(node, name7, blockstore, context2, options);
|
19043
20498
|
};
|
19044
20499
|
var find_cid_in_shard_default = findShardCid;
|
@@ -19366,8 +20821,8 @@ You can use close({ resize: true }) to resize header`);
|
|
19366
20821
|
}
|
19367
20822
|
};
|
19368
20823
|
function pushable(options = {}) {
|
19369
|
-
const getNext = (
|
19370
|
-
const next =
|
20824
|
+
const getNext = (buffer3) => {
|
20825
|
+
const next = buffer3.shift();
|
19371
20826
|
if (next == null) {
|
19372
20827
|
return { done: true };
|
19373
20828
|
}
|
@@ -19385,15 +20840,15 @@ You can use close({ resize: true }) to resize header`);
|
|
19385
20840
|
function _pushable(getNext, options) {
|
19386
20841
|
options = options ?? {};
|
19387
20842
|
let onEnd = options.onEnd;
|
19388
|
-
let
|
20843
|
+
let buffer3 = new FIFO();
|
19389
20844
|
let pushable2;
|
19390
20845
|
let onNext;
|
19391
20846
|
let ended;
|
19392
20847
|
let drain = pDefer();
|
19393
20848
|
const waitNext = async () => {
|
19394
20849
|
try {
|
19395
|
-
if (!
|
19396
|
-
return getNext(
|
20850
|
+
if (!buffer3.isEmpty()) {
|
20851
|
+
return getNext(buffer3);
|
19397
20852
|
}
|
19398
20853
|
if (ended) {
|
19399
20854
|
return { done: true };
|
@@ -19401,9 +20856,9 @@ You can use close({ resize: true }) to resize header`);
|
|
19401
20856
|
return await new Promise((resolve5, reject) => {
|
19402
20857
|
onNext = (next) => {
|
19403
20858
|
onNext = null;
|
19404
|
-
|
20859
|
+
buffer3.push(next);
|
19405
20860
|
try {
|
19406
|
-
resolve5(getNext(
|
20861
|
+
resolve5(getNext(buffer3));
|
19407
20862
|
} catch (err) {
|
19408
20863
|
reject(err);
|
19409
20864
|
}
|
@@ -19411,7 +20866,7 @@ You can use close({ resize: true }) to resize header`);
|
|
19411
20866
|
};
|
19412
20867
|
});
|
19413
20868
|
} finally {
|
19414
|
-
if (
|
20869
|
+
if (buffer3.isEmpty()) {
|
19415
20870
|
queueMicrotask(() => {
|
19416
20871
|
drain.resolve();
|
19417
20872
|
drain = pDefer();
|
@@ -19423,15 +20878,15 @@ You can use close({ resize: true }) to resize header`);
|
|
19423
20878
|
if (onNext != null) {
|
19424
20879
|
return onNext(next);
|
19425
20880
|
}
|
19426
|
-
|
20881
|
+
buffer3.push(next);
|
19427
20882
|
return pushable2;
|
19428
20883
|
};
|
19429
20884
|
const bufferError = (err) => {
|
19430
|
-
|
20885
|
+
buffer3 = new FIFO();
|
19431
20886
|
if (onNext != null) {
|
19432
20887
|
return onNext({ error: err });
|
19433
20888
|
}
|
19434
|
-
|
20889
|
+
buffer3.push({ error: err });
|
19435
20890
|
return pushable2;
|
19436
20891
|
};
|
19437
20892
|
const push2 = (value) => {
|
@@ -19450,7 +20905,7 @@ You can use close({ resize: true }) to resize header`);
|
|
19450
20905
|
return err != null ? bufferError(err) : bufferNext({ done: true });
|
19451
20906
|
};
|
19452
20907
|
const _return = () => {
|
19453
|
-
|
20908
|
+
buffer3 = new FIFO();
|
19454
20909
|
end();
|
19455
20910
|
return { done: true };
|
19456
20911
|
};
|
@@ -19468,12 +20923,12 @@ You can use close({ resize: true }) to resize header`);
|
|
19468
20923
|
push: push2,
|
19469
20924
|
end,
|
19470
20925
|
get readableLength() {
|
19471
|
-
return
|
20926
|
+
return buffer3.size;
|
19472
20927
|
},
|
19473
20928
|
onEmpty: async (options2) => {
|
19474
20929
|
const signal = options2?.signal;
|
19475
20930
|
signal?.throwIfAborted();
|
19476
|
-
if (
|
20931
|
+
if (buffer3.isEmpty()) {
|
19477
20932
|
return;
|
19478
20933
|
}
|
19479
20934
|
let cancel;
|
@@ -20118,8 +21573,8 @@ You can use close({ resize: true }) to resize header`);
|
|
20118
21573
|
// ../../node_modules/.pnpm/ipfs-unixfs-exporter@13.2.5/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js
|
20119
21574
|
async function walkDAG(blockstore, node, queue, streamPosition, start, end, options) {
|
20120
21575
|
if (node instanceof Uint8Array) {
|
20121
|
-
const
|
20122
|
-
queue.push(
|
21576
|
+
const buf3 = extract_data_from_block_default(node, streamPosition, start, end);
|
21577
|
+
queue.push(buf3);
|
20123
21578
|
return;
|
20124
21579
|
}
|
20125
21580
|
if (node.Data == null) {
|
@@ -20133,9 +21588,9 @@ You can use close({ resize: true }) to resize header`);
|
|
20133
21588
|
}
|
20134
21589
|
if (file.data != null) {
|
20135
21590
|
const data = file.data;
|
20136
|
-
const
|
20137
|
-
queue.push(
|
20138
|
-
streamPosition += BigInt(
|
21591
|
+
const buf3 = extract_data_from_block_default(data, streamPosition, start, end);
|
21592
|
+
queue.push(buf3);
|
21593
|
+
streamPosition += BigInt(buf3.byteLength);
|
20139
21594
|
}
|
20140
21595
|
const childOps = [];
|
20141
21596
|
if (node.Links.length !== file.blockSizes.length) {
|
@@ -20173,7 +21628,7 @@ You can use close({ resize: true }) to resize header`);
|
|
20173
21628
|
let child;
|
20174
21629
|
switch (link2.Hash.code) {
|
20175
21630
|
case code3:
|
20176
|
-
child =
|
21631
|
+
child = decode16(block);
|
20177
21632
|
break;
|
20178
21633
|
case code5:
|
20179
21634
|
child = block;
|
@@ -20220,11 +21675,11 @@ You can use close({ resize: true }) to resize header`);
|
|
20220
21675
|
void walkDAG(blockstore, node, queue, 0n, start, end, options).catch((err) => {
|
20221
21676
|
queue.end(err);
|
20222
21677
|
});
|
20223
|
-
for await (const
|
20224
|
-
if (
|
21678
|
+
for await (const buf3 of queue) {
|
21679
|
+
if (buf3 == null) {
|
20225
21680
|
continue;
|
20226
21681
|
}
|
20227
|
-
read6 += BigInt(
|
21682
|
+
read6 += BigInt(buf3.byteLength);
|
20228
21683
|
if (read6 > wanted) {
|
20229
21684
|
queue.end();
|
20230
21685
|
throw (0, import_err_code7.default)(new Error("Read too many bytes - the file size reported by the UnixFS data in the root node may be incorrect"), "ERR_OVER_READ");
|
@@ -20237,7 +21692,7 @@ You can use close({ resize: true }) to resize header`);
|
|
20237
21692
|
totalBytes: wanted,
|
20238
21693
|
fileSize
|
20239
21694
|
}));
|
20240
|
-
yield
|
21695
|
+
yield buf3;
|
20241
21696
|
}
|
20242
21697
|
if (read6 < wanted) {
|
20243
21698
|
throw (0, import_err_code7.default)(new Error("Traversed entire DAG but did not read enough bytes"), "ERR_UNDER_READ");
|
@@ -20281,7 +21736,7 @@ You can use close({ resize: true }) to resize header`);
|
|
20281
21736
|
return { entries: result.entry == null ? [] : [result.entry] };
|
20282
21737
|
} else {
|
20283
21738
|
const block = await blockstore.get(link2.Hash, options);
|
20284
|
-
node =
|
21739
|
+
node = decode16(block);
|
20285
21740
|
options.onProgress?.(new CustomProgressEvent("unixfs:exporter:walk:hamt-sharded-directory", {
|
20286
21741
|
cid: link2.Hash
|
20287
21742
|
}));
|
@@ -20314,7 +21769,7 @@ You can use close({ resize: true }) to resize header`);
|
|
20314
21769
|
};
|
20315
21770
|
var unixFsResolver = async (cid, name7, path, toResolve, resolve5, depth, blockstore, options) => {
|
20316
21771
|
const block = await blockstore.get(cid, options);
|
20317
|
-
const node =
|
21772
|
+
const node = decode16(block);
|
20318
21773
|
let unixfs;
|
20319
21774
|
let next;
|
20320
21775
|
if (name7 == null) {
|
@@ -20881,7 +22336,7 @@ You can use close({ resize: true }) to resize header`);
|
|
20881
22336
|
BranchClass: MapBranch,
|
20882
22337
|
BranchEntryClass: MapBranchEntry
|
20883
22338
|
};
|
20884
|
-
var createGetNode2 = (get7, cache4, chunker3, codec, hasher,
|
22339
|
+
var createGetNode2 = (get7, cache4, chunker3, codec, hasher, compare6, opts) => {
|
20885
22340
|
const LeafClass2 = opts.LeafClass || MapLeaf;
|
20886
22341
|
const LeafEntryClass = opts.LeafEntryClass || MapLeafEntry;
|
20887
22342
|
const BranchClass2 = opts.BranchClass || MapBranch;
|
@@ -20897,7 +22352,7 @@ You can use close({ resize: true }) to resize header`);
|
|
20897
22352
|
getNode,
|
20898
22353
|
codec,
|
20899
22354
|
hasher,
|
20900
|
-
compare:
|
22355
|
+
compare: compare6,
|
20901
22356
|
LeafEntryClass,
|
20902
22357
|
LeafClass: LeafClass2,
|
20903
22358
|
BranchEntryClass,
|
@@ -20905,10 +22360,10 @@ You can use close({ resize: true }) to resize header`);
|
|
20905
22360
|
});
|
20906
22361
|
return getNode;
|
20907
22362
|
};
|
20908
|
-
var create16 = ({ get: get7, cache: cache4, chunker: chunker3, list, codec, hasher, sorted, compare:
|
22363
|
+
var create16 = ({ get: get7, cache: cache4, chunker: chunker3, list, codec, hasher, sorted, compare: compare6, ...opts }) => {
|
20909
22364
|
if (!sorted)
|
20910
|
-
list = list.sort(({ key: a }, { key: b }) =>
|
20911
|
-
const getNode = createGetNode2(get7, cache4, chunker3, codec, hasher,
|
22365
|
+
list = list.sort(({ key: a }, { key: b }) => compare6(a, b));
|
22366
|
+
const getNode = createGetNode2(get7, cache4, chunker3, codec, hasher, compare6, opts);
|
20912
22367
|
const _opts = {
|
20913
22368
|
list,
|
20914
22369
|
codec,
|
@@ -20916,7 +22371,7 @@ You can use close({ resize: true }) to resize header`);
|
|
20916
22371
|
chunker: chunker3,
|
20917
22372
|
getNode,
|
20918
22373
|
sorted,
|
20919
|
-
compare:
|
22374
|
+
compare: compare6,
|
20920
22375
|
cache: cache4,
|
20921
22376
|
LeafClass: opts.LeafClass || MapLeaf,
|
20922
22377
|
LeafEntryClass: opts.LeafEntryClass || MapLeafEntry,
|
@@ -20925,11 +22380,11 @@ You can use close({ resize: true }) to resize header`);
|
|
20925
22380
|
};
|
20926
22381
|
return create5(_opts);
|
20927
22382
|
};
|
20928
|
-
var load2 = ({ cid, get: get7, cache: cache4, chunker: chunker3, codec, hasher, compare:
|
20929
|
-
const getNode = createGetNode2(get7, cache4, chunker3, codec, hasher,
|
22383
|
+
var load2 = ({ cid, get: get7, cache: cache4, chunker: chunker3, codec, hasher, compare: compare6, ...opts }) => {
|
22384
|
+
const getNode = createGetNode2(get7, cache4, chunker3, codec, hasher, compare6, opts);
|
20930
22385
|
return getNode(cid);
|
20931
22386
|
};
|
20932
|
-
function makeDecoder({ chunker: chunker3, cache: cache4, getNode, codec, hasher, compare:
|
22387
|
+
function makeDecoder({ chunker: chunker3, cache: cache4, getNode, codec, hasher, compare: compare6, LeafEntryClass, LeafClass: LeafClass2, BranchEntryClass, BranchClass: BranchClass2 }) {
|
20933
22388
|
const entryOpts = {
|
20934
22389
|
codec,
|
20935
22390
|
hasher
|
@@ -20943,7 +22398,7 @@ You can use close({ resize: true }) to resize header`);
|
|
20943
22398
|
getNode,
|
20944
22399
|
codec,
|
20945
22400
|
hasher,
|
20946
|
-
compare:
|
22401
|
+
compare: compare6
|
20947
22402
|
};
|
20948
22403
|
let entries3;
|
20949
22404
|
let CLS;
|
@@ -20978,7 +22433,7 @@ You can use close({ resize: true }) to resize header`);
|
|
20978
22433
|
}
|
20979
22434
|
|
20980
22435
|
// ../../node_modules/.pnpm/prolly-trees@1.0.4/node_modules/prolly-trees/esm/src/db-index.js
|
20981
|
-
var
|
22436
|
+
var compare4 = (a, b) => {
|
20982
22437
|
const [aKey, aRef] = a;
|
20983
22438
|
const [bKey, bRef] = b;
|
20984
22439
|
const comp = simpleCompare(aKey, bKey);
|
@@ -21084,7 +22539,7 @@ You can use close({ resize: true }) to resize header`);
|
|
21084
22539
|
};
|
21085
22540
|
var defaults4 = {
|
21086
22541
|
...classes2,
|
21087
|
-
compare:
|
22542
|
+
compare: compare4
|
21088
22543
|
};
|
21089
22544
|
var create17 = (opts) => {
|
21090
22545
|
opts = {
|
@@ -21115,7 +22570,7 @@ You can use close({ resize: true }) to resize header`);
|
|
21115
22570
|
return 1;
|
21116
22571
|
return simpleCompare(aRef, bRef);
|
21117
22572
|
};
|
21118
|
-
var
|
22573
|
+
var compare5 = (a, b) => {
|
21119
22574
|
const [aKey, aRef] = a;
|
21120
22575
|
const [bKey, bRef] = b;
|
21121
22576
|
const comp = simpleCompare(aKey, bKey);
|
@@ -21123,7 +22578,7 @@ You can use close({ resize: true }) to resize header`);
|
|
21123
22578
|
return comp;
|
21124
22579
|
return refCompare2(aRef, bRef);
|
21125
22580
|
};
|
21126
|
-
var byKeyOpts = { cache: nocache, chunker: bf(30), codec: src_exports, hasher: sha256, compare:
|
22581
|
+
var byKeyOpts = { cache: nocache, chunker: bf(30), codec: src_exports, hasher: sha256, compare: compare5 };
|
21127
22582
|
var byIdOpts = { cache: nocache, chunker: bf(30), codec: src_exports, hasher: sha256, compare: simpleCompare };
|
21128
22583
|
function indexEntriesForChanges(changes, mapFn) {
|
21129
22584
|
const indexEntries = [];
|