@ghostlytools/sdk 1.11.2 → 1.11.4
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 +1 -1
- package/dist/app.js.map +1 -1
- package/dist/core.js +2 -2
- package/dist/{fakes-DCH5oJMm.js → fakes-CXeeyI4Z.js} +2 -2
- package/dist/{fakes-DCH5oJMm.js.map → fakes-CXeeyI4Z.js.map} +1 -1
- package/dist/fakes.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{keet-identity-key-3EEmDkxz.js → keet-identity-key-DLXTTFZH.js} +1754 -86
- package/dist/keet-identity-key-DLXTTFZH.js.map +1 -0
- package/dist/{src-DA7T3Gvo.js → src-CqAqFhh9.js} +986 -237
- package/dist/src-CqAqFhh9.js.map +1 -0
- package/dist/testing.js +3 -3
- package/dist/types/core/src/appStore.d.ts +5 -0
- package/dist/types/core/src/communityRendezvous.d.ts +5 -2
- package/dist/types/core/src/datalink.d.ts +10 -0
- package/dist/types/core/src/frames.d.ts +18 -0
- package/dist/types/core/src/ghostlink.d.ts +59 -2
- package/dist/types/core/src/groupCommunity.d.ts +13 -3
- package/dist/types/core/src/groupSession.d.ts +2 -0
- package/dist/types/core/src/http.d.ts +26 -3
- package/dist/types/core/src/identity.d.ts +8 -0
- package/dist/types/core/src/linkPreview.d.ts +9 -2
- package/dist/types/core/src/miniApp.d.ts +1 -1
- package/dist/types/core/src/pairedAppRanges.d.ts +2 -0
- package/dist/types/core/src/pairedApps.d.ts +4 -2
- package/dist/types/core/src/relay.d.ts +10 -0
- package/dist/types/core/src/videoMetadata.d.ts +15 -1
- package/dist/{verify-DsXR5sRX.js → verify-B9s82dbd.js} +2 -2
- package/dist/{verify-DsXR5sRX.js.map → verify-B9s82dbd.js.map} +1 -1
- package/package.json +1 -1
- package/dist/keet-identity-key-3EEmDkxz.js.map +0 -1
- package/dist/src-DA7T3Gvo.js.map +0 -1
|
@@ -398,6 +398,18 @@ var IDENTITY_MEMO_MAX = 16384;
|
|
|
398
398
|
* that in JSC. The seed itself is never kept, so a seed its owner zeroes leaves nothing behind here.
|
|
399
399
|
*/
|
|
400
400
|
var publicKeys = /* @__PURE__ */ new Map();
|
|
401
|
+
var publicKeyFastPath = null;
|
|
402
|
+
/** Gives (or, with `null`, takes back) the faster derivation of every public key `identityFromSeed` derives. */
|
|
403
|
+
function setPublicKeyFastPath(derive) {
|
|
404
|
+
publicKeyFastPath = derive;
|
|
405
|
+
}
|
|
406
|
+
function derivePublicKey(seed) {
|
|
407
|
+
if (publicKeyFastPath) try {
|
|
408
|
+
const key = publicKeyFastPath(seed);
|
|
409
|
+
if (key.length === 32) return Uint8Array.from(key);
|
|
410
|
+
} catch {}
|
|
411
|
+
return ed25519.getPublicKey(seed);
|
|
412
|
+
}
|
|
401
413
|
function publicKeyOf(seed) {
|
|
402
414
|
const id = toBase64Url(sha256(seed));
|
|
403
415
|
const now = Date.now();
|
|
@@ -407,7 +419,7 @@ function publicKeyOf(seed) {
|
|
|
407
419
|
entry.at = now;
|
|
408
420
|
} else {
|
|
409
421
|
entry = {
|
|
410
|
-
key:
|
|
422
|
+
key: derivePublicKey(seed),
|
|
411
423
|
at: now
|
|
412
424
|
};
|
|
413
425
|
for (const [oldest, { at }] of publicKeys) {
|
|
@@ -1105,7 +1117,7 @@ var staleTurn = (turn, now) => now - Math.max(turn.askedAt, turn.servedAt) >= 6e
|
|
|
1105
1117
|
* Counted as they were, an hour's step back held every background read for 59 minutes, and a daemon with 50 contacts
|
|
1106
1118
|
* away read 4 of them in the next 15 (bug hunt, 2026-11-07).
|
|
1107
1119
|
*/
|
|
1108
|
-
var within = (list, now, ms) => list.map((at) => Math.min(at, now)).filter((at) => now - at < ms);
|
|
1120
|
+
var within$1 = (list, now, ms) => list.map((at) => Math.min(at, now)).filter((at) => now - at < ms);
|
|
1109
1121
|
/**
|
|
1110
1122
|
* Keys and when each was last set, those of the last minute: how many and the latest, without walking them all (the
|
|
1111
1123
|
* chats that need a relay, `chatNeeds`). Each is set at the time it is set, so the sets come oldest first; a clock
|
|
@@ -1849,6 +1861,8 @@ var RelayTransport = class {
|
|
|
1849
1861
|
if (!again && !elsewhere) {
|
|
1850
1862
|
const held = this.publishWait(key, asker(options, true));
|
|
1851
1863
|
if (held) throw new DiscoveryBudgetError(held.wait, `Publish held back on every relay: ${held.reasons.join("; ")}`);
|
|
1864
|
+
const refused = this.refusedEverywhere(key, asker(options, true));
|
|
1865
|
+
if (refused) throw refused;
|
|
1852
1866
|
}
|
|
1853
1867
|
const timestamp = this.nextTimestamp(key);
|
|
1854
1868
|
let redated;
|
|
@@ -1922,6 +1936,42 @@ var RelayTransport = class {
|
|
|
1922
1936
|
reasons
|
|
1923
1937
|
};
|
|
1924
1938
|
}
|
|
1939
|
+
/**
|
|
1940
|
+
* A publish that every relay would refuse now without being asked (its network cooling down, left alone after failing,
|
|
1941
|
+
* its rate limit or this asker's budget), and not as a wait alone (`publishWait` says those): the failure `putEverywhere`
|
|
1942
|
+
* would end in, in the same words, said before the packet is signed and dated. Null when some relay would be asked. With
|
|
1943
|
+
* every relay out of reach on a page that is online, each chat signed a packet every few seconds that went nowhere: ~58
|
|
1944
|
+
* a second at 300 chats (bug hunt, 2026-11-12).
|
|
1945
|
+
*/
|
|
1946
|
+
refusedEverywhere(pubKeyZ32, who) {
|
|
1947
|
+
const probe = this.breaker.allDownProbe(this.relays);
|
|
1948
|
+
const now = Date.now();
|
|
1949
|
+
const reasons = [], held = [];
|
|
1950
|
+
for (const relay of this.relays) {
|
|
1951
|
+
const refused = this.refusal(relay, relay === probe);
|
|
1952
|
+
if (refused) {
|
|
1953
|
+
reasons.push(String(refused));
|
|
1954
|
+
continue;
|
|
1955
|
+
}
|
|
1956
|
+
if (this.heldFor(relay, who, now, pubKeyZ32) <= 0) return null;
|
|
1957
|
+
held.push(relay);
|
|
1958
|
+
reasons.push(String(new DiscoveryBudgetError(this.heldFor(relay, who))));
|
|
1959
|
+
}
|
|
1960
|
+
for (const relay of held) this.take(relay, who, pubKeyZ32);
|
|
1961
|
+
return new PublishFailedError(`Publish failed on every relay: ${reasons.join("; ")}`, false);
|
|
1962
|
+
}
|
|
1963
|
+
/** What `put` refuses a request to this relay with before its budget is asked; null when it gets that far. */
|
|
1964
|
+
refusal(relay, probe) {
|
|
1965
|
+
if (!probe && this.networkCoolingDown(relay, "PUT")) return new RelayNoAnswerError(`${relay} did not answer a moment ago; retry shortly`, false);
|
|
1966
|
+
const limited = this.rateLimitedFor(relay);
|
|
1967
|
+
if (limited > 0) return new DiscoveryBudgetError(limited, "Discovery relay is cooling down after a 429; retry shortly");
|
|
1968
|
+
const blocked = probe ? 0 : this.breaker.blockedFor(relay);
|
|
1969
|
+
if (blocked > 0) {
|
|
1970
|
+
if (this.breaker.blockedKind(relay) === "throttled") return new DiscoveryBudgetError(blocked, "Discovery relay is throttling this address; retry shortly");
|
|
1971
|
+
return new RelayLeftAloneError(`${relay} is left alone after failing; asked again in ${Math.max(1, Math.ceil(this.breaker.askedAgainIn(relay, this.relays) / 1e3))} s`);
|
|
1972
|
+
}
|
|
1973
|
+
return null;
|
|
1974
|
+
}
|
|
1925
1975
|
/** One relay's packet for a key, read now: its time, kept for `nextTimestamp`. Null when it has none or does not answer. */
|
|
1926
1976
|
async heldAt(relay, pubKeyZ32, who) {
|
|
1927
1977
|
if (!this.take(relay, who, pubKeyZ32)) return null;
|
|
@@ -2338,7 +2388,7 @@ var RelayTransport = class {
|
|
|
2338
2388
|
*/
|
|
2339
2389
|
hedgeRoom(relay) {
|
|
2340
2390
|
const now = Date.now();
|
|
2341
|
-
return within(this.spent.get(relay) ?? [], now, 6e4).length < this.limitOf(relay) - this.reserveOf(relay);
|
|
2391
|
+
return within$1(this.spent.get(relay) ?? [], now, 6e4).length < this.limitOf(relay) - this.reserveOf(relay);
|
|
2342
2392
|
}
|
|
2343
2393
|
readAnsweredAt(pubKeyZ32) {
|
|
2344
2394
|
return this.readAt.get(pubKeyZ32);
|
|
@@ -2435,14 +2485,8 @@ var RelayTransport = class {
|
|
|
2435
2485
|
}
|
|
2436
2486
|
/** `sent`: told, once the budget took the request, whether the relay takes the packet (a 2xx). */
|
|
2437
2487
|
async put(relay, pubKeyZ32, payload, replaces, who, probe = false, sent) {
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
if (limited > 0) throw new DiscoveryBudgetError(limited, "Discovery relay is cooling down after a 429; retry shortly");
|
|
2441
|
-
const blocked = probe ? 0 : this.breaker.blockedFor(relay);
|
|
2442
|
-
if (blocked > 0) {
|
|
2443
|
-
if (this.breaker.blockedKind(relay) === "throttled") throw new DiscoveryBudgetError(blocked, "Discovery relay is throttling this address; retry shortly");
|
|
2444
|
-
throw new RelayLeftAloneError(`${relay} is left alone after failing; asked again in ${Math.max(1, Math.ceil(this.breaker.askedAgainIn(relay, this.relays) / 1e3))} s`);
|
|
2445
|
-
}
|
|
2488
|
+
const refused = this.refusal(relay, probe);
|
|
2489
|
+
if (refused) throw refused;
|
|
2446
2490
|
if (!this.take(relay, who, pubKeyZ32)) throw new DiscoveryBudgetError(this.heldFor(relay, who));
|
|
2447
2491
|
if (probe) this.breaker.beginAllDown(relay);
|
|
2448
2492
|
else this.breaker.begin(relay);
|
|
@@ -2531,7 +2575,7 @@ var RelayTransport = class {
|
|
|
2531
2575
|
if (isGroupSignal(who)) this.spentGroupSignal.get(relay).push(now);
|
|
2532
2576
|
const departedOver = isDepartedRead(who) && this.spent.get(relay).length >= this.limitOf(relay);
|
|
2533
2577
|
if (departedOver) this.overAdd(this.departedOver, key, now);
|
|
2534
|
-
if (isAwaitedRead(who) && this.spent.get(relay).length >= this.limitOf(relay)) this.awaitedOver = [...within(this.awaitedOver, now, 6e4), now];
|
|
2578
|
+
if (isAwaitedRead(who) && this.spent.get(relay).length >= this.limitOf(relay)) this.awaitedOver = [...within$1(this.awaitedOver, now, 6e4), now];
|
|
2535
2579
|
this.spent.get(relay).push(now);
|
|
2536
2580
|
if (who.background) this.spentBackground.get(relay).push(now);
|
|
2537
2581
|
if (who.background && who.write) this.spentBackgroundWrites.get(relay).push(now);
|
|
@@ -2566,26 +2610,26 @@ var RelayTransport = class {
|
|
|
2566
2610
|
* without its own allowance (`ANSWER_READ_ALLOWANCE`).
|
|
2567
2611
|
*/
|
|
2568
2612
|
heldFor(relay, who, now = Date.now(), key, turns = true, ownAllowance = true) {
|
|
2569
|
-
const recent = within(this.spent.get(relay) ?? [], now, 6e4);
|
|
2570
|
-
const recentBackground = within(this.spentBackground.get(relay) ?? [], now, 6e4);
|
|
2613
|
+
const recent = within$1(this.spent.get(relay) ?? [], now, 6e4);
|
|
2614
|
+
const recentBackground = within$1(this.spentBackground.get(relay) ?? [], now, 6e4);
|
|
2571
2615
|
this.spent.set(relay, recent);
|
|
2572
2616
|
this.spentBackground.set(relay, recentBackground);
|
|
2573
|
-
const recentBackgroundWrites = within(this.spentBackgroundWrites.get(relay) ?? [], now, 6e4);
|
|
2617
|
+
const recentBackgroundWrites = within$1(this.spentBackgroundWrites.get(relay) ?? [], now, 6e4);
|
|
2574
2618
|
this.spentBackgroundWrites.set(relay, recentBackgroundWrites);
|
|
2575
2619
|
const over = (list, limit) => list.length >= limit ? list[list.length - limit] + 6e4 - now : 0;
|
|
2576
2620
|
const limit = this.limitOf(relay);
|
|
2577
2621
|
const departed = isDepartedRead(who) && key !== void 0 && recent.length >= limit && this.overReads(this.departedOver, key, now) < 6;
|
|
2578
|
-
if (isAwaitedRead(who)) this.awaitedOver = within(this.awaitedOver, now, 6e4);
|
|
2622
|
+
if (isAwaitedRead(who)) this.awaitedOver = within$1(this.awaitedOver, now, 6e4);
|
|
2579
2623
|
const awaited = isAwaitedRead(who) && key !== void 0 && recent.length >= limit && this.awaitedOver.length < 4;
|
|
2580
2624
|
const share = isChatSignal(who) || departed || awaited ? SIGNALING_ALLOWANCE_SHARE : isGroupSignal(who) ? GROUP_SIGNALING_ALLOWANCE_SHARE : 0;
|
|
2581
2625
|
let allowance = share ? Math.max(0, Math.floor(limit * share) - (who.write ? 0 : 1)) : 0;
|
|
2582
2626
|
if (departed && now - this.awaitedAt < 6e4) allowance = Math.max(0, allowance - 2);
|
|
2583
|
-
const groupSignaled = within(this.spentGroupSignal.get(relay) ?? [], now, 6e4);
|
|
2627
|
+
const groupSignaled = within$1(this.spentGroupSignal.get(relay) ?? [], now, 6e4);
|
|
2584
2628
|
this.spentGroupSignal.set(relay, groupSignaled);
|
|
2585
2629
|
const groupFloor = isGroupSignal(who) && groupSignaled.length < allowance;
|
|
2586
2630
|
let wait = groupFloor ? 0 : over(recent, limit + allowance);
|
|
2587
2631
|
const starved = key !== void 0 && this.starved(key, who, now);
|
|
2588
|
-
const groupOver = within(this.spentGroupOver.get(relay) ?? [], now, GROUP_OVER_PACE_MS);
|
|
2632
|
+
const groupOver = within$1(this.spentGroupOver.get(relay) ?? [], now, GROUP_OVER_PACE_MS);
|
|
2589
2633
|
this.spentGroupOver.set(relay, groupOver);
|
|
2590
2634
|
if (isGroupSignal(who) && !who.write && recent.length >= limit && groupOver.length > 0) wait = Math.max(wait, groupOver[groupOver.length - 1] + GROUP_OVER_PACE_MS - now);
|
|
2591
2635
|
if (who.background && !starved) {
|
|
@@ -2595,16 +2639,16 @@ var RelayTransport = class {
|
|
|
2595
2639
|
const signaling = this.urgentAt + SIGNALING_WINDOW_MS - now;
|
|
2596
2640
|
if (signaling > 0 && !who.door) wait = Math.max(wait, Math.min(signaling, over(recentBackground, Math.min(this.backgroundWhileSignaling, Math.ceil(limit / 6)))));
|
|
2597
2641
|
}
|
|
2598
|
-
const burst = within(this.spentGroupUrgent.get(relay) ?? [], now, GROUP_BURST_MS);
|
|
2642
|
+
const burst = within$1(this.spentGroupUrgent.get(relay) ?? [], now, GROUP_BURST_MS);
|
|
2599
2643
|
this.spentGroupUrgent.set(relay, burst);
|
|
2600
|
-
const answerBurst = within(this.spentAnswerUrgent.get(relay) ?? [], now, GROUP_BURST_MS);
|
|
2644
|
+
const answerBurst = within$1(this.spentAnswerUrgent.get(relay) ?? [], now, GROUP_BURST_MS);
|
|
2601
2645
|
this.spentAnswerUrgent.set(relay, answerBurst);
|
|
2602
2646
|
if (isGroupUrgentRead(who)) {
|
|
2603
2647
|
const most = Math.max(8, Math.floor(limit * GROUP_BURST_MS / 6e4));
|
|
2604
2648
|
const spent = isGroupAnswerRead(who) ? answerBurst : burst;
|
|
2605
2649
|
if (spent.length >= most) wait = Math.max(wait, spent[spent.length - most] + GROUP_BURST_MS - now);
|
|
2606
2650
|
}
|
|
2607
|
-
const watched = within(this.spentWatch.get(relay) ?? [], now, GROUP_RATION_WINDOW_MS);
|
|
2651
|
+
const watched = within$1(this.spentWatch.get(relay) ?? [], now, GROUP_RATION_WINDOW_MS);
|
|
2608
2652
|
this.spentWatch.set(relay, watched);
|
|
2609
2653
|
let turn = 0;
|
|
2610
2654
|
if (isWatch(who)) {
|
|
@@ -2612,14 +2656,14 @@ var RelayTransport = class {
|
|
|
2612
2656
|
if (watched.length >= most) wait = Math.max(wait, watched[watched.length - most] + GROUP_RATION_WINDOW_MS - now);
|
|
2613
2657
|
if (this.readsAhead(key, now, watchLane(who)) > 0) turn = TURN_WAIT_MS;
|
|
2614
2658
|
}
|
|
2615
|
-
const chatWatched = within(this.spentChatWatch.get(relay) ?? [], now, GROUP_RATION_WINDOW_MS);
|
|
2659
|
+
const chatWatched = within$1(this.spentChatWatch.get(relay) ?? [], now, GROUP_RATION_WINDOW_MS);
|
|
2616
2660
|
this.spentChatWatch.set(relay, chatWatched);
|
|
2617
2661
|
if (isChatWatch(who) && !departed) {
|
|
2618
2662
|
const most = Math.max(1, Math.ceil(limit * CHAT_WATCH_SHARE * GROUP_RATION_WINDOW_MS / 6e4));
|
|
2619
2663
|
if (chatWatched.length >= most) wait = Math.max(wait, chatWatched[chatWatched.length - most] + GROUP_RATION_WINDOW_MS - now);
|
|
2620
2664
|
if (this.readsAhead(key, now, watchLane(who)) > 0) turn = TURN_WAIT_MS;
|
|
2621
2665
|
}
|
|
2622
|
-
const rationed = within(this.spentGroupReads.get(relay) ?? [], now, GROUP_RATION_WINDOW_MS);
|
|
2666
|
+
const rationed = within$1(this.spentGroupReads.get(relay) ?? [], now, GROUP_RATION_WINDOW_MS);
|
|
2623
2667
|
this.spentGroupReads.set(relay, rationed);
|
|
2624
2668
|
const pastLimit = isGroupSignal(who) && recent.length >= limit;
|
|
2625
2669
|
if (isGroupRead(who) && !pastLimit && now - (this.groupsFullAt.get(relay) ?? -Infinity) < GROUP_RATION_MS) {
|
|
@@ -2653,7 +2697,7 @@ var RelayTransport = class {
|
|
|
2653
2697
|
* than it in the last minute, and none within `ANSWER_READ_SPACING_MS`. None where the groups have no allowance.
|
|
2654
2698
|
*/
|
|
2655
2699
|
answerAllowanceFree(relay, now) {
|
|
2656
|
-
const spent = within(this.spentAnswerAllowance.get(relay) ?? [], now, 6e4);
|
|
2700
|
+
const spent = within$1(this.spentAnswerAllowance.get(relay) ?? [], now, 6e4);
|
|
2657
2701
|
this.spentAnswerAllowance.set(relay, spent);
|
|
2658
2702
|
const most = Math.min(3, Math.floor(this.limitOf(relay) * GROUP_SIGNALING_ALLOWANCE_SHARE));
|
|
2659
2703
|
return spent.length < most && (spent.length === 0 || now - spent[spent.length - 1] >= 2e4);
|
|
@@ -2678,7 +2722,7 @@ var RelayTransport = class {
|
|
|
2678
2722
|
}
|
|
2679
2723
|
/** What is left of the community members' way back allowance on this relay (`WAY_BACK_SHARE`); its reads leave a write the last of it. */
|
|
2680
2724
|
wayBackLeft(relay, who, now) {
|
|
2681
|
-
const spent = within(this.spentWayBack.get(relay) ?? [], now, 6e4);
|
|
2725
|
+
const spent = within$1(this.spentWayBack.get(relay) ?? [], now, 6e4);
|
|
2682
2726
|
this.spentWayBack.set(relay, spent);
|
|
2683
2727
|
return Math.floor(this.limitOf(relay) * WAY_BACK_SHARE) - (who.write ? 0 : 1) - spent.length;
|
|
2684
2728
|
}
|
|
@@ -2762,7 +2806,7 @@ var RelayTransport = class {
|
|
|
2762
2806
|
}
|
|
2763
2807
|
/** This key's departed reads past the limit in the last minute (`DEPARTED_READS`). */
|
|
2764
2808
|
overReads(over, key, now) {
|
|
2765
|
-
const reads = within(over.get(key) ?? [], now, 6e4);
|
|
2809
|
+
const reads = within$1(over.get(key) ?? [], now, 6e4);
|
|
2766
2810
|
if (reads.length) over.set(key, reads);
|
|
2767
2811
|
else over.delete(key);
|
|
2768
2812
|
return reads.length;
|
|
@@ -2810,7 +2854,7 @@ var RelayTransport = class {
|
|
|
2810
2854
|
spareHeldFor(relay, now) {
|
|
2811
2855
|
const reserved = this.chatReservedFor(relay, now);
|
|
2812
2856
|
if (reserved <= 0) return 0;
|
|
2813
|
-
const recent = within(this.spent.get(relay) ?? [], now, 6e4);
|
|
2857
|
+
const recent = within$1(this.spent.get(relay) ?? [], now, 6e4);
|
|
2814
2858
|
const keep = this.limitOf(relay) - this.chatReserveOf(relay, now);
|
|
2815
2859
|
return recent.length >= keep ? Math.min(reserved, recent[recent.length - keep] + 6e4 - now) : 0;
|
|
2816
2860
|
}
|
|
@@ -3151,7 +3195,7 @@ var TurnRecordError = class extends Error {
|
|
|
3151
3195
|
this.name = "TurnRecordError";
|
|
3152
3196
|
}
|
|
3153
3197
|
};
|
|
3154
|
-
var refuse$
|
|
3198
|
+
var refuse$3 = (refusal, detail) => {
|
|
3155
3199
|
throw new TurnRecordError(refusal, detail);
|
|
3156
3200
|
};
|
|
3157
3201
|
var isZero = (bytes) => bytes.every((b) => b === 0);
|
|
@@ -3247,70 +3291,70 @@ async function signTurnBody(address, fields, signer) {
|
|
|
3247
3291
|
* against the device that was active before) is the caller's: `turnRead.ts`.
|
|
3248
3292
|
*/
|
|
3249
3293
|
function readTurnBody(body, address) {
|
|
3250
|
-
if (body.length !== 374) refuse$
|
|
3251
|
-
if (body[OFFSET.version] !== 1) refuse$
|
|
3294
|
+
if (body.length !== 374) refuse$3("length");
|
|
3295
|
+
if (body[OFFSET.version] !== 1) refuse$3("version");
|
|
3252
3296
|
const turn = new DataView(body.buffer, body.byteOffset, body.byteLength).getUint32(OFFSET.turn);
|
|
3253
3297
|
const rev = body[OFFSET.rev] << 16 | body[OFFSET.rev + 1] << 8 | body[OFFSET.rev + 2];
|
|
3254
|
-
if (rev >= TURN_REV_LIMIT) refuse$
|
|
3298
|
+
if (rev >= TURN_REV_LIMIT) refuse$3("rev");
|
|
3255
3299
|
const author = body[OFFSET.author], active = body[OFFSET.active], count = body[OFFSET.count];
|
|
3256
|
-
if (author >= 4) refuse$
|
|
3257
|
-
if (active >= 4 && active !== 255) refuse$
|
|
3258
|
-
if (count > 4) refuse$
|
|
3300
|
+
if (author >= 4) refuse$3("author");
|
|
3301
|
+
if (active >= 4 && active !== 255) refuse$3("active");
|
|
3302
|
+
if (count > 4) refuse$3("count");
|
|
3259
3303
|
const slots = [];
|
|
3260
3304
|
const decoder = new TextDecoder("utf-8", { fatal: true });
|
|
3261
3305
|
for (let i = 0; i < 4; i++) {
|
|
3262
3306
|
const at = OFFSET.slots + i * SLOT_BYTES;
|
|
3263
3307
|
const key = body.slice(at, at + 32), padded = body.subarray(at + 32, at + SLOT_BYTES);
|
|
3264
3308
|
if (isZero(key)) {
|
|
3265
|
-
if (!isZero(padded)) refuse$
|
|
3309
|
+
if (!isZero(padded)) refuse$3("slots");
|
|
3266
3310
|
slots.push(null);
|
|
3267
3311
|
continue;
|
|
3268
3312
|
}
|
|
3269
3313
|
const end = padded.indexOf(0);
|
|
3270
3314
|
const name = end < 0 ? padded : padded.subarray(0, end);
|
|
3271
|
-
if (end >= 0 && !isZero(padded.subarray(end))) refuse$
|
|
3315
|
+
if (end >= 0 && !isZero(padded.subarray(end))) refuse$3("name");
|
|
3272
3316
|
let text = "";
|
|
3273
3317
|
try {
|
|
3274
3318
|
text = decoder.decode(name);
|
|
3275
3319
|
} catch {
|
|
3276
|
-
refuse$
|
|
3320
|
+
refuse$3("name");
|
|
3277
3321
|
}
|
|
3278
|
-
if (slots.some((other) => other && bytesEqual(other.key, key))) refuse$
|
|
3322
|
+
if (slots.some((other) => other && bytesEqual(other.key, key))) refuse$3("slots", "one key in two slots");
|
|
3279
3323
|
slots.push({
|
|
3280
3324
|
key,
|
|
3281
3325
|
name: turnName(text)
|
|
3282
3326
|
});
|
|
3283
3327
|
}
|
|
3284
|
-
if (slots.filter(Boolean).length !== count) refuse$
|
|
3328
|
+
if (slots.filter(Boolean).length !== count) refuse$3("count");
|
|
3285
3329
|
const authorSlot = slots[author];
|
|
3286
|
-
if (!authorSlot) return refuse$
|
|
3330
|
+
if (!authorSlot) return refuse$3("author");
|
|
3287
3331
|
const tombstone = turn === TOMBSTONE_TURN;
|
|
3288
|
-
if (tombstone !== (active === 255)) refuse$
|
|
3332
|
+
if (tombstone !== (active === 255)) refuse$3("tombstone");
|
|
3289
3333
|
if (!tombstone) {
|
|
3290
|
-
if (!slots[active]) refuse$
|
|
3291
|
-
if (author !== active) refuse$
|
|
3334
|
+
if (!slots[active]) refuse$3("active");
|
|
3335
|
+
if (author !== active) refuse$3("author-not-active");
|
|
3292
3336
|
}
|
|
3293
3337
|
const present = body[OFFSET.releasePresent];
|
|
3294
|
-
if (present > 1) refuse$
|
|
3338
|
+
if (present > 1) refuse$3("release-layout");
|
|
3295
3339
|
let release;
|
|
3296
3340
|
if (!present) {
|
|
3297
|
-
if (!isZero(body.subarray(OFFSET.releaseFrom, OFFSET.signature))) refuse$
|
|
3341
|
+
if (!isZero(body.subarray(OFFSET.releaseFrom, OFFSET.signature))) refuse$3("release-layout");
|
|
3298
3342
|
} else {
|
|
3299
|
-
if (tombstone) refuse$
|
|
3343
|
+
if (tombstone) refuse$3("tombstone", "a tombstone carries no release");
|
|
3300
3344
|
const from = body[OFFSET.releaseFrom], to = body[OFFSET.releaseTo];
|
|
3301
3345
|
const fromSlot = from < 4 ? slots[from] : null, toSlot = to < 4 ? slots[to] : null;
|
|
3302
|
-
if (!fromSlot || !toSlot) return refuse$
|
|
3346
|
+
if (!fromSlot || !toSlot) return refuse$3("release-layout");
|
|
3303
3347
|
release = {
|
|
3304
3348
|
from,
|
|
3305
3349
|
to,
|
|
3306
3350
|
h: body.slice(OFFSET.releaseH, OFFSET.releaseSignature),
|
|
3307
3351
|
signature: body.slice(OFFSET.releaseSignature, OFFSET.signature)
|
|
3308
3352
|
};
|
|
3309
|
-
if (to !== active) refuse$
|
|
3310
|
-
if (!verify(release.signature, turnReleaseMessage(address, turn, toSlot.key, release.h), fromSlot.key)) refuse$
|
|
3353
|
+
if (to !== active) refuse$3("release", "the release is to another device than the active one");
|
|
3354
|
+
if (!verify(release.signature, turnReleaseMessage(address, turn, toSlot.key, release.h), fromSlot.key)) refuse$3("release");
|
|
3311
3355
|
}
|
|
3312
3356
|
const signature = body.slice(OFFSET.signature);
|
|
3313
|
-
if (!verify(signature, turnSignedMessage(address, body), authorSlot.key)) refuse$
|
|
3357
|
+
if (!verify(signature, turnSignedMessage(address, body), authorSlot.key)) refuse$3("signature");
|
|
3314
3358
|
return {
|
|
3315
3359
|
turn,
|
|
3316
3360
|
rev,
|
|
@@ -4485,7 +4529,7 @@ function parseImageMeta(value, mime) {
|
|
|
4485
4529
|
var u16be$1 = (b, at) => b[at] << 8 | b[at + 1];
|
|
4486
4530
|
var u16le = (b, at) => b[at] | b[at + 1] << 8;
|
|
4487
4531
|
var u24le = (b, at) => b[at] | b[at + 1] << 8 | b[at + 2] << 16;
|
|
4488
|
-
var u32be$
|
|
4532
|
+
var u32be$3 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
|
|
4489
4533
|
var ascii = (b, at, text) => [...text].every((c, i) => b[at + i] === c.charCodeAt(0));
|
|
4490
4534
|
var sized = (width, height) => edge(width) && edge(height) ? {
|
|
4491
4535
|
width,
|
|
@@ -4513,7 +4557,7 @@ function exifOrientation(b, tiff, end) {
|
|
|
4513
4557
|
const little = ascii(b, tiff, "II");
|
|
4514
4558
|
if (!little && !ascii(b, tiff, "MM")) return 1;
|
|
4515
4559
|
const u16 = (at) => little ? u16le(b, at) : u16be$1(b, at);
|
|
4516
|
-
const u32 = (at) => little ? u16le(b, at) + u16le(b, at + 2) * 65536 : u32be$
|
|
4560
|
+
const u32 = (at) => little ? u16le(b, at) + u16le(b, at + 2) * 65536 : u32be$3(b, at);
|
|
4517
4561
|
if (u16(tiff + 2) !== 42) return 1;
|
|
4518
4562
|
const ifd = tiff + u32(tiff + 4);
|
|
4519
4563
|
if (ifd + 2 > end) return 1;
|
|
@@ -4598,7 +4642,7 @@ function gifSize(b) {
|
|
|
4598
4642
|
function imageSize(head) {
|
|
4599
4643
|
const b = head;
|
|
4600
4644
|
try {
|
|
4601
|
-
if (b.length >= 24 && b[0] === 137 && ascii(b, 1, "PNG\r\n\n") && ascii(b, 12, "IHDR")) return sized(u32be$
|
|
4645
|
+
if (b.length >= 24 && b[0] === 137 && ascii(b, 1, "PNG\r\n\n") && ascii(b, 12, "IHDR")) return sized(u32be$3(b, 16), u32be$3(b, 20));
|
|
4602
4646
|
if (b.length >= 10 && (ascii(b, 0, "GIF87a") || ascii(b, 0, "GIF89a"))) return gifSize(b);
|
|
4603
4647
|
if (b.length >= 4 && b[0] === 255 && b[1] === 216 && b[2] === 255) return jpegSize(b);
|
|
4604
4648
|
if (b.length >= 16 && ascii(b, 0, "RIFF") && ascii(b, 8, "WEBP")) return webpSize(b);
|
|
@@ -7937,6 +7981,24 @@ var LIMITS = {
|
|
|
7937
7981
|
*/
|
|
7938
7982
|
maxClientWaiting: 64,
|
|
7939
7983
|
maxClientWaitingBodyBytes: 67108864,
|
|
7984
|
+
/**
|
|
7985
|
+
* Response-body bytes a client holds for one response before whatever reads it took them. Past it, a response its
|
|
7986
|
+
* reader takes nothing of for `unreadStallMs` is reset: its reader stalled. Four times what a host keeps buffered on
|
|
7987
|
+
* the link (`sendHighWaterMark`), so a reader that keeps up never reaches it.
|
|
7988
|
+
*/
|
|
7989
|
+
maxUnreadResponseBytes: 4194304,
|
|
7990
|
+
/**
|
|
7991
|
+
* How long a reader past `maxUnreadResponseBytes` may take nothing before its response is reset. One that keeps
|
|
7992
|
+
* reading, only slower than the link (a video playing as it arrives, a contact's app read through the web's services
|
|
7993
|
+
* worker), is not cut: it holds up to the response's own bound.
|
|
7994
|
+
*/
|
|
7995
|
+
unreadStallMs: 2e3,
|
|
7996
|
+
/**
|
|
7997
|
+
* Response-body bytes a client holds for all its responses before their readers took them. Past it, a response over
|
|
7998
|
+
* `maxUnreadResponseBytes` is reset at once, its reader's pace aside: one slow reader keeps its whole response (as
|
|
7999
|
+
* much as `maxResponseBodyBytes`), but many cannot add up (a contact's app reading each answer a chunk at a time).
|
|
8000
|
+
*/
|
|
8001
|
+
maxClientUnreadResponseBytes: 67108864,
|
|
7940
8002
|
maxChatMessageBytes: 16384,
|
|
7941
8003
|
maxFileBytes: 104857600,
|
|
7942
8004
|
/** Files a peer may be sending us at once. */
|
|
@@ -8308,10 +8370,11 @@ function resolveTargetUrl(target, path) {
|
|
|
8308
8370
|
if (!path.startsWith("/") || path.startsWith("//")) return null;
|
|
8309
8371
|
for (const char of path) {
|
|
8310
8372
|
const code = char.codePointAt(0) ?? 0;
|
|
8311
|
-
if (code <= 32 || code === 127
|
|
8373
|
+
if (code <= 32 || code === 127) return null;
|
|
8312
8374
|
}
|
|
8313
8375
|
const queryAt = path.indexOf("?");
|
|
8314
8376
|
const pathPart = queryAt === -1 ? path : path.slice(0, queryAt);
|
|
8377
|
+
if (pathPart.includes("\\")) return null;
|
|
8315
8378
|
if (/%(2f|5c|2e)/i.test(pathPart)) return null;
|
|
8316
8379
|
if (pathPart.split("/").some(climbsOut)) return null;
|
|
8317
8380
|
let url;
|
|
@@ -8390,14 +8453,15 @@ function sanitizeRequestHeaders(headers) {
|
|
|
8390
8453
|
return !DROPPED_REQUEST_HEADER_PREFIXES.some((prefix) => lower.startsWith(prefix));
|
|
8391
8454
|
});
|
|
8392
8455
|
}
|
|
8393
|
-
|
|
8456
|
+
/** `from`: the local URL of the request answered, the one a relative `Location` is read against. */
|
|
8457
|
+
function sanitizeResponseHeaders(headers, target, from) {
|
|
8394
8458
|
const out = [];
|
|
8395
8459
|
for (const [name, value] of headers) {
|
|
8396
8460
|
const lower = name.toLowerCase();
|
|
8397
8461
|
if (!HEADER_NAME.test(name) || !isCleanHeaderValue(value)) continue;
|
|
8398
8462
|
if (HOP_BY_HOP.has(lower) || DROPPED_RESPONSE_HEADERS.has(lower)) continue;
|
|
8399
8463
|
if (lower === "location" || lower === "content-location") {
|
|
8400
|
-
const location = relativizeLocation(value, target);
|
|
8464
|
+
const location = relativizeLocation(value, target, from);
|
|
8401
8465
|
if (location !== null) out.push([name, location]);
|
|
8402
8466
|
} else if (lower === "set-cookie") out.push([name, value.replace(/;\s*domain\s*=[^;]*/gi, "")]);
|
|
8403
8467
|
else out.push([name, value]);
|
|
@@ -8513,12 +8577,14 @@ function withViewerPolicy(headers, relayOnly = false) {
|
|
|
8513
8577
|
/**
|
|
8514
8578
|
* Turns `http://localhost:3400/base/x` into `/x` so the client never learns or
|
|
8515
8579
|
* follows the local address. Null when the location is not on the target origin
|
|
8516
|
-
* and under its base path.
|
|
8580
|
+
* and under its base path. A relative one (`edit`, `?page=2`, `../x`) is read
|
|
8581
|
+
* against `from`, the local URL of the request it answers, as a browser reads it;
|
|
8582
|
+
* without one, against the base path.
|
|
8517
8583
|
*/
|
|
8518
|
-
function relativizeLocation(location, target) {
|
|
8584
|
+
function relativizeLocation(location, target, from) {
|
|
8519
8585
|
let url;
|
|
8520
8586
|
try {
|
|
8521
|
-
url = new URL(location, `${target.origin}${target.basePath}/`);
|
|
8587
|
+
url = new URL(location, from ?? `${target.origin}${target.basePath}/`);
|
|
8522
8588
|
} catch {
|
|
8523
8589
|
return null;
|
|
8524
8590
|
}
|
|
@@ -8531,10 +8597,10 @@ function relativizeLocation(location, target) {
|
|
|
8531
8597
|
if (!path.startsWith("/") || path.startsWith("//")) return null;
|
|
8532
8598
|
return `${path}${url.search}${url.hash}`;
|
|
8533
8599
|
}
|
|
8534
|
-
function isRedirectBlocked(response, target) {
|
|
8600
|
+
function isRedirectBlocked(response, target, from) {
|
|
8535
8601
|
if (response.status < 300 || response.status > 399) return false;
|
|
8536
8602
|
const location = response.headers.find(([name]) => name.toLowerCase() === "location");
|
|
8537
|
-
return location !== void 0 && relativizeLocation(location[1], target) === null;
|
|
8603
|
+
return location !== void 0 && relativizeLocation(location[1], target, from) === null;
|
|
8538
8604
|
}
|
|
8539
8605
|
var ALLOWED_METHODS = /* @__PURE__ */ new Set([
|
|
8540
8606
|
"GET",
|
|
@@ -8559,6 +8625,8 @@ var HttpHost = class {
|
|
|
8559
8625
|
live = /* @__PURE__ */ new Set();
|
|
8560
8626
|
/** Body bytes of the streams in `live`: a peer cannot make the host hold more than `maxHostBodyBytesPerPeer`. */
|
|
8561
8627
|
heldBodyBytes = 0;
|
|
8628
|
+
/** One listener per `revoked` signal of the open streams, not one per stream: a page opens dozens at once. */
|
|
8629
|
+
revokedListeners = /* @__PURE__ */ new Map();
|
|
8562
8630
|
constructor(channel, getService, localFetch) {
|
|
8563
8631
|
this.channel = channel;
|
|
8564
8632
|
this.getService = getService;
|
|
@@ -8571,7 +8639,7 @@ var HttpHost = class {
|
|
|
8571
8639
|
if (this.streams.has(frame.id)) return;
|
|
8572
8640
|
const method = frame.m.toUpperCase();
|
|
8573
8641
|
const service = this.getService(frame.s);
|
|
8574
|
-
if (!service) return this.fail(frame.id, 404, "unknown-service", "This peer does not share that service.");
|
|
8642
|
+
if (!service || service.revoked?.aborted) return this.fail(frame.id, 404, "unknown-service", "This peer does not share that service.");
|
|
8575
8643
|
if (!ALLOWED_METHODS.has(method)) return this.fail(frame.id, 405, "method-not-allowed", "Method not allowed.");
|
|
8576
8644
|
if (this.live.size >= LIMITS.maxConcurrentRequestsPerPeer) return this.fail(frame.id, 503, "busy", "Too many concurrent requests.");
|
|
8577
8645
|
const url = resolveTargetUrl(service.target, frame.p);
|
|
@@ -8591,6 +8659,7 @@ var HttpHost = class {
|
|
|
8591
8659
|
};
|
|
8592
8660
|
this.streams.set(frame.id, stream);
|
|
8593
8661
|
this.live.add(stream);
|
|
8662
|
+
if (service.revoked) this.watchRevoked(service.revoked);
|
|
8594
8663
|
if (frame.b && !BODYLESS_METHODS.has(method)) this.watchPace(stream);
|
|
8595
8664
|
else this.run(stream);
|
|
8596
8665
|
}
|
|
@@ -8639,6 +8708,33 @@ var HttpHost = class {
|
|
|
8639
8708
|
stream.abort.abort();
|
|
8640
8709
|
if (this.isCurrent(stream)) this.streams.delete(stream.frame.id);
|
|
8641
8710
|
if (!stream.started) this.release(stream);
|
|
8711
|
+
const revoked = stream.service.revoked;
|
|
8712
|
+
const listener = revoked && this.revokedListeners.get(revoked);
|
|
8713
|
+
if (listener && ![...this.streams.values()].some((s) => s.service.revoked === revoked)) {
|
|
8714
|
+
revoked.removeEventListener("abort", listener);
|
|
8715
|
+
this.revokedListeners.delete(revoked);
|
|
8716
|
+
}
|
|
8717
|
+
}
|
|
8718
|
+
/** An answer still on its way would reach someone the app is no longer shared with: those streams are reset. */
|
|
8719
|
+
watchRevoked(revoked) {
|
|
8720
|
+
if (this.revokedListeners.has(revoked)) return;
|
|
8721
|
+
const listener = () => {
|
|
8722
|
+
this.revokedListeners.delete(revoked);
|
|
8723
|
+
for (const stream of [...this.streams.values()]) {
|
|
8724
|
+
if (stream.service.revoked !== revoked) continue;
|
|
8725
|
+
this.end(stream);
|
|
8726
|
+
try {
|
|
8727
|
+
this.channel.send(encodeControl({
|
|
8728
|
+
t: "rst",
|
|
8729
|
+
id: stream.frame.id,
|
|
8730
|
+
d: "s",
|
|
8731
|
+
e: "The app is no longer shared with you."
|
|
8732
|
+
}));
|
|
8733
|
+
} catch {}
|
|
8734
|
+
}
|
|
8735
|
+
};
|
|
8736
|
+
this.revokedListeners.set(revoked, listener);
|
|
8737
|
+
revoked.addEventListener("abort", listener, { once: true });
|
|
8642
8738
|
}
|
|
8643
8739
|
/** The stream no longer counts toward the limits: its body is dropped, or its local fetch has settled. */
|
|
8644
8740
|
release(stream) {
|
|
@@ -8690,7 +8786,7 @@ var HttpHost = class {
|
|
|
8690
8786
|
}));
|
|
8691
8787
|
return;
|
|
8692
8788
|
}
|
|
8693
|
-
if (isRedirectBlocked(response, service.target)) {
|
|
8789
|
+
if (isRedirectBlocked(response, service.target, stream.url)) {
|
|
8694
8790
|
this.end(stream);
|
|
8695
8791
|
return this.fail(frame.id, 502, "redirect-blocked", "The service redirected outside of the shared target.");
|
|
8696
8792
|
}
|
|
@@ -8699,7 +8795,7 @@ var HttpHost = class {
|
|
|
8699
8795
|
t: "res",
|
|
8700
8796
|
id: frame.id,
|
|
8701
8797
|
st: response.status,
|
|
8702
|
-
h: sanitizeResponseHeaders(response.headers, service.target),
|
|
8798
|
+
h: sanitizeResponseHeaders(response.headers, service.target, stream.url),
|
|
8703
8799
|
b: hasBody
|
|
8704
8800
|
};
|
|
8705
8801
|
this.channel.send(encodeControl(res));
|
|
@@ -8771,12 +8867,23 @@ var GhostlyHttpError = class extends Error {
|
|
|
8771
8867
|
}
|
|
8772
8868
|
};
|
|
8773
8869
|
var BodyQueue = class {
|
|
8870
|
+
all;
|
|
8774
8871
|
chunks = [];
|
|
8775
8872
|
done = false;
|
|
8776
8873
|
error = null;
|
|
8777
8874
|
wake = null;
|
|
8875
|
+
/** Bytes received and not yet read. */
|
|
8876
|
+
held = 0;
|
|
8877
|
+
/** Bytes read so far, all told. */
|
|
8878
|
+
taken = 0;
|
|
8879
|
+
/** `all`: what every queue of the same client holds, kept with this one's. */
|
|
8880
|
+
constructor(all) {
|
|
8881
|
+
this.all = all;
|
|
8882
|
+
}
|
|
8778
8883
|
push(chunk) {
|
|
8779
8884
|
this.chunks.push(chunk);
|
|
8885
|
+
this.held += chunk.length;
|
|
8886
|
+
this.all.held += chunk.length;
|
|
8780
8887
|
this.wake?.();
|
|
8781
8888
|
}
|
|
8782
8889
|
finish(error) {
|
|
@@ -8785,9 +8892,24 @@ var BodyQueue = class {
|
|
|
8785
8892
|
this.error = error ?? null;
|
|
8786
8893
|
this.wake?.();
|
|
8787
8894
|
}
|
|
8895
|
+
/** Lets go of what was not read yet, ended or not: the reader gets `error` in its place. */
|
|
8896
|
+
drop(error) {
|
|
8897
|
+
this.chunks = [];
|
|
8898
|
+
this.all.held -= this.held;
|
|
8899
|
+
this.held = 0;
|
|
8900
|
+
this.done = true;
|
|
8901
|
+
this.error = error;
|
|
8902
|
+
this.wake?.();
|
|
8903
|
+
}
|
|
8788
8904
|
async *[Symbol.asyncIterator]() {
|
|
8789
8905
|
for (;;) {
|
|
8790
|
-
while (this.chunks.length > 0)
|
|
8906
|
+
while (this.chunks.length > 0) {
|
|
8907
|
+
const chunk = this.chunks.shift();
|
|
8908
|
+
this.held -= chunk.length;
|
|
8909
|
+
this.all.held -= chunk.length;
|
|
8910
|
+
this.taken += chunk.length;
|
|
8911
|
+
yield chunk;
|
|
8912
|
+
}
|
|
8791
8913
|
if (this.error) throw this.error;
|
|
8792
8914
|
if (this.done) return;
|
|
8793
8915
|
await new Promise((resolve) => this.wake = resolve);
|
|
@@ -8803,6 +8925,8 @@ var HttpClient = class {
|
|
|
8803
8925
|
waitingBytes = 0;
|
|
8804
8926
|
inFlight = 0;
|
|
8805
8927
|
closed = false;
|
|
8928
|
+
/** Response-body bytes all this client's responses hold before their readers took them. */
|
|
8929
|
+
unread = { held: 0 };
|
|
8806
8930
|
constructor(channel) {
|
|
8807
8931
|
this.channel = channel;
|
|
8808
8932
|
}
|
|
@@ -8875,7 +8999,7 @@ var HttpClient = class {
|
|
|
8875
8999
|
const stream = this.streams.get(frame.id);
|
|
8876
9000
|
if (!stream || stream.queue) return;
|
|
8877
9001
|
clearTimeout(stream.headersTimer);
|
|
8878
|
-
const queue = new BodyQueue();
|
|
9002
|
+
const queue = new BodyQueue(this.unread);
|
|
8879
9003
|
stream.queue = queue;
|
|
8880
9004
|
if (frame.b) this.armIdleTimer(frame.id, stream);
|
|
8881
9005
|
else this.finish(frame.id);
|
|
@@ -8896,9 +9020,34 @@ var HttpClient = class {
|
|
|
8896
9020
|
stream.received += chunk.payload.length;
|
|
8897
9021
|
if (stream.received > stream.maxBytes) return this.abort(chunk.id, new GhostlyHttpError("response-too-large", "Response body too large"));
|
|
8898
9022
|
if (chunk.payload.length > 0) stream.queue.push(chunk.payload.slice());
|
|
9023
|
+
if (stream.queue.held > LIMITS.maxUnreadResponseBytes) {
|
|
9024
|
+
if (this.unread.held > LIMITS.maxClientUnreadResponseBytes) return this.dropUnread(chunk.id, stream.queue);
|
|
9025
|
+
this.checkUnread(chunk.id, stream, stream.queue);
|
|
9026
|
+
}
|
|
8899
9027
|
if (chunk.end) this.finish(chunk.id);
|
|
8900
9028
|
else this.armIdleTimer(chunk.id, stream);
|
|
8901
9029
|
}
|
|
9030
|
+
/**
|
|
9031
|
+
* Nothing tells the peer to slow down, and its last chunk frees the slot: a reader that stalls (a contact's page that
|
|
9032
|
+
* never reads what it fetched) would have the whole body held here, one per request it leaves unread. Past the bound
|
|
9033
|
+
* the reader gets `unreadStallMs`, as a link that hands over many chunks at once leaves it no turn: one that took
|
|
9034
|
+
* something in it is looked at again, one that took nothing has the response reset and what it held let go.
|
|
9035
|
+
*/
|
|
9036
|
+
checkUnread(id, stream, queue) {
|
|
9037
|
+
if (stream.unreadCheck) return;
|
|
9038
|
+
const taken = queue.taken;
|
|
9039
|
+
stream.unreadCheck = setTimeout(() => {
|
|
9040
|
+
stream.unreadCheck = void 0;
|
|
9041
|
+
if (queue.held <= LIMITS.maxUnreadResponseBytes) return;
|
|
9042
|
+
if (queue.taken > taken) return this.checkUnread(id, stream, queue);
|
|
9043
|
+
this.dropUnread(id, queue);
|
|
9044
|
+
}, LIMITS.unreadStallMs);
|
|
9045
|
+
}
|
|
9046
|
+
dropUnread(id, queue) {
|
|
9047
|
+
const error = new GhostlyHttpError("unread", "Response body not read in time");
|
|
9048
|
+
queue.drop(error);
|
|
9049
|
+
this.abort(id, error);
|
|
9050
|
+
}
|
|
8902
9051
|
handleReset(frame) {
|
|
8903
9052
|
this.abort(frame.id, new GhostlyHttpError("reset", frame.e || "Request reset by peer"), false);
|
|
8904
9053
|
}
|
|
@@ -10418,6 +10567,8 @@ var DataLink = class {
|
|
|
10418
10567
|
fullGather = false;
|
|
10419
10568
|
/** The offer or answer out has no public candidate (as it went: the connection's description gains any that come later). */
|
|
10420
10569
|
sentLacksPublic = false;
|
|
10570
|
+
/** Connections the gathering under way replaced for finding no candidate at all (`gathered`); 0 when none is under way. */
|
|
10571
|
+
gatherStalls = 0;
|
|
10421
10572
|
lastSignalTs = 0;
|
|
10422
10573
|
/** The peer's description as this connection was given it: Chrome shows it as `remoteDescription` only once applied. */
|
|
10423
10574
|
remoteSdp = null;
|
|
@@ -10511,11 +10662,13 @@ var DataLink = class {
|
|
|
10511
10662
|
}
|
|
10512
10663
|
this.lastSignalTs = signal.ts;
|
|
10513
10664
|
const wasOpen = this.state === "open";
|
|
10665
|
+
const unpublic = this.gatherStalled;
|
|
10514
10666
|
this.teardown();
|
|
10515
10667
|
if (wasOpen) {
|
|
10516
10668
|
this.options.onDirect?.("closed");
|
|
10517
10669
|
this.options.onClose();
|
|
10518
10670
|
}
|
|
10671
|
+
if (unpublic) this.options.onDirect?.("no-public");
|
|
10519
10672
|
this.answered = {
|
|
10520
10673
|
offer: signal,
|
|
10521
10674
|
at: Date.now(),
|
|
@@ -10593,7 +10746,7 @@ var DataLink = class {
|
|
|
10593
10746
|
}
|
|
10594
10747
|
close() {
|
|
10595
10748
|
const stalled = Date.now() - this.connectingSince >= STALLED_EVIDENCE_MS;
|
|
10596
|
-
const evidence = stalled ? this.directEvidence() : null;
|
|
10749
|
+
const evidence = (stalled ? this.directEvidence() : null) ?? (this.gatherStalled ? "no-public" : null);
|
|
10597
10750
|
this.noteNoPublic(stalled);
|
|
10598
10751
|
this.answered = null;
|
|
10599
10752
|
this.reset();
|
|
@@ -10625,6 +10778,16 @@ var DataLink = class {
|
|
|
10625
10778
|
return !PUBLIC_CANDIDATE.test(local) ? "no-public" : symmetricNat(local) ? "symmetric" : this.myOfferTs ? "no-path" : null;
|
|
10626
10779
|
}
|
|
10627
10780
|
/**
|
|
10781
|
+
* The gathering under way found no candidate on every connection but the one it waits on now (`GATHER_ATTEMPTS` - 1
|
|
10782
|
+
* stalls): ended from outside now (another transport went live, the contact's offer took its place), it says what
|
|
10783
|
+
* one that ran out says, `no-public`. Saying nothing held the note back on a network that blocks direct connections:
|
|
10784
|
+
* a browser there gathers none, its chats went live over Iroh before the third stall, and only a later attempt, if
|
|
10785
|
+
* any came, said it (direct-blocked e2e, 2026-11-13).
|
|
10786
|
+
*/
|
|
10787
|
+
get gatherStalled() {
|
|
10788
|
+
return this.gatherStalls >= 2;
|
|
10789
|
+
}
|
|
10790
|
+
/**
|
|
10628
10791
|
* The attempt on this connection failed (it timed out, ICE failed or closed, its channel closed). An answer the
|
|
10629
10792
|
* offerer may not have read yet is made again for the same offer while it still stands (`REANSWERS`); anything
|
|
10630
10793
|
* else goes back to idle. `byConnection`: the connection said so itself, rather than a timer of this link's.
|
|
@@ -10709,6 +10872,7 @@ var DataLink = class {
|
|
|
10709
10872
|
*/
|
|
10710
10873
|
async gathered(offer, describe) {
|
|
10711
10874
|
let stalled = null;
|
|
10875
|
+
this.gatherStalls = 0;
|
|
10712
10876
|
for (let attempt = 1;; attempt++) {
|
|
10713
10877
|
const pc = this.createConnection();
|
|
10714
10878
|
if (stalled) this.closeConnection(stalled);
|
|
@@ -10728,6 +10892,7 @@ var DataLink = class {
|
|
|
10728
10892
|
offer,
|
|
10729
10893
|
...attempt > 1 ? { attempt } : {}
|
|
10730
10894
|
});
|
|
10895
|
+
this.gatherStalls = 0;
|
|
10731
10896
|
return pc;
|
|
10732
10897
|
}
|
|
10733
10898
|
traceLink(this.options.myPubKeyZ32, "ice-stalled", {
|
|
@@ -10741,6 +10906,7 @@ var DataLink = class {
|
|
|
10741
10906
|
return null;
|
|
10742
10907
|
}
|
|
10743
10908
|
stalled = pc;
|
|
10909
|
+
this.gatherStalls = attempt;
|
|
10744
10910
|
}
|
|
10745
10911
|
}
|
|
10746
10912
|
createConnection() {
|
|
@@ -10818,6 +10984,7 @@ var DataLink = class {
|
|
|
10818
10984
|
this.myOfferTs = this.myOfferOutAt = 0;
|
|
10819
10985
|
this.answerCameLate = false;
|
|
10820
10986
|
this.remoteSdp = null;
|
|
10987
|
+
this.gatherStalls = 0;
|
|
10821
10988
|
if (!pc) return false;
|
|
10822
10989
|
this.closeConnection(pc);
|
|
10823
10990
|
return true;
|
|
@@ -12708,6 +12875,17 @@ var LINK_CLOSERS = {
|
|
|
12708
12875
|
var LINK_STOP = /[、。〈-】!(),:;?،؛؟۔]/;
|
|
12709
12876
|
/** What a link leaves out at its end: a sentence's punctuation ("…", "»", "”" too), never a path's "/". */
|
|
12710
12877
|
var LINK_TRAILING = /[.,;:!?'"*_>…»’”]/;
|
|
12878
|
+
/**
|
|
12879
|
+
* What a chat puts right after a link with no space and no address ends with: an emoji ("https://x.example/a🔥", with
|
|
12880
|
+
* its skin tone, presentation selector, joiners and flag tags) and characters that draw as nothing. Read one code point
|
|
12881
|
+
* at a time from the end, so an emoji inside an address stays in it.
|
|
12882
|
+
*/
|
|
12883
|
+
var LINK_TAIL = /^(?:\p{Extended_Pictographic}|\p{Emoji_Modifier}|\p{Regional_Indicator}|[\u200b\u200c\u2060\ufeff\u{e0020}-\u{e007f}]|\u200d|\ufe0e|\ufe0f)$/u;
|
|
12884
|
+
/** How many UTF-16 units of `url` before `end` are an emoji's or an invisible character's last code point (0: none). */
|
|
12885
|
+
function linkTail(url, end) {
|
|
12886
|
+
const units = end > 1 && /[\udc00-\udfff]/.test(url[end - 1]) && /[\ud800-\udbff]/.test(url[end - 2]) ? 2 : 1;
|
|
12887
|
+
return end > 0 && LINK_TAIL.test(url.slice(end - units, end)) ? units : 0;
|
|
12888
|
+
}
|
|
12711
12889
|
/** A link up to the first `LINK_STOP`: "https://x.example/a。" opens /a, not /a%E3%80%82. */
|
|
12712
12890
|
function linkStop(url) {
|
|
12713
12891
|
const at = url.search(LINK_STOP);
|
|
@@ -12715,10 +12893,20 @@ function linkStop(url) {
|
|
|
12715
12893
|
}
|
|
12716
12894
|
/**
|
|
12717
12895
|
* A link ends where the sentence around it takes over: trailing punctuation ("see https://x.example/a.", in any of
|
|
12718
|
-
* the app's languages) and a closing bracket or quote the link did not
|
|
12719
|
-
* text. The same rule as the message bubble's links.
|
|
12896
|
+
* the app's languages), an emoji or invisible character (`linkTail`) and a closing bracket or quote the link did not
|
|
12897
|
+
* open ("(https://x.example/a)") are left as text. The same rule as the message bubble's links.
|
|
12720
12898
|
*/
|
|
12721
12899
|
function linkEnd(whole) {
|
|
12900
|
+
return trimEnd(whole, true);
|
|
12901
|
+
}
|
|
12902
|
+
/**
|
|
12903
|
+
* A payment link (`bitcoin:`, `monero:`…) ends as a web link does, but keeps an emoji at its end: its label or message
|
|
12904
|
+
* is text written as it is ("…&label=Pizza 🍕"), cut at 140 characters wherever that falls.
|
|
12905
|
+
*/
|
|
12906
|
+
function uriEnd(whole) {
|
|
12907
|
+
return trimEnd(whole, false);
|
|
12908
|
+
}
|
|
12909
|
+
function trimEnd(whole, tails) {
|
|
12722
12910
|
const url = linkStop(whole);
|
|
12723
12911
|
const count = {
|
|
12724
12912
|
"(": 0,
|
|
@@ -12733,6 +12921,11 @@ function linkEnd(whole) {
|
|
|
12733
12921
|
while (end > 0) {
|
|
12734
12922
|
const last = url[end - 1];
|
|
12735
12923
|
const opener = LINK_CLOSERS[last];
|
|
12924
|
+
const tail = tails ? linkTail(url, end) : 0;
|
|
12925
|
+
if (tail) {
|
|
12926
|
+
end -= tail;
|
|
12927
|
+
continue;
|
|
12928
|
+
}
|
|
12736
12929
|
if (!LINK_TRAILING.test(last) && !(opener && count[last] > count[opener])) break;
|
|
12737
12930
|
if (opener) count[last]--;
|
|
12738
12931
|
end--;
|
|
@@ -16741,7 +16934,7 @@ async function verifyPeerProof(event, c, readStorage) {
|
|
|
16741
16934
|
if (sig.length !== 64 || !verify(sig, data, fromZ32(c.externalKey))) throw new Error("Invalid Pubky signature");
|
|
16742
16935
|
} else if (c.adapter === "keet-import") {
|
|
16743
16936
|
if (sig.length !== 107 || sig[0] !== 1 || sig[41] !== 0 || sig[42] !== 1) throw new Error("Unsupported Keet attestation");
|
|
16744
|
-
const { default: IdentityKey } = await import("./keet-identity-key-
|
|
16937
|
+
const { default: IdentityKey } = await import("./keet-identity-key-DLXTTFZH.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
|
|
16745
16938
|
if (!IdentityKey.verify(b4a.from(sig), b4a.from(data), { expectedIdentity: b4a.from(unhex(c.externalKey)) })) throw new Error("Invalid Keet attestation");
|
|
16746
16939
|
} else throw new Error("Unsupported proof adapter");
|
|
16747
16940
|
}
|
|
@@ -19278,9 +19471,6 @@ var RateWindows = class {
|
|
|
19278
19471
|
prune(now) {
|
|
19279
19472
|
for (const [app, window] of this.windows) if (!window.length || now - window[window.length - 1] >= 1e3) this.windows.delete(app);
|
|
19280
19473
|
}
|
|
19281
|
-
clear() {
|
|
19282
|
-
this.windows.clear();
|
|
19283
|
-
}
|
|
19284
19474
|
};
|
|
19285
19475
|
/**
|
|
19286
19476
|
* The apps of one chat on its live sessions. `open` (this side's apps, by chat app id, with their versions) lasts
|
|
@@ -19345,7 +19535,8 @@ var AppSessions = class {
|
|
|
19345
19535
|
}
|
|
19346
19536
|
/**
|
|
19347
19537
|
* The session ended, or `apps/1` is no longer agreed: what the peer had open is gone, and each such app hears a
|
|
19348
|
-
* `close` with `offline`. This side's open apps stay, and say `open` again on the next session.
|
|
19538
|
+
* `close` with `offline`. This side's open apps stay, and say `open` again on the next session. The rate windows
|
|
19539
|
+
* stay too: they are the contact's per app, or turning `apps/1` off and on would give each app a new 50.
|
|
19349
19540
|
*/
|
|
19350
19541
|
sessionEnded() {
|
|
19351
19542
|
const closed = [.../* @__PURE__ */ new Set([...this.held.keys(), ...this.peer.keys()])].map((app) => ({
|
|
@@ -19355,14 +19546,13 @@ var AppSessions = class {
|
|
|
19355
19546
|
}));
|
|
19356
19547
|
this.peer.clear();
|
|
19357
19548
|
this.held.clear();
|
|
19358
|
-
this.received.clear();
|
|
19359
|
-
this.sent.clear();
|
|
19360
19549
|
return closed;
|
|
19361
19550
|
}
|
|
19362
19551
|
/**
|
|
19363
19552
|
* The session ended or was replaced, and another may follow at once: what the peer had open is held, not closed (no
|
|
19364
19553
|
* event now). Nothing is sent to a held app; an `open` on the next session takes it back, a `close` closes it, and
|
|
19365
|
-
* `heldExpired` closes the rest once `graceMs` has passed since the suspension that held each.
|
|
19554
|
+
* `heldExpired` closes the rest once `graceMs` has passed since the suspension that held each. The rate windows stay,
|
|
19555
|
+
* as in `sessionEnded`.
|
|
19366
19556
|
*/
|
|
19367
19557
|
sessionSuspended(graceMs = APP_RESUME_GRACE_MS) {
|
|
19368
19558
|
const until = this.now() + graceMs;
|
|
@@ -19371,8 +19561,6 @@ var AppSessions = class {
|
|
|
19371
19561
|
until
|
|
19372
19562
|
});
|
|
19373
19563
|
this.peer.clear();
|
|
19374
|
-
this.received.clear();
|
|
19375
|
-
this.sent.clear();
|
|
19376
19564
|
}
|
|
19377
19565
|
/** Whether any of the peer's apps is held, waiting for its next session. */
|
|
19378
19566
|
get holding() {
|
|
@@ -19656,6 +19844,8 @@ var AppRanges = class {
|
|
|
19656
19844
|
newServeId;
|
|
19657
19845
|
now;
|
|
19658
19846
|
serves = /* @__PURE__ */ new Map();
|
|
19847
|
+
/** The same serves by app, then file: an app may serve 100,000 files, and walking `serves` for each was O(n²). */
|
|
19848
|
+
servesByApp = /* @__PURE__ */ new Map();
|
|
19659
19849
|
serving = /* @__PURE__ */ new Map();
|
|
19660
19850
|
/**
|
|
19661
19851
|
* Tasks cancelled, unserved, or stopped by the contact's close or a session's end, that this side is still reading or
|
|
@@ -19685,25 +19875,33 @@ var AppRanges = class {
|
|
|
19685
19875
|
*/
|
|
19686
19876
|
serve(app, file) {
|
|
19687
19877
|
if (!isChatAppId(app)) throw new Error("Not a chat app id");
|
|
19688
|
-
|
|
19878
|
+
const files = this.servesByApp.get(app) ?? /* @__PURE__ */ new Map();
|
|
19879
|
+
const served = files.get(file);
|
|
19880
|
+
if (served !== void 0) return served;
|
|
19689
19881
|
let id = this.newServeId();
|
|
19690
19882
|
while (this.serves.has(id)) id = this.newServeId();
|
|
19691
19883
|
this.serves.set(id, {
|
|
19692
19884
|
app,
|
|
19693
19885
|
file
|
|
19694
19886
|
});
|
|
19887
|
+
files.set(file, id);
|
|
19888
|
+
this.servesByApp.set(app, files);
|
|
19695
19889
|
return id;
|
|
19696
19890
|
}
|
|
19697
19891
|
/** Ends one serve: requests under it still being sent stop. False when it was not served. */
|
|
19698
19892
|
unserve(serveId) {
|
|
19699
|
-
|
|
19893
|
+
const serve = this.serves.get(serveId);
|
|
19894
|
+
if (!serve) return false;
|
|
19700
19895
|
this.serves.delete(serveId);
|
|
19896
|
+
const files = this.servesByApp.get(serve.app);
|
|
19897
|
+
files.delete(serve.file);
|
|
19898
|
+
if (!files.size) this.servesByApp.delete(serve.app);
|
|
19701
19899
|
for (const task of this.serving.values()) if (task.serve === serveId) this.drop(task, true);
|
|
19702
19900
|
return true;
|
|
19703
19901
|
}
|
|
19704
19902
|
/** The serve ids `app` has given out and not ended (what the panel's "Sharing with" line shows). */
|
|
19705
19903
|
servesOf(app) {
|
|
19706
|
-
return [...this.
|
|
19904
|
+
return [...this.servesByApp.get(app)?.values() ?? []];
|
|
19707
19905
|
}
|
|
19708
19906
|
/** An `ar-get` from the contact: the task to read and send, or null when it was refused (the refusal is sent) or dropped. */
|
|
19709
19907
|
receiveGet(frame) {
|
|
@@ -19836,14 +20034,15 @@ var AppRanges = class {
|
|
|
19836
20034
|
* them now.
|
|
19837
20035
|
*/
|
|
19838
20036
|
closeApp(app, error = "peer-closed", stopped = false) {
|
|
19839
|
-
for (const
|
|
20037
|
+
for (const id of this.servesByApp.get(app)?.values() ?? []) this.serves.delete(id);
|
|
20038
|
+
this.servesByApp.delete(app);
|
|
19840
20039
|
for (const key of [...this.sizes.keys()]) if (key.startsWith(`${app} `)) this.sizes.delete(key);
|
|
19841
20040
|
this.endRequests(app, error, stopped);
|
|
19842
20041
|
}
|
|
19843
20042
|
/** The session ended: no serve id lasts into the next, and every request fails with `offline`. Tasks still being read keep their places into the next. */
|
|
19844
20043
|
reset() {
|
|
19845
20044
|
this.sizes.clear();
|
|
19846
|
-
for (const app of
|
|
20045
|
+
for (const app of [...this.servesByApp.keys()]) this.closeApp(app, "offline");
|
|
19847
20046
|
this.suspend();
|
|
19848
20047
|
}
|
|
19849
20048
|
/**
|
|
@@ -22822,9 +23021,10 @@ function mergeLobby(existing, mine, now = Date.now()) {
|
|
|
22822
23021
|
function freshHubs(hubs, now = Date.now()) {
|
|
22823
23022
|
return hubs.filter((h) => now - h.ts < COMMUNITY_TOPOLOGY.beaconFreshMs && h.ts <= now + 6e4);
|
|
22824
23023
|
}
|
|
23024
|
+
var rankHash = (subject, hubKey) => sha256(concatBytes(utf8Encode("ghostly-group-community/1 rank"), publicKeyFromZ32(subject), publicKeyFromZ32(hubKey)));
|
|
22825
23025
|
/** Rendezvous hashing: how strongly a hub is responsible for someone (a knock, a member). Highest first. */
|
|
22826
23026
|
function hubRank(subject, hubKey) {
|
|
22827
|
-
return toBase64Url(
|
|
23027
|
+
return toBase64Url(rankHash(subject, hubKey));
|
|
22828
23028
|
}
|
|
22829
23029
|
function rankHubs(subject, hubs) {
|
|
22830
23030
|
return [...hubs].sort((a, b) => {
|
|
@@ -22833,12 +23033,25 @@ function rankHubs(subject, hubs) {
|
|
|
22833
23033
|
});
|
|
22834
23034
|
}
|
|
22835
23035
|
/**
|
|
22836
|
-
* The hubs a member asks for edges:
|
|
22837
|
-
*
|
|
23036
|
+
* The hubs a member asks for edges: fresh ones with room, at most `hubsPerMember`, by rendezvous hashing weighted by
|
|
23037
|
+
* the room each has left, so the members picking at once spread over the hubs in proportion to it. The members a
|
|
23038
|
+
* closing hub carried all pick in the same second: each took the least loaded hub, all of them the same one, which
|
|
23039
|
+
* opened their 12 or 16 edges at once on its relays' budget and brought none up for minutes, then the next hub did the
|
|
23040
|
+
* same, and 6 of them stepped up as hubs with nobody on them (36 members, bug hunt, 2026-11-11).
|
|
22838
23041
|
*/
|
|
22839
23042
|
function pickHubs(me, hubs, now = Date.now(), avoid = /* @__PURE__ */ new Set()) {
|
|
22840
23043
|
const lately = (h) => now - h.ts < COMMUNITY_TOPOLOGY.beaconEveryMs * 1.5 ? 0 : 1;
|
|
22841
|
-
return freshHubs(hubs, now).filter((h) => h.key !== me && !avoid.has(h.key) && h.load < COMMUNITY_TOPOLOGY.hubCapacity).
|
|
23044
|
+
return freshHubs(hubs, now).filter((h) => h.key !== me && !avoid.has(h.key) && h.load < COMMUNITY_TOPOLOGY.hubCapacity).map((h) => ({
|
|
23045
|
+
key: h.key,
|
|
23046
|
+
lately: lately(h),
|
|
23047
|
+
score: spreadScore(me, h)
|
|
23048
|
+
})).sort((a, b) => a.lately - b.lately || b.score - a.score).slice(0, COMMUNITY_TOPOLOGY.hubsPerMember).map((h) => h.key);
|
|
23049
|
+
}
|
|
23050
|
+
/** Weighted rendezvous hashing: room / -ln(u), u in (0, 1) from this member's rank of the hub; the highest is picked. */
|
|
23051
|
+
function spreadScore(me, hub) {
|
|
23052
|
+
const r = rankHash(me, hub.key);
|
|
23053
|
+
const u = (r[0] * 65536 + r[1] * 256 + r[2] + .5) / 16777216;
|
|
23054
|
+
return (COMMUNITY_TOPOLOGY.hubCapacity - hub.load) / -Math.log(u);
|
|
22842
23055
|
}
|
|
22843
23056
|
/** Should this member be a hub? Too few fresh hubs, or all full, and room in the beacon. */
|
|
22844
23057
|
function shouldBeHub(me, hubs, now = Date.now()) {
|
|
@@ -23869,6 +24082,12 @@ var BLOCKED_DIAL_WAIT_MS = 1e4;
|
|
|
23869
24082
|
*/
|
|
23870
24083
|
var UNPROVEN_AUTH_MS = 15e3;
|
|
23871
24084
|
/**
|
|
24085
|
+
* Connections dialled in that authenticate at once beside the one waiting to take over (`contend`). Whoever read the
|
|
24086
|
+
* endpoint and dials it over and over pushes out only the oldest of them: the contact's, a few round trips long, is
|
|
24087
|
+
* pushed out only by this many dials within those round trips.
|
|
24088
|
+
*/
|
|
24089
|
+
var DIALED_IN_CONTENDERS = 8;
|
|
24090
|
+
/**
|
|
23872
24091
|
* A native connection this side dialled that has not authenticated this long after it opened, while the contact's
|
|
23873
24092
|
* record names a newer way to dial it: the dial went to an old address (the web app's Iroh homed on another relay after
|
|
23874
24093
|
* a restart), and the chat dials the new one at once. Sooner, it is a handshake still under way.
|
|
@@ -23888,6 +24107,14 @@ var RACE_DIRECT_MS = 8e3;
|
|
|
23888
24107
|
*/
|
|
23889
24108
|
var RACE_RELAYED_MS = 4e4;
|
|
23890
24109
|
/**
|
|
24110
|
+
* A relayed transport dialled ahead of the others (Automatic's Iroh through its relay, WISP 100 revision 2026-11-08) has
|
|
24111
|
+
* this long before the next ranked one is dialled too, the first still going: whichever goes live first carries the
|
|
24112
|
+
* chat. Through a relay that answers it connects well within it (0.1-0.9 s measured); one that reaches nobody (the
|
|
24113
|
+
* relay down, the contact no longer on it) gives up only at Iroh's connect timeout, 20 s, and held the WebRTC offer back
|
|
24114
|
+
* that long at every return: 26-30 s to live between two CLIs with the Iroh relay down, 4 s with WebRTC chosen.
|
|
24115
|
+
*/
|
|
24116
|
+
var RELAYED_FIRST_MS = 3e3;
|
|
24117
|
+
/**
|
|
23891
24118
|
* A WebRTC offer this side made that was answered, and has not connected this long after the answer was applied: where
|
|
23892
24119
|
* a path exists ICE finds it in a second or two, so there is none (a VPN's NAT, a firewall that drops UDP, and no TURN
|
|
23893
24120
|
* server), and every transport ranked after WebRTC is dialled now, the relayed ones too, the attempt still standing.
|
|
@@ -24208,6 +24435,11 @@ var GhostLink = class {
|
|
|
24208
24435
|
switcher;
|
|
24209
24436
|
/** `plan`: a switch both sides agreed; without one, a replacement the contact dialled (`attachReplacement`). */
|
|
24210
24437
|
candidate = null;
|
|
24438
|
+
/**
|
|
24439
|
+
* Connections that authenticate beside a `candidate` dialled in and unproven (`contend`), oldest first: whichever
|
|
24440
|
+
* authenticates first takes over, so one that never does neither holds the place nor takes it from the contact's.
|
|
24441
|
+
*/
|
|
24442
|
+
contenders = [];
|
|
24211
24443
|
candidateEpoch = 0;
|
|
24212
24444
|
/** The native dial a transport change has in flight, per transport (`prepareSwitch`). */
|
|
24213
24445
|
switchDials = /* @__PURE__ */ new Map();
|
|
@@ -24360,7 +24592,8 @@ var GhostLink = class {
|
|
|
24360
24592
|
/**
|
|
24361
24593
|
* The WebRTC offer this side's dial made last, with fallback allowed: what a transport that comes up meanwhile joins.
|
|
24362
24594
|
* `resume`: the dial that made it is this side back after an absence, over WebRTC (`resuming`); `woke`: the absence
|
|
24363
|
-
* was the app's in the background, not a restart (`resumeAfterAbsence`).
|
|
24595
|
+
* was the app's in the background, not a restart (`resumeAfterAbsence`). `knockMissed`: the dial that made it followed a
|
|
24596
|
+
* resume's knock that found nothing (`resumeKnockMissed`).
|
|
24364
24597
|
*/
|
|
24365
24598
|
offered;
|
|
24366
24599
|
/**
|
|
@@ -24371,6 +24604,10 @@ var GhostLink = class {
|
|
|
24371
24604
|
/** The attempt (its epoch) whose direct transports were knocked on as its offer went out (`knockEarly`), and whether that is under way. */
|
|
24372
24605
|
knockedEarly = -1;
|
|
24373
24606
|
knockingEarly = false;
|
|
24607
|
+
/** The attempt (its epoch) of a resume over WebRTC whose offer Iroh joined, its endpoint up only after the dial (`joinRace`). */
|
|
24608
|
+
irohJoinedResume = -1;
|
|
24609
|
+
/** The same for HyperDHT (direct, and already in the race's `afterRtc`). */
|
|
24610
|
+
hyperdhtJoinedResume = -1;
|
|
24374
24611
|
/** When this side's offer's answer was applied (`RACE_ANSWERED_MS`); 0 while the data link is not connecting on it. */
|
|
24375
24612
|
answeredAt = 0;
|
|
24376
24613
|
/** This side's offer is out unanswered, or answered and not connected yet: what is ranked after WebRTC may race it. */
|
|
@@ -24486,6 +24723,8 @@ var GhostLink = class {
|
|
|
24486
24723
|
resumeWaitUntil = 0;
|
|
24487
24724
|
/** The contact's other native transports were knocked on while this resume waited (`knockWhileResuming`). */
|
|
24488
24725
|
resumeKnocked = false;
|
|
24726
|
+
/** The resume's knock found nothing (`knock`): the next dial is still the resume's, made whatever the key. */
|
|
24727
|
+
resumeKnockMissed = false;
|
|
24489
24728
|
/** What the last live session ran on, kept after it ended: a wake resumes on it (`resumeAfterAbsence`). */
|
|
24490
24729
|
lastLiveOn;
|
|
24491
24730
|
/** `resuming` is a wake's, not a restart's. */
|
|
@@ -24716,7 +24955,7 @@ var GhostLink = class {
|
|
|
24716
24955
|
if (isDiscoveryBudgetError(error)) return;
|
|
24717
24956
|
if (!signal || !options.params.profile) return;
|
|
24718
24957
|
this.signalPublishFailed = true;
|
|
24719
|
-
|
|
24958
|
+
this.sayPairingState({
|
|
24720
24959
|
status: "error",
|
|
24721
24960
|
error: publishFailure(error)
|
|
24722
24961
|
});
|
|
@@ -24972,7 +25211,7 @@ var GhostLink = class {
|
|
|
24972
25211
|
} else if (credentials?.requireSignedSignals && !this.isDataLinkOpen) {
|
|
24973
25212
|
this.securityRejected = true;
|
|
24974
25213
|
this.tracker?.failed("rejected", false);
|
|
24975
|
-
|
|
25214
|
+
this.sayPairingState({
|
|
24976
25215
|
status: "error",
|
|
24977
25216
|
keyMismatch: false,
|
|
24978
25217
|
error: "Ignored an unauthenticated discovery signal. Keep both peers on the updated version; the saved key has not been replaced."
|
|
@@ -25064,7 +25303,7 @@ var GhostLink = class {
|
|
|
25064
25303
|
if (this.stopped || this.keyStopped || this.securityRejected) return;
|
|
25065
25304
|
if (this.streamBlocked) this.emitDeliveryState();
|
|
25066
25305
|
else if (this.paired?.state) this.emitPairingState();
|
|
25067
|
-
else this.
|
|
25306
|
+
else this.sayPairingState({ status: "connecting" });
|
|
25068
25307
|
}
|
|
25069
25308
|
emitPairingState() {
|
|
25070
25309
|
this.syncWait();
|
|
@@ -25081,7 +25320,7 @@ var GhostLink = class {
|
|
|
25081
25320
|
if (!open) this.pairedFiles?.closeAll();
|
|
25082
25321
|
this.options.events?.onDataLinkState?.(open ? "open" : "idle");
|
|
25083
25322
|
}
|
|
25084
|
-
this.
|
|
25323
|
+
this.sayPairingState({
|
|
25085
25324
|
...state,
|
|
25086
25325
|
...blocked ? {
|
|
25087
25326
|
status: this.transitionError ? "error" : "negotiating",
|
|
@@ -25168,17 +25407,36 @@ var GhostLink = class {
|
|
|
25168
25407
|
this.session.setActive(active);
|
|
25169
25408
|
this.dht?.setActive(active);
|
|
25170
25409
|
}
|
|
25410
|
+
/**
|
|
25411
|
+
* What `emitDeliveryState` said last, cleared by any other pairing state: every mailbox read and publication of a
|
|
25412
|
+
* DHT-only chat asks for it again, and one that changed nothing builds no engine state (bug hunt 1109-chat-perf).
|
|
25413
|
+
*/
|
|
25414
|
+
saidDeliveryState;
|
|
25415
|
+
sayPairingState(state) {
|
|
25416
|
+
this.saidDeliveryState = void 0;
|
|
25417
|
+
this.options.events?.onPairingState?.(state);
|
|
25418
|
+
}
|
|
25171
25419
|
emitDeliveryState() {
|
|
25172
25420
|
if (!this.streamBlocked) return;
|
|
25173
25421
|
const credentials = this.options.pairing?.credentials;
|
|
25174
25422
|
const error = this.dht?.view.error;
|
|
25175
|
-
|
|
25423
|
+
const state = {
|
|
25176
25424
|
status: error ? "error" : credentials?.peerKey ? "ready" : "connecting",
|
|
25177
25425
|
peerKey: credentials?.peerKey,
|
|
25178
25426
|
code: this.dht?.comparisonCode,
|
|
25179
25427
|
verified: !!credentials?.peerKey && credentials.verifiedPeerKey === credentials.peerKey,
|
|
25180
25428
|
error
|
|
25181
|
-
}
|
|
25429
|
+
};
|
|
25430
|
+
const said = JSON.stringify([
|
|
25431
|
+
state.status,
|
|
25432
|
+
state.peerKey,
|
|
25433
|
+
state.code,
|
|
25434
|
+
state.verified,
|
|
25435
|
+
state.error
|
|
25436
|
+
]);
|
|
25437
|
+
if (said === this.saidDeliveryState) return;
|
|
25438
|
+
this.saidDeliveryState = said;
|
|
25439
|
+
this.options.events?.onPairingState?.(state);
|
|
25182
25440
|
}
|
|
25183
25441
|
async setDeliveryMode(mode) {
|
|
25184
25442
|
if (!this.dht) throw new Error("DHT delivery is unavailable for this conversation.");
|
|
@@ -25289,7 +25547,7 @@ var GhostLink = class {
|
|
|
25289
25547
|
if (epoch !== this.connectionEpoch) return;
|
|
25290
25548
|
const message = error instanceof Error ? error.message : String(error);
|
|
25291
25549
|
this.tracker?.failed("transport", true, message);
|
|
25292
|
-
if (!this.dialFailed(message)) this.
|
|
25550
|
+
if (!this.dialFailed(message)) this.sayPairingState({
|
|
25293
25551
|
status: "error",
|
|
25294
25552
|
error: message
|
|
25295
25553
|
});
|
|
@@ -25863,9 +26121,15 @@ var GhostLink = class {
|
|
|
25863
26121
|
* holds the old session and would notice only when its liveness gives up (a minute); a dial reaches it now and takes
|
|
25864
26122
|
* over (`attachReplacement`). Once only, and a knock that does not connect counts as no failure: the contact may
|
|
25865
26123
|
* simply be away. Two dials crossing are settled by key order (see `registerEndpoint`).
|
|
26124
|
+
*
|
|
26125
|
+
* A resume's knock that does not connect leaves its dial whatever the key to the next one (`resumeKnockMissed`), whose
|
|
26126
|
+
* offer knocks on the contact's other transports (`knockMissed`): a contact holding the old session over HyperDHT
|
|
26127
|
+
* announces no listener (endpoint.mjs), so the knock finds nothing, and the higher key waited for the contact to
|
|
26128
|
+
* notice (14.5-15.2 s between two CLI daemons, against 0.8-1.6 s with the lower key; under 5 s now).
|
|
25866
26129
|
*/
|
|
25867
26130
|
async knock(transport) {
|
|
25868
|
-
|
|
26131
|
+
const resume = this.resuming === transport;
|
|
26132
|
+
if (resume) {
|
|
25869
26133
|
this.resuming = void 0;
|
|
25870
26134
|
this.resumingWoke = false;
|
|
25871
26135
|
}
|
|
@@ -25892,6 +26156,7 @@ var GhostLink = class {
|
|
|
25892
26156
|
transport,
|
|
25893
26157
|
error: error instanceof Error ? error.message : String(error)
|
|
25894
26158
|
});
|
|
26159
|
+
if (resume && epoch === this.connectionEpoch) this.resumeKnockMissed = true;
|
|
25895
26160
|
} finally {
|
|
25896
26161
|
if (this.knocking === knocking) this.knocking = null;
|
|
25897
26162
|
if (epoch === this.connectionEpoch) {
|
|
@@ -26057,12 +26322,14 @@ var GhostLink = class {
|
|
|
26057
26322
|
return;
|
|
26058
26323
|
}
|
|
26059
26324
|
this.dialing = true;
|
|
26325
|
+
const knockMissed = this.resumeKnockMissed;
|
|
26326
|
+
this.resumeKnockMissed = false;
|
|
26060
26327
|
const epoch = this.connectionEpoch;
|
|
26061
26328
|
this.attempt = {
|
|
26062
26329
|
side: "dialled",
|
|
26063
26330
|
failed: []
|
|
26064
26331
|
};
|
|
26065
|
-
this.
|
|
26332
|
+
this.sayPairingState({ status: "connecting" });
|
|
26066
26333
|
try {
|
|
26067
26334
|
const local = this.transportOffer();
|
|
26068
26335
|
const relayed = relayedTransports(this.localDescriptors(), this.peerDescriptors);
|
|
@@ -26085,6 +26352,7 @@ var GhostLink = class {
|
|
|
26085
26352
|
const now = Date.now(), demoted = (t) => (this.demotedUntil.get(t) ?? 0) > now;
|
|
26086
26353
|
const ordered = choices.length > 1 ? [...choices.filter((t) => !demoted(t)), ...choices.filter(demoted)] : choices;
|
|
26087
26354
|
const failedFirst = [];
|
|
26355
|
+
let ahead;
|
|
26088
26356
|
for (const [index, transport] of ordered.entries()) {
|
|
26089
26357
|
if (index > 0 && !fallback) break;
|
|
26090
26358
|
if (transport === "webrtc/1") {
|
|
@@ -26099,7 +26367,8 @@ var GhostLink = class {
|
|
|
26099
26367
|
epoch,
|
|
26100
26368
|
at: offeredAt,
|
|
26101
26369
|
...resume && { resume },
|
|
26102
|
-
...woke && { woke }
|
|
26370
|
+
...woke && { woke },
|
|
26371
|
+
...knockMissed && { knockMissed }
|
|
26103
26372
|
} : void 0;
|
|
26104
26373
|
this.offerMade = {
|
|
26105
26374
|
epoch,
|
|
@@ -26131,11 +26400,28 @@ var GhostLink = class {
|
|
|
26131
26400
|
for (const joined of next.rest) if (!ordered.includes(joined)) ordered.push(joined);
|
|
26132
26401
|
continue;
|
|
26133
26402
|
}
|
|
26134
|
-
const
|
|
26403
|
+
const dialled = this.dialNative(transport, epoch);
|
|
26404
|
+
let result;
|
|
26405
|
+
if (fallback && !ahead && index < ordered.length - 1 && relayed.includes(transport)) {
|
|
26406
|
+
let headStart;
|
|
26407
|
+
result = await Promise.race([dialled, new Promise((resolve) => {
|
|
26408
|
+
headStart = setTimeout(() => resolve("slow"), RELAYED_FIRST_MS);
|
|
26409
|
+
})]);
|
|
26410
|
+
clearTimeout(headStart);
|
|
26411
|
+
if (result === "slow") {
|
|
26412
|
+
ahead = dialled;
|
|
26413
|
+
continue;
|
|
26414
|
+
}
|
|
26415
|
+
} else result = await dialled;
|
|
26135
26416
|
if (result === true) return;
|
|
26136
26417
|
lastError = result;
|
|
26137
26418
|
failedFirst.push(transport);
|
|
26138
26419
|
}
|
|
26420
|
+
if (ahead) {
|
|
26421
|
+
const result = await ahead;
|
|
26422
|
+
if (result === true) return;
|
|
26423
|
+
lastError = result;
|
|
26424
|
+
}
|
|
26139
26425
|
throw lastError ?? /* @__PURE__ */ new Error("No permitted transport could connect");
|
|
26140
26426
|
} catch (error) {
|
|
26141
26427
|
if (epoch === this.connectionEpoch) this.attemptEnded(error instanceof Error ? error.message : String(error));
|
|
@@ -26283,7 +26569,7 @@ var GhostLink = class {
|
|
|
26283
26569
|
const answered = this.answeredAt ? this.answeredAt + RACE_ANSWERED_MS : Infinity;
|
|
26284
26570
|
const at = next.rest.filter((t) => t !== "webrtc/1").map((t) => Math.max(Math.min(offeredAt + (relayed.includes(t) ? RACE_RELAYED_MS : RACE_DIRECT_MS), answered), this.canDial(t) ? 0 : now + RACE_RETRY_MS));
|
|
26285
26571
|
if (!at.length) return;
|
|
26286
|
-
if (this.offered?.resume && this.knockedEarly !== epoch) setTimeout(() => this.maybeKnockEarly(epoch), 0);
|
|
26572
|
+
if ((this.offered?.resume || this.offered?.knockMissed) && this.knockedEarly !== epoch) setTimeout(() => this.maybeKnockEarly(epoch), 0);
|
|
26287
26573
|
this.raceTimer = setTimeout(() => {
|
|
26288
26574
|
this.raceTimer = null;
|
|
26289
26575
|
this.race(epoch, offeredAt);
|
|
@@ -26368,13 +26654,20 @@ var GhostLink = class {
|
|
|
26368
26654
|
contactQuiet(ms = EXPECT_PEER_MS) {
|
|
26369
26655
|
return Date.now() - presenceSeenAt(this.session.peerPresence) >= ms;
|
|
26370
26656
|
}
|
|
26371
|
-
/**
|
|
26657
|
+
/**
|
|
26658
|
+
* The direct transports of an attempt that resumes to a quiet contact, knocked on while its offer stands (`scheduleRace`).
|
|
26659
|
+
* So are those of the dial after a resume's knock that found nothing (`knockMissed`), relayed ones too, whatever the
|
|
26660
|
+
* contact's newest packet: it holds the old session and reads offers at a live chat's pace.
|
|
26661
|
+
*/
|
|
26372
26662
|
maybeKnockEarly(epoch) {
|
|
26373
|
-
const next = this.afterRtc;
|
|
26374
|
-
if (!this.offered?.resume || this.offered
|
|
26375
|
-
if (this.dialing || this.channel || this.stopped || !this.offerOut
|
|
26376
|
-
const
|
|
26377
|
-
const
|
|
26663
|
+
const next = this.afterRtc, missed = !!this.offered?.knockMissed;
|
|
26664
|
+
if (!(this.offered?.resume || missed) || this.offered?.epoch !== epoch || this.knockedEarly === epoch || next?.epoch !== epoch || epoch !== this.connectionEpoch) return;
|
|
26665
|
+
if (this.dialing || this.channel || this.stopped || !this.offerOut) return;
|
|
26666
|
+
const iroh = !missed && this.irohJoinedResume === epoch && this.irohRanksFirst();
|
|
26667
|
+
const hyperdht = !missed && this.hyperdhtJoinedResume === epoch && next.rest.includes("hyperdht/1") && !this.relayedTransports.includes("hyperdht/1") && this.canDial("hyperdht/1");
|
|
26668
|
+
if (!iroh && !hyperdht && !(missed || this.offered.woke || this.contactQuiet())) return;
|
|
26669
|
+
const relayed = missed || this.upgradesFromRelay() ? [] : this.relayedTransports;
|
|
26670
|
+
const direct = iroh || hyperdht ? [...iroh ? ["iroh/1"] : [], ...hyperdht ? ["hyperdht/1"] : []] : next.rest.filter((t) => !relayed.includes(t) && this.canDial(t));
|
|
26378
26671
|
if (!direct.length) return;
|
|
26379
26672
|
this.knockedEarly = epoch;
|
|
26380
26673
|
this.knockEarly(epoch, direct);
|
|
@@ -26421,8 +26714,20 @@ var GhostLink = class {
|
|
|
26421
26714
|
rest: [...rest, transport]
|
|
26422
26715
|
};
|
|
26423
26716
|
traceLink(this.myPubKeyZ32, "race-join", { transport });
|
|
26717
|
+
if (offered.resume && transport === "iroh/1") this.irohJoinedResume = offered.epoch;
|
|
26718
|
+
if (offered.resume && transport === "hyperdht/1") this.hyperdhtJoinedResume = offered.epoch;
|
|
26719
|
+
if (offered.knockMissed && this.canDial(transport)) this.knockEarly(offered.epoch, [transport]);
|
|
26424
26720
|
if (!this.racing) this.scheduleRace(offered.epoch, offered.at);
|
|
26425
26721
|
}
|
|
26722
|
+
/**
|
|
26723
|
+
* On Automatic with no choice standing, Iroh ranks ahead of WebRTC for this contact and can be dialled now (WISP 100,
|
|
26724
|
+
* revision 2026-11-08): where a resume over WebRTC goes on Iroh instead (`dial`).
|
|
26725
|
+
*/
|
|
26726
|
+
irohRanksFirst() {
|
|
26727
|
+
if (!this.automatic || !this.peerTransports || !this.canDial("iroh/1") || (this.switcher.chosenTarget ?? this.choiceApart?.transport)) return false;
|
|
26728
|
+
const ranked = rankTransports(this.transportOffer(), this.peerFallback ? this.peerTransports : this.peerTransports.slice(0, 1), this.relayedTransports);
|
|
26729
|
+
return ranked.includes("iroh/1") && ranked.indexOf("iroh/1") < ranked.indexOf("webrtc/1");
|
|
26730
|
+
}
|
|
26426
26731
|
/** WebRTC could not start an attempt here: it goes last in the dial order for `RTC_UNSTARTED_MS`, while another transport remains. */
|
|
26427
26732
|
rtcUnstarted() {
|
|
26428
26733
|
traceLink(this.myPubKeyZ32, "rtc-unstarted", {});
|
|
@@ -26538,7 +26843,7 @@ var GhostLink = class {
|
|
|
26538
26843
|
* anyway holds (a first pairing's role, a restart, WebRTC set aside). Its own dial, chosen by hand, is not retried.
|
|
26539
26844
|
*/
|
|
26540
26845
|
awaitsContactDial() {
|
|
26541
|
-
return !(this.firstPairing() ? this.options.pairingProgress?.role : void 0) && this.myPubKeyZ32 > this.options.params.peerPubKeyZ32 && !this.resuming && !this.dialsPastRtc();
|
|
26846
|
+
return !(this.firstPairing() ? this.options.pairingProgress?.role : void 0) && this.myPubKeyZ32 > this.options.params.peerPubKeyZ32 && !this.resuming && !this.resumeKnockMissed && !this.dialsPastRtc();
|
|
26542
26847
|
}
|
|
26543
26848
|
/** A transport of the attempt under way did not connect. */
|
|
26544
26849
|
attemptFailed(transport, error) {
|
|
@@ -27867,16 +28172,18 @@ var GhostLink = class {
|
|
|
27867
28172
|
requireLegacyCapabilities() {
|
|
27868
28173
|
if (this.options.params.profile) throw new Error("This experimental paired profile supports chat only.");
|
|
27869
28174
|
}
|
|
27870
|
-
|
|
28175
|
+
/** `closeRtc`: a WebRTC attempt under way beside a native session is this change's, and ends with it. */
|
|
28176
|
+
cancelCandidate(closeRtc = true) {
|
|
27871
28177
|
this.candidateEpoch++;
|
|
27872
28178
|
const candidate = this.candidate;
|
|
27873
28179
|
this.candidate = null;
|
|
27874
28180
|
candidate?.session.stop();
|
|
27875
28181
|
candidate?.reject(/* @__PURE__ */ new Error("Transport change cancelled"));
|
|
27876
28182
|
candidate?.channel.close();
|
|
28183
|
+
this.dropContenders("Transport change cancelled");
|
|
27877
28184
|
this.rtcCandidateWaiter?.reject(/* @__PURE__ */ new Error("Transport change cancelled"));
|
|
27878
28185
|
this.rtcCandidateWaiter = null;
|
|
27879
|
-
if (this.activeBinding) this.dataLink.close();
|
|
28186
|
+
if (this.activeBinding && closeRtc) this.dataLink.close();
|
|
27880
28187
|
}
|
|
27881
28188
|
async prepareSwitch(plan) {
|
|
27882
28189
|
const epoch = ++this.candidateEpoch;
|
|
@@ -27962,6 +28269,7 @@ var GhostLink = class {
|
|
|
27962
28269
|
candidate?.session.stop();
|
|
27963
28270
|
candidate?.reject(/* @__PURE__ */ new Error("Candidate failed"));
|
|
27964
28271
|
candidate?.channel.close();
|
|
28272
|
+
this.dropContenders("Candidate failed");
|
|
27965
28273
|
this.rtcCandidateWaiter = null;
|
|
27966
28274
|
if (transport === "webrtc/1") this.dataLink.close();
|
|
27967
28275
|
}
|
|
@@ -27969,16 +28277,62 @@ var GhostLink = class {
|
|
|
27969
28277
|
if (epoch === this.candidateEpoch && this.switcher.pending === plan) this.switcher.fail(`Transport change failed: ${lastError instanceof Error ? lastError.message : "no permitted transport connected"}. Retry or choose another transport.`);
|
|
27970
28278
|
}
|
|
27971
28279
|
attachCandidate(channel, binding, plan) {
|
|
27972
|
-
|
|
28280
|
+
const rtcMove = !binding && plan.choices[0] === "webrtc/1";
|
|
28281
|
+
if (this.candidate && !this.contendable(rtcMove ? this.candidate.plan : plan) || this.switcher.pending !== plan || !plan.choices.includes(binding?.transport ?? "webrtc/1")) {
|
|
27973
28282
|
channel.close();
|
|
27974
28283
|
return Promise.reject(/* @__PURE__ */ new Error("Obsolete or duplicate transport candidate"));
|
|
27975
28284
|
}
|
|
27976
|
-
return new Promise((resolve, reject) => this.
|
|
28285
|
+
return new Promise((resolve, reject) => this.contend(channel, binding, {
|
|
27977
28286
|
plan,
|
|
27978
28287
|
resolve,
|
|
27979
28288
|
reject
|
|
27980
28289
|
}));
|
|
27981
28290
|
}
|
|
28291
|
+
/** The candidate waiting for `plan` (none: a replacement) was dialled in and has not authenticated yet. */
|
|
28292
|
+
contendable(plan) {
|
|
28293
|
+
const held = this.candidate;
|
|
28294
|
+
return !!held && held.plan === plan && this.unproven(held.channel) && held.session.state.status !== "ready";
|
|
28295
|
+
}
|
|
28296
|
+
/**
|
|
28297
|
+
* A connection that authenticates beside the candidate held (`contenders`), or takes the place if none is. With
|
|
28298
|
+
* `DIALED_IN_CONTENDERS` waiting already, the oldest dialled in and unproven of them gives its place up.
|
|
28299
|
+
*/
|
|
28300
|
+
contend(channel, binding, migration) {
|
|
28301
|
+
if (this.candidate && this.contenders.length >= 8) {
|
|
28302
|
+
const at = this.contenders.findIndex((c) => this.unproven(c.channel));
|
|
28303
|
+
if (at < 0) {
|
|
28304
|
+
channel.close();
|
|
28305
|
+
migration.reject(/* @__PURE__ */ new Error("Obsolete or duplicate transport candidate"));
|
|
28306
|
+
return;
|
|
28307
|
+
}
|
|
28308
|
+
const [oldest] = this.contenders.splice(at, 1);
|
|
28309
|
+
traceLink(this.myPubKeyZ32, "dialed-in-dropped", { transport: oldest.binding?.transport });
|
|
28310
|
+
oldest.session.stop();
|
|
28311
|
+
oldest.reject(/* @__PURE__ */ new Error("A newer connection took its place"));
|
|
28312
|
+
oldest.channel.close();
|
|
28313
|
+
}
|
|
28314
|
+
this.attach(channel, binding, migration);
|
|
28315
|
+
}
|
|
28316
|
+
/** One of the `contenders` authenticated first: it takes the candidate's place, and the candidate held closes. */
|
|
28317
|
+
promoteContender(channel) {
|
|
28318
|
+
const at = this.contenders.findIndex((c) => c.channel === channel);
|
|
28319
|
+
if (at < 0) return false;
|
|
28320
|
+
const [won] = this.contenders.splice(at, 1), held = this.candidate;
|
|
28321
|
+
this.candidate = won;
|
|
28322
|
+
if (held) {
|
|
28323
|
+
held.session.stop();
|
|
28324
|
+
held.reject(/* @__PURE__ */ new Error("Another connection authenticated first"));
|
|
28325
|
+
held.channel.close();
|
|
28326
|
+
}
|
|
28327
|
+
return true;
|
|
28328
|
+
}
|
|
28329
|
+
dropContenders(reason) {
|
|
28330
|
+
for (const c of this.contenders.splice(0)) {
|
|
28331
|
+
c.session.stop();
|
|
28332
|
+
c.reject(new Error(reason));
|
|
28333
|
+
c.channel.close();
|
|
28334
|
+
}
|
|
28335
|
+
}
|
|
27982
28336
|
/**
|
|
27983
28337
|
* Both sides dialled at once (two apps back after a restart, each knocking): the lower key's dial carries the chat, on
|
|
27984
28338
|
* both sides; the higher key's side takes it over as a replacement (`attachReplacement`). Here, on the lower key's
|
|
@@ -28045,13 +28399,12 @@ var GhostLink = class {
|
|
|
28045
28399
|
channel.close();
|
|
28046
28400
|
return;
|
|
28047
28401
|
}
|
|
28048
|
-
|
|
28049
|
-
|
|
28050
|
-
|
|
28051
|
-
|
|
28052
|
-
|
|
28053
|
-
|
|
28054
|
-
waiting.reject(/* @__PURE__ */ new Error("A newer connection took its place"));
|
|
28402
|
+
if (this.contendable()) {
|
|
28403
|
+
this.contend(channel, binding, {
|
|
28404
|
+
resolve: () => {},
|
|
28405
|
+
reject: () => {}
|
|
28406
|
+
});
|
|
28407
|
+
return;
|
|
28055
28408
|
}
|
|
28056
28409
|
if (this.candidate) {
|
|
28057
28410
|
channel.close();
|
|
@@ -28193,6 +28546,11 @@ var GhostLink = class {
|
|
|
28193
28546
|
this.candidate = null;
|
|
28194
28547
|
migration?.reject(/* @__PURE__ */ new Error("Candidate connection closed"));
|
|
28195
28548
|
}
|
|
28549
|
+
const contender = this.contenders.findIndex((c) => c.channel === channel);
|
|
28550
|
+
if (contender >= 0) {
|
|
28551
|
+
this.contenders.splice(contender, 1)[0].session.stop();
|
|
28552
|
+
migration?.reject(/* @__PURE__ */ new Error("Candidate connection closed"));
|
|
28553
|
+
}
|
|
28196
28554
|
if (this.channel === channel) {
|
|
28197
28555
|
const wasLive = this.paired?.state.status === "ready";
|
|
28198
28556
|
this.rejectWaiters(/* @__PURE__ */ new Error("The peer closed this connection. Check that both transport preferences allow a common transport, then reconnect."));
|
|
@@ -28266,7 +28624,7 @@ var GhostLink = class {
|
|
|
28266
28624
|
let carried = null;
|
|
28267
28625
|
let switched = null, replaced = false;
|
|
28268
28626
|
if (migration) {
|
|
28269
|
-
if (this.candidate?.channel !== channel) {
|
|
28627
|
+
if (this.candidate?.channel !== channel && !this.promoteContender(channel)) {
|
|
28270
28628
|
paired.stop();
|
|
28271
28629
|
channel.close();
|
|
28272
28630
|
return;
|
|
@@ -28274,6 +28632,7 @@ var GhostLink = class {
|
|
|
28274
28632
|
const oldChannel = this.channel, oldPaired = this.paired, oldBinding = this.activeBinding;
|
|
28275
28633
|
const from = oldPaired?.state.transport;
|
|
28276
28634
|
this.candidate = null;
|
|
28635
|
+
this.dropContenders("Another connection authenticated first");
|
|
28277
28636
|
const files = this.pairedFiles;
|
|
28278
28637
|
this.pairedFiles = null;
|
|
28279
28638
|
if (files && migration.plan && paired.supports("files/2")) {
|
|
@@ -28348,6 +28707,7 @@ var GhostLink = class {
|
|
|
28348
28707
|
this.rtcCandidateWaiter = null;
|
|
28349
28708
|
this.autoConnectFailures = 0;
|
|
28350
28709
|
this.lastAutoConnectAt = 0;
|
|
28710
|
+
this.resumeKnockMissed = false;
|
|
28351
28711
|
traceLink(this.myPubKeyZ32, "paired-ready");
|
|
28352
28712
|
this.attempt = null;
|
|
28353
28713
|
if (this.lastAttempt) {
|
|
@@ -28713,14 +29073,17 @@ var GhostLink = class {
|
|
|
28713
29073
|
}
|
|
28714
29074
|
}
|
|
28715
29075
|
});
|
|
28716
|
-
if (migration)
|
|
28717
|
-
|
|
28718
|
-
|
|
28719
|
-
|
|
28720
|
-
|
|
28721
|
-
|
|
28722
|
-
|
|
28723
|
-
|
|
29076
|
+
if (migration) {
|
|
29077
|
+
const entry = {
|
|
29078
|
+
channel,
|
|
29079
|
+
session: paired,
|
|
29080
|
+
binding,
|
|
29081
|
+
...migration.plan && { plan: migration.plan },
|
|
29082
|
+
reject: migration.reject
|
|
29083
|
+
};
|
|
29084
|
+
if (this.candidate) this.contenders.push(entry);
|
|
29085
|
+
else this.candidate = entry;
|
|
29086
|
+
} else this.paired = paired;
|
|
28724
29087
|
paired.start();
|
|
28725
29088
|
return;
|
|
28726
29089
|
}
|
|
@@ -29117,7 +29480,7 @@ var GhostLink = class {
|
|
|
29117
29480
|
this.applicationOpen = false;
|
|
29118
29481
|
this.dht?.setLive(false);
|
|
29119
29482
|
if (!this.candidate) {
|
|
29120
|
-
this.cancelCandidate();
|
|
29483
|
+
this.cancelCandidate(!!this.switcher.pending || !!this.rtcCandidateWaiter);
|
|
29121
29484
|
this.switcher.stop();
|
|
29122
29485
|
this.transitionTarget = this.transitionError = void 0;
|
|
29123
29486
|
}
|
|
@@ -29184,9 +29547,12 @@ var GhostLink = class {
|
|
|
29184
29547
|
via: "datalink"
|
|
29185
29548
|
});
|
|
29186
29549
|
break;
|
|
29187
|
-
case "call":
|
|
29188
|
-
this.
|
|
29550
|
+
case "call": {
|
|
29551
|
+
if (!this.callsReceived.take()) break;
|
|
29552
|
+
const signal = heardCallSignal(frame.s, Date.now());
|
|
29553
|
+
if (this.pairedCalls.heard(signal)) this.options.events?.onCallSignal?.(signal);
|
|
29189
29554
|
break;
|
|
29555
|
+
}
|
|
29190
29556
|
case "req":
|
|
29191
29557
|
this.httpHost?.handleRequest(frame);
|
|
29192
29558
|
break;
|
|
@@ -29253,8 +29619,9 @@ var GhostLink = class {
|
|
|
29253
29619
|
* and HEIF (HEIC, AVIF), without decoding or re-encoding a pixel.
|
|
29254
29620
|
*
|
|
29255
29621
|
* Fail-closed: a file that is one of these pictures, by its bytes or by its type, and whose metadata cannot be removed
|
|
29256
|
-
* (truncated, malformed, a part this does not know) is refused with `NO_PICTURE_METADATA`, never sent as it was.
|
|
29257
|
-
*
|
|
29622
|
+
* (truncated, malformed, a part this does not know) is refused with `NO_PICTURE_METADATA`, never sent as it was. So is
|
|
29623
|
+
* a JPEG XL or a JPEG 2000 in its boxes (their Exif, XMP and GeoJP2 boxes are not removed here). Any other file goes
|
|
29624
|
+
* as it is.
|
|
29258
29625
|
*/
|
|
29259
29626
|
var PICTURE_METADATA_LIMITS = {
|
|
29260
29627
|
/** The largest picture read whole to remove its metadata: past this it is refused. */
|
|
@@ -29295,9 +29662,11 @@ var HEIF_BRANDS = /* @__PURE__ */ new Set([
|
|
|
29295
29662
|
"avif",
|
|
29296
29663
|
"avis"
|
|
29297
29664
|
]);
|
|
29665
|
+
/** The signature box a JPEG XL (`JXL `) or a JPEG 2000 (`jP `) in boxes starts with. */
|
|
29666
|
+
var SIGNATURE_BOXES = /* @__PURE__ */ new Set(["JXL ", "jP "]);
|
|
29298
29667
|
var u16be = (b, at) => b[at] << 8 | b[at + 1];
|
|
29299
|
-
var u32be$
|
|
29300
|
-
var u32le$
|
|
29668
|
+
var u32be$2 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
|
|
29669
|
+
var u32le$2 = (b, at) => (b[at] | b[at + 1] << 8 | b[at + 2] << 16 | b[at + 3] << 24) >>> 0;
|
|
29301
29670
|
var text$2 = (b, at, length) => String.fromCharCode(...b.subarray(at, at + length));
|
|
29302
29671
|
var starts = (b, at, prefix) => at + prefix.length <= b.length && text$2(b, at, prefix.length) === prefix;
|
|
29303
29672
|
/** A picture this strips, by its first bytes. */
|
|
@@ -29307,8 +29676,9 @@ function kindOf(b) {
|
|
|
29307
29676
|
if (b.length >= 12 && starts(b, 0, "RIFF") && starts(b, 8, "WEBP")) return "webp";
|
|
29308
29677
|
if (starts(b, 0, "GIF87a") || starts(b, 0, "GIF89a")) return "gif";
|
|
29309
29678
|
if (starts(b, 0, "II*\0") || starts(b, 0, "MM\0*") || starts(b, 0, "II+\0") || starts(b, 0, "MM\0+")) return "tiff";
|
|
29679
|
+
if (b.length >= 12 && u32be$2(b, 0) === 12 && SIGNATURE_BOXES.has(text$2(b, 4, 4)) && u32be$2(b, 8) === 218793738) return "boxes";
|
|
29310
29680
|
if (b.length >= 16 && starts(b, 4, "ftyp")) {
|
|
29311
|
-
const end = Math.min(b.length, u32be$
|
|
29681
|
+
const end = Math.min(b.length, u32be$2(b, 0));
|
|
29312
29682
|
for (let at = 8; at + 4 <= end; at += 4) if (at !== 12 && HEIF_BRANDS.has(text$2(b, at, 4))) return "heif";
|
|
29313
29683
|
}
|
|
29314
29684
|
}
|
|
@@ -29432,7 +29802,7 @@ function stripPng(b) {
|
|
|
29432
29802
|
let at = 8, exif = false, imaged = false;
|
|
29433
29803
|
for (;;) {
|
|
29434
29804
|
check$2(at + 12 <= b.length);
|
|
29435
|
-
const length = u32be$
|
|
29805
|
+
const length = u32be$2(b, at), type = text$2(b, at + 4, 4);
|
|
29436
29806
|
check$2(at + 12 + length <= b.length && (at > 8 || type === "IHDR"));
|
|
29437
29807
|
const critical = (b[at + 4] & 32) === 0;
|
|
29438
29808
|
check$2(!critical || PNG_CRITICAL.has(type));
|
|
@@ -29458,13 +29828,13 @@ var WEBP_KEEPS = /* @__PURE__ */ new Set([
|
|
|
29458
29828
|
]);
|
|
29459
29829
|
function stripWebp(b) {
|
|
29460
29830
|
check$2(b.length >= 20);
|
|
29461
|
-
const riffEnd = 8 + u32le$
|
|
29831
|
+
const riffEnd = 8 + u32le$2(b, 4);
|
|
29462
29832
|
check$2(riffEnd <= b.length && riffEnd % 2 === 0);
|
|
29463
29833
|
const parts = [];
|
|
29464
29834
|
let at = 12, size = 4, drawn = false, exif = false, vp8x;
|
|
29465
29835
|
while (at < riffEnd) {
|
|
29466
29836
|
check$2(at + 8 <= riffEnd);
|
|
29467
|
-
const type = text$2(b, at, 4), length = u32le$
|
|
29837
|
+
const type = text$2(b, at, 4), length = u32le$2(b, at + 4), end = at + 8 + length + (length & 1);
|
|
29468
29838
|
check$2(end <= riffEnd && (at > 12 || type === "VP8 " || type === "VP8L" || type === "VP8X"));
|
|
29469
29839
|
let chunk;
|
|
29470
29840
|
if (WEBP_KEEPS.has(type)) {
|
|
@@ -29582,11 +29952,11 @@ function boxes$1(b, start, end) {
|
|
|
29582
29952
|
const found = [];
|
|
29583
29953
|
for (let at = start; at < end;) {
|
|
29584
29954
|
check$2(at + 8 <= end);
|
|
29585
|
-
let size = u32be$
|
|
29955
|
+
let size = u32be$2(b, at), body = at + 8;
|
|
29586
29956
|
const type = text$2(b, at + 4, 4);
|
|
29587
29957
|
if (size === 1) {
|
|
29588
29958
|
check$2(at + 16 <= end);
|
|
29589
|
-
size = u32be$
|
|
29959
|
+
size = u32be$2(b, at + 8) * 2 ** 32 + u32be$2(b, at + 12);
|
|
29590
29960
|
body = at + 16;
|
|
29591
29961
|
} else if (size === 0) size = end - at;
|
|
29592
29962
|
if (type === "uuid") body += 16;
|
|
@@ -29624,7 +29994,7 @@ function stripHeif(b) {
|
|
|
29624
29994
|
const version = b[infe.body];
|
|
29625
29995
|
check$2(version === 2 || version === 3);
|
|
29626
29996
|
let at = infe.body + 4;
|
|
29627
|
-
const id = version === 2 ? u16be(b, at) : u32be$
|
|
29997
|
+
const id = version === 2 ? u16be(b, at) : u32be$2(b, at);
|
|
29628
29998
|
at += version === 2 ? 2 : 4;
|
|
29629
29999
|
check$2(at + 6 <= infe.end);
|
|
29630
30000
|
if (HEIF_METADATA_ITEMS.has(text$2(b, at + 2, 4))) metadata.add(id);
|
|
@@ -29646,7 +30016,7 @@ function stripHeif(b) {
|
|
|
29646
30016
|
/** The next field of `size` bytes (0, 2, 4 or 8), big-endian. */
|
|
29647
30017
|
const read = (size) => {
|
|
29648
30018
|
check$2(at + size <= iloc.end);
|
|
29649
|
-
const value = size === 0 ? 0 : size === 2 ? u16be(b, at) : size === 4 ? u32be$
|
|
30019
|
+
const value = size === 0 ? 0 : size === 2 ? u16be(b, at) : size === 4 ? u32be$2(b, at) : size === 8 ? u32be$2(b, at) * 2 ** 32 + u32be$2(b, at + 4) : NaN;
|
|
29650
30020
|
check$2(Number.isSafeInteger(value));
|
|
29651
30021
|
at += size;
|
|
29652
30022
|
return value;
|
|
@@ -29852,7 +30222,7 @@ function stripTiff(b) {
|
|
|
29852
30222
|
};
|
|
29853
30223
|
const u32 = (at) => {
|
|
29854
30224
|
check$2(at + 4 <= b.length);
|
|
29855
|
-
return little ? u32le$
|
|
30225
|
+
return little ? u32le$2(b, at) : u32be$2(b, at);
|
|
29856
30226
|
};
|
|
29857
30227
|
check$2(b.length >= 8 && u16(2) === 42);
|
|
29858
30228
|
const out = b.slice(), seen = /* @__PURE__ */ new Set();
|
|
@@ -29912,13 +30282,18 @@ function stripTiff(b) {
|
|
|
29912
30282
|
}
|
|
29913
30283
|
return [out];
|
|
29914
30284
|
}
|
|
30285
|
+
/** A JPEG XL or a JPEG 2000 in boxes: refused. */
|
|
30286
|
+
function refuse$2() {
|
|
30287
|
+
throw new Error(NO_PICTURE_METADATA);
|
|
30288
|
+
}
|
|
29915
30289
|
var STRIP = {
|
|
29916
30290
|
jpeg: stripJpeg,
|
|
29917
30291
|
png: stripPng,
|
|
29918
30292
|
webp: stripWebp,
|
|
29919
30293
|
heif: stripHeif,
|
|
29920
30294
|
gif: stripGif,
|
|
29921
|
-
tiff: stripTiff
|
|
30295
|
+
tiff: stripTiff,
|
|
30296
|
+
boxes: refuse$2
|
|
29922
30297
|
};
|
|
29923
30298
|
/**
|
|
29924
30299
|
* A picture's bytes without its metadata, as parts to put in a Blob; undefined when the file is not a picture this
|
|
@@ -29971,16 +30346,31 @@ async function withoutPictureMetadata(source, mime) {
|
|
|
29971
30346
|
* removed (truncated, malformed, a part of its movie this does not know) is refused with `NO_VIDEO_METADATA`, never sent as it was.
|
|
29972
30347
|
* 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
30348
|
* M4A) here: audioMetadata.ts strips it.
|
|
30349
|
+
*
|
|
30350
|
+
* An AVI (a dashcam's, an older camera's) goes without what its header and its `INFO` list say: each chunk but the
|
|
30351
|
+
* ones its frames and sound are made of (`avih`, `strh`, `strf`, `indx`, `vprp`, `dmlh`) becomes `JUNK`, zeroed (a
|
|
30352
|
+
* stream's name `strn` and data `strd`, `IDIT`'s date, a camera's `LIST ncdt`), and the chunks of a stream that is
|
|
30353
|
+
* neither pictures nor sound (a GPS or subtitle text stream) are zeroed in `movi`, so no offset moves. An ASF (WMV,
|
|
30354
|
+
* WMA), an FLV and an MPEG transport stream are refused with `NO_VIDEO_METADATA` (a WMA, typed as audio, with
|
|
30355
|
+
* `NO_AUDIO_METADATA`): their titles, places and dates are not removed here.
|
|
29974
30356
|
*/
|
|
29975
30357
|
var VIDEO_METADATA_LIMITS = {
|
|
29976
30358
|
/** The largest `moov` or `moof` read whole, and the most bytes of a metadata track's chunk: past this the video is refused. */
|
|
29977
30359
|
maxBoxBytes: 67108864,
|
|
29978
30360
|
/** The most top-level boxes walked (a fragmented MP4 has two per fragment). */
|
|
29979
30361
|
maxBoxes: 1e5,
|
|
30362
|
+
/** The most chunks of an AVI walked (one per frame and per piece of sound). */
|
|
30363
|
+
maxChunks: 4e6,
|
|
29980
30364
|
/** Bytes read first to tell a video from another file. */
|
|
29981
30365
|
headBytes: 64,
|
|
29982
30366
|
/** Bytes read at once for a box's header or a small box, so the next headers and `moof`s are read with it. */
|
|
29983
|
-
readAhead: 65536
|
|
30367
|
+
readAhead: 65536,
|
|
30368
|
+
/** The most a walk going on from its window reads at once (an Ogg's pages, a live WebM's blocks: the whole file). */
|
|
30369
|
+
readAheadMax: 4194304,
|
|
30370
|
+
/** The most bytes between two parts replaced that are read and sent with them as one part of the stripped video. */
|
|
30371
|
+
joinGap: 65536,
|
|
30372
|
+
/** The most bytes of such a part. */
|
|
30373
|
+
joinedBytes: 4194304
|
|
29984
30374
|
};
|
|
29985
30375
|
/** Why a video is refused: its metadata could not be removed, so it does not go at all. */
|
|
29986
30376
|
var NO_VIDEO_METADATA = "This video cannot be sent: Ghostly could not remove the details saved in it, like where it was recorded";
|
|
@@ -30107,7 +30497,7 @@ var VISUAL = /* @__PURE__ */ new Set([
|
|
|
30107
30497
|
]);
|
|
30108
30498
|
/** 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. */
|
|
30109
30499
|
var ZEROS$1 = new Blob([/* @__PURE__ */ new Uint8Array(1048576)]);
|
|
30110
|
-
var u32be = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
|
|
30500
|
+
var u32be$1 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
|
|
30111
30501
|
var text$1 = (b, at, length) => String.fromCharCode(...b.subarray(at, at + length));
|
|
30112
30502
|
/** Refuses the video where its bytes are not what this expects. */
|
|
30113
30503
|
function check$1(ok) {
|
|
@@ -30116,11 +30506,11 @@ function check$1(ok) {
|
|
|
30116
30506
|
/** A box's header at `at` of `b` (`base` its offset in the file), up to `end` (a size of 0 runs to it). */
|
|
30117
30507
|
function header(b, at, end, base = 0) {
|
|
30118
30508
|
check$1(at + 8 <= b.length);
|
|
30119
|
-
let size = u32be(b, at), body = at + 8;
|
|
30509
|
+
let size = u32be$1(b, at), body = at + 8;
|
|
30120
30510
|
const type = text$1(b, at + 4, 4);
|
|
30121
30511
|
if (size === 1) {
|
|
30122
30512
|
check$1(at + 16 <= b.length);
|
|
30123
|
-
size = u32be(b, at + 8) * 2 ** 32 + u32be(b, at + 12);
|
|
30513
|
+
size = u32be$1(b, at + 8) * 2 ** 32 + u32be$1(b, at + 12);
|
|
30124
30514
|
body = at + 16;
|
|
30125
30515
|
} else if (size === 0) size = end - (base + at);
|
|
30126
30516
|
if (type === "uuid") body += 16;
|
|
@@ -30150,7 +30540,7 @@ function empty(b, box) {
|
|
|
30150
30540
|
101,
|
|
30151
30541
|
101
|
|
30152
30542
|
], box.start + 4);
|
|
30153
|
-
b.fill(0, box.start + (u32be(b, box.start) === 1 ? 16 : 8), box.end);
|
|
30543
|
+
b.fill(0, box.start + (u32be$1(b, box.start) === 1 ? 16 : 8), box.end);
|
|
30154
30544
|
}
|
|
30155
30545
|
/**
|
|
30156
30546
|
* Every metadata box in a container's children (and in theirs, for the containers below a track) emptied, every
|
|
@@ -30193,9 +30583,9 @@ function chunkOffsets(b, stbl) {
|
|
|
30193
30583
|
check$1(!!stco !== !!co64);
|
|
30194
30584
|
const offsets = stco ?? co64;
|
|
30195
30585
|
check$1(offsets.body + 8 <= offsets.end);
|
|
30196
|
-
const chunks = u32be(b, offsets.body + 4);
|
|
30586
|
+
const chunks = u32be$1(b, offsets.body + 4);
|
|
30197
30587
|
check$1(offsets.body + 8 + chunks * (co64 ? 8 : 4) <= offsets.end);
|
|
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);
|
|
30588
|
+
const offsetOf = (i) => co64 ? u32be$1(b, co64.body + 8 + i * 8) * 2 ** 32 + u32be$1(b, co64.body + 12 + i * 8) : u32be$1(b, stco.body + 8 + i * 4);
|
|
30199
30589
|
return {
|
|
30200
30590
|
chunks,
|
|
30201
30591
|
offsetOf
|
|
@@ -30208,14 +30598,14 @@ function sampleRanges(b, stbl) {
|
|
|
30208
30598
|
const need = (box, at, bytes) => check$1(at + bytes <= box.end);
|
|
30209
30599
|
const sizeTable = stsz ?? stz2;
|
|
30210
30600
|
need(sizeTable, sizeTable.body, 12);
|
|
30211
|
-
const count = u32be(b, sizeTable.body + 8);
|
|
30601
|
+
const count = u32be$1(b, sizeTable.body + 8);
|
|
30212
30602
|
let sizeOf;
|
|
30213
30603
|
/** Samples of one size: a chunk's length is counted, not added up a sample at a time. */
|
|
30214
30604
|
let uniform = 0;
|
|
30215
30605
|
if (stsz) {
|
|
30216
|
-
uniform = u32be(b, stsz.body + 4);
|
|
30606
|
+
uniform = u32be$1(b, stsz.body + 4);
|
|
30217
30607
|
if (!uniform) need(stsz, stsz.body + 12, count * 4);
|
|
30218
|
-
sizeOf = (i) => u32be(b, stsz.body + 12 + i * 4);
|
|
30608
|
+
sizeOf = (i) => u32be$1(b, stsz.body + 12 + i * 4);
|
|
30219
30609
|
} else {
|
|
30220
30610
|
const field = b[stz2.body + 7];
|
|
30221
30611
|
check$1(field === 4 || field === 8 || field === 16);
|
|
@@ -30225,13 +30615,13 @@ function sampleRanges(b, stbl) {
|
|
|
30225
30615
|
}
|
|
30226
30616
|
const { chunks, offsetOf } = chunkOffsets(b, stbl);
|
|
30227
30617
|
need(stsc, stsc.body, 8);
|
|
30228
|
-
const runs = u32be(b, stsc.body + 4);
|
|
30618
|
+
const runs = u32be$1(b, stsc.body + 4);
|
|
30229
30619
|
need(stsc, stsc.body + 8, runs * 12);
|
|
30230
30620
|
const ranges = [];
|
|
30231
30621
|
let sample = 0;
|
|
30232
30622
|
for (let run = 0; run < runs; run++) {
|
|
30233
|
-
const first = u32be(b, stsc.body + 8 + run * 12), perChunk = u32be(b, stsc.body + 12 + run * 12);
|
|
30234
|
-
const last = run + 1 < runs ? u32be(b, stsc.body + 8 + (run + 1) * 12) : chunks + 1;
|
|
30623
|
+
const first = u32be$1(b, stsc.body + 8 + run * 12), perChunk = u32be$1(b, stsc.body + 12 + run * 12);
|
|
30624
|
+
const last = run + 1 < runs ? u32be$1(b, stsc.body + 8 + (run + 1) * 12) : chunks + 1;
|
|
30235
30625
|
check$1(first >= 1 && last > first && last <= chunks + 1);
|
|
30236
30626
|
for (let chunk = first; chunk < last; chunk++) {
|
|
30237
30627
|
const start = offsetOf(chunk - 1);
|
|
@@ -30253,7 +30643,7 @@ function defaultSampleSizes(moov) {
|
|
|
30253
30643
|
for (const trex of mvex ? boxes(moov, mvex.body, mvex.end) : []) {
|
|
30254
30644
|
if (trex.type !== "trex") continue;
|
|
30255
30645
|
check$1(trex.body + 24 <= trex.end);
|
|
30256
|
-
sizes.set(u32be(moov, trex.body + 4), u32be(moov, trex.body + 16));
|
|
30646
|
+
sizes.set(u32be$1(moov, trex.body + 4), u32be$1(moov, trex.body + 16));
|
|
30257
30647
|
}
|
|
30258
30648
|
return sizes;
|
|
30259
30649
|
}
|
|
@@ -30271,30 +30661,30 @@ function fragmentRanges(b, at, sizes) {
|
|
|
30271
30661
|
if (traf.type !== "traf") continue;
|
|
30272
30662
|
const tfhd = child(b, traf, "tfhd");
|
|
30273
30663
|
check$1(!!tfhd && tfhd.body + 8 <= tfhd.end);
|
|
30274
|
-
const flags = u32be(b, tfhd.body) & 16777215;
|
|
30664
|
+
const flags = u32be$1(b, tfhd.body) & 16777215;
|
|
30275
30665
|
let field = tfhd.body + 8, base = flags & 131072 ? at : previous;
|
|
30276
30666
|
if (flags & 1) {
|
|
30277
30667
|
check$1(field + 8 <= tfhd.end);
|
|
30278
|
-
base = u32be(b, field) * 2 ** 32 + u32be(b, field + 4);
|
|
30668
|
+
base = u32be$1(b, field) * 2 ** 32 + u32be$1(b, field + 4);
|
|
30279
30669
|
field += 8;
|
|
30280
30670
|
}
|
|
30281
30671
|
if (flags & 2) field += 4;
|
|
30282
30672
|
if (flags & 8) field += 4;
|
|
30283
|
-
const track = u32be(b, tfhd.body + 4);
|
|
30673
|
+
const track = u32be$1(b, tfhd.body + 4);
|
|
30284
30674
|
let size = sizes.get(track);
|
|
30285
30675
|
if (flags & 16) {
|
|
30286
30676
|
check$1(field + 4 <= tfhd.end);
|
|
30287
|
-
size = u32be(b, field);
|
|
30677
|
+
size = u32be$1(b, field);
|
|
30288
30678
|
}
|
|
30289
30679
|
let next = base;
|
|
30290
30680
|
for (const trun of boxes(b, traf.body, traf.end)) {
|
|
30291
30681
|
if (trun.type !== "trun") continue;
|
|
30292
30682
|
check$1(trun.body + 8 <= trun.end);
|
|
30293
|
-
const runFlags = u32be(b, trun.body) & 16777215, count = u32be(b, trun.body + 4);
|
|
30683
|
+
const runFlags = u32be$1(b, trun.body) & 16777215, count = u32be$1(b, trun.body + 4);
|
|
30294
30684
|
let field = trun.body + 8;
|
|
30295
30685
|
if (runFlags & 1) {
|
|
30296
30686
|
check$1(field + 4 <= trun.end);
|
|
30297
|
-
next = base + (u32be(b, field) | 0);
|
|
30687
|
+
next = base + (u32be$1(b, field) | 0);
|
|
30298
30688
|
field += 4;
|
|
30299
30689
|
}
|
|
30300
30690
|
if (runFlags & 4) field += 4;
|
|
@@ -30308,7 +30698,7 @@ function fragmentRanges(b, at, sizes) {
|
|
|
30308
30698
|
let length = 0;
|
|
30309
30699
|
if (runFlags & 512) {
|
|
30310
30700
|
const sizeAt = field + (runFlags & 256 ? 4 : 0);
|
|
30311
|
-
for (let i = 0; i < count; i++) length += u32be(b, sizeAt + i * stride);
|
|
30701
|
+
for (let i = 0; i < count; i++) length += u32be$1(b, sizeAt + i * stride);
|
|
30312
30702
|
} else if (count) {
|
|
30313
30703
|
check$1(size !== void 0);
|
|
30314
30704
|
length = count * size;
|
|
@@ -30389,7 +30779,7 @@ function stripMoov(b) {
|
|
|
30389
30779
|
check$1(selfContained(b, minf) && !!tkhd);
|
|
30390
30780
|
const id = tkhd.body + 4 + (b[tkhd.body] === 1 ? 16 : 8);
|
|
30391
30781
|
check$1(id + 4 <= tkhd.end);
|
|
30392
|
-
captions.add(u32be(b, id));
|
|
30782
|
+
captions.add(u32be$1(b, id));
|
|
30393
30783
|
for (const range of sampleRanges(b, stbl)) zeroed.push(range);
|
|
30394
30784
|
} else check$1(HANDLERS.has(handler));
|
|
30395
30785
|
if (handler === "vide") video = true;
|
|
@@ -30419,20 +30809,40 @@ function meets(ranges, start, end) {
|
|
|
30419
30809
|
return low < ranges.length && ranges[low][0] < end;
|
|
30420
30810
|
}
|
|
30421
30811
|
/**
|
|
30812
|
+
* Whether `start` to `end` of the file is within one of `boxes` (in file order, apart): the first one that ends at or
|
|
30813
|
+
* past `end` is the only one that can hold it, found by halves, so a caption run per fragment is not checked against
|
|
30814
|
+
* every fragment's `mdat`.
|
|
30815
|
+
*/
|
|
30816
|
+
function within(boxes, start, end) {
|
|
30817
|
+
let low = 0, high = boxes.length;
|
|
30818
|
+
while (low < high) {
|
|
30819
|
+
const middle = low + high >>> 1;
|
|
30820
|
+
if (boxes[middle].end >= end) high = middle;
|
|
30821
|
+
else low = middle + 1;
|
|
30822
|
+
}
|
|
30823
|
+
return low < boxes.length && start >= boxes[low].body;
|
|
30824
|
+
}
|
|
30825
|
+
/**
|
|
30422
30826
|
* `source` read a window at a time: a read that fits in `readAhead` bytes reads that many from where it starts, and
|
|
30423
30827
|
* the reads after it within them (the next boxes' headers, a fragment's `moof`) are served from it, as copies (they
|
|
30424
|
-
* are changed in place). A Blob's read costs
|
|
30828
|
+
* are changed in place). A Blob's read costs most for being one (in Chromium ~0.3 ms, and ~0.9 ms per MiB), so a
|
|
30829
|
+
* fragment costs one, not three.
|
|
30830
|
+
*
|
|
30831
|
+
* A walk that goes on from its window (an Ogg's pages, a live WebM's blocks: headers less than a window apart, through
|
|
30832
|
+
* the whole file) reads twice as much each time, up to `readAheadMax`, so it makes a few large reads, not one per
|
|
30833
|
+
* 64 KiB. One that jumps farther (over a fragment's samples) or back reads `readAhead` again.
|
|
30425
30834
|
*/
|
|
30426
30835
|
function readingAhead(source) {
|
|
30427
|
-
let start = 0, window = /* @__PURE__ */ new Uint8Array(0);
|
|
30836
|
+
let start = 0, window = /* @__PURE__ */ new Uint8Array(0), ahead = VIDEO_METADATA_LIMITS.readAhead;
|
|
30428
30837
|
return {
|
|
30429
30838
|
size: source.size,
|
|
30430
30839
|
async read(offset, length) {
|
|
30431
30840
|
const end = start + window.length;
|
|
30432
30841
|
if (offset < start || offset + length > end && end < source.size) {
|
|
30433
|
-
|
|
30842
|
+
ahead = window.length > 0 && offset >= start && offset - end < ahead ? Math.min(ahead * 2, VIDEO_METADATA_LIMITS.readAheadMax) : VIDEO_METADATA_LIMITS.readAhead;
|
|
30843
|
+
if (length > ahead) return source.read(offset, length);
|
|
30434
30844
|
start = offset;
|
|
30435
|
-
window = await source.read(offset,
|
|
30845
|
+
window = await source.read(offset, ahead);
|
|
30436
30846
|
}
|
|
30437
30847
|
return window.slice(offset - start, offset - start + length);
|
|
30438
30848
|
}
|
|
@@ -30454,6 +30864,142 @@ async function whole(source, box) {
|
|
|
30454
30864
|
check$1(bytes.length === box.end - box.start);
|
|
30455
30865
|
return bytes;
|
|
30456
30866
|
}
|
|
30867
|
+
var u32le$1 = (b, at) => (b[at] | b[at + 1] << 8 | b[at + 2] << 16 | b[at + 3] << 24) >>> 0;
|
|
30868
|
+
var JUNK = Uint8Array.from("JUNK", (c) => c.charCodeAt(0));
|
|
30869
|
+
/** The chunks of an AVI's header its frames and sound are read with, kept; any other becomes `JUNK`. */
|
|
30870
|
+
var AVI_HEADER_KEEPS = /* @__PURE__ */ new Set([
|
|
30871
|
+
"avih",
|
|
30872
|
+
"strh",
|
|
30873
|
+
"strf",
|
|
30874
|
+
"indx",
|
|
30875
|
+
"vprp",
|
|
30876
|
+
"dmlh"
|
|
30877
|
+
]);
|
|
30878
|
+
/** The lists of an AVI's header looked into. */
|
|
30879
|
+
var AVI_HEADER_LISTS = /* @__PURE__ */ new Set([
|
|
30880
|
+
"hdrl",
|
|
30881
|
+
"strl",
|
|
30882
|
+
"odml"
|
|
30883
|
+
]);
|
|
30884
|
+
/** The streams whose chunks in `movi` are kept: pictures and sound. */
|
|
30885
|
+
var AVI_STREAMS = /* @__PURE__ */ new Set(["vids", "auds"]);
|
|
30886
|
+
/** A frame's or a piece of sound's chunk in `movi`: its stream's number, then what it is. */
|
|
30887
|
+
var AVI_DATA = /^\d\d(dc|db|wb|pc)$/;
|
|
30888
|
+
/** An AVI: `RIFF` `AVI `, then any `RIFF` `AVIX` (an OpenDML one past 1 GiB). */
|
|
30889
|
+
var isAvi = (head) => head.length >= 12 && text$1(head, 0, 4) === "RIFF" && text$1(head, 8, 4) === "AVI ";
|
|
30890
|
+
/** An AVI without what its header and `INFO` say, nor its text and data streams' chunks; the patches in file order. */
|
|
30891
|
+
async function avi(source) {
|
|
30892
|
+
const patches = [], size = source.size;
|
|
30893
|
+
/** Whether each stream, in order, is kept (pictures or sound). */
|
|
30894
|
+
const streams = [];
|
|
30895
|
+
let chunks = 0;
|
|
30896
|
+
const chunkAt = async (at, end) => {
|
|
30897
|
+
check$1(++chunks <= VIDEO_METADATA_LIMITS.maxChunks && at + 8 <= end);
|
|
30898
|
+
const head = await source.read(at, 12);
|
|
30899
|
+
check$1(head.length >= 8);
|
|
30900
|
+
const id = text$1(head, 0, 4), length = u32le$1(head, 4), list = id === "LIST" || id === "RIFF";
|
|
30901
|
+
check$1(!list || length >= 4 && head.length >= 12);
|
|
30902
|
+
return {
|
|
30903
|
+
id,
|
|
30904
|
+
type: list ? text$1(head, 8, 4) : "",
|
|
30905
|
+
start: at,
|
|
30906
|
+
body: at + (list ? 12 : 8),
|
|
30907
|
+
end: at + 8 + length,
|
|
30908
|
+
next: at + 8 + length + (length & 1)
|
|
30909
|
+
};
|
|
30910
|
+
};
|
|
30911
|
+
/** Zeros from `start` to `end`; a chunk made `JUNK` (`junk`) has its id replaced too. */
|
|
30912
|
+
const zero = (start, end) => {
|
|
30913
|
+
if (end > start) patches.push({
|
|
30914
|
+
start,
|
|
30915
|
+
end
|
|
30916
|
+
});
|
|
30917
|
+
};
|
|
30918
|
+
const junk = (chunk, end = chunk.end) => {
|
|
30919
|
+
if (chunk.id !== "JUNK") patches.push({
|
|
30920
|
+
start: chunk.start,
|
|
30921
|
+
end: chunk.start + 4,
|
|
30922
|
+
bytes: JUNK
|
|
30923
|
+
});
|
|
30924
|
+
zero(chunk.start + 8, end);
|
|
30925
|
+
};
|
|
30926
|
+
const header = async (start, end) => {
|
|
30927
|
+
for (let at = start; at < end;) {
|
|
30928
|
+
const chunk = await chunkAt(at, end);
|
|
30929
|
+
check$1(chunk.end <= end);
|
|
30930
|
+
if (chunk.id === "LIST" && AVI_HEADER_LISTS.has(chunk.type)) await header(chunk.body, chunk.end);
|
|
30931
|
+
else if (chunk.id === "strh") {
|
|
30932
|
+
check$1(chunk.end - chunk.body >= 4);
|
|
30933
|
+
streams.push(AVI_STREAMS.has(text$1(await source.read(chunk.body, 4), 0, 4)));
|
|
30934
|
+
} else if (chunk.id === "JUNK") zero(chunk.body, chunk.end);
|
|
30935
|
+
else if (!AVI_HEADER_KEEPS.has(chunk.id)) junk(chunk);
|
|
30936
|
+
at = Math.min(chunk.next, end);
|
|
30937
|
+
}
|
|
30938
|
+
};
|
|
30939
|
+
const movi = async (start, end) => {
|
|
30940
|
+
let at = start;
|
|
30941
|
+
for (; at + 8 <= end;) {
|
|
30942
|
+
const chunk = await chunkAt(at, end), until = Math.min(chunk.end, end);
|
|
30943
|
+
if (chunk.id === "LIST" && chunk.type === "rec ") await movi(chunk.body, until);
|
|
30944
|
+
else if (chunk.id.startsWith("ix") || AVI_DATA.test(chunk.id) && streams[Number(chunk.id.slice(0, 2))]) {} else if (/^\d\d/.test(chunk.id)) zero(chunk.body, until);
|
|
30945
|
+
else junk(chunk, until);
|
|
30946
|
+
at = Math.min(chunk.next, end);
|
|
30947
|
+
}
|
|
30948
|
+
zero(at, end);
|
|
30949
|
+
};
|
|
30950
|
+
let at = 0;
|
|
30951
|
+
for (let first = true; at + 12 <= size; first = false) {
|
|
30952
|
+
const head = await source.read(at, 12);
|
|
30953
|
+
if (text$1(head, 0, 4) !== "RIFF" || text$1(head, 8, 4) !== (first ? "AVI " : "AVIX")) break;
|
|
30954
|
+
const form = await chunkAt(at, size), end = Math.min(form.end, size);
|
|
30955
|
+
for (let inner = form.body; inner + 8 <= end;) {
|
|
30956
|
+
const chunk = await chunkAt(inner, end);
|
|
30957
|
+
if (first && chunk.id === "LIST" && chunk.type === "hdrl") {
|
|
30958
|
+
check$1(!streams.length && chunk.end <= end);
|
|
30959
|
+
await header(chunk.body, chunk.end);
|
|
30960
|
+
} else if (chunk.id === "LIST" && chunk.type === "movi") {
|
|
30961
|
+
check$1(streams.length > 0);
|
|
30962
|
+
await movi(chunk.body, Math.min(chunk.end, end));
|
|
30963
|
+
} else if (chunk.id === "JUNK") zero(chunk.body, Math.min(chunk.end, end));
|
|
30964
|
+
else if (chunk.id !== "idx1") junk(chunk, Math.min(chunk.end, end));
|
|
30965
|
+
inner = Math.min(chunk.next, end);
|
|
30966
|
+
}
|
|
30967
|
+
at = Math.min(form.next, size);
|
|
30968
|
+
}
|
|
30969
|
+
zero(at, size);
|
|
30970
|
+
return patches;
|
|
30971
|
+
}
|
|
30972
|
+
/** An ASF (WMV, WMA): its header object's GUID. */
|
|
30973
|
+
var ASF = [
|
|
30974
|
+
48,
|
|
30975
|
+
38,
|
|
30976
|
+
178,
|
|
30977
|
+
117,
|
|
30978
|
+
142,
|
|
30979
|
+
102,
|
|
30980
|
+
207,
|
|
30981
|
+
17,
|
|
30982
|
+
166,
|
|
30983
|
+
217,
|
|
30984
|
+
0,
|
|
30985
|
+
170,
|
|
30986
|
+
0,
|
|
30987
|
+
98,
|
|
30988
|
+
206,
|
|
30989
|
+
108
|
|
30990
|
+
];
|
|
30991
|
+
var isAsf = (head) => head.length >= 16 && ASF.every((byte, i) => head[i] === byte);
|
|
30992
|
+
/** A video whose metadata is not removed here, so it is refused: an ASF, an FLV, an MPEG transport stream (`.ts`, `.m2ts`). */
|
|
30993
|
+
async function refused(source, head) {
|
|
30994
|
+
if (isAsf(head) || head.length >= 4 && text$1(head, 0, 3) === "FLV" && head[3] === 1) return true;
|
|
30995
|
+
const packetAt = (b, at) => b[at] === 71 && (b[at + 3] & 48) !== 0;
|
|
30996
|
+
for (const [packet, offset] of [[188, 0], [192, 4]]) {
|
|
30997
|
+
if (!packetAt(head, offset) || source.size < offset + 2 * packet + 4) continue;
|
|
30998
|
+
const next = await source.read(offset + packet, packet + 4);
|
|
30999
|
+
if (packetAt(next, 0) && packetAt(next, packet)) return true;
|
|
31000
|
+
}
|
|
31001
|
+
return false;
|
|
31002
|
+
}
|
|
30457
31003
|
/**
|
|
30458
31004
|
* What a file is by its first box: a movie (`FIRST_BOXES`), a file of boxes that is one when it holds a `moov` (any
|
|
30459
31005
|
* other box found at the top of a movie: a stream's segment holds none), or another file. An HEIF picture is
|
|
@@ -30478,11 +31024,20 @@ async function withoutVideoMetadata(source, mime) {
|
|
|
30478
31024
|
if (!patches) return void 0;
|
|
30479
31025
|
const parts = [];
|
|
30480
31026
|
let at = 0;
|
|
30481
|
-
for (
|
|
31027
|
+
for (let i = 0; i < patches.length;) {
|
|
31028
|
+
const patch = patches[i];
|
|
31029
|
+
let last = i;
|
|
31030
|
+
while (last + 1 < patches.length && patches[last + 1].start - patches[last].end <= VIDEO_METADATA_LIMITS.joinGap && patches[last + 1].end - patch.start <= VIDEO_METADATA_LIMITS.joinedBytes) last++;
|
|
30482
31031
|
if (patch.start > at) parts.push(source.slice(at, patch.start));
|
|
30483
|
-
if (
|
|
31032
|
+
if (last > i) {
|
|
31033
|
+
const joined = new Uint8Array(await source.slice(patch.start, patches[last].end).arrayBuffer());
|
|
31034
|
+
for (const { start, end, bytes } of patches.slice(i, last + 1)) if (bytes) joined.set(bytes, start - patch.start);
|
|
31035
|
+
else joined.fill(0, start - patch.start, end - patch.start);
|
|
31036
|
+
parts.push(joined);
|
|
31037
|
+
} else if (patch.bytes) parts.push(patch.bytes);
|
|
30484
31038
|
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)));
|
|
30485
|
-
at =
|
|
31039
|
+
at = patches[last].end;
|
|
31040
|
+
i = last + 1;
|
|
30486
31041
|
}
|
|
30487
31042
|
if (at < source.size) parts.push(source.slice(at));
|
|
30488
31043
|
return new Blob(parts, { type: mime });
|
|
@@ -30495,6 +31050,11 @@ async function withoutVideoMetadata(source, mime) {
|
|
|
30495
31050
|
async function videoMetadataPatches(file, mime, audio = false) {
|
|
30496
31051
|
const source = readingAhead(file);
|
|
30497
31052
|
const head = await source.read(0, VIDEO_METADATA_LIMITS.headBytes);
|
|
31053
|
+
if (isAvi(head)) {
|
|
31054
|
+
const patches = await avi(source);
|
|
31055
|
+
return patches.length ? patches : void 0;
|
|
31056
|
+
}
|
|
31057
|
+
if (!(isAsf(head) && mime.toLowerCase().startsWith("audio/"))) check$1(!await refused(source, head));
|
|
30498
31058
|
const typed = STRIPPED_TYPES.has(mime.split(";")[0].trim().toLowerCase());
|
|
30499
31059
|
const container = containerOf(head, mime);
|
|
30500
31060
|
if (!container) {
|
|
@@ -30584,7 +31144,7 @@ async function videoMetadataPatches(file, mime, audio = false) {
|
|
|
30584
31144
|
const mdats = top.filter((box) => box.type === "mdat");
|
|
30585
31145
|
const merged = [];
|
|
30586
31146
|
for (const [start, end] of zeroed.sort((a, b) => a[0] - b[0])) {
|
|
30587
|
-
check$1(mdats
|
|
31147
|
+
check$1(within(mdats, start, end));
|
|
30588
31148
|
const last = merged[merged.length - 1];
|
|
30589
31149
|
if (last && start <= last[1]) last[1] = Math.max(last[1], end);
|
|
30590
31150
|
else merged.push([start, end]);
|
|
@@ -30620,13 +31180,22 @@ async function videoMetadataPatches(file, mime, audio = false) {
|
|
|
30620
31180
|
* - WAV (RIFF, RF64 or BW64): every chunk but its format, data and the ones of the sound itself (`fact`, `cue `,
|
|
30621
31181
|
* `smpl`, `inst`, an RF64's `ds64`) becomes `JUNK`, zeroed (an INFO list, an `id3 ` chunk, a broadcast `bext` with
|
|
30622
31182
|
* its date and originator, iXML, XMP).
|
|
31183
|
+
* - AIFF and AIFF-C: every chunk but its sound's (`COMM`, `SSND`, `FVER`, `MARK`, `INST`, `AESD`, `chan`) becomes
|
|
31184
|
+
* `JUNK`, zeroed (NAME, AUTH, ANNO, `(c) `, COMT, an `ID3 ` chunk, an app's `APPL`).
|
|
31185
|
+
* - CAF: every chunk but its sound's (`desc`, `data`, `pakt`, `kuki`, `chan`, `peak`, `ovvw`) becomes `free`, zeroed
|
|
31186
|
+
* (its `info` strings, a marker's names in `strg`, `edct` comments, `uuid` chunks).
|
|
31187
|
+
* - WavPack: its APEv2 and ID3v1 tags at the end as an MP3's, and the source file's header and trailer each block may
|
|
31188
|
+
* keep for a lossless restore (a WAV's INFO list, an AIFF's NAME) made a sub-block that says nothing, zeroed.
|
|
31189
|
+
* - TTA: its tags at the end (and an ID3v2 before it) as an MP3's.
|
|
31190
|
+
* - Sun AU: its annotation, zeros.
|
|
30623
31191
|
* - WebM and Matroska, audio or video: `Tags`, `Attachments`, `Chapters`, the title, the date, the file names and each
|
|
30624
31192
|
* track's name become `Void` elements (and the SeekHead's entries for them); the muxer's and the writing app's names
|
|
30625
31193
|
* are zeroed. A Vorbis, Theora or FLAC track's CodecPrivate (its Ogg headers or its FLAC metadata blocks) has its
|
|
30626
31194
|
* comments emptied as an Ogg's or a FLAC's. Clusters, cues and other track settings are kept as they are.
|
|
30627
31195
|
*
|
|
30628
31196
|
* 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.
|
|
31197
|
+
* refused with `NO_AUDIO_METADATA`, never sent as it was. So is a WMA (ASF): its title, place and date are not removed
|
|
31198
|
+
* here. Any other file goes as it is (other audio formats too).
|
|
30630
31199
|
*/
|
|
30631
31200
|
var AUDIO_METADATA_LIMITS = {
|
|
30632
31201
|
/** The largest header, element or tag read whole (an Ogg comment header with a picture in it): past this the file is refused. */
|
|
@@ -30642,6 +31211,7 @@ var NO_AUDIO_METADATA = "This audio cannot be sent: Ghostly could not remove the
|
|
|
30642
31211
|
var ZEROS = new Blob([/* @__PURE__ */ new Uint8Array(1048576)]);
|
|
30643
31212
|
var text = (b, at, length) => String.fromCharCode(...b.subarray(at, at + length));
|
|
30644
31213
|
var u32le = (b, at) => (b[at] | b[at + 1] << 8 | b[at + 2] << 16 | b[at + 3] << 24) >>> 0;
|
|
31214
|
+
var u32be = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
|
|
30645
31215
|
var syncsafe = (b, at) => b[at] << 21 | b[at + 1] << 14 | b[at + 2] << 7 | b[at + 3];
|
|
30646
31216
|
var latin = (s) => Uint8Array.from(s, (c) => c.charCodeAt(0));
|
|
30647
31217
|
/** Refuses the file where its bytes are not what this expects. */
|
|
@@ -31004,6 +31574,121 @@ async function wav(read, size, rf64, patches) {
|
|
|
31004
31574
|
at = Math.min(end, size);
|
|
31005
31575
|
}
|
|
31006
31576
|
}
|
|
31577
|
+
/** The chunks an AIFF's or AIFF-C's sound is made of, kept; any other becomes `JUNK`. */
|
|
31578
|
+
var AIFF_KEEPS = /* @__PURE__ */ new Set([
|
|
31579
|
+
"COMM",
|
|
31580
|
+
"SSND",
|
|
31581
|
+
"FVER",
|
|
31582
|
+
"MARK",
|
|
31583
|
+
"INST",
|
|
31584
|
+
"AESD",
|
|
31585
|
+
"chan"
|
|
31586
|
+
]);
|
|
31587
|
+
/** An AIFF's chunks from its form type: big-endian sizes, each padded to an even length. */
|
|
31588
|
+
async function aiff(read, size, patches) {
|
|
31589
|
+
const count = counter();
|
|
31590
|
+
for (let at = 12; at + 8 <= size;) {
|
|
31591
|
+
count();
|
|
31592
|
+
const head = await read(at, 8);
|
|
31593
|
+
const id = text(head, 0, 4), length = u32be(head, 4);
|
|
31594
|
+
let end = at + 8 + length + length % 2;
|
|
31595
|
+
if (id === "SSND") end = length ? Math.min(end, size) : size;
|
|
31596
|
+
else check(at + 8 + length <= size);
|
|
31597
|
+
if (!AIFF_KEEPS.has(id)) {
|
|
31598
|
+
if (id !== "JUNK") patches.push({
|
|
31599
|
+
start: at,
|
|
31600
|
+
end: at + 4,
|
|
31601
|
+
bytes: latin("JUNK")
|
|
31602
|
+
});
|
|
31603
|
+
if (length) patches.push({
|
|
31604
|
+
start: at + 8,
|
|
31605
|
+
end: at + 8 + length
|
|
31606
|
+
});
|
|
31607
|
+
}
|
|
31608
|
+
at = Math.min(end, size);
|
|
31609
|
+
}
|
|
31610
|
+
}
|
|
31611
|
+
/** The chunks a CAF's sound is made of, kept; any other becomes `free`. */
|
|
31612
|
+
var CAF_KEEPS = /* @__PURE__ */ new Set([
|
|
31613
|
+
"desc",
|
|
31614
|
+
"data",
|
|
31615
|
+
"pakt",
|
|
31616
|
+
"kuki",
|
|
31617
|
+
"chan",
|
|
31618
|
+
"peak",
|
|
31619
|
+
"ovvw"
|
|
31620
|
+
]);
|
|
31621
|
+
/** A CAF's chunks after its 8-byte header: big-endian 64-bit sizes, `data`'s -1 when it runs to the end. */
|
|
31622
|
+
async function caf(read, size, patches) {
|
|
31623
|
+
const count = counter();
|
|
31624
|
+
for (let at = 8; at + 12 <= size;) {
|
|
31625
|
+
count();
|
|
31626
|
+
const head = await read(at, 12);
|
|
31627
|
+
const id = text(head, 0, 4), high = u32be(head, 4), length = high * 2 ** 32 + u32be(head, 8);
|
|
31628
|
+
const toEnd = id === "data" && high === 4294967295 && u32be(head, 8) === 4294967295;
|
|
31629
|
+
check(toEnd || Number.isSafeInteger(length) && at + 12 + length <= size);
|
|
31630
|
+
const end = toEnd ? size : at + 12 + length;
|
|
31631
|
+
if (!CAF_KEEPS.has(id)) {
|
|
31632
|
+
if (id !== "free") patches.push({
|
|
31633
|
+
start: at,
|
|
31634
|
+
end: at + 4,
|
|
31635
|
+
bytes: latin("free")
|
|
31636
|
+
});
|
|
31637
|
+
if (end > at + 12) patches.push({
|
|
31638
|
+
start: at + 12,
|
|
31639
|
+
end
|
|
31640
|
+
});
|
|
31641
|
+
}
|
|
31642
|
+
at = end;
|
|
31643
|
+
}
|
|
31644
|
+
}
|
|
31645
|
+
/** A WavPack sub-block's own id (its flags apart): the source file's header and trailer, a WAV's or another's. */
|
|
31646
|
+
var WAVPACK_SOURCE = /* @__PURE__ */ new Set([
|
|
31647
|
+
33,
|
|
31648
|
+
34,
|
|
31649
|
+
35,
|
|
31650
|
+
36
|
|
31651
|
+
]);
|
|
31652
|
+
/** A WavPack's blocks from `at`, their source file's header and trailer emptied; returns where they end (its tags). */
|
|
31653
|
+
async function wavpack(read, size, at, patches) {
|
|
31654
|
+
const count = counter();
|
|
31655
|
+
while (at + 32 <= size && text(await read(at, 4), 0, 4) === "wvpk") {
|
|
31656
|
+
count();
|
|
31657
|
+
const end = at + 8 + u32le(await read(at + 4, 4), 0);
|
|
31658
|
+
check(end >= at + 32 && end <= size);
|
|
31659
|
+
for (let sub = at + 32; sub < end;) {
|
|
31660
|
+
count();
|
|
31661
|
+
const head = await read(sub, Math.min(4, end - sub));
|
|
31662
|
+
const large = (head[0] & 128) !== 0, body = sub + (large ? 4 : 2);
|
|
31663
|
+
check(body <= end);
|
|
31664
|
+
const length = (large ? head[1] | head[2] << 8 | head[3] << 16 : head[1]) * 2;
|
|
31665
|
+
check(body + length <= end);
|
|
31666
|
+
if (WAVPACK_SOURCE.has(head[0] & 63)) {
|
|
31667
|
+
patches.push({
|
|
31668
|
+
start: sub,
|
|
31669
|
+
end: sub + 1,
|
|
31670
|
+
bytes: Uint8Array.of(head[0] & 192 | 32)
|
|
31671
|
+
});
|
|
31672
|
+
if (length) patches.push({
|
|
31673
|
+
start: body,
|
|
31674
|
+
end: body + length
|
|
31675
|
+
});
|
|
31676
|
+
}
|
|
31677
|
+
sub = body + length;
|
|
31678
|
+
}
|
|
31679
|
+
at = end;
|
|
31680
|
+
}
|
|
31681
|
+
return at;
|
|
31682
|
+
}
|
|
31683
|
+
/** A Sun AU's annotation: from its 24-byte header to its sound. */
|
|
31684
|
+
async function au(read, size, patches) {
|
|
31685
|
+
const offset = u32be(await read(4, 4), 0);
|
|
31686
|
+
check(offset >= 24 && offset <= size);
|
|
31687
|
+
if (offset > 24) patches.push({
|
|
31688
|
+
start: 24,
|
|
31689
|
+
end: offset
|
|
31690
|
+
});
|
|
31691
|
+
}
|
|
31007
31692
|
var EBML_HEADER = 440786851;
|
|
31008
31693
|
var SEGMENT$1 = 408125543;
|
|
31009
31694
|
var CLUSTER = 524531317;
|
|
@@ -31258,6 +31943,12 @@ async function audioMetadataPatches(file, mime) {
|
|
|
31258
31943
|
"BW64"
|
|
31259
31944
|
].includes(text(head, 0, 4)) && text(head, 8, 4) === "WAVE") await wav(read, size, text(head, 0, 4) !== "RIFF", patches);
|
|
31260
31945
|
else if (text(head, 0, 4) === "Eߣ") await matroska(source, read, patches);
|
|
31946
|
+
else if (head.length >= 12 && text(head, 0, 4) === "FORM" && ["AIFF", "AIFC"].includes(text(head, 8, 4))) await aiff(read, size, patches);
|
|
31947
|
+
else if (head.length >= 8 && text(head, 0, 4) === "caff") await caf(read, size, patches);
|
|
31948
|
+
else if (head.length >= 24 && text(head, 0, 4) === ".snd") await au(read, size, patches);
|
|
31949
|
+
else if (text(head, 0, 4) === "wvpk") await trailingTags(read, size, await wavpack(read, size, 0, patches), patches);
|
|
31950
|
+
else if (text(head, 0, 4) === "TTA1") await trailingTags(read, size, 0, patches);
|
|
31951
|
+
else if (isAsf(head)) check(false);
|
|
31261
31952
|
else if (text(head, 0, 4) === "fLaC") await trailingTags(read, size, await flac(read, size, 0, patches), patches);
|
|
31262
31953
|
else if (isId3(head) || isFrame(head, 0)) {
|
|
31263
31954
|
let at = 0;
|
|
@@ -31267,6 +31958,7 @@ async function audioMetadataPatches(file, mime) {
|
|
|
31267
31958
|
at = await emptyId3(read, size, at, next, patches);
|
|
31268
31959
|
}
|
|
31269
31960
|
if (at + 4 <= size && text(await read(at, 4), 0, 4) === "fLaC") at = await flac(read, size, at, patches);
|
|
31961
|
+
else if (at + 4 <= size && text(await read(at, 4), 0, 4) === "wvpk") at = await wavpack(read, size, at, patches);
|
|
31270
31962
|
await trailingTags(read, size, at, patches);
|
|
31271
31963
|
} else if (MPEG_AUDIO.has(baseMime(mime))) await trailingTags(read, size, 0, patches);
|
|
31272
31964
|
else return void 0;
|
|
@@ -31749,7 +32441,7 @@ function parsePayParams(body, destination) {
|
|
|
31749
32441
|
maxSat,
|
|
31750
32442
|
metadata,
|
|
31751
32443
|
descriptionHash: hex(sha256(new TextEncoder().encode(metadata))),
|
|
31752
|
-
description: description.slice(0, 280),
|
|
32444
|
+
description: stripHidden(description.replace(/\s+/g, " ")).slice(0, 280),
|
|
31753
32445
|
identifier,
|
|
31754
32446
|
commentAllowed: comment
|
|
31755
32447
|
};
|
|
@@ -31775,12 +32467,15 @@ function invoiceCallbackUrl(params, amountSat, comment) {
|
|
|
31775
32467
|
}
|
|
31776
32468
|
return url.href;
|
|
31777
32469
|
}
|
|
31778
|
-
/**
|
|
31779
|
-
|
|
32470
|
+
/**
|
|
32471
|
+
* A success action's link: HTTPS, bounded, no user part ("https://www.paypal.com@evil.example" opens evil.example),
|
|
32472
|
+
* and on the callback's own host (LUD-09), so a service cannot hand out a link to somewhere else.
|
|
32473
|
+
*/
|
|
32474
|
+
function successUrl(text, host) {
|
|
31780
32475
|
if (!/^https:\/\//i.test(text) || text.length > LNURL_LIMITS.maxUrlLength) return false;
|
|
31781
32476
|
try {
|
|
31782
32477
|
const url = new URL(text);
|
|
31783
|
-
return !url.username && !url.password;
|
|
32478
|
+
return !url.username && !url.password && url.host === host;
|
|
31784
32479
|
} catch {
|
|
31785
32480
|
return false;
|
|
31786
32481
|
}
|
|
@@ -31805,7 +32500,7 @@ function parseInvoiceCallback(body, params, amountSat) {
|
|
|
31805
32500
|
tag: "message",
|
|
31806
32501
|
message: reason(action.message)
|
|
31807
32502
|
};
|
|
31808
|
-
else if (action.tag === "url" && typeof action.url === "string" && successUrl(action.url)) successAction = {
|
|
32503
|
+
else if (action.tag === "url" && typeof action.url === "string" && successUrl(action.url, params.callbackDomain)) successAction = {
|
|
31809
32504
|
tag: "url",
|
|
31810
32505
|
description: reason(action.description),
|
|
31811
32506
|
url: action.url
|
|
@@ -36518,7 +37213,12 @@ var GroupSession = class {
|
|
|
36518
37213
|
pruneRelay() {
|
|
36519
37214
|
if (this.state.relay?.length) this.state.relay = this.state.relay.filter((f) => this.handsOn(f.s));
|
|
36520
37215
|
if (this.onRows?.length) this.onRows = this.onRows.filter((f) => this.handsOn(f.s));
|
|
36521
|
-
if (this.state.relayEdits?.length) this.state.relayEdits = this.state.relayEdits.filter((f) => rosterHas(this.roster, f.s) || this.isRemovalEdit(f));
|
|
37216
|
+
if (this.state.relayEdits?.length) this.state.relayEdits = this.state.relayEdits.filter((f) => rosterHas(this.roster, f.s) || this.carriedUnread(f) || this.isRemovalEdit(f));
|
|
37217
|
+
}
|
|
37218
|
+
/** An edit of an epoch I was not a member of (let in after it): kept and handed on unread (WISP 902 § Edits, "Carried unread"). */
|
|
37219
|
+
carriedUnread(frame) {
|
|
37220
|
+
const commit = this.state.chain[frame.e];
|
|
37221
|
+
return !!commit && !rosterHas(commit.m, this.myKey);
|
|
36522
37222
|
}
|
|
36523
37223
|
/** Whether a kept edit is a removal (WISP 400 § Delete for everyone): its box, under its epoch's key, says `rm`. */
|
|
36524
37224
|
isRemovalEdit(frame) {
|
|
@@ -37539,9 +38239,9 @@ var GroupSession = class {
|
|
|
37539
38239
|
if (!commit || !rosterHas(commit.m, raw.s)) return;
|
|
37540
38240
|
if (!(this.state.relayEdits ?? []).some((f) => f.s === raw.s && f.e === raw.e && f.n === raw.n && f.v >= raw.v) && !this.paced(this.editPace, raw.s, raw.c.length + 400, raw.s !== from && (this.awaitsAnswer(from) || waited))) return;
|
|
37541
38241
|
if (!rosterHas(commit.m, this.myKey)) {
|
|
37542
|
-
if (
|
|
38242
|
+
if (this.keepEdit(raw)) {
|
|
37543
38243
|
this.persistSoon();
|
|
37544
|
-
this.took(cleanEdit(raw));
|
|
38244
|
+
if (member) this.took(cleanEdit(raw));
|
|
37545
38245
|
}
|
|
37546
38246
|
return;
|
|
37547
38247
|
}
|
|
@@ -37935,7 +38635,7 @@ var GroupSession = class {
|
|
|
37935
38635
|
answer.push(...edits.slice(-GROUP_LIMITS.handOnEdits));
|
|
37936
38636
|
}
|
|
37937
38637
|
const handed = this.leaversHanded.get(from);
|
|
37938
|
-
const gone = (this.state.relayEdits ?? []).filter((f) => !rosterHas(this.roster, f.s) && readable(f) && !handed?.has(editKey(f)));
|
|
38638
|
+
const gone = (this.state.relayEdits ?? []).filter((f) => !rosterHas(this.roster, f.s) && (readable(f) || carrier && !!this.state.chain[f.e]) && !handed?.has(editKey(f)));
|
|
37939
38639
|
answer.push(...gone.slice(-GROUP_LIMITS.handOnEdits));
|
|
37940
38640
|
answer.push(...metas.map((m) => m.frame));
|
|
37941
38641
|
answer.push(...this.namesFor(from, frame.nt));
|
|
@@ -38888,6 +39588,37 @@ function isSealed(v) {
|
|
|
38888
39588
|
"c"
|
|
38889
39589
|
].every((k) => typeof v[k] === "string" && B64.test(v[k]) && v[k].length <= 128);
|
|
38890
39590
|
}
|
|
39591
|
+
var COMMIT_HASH = /^[0-9a-f]{64}$/;
|
|
39592
|
+
/**
|
|
39593
|
+
* A `group-secret` or `group-entry` frame a hub routes for another member, rebuilt from its known fields when each has
|
|
39594
|
+
* its real shape: what a hub remembers and hands on is no bigger than a real one. Null for anything else.
|
|
39595
|
+
*/
|
|
39596
|
+
function routedCommunityFrame(raw) {
|
|
39597
|
+
const { t, v, g, to, s } = raw;
|
|
39598
|
+
if (v !== 2 || typeof g !== "string" || !GROUP_ID.test(g) || !MEMBER_KEY.test(to) || !isSealed(s)) return null;
|
|
39599
|
+
const sealed = {
|
|
39600
|
+
e: s.e,
|
|
39601
|
+
n: s.n,
|
|
39602
|
+
c: s.c
|
|
39603
|
+
};
|
|
39604
|
+
if (t === "group-secret" && typeof raw.h === "string" && COMMIT_HASH.test(raw.h)) return {
|
|
39605
|
+
t,
|
|
39606
|
+
v,
|
|
39607
|
+
g,
|
|
39608
|
+
to,
|
|
39609
|
+
h: raw.h,
|
|
39610
|
+
s: sealed
|
|
39611
|
+
};
|
|
39612
|
+
if (t === "group-entry" && isZ32Key(raw.x)) return {
|
|
39613
|
+
t,
|
|
39614
|
+
v,
|
|
39615
|
+
g,
|
|
39616
|
+
to,
|
|
39617
|
+
x: raw.x,
|
|
39618
|
+
s: sealed
|
|
39619
|
+
};
|
|
39620
|
+
return null;
|
|
39621
|
+
}
|
|
38891
39622
|
/** A welcome's shape and the whole chain it and the pieces before it carry, not yet checked (`CommunitySession.join`). */
|
|
38892
39623
|
function readWelcome(link, pieces, welcome) {
|
|
38893
39624
|
if (!welcome || typeof welcome !== "object") return { error: "Malformed welcome" };
|
|
@@ -39124,18 +39855,22 @@ var CommunitySession = class CommunitySession {
|
|
|
39124
39855
|
return this.state.chain[this.state.chain.length - 1];
|
|
39125
39856
|
}
|
|
39126
39857
|
/**
|
|
39127
|
-
* The top commit's hash
|
|
39128
|
-
*
|
|
39858
|
+
* The top commit's hash: a view reads it for each member (its roster, what each member's lines are missing), and
|
|
39859
|
+
* hashing it every time cost tens of milliseconds per state in big communities.
|
|
39129
39860
|
*/
|
|
39130
39861
|
get topHash() {
|
|
39131
|
-
|
|
39132
|
-
|
|
39133
|
-
|
|
39134
|
-
|
|
39135
|
-
|
|
39136
|
-
|
|
39862
|
+
return this.hashOf(this.top);
|
|
39863
|
+
}
|
|
39864
|
+
/**
|
|
39865
|
+
* A commit's hash, kept for the commit it was taken from (a commit never changes once made): every sync frame, sync
|
|
39866
|
+
* answer and commit hashed the whole window again, about a tenth of the load test's CPU at 64 and 128 members.
|
|
39867
|
+
*/
|
|
39868
|
+
hashOf(c) {
|
|
39869
|
+
let h = this.hashes.get(c);
|
|
39870
|
+
if (h === void 0) this.hashes.set(c, h = communityCommitHash(c));
|
|
39871
|
+
return h;
|
|
39137
39872
|
}
|
|
39138
|
-
|
|
39873
|
+
hashes = /* @__PURE__ */ new WeakMap();
|
|
39139
39874
|
get epoch() {
|
|
39140
39875
|
return this.top.e;
|
|
39141
39876
|
}
|
|
@@ -39201,11 +39936,11 @@ var CommunitySession = class CommunitySession {
|
|
|
39201
39936
|
* does never wins, see `better`), and it parts within the window. Kept until the tip or the side moves.
|
|
39202
39937
|
*/
|
|
39203
39938
|
mayWin() {
|
|
39204
|
-
const side = this.state.side, at = `${this.topHash}:${side.length}:${side.length ?
|
|
39939
|
+
const side = this.state.side, at = `${this.topHash}:${side.length}:${side.length ? this.hashOf(side[side.length - 1]) : ""}`;
|
|
39205
39940
|
if (this.winning?.at === at) return this.winning.set;
|
|
39206
39941
|
const counts = this.adminCounts(), main = this.branch(this.topHash), set = /* @__PURE__ */ new Set();
|
|
39207
39942
|
for (const c of side) {
|
|
39208
|
-
const h =
|
|
39943
|
+
const h = this.hashOf(c), branch = this.rosters.has(h) ? this.branch(h) : null;
|
|
39209
39944
|
if (!branch || !branch.path.length) continue;
|
|
39210
39945
|
const { parent, admin } = this.parting(branch, main, counts);
|
|
39211
39946
|
if (!(admin[1] && !admin[0]) && parent >= this.epoch - COMMUNITY_LIMITS.window) set.add(h);
|
|
@@ -39225,12 +39960,12 @@ var CommunitySession = class CommunitySession {
|
|
|
39225
39960
|
const side = this.state.side, parents = new Set(side.map((c) => c.p)), counts = this.adminCounts();
|
|
39226
39961
|
let lost;
|
|
39227
39962
|
for (const c of side) {
|
|
39228
|
-
const h =
|
|
39963
|
+
const h = this.hashOf(c);
|
|
39229
39964
|
if (parents.has(h)) continue;
|
|
39230
39965
|
const branch = this.branch(h);
|
|
39231
39966
|
if (!branch || !branch.path.some((x) => rosterHas(this.rosters.get(x) ?? [], key))) continue;
|
|
39232
39967
|
for (let j = branch.fork + 1; j < this.state.chain.length; j++) {
|
|
39233
|
-
if (this.better(branch, this.branch(
|
|
39968
|
+
if (this.better(branch, this.branch(this.hashOf(this.state.chain[j])), counts)) continue;
|
|
39234
39969
|
lost = {
|
|
39235
39970
|
fork: Math.min(lost?.fork ?? j, branch.fork),
|
|
39236
39971
|
end: Math.max(lost?.end ?? j, j)
|
|
@@ -39251,7 +39986,7 @@ var CommunitySession = class CommunitySession {
|
|
|
39251
39986
|
if (found) return rosterHas(this.rosterAt(found.hash) ?? [], key);
|
|
39252
39987
|
const i = this.state.chain.length - 1 - (this.epoch - Number(e));
|
|
39253
39988
|
const commit = Number.isSafeInteger(i) && i >= 0 ? this.state.chain[i] : void 0;
|
|
39254
|
-
const hash = commit &&
|
|
39989
|
+
const hash = commit && this.hashOf(commit);
|
|
39255
39990
|
return !!hash && hash.startsWith(h) && this.wasInAt(key, i);
|
|
39256
39991
|
}
|
|
39257
39992
|
/**
|
|
@@ -39274,7 +40009,7 @@ var CommunitySession = class CommunitySession {
|
|
|
39274
40009
|
for (const k of after) if (!before.has(k)) s.byKey.set(k, [...s.byKey.get(k) ?? [], s.through]);
|
|
39275
40010
|
for (const k of before) if (!after.has(k)) s.byKey.get(k).push(s.through);
|
|
39276
40011
|
}
|
|
39277
|
-
s.top =
|
|
40012
|
+
s.top = this.hashOf(this.state.chain[s.through - 1]);
|
|
39278
40013
|
}
|
|
39279
40014
|
const at = s.byKey.get(key) ?? [];
|
|
39280
40015
|
for (let j = 0; j < at.length; j += 2) if (at[j] <= i && (j + 1 >= at.length || i < at[j + 1])) return true;
|
|
@@ -39310,14 +40045,14 @@ var CommunitySession = class CommunitySession {
|
|
|
39310
40045
|
if (i < 0) return rosterHas(this.roster, f.s) || this.isRecentMember(f.s) || !this.lostAt(f.s);
|
|
39311
40046
|
const commit = this.state.chain[i];
|
|
39312
40047
|
if (commit.k !== "leave") return false;
|
|
39313
|
-
const high = this.state.left?.[
|
|
40048
|
+
const high = this.state.left?.[this.hashOf(commit)]?.hi[seenKey(f.e, f.h)];
|
|
39314
40049
|
return high !== void 0 && f.n <= high;
|
|
39315
40050
|
}
|
|
39316
40051
|
/** The mark of a leave on my branch, as a frame to hand on (see `heardAfterOut`). */
|
|
39317
40052
|
leftFrame(key) {
|
|
39318
40053
|
const i = this.outIndex(key);
|
|
39319
40054
|
if (i < 0 || this.state.chain[i].k !== "leave") return void 0;
|
|
39320
|
-
const h =
|
|
40055
|
+
const h = this.hashOf(this.state.chain[i]), mark = this.state.left?.[h];
|
|
39321
40056
|
return mark && {
|
|
39322
40057
|
t: "group-left",
|
|
39323
40058
|
v: 2,
|
|
@@ -39436,7 +40171,7 @@ var CommunitySession = class CommunitySession {
|
|
|
39436
40171
|
this.state.chain.forEach((commit, i) => {
|
|
39437
40172
|
roster = communityRoster(roster, commit, true);
|
|
39438
40173
|
if (!roster) throw new Error("Stored membership chain does not replay");
|
|
39439
|
-
const h =
|
|
40174
|
+
const h = this.hashOf(commit);
|
|
39440
40175
|
this.known.set(h, commit);
|
|
39441
40176
|
this.mainIndex.set(h, i);
|
|
39442
40177
|
if (i >= keepFrom) this.rosters.set(h, roster);
|
|
@@ -39448,7 +40183,7 @@ var CommunitySession = class CommunitySession {
|
|
|
39448
40183
|
if (!parentRoster || !parent) return false;
|
|
39449
40184
|
const result = verifyCommunityCommit(commit, parent, parentRoster, this.id, this.ancestry(commit.p));
|
|
39450
40185
|
if ("error" in result) return false;
|
|
39451
|
-
const h =
|
|
40186
|
+
const h = this.hashOf(result.commit);
|
|
39452
40187
|
this.known.set(h, result.commit);
|
|
39453
40188
|
this.rosters.set(h, result.roster);
|
|
39454
40189
|
return true;
|
|
@@ -39475,7 +40210,7 @@ var CommunitySession = class CommunitySession {
|
|
|
39475
40210
|
const i = this.state.chain.length - 1 - (this.epoch - e);
|
|
39476
40211
|
const candidates = [...i >= 0 && i < this.state.chain.length ? [this.state.chain[i]] : [], ...this.state.side.filter((c) => c.e === e)];
|
|
39477
40212
|
for (const commit of candidates) {
|
|
39478
|
-
const hash =
|
|
40213
|
+
const hash = this.hashOf(commit);
|
|
39479
40214
|
if (hash.startsWith(h16) && this.rosters.has(hash)) return {
|
|
39480
40215
|
commit,
|
|
39481
40216
|
hash
|
|
@@ -39525,8 +40260,8 @@ var CommunitySession = class CommunitySession {
|
|
|
39525
40260
|
const admin = counts[x.fork] - counts[m] > 0 || path.some((h) => ADMIN_ONLY.has(this.known.get(h).k));
|
|
39526
40261
|
return {
|
|
39527
40262
|
admin,
|
|
39528
|
-
first: x.fork > m ?
|
|
39529
|
-
roles: !admin ? [] : [...this.state.chain.slice(m + 1, x.fork + 1).filter((c) => c.k === "role").map((c) =>
|
|
40263
|
+
first: x.fork > m ? this.hashOf(this.state.chain[m + 1]) : path[0] ?? "",
|
|
40264
|
+
roles: !admin ? [] : [...this.state.chain.slice(m + 1, x.fork + 1).filter((c) => c.k === "role").map((c) => this.hashOf(c)), ...path.filter((h) => this.known.get(h).k === "role")]
|
|
39530
40265
|
};
|
|
39531
40266
|
};
|
|
39532
40267
|
const sa = side(a), sb = side(b);
|
|
@@ -39548,7 +40283,7 @@ var CommunitySession = class CommunitySession {
|
|
|
39548
40283
|
if (fork === void 0 || this.signedAfter(h, role.s)) return false;
|
|
39549
40284
|
return [...at === void 0 ? this.state.chain.slice(fork + 1) : [], ...this.state.side].some((c) => {
|
|
39550
40285
|
if (c.k !== "leave" || c.s !== role.s) return false;
|
|
39551
|
-
const b = this.branch(
|
|
40286
|
+
const b = this.branch(this.hashOf(c));
|
|
39552
40287
|
if (!b || (at !== void 0 ? b.fork >= at : b.path.includes(h))) return false;
|
|
39553
40288
|
return leaveStands(c, this.ancestry(role.p));
|
|
39554
40289
|
});
|
|
@@ -39560,7 +40295,7 @@ var CommunitySession = class CommunitySession {
|
|
|
39560
40295
|
if (at !== void 0 && this.state.chain.slice(at + 1).some((c) => c.by === key)) return true;
|
|
39561
40296
|
return this.state.side.some((c) => {
|
|
39562
40297
|
if (c.by !== key) return false;
|
|
39563
|
-
const b = this.branch(
|
|
40298
|
+
const b = this.branch(this.hashOf(c));
|
|
39564
40299
|
return !!b && (at !== void 0 ? b.fork >= at : b.path.includes(h));
|
|
39565
40300
|
});
|
|
39566
40301
|
}
|
|
@@ -39628,7 +40363,7 @@ var CommunitySession = class CommunitySession {
|
|
|
39628
40363
|
if (GROWS.has(result.commit.k) && !keepsRoom(result.commit.e, result.roster)) return false;
|
|
39629
40364
|
const parentAdmin = rosterAdmin(parentRoster);
|
|
39630
40365
|
if (result.commit.k === "add" && result.commit.by !== parentAdmin && memberAdmissions(parentAdmin, this.ancestry(p)) >= COMMUNITY_LIMITS.memberAdmissions) return false;
|
|
39631
|
-
const commit = result.commit, h =
|
|
40366
|
+
const commit = result.commit, h = this.hashOf(commit);
|
|
39632
40367
|
const admin = rosterAdmin(parentRoster);
|
|
39633
40368
|
if (commit.by === admin) {
|
|
39634
40369
|
for (const [other, c] of this.known) if (other !== h && c.p === commit.p && c.by === admin) {
|
|
@@ -39718,7 +40453,7 @@ var CommunitySession = class CommunitySession {
|
|
|
39718
40453
|
let best = this.branch(this.topHash);
|
|
39719
40454
|
const parents = new Set(this.state.side.map((c) => c.p));
|
|
39720
40455
|
for (const c of this.state.side) {
|
|
39721
|
-
const h =
|
|
40456
|
+
const h = this.hashOf(c);
|
|
39722
40457
|
if (this.mainIndex.has(h) || parents.has(h)) continue;
|
|
39723
40458
|
const branch = this.branch(h);
|
|
39724
40459
|
if (branch && this.better(branch, best, counts)) best = branch;
|
|
@@ -39731,13 +40466,13 @@ var CommunitySession = class CommunitySession {
|
|
|
39731
40466
|
const ancestor = this.mainIndex.get(this.known.get(path[0]).p);
|
|
39732
40467
|
const dropped = this.state.chain.splice(ancestor + 1);
|
|
39733
40468
|
for (const c of dropped) {
|
|
39734
|
-
const h =
|
|
40469
|
+
const h = this.hashOf(c);
|
|
39735
40470
|
this.mainIndex.delete(h);
|
|
39736
40471
|
this.state.side.push(c);
|
|
39737
40472
|
}
|
|
39738
40473
|
for (const h of path) {
|
|
39739
40474
|
const c = this.known.get(h);
|
|
39740
|
-
this.state.side = this.state.side.filter((x) =>
|
|
40475
|
+
this.state.side = this.state.side.filter((x) => this.hashOf(x) !== h);
|
|
39741
40476
|
this.mainIndex.set(h, this.state.chain.length);
|
|
39742
40477
|
this.state.chain.push(c);
|
|
39743
40478
|
this.takeDerived(h);
|
|
@@ -39795,12 +40530,7 @@ var CommunitySession = class CommunitySession {
|
|
|
39795
40530
|
* branch it grows still comes in commit by commit (one let go comes again from where it parts in a catch-up).
|
|
39796
40531
|
*/
|
|
39797
40532
|
pruneSide() {
|
|
39798
|
-
const admin = this.admin,
|
|
39799
|
-
const hash = (c) => {
|
|
39800
|
-
let h = hashes.get(c);
|
|
39801
|
-
if (!h) hashes.set(c, h = communityCommitHash(c));
|
|
39802
|
-
return h;
|
|
39803
|
-
};
|
|
40533
|
+
const admin = this.admin, hash = (c) => this.hashOf(c);
|
|
39804
40534
|
let side = this.state.side.slice(-COMMUNITY_LIMITS.side);
|
|
39805
40535
|
for (;;) {
|
|
39806
40536
|
const held = new Set(side.map(hash)), parents = new Set(side.map((c) => c.p)), drop = /* @__PURE__ */ new Set();
|
|
@@ -39859,10 +40589,10 @@ var CommunitySession = class CommunitySession {
|
|
|
39859
40589
|
* kept, only get what is left of the bound, the most recent first.
|
|
39860
40590
|
*/
|
|
39861
40591
|
pruneSecrets() {
|
|
39862
|
-
const keep = new Set(this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) =>
|
|
40592
|
+
const keep = new Set(this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) => this.hashOf(c)));
|
|
39863
40593
|
let room = COMMUNITY_LIMITS.secrets - [...keep].filter((h) => this.state.secrets[h]).length;
|
|
39864
40594
|
for (let i = this.state.side.length - 1; i >= 0 && room > 0; i--) {
|
|
39865
|
-
const h =
|
|
40595
|
+
const h = this.hashOf(this.state.side[i]);
|
|
39866
40596
|
if (this.state.secrets[h] && !keep.has(h)) {
|
|
39867
40597
|
keep.add(h);
|
|
39868
40598
|
room--;
|
|
@@ -40000,7 +40730,7 @@ var CommunitySession = class CommunitySession {
|
|
|
40000
40730
|
...draft,
|
|
40001
40731
|
c: confirmationTag(epochKeys(secret, this.id, draft.e).confirm, untagged)
|
|
40002
40732
|
}, this.identity.seed);
|
|
40003
|
-
const hash =
|
|
40733
|
+
const hash = this.hashOf(commit);
|
|
40004
40734
|
this.known.set(hash, commit);
|
|
40005
40735
|
this.rosters.set(hash, roster);
|
|
40006
40736
|
this.mainIndex.set(hash, this.state.chain.length);
|
|
@@ -40073,7 +40803,7 @@ var CommunitySession = class CommunitySession {
|
|
|
40073
40803
|
if (!rosterHas(this.roster, memberKey) || memberKey === this.myKey || !isZ32Key(memberKey)) throw new Error("Not a member");
|
|
40074
40804
|
for (let i = this.state.chain.length - 1; i >= 0; i--) {
|
|
40075
40805
|
const c = this.state.chain[i];
|
|
40076
|
-
if (c.k === "add" && c.s === memberKey) return this.welcomeFor(memberKey,
|
|
40806
|
+
if (c.k === "add" && c.s === memberKey) return this.welcomeFor(memberKey, this.hashOf(c));
|
|
40077
40807
|
}
|
|
40078
40808
|
throw new Error("Not a member");
|
|
40079
40809
|
});
|
|
@@ -40081,7 +40811,7 @@ var CommunitySession = class CommunitySession {
|
|
|
40081
40811
|
/** The chain, the secrets from the admitting commit on, the rendezvous secret and the entry seed, for one newcomer. */
|
|
40082
40812
|
welcomeFor(memberKey, admittedAt) {
|
|
40083
40813
|
const chain = this.state.chain, from = this.mainIndex.get(admittedAt);
|
|
40084
|
-
const secrets = chain.slice(from).map((c) =>
|
|
40814
|
+
const secrets = chain.slice(from).map((c) => this.hashOf(c)).filter((h) => this.state.secrets[h]).map((h) => ({
|
|
40085
40815
|
h,
|
|
40086
40816
|
s: sealSecret(memberKey, fromBase64Url(this.state.secrets[h]), secretAad(this.id, h, memberKey))
|
|
40087
40817
|
}));
|
|
@@ -40206,7 +40936,7 @@ var CommunitySession = class CommunitySession {
|
|
|
40206
40936
|
ls: toBase64Url(sign(leaveStatement(this.id, this.myKey), this.identity.seed))
|
|
40207
40937
|
};
|
|
40208
40938
|
for (const c of this.ancestry(this.topHash)) if (c.k === "add" && c.s === this.myKey || c.k === "create" && c.by === this.myKey) {
|
|
40209
|
-
frame.ls3 = toBase64Url(sign(leaveStatement3(this.id, this.myKey,
|
|
40939
|
+
frame.ls3 = toBase64Url(sign(leaveStatement3(this.id, this.myKey, this.hashOf(c)), this.identity.seed));
|
|
40210
40940
|
break;
|
|
40211
40941
|
}
|
|
40212
40942
|
this.hooks.broadcast(frame);
|
|
@@ -40850,9 +41580,9 @@ var CommunitySession = class CommunitySession {
|
|
|
40850
41580
|
heard: open?.heard ?? false
|
|
40851
41581
|
});
|
|
40852
41582
|
}
|
|
40853
|
-
const secrets = this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) =>
|
|
41583
|
+
const secrets = this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) => this.hashOf(c)).filter((h) => this.state.secrets[h]).map(shortHash);
|
|
40854
41584
|
const loc = [];
|
|
40855
|
-
for (let back = 1; back < this.state.chain.length && loc.length < 12; back *= 2) loc.push(
|
|
41585
|
+
for (let back = 1; back < this.state.chain.length && loc.length < 12; back *= 2) loc.push(this.hashOf(this.state.chain[this.state.chain.length - 1 - back]));
|
|
40856
41586
|
return {
|
|
40857
41587
|
t: "group-sync",
|
|
40858
41588
|
v: 2,
|
|
@@ -41297,7 +42027,7 @@ var CommunitySession = class CommunitySession {
|
|
|
41297
42027
|
}
|
|
41298
42028
|
const out = this.outEpoch(from);
|
|
41299
42029
|
for (let i = start; i < this.state.chain.length; i++) {
|
|
41300
|
-
const commit = this.state.chain[i], h =
|
|
42030
|
+
const commit = this.state.chain[i], h = this.hashOf(commit);
|
|
41301
42031
|
answer.push({
|
|
41302
42032
|
t: "group-commit",
|
|
41303
42033
|
v: 2,
|
|
@@ -41315,7 +42045,7 @@ var CommunitySession = class CommunitySession {
|
|
|
41315
42045
|
});
|
|
41316
42046
|
}
|
|
41317
42047
|
const held = new Set(Array.isArray(frame.secrets) ? frame.secrets.filter((x) => typeof x === "string") : []);
|
|
41318
|
-
const secrets = this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) =>
|
|
42048
|
+
const secrets = this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) => this.hashOf(c)).filter((h) => this.state.secrets[h] && !held.has(shortHash(h)) && this.readsAt(h, from, out)).map((h) => ({
|
|
41319
42049
|
h,
|
|
41320
42050
|
s: sealSecret(from, fromBase64Url(this.state.secrets[h]), secretAad(this.id, h, from))
|
|
41321
42051
|
}));
|
|
@@ -42083,12 +42813,14 @@ function appRevocationFor(version, revocations) {
|
|
|
42083
42813
|
return null;
|
|
42084
42814
|
}
|
|
42085
42815
|
function checkAppBeforeRun(version, stores, revocations = []) {
|
|
42086
|
-
const
|
|
42087
|
-
|
|
42088
|
-
|
|
42089
|
-
|
|
42090
|
-
|
|
42091
|
-
|
|
42816
|
+
for (const list of [revocations, ...stores.map((s) => s.revoked)]) {
|
|
42817
|
+
const revocation = appRevocationFor(version, indexed(list, (r) => r.statement.app).get(version.ref) ?? []);
|
|
42818
|
+
if (revocation) return {
|
|
42819
|
+
status: "revoked",
|
|
42820
|
+
revocation
|
|
42821
|
+
};
|
|
42822
|
+
}
|
|
42823
|
+
const by = stores.flatMap((s) => (indexed(s.removed, (r) => `${r.ref} ${r.digest}`).get(`${version.ref} ${version.digest}`) ?? []).map((r) => ({
|
|
42092
42824
|
store: s.key,
|
|
42093
42825
|
name: s.name,
|
|
42094
42826
|
reason: r.reason,
|
|
@@ -42099,6 +42831,23 @@ function checkAppBeforeRun(version, stores, revocations = []) {
|
|
|
42099
42831
|
by
|
|
42100
42832
|
} : { status: "ok" };
|
|
42101
42833
|
}
|
|
42834
|
+
var indexes = /* @__PURE__ */ new WeakMap();
|
|
42835
|
+
function indexed(list, key) {
|
|
42836
|
+
const held = indexes.get(list);
|
|
42837
|
+
if (held && held.length === list.length) return held.byKey;
|
|
42838
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
42839
|
+
for (const entry of list) {
|
|
42840
|
+
const k = key(entry);
|
|
42841
|
+
const same = byKey.get(k);
|
|
42842
|
+
if (same) same.push(entry);
|
|
42843
|
+
else byKey.set(k, [entry]);
|
|
42844
|
+
}
|
|
42845
|
+
indexes.set(list, {
|
|
42846
|
+
length: list.length,
|
|
42847
|
+
byKey
|
|
42848
|
+
});
|
|
42849
|
+
return byKey;
|
|
42850
|
+
}
|
|
42102
42851
|
function appStoreDecision(held, read) {
|
|
42103
42852
|
if (!held) return "new";
|
|
42104
42853
|
if (held.key !== read.key) return "other-key";
|
|
@@ -42881,6 +43630,6 @@ function x401ApprovalDigest(subject) {
|
|
|
42881
43630
|
return toBase64Url(sha256(utf8Encode(canonical)));
|
|
42882
43631
|
}
|
|
42883
43632
|
//#endregion
|
|
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 };
|
|
43633
|
+
export { sealGroupTyping as $, TURN_NAME_BYTES as $C, readDeviceInvite as $S, generateEncryptionKey as $T, wrapDataChannel as $_, NO_PICTURE_METADATA as $a, planKnocks as $b, nextPinNumber as $c, storageProofBody as $d, validDomainRecord as $f, MAX_DHT_TEXT_BYTES as $g, GROUP_PROFILE as $h, parsePaymentAmount as $i, encodeAppRangeData as $l, BUTTON_STYLES as $m, verifySshSignature as $n, GROUP_HAVE_FRAME as $o, RateWindow as $p, DID_GHOSTLY_SERVICE as $r, PairedCalls as $s, CATCH_UP_PAUSE_MS as $t, DHT_TEXT_CAPABILITY as $u, HANDOFF_BUSY_REASONS as $v, RelaysFailedError as $w, isAppLicense as $x, readHandoffAck as $y, readX401ProofResponseHeader as A, deviceLinkRendezvousSeed as AC, __toCommonJS as AE, verifyAppStatementBytes as AS, createRelayPayload as AT, VIEWER_PERMISSIONS_POLICY as A_, parsePayParams as Aa, ENROLL_PROOF as Ab, TYPING_KINDS as Ac, identityStatementText as Ad, newMailbox as Af, CONNECT_TIMEOUT_MS as Ag, shownTime as Ah, didDhtFromPublicKey as Ai, wakeRequest as Al, ReactionWindow as Am, groupMetaToHand as An, RACE_RELAYED_MS as Ao, parseVoiceMeta as Ap, atprotoProofRecord as Ar, wireHubPolicy as As, groupEntryUrl as At, REACTIONS_CAPABILITY as Au, waitForIceGathering as Av, ANSWER_READ_SPACING_MS as Aw, mergeContactKnocks as Ax, handoffContext as Ay, APP_STORE_KINDS as B, TURN_PUT_WINDOW_MS as BC, readCanonicalJson as BS, readDnsName as BT, viewerServicePolicy as B_, isFederationId as Ba, readEnrollGrant as Bb, parseTypingFrame as Bc, PROOF_ADAPTERS as Bd, decodeDnsResponse as Bf, DIRECT_OWN_ATTEMPTS as Bg, SAID_AGAIN as Bh, EVM_TEST_CHAINS as Bi, vapidKeysMatch as Bl, readReaction as Bm, verifyGroupMetaSignature as Bn, WAKE_LOST_MS as Bo, isPlayableVideoType as Bp, decodeAtprotoCommit as Br, mergeLobby as Bs, GroupWakeLimiter as Bt, sessionCapabilitiesFrame as Bu, MAX_SERVICES as Bv, DEPARTED_READS as Bw, APP_CLIENTS as Bx, handoffManifestFrames as By, buildX401TokenObject as C, HANDOFF_CAPABILITY as CC, toZ32 as CE, readAppRevocations as CS, isDiscoveryBudgetError as CT, guardViewerAnswer as C_, LIGHTNING_DESTINATION_PATTERN as Ca, verifySetUpdate as Cb, parseStatusFrame as Cc, boundIdentityDisplay as Cd, transportOrder as Cf, ratchetOn as Cg, taskProgress as Ch, DID_DHT_MAX_PAYLOAD as Ci, newWakeToken as Cl, readForwarded as Cm, encodeGroupMetaBody as Cn, MESSAGE_RECEIVE_LIMITS as Co, VOICE_LIMITS as Cp, u64 as Cr, MESH_HUBS as Cs, verifyCommunityCommit as Ct, BUTTONS_CAPABILITY as Cu, isCandidateAddress as Cv, turnReleaseMessage as Cw, knockHolds as Cx, filePartName as Cy, readX401ProofRequest as D, deviceKeyZ32 as DC, __esmMin as DE, signAppRevocation as DS, PKARR_FUTURE_SKEW_MS as DT, HttpHost as D_, invoiceCallbackUrl as Da, ENROLL_DONE as Db, statusFrame as Dc, identityRefusal as Dd, HoldKeys as Df, ratchetSessionOf as Dg, claimedTime as Dh, DidDhtError as Di, relayRequest as Dl, REACTED_FRAME as Dm, groupMetaNewer as Dn, PONG_WAIT_MS as Do, fileMessageText as Dp, ATPROTO_PROOF_COLLECTION as Dr, meshRendezvous as Ds, decodeGroupEntryLink as Dt, FILES_CAPABILITY as Du, pickCallCandidates as Dv, turnVerifierMark as Dw, linkRecords as Dx, handoffAttemptSucceeded as Dy, isX401Protocol as E, deviceFrameCapability as EC, __commonJSMin as EE, signAppObject as ES, MAX_DNS_PACKET_BYTES as ET, HttpClient as E_, findLightningDestination as Ea, ENROLL_CANCEL_REASONS as Eb, sanitizeStatusText as Ec, identityPresentationBytes as Ed, HOLD_LIMITS as Ef, ratchetSeal as Eg, arrivalKey as Eh, DID_DHT_VERSION as Ei, readWakePayload as El, QUICK_REACTIONS as Em, groupMetaChange as En, PAIRING_RETRY_MS as Eo, downsamplePeaks as Ep, ATPROTO_FULL_SCOPE as Er, meshHubs as Es, MAX_KNOCKS as Et, FILES_BINARY_CAPABILITY as Eu, parseCallSignal as Ev, turnStatedVerifier as Ew, knockSlotRecords as Ex, handoffAttemptFailed as Ey, appRevocationFor as F, signDeviceTransports as FC, parseImageMeta as FS, readOwnRelayPayload as FT, relativizeLocation as F_, findBolt11 as Fa, enrollGrantFrame as Fb, TYPING_STATUS_MAX as Fc, signIdentityPresentation as Fd, DOMAIN_MAX_RECORDS as Ff, LATE_ANSWER_MS as Fg, LEGACY_GROUP_MEMBERS as Fh, jwkThumbprint as Fi, decryptPushPayload as Fl, reactedFrame as Fm, parseGroupMetaBody as Fn, RTC_SIGNAL_RECEIVE_LIMIT as Fo, voiceLevelsOf as Fp, parseAtprotoDidDocument as Fr, freshHubs as Fs, GROUP_WAKE_FRAME as Ft, SessionCapabilities as Fu, emptyLinkRecords as Fv, CHAT_RESERVE as Fw, requestRecords as Fx, handoffEphemeral as Fy, readAppStore as G, keptAtEqualSequence as GC, readContactLink as GS, identityFromSeed as GT, LIMITS as G_, audioMetadataPatches as Ga, MAX_MISSED as Gb, typingKindOf as Gc, emptyProofLedger as Gd, isPublicAddress as Gf, AWAITING_PEER_MS as Gg, rememberAlone as Gh, TEST_USDT_FAUCET_AMOUNT as Gi, AppRanges as Gl, REPLY_LIMITS as Gm, SSH_PUBLIC_KEY_MAX as Gn, publishFailure as Go, EDIT_BUFFER_MS as Gp, parseAtprotoDidKey as Gr, readBeaconHead as Gs, GROUP_LIMITS as Gt, CAPS_ISSUED_BACK_MS as Gu, isViewerTag as Gv, GROUP_RATION_WINDOW_MS as Gw, APP_SCREENSHOTS_DIR as Gx, handoffRetryAfter as Gy, checkAppListing as H, TURN_SETTLE_MS as HC, CONTACT_LINK_VERSION as HS, IDENTITY_MEMO_MAX as HT, withViewerPolicy as H_, parseFedimintRequestPayload as Ha, verifyEnrollProof as Hb, sanitizeTypingStatus as Hc, PeerProofs as Hd, domainTxtRecord as Hf, DirectPathWatch as Hg, commitUntaggedHash as Hh, PaymentPreflightError as Hi, APP_RANGE_ERRORS as Hl, wireReaction as Hm, SSHSIG_MAX_ARMOR as Hn, pairedMessageFits as Ho, parseVideoMeta as Hp, encodeDagCbor as Hr, pickHubs as Hs, groupWakes as Ht, PairedSession as Hu, decodeServices as Hv, GROUP_BURST_MS as Hw, APP_FORBIDDEN_KEYS as Hx, handoffPakeFrame as Hy, appStoreDecision as I, unsignedDeviceTransports as IC, previewable as IS, signRelayPayload as IT, resolveTargetUrl as I_, ENDPOINT as Ia, enrollHelloFrame as Ib, TYPING_TIMEOUT_MS as Ic, verifyIdentityPresentation as Id, DOMAIN_METHODS as If, OFFER_HOST_GATHER_MS as Ig, MAX_GROUP_CHAIN as Ih, openDidDhtPayload as Ii, encryptPushPayload as Il, reactionEmoji as Im, parseGroupMetaFrame as In, RTC_UNSTARTED_MS as Io, voicePeaksOf as Ip, shortAtprotoDid as Ir, hubRank as Is, GROUP_WAKE_GROUP_LIMIT as It, TYPING_CAPABILITY as Iu, isEmptyLinkPacket as Iv, CHAT_RESERVE_MOST_SHARE as Iw, seenEntry as Ix, handoffFileMissingFrame as Iy, signAppStore as J, TOMBSTONE_TURN as JC, DEVICE_INVITE_OWN_DEVICE as JS, setPublicKeyFastPath as JT, decodeChunk as J_, VIDEO_METADATA_LIMITS as Ja, REOPEN_BELOW as Jb, PINNED_FRAME as Jc, nostrProofTemplate as Jd, parseDomainTxt as Jf, DHT_POLL_INTERVALS as Jg, signCommit as Jh, arkAddressPrefix as Ji, appRangeDataFrame as Jl, readReply as Jm, parseSshSignature as Jn, engineError as Jo, EDIT_RECEIVE_LIMIT as Jp, unsignedCommitBytes as Jr, validHead as Js, GroupSession as Jt, CAPS_PUBLISH_SPACING_MS as Ju, servicesToWire as Jv, HEDGE_MS as Jw, appViewOf as Jx, handoffVerifiedMessage as Jy, readAppStoreSteps as K, turnPutSummary as KC, DEVICE_INVITE_BYTES as KS, identityFromSeedB64 as KT, MAX_CHUNK_PAYLOAD_BYTES as K_, withoutAudioMetadata as Ka, MAX_WAITING as Kb, COMMUNITY_PIN_FRAME as Kc, importedProof as Kd, nip05RootKey as Kf, DAEMON_WATCH_PEER_IDLE_MS as Kg, rosterAdmin as Kh, USDT_PUBLIC_RPC as Ki, appRangeCancelFrame as Kl, groupReplyAuthor as Km, SshSigError as Kn, ENGINE_ERRORS as Ko, EDIT_FRAME as Kp, parseAtprotoVerificationKey as Kr, readLobby as Ks, GROUP_REACTED_FRAME as Kt, CAPS_LABEL as Ku, serviceIdFromName as Kv, GROUP_SIGNALING_ALLOWANCE_SHARE as Kw, APP_VIEWS as Kx, handoffStreamKey as Ky, appUpdateDecision as L, verifyDeviceTransports as LC, readImageMeta as LS, decodeDnsAnswers as LT, sanitizeRequestHeaders as L_, cashuRequestPayload as La, enrollMessage as Lb, TypingReceiver as Lc, IDENTITY_TIMELINE_MAX as Ld, DOMAIN_TXT_MAX_BYTES as Lf, REANSWERS as Lg, MAX_GROUP_MEMBERS as Lh, resolveDidDht as Li, generateVapidKeys as Ll, reactionFrame as Lm, parseGroupMetaStatement as Ln, SWITCH_RETIRE_MS as Lo, PLAYABLE_VIDEO as Lp, AtprotoCid as Lr, lobbyKeys as Ls, GROUP_WAKE_GROUP_WINDOW_MS as Lt, UPGRADE_CAPABILITY as Lu, parseLinkRecords as Lv, CHAT_RESERVE_PER_CHAT as Lw, stampHolds as Lx, handoffFileRequestFrame as Ly, readX401ProofResultHeader as M, deviceLinkSecret as MC, exifOrientation as MS, newerPacket as MT, VIEWER_SERVICE_CSP_RELAY_ONLY as M_, resolveLightningDestination as Ma, enrollCancelReason as Mb, TYPING_RATE_WINDOW_MS as Mc, newIdentityBinding as Md, DNS_LABEL as Mf, DataLink as Mg, GROUP_ID as Mh, didDhtRecords as Mi, PUSH_SERVICE_HOSTS as Ml, parseReactedFrame as Mm, keepPastGroupMeta as Mn, RELAYED_FIRST_MS as Mo, voiceDownloadName as Mp, checkAtprotoProofRecord as Mr, beaconKeys as Ms, knockRecords as Mt, SESSION_CAPABILITIES_FRAME as Mu, MAX_MSGS_PAYLOAD_B64 as Mv, BACKGROUND_REQUESTS_PER_MINUTE as Mw, readKnockSlot as Mx, handoffDataFrame as My, x401AnswerableRequests as N, devicePingFrame as NC, imageSize as NS, openRelayPayload as NT, formatLocalTarget as N_, BOLT11_PATTERN as Na, enrollDigits as Nb, TYPING_REFRESH_MS as Nc, receivedIdentityStatus as Nd, DNS_TYPE as Nf, GATHER_ATTEMPTS as Ng, GROUP_MEMBER_CAP as Nh, encodeDidDhtDeactivated as Ni, WebPushError as Nl, parseReactionFrame as Nm, nextGroupMetaRevision as Nn, RESUME_WAIT_MS as No, voiceFileName as Np, isAtprotoDid as Nr, beaconRecords as Ns, mergeKnocks as Nt, STATUS_CAPABILITY as Nu, RECORD_TTL as Nv, BACKGROUND_WHILE_SIGNALING as Nw, readLinkRecord as Nx, handoffDigest as Ny, readX401ProofRequestHeader as O, deviceLinkPairing as OC, __exportAll as OE, verifyAppRevocation as OS, PacketTooLargeError as OT, VIEWER_DROPPED_DIRECTIVES as O_, parseInvoiceCallback as Oa, ENROLL_GRANT as Ob, statusState as Oc, identityRevocationValue as Od, HoldRefusedError as Of, ratchetUnknownSession as Og, heardTime as Oh, decodeDidDhtPacket as Oi, wakeFrame as Ol, REACTION_FRAME as Om, groupMetaPicture as On, RACE_ANSWERED_MS as Oo, formatVoiceDuration as Op, ATPROTO_PROOF_SCOPE as Or, parseHubPolicy as Os, encodeGroupEntryLink as Ot, KNOWN_SESSION_CAPABILITIES as Ou, sdpHasCandidates as Ov, ANSWER_READ_ALLOWANCE as Ow, makeStamp as Ox, handoffBusyFrame as Oy, addedAppPermissions as P, newDeviceSetSecret as PC, isImageMime as PS, parseRelayPayload as PT, parseLocalTarget as P_, decodeBolt11 as Pa, enrollDoneFrame as Pb, TYPING_SEND_LIMIT as Pc, revokesIdentity as Pd, DOMAIN_FILE_MAX_BYTES as Pf, GATHER_STALL_MS as Pg, GROUP_VERSION_LARGE as Ph, encodeDidDhtPacket as Pi, checkPushEndpoint as Pl, queueReaction as Pm, openGroupMeta as Pn, RTC_SIGNAL_RATE_WINDOW_MS as Po, voiceLevel as Pp, normalizeAtprotoHandle as Pr, doorHubs as Ps, readKnocks as Pt, STATUS_CARD_CAPABILITY as Pu, buildLinkRecords as Pv, BACKGROUND_WRITES_SHARE as Pw, requestPlaintextBytes as Px, handoffDoneFrame as Py, openGroupTyping as Q, TURN_MAX as QC, encodeDeviceInvite as QS, encrypt as QT, sendBody as Q_, withoutVideoMetadata as Qa, newInbox as Qb, mayPin as Qc, storageProof as Qd, txtValue as Qf, LinkSession as Qg, verifyCommitSignature as Qh, isWalletNetwork as Qi, decodeAppRangeData as Ql, BUTTON_ID as Qm, sshSignCommand as Qn, GROUP_FILE_LIMITS as Qo, REMOVED_TEXT as Qp, DID_FILE_MAX_BYTES as Qr, PAIRED_CALL_FRAME as Qs, groupMessageId as Qt, CapsRefusedError as Qu, HANDOFF_BUSY as Qv, RelayTransport as Qw, findAppForbiddenKey as Qx, openHandoffPiece as Qy, checkAppBeforeRun as R, seedSigner as RC, canonicalJson as RS, decodeTxtPacket as RT, sanitizeResponseHeaders as R_, fedimintRequestPayload as Ra, enrollProofFrame as Rb, TypingSender as Rc, applyIdentityEvent as Rd, NIP05_PATH as Rf, STALLED_EVIDENCE_MS as Rg, MEMBER_KEY as Rh, signDidDhtPacket as Ri, pushRequest as Rl, reactionIsNewer as Rm, parseGroupMetaTag as Rn, UNPROVEN_AUTH_MS as Ro, VIDEO_LIMITS as Rp, AtprotoProofError as Rr, lobbyRecords as Rs, GROUP_WAKE_MEMBER_INTERVAL_MS as Rt, WAKE_SESSION_CAPABILITY as Ru, HTTP_SERVICE_PROTO as Rv, CHAT_WATCH_SHARE as Rw, APP_BUNDLE_LIMITS as Rx, handoffHaveFrames as Ry, buildX401ResultArtifact as S, ENROLL_CAPABILITY as SC, toBase64Url as SE, readAppRevocationShape as SS, heldBackError as ST, allowingViewerGuard as S_, pubkyHomeserverOf as Sa, signTombstone as Sb, liveStatus as Sc, IdentityExchange as Sd, relayedTransports as Sf, ratchetHeard as Sg, statusCardText as Sh, strictBase64Url as Si, deviceWakeRequest as Sl, forwardedMany as Sm, MAX_GROUP_PICTURE_LENGTH as Sn, MAX_PAIRED_MESSAGE_FRAME as So, RECORDING_TYPES as Sp, u32$1 as Sr, GROUP_VERSION_HUBS as Ss, verifyCommunityChainPaced as St, APP_RANGES_CAPABILITY as Su, heardCallSignal as Sv, turnPayloadSequence as Sw, contactDay as Sx, filePartDigest as Sy, encodeX401Header as T, deviceEchoNonce as TC, utf8Encode as TE, setAppSignatureFastPath as TS, withRequestOptions as TT, GhostlyHttpError as T_, fetchLnurlJson as Ta, ENROLL_CANCEL as Tb, sameStatusState as Tc, emptyIdentityLedger as Td, HOLD_DATED_BACK_MS as Tf, ratchetRoot as Tg, MESSAGE_CLOCK_SKEW_MS as Th, DID_DHT_TTL as Ti, readWake as Tl, GROUP_REACTION_FRAME as Tm, groupMetaBody as Tn, PAIRING_ATTEMPT_MS as To, baseMime as Tp, ATPROTO_DECLARED_SCOPE as Tr, mayBeHub as Ts, KNOCK_TTL_MS as Tt, EDIT_CAPABILITY as Tu, keepsToRelays as Tv, turnSignedMessage as Tw, knockSlotOf as Tx, handoffAttemptAllowed as Ty, checkAppStoreIndex as U, TURN_VISIBLE_MS as UC, createContactLink as US, IDENTITY_MEMO_SIZE as UT, CHUNK_FLAG_END as U_, AUDIO_METADATA_LIMITS as Ua, FLOOD_PER_DAY as Ub, typingActivity as Uc, STORAGE_LIFETIME as Ud, domainWellKnownFile as Uf, directBlocked as Ug, expectedRoster as Uh, SEPOLIA_TEST_USDT as Ui, APP_RANGE_FRAMES as Ul, PAIRED_REPLY_AUTHORS as Um, SSHSIG_NAMESPACE as Un, pairedMessageFrame as Uo, EDITED_FRAME as Up, findInMst as Ur, rankHubs as Us, mentionedMembers as Ut, SESSION_FRAME_MAX as Uu, encodeServices as Uv, GROUP_BURST_ONE_LINK as Uw, APP_ICON_PATH as Ux, handoffReleaseFrame as Uy, APP_STORE_LIMITS as V, TURN_RAISE_READ_TIMEOUT_MS as VC, CONTACT_LINK_BYTES as VS, IDENTITY_MEMO_IDLE_MS as VT, webLocalFetch as V_, parseCashuRequestPayload as Va, readEnrollHello as Vb, plainStatusLine as Vc, PROOF_CAPABILITY as Vd, dnsProofName as Vf, DIRECT_PEERS as Vg, commitHash as Vh, ONCHAIN_PROVIDER as Vi, APP_RANGE_DATA_KIND as Vl, validReactionNumber as Vm, wrapGroupMeta as Vn, pairedEditFits as Vo, isVideoMime as Vp, decodeDagCbor as Vr, newerHead as Vs, groupWakeFrame as Vt, PAIRED_PROFILE as Vu, SERVICES_VERSION as Vv, FRESH_READ_MS as Vw, APP_CLIENT_NAME as Vx, handoffOfferFrame as Vy, readAppListing as W, classifyTurnRead as WC, encodeContactLink as WS, createIdentity as WT, CHUNK_KIND as W_, NO_AUDIO_METADATA as Wa, MAX_DONE as Wb, typingFrame as Wc, STORAGE_ROOT as Wd, encodeDnsQuery as Wf, symmetricNat as Wg, parseGroupCommit as Wh, SEPOLIA_TEST_USDT_FAUCET as Wi, APP_RANGE_LIMITS as Wl, REPLY_ID as Wm, SSH_KEY_TYPES as Wn, parsePaymentNetworks as Wo, EDIT_BUFFER_MAX as Wp, parseAtprotoCar as Wr, readBeacon as Ws, parseGroupWakeFrame as Wt, SESSION_RECEIVE_PENDING as Wu, isValidServiceId as Wv, GROUP_OVER_PACE_MS as Ww, APP_PERMISSIONS as Wx, handoffRequestFrame as Wy, GroupTypingBoard as X, TURN_LABEL as XC, deviceInviteJoinerKeyZ32 as XS, verify as XT, encodeChunk as X_, readingAhead as Xa, endedRequests as Xb, PIN_FRAME as Xc, proofHash as Xd, recordsFromWellKnown as Xf, FIRST_PUBLISH_MAX_MS as Xg, verifyChain as Xh, assertWholeSats as Xi, appRangeErrorFrame as Xl, wireReply as Xm, sshFingerprint as Xn, parseEngineError as Xo, MAX_EDITS_PER_MESSAGE as Xp, verifyAtprotoSignature as Xr, CALL_RECEIVE_LIMIT as Xs, chainPieces as Xt, CapsExchange as Xu, HANDOFF_ACK as Xv, RELAY_REQUESTS_PER_MINUTE as Xw, buildAppBundle as Xx, isHandoffPartName as Xy, GROUP_TYPING_FRAME as Y, TURN_BODY_BYTES as YC, createDeviceInvite as YS, sign as YT, decodeControl as Y_, isAsf as Ya, clearMissed as Yb, PIN_CLOCK_SKEW_MS as Yc, proofCapability as Yd, recordsFromTxt as Yf, EXPECT_PEER_MS as Yg, sortRoster as Yh, assertTokenUnits as Yi, appRangeEndFrame as Yl, replySnippet as Ym, sameSshKey as Yn, engineText as Yo, EDIT_SEND_LIMIT as Yp, verifyAtprotoRecordProof as Yr, CALL_RATE_WINDOW_MS as Ys, asWritten as Yt, CAPS_REFRESH_MS as Yu, viewerTag as Yv, PREVIOUS_DEFAULT_RELAYS as Yw, assembleAppBundle as Yx, handoffVersions as Yy, groupTypingEpoch as Z, TURN_LAST_SEQUENCE as ZC, deviceInviteJoinerParams as ZS, decrypt as ZT, encodeControl as Z_, videoMetadataPatches as Za, inboxRecord as Zb, PIN_LIMITS as Zc, proofStatement as Zd, recordsName as Zf, IDLE_THRESHOLD as Zg, verifyCommit as Zh, formatPaymentAmount as Zi, appRangeGetFrame as Zl, ACTIVE_TASK_STATUSES as Zm, sshKeyDigestHex as Zn, PairingTracker as Zo, MAX_REMOVAL_NUMBER as Zp, DID_DOCUMENT_MAX_BYTES as Zr, MAX_PAIRED_CALL_SIGNAL as Zs, frameBytes as Zt, CapsKeys as Zu, HANDOFF_ATTEMPTS as Zv, REQUESTS_PER_MINUTE as Zw, checkAppManifest as Zx, newHandoffId as Zy, X401_PROTOCOLS as _, readInviteCode as _C, fromBase64Url as _E, isAppKey as _S, BREAKER_THRESHOLD as _T, VIEWER_GUARD_CSP as __, pubkyProofFile as _a, encodeSetSlots as _b, STATUS_RATE_WINDOW_MS as _c, IDENTITY_REUSE_CHECK_S as _d, dialableIrohRelay as _f, RATCHET_KEEP_MS as _g, checkStatusCard as _h, parseDidDocument as _i, WAKE_ONLINE_TTL_SECONDS as _l, previewImageSize as _m, GROUP_META_PAST as _n, HANDLED_WAIT_MS as _o, formatFileSize as _p, encodeTx as _r, SIGNAL_HOLD_MS as _s, rosterHash as _t, isAppVersion as _u, callSignalHeardAt as _v, signTurnRelease as _w, STAMP_BITS_DEFAULT as _x, HANDOFF_TIMINGS as _y, X401_DCQL_LIMITS as a, OwnInviteError as aC, sanitizeAvatar as aE, sha256Paced as aS, WATCH_SHARE as aT, RELAY_POLL_INTERVALS as a_, sparkAddressKind as aa, readHandoffHave as ab, FileUplink as ac, IDENTITY_CHALLENGE_WINDOW as ad, ringAuthorization as af, epochKeys as ag, ROUTINE_STATES as ah, checkDidJws as ai, pinnedFrame as al, validEditMessage as am, carryMentions as an, ANSWERS_REFUSED_PAUSE_MS as ao, DHT_TEXT_BYTES as ap, bip322MessageHash as ar, isGroupMessageId as as, communityGroupId as at, APP_PEER_OPEN_MAX as au, extractRtcParams as av, TURN_TTL as aw, ContactRequestError as ax, HANDOFF_FILE_REQUEST as ay, buildX401ProofRequest as b, DEVICE_ECHO_FRAME as bC, randomBytes as bE, isAppSignature as bS, PublishFailedError as bT, VIEWER_WORKER_GUARD_CSP as b_, encodeSvcbPacket as ba, setUpdateFrame as bb, StatusReceiver as bc, IDENTITY_SUBJECT as bd, rankTransports as bf, emptyRatchetState as bg, sameButtonText as bh, signingKeys as bi, WAKE_TTL_SECONDS as bl, FORWARD_LIMITS as bm, MAX_GROUP_NAME_BYTES as bn, LIVENESS_MISSED_PINGS as bo, sanitizeMime as bp, sha256d as br, groupSignalFrame as bs, signCommunity as bt, readAppFrame as bu, decompressSdp as bv, turnName as bw, contactAskerFrame as bx, HANDOFF_WINDOW as by, readX401DcqlQuery as c, decodeInviteCode as cC, hasVisible as cE, APP_PREFIXES as cS, currentRelays as cT, STALLED_LOOK_MS as c_, BITCOIN_NETWORKS as ca, readHandoffPake as cb, refusalText as cc, IDENTITY_FRAME_LIMIT as cd, validRingKey as cf, openSecret as cg, TASK_STATUSES as ch, didJwsAlg as ci, WAKE_CALL_INTERVAL_MS as cl, LINK_MAX_CHARS as cm, meshMessageRef as cn, CROSSED_PROBE_MS as co, LIVE_POLL_MS as cp, decodeBase64 as cr, readGroupWant as cs, communityRoster as ct, APP_RESUME_GRACE_MS as cu, BURST_RING_MS as cv, encodeTurnFields as cw, LINK_RECORD_LABEL as cx, HANDOFF_LATER_BYTES as cy, newX401HolderKey as d, inviteLink as dC, stripHidden as dE, appRef as dS, relayUrlProblem as dT, UNUSED_INVITE_UPKEEP_MS as d_, PUBKY_PROOF_ROOT as da, readHandoffVerified as db, transferStalled as dc, IDENTITY_MAX_EVIDENCE as dd, AUTOMATIC_ORDER as df, sha256Hex as dg, buttonLabelClash as dh, didWebFile as di, WAKE_FRAME as dl, canonicalUrl as dm, MENTION_EVERYONE as dn, DEMOTE_MS as do, DHT_FILE_CAPABILITY as dp, ByteReader as dr, CarriedTransport as ds, derivedSecret as dt, AppSessions as du, PAIRED_CALL_CANDIDATES as dv, openTurnValue as dw, REQUEST_CLOCK_SKEW_MS as dx, HANDOFF_OFFER as dy, DEVICE_INVITE_VERSION as eC, sealedLength as eE, isAppPath as eS, SIGNALING_ALLOWANCE_SHARE as eT, OFFER_FAST_MS as e_, validatePaymentTarget as ea, readHandoffBusy as eb, parsePairedCallFrame as ec, capsDescriptors as ed, storageProofPath as ef, confirmationMatches as eg, CRON_LINE as eh, DID_JWS_ALGS as ei, parsePinFrame as el, dhtEditId as em, CATCH_UP_SLICE as en, PICTURE_METADATA_LIMITS as eo, wellKnownUrl as ep, isLegacySignature as er, GROUP_VERSION_FILES as es, COMMUNITY_LIMITS as et, isServeId as eu, DATA_CHANNEL_ID as ev, TURN_NO_ACTIVE as ew, settleRequest as ex, HANDOFF_CANCEL as ey, readX401SdJwtVc as f, inviteOwnership as fC, trimEndOf as fE, appRefPublisher as fS, setLinkTraceSink as fT, UNUSED_INVITE_WAIT_MAX_MS as f_, isPubkyKey as fa, sameDigest as fb, PRESENCES as fc, IDENTITY_MAX_FRAME as fd, RELAY_URL as ff, FOLLOW_MS as fg, cardEditNumber as fh, didWebFileNames as fi, WAKE_INTERVAL_MS as fl, linkEnd as fm, MENTION_LIMITS as fn, DHT_PIN_GRACE_MS as fo, dhtFileElements as fp, compactSize as fr, GROUP_SIGNAL_FRAME as fs, encodeCommunityLink as ft, appCloseFrame as fu, QUICK_REDIAL_MS as fv, readTurnBody as fw, REQUEST_LABEL as fx, HANDOFF_PAKE as fy, X401_LIMITS as g, pastedAgain as gC, fromBase64 as gE, isAppHash as gS, BREAKER_MAX_MS as gT, unusedInviteWait as g_, pubkyProofCapability as ga, SET_UPDATE as gb, STATUS_RATE_LIMIT as gc, IDENTITY_PROVIDER_ID as gd, checkedDescriptors as gf, RATCHET_HEADER_BYTES as gg, cardUrl as gh, parseDid as gi, WAKE_ONLINE_INTERVAL_MS as gl, parseLinkPreview as gm, wireMentions as gn, GhostLink as go, PREVIEWABLE_IMAGE as gp, decodeWitness as gr, SIGNAL_FRESH_MS as gs, leftStatement as gt, chatAppId as gu, callRtcConfig as gv, signTurnPacket as gw, REQUEST_TEXT_BYTES as gx, HANDOFF_REQUEST as gy, X401_HEADERS as h, ownInviteRefusal as hC, concatBytes as hE, checkAppRevokeStatement as hS, BREAKER_BASE_MS as hT, presenceSeenAt as h_, normalizePubkyKey as ha, SET_ACK as hb, STATUS_IDLE_AFTER_MS as hc, IDENTITY_PROOF_CAPABILITY as hd, automaticTransport as hf, RATCHET_CAPABILITY as hg, cardTimeUtc as hh, normalizeDid as hi, WAKE_ONLINE_DELAY_MS as hl, linksIn as hm, validMentions as hn, FIRST_PAIRING_PACE_MS as ho, FileTransfers as hp, decodeTx as hr, SIGNAL_CARRIERS as hs, leaveStatement3 as ht, appOpenFrame as hu, buildSdpFromSignal as hv, signTurnBody as hw, REQUEST_PACKET_BYTES as hx, HANDOFF_RELEASE as hy, x401ApprovalDigest as i, INVITE_VERSION as iC, jpegSize$1 as iE, readAppBundleAsync as iS, TURN_SOURCE_TIMEOUT_MS as iT, PRESENCE_WINDOW as i_, isSparkAddress as ia, readHandoffFileFrame as ib, FILE_LIMITS as ic, parsePacketTransports as id, RING_LIFETIME as if, encryptText as ig, REMOVABLE_KINDS as ih, DidError as ii, pinNumberHolds as il, parseEditedFrame as im, GROUP_EDIT_TEXT_BYTES as in, ANSWERS_REFUSED_PAUSES as io, DHT_MESSAGE_TTL as ip, MessageRefusal as ir, groupFileFallback as is, communityCommitHash as it, APP_FRAME as iu, buildDataSdp as iv, TURN_SLOTS as iw, CONTACT_RECORD_TTL as ix, HANDOFF_FILE_MISSING as iy, readX401ProofResult as j, deviceLinkSealKey as jC, IMAGE_LIMITS as jS, measureRecords as jT, VIEWER_SERVICE_CSP as j_, requestLnurlInvoice as ja, enrollCancelFrame as jb, TYPING_RATE_LIMIT as jc, isIdentityBinding as jd, readManifest as jf, DATA_SETTLE_MS as jg, GROUP_ADMIN_OFF_ERROR as jh, didDhtKey as ji, PUSH_PAD_BYTES as jl, nextReactionNumber as jm, groupName as jn, REDESCRIBED_GRACE_MS as jo, recordingMime as jp, atprotoProofRkey as jr, COMMUNITY_TOPOLOGY as js, knockIdentity as jt, SERVICES_CAPABILITY as ju, LABEL$1 as jv, AWAITED_READS as jw, openRequest as jx, handoffContextProof as jy, readX401ProofResponse as k, deviceLinkParams as kC, __require as kE, verifyAppSignature as kS, RELAY_PAYLOAD_MAX_BYTES as kT, VIEWER_DROPPED_HEADERS as k_, parseLightningDestination as ka, ENROLL_HELLO as kb, TYPING_FRAME as kc, identityStatement as kd, isHoldUrl as kf, ANSWER_REFUSED_REDIALS as kg, receivedTimestamp as kh, didDhtDocument as ki, wakePayload as kl, REACTION_LIMITS as km, groupMetaTag as kn, RACE_DIRECT_MS as ko, isPlayableAudioType as kp, atprotoDidMethod as kr, pickMeshHubs as ks, entryParams as kt, PIN_CAPABILITY as ku, signalHasVideo as kv, ANSWER_READ_FIRST_MS as kw, makeStampPaced as kx, handoffCancelFrame as ky, x401VpToken as l, encodeGhostlyInvite as lC, sanitizeDisplayText as lE, APP_STATEMENT_LIMITS as lS, normalizeRelayUrl as lT, TRANSPORTS_GONE_MS as l_, isBitcoinAddress as la, readHandoffRelease as lb, sentWhole as lc, IDENTITY_FRAME_WINDOW_MS as ld, verifyRingAuthorization as lf, sealPair as lg, appCardId as lh, didSignedMessages as li, WAKE_CALL_TTL_SECONDS as ll, LINK_PREVIEW_LIMITS as lm, parseCommunityEdit as ln, CROSSED_WAIT_MS as lo, emptyDhtDeliveryState as lp, verifyBip322 as lr, readGroupWantNo as ls, communityUntaggedHash as lt, APP_SEND_LIMIT as lu, CALL_SIGNAL_FUTURE_MS as lv, firstDeviceSetSecret as lw, MAX_SEEN as lx, HANDOFF_LIST_PER_FRAME as ly, x401HolderJwk as m, inviteQrText as mC, bytesEqual as mE, appSignedBytes as mS, BREAKER_ALL_DOWN_PROBE_MS as mT, countUnusedInvite as m_, newPubkyProofFolder as ma, sortParts as mb, STATUS_FRAME as mc, IDENTITY_MAX_VALIDITY as md, TRANSPORTS as mf, MAX_SKIPPED_KEYS as mg, cardLinkHost as mh, didWebHost as mi, WAKE_ONLINE_BATCH_MS as ml, linkTail as mm, mentionsMember as mn, EARLY_DIAL_JOIN_MS as mo, readDhtFile as mp, decodeBitcoinAddress as mr, SIGNALS_PER_MINUTE as ms, leaveStatement as mt, appDataFrame as mu, answersOffer as mv, sealTurnBody as mw, REQUEST_NAME_UNITS as mx, HANDOFF_PIECE_OVERHEAD as my, X401_RESPONSE_MODES as n, INVITE_LINK_ORIGIN as nC, MAX_AVATAR_LENGTH as nE, pacer as nS, SLOW_DEMOTE_MS as nT, OFFER_STEP_MAX as n_, SPARK_NETWORKS as na, readHandoffData as nb, FILE_DATA_KIND as nc, emptyCapsState as nd, verifyNostrProof as nf, decryptText as ng, PR_CHECKS as nh, DID_MAX_LENGTH as ni, pinFrame as nl, editedFrame as nm, COMMUNITY_EDIT_FRAME as nn, stripPictureMetadata as no, DHT_FILE_REFUSED as np, verifyBitcoinMessage as nr, GROUP_WANT_NO_FRAME as ns, CommunitySession as nt, readAppRangeFrame as nu, RTC_SIGNAL_FUTURE_MS as nv, TURN_SEALED_BYTES as nw, turnOff as nx, HANDOFF_DATA as ny, matchX401Dcql as o, createChatInvite as oC, MAX_NICK_LENGTH as oE, yieldThread as oS, WAY_BACK_SHARE as oT, SIGNAL_DUE_READS as o_, sparkInvoiceDetails as oa, readHandoffHello as ob, decodeFileData as oc, IDENTITY_CHECK_UNAVAILABLE as od, ringClaims as of, newEpochSecret as og, RUN_RESULTS as oh, checkDidSignature as oi, readPin as ol, validEditNumber as om, communityEditFrame as on, BLOCKED_DIAL_WAIT_MS as oo, DHT_TEXT_REFUSED as op, bip322ToSign as or, readGroupFileMeta as os, communityHasFrame as ot, APP_RATE_LIMIT as ou, offerIsFresh as ov, TURN_VERSION as ow, KNOCK_SLOTS as ox, HANDOFF_HAVE as oy, sameX401HolderJwk as p, inviteQrSegments as pC, unwrapPasted as pE, appRevocationId as pS, traceLink as pT, WATCH_PEER_MS as p_, isPubkyProofFolder as pa, sealHandoffPiece as pb, STATUS_AVAILABILITIES as pc, IDENTITY_MAX_RECEIVED as pd, RELAY_WITH_SECRETS as pf, MAX_SKIP as pg, cardLine as ph, didWebFileUrl as pi, WAKE_ONLINE_BATCH as pl, linkStop as pm, mentionsBytes as pn, DIALED_IN_CONTENDERS as po, dhtFileId as pp, decodeAnyBitcoinAddress as pr, GROUP_VERSION_SIGNALS as ps, leaveStands as pt, appDataBytes as pu, RTC_CONFIG as pv, readTurnPacket as pw, REQUEST_LIFETIME_MS as px, HANDOFF_PIECE_BYTES as py, repeatedJsonKey as q, TOMBSTONE_SEQUENCE as qC, DEVICE_INVITE_LIFETIME_S as qS, publicKeyFromZ32 as qT, PROTOCOL_VERSION as q_, NO_VIDEO_METADATA as qa, NEW_PER_HOUR as qb, GROUP_PIN_FRAME as qc, isProofAdapter as qd, normalizeDomain as qf, DEPARTED_READ_MS as qg, rosterHas as qh, WALLET_NETWORKS as qi, appRangeChunk as ql, pairedReplyAuthor as qm, parseSshPublicKey as qn, EngineError as qo, EDIT_RATE_WINDOW_MS as qp, readAtprotoCid as qr, shouldBeHub as qs, GROUP_READ_NOTE as qt, CAPS_LIMITS as qu, servicesFromWire as qv, HEDGE_MISSING_MS as qw, appDigest as qx, handoffVerifiedFrame as qy, readX401OpenId4VpRequest as r, INVITE_MAX_LENGTH as rC, MAX_AVATAR_SIDE as rE, readAppBundle as rS, SLOW_MS as rT, PRESENCE_HEARTBEAT as r_, SPARK_PROVIDER as ra, readHandoffDone as rb, FILE_FRAMES as rc, encodePacketTransports as rd, verifyPeerProof as rf, edgeParams as rg, PR_STATES as rh, DID_METHODS as ri, pinIsNewer as rl, parseEditFrame as rm, GROUP_EDIT_FRAME as rn, withoutPictureMetadata as ro, DHT_FILE_TOO_LARGE as rp, BIP322_REVISION as rr, fetchesByItself as rs, GROUP_READ_NOTE_COMMUNITY as rt, APP_DATA_MAX_BYTES as ru, RTC_SIGNAL_MAX_AGE_MS as rv, TURN_SIGNED_BYTES as rw, CONTACT_ASKER_FRAME as rx, HANDOFF_DONE as ry, presentX401SdJwtVc as s, createLink as sC, dropLoneJoiners as sE, APP_NAME as sS, WRITE_FIRST_MS as sT, SIGNAL_OUT_READS as s_, sparkNetworkOf as sa, readHandoffManifest as sb, encodeFileData as sc, IDENTITY_CLOCK_SKEW as sd, ringEvidence as sf, openPair as sg, STATUS_CARD_LIMITS as sh, didGhostlyServiceEntry as si, DEVICE_WAKE_TTL_SECONDS as sl, validRemovalNumber as sm, communityMessageAuthor as sn, CROSSED_FRESH_MS as so, DhtDelivery as sp, bip322ToSpend as sr, readGroupHave as ss, communityMessageId as st, APP_RATE_WINDOW_MS as su, parseRtcSignal as sv, TurnRecordError as sw, KNOCK_SLOT_LABEL as sx, HANDOFF_HELLO as sy, X401_REQUEST_LIMITS as t, INVITE_HRP as tC, tryDecrypt as tE, isAppUrl as tS, SIGNALING_WINDOW_MS as tT, OFFER_LOOK_MS as t_, walletNetworkOf as ta, readHandoffCancel as tb, ChatFiles as tc, dialDescriptors as td, validExternalKey as tf, confirmationTag as tg, ITEM_STATES as th, DID_JWS_MAX_LENGTH as ti, parsePinnedFrame as tl, editFrame as tm, CatchUpAnswers as tn, isStrippedPicture as to, ACTIVE_DHT_POLL_MS as tp, legacyMessageHash as tr, GROUP_WANT_FRAME as ts, COMMUNITY_PROFILE as tt, parseAppRangeFrame as tu, DATA_CHANNEL_LABEL as tv, TURN_REV_LIMIT as tw, takeRequest as tx, HANDOFF_CANCEL_REASONS as ty, X401_CREDENTIAL_LIMITS as u, encodeInviteCode as uC, sanitizeNick as uE, appFingerprint as uS, readRelayBody as uT, UNUSED_INVITE_READS_PER_MINUTE as u_, PUBKY_PROOF_MAX_BYTES as ua, readHandoffTurnFrame as ub, transferEnded as uc, IDENTITY_MAX_CHECKS_PER_HOUR as ud, verifyRingEvidence as uf, sealSecret as ug, appCardUrl as uh, didWebDocumentUrl as ui, WAKE_CALL_WAIT_MS as ul, LINK_TRAILING as um, validEditText as un, DEMOTE_AFTER_FAILURES as uo, peekDhtMailbox as up, BitcoinAddressError as ur, CARRIED_DEFER_MS as us, decodeCommunityLink as ut, APP_VERSION_MAX as uu, CALL_SIGNAL_MAX_AGE_MS as uv, nextTurnPosition as uw, MAX_SLOT_KNOCKS as ux, HANDOFF_MANIFEST as uy, X401_SCHEME as v, DEVICES_CAPABILITY as vC, fromZ32 as vE, isAppLine as vS, RelayBreaker as vT, VIEWER_GUARD_HASH as v_, pubkyProofPath as va, readSetUpdate as vb, STATUS_SEND_INTERVAL_MS as vc, IDENTITY_REVOCATION_LABEL as vd, irohDescriptor as vf, RATCHET_OVERHEAD as vg, readStatusCard as vh, parseDidJws as vi, WAKE_RETRY_MS as vl, sanitizePreviewImage as vm, GROUP_META_PAST_CHARS as vn, INVITER_DIAL_GRACE_MS as vo, safeBlobType as vp, encodeWitness as vr, SIGNAL_PROVEN_MS as vs, routedCommunityFrame as vt, isChatAppId as vu, compressSdp as vv, turnInstance as vw, STAMP_BITS_MAX as vx, HANDOFF_VERIFIED as vy, decodeX401Header as w, deviceEchoFrame as wC, utf8Decode as wE, readAppSignature as wS, publishedNowhere as wT, viewerGuardOffset as w_, LNURL_LIMITS as wa, DEVICE_KINDS as wb, personStatus as wc, boundVerifiedIdentity as wd, HOLD_CAPABILITY as wf, ratchetOpen as wg, usageLeft as wh, DID_DHT_PREFIX as wi, parseWakeFrame as wl, COMMUNITY_REACTION_FRAME as wm, groupDisplayName as wn, PAIRED_FRAME_TOO_LARGE as wo, VOICE_METER as wp, varBytes as wr, NO_HUB_POLICY as ws, GROUP_ENTRY_PROFILE as wt, CALLS_CAPABILITY as wu, isGlobalIpv4Host as wv, turnSequence as ww, knockSlotIdentity as wx, handoffAckFrame as wy, buildX401ProofResult as x, DEVICE_PING_FRAME as xC, toBase64 as xE, readAppRevocation as xS, budgetRetryMs as xT, WEBRTC_GUARD as x_, homeserverWebEndpoint as xa, setUpdateMessage as xb, StatusSender as xc, IdentityCheckUnavailable as xd, relayUrl as xf, isRatcheted as xg, statusCardBytes as xh, staticDidDocument as xi, WakeLimiter as xl, forwardedAgain as xm, MAX_GROUP_NAME_LENGTH as xn, LIVENESS_PING_MS as xo, PLAYABLE_AUDIO as xp, txHash as xr, readGroupSignal as xs, verifyCommunityChain as xt, APPS_CAPABILITY as xu, extractParamsFromSdp as xv, turnPacket as xw, contactAskerHolds as xx, NO_ATTEMPTS as xy, X401_VERSION as y, DEVICE_CAPABILITIES as yC, isZ32Key as yE, isAppRef as yS, DiscoveryBudgetError as yT, VIEWER_GUARD_SCRIPT as y_, decodeSvcbRecords as ya, setAckFrame as yb, STATUS_TEXT_MAX as yc, IDENTITY_STATEMENT_PREFIX as yd, irohRelayUrl as yf, RatchetBox as yg, removedCardText as yh, parseDidSignaturePaste as yi, WAKE_SUBJECT as yl, uriEnd as ym, MAX_GROUP_META_BODY as yn, INVITE_TAKEN as yo, sanitizeFileName as yp, hash160 as yr, SIGNAL_REPLY_MS as ys, shortHash as yt, parseAppFrame as yu, contactRtcConfig as yv, turnKeys as yw, STAMP_BITS_MIN as yx, HANDOFF_VERSION as yy, planAppUpdate as z, webCryptoSigner as zC, canonicalJsonBytes as zS, encodeTxtPacket as zT, viewerResponseHeaders as z_, findEndpoint as za, formatEnrollDigits as zb, parseTypingActivity as zc, lastSharedWithMe as zd, WELL_KNOWN_PATH as zf, DIRECT_EVIDENCE_MS as zg, OWN_FRAME_LIMIT as zh, ETHEREUM_USDT as zi, vapidAuthorization as zl, readDhtReactions as zm, signGroupMeta as zn, WAKE_ANSWER_GRACE_MS as zo, formatVideoDuration as zp, atprotoCidFor as zr, mergeBeacon as zs, GROUP_WAKE_RECEIVE_LIMIT as zt, parseSessionCapabilities as zu, LEGACY_SERVICES as zv, DEFAULT_RELAYS as zw, APP_BUNDLE_MAGIC as zx, handoffHelloFrame as zy };
|
|
42885
43634
|
|
|
42886
|
-
//# sourceMappingURL=src-
|
|
43635
|
+
//# sourceMappingURL=src-CqAqFhh9.js.map
|