@ghostlytools/sdk 1.11.0 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +5 -2
- package/dist/app.js.map +1 -1
- package/dist/core.js +280 -2
- package/dist/core.js.map +1 -1
- package/dist/{fakes-Cu6mpUKs.js → fakes-DCH5oJMm.js} +3 -3
- package/dist/{fakes-Cu6mpUKs.js.map → fakes-DCH5oJMm.js.map} +1 -1
- package/dist/fakes.js +1 -1
- package/dist/index.js +3 -3
- package/dist/{keet-identity-key-DHlSH_39.js → keet-identity-key-3EEmDkxz.js} +2 -2
- package/dist/{keet-identity-key-DHlSH_39.js.map → keet-identity-key-3EEmDkxz.js.map} +1 -1
- package/dist/{src-i6IUh-ng.js → src-DA7T3Gvo.js} +1247 -269
- package/dist/src-DA7T3Gvo.js.map +1 -0
- package/dist/testing.js +4 -4
- package/dist/types/browser/src/engine/paymentAdapters/providers/types.d.ts +6 -1
- package/dist/types/core/src/audioMetadata.d.ts +23 -0
- package/dist/types/core/src/catchUp.d.ts +2 -0
- package/dist/types/core/src/chatFiles.d.ts +6 -0
- package/dist/types/core/src/clipboardGuard.d.ts +43 -0
- package/dist/types/core/src/dhtDelivery.d.ts +13 -0
- package/dist/types/core/src/didDht.d.ts +6 -4
- package/dist/types/core/src/frames.d.ts +11 -0
- package/dist/types/core/src/ghostlink.d.ts +20 -0
- package/dist/types/core/src/groupCommunity.d.ts +7 -1
- package/dist/types/core/src/groupSession.d.ts +18 -1
- package/dist/types/core/src/http.d.ts +16 -2
- package/dist/types/core/src/identity.d.ts +8 -1
- package/dist/types/core/src/identityProofs.d.ts +7 -0
- package/dist/types/core/src/index.d.ts +3 -0
- package/dist/types/core/src/miniApp.d.ts +4 -1
- package/dist/types/core/src/pairedAppRanges.d.ts +5 -0
- package/dist/types/core/src/relay.d.ts +7 -4
- package/dist/types/core/src/transport.d.ts +3 -1
- package/dist/types/core/src/videoMetadata.d.ts +8 -2
- package/dist/types/core/src/viewerGuard.d.ts +20 -7
- package/dist/{types-DvtCy3WB.js → types-DYLIIkU8.js} +2 -1
- package/dist/types-DYLIIkU8.js.map +1 -0
- package/dist/{verify-BoaDPIrS.js → verify-DsXR5sRX.js} +2 -2
- package/dist/{verify-BoaDPIrS.js.map → verify-DsXR5sRX.js.map} +1 -1
- package/package.json +1 -1
- package/dist/src-i6IUh-ng.js.map +0 -1
- package/dist/types-DvtCy3WB.js.map +0 -1
|
@@ -383,9 +383,16 @@ function tryDecrypt(encoded, key) {
|
|
|
383
383
|
}
|
|
384
384
|
//#endregion
|
|
385
385
|
//#region ../core/src/identity.ts
|
|
386
|
-
/** How many public keys `identityFromSeed` keeps: a start with 50 chats and 20 groups derives about 400 distinct ones. */
|
|
386
|
+
/** How many public keys `identityFromSeed` keeps however long ago they were used: a start with 50 chats and 20 groups derives about 400 distinct ones. */
|
|
387
387
|
var IDENTITY_MEMO_SIZE = 1024;
|
|
388
388
|
/**
|
|
389
|
+
* Past `IDENTITY_MEMO_SIZE`, a key is let go only once it has not been asked for this long: a start asks for all of a
|
|
390
|
+
* profile's keys within seconds (a 600-chat one, ~4,000 of them), then asks again for the running links' ones.
|
|
391
|
+
*/
|
|
392
|
+
var IDENTITY_MEMO_IDLE_MS = 6e5;
|
|
393
|
+
/** The most keys kept, used or not: ~410 bytes each in V8 (its id, its key and when it was used), ~6.7 MB in all. */
|
|
394
|
+
var IDENTITY_MEMO_MAX = 16384;
|
|
395
|
+
/**
|
|
389
396
|
* Public keys already derived, by the SHA-256 of their seed, the most recently used last. A chat's start derives the
|
|
390
397
|
* same few seeds' keys again and again (its link, its delivery, its capability record): ~0.25 ms each in V8, ~3.4x
|
|
391
398
|
* that in JSC. The seed itself is never kept, so a seed its owner zeroes leaves nothing behind here.
|
|
@@ -393,14 +400,24 @@ var IDENTITY_MEMO_SIZE = 1024;
|
|
|
393
400
|
var publicKeys = /* @__PURE__ */ new Map();
|
|
394
401
|
function publicKeyOf(seed) {
|
|
395
402
|
const id = toBase64Url(sha256(seed));
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
403
|
+
const now = Date.now();
|
|
404
|
+
let entry = publicKeys.get(id);
|
|
405
|
+
if (entry) {
|
|
406
|
+
publicKeys.delete(id);
|
|
407
|
+
entry.at = now;
|
|
408
|
+
} else {
|
|
409
|
+
entry = {
|
|
410
|
+
key: ed25519.getPublicKey(seed),
|
|
411
|
+
at: now
|
|
412
|
+
};
|
|
413
|
+
for (const [oldest, { at }] of publicKeys) {
|
|
414
|
+
if (publicKeys.size < 1024) break;
|
|
415
|
+
if (publicKeys.size < 16384 && now - at < 6e5) break;
|
|
416
|
+
publicKeys.delete(oldest);
|
|
417
|
+
}
|
|
401
418
|
}
|
|
402
|
-
publicKeys.set(id,
|
|
403
|
-
return key.slice();
|
|
419
|
+
publicKeys.set(id, entry);
|
|
420
|
+
return entry.key.slice();
|
|
404
421
|
}
|
|
405
422
|
function identityFromSeed(seed) {
|
|
406
423
|
if (seed.length !== 32) throw new Error("Seed must be exactly 32 bytes");
|
|
@@ -1245,7 +1262,7 @@ var DEPARTED_READS = 6;
|
|
|
1245
1262
|
/**
|
|
1246
1263
|
* A 1:1 chat's reads of an invite this side made, while its joiner is due and has not shown (`awaited`, `AWAITING_PEER_MS`
|
|
1247
1264
|
* in link.ts), may go over a relay's minute within the chat's allowance (`SIGNALING_ALLOWANCE_SHARE`) the same way: at
|
|
1248
|
-
* most this many
|
|
1265
|
+
* most this many in a minute, every invite and every relay together. And while one asked in the last minute, the departed
|
|
1249
1266
|
* reads leave them half of that on each relay: the last `AWAITED_READS / 2` of the allowance's reads (`DEPARTED_READS`
|
|
1250
1267
|
* then take at most 3 on a relay of 30, against 5). Read every 2 to 4 s, they cover the seconds in which a joiner that
|
|
1251
1268
|
* opened the link at once knocks. Within the chats' allowance, they add nothing to what a relay may see in a minute
|
|
@@ -1253,6 +1270,9 @@ var DEPARTED_READS = 6;
|
|
|
1253
1270
|
* another on relays of 30 spent the minute on both 12 s in (two pairings, about 15 requests a relay each), the departed
|
|
1254
1271
|
* reads of the contact that had just left took the allowance, and the third invite's key was read once, then not until
|
|
1255
1272
|
* the minute freed: the joiner's knock 48 s late, and join to live in 60 s, against 2.6 and 4.6 s (CLI lab, 2026-11-07).
|
|
1273
|
+
* Not this many per invite: a web profile with 150 chats added from old sessions, each an invite awaited from that start,
|
|
1274
|
+
* had their reads take the whole allowance at every refill, and a live contact's reads after a reload went once a
|
|
1275
|
+
* minute: the chat came back in 2 to 7 min, against 41 to 69 s before (2026-11-07).
|
|
1256
1276
|
*/
|
|
1257
1277
|
var AWAITED_READS = 4;
|
|
1258
1278
|
/**
|
|
@@ -1628,8 +1648,8 @@ var RelayTransport = class {
|
|
|
1628
1648
|
spentAnswerAllowance = /* @__PURE__ */ new Map();
|
|
1629
1649
|
/** Per contact, its departed reads past the limit in the last minute, every relay together (`DEPARTED_READS`). */
|
|
1630
1650
|
departedOver = /* @__PURE__ */ new Map();
|
|
1631
|
-
/**
|
|
1632
|
-
awaitedOver =
|
|
1651
|
+
/** The awaited reads past the limit in the last minute, every invite and every relay together (`AWAITED_READS`). */
|
|
1652
|
+
awaitedOver = [];
|
|
1633
1653
|
/** When an awaited invite's read last asked: the departed reads leave it room for a minute (`AWAITED_READS`). */
|
|
1634
1654
|
awaitedAt = -Infinity;
|
|
1635
1655
|
/**
|
|
@@ -2511,7 +2531,7 @@ var RelayTransport = class {
|
|
|
2511
2531
|
if (isGroupSignal(who)) this.spentGroupSignal.get(relay).push(now);
|
|
2512
2532
|
const departedOver = isDepartedRead(who) && this.spent.get(relay).length >= this.limitOf(relay);
|
|
2513
2533
|
if (departedOver) this.overAdd(this.departedOver, key, now);
|
|
2514
|
-
if (isAwaitedRead(who) && this.spent.get(relay).length >= this.limitOf(relay)) this.
|
|
2534
|
+
if (isAwaitedRead(who) && this.spent.get(relay).length >= this.limitOf(relay)) this.awaitedOver = [...within(this.awaitedOver, now, 6e4), now];
|
|
2515
2535
|
this.spent.get(relay).push(now);
|
|
2516
2536
|
if (who.background) this.spentBackground.get(relay).push(now);
|
|
2517
2537
|
if (who.background && who.write) this.spentBackgroundWrites.get(relay).push(now);
|
|
@@ -2555,7 +2575,8 @@ var RelayTransport = class {
|
|
|
2555
2575
|
const over = (list, limit) => list.length >= limit ? list[list.length - limit] + 6e4 - now : 0;
|
|
2556
2576
|
const limit = this.limitOf(relay);
|
|
2557
2577
|
const departed = isDepartedRead(who) && key !== void 0 && recent.length >= limit && this.overReads(this.departedOver, key, now) < 6;
|
|
2558
|
-
|
|
2578
|
+
if (isAwaitedRead(who)) this.awaitedOver = within(this.awaitedOver, now, 6e4);
|
|
2579
|
+
const awaited = isAwaitedRead(who) && key !== void 0 && recent.length >= limit && this.awaitedOver.length < 4;
|
|
2559
2580
|
const share = isChatSignal(who) || departed || awaited ? SIGNALING_ALLOWANCE_SHARE : isGroupSignal(who) ? GROUP_SIGNALING_ALLOWANCE_SHARE : 0;
|
|
2560
2581
|
let allowance = share ? Math.max(0, Math.floor(limit * share) - (who.write ? 0 : 1)) : 0;
|
|
2561
2582
|
if (departed && now - this.awaitedAt < 6e4) allowance = Math.max(0, allowance - 2);
|
|
@@ -2739,7 +2760,7 @@ var RelayTransport = class {
|
|
|
2739
2760
|
const since = this.heldBack.get(key)?.since;
|
|
2740
2761
|
return !who.group && !who.write && !who.door && since !== void 0 && now - since >= READ_STARVED_MS;
|
|
2741
2762
|
}
|
|
2742
|
-
/** This key's departed
|
|
2763
|
+
/** This key's departed reads past the limit in the last minute (`DEPARTED_READS`). */
|
|
2743
2764
|
overReads(over, key, now) {
|
|
2744
2765
|
const reads = within(over.get(key) ?? [], now, 6e4);
|
|
2745
2766
|
if (reads.length) over.set(key, reads);
|
|
@@ -5039,7 +5060,7 @@ function findAppForbiddenKey(value) {
|
|
|
5039
5060
|
var MAX_CLIENTS = 16;
|
|
5040
5061
|
var SEMVER$1 = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
5041
5062
|
var HOST = /^>=(0|[1-9]\d*)\.(0|[1-9]\d*)(\.(0|[1-9]\d*))?$/;
|
|
5042
|
-
var SEGMENT$
|
|
5063
|
+
var SEGMENT$2 = /^[A-Za-z0-9._-]+$/;
|
|
5043
5064
|
var codePoints = (s) => [...s].length;
|
|
5044
5065
|
/** Text of several lines: no control character but the line feed. */
|
|
5045
5066
|
var isText$3 = (v, max) => typeof v === "string" && codePoints(v) <= max && !/[^\P{Cc}\n]/u.test(v);
|
|
@@ -5111,7 +5132,7 @@ function isAppLicense(value) {
|
|
|
5111
5132
|
/** A path of a bundle: relative, `/`-separated, `[A-Za-z0-9._-]` per segment, no `.` or `..`, at most 128 bytes. */
|
|
5112
5133
|
function isAppPath(value) {
|
|
5113
5134
|
if (typeof value !== "string" || value.length < 1 || value.length > APP_BUNDLE_LIMITS.pathBytes) return false;
|
|
5114
|
-
return value.split("/").every((s) => SEGMENT$
|
|
5135
|
+
return value.split("/").every((s) => SEGMENT$2.test(s) && s !== "." && s !== "..");
|
|
5115
5136
|
}
|
|
5116
5137
|
var bad = (field, detail = `${field} is not valid`) => ({
|
|
5117
5138
|
ok: false,
|
|
@@ -7902,6 +7923,12 @@ var LIMITS = {
|
|
|
7902
7923
|
maxPathBytes: 8192,
|
|
7903
7924
|
/** Requests a host serves at once for one peer. */
|
|
7904
7925
|
maxConcurrentRequestsPerPeer: 32,
|
|
7926
|
+
/**
|
|
7927
|
+
* Request-body bytes a host holds for one peer at once, from a body's first chunk until its local fetch settles.
|
|
7928
|
+
* Past it a request is refused (`busy`). As much as a client's in-flight requests can carry, so only a peer that
|
|
7929
|
+
* ignores that limit reaches it.
|
|
7930
|
+
*/
|
|
7931
|
+
maxHostBodyBytesPerPeer: 134217728,
|
|
7905
7932
|
/** Requests a client keeps in flight; the rest wait in a queue. */
|
|
7906
7933
|
maxClientInFlight: 16,
|
|
7907
7934
|
/**
|
|
@@ -7918,6 +7945,11 @@ var LIMITS = {
|
|
|
7918
7945
|
maxStoredIncomingBytesPerPeer: 524288e3,
|
|
7919
7946
|
requestTimeoutMs: 6e4,
|
|
7920
7947
|
bodyIdleTimeoutMs: 3e4,
|
|
7948
|
+
/**
|
|
7949
|
+
* What a request body must bring in each `bodyIdleTimeoutMs` (unless it ends) to count as moving: a peer that sends a
|
|
7950
|
+
* few bytes at a time is let go like one that stalls.
|
|
7951
|
+
*/
|
|
7952
|
+
minRequestBodyBytesPerIdle: 16384,
|
|
7921
7953
|
/** Stop writing to the channel above this many buffered bytes. */
|
|
7922
7954
|
sendHighWaterMark: 1048576,
|
|
7923
7955
|
sendLowWaterMark: 262144
|
|
@@ -8437,15 +8469,45 @@ function viewerServicePolicy(relayOnly) {
|
|
|
8437
8469
|
return relayOnly ? VIEWER_SERVICE_CSP_RELAY_ONLY : VIEWER_SERVICE_CSP;
|
|
8438
8470
|
}
|
|
8439
8471
|
/**
|
|
8472
|
+
* The browser features a contact's app in the extension's viewer tab may not use. Its tab is a site of its own, so
|
|
8473
|
+
* what the person granted it (camera, microphone, location, a device) would be a site setting of the browser's, which
|
|
8474
|
+
* no Delete chat, Clear all data or Delete profile reaches; denied here, the browser never asks and ignores a grant
|
|
8475
|
+
* made before. The web app's view is a frame of another site, which gets none of them, and Desktop's window grants none.
|
|
8476
|
+
*/
|
|
8477
|
+
var VIEWER_PERMISSIONS_POLICY = [
|
|
8478
|
+
"camera",
|
|
8479
|
+
"microphone",
|
|
8480
|
+
"display-capture",
|
|
8481
|
+
"geolocation",
|
|
8482
|
+
"midi",
|
|
8483
|
+
"usb",
|
|
8484
|
+
"serial",
|
|
8485
|
+
"hid",
|
|
8486
|
+
"clipboard-read",
|
|
8487
|
+
"idle-detection",
|
|
8488
|
+
"local-fonts",
|
|
8489
|
+
"window-management",
|
|
8490
|
+
"storage-access",
|
|
8491
|
+
"publickey-credentials-create"
|
|
8492
|
+
].map((feature) => `${feature}=()`).join(", ");
|
|
8493
|
+
/** A contact's headers that would set the page's features: the viewer's own policy takes their place. */
|
|
8494
|
+
var VIEWER_FEATURE_HEADERS = ["permissions-policy", "feature-policy"];
|
|
8495
|
+
/**
|
|
8440
8496
|
* `headers` with Ghostly's policy after the contact's own, all in one `content-security-policy` joined by commas: a
|
|
8441
|
-
* browser enforces every policy of the list, so the contact's can narrow Ghostly's but never widen it.
|
|
8497
|
+
* browser enforces every policy of the list, so the contact's can narrow Ghostly's but never widen it. The page's
|
|
8498
|
+
* features are Ghostly's alone (`VIEWER_PERMISSIONS_POLICY`): a contact's permissions policy could allow them, and one
|
|
8499
|
+
* the browser cannot read would void the whole header, Ghostly's part with it.
|
|
8442
8500
|
*/
|
|
8443
8501
|
function withViewerPolicy(headers, relayOnly = false) {
|
|
8444
8502
|
const policies = [];
|
|
8445
8503
|
const out = [];
|
|
8446
|
-
for (const [name, value] of headers)
|
|
8447
|
-
|
|
8504
|
+
for (const [name, value] of headers) {
|
|
8505
|
+
const lower = name.toLowerCase();
|
|
8506
|
+
if (lower === "content-security-policy") policies.push(value);
|
|
8507
|
+
else if (!VIEWER_FEATURE_HEADERS.includes(lower)) out.push([name, value]);
|
|
8508
|
+
}
|
|
8448
8509
|
out.push(["content-security-policy", [...policies, viewerServicePolicy(relayOnly)].join(", ")]);
|
|
8510
|
+
out.push(["permissions-policy", VIEWER_PERMISSIONS_POLICY]);
|
|
8449
8511
|
return out;
|
|
8450
8512
|
}
|
|
8451
8513
|
/**
|
|
@@ -8495,6 +8557,8 @@ var HttpHost = class {
|
|
|
8495
8557
|
* so a stream counts toward the limit until its fetch has settled.
|
|
8496
8558
|
*/
|
|
8497
8559
|
live = /* @__PURE__ */ new Set();
|
|
8560
|
+
/** Body bytes of the streams in `live`: a peer cannot make the host hold more than `maxHostBodyBytesPerPeer`. */
|
|
8561
|
+
heldBodyBytes = 0;
|
|
8498
8562
|
constructor(channel, getService, localFetch) {
|
|
8499
8563
|
this.channel = channel;
|
|
8500
8564
|
this.getService = getService;
|
|
@@ -8521,25 +8585,32 @@ var HttpHost = class {
|
|
|
8521
8585
|
url,
|
|
8522
8586
|
body: [],
|
|
8523
8587
|
bodyBytes: 0,
|
|
8588
|
+
movedBytes: 0,
|
|
8524
8589
|
abort: new AbortController(),
|
|
8525
8590
|
started: false
|
|
8526
8591
|
};
|
|
8527
8592
|
this.streams.set(frame.id, stream);
|
|
8528
8593
|
this.live.add(stream);
|
|
8529
|
-
if (frame.b && !BODYLESS_METHODS.has(method)) this.
|
|
8594
|
+
if (frame.b && !BODYLESS_METHODS.has(method)) this.watchPace(stream);
|
|
8530
8595
|
else this.run(stream);
|
|
8531
8596
|
}
|
|
8532
8597
|
handleChunk(chunk) {
|
|
8533
8598
|
const stream = this.streams.get(chunk.id);
|
|
8534
8599
|
if (!stream || stream.started) return;
|
|
8535
|
-
|
|
8536
|
-
if (stream.bodyBytes > LIMITS.maxRequestBodyBytes) {
|
|
8600
|
+
const bytes = chunk.payload.length;
|
|
8601
|
+
if (stream.bodyBytes + bytes > LIMITS.maxRequestBodyBytes) {
|
|
8537
8602
|
this.end(stream);
|
|
8538
8603
|
return this.fail(chunk.id, 413, "request-too-large", "Request body too large.");
|
|
8539
8604
|
}
|
|
8605
|
+
if (this.heldBodyBytes + bytes > LIMITS.maxHostBodyBytesPerPeer) {
|
|
8606
|
+
this.end(stream);
|
|
8607
|
+
return this.fail(chunk.id, 503, "busy", "Too many request bodies at once.");
|
|
8608
|
+
}
|
|
8609
|
+
stream.bodyBytes += bytes;
|
|
8610
|
+
this.heldBodyBytes += bytes;
|
|
8611
|
+
stream.movedBytes += bytes;
|
|
8540
8612
|
if (chunk.payload.length > 0) stream.body.push(chunk.payload.slice());
|
|
8541
8613
|
if (chunk.end) this.run(stream);
|
|
8542
|
-
else this.armIdleTimer(stream);
|
|
8543
8614
|
}
|
|
8544
8615
|
handleReset(frame) {
|
|
8545
8616
|
const stream = this.streams.get(frame.id);
|
|
@@ -8548,9 +8619,13 @@ var HttpHost = class {
|
|
|
8548
8619
|
closeAll() {
|
|
8549
8620
|
for (const stream of [...this.streams.values()]) this.end(stream);
|
|
8550
8621
|
}
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
stream.
|
|
8622
|
+
/** A body that brings less than `minRequestBodyBytesPerIdle` in a `bodyIdleTimeoutMs` is let go, even if it trickles. */
|
|
8623
|
+
watchPace(stream) {
|
|
8624
|
+
stream.paceTimer = setTimeout(() => {
|
|
8625
|
+
if (stream.movedBytes >= LIMITS.minRequestBodyBytesPerIdle) {
|
|
8626
|
+
stream.movedBytes = 0;
|
|
8627
|
+
return this.watchPace(stream);
|
|
8628
|
+
}
|
|
8554
8629
|
this.end(stream);
|
|
8555
8630
|
this.fail(stream.frame.id, 408, "request-timeout", "Request body timed out.");
|
|
8556
8631
|
}, LIMITS.bodyIdleTimeoutMs);
|
|
@@ -8560,10 +8635,16 @@ var HttpHost = class {
|
|
|
8560
8635
|
return this.streams.get(stream.frame.id) === stream;
|
|
8561
8636
|
}
|
|
8562
8637
|
end(stream) {
|
|
8563
|
-
clearTimeout(stream.
|
|
8638
|
+
clearTimeout(stream.paceTimer);
|
|
8564
8639
|
stream.abort.abort();
|
|
8565
8640
|
if (this.isCurrent(stream)) this.streams.delete(stream.frame.id);
|
|
8566
|
-
if (!stream.started) this.
|
|
8641
|
+
if (!stream.started) this.release(stream);
|
|
8642
|
+
}
|
|
8643
|
+
/** The stream no longer counts toward the limits: its body is dropped, or its local fetch has settled. */
|
|
8644
|
+
release(stream) {
|
|
8645
|
+
this.live.delete(stream);
|
|
8646
|
+
this.heldBodyBytes -= stream.bodyBytes;
|
|
8647
|
+
stream.bodyBytes = 0;
|
|
8567
8648
|
}
|
|
8568
8649
|
fail(id, status, code, message) {
|
|
8569
8650
|
const body = utf8Encode(`${message}\n`);
|
|
@@ -8580,19 +8661,20 @@ var HttpHost = class {
|
|
|
8580
8661
|
}
|
|
8581
8662
|
async run(stream) {
|
|
8582
8663
|
stream.started = true;
|
|
8583
|
-
clearTimeout(stream.
|
|
8664
|
+
clearTimeout(stream.paceTimer);
|
|
8584
8665
|
const { frame, service } = stream;
|
|
8585
8666
|
const timeout = setTimeout(() => stream.abort.abort(), LIMITS.requestTimeoutMs);
|
|
8586
8667
|
let headersSent = false;
|
|
8668
|
+
const body = stream.body.length > 0 ? concatBytes(...stream.body) : null;
|
|
8669
|
+
stream.body = [];
|
|
8587
8670
|
try {
|
|
8588
8671
|
const response = await this.localFetch({
|
|
8589
8672
|
url: stream.url,
|
|
8590
8673
|
method: frame.m,
|
|
8591
8674
|
headers: sanitizeRequestHeaders(frame.h),
|
|
8592
|
-
body
|
|
8675
|
+
body,
|
|
8593
8676
|
signal: stream.abort.signal
|
|
8594
8677
|
});
|
|
8595
|
-
stream.body = [];
|
|
8596
8678
|
clearTimeout(timeout);
|
|
8597
8679
|
if (!this.isCurrent(stream)) return;
|
|
8598
8680
|
if (response.finalUrl && response.finalUrl !== stream.url) {
|
|
@@ -8640,7 +8722,7 @@ var HttpHost = class {
|
|
|
8640
8722
|
else if (timedOut && error?.name === "AbortError") this.fail(frame.id, 504, "timeout", "The local service did not answer in time.");
|
|
8641
8723
|
else this.fail(frame.id, 502, "unreachable", "The local service is not reachable.");
|
|
8642
8724
|
} finally {
|
|
8643
|
-
this.
|
|
8725
|
+
this.release(stream);
|
|
8644
8726
|
}
|
|
8645
8727
|
}
|
|
8646
8728
|
};
|
|
@@ -9013,6 +9095,18 @@ var VIEWER_GUARD_HASH = "'sha256-P3jYgJwfoJ/cAS31rQz7Tk99bBwsSeN2wDDqJubDMZw='";
|
|
|
9013
9095
|
* `javascript:` URL to the guard's policy before it runs.
|
|
9014
9096
|
*/
|
|
9015
9097
|
var VIEWER_GUARD_CSP = "frame-src 'self'; object-src 'self'; require-trusted-types-for 'script'";
|
|
9098
|
+
/**
|
|
9099
|
+
* `VIEWER_GUARD_CSP` for a worker's own script: no Trusted Types. A worker has no `javascript:` URL, no `execCommand`
|
|
9100
|
+
* and no WebRTC for a guard to keep, and no guard runs in it to make the `default` policy, so Trusted Types there
|
|
9101
|
+
* would refuse its every `importScripts`, `eval` and `new Function`.
|
|
9102
|
+
*/
|
|
9103
|
+
var VIEWER_WORKER_GUARD_CSP = "frame-src 'self'; object-src 'self'";
|
|
9104
|
+
/** The `destination` of a worker's own script: its answer's policy is the worker's. */
|
|
9105
|
+
var WORKER_DESTINATIONS = /* @__PURE__ */ new Set([
|
|
9106
|
+
"worker",
|
|
9107
|
+
"sharedworker",
|
|
9108
|
+
"serviceworker"
|
|
9109
|
+
]);
|
|
9016
9110
|
/** Refuses every script of a page the guard cannot be put first in. */
|
|
9017
9111
|
var NO_SCRIPTS_CSP = "script-src 'none'";
|
|
9018
9112
|
/**
|
|
@@ -9032,12 +9126,17 @@ var DOCUMENT_DESTINATIONS = /* @__PURE__ */ new Set([
|
|
|
9032
9126
|
"embed",
|
|
9033
9127
|
"fencedframe"
|
|
9034
9128
|
]);
|
|
9129
|
+
/** The WebRTC guard, the one `guardViewerAnswer` puts in when it is given none. */
|
|
9130
|
+
var WEBRTC_GUARD = {
|
|
9131
|
+
script: VIEWER_GUARD_SCRIPT,
|
|
9132
|
+
hash: VIEWER_GUARD_HASH
|
|
9133
|
+
};
|
|
9035
9134
|
/**
|
|
9036
|
-
* A contact's `Content-Security-Policy` value (one policy or several, joined by commas), each given the
|
|
9135
|
+
* A contact's `Content-Security-Policy` value (one policy or several, joined by commas), each given the guards' hashes
|
|
9037
9136
|
* where it would refuse an inline script: in the directive that governs `<script>` elements (`script-src-elem`, else
|
|
9038
9137
|
* `script-src`, else `default-src`), unless it lets every inline script run already. Nothing else of it changes.
|
|
9039
9138
|
*/
|
|
9040
|
-
function allowingViewerGuard(value) {
|
|
9139
|
+
function allowingViewerGuard(value, hashes = [VIEWER_GUARD_HASH]) {
|
|
9041
9140
|
return value.split(",").map((policy) => {
|
|
9042
9141
|
const directives = policy.split(";");
|
|
9043
9142
|
const names = directives.map((directive) => directive.trim().split(/\s+/)[0].toLowerCase());
|
|
@@ -9049,7 +9148,7 @@ function allowingViewerGuard(value) {
|
|
|
9049
9148
|
if (at === void 0) return policy;
|
|
9050
9149
|
const sources = directives[at].trim().split(/\s+/).slice(1).map((source) => source.toLowerCase());
|
|
9051
9150
|
if (sources.includes("'unsafe-inline'") && !sources.some((source) => source.startsWith("'nonce-") || /^'sha(256|384|512)-/.test(source) || source === "'strict-dynamic'")) return policy;
|
|
9052
|
-
directives[at] = `${directives[at].trimEnd()} ${
|
|
9151
|
+
directives[at] = `${directives[at].trimEnd()} ${hashes.join(" ")}`;
|
|
9053
9152
|
return directives.join(";");
|
|
9054
9153
|
}).join(",");
|
|
9055
9154
|
}
|
|
@@ -9072,7 +9171,22 @@ var find = (bytes, from, text) => {
|
|
|
9072
9171
|
* `head` ends before that is known and more is coming (`done` false).
|
|
9073
9172
|
*/
|
|
9074
9173
|
function viewerGuardOffset(head, done) {
|
|
9075
|
-
|
|
9174
|
+
return guardOffsetFrom(head, done, {
|
|
9175
|
+
from: 0,
|
|
9176
|
+
seen: 0
|
|
9177
|
+
});
|
|
9178
|
+
}
|
|
9179
|
+
/** Too short to tell: what starts at `from` is looked at again with more, its close from about `seen` on. */
|
|
9180
|
+
function wait(look, from, seen) {
|
|
9181
|
+
look.from = from;
|
|
9182
|
+
look.seen = seen;
|
|
9183
|
+
return null;
|
|
9184
|
+
}
|
|
9185
|
+
/** `viewerGuardOffset` going on from `look`, which it moves along when the head is too short to tell. */
|
|
9186
|
+
function guardOffsetFrom(head, done, look) {
|
|
9187
|
+
if (look.from === 0 && !done && head.length < 3 && at(head, 0, "".slice(0, head.length))) return null;
|
|
9188
|
+
let offset = look.from === 0 && at(head, 0, "") ? 3 : look.from;
|
|
9189
|
+
const after = (start) => offset === look.from ? Math.max(start, look.seen - 3) : start;
|
|
9076
9190
|
for (;;) {
|
|
9077
9191
|
while (offset < head.length && [
|
|
9078
9192
|
9,
|
|
@@ -9081,43 +9195,45 @@ function viewerGuardOffset(head, done) {
|
|
|
9081
9195
|
13,
|
|
9082
9196
|
32
|
|
9083
9197
|
].includes(head[offset])) offset++;
|
|
9084
|
-
if (offset >= head.length) return done ? offset :
|
|
9198
|
+
if (offset >= head.length) return done ? offset : wait(look, offset, head.length);
|
|
9085
9199
|
let end;
|
|
9086
9200
|
if (at(head, offset, "<!--")) {
|
|
9087
9201
|
if (at(head, offset + 4, ">")) end = offset + 5;
|
|
9088
9202
|
else if (at(head, offset + 4, "->")) end = offset + 6;
|
|
9089
9203
|
else {
|
|
9090
|
-
const ends = ["-->", "--!>"].map((close) => [find(head, offset + 4, close), close.length]).filter(([index]) => index >= 0).sort(([a], [b]) => a - b);
|
|
9204
|
+
const ends = ["-->", "--!>"].map((close) => [find(head, after(offset + 4), close), close.length]).filter(([index]) => index >= 0).sort(([a], [b]) => a - b);
|
|
9091
9205
|
end = ends.length ? ends[0][0] + ends[0][1] : -1;
|
|
9092
9206
|
}
|
|
9093
9207
|
} else if (at(head, offset, "<!doctype", true)) {
|
|
9094
|
-
const close = find(head, offset, ">");
|
|
9208
|
+
const close = find(head, after(offset), ">");
|
|
9095
9209
|
if (close >= 0) return close + 1;
|
|
9096
9210
|
end = -1;
|
|
9097
9211
|
} else if (at(head, offset, "<!") || at(head, offset, "<?")) {
|
|
9098
|
-
const close = find(head, offset, ">");
|
|
9212
|
+
const close = find(head, after(offset), ">");
|
|
9099
9213
|
end = close >= 0 ? close + 1 : -1;
|
|
9100
9214
|
} else if (offset === head.length - 1 && head[offset] === 60) {
|
|
9101
|
-
if (!done) return
|
|
9215
|
+
if (!done) return wait(look, offset, head.length);
|
|
9102
9216
|
return offset;
|
|
9103
9217
|
} else return offset;
|
|
9104
|
-
if (end < 0) return done ? offset :
|
|
9218
|
+
if (end < 0) return done ? offset : wait(look, offset, head.length);
|
|
9105
9219
|
offset = end;
|
|
9106
9220
|
}
|
|
9107
9221
|
}
|
|
9108
9222
|
/** How far into a page the guard is looked for a place in: past it, it goes where the look stopped. */
|
|
9109
9223
|
var LOOK_BYTES = 65536;
|
|
9110
9224
|
/**
|
|
9111
|
-
* A contact's answer as a viewer serves it
|
|
9112
|
-
*
|
|
9113
|
-
* (`allowingViewerGuard`) and `VIEWER_GUARD_CSP` goes along. A page (`destination`, null when the browser did not say)
|
|
9114
|
-
* that is HTML gets the
|
|
9225
|
+
* A contact's answer as a viewer serves it where it cannot run `guards` in every frame itself (the web runner; the
|
|
9226
|
+
* WebRTC guard while Hide my IP from contacts is on, unless it is given others): the contact's policies take the guards'
|
|
9227
|
+
* hashes (`allowingViewerGuard`) and `VIEWER_GUARD_CSP` goes along. A page (`destination`, null when the browser did not say)
|
|
9228
|
+
* that is HTML gets the guards first in it, in their order; one they cannot be put in (another type, more than one type, a
|
|
9115
9229
|
* compressed, UTF-16 or ISO-2022-JP body, a type with a quote or a backslash in it, an escape byte before the guard's
|
|
9116
9230
|
* place) runs no script at all. Anything that is not a page passes as it was. The caller adds Ghostly's own policy as before.
|
|
9117
9231
|
*/
|
|
9118
|
-
async function guardViewerAnswer(headers, body, destination) {
|
|
9119
|
-
const
|
|
9120
|
-
out.
|
|
9232
|
+
async function guardViewerAnswer(headers, body, destination, guards = [WEBRTC_GUARD]) {
|
|
9233
|
+
const hashes = guards.map((guard) => guard.hash);
|
|
9234
|
+
const out = headers.map(([name, value]) => [name, name.toLowerCase() === "content-security-policy" ? allowingViewerGuard(value, hashes) : value]);
|
|
9235
|
+
const worker = destination !== null && WORKER_DESTINATIONS.has(destination.toLowerCase());
|
|
9236
|
+
out.push(["content-security-policy", worker ? VIEWER_WORKER_GUARD_CSP : VIEWER_GUARD_CSP]);
|
|
9121
9237
|
if (destination !== null && !DOCUMENT_DESTINATIONS.has(destination.toLowerCase())) return {
|
|
9122
9238
|
headers: out,
|
|
9123
9239
|
body
|
|
@@ -9142,14 +9258,27 @@ async function guardViewerAnswer(headers, body, destination) {
|
|
|
9142
9258
|
});
|
|
9143
9259
|
if (!html || encoded) return noScripts();
|
|
9144
9260
|
const iterator = body[Symbol.asyncIterator]();
|
|
9145
|
-
let
|
|
9261
|
+
let room = /* @__PURE__ */ new Uint8Array(0);
|
|
9262
|
+
let head = room;
|
|
9146
9263
|
let done = false;
|
|
9147
9264
|
let offset = null;
|
|
9265
|
+
const look = {
|
|
9266
|
+
from: 0,
|
|
9267
|
+
seen: 0
|
|
9268
|
+
};
|
|
9148
9269
|
while (offset === null) {
|
|
9149
9270
|
const next = await iterator.next();
|
|
9150
9271
|
if (next.done) done = true;
|
|
9151
|
-
else
|
|
9152
|
-
|
|
9272
|
+
else {
|
|
9273
|
+
if (head.length + next.value.length > room.length) {
|
|
9274
|
+
const more = new Uint8Array(Math.max(room.length * 2, head.length + next.value.length));
|
|
9275
|
+
more.set(head);
|
|
9276
|
+
room = more;
|
|
9277
|
+
}
|
|
9278
|
+
room.set(next.value, head.length);
|
|
9279
|
+
head = room.subarray(0, head.length + next.value.length);
|
|
9280
|
+
}
|
|
9281
|
+
offset = guardOffsetFrom(head, done || head.length >= LOOK_BYTES, look);
|
|
9153
9282
|
}
|
|
9154
9283
|
const rest = { [Symbol.asyncIterator]: () => iterator };
|
|
9155
9284
|
const resumed = async function* (first) {
|
|
@@ -9164,7 +9293,7 @@ async function guardViewerAnswer(headers, body, destination) {
|
|
|
9164
9293
|
headers: out,
|
|
9165
9294
|
body: resumed(head)
|
|
9166
9295
|
};
|
|
9167
|
-
const guarded = concatBytes(head.subarray(0, offset), utf8Encode(`<script>${
|
|
9296
|
+
const guarded = concatBytes(head.subarray(0, offset), utf8Encode(guards.map((guard) => `<script>${guard.script}<\/script>`).join("")), head.subarray(offset));
|
|
9168
9297
|
return {
|
|
9169
9298
|
headers: out.filter(([name]) => name.toLowerCase() !== "content-length"),
|
|
9170
9299
|
body: resumed(guarded)
|
|
@@ -9983,7 +10112,7 @@ var LinkSession = class {
|
|
|
9983
10112
|
receivedNew = true;
|
|
9984
10113
|
if (fresh.length > 0) this.events.onMessages?.(fresh, batch);
|
|
9985
10114
|
}
|
|
9986
|
-
if (read && batch.packetTimestamp > this.peerPacketAt) this.peerPacketAt = batch.packetTimestamp;
|
|
10115
|
+
if (read && batch.packetTimestamp > this.peerPacketAt) this.peerPacketAt = Math.min(batch.packetTimestamp, Date.now() + PKARR_FUTURE_SKEW_MS);
|
|
9987
10116
|
const seenAt = batch.packetTimestamp === wasSeen ? presenceSeenAt(this.presence) : Math.max(readBefore, Math.min(batch.packetTimestamp, Date.now()));
|
|
9988
10117
|
const online = batch.services !== null && Date.now() - seenAt < 6e5;
|
|
9989
10118
|
this.presence = {
|
|
@@ -14620,7 +14749,8 @@ var DhtDelivery = class DhtDelivery {
|
|
|
14620
14749
|
* envelope was seen in the pinned mailbox, the invite's is not read any more.
|
|
14621
14750
|
*/
|
|
14622
14751
|
async read(background, signal = false) {
|
|
14623
|
-
const
|
|
14752
|
+
const departed = !signal && !background && this.departedRead();
|
|
14753
|
+
const pinned = this.pinned(), options = signal ? { signal } : background ? { background } : departed ? { departed } : void 0;
|
|
14624
14754
|
const before = this.state.peerPinned;
|
|
14625
14755
|
const boxes = !pinned ? ["invite"] : before === "seen" ? ["pinned"] : before ? ["pinned", "invite"] : ["invite", "pinned"];
|
|
14626
14756
|
let found = null;
|
|
@@ -14755,6 +14885,21 @@ var DhtDelivery = class DhtDelivery {
|
|
|
14755
14885
|
return this.state.peerMode === "dht" && this.options.peerDhtPollMs && there ? Math.min(this.options.peerDhtPollMs, STREAM_POLL_MS) : STREAM_POLL_MS;
|
|
14756
14886
|
}
|
|
14757
14887
|
/**
|
|
14888
|
+
* The contact is on DHT only and this side is not: a live link waits on the contact's envelope saying it left, and
|
|
14889
|
+
* nothing else of the contact's shows before it (no offer is read, no dial taken, while its mailbox says DHT only). Its
|
|
14890
|
+
* reads that are not background ones (the chat open, a text awaiting its receipt) then say `departed`: a few may go over
|
|
14891
|
+
* the relays' minute (`DEPARTED_READS` in relay.ts, per mailbox, every relay together, 6 at the open chat's 10 s pace).
|
|
14892
|
+
* As plain reads, an extension that stayed on Automatic, its minute spent by what it did before, read nothing of its
|
|
14893
|
+
* contact for 40 s after the contact left DHT only, and the matrix's chat stayed "On DHT · retrying live" (E2E full,
|
|
14894
|
+
* 2026-11-07 and 11-08). No more reads than before: those it made anyway, the minute spent, go within the allowance.
|
|
14895
|
+
* Not while this side is leaving DHT only itself (`signalReads` left, `leavingRead`): its read at the switch stays a
|
|
14896
|
+
* plain one, the rest are signaling, so the few requests past a spent minute stay for the dialling side's read of the
|
|
14897
|
+
* answer. As a departed read, the switch's took one, and both sides leaving went live in 34 s, against 10.
|
|
14898
|
+
*/
|
|
14899
|
+
departedRead() {
|
|
14900
|
+
return this.mode !== "dht" && this.state.peerMode === "dht" && this.signalReads === 0 && !!this.options.credentials.peerKey;
|
|
14901
|
+
}
|
|
14902
|
+
/**
|
|
14758
14903
|
* This side is DHT only, and nothing waits on the contact's mailbox: the contact, pinned, is away (nothing new of its
|
|
14759
14904
|
* own in `PRESENCE_WINDOW`; it puts a keep-alive every four minutes while there), no text of ours awaits its receipt,
|
|
14760
14905
|
* and the chat is not on screen. Its mailbox is then read at the background pace, as background reads, not every 4 s:
|
|
@@ -15271,18 +15416,23 @@ var DNS_TYPE = {
|
|
|
15271
15416
|
TXT: 16,
|
|
15272
15417
|
AAAA: 28
|
|
15273
15418
|
};
|
|
15419
|
+
/**
|
|
15420
|
+
* EDNS0 OPT record (RFC 6891) with one Client Subnet option of source prefix 0 (RFC 7871 §7.1.2): a resolver must
|
|
15421
|
+
* not add this device's subnet to its queries to the name's servers, as Google Public DNS otherwise does.
|
|
15422
|
+
*/
|
|
15423
|
+
var NO_CLIENT_SUBNET = Uint8Array.of(0, 0, 41, 4, 208, 0, 0, 0, 0, 0, 8, 0, 8, 0, 4, 0, 1, 0, 0);
|
|
15274
15424
|
/** A recursive query for one name and type. ID 0, as RFC 8484 recommends for caching;
|
|
15275
15425
|
* the AD bit asks the resolver to report DNSSEC validation (RFC 6840 §5.7). */
|
|
15276
15426
|
function encodeDnsQuery(name, type) {
|
|
15277
15427
|
const labels = name.replace(/\.$/, "").split(".");
|
|
15278
|
-
const parts = [Uint8Array.of(0, 0, 1, 32, 0, 1, 0, 0, 0, 0, 0,
|
|
15428
|
+
const parts = [Uint8Array.of(0, 0, 1, 32, 0, 1, 0, 0, 0, 0, 0, 1)];
|
|
15279
15429
|
for (const label of labels) {
|
|
15280
15430
|
const bytes = utf8Encode(label);
|
|
15281
15431
|
if (!bytes.length || bytes.length > 63) throw new Error("Invalid DNS name");
|
|
15282
15432
|
parts.push(Uint8Array.of(bytes.length), bytes);
|
|
15283
15433
|
}
|
|
15284
15434
|
const code = DNS_TYPE[type];
|
|
15285
|
-
parts.push(Uint8Array.of(0, code >> 8, code & 255, 0, 1));
|
|
15435
|
+
parts.push(Uint8Array.of(0, code >> 8, code & 255, 0, 1), NO_CLIENT_SUBNET);
|
|
15286
15436
|
return concatBytes(...parts);
|
|
15287
15437
|
}
|
|
15288
15438
|
function readName(data, start) {
|
|
@@ -16591,7 +16741,7 @@ async function verifyPeerProof(event, c, readStorage) {
|
|
|
16591
16741
|
if (sig.length !== 64 || !verify(sig, data, fromZ32(c.externalKey))) throw new Error("Invalid Pubky signature");
|
|
16592
16742
|
} else if (c.adapter === "keet-import") {
|
|
16593
16743
|
if (sig.length !== 107 || sig[0] !== 1 || sig[41] !== 0 || sig[42] !== 1) throw new Error("Unsupported Keet attestation");
|
|
16594
|
-
const { default: IdentityKey } = await import("./keet-identity-key-
|
|
16744
|
+
const { default: IdentityKey } = await import("./keet-identity-key-3EEmDkxz.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
|
|
16595
16745
|
if (!IdentityKey.verify(b4a.from(sig), b4a.from(data), { expectedIdentity: b4a.from(unhex(c.externalKey)) })) throw new Error("Invalid Keet attestation");
|
|
16596
16746
|
} else throw new Error("Unsupported proof adapter");
|
|
16597
16747
|
}
|
|
@@ -17296,6 +17446,7 @@ var IdentityExchange = class {
|
|
|
17296
17446
|
id,
|
|
17297
17447
|
provider,
|
|
17298
17448
|
subject,
|
|
17449
|
+
account: local.account ?? subject,
|
|
17299
17450
|
status: "queued",
|
|
17300
17451
|
at: this.now()
|
|
17301
17452
|
};
|
|
@@ -17454,7 +17605,7 @@ var IdentityExchange = class {
|
|
|
17454
17605
|
at: this.now(),
|
|
17455
17606
|
error
|
|
17456
17607
|
};
|
|
17457
|
-
const replaced = (x) => ok && x.status === "accepted" && x.provider === s.provider && x.
|
|
17608
|
+
const replaced = (x) => ok && x.status === "accepted" && x.provider === s.provider && x.account !== void 0 && x.account === s.account;
|
|
17458
17609
|
await this.options.storage.update((l) => l.shared.filter((x) => x.id !== s.id && replaced(x)).reduce((out, x) => this.log(out, {
|
|
17459
17610
|
type: "stopped",
|
|
17460
17611
|
side: "mine",
|
|
@@ -19287,7 +19438,12 @@ var APP_RANGE_LIMITS = {
|
|
|
19287
19438
|
* The bytes a server takes asks for in one second, its apps together: one more is answered `busy`. Counted as they
|
|
19288
19439
|
* are asked, so a cancelled one counts as the read it started. Twice the asking app's own budget (16 MiB a second).
|
|
19289
19440
|
*/
|
|
19290
|
-
bytesPerSecond: 33554432
|
|
19441
|
+
bytesPerSecond: 33554432,
|
|
19442
|
+
/**
|
|
19443
|
+
* The least one ask counts in `bytesPerSecond`, however few bytes it asked or the file held from its offset: each is
|
|
19444
|
+
* a read on this device, so a contact gets at most 512 a second.
|
|
19445
|
+
*/
|
|
19446
|
+
askFloorBytes: 65536
|
|
19291
19447
|
};
|
|
19292
19448
|
/**
|
|
19293
19449
|
* What an `ar-err` says. `not-served`: no serve of that id (never given, or ended); `changed` and
|
|
@@ -19568,16 +19724,17 @@ var AppRanges = class {
|
|
|
19568
19724
|
old.out = true;
|
|
19569
19725
|
this.takenBytes -= old.bytes;
|
|
19570
19726
|
}
|
|
19571
|
-
|
|
19727
|
+
const bytes = Math.max(frame.n, APP_RANGE_LIMITS.askFloorBytes);
|
|
19728
|
+
if (this.takenBytes + bytes > APP_RANGE_LIMITS.bytesPerSecond) {
|
|
19572
19729
|
this.send(appRangeErrorFrame(app, request, "busy"));
|
|
19573
19730
|
return null;
|
|
19574
19731
|
}
|
|
19575
19732
|
const charge = {
|
|
19576
19733
|
at,
|
|
19577
|
-
bytes
|
|
19734
|
+
bytes
|
|
19578
19735
|
};
|
|
19579
19736
|
this.taken.push(charge);
|
|
19580
|
-
this.takenBytes +=
|
|
19737
|
+
this.takenBytes += bytes;
|
|
19581
19738
|
const task = {
|
|
19582
19739
|
app,
|
|
19583
19740
|
request,
|
|
@@ -19599,7 +19756,7 @@ var AppRanges = class {
|
|
|
19599
19756
|
/** Every byte of `task` was sent: `ar-end` goes with the file's size, unless the task was dropped meanwhile. */
|
|
19600
19757
|
finish(task, size) {
|
|
19601
19758
|
if (!this.take(task)) return;
|
|
19602
|
-
const charge = task.charge, sent = Math.max(
|
|
19759
|
+
const charge = task.charge, sent = Math.max(APP_RANGE_LIMITS.askFloorBytes, Math.min(task.length, size - task.offset));
|
|
19603
19760
|
if (charge && !charge.out && charge.bytes > sent) {
|
|
19604
19761
|
this.takenBytes -= charge.bytes - sent;
|
|
19605
19762
|
charge.bytes = sent;
|
|
@@ -21080,6 +21237,12 @@ var ChatFiles = class {
|
|
|
21080
21237
|
moving = /* @__PURE__ */ new Set();
|
|
21081
21238
|
/** Files that stopped sending for the chat's window alone: they go on once another's bytes are confirmed. */
|
|
21082
21239
|
held = /* @__PURE__ */ new Set();
|
|
21240
|
+
/**
|
|
21241
|
+
* Files this side cancelled while no session carried the cancel (`pf-abort`), said on the next one. The session also
|
|
21242
|
+
* goes for a moment when a move swaps it (its capabilities are agreed again): unsaid, the receiver showed the file
|
|
21243
|
+
* moving, its bytes kept, until its idle nudge asked 30 s later.
|
|
21244
|
+
*/
|
|
21245
|
+
unsaid = /* @__PURE__ */ new Set();
|
|
21083
21246
|
attached = false;
|
|
21084
21247
|
peerRoomValue = null;
|
|
21085
21248
|
/** What the chat's files may have in flight, sized by the path. */
|
|
@@ -21178,6 +21341,10 @@ var ChatFiles = class {
|
|
|
21178
21341
|
this.refill = 0;
|
|
21179
21342
|
this.host.uplink?.join(this);
|
|
21180
21343
|
this.sayRoom();
|
|
21344
|
+
for (const id of this.unsaid) if (this.send({
|
|
21345
|
+
t: "pf-abort",
|
|
21346
|
+
id
|
|
21347
|
+
})) this.unsaid.delete(id);
|
|
21181
21348
|
this.sweep();
|
|
21182
21349
|
for (const entry of this.entries.values()) {
|
|
21183
21350
|
if (transferEnded(entry.record)) continue;
|
|
@@ -22183,10 +22350,10 @@ var ChatFiles = class {
|
|
|
22183
22350
|
const entry = this.entry(direction, id);
|
|
22184
22351
|
if (transferEnded(entry.record)) return;
|
|
22185
22352
|
if (direction === "out") {
|
|
22186
|
-
this.send({
|
|
22353
|
+
if (!this.send({
|
|
22187
22354
|
t: "pf-abort",
|
|
22188
22355
|
id
|
|
22189
|
-
});
|
|
22356
|
+
})) this.unsaid.add(id);
|
|
22190
22357
|
this.end(entry, "cancelled", "You cancelled it");
|
|
22191
22358
|
} else {
|
|
22192
22359
|
this.discardStored(entry);
|
|
@@ -23828,6 +23995,22 @@ var QUIET_FRAMES = /* @__PURE__ */ new Set([
|
|
|
23828
23995
|
CONTACT_ASKER_FRAME
|
|
23829
23996
|
]);
|
|
23830
23997
|
/**
|
|
23998
|
+
* What a session a move replaced still reads while its channel retires (`SWITCH_RETIRE_MS`): the contact's texts,
|
|
23999
|
+
* reactions, pins and edits, and its receipts of this side's, which it sends on that session until its own side moves.
|
|
24000
|
+
* Its files/3 frames too (a cancel, a pause, a file's check): `ChatFiles` answers them on the session now.
|
|
24001
|
+
*/
|
|
24002
|
+
var RETIRING_FRAMES = /* @__PURE__ */ new Set([
|
|
24003
|
+
"paired-message",
|
|
24004
|
+
"paired-received",
|
|
24005
|
+
REACTION_FRAME,
|
|
24006
|
+
REACTED_FRAME,
|
|
24007
|
+
PIN_FRAME,
|
|
24008
|
+
PINNED_FRAME,
|
|
24009
|
+
EDIT_FRAME,
|
|
24010
|
+
EDITED_FRAME,
|
|
24011
|
+
...FILE_FRAMES
|
|
24012
|
+
]);
|
|
24013
|
+
/**
|
|
23831
24014
|
* A ping with nothing at all back this long after it went: the contact may have crashed and started again, with its new
|
|
23832
24015
|
* offer waiting on the relays, while this side still holds the old session and reads them at a live chat's pace (30 s).
|
|
23833
24016
|
* They are read now. Nothing more: the session is let go only by `LIVENESS_MISSED_PINGS`, or by the contact's offer
|
|
@@ -23885,6 +24068,17 @@ var APP_IN_FLIGHT = 65536;
|
|
|
23885
24068
|
/** Largest `paired-message` frame sent with a preview: a session fails on a frame over 60 KiB (`PairedSession`). */
|
|
23886
24069
|
var MAX_PAIRED_MESSAGE_FRAME = 57344;
|
|
23887
24070
|
/**
|
|
24071
|
+
* Texts a contact's link takes: a burst per short window (a reconnect flushes every queued text at once) and a total
|
|
24072
|
+
* per hour, both well above what a person or a bot sends. The rest go unconfirmed and come again (the sender's outbox
|
|
24073
|
+
* resends with backoff), so a catch-up only slows.
|
|
24074
|
+
*/
|
|
24075
|
+
var MESSAGE_RECEIVE_LIMITS = {
|
|
24076
|
+
burst: 200,
|
|
24077
|
+
burstWindowMs: 1e4,
|
|
24078
|
+
hourly: 1800,
|
|
24079
|
+
hourWindowMs: 36e5
|
|
24080
|
+
};
|
|
24081
|
+
/**
|
|
23888
24082
|
* A `paired-message` frame. The preview (`pv`) is left out when the frame would pass `MAX_PAIRED_MESSAGE_FRAME`
|
|
23889
24083
|
* with it: the text matters, the card does not. A reply (`r`, WISP 401 § Replies) is a few hundred bytes at most
|
|
23890
24084
|
* and always goes, and so does a forwarded message's hop count (`fw`, WISP 401 § Forwards) and a status card (`sc`,
|
|
@@ -24102,6 +24296,8 @@ var GhostLink = class {
|
|
|
24102
24296
|
pinsReceived = new ReactionWindow(PIN_LIMITS.receive, PIN_LIMITS.windowMs);
|
|
24103
24297
|
/** Edit frames the contact may send per window; the rest go unconfirmed and come again. */
|
|
24104
24298
|
editsReceived = new RateWindow(30, EDIT_RATE_WINDOW_MS);
|
|
24299
|
+
/** Text frames the contact may send per window (`MESSAGE_RECEIVE_LIMITS`); the rest go unconfirmed and come again. */
|
|
24300
|
+
messagesReceived = [new RateWindow(MESSAGE_RECEIVE_LIMITS.burst, MESSAGE_RECEIVE_LIMITS.burstWindowMs), new RateWindow(MESSAGE_RECEIVE_LIMITS.hourly, MESSAGE_RECEIVE_LIMITS.hourWindowMs)];
|
|
24105
24301
|
/** Call signals the contact may send per window; the rest are dropped. */
|
|
24106
24302
|
callsReceived = new RateWindow(150, CALL_RATE_WINDOW_MS);
|
|
24107
24303
|
/** WebRTC signals the contact may send on the session (`paired-rtc`) per window; the rest are dropped. */
|
|
@@ -25130,6 +25326,18 @@ var GhostLink = class {
|
|
|
25130
25326
|
});
|
|
25131
25327
|
}
|
|
25132
25328
|
/**
|
|
25329
|
+
* Where the receipt of a frame read on `channel` goes: that session while it carries the chat, the one now when a move
|
|
25330
|
+
* replaced it (or moved while the frame was shown), or nowhere.
|
|
25331
|
+
*/
|
|
25332
|
+
answerOn(channel) {
|
|
25333
|
+
const live = this.channel;
|
|
25334
|
+
return live && (live === channel || this.retiring.has(channel)) && this.isDataLinkOpen ? live : null;
|
|
25335
|
+
}
|
|
25336
|
+
/** Counts one text the contact sent; false (and not counted) when either of `messagesReceived` is full. */
|
|
25337
|
+
takeMessage() {
|
|
25338
|
+
return this.messagesReceived.every((window) => window.wait() === 0) && this.messagesReceived.every((window) => window.take());
|
|
25339
|
+
}
|
|
25340
|
+
/**
|
|
25133
25341
|
* The WebRTC session a switch moved off is still retiring (`SWITCH_RETIRE_MS`): its data link is open, and a new offer
|
|
25134
25342
|
* cannot go until it closes. Resolves once it has (at once when none is).
|
|
25135
25343
|
*/
|
|
@@ -28025,6 +28233,12 @@ var GhostLink = class {
|
|
|
28025
28233
|
if (this.channel === channel && (!this.unproven(channel) && !this.pinnedSince(channel, paired) || paired.state.status === "ready")) this.emitPairingState();
|
|
28026
28234
|
},
|
|
28027
28235
|
onFailure: () => {
|
|
28236
|
+
const retiring = this.channel !== channel ? this.retiring.get(channel) : void 0;
|
|
28237
|
+
if (retiring) {
|
|
28238
|
+
clearTimeout(retiring.timer);
|
|
28239
|
+
retiring.close();
|
|
28240
|
+
return;
|
|
28241
|
+
}
|
|
28028
28242
|
if (paired.state.keyMismatch) this.options.events?.onPeerKeyRefused?.();
|
|
28029
28243
|
if (this.unproven(channel) || this.pinnedSince(channel, paired) || paired.authTimedOut || paired.overloaded) {
|
|
28030
28244
|
if (paired.state.keyMismatch) this.dht?.foreignKeySeen("stream");
|
|
@@ -28072,11 +28286,12 @@ var GhostLink = class {
|
|
|
28072
28286
|
this.paired = paired;
|
|
28073
28287
|
this.activeBinding = binding;
|
|
28074
28288
|
this.channelSince = Date.now();
|
|
28075
|
-
oldPaired?.stop();
|
|
28076
28289
|
const oldRtc = oldBinding ? null : this.dataLink.connection;
|
|
28077
28290
|
if (oldChannel) this.retire(oldChannel, () => {
|
|
28291
|
+
oldPaired?.stop();
|
|
28078
28292
|
if (oldRtc && this.activeBinding && this.dataLink.connection === oldRtc) this.dataLink.close();
|
|
28079
28293
|
}, !oldBinding);
|
|
28294
|
+
else oldPaired?.stop();
|
|
28080
28295
|
if (migration.plan && binding && oldBinding && WEBRTC_ATTEMPT.has(this.dataLink.state)) this.dataLink.close();
|
|
28081
28296
|
this.session.setDataLinkOpen(true);
|
|
28082
28297
|
if (migration.plan) switched = {
|
|
@@ -28155,10 +28370,13 @@ var GhostLink = class {
|
|
|
28155
28370
|
}
|
|
28156
28371
|
},
|
|
28157
28372
|
onApplication: async (data) => {
|
|
28158
|
-
|
|
28159
|
-
this.
|
|
28160
|
-
|
|
28161
|
-
|
|
28373
|
+
const retired = this.channel !== channel;
|
|
28374
|
+
if (retired && !this.retiring.has(channel)) return;
|
|
28375
|
+
if (!retired) {
|
|
28376
|
+
this.unansweredPings = 0;
|
|
28377
|
+
this.heardFromPeer();
|
|
28378
|
+
this.framesHeard++;
|
|
28379
|
+
} else if (typeof data !== "string") return;
|
|
28162
28380
|
if (typeof data !== "string") {
|
|
28163
28381
|
if (data[0] === 5) {
|
|
28164
28382
|
const range = this.supportsAppRanges && this.supportsBinaryFiles ? decodeAppRangeData(data) : null;
|
|
@@ -28181,6 +28399,7 @@ var GhostLink = class {
|
|
|
28181
28399
|
} catch {
|
|
28182
28400
|
return;
|
|
28183
28401
|
}
|
|
28402
|
+
if (retired && !RETIRING_FRAMES.has(String(frame?.t))) return;
|
|
28184
28403
|
if (frame && typeof frame === "object" && !QUIET_FRAMES.has(String(frame.t))) this.activityAt = Date.now();
|
|
28185
28404
|
if (frame?.t === "paired-ping") {
|
|
28186
28405
|
try {
|
|
@@ -28336,8 +28555,9 @@ var GhostLink = class {
|
|
|
28336
28555
|
if (!this.supportsReactions || !this.reactionsReceived.take()) return;
|
|
28337
28556
|
const reaction = parseReactionFrame(frame);
|
|
28338
28557
|
if (!reaction) return;
|
|
28339
|
-
|
|
28340
|
-
|
|
28558
|
+
const reacted = await this.options.events?.onReaction?.(reaction), live = this.answerOn(channel);
|
|
28559
|
+
if (reacted && live) try {
|
|
28560
|
+
live.send(reactedFrame(reaction.n));
|
|
28341
28561
|
} catch {}
|
|
28342
28562
|
return;
|
|
28343
28563
|
}
|
|
@@ -28350,8 +28570,9 @@ var GhostLink = class {
|
|
|
28350
28570
|
if (!this.supportsPins || !this.pinsReceived.take()) return;
|
|
28351
28571
|
const pin = parsePinFrame(frame);
|
|
28352
28572
|
if (!pin) return;
|
|
28353
|
-
|
|
28354
|
-
|
|
28573
|
+
const pinned = await this.options.events?.onPin?.(pin), live = this.answerOn(channel);
|
|
28574
|
+
if (pinned && live) try {
|
|
28575
|
+
live.send(pinnedFrame(pin.n));
|
|
28355
28576
|
} catch {}
|
|
28356
28577
|
return;
|
|
28357
28578
|
}
|
|
@@ -28364,7 +28585,8 @@ var GhostLink = class {
|
|
|
28364
28585
|
if (!this.supportsEdits || !this.editsReceived.take()) return;
|
|
28365
28586
|
const edit = parseEditFrame(frame);
|
|
28366
28587
|
if (!edit) return;
|
|
28367
|
-
|
|
28588
|
+
const edited = await this.options.events?.onMessageEdit?.(edit), live = this.answerOn(channel);
|
|
28589
|
+
if (edited && live) live.send(editedFrame(edit.id, edit.e));
|
|
28368
28590
|
return;
|
|
28369
28591
|
}
|
|
28370
28592
|
if (frame?.t === "paired-edited") {
|
|
@@ -28460,6 +28682,7 @@ var GhostLink = class {
|
|
|
28460
28682
|
return;
|
|
28461
28683
|
}
|
|
28462
28684
|
if (!frame || typeof frame.id !== "string" || !/^[A-Za-z0-9_-]{22}$/.test(frame.id)) return;
|
|
28685
|
+
if (frame.t === "paired-message" && !this.takeMessage()) return;
|
|
28463
28686
|
if (frame.t === "paired-message" && typeof frame.m === "string" && utf8Encode(frame.m).length <= LIMITS.maxChatMessageBytes && typeof frame.ts === "number" && Number.isSafeInteger(frame.ts) && frame.ts > 0) {
|
|
28464
28687
|
const preview = frame.pv === void 0 ? void 0 : parseLinkPreview(frame.pv, frame.m);
|
|
28465
28688
|
this.typingReceiver.clear();
|
|
@@ -28476,7 +28699,8 @@ var GhostLink = class {
|
|
|
28476
28699
|
...forwarded && { forwarded },
|
|
28477
28700
|
...card && { card }
|
|
28478
28701
|
});
|
|
28479
|
-
|
|
28702
|
+
const live = this.answerOn(channel);
|
|
28703
|
+
if (live) live.send(JSON.stringify({
|
|
28480
28704
|
t: "paired-received",
|
|
28481
28705
|
id: frame.id
|
|
28482
28706
|
}));
|
|
@@ -28953,6 +29177,7 @@ var GhostLink = class {
|
|
|
28953
29177
|
break;
|
|
28954
29178
|
}
|
|
28955
29179
|
case "m":
|
|
29180
|
+
if (!this.takeMessage()) break;
|
|
28956
29181
|
this.options.events?.onMessage?.({
|
|
28957
29182
|
text: frame.m,
|
|
28958
29183
|
timestamp: frame.ts,
|
|
@@ -29072,9 +29297,9 @@ var HEIF_BRANDS = /* @__PURE__ */ new Set([
|
|
|
29072
29297
|
]);
|
|
29073
29298
|
var u16be = (b, at) => b[at] << 8 | b[at + 1];
|
|
29074
29299
|
var u32be$1 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
|
|
29075
|
-
var u32le = (b, at) => (b[at] | b[at + 1] << 8 | b[at + 2] << 16 | b[at + 3] << 24) >>> 0;
|
|
29076
|
-
var text$
|
|
29077
|
-
var starts = (b, at, prefix) => at + prefix.length <= b.length && text$
|
|
29300
|
+
var u32le$1 = (b, at) => (b[at] | b[at + 1] << 8 | b[at + 2] << 16 | b[at + 3] << 24) >>> 0;
|
|
29301
|
+
var text$2 = (b, at, length) => String.fromCharCode(...b.subarray(at, at + length));
|
|
29302
|
+
var starts = (b, at, prefix) => at + prefix.length <= b.length && text$2(b, at, prefix.length) === prefix;
|
|
29078
29303
|
/** A picture this strips, by its first bytes. */
|
|
29079
29304
|
function kindOf(b) {
|
|
29080
29305
|
if (b.length >= 3 && b[0] === 255 && b[1] === 216 && b[2] === 255) return "jpeg";
|
|
@@ -29084,11 +29309,11 @@ function kindOf(b) {
|
|
|
29084
29309
|
if (starts(b, 0, "II*\0") || starts(b, 0, "MM\0*") || starts(b, 0, "II+\0") || starts(b, 0, "MM\0+")) return "tiff";
|
|
29085
29310
|
if (b.length >= 16 && starts(b, 4, "ftyp")) {
|
|
29086
29311
|
const end = Math.min(b.length, u32be$1(b, 0));
|
|
29087
|
-
for (let at = 8; at + 4 <= end; at += 4) if (at !== 12 && HEIF_BRANDS.has(text$
|
|
29312
|
+
for (let at = 8; at + 4 <= end; at += 4) if (at !== 12 && HEIF_BRANDS.has(text$2(b, at, 4))) return "heif";
|
|
29088
29313
|
}
|
|
29089
29314
|
}
|
|
29090
29315
|
/** Refuses the picture where its bytes are not what this expects. */
|
|
29091
|
-
function check$
|
|
29316
|
+
function check$2(ok) {
|
|
29092
29317
|
if (!ok) throw new Error(NO_PICTURE_METADATA);
|
|
29093
29318
|
}
|
|
29094
29319
|
/** SOFn markers: every frame type but DHT (C4), JPG (C8) and DAC (CC). */
|
|
@@ -29122,12 +29347,12 @@ function stripJpeg(b) {
|
|
|
29122
29347
|
const parts = [b.subarray(0, 2)];
|
|
29123
29348
|
let at = 2, framed = false, scanned = false, exif = false;
|
|
29124
29349
|
for (;;) {
|
|
29125
|
-
check$
|
|
29350
|
+
check$2(at < b.length && b[at] === 255);
|
|
29126
29351
|
while (at < b.length && b[at] === 255) at++;
|
|
29127
|
-
check$
|
|
29352
|
+
check$2(at < b.length);
|
|
29128
29353
|
const marker = b[at++];
|
|
29129
29354
|
if (marker === 217) {
|
|
29130
|
-
check$
|
|
29355
|
+
check$2(framed && scanned);
|
|
29131
29356
|
parts.push(Uint8Array.of(255, 217));
|
|
29132
29357
|
return parts;
|
|
29133
29358
|
}
|
|
@@ -29135,9 +29360,9 @@ function stripJpeg(b) {
|
|
|
29135
29360
|
parts.push(Uint8Array.of(255, marker));
|
|
29136
29361
|
continue;
|
|
29137
29362
|
}
|
|
29138
|
-
check$
|
|
29363
|
+
check$2(marker !== 0 && marker !== 216 && at + 2 <= b.length);
|
|
29139
29364
|
const length = u16be(b, at);
|
|
29140
|
-
check$
|
|
29365
|
+
check$2(length >= 2 && at + length <= b.length);
|
|
29141
29366
|
if (marker === 224 && length > 16 && starts(b, at + 2, "JFIF\0")) parts.push(Uint8Array.of(255, 224, 0, 16, ...b.subarray(at + 2, at + 14), 0, 0));
|
|
29142
29367
|
else if (jpegKeeps(marker, b, at + 2)) {
|
|
29143
29368
|
parts.push(Uint8Array.of(255, marker), b.subarray(at, at + length));
|
|
@@ -29149,15 +29374,15 @@ function stripJpeg(b) {
|
|
|
29149
29374
|
}
|
|
29150
29375
|
at += length;
|
|
29151
29376
|
if (marker !== 218) continue;
|
|
29152
|
-
check$
|
|
29377
|
+
check$2(framed);
|
|
29153
29378
|
scanned = true;
|
|
29154
29379
|
let end = at;
|
|
29155
29380
|
for (;;) {
|
|
29156
29381
|
end = b.indexOf(255, end);
|
|
29157
|
-
check$
|
|
29382
|
+
check$2(end >= 0);
|
|
29158
29383
|
let next = end + 1;
|
|
29159
29384
|
while (next < b.length && b[next] === 255) next++;
|
|
29160
|
-
check$
|
|
29385
|
+
check$2(next < b.length);
|
|
29161
29386
|
if (b[next] !== 0 && !(b[next] >= 208 && b[next] <= 215)) break;
|
|
29162
29387
|
end = next + 1;
|
|
29163
29388
|
}
|
|
@@ -29206,11 +29431,11 @@ function stripPng(b) {
|
|
|
29206
29431
|
const parts = [b.subarray(0, 8)];
|
|
29207
29432
|
let at = 8, exif = false, imaged = false;
|
|
29208
29433
|
for (;;) {
|
|
29209
|
-
check$
|
|
29210
|
-
const length = u32be$1(b, at), type = text$
|
|
29211
|
-
check$
|
|
29434
|
+
check$2(at + 12 <= b.length);
|
|
29435
|
+
const length = u32be$1(b, at), type = text$2(b, at + 4, 4);
|
|
29436
|
+
check$2(at + 12 + length <= b.length && (at > 8 || type === "IHDR"));
|
|
29212
29437
|
const critical = (b[at + 4] & 32) === 0;
|
|
29213
|
-
check$
|
|
29438
|
+
check$2(!critical || PNG_CRITICAL.has(type));
|
|
29214
29439
|
if (critical || PNG_DRAWS.has(type)) parts.push(b.subarray(at, at + 12 + length));
|
|
29215
29440
|
else if (type === "eXIf" && !exif && !imaged) {
|
|
29216
29441
|
exif = true;
|
|
@@ -29232,20 +29457,20 @@ var WEBP_KEEPS = /* @__PURE__ */ new Set([
|
|
|
29232
29457
|
"ICCP"
|
|
29233
29458
|
]);
|
|
29234
29459
|
function stripWebp(b) {
|
|
29235
|
-
check$
|
|
29236
|
-
const riffEnd = 8 + u32le(b, 4);
|
|
29237
|
-
check$
|
|
29460
|
+
check$2(b.length >= 20);
|
|
29461
|
+
const riffEnd = 8 + u32le$1(b, 4);
|
|
29462
|
+
check$2(riffEnd <= b.length && riffEnd % 2 === 0);
|
|
29238
29463
|
const parts = [];
|
|
29239
29464
|
let at = 12, size = 4, drawn = false, exif = false, vp8x;
|
|
29240
29465
|
while (at < riffEnd) {
|
|
29241
|
-
check$
|
|
29242
|
-
const type = text$
|
|
29243
|
-
check$
|
|
29466
|
+
check$2(at + 8 <= riffEnd);
|
|
29467
|
+
const type = text$2(b, at, 4), length = u32le$1(b, at + 4), end = at + 8 + length + (length & 1);
|
|
29468
|
+
check$2(end <= riffEnd && (at > 12 || type === "VP8 " || type === "VP8L" || type === "VP8X"));
|
|
29244
29469
|
let chunk;
|
|
29245
29470
|
if (WEBP_KEEPS.has(type)) {
|
|
29246
29471
|
chunk = b.subarray(at, end);
|
|
29247
29472
|
if (type === "VP8X") {
|
|
29248
|
-
check$
|
|
29473
|
+
check$2(length >= 10);
|
|
29249
29474
|
chunk = vp8x = chunk.slice();
|
|
29250
29475
|
chunk[8] = chunk[8] & -13;
|
|
29251
29476
|
}
|
|
@@ -29273,7 +29498,7 @@ function stripWebp(b) {
|
|
|
29273
29498
|
}
|
|
29274
29499
|
at = end;
|
|
29275
29500
|
}
|
|
29276
|
-
check$
|
|
29501
|
+
check$2(drawn);
|
|
29277
29502
|
const header = /* @__PURE__ */ new Uint8Array(12);
|
|
29278
29503
|
header.set(b.subarray(0, 12));
|
|
29279
29504
|
new DataView(header.buffer).setUint32(4, size, true);
|
|
@@ -29356,16 +29581,16 @@ var HEIF_ABOUT = /* @__PURE__ */ new Set([
|
|
|
29356
29581
|
function boxes$1(b, start, end) {
|
|
29357
29582
|
const found = [];
|
|
29358
29583
|
for (let at = start; at < end;) {
|
|
29359
|
-
check$
|
|
29584
|
+
check$2(at + 8 <= end);
|
|
29360
29585
|
let size = u32be$1(b, at), body = at + 8;
|
|
29361
|
-
const type = text$
|
|
29586
|
+
const type = text$2(b, at + 4, 4);
|
|
29362
29587
|
if (size === 1) {
|
|
29363
|
-
check$
|
|
29588
|
+
check$2(at + 16 <= end);
|
|
29364
29589
|
size = u32be$1(b, at + 8) * 2 ** 32 + u32be$1(b, at + 12);
|
|
29365
29590
|
body = at + 16;
|
|
29366
29591
|
} else if (size === 0) size = end - at;
|
|
29367
29592
|
if (type === "uuid") body += 16;
|
|
29368
|
-
check$
|
|
29593
|
+
check$2(size >= body - at && at + size <= end);
|
|
29369
29594
|
found.push({
|
|
29370
29595
|
type,
|
|
29371
29596
|
start: at,
|
|
@@ -29378,58 +29603,58 @@ function boxes$1(b, start, end) {
|
|
|
29378
29603
|
}
|
|
29379
29604
|
function stripHeif(b) {
|
|
29380
29605
|
const top = boxes$1(b, 0, b.length);
|
|
29381
|
-
check$
|
|
29606
|
+
check$2(top[0]?.type === "ftyp" && top.every((box) => HEIF_TOP.has(box.type)));
|
|
29382
29607
|
const metas = top.filter((box) => box.type === "meta");
|
|
29383
|
-
check$
|
|
29608
|
+
check$2(metas.length === 1);
|
|
29384
29609
|
const meta = metas[0];
|
|
29385
29610
|
const children = boxes$1(b, meta.body + 4, meta.end);
|
|
29386
|
-
check$
|
|
29611
|
+
check$2(children.every((box) => HEIF_META.has(box.type)));
|
|
29387
29612
|
const one = (type) => {
|
|
29388
29613
|
const of = children.filter((box) => box.type === type);
|
|
29389
|
-
check$
|
|
29614
|
+
check$2(of.length <= 1);
|
|
29390
29615
|
return of[0];
|
|
29391
29616
|
};
|
|
29392
29617
|
const iinf = one("iinf"), iloc = one("iloc"), idat = one("idat");
|
|
29393
|
-
check$
|
|
29618
|
+
check$2(!!iinf && !!iloc);
|
|
29394
29619
|
const metadata = /* @__PURE__ */ new Set();
|
|
29395
29620
|
const infeVersion = b[iinf.body];
|
|
29396
29621
|
const entries = boxes$1(b, iinf.body + 4 + (infeVersion === 0 ? 2 : 4), iinf.end);
|
|
29397
29622
|
for (const infe of entries) {
|
|
29398
|
-
check$
|
|
29623
|
+
check$2(infe.type === "infe" && infe.body + 4 <= infe.end);
|
|
29399
29624
|
const version = b[infe.body];
|
|
29400
|
-
check$
|
|
29625
|
+
check$2(version === 2 || version === 3);
|
|
29401
29626
|
let at = infe.body + 4;
|
|
29402
29627
|
const id = version === 2 ? u16be(b, at) : u32be$1(b, at);
|
|
29403
29628
|
at += version === 2 ? 2 : 4;
|
|
29404
|
-
check$
|
|
29405
|
-
if (HEIF_METADATA_ITEMS.has(text$
|
|
29629
|
+
check$2(at + 6 <= infe.end);
|
|
29630
|
+
if (HEIF_METADATA_ITEMS.has(text$2(b, at + 2, 4))) metadata.add(id);
|
|
29406
29631
|
}
|
|
29407
29632
|
const iprp = one("iprp"), properties = [];
|
|
29408
29633
|
if (iprp) {
|
|
29409
29634
|
const held = boxes$1(b, iprp.body, iprp.end);
|
|
29410
29635
|
const ipco = held.filter((box) => box.type === "ipco");
|
|
29411
|
-
check$
|
|
29636
|
+
check$2(ipco.length === 1 && held.every((box) => box.type === "ipco" || box.type === "ipma"));
|
|
29412
29637
|
properties.push(...boxes$1(b, ipco[0].body, ipco[0].end));
|
|
29413
|
-
check$
|
|
29638
|
+
check$2(properties.every((box) => HEIF_DRAWS.has(box.type) || HEIF_ABOUT.has(box.type)));
|
|
29414
29639
|
}
|
|
29415
29640
|
/** `free` and `skip` boxes, at the top and in `meta`, and the properties about the picture: their bodies go as zeros. */
|
|
29416
29641
|
const space = [...[...top, ...children].filter((box) => box.type === "free" || box.type === "skip"), ...properties.filter((box) => HEIF_ABOUT.has(box.type))];
|
|
29417
29642
|
const out = b.slice();
|
|
29418
29643
|
const version = b[iloc.body];
|
|
29419
|
-
check$
|
|
29644
|
+
check$2(version <= 2);
|
|
29420
29645
|
let at = iloc.body + 4;
|
|
29421
29646
|
/** The next field of `size` bytes (0, 2, 4 or 8), big-endian. */
|
|
29422
29647
|
const read = (size) => {
|
|
29423
|
-
check$
|
|
29648
|
+
check$2(at + size <= iloc.end);
|
|
29424
29649
|
const value = size === 0 ? 0 : size === 2 ? u16be(b, at) : size === 4 ? u32be$1(b, at) : size === 8 ? u32be$1(b, at) * 2 ** 32 + u32be$1(b, at + 4) : NaN;
|
|
29425
|
-
check$
|
|
29650
|
+
check$2(Number.isSafeInteger(value));
|
|
29426
29651
|
at += size;
|
|
29427
29652
|
return value;
|
|
29428
29653
|
};
|
|
29429
29654
|
const read2 = () => read(2);
|
|
29430
|
-
check$
|
|
29655
|
+
check$2(at + 2 <= iloc.end);
|
|
29431
29656
|
const offsetSize = b[at] >> 4, lengthSize = b[at] & 15, baseSize = b[at + 1] >> 4, indexSize = version > 0 ? b[at + 1] & 15 : 0;
|
|
29432
|
-
check$
|
|
29657
|
+
check$2([
|
|
29433
29658
|
offsetSize,
|
|
29434
29659
|
lengthSize,
|
|
29435
29660
|
baseSize,
|
|
@@ -29448,12 +29673,12 @@ function stripHeif(b) {
|
|
|
29448
29673
|
const offset = read(offsetSize), length = read(lengthSize);
|
|
29449
29674
|
if (!metadata.has(id)) {
|
|
29450
29675
|
const start = base + offset, end = length ? start + length : b.length;
|
|
29451
|
-
check$
|
|
29676
|
+
check$2(reference !== 0 || method !== 0 || !space.some((box) => start < box.end && end > box.body));
|
|
29452
29677
|
continue;
|
|
29453
29678
|
}
|
|
29454
|
-
check$
|
|
29679
|
+
check$2(reference === 0 && length > 0 && (method === 0 || method === 1 && !!idat));
|
|
29455
29680
|
const start = (method === 1 ? idat.body : 0) + base + offset, limit = method === 1 ? idat.end : b.length;
|
|
29456
|
-
check$
|
|
29681
|
+
check$2(start + length <= limit);
|
|
29457
29682
|
out.fill(0, start, start + length);
|
|
29458
29683
|
}
|
|
29459
29684
|
}
|
|
@@ -29466,44 +29691,44 @@ var GIF_APPS_KEPT = /* @__PURE__ */ new Set([
|
|
|
29466
29691
|
"ICCRGBG1012"
|
|
29467
29692
|
]);
|
|
29468
29693
|
function stripGif(b) {
|
|
29469
|
-
check$
|
|
29694
|
+
check$2(b.length >= 13);
|
|
29470
29695
|
/** A colour table's bytes, from the flags that say it is there and its size. */
|
|
29471
29696
|
const table = (flags) => flags & 128 ? 3 << (flags & 7) + 1 : 0;
|
|
29472
29697
|
/** The end of the data sub-blocks at `at`, past their empty block. */
|
|
29473
29698
|
const blocks = (at) => {
|
|
29474
29699
|
for (;;) {
|
|
29475
|
-
check$
|
|
29700
|
+
check$2(at < b.length);
|
|
29476
29701
|
const length = b[at];
|
|
29477
29702
|
at += 1 + length;
|
|
29478
29703
|
if (!length) return at;
|
|
29479
29704
|
}
|
|
29480
29705
|
};
|
|
29481
29706
|
let at = 13 + table(b[10]), framed = false;
|
|
29482
|
-
check$
|
|
29707
|
+
check$2(at <= b.length);
|
|
29483
29708
|
const parts = [b.subarray(0, at)];
|
|
29484
29709
|
for (;;) {
|
|
29485
|
-
check$
|
|
29710
|
+
check$2(at < b.length);
|
|
29486
29711
|
const introducer = b[at];
|
|
29487
29712
|
if (introducer === 59) {
|
|
29488
|
-
check$
|
|
29713
|
+
check$2(framed);
|
|
29489
29714
|
parts.push(Uint8Array.of(59));
|
|
29490
29715
|
return parts;
|
|
29491
29716
|
}
|
|
29492
29717
|
if (introducer === 44) {
|
|
29493
|
-
check$
|
|
29718
|
+
check$2(at + 10 <= b.length);
|
|
29494
29719
|
const data = at + 10 + table(b[at + 9]);
|
|
29495
|
-
check$
|
|
29720
|
+
check$2(data < b.length);
|
|
29496
29721
|
const end = blocks(data + 1);
|
|
29497
29722
|
parts.push(b.subarray(at, end));
|
|
29498
29723
|
framed = true;
|
|
29499
29724
|
at = end;
|
|
29500
29725
|
continue;
|
|
29501
29726
|
}
|
|
29502
|
-
check$
|
|
29727
|
+
check$2(introducer === 33 && at + 2 < b.length);
|
|
29503
29728
|
const label = b[at + 1], end = blocks(at + 2);
|
|
29504
|
-
const app = label === 255 && b[at + 2] === 11 && GIF_APPS_KEPT.has(text$
|
|
29729
|
+
const app = label === 255 && b[at + 2] === 11 && GIF_APPS_KEPT.has(text$2(b, at + 3, 11));
|
|
29505
29730
|
if (label === 249 || label === 1 || app) parts.push(b.subarray(at, end));
|
|
29506
|
-
else check$
|
|
29731
|
+
else check$2(label === 254 || label === 255);
|
|
29507
29732
|
at = end;
|
|
29508
29733
|
}
|
|
29509
29734
|
}
|
|
@@ -29622,18 +29847,18 @@ var TIFF_TYPE_BYTES = [
|
|
|
29622
29847
|
function stripTiff(b) {
|
|
29623
29848
|
const little = b[0] === 73;
|
|
29624
29849
|
const u16 = (at) => {
|
|
29625
|
-
check$
|
|
29850
|
+
check$2(at + 2 <= b.length);
|
|
29626
29851
|
return little ? b[at] | b[at + 1] << 8 : u16be(b, at);
|
|
29627
29852
|
};
|
|
29628
29853
|
const u32 = (at) => {
|
|
29629
|
-
check$
|
|
29630
|
-
return little ? u32le(b, at) : u32be$1(b, at);
|
|
29854
|
+
check$2(at + 4 <= b.length);
|
|
29855
|
+
return little ? u32le$1(b, at) : u32be$1(b, at);
|
|
29631
29856
|
};
|
|
29632
|
-
check$
|
|
29857
|
+
check$2(b.length >= 8 && u16(2) === 42);
|
|
29633
29858
|
const out = b.slice(), seen = /* @__PURE__ */ new Set();
|
|
29634
29859
|
/** An IFD's entries: tag, type, the value's first byte (in the entry or where it points) and its bytes. */
|
|
29635
29860
|
const entries = (ifd) => {
|
|
29636
|
-
check$
|
|
29861
|
+
check$2(ifd >= 8 && !seen.has(ifd) && seen.size < 1024);
|
|
29637
29862
|
seen.add(ifd);
|
|
29638
29863
|
const count = u16(ifd), next = ifd + 2 + count * 12;
|
|
29639
29864
|
u32(next);
|
|
@@ -29641,10 +29866,10 @@ function stripTiff(b) {
|
|
|
29641
29866
|
next,
|
|
29642
29867
|
list: Array.from({ length: count }, (_, i) => {
|
|
29643
29868
|
const at = ifd + 2 + i * 12, tag = u16(at), type = u16(at + 2);
|
|
29644
|
-
check$
|
|
29869
|
+
check$2(type >= 1 && type < TIFF_TYPE_BYTES.length);
|
|
29645
29870
|
const bytes = TIFF_TYPE_BYTES[type] * u32(at + 4);
|
|
29646
29871
|
const value = bytes <= 4 ? at + 8 : u32(at + 8);
|
|
29647
|
-
check$
|
|
29872
|
+
check$2(Number.isSafeInteger(bytes) && value + bytes <= b.length);
|
|
29648
29873
|
return {
|
|
29649
29874
|
at,
|
|
29650
29875
|
tag,
|
|
@@ -29659,7 +29884,7 @@ function stripTiff(b) {
|
|
|
29659
29884
|
const empty = (ifd) => {
|
|
29660
29885
|
const { next, list } = entries(ifd);
|
|
29661
29886
|
for (const entry of list) {
|
|
29662
|
-
check$
|
|
29887
|
+
check$2(entry.tag !== 37500);
|
|
29663
29888
|
if (TIFF_METADATA_IFDS.has(entry.tag)) empty(u32(entry.value));
|
|
29664
29889
|
out.fill(0, entry.value, entry.value + entry.bytes);
|
|
29665
29890
|
}
|
|
@@ -29669,16 +29894,16 @@ function stripTiff(b) {
|
|
|
29669
29894
|
const { next, list } = entries(ifd);
|
|
29670
29895
|
let kept = 0;
|
|
29671
29896
|
for (const { at, tag, value, bytes } of list) {
|
|
29672
|
-
if (tag === 259) check$
|
|
29897
|
+
if (tag === 259) check$2(TIFF_COMPRESSION.has(u16(value)));
|
|
29673
29898
|
if (TIFF_METADATA_IFDS.has(tag)) {
|
|
29674
29899
|
empty(u32(value));
|
|
29675
29900
|
continue;
|
|
29676
29901
|
}
|
|
29677
29902
|
if (TIFF_METADATA.has(tag)) out.fill(0, value, value + bytes);
|
|
29678
|
-
else check$
|
|
29903
|
+
else check$2(TIFF_DRAWS.has(tag));
|
|
29679
29904
|
out.copyWithin(ifd + 2 + kept++ * 12, at, at + 12);
|
|
29680
29905
|
}
|
|
29681
|
-
check$
|
|
29906
|
+
check$2(kept > 0);
|
|
29682
29907
|
const end = ifd + 2 + kept * 12;
|
|
29683
29908
|
out.set(little ? [kept & 255, kept >> 8] : [kept >> 8, kept & 255], ifd);
|
|
29684
29909
|
out.set(b.subarray(next, next + 4), end);
|
|
@@ -29744,7 +29969,8 @@ async function withoutPictureMetadata(source, mime) {
|
|
|
29744
29969
|
*
|
|
29745
29970
|
* Fail-closed: a file that is an MP4 or QuickTime video, by its bytes or by its type, and whose metadata cannot be
|
|
29746
29971
|
* removed (truncated, malformed, a part of its movie this does not know) is refused with `NO_VIDEO_METADATA`, never sent as it was.
|
|
29747
|
-
* A picture (HEIF is pictureMetadata.ts's)
|
|
29972
|
+
* A picture (HEIF is pictureMetadata.ts's) and any other file go as they are; so does a file without a video track (an
|
|
29973
|
+
* M4A) here: audioMetadata.ts strips it.
|
|
29748
29974
|
*/
|
|
29749
29975
|
var VIDEO_METADATA_LIMITS = {
|
|
29750
29976
|
/** The largest `moov` or `moof` read whole, and the most bytes of a metadata track's chunk: past this the video is refused. */
|
|
@@ -29880,25 +30106,25 @@ var VISUAL = /* @__PURE__ */ new Set([
|
|
|
29880
30106
|
"pict"
|
|
29881
30107
|
]);
|
|
29882
30108
|
/** Zeros put in a Blob a slice at a time: a Blob's Blob parts are not copied, so a zeroed range of any size holds no more. */
|
|
29883
|
-
var ZEROS = new Blob([/* @__PURE__ */ new Uint8Array(1048576)]);
|
|
30109
|
+
var ZEROS$1 = new Blob([/* @__PURE__ */ new Uint8Array(1048576)]);
|
|
29884
30110
|
var u32be = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
|
|
29885
|
-
var text = (b, at, length) => String.fromCharCode(...b.subarray(at, at + length));
|
|
30111
|
+
var text$1 = (b, at, length) => String.fromCharCode(...b.subarray(at, at + length));
|
|
29886
30112
|
/** Refuses the video where its bytes are not what this expects. */
|
|
29887
|
-
function check(ok) {
|
|
30113
|
+
function check$1(ok) {
|
|
29888
30114
|
if (!ok) throw new Error(NO_VIDEO_METADATA);
|
|
29889
30115
|
}
|
|
29890
30116
|
/** A box's header at `at` of `b` (`base` its offset in the file), up to `end` (a size of 0 runs to it). */
|
|
29891
30117
|
function header(b, at, end, base = 0) {
|
|
29892
|
-
check(at + 8 <= b.length);
|
|
30118
|
+
check$1(at + 8 <= b.length);
|
|
29893
30119
|
let size = u32be(b, at), body = at + 8;
|
|
29894
|
-
const type = text(b, at + 4, 4);
|
|
30120
|
+
const type = text$1(b, at + 4, 4);
|
|
29895
30121
|
if (size === 1) {
|
|
29896
|
-
check(at + 16 <= b.length);
|
|
30122
|
+
check$1(at + 16 <= b.length);
|
|
29897
30123
|
size = u32be(b, at + 8) * 2 ** 32 + u32be(b, at + 12);
|
|
29898
30124
|
body = at + 16;
|
|
29899
30125
|
} else if (size === 0) size = end - (base + at);
|
|
29900
30126
|
if (type === "uuid") body += 16;
|
|
29901
|
-
check(Number.isSafeInteger(size) && size >= body - at && base + at + size <= end);
|
|
30127
|
+
check$1(Number.isSafeInteger(size) && size >= body - at && base + at + size <= end);
|
|
29902
30128
|
return {
|
|
29903
30129
|
type,
|
|
29904
30130
|
start: base + at,
|
|
@@ -29909,7 +30135,7 @@ function header(b, at, end, base = 0) {
|
|
|
29909
30135
|
function boxes(b, start, end) {
|
|
29910
30136
|
const found = [];
|
|
29911
30137
|
for (let at = start; at < end;) {
|
|
29912
|
-
check(at + 8 <= end);
|
|
30138
|
+
check$1(at + 8 <= end);
|
|
29913
30139
|
const box = header(b.subarray(0, end), at, end);
|
|
29914
30140
|
found.push(box);
|
|
29915
30141
|
at = box.end;
|
|
@@ -29943,32 +30169,32 @@ function emptyWithin(b, start, end) {
|
|
|
29943
30169
|
*/
|
|
29944
30170
|
function zeroCompressorNames(b, stbl) {
|
|
29945
30171
|
const stsd = child(b, stbl, "stsd");
|
|
29946
|
-
check(!!stsd && stsd.body + 8 <= stsd.end);
|
|
30172
|
+
check$1(!!stsd && stsd.body + 8 <= stsd.end);
|
|
29947
30173
|
for (const entry of boxes(b, stsd.body + 8, stsd.end)) {
|
|
29948
|
-
check(entry.body + 74 <= entry.end);
|
|
30174
|
+
check$1(entry.body + 74 <= entry.end);
|
|
29949
30175
|
b.fill(0, entry.body + 42, entry.body + 74);
|
|
29950
30176
|
}
|
|
29951
30177
|
}
|
|
29952
30178
|
/** A `mvhd`, `tkhd` or `mdhd` with its creation and modification times zeroed: 32 bits each in version 0, 64 in 1. */
|
|
29953
30179
|
function zeroTimes(b, box) {
|
|
29954
30180
|
const version = b[box.body], bytes = version === 1 ? 16 : 8;
|
|
29955
|
-
check(version <= 1 && box.body + 4 + bytes <= box.end);
|
|
30181
|
+
check$1(version <= 1 && box.body + 4 + bytes <= box.end);
|
|
29956
30182
|
b.fill(0, box.body + 4, box.body + 4 + bytes);
|
|
29957
30183
|
}
|
|
29958
30184
|
var child = (b, parent, type) => {
|
|
29959
30185
|
if (!parent) return void 0;
|
|
29960
30186
|
const of = boxes(b, parent.body, parent.end).filter((box) => box.type === type);
|
|
29961
|
-
check(of.length <= 1);
|
|
30187
|
+
check$1(of.length <= 1);
|
|
29962
30188
|
return of[0];
|
|
29963
30189
|
};
|
|
29964
30190
|
/** A sample table's chunks, from its `stco` or `co64`: how many, and where each starts in the file. */
|
|
29965
30191
|
function chunkOffsets(b, stbl) {
|
|
29966
30192
|
const stco = child(b, stbl, "stco"), co64 = child(b, stbl, "co64");
|
|
29967
|
-
check(!!stco !== !!co64);
|
|
30193
|
+
check$1(!!stco !== !!co64);
|
|
29968
30194
|
const offsets = stco ?? co64;
|
|
29969
|
-
check(offsets.body + 8 <= offsets.end);
|
|
30195
|
+
check$1(offsets.body + 8 <= offsets.end);
|
|
29970
30196
|
const chunks = u32be(b, offsets.body + 4);
|
|
29971
|
-
check(offsets.body + 8 + chunks * (co64 ? 8 : 4) <= offsets.end);
|
|
30197
|
+
check$1(offsets.body + 8 + chunks * (co64 ? 8 : 4) <= offsets.end);
|
|
29972
30198
|
const offsetOf = (i) => co64 ? u32be(b, co64.body + 8 + i * 8) * 2 ** 32 + u32be(b, co64.body + 12 + i * 8) : u32be(b, stco.body + 8 + i * 4);
|
|
29973
30199
|
return {
|
|
29974
30200
|
chunks,
|
|
@@ -29978,8 +30204,8 @@ function chunkOffsets(b, stbl) {
|
|
|
29978
30204
|
/** The byte ranges of a track's samples in the file, one per chunk, from its sample table. */
|
|
29979
30205
|
function sampleRanges(b, stbl) {
|
|
29980
30206
|
const stsz = child(b, stbl, "stsz"), stz2 = child(b, stbl, "stz2"), stsc = child(b, stbl, "stsc");
|
|
29981
|
-
check(!!stsc && !!stsz !== !!stz2);
|
|
29982
|
-
const need = (box, at, bytes) => check(at + bytes <= box.end);
|
|
30207
|
+
check$1(!!stsc && !!stsz !== !!stz2);
|
|
30208
|
+
const need = (box, at, bytes) => check$1(at + bytes <= box.end);
|
|
29983
30209
|
const sizeTable = stsz ?? stz2;
|
|
29984
30210
|
need(sizeTable, sizeTable.body, 12);
|
|
29985
30211
|
const count = u32be(b, sizeTable.body + 8);
|
|
@@ -29992,7 +30218,7 @@ function sampleRanges(b, stbl) {
|
|
|
29992
30218
|
sizeOf = (i) => u32be(b, stsz.body + 12 + i * 4);
|
|
29993
30219
|
} else {
|
|
29994
30220
|
const field = b[stz2.body + 7];
|
|
29995
|
-
check(field === 4 || field === 8 || field === 16);
|
|
30221
|
+
check$1(field === 4 || field === 8 || field === 16);
|
|
29996
30222
|
need(stz2, stz2.body + 12, Math.ceil(count * field / 8));
|
|
29997
30223
|
const at = stz2.body + 12;
|
|
29998
30224
|
sizeOf = field === 16 ? (i) => b[at + i * 2] << 8 | b[at + i * 2 + 1] : field === 8 ? (i) => b[at + i] : (i) => i & 1 ? b[at + (i >> 1)] & 15 : b[at + (i >> 1)] >> 4;
|
|
@@ -30006,18 +30232,18 @@ function sampleRanges(b, stbl) {
|
|
|
30006
30232
|
for (let run = 0; run < runs; run++) {
|
|
30007
30233
|
const first = u32be(b, stsc.body + 8 + run * 12), perChunk = u32be(b, stsc.body + 12 + run * 12);
|
|
30008
30234
|
const last = run + 1 < runs ? u32be(b, stsc.body + 8 + (run + 1) * 12) : chunks + 1;
|
|
30009
|
-
check(first >= 1 && last > first && last <= chunks + 1);
|
|
30235
|
+
check$1(first >= 1 && last > first && last <= chunks + 1);
|
|
30010
30236
|
for (let chunk = first; chunk < last; chunk++) {
|
|
30011
30237
|
const start = offsetOf(chunk - 1);
|
|
30012
|
-
check(sample + perChunk <= count);
|
|
30238
|
+
check$1(sample + perChunk <= count);
|
|
30013
30239
|
let length = uniform * perChunk;
|
|
30014
30240
|
if (!uniform) for (let i = 0; i < perChunk; i++) length += sizeOf(sample + i);
|
|
30015
30241
|
sample += perChunk;
|
|
30016
|
-
check(Number.isSafeInteger(start) && length <= VIDEO_METADATA_LIMITS.maxBoxBytes);
|
|
30242
|
+
check$1(Number.isSafeInteger(start) && length <= VIDEO_METADATA_LIMITS.maxBoxBytes);
|
|
30017
30243
|
if (length) ranges.push([start, start + length]);
|
|
30018
30244
|
}
|
|
30019
30245
|
}
|
|
30020
|
-
check(sample === count);
|
|
30246
|
+
check$1(sample === count);
|
|
30021
30247
|
return ranges;
|
|
30022
30248
|
}
|
|
30023
30249
|
/** Each track's default sample size in fragments, from `moov`'s `mvex/trex` boxes, by track ID. */
|
|
@@ -30026,7 +30252,7 @@ function defaultSampleSizes(moov) {
|
|
|
30026
30252
|
const mvex = child(moov, header(moov, 0, moov.length), "mvex");
|
|
30027
30253
|
for (const trex of mvex ? boxes(moov, mvex.body, mvex.end) : []) {
|
|
30028
30254
|
if (trex.type !== "trex") continue;
|
|
30029
|
-
check(trex.body + 24 <= trex.end);
|
|
30255
|
+
check$1(trex.body + 24 <= trex.end);
|
|
30030
30256
|
sizes.set(u32be(moov, trex.body + 4), u32be(moov, trex.body + 16));
|
|
30031
30257
|
}
|
|
30032
30258
|
return sizes;
|
|
@@ -30044,11 +30270,11 @@ function fragmentRanges(b, at, sizes) {
|
|
|
30044
30270
|
for (const traf of boxes(b, header(b, 0, b.length).body, b.length)) {
|
|
30045
30271
|
if (traf.type !== "traf") continue;
|
|
30046
30272
|
const tfhd = child(b, traf, "tfhd");
|
|
30047
|
-
check(!!tfhd && tfhd.body + 8 <= tfhd.end);
|
|
30273
|
+
check$1(!!tfhd && tfhd.body + 8 <= tfhd.end);
|
|
30048
30274
|
const flags = u32be(b, tfhd.body) & 16777215;
|
|
30049
30275
|
let field = tfhd.body + 8, base = flags & 131072 ? at : previous;
|
|
30050
30276
|
if (flags & 1) {
|
|
30051
|
-
check(field + 8 <= tfhd.end);
|
|
30277
|
+
check$1(field + 8 <= tfhd.end);
|
|
30052
30278
|
base = u32be(b, field) * 2 ** 32 + u32be(b, field + 4);
|
|
30053
30279
|
field += 8;
|
|
30054
30280
|
}
|
|
@@ -30057,17 +30283,17 @@ function fragmentRanges(b, at, sizes) {
|
|
|
30057
30283
|
const track = u32be(b, tfhd.body + 4);
|
|
30058
30284
|
let size = sizes.get(track);
|
|
30059
30285
|
if (flags & 16) {
|
|
30060
|
-
check(field + 4 <= tfhd.end);
|
|
30286
|
+
check$1(field + 4 <= tfhd.end);
|
|
30061
30287
|
size = u32be(b, field);
|
|
30062
30288
|
}
|
|
30063
30289
|
let next = base;
|
|
30064
30290
|
for (const trun of boxes(b, traf.body, traf.end)) {
|
|
30065
30291
|
if (trun.type !== "trun") continue;
|
|
30066
|
-
check(trun.body + 8 <= trun.end);
|
|
30292
|
+
check$1(trun.body + 8 <= trun.end);
|
|
30067
30293
|
const runFlags = u32be(b, trun.body) & 16777215, count = u32be(b, trun.body + 4);
|
|
30068
30294
|
let field = trun.body + 8;
|
|
30069
30295
|
if (runFlags & 1) {
|
|
30070
|
-
check(field + 4 <= trun.end);
|
|
30296
|
+
check$1(field + 4 <= trun.end);
|
|
30071
30297
|
next = base + (u32be(b, field) | 0);
|
|
30072
30298
|
field += 4;
|
|
30073
30299
|
}
|
|
@@ -30078,16 +30304,16 @@ function fragmentRanges(b, at, sizes) {
|
|
|
30078
30304
|
1024,
|
|
30079
30305
|
2048
|
|
30080
30306
|
].filter((flag) => runFlags & flag).length * 4;
|
|
30081
|
-
check(field + count * stride <= trun.end);
|
|
30307
|
+
check$1(field + count * stride <= trun.end);
|
|
30082
30308
|
let length = 0;
|
|
30083
30309
|
if (runFlags & 512) {
|
|
30084
30310
|
const sizeAt = field + (runFlags & 256 ? 4 : 0);
|
|
30085
30311
|
for (let i = 0; i < count; i++) length += u32be(b, sizeAt + i * stride);
|
|
30086
30312
|
} else if (count) {
|
|
30087
|
-
check(size !== void 0);
|
|
30313
|
+
check$1(size !== void 0);
|
|
30088
30314
|
length = count * size;
|
|
30089
30315
|
}
|
|
30090
|
-
check(Number.isSafeInteger(next) && Number.isSafeInteger(next + length));
|
|
30316
|
+
check$1(Number.isSafeInteger(next) && Number.isSafeInteger(next + length));
|
|
30091
30317
|
if (length) ranges.push([
|
|
30092
30318
|
next,
|
|
30093
30319
|
next + length,
|
|
@@ -30119,7 +30345,7 @@ function stripMoov(b) {
|
|
|
30119
30345
|
empty(b, box);
|
|
30120
30346
|
continue;
|
|
30121
30347
|
}
|
|
30122
|
-
check(MOOV_KEEPS.has(box.type));
|
|
30348
|
+
check$1(MOOV_KEEPS.has(box.type));
|
|
30123
30349
|
if (SPACE.has(box.type)) b.fill(0, box.body, box.end);
|
|
30124
30350
|
if (box.type === "mvhd") zeroTimes(b, box);
|
|
30125
30351
|
if (box.type === "mvex") {
|
|
@@ -30133,39 +30359,39 @@ function stripMoov(b) {
|
|
|
30133
30359
|
empty(b, part);
|
|
30134
30360
|
continue;
|
|
30135
30361
|
}
|
|
30136
|
-
check(TRAK_KEEPS.has(part.type));
|
|
30362
|
+
check$1(TRAK_KEEPS.has(part.type));
|
|
30137
30363
|
if (part.type === "tkhd") {
|
|
30138
|
-
check(!tkhd);
|
|
30364
|
+
check$1(!tkhd);
|
|
30139
30365
|
tkhd = part;
|
|
30140
30366
|
zeroTimes(b, part);
|
|
30141
30367
|
}
|
|
30142
30368
|
if (part.type === "mdia") {
|
|
30143
|
-
check(!mdia);
|
|
30369
|
+
check$1(!mdia);
|
|
30144
30370
|
mdia = part;
|
|
30145
30371
|
}
|
|
30146
30372
|
}
|
|
30147
|
-
check(!!mdia);
|
|
30373
|
+
check$1(!!mdia);
|
|
30148
30374
|
const hdlr = child(b, mdia, "hdlr"), minf = child(b, mdia, "minf"), mdhd = child(b, mdia, "mdhd");
|
|
30149
|
-
check(!!hdlr && !!minf && hdlr.body + 12 <= hdlr.end);
|
|
30375
|
+
check$1(!!hdlr && !!minf && hdlr.body + 12 <= hdlr.end);
|
|
30150
30376
|
if (mdhd) zeroTimes(b, mdhd);
|
|
30151
|
-
const handler = text(b, hdlr.body + 8, 4);
|
|
30377
|
+
const handler = text$1(b, hdlr.body + 8, 4);
|
|
30152
30378
|
const stbl = child(b, minf, "stbl");
|
|
30153
|
-
check(!!stbl);
|
|
30379
|
+
check$1(!!stbl);
|
|
30154
30380
|
tables.push(stbl);
|
|
30155
30381
|
if (handler === "meta") {
|
|
30156
|
-
check(selfContained(b, minf));
|
|
30382
|
+
check$1(selfContained(b, minf));
|
|
30157
30383
|
metadata = true;
|
|
30158
30384
|
for (const range of sampleRanges(b, stbl)) zeroed.push(range);
|
|
30159
30385
|
} else if (handler === "tmcd" && selfContained(b, minf)) {
|
|
30160
30386
|
metadata = true;
|
|
30161
30387
|
for (const range of sampleRanges(b, stbl)) zeroed.push(range);
|
|
30162
30388
|
} else if (CAPTIONS.has(handler)) {
|
|
30163
|
-
check(selfContained(b, minf) && !!tkhd);
|
|
30389
|
+
check$1(selfContained(b, minf) && !!tkhd);
|
|
30164
30390
|
const id = tkhd.body + 4 + (b[tkhd.body] === 1 ? 16 : 8);
|
|
30165
|
-
check(id + 4 <= tkhd.end);
|
|
30391
|
+
check$1(id + 4 <= tkhd.end);
|
|
30166
30392
|
captions.add(u32be(b, id));
|
|
30167
30393
|
for (const range of sampleRanges(b, stbl)) zeroed.push(range);
|
|
30168
|
-
} else check(HANDLERS.has(handler));
|
|
30394
|
+
} else check$1(HANDLERS.has(handler));
|
|
30169
30395
|
if (handler === "vide") video = true;
|
|
30170
30396
|
if (VISUAL.has(handler)) zeroCompressorNames(b, stbl);
|
|
30171
30397
|
emptyWithin(b, box.body, box.end);
|
|
@@ -30223,9 +30449,9 @@ async function headerAt(source, at) {
|
|
|
30223
30449
|
}
|
|
30224
30450
|
/** A box read whole, within the limit. */
|
|
30225
30451
|
async function whole(source, box) {
|
|
30226
|
-
check(box.end - box.start <= VIDEO_METADATA_LIMITS.maxBoxBytes);
|
|
30452
|
+
check$1(box.end - box.start <= VIDEO_METADATA_LIMITS.maxBoxBytes);
|
|
30227
30453
|
const bytes = await source.read(box.start, box.end - box.start);
|
|
30228
|
-
check(bytes.length === box.end - box.start);
|
|
30454
|
+
check$1(bytes.length === box.end - box.start);
|
|
30229
30455
|
return bytes;
|
|
30230
30456
|
}
|
|
30231
30457
|
/**
|
|
@@ -30234,7 +30460,7 @@ async function whole(source, box) {
|
|
|
30234
30460
|
* pictureMetadata.ts's.
|
|
30235
30461
|
*/
|
|
30236
30462
|
function containerOf(head, mime) {
|
|
30237
|
-
const first = head.length >= 8 ? text(head, 4, 4) : "";
|
|
30463
|
+
const first = head.length >= 8 ? text$1(head, 4, 4) : "";
|
|
30238
30464
|
if (isStrippedPicture(head, mime)) return void 0;
|
|
30239
30465
|
if (FIRST_BOXES.has(first)) return "movie";
|
|
30240
30466
|
return TOP_KEEPS.has(first) || TOP_EMPTIED.has(first) ? "boxes" : void 0;
|
|
@@ -30255,7 +30481,7 @@ async function withoutVideoMetadata(source, mime) {
|
|
|
30255
30481
|
for (const patch of patches) {
|
|
30256
30482
|
if (patch.start > at) parts.push(source.slice(at, patch.start));
|
|
30257
30483
|
if (patch.bytes) parts.push(patch.bytes);
|
|
30258
|
-
else for (let left = patch.end - patch.start; left > 0; left -= ZEROS.size) parts.push(ZEROS.slice(0, Math.min(left, ZEROS.size)));
|
|
30484
|
+
else for (let left = patch.end - patch.start; left > 0; left -= ZEROS$1.size) parts.push(ZEROS$1.slice(0, Math.min(left, ZEROS$1.size)));
|
|
30259
30485
|
at = patch.end;
|
|
30260
30486
|
}
|
|
30261
30487
|
if (at < source.size) parts.push(source.slice(at));
|
|
@@ -30264,9 +30490,9 @@ async function withoutVideoMetadata(source, mime) {
|
|
|
30264
30490
|
/**
|
|
30265
30491
|
* What `withoutVideoMetadata` changes in a video read from `source` (one not held in a Blob: a file kept in storage):
|
|
30266
30492
|
* the parts replaced, in order and apart, the rest of its bytes going as they are; undefined when it goes as it is.
|
|
30267
|
-
* Throws `NO_VIDEO_METADATA` as it does.
|
|
30493
|
+
* Throws `NO_VIDEO_METADATA` as it does. With `audio`, a movie without a video track (an M4A) is stripped too.
|
|
30268
30494
|
*/
|
|
30269
|
-
async function videoMetadataPatches(file, mime) {
|
|
30495
|
+
async function videoMetadataPatches(file, mime, audio = false) {
|
|
30270
30496
|
const source = readingAhead(file);
|
|
30271
30497
|
const head = await source.read(0, VIDEO_METADATA_LIMITS.headBytes);
|
|
30272
30498
|
const typed = STRIPPED_TYPES.has(mime.split(";")[0].trim().toLowerCase());
|
|
@@ -30282,7 +30508,7 @@ async function videoMetadataPatches(file, mime) {
|
|
|
30282
30508
|
const dropped = [];
|
|
30283
30509
|
let trailer = false;
|
|
30284
30510
|
for (let at = 0; at < source.size;) {
|
|
30285
|
-
check(top.length < VIDEO_METADATA_LIMITS.maxBoxes);
|
|
30511
|
+
check$1(top.length < VIDEO_METADATA_LIMITS.maxBoxes);
|
|
30286
30512
|
const box = await headerAt(source, at);
|
|
30287
30513
|
if (!box || top.length && box.type === "\0\0\0\0") {
|
|
30288
30514
|
patches.push({
|
|
@@ -30300,13 +30526,13 @@ async function videoMetadataPatches(file, mime) {
|
|
|
30300
30526
|
}
|
|
30301
30527
|
const moovs = top.filter((box) => box.type === "moov");
|
|
30302
30528
|
if (!moovs.length && container === "boxes" && !typed) {
|
|
30303
|
-
check(!trailer && top.every((box) => TOP_KEEPS.has(box.type) || TOP_EMPTIED.has(box.type)));
|
|
30529
|
+
check$1(!trailer && top.every((box) => TOP_KEEPS.has(box.type) || TOP_EMPTIED.has(box.type)));
|
|
30304
30530
|
return;
|
|
30305
30531
|
}
|
|
30306
|
-
check(moovs.length === 1);
|
|
30532
|
+
check$1(moovs.length === 1);
|
|
30307
30533
|
const moov = await whole(source, moovs[0]);
|
|
30308
30534
|
const { video, fragmented, metadata, zeroed, tables, captions } = stripMoov(moov);
|
|
30309
|
-
if (!video && !typed) return void 0;
|
|
30535
|
+
if (!video && !typed && !audio) return void 0;
|
|
30310
30536
|
patches.push({
|
|
30311
30537
|
start: moovs[0].start,
|
|
30312
30538
|
end: moovs[0].end,
|
|
@@ -30316,15 +30542,15 @@ async function videoMetadataPatches(file, mime) {
|
|
|
30316
30542
|
const { chunks, offsetOf } = chunkOffsets(moov, stbl);
|
|
30317
30543
|
for (let i = 0; i < chunks; i++) {
|
|
30318
30544
|
const offset = offsetOf(i);
|
|
30319
|
-
check(!meets(dropped, offset, offset + 1));
|
|
30545
|
+
check$1(!meets(dropped, offset, offset + 1));
|
|
30320
30546
|
}
|
|
30321
30547
|
}
|
|
30322
|
-
check(!fragmented || !metadata);
|
|
30548
|
+
check$1(!fragmented || !metadata);
|
|
30323
30549
|
const sizes = (dropped.length || captions.size) && fragmented ? defaultSampleSizes(moov) : void 0;
|
|
30324
30550
|
for (const box of top) if (box.type === "moof") {
|
|
30325
30551
|
const moof = await whole(source, box);
|
|
30326
30552
|
if (dropped.length || captions.size) for (const [start, end, track] of fragmentRanges(moof, box.start, sizes ?? /* @__PURE__ */ new Map())) {
|
|
30327
|
-
check(!meets(dropped, start, end));
|
|
30553
|
+
check$1(!meets(dropped, start, end));
|
|
30328
30554
|
if (captions.has(track)) zeroed.push([start, end]);
|
|
30329
30555
|
}
|
|
30330
30556
|
emptyWithin(moof, box.body - box.start, moof.length);
|
|
@@ -30358,7 +30584,7 @@ async function videoMetadataPatches(file, mime) {
|
|
|
30358
30584
|
const mdats = top.filter((box) => box.type === "mdat");
|
|
30359
30585
|
const merged = [];
|
|
30360
30586
|
for (const [start, end] of zeroed.sort((a, b) => a[0] - b[0])) {
|
|
30361
|
-
check(mdats.some((mdat) => start >= mdat.body && end <= mdat.end));
|
|
30587
|
+
check$1(mdats.some((mdat) => start >= mdat.body && end <= mdat.end));
|
|
30362
30588
|
const last = merged[merged.length - 1];
|
|
30363
30589
|
if (last && start <= last[1]) last[1] = Math.max(last[1], end);
|
|
30364
30590
|
else merged.push([start, end]);
|
|
@@ -30369,12 +30595,709 @@ async function videoMetadataPatches(file, mime) {
|
|
|
30369
30595
|
});
|
|
30370
30596
|
let at = 0;
|
|
30371
30597
|
for (const patch of patches.sort((a, b) => a.start - b.start)) {
|
|
30372
|
-
check(patch.start >= at);
|
|
30598
|
+
check$1(patch.start >= at);
|
|
30373
30599
|
at = patch.end;
|
|
30374
30600
|
}
|
|
30375
30601
|
return patches;
|
|
30376
30602
|
}
|
|
30377
30603
|
//#endregion
|
|
30604
|
+
//#region ../core/src/audioMetadata.ts
|
|
30605
|
+
/**
|
|
30606
|
+
* What an audio file leaves with. A recording made in another app, or a song a tagger went through, says more than its
|
|
30607
|
+
* sound: a title or a file name that is where it was recorded (a phone's recorder names it after the place), a comment,
|
|
30608
|
+
* a location tag, a picture, the date. The sender removes them before the file is stored and its digest computed, as
|
|
30609
|
+
* pictures' and videos' are (pictureMetadata.ts, videoMetadata.ts), without decoding or re-encoding a sample, and the
|
|
30610
|
+
* file keeps its size, so no offset in it moves and it plays as it did:
|
|
30611
|
+
*
|
|
30612
|
+
* - MP4 audio (M4A, a voice note recorded in MP4): videoMetadata.ts's box walk, its `udta` and `meta` emptied.
|
|
30613
|
+
* - MP3 and AAC: an ID3v2 tag at the start becomes an empty one (its frames zeros: padding), one at the end (with its
|
|
30614
|
+
* footer), an APEv2 tag's items, a Lyrics3v2 tag and an ID3v1 tag's fields become zeros. One typed as MP3 or AAC
|
|
30615
|
+
* whose first bytes are neither (junk before its first frame) still has the tags at its end emptied.
|
|
30616
|
+
* - FLAC: every metadata block but its stream info and seek table (a Vorbis comment, a picture, a cue sheet, an
|
|
30617
|
+
* application's) becomes padding, zeroed.
|
|
30618
|
+
* - Ogg Opus, Vorbis, Speex and Theora: the comment header keeps its vendor (the encoder's name) and has no comment,
|
|
30619
|
+
* the bytes after it zeros. FLAC in Ogg: its metadata blocks as a FLAC's. Each page changed has its checksum made again.
|
|
30620
|
+
* - WAV (RIFF, RF64 or BW64): every chunk but its format, data and the ones of the sound itself (`fact`, `cue `,
|
|
30621
|
+
* `smpl`, `inst`, an RF64's `ds64`) becomes `JUNK`, zeroed (an INFO list, an `id3 ` chunk, a broadcast `bext` with
|
|
30622
|
+
* its date and originator, iXML, XMP).
|
|
30623
|
+
* - WebM and Matroska, audio or video: `Tags`, `Attachments`, `Chapters`, the title, the date, the file names and each
|
|
30624
|
+
* track's name become `Void` elements (and the SeekHead's entries for them); the muxer's and the writing app's names
|
|
30625
|
+
* are zeroed. A Vorbis, Theora or FLAC track's CodecPrivate (its Ogg headers or its FLAC metadata blocks) has its
|
|
30626
|
+
* comments emptied as an Ogg's or a FLAC's. Clusters, cues and other track settings are kept as they are.
|
|
30627
|
+
*
|
|
30628
|
+
* Fail-closed: a file that is one of these by its bytes and whose tags cannot be removed (truncated, malformed) is
|
|
30629
|
+
* refused with `NO_AUDIO_METADATA`, never sent as it was. Any other file goes as it is (other audio formats too).
|
|
30630
|
+
*/
|
|
30631
|
+
var AUDIO_METADATA_LIMITS = {
|
|
30632
|
+
/** The largest header, element or tag read whole (an Ogg comment header with a picture in it): past this the file is refused. */
|
|
30633
|
+
maxReadBytes: 67108864,
|
|
30634
|
+
/** The most pages, chunks, blocks or elements walked. */
|
|
30635
|
+
maxParts: 1e6,
|
|
30636
|
+
/** Bytes read first to tell an audio file from another file. */
|
|
30637
|
+
headBytes: 64
|
|
30638
|
+
};
|
|
30639
|
+
/** Why an audio file is refused: its tags could not be removed, so it does not go at all. */
|
|
30640
|
+
var NO_AUDIO_METADATA = "This audio cannot be sent: Ghostly could not remove the details saved in it, like where it was recorded";
|
|
30641
|
+
/** Zeros put in a Blob a slice at a time: a Blob's Blob parts are not copied, so a zeroed range of any size holds no more. */
|
|
30642
|
+
var ZEROS = new Blob([/* @__PURE__ */ new Uint8Array(1048576)]);
|
|
30643
|
+
var text = (b, at, length) => String.fromCharCode(...b.subarray(at, at + length));
|
|
30644
|
+
var u32le = (b, at) => (b[at] | b[at + 1] << 8 | b[at + 2] << 16 | b[at + 3] << 24) >>> 0;
|
|
30645
|
+
var syncsafe = (b, at) => b[at] << 21 | b[at + 1] << 14 | b[at + 2] << 7 | b[at + 3];
|
|
30646
|
+
var latin = (s) => Uint8Array.from(s, (c) => c.charCodeAt(0));
|
|
30647
|
+
/** Refuses the file where its bytes are not what this expects. */
|
|
30648
|
+
function check(ok) {
|
|
30649
|
+
if (!ok) throw new Error(NO_AUDIO_METADATA);
|
|
30650
|
+
}
|
|
30651
|
+
function exactly(source) {
|
|
30652
|
+
return async (offset, length) => {
|
|
30653
|
+
check(offset >= 0 && length >= 0 && length <= AUDIO_METADATA_LIMITS.maxReadBytes && offset + length <= source.size);
|
|
30654
|
+
const bytes = await source.read(offset, length);
|
|
30655
|
+
check(bytes.length === length);
|
|
30656
|
+
return bytes;
|
|
30657
|
+
};
|
|
30658
|
+
}
|
|
30659
|
+
/** Counts the parts walked, so a file of millions of tiny ones is refused rather than walked forever. */
|
|
30660
|
+
function counter() {
|
|
30661
|
+
let parts = 0;
|
|
30662
|
+
return () => check(++parts <= AUDIO_METADATA_LIMITS.maxParts);
|
|
30663
|
+
}
|
|
30664
|
+
/** An ID3v2 header at `at` of `b`: its version 2 to 4 and its size four 7-bit bytes, or none. */
|
|
30665
|
+
var isId3 = (b, at = 0) => b.length >= at + 10 && text(b, at, 3) === "ID3" && b[at + 3] >= 2 && b[at + 3] <= 4 && b[at + 4] !== 255 && [
|
|
30666
|
+
6,
|
|
30667
|
+
7,
|
|
30668
|
+
8,
|
|
30669
|
+
9
|
|
30670
|
+
].every((i) => b[at + i] < 128);
|
|
30671
|
+
/**
|
|
30672
|
+
* The ID3v2 tag whose header is `head`, at `at`: made an empty one where it is, its frames (and an extended header)
|
|
30673
|
+
* zeros, which is its padding, its flags but the footer's cleared. Returns where it ends.
|
|
30674
|
+
*/
|
|
30675
|
+
async function emptyId3(read, size, at, head, patches) {
|
|
30676
|
+
const body = syncsafe(head, 6), footer = head[3] === 4 && head[5] & 16 ? 10 : 0, end = at + 10 + body + footer;
|
|
30677
|
+
check(end <= size);
|
|
30678
|
+
const flags = Uint8Array.of(footer ? 16 : 0);
|
|
30679
|
+
patches.push({
|
|
30680
|
+
start: at + 5,
|
|
30681
|
+
end: at + 6,
|
|
30682
|
+
bytes: flags
|
|
30683
|
+
});
|
|
30684
|
+
if (body) patches.push({
|
|
30685
|
+
start: at + 10,
|
|
30686
|
+
end: at + 10 + body
|
|
30687
|
+
});
|
|
30688
|
+
if (footer) {
|
|
30689
|
+
check(text(await read(at + 10 + body, 3), 0, 3) === "3DI");
|
|
30690
|
+
patches.push({
|
|
30691
|
+
start: at + 10 + body + 5,
|
|
30692
|
+
end: at + 10 + body + 6,
|
|
30693
|
+
bytes: flags
|
|
30694
|
+
});
|
|
30695
|
+
}
|
|
30696
|
+
return end;
|
|
30697
|
+
}
|
|
30698
|
+
/**
|
|
30699
|
+
* The tags at the end of an MP3 or AAC file (after `start`): an ID3v1 (and its extended part), then any of an APEv2
|
|
30700
|
+
* tag, a Lyrics3v2 tag and an ID3v2 tag with a footer, in any order. Each found is emptied where it is.
|
|
30701
|
+
*/
|
|
30702
|
+
async function trailingTags(read, size, start, patches) {
|
|
30703
|
+
let end = size;
|
|
30704
|
+
if (end - 128 >= start && text(await read(end - 128, 3), 0, 3) === "TAG") {
|
|
30705
|
+
patches.push({
|
|
30706
|
+
start: end - 125,
|
|
30707
|
+
end: end - 1
|
|
30708
|
+
}, {
|
|
30709
|
+
start: end - 1,
|
|
30710
|
+
end,
|
|
30711
|
+
bytes: Uint8Array.of(255)
|
|
30712
|
+
});
|
|
30713
|
+
end -= 128;
|
|
30714
|
+
if (end - 227 >= start && text(await read(end - 227, 4), 0, 4) === "TAG+") {
|
|
30715
|
+
patches.push({
|
|
30716
|
+
start: end - 223,
|
|
30717
|
+
end
|
|
30718
|
+
});
|
|
30719
|
+
end -= 227;
|
|
30720
|
+
}
|
|
30721
|
+
}
|
|
30722
|
+
const count = counter();
|
|
30723
|
+
for (;;) {
|
|
30724
|
+
count();
|
|
30725
|
+
if (end - 32 >= start) {
|
|
30726
|
+
const footer = await read(end - 32, 32);
|
|
30727
|
+
if (text(footer, 0, 8) === "APETAGEX") {
|
|
30728
|
+
const length = u32le(footer, 12), header = footer[23] & 128 ? 32 : 0, tagStart = end - length - header;
|
|
30729
|
+
check(length >= 32 && tagStart >= start);
|
|
30730
|
+
if (header) {
|
|
30731
|
+
check(text(await read(tagStart, 8), 0, 8) === "APETAGEX");
|
|
30732
|
+
patches.push({
|
|
30733
|
+
start: tagStart + 16,
|
|
30734
|
+
end: tagStart + 20
|
|
30735
|
+
});
|
|
30736
|
+
}
|
|
30737
|
+
if (length > 32) patches.push({
|
|
30738
|
+
start: tagStart + header,
|
|
30739
|
+
end: end - 32
|
|
30740
|
+
});
|
|
30741
|
+
patches.push({
|
|
30742
|
+
start: end - 16,
|
|
30743
|
+
end: end - 12
|
|
30744
|
+
});
|
|
30745
|
+
end = tagStart;
|
|
30746
|
+
continue;
|
|
30747
|
+
}
|
|
30748
|
+
}
|
|
30749
|
+
if (end - 15 >= start) {
|
|
30750
|
+
const footer = await read(end - 15, 15);
|
|
30751
|
+
if (text(footer, 6, 9) === "LYRICS200") {
|
|
30752
|
+
const length = /^\d{6}$/.test(text(footer, 0, 6)) ? Number(text(footer, 0, 6)) : -1, tagStart = end - 15 - length;
|
|
30753
|
+
check(length >= 11 && tagStart >= start && text(await read(tagStart, 11), 0, 11) === "LYRICSBEGIN");
|
|
30754
|
+
if (length > 11) patches.push({
|
|
30755
|
+
start: tagStart + 11,
|
|
30756
|
+
end: end - 15
|
|
30757
|
+
});
|
|
30758
|
+
end = tagStart;
|
|
30759
|
+
continue;
|
|
30760
|
+
}
|
|
30761
|
+
}
|
|
30762
|
+
if (end - 10 >= start) {
|
|
30763
|
+
const footer = await read(end - 10, 10);
|
|
30764
|
+
if (text(footer, 0, 3) === "3DI") {
|
|
30765
|
+
check([
|
|
30766
|
+
6,
|
|
30767
|
+
7,
|
|
30768
|
+
8,
|
|
30769
|
+
9
|
|
30770
|
+
].every((i) => footer[i] < 128));
|
|
30771
|
+
const tagStart = end - 20 - syncsafe(footer, 6);
|
|
30772
|
+
check(tagStart >= start);
|
|
30773
|
+
const head = await read(tagStart, 10);
|
|
30774
|
+
check(isId3(head));
|
|
30775
|
+
check(await emptyId3(read, size, tagStart, head, patches) === end);
|
|
30776
|
+
end = tagStart;
|
|
30777
|
+
continue;
|
|
30778
|
+
}
|
|
30779
|
+
}
|
|
30780
|
+
return;
|
|
30781
|
+
}
|
|
30782
|
+
}
|
|
30783
|
+
/** The types an MP3 or AAC file is sent as: one whose first bytes are no frame still has its tags at the end read. */
|
|
30784
|
+
var MPEG_AUDIO = /* @__PURE__ */ new Set([
|
|
30785
|
+
"audio/mpeg",
|
|
30786
|
+
"audio/mp3",
|
|
30787
|
+
"audio/mpeg3",
|
|
30788
|
+
"audio/x-mpeg",
|
|
30789
|
+
"audio/x-mp3",
|
|
30790
|
+
"audio/aac",
|
|
30791
|
+
"audio/x-aac",
|
|
30792
|
+
"audio/aacp"
|
|
30793
|
+
]);
|
|
30794
|
+
/** An MPEG audio frame's or an ADTS header's first bytes: 11 bits set, a version and a layer that are some. */
|
|
30795
|
+
var isFrame = (b, at) => b.length >= at + 2 && b[at] === 255 && (b[at + 1] & 224) === 224 && (b[at + 1] & 24) !== 8;
|
|
30796
|
+
var FLAC_KEEPS = /* @__PURE__ */ new Set([0, 3]);
|
|
30797
|
+
/** A FLAC's metadata blocks from `at` (its `fLaC`): all but its stream info and seek table become padding, zeroed. */
|
|
30798
|
+
async function flac(read, size, at, patches) {
|
|
30799
|
+
const count = counter();
|
|
30800
|
+
for (at += 4;;) {
|
|
30801
|
+
count();
|
|
30802
|
+
const head = await read(at, 4);
|
|
30803
|
+
const last = head[0] & 128, type = head[0] & 127, end = at + 4 + (head[1] << 16 | head[2] << 8 | head[3]);
|
|
30804
|
+
check(type !== 127 && end <= size);
|
|
30805
|
+
if (!FLAC_KEEPS.has(type)) {
|
|
30806
|
+
if (type !== 1) patches.push({
|
|
30807
|
+
start: at,
|
|
30808
|
+
end: at + 1,
|
|
30809
|
+
bytes: Uint8Array.of(last | 1)
|
|
30810
|
+
});
|
|
30811
|
+
if (end > at + 4) patches.push({
|
|
30812
|
+
start: at + 4,
|
|
30813
|
+
end
|
|
30814
|
+
});
|
|
30815
|
+
}
|
|
30816
|
+
at = end;
|
|
30817
|
+
if (last) return at;
|
|
30818
|
+
}
|
|
30819
|
+
}
|
|
30820
|
+
var OGG_CRC = (() => {
|
|
30821
|
+
const table = /* @__PURE__ */ new Uint32Array(256);
|
|
30822
|
+
for (let i = 0; i < 256; i++) {
|
|
30823
|
+
let crc = i << 24;
|
|
30824
|
+
for (let bit = 0; bit < 8; bit++) crc = crc & 2147483648 ? crc << 1 ^ 79764919 : crc << 1;
|
|
30825
|
+
table[i] = crc >>> 0;
|
|
30826
|
+
}
|
|
30827
|
+
return table;
|
|
30828
|
+
})();
|
|
30829
|
+
/** Ogg's page checksum, over the page with its checksum's four bytes zeroed. */
|
|
30830
|
+
function oggCrc(page) {
|
|
30831
|
+
let crc = 0;
|
|
30832
|
+
for (let i = 0; i < page.length; i++) crc = (crc << 8 ^ OGG_CRC[(crc >>> 24 ^ (i >= 22 && i < 26 ? 0 : page[i])) & 255]) >>> 0;
|
|
30833
|
+
return crc;
|
|
30834
|
+
}
|
|
30835
|
+
/**
|
|
30836
|
+
* A comment header with no comment: its magic and vendor kept, its count 0 (and Vorbis's framing bit set), the rest
|
|
30837
|
+
* zeros: padding after the comments, which Opus says may be there and Vorbis's, Speex's and Theora's readers do not read.
|
|
30838
|
+
*/
|
|
30839
|
+
function noComments(packet, comments, framing) {
|
|
30840
|
+
const magic = comments.length;
|
|
30841
|
+
check(text(packet, 0, magic) === comments && packet.length >= magic + 4);
|
|
30842
|
+
const count = magic + 4 + u32le(packet, magic);
|
|
30843
|
+
check(count + 4 + (framing ? 1 : 0) <= packet.length);
|
|
30844
|
+
const out = new Uint8Array(packet.length);
|
|
30845
|
+
out.set(packet.subarray(0, count));
|
|
30846
|
+
if (framing) out[count + 4] = 1;
|
|
30847
|
+
return out;
|
|
30848
|
+
}
|
|
30849
|
+
/** A FLAC metadata block that is a whole packet (FLAC in Ogg): kept, or made padding as `flac` makes it. */
|
|
30850
|
+
function noFlacBlock(packet) {
|
|
30851
|
+
check(packet.length >= 4 && packet.length === 4 + (packet[1] << 16 | packet[2] << 8 | packet[3]) && (packet[0] & 127) !== 127);
|
|
30852
|
+
const type = packet[0] & 127;
|
|
30853
|
+
if (FLAC_KEEPS.has(type)) return packet;
|
|
30854
|
+
const out = new Uint8Array(packet.length);
|
|
30855
|
+
out[0] = type === 1 ? packet[0] : packet[0] & 128 | 1;
|
|
30856
|
+
return out;
|
|
30857
|
+
}
|
|
30858
|
+
/** A codec whose second packet is its comment header: its magic, and whether a framing bit follows its comments (Vorbis). */
|
|
30859
|
+
var commentHeader = (head, comments, framing) => ({
|
|
30860
|
+
head,
|
|
30861
|
+
tagged: (_, index) => index === 0,
|
|
30862
|
+
empty: (packet) => noComments(packet, comments, framing)
|
|
30863
|
+
});
|
|
30864
|
+
var OGG_CODECS = [
|
|
30865
|
+
commentHeader("OpusHead", "OpusTags", false),
|
|
30866
|
+
commentHeader("vorbis", "vorbis", true),
|
|
30867
|
+
commentHeader("Speex ", "", false),
|
|
30868
|
+
commentHeader("theora", "theora", false),
|
|
30869
|
+
{
|
|
30870
|
+
head: "FLAC",
|
|
30871
|
+
tagged: (packet, index) => {
|
|
30872
|
+
if (index) return !(packet[0] & 128);
|
|
30873
|
+
check(packet.length >= 17 && text(packet, 9, 4) === "fLaC");
|
|
30874
|
+
return !(packet[13] & 128);
|
|
30875
|
+
},
|
|
30876
|
+
empty: noFlacBlock
|
|
30877
|
+
}
|
|
30878
|
+
];
|
|
30879
|
+
/**
|
|
30880
|
+
* An Ogg file's pages walked: each logical stream's comment header (a chained file has one per link) made one with no
|
|
30881
|
+
* comment where it is, across the pages it spans, and those pages' checksums made again.
|
|
30882
|
+
*/
|
|
30883
|
+
async function ogg(read, size, patches) {
|
|
30884
|
+
const streams = /* @__PURE__ */ new Map();
|
|
30885
|
+
/** The bytes put in the pages changed, by where each page starts: by where they go in the file. */
|
|
30886
|
+
const pages = /* @__PURE__ */ new Map();
|
|
30887
|
+
const packetOf = async (ranges) => {
|
|
30888
|
+
const length = ranges.reduce((sum, [start, end]) => sum + end - start, 0);
|
|
30889
|
+
check(length <= AUDIO_METADATA_LIMITS.maxReadBytes);
|
|
30890
|
+
const packet = new Uint8Array(length);
|
|
30891
|
+
let at = 0;
|
|
30892
|
+
for (const [start, end] of ranges) {
|
|
30893
|
+
packet.set(await read(start, end - start), at);
|
|
30894
|
+
at += end - start;
|
|
30895
|
+
}
|
|
30896
|
+
return packet;
|
|
30897
|
+
};
|
|
30898
|
+
const count = counter();
|
|
30899
|
+
for (let at = 0; at < size;) {
|
|
30900
|
+
count();
|
|
30901
|
+
const head = await read(at, 27);
|
|
30902
|
+
check(text(head, 0, 4) === "OggS" && head[4] === 0);
|
|
30903
|
+
const lacing = await read(at + 27, head[26]);
|
|
30904
|
+
const end = at + 27 + lacing.length + lacing.reduce((sum, l) => sum + l, 0);
|
|
30905
|
+
check(end <= size);
|
|
30906
|
+
const serial = u32le(head, 14);
|
|
30907
|
+
if (head[5] & 2) streams.set(serial, {
|
|
30908
|
+
packet: 0,
|
|
30909
|
+
ranges: [],
|
|
30910
|
+
tagged: true
|
|
30911
|
+
});
|
|
30912
|
+
const stream = streams.get(serial);
|
|
30913
|
+
check(!!stream);
|
|
30914
|
+
let offset = at + 27 + lacing.length;
|
|
30915
|
+
for (const length of lacing) {
|
|
30916
|
+
if (stream.tagged) stream.ranges.push([
|
|
30917
|
+
offset,
|
|
30918
|
+
offset + length,
|
|
30919
|
+
at
|
|
30920
|
+
]);
|
|
30921
|
+
offset += length;
|
|
30922
|
+
if (length === 255) continue;
|
|
30923
|
+
if (stream.packet === 0) {
|
|
30924
|
+
const first = await packetOf(stream.ranges);
|
|
30925
|
+
stream.codec = OGG_CODECS.find((codec) => text(first, 0, codec.head.length) === codec.head) ?? null;
|
|
30926
|
+
stream.tagged = !!stream.codec?.tagged(first, 0);
|
|
30927
|
+
} else if (stream.tagged && stream.codec) {
|
|
30928
|
+
const packet = await packetOf(stream.ranges), emptied = stream.codec.empty(packet);
|
|
30929
|
+
stream.tagged = stream.codec.tagged(packet, stream.packet);
|
|
30930
|
+
let from = 0;
|
|
30931
|
+
for (const [start, until, page] of stream.ranges) {
|
|
30932
|
+
if (!pages.has(page)) pages.set(page, []);
|
|
30933
|
+
pages.get(page).push([start, emptied.subarray(from, from + until - start)]);
|
|
30934
|
+
from += until - start;
|
|
30935
|
+
}
|
|
30936
|
+
}
|
|
30937
|
+
stream.packet++;
|
|
30938
|
+
stream.ranges = [];
|
|
30939
|
+
}
|
|
30940
|
+
at = end;
|
|
30941
|
+
}
|
|
30942
|
+
for (const stream of streams.values()) check(!stream.tagged);
|
|
30943
|
+
for (const [start, changes] of pages) {
|
|
30944
|
+
const head = await read(start, 27), lacing = await read(start + 27, head[26]);
|
|
30945
|
+
const end = start + 27 + lacing.length + lacing.reduce((sum, l) => sum + l, 0);
|
|
30946
|
+
const page = (await read(start, end - start)).slice();
|
|
30947
|
+
for (const [where, bytes] of changes) page.set(bytes, where - start);
|
|
30948
|
+
const crc = oggCrc(page);
|
|
30949
|
+
page.set([
|
|
30950
|
+
crc & 255,
|
|
30951
|
+
crc >>> 8 & 255,
|
|
30952
|
+
crc >>> 16 & 255,
|
|
30953
|
+
crc >>> 24
|
|
30954
|
+
], 22);
|
|
30955
|
+
patches.push({
|
|
30956
|
+
start,
|
|
30957
|
+
end,
|
|
30958
|
+
bytes: page
|
|
30959
|
+
});
|
|
30960
|
+
}
|
|
30961
|
+
}
|
|
30962
|
+
/** The chunks a WAV's sound is made of, kept; any other becomes `JUNK`. */
|
|
30963
|
+
var WAV_KEEPS = /* @__PURE__ */ new Set([
|
|
30964
|
+
"fmt ",
|
|
30965
|
+
"data",
|
|
30966
|
+
"fact",
|
|
30967
|
+
"cue ",
|
|
30968
|
+
"smpl",
|
|
30969
|
+
"inst"
|
|
30970
|
+
]);
|
|
30971
|
+
var WAV_SPACE = /* @__PURE__ */ new Set([
|
|
30972
|
+
"JUNK",
|
|
30973
|
+
"junk",
|
|
30974
|
+
"PAD ",
|
|
30975
|
+
"FLLR"
|
|
30976
|
+
]);
|
|
30977
|
+
/** A WAV's chunks from its `WAVE`; an RF64 or BW64 one (`rf64`) has its `ds64` first, which says `data`'s size when its own is all ones. */
|
|
30978
|
+
async function wav(read, size, rf64, patches) {
|
|
30979
|
+
let dataSize;
|
|
30980
|
+
if (rf64) {
|
|
30981
|
+
const ds64 = await read(12, 24);
|
|
30982
|
+
check(text(ds64, 0, 4) === "ds64" && u32le(ds64, 4) >= 28);
|
|
30983
|
+
dataSize = u32le(ds64, 16) + u32le(ds64, 20) * 2 ** 32;
|
|
30984
|
+
}
|
|
30985
|
+
const count = counter();
|
|
30986
|
+
for (let at = 12; at + 8 <= size;) {
|
|
30987
|
+
count();
|
|
30988
|
+
const head = await read(at, 8);
|
|
30989
|
+
const id = text(head, 0, 4), length = id === "data" && dataSize !== void 0 && u32le(head, 4) === 4294967295 ? dataSize : u32le(head, 4);
|
|
30990
|
+
let end = at + 8 + length + length % 2;
|
|
30991
|
+
if (id === "data") end = length ? Math.min(end, size) : size;
|
|
30992
|
+
else check(at + 8 + length <= size);
|
|
30993
|
+
if (!WAV_KEEPS.has(id) && !(rf64 && at === 12)) {
|
|
30994
|
+
if (!WAV_SPACE.has(id)) patches.push({
|
|
30995
|
+
start: at,
|
|
30996
|
+
end: at + 4,
|
|
30997
|
+
bytes: latin("JUNK")
|
|
30998
|
+
});
|
|
30999
|
+
if (length) patches.push({
|
|
31000
|
+
start: at + 8,
|
|
31001
|
+
end: at + 8 + length
|
|
31002
|
+
});
|
|
31003
|
+
}
|
|
31004
|
+
at = Math.min(end, size);
|
|
31005
|
+
}
|
|
31006
|
+
}
|
|
31007
|
+
var EBML_HEADER = 440786851;
|
|
31008
|
+
var SEGMENT$1 = 408125543;
|
|
31009
|
+
var CLUSTER = 524531317;
|
|
31010
|
+
var VOID = 236;
|
|
31011
|
+
var CRC32 = 191;
|
|
31012
|
+
var SEEK_HEAD = 290298740;
|
|
31013
|
+
var INFO = 357149030;
|
|
31014
|
+
var TRACKS = 374648427;
|
|
31015
|
+
/** What a segment's sound and pictures are made of, kept; any other top-level element (Tags, Attachments, Chapters) becomes Void. */
|
|
31016
|
+
var SEGMENT_KEEPS = /* @__PURE__ */ new Set([
|
|
31017
|
+
SEEK_HEAD,
|
|
31018
|
+
INFO,
|
|
31019
|
+
TRACKS,
|
|
31020
|
+
CLUSTER,
|
|
31021
|
+
475249515
|
|
31022
|
+
]);
|
|
31023
|
+
/** What a cluster holds: one of unknown size ends where an element that is none of these starts. */
|
|
31024
|
+
var CLUSTER_CHILDREN = /* @__PURE__ */ new Set([
|
|
31025
|
+
231,
|
|
31026
|
+
22612,
|
|
31027
|
+
167,
|
|
31028
|
+
171,
|
|
31029
|
+
163,
|
|
31030
|
+
160,
|
|
31031
|
+
175,
|
|
31032
|
+
VOID,
|
|
31033
|
+
CRC32
|
|
31034
|
+
]);
|
|
31035
|
+
/** What Info keeps: the timing, the segment's IDs; the muxer's and writing app's names, zeroed. Any other (a title, a date, file names) becomes Void. */
|
|
31036
|
+
var INFO_KEEPS = /* @__PURE__ */ new Set([
|
|
31037
|
+
2807729,
|
|
31038
|
+
17545,
|
|
31039
|
+
29604,
|
|
31040
|
+
17476,
|
|
31041
|
+
3979555,
|
|
31042
|
+
4110627,
|
|
31043
|
+
26916
|
|
31044
|
+
]);
|
|
31045
|
+
var INFO_ZEROED = /* @__PURE__ */ new Set([19840, 22337]);
|
|
31046
|
+
var TRACK_ENTRY = 174;
|
|
31047
|
+
var TRACK_NAME = 21358;
|
|
31048
|
+
var CODEC_ID = 134;
|
|
31049
|
+
var CODEC_PRIVATE = 25506;
|
|
31050
|
+
var SEEK = 19899;
|
|
31051
|
+
var SEEK_ID = 21419;
|
|
31052
|
+
/** The codecs whose CodecPrivate is their Ogg headers Xiph-laced: the second a comment header, its magic, and whether a framing bit follows its comments. */
|
|
31053
|
+
var XIPH_PRIVATE = /* @__PURE__ */ new Map([["A_VORBIS", ["vorbis", true]], ["V_THEORA", ["theora", false]]]);
|
|
31054
|
+
/** The element whose header is at `at` of `b` (`base` its offset in the file); one of unknown size ends at `limit`. */
|
|
31055
|
+
function element(b, at, limit, base = 0) {
|
|
31056
|
+
check(at < b.length);
|
|
31057
|
+
const idLength = Math.clz32(b[at]) - 23;
|
|
31058
|
+
check(idLength >= 1 && idLength <= 4 && at + idLength < b.length);
|
|
31059
|
+
let id = 0;
|
|
31060
|
+
for (let i = 0; i < idLength; i++) id = id * 256 + b[at + i];
|
|
31061
|
+
const sizeAt = at + idLength, sizeLength = Math.clz32(b[sizeAt]) - 23;
|
|
31062
|
+
check(sizeLength >= 1 && sizeLength <= 8 && sizeAt + sizeLength <= b.length);
|
|
31063
|
+
let size = b[sizeAt] & 255 >> sizeLength, ones = size === 255 >> sizeLength;
|
|
31064
|
+
for (let i = 1; i < sizeLength; i++) {
|
|
31065
|
+
size = size * 256 + b[sizeAt + i];
|
|
31066
|
+
ones &&= b[sizeAt + i] === 255;
|
|
31067
|
+
}
|
|
31068
|
+
const body = base + sizeAt + sizeLength;
|
|
31069
|
+
return {
|
|
31070
|
+
id,
|
|
31071
|
+
start: base + at,
|
|
31072
|
+
body,
|
|
31073
|
+
end: ones ? limit : body + size,
|
|
31074
|
+
unknown: ones
|
|
31075
|
+
};
|
|
31076
|
+
}
|
|
31077
|
+
/** An element's header read from the file at `at`. */
|
|
31078
|
+
async function elementAt(source, at, limit) {
|
|
31079
|
+
return element(await source.read(at, 12), 0, limit, at);
|
|
31080
|
+
}
|
|
31081
|
+
/** A Void element `length` bytes long: its ID, its size in as many bytes as it takes to fill it, the rest zeros. */
|
|
31082
|
+
function voidHeader(length) {
|
|
31083
|
+
for (let sizeLength = 1; sizeLength <= 8; sizeLength++) {
|
|
31084
|
+
const body = length - 1 - sizeLength;
|
|
31085
|
+
if (body < 0 || body >= 2 ** (7 * sizeLength) - 1) continue;
|
|
31086
|
+
const header = new Uint8Array(1 + sizeLength);
|
|
31087
|
+
header[0] = VOID;
|
|
31088
|
+
for (let i = sizeLength, rest = body; i >= 1; i--, rest = Math.floor(rest / 256)) header[i] = rest % 256;
|
|
31089
|
+
header[1] |= 128 >> sizeLength - 1;
|
|
31090
|
+
return header;
|
|
31091
|
+
}
|
|
31092
|
+
check(false);
|
|
31093
|
+
}
|
|
31094
|
+
/** `el` of `b` (read whole, `el`'s offsets in it) made Void where it is. */
|
|
31095
|
+
function voidIn(b, el) {
|
|
31096
|
+
const header = voidHeader(el.end - el.start);
|
|
31097
|
+
b.fill(0, el.start, el.end);
|
|
31098
|
+
b.set(header, el.start);
|
|
31099
|
+
}
|
|
31100
|
+
/** The children of `parent` (in `b`, read whole) as elements, each within it. */
|
|
31101
|
+
function childrenOf(b, parent) {
|
|
31102
|
+
const found = [];
|
|
31103
|
+
for (let at = parent.body; at < parent.end;) {
|
|
31104
|
+
const child = element(b.subarray(0, parent.end), at, parent.end);
|
|
31105
|
+
check(!child.unknown && child.end <= parent.end);
|
|
31106
|
+
found.push(child);
|
|
31107
|
+
at = child.end;
|
|
31108
|
+
}
|
|
31109
|
+
return found;
|
|
31110
|
+
}
|
|
31111
|
+
/**
|
|
31112
|
+
* A track's CodecPrivate (`b`, changed in it) by its codec: a Vorbis or Theora track's headers (their count less one,
|
|
31113
|
+
* each size but the last's in Xiph lacing, them) with a comment header that has no comment, its sizes kept; a FLAC
|
|
31114
|
+
* track's `fLaC` and metadata blocks as a FLAC's, any byte after the last zeroed. Another codec's is kept as it is.
|
|
31115
|
+
*/
|
|
31116
|
+
async function noPrivateTags(b, codec) {
|
|
31117
|
+
const xiph = XIPH_PRIVATE.get(codec);
|
|
31118
|
+
if (xiph) {
|
|
31119
|
+
check(b.length >= 1 && b[0] === 2);
|
|
31120
|
+
let at = 1;
|
|
31121
|
+
const sizes = [];
|
|
31122
|
+
while (sizes.length < 2) {
|
|
31123
|
+
let size = 0;
|
|
31124
|
+
for (let byte = 255; byte === 255; size += byte) {
|
|
31125
|
+
check(at < b.length);
|
|
31126
|
+
byte = b[at++];
|
|
31127
|
+
}
|
|
31128
|
+
sizes.push(size);
|
|
31129
|
+
}
|
|
31130
|
+
const start = at + sizes[0], end = start + sizes[1];
|
|
31131
|
+
check(end <= b.length);
|
|
31132
|
+
b.set(noComments(b.subarray(start, end), ...xiph), start);
|
|
31133
|
+
} else if (codec === "A_FLAC") {
|
|
31134
|
+
check(b.length >= 4 && text(b, 0, 4) === "fLaC");
|
|
31135
|
+
const patches = [];
|
|
31136
|
+
const end = await flac(async (offset, length) => {
|
|
31137
|
+
check(offset >= 0 && length >= 0 && offset + length <= b.length);
|
|
31138
|
+
return b.subarray(offset, offset + length);
|
|
31139
|
+
}, b.length, 0, patches);
|
|
31140
|
+
for (const patch of patches) if (patch.bytes) b.set(patch.bytes, patch.start);
|
|
31141
|
+
else b.fill(0, patch.start, patch.end);
|
|
31142
|
+
b.fill(0, end);
|
|
31143
|
+
}
|
|
31144
|
+
}
|
|
31145
|
+
/**
|
|
31146
|
+
* A top-level element of a segment read whole and changed in it: Info without its title, date and file names (its
|
|
31147
|
+
* muxer's and writing app's names zeroed), Tracks without their names and the comments in their CodecPrivate, a
|
|
31148
|
+
* SeekHead without the entries for what became Void. A CRC-32 in them, wrong once they changed, becomes Void too.
|
|
31149
|
+
*/
|
|
31150
|
+
async function stripTopLevel(b) {
|
|
31151
|
+
const top = element(b, 0, b.length);
|
|
31152
|
+
check(!top.unknown && top.end === b.length);
|
|
31153
|
+
for (const child of childrenOf(b, top)) {
|
|
31154
|
+
if (child.id === CRC32) voidIn(b, child);
|
|
31155
|
+
else if (top.id === INFO) {
|
|
31156
|
+
if (INFO_ZEROED.has(child.id)) b.fill(0, child.body, child.end);
|
|
31157
|
+
else if (!INFO_KEEPS.has(child.id) && child.id !== VOID) voidIn(b, child);
|
|
31158
|
+
} else if (top.id === TRACKS && child.id === TRACK_ENTRY) {
|
|
31159
|
+
const parts = childrenOf(b, child), ids = parts.filter((part) => part.id === CODEC_ID);
|
|
31160
|
+
check(ids.length <= 1);
|
|
31161
|
+
const codec = ids[0] ? text(b, ids[0].body, ids[0].end - ids[0].body).replace(/\0+$/, "") : "";
|
|
31162
|
+
for (const part of parts) if (part.id === TRACK_NAME || part.id === CRC32) voidIn(b, part);
|
|
31163
|
+
else if (part.id === CODEC_PRIVATE) await noPrivateTags(b.subarray(part.body, part.end), codec);
|
|
31164
|
+
} else if (top.id === SEEK_HEAD && child.id === SEEK) {
|
|
31165
|
+
const target = childrenOf(b, child).find((part) => part.id === SEEK_ID);
|
|
31166
|
+
let id = 0;
|
|
31167
|
+
if (target) for (let i = target.body; i < target.end; i++) id = id * 256 + b[i];
|
|
31168
|
+
if (!SEGMENT_KEEPS.has(id)) voidIn(b, child);
|
|
31169
|
+
}
|
|
31170
|
+
if (child.id === VOID) b.fill(0, child.body, child.end);
|
|
31171
|
+
}
|
|
31172
|
+
}
|
|
31173
|
+
/** Where a cluster of unknown size ends: at the first element that is not a cluster's, or the segment's end. */
|
|
31174
|
+
async function clusterEnd(source, at, limit, count) {
|
|
31175
|
+
for (;;) {
|
|
31176
|
+
count();
|
|
31177
|
+
if (at >= limit) return limit;
|
|
31178
|
+
const child = await elementAt(source, at, limit);
|
|
31179
|
+
if (!CLUSTER_CHILDREN.has(child.id)) return at;
|
|
31180
|
+
check(!child.unknown);
|
|
31181
|
+
if (child.end >= limit) return limit;
|
|
31182
|
+
at = child.end;
|
|
31183
|
+
}
|
|
31184
|
+
}
|
|
31185
|
+
async function matroska(source, read, patches) {
|
|
31186
|
+
const count = counter();
|
|
31187
|
+
const toVoid = (el) => {
|
|
31188
|
+
const header = voidHeader(el.end - el.start);
|
|
31189
|
+
patches.push({
|
|
31190
|
+
start: el.start,
|
|
31191
|
+
end: el.start + header.length,
|
|
31192
|
+
bytes: header
|
|
31193
|
+
});
|
|
31194
|
+
if (el.end > el.start + header.length) patches.push({
|
|
31195
|
+
start: el.start + header.length,
|
|
31196
|
+
end: el.end
|
|
31197
|
+
});
|
|
31198
|
+
};
|
|
31199
|
+
for (let at = 0; at < source.size;) {
|
|
31200
|
+
count();
|
|
31201
|
+
const top = await elementAt(source, at, source.size);
|
|
31202
|
+
check(top.end <= source.size);
|
|
31203
|
+
if (top.id === EBML_HEADER) check(!top.unknown);
|
|
31204
|
+
else if (top.id === VOID) {
|
|
31205
|
+
if (top.end > top.body) patches.push({
|
|
31206
|
+
start: top.body,
|
|
31207
|
+
end: top.end
|
|
31208
|
+
});
|
|
31209
|
+
} else if (top.id !== SEGMENT$1) {
|
|
31210
|
+
check(!top.unknown);
|
|
31211
|
+
toVoid(top);
|
|
31212
|
+
} else for (let in_ = top.body; in_ < top.end;) {
|
|
31213
|
+
count();
|
|
31214
|
+
const el = await elementAt(source, in_, top.end);
|
|
31215
|
+
if (el.id === CLUSTER) {
|
|
31216
|
+
in_ = el.unknown ? await clusterEnd(source, el.body, top.end, count) : Math.min(el.end, top.end);
|
|
31217
|
+
continue;
|
|
31218
|
+
}
|
|
31219
|
+
check(!el.unknown && el.end <= top.end);
|
|
31220
|
+
if (el.id === INFO || el.id === TRACKS || el.id === SEEK_HEAD) {
|
|
31221
|
+
const bytes = (await read(el.start, el.end - el.start)).slice();
|
|
31222
|
+
await stripTopLevel(bytes);
|
|
31223
|
+
patches.push({
|
|
31224
|
+
start: el.start,
|
|
31225
|
+
end: el.end,
|
|
31226
|
+
bytes
|
|
31227
|
+
});
|
|
31228
|
+
} else if (el.id === VOID) {
|
|
31229
|
+
if (el.end > el.body) patches.push({
|
|
31230
|
+
start: el.body,
|
|
31231
|
+
end: el.end
|
|
31232
|
+
});
|
|
31233
|
+
} else if (!SEGMENT_KEEPS.has(el.id)) toVoid(el);
|
|
31234
|
+
in_ = el.end;
|
|
31235
|
+
}
|
|
31236
|
+
at = top.end;
|
|
31237
|
+
}
|
|
31238
|
+
}
|
|
31239
|
+
/**
|
|
31240
|
+
* What `withoutAudioMetadata` changes in an audio file read from `source` (one not held in a Blob: a file kept in
|
|
31241
|
+
* storage): the parts replaced, in order and apart, the rest of its bytes going as they are; undefined when it goes as
|
|
31242
|
+
* it is. Throws `NO_AUDIO_METADATA` for one whose tags cannot be removed; an error reading `source` as it is.
|
|
31243
|
+
*/
|
|
31244
|
+
async function audioMetadataPatches(file, mime) {
|
|
31245
|
+
const source = readingAhead(file), read = exactly(source), size = source.size;
|
|
31246
|
+
const head = await source.read(0, Math.min(AUDIO_METADATA_LIMITS.headBytes, size));
|
|
31247
|
+
const patches = [];
|
|
31248
|
+
if (head.length >= 8 && text(head, 4, 4) === "ftyp") try {
|
|
31249
|
+
return await videoMetadataPatches(file, mime, true);
|
|
31250
|
+
} catch (error) {
|
|
31251
|
+
if (error instanceof Error && error.message === "This video cannot be sent: Ghostly could not remove the details saved in it, like where it was recorded") throw Object.assign(/* @__PURE__ */ new Error(NO_AUDIO_METADATA), { cause: error });
|
|
31252
|
+
throw error;
|
|
31253
|
+
}
|
|
31254
|
+
else if (text(head, 0, 4) === "OggS") await ogg(read, size, patches);
|
|
31255
|
+
else if (head.length >= 12 && [
|
|
31256
|
+
"RIFF",
|
|
31257
|
+
"RF64",
|
|
31258
|
+
"BW64"
|
|
31259
|
+
].includes(text(head, 0, 4)) && text(head, 8, 4) === "WAVE") await wav(read, size, text(head, 0, 4) !== "RIFF", patches);
|
|
31260
|
+
else if (text(head, 0, 4) === "Eߣ") await matroska(source, read, patches);
|
|
31261
|
+
else if (text(head, 0, 4) === "fLaC") await trailingTags(read, size, await flac(read, size, 0, patches), patches);
|
|
31262
|
+
else if (isId3(head) || isFrame(head, 0)) {
|
|
31263
|
+
let at = 0;
|
|
31264
|
+
const count = counter();
|
|
31265
|
+
for (let next = head; isId3(next); next = at + 10 <= size ? await read(at, 10) : /* @__PURE__ */ new Uint8Array(0)) {
|
|
31266
|
+
count();
|
|
31267
|
+
at = await emptyId3(read, size, at, next, patches);
|
|
31268
|
+
}
|
|
31269
|
+
if (at + 4 <= size && text(await read(at, 4), 0, 4) === "fLaC") at = await flac(read, size, at, patches);
|
|
31270
|
+
await trailingTags(read, size, at, patches);
|
|
31271
|
+
} else if (MPEG_AUDIO.has(baseMime(mime))) await trailingTags(read, size, 0, patches);
|
|
31272
|
+
else return void 0;
|
|
31273
|
+
if (!patches.length) return void 0;
|
|
31274
|
+
patches.sort((a, b) => a.start - b.start);
|
|
31275
|
+
for (let i = 1; i < patches.length; i++) check(patches[i].start >= patches[i - 1].end);
|
|
31276
|
+
return patches;
|
|
31277
|
+
}
|
|
31278
|
+
/**
|
|
31279
|
+
* `source` as it is sent: an audio file without its tags, made of `source`'s own bytes but for the parts emptied;
|
|
31280
|
+
* undefined when it goes as it is (not one of these, or one with nothing to remove). Throws `NO_AUDIO_METADATA` for
|
|
31281
|
+
* one whose tags cannot be removed; an error reading `source` as it is.
|
|
31282
|
+
*/
|
|
31283
|
+
async function withoutAudioMetadata(source, mime) {
|
|
31284
|
+
const patches = await audioMetadataPatches({
|
|
31285
|
+
size: source.size,
|
|
31286
|
+
read: async (offset, length) => new Uint8Array(await source.slice(offset, offset + length).arrayBuffer())
|
|
31287
|
+
}, mime);
|
|
31288
|
+
if (!patches) return void 0;
|
|
31289
|
+
const parts = [];
|
|
31290
|
+
let at = 0;
|
|
31291
|
+
for (const patch of patches) {
|
|
31292
|
+
if (patch.start > at) parts.push(source.slice(at, patch.start));
|
|
31293
|
+
if (patch.bytes) parts.push(patch.bytes);
|
|
31294
|
+
else for (let left = patch.end - patch.start; left > 0; left -= ZEROS.size) parts.push(ZEROS.slice(0, Math.min(left, ZEROS.size)));
|
|
31295
|
+
at = patch.end;
|
|
31296
|
+
}
|
|
31297
|
+
if (at < source.size) parts.push(source.slice(at));
|
|
31298
|
+
return new Blob(parts, { type: mime });
|
|
31299
|
+
}
|
|
31300
|
+
//#endregion
|
|
30378
31301
|
//#region ../core/src/payments.ts
|
|
30379
31302
|
/**
|
|
30380
31303
|
* Payments between two linked peers. Ghostly does not move money itself: it
|
|
@@ -31832,45 +32755,35 @@ function seqDate(seq) {
|
|
|
31832
32755
|
return Number.isNaN(date.getTime()) ? (/* @__PURE__ */ new Date(0)).toISOString() : date.toISOString();
|
|
31833
32756
|
}
|
|
31834
32757
|
/**
|
|
31835
|
-
* Resolves a did:dht through Pkarr relays: one GET
|
|
31836
|
-
*
|
|
31837
|
-
*
|
|
32758
|
+
* Resolves a did:dht through Pkarr relays: one GET to each, all at once, and the newest packet that
|
|
32759
|
+
* checks out wins (the highest sequence number; on a tie, the relay listed first), so a relay holding
|
|
32760
|
+
* an older version cannot bring back a removed key or undo a deactivation. Each answer is bounded to
|
|
32761
|
+
* a BEP44 item, its signature checked against the DID's key and its records parsed strictly; a relay
|
|
32762
|
+
* that has nothing, fails or serves a packet that does not check out does not count. A deactivated DID
|
|
31838
32763
|
* resolves (`metadata.deactivated`); everything else that goes wrong throws a `DidDhtError`.
|
|
31839
32764
|
*/
|
|
31840
32765
|
async function resolveDidDht(did, options) {
|
|
31841
32766
|
const { z32 } = didDhtKey(did);
|
|
31842
32767
|
const relays = [...new Set((options.relays ?? DEFAULT_RELAYS).map(normalizeRelayUrl).filter((r) => r !== null))];
|
|
31843
32768
|
if (relays.length === 0) throw new DidDhtError("No Pkarr relay to ask", "unreachable");
|
|
32769
|
+
options.signal?.throwIfAborted();
|
|
32770
|
+
const responses = await Promise.all(relays.map((relay) => options.fetch(`${relay}/${z32}`, {
|
|
32771
|
+
maxBytes: DID_DHT_MAX_PAYLOAD,
|
|
32772
|
+
signal: options.signal,
|
|
32773
|
+
redirect: "error"
|
|
32774
|
+
}).catch(() => void 0)));
|
|
32775
|
+
options.signal?.throwIfAborted();
|
|
31844
32776
|
let notFound = false;
|
|
31845
32777
|
let refused;
|
|
31846
|
-
|
|
31847
|
-
|
|
31848
|
-
|
|
31849
|
-
|
|
31850
|
-
|
|
31851
|
-
maxBytes: DID_DHT_MAX_PAYLOAD,
|
|
31852
|
-
signal: options.signal,
|
|
31853
|
-
redirect: "error"
|
|
31854
|
-
});
|
|
31855
|
-
} catch (error) {
|
|
31856
|
-
if (options.signal?.aborted) throw error;
|
|
31857
|
-
continue;
|
|
31858
|
-
}
|
|
31859
|
-
if (response.status === 404) {
|
|
31860
|
-
notFound = true;
|
|
31861
|
-
continue;
|
|
31862
|
-
}
|
|
31863
|
-
if (response.status !== 200) continue;
|
|
32778
|
+
let newest;
|
|
32779
|
+
for (const [i, relay] of relays.entries()) {
|
|
32780
|
+
const response = responses[i];
|
|
32781
|
+
if (response?.status === 404) notFound = true;
|
|
32782
|
+
if (response?.status !== 200) continue;
|
|
31864
32783
|
try {
|
|
31865
32784
|
const opened = openDidDhtPayload(did, response.bytes);
|
|
31866
|
-
|
|
31867
|
-
|
|
31868
|
-
metadata: {
|
|
31869
|
-
versionId: opened.seq.toString(),
|
|
31870
|
-
updated: seqDate(opened.seq),
|
|
31871
|
-
...opened.deactivated ? { deactivated: true } : {},
|
|
31872
|
-
...opened.types ? { types: opened.types } : {}
|
|
31873
|
-
},
|
|
32785
|
+
if (!newest || opened.seq > newest.seq) newest = {
|
|
32786
|
+
...opened,
|
|
31874
32787
|
relay
|
|
31875
32788
|
};
|
|
31876
32789
|
} catch (error) {
|
|
@@ -31878,6 +32791,16 @@ async function resolveDidDht(did, options) {
|
|
|
31878
32791
|
refused = error;
|
|
31879
32792
|
}
|
|
31880
32793
|
}
|
|
32794
|
+
if (newest) return {
|
|
32795
|
+
document: newest.document,
|
|
32796
|
+
metadata: {
|
|
32797
|
+
versionId: newest.seq.toString(),
|
|
32798
|
+
updated: seqDate(newest.seq),
|
|
32799
|
+
...newest.deactivated ? { deactivated: true } : {},
|
|
32800
|
+
...newest.types ? { types: newest.types } : {}
|
|
32801
|
+
},
|
|
32802
|
+
relay: newest.relay
|
|
32803
|
+
};
|
|
31881
32804
|
if (refused) throw refused;
|
|
31882
32805
|
if (notFound) throw new DidDhtError("No document is published for this did:dht", "not-found");
|
|
31883
32806
|
throw new DidDhtError("No Pkarr relay answered for this did:dht", "unreachable");
|
|
@@ -34385,6 +35308,17 @@ function indexOf(points, words, from) {
|
|
|
34385
35308
|
}
|
|
34386
35309
|
return -1;
|
|
34387
35310
|
}
|
|
35311
|
+
//#endregion
|
|
35312
|
+
//#region ../core/src/catchUp.ts
|
|
35313
|
+
/**
|
|
35314
|
+
* Frames of one catch-up answer in a slice, two slices at most not handled yet by the member's app: the next goes once
|
|
35315
|
+
* it handled the one before the last. An app holds 64 frames waiting at most before 2026-10-07 (more ends the session),
|
|
35316
|
+
* and a member back in a busy group was handed over a hundred at once (a private group's answer, WISP 902; a
|
|
35317
|
+
* community's, WISP 903: 258 from a full store).
|
|
35318
|
+
*/
|
|
35319
|
+
var CATCH_UP_SLICE = 16;
|
|
35320
|
+
/** Between two slices, when the member's app cannot say it handled one (`handled` resolves `false`). */
|
|
35321
|
+
var CATCH_UP_PAUSE_MS = 500;
|
|
34388
35322
|
/**
|
|
34389
35323
|
* Catch-up answers, a slice at a time (`CATCH_UP_SLICE`), with two slices at most not handled yet by the member's app
|
|
34390
35324
|
* (`hooks.handled`): the next once it handled the one before the last, so the slices follow each other without a round
|
|
@@ -34463,6 +35397,10 @@ var CatchUpAnswers = class {
|
|
|
34463
35397
|
}
|
|
34464
35398
|
})();
|
|
34465
35399
|
}
|
|
35400
|
+
/** Whether an answer to `to` still has frames to send, or sent ones its app has not said it handled yet (`hooks.handled`). */
|
|
35401
|
+
busy(to) {
|
|
35402
|
+
return this.going.has(to) || !!this.onTheirWay.get(to)?.size;
|
|
35403
|
+
}
|
|
34466
35404
|
/** The next slice of `rest` to `to`, as sent: undefined, and nothing left, when the edge did not take one. */
|
|
34467
35405
|
sendSlice(to, rest) {
|
|
34468
35406
|
const slice = rest.splice(0, 16);
|
|
@@ -34573,6 +35511,11 @@ var GROUP_READ_NOTE = `Everyone in the group can read everything sent while they
|
|
|
34573
35511
|
*/
|
|
34574
35512
|
var ANSWER_WINDOW_MS$1 = 5e3;
|
|
34575
35513
|
/**
|
|
35514
|
+
* How long a name an edge took away can still come back when I am taken out of the group (`nameKept`): the commit
|
|
35515
|
+
* that removed me comes over the admin's kept edge right after it opens, within the minute that edge stays open.
|
|
35516
|
+
*/
|
|
35517
|
+
var UNNAMED_KEPT_MS = 6e4;
|
|
35518
|
+
/**
|
|
34576
35519
|
* One member's messages (or edits) taken: its whole log handed back at once twice over (`AUTHOR_BURST`: an edge opening
|
|
34577
35520
|
* hears it, with what the member says live beside it, and the edits its app says again), then
|
|
34578
35521
|
* `GROUP_LIMITS.messagesPerAuthor` and `messageBytesPerAuthor` per `messageWindowMs`, as a community's `MessagePace`.
|
|
@@ -35006,6 +35949,12 @@ var GroupSession = class {
|
|
|
35006
35949
|
* said it (`heardName`). In memory only; the records held start it.
|
|
35007
35950
|
*/
|
|
35008
35951
|
nickAt = /* @__PURE__ */ new Map();
|
|
35952
|
+
/**
|
|
35953
|
+
* Member → the name an edge's empty one took away a moment ago (`setNick`), and when. The admin that removed me while
|
|
35954
|
+
* I was away says no name on the edge it kept to tell me, as its app opens it, and the commit that removes me comes
|
|
35955
|
+
* right after on that edge: that name comes back for the history I keep (`nameKept`). In memory only.
|
|
35956
|
+
*/
|
|
35957
|
+
unnamed = /* @__PURE__ */ new Map();
|
|
35009
35958
|
/** The version of my name record last said to every member (`sayName`). In memory only: said again once per start. */
|
|
35010
35959
|
nameSaid;
|
|
35011
35960
|
/** New name records taken per member, a few a minute (`GROUP_LIMITS.namesPerMember`). In memory only. */
|
|
@@ -35014,8 +35963,8 @@ var GroupSession = class {
|
|
|
35014
35963
|
messagePace = /* @__PURE__ */ new Map();
|
|
35015
35964
|
editPace = /* @__PURE__ */ new Map();
|
|
35016
35965
|
queue = Promise.resolve();
|
|
35017
|
-
/**
|
|
35018
|
-
pendingMeta;
|
|
35966
|
+
/** Metadata frames that name a commit or an epoch I do not have yet, one signed by the admin and one by anyone else (`waitMeta`): tried again when the chain moves. */
|
|
35967
|
+
pendingMeta = {};
|
|
35019
35968
|
/** While `handle` runs: the frames it took that a hub passes on (`handle`'s result). */
|
|
35020
35969
|
passOn = null;
|
|
35021
35970
|
/** The frames kept to hand on that the app holds with its messages, oldest first; undefined when the state holds them all. */
|
|
@@ -35716,6 +36665,16 @@ var GroupSession = class {
|
|
|
35716
36665
|
this.waiting = [];
|
|
35717
36666
|
this.waitingBytes = 0;
|
|
35718
36667
|
this.pendingCommits.clear();
|
|
36668
|
+
this.nameKept();
|
|
36669
|
+
}
|
|
36670
|
+
/**
|
|
36671
|
+
* Out of the group: a name an edge took away a moment before comes back, as the history I keep still shows it. The
|
|
36672
|
+
* edge the admin kept to tell me I was removed says no name as it opens, just before the commit that removed me.
|
|
36673
|
+
*/
|
|
36674
|
+
nameKept() {
|
|
36675
|
+
const now = this.now();
|
|
36676
|
+
for (const [key, { nick, at }] of this.unnamed) if (now - at <= UNNAMED_KEPT_MS && !this.state.nicks[key]) this.state.nicks[key] = nick;
|
|
36677
|
+
this.unnamed.clear();
|
|
35719
36678
|
}
|
|
35720
36679
|
/**
|
|
35721
36680
|
* Encrypts and signs a text, keeps it for catch-up and sends it to every other member. `mentions`: places of the
|
|
@@ -36222,10 +37181,17 @@ var GroupSession = class {
|
|
|
36222
37181
|
setNick(key, nick) {
|
|
36223
37182
|
return this.serialize(async () => {
|
|
36224
37183
|
const clean = sanitizeNick(nick);
|
|
37184
|
+
if (!clean && this.state.status !== "active") return;
|
|
36225
37185
|
this.nickAt.set(key, this.now());
|
|
36226
|
-
|
|
37186
|
+
const was = this.state.nicks[key];
|
|
37187
|
+
if ((was ?? void 0) === clean) return;
|
|
36227
37188
|
if (clean) this.state.nicks[key] = clean;
|
|
36228
37189
|
else delete this.state.nicks[key];
|
|
37190
|
+
if (!clean && was) this.unnamed.set(key, {
|
|
37191
|
+
nick: was,
|
|
37192
|
+
at: this.now()
|
|
37193
|
+
});
|
|
37194
|
+
else this.unnamed.delete(key);
|
|
36229
37195
|
if (key === this.myKey) await this.persist();
|
|
36230
37196
|
else this.persistSoon();
|
|
36231
37197
|
this.hooks.changed();
|
|
@@ -37099,22 +38065,14 @@ var GroupSession = class {
|
|
|
37099
38065
|
const s = frame.statement;
|
|
37100
38066
|
if (!groupMetaNewer(s, this.state.meta)) return;
|
|
37101
38067
|
if (s.e > this.epoch || frame.k > this.epoch) {
|
|
37102
|
-
this.
|
|
37103
|
-
from,
|
|
37104
|
-
frame: raw
|
|
37105
|
-
};
|
|
37106
|
-
this.ask(from);
|
|
38068
|
+
this.waitMeta(from, raw, s);
|
|
37107
38069
|
return;
|
|
37108
38070
|
}
|
|
37109
38071
|
const commit = this.state.chain[s.e];
|
|
37110
38072
|
if (commitHash(commit) !== s.h || rosterAdmin(commit.m) !== s.by || this.admin !== s.by || !verifyGroupMetaSignature(s)) return;
|
|
37111
38073
|
const secret = this.secret(frame.k);
|
|
37112
38074
|
if (!secret) {
|
|
37113
|
-
this.
|
|
37114
|
-
from,
|
|
37115
|
-
frame: raw
|
|
37116
|
-
};
|
|
37117
|
-
this.ask(from);
|
|
38075
|
+
this.waitMeta(from, raw, s);
|
|
37118
38076
|
return;
|
|
37119
38077
|
}
|
|
37120
38078
|
const opened = openGroupMeta(frame, epochKeys(secret, this.id, frame.k).message);
|
|
@@ -37135,6 +38093,21 @@ var GroupSession = class {
|
|
|
37135
38093
|
});
|
|
37136
38094
|
}
|
|
37137
38095
|
/**
|
|
38096
|
+
* A statement that waits for the chain: only one its signer signed, so an altered copy cannot push out the one
|
|
38097
|
+
* waiting. The admin I know has a place of their own, which another member's statement cannot take, and in each
|
|
38098
|
+
* place only a later statement takes the one waiting.
|
|
38099
|
+
*/
|
|
38100
|
+
waitMeta(from, raw, s) {
|
|
38101
|
+
if (!verifyGroupMetaSignature(s)) return;
|
|
38102
|
+
const place = s.by === this.admin ? "admin" : "other", waiting = this.pendingMeta[place];
|
|
38103
|
+
if (!waiting || groupMetaNewer(s, waiting.s)) this.pendingMeta[place] = {
|
|
38104
|
+
from,
|
|
38105
|
+
frame: raw,
|
|
38106
|
+
s
|
|
38107
|
+
};
|
|
38108
|
+
this.ask(from);
|
|
38109
|
+
}
|
|
38110
|
+
/**
|
|
37138
38111
|
* Who made the change a statement brings me: its signer, when they were the admin all along since the statement I
|
|
37139
38112
|
* held (or, with none, since I got in). A new admin signs again what the last one set (`metaFollowsChain`): to a
|
|
37140
38113
|
* member that missed that, it is no change of theirs it can tell apart, so nobody is named. With none held, theirs is
|
|
@@ -37151,9 +38124,9 @@ var GroupSession = class {
|
|
|
37151
38124
|
}
|
|
37152
38125
|
/** After the chain or my secrets moved: the waiting statement, and, if I became the admin, the name and picture signed again as mine. */
|
|
37153
38126
|
async metaFollowsChain() {
|
|
37154
|
-
const
|
|
37155
|
-
this.pendingMeta =
|
|
37156
|
-
if (pending) await this.receiveMeta(pending.from, pending.frame);
|
|
38127
|
+
const { admin, other } = this.pendingMeta;
|
|
38128
|
+
this.pendingMeta = {};
|
|
38129
|
+
for (const pending of [admin, other]) if (pending) await this.receiveMeta(pending.from, pending.frame);
|
|
37157
38130
|
if (this.isAdmin && this.state.meta && this.state.meta.by !== this.myKey) await this.publishMeta(this.state.meta.body, this.state.meta.ts, true);
|
|
37158
38131
|
}
|
|
37159
38132
|
async fork(reason) {
|
|
@@ -37991,8 +38964,8 @@ var CommunitySession = class CommunitySession {
|
|
|
37991
38964
|
/** My frames said again in this run (`e:h16:n`) → the id of the message they first were. In memory only. */
|
|
37992
38965
|
resealedFrom = /* @__PURE__ */ new Map();
|
|
37993
38966
|
saveTimer;
|
|
37994
|
-
/**
|
|
37995
|
-
pendingMeta;
|
|
38967
|
+
/** Metadata frames naming a commit or a secret I do not have yet, one signed by the admin and one by anyone else (`waitMeta`): tried again when the chain or my secrets move. */
|
|
38968
|
+
pendingMeta = {};
|
|
37996
38969
|
/** The store's frames the app holds with their messages (`storeKey` → message id): in memory here, not in what is saved. */
|
|
37997
38970
|
onRows = /* @__PURE__ */ new Map();
|
|
37998
38971
|
/** The oldest epoch whose seen marks are kept, as of the last `pruneSeen`. In memory only. */
|
|
@@ -40550,23 +41523,13 @@ var CommunitySession = class CommunitySession {
|
|
|
40550
41523
|
if (!groupMetaNewer(s, this.state.meta)) return false;
|
|
40551
41524
|
const at = this.mainIndex.get(s.h);
|
|
40552
41525
|
if (at === void 0) {
|
|
40553
|
-
if (s.e >= this.epoch - COMMUNITY_LIMITS.window)
|
|
40554
|
-
this.pendingMeta = {
|
|
40555
|
-
from,
|
|
40556
|
-
frame: raw
|
|
40557
|
-
};
|
|
40558
|
-
this.ask(from);
|
|
40559
|
-
}
|
|
41526
|
+
if (s.e >= this.epoch - COMMUNITY_LIMITS.window) this.waitMeta(from, raw, s);
|
|
40560
41527
|
return false;
|
|
40561
41528
|
}
|
|
40562
41529
|
if (at !== s.e || rosterAdmin(this.rosterAt(s.h) ?? []) !== s.by || this.admin !== s.by || !verifyGroupMetaSignature(s)) return false;
|
|
40563
41530
|
const secret = this.state.secrets[frame.k], sealedUnder = this.known.get(frame.k);
|
|
40564
41531
|
if (!secret || !sealedUnder) {
|
|
40565
|
-
this.
|
|
40566
|
-
from,
|
|
40567
|
-
frame: raw
|
|
40568
|
-
};
|
|
40569
|
-
this.ask(from);
|
|
41532
|
+
this.waitMeta(from, raw, s);
|
|
40570
41533
|
return false;
|
|
40571
41534
|
}
|
|
40572
41535
|
const opened = openGroupMeta(frame, epochKeys(fromBase64Url(secret), this.id, sealedUnder.e).message);
|
|
@@ -40581,6 +41544,21 @@ var CommunitySession = class CommunitySession {
|
|
|
40581
41544
|
return true;
|
|
40582
41545
|
}
|
|
40583
41546
|
/**
|
|
41547
|
+
* A statement that waits for the chain: only one its signer signed, so an altered copy cannot push out the one
|
|
41548
|
+
* waiting. The admin I know has a place of their own, which another member's statement cannot take, and in each
|
|
41549
|
+
* place only a later statement takes the one waiting.
|
|
41550
|
+
*/
|
|
41551
|
+
waitMeta(from, raw, s) {
|
|
41552
|
+
if (!verifyGroupMetaSignature(s)) return;
|
|
41553
|
+
const place = s.by === this.admin ? "admin" : "other", waiting = this.pendingMeta[place];
|
|
41554
|
+
if (!waiting || groupMetaNewer(s, waiting.s)) this.pendingMeta[place] = {
|
|
41555
|
+
from,
|
|
41556
|
+
frame: raw,
|
|
41557
|
+
s
|
|
41558
|
+
};
|
|
41559
|
+
this.ask(from);
|
|
41560
|
+
}
|
|
41561
|
+
/**
|
|
40584
41562
|
* Who made the change a statement brings me (`at`: its commit's place on my main branch): its signer, when they were
|
|
40585
41563
|
* the admin all along since the statement I held (or, with none, since I got in). A new admin signs again what the
|
|
40586
41564
|
* last one set (`metaFollowsChain`): to a member that missed that, it is no change of theirs it can tell apart. With
|
|
@@ -40605,9 +41583,9 @@ var CommunitySession = class CommunitySession {
|
|
|
40605
41583
|
* went with a branch that lost a fork, the name and picture signed again as mine under the main branch.
|
|
40606
41584
|
*/
|
|
40607
41585
|
async metaFollowsChain() {
|
|
40608
|
-
const
|
|
40609
|
-
this.pendingMeta =
|
|
40610
|
-
if (pending && await this.receiveMeta(pending.from, pending.frame)) this.hooks.relay?.(pending.frame);
|
|
41586
|
+
const { admin, other } = this.pendingMeta;
|
|
41587
|
+
this.pendingMeta = {};
|
|
41588
|
+
for (const pending of [admin, other]) if (pending && await this.receiveMeta(pending.from, pending.frame)) this.hooks.relay?.(pending.frame);
|
|
40611
41589
|
const meta = this.state.meta;
|
|
40612
41590
|
if (this.isAdmin && meta && (meta.by !== this.myKey || !this.mainIndex.has(meta.h))) await this.publishMeta(meta.body, meta.ts, true);
|
|
40613
41591
|
}
|
|
@@ -41903,6 +42881,6 @@ function x401ApprovalDigest(subject) {
|
|
|
41903
42881
|
return toBase64Url(sha256(utf8Encode(canonical)));
|
|
41904
42882
|
}
|
|
41905
42883
|
//#endregion
|
|
41906
|
-
export { COMMUNITY_LIMITS as $, turnInstance as $C, DEVICES_CAPABILITY as $S, toBase64 as $T, compressSdp as $_, DEMOTE_AFTER_FAILURES as $a, STAMP_BITS_MAX as $b, WAKE_ONLINE_BATCH as $c, RELAY_WITH_SECRETS as $d, dhtFileId as $f, presenceSeenAt as $g, RATCHET_CAPABILITY as $h, isSparkAddress as $i, appDataBytes as $l, cardTimeUtc as $m, MessageRefusal as $n, GROUP_VERSION_SIGNALS as $o, linkStop as $p, DidError as $r, STATUS_AVAILABILITIES as $s, GROUP_EDIT_TEXT_BYTES as $t, IDENTITY_MAX_RECEIVED as $u, HANDOFF_VERIFIED as $v, RelayBreaker as $w, isAppLine as $x, readSetUpdate as $y, readX401ProofResponseHeader as A, TURN_BODY_BYTES as AC, createDeviceInvite as AS, encrypt as AT, decodeControl as A_, findBolt11 as Aa, clearMissed as Ab, typingFrame as Ac, STORAGE_ROOT as Ad, encodeDnsQuery as Af, DAEMON_WATCH_PEER_IDLE_MS as Ag, rosterAdmin as Ah, jwkThumbprint as Ai, APP_RANGE_LIMITS as Al, groupReplyAuthor as Am, parseGroupMetaBody as An, parsePaymentNetworks as Ao, EDIT_BUFFER_MAX as Ap, parseAtprotoDidDocument as Ar, readBeacon as As, knockRecords as At, SESSION_RECEIVE_PENDING as Au, viewerTag as Av, PREVIOUS_DEFAULT_RELAYS as Aw, assembleAppBundle as Ax, handoffVersions as Ay, APP_STORE_KINDS as B, TURN_TTL as BC, OwnInviteError as BS, hasVisible as BT, extractRtcParams as B_, videoMetadataPatches as Ba, ContactRequestError as Bb, parsePinFrame as Bc, storageProofPath as Bd, wellKnownUrl as Bf, OFFER_STEP_MAX as Bg, decryptText as Bh, TEST_USDT_FAUCET_AMOUNT as Bi, isServeId as Bl, PR_CHECKS as Bm, SSH_PUBLIC_KEY_MAX as Bn, GROUP_VERSION_FILES as Bo, dhtEditId as Bp, parseAtprotoDidKey as Br, parsePairedCallFrame as Bs, groupWakes as Bt, capsDescriptors as Bu, HANDOFF_FILE_REQUEST as Bv, WATCH_SHARE as Bw, sha256Paced as Bx, readHandoffHave as By, buildX401TokenObject as C, TURN_SETTLE_MS as CC, CONTACT_LINK_VERSION as CS, createIdentity as CT, withViewerPolicy as C_, parseInvoiceCallback as Ca, verifyEnrollProof as Cb, TypingReceiver as Cc, IDENTITY_TIMELINE_MAX as Cd, DOMAIN_TXT_MAX_BYTES as Cf, DIRECT_EVIDENCE_MS as Cg, OWN_FRAME_LIMIT as Ch, decodeDidDhtPacket as Ci, generateVapidKeys as Cl, readDhtReactions as Cm, groupMetaPicture as Cn, SWITCH_RETIRE_MS as Co, PLAYABLE_VIDEO as Cp, ATPROTO_PROOF_SCOPE as Cr, lobbyKeys as Cs, KNOCK_TTL_MS as Ct, UPGRADE_CAPABILITY as Cu, decodeServices as Cv, GROUP_BURST_MS as Cw, APP_FORBIDDEN_KEYS as Cx, handoffPakeFrame as Cy, readX401ProofRequest as D, turnPutSummary as DC, DEVICE_INVITE_BYTES as DS, sign as DT, MAX_CHUNK_PAYLOAD_BYTES as D_, resolveLightningDestination as Da, MAX_WAITING as Db, plainStatusLine as Dc, PROOF_CAPABILITY as Dd, dnsProofName as Df, directBlocked as Dg, expectedRoster as Dh, didDhtRecords as Di, APP_RANGE_DATA_KIND as Dl, PAIRED_REPLY_AUTHORS as Dm, keepPastGroupMeta as Dn, pairedEditFits as Do, isVideoMime as Dp, checkAtprotoProofRecord as Dr, newerHead as Ds, entryParams as Dt, PAIRED_PROFILE as Du, serviceIdFromName as Dv, GROUP_SIGNALING_ALLOWANCE_SHARE as Dw, APP_VIEWS as Dx, handoffStreamKey as Dy, isX401Protocol as E, keptAtEqualSequence as EC, readContactLink as ES, publicKeyFromZ32 as ET, LIMITS as E_, requestLnurlInvoice as Ea, MAX_MISSED as Eb, parseTypingFrame as Ec, PROOF_ADAPTERS as Ed, decodeDnsResponse as Ef, DirectPathWatch as Eg, commitUntaggedHash as Eh, didDhtKey as Ei, vapidKeysMatch as El, wireReaction as Em, groupName as En, WAKE_LOST_MS as Eo, isPlayableVideoType as Ep, atprotoProofRkey as Er, mergeLobby as Es, encodeGroupEntryLink as Et, sessionCapabilitiesFrame as Eu, isViewerTag as Ev, GROUP_RATION_WINDOW_MS as Ew, APP_SCREENSHOTS_DIR as Ex, handoffRetryAfter as Ey, appRevocationFor as F, TURN_NO_ACTIVE as FC, DEVICE_INVITE_VERSION as FS, MAX_AVATAR_SIDE as FT, DATA_CHANNEL_ID as F_, isFederationId as Fa, settleRequest as Fb, PIN_CLOCK_SKEW_MS as Fc, proofCapability as Fd, recordsFromTxt as Ff, IDLE_THRESHOLD as Fg, verifyCommit as Fh, EVM_TEST_CHAINS as Fi, appRangeEndFrame as Fl, ACTIVE_TASK_STATUSES as Fm, verifyGroupMetaSignature as Fn, engineText as Fo, EDIT_SEND_LIMIT as Fp, decodeAtprotoCommit as Fr, CALL_RATE_WINDOW_MS as Fs, GROUP_WAKE_GROUP_WINDOW_MS as Ft, CAPS_REFRESH_MS as Fu, HANDOFF_CANCEL as Fv, SIGNALING_ALLOWANCE_SHARE as Fw, isAppPath as Fx, readHandoffBusy as Fy, readAppStore as G, nextTurnPosition as GC, encodeInviteCode as GS, unwrapPasted as GT, CALL_SIGNAL_MAX_AGE_MS as G_, stripPictureMetadata as Ga, MAX_SLOT_KNOCKS as Gb, pinnedFrame as Gc, ringAuthorization as Gd, DHT_TEXT_BYTES as Gf, SIGNAL_OUT_READS as Gg, openPair as Gh, assertWholeSats as Gi, APP_PEER_OPEN_MAX as Gl, STATUS_CARD_LIMITS as Gm, sshFingerprint as Gn, isGroupMessageId as Go, validEditMessage as Gp, verifyAtprotoSignature as Gr, FileUplink as Gs, GROUP_READ_NOTE as Gt, IDENTITY_CHALLENGE_WINDOW as Gu, HANDOFF_MANIFEST as Gv, readRelayBody as Gw, appFingerprint as Gx, readHandoffTurnFrame as Gy, checkAppListing as H, TurnRecordError as HC, createLink as HS, sanitizeNick as HT, parseRtcSignal as H_, NO_PICTURE_METADATA as Ha, KNOCK_SLOT_LABEL as Hb, pinFrame as Hc, verifyNostrProof as Hd, DHT_FILE_REFUSED as Hf, PRESENCE_WINDOW as Hg, encryptText as Hh, WALLET_NETWORKS as Hi, readAppRangeFrame as Hl, REMOVABLE_KINDS as Hm, parseSshPublicKey as Hn, GROUP_WANT_NO_FRAME as Ho, editedFrame as Hp, readAtprotoCid as Hr, FILE_DATA_KIND as Hs, parseGroupWakeFrame as Ht, emptyCapsState as Hu, HANDOFF_HELLO as Hv, WRITE_FIRST_MS as Hw, APP_NAME as Hx, readHandoffManifest as Hy, appStoreDecision as I, TURN_REV_LIMIT as IC, INVITE_HRP as IS, jpegSize$1 as IT, DATA_CHANNEL_LABEL as I_, parseCashuRequestPayload as Ia, takeRequest as Ib, PIN_FRAME as Ic, proofHash as Id, recordsFromWellKnown as If, LinkSession as Ig, verifyCommitSignature as Ih, ONCHAIN_PROVIDER as Ii, appRangeErrorFrame as Il, BUTTON_ID as Im, wrapGroupMeta as In, parseEngineError as Io, MAX_EDITS_PER_MESSAGE as Ip, decodeDagCbor as Ir, CALL_RECEIVE_LIMIT as Is, GROUP_WAKE_MEMBER_INTERVAL_MS as It, CapsExchange as Iu, HANDOFF_CANCEL_REASONS as Iv, SIGNALING_WINDOW_MS as Iw, isAppUrl as Ix, readHandoffCancel as Iy, GROUP_TYPING_FRAME as J, readTurnPacket as JC, inviteQrSegments as JS, fromBase64 as JT, RTC_CONFIG as J_, ANSWERS_REFUSED_PAUSE_MS as Ja, REQUEST_LIFETIME_MS as Jb, WAKE_CALL_INTERVAL_MS as Jc, validRingKey as Jd, LIVE_POLL_MS as Jf, UNUSED_INVITE_READS_PER_MINUTE as Jg, sealSecret as Jh, parsePaymentAmount as Ji, APP_RESUME_GRACE_MS as Jl, appCardUrl as Jm, verifySshSignature as Jn, readGroupWant as Jo, LINK_MAX_CHARS as Jp, DID_GHOSTLY_SERVICE as Jr, refusalText as Js, chainPieces as Jt, IDENTITY_FRAME_LIMIT as Ju, HANDOFF_PIECE_BYTES as Jv, traceLink as Jw, appRevocationId as Jx, sealHandoffPiece as Jy, readAppStoreSteps as K, openTurnValue as KC, inviteLink as KS, bytesEqual as KT, PAIRED_CALL_CANDIDATES as K_, withoutPictureMetadata as Ka, REQUEST_CLOCK_SKEW_MS as Kb, readPin as Kc, ringClaims as Kd, DHT_TEXT_REFUSED as Kf, STALLED_LOOK_MS as Kg, openSecret as Kh, formatPaymentAmount as Ki, APP_RATE_LIMIT as Kl, TASK_STATUSES as Km, sshKeyDigestHex as Kn, readGroupFileMeta as Ko, validEditNumber as Kp, DID_DOCUMENT_MAX_BYTES as Kr, decodeFileData as Ks, GroupSession as Kt, IDENTITY_CHECK_UNAVAILABLE as Ku, HANDOFF_OFFER as Kv, relayUrlProblem as Kw, appRef as Kx, readHandoffVerified as Ky, appUpdateDecision as L, TURN_SEALED_BYTES as LC, INVITE_LINK_ORIGIN as LS, sanitizeAvatar as LT, RTC_SIGNAL_FUTURE_MS as L_, parseFedimintRequestPayload as La, turnOff as Lb, PIN_LIMITS as Lc, proofStatement as Ld, recordsName as Lf, MAX_DHT_TEXT_BYTES as Lg, GROUP_PROFILE as Lh, PaymentPreflightError as Li, appRangeGetFrame as Ll, BUTTON_STYLES as Lm, SSHSIG_MAX_ARMOR as Ln, PairingTracker as Lo, MAX_REMOVAL_NUMBER as Lp, encodeDagCbor as Lr, MAX_PAIRED_CALL_SIGNAL as Ls, GROUP_WAKE_RECEIVE_LIMIT as Lt, CapsKeys as Lu, HANDOFF_DATA as Lv, SLOW_DEMOTE_MS as Lw, pacer as Lx, readHandoffData as Ly, readX401ProofResultHeader as M, TURN_LAST_SEQUENCE as MC, deviceInviteJoinerParams as MS, sealedLength as MT, encodeControl as M_, cashuRequestPayload as Ma, inboxRecord as Mb, COMMUNITY_PIN_FRAME as Mc, importedProof as Md, nip05RootKey as Mf, DHT_POLL_INTERVALS as Mg, signCommit as Mh, resolveDidDht as Mi, appRangeCancelFrame as Ml, readReply as Mm, parseGroupMetaStatement as Mn, ENGINE_ERRORS as Mo, EDIT_FRAME as Mp, AtprotoCid as Mr, readLobby as Ms, readKnocks as Mt, CAPS_LABEL as Mu, HANDOFF_ATTEMPTS as Mv, REQUESTS_PER_MINUTE as Mw, checkAppManifest as Mx, newHandoffId as My, x401AnswerableRequests as N, TURN_MAX as NC, encodeDeviceInvite as NS, tryDecrypt as NT, sendBody as N_, fedimintRequestPayload as Na, newInbox as Nb, GROUP_PIN_FRAME as Nc, isProofAdapter as Nd, normalizeDomain as Nf, EXPECT_PEER_MS as Ng, sortRoster as Nh, signDidDhtPacket as Ni, appRangeChunk as Nl, replySnippet as Nm, parseGroupMetaTag as Nn, EngineError as No, EDIT_RATE_WINDOW_MS as Np, AtprotoProofError as Nr, shouldBeHub as Ns, GROUP_WAKE_FRAME as Nt, CAPS_LIMITS as Nu, HANDOFF_BUSY as Nv, RelayTransport as Nw, findAppForbiddenKey as Nx, openHandoffPiece as Ny, readX401ProofRequestHeader as O, TOMBSTONE_SEQUENCE as OC, DEVICE_INVITE_LIFETIME_S as OS, verify as OT, PROTOCOL_VERSION as O_, BOLT11_PATTERN as Oa, NEW_PER_HOUR as Ob, sanitizeTypingStatus as Oc, PeerProofs as Od, domainTxtRecord as Of, symmetricNat as Og, parseGroupCommit as Oh, encodeDidDhtDeactivated as Oi, APP_RANGE_ERRORS as Ol, REPLY_ID as Om, nextGroupMetaRevision as On, pairedMessageFits as Oo, parseVideoMeta as Op, isAtprotoDid as Or, pickHubs as Os, groupEntryUrl as Ot, PairedSession as Ou, servicesFromWire as Ov, HEDGE_MISSING_MS as Ow, appDigest as Ox, handoffVerifiedFrame as Oy, addedAppPermissions as P, TURN_NAME_BYTES as PC, readDeviceInvite as PS, MAX_AVATAR_LENGTH as PT, wrapDataChannel as P_, findEndpoint as Pa, planKnocks as Pb, PINNED_FRAME as Pc, nostrProofTemplate as Pd, parseDomainTxt as Pf, FIRST_PUBLISH_MAX_MS as Pg, verifyChain as Ph, ETHEREUM_USDT as Pi, appRangeDataFrame as Pl, wireReply as Pm, signGroupMeta as Pn, engineError as Po, EDIT_RECEIVE_LIMIT as Pp, atprotoCidFor as Pr, validHead as Ps, GROUP_WAKE_GROUP_LIMIT as Pt, CAPS_PUBLISH_SPACING_MS as Pu, HANDOFF_BUSY_REASONS as Pv, RelaysFailedError as Pw, isAppLicense as Px, readHandoffAck as Py, sealGroupTyping as Q, signTurnRelease as QC, readInviteCode as QS, randomBytes as QT, callSignalHeardAt as Q_, CROSSED_WAIT_MS as Qa, STAMP_BITS_DEFAULT as Qb, WAKE_INTERVAL_MS as Qc, RELAY_URL as Qd, dhtFileElements as Qf, countUnusedInvite as Qg, MAX_SKIPPED_KEYS as Qh, SPARK_PROVIDER as Qi, appCloseFrame as Ql, cardLinkHost as Qm, BIP322_REVISION as Qn, GROUP_SIGNAL_FRAME as Qo, linkEnd as Qp, DID_METHODS as Qr, PRESENCES as Qs, GROUP_EDIT_FRAME as Qt, IDENTITY_MAX_FRAME as Qu, HANDOFF_TIMINGS as Qv, BREAKER_THRESHOLD as Qw, isAppKey as Qx, encodeSetSlots as Qy, checkAppBeforeRun as R, TURN_SIGNED_BYTES as RC, INVITE_MAX_LENGTH as RS, MAX_NICK_LENGTH as RT, RTC_SIGNAL_MAX_AGE_MS as R_, NO_VIDEO_METADATA as Ra, CONTACT_ASKER_FRAME as Rb, mayPin as Rc, storageProof as Rd, txtValue as Rf, OFFER_FAST_MS as Rg, confirmationMatches as Rh, SEPOLIA_TEST_USDT as Ri, decodeAppRangeData as Rl, CRON_LINE as Rm, SSHSIG_NAMESPACE as Rn, GROUP_FILE_LIMITS as Ro, REMOVED_TEXT as Rp, findInMst as Rr, PAIRED_CALL_FRAME as Rs, GroupWakeLimiter as Rt, CapsRefusedError as Ru, HANDOFF_DONE as Rv, SLOW_MS as Rw, readAppBundle as Rx, readHandoffDone as Ry, buildX401ResultArtifact as S, TURN_RAISE_READ_TIMEOUT_MS as SC, CONTACT_LINK_BYTES as SS, IDENTITY_MEMO_SIZE as ST, webLocalFetch as S_, invoiceCallbackUrl as Sa, readEnrollHello as Sb, TYPING_TIMEOUT_MS as Sc, verifyIdentityPresentation as Sd, DOMAIN_METHODS as Sf, STALLED_EVIDENCE_MS as Sg, MEMBER_KEY as Sh, DidDhtError as Si, encryptPushPayload as Sl, reactionIsNewer as Sm, groupMetaNewer as Sn, RTC_UNSTARTED_MS as So, voicePeaksOf as Sp, ATPROTO_PROOF_COLLECTION as Sr, hubRank as Ss, GROUP_ENTRY_PROFILE as St, TYPING_CAPABILITY as Su, SERVICES_VERSION as Sv, FRESH_READ_MS as Sw, APP_CLIENT_NAME as Sx, handoffOfferFrame as Sy, encodeX401Header as T, classifyTurnRead as TC, encodeContactLink as TS, identityFromSeedB64 as TT, CHUNK_KIND as T_, parsePayParams as Ta, MAX_DONE as Tb, parseTypingActivity as Tc, lastSharedWithMe as Td, WELL_KNOWN_PATH as Tf, DIRECT_PEERS as Tg, commitHash as Th, didDhtFromPublicKey as Ti, vapidAuthorization as Tl, validReactionNumber as Tm, groupMetaToHand as Tn, WAKE_ANSWER_GRACE_MS as To, formatVideoDuration as Tp, atprotoProofRecord as Tr, mergeBeacon as Ts, decodeGroupEntryLink as Tt, parseSessionCapabilities as Tu, isValidServiceId as Tv, GROUP_OVER_PACE_MS as Tw, APP_PERMISSIONS as Tx, handoffRequestFrame as Ty, checkAppStoreIndex as U, encodeTurnFields as UC, decodeInviteCode as US, stripHidden as UT, BURST_RING_MS as U_, PICTURE_METADATA_LIMITS as Ua, LINK_RECORD_LABEL as Ub, pinIsNewer as Uc, verifyPeerProof as Ud, DHT_FILE_TOO_LARGE as Uf, RELAY_POLL_INTERVALS as Ug, epochKeys as Uh, arkAddressPrefix as Ui, APP_DATA_MAX_BYTES as Ul, ROUTINE_STATES as Um, parseSshSignature as Un, fetchesByItself as Uo, parseEditFrame as Up, unsignedCommitBytes as Ur, FILE_FRAMES as Us, GROUP_LIMITS as Ut, encodePacketTransports as Uu, HANDOFF_LATER_BYTES as Uv, currentRelays as Uw, APP_PREFIXES as Ux, readHandoffPake as Uy, APP_STORE_LIMITS as V, TURN_VERSION as VC, createChatInvite as VS, sanitizeDisplayText as VT, offerIsFresh as V_, withoutVideoMetadata as Va, KNOCK_SLOTS as Vb, parsePinnedFrame as Vc, validExternalKey as Vd, ACTIVE_DHT_POLL_MS as Vf, PRESENCE_HEARTBEAT as Vg, edgeParams as Vh, USDT_PUBLIC_RPC as Vi, parseAppRangeFrame as Vl, PR_STATES as Vm, SshSigError as Vn, GROUP_WANT_FRAME as Vo, editFrame as Vp, parseAtprotoVerificationKey as Vr, ChatFiles as Vs, mentionedMembers as Vt, dialDescriptors as Vu, HANDOFF_HAVE as Vv, WAY_BACK_SHARE as Vw, yieldThread as Vx, readHandoffHello as Vy, readAppListing as W, firstDeviceSetSecret as WC, encodeGhostlyInvite as WS, trimEndOf as WT, CALL_SIGNAL_FUTURE_MS as W_, isStrippedPicture as Wa, MAX_SEEN as Wb, pinNumberHolds as Wc, RING_LIFETIME as Wd, DHT_MESSAGE_TTL as Wf, SIGNAL_DUE_READS as Wg, newEpochSecret as Wh, assertTokenUnits as Wi, APP_FRAME as Wl, RUN_RESULTS as Wm, sameSshKey as Wn, groupFileFallback as Wo, parseEditedFrame as Wp, verifyAtprotoRecordProof as Wr, FILE_LIMITS as Ws, GROUP_REACTED_FRAME as Wt, parsePacketTransports as Wu, HANDOFF_LIST_PER_FRAME as Wv, normalizeRelayUrl as Ww, APP_STATEMENT_LIMITS as Wx, readHandoffRelease as Wy, groupTypingEpoch as X, signTurnBody as XC, ownInviteRefusal as XS, fromZ32 as XT, buildSdpFromSignal as X_, CROSSED_FRESH_MS as Xa, REQUEST_PACKET_BYTES as Xb, WAKE_CALL_WAIT_MS as Xc, verifyRingEvidence as Xd, peekDhtMailbox as Xf, UNUSED_INVITE_WAIT_MAX_MS as Xg, FOLLOW_MS as Xh, walletNetworkOf as Xi, APP_VERSION_MAX as Xl, cardEditNumber as Xm, legacyMessageHash as Xn, CARRIED_DEFER_MS as Xo, LINK_TRAILING as Xp, DID_JWS_MAX_LENGTH as Xr, transferEnded as Xs, groupMessageId as Xt, IDENTITY_MAX_CHECKS_PER_HOUR as Xu, HANDOFF_RELEASE as Xv, BREAKER_BASE_MS as Xw, checkAppRevokeStatement as Xx, SET_ACK as Xy, GroupTypingBoard as Y, sealTurnBody as YC, inviteQrText as YS, fromBase64Url as YT, answersOffer as Y_, BLOCKED_DIAL_WAIT_MS as Ya, REQUEST_NAME_UNITS as Yb, WAKE_CALL_TTL_SECONDS as Yc, verifyRingAuthorization as Yd, emptyDhtDeliveryState as Yf, UNUSED_INVITE_UPKEEP_MS as Yg, sha256Hex as Yh, validatePaymentTarget as Yi, APP_SEND_LIMIT as Yl, buttonLabelClash as Ym, isLegacySignature as Yn, readGroupWantNo as Yo, LINK_PREVIEW_LIMITS as Yp, DID_JWS_ALGS as Yr, sentWhole as Ys, frameBytes as Yt, IDENTITY_FRAME_WINDOW_MS as Yu, HANDOFF_PIECE_OVERHEAD as Yv, BREAKER_ALL_DOWN_PROBE_MS as Yw, appSignedBytes as Yx, sortParts as Yy, openGroupTyping as Z, signTurnPacket as ZC, pastedAgain as ZS, isZ32Key as ZT, callRtcConfig as Z_, CROSSED_PROBE_MS as Za, REQUEST_TEXT_BYTES as Zb, WAKE_FRAME as Zc, AUTOMATIC_ORDER as Zd, DHT_FILE_CAPABILITY as Zf, WATCH_PEER_MS as Zg, MAX_SKIP as Zh, SPARK_NETWORKS as Zi, AppSessions as Zl, cardLine as Zm, verifyBitcoinMessage as Zn, CarriedTransport as Zo, canonicalUrl as Zp, DID_MAX_LENGTH as Zr, transferStalled as Zs, COMMUNITY_EDIT_FRAME as Zt, IDENTITY_MAX_EVIDENCE as Zu, HANDOFF_REQUEST as Zv, BREAKER_MAX_MS as Zw, isAppHash as Zx, SET_UPDATE as Zy, X401_PROTOCOLS as _, unsignedDeviceTransports as _C, previewable as _S, signRelayPayload as _T, resolveTargetUrl as __, pubkyHomeserverOf as _a, enrollHelloFrame as _b, TYPING_RATE_LIMIT as _c, isIdentityBinding as _d, readManifest as _f, GATHER_ATTEMPTS as _g, GROUP_MEMBER_CAP as _h, strictBase64Url as _i, PUSH_PAD_BYTES as _l, parseReactionFrame as _m, MAX_GROUP_PICTURE_LENGTH as _n, RACE_RELAYED_MS as _o, recordingMime as _p, u32$1 as _r, COMMUNITY_TOPOLOGY as _s, shortHash as _t, SERVICES_CAPABILITY as _u, isEmptyLinkPacket as _v, CHAT_RESERVE_MOST_SHARE as _w, seenEntry as _x, handoffFileMissingFrame as _y, X401_DCQL_LIMITS as a, deviceEchoFrame as aC, __esmMin as aE, readAppSignature as aS, publishedNowhere as aT, guardViewerAnswer as a_, PUBKY_PROOF_MAX_BYTES as aa, DEVICE_KINDS as ab, STATUS_TEXT_MAX as ac, IDENTITY_STATEMENT_PREFIX as ad, irohRelayUrl as af, isRatcheted as ag, statusCardBytes as ah, didWebDocumentUrl as ai, WAKE_SUBJECT as al, forwardedAgain as am, validEditText as an, HANDLED_WAIT_MS as ao, sanitizeFileName as ap, BitcoinAddressError as ar, SIGNAL_REPLY_MS as as, communityHasFrame as at, parseAppFrame as au, isGlobalIpv4Host as av, turnSequence as aw, knockSlotIdentity as ax, handoffAckFrame as ay, buildX401ProofRequest as b, webCryptoSigner as bC, canonicalJsonBytes as bS, encodeTxtPacket as bT, viewerResponseHeaders as b_, fetchLnurlJson as ba, formatEnrollDigits as bb, TYPING_SEND_LIMIT as bc, revokesIdentity as bd, DOMAIN_FILE_MAX_BYTES as bf, OFFER_HOST_GATHER_MS as bg, MAX_GROUP_CHAIN as bh, DID_DHT_TTL as bi, checkPushEndpoint as bl, reactionEmoji as bm, groupMetaBody as bn, RTC_SIGNAL_RATE_WINDOW_MS as bo, voiceLevel as bp, ATPROTO_DECLARED_SCOPE as br, doorHubs as bs, verifyCommunityChainPaced as bt, STATUS_CARD_CAPABILITY as bu, LEGACY_SERVICES as bv, DEFAULT_RELAYS as bw, APP_BUNDLE_MAGIC as bx, handoffHelloFrame as by, readX401DcqlQuery as c, deviceKeyZ32 as cC, __toCommonJS as cE, signAppRevocation as cS, PKARR_FUTURE_SKEW_MS as cT, HttpClient as c_, isPubkyProofFolder as ca, ENROLL_DONE as cb, liveStatus as cc, IdentityExchange as cd, relayedTransports as cf, ratchetOpen as cg, usageLeft as ch, didWebFileUrl as ci, deviceWakeRequest as cl, COMMUNITY_REACTION_FRAME as cm, mentionsBytes as cn, LIVENESS_MISSED_PINGS as co, RECORDING_TYPES as cp, decodeAnyBitcoinAddress as cr, GROUP_VERSION_HUBS as cs, communityUntaggedHash as ct, APP_RANGES_CAPABILITY as cu, pickCallCandidates as cv, turnVerifierMark as cw, linkRecords as cx, handoffAttemptSucceeded as cy, newX401HolderKey as d, deviceLinkRendezvousSeed as dC, verifyAppStatementBytes as dS, createRelayPayload as dT, VIEWER_DROPPED_HEADERS as d_, pubkyProofCapability as da, ENROLL_PROOF as db, sameStatusState as dc, emptyIdentityLedger as dd, HOLD_DATED_BACK_MS as df, ratchetSessionOf as dg, claimedTime as dh, parseDid as di, readWake as dl, REACTED_FRAME as dm, wireMentions as dn, PAIRED_FRAME_TOO_LARGE as do, baseMime as dp, decodeWitness as dr, mayBeHub as ds, encodeCommunityLink as dt, EDIT_CAPABILITY as du, waitForIceGathering as dv, ANSWER_READ_SPACING_MS as dw, mergeContactKnocks as dx, handoffContext as dy, DEVICE_CAPABILITIES as eC, toBase64Url as eE, isAppRef as eS, DiscoveryBudgetError as eT, unusedInviteWait as e_, sparkAddressKind as ea, setAckFrame as eb, STATUS_FRAME as ec, IDENTITY_MAX_VALIDITY as ed, TRANSPORTS as ef, RATCHET_HEADER_BYTES as eg, cardUrl as eh, checkDidJws as ei, WAKE_ONLINE_BATCH_MS as el, linksIn as em, carryMentions as en, DEMOTE_MS as eo, readDhtFile as ep, bip322MessageHash as er, SIGNALS_PER_MINUTE as es, COMMUNITY_PROFILE as et, appDataFrame as eu, contactRtcConfig as ev, turnKeys as ew, STAMP_BITS_MIN as ex, HANDOFF_VERSION as ey, readX401SdJwtVc as f, deviceLinkSealKey as fC, IMAGE_LIMITS as fS, measureRecords as fT, VIEWER_SERVICE_CSP as f_, pubkyProofFile as fa, enrollCancelFrame as fb, sanitizeStatusText as fc, identityPresentationBytes as fd, HOLD_LIMITS as ff, ratchetUnknownSession as fg, heardTime as fh, parseDidDocument as fi, readWakePayload as fl, REACTION_FRAME as fm, GROUP_META_PAST as fn, PAIRING_ATTEMPT_MS as fo, downsamplePeaks as fp, encodeTx as fr, meshHubs as fs, leaveStands as ft, FILES_BINARY_CAPABILITY as fu, LABEL$1 as fv, AWAITED_READS as fw, openRequest as fx, handoffContextProof as fy, X401_LIMITS as g, signDeviceTransports as gC, parseImageMeta as gS, readOwnRelayPayload as gT, relativizeLocation as g_, homeserverWebEndpoint as ga, enrollGrantFrame as gb, TYPING_KINDS as gc, identityStatementText as gd, newMailbox as gf, DataLink as gg, GROUP_ID as gh, staticDidDocument as gi, wakeRequest as gl, parseReactedFrame as gm, MAX_GROUP_NAME_LENGTH as gn, RACE_DIRECT_MS as go, parseVoiceMeta as gp, txHash as gr, wireHubPolicy as gs, rosterHash as gt, REACTIONS_CAPABILITY as gu, emptyLinkRecords as gv, CHAT_RESERVE as gw, requestRecords as gx, handoffEphemeral as gy, X401_HEADERS as h, newDeviceSetSecret as hC, isImageMime as hS, parseRelayPayload as hT, parseLocalTarget as h_, encodeSvcbPacket as ha, enrollDoneFrame as hb, TYPING_FRAME as hc, identityStatement as hd, isHoldUrl as hf, DATA_SETTLE_MS as hg, GROUP_ADMIN_OFF_ERROR as hh, signingKeys as hi, wakePayload as hl, nextReactionNumber as hm, MAX_GROUP_NAME_BYTES as hn, RACE_ANSWERED_MS as ho, isPlayableAudioType as hp, sha256d as hr, pickMeshHubs as hs, leftStatement as ht, PIN_CAPABILITY as hu, buildLinkRecords as hv, BACKGROUND_WRITES_SHARE as hw, requestPlaintextBytes as hx, handoffDoneFrame as hy, x401ApprovalDigest as i, HANDOFF_CAPABILITY as iC, __commonJSMin as iE, readAppRevocations as iS, isDiscoveryBudgetError as iT, allowingViewerGuard as i_, isBitcoinAddress as ia, verifySetUpdate as ib, STATUS_SEND_INTERVAL_MS as ic, IDENTITY_REVOCATION_LABEL as id, irohDescriptor as if, emptyRatchetState as ig, sameButtonText as ih, didSignedMessages as ii, WAKE_RETRY_MS as il, FORWARD_LIMITS as im, parseCommunityEdit as in, GhostLink as io, safeBlobType as ip, verifyBip322 as ir, SIGNAL_PROVEN_MS as is, communityGroupId as it, isChatAppId as iu, isCandidateAddress as iv, turnReleaseMessage as iw, knockHolds as ix, filePartName as iy, readX401ProofResult as j, TURN_LABEL as jC, deviceInviteJoinerKeyZ32 as jS, generateEncryptionKey as jT, encodeChunk as j_, ENDPOINT as ja, endedRequests as jb, typingKindOf as jc, emptyProofLedger as jd, isPublicAddress as jf, DEPARTED_READ_MS as jg, rosterHas as jh, openDidDhtPayload as ji, AppRanges as jl, pairedReplyAuthor as jm, parseGroupMetaFrame as jn, publishFailure as jo, EDIT_BUFFER_MS as jp, shortAtprotoDid as jr, readBeaconHead as js, mergeKnocks as jt, CAPS_ISSUED_BACK_MS as ju, HANDOFF_ACK as jv, RELAY_REQUESTS_PER_MINUTE as jw, buildAppBundle as jx, isHandoffPartName as jy, readX401ProofResponse as k, TOMBSTONE_TURN as kC, DEVICE_INVITE_OWN_DEVICE as kS, decrypt as kT, decodeChunk as k_, decodeBolt11 as ka, REOPEN_BELOW as kb, typingActivity as kc, STORAGE_LIFETIME as kd, domainWellKnownFile as kf, AWAITING_PEER_MS as kg, rememberAlone as kh, encodeDidDhtPacket as ki, APP_RANGE_FRAMES as kl, REPLY_LIMITS as km, openGroupMeta as kn, pairedMessageFrame as ko, EDITED_FRAME as kp, normalizeAtprotoHandle as kr, rankHubs as ks, knockIdentity as kt, SESSION_FRAME_MAX as ku, servicesToWire as kv, HEDGE_MS as kw, appViewOf as kx, handoffVerifiedMessage as ky, x401VpToken as l, deviceLinkPairing as lC, verifyAppRevocation as lS, PacketTooLargeError as lT, HttpHost as l_, newPubkyProofFolder as la, ENROLL_GRANT as lb, parseStatusFrame as lc, boundIdentityDisplay as ld, transportOrder as lf, ratchetRoot as lg, MESSAGE_CLOCK_SKEW_MS as lh, didWebHost as li, newWakeToken as ll, GROUP_REACTION_FRAME as lm, mentionsMember as ln, LIVENESS_PING_MS as lo, VOICE_LIMITS as lp, decodeBitcoinAddress as lr, MESH_HUBS as ls, decodeCommunityLink as lt, BUTTONS_CAPABILITY as lu, sdpHasCandidates as lv, ANSWER_READ_ALLOWANCE as lw, makeStamp as lx, handoffBusyFrame as ly, x401HolderJwk as m, devicePingFrame as mC, imageSize as mS, openRelayPayload as mT, formatLocalTarget as m_, decodeSvcbRecords as ma, enrollDigits as mb, statusState as mc, identityRevocationValue as md, HoldRefusedError as mf, CONNECT_TIMEOUT_MS as mg, shownTime as mh, parseDidSignaturePaste as mi, wakeFrame as ml, ReactionWindow as mm, MAX_GROUP_META_BODY as mn, PONG_WAIT_MS as mo, formatVoiceDuration as mp, hash160 as mr, parseHubPolicy as ms, leaveStatement3 as mt, KNOWN_SESSION_CAPABILITIES as mu, RECORD_TTL as mv, BACKGROUND_WHILE_SIGNALING as mw, readLinkRecord as mx, handoffDigest as my, X401_RESPONSE_MODES as n, DEVICE_PING_FRAME as nC, utf8Decode as nE, readAppRevocation as nS, budgetRetryMs as nT, VIEWER_GUARD_HASH as n_, sparkNetworkOf as na, setUpdateMessage as nb, STATUS_RATE_LIMIT as nc, IDENTITY_PROVIDER_ID as nd, checkedDescriptors as nf, RATCHET_OVERHEAD as ng, readStatusCard as nh, didGhostlyServiceEntry as ni, WAKE_ONLINE_INTERVAL_MS as nl, previewImageSize as nm, communityMessageAuthor as nn, EARLY_DIAL_JOIN_MS as no, PREVIEWABLE_IMAGE as np, bip322ToSpend as nr, SIGNAL_FRESH_MS as ns, GROUP_READ_NOTE_COMMUNITY as nt, chatAppId as nu, extractParamsFromSdp as nv, turnPacket as nw, contactAskerHolds as nx, NO_ATTEMPTS as ny, matchX401Dcql as o, deviceEchoNonce as oC, __exportAll as oE, setAppSignatureFastPath as oS, withRequestOptions as oT, viewerGuardOffset as o_, PUBKY_PROOF_ROOT as oa, ENROLL_CANCEL as ob, StatusReceiver as oc, IDENTITY_SUBJECT as od, rankTransports as of, ratchetHeard as og, statusCardText as oh, didWebFile as oi, WAKE_TTL_SECONDS as ol, forwardedMany as om, MENTION_EVERYONE as on, INVITER_DIAL_GRACE_MS as oo, sanitizeMime as op, ByteReader as or, groupSignalFrame as os, communityMessageId as ot, readAppFrame as ou, keepsToRelays as ov, turnSignedMessage as ow, knockSlotOf as ox, handoffAttemptAllowed as oy, sameX401HolderJwk as p, deviceLinkSecret as pC, exifOrientation as pS, newerPacket as pT, VIEWER_SERVICE_CSP_RELAY_ONLY as p_, pubkyProofPath as pa, enrollCancelReason as pb, statusFrame as pc, identityRefusal as pd, HoldKeys as pf, ANSWER_REFUSED_REDIALS as pg, receivedTimestamp as ph, parseDidJws as pi, relayRequest as pl, REACTION_LIMITS as pm, GROUP_META_PAST_CHARS as pn, PAIRING_RETRY_MS as po, fileMessageText as pp, encodeWitness as pr, meshRendezvous as ps, leaveStatement as pt, FILES_CAPABILITY as pu, MAX_MSGS_PAYLOAD_B64 as pv, BACKGROUND_REQUESTS_PER_MINUTE as pw, readKnockSlot as px, handoffDataFrame as py, signAppStore as q, readTurnBody as qC, inviteOwnership as qS, concatBytes as qT, QUICK_REDIAL_MS as q_, ANSWERS_REFUSED_PAUSES as qa, REQUEST_LABEL as qb, DEVICE_WAKE_TTL_SECONDS as qc, ringEvidence as qd, DhtDelivery as qf, TRANSPORTS_GONE_MS as qg, sealPair as qh, isWalletNetwork as qi, APP_RATE_WINDOW_MS as ql, appCardId as qm, sshSignCommand as qn, readGroupHave as qo, validRemovalNumber as qp, DID_FILE_MAX_BYTES as qr, encodeFileData as qs, asWritten as qt, IDENTITY_CLOCK_SKEW as qu, HANDOFF_PAKE as qv, setLinkTraceSink as qw, appRefPublisher as qx, sameDigest as qy, readX401OpenId4VpRequest as r, ENROLL_CAPABILITY as rC, utf8Encode as rE, readAppRevocationShape as rS, heldBackError as rT, VIEWER_GUARD_SCRIPT as r_, BITCOIN_NETWORKS as ra, signTombstone as rb, STATUS_RATE_WINDOW_MS as rc, IDENTITY_REUSE_CHECK_S as rd, dialableIrohRelay as rf, RatchetBox as rg, removedCardText as rh, didJwsAlg as ri, WAKE_ONLINE_TTL_SECONDS as rl, sanitizePreviewImage as rm, meshMessageRef as rn, FIRST_PAIRING_PACE_MS as ro, formatFileSize as rp, decodeBase64 as rr, SIGNAL_HOLD_MS as rs, communityCommitHash as rt, isAppVersion as ru, heardCallSignal as rv, turnPayloadSequence as rw, contactDay as rx, filePartDigest as ry, presentX401SdJwtVc as s, deviceFrameCapability as sC, __require as sE, signAppObject as sS, MAX_DNS_PACKET_BYTES as sT, GhostlyHttpError as s_, isPubkyKey as sa, ENROLL_CANCEL_REASONS as sb, StatusSender as sc, IdentityCheckUnavailable as sd, relayUrl as sf, ratchetOn as sg, taskProgress as sh, didWebFileNames as si, WakeLimiter as sl, readForwarded as sm, MENTION_LIMITS as sn, INVITE_TAKEN as so, PLAYABLE_AUDIO as sp, compactSize as sr, readGroupSignal as ss, communityRoster as st, APPS_CAPABILITY as su, parseCallSignal as sv, turnStatedVerifier as sw, knockSlotRecords as sx, handoffAttemptFailed as sy, X401_REQUEST_LIMITS as t, DEVICE_ECHO_FRAME as tC, toZ32 as tE, isAppSignature as tS, PublishFailedError as tT, VIEWER_GUARD_CSP as t_, sparkInvoiceDetails as ta, setUpdateFrame as tb, STATUS_IDLE_AFTER_MS as tc, IDENTITY_PROOF_CAPABILITY as td, automaticTransport as tf, RATCHET_KEEP_MS as tg, checkStatusCard as th, checkDidSignature as ti, WAKE_ONLINE_DELAY_MS as tl, parseLinkPreview as tm, communityEditFrame as tn, DHT_PIN_GRACE_MS as to, FileTransfers as tp, bip322ToSign as tr, SIGNAL_CARRIERS as ts, CommunitySession as tt, appOpenFrame as tu, decompressSdp as tv, turnName as tw, contactAskerFrame as tx, HANDOFF_WINDOW as ty, X401_CREDENTIAL_LIMITS as u, deviceLinkParams as uC, verifyAppSignature as uS, RELAY_PAYLOAD_MAX_BYTES as uT, VIEWER_DROPPED_DIRECTIVES as u_, normalizePubkyKey as ua, ENROLL_HELLO as ub, personStatus as uc, boundVerifiedIdentity as ud, HOLD_CAPABILITY as uf, ratchetSeal as ug, arrivalKey as uh, normalizeDid as ui, parseWakeFrame as ul, QUICK_REACTIONS as um, validMentions as un, MAX_PAIRED_MESSAGE_FRAME as uo, VOICE_METER as up, decodeTx as ur, NO_HUB_POLICY as us, derivedSecret as ut, CALLS_CAPABILITY as uu, signalHasVideo as uv, ANSWER_READ_FIRST_MS as uw, makeStampPaced as ux, handoffCancelFrame as uy, X401_SCHEME as v, verifyDeviceTransports as vC, readImageMeta as vS, decodeDnsAnswers as vT, sanitizeRequestHeaders as v_, LIGHTNING_DESTINATION_PATTERN as va, enrollMessage as vb, TYPING_RATE_WINDOW_MS as vc, newIdentityBinding as vd, DNS_LABEL as vf, GATHER_STALL_MS as vg, GROUP_VERSION_LARGE as vh, DID_DHT_MAX_PAYLOAD as vi, PUSH_SERVICE_HOSTS as vl, queueReaction as vm, encodeGroupMetaBody as vn, REDESCRIBED_GRACE_MS as vo, voiceDownloadName as vp, u64 as vr, beaconKeys as vs, signCommunity as vt, SESSION_CAPABILITIES_FRAME as vu, parseLinkRecords as vv, CHAT_RESERVE_PER_CHAT as vw, stampHolds as vx, handoffFileRequestFrame as vy, decodeX401Header as w, TURN_VISIBLE_MS as wC, createContactLink as wS, identityFromSeed as wT, CHUNK_FLAG_END as w_, parseLightningDestination as wa, FLOOD_PER_DAY as wb, TypingSender as wc, applyIdentityEvent as wd, NIP05_PATH as wf, DIRECT_OWN_ATTEMPTS as wg, SAID_AGAIN as wh, didDhtDocument as wi, pushRequest as wl, readReaction as wm, groupMetaTag as wn, UNPROVEN_AUTH_MS as wo, VIDEO_LIMITS as wp, atprotoDidMethod as wr, lobbyRecords as ws, MAX_KNOCKS as wt, WAKE_SESSION_CAPABILITY as wu, encodeServices as wv, GROUP_BURST_ONE_LINK as ww, APP_ICON_PATH as wx, handoffReleaseFrame as wy, buildX401ProofResult as x, TURN_PUT_WINDOW_MS as xC, readCanonicalJson as xS, readDnsName as xT, viewerServicePolicy as x_, findLightningDestination as xa, readEnrollGrant as xb, TYPING_STATUS_MAX as xc, signIdentityPresentation as xd, DOMAIN_MAX_RECORDS as xf, REANSWERS as xg, MAX_GROUP_MEMBERS as xh, DID_DHT_VERSION as xi, decryptPushPayload as xl, reactionFrame as xm, groupMetaChange as xn, RTC_SIGNAL_RECEIVE_LIMIT as xo, voiceLevelsOf as xp, ATPROTO_FULL_SCOPE as xr, freshHubs as xs, verifyCommunityCommit as xt, SessionCapabilities as xu, MAX_SERVICES as xv, DEPARTED_READS as xw, APP_CLIENTS as xx, handoffManifestFrames as xy, X401_VERSION as y, seedSigner as yC, canonicalJson as yS, decodeTxtPacket as yT, sanitizeResponseHeaders as y_, LNURL_LIMITS as ya, enrollProofFrame as yb, TYPING_REFRESH_MS as yc, receivedIdentityStatus as yd, DNS_TYPE as yf, LATE_ANSWER_MS as yg, LEGACY_GROUP_MEMBERS as yh, DID_DHT_PREFIX as yi, WebPushError as yl, reactedFrame as ym, groupDisplayName as yn, RESUME_WAIT_MS as yo, voiceFileName as yp, varBytes as yr, beaconRecords as ys, verifyCommunityChain as yt, STATUS_CAPABILITY as yu, HTTP_SERVICE_PROTO as yv, CHAT_WATCH_SHARE as yw, APP_BUNDLE_LIMITS as yx, handoffHaveFrames as yy, planAppUpdate as z, TURN_SLOTS as zC, INVITE_VERSION as zS, dropLoneJoiners as zT, buildDataSdp as z_, VIDEO_METADATA_LIMITS as za, CONTACT_RECORD_TTL as zb, nextPinNumber as zc, storageProofBody as zd, validDomainRecord as zf, OFFER_LOOK_MS as zg, confirmationTag as zh, SEPOLIA_TEST_USDT_FAUCET as zi, encodeAppRangeData as zl, ITEM_STATES as zm, SSH_KEY_TYPES as zn, GROUP_HAVE_FRAME as zo, RateWindow as zp, parseAtprotoCar as zr, PairedCalls as zs, groupWakeFrame as zt, DHT_TEXT_CAPABILITY as zu, HANDOFF_FILE_MISSING as zv, TURN_SOURCE_TIMEOUT_MS as zw, readAppBundleAsync as zx, readHandoffFileFrame as zy };
|
|
42884
|
+
export { COMMUNITY_LIMITS as $, TURN_VERSION as $C, createChatInvite as $S, dropLoneJoiners as $T, offerIsFresh as $_, stripPictureMetadata as $a, KNOCK_SLOTS as $b, pinNumberHolds as $c, RING_LIFETIME as $d, DHT_MESSAGE_TTL as $f, SIGNAL_DUE_READS as $g, newEpochSecret as $h, walletNetworkOf as $i, APP_FRAME as $l, RUN_RESULTS as $m, legacyMessageHash as $n, groupFileFallback as $o, parseEditedFrame as $p, DID_JWS_MAX_LENGTH as $r, FILE_LIMITS as $s, CatchUpAnswers as $t, parsePacketTransports as $u, HANDOFF_HAVE as $v, WAY_BACK_SHARE as $w, yieldThread as $x, readHandoffHello as $y, readX401ProofResponseHeader as A, verifyDeviceTransports as AC, readImageMeta as AS, decodeDnsAnswers as AT, sanitizeRequestHeaders as A_, resolveLightningDestination as Aa, enrollMessage as Ab, TYPING_STATUS_MAX as Ac, signIdentityPresentation as Ad, DOMAIN_MAX_RECORDS as Af, REANSWERS as Ag, MAX_GROUP_MEMBERS as Ah, didDhtRecords as Ai, decryptPushPayload as Al, reactionFrame as Am, keepPastGroupMeta as An, RTC_SIGNAL_RECEIVE_LIMIT as Ao, voiceLevelsOf as Ap, checkAtprotoProofRecord as Ar, freshHubs as As, knockRecords as At, SessionCapabilities as Au, parseLinkRecords as Av, CHAT_RESERVE_PER_CHAT as Aw, stampHolds as Ax, handoffFileRequestFrame as Ay, APP_STORE_KINDS as B, TOMBSTONE_SEQUENCE as BC, DEVICE_INVITE_LIFETIME_S as BS, publicKeyFromZ32 as BT, PROTOCOL_VERSION as B_, parseFedimintRequestPayload as Ba, NEW_PER_HOUR as Bb, typingKindOf as Bc, emptyProofLedger as Bd, isPublicAddress as Bf, DEPARTED_READ_MS as Bg, rosterHas as Bh, PaymentPreflightError as Bi, AppRanges as Bl, pairedReplyAuthor as Bm, SSHSIG_MAX_ARMOR as Bn, publishFailure as Bo, EDIT_BUFFER_MS as Bp, encodeDagCbor as Br, readBeaconHead as Bs, groupWakes as Bt, CAPS_ISSUED_BACK_MS as Bu, servicesFromWire as Bv, HEDGE_MISSING_MS as Bw, appDigest as Bx, handoffVerifiedFrame as By, buildX401TokenObject as C, deviceLinkRendezvousSeed as CC, verifyAppStatementBytes as CS, createRelayPayload as CT, VIEWER_PERMISSIONS_POLICY as C_, fetchLnurlJson as Ca, ENROLL_PROOF as Cb, statusState as Cc, identityRevocationValue as Cd, HoldRefusedError as Cf, CONNECT_TIMEOUT_MS as Cg, shownTime as Ch, DID_DHT_TTL as Ci, wakeFrame as Cl, ReactionWindow as Cm, groupMetaBody as Cn, PONG_WAIT_MS as Co, formatVoiceDuration as Cp, ATPROTO_DECLARED_SCOPE as Cr, parseHubPolicy as Cs, KNOCK_TTL_MS as Ct, KNOWN_SESSION_CAPABILITIES as Cu, waitForIceGathering as Cv, ANSWER_READ_SPACING_MS as Cw, mergeContactKnocks as Cx, handoffContext as Cy, readX401ProofRequest as D, newDeviceSetSecret as DC, isImageMime as DS, parseRelayPayload as DT, parseLocalTarget as D_, parseLightningDestination as Da, enrollDoneFrame as Db, TYPING_RATE_WINDOW_MS as Dc, newIdentityBinding as Dd, DNS_LABEL as Df, GATHER_STALL_MS as Dg, GROUP_VERSION_LARGE as Dh, didDhtDocument as Di, PUSH_SERVICE_HOSTS as Dl, queueReaction as Dm, groupMetaTag as Dn, REDESCRIBED_GRACE_MS as Do, voiceDownloadName as Dp, atprotoDidMethod as Dr, beaconKeys as Ds, entryParams as Dt, SESSION_CAPABILITIES_FRAME as Du, buildLinkRecords as Dv, BACKGROUND_WRITES_SHARE as Dw, requestPlaintextBytes as Dx, handoffDoneFrame as Dy, isX401Protocol as E, devicePingFrame as EC, imageSize as ES, openRelayPayload as ET, formatLocalTarget as E_, parseInvoiceCallback as Ea, enrollDigits as Eb, TYPING_RATE_LIMIT as Ec, isIdentityBinding as Ed, readManifest as Ef, GATHER_ATTEMPTS as Eg, GROUP_MEMBER_CAP as Eh, decodeDidDhtPacket as Ei, PUSH_PAD_BYTES as El, parseReactionFrame as Em, groupMetaPicture as En, RACE_RELAYED_MS as Eo, recordingMime as Ep, ATPROTO_PROOF_SCOPE as Er, COMMUNITY_TOPOLOGY as Es, encodeGroupEntryLink as Et, SERVICES_CAPABILITY as Eu, RECORD_TTL as Ev, BACKGROUND_WHILE_SIGNALING as Ew, readLinkRecord as Ex, handoffDigest as Ey, appRevocationFor as F, TURN_SETTLE_MS as FC, CONTACT_LINK_VERSION as FS, IDENTITY_MEMO_MAX as FT, withViewerPolicy as F_, cashuRequestPayload as Fa, verifyEnrollProof as Fb, parseTypingFrame as Fc, PROOF_ADAPTERS as Fd, decodeDnsResponse as Ff, DirectPathWatch as Fg, commitUntaggedHash as Fh, resolveDidDht as Fi, vapidKeysMatch as Fl, wireReaction as Fm, parseGroupMetaStatement as Fn, WAKE_LOST_MS as Fo, isPlayableVideoType as Fp, AtprotoCid as Fr, mergeLobby as Fs, GROUP_WAKE_GROUP_WINDOW_MS as Ft, sessionCapabilitiesFrame as Fu, decodeServices as Fv, GROUP_BURST_MS as Fw, APP_FORBIDDEN_KEYS as Fx, handoffPakeFrame as Fy, readAppStore as G, TURN_MAX as GC, encodeDeviceInvite as GS, generateEncryptionKey as GT, sendBody as G_, NO_VIDEO_METADATA as Ga, newInbox as Gb, PIN_FRAME as Gc, proofHash as Gd, recordsFromWellKnown as Gf, LinkSession as Gg, verifyCommitSignature as Gh, WALLET_NETWORKS as Gi, appRangeErrorFrame as Gl, BUTTON_ID as Gm, parseSshPublicKey as Gn, parseEngineError as Go, MAX_EDITS_PER_MESSAGE as Gp, readAtprotoCid as Gr, CALL_RECEIVE_LIMIT as Gs, GROUP_READ_NOTE as Gt, CapsExchange as Gu, HANDOFF_BUSY as Gv, RelayTransport as Gw, findAppForbiddenKey as Gx, openHandoffPiece as Gy, checkAppListing as H, TURN_BODY_BYTES as HC, createDeviceInvite as HS, verify as HT, decodeControl as H_, NO_AUDIO_METADATA as Ha, clearMissed as Hb, GROUP_PIN_FRAME as Hc, isProofAdapter as Hd, normalizeDomain as Hf, EXPECT_PEER_MS as Hg, sortRoster as Hh, SEPOLIA_TEST_USDT_FAUCET as Hi, appRangeChunk as Hl, replySnippet as Hm, SSH_KEY_TYPES as Hn, EngineError as Ho, EDIT_RATE_WINDOW_MS as Hp, parseAtprotoCar as Hr, shouldBeHub as Hs, parseGroupWakeFrame as Ht, CAPS_LIMITS as Hu, viewerTag as Hv, PREVIOUS_DEFAULT_RELAYS as Hw, assembleAppBundle as Hx, handoffVersions as Hy, appStoreDecision as I, TURN_VISIBLE_MS as IC, createContactLink as IS, IDENTITY_MEMO_SIZE as IT, CHUNK_FLAG_END as I_, fedimintRequestPayload as Ia, FLOOD_PER_DAY as Ib, plainStatusLine as Ic, PROOF_CAPABILITY as Id, dnsProofName as If, directBlocked as Ig, expectedRoster as Ih, signDidDhtPacket as Ii, APP_RANGE_DATA_KIND as Il, PAIRED_REPLY_AUTHORS as Im, parseGroupMetaTag as In, pairedEditFits as Io, isVideoMime as Ip, AtprotoProofError as Ir, newerHead as Is, GROUP_WAKE_MEMBER_INTERVAL_MS as It, PAIRED_PROFILE as Iu, encodeServices as Iv, GROUP_BURST_ONE_LINK as Iw, APP_ICON_PATH as Ix, handoffReleaseFrame as Iy, GROUP_TYPING_FRAME as J, TURN_REV_LIMIT as JC, INVITE_HRP as JS, MAX_AVATAR_LENGTH as JT, DATA_CHANNEL_LABEL as J_, videoMetadataPatches as Ja, takeRequest as Jb, nextPinNumber as Jc, storageProofBody as Jd, validDomainRecord as Jf, OFFER_LOOK_MS as Jg, confirmationTag as Jh, assertWholeSats as Ji, encodeAppRangeData as Jl, ITEM_STATES as Jm, sshFingerprint as Jn, GROUP_HAVE_FRAME as Jo, RateWindow as Jp, verifyAtprotoSignature as Jr, PairedCalls as Js, chainPieces as Jt, DHT_TEXT_CAPABILITY as Ju, HANDOFF_CANCEL_REASONS as Jv, SIGNALING_WINDOW_MS as Jw, isAppUrl as Jx, readHandoffCancel as Jy, readAppStoreSteps as K, TURN_NAME_BYTES as KC, readDeviceInvite as KS, sealedLength as KT, wrapDataChannel as K_, VIDEO_METADATA_LIMITS as Ka, planKnocks as Kb, PIN_LIMITS as Kc, proofStatement as Kd, recordsName as Kf, MAX_DHT_TEXT_BYTES as Kg, GROUP_PROFILE as Kh, arkAddressPrefix as Ki, appRangeGetFrame as Kl, BUTTON_STYLES as Km, parseSshSignature as Kn, PairingTracker as Ko, MAX_REMOVAL_NUMBER as Kp, unsignedCommitBytes as Kr, MAX_PAIRED_CALL_SIGNAL as Ks, GroupSession as Kt, CapsKeys as Ku, HANDOFF_BUSY_REASONS as Kv, RelaysFailedError as Kw, isAppLicense as Kx, readHandoffAck as Ky, appUpdateDecision as L, classifyTurnRead as LC, encodeContactLink as LS, createIdentity as LT, CHUNK_KIND as L_, findEndpoint as La, MAX_DONE as Lb, sanitizeTypingStatus as Lc, PeerProofs as Ld, domainTxtRecord as Lf, symmetricNat as Lg, parseGroupCommit as Lh, ETHEREUM_USDT as Li, APP_RANGE_ERRORS as Ll, REPLY_ID as Lm, signGroupMeta as Ln, pairedMessageFits as Lo, parseVideoMeta as Lp, atprotoCidFor as Lr, pickHubs as Ls, GROUP_WAKE_RECEIVE_LIMIT as Lt, PairedSession as Lu, isValidServiceId as Lv, GROUP_OVER_PACE_MS as Lw, APP_PERMISSIONS as Lx, handoffRequestFrame as Ly, readX401ProofResultHeader as M, webCryptoSigner as MC, canonicalJsonBytes as MS, encodeTxtPacket as MT, viewerResponseHeaders as M_, decodeBolt11 as Ma, formatEnrollDigits as Mb, TypingReceiver as Mc, IDENTITY_TIMELINE_MAX as Md, DOMAIN_TXT_MAX_BYTES as Mf, DIRECT_EVIDENCE_MS as Mg, OWN_FRAME_LIMIT as Mh, encodeDidDhtPacket as Mi, generateVapidKeys as Ml, readDhtReactions as Mm, openGroupMeta as Mn, SWITCH_RETIRE_MS as Mo, PLAYABLE_VIDEO as Mp, normalizeAtprotoHandle as Mr, lobbyKeys as Ms, readKnocks as Mt, UPGRADE_CAPABILITY as Mu, LEGACY_SERVICES as Mv, DEFAULT_RELAYS as Mw, APP_BUNDLE_MAGIC as Mx, handoffHelloFrame as My, x401AnswerableRequests as N, TURN_PUT_WINDOW_MS as NC, readCanonicalJson as NS, readDnsName as NT, viewerServicePolicy as N_, findBolt11 as Na, readEnrollGrant as Nb, TypingSender as Nc, applyIdentityEvent as Nd, NIP05_PATH as Nf, DIRECT_OWN_ATTEMPTS as Ng, SAID_AGAIN as Nh, jwkThumbprint as Ni, pushRequest as Nl, readReaction as Nm, parseGroupMetaBody as Nn, UNPROVEN_AUTH_MS as No, VIDEO_LIMITS as Np, parseAtprotoDidDocument as Nr, lobbyRecords as Ns, GROUP_WAKE_FRAME as Nt, WAKE_SESSION_CAPABILITY as Nu, MAX_SERVICES as Nv, DEPARTED_READS as Nw, APP_CLIENTS as Nx, handoffManifestFrames as Ny, readX401ProofRequestHeader as O, signDeviceTransports as OC, parseImageMeta as OS, readOwnRelayPayload as OT, relativizeLocation as O_, parsePayParams as Oa, enrollGrantFrame as Ob, TYPING_REFRESH_MS as Oc, receivedIdentityStatus as Od, DNS_TYPE as Of, LATE_ANSWER_MS as Og, LEGACY_GROUP_MEMBERS as Oh, didDhtFromPublicKey as Oi, WebPushError as Ol, reactedFrame as Om, groupMetaToHand as On, RESUME_WAIT_MS as Oo, voiceFileName as Op, atprotoProofRecord as Or, beaconRecords as Os, groupEntryUrl as Ot, STATUS_CAPABILITY as Ou, emptyLinkRecords as Ov, CHAT_RESERVE as Ow, requestRecords as Ox, handoffEphemeral as Oy, addedAppPermissions as P, TURN_RAISE_READ_TIMEOUT_MS as PC, CONTACT_LINK_BYTES as PS, IDENTITY_MEMO_IDLE_MS as PT, webLocalFetch as P_, ENDPOINT as Pa, readEnrollHello as Pb, parseTypingActivity as Pc, lastSharedWithMe as Pd, WELL_KNOWN_PATH as Pf, DIRECT_PEERS as Pg, commitHash as Ph, openDidDhtPayload as Pi, vapidAuthorization as Pl, validReactionNumber as Pm, parseGroupMetaFrame as Pn, WAKE_ANSWER_GRACE_MS as Po, formatVideoDuration as Pp, shortAtprotoDid as Pr, mergeBeacon as Ps, GROUP_WAKE_GROUP_LIMIT as Pt, parseSessionCapabilities as Pu, SERVICES_VERSION as Pv, FRESH_READ_MS as Pw, APP_CLIENT_NAME as Px, handoffOfferFrame as Py, sealGroupTyping as Q, TURN_TTL as QC, OwnInviteError as QS, MAX_NICK_LENGTH as QT, extractRtcParams as Q_, isStrippedPicture as Qa, ContactRequestError as Qb, pinIsNewer as Qc, verifyPeerProof as Qd, DHT_FILE_TOO_LARGE as Qf, RELAY_POLL_INTERVALS as Qg, epochKeys as Qh, validatePaymentTarget as Qi, APP_DATA_MAX_BYTES as Ql, ROUTINE_STATES as Qm, isLegacySignature as Qn, fetchesByItself as Qo, parseEditFrame as Qp, DID_JWS_ALGS as Qr, FILE_FRAMES as Qs, CATCH_UP_SLICE as Qt, encodePacketTransports as Qu, HANDOFF_FILE_REQUEST as Qv, WATCH_SHARE as Qw, sha256Paced as Qx, readHandoffHave as Qy, checkAppBeforeRun as R, keptAtEqualSequence as RC, readContactLink as RS, identityFromSeed as RT, LIMITS as R_, isFederationId as Ra, MAX_MISSED as Rb, typingActivity as Rc, STORAGE_LIFETIME as Rd, domainWellKnownFile as Rf, AWAITING_PEER_MS as Rg, rememberAlone as Rh, EVM_TEST_CHAINS as Ri, APP_RANGE_FRAMES as Rl, REPLY_LIMITS as Rm, verifyGroupMetaSignature as Rn, pairedMessageFrame as Ro, EDITED_FRAME as Rp, decodeAtprotoCommit as Rr, rankHubs as Rs, GroupWakeLimiter as Rt, SESSION_FRAME_MAX as Ru, isViewerTag as Rv, GROUP_RATION_WINDOW_MS as Rw, APP_SCREENSHOTS_DIR as Rx, handoffRetryAfter as Ry, buildX401ResultArtifact as S, deviceLinkParams as SC, __toCommonJS as SE, verifyAppSignature as SS, RELAY_PAYLOAD_MAX_BYTES as ST, VIEWER_DROPPED_HEADERS as S_, LNURL_LIMITS as Sa, ENROLL_HELLO as Sb, statusFrame as Sc, identityRefusal as Sd, HoldKeys as Sf, ANSWER_REFUSED_REDIALS as Sg, receivedTimestamp as Sh, DID_DHT_PREFIX as Si, relayRequest as Sl, REACTION_LIMITS as Sm, groupDisplayName as Sn, PAIRING_RETRY_MS as So, fileMessageText as Sp, varBytes as Sr, meshRendezvous as Ss, GROUP_ENTRY_PROFILE as St, FILES_CAPABILITY as Su, signalHasVideo as Sv, ANSWER_READ_FIRST_MS as Sw, makeStampPaced as Sx, handoffCancelFrame as Sy, encodeX401Header as T, deviceLinkSecret as TC, exifOrientation as TS, newerPacket as TT, VIEWER_SERVICE_CSP_RELAY_ONLY as T_, invoiceCallbackUrl as Ta, enrollCancelReason as Tb, TYPING_KINDS as Tc, identityStatementText as Td, newMailbox as Tf, DataLink as Tg, GROUP_ID as Th, DidDhtError as Ti, wakeRequest as Tl, parseReactedFrame as Tm, groupMetaNewer as Tn, RACE_DIRECT_MS as To, parseVoiceMeta as Tp, ATPROTO_PROOF_COLLECTION as Tr, wireHubPolicy as Ts, decodeGroupEntryLink as Tt, REACTIONS_CAPABILITY as Tu, MAX_MSGS_PAYLOAD_B64 as Tv, BACKGROUND_REQUESTS_PER_MINUTE as Tw, readKnockSlot as Tx, handoffDataFrame as Ty, checkAppStoreIndex as U, TURN_LABEL as UC, deviceInviteJoinerKeyZ32 as US, decrypt as UT, encodeChunk as U_, audioMetadataPatches as Ua, endedRequests as Ub, PINNED_FRAME as Uc, nostrProofTemplate as Ud, parseDomainTxt as Uf, FIRST_PUBLISH_MAX_MS as Ug, verifyChain as Uh, TEST_USDT_FAUCET_AMOUNT as Ui, appRangeDataFrame as Ul, wireReply as Um, SSH_PUBLIC_KEY_MAX as Un, engineError as Uo, EDIT_RECEIVE_LIMIT as Up, parseAtprotoDidKey as Ur, validHead as Us, GROUP_LIMITS as Ut, CAPS_PUBLISH_SPACING_MS as Uu, HANDOFF_ACK as Uv, RELAY_REQUESTS_PER_MINUTE as Uw, buildAppBundle as Ux, isHandoffPartName as Uy, APP_STORE_LIMITS as V, TOMBSTONE_TURN as VC, DEVICE_INVITE_OWN_DEVICE as VS, sign as VT, decodeChunk as V_, AUDIO_METADATA_LIMITS as Va, REOPEN_BELOW as Vb, COMMUNITY_PIN_FRAME as Vc, importedProof as Vd, nip05RootKey as Vf, DHT_POLL_INTERVALS as Vg, signCommit as Vh, SEPOLIA_TEST_USDT as Vi, appRangeCancelFrame as Vl, readReply as Vm, SSHSIG_NAMESPACE as Vn, ENGINE_ERRORS as Vo, EDIT_FRAME as Vp, findInMst as Vr, readLobby as Vs, mentionedMembers as Vt, CAPS_LABEL as Vu, servicesToWire as Vv, HEDGE_MS as Vw, appViewOf as Vx, handoffVerifiedMessage as Vy, readAppListing as W, TURN_LAST_SEQUENCE as WC, deviceInviteJoinerParams as WS, encrypt as WT, encodeControl as W_, withoutAudioMetadata as Wa, inboxRecord as Wb, PIN_CLOCK_SKEW_MS as Wc, proofCapability as Wd, recordsFromTxt as Wf, IDLE_THRESHOLD as Wg, verifyCommit as Wh, USDT_PUBLIC_RPC as Wi, appRangeEndFrame as Wl, ACTIVE_TASK_STATUSES as Wm, SshSigError as Wn, engineText as Wo, EDIT_SEND_LIMIT as Wp, parseAtprotoVerificationKey as Wr, CALL_RATE_WINDOW_MS as Ws, GROUP_REACTED_FRAME as Wt, CAPS_REFRESH_MS as Wu, HANDOFF_ATTEMPTS as Wv, REQUESTS_PER_MINUTE as Ww, checkAppManifest as Wx, newHandoffId as Wy, groupTypingEpoch as X, TURN_SIGNED_BYTES as XC, INVITE_MAX_LENGTH as XS, jpegSize$1 as XT, RTC_SIGNAL_MAX_AGE_MS as X_, NO_PICTURE_METADATA as Xa, CONTACT_ASKER_FRAME as Xb, parsePinnedFrame as Xc, validExternalKey as Xd, ACTIVE_DHT_POLL_MS as Xf, PRESENCE_HEARTBEAT as Xg, edgeParams as Xh, isWalletNetwork as Xi, parseAppRangeFrame as Xl, PR_STATES as Xm, sshSignCommand as Xn, GROUP_WANT_FRAME as Xo, editFrame as Xp, DID_FILE_MAX_BYTES as Xr, ChatFiles as Xs, groupMessageId as Xt, dialDescriptors as Xu, HANDOFF_DONE as Xv, SLOW_MS as Xw, readAppBundle as Xx, readHandoffDone as Xy, GroupTypingBoard as Y, TURN_SEALED_BYTES as YC, INVITE_LINK_ORIGIN as YS, MAX_AVATAR_SIDE as YT, RTC_SIGNAL_FUTURE_MS as Y_, withoutVideoMetadata as Ya, turnOff as Yb, parsePinFrame as Yc, storageProofPath as Yd, wellKnownUrl as Yf, OFFER_STEP_MAX as Yg, decryptText as Yh, formatPaymentAmount as Yi, isServeId as Yl, PR_CHECKS as Ym, sshKeyDigestHex as Yn, GROUP_VERSION_FILES as Yo, dhtEditId as Yp, DID_DOCUMENT_MAX_BYTES as Yr, parsePairedCallFrame as Ys, frameBytes as Yt, capsDescriptors as Yu, HANDOFF_DATA as Yv, SLOW_DEMOTE_MS as Yw, pacer as Yx, readHandoffData as Yy, openGroupTyping as Z, TURN_SLOTS as ZC, INVITE_VERSION as ZS, sanitizeAvatar as ZT, buildDataSdp as Z_, PICTURE_METADATA_LIMITS as Za, CONTACT_RECORD_TTL as Zb, pinFrame as Zc, verifyNostrProof as Zd, DHT_FILE_REFUSED as Zf, PRESENCE_WINDOW as Zg, encryptText as Zh, parsePaymentAmount as Zi, readAppRangeFrame as Zl, REMOVABLE_KINDS as Zm, verifySshSignature as Zn, GROUP_WANT_NO_FRAME as Zo, editedFrame as Zp, DID_GHOSTLY_SERVICE as Zr, FILE_DATA_KIND as Zs, CATCH_UP_PAUSE_MS as Zt, emptyCapsState as Zu, HANDOFF_FILE_MISSING as Zv, TURN_SOURCE_TIMEOUT_MS as Zw, readAppBundleAsync as Zx, readHandoffFileFrame as Zy, X401_PROTOCOLS as _, deviceEchoFrame as _C, utf8Encode as _E, readAppSignature as _S, publishedNowhere as _T, viewerGuardOffset as __, decodeSvcbRecords as _a, DEVICE_KINDS as _b, liveStatus as _c, IdentityExchange as _d, relayedTransports as _f, ratchetOpen as _g, usageLeft as _h, parseDidSignaturePaste as _i, deviceWakeRequest as _l, COMMUNITY_REACTION_FRAME as _m, MAX_GROUP_META_BODY as _n, LIVENESS_PING_MS as _o, RECORDING_TYPES as _p, hash160 as _r, GROUP_VERSION_HUBS as _s, shortHash as _t, APP_RANGES_CAPABILITY as _u, isGlobalIpv4Host as _v, turnSequence as _w, knockSlotIdentity as _x, handoffAckFrame as _y, X401_DCQL_LIMITS as a, inviteOwnership as aC, unwrapPasted as aE, appRefPublisher as aS, setLinkTraceSink as aT, UNUSED_INVITE_WAIT_MAX_MS as a_, sparkNetworkOf as aa, sameDigest as ab, transferEnded as ac, IDENTITY_MAX_CHECKS_PER_HOUR as ad, verifyRingEvidence as af, FOLLOW_MS as ag, cardEditNumber as ah, didGhostlyServiceEntry as ai, WAKE_CALL_WAIT_MS as al, LINK_TRAILING as am, communityMessageAuthor as an, CROSSED_PROBE_MS as ao, peekDhtMailbox as ap, bip322ToSpend as ar, CARRIED_DEFER_MS as as, communityHasFrame as at, APP_VERSION_MAX as au, QUICK_REDIAL_MS as av, readTurnBody as aw, REQUEST_LABEL as ax, HANDOFF_PAKE as ay, buildX401ProofRequest as b, deviceKeyZ32 as bC, __exportAll as bE, signAppRevocation as bS, PKARR_FUTURE_SKEW_MS as bT, HttpHost as b_, pubkyHomeserverOf as ba, ENROLL_DONE as bb, sameStatusState as bc, emptyIdentityLedger as bd, HOLD_DATED_BACK_MS as bf, ratchetSessionOf as bg, claimedTime as bh, strictBase64Url as bi, readWake as bl, REACTED_FRAME as bm, MAX_GROUP_PICTURE_LENGTH as bn, PAIRED_FRAME_TOO_LARGE as bo, baseMime as bp, u32$1 as br, mayBeHub as bs, verifyCommunityChainPaced as bt, EDIT_CAPABILITY as bu, pickCallCandidates as bv, turnVerifierMark as bw, linkRecords as bx, handoffAttemptSucceeded as by, readX401DcqlQuery as c, ownInviteRefusal as cC, fromBase64 as cE, checkAppRevokeStatement as cS, BREAKER_BASE_MS as cT, presenceSeenAt as c_, PUBKY_PROOF_MAX_BYTES as ca, SET_ACK as cb, STATUS_AVAILABILITIES as cc, IDENTITY_MAX_RECEIVED as cd, RELAY_WITH_SECRETS as cf, RATCHET_CAPABILITY as cg, cardTimeUtc as ch, didWebDocumentUrl as ci, WAKE_ONLINE_BATCH as cl, linkStop as cm, validEditText as cn, DEMOTE_MS as co, dhtFileId as cp, BitcoinAddressError as cr, GROUP_VERSION_SIGNALS as cs, communityUntaggedHash as ct, appDataBytes as cu, buildSdpFromSignal as cv, signTurnBody as cw, REQUEST_PACKET_BYTES as cx, HANDOFF_RELEASE as cy, newX401HolderKey as d, DEVICES_CAPABILITY as dC, isZ32Key as dE, isAppLine as dS, RelayBreaker as dT, VIEWER_GUARD_HASH as d_, isPubkyProofFolder as da, readSetUpdate as db, STATUS_RATE_LIMIT as dc, IDENTITY_PROVIDER_ID as dd, checkedDescriptors as df, RATCHET_OVERHEAD as dg, readStatusCard as dh, didWebFileUrl as di, WAKE_ONLINE_INTERVAL_MS as dl, previewImageSize as dm, mentionsBytes as dn, FIRST_PAIRING_PACE_MS as do, PREVIEWABLE_IMAGE as dp, decodeAnyBitcoinAddress as dr, SIGNAL_FRESH_MS as ds, encodeCommunityLink as dt, chatAppId as du, compressSdp as dv, turnInstance as dw, STAMP_BITS_MAX as dx, HANDOFF_VERIFIED as dy, createLink as eC, hasVisible as eE, APP_NAME as eS, WRITE_FIRST_MS as eT, SIGNAL_OUT_READS as e_, SPARK_NETWORKS as ea, readHandoffManifest as eb, FileUplink as ec, IDENTITY_CHALLENGE_WINDOW as ed, ringAuthorization as ef, openPair as eg, STATUS_CARD_LIMITS as eh, DID_MAX_LENGTH as ei, pinnedFrame as el, validEditMessage as em, COMMUNITY_EDIT_FRAME as en, withoutPictureMetadata as eo, DHT_TEXT_BYTES as ep, verifyBitcoinMessage as er, isGroupMessageId as es, COMMUNITY_PROFILE as et, APP_PEER_OPEN_MAX as eu, parseRtcSignal as ev, TurnRecordError as ew, KNOCK_SLOT_LABEL as ex, HANDOFF_HELLO as ey, readX401SdJwtVc as f, DEVICE_CAPABILITIES as fC, randomBytes as fE, isAppRef as fS, DiscoveryBudgetError as fT, VIEWER_GUARD_SCRIPT as f_, newPubkyProofFolder as fa, setAckFrame as fb, STATUS_RATE_WINDOW_MS as fc, IDENTITY_REUSE_CHECK_S as fd, dialableIrohRelay as ff, RatchetBox as fg, removedCardText as fh, didWebHost as fi, WAKE_ONLINE_TTL_SECONDS as fl, sanitizePreviewImage as fm, mentionsMember as fn, GhostLink as fo, formatFileSize as fp, decodeBitcoinAddress as fr, SIGNAL_HOLD_MS as fs, leaveStands as ft, isAppVersion as fu, contactRtcConfig as fv, turnKeys as fw, STAMP_BITS_MIN as fx, HANDOFF_VERSION as fy, X401_LIMITS as g, HANDOFF_CAPABILITY as gC, utf8Decode as gE, readAppRevocations as gS, isDiscoveryBudgetError as gT, guardViewerAnswer as g_, pubkyProofPath as ga, verifySetUpdate as gb, StatusSender as gc, IdentityCheckUnavailable as gd, relayUrl as gf, ratchetOn as gg, taskProgress as gh, parseDidJws as gi, WakeLimiter as gl, readForwarded as gm, GROUP_META_PAST_CHARS as gn, LIVENESS_MISSED_PINGS as go, PLAYABLE_AUDIO as gp, encodeWitness as gr, readGroupSignal as gs, rosterHash as gt, APPS_CAPABILITY as gu, isCandidateAddress as gv, turnReleaseMessage as gw, knockHolds as gx, filePartName as gy, X401_HEADERS as h, ENROLL_CAPABILITY as hC, toZ32 as hE, readAppRevocationShape as hS, heldBackError as hT, allowingViewerGuard as h_, pubkyProofFile as ha, signTombstone as hb, StatusReceiver as hc, IDENTITY_SUBJECT as hd, rankTransports as hf, ratchetHeard as hg, statusCardText as hh, parseDidDocument as hi, WAKE_TTL_SECONDS as hl, forwardedMany as hm, GROUP_META_PAST as hn, INVITE_TAKEN as ho, sanitizeMime as hp, encodeTx as hr, groupSignalFrame as hs, leftStatement as ht, readAppFrame as hu, heardCallSignal as hv, turnPayloadSequence as hw, contactDay as hx, filePartDigest as hy, x401ApprovalDigest as i, inviteLink as iC, trimEndOf as iE, appRef as iS, relayUrlProblem as iT, UNUSED_INVITE_UPKEEP_MS as i_, sparkInvoiceDetails as ia, readHandoffVerified as ib, sentWhole as ic, IDENTITY_FRAME_WINDOW_MS as id, verifyRingAuthorization as if, sha256Hex as ig, buttonLabelClash as ih, checkDidSignature as ii, WAKE_CALL_TTL_SECONDS as il, LINK_PREVIEW_LIMITS as im, communityEditFrame as in, CROSSED_FRESH_MS as io, emptyDhtDeliveryState as ip, bip322ToSign as ir, readGroupWantNo as is, communityGroupId as it, APP_SEND_LIMIT as iu, PAIRED_CALL_CANDIDATES as iv, openTurnValue as iw, REQUEST_CLOCK_SKEW_MS as ix, HANDOFF_OFFER as iy, readX401ProofResult as j, seedSigner as jC, canonicalJson as jS, decodeTxtPacket as jT, sanitizeResponseHeaders as j_, BOLT11_PATTERN as ja, enrollProofFrame as jb, TYPING_TIMEOUT_MS as jc, verifyIdentityPresentation as jd, DOMAIN_METHODS as jf, STALLED_EVIDENCE_MS as jg, MEMBER_KEY as jh, encodeDidDhtDeactivated as ji, encryptPushPayload as jl, reactionIsNewer as jm, nextGroupMetaRevision as jn, RTC_UNSTARTED_MS as jo, voicePeaksOf as jp, isAtprotoDid as jr, hubRank as js, mergeKnocks as jt, TYPING_CAPABILITY as ju, HTTP_SERVICE_PROTO as jv, CHAT_WATCH_SHARE as jw, APP_BUNDLE_LIMITS as jx, handoffHaveFrames as jy, readX401ProofResponse as k, unsignedDeviceTransports as kC, previewable as kS, signRelayPayload as kT, resolveTargetUrl as k_, requestLnurlInvoice as ka, enrollHelloFrame as kb, TYPING_SEND_LIMIT as kc, revokesIdentity as kd, DOMAIN_FILE_MAX_BYTES as kf, OFFER_HOST_GATHER_MS as kg, MAX_GROUP_CHAIN as kh, didDhtKey as ki, checkPushEndpoint as kl, reactionEmoji as km, groupName as kn, RTC_SIGNAL_RATE_WINDOW_MS as ko, voiceLevel as kp, atprotoProofRkey as kr, doorHubs as ks, knockIdentity as kt, STATUS_CARD_CAPABILITY as ku, isEmptyLinkPacket as kv, CHAT_RESERVE_MOST_SHARE as kw, seenEntry as kx, handoffFileMissingFrame as ky, x401VpToken as l, pastedAgain as lC, fromBase64Url as lE, isAppHash as lS, BREAKER_MAX_MS as lT, unusedInviteWait as l_, PUBKY_PROOF_ROOT as la, SET_UPDATE as lb, STATUS_FRAME as lc, IDENTITY_MAX_VALIDITY as ld, TRANSPORTS as lf, RATCHET_HEADER_BYTES as lg, cardUrl as lh, didWebFile as li, WAKE_ONLINE_BATCH_MS as ll, linksIn as lm, MENTION_EVERYONE as ln, DHT_PIN_GRACE_MS as lo, readDhtFile as lp, ByteReader as lr, SIGNALS_PER_MINUTE as ls, decodeCommunityLink as lt, appDataFrame as lu, callRtcConfig as lv, signTurnPacket as lw, REQUEST_TEXT_BYTES as lx, HANDOFF_REQUEST as ly, x401HolderJwk as m, DEVICE_PING_FRAME as mC, toBase64Url as mE, readAppRevocation as mS, budgetRetryMs as mT, WEBRTC_GUARD as m_, pubkyProofCapability as ma, setUpdateMessage as mb, STATUS_TEXT_MAX as mc, IDENTITY_STATEMENT_PREFIX as md, irohRelayUrl as mf, isRatcheted as mg, statusCardBytes as mh, parseDid as mi, WAKE_SUBJECT as ml, forwardedAgain as mm, wireMentions as mn, INVITER_DIAL_GRACE_MS as mo, sanitizeFileName as mp, decodeWitness as mr, SIGNAL_REPLY_MS as ms, leaveStatement3 as mt, parseAppFrame as mu, extractParamsFromSdp as mv, turnPacket as mw, contactAskerHolds as mx, NO_ATTEMPTS as my, X401_RESPONSE_MODES as n, encodeGhostlyInvite as nC, sanitizeNick as nE, APP_STATEMENT_LIMITS as nS, normalizeRelayUrl as nT, TRANSPORTS_GONE_MS as n_, isSparkAddress as na, readHandoffRelease as nb, encodeFileData as nc, IDENTITY_CLOCK_SKEW as nd, ringEvidence as nf, sealPair as ng, appCardId as nh, DidError as ni, DEVICE_WAKE_TTL_SECONDS as nl, validRemovalNumber as nm, GROUP_EDIT_TEXT_BYTES as nn, ANSWERS_REFUSED_PAUSE_MS as no, DhtDelivery as np, MessageRefusal as nr, readGroupHave as ns, GROUP_READ_NOTE_COMMUNITY as nt, APP_RATE_WINDOW_MS as nu, CALL_SIGNAL_FUTURE_MS as nv, firstDeviceSetSecret as nw, MAX_SEEN as nx, HANDOFF_LIST_PER_FRAME as ny, matchX401Dcql as o, inviteQrSegments as oC, bytesEqual as oE, appRevocationId as oS, traceLink as oT, WATCH_PEER_MS as o_, BITCOIN_NETWORKS as oa, sealHandoffPiece as ob, transferStalled as oc, IDENTITY_MAX_EVIDENCE as od, AUTOMATIC_ORDER as of, MAX_SKIP as og, cardLine as oh, didJwsAlg as oi, WAKE_FRAME as ol, canonicalUrl as om, meshMessageRef as on, CROSSED_WAIT_MS as oo, DHT_FILE_CAPABILITY as op, decodeBase64 as or, CarriedTransport as os, communityMessageId as ot, AppSessions as ou, RTC_CONFIG as ov, readTurnPacket as ow, REQUEST_LIFETIME_MS as ox, HANDOFF_PIECE_BYTES as oy, sameX401HolderJwk as p, DEVICE_ECHO_FRAME as pC, toBase64 as pE, isAppSignature as pS, PublishFailedError as pT, VIEWER_WORKER_GUARD_CSP as p_, normalizePubkyKey as pa, setUpdateFrame as pb, STATUS_SEND_INTERVAL_MS as pc, IDENTITY_REVOCATION_LABEL as pd, irohDescriptor as pf, emptyRatchetState as pg, sameButtonText as ph, normalizeDid as pi, WAKE_RETRY_MS as pl, FORWARD_LIMITS as pm, validMentions as pn, HANDLED_WAIT_MS as po, safeBlobType as pp, decodeTx as pr, SIGNAL_PROVEN_MS as ps, leaveStatement as pt, isChatAppId as pu, decompressSdp as pv, turnName as pw, contactAskerFrame as px, HANDOFF_WINDOW as py, signAppStore as q, TURN_NO_ACTIVE as qC, DEVICE_INVITE_VERSION as qS, tryDecrypt as qT, DATA_CHANNEL_ID as q_, readingAhead as qa, settleRequest as qb, mayPin as qc, storageProof as qd, txtValue as qf, OFFER_FAST_MS as qg, confirmationMatches as qh, assertTokenUnits as qi, decodeAppRangeData as ql, CRON_LINE as qm, sameSshKey as qn, GROUP_FILE_LIMITS as qo, REMOVED_TEXT as qp, verifyAtprotoRecordProof as qr, PAIRED_CALL_FRAME as qs, asWritten as qt, CapsRefusedError as qu, HANDOFF_CANCEL as qv, SIGNALING_ALLOWANCE_SHARE as qw, isAppPath as qx, readHandoffBusy as qy, readX401OpenId4VpRequest as r, encodeInviteCode as rC, stripHidden as rE, appFingerprint as rS, readRelayBody as rT, UNUSED_INVITE_READS_PER_MINUTE as r_, sparkAddressKind as ra, readHandoffTurnFrame as rb, refusalText as rc, IDENTITY_FRAME_LIMIT as rd, validRingKey as rf, sealSecret as rg, appCardUrl as rh, checkDidJws as ri, WAKE_CALL_INTERVAL_MS as rl, LINK_MAX_CHARS as rm, carryMentions as rn, BLOCKED_DIAL_WAIT_MS as ro, LIVE_POLL_MS as rp, bip322MessageHash as rr, readGroupWant as rs, communityCommitHash as rt, APP_RESUME_GRACE_MS as ru, CALL_SIGNAL_MAX_AGE_MS as rv, nextTurnPosition as rw, MAX_SLOT_KNOCKS as rx, HANDOFF_MANIFEST as ry, presentX401SdJwtVc as s, inviteQrText as sC, concatBytes as sE, appSignedBytes as sS, BREAKER_ALL_DOWN_PROBE_MS as sT, countUnusedInvite as s_, isBitcoinAddress as sa, sortParts as sb, PRESENCES as sc, IDENTITY_MAX_FRAME as sd, RELAY_URL as sf, MAX_SKIPPED_KEYS as sg, cardLinkHost as sh, didSignedMessages as si, WAKE_INTERVAL_MS as sl, linkEnd as sm, parseCommunityEdit as sn, DEMOTE_AFTER_FAILURES as so, dhtFileElements as sp, verifyBip322 as sr, GROUP_SIGNAL_FRAME as ss, communityRoster as st, appCloseFrame as su, answersOffer as sv, sealTurnBody as sw, REQUEST_NAME_UNITS as sx, HANDOFF_PIECE_OVERHEAD as sy, X401_REQUEST_LIMITS as t, decodeInviteCode as tC, sanitizeDisplayText as tE, APP_PREFIXES as tS, currentRelays as tT, STALLED_LOOK_MS as t_, SPARK_PROVIDER as ta, readHandoffPake as tb, decodeFileData as tc, IDENTITY_CHECK_UNAVAILABLE as td, ringClaims as tf, openSecret as tg, TASK_STATUSES as th, DID_METHODS as ti, readPin as tl, validEditNumber as tm, GROUP_EDIT_FRAME as tn, ANSWERS_REFUSED_PAUSES as to, DHT_TEXT_REFUSED as tp, BIP322_REVISION as tr, readGroupFileMeta as ts, CommunitySession as tt, APP_RATE_LIMIT as tu, BURST_RING_MS as tv, encodeTurnFields as tw, LINK_RECORD_LABEL as tx, HANDOFF_LATER_BYTES as ty, X401_CREDENTIAL_LIMITS as u, readInviteCode as uC, fromZ32 as uE, isAppKey as uS, BREAKER_THRESHOLD as uT, VIEWER_GUARD_CSP as u_, isPubkyKey as ua, encodeSetSlots as ub, STATUS_IDLE_AFTER_MS as uc, IDENTITY_PROOF_CAPABILITY as ud, automaticTransport as uf, RATCHET_KEEP_MS as ug, checkStatusCard as uh, didWebFileNames as ui, WAKE_ONLINE_DELAY_MS as ul, parseLinkPreview as um, MENTION_LIMITS as un, EARLY_DIAL_JOIN_MS as uo, FileTransfers as up, compactSize as ur, SIGNAL_CARRIERS as us, derivedSecret as ut, appOpenFrame as uu, callSignalHeardAt as uv, signTurnRelease as uw, STAMP_BITS_DEFAULT as ux, HANDOFF_TIMINGS as uy, X401_SCHEME as v, deviceEchoNonce as vC, __commonJSMin as vE, setAppSignatureFastPath as vS, withRequestOptions as vT, GhostlyHttpError as v_, encodeSvcbPacket as va, ENROLL_CANCEL as vb, parseStatusFrame as vc, boundIdentityDisplay as vd, transportOrder as vf, ratchetRoot as vg, MESSAGE_CLOCK_SKEW_MS as vh, signingKeys as vi, newWakeToken as vl, GROUP_REACTION_FRAME as vm, MAX_GROUP_NAME_BYTES as vn, MAX_PAIRED_MESSAGE_FRAME as vo, VOICE_LIMITS as vp, sha256d as vr, MESH_HUBS as vs, signCommunity as vt, BUTTONS_CAPABILITY as vu, keepsToRelays as vv, turnSignedMessage as vw, knockSlotOf as vx, handoffAttemptAllowed as vy, decodeX401Header as w, deviceLinkSealKey as wC, IMAGE_LIMITS as wS, measureRecords as wT, VIEWER_SERVICE_CSP as w_, findLightningDestination as wa, enrollCancelFrame as wb, TYPING_FRAME as wc, identityStatement as wd, isHoldUrl as wf, DATA_SETTLE_MS as wg, GROUP_ADMIN_OFF_ERROR as wh, DID_DHT_VERSION as wi, wakePayload as wl, nextReactionNumber as wm, groupMetaChange as wn, RACE_ANSWERED_MS as wo, isPlayableAudioType as wp, ATPROTO_FULL_SCOPE as wr, pickMeshHubs as ws, MAX_KNOCKS as wt, PIN_CAPABILITY as wu, LABEL$1 as wv, AWAITED_READS as ww, openRequest as wx, handoffContextProof as wy, buildX401ProofResult as x, deviceLinkPairing as xC, __require as xE, verifyAppRevocation as xS, PacketTooLargeError as xT, VIEWER_DROPPED_DIRECTIVES as x_, LIGHTNING_DESTINATION_PATTERN as xa, ENROLL_GRANT as xb, sanitizeStatusText as xc, identityPresentationBytes as xd, HOLD_LIMITS as xf, ratchetUnknownSession as xg, heardTime as xh, DID_DHT_MAX_PAYLOAD as xi, readWakePayload as xl, REACTION_FRAME as xm, encodeGroupMetaBody as xn, PAIRING_ATTEMPT_MS as xo, downsamplePeaks as xp, u64 as xr, meshHubs as xs, verifyCommunityCommit as xt, FILES_BINARY_CAPABILITY as xu, sdpHasCandidates as xv, ANSWER_READ_ALLOWANCE as xw, makeStamp as xx, handoffBusyFrame as xy, X401_VERSION as y, deviceFrameCapability as yC, __esmMin as yE, signAppObject as yS, MAX_DNS_PACKET_BYTES as yT, HttpClient as y_, homeserverWebEndpoint as ya, ENROLL_CANCEL_REASONS as yb, personStatus as yc, boundVerifiedIdentity as yd, HOLD_CAPABILITY as yf, ratchetSeal as yg, arrivalKey as yh, staticDidDocument as yi, parseWakeFrame as yl, QUICK_REACTIONS as ym, MAX_GROUP_NAME_LENGTH as yn, MESSAGE_RECEIVE_LIMITS as yo, VOICE_METER as yp, txHash as yr, NO_HUB_POLICY as ys, verifyCommunityChain as yt, CALLS_CAPABILITY as yu, parseCallSignal as yv, turnStatedVerifier as yw, knockSlotRecords as yx, handoffAttemptFailed as yy, planAppUpdate as z, turnPutSummary as zC, DEVICE_INVITE_BYTES as zS, identityFromSeedB64 as zT, MAX_CHUNK_PAYLOAD_BYTES as z_, parseCashuRequestPayload as za, MAX_WAITING as zb, typingFrame as zc, STORAGE_ROOT as zd, encodeDnsQuery as zf, DAEMON_WATCH_PEER_IDLE_MS as zg, rosterAdmin as zh, ONCHAIN_PROVIDER as zi, APP_RANGE_LIMITS as zl, groupReplyAuthor as zm, wrapGroupMeta as zn, parsePaymentNetworks as zo, EDIT_BUFFER_MAX as zp, decodeDagCbor as zr, readBeacon as zs, groupWakeFrame as zt, SESSION_RECEIVE_PENDING as zu, serviceIdFromName as zv, GROUP_SIGNALING_ALLOWANCE_SHARE as zw, APP_VIEWS as zx, handoffStreamKey as zy };
|
|
41907
42885
|
|
|
41908
|
-
//# sourceMappingURL=src-
|
|
42886
|
+
//# sourceMappingURL=src-DA7T3Gvo.js.map
|