@ghostlytools/sdk 1.4.4 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/app.js +15 -7
  2. package/dist/app.js.map +1 -1
  3. package/dist/core.js +2 -2
  4. package/dist/{fakes-Cg-kTSO_.js → fakes-CdgaBLS1.js} +2 -2
  5. package/dist/{fakes-Cg-kTSO_.js.map → fakes-CdgaBLS1.js.map} +1 -1
  6. package/dist/fakes.js +1 -1
  7. package/dist/index.js +2 -2
  8. package/dist/{keet-identity-key-BHXtiqy8.js → keet-identity-key-D_bUxyiq.js} +2 -2
  9. package/dist/{keet-identity-key-BHXtiqy8.js.map → keet-identity-key-D_bUxyiq.js.map} +1 -1
  10. package/dist/{src-BdAF18HA.js → src-D9oJLTXM.js} +863 -83
  11. package/dist/src-D9oJLTXM.js.map +1 -0
  12. package/dist/testing.js +3 -3
  13. package/dist/types/core/src/callSignal.d.ts +33 -4
  14. package/dist/types/core/src/catchUp.d.ts +18 -5
  15. package/dist/types/core/src/dhtDelivery.d.ts +4 -4
  16. package/dist/types/core/src/ghostlink.d.ts +54 -1
  17. package/dist/types/core/src/groupCommunity.d.ts +27 -3
  18. package/dist/types/core/src/groupEdits.d.ts +6 -0
  19. package/dist/types/core/src/groupSession.d.ts +6 -3
  20. package/dist/types/core/src/index.d.ts +1 -0
  21. package/dist/types/core/src/miniApp.d.ts +39 -9
  22. package/dist/types/core/src/pairedAppRanges.d.ts +188 -0
  23. package/dist/types/core/src/pairedCapabilities.d.ts +6 -1
  24. package/dist/types/core/src/pairedEdits.d.ts +14 -1
  25. package/dist/types/core/src/relay.d.ts +12 -1
  26. package/dist/types/core/src/relayBreaker.d.ts +7 -2
  27. package/dist/types/core/src/signal.d.ts +4 -1
  28. package/dist/types/core/src/statusCards.d.ts +21 -1
  29. package/dist/{verify-BUV-kmKL.js → verify-DMeDznOh.js} +2 -2
  30. package/dist/{verify-BUV-kmKL.js.map → verify-DMeDznOh.js.map} +1 -1
  31. package/package.json +1 -1
  32. package/dist/src-BdAF18HA.js.map +0 -1
@@ -831,13 +831,24 @@ var RelayBreaker = class {
831
831
  const circuit = this.circuits.get(relay);
832
832
  if (circuit) circuit.probing = false;
833
833
  }
834
- /** The relay answered: whatever was wrong is over. */
835
- success(relay) {
834
+ /**
835
+ * The relay answered: whatever was wrong is over. When it was left alone and so was every other relay of `relays`
836
+ * (by default those that failed), for failing, the outage is over for them too: they are asked again now, not at the
837
+ * end of a wait of up to `BREAKER_MAX_MS` (two clients whose probes another relay answered each would share none
838
+ * for minutes). Their trips stay: one really down trips again at once, for longer.
839
+ */
840
+ success(relay, relays = [...this.circuits.keys()]) {
836
841
  const circuit = this.circuits.get(relay);
837
842
  if (!circuit) return;
838
843
  const recovered = circuit.openUntil !== 0;
839
844
  this.circuits.delete(relay);
840
- if (recovered) this.options.onRecover?.(relay);
845
+ if (!recovered) return;
846
+ const others = relays.filter((r) => r !== relay).map((r) => this.circuits.get(r));
847
+ if (others.length && others.every((other) => !!other && other.openUntil !== 0 && other.kind === "error")) {
848
+ const now = this.now();
849
+ for (const other of others) other.openUntil = Math.min(other.openUntil, now);
850
+ }
851
+ this.options.onRecover?.(relay);
841
852
  }
842
853
  /**
843
854
  * The relay failed a request; a probe that fails trips it again at once. While it is left alone and no probe is out,
@@ -1264,6 +1275,17 @@ function normalizeRelayUrl(input) {
1264
1275
  }
1265
1276
  /** A relay the breaker leaves alone for failing (`RelayBreaker`): nothing was asked of it now. */
1266
1277
  var RelayLeftAloneError = class extends Error {};
1278
+ /**
1279
+ * A read the relays failed (or left alone for failing before), when its caller has another path to ask
1280
+ * (`RelayTransport.resolve` with `keptOnFailure` false): `kept` is the newest packet the relays gave for the key before.
1281
+ */
1282
+ var RelaysFailedError = class extends Error {
1283
+ kept;
1284
+ constructor(kept) {
1285
+ super("No Pkarr relay reachable");
1286
+ this.kept = kept;
1287
+ }
1288
+ };
1267
1289
  var RelayTransport = class {
1268
1290
  relays;
1269
1291
  timeoutMs;
@@ -1426,7 +1448,7 @@ var RelayTransport = class {
1426
1448
  return;
1427
1449
  }
1428
1450
  if (method) this.networkCooldown.delete(`${method} ${relay}`);
1429
- this.breaker.success(relay);
1451
+ this.breaker.success(relay, this.relays);
1430
1452
  }
1431
1453
  setRelays(relays) {
1432
1454
  const normalized = relays.map(normalizeRelayUrl).filter((r) => r !== null);
@@ -1707,8 +1729,11 @@ var RelayTransport = class {
1707
1729
  *
1708
1730
  * A hedge spends a second request, so it goes only where the budget has requests to spare (`hedgeRoom`), never for a
1709
1731
  * background read (nobody waits on it), and later for a key whose last read found nothing (`HEDGE_MISSING_MS`).
1732
+ *
1733
+ * `keptOnFailure` false: a read the relays failed throws `RelaysFailedError` with the packet they gave last, in place
1734
+ * of handing that back as their answer (a CLI asks the DHT then, `RelaysAndDht`).
1710
1735
  */
1711
- async resolve(pubKeyZ32, options = {}) {
1736
+ async resolve(pubKeyZ32, options = {}, keptOnFailure = true) {
1712
1737
  if (this.relays.length === 0) throw new Error("No Pkarr relays configured");
1713
1738
  if (options.background && !options.urgent && !options.group) this.chatNeeds.delete(pubKeyZ32);
1714
1739
  const readAt = this.readAt.get(pubKeyZ32);
@@ -1842,6 +1867,7 @@ var RelayTransport = class {
1842
1867
  const resting = this.relays.every((r) => this.isCoolingDown(r, "GET") || this.breaker.blockedFor(r) > 0 || this.heldFor(r, who, Date.now(), pubKeyZ32) > 0);
1843
1868
  const known = down ? this.newest.get(pubKeyZ32) : newerPacket(this.newest.get(pubKeyZ32), this.written.get(pubKeyZ32));
1844
1869
  if (resting && known) {
1870
+ if (down && !keptOnFailure) throw new RelaysFailedError(known);
1845
1871
  if (!down && budgetWait < Infinity) this.heldBackUntil(pubKeyZ32, Date.now() + budgetWait);
1846
1872
  return known;
1847
1873
  }
@@ -1911,7 +1937,7 @@ var RelayTransport = class {
1911
1937
  slow(relay) {
1912
1938
  this.slowUntil.set(relay, Date.now() + SLOW_DEMOTE_MS);
1913
1939
  if (this.relays.some((r) => r !== relay && this.breaker.blockedFor(r) === 0 && !this.isCoolingDown(r, "GET"))) this.breaker.failure(relay, "error", "slow");
1914
- else this.breaker.success(relay);
1940
+ else this.breaker.success(relay, this.relays);
1915
1941
  }
1916
1942
  /**
1917
1943
  * A hedge may go to this relay: its minute has more requests left than what groups leave a chat (`reserveOf`), so
@@ -6505,11 +6531,15 @@ var RTC_CONFIG = {
6505
6531
  * A call's WebRTC configuration: the apps' STUN servers, then the profile's own (Settings → Network → ICE
6506
6532
  * servers: a TURN relay, typically). A relay is what connects a call when no direct path works: a VPN that takes
6507
6533
  * every packet through its tunnel, or a NAT that maps each destination apart.
6534
+ *
6535
+ * `relayOnly` ("Hide my IP from contacts", WISP 100 § Relay only): the profile's TURN servers alone, no STUN server
6536
+ * (the apps' or the profile's), and the relay policy, so the connection gathers and uses relay candidates only. With
6537
+ * no usable TURN server it has no server at all, and finds no candidate: it fails, it never goes direct.
6508
6538
  */
6509
- function callRtcConfig(extra = []) {
6539
+ function callRtcConfig(extra = [], { relayOnly = false } = {}) {
6510
6540
  const servers = [];
6511
6541
  for (const server of extra) {
6512
- const urls = (Array.isArray(server.urls) ? server.urls : server.urls.split(/[\s,]+/)).filter(Boolean);
6542
+ const urls = (Array.isArray(server.urls) ? server.urls : server.urls.split(/[\s,]+/)).filter(Boolean).filter((url) => !relayOnly || /^turns?:/i.test(url));
6513
6543
  if (!urls.length) continue;
6514
6544
  if (urls.some((url) => /^turns?:/i.test(url)) && (!server.username?.trim() || !server.credential?.trim())) continue;
6515
6545
  servers.push({
@@ -6518,12 +6548,30 @@ function callRtcConfig(extra = []) {
6518
6548
  ...server.credential ? { credential: server.credential } : {}
6519
6549
  });
6520
6550
  }
6551
+ if (relayOnly) return {
6552
+ ...RTC_CONFIG,
6553
+ iceServers: servers,
6554
+ iceTransportPolicy: "relay"
6555
+ };
6521
6556
  return {
6522
6557
  ...RTC_CONFIG,
6523
6558
  iceServers: [...RTC_CONFIG.iceServers ?? [], ...servers]
6524
6559
  };
6525
6560
  }
6526
6561
  /**
6562
+ * The WebRTC configuration of a chat's data link or a group's edge, from the profile's settings: its ICE servers,
6563
+ * and "Hide my IP from contacts" (`relayOnly`), as a call's (`callRtcConfig`). No candidate pool: an app holds one
6564
+ * such connection per chat and per group member, and a call only one.
6565
+ */
6566
+ function contactRtcConfig(settings) {
6567
+ const { iceCandidatePoolSize: _pool, ...config } = callRtcConfig(settings.iceServers ?? [], { relayOnly: settings.relayOnly === true });
6568
+ return config;
6569
+ }
6570
+ /** Whether a connection keeps to relays (`iceTransportPolicy: "relay"`): what it sends a contact is then relay candidates only. */
6571
+ function keepsToRelays(pc) {
6572
+ return pc?.getConfiguration?.().iceTransportPolicy === "relay";
6573
+ }
6574
+ /**
6527
6575
  * How many candidates a signal on the chat session carries (`paired-call`, WISP 601): the receiver takes eight.
6528
6576
  * A compatibility chat's `_call` record keeps to one host and one server reflexive candidate (a DHT packet's worth).
6529
6577
  */
@@ -6543,11 +6591,14 @@ var PAIRED_CALL_CANDIDATES = 8;
6543
6591
  *
6544
6592
  * UDP only, loopback, link-local and unspecified addresses left out (loopback kept with `loopback`), the related
6545
6593
  * address dropped (it is informational, and an IPv6 one broke apps before 0.5).
6594
+ *
6595
+ * `relayOnly` ("Hide my IP from contacts"): relay candidates alone, whatever else the connection gathered. A relay
6596
+ * candidate's address is the TURN server's; its related address, dropped as every one is, would be this device's.
6546
6597
  */
6547
- function pickCallCandidates(candidates, max = 8, { loopback = false } = {}) {
6548
- const udp = candidates.map((c) => c.trim()).filter((c) => / udp /i.test(c));
6549
- const address = (c) => c.split(" ")[4] ?? "";
6598
+ function pickCallCandidates(candidates, max = 8, { loopback = false, relayOnly = false } = {}) {
6550
6599
  const type = (c) => / typ (\S+)/.exec(c)?.[1];
6600
+ const udp = candidates.map((c) => c.trim()).filter((c) => / udp /i.test(c) && (!relayOnly || type(c) === "relay"));
6601
+ const address = (c) => c.split(" ")[4] ?? "";
6551
6602
  const cost = (c) => Number(/ network-cost (\d+)/.exec(c)?.[1] ?? 0);
6552
6603
  const ipv6 = (c) => address(c).includes(":");
6553
6604
  const usable = (c) => {
@@ -6572,9 +6623,10 @@ function pickCallCandidates(candidates, max = 8, { loopback = false } = {}) {
6572
6623
  /**
6573
6624
  * The parameters of a call signal, from an SDP. `maxCandidates` above two (a signal on the chat session) carries
6574
6625
  * the candidates `pickCallCandidates` chooses; the default keeps a compatibility chat's one host and one server
6575
- * reflexive candidate.
6626
+ * reflexive candidate. `relayOnly` ("Hide my IP from contacts"): relay candidates only, in either; a compatibility
6627
+ * chat's two then go to the first two relay ones.
6576
6628
  */
6577
- function extractParamsFromSdp(sdp, { maxCandidates = 2, loopback = false } = {}) {
6629
+ function extractParamsFromSdp(sdp, { maxCandidates = 2, loopback = false, relayOnly = false } = {}) {
6578
6630
  const lines = sdp.split("\r\n");
6579
6631
  let ufrag = "";
6580
6632
  let pwd = "";
@@ -6618,7 +6670,10 @@ function extractParamsFromSdp(sdp, { maxCandidates = 2, loopback = false } = {})
6618
6670
  }
6619
6671
  const srflxCandidates = candidates.filter((c) => / typ srflx( |$)/.test(c));
6620
6672
  const hostCandidates = candidates.filter((c) => / typ host( |$)/.test(c) && / udp /i.test(c));
6621
- const selectedCandidates = maxCandidates > 2 ? pickCallCandidates(candidates, maxCandidates, { loopback }) : [...hostCandidates.slice(0, 1), ...srflxCandidates.slice(0, 1)].map((c) => c.replace(/ raddr \S*:\S* rport \d+/, ""));
6673
+ const selectedCandidates = maxCandidates > 2 || relayOnly ? pickCallCandidates(candidates, maxCandidates, {
6674
+ loopback,
6675
+ relayOnly
6676
+ }) : [...hostCandidates.slice(0, 1), ...srflxCandidates.slice(0, 1)].map((c) => c.replace(/ raddr \S+ rport \d+/, ""));
6622
6677
  const ssrcs = [];
6623
6678
  if (audioSsrc !== null) ssrcs.push(audioSsrc);
6624
6679
  if (videoSsrc !== null) ssrcs.push(videoSsrc);
@@ -7062,7 +7117,8 @@ function hostRank(parts, reflexiveBases) {
7062
7117
  const wayOut = reflexiveBases.has(parts[4]) || isGlobalIpv4Host(parts.join(" "));
7063
7118
  return (costly ? 2 : 0) + (wayOut ? 0 : 1);
7064
7119
  }
7065
- function extractRtcParams(sdp) {
7120
+ /** `relayOnly` ("Hide my IP from contacts", the connection keeps to relays): relay candidates only, whatever else is in the SDP. */
7121
+ function extractRtcParams(sdp, { relayOnly = false } = {}) {
7066
7122
  let u = "";
7067
7123
  let p = "";
7068
7124
  let f = "";
@@ -7078,7 +7134,7 @@ function extractRtcParams(sdp) {
7078
7134
  const parts = line.slice(12).split(" ");
7079
7135
  if (parts.length < 8 || parts[1] !== "1" || parts[2].toLowerCase() !== "udp") continue;
7080
7136
  const type = CANDIDATE_TYPES[parts[7]];
7081
- if (!type) continue;
7137
+ if (!type || relayOnly && type !== "r") continue;
7082
7138
  const compact = `${type},${parts[4]},${parts[5]}`;
7083
7139
  if (found.some((c) => c.compact === compact)) continue;
7084
7140
  found.push({
@@ -9058,7 +9114,7 @@ var DataLink = class {
9058
9114
  const signal = {
9059
9115
  t: "o",
9060
9116
  ts: this.myOfferTs,
9061
- ...extractRtcParams(pc.localDescription.sdp)
9117
+ ...extractRtcParams(pc.localDescription.sdp, { relayOnly: keepsToRelays(pc) })
9062
9118
  };
9063
9119
  this.options.publishSignal(JSON.stringify(signal));
9064
9120
  } catch {
@@ -9245,7 +9301,7 @@ var DataLink = class {
9245
9301
  t: "a",
9246
9302
  ts: Date.now(),
9247
9303
  o: offer.ts,
9248
- ...extractRtcParams(pc.localDescription.sdp)
9304
+ ...extractRtcParams(pc.localDescription.sdp, { relayOnly: keepsToRelays(pc) })
9249
9305
  };
9250
9306
  this.options.publishSignal(JSON.stringify(signal));
9251
9307
  this.setState("connecting");
@@ -9830,10 +9886,13 @@ var PR_CHECKS = [
9830
9886
  "failing",
9831
9887
  "pending"
9832
9888
  ];
9889
+ /** The kinds a sender may take back (WISP 405 § Removing a card). */
9890
+ var REMOVABLE_KINDS = ["task", "routine"];
9833
9891
  var ID$5 = /^[A-Za-z0-9_.:][A-Za-z0-9_.:-]{0,63}$/;
9834
9892
  /** A button's id: 1 to 32 of `A-Z a-z 0-9 _ . : -`, not starting with `-`. */
9835
9893
  var BUTTON_ID = /^[A-Za-z0-9_.:][A-Za-z0-9_.:-]{0,31}$/;
9836
- var CRON = /^[0-9A-Za-z*,/?#\- ]{1,64}$/;
9894
+ /** A routine's cron line, trimmed: 1 to 64 of `0-9 A-Z a-z * , / ? # -` and spaces (shown, never run). */
9895
+ var CRON_LINE = /^[0-9A-Za-z*,/?#\- ]{1,64}$/;
9837
9896
  /**
9838
9897
  * Whether a typed answer is a button's label or id (WISP 406 · Message Buttons): ignoring case and spaces at the ends.
9839
9898
  * Not the device's locale's case: the presser's and the author's apps must agree ("I" is not "ı" anywhere).
@@ -10020,6 +10079,14 @@ function readStatusCard(raw, now = Date.now()) {
10020
10079
  ...raw.opened === true && { opened: true }
10021
10080
  };
10022
10081
  }
10082
+ if (raw.kind === "removed") {
10083
+ const of = oneOf(REMOVABLE_KINDS, raw.of);
10084
+ return of && {
10085
+ kind: "removed",
10086
+ id,
10087
+ of
10088
+ };
10089
+ }
10023
10090
  const latest = now + MESSAGE_CLOCK_SKEW_MS;
10024
10091
  if (raw.kind === "usage") return readUsage(raw, id, now);
10025
10092
  const links = readLinks(raw.links);
@@ -10083,7 +10150,7 @@ function readStatusCard(raw, now = Date.now()) {
10083
10150
  if (raw.kind === "routine") {
10084
10151
  const name = cardLine(raw.name, STATUS_CARD_LIMITS.title), schedule = cardLine(raw.schedule, STATUS_CARD_LIMITS.schedule), state = oneOf(ROUTINE_STATES, raw.state);
10085
10152
  if (!name || !schedule || !state) return void 0;
10086
- const cron = typeof raw.cron === "string" && CRON.test(raw.cron.trim()) ? raw.cron.trim() : void 0;
10153
+ const cron = typeof raw.cron === "string" && CRON_LINE.test(raw.cron.trim()) ? raw.cron.trim() : void 0;
10087
10154
  const lastRun = readRun(raw.lastRun, now);
10088
10155
  const nextRunAt = typeof raw.nextRunAt === "number" && Number.isSafeInteger(raw.nextRunAt) && raw.nextRunAt > 0 && raw.nextRunAt <= now + STATUS_CARD_LIMITS.nextRunMs ? raw.nextRunAt : void 0;
10089
10156
  const runs = [];
@@ -10140,7 +10207,7 @@ function checkStatusCard(raw, now = Date.now()) {
10140
10207
  if (!isObject$7(raw)) return { error: "A card is an object" };
10141
10208
  const bytes = statusCardBytes(raw);
10142
10209
  if (bytes > STATUS_CARD_LIMITS.bytes) return { error: `The card takes ${bytes} bytes; at most ${STATUS_CARD_LIMITS.bytes}` };
10143
- if (raw.kind !== "task" && raw.kind !== "routine" && raw.kind !== "buttons" && raw.kind !== "app" && raw.kind !== "usage") return { error: "kind is task, routine, buttons, app or usage" };
10210
+ if (raw.kind !== "task" && raw.kind !== "routine" && raw.kind !== "buttons" && raw.kind !== "app" && raw.kind !== "usage" && raw.kind !== "removed") return { error: "kind is task, routine, buttons, app, usage or removed" };
10144
10211
  if (typeof raw.id !== "string" || !ID$5.test(raw.id)) return { error: `id is 1 to ${STATUS_CARD_LIMITS.id} of A-Z a-z 0-9 _ . : - and does not start with -` };
10145
10212
  const line = (field, value, max, required = false) => {
10146
10213
  if (value === void 0 && !required) return null;
@@ -10163,7 +10230,11 @@ function checkStatusCard(raw, now = Date.now()) {
10163
10230
  }
10164
10231
  const share = (field, value) => value === void 0 || typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 100 ? null : `${field} is a number from 0 to 100`;
10165
10232
  const reset = (field, value) => value === void 0 || ahead(value, now) !== void 0 ? null : `${field} is a time in milliseconds, within a year`;
10166
- if (raw.kind === "usage") {
10233
+ if (raw.kind === "removed") {
10234
+ if (!oneOf(REMOVABLE_KINDS, raw.of)) errors.push(`of is one of ${REMOVABLE_KINDS.join(", ")}`);
10235
+ const extra = Object.keys(raw).find((key) => key !== "kind" && key !== "id" && key !== "of");
10236
+ if (extra) errors.push(`a removed card takes only kind, id and of, not ${extra}`);
10237
+ } else if (raw.kind === "usage") {
10167
10238
  if (raw.links !== void 0) errors.push("a usage card takes no links");
10168
10239
  if (raw.left === void 0 && raw.used === void 0) errors.push("left (a percent) or used and limit");
10169
10240
  errors.push(share("left", raw.left));
@@ -10270,7 +10341,7 @@ function checkStatusCard(raw, now = Date.now()) {
10270
10341
  } else {
10271
10342
  errors.push(line("name", raw.name, STATUS_CARD_LIMITS.title, true), line("schedule", raw.schedule, STATUS_CARD_LIMITS.schedule, true));
10272
10343
  if (!oneOf(ROUTINE_STATES, raw.state)) errors.push(`state is one of ${ROUTINE_STATES.join(", ")}`);
10273
- if (raw.cron !== void 0 && !(typeof raw.cron === "string" && CRON.test(raw.cron.trim()))) errors.push(`cron is a cron line of at most ${STATUS_CARD_LIMITS.cron} characters`);
10344
+ if (raw.cron !== void 0 && !(typeof raw.cron === "string" && CRON_LINE.test(raw.cron.trim()))) errors.push(`cron is a cron line of at most ${STATUS_CARD_LIMITS.cron} characters`);
10274
10345
  if (raw.nextRunAt !== void 0 && !(typeof raw.nextRunAt === "number" && Number.isSafeInteger(raw.nextRunAt) && raw.nextRunAt > 0 && raw.nextRunAt <= now + STATUS_CARD_LIMITS.nextRunMs)) errors.push("nextRunAt is a time in milliseconds, within a year");
10275
10346
  const run = (field, value) => {
10276
10347
  if (!isObject$7(value)) return errors.push(`${field} is an object`);
@@ -10320,10 +10391,18 @@ function cardTimeUtc(ms) {
10320
10391
  return `${new Date(ms).toISOString().slice(0, 16).replace("T", " ")} UTC`;
10321
10392
  }
10322
10393
  /**
10394
+ * The text a removed card's message carries (WISP 405 § Removing a card): "🗑 Task removed", with the card's title or
10395
+ * name when the sender knows it ("🗑 Task removed: Fix relay rotation"). An app without the `removed` kind shows it.
10396
+ */
10397
+ function removedCardText(of, title) {
10398
+ return `🗑 ${of === "task" ? "Task" : "Routine"} removed${title ? `: ${title}` : ""}`;
10399
+ }
10400
+ /**
10323
10401
  * The text a card's message carries: what an app without cards shows, the DHT floor carries, the chat list previews
10324
10402
  * and search finds. Plain lines, the first naming the card, no bars or layout that would read badly elsewhere.
10325
10403
  */
10326
10404
  function statusCardText(card) {
10405
+ if (card.kind === "removed") return removedCardText(card.of);
10327
10406
  if (card.kind === "app") {
10328
10407
  const named = `${card.title}${card.version ? ` ${card.version}` : ""}`;
10329
10408
  return [card.opened ? `🧩 Opened ${named} in this chat (Ghostly app)` : `🧩 ${named} (Ghostly app)`, ...card.url ? [card.url] : []].join("\n");
@@ -10834,11 +10913,20 @@ function parseLinkPreview(raw, text) {
10834
10913
  * message. A status card (`sc`, WISP 405 · Status Cards) may come with it too; a card message takes up to
10835
10914
  * `STATUS_CARD_LIMITS.edits` edits, a number past `MAX_EDITS_PER_MESSAGE` holding only with a card. Older apps drop
10836
10915
  * both frames: they have an id, but a `t` they do not know.
10916
+ *
10917
+ * A removal (WISP 400 § Delete for everyone) is the message's last edit, flagged `rm`, with a fallback text and
10918
+ * nothing else beside it; an app from before removals shows that text as the edit:
10919
+ *
10920
+ * {"t":"paired-edit","id":"<the message's wire id>","e":4,"ts":1790000000000,"m":"🗑 Message removed","rm":true}
10837
10921
  */
10838
10922
  var EDIT_FRAME = "paired-edit";
10839
10923
  var EDITED_FRAME = "paired-edited";
10840
10924
  /** Edits one message takes; the sender refuses the next one and the receiver ignores a higher number. */
10841
10925
  var MAX_EDITS_PER_MESSAGE = 100;
10926
+ /** A removal is numbered one past the message's last edit, so it may pass a card message's bound by one. */
10927
+ var MAX_REMOVAL_NUMBER = STATUS_CARD_LIMITS.edits + 1;
10928
+ /** The text a removal carries: only what an app from before removals shows in the message's place. */
10929
+ var REMOVED_TEXT = "🗑 Message removed";
10842
10930
  /** A sender says at most this many edits per `EDIT_RATE_WINDOW_MS` in one chat; the newest text of each message waits. */
10843
10931
  var EDIT_SEND_LIMIT = 10;
10844
10932
  /** A receiver takes at most this many edit frames per window; the rest are dropped unconfirmed, so they come again. */
@@ -10848,6 +10936,8 @@ var EDIT_RATE_WINDOW_MS = 1e4;
10848
10936
  var EDIT_BUFFER_MS = 6e4;
10849
10937
  var EDIT_BUFFER_MAX = 32;
10850
10938
  var ID$4 = /^[A-Za-z0-9_-]{22}$/;
10939
+ /** A removal may name a file too (WISP 401 § Edits): its offer's id, as a file's id holds (`files.ts`). */
10940
+ var REMOVAL_ID = /^[A-Za-z0-9_-]{8,64}$/;
10851
10941
  /** Largest edit frame sent with a preview: the preview is left out past it, as with a message. */
10852
10942
  var MAX_EDIT_FRAME = 57344;
10853
10943
  /**
@@ -10855,6 +10945,14 @@ var MAX_EDIT_FRAME = 57344;
10855
10945
  * goes: it is bounded well under what the frame has room for, and it is what a card message is.
10856
10946
  */
10857
10947
  function editFrame(edit) {
10948
+ if (edit.rm) return JSON.stringify({
10949
+ t: EDIT_FRAME,
10950
+ id: edit.id,
10951
+ e: edit.e,
10952
+ ts: edit.ts,
10953
+ m: edit.m,
10954
+ rm: true
10955
+ });
10858
10956
  const base = {
10859
10957
  t: EDIT_FRAME,
10860
10958
  id: edit.id,
@@ -10883,6 +10981,10 @@ function editedFrame(id, e) {
10883
10981
  function validEditNumber(e) {
10884
10982
  return Number.isSafeInteger(e) && e >= 1 && e <= 100;
10885
10983
  }
10984
+ /** A removal's number: any up to one past a card message's bound, card or not. */
10985
+ function validRemovalNumber(e) {
10986
+ return Number.isSafeInteger(e) && e >= 1 && e <= MAX_REMOVAL_NUMBER;
10987
+ }
10886
10988
  /** A message's new text: not empty, no space around it, within a chat message's bytes. The same on a session and on the DHT. */
10887
10989
  function validEditMessage(m) {
10888
10990
  return typeof m === "string" && !!m.trim() && m === m.trim() && utf8Encode(m).length <= LIMITS.maxChatMessageBytes;
@@ -10890,14 +10992,22 @@ function validEditMessage(m) {
10890
10992
  /**
10891
10993
  * The edit a `paired-edit` frame says, or null when it is malformed (then it says nothing and is not confirmed). A
10892
10994
  * preview or a card that does not hold is dropped, never the edit; an edit numbered past `MAX_EDITS_PER_MESSAGE`
10893
- * holds only with a card.
10995
+ * holds only with a card. A removal carries its fallback text alone, and a `rm` other than `true` is no edit.
10894
10996
  */
10895
10997
  function parseEditFrame(frame, now = Date.now()) {
10896
10998
  if (frame?.t !== "paired-edit") return null;
10897
- const { id, e, ts, m } = frame;
10898
- if (typeof id !== "string" || !ID$4.test(id) || !cardEditNumber(e)) return null;
10999
+ const { id, e, ts, m, rm } = frame;
11000
+ if (rm !== void 0 && rm !== true) return null;
11001
+ if (typeof id !== "string" || !(rm ? REMOVAL_ID : ID$4).test(id) || typeof e !== "number" || !(rm ? validRemovalNumber(e) : cardEditNumber(e))) return null;
10899
11002
  if (typeof ts !== "number" || !Number.isSafeInteger(ts) || ts <= 0) return null;
10900
11003
  if (!validEditMessage(m)) return null;
11004
+ if (rm) return {
11005
+ id,
11006
+ e,
11007
+ ts,
11008
+ m,
11009
+ rm
11010
+ };
10901
11011
  const sc = frame.sc === void 0 ? void 0 : readStatusCard(frame.sc, now);
10902
11012
  if (!validEditNumber(e) && !sc) return null;
10903
11013
  const pv = frame.pv === void 0 ? void 0 : parseLinkPreview(frame.pv, m);
@@ -10913,7 +11023,7 @@ function parseEditFrame(frame, now = Date.now()) {
10913
11023
  /** The confirmation a `paired-edited` frame says, or null when it is malformed. */
10914
11024
  function parseEditedFrame(frame) {
10915
11025
  if (frame?.t !== "paired-edited") return null;
10916
- return typeof frame.id === "string" && ID$4.test(frame.id) && cardEditNumber(frame.e) ? {
11026
+ return typeof frame.id === "string" && REMOVAL_ID.test(frame.id) && validRemovalNumber(frame.e) ? {
10917
11027
  id: frame.id,
10918
11028
  e: frame.e
10919
11029
  } : null;
@@ -10982,7 +11092,7 @@ function isVideoMime(mime) {
10982
11092
  function isPlayableVideoType(mime) {
10983
11093
  return PLAYABLE_VIDEO.test(mime.split(";")[0].trim().toLowerCase());
10984
11094
  }
10985
- var BASE64URL = /^[A-Za-z0-9_-]+$/;
11095
+ var BASE64URL$1 = /^[A-Za-z0-9_-]+$/;
10986
11096
  var JPEG_START = [
10987
11097
  255,
10988
11098
  216,
@@ -11005,7 +11115,7 @@ function parseVideoMeta(value, mime) {
11005
11115
  width,
11006
11116
  height
11007
11117
  };
11008
- if (typeof poster === "string" && poster.length <= Math.ceil(VIDEO_LIMITS.maxPosterBytes * 4 / 3) && BASE64URL.test(poster)) try {
11118
+ if (typeof poster === "string" && poster.length <= Math.ceil(VIDEO_LIMITS.maxPosterBytes * 4 / 3) && BASE64URL$1.test(poster)) try {
11009
11119
  const bytes = fromBase64Url(poster);
11010
11120
  const size = bytes.length <= VIDEO_LIMITS.maxPosterBytes && JPEG_START.every((b, i) => bytes[i] === b) ? imageSize(bytes) : void 0;
11011
11121
  if (size && Math.max(size.width, size.height) <= VIDEO_LIMITS.posterEdge) meta.poster = poster;
@@ -12426,7 +12536,7 @@ var DhtDelivery = class DhtDelivery {
12426
12536
  let found = null;
12427
12537
  for (const [i, box] of boxes.entries()) {
12428
12538
  if (i > 0 && box === "pinned") {
12429
- if (!this.state.peerPinned && (!found || Date.now() - this.pinnedProbeAt < PINNED_PROBE_MS)) return;
12539
+ if (!this.state.peerPinned && (!found || this.state.inviteTaken || Date.now() - this.pinnedProbeAt < PINNED_PROBE_MS)) return;
12430
12540
  if (!this.state.peerPinned) this.pinnedProbeAt = Date.now();
12431
12541
  }
12432
12542
  const address = box === "pinned" ? pinned.peerAddress : this.peerAddress;
@@ -12553,14 +12663,14 @@ var DhtDelivery = class DhtDelivery {
12553
12663
  return age >= 6e5 ? age : void 0;
12554
12664
  }
12555
12665
  /**
12556
- * The wait between reads of the mailbox of a joined chat whose invite someone else used first (`inviteTaken`), before
12557
- * it pinned anyone: nothing is awaited from its inviter, so it is read as an unused invite of its age (counted from
12558
- * the join) from the notice on, however few other invites the app holds. One slow read stays, so a chat whose invite
12559
- * turns out not to be taken (`untaken`) still notices. Undefined for any other chat.
12666
+ * The wait between reads of the mailbox of a joined chat whose invite someone else used first (`inviteTaken`), whether
12667
+ * or not its look-up pinned the inviter first (`unanswered`): nothing is awaited from its inviter, so it is read as an
12668
+ * unused invite of its age (counted from the join) from the notice on, however few other invites the app holds. One
12669
+ * slow read stays, so a chat whose invite turns out not to be taken (`untaken`) still notices. Undefined for any other chat.
12560
12670
  */
12561
12671
  takenInviteWait() {
12562
12672
  const now = Date.now(), madeAt = this.options.inviteMadeAt;
12563
- if (!this.state.inviteTaken || this.options.credentials.peerKey || madeAt === void 0 || this.active || now < this.fastUntil) return void 0;
12673
+ if (!this.state.inviteTaken || madeAt === void 0 || this.active || now < this.fastUntil) return void 0;
12564
12674
  return unusedInviteWait(now - Math.min(madeAt, this.startedAt), this.mode === "dht" ? DHT_POLL_MS : STREAM_POLL_MS, Infinity);
12565
12675
  }
12566
12676
  schedule() {
@@ -13606,7 +13716,7 @@ async function verifyPeerProof(event, c, readStorage) {
13606
13716
  if (sig.length !== 64 || !verify(sig, data, fromZ32(c.externalKey))) throw new Error("Invalid Pubky signature");
13607
13717
  } else if (c.adapter === "keet-import") {
13608
13718
  if (sig.length !== 107 || sig[0] !== 1 || sig[41] !== 0 || sig[42] !== 1) throw new Error("Unsupported Keet attestation");
13609
- const { default: IdentityKey } = await import("./keet-identity-key-BHXtiqy8.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
13719
+ const { default: IdentityKey } = await import("./keet-identity-key-D_bUxyiq.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
13610
13720
  if (!IdentityKey.verify(b4a.from(sig), b4a.from(data), { expectedIdentity: b4a.from(unhex(c.externalKey)) })) throw new Error("Invalid Keet attestation");
13611
13721
  } else throw new Error("Unsupported proof adapter");
13612
13722
  }
@@ -16206,6 +16316,11 @@ var UPGRADE_CAPABILITY = "upgrade/1";
16206
16316
  * `pairedApps.ts`). Offered only while the apps feature is on.
16207
16317
  */
16208
16318
  var APPS_CAPABILITY = "apps/1";
16319
+ /**
16320
+ * The read lane of mini-apps (WISP 1200 § A read lane to the contact, `pairedAppRanges.ts`): the contact's app reads a
16321
+ * file this side's app serves, in ranges, outside `apps/1`. Offered beside `apps/1` only.
16322
+ */
16323
+ var APP_RANGES_CAPABILITY = "app-ranges/1";
16209
16324
  /** Every capability this app knows on a session: what `receive` reports changes of. */
16210
16325
  var KNOWN_SESSION_CAPABILITIES = [
16211
16326
  CALLS_CAPABILITY,
@@ -16220,7 +16335,8 @@ var KNOWN_SESSION_CAPABILITIES = [
16220
16335
  STATUS_CARD_CAPABILITY,
16221
16336
  BUTTONS_CAPABILITY,
16222
16337
  UPGRADE_CAPABILITY,
16223
- APPS_CAPABILITY
16338
+ APPS_CAPABILITY,
16339
+ APP_RANGES_CAPABILITY
16224
16340
  ];
16225
16341
  var SESSION_CAPABILITIES_FRAME = "paired-capabilities";
16226
16342
  var MAX_ENTRIES$1 = 32;
@@ -16567,6 +16683,423 @@ var AppSessions = class {
16567
16683
  }
16568
16684
  };
16569
16685
  //#endregion
16686
+ //#region ../core/src/pairedAppRanges.ts
16687
+ /**
16688
+ * The read lane of mini-apps in a 1:1 chat (WISP 1200 § A read lane to the contact: `app-ranges/1`): the contact's app
16689
+ * reads, in ranges, a file this side's app serves, over the chat's session but not through `apps/1`.
16690
+ *
16691
+ * {"t":"ar-get","a":"<chat app id>","s":"<serve id>","r":7,"o":0,"n":1048576}
16692
+ * {"t":"ar-data","a":"<chat app id>","r":7,"o":0,"d":"<base64url>"}
16693
+ * {"t":"ar-end","a":"<chat app id>","r":7,"z":734003200}
16694
+ * {"t":"ar-err","a":"<chat app id>","r":7,"e":"not-served"}
16695
+ * {"t":"ar-cancel","a":"<chat app id>","r":7}
16696
+ *
16697
+ * The asker sends `ar-get` (request `r`, a number of its own, for `n` bytes at offset `o` of serve `s`) and may send
16698
+ * `ar-cancel`; the server answers with the bytes in chunks of at most `APP_RANGE_LIMITS.chunkBytes`, then `ar-end`
16699
+ * once every byte asked was sent (fewer at the end of the file), with `z` the served file's size, or `ar-err` instead of
16700
+ * any. A read of one byte at 0 is how the asker learns the size. Where `files/4` is on,
16701
+ * a chunk is a binary message of kind `APP_RANGE_DATA_KIND` (`encodeAppRangeData`) in place of `ar-data`. It needs
16702
+ * `app-ranges/1` in `paired-capabilities` on both sides. A reader ignores keys it does not know, so a later version
16703
+ * can add some.
16704
+ */
16705
+ var APP_RANGE_FRAMES = /* @__PURE__ */ new Set([
16706
+ "ar-get",
16707
+ "ar-data",
16708
+ "ar-end",
16709
+ "ar-err",
16710
+ "ar-cancel"
16711
+ ]);
16712
+ var APP_RANGE_LIMITS = {
16713
+ /** One `ar-get`, at most: as one `remote.read` of the app. */
16714
+ requestBytes: 1048576,
16715
+ /** One chunk, `ar-data` or binary: as a chat file's. */
16716
+ chunkBytes: 16384,
16717
+ /** The largest request number: it is 4 bytes in a binary chunk. */
16718
+ maxRequest: 4294967295,
16719
+ /** Requests a server takes in flight per app; one more is answered `busy`. An asker keeps the rest waiting. */
16720
+ inFlight: 4
16721
+ };
16722
+ /**
16723
+ * What an `ar-err` says. `not-served`: no serve of that id on this session (never given, or ended); `changed` and
16724
+ * `gone`: the file under it, as `files.read` says them; `busy`: past the requests the server takes in flight. A
16725
+ * later version may add one: an asker reads a code it does not know as a failure.
16726
+ */
16727
+ var APP_RANGE_ERRORS = [
16728
+ "not-served",
16729
+ "changed",
16730
+ "gone",
16731
+ "busy"
16732
+ ];
16733
+ /** A serve id as it is on the wire: 22 base64url characters (16 random bytes, no padding), as a chat app id. */
16734
+ var isServeId = isChatAppId;
16735
+ var isRequest = (value) => typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= APP_RANGE_LIMITS.maxRequest;
16736
+ var isOffset = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
16737
+ var ERROR_CODE$1 = /^[a-z][a-z-]{0,31}$/;
16738
+ var BASE64URL = /^[A-Za-z0-9_-]*$/;
16739
+ /** The bytes of `d`, or null when it is not 1 to `chunkBytes` bytes of canonical base64url without padding. */
16740
+ function appRangeChunk(d) {
16741
+ if (typeof d !== "string" || !d.length || d.length % 4 === 1 || d.length > Math.ceil(APP_RANGE_LIMITS.chunkBytes * 4 / 3) || !BASE64URL.test(d)) return null;
16742
+ let bytes;
16743
+ try {
16744
+ bytes = fromBase64Url(d);
16745
+ } catch {
16746
+ return null;
16747
+ }
16748
+ return bytes.length && bytes.length <= APP_RANGE_LIMITS.chunkBytes && toBase64Url(bytes) === d ? bytes : null;
16749
+ }
16750
+ function appRangeGetFrame(app, serve, request, offset, length) {
16751
+ const frame = {
16752
+ t: "ar-get",
16753
+ a: app,
16754
+ s: serve,
16755
+ r: request,
16756
+ o: offset,
16757
+ n: length
16758
+ };
16759
+ if (!readAppRangeFrame(frame).ok) throw new Error("Not an app range request");
16760
+ return frame;
16761
+ }
16762
+ function appRangeDataFrame(app, request, offset, data) {
16763
+ const frame = {
16764
+ t: "ar-data",
16765
+ a: app,
16766
+ r: request,
16767
+ o: offset,
16768
+ d: toBase64Url(data)
16769
+ };
16770
+ if (!readAppRangeFrame(frame).ok) throw new Error("Not app range data");
16771
+ return frame;
16772
+ }
16773
+ function appRangeEndFrame(app, request, size) {
16774
+ if (!isChatAppId(app) || !isRequest(request) || !isOffset(size)) throw new Error("Not an app range end");
16775
+ return {
16776
+ t: "ar-end",
16777
+ a: app,
16778
+ r: request,
16779
+ z: size
16780
+ };
16781
+ }
16782
+ function appRangeErrorFrame(app, request, error) {
16783
+ if (!isChatAppId(app) || !isRequest(request) || !APP_RANGE_ERRORS.includes(error)) throw new Error("Not an app range error");
16784
+ return {
16785
+ t: "ar-err",
16786
+ a: app,
16787
+ r: request,
16788
+ e: error
16789
+ };
16790
+ }
16791
+ function appRangeCancelFrame(app, request) {
16792
+ if (!isChatAppId(app) || !isRequest(request)) throw new Error("Not an app range cancel");
16793
+ return {
16794
+ t: "ar-cancel",
16795
+ a: app,
16796
+ r: request
16797
+ };
16798
+ }
16799
+ /**
16800
+ * An `ar-*` frame as the peer sent it, or why a reader must refuse it: an unknown `t`, no valid `a`, an `ar-get`
16801
+ * without a valid `s`, a request number that is not 0 to 2^32 - 1, an offset that is not a safe whole number at or
16802
+ * above 0, an `n` that is not 1 to `requestBytes` (or runs past 2^53 - 1), a `d` that is not 1 to `chunkBytes` bytes of
16803
+ * canonical base64url, an `e` that is not a code (lower case letters and `-`, at most 32), an `ar-end` whose `z` is not
16804
+ * a size (a safe whole number at or above 0). Other keys are ignored.
16805
+ */
16806
+ function readAppRangeFrame(frame) {
16807
+ const refuse = (refusal) => ({
16808
+ ok: false,
16809
+ refusal
16810
+ });
16811
+ const t = frame?.t;
16812
+ if (typeof t !== "string" || !APP_RANGE_FRAMES.has(t)) return refuse("not-ranges");
16813
+ if (!isChatAppId(frame.a)) return refuse("bad-a");
16814
+ const a = frame.a;
16815
+ if (t === "ar-get" && !isServeId(frame.s)) return refuse("bad-s");
16816
+ if (!isRequest(frame.r)) return refuse("bad-r");
16817
+ const r = frame.r;
16818
+ switch (t) {
16819
+ case "ar-get": {
16820
+ if (!isOffset(frame.o)) return refuse("bad-o");
16821
+ const n = frame.n;
16822
+ if (typeof n !== "number" || !Number.isInteger(n) || n < 1 || n > APP_RANGE_LIMITS.requestBytes || !Number.isSafeInteger(frame.o + n)) return refuse("bad-n");
16823
+ return {
16824
+ ok: true,
16825
+ frame: {
16826
+ t,
16827
+ a,
16828
+ s: frame.s,
16829
+ r,
16830
+ o: frame.o,
16831
+ n
16832
+ }
16833
+ };
16834
+ }
16835
+ case "ar-data":
16836
+ if (!isOffset(frame.o)) return refuse("bad-o");
16837
+ if (!appRangeChunk(frame.d)) return refuse("bad-d");
16838
+ return {
16839
+ ok: true,
16840
+ frame: {
16841
+ t,
16842
+ a,
16843
+ r,
16844
+ o: frame.o,
16845
+ d: frame.d
16846
+ }
16847
+ };
16848
+ case "ar-err": return typeof frame.e === "string" && ERROR_CODE$1.test(frame.e) ? {
16849
+ ok: true,
16850
+ frame: {
16851
+ t,
16852
+ a,
16853
+ r,
16854
+ e: frame.e
16855
+ }
16856
+ } : refuse("bad-e");
16857
+ case "ar-end": return isOffset(frame.z) ? {
16858
+ ok: true,
16859
+ frame: {
16860
+ t,
16861
+ a,
16862
+ r,
16863
+ z: frame.z
16864
+ }
16865
+ } : refuse("bad-z");
16866
+ default: return {
16867
+ ok: true,
16868
+ frame: {
16869
+ t: "ar-cancel",
16870
+ a,
16871
+ r
16872
+ }
16873
+ };
16874
+ }
16875
+ }
16876
+ /** An `ar-*` frame as the peer sent it, or null when a reader must refuse it (`readAppRangeFrame` says why). */
16877
+ function parseAppRangeFrame(frame) {
16878
+ const read = readAppRangeFrame(frame);
16879
+ return read.ok ? read.frame : null;
16880
+ }
16881
+ /**
16882
+ * `app-ranges/1` beside `files/4` (WISP 100 § Text and binary messages): a chunk as one binary message of the session,
16883
+ * in place of the base64url text of an `ar-data` frame:
16884
+ *
16885
+ * kind 0x05 (1) | chat app id (16) | request (4, big endian) | offset (8, big endian) | data (1 to `chunkBytes`)
16886
+ */
16887
+ var APP_RANGE_DATA_KIND = 5;
16888
+ var HEAD = 29;
16889
+ /** The binary message for the bytes of request `request` of app `app` at `offset`. Throws on what no receiver would take. */
16890
+ function encodeAppRangeData(app, request, offset, data) {
16891
+ if (!isChatAppId(app) || !isRequest(request) || !isOffset(offset) || !data.length || data.length > APP_RANGE_LIMITS.chunkBytes) throw new Error("Invalid app range data");
16892
+ const id = fromBase64Url(app);
16893
+ if (id.length !== 16) throw new Error("Invalid app range data");
16894
+ const out = new Uint8Array(HEAD + data.length);
16895
+ out[0] = 5;
16896
+ out.set(id, 1);
16897
+ const view = new DataView(out.buffer);
16898
+ view.setUint32(17, request);
16899
+ view.setUint32(21, Math.floor(offset / 2 ** 32));
16900
+ view.setUint32(25, offset % 2 ** 32);
16901
+ out.set(data, HEAD);
16902
+ return out;
16903
+ }
16904
+ /** What a binary message from the contact says, or null when it is not well-formed app range data. `data` is a view of `message`. */
16905
+ function decodeAppRangeData(message) {
16906
+ if (message.length <= HEAD || message[0] !== 5 || message.length - HEAD > APP_RANGE_LIMITS.chunkBytes) return null;
16907
+ const view = new DataView(message.buffer, message.byteOffset, message.byteLength);
16908
+ const high = view.getUint32(21);
16909
+ if (high > 2097151) return null;
16910
+ return {
16911
+ a: toBase64Url(message.slice(1, 17)),
16912
+ r: view.getUint32(17),
16913
+ o: high * 2 ** 32 + view.getUint32(25),
16914
+ data: message.subarray(HEAD)
16915
+ };
16916
+ }
16917
+ var slot = (app, request) => `${app}:${request}`;
16918
+ /**
16919
+ * The read lane of one chat, both ways (WISP 1200 § A read lane to the contact). As the side that serves it keeps the
16920
+ * serve ids it gave out on this session and answers the contact's `ar-get` for those only, at most
16921
+ * `APP_RANGE_LIMITS.inFlight` per app (`busy` past it); the bytes themselves are read and sent by the session, which
16922
+ * calls `finish` or `fail` for each task. As the side that asks it sends at most `inFlight` requests per app, keeps
16923
+ * the rest waiting, and puts each answer back together, in order, from the offset asked. Serves and requests last one
16924
+ * session: `reset` ends them all, `closeApp` those of one app.
16925
+ */
16926
+ var AppRanges = class {
16927
+ send;
16928
+ newServeId;
16929
+ serves = /* @__PURE__ */ new Map();
16930
+ serving = /* @__PURE__ */ new Map();
16931
+ /** Tasks cancelled or unserved that the session is still reading or sending: each counts in its app's `inFlight` until settled. */
16932
+ draining = /* @__PURE__ */ new Set();
16933
+ asking = /* @__PURE__ */ new Map();
16934
+ waiting = /* @__PURE__ */ new Map();
16935
+ nextRequest = 0;
16936
+ constructor(send, newServeId = () => toBase64Url(randomBytes(16))) {
16937
+ this.send = send;
16938
+ this.newServeId = newServeId;
16939
+ }
16940
+ /** Lets the contact's `app` read `file` on this session: the serve id to tell it. */
16941
+ serve(app, file) {
16942
+ if (!isChatAppId(app)) throw new Error("Not a chat app id");
16943
+ let id = this.newServeId();
16944
+ while (this.serves.has(id)) id = this.newServeId();
16945
+ this.serves.set(id, {
16946
+ app,
16947
+ file
16948
+ });
16949
+ return id;
16950
+ }
16951
+ /** Ends one serve: requests under it still being sent stop. False when it was not served. */
16952
+ unserve(serveId) {
16953
+ if (!this.serves.get(serveId)) return false;
16954
+ this.serves.delete(serveId);
16955
+ for (const task of this.serving.values()) if (task.serve === serveId) this.drop(task, true);
16956
+ return true;
16957
+ }
16958
+ /** The serve ids `app` has given out on this session (what the panel's "Sharing with" line shows). */
16959
+ servesOf(app) {
16960
+ return [...this.serves].filter(([, serve]) => serve.app === app).map(([id]) => id);
16961
+ }
16962
+ /** An `ar-get` from the contact: the task to read and send, or null when it was refused (the refusal is sent) or dropped. */
16963
+ receiveGet(frame) {
16964
+ const { a: app, r: request } = frame;
16965
+ if (this.serving.has(slot(app, request))) return null;
16966
+ const serve = this.serves.get(frame.s);
16967
+ if (!serve || serve.app !== app) {
16968
+ this.send(appRangeErrorFrame(app, request, "not-served"));
16969
+ return null;
16970
+ }
16971
+ if ([...this.serving.values(), ...this.draining].filter((task) => task.app === app).length >= APP_RANGE_LIMITS.inFlight) {
16972
+ this.send(appRangeErrorFrame(app, request, "busy"));
16973
+ return null;
16974
+ }
16975
+ const task = {
16976
+ app,
16977
+ request,
16978
+ serve: frame.s,
16979
+ file: serve.file,
16980
+ offset: frame.o,
16981
+ length: frame.n,
16982
+ live: true
16983
+ };
16984
+ this.serving.set(slot(app, request), task);
16985
+ return task;
16986
+ }
16987
+ /** An `ar-cancel` from the contact: that request sends nothing more, and its number frees; its place frees once it is settled. */
16988
+ receiveCancel(frame) {
16989
+ const task = this.serving.get(slot(frame.a, frame.r));
16990
+ if (task) this.drop(task, true);
16991
+ }
16992
+ /** Every byte of `task` was sent: `ar-end` goes with the file's size, unless the task was dropped meanwhile. */
16993
+ finish(task, size) {
16994
+ if (this.take(task)) this.send(appRangeEndFrame(task.app, task.request, size));
16995
+ }
16996
+ /** The file under `task` could not be read: `ar-err` goes in place of the rest, unless the task was dropped meanwhile. */
16997
+ fail(task, error) {
16998
+ if (this.take(task)) this.send(appRangeErrorFrame(task.app, task.request, error));
16999
+ }
17000
+ /** The session stopped working on `task` without an answer (it is no longer live, or the channel went): its place frees, nothing is sent. */
17001
+ release(task) {
17002
+ this.take(task);
17003
+ }
17004
+ /** Reads `length` bytes at `offset` of what the contact's `app` serves as `serve`: the bytes (fewer at the end) and the file's size. */
17005
+ read(app, serve, offset, length) {
17006
+ appRangeGetFrame(app, serve, 0, offset, length);
17007
+ return new Promise((resolve, reject) => {
17008
+ const ask = {
17009
+ app,
17010
+ serve,
17011
+ offset,
17012
+ length,
17013
+ chunks: [],
17014
+ got: 0,
17015
+ resolve,
17016
+ reject
17017
+ };
17018
+ const queue = this.waiting.get(app) ?? [];
17019
+ queue.push(ask);
17020
+ this.waiting.set(app, queue);
17021
+ this.pump(app);
17022
+ });
17023
+ }
17024
+ /** Bytes of a request of ours, from `ar-data` or a binary chunk. Out of order or past what was asked fails the request. */
17025
+ receiveData(app, request, offset, data) {
17026
+ const ask = this.asking.get(slot(app, request));
17027
+ if (!ask) return;
17028
+ if (offset !== ask.offset + ask.got || ask.got + data.length > ask.length) {
17029
+ this.send(appRangeCancelFrame(app, request));
17030
+ return this.settle(ask, "failed");
17031
+ }
17032
+ ask.chunks.push(data.slice());
17033
+ ask.got += data.length;
17034
+ }
17035
+ /** The contact's `ar-end` or `ar-err` for a request of ours. */
17036
+ receiveAnswer(frame) {
17037
+ const ask = this.asking.get(slot(frame.a, frame.r));
17038
+ if (!ask) return;
17039
+ if (frame.t === "ar-err") return this.settle(ask, [
17040
+ "not-served",
17041
+ "changed",
17042
+ "gone"
17043
+ ].find((code) => code === frame.e) ?? "failed");
17044
+ if (ask.got !== Math.max(0, Math.min(ask.length, frame.z - ask.offset))) return this.settle(ask, "failed");
17045
+ this.settle(ask);
17046
+ ask.resolve({
17047
+ bytes: concatBytes(...ask.chunks),
17048
+ size: frame.z
17049
+ });
17050
+ }
17051
+ /** `app` closed on either side: its serves end, what it was sending stops and what it asked fails with `error`. */
17052
+ closeApp(app, error = "peer-closed") {
17053
+ for (const [id, serve] of this.serves) if (serve.app === app) this.serves.delete(id);
17054
+ for (const task of this.serving.values()) if (task.app === app) this.drop(task);
17055
+ for (const task of this.draining) if (task.app === app) this.draining.delete(task);
17056
+ for (const ask of this.waiting.get(app) ?? []) ask.reject(new Error(error));
17057
+ this.waiting.delete(app);
17058
+ for (const ask of this.asking.values()) if (ask.app === app) this.settle(ask, error);
17059
+ }
17060
+ /** The session ended: no serve id lasts into the next, and every request fails with `offline`. */
17061
+ reset() {
17062
+ const apps = new Set([...this.serves.values()].map((serve) => serve.app).concat([...this.serving.values(), ...this.draining].map((task) => task.app), [...this.waiting.keys()], [...this.asking.values()].map((ask) => ask.app)));
17063
+ for (const app of apps) this.closeApp(app, "offline");
17064
+ }
17065
+ /** Stops `task` and frees its request number; `draining` keeps it counted until it is settled. */
17066
+ drop(task, draining = false) {
17067
+ task.live = false;
17068
+ this.serving.delete(slot(task.app, task.request));
17069
+ if (draining) this.draining.add(task);
17070
+ }
17071
+ /** Frees `task`'s place; false when it was no longer live (nothing to send for it). */
17072
+ take(task) {
17073
+ if (this.draining.delete(task)) return false;
17074
+ const held = this.serving.get(slot(task.app, task.request));
17075
+ if (held !== task || !held.live) return false;
17076
+ this.drop(held);
17077
+ return true;
17078
+ }
17079
+ /** Ends `ask` (failing it with `error` when given) and sends the next one waiting for its app. */
17080
+ settle(ask, error) {
17081
+ if (ask.request === void 0 || this.asking.get(slot(ask.app, ask.request)) !== ask) return;
17082
+ this.asking.delete(slot(ask.app, ask.request));
17083
+ if (error) ask.reject(new Error(error));
17084
+ this.pump(ask.app);
17085
+ }
17086
+ pump(app) {
17087
+ const queue = this.waiting.get(app);
17088
+ let inFlight = [...this.asking.values()].filter((ask) => ask.app === app).length;
17089
+ while (queue?.length && inFlight < APP_RANGE_LIMITS.inFlight) {
17090
+ const ask = queue.shift();
17091
+ let request = this.nextRequest;
17092
+ while (this.asking.has(slot(app, request))) request = request === APP_RANGE_LIMITS.maxRequest ? 0 : request + 1;
17093
+ this.nextRequest = request === APP_RANGE_LIMITS.maxRequest ? 0 : request + 1;
17094
+ ask.request = request;
17095
+ this.asking.set(slot(app, request), ask);
17096
+ inFlight++;
17097
+ this.send(appRangeGetFrame(app, ask.serve, request, ask.offset, ask.length));
17098
+ }
17099
+ if (queue && !queue.length) this.waiting.delete(app);
17100
+ }
17101
+ };
17102
+ //#endregion
16570
17103
  //#region ../core/src/webPush.ts
16571
17104
  var WebPushError = class extends Error {};
16572
17105
  var RECORD_SIZE = 4096;
@@ -20172,6 +20705,12 @@ var GhostLink = class {
20172
20705
  typingReceiver = new TypingReceiver((typing, activity) => this.options.events?.onPeerTyping?.(typing, activity));
20173
20706
  /** Mini-apps on this session (`apps/1`): this side's open apps (kept across sessions), the peer's, the limits. */
20174
20707
  apps;
20708
+ /** The read lane on this session (`app-ranges/1`): what this side serves and what it asked; none of it outlives the session. */
20709
+ appRanges = new AppRanges((frame) => {
20710
+ if (this.supportsAppRanges && this.channel) try {
20711
+ this.channel.send(JSON.stringify(frame));
20712
+ } catch {}
20713
+ });
20175
20714
  /** Reaction frames the contact may send per window; the rest go unconfirmed and come again. */
20176
20715
  reactionsReceived = new ReactionWindow(REACTION_LIMITS.receive);
20177
20716
  /** Pin frames the contact may send per window; the rest go unconfirmed and come again. */
@@ -20932,9 +21471,12 @@ var GhostLink = class {
20932
21471
  get presence() {
20933
21472
  return this.mergePresence(this.session.peerPresence);
20934
21473
  }
20935
- /** Someone else used the invite first, and this side never pinned its inviter: there is nobody to pair with. */
21474
+ /**
21475
+ * Someone else used the invite first: there is nobody to pair with, whether or not this side's look-up pinned its
21476
+ * inviter from the envelope put out before anyone joined (said only while unproven: never live, nothing confirmed).
21477
+ */
20936
21478
  get takenFromUs() {
20937
- return !this.options.pairing?.credentials.peerKey && !!this.dht?.inviteTaken;
21479
+ return !!this.dht?.inviteTaken;
20938
21480
  }
20939
21481
  /**
20940
21482
  * The session runs on the joiner's link key, which every copy of the invite derives: while the invite is taken from
@@ -22899,6 +23441,7 @@ var GhostLink = class {
22899
23441
  if (this.options.buttonsSupport) offered.push(BUTTONS_CAPABILITY);
22900
23442
  if (this.options.upgradeSupport) offered.push(UPGRADE_CAPABILITY);
22901
23443
  if (this.options.appsSupport) offered.push(APPS_CAPABILITY);
23444
+ if (this.options.appsSupport && this.options.appRangesSupport) offered.push(APP_RANGES_CAPABILITY);
22902
23445
  if (this.options.deviceCapabilities) offered.push(...this.options.deviceCapabilities);
22903
23446
  return offered;
22904
23447
  }
@@ -23021,7 +23564,7 @@ var GhostLink = class {
23021
23564
  if (!this.options.params.profile) return "Edits need a current chat";
23022
23565
  if (this.channel && this.isDataLinkOpen) {
23023
23566
  if (!this.supportsEdits) return "Your contact's app does not show edits yet";
23024
- if (!validEditNumber(edit.e) && !(edit.sc && this.supportsStatusCards)) return "Your contact's app takes no more edits of this message";
23567
+ if (!edit.rm && !validEditNumber(edit.e) && !(edit.sc && this.supportsStatusCards)) return "Your contact's app takes no more edits of this message";
23025
23568
  try {
23026
23569
  this.channel.send(editFrame(edit));
23027
23570
  return null;
@@ -23030,6 +23573,7 @@ var GhostLink = class {
23030
23573
  }
23031
23574
  }
23032
23575
  if (edit.sc) return "A card's update goes when you are live";
23576
+ if (edit.rm) return "A removal goes when you are live";
23033
23577
  if (dht && this.dht && this.textDelivery === "dht") return this.dht.send(edit.m, edit.ts, dhtEditId(edit.id, edit.e), void 0, [edit.id, edit.e]);
23034
23578
  return "Edits go when you are live";
23035
23579
  }
@@ -23087,6 +23631,7 @@ var GhostLink = class {
23087
23631
  closeApp(app) {
23088
23632
  const frame = JSON.stringify(appCloseFrame(app));
23089
23633
  if (!this.apps.open.delete(app)) return;
23634
+ this.appRanges.closeApp(app, "offline");
23090
23635
  if (this.supportsApps && this.channel) try {
23091
23636
  this.channel.send(frame);
23092
23637
  } catch {}
@@ -23121,8 +23666,98 @@ var GhostLink = class {
23121
23666
  if (files) files.appAhead = Math.min(files.appAhead + frame.length, APP_AHEAD_OF_FILES + APP_DATA_MAX_BYTES);
23122
23667
  return null;
23123
23668
  }
23669
+ /** Both sides offer `app-ranges/1` (and `apps/1`) on the open session: an app's files can be read from the other side. */
23670
+ get supportsAppRanges() {
23671
+ return this.supportsApps && this.sessionCapabilities.agreed("app-ranges/1");
23672
+ }
23673
+ /** Why the read lane cannot be used for `app` now, or null when it can: open on both sides, on a live session that has it. */
23674
+ appRangesRefusal(app) {
23675
+ if (!this.apps.open.has(app)) return "not-open";
23676
+ if (!this.channel || !this.isDataLinkOpen) return "offline";
23677
+ return this.supportsAppRanges && this.apps.peerOpen.has(app) ? null : "peer-closed";
23678
+ }
23679
+ /**
23680
+ * Lets the contact's `app` read `file` (what this side's app calls it) for as long as both have the app open on this
23681
+ * session: the serve id to tell it, or why not.
23682
+ */
23683
+ serveAppFile(app, file) {
23684
+ const error = this.appRangesRefusal(app);
23685
+ return error ? { error } : { serve: this.appRanges.serve(app, file) };
23686
+ }
23687
+ /** Ends a serve; false when it was not served (any more). */
23688
+ unserveAppFile(serve) {
23689
+ return this.appRanges.unserve(serve);
23690
+ }
23691
+ /** The serve ids `app` has given out on this session. */
23692
+ appServes(app) {
23693
+ return this.appRanges.servesOf(app);
23694
+ }
23695
+ /**
23696
+ * Reads `length` bytes at `offset` of what the contact's `app` serves as `serve`: the bytes (fewer at the end of the
23697
+ * file) and the file's size. Rejects with an `Error` whose message is an `AppRangeReadError` or `not-open`.
23698
+ */
23699
+ readAppRange(app, serve, offset, length) {
23700
+ const error = this.appRangesRefusal(app);
23701
+ return error ? Promise.reject(new Error(error)) : this.appRanges.read(app, serve, offset, length);
23702
+ }
23703
+ /**
23704
+ * The bytes `task` asked for (fewer at the end of the file, none past it) and the file's size: sent in chunks as the
23705
+ * channel has room, sharing files' line (`filesWritable`), as binary messages where `files/4` is agreed, then
23706
+ * `ar-end`. Stops when the task is no longer live or the session changes.
23707
+ */
23708
+ async sendAppRange(task, bytes, size) {
23709
+ bytes = bytes.subarray(0, task.length);
23710
+ const channel = this.channel;
23711
+ try {
23712
+ if (!channel) return;
23713
+ for (let at = 0; at < bytes.length; at += APP_RANGE_LIMITS.chunkBytes) {
23714
+ for (let room = this.filesWritable(); room; room = this.channel === channel ? this.filesWritable() : void 0) await room;
23715
+ if (!task.live || this.channel !== channel || !this.supportsAppRanges) return;
23716
+ const chunk = bytes.subarray(at, at + APP_RANGE_LIMITS.chunkBytes);
23717
+ const message = this.supportsBinaryFiles ? encodeAppRangeData(task.app, task.request, task.offset + at, chunk) : JSON.stringify(appRangeDataFrame(task.app, task.request, task.offset + at, chunk));
23718
+ try {
23719
+ channel.send(message);
23720
+ } catch {
23721
+ await new Promise((resolve) => setTimeout(resolve, FILE_LIMITS.sendRetryMs));
23722
+ at -= APP_RANGE_LIMITS.chunkBytes;
23723
+ continue;
23724
+ }
23725
+ this.filesWrote(channel, typeof message === "string" ? message.length : message.byteLength);
23726
+ }
23727
+ this.appRanges.finish(task, size);
23728
+ } finally {
23729
+ this.appRanges.release(task);
23730
+ }
23731
+ }
23732
+ /** `task`'s file cannot be read: `changed` or `gone` goes in place of its bytes (nothing once it is no longer live, but its place frees). */
23733
+ failAppRange(task, error) {
23734
+ this.appRanges.fail(task, error);
23735
+ }
23736
+ /** An `ar-*` frame from the contact, on a session that agreed `app-ranges/1`. */
23737
+ receiveAppRange(frame) {
23738
+ const read = readAppRangeFrame(frame);
23739
+ if (!read.ok) return;
23740
+ const ranges = read.frame;
23741
+ switch (ranges.t) {
23742
+ case "ar-get": {
23743
+ if (this.appRangesRefusal(ranges.a)) {
23744
+ try {
23745
+ this.channel?.send(JSON.stringify(appRangeErrorFrame(ranges.a, ranges.r, "not-served")));
23746
+ } catch {}
23747
+ return;
23748
+ }
23749
+ const task = this.appRanges.receiveGet(ranges);
23750
+ if (task) this.options.events?.onAppRangeTask?.(task);
23751
+ return;
23752
+ }
23753
+ case "ar-cancel": return this.appRanges.receiveCancel(ranges);
23754
+ case "ar-data": return this.appRanges.receiveData(ranges.a, ranges.r, ranges.o, appRangeChunk(ranges.d));
23755
+ default: return this.appRanges.receiveAnswer(ranges);
23756
+ }
23757
+ }
23124
23758
  /** What the contact had open is gone (`apps/1` is no longer agreed, or this link stopped): each app hears it now. */
23125
23759
  appsEnded() {
23760
+ this.appRanges.reset();
23126
23761
  if (this.appsGrace) {
23127
23762
  clearTimeout(this.appsGrace);
23128
23763
  this.appsGrace = null;
@@ -23136,6 +23771,7 @@ var GhostLink = class {
23136
23771
  * hears only that open, not a close first; one not said again by then is closed with `offline`.
23137
23772
  */
23138
23773
  appsSuspended() {
23774
+ this.appRanges.reset();
23139
23775
  this.apps.sessionSuspended();
23140
23776
  if (!this.apps.holding || this.appsGrace) return;
23141
23777
  this.appsGrace = setTimeout(() => {
@@ -23301,6 +23937,7 @@ var GhostLink = class {
23301
23937
  if (!this.supportsApps) this.appsEnded();
23302
23938
  this.options.events?.onAppsSupport?.(this.supportsApps);
23303
23939
  }
23940
+ if (changed.includes("app-ranges/1") && !this.supportsAppRanges) this.appRanges.reset();
23304
23941
  const devices = this.options.deviceCapabilities;
23305
23942
  if (devices && changed.some((capability) => devices.includes(capability))) this.options.events?.onDeviceCapabilities?.(devices.filter((capability) => this.supportsDevice(capability)));
23306
23943
  this.emitPairingState();
@@ -23845,6 +24482,11 @@ var GhostLink = class {
23845
24482
  this.heardFromPeer();
23846
24483
  this.framesHeard++;
23847
24484
  if (typeof data !== "string") {
24485
+ if (data[0] === 5) {
24486
+ const range = this.supportsAppRanges && this.supportsBinaryFiles ? decodeAppRangeData(data) : null;
24487
+ if (range) this.appRanges.receiveData(range.a, range.r, range.o, range.data);
24488
+ return;
24489
+ }
23848
24490
  const chunk = this.supportsBinaryFiles ? decodeFileData(data) : null;
23849
24491
  if (!chunk) return;
23850
24492
  this.activityAt = Date.now();
@@ -23992,9 +24634,14 @@ var GhostLink = class {
23992
24634
  if (frame?.t === "paired-app") {
23993
24635
  if (!this.supportsApps) return;
23994
24636
  const event = this.apps.receive(frame);
24637
+ if (event && "o" in event && event.o === "close") this.appRanges.closeApp(event.app);
23995
24638
  if (event) this.options.events?.onAppFrame?.(event);
23996
24639
  return;
23997
24640
  }
24641
+ if (APP_RANGE_FRAMES.has(String(frame?.t))) {
24642
+ if (this.supportsAppRanges) this.receiveAppRange(frame);
24643
+ return;
24644
+ }
23998
24645
  if (frame?.t === "paired-reaction") {
23999
24646
  if (!this.supportsReactions || !this.reactionsReceived.take()) return;
24000
24647
  const reaction = parseReactionFrame(frame);
@@ -28466,6 +29113,10 @@ var wireMentions = (mentions) => mentions.map(({ k, o, l }) => ({
28466
29113
  * `sc` is the status card of this version (WISP 405 · Status Cards); an edit with one may be numbered up to
28467
29114
  * `STATUS_CARD_LIMITS.edits`, one without only up to `MAX_EDITS_PER_MESSAGE`.
28468
29115
  *
29116
+ * A removal (WISP 400 § Delete for everyone) is an edit with `rm: true` and a fallback text, nothing else beside it,
29117
+ * numbered up to `MAX_REMOVAL_NUMBER`: in a mesh group's box as `{ "text", "rm": true }`, in a community's frame beside
29118
+ * `text`. A `rm` other than `true` is no edit.
29119
+ *
28469
29120
  * Older apps drop both: a mesh session ignores a `t` it does not know, a community app the `x` frames it does not know.
28470
29121
  */
28471
29122
  var GROUP_EDIT_FRAME = "group-edit";
@@ -28495,6 +29146,14 @@ function validEditText(text) {
28495
29146
  }
28496
29147
  /** The `x` frame a community edit travels as. */
28497
29148
  function communityEditFrame(edit) {
29149
+ if (edit.rm) return {
29150
+ t: COMMUNITY_EDIT_FRAME,
29151
+ id: edit.id,
29152
+ v: edit.e,
29153
+ ts: edit.ts,
29154
+ text: edit.m,
29155
+ rm: true
29156
+ };
28498
29157
  return {
28499
29158
  t: COMMUNITY_EDIT_FRAME,
28500
29159
  id: edit.id,
@@ -28512,9 +29171,17 @@ function communityEditFrame(edit) {
28512
29171
  */
28513
29172
  function parseCommunityEdit(frame, sender) {
28514
29173
  if (frame?.t !== "edit") return null;
28515
- const { id, v, ts, text } = frame;
28516
- if (typeof id !== "string" || communityMessageAuthor(id) !== sender || !cardEditNumber(v)) return null;
29174
+ const { id, v, ts, text, rm } = frame;
29175
+ if (rm !== void 0 && rm !== true) return null;
29176
+ if (typeof id !== "string" || communityMessageAuthor(id) !== sender || typeof v !== "number" || !(rm ? validRemovalNumber(v) : cardEditNumber(v))) return null;
28517
29177
  if (typeof ts !== "number" || !Number.isSafeInteger(ts) || ts <= 0 || !validEditText(text)) return null;
29178
+ if (rm) return {
29179
+ id,
29180
+ e: v,
29181
+ ts,
29182
+ m: text,
29183
+ rm
29184
+ };
28518
29185
  const sc = frame.sc === void 0 ? void 0 : readStatusCard(frame.sc);
28519
29186
  if (!validEditNumber(v) && !sc) return null;
28520
29187
  const k = validMentions(frame.m, text, false);
@@ -28574,15 +29241,21 @@ var CatchUpAnswers = class {
28574
29241
  hooks;
28575
29242
  /** Answers still going out, per member: what is left of each. */
28576
29243
  going = /* @__PURE__ */ new Map();
29244
+ /**
29245
+ * Per member, the frames sent (`hooks.key`) whose `handled` has not resolved yet: still waiting in its app, which asks
29246
+ * again every 10 s while it handles 1 or 2 a second, and each answer sent the same ones again (200 missed went 1,009
29247
+ * times). Left out of a newer answer until handled; one handled and still missing (lost) goes in the next.
29248
+ */
29249
+ onTheirWay = /* @__PURE__ */ new Map();
28577
29250
  constructor(hooks) {
28578
29251
  this.hooks = hooks;
28579
29252
  }
28580
29253
  /**
28581
29254
  * The first two slices go now, the rest without holding the group's other frames back. A newer answer to the same
28582
- * member goes after what is left of the last, without the frames still queued there (the same objects: a store's);
28583
- * it took their place before, and left out what the member's `have` said it held: a live frame of an author raises
28584
- * it above that author's frames still queued, which were lost for good. A frame the edge did not take ends the answer
28585
- * (the member asks again when its edge opens).
29255
+ * member goes after what is left of the last, without the frames still queued there (the same objects: a store's)
29256
+ * nor those still on their way (`onTheirWay`); it took their place before, and left out what the member's `have`
29257
+ * said it held: a live frame of an author raises it above that author's frames still queued, which were lost for
29258
+ * good. A frame the edge did not take ends the answer (the member asks again when its edge opens).
28586
29259
  */
28587
29260
  handOut(to, frames) {
28588
29261
  const handled = this.hooks.handled;
@@ -28590,6 +29263,11 @@ var CatchUpAnswers = class {
28590
29263
  for (const frame of frames) this.hooks.send(to, frame);
28591
29264
  return;
28592
29265
  }
29266
+ const sent = this.onTheirWay.get(to), key = this.hooks.key;
29267
+ if (sent?.size && key) frames = frames.filter((frame) => {
29268
+ const k = key(frame);
29269
+ return k === void 0 || !sent.has(k);
29270
+ });
28593
29271
  const going = this.going.get(to);
28594
29272
  if (going) {
28595
29273
  const queued = new Set(going);
@@ -28598,9 +29276,19 @@ var CatchUpAnswers = class {
28598
29276
  }
28599
29277
  const rest = [...frames], told = [];
28600
29278
  const ask = () => handled(to).catch(() => false);
29279
+ const settled = async () => {
29280
+ let answer = await ask();
29281
+ while (answer === "late" && this.hooks.active()) answer = await ask();
29282
+ return answer;
29283
+ };
28601
29284
  const next = () => {
28602
- if (!this.sendSlice(to, rest)) return false;
28603
- if (rest.length) told.push(ask());
29285
+ const slice = this.sendSlice(to, rest);
29286
+ if (!slice) return false;
29287
+ const keys = key ? slice.map(key).filter((k) => k !== void 0) : [];
29288
+ if (!rest.length && !keys.length) return true;
29289
+ const done = settled();
29290
+ if (keys.length) this.track(to, keys, done);
29291
+ if (rest.length) told.push(done);
28604
29292
  return true;
28605
29293
  };
28606
29294
  if (!next() || !next() || !rest.length) return;
@@ -28608,9 +29296,7 @@ var CatchUpAnswers = class {
28608
29296
  (async () => {
28609
29297
  try {
28610
29298
  while (rest.length) {
28611
- let answer = await told.shift();
28612
- while (answer === "late" && this.hooks.active()) answer = await ask();
28613
- if (!answer) await new Promise((resolve) => setTimeout(resolve, 500));
29299
+ if (!await told.shift()) await new Promise((resolve) => setTimeout(resolve, 500));
28614
29300
  if (!this.hooks.active() || !next()) break;
28615
29301
  }
28616
29302
  } finally {
@@ -28618,13 +29304,24 @@ var CatchUpAnswers = class {
28618
29304
  }
28619
29305
  })();
28620
29306
  }
28621
- /** The next slice of `rest` to `to`: false, and nothing left, when the edge did not take one. */
29307
+ /** The next slice of `rest` to `to`, as sent: undefined, and nothing left, when the edge did not take one. */
28622
29308
  sendSlice(to, rest) {
28623
- for (const frame of rest.splice(0, 16)) if (this.hooks.send(to, frame) === false) {
29309
+ const slice = rest.splice(0, 16);
29310
+ for (const frame of slice) if (this.hooks.send(to, frame) === false) {
28624
29311
  rest.length = 0;
28625
- return false;
29312
+ return;
28626
29313
  }
28627
- return true;
29314
+ return slice;
29315
+ }
29316
+ /** A slice's frames (`keys`) are on their way to `to` until `done`: its app handled them, or cannot say (`false`). */
29317
+ track(to, keys, done) {
29318
+ let sent = this.onTheirWay.get(to);
29319
+ if (!sent) this.onTheirWay.set(to, sent = /* @__PURE__ */ new Set());
29320
+ for (const k of keys) sent.add(k);
29321
+ done.then(() => {
29322
+ for (const k of keys) sent.delete(k);
29323
+ if (!sent.size && this.onTheirWay.get(to) === sent) this.onTheirWay.delete(to);
29324
+ });
28628
29325
  }
28629
29326
  };
28630
29327
  //#endregion
@@ -28884,7 +29581,7 @@ var editSigned = (f) => utf8Encode(JSON.stringify([
28884
29581
  function isEditFrame(v) {
28885
29582
  if (!v || typeof v !== "object") return false;
28886
29583
  const f = v;
28887
- return f.t === "group-edit" && typeof f.g === "string" && GROUP_ID.test(f.g) && Number.isSafeInteger(f.e) && f.e >= 0 && typeof f.s === "string" && MEMBER_KEY.test(f.s) && Number.isSafeInteger(f.n) && f.n >= 0 && cardEditNumber(f.v) && Number.isSafeInteger(f.ts) && f.ts > 0 && typeof f.nn === "string" && f.nn.length === 32 && B64$1.test(f.nn) && typeof f.c === "string" && f.c.length <= MAX_EDIT_BOX && B64$1.test(f.c) && typeof f.sig === "string" && f.sig.length === 86 && B64$1.test(f.sig);
29584
+ return f.t === "group-edit" && typeof f.g === "string" && GROUP_ID.test(f.g) && Number.isSafeInteger(f.e) && f.e >= 0 && typeof f.s === "string" && MEMBER_KEY.test(f.s) && Number.isSafeInteger(f.n) && f.n >= 0 && validRemovalNumber(f.v) && Number.isSafeInteger(f.ts) && f.ts > 0 && typeof f.nn === "string" && f.nn.length === 32 && B64$1.test(f.nn) && typeof f.c === "string" && f.c.length <= MAX_EDIT_BOX && B64$1.test(f.c) && typeof f.sig === "string" && f.sig.length === 86 && B64$1.test(f.sig);
28888
29585
  }
28889
29586
  /**
28890
29587
  * Where a frame said again was first said (`o`): an earlier epoch than the frame's own and a sequence number there, or
@@ -29094,7 +29791,8 @@ var GroupSession = class {
29094
29791
  return hooks.send(to, frame);
29095
29792
  },
29096
29793
  ...hooks.handled && { handled: (to) => hooks.handled(to) },
29097
- active: () => this.state.status === "active"
29794
+ active: () => this.state.status === "active",
29795
+ key: (frame) => frame.t === "group-msg" ? frameKey$1(frame) : void 0
29098
29796
  });
29099
29797
  this.provisional = new Set((state.provisional ?? []).slice(-GROUP_LIMITS.provisional));
29100
29798
  this.chainMovedAt = this.clock();
@@ -29221,13 +29919,24 @@ var GroupSession = class {
29221
29919
  return this.roster.map(([k]) => k).filter((k) => k !== this.myKey);
29222
29920
  }
29223
29921
  /**
29224
- * Whether `key` could read message `messageId` (`<s>:<e>:<n>`) and still can: in the roster of its epoch, and in the
29225
- * roster now. A holder serves a group file only to such a member (WISP 503 § Asking).
29922
+ * Whether `key` could read message `messageId` (`<s>:<e>:<n>`) and still can: in the roster now, and in the roster of
29923
+ * its epoch or, given the message's time `ts`, in the roster of the epoch its author, behind on the chain, said it
29924
+ * again under (`saidAgainEpoch`): the newest after its own that comes before any `add` dated later than it. That
29925
+ * member read it under its first id. A holder serves a group file only to such a member (WISP 503 § Asking).
29226
29926
  */
29227
- couldRead(key, messageId) {
29927
+ couldRead(key, messageId, ts) {
29228
29928
  const e = Number(messageId.split(":")[1]);
29229
29929
  const then = this.state.chain.find((c) => c.e === e);
29230
- return !!then && rosterHas(then.m, key) && rosterHas(this.roster, key);
29930
+ if (!then || !rosterHas(this.roster, key)) return false;
29931
+ if (rosterHas(then.m, key)) return true;
29932
+ if (ts === void 0) return false;
29933
+ let again;
29934
+ for (let later = e + 1; later <= this.epoch; later++) {
29935
+ const c = this.state.chain[later];
29936
+ if (!c || c.k === "add" && c.ts > ts) break;
29937
+ again = c;
29938
+ }
29939
+ return !!again && rosterHas(again.m, key);
29231
29940
  }
29232
29941
  role(key) {
29233
29942
  return this.roster.find(([k]) => k === key)?.[1];
@@ -29852,12 +30561,15 @@ var GroupSession = class {
29852
30561
  const ref = meshMessageRef(messageId);
29853
30562
  const commit = ref && this.state.chain[ref.e];
29854
30563
  if (!ref || ref.s !== this.myKey || !commit || !rosterHas(commit.m, this.myKey)) return { error: "Only your own messages can be edited" };
29855
- if (!(edit.card ? cardEditNumber(edit.v) : validEditNumber(edit.v))) return { error: "This message was edited too many times" };
30564
+ if (!(edit.remove ? validRemovalNumber(edit.v) : edit.card ? cardEditNumber(edit.v) : validEditNumber(edit.v))) return { error: "This message was edited too many times" };
29856
30565
  const text = edit.text.trim();
29857
30566
  if (!validEditText(text)) return { error: text ? "Message exceeds 16 KiB" : "An edit cannot be empty" };
29858
30567
  if (!this.secret(ref.e)) return { error: "This message is too old to edit: its epoch's key is gone" };
29859
30568
  const named = validMentions(wireMentions(edit.mentions ?? []), text, rosterAdmin(commit.m) === this.myKey && this.isAdmin);
29860
- const plain = JSON.stringify({
30569
+ const plain = JSON.stringify(edit.remove ? {
30570
+ text,
30571
+ rm: true
30572
+ } : {
29861
30573
  text,
29862
30574
  ...named.length ? { m: named } : {},
29863
30575
  ...edit.card ? { sc: edit.card } : {}
@@ -30254,9 +30966,12 @@ var GroupSession = class {
30254
30966
  return;
30255
30967
  }
30256
30968
  if (!body || typeof body !== "object" || !validEditText(body.text)) return;
30257
- const k = validMentions(body.m, body.text, rosterAdmin(commit.m) === raw.s && this.admin === raw.s);
30258
- const sc = body.sc === void 0 ? void 0 : readStatusCard(body.sc);
30259
- if (!validEditNumber(raw.v) && !sc) return;
30969
+ if (body.rm !== void 0 && body.rm !== true) return;
30970
+ const rm = body.rm === true;
30971
+ if (!rm && !cardEditNumber(raw.v)) return;
30972
+ const k = rm ? [] : validMentions(body.m, body.text, rosterAdmin(commit.m) === raw.s && this.admin === raw.s);
30973
+ const sc = rm || body.sc === void 0 ? void 0 : readStatusCard(body.sc);
30974
+ if (!rm && !validEditNumber(raw.v) && !sc) return;
30260
30975
  const copy = this.kept().find((f) => f.s === raw.s && f.e === raw.e && f.n === raw.n);
30261
30976
  const first = copy && readFirstPlace(copy.o, copy.e);
30262
30977
  await this.hooks.edit?.({
@@ -30266,7 +30981,8 @@ var GroupSession = class {
30266
30981
  ts: raw.ts,
30267
30982
  m: body.text,
30268
30983
  ...k.length ? { k } : {},
30269
- ...sc ? { sc } : {}
30984
+ ...sc ? { sc } : {},
30985
+ ...rm ? { rm: true } : {}
30270
30986
  });
30271
30987
  if (this.keepEdit(raw)) {
30272
30988
  await this.persist();
@@ -31062,12 +31778,16 @@ var FRESH = /* @__PURE__ */ new Set([
31062
31778
  * history keeps room for everyone else to get out after it: two commits a member (a leave or a remove is one, and a
31063
31779
  * leaving admin hands the role over first). The history is never compacted, and one that filled with people in it
31064
31780
  * took no leave, remove or handover any more. Its own rule: a history up to `COMMUNITY_LIMITS.chain` verifies as before.
31781
+ * A member takes in such a commit from someone else only when it keeps that room too (`receiveCommit`): an app that
31782
+ * does not keep it could otherwise fill the history for everyone.
31065
31783
  */
31066
31784
  var GROWS = /* @__PURE__ */ new Set([
31067
31785
  "add",
31068
31786
  "rotate",
31069
31787
  "link"
31070
31788
  ]);
31789
+ /** Whether a history whose last commit is at `epoch`, with `roster` in it, still has room for everyone else to get out. */
31790
+ var keepsRoom = (epoch, roster) => epoch + 1 + 2 * (roster.length - 1) <= COMMUNITY_LIMITS.chain;
31071
31791
  /**
31072
31792
  * Kinds only the admin commits. They are final: a branch that drops one never replaces the branch
31073
31793
  * that has it, however long, so no member can undo a removal, a hand-over, a rotation or a link change
@@ -31129,6 +31849,30 @@ var leftStatement = (g, h, hi) => utf8Encode(JSON.stringify([
31129
31849
  Object.entries(hi).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)
31130
31850
  ]));
31131
31851
  var LEFT_EPOCH = /^\d{1,15}:[a-f0-9]{16}$/;
31852
+ /** A leave of one admission: `h` is the hash of the commit that last put `s` in the roster (its `add`, or the `create` it signed). */
31853
+ var leaveStatement3 = (g, s, h) => utf8Encode(JSON.stringify([
31854
+ "ghostly-group/3 leave",
31855
+ g,
31856
+ s,
31857
+ h
31858
+ ]));
31859
+ /**
31860
+ * Whether a leave holds after `before` (the commits before it, newest first): its `ls3` names the commit that last
31861
+ * admitted the leaver, or, from an app that signs no such statement, no earlier leave carries its `ls`. `ls` says the
31862
+ * same for every admission of a member, so by itself it ends one admission only.
31863
+ */
31864
+ function leaveStands(leave, before) {
31865
+ if (!leave.s || !leave.ls) return false;
31866
+ let admitted = false;
31867
+ for (const c of before) {
31868
+ if (!admitted && (c.k === "add" && c.s === leave.s || c.k === "create" && c.by === leave.s)) {
31869
+ admitted = true;
31870
+ if (leave.ls3 && SIG.test(leave.ls3) && verify(fromBase64Url(leave.ls3), leaveStatement3(leave.g, leave.s, communityCommitHash(c)), publicKeyFromZ32(leave.s))) return true;
31871
+ }
31872
+ if (c.k === "leave" && c.ls === leave.ls) return false;
31873
+ }
31874
+ return true;
31875
+ }
31132
31876
  /** The secret of an epoch that adds, re-roles or re-links: from the previous one and the commit. */
31133
31877
  function derivedSecret(previous, untaggedHash) {
31134
31878
  return hkdf(sha256, previous, utf8Encode(untaggedHash), utf8Encode("ghostly-group/2 derived"), 32);
@@ -31154,6 +31898,7 @@ function parseCommit(raw) {
31154
31898
  if (c.x !== void 0) out.x = c.x;
31155
31899
  if (c.n !== void 0) out.n = c.n;
31156
31900
  if (c.ls !== void 0) out.ls = c.ls;
31901
+ if (out.k === "leave" && typeof c.ls3 === "string" && SIG.test(c.ls3)) out.ls3 = c.ls3;
31157
31902
  return out;
31158
31903
  }
31159
31904
  /**
@@ -31186,15 +31931,18 @@ function communityRoster(previous, c, trusted = false) {
31186
31931
  /**
31187
31932
  * One commit against its parent (null for a genesis) and the parent's roster: shape, id, link,
31188
31933
  * authority, roster arithmetic, roster hash and signature. The confirmation tag is checked once
31189
- * the secret is known.
31934
+ * the secret is known. `before`: the commits before it on its branch, newest first; given, a `leave` is held to the
31935
+ * admission it ends (`leaveStands`). A member gives it for every commit it takes in after its own admission; the chain
31936
+ * of a welcome is not held to it (`verifyCommunityChain`).
31190
31937
  */
31191
- function verifyCommunityCommit(raw, parent, parentRoster, groupId) {
31938
+ function verifyCommunityCommit(raw, parent, parentRoster, groupId, before) {
31192
31939
  const commit = parseCommit(raw);
31193
31940
  if (!commit) return { error: "Malformed membership commit" };
31194
31941
  if (groupId && commit.g !== groupId) return { error: "Commit for another group" };
31195
31942
  if (parent) {
31196
31943
  if (commit.g !== parent.g) return { error: "Commit for another group" };
31197
31944
  if (commit.e !== parent.e + 1) return { error: "Commit out of sequence" };
31945
+ if (commit.e >= COMMUNITY_LIMITS.chain) return { error: "Membership chain too long" };
31198
31946
  if (commit.p !== communityCommitHash(parent)) return { error: "Commit does not follow its parent" };
31199
31947
  } else {
31200
31948
  if (commit.e !== 0 || commit.p !== "" || commit.k !== "create") return { error: "The chain does not start with the creation of the group" };
@@ -31204,6 +31952,7 @@ function verifyCommunityCommit(raw, parent, parentRoster, groupId) {
31204
31952
  if (commit.k !== "leave" && commit.ls !== void 0) return { error: "Malformed membership commit" };
31205
31953
  const roster = communityRoster(parent ? parentRoster : null, commit);
31206
31954
  if (!roster) return { error: "Unauthorized or inconsistent membership change" };
31955
+ if (commit.k === "leave" && before && !leaveStands(commit, before)) return { error: "This leave is not for the member's current admission" };
31207
31956
  if (rosterHash(roster) !== commit.m) return { error: "The roster hash does not match the change" };
31208
31957
  if (!verify(fromBase64Url(commit.sig), utf8Encode(tuple(commit)), publicKeyFromZ32(commit.by))) return { error: "Membership commit signature is invalid" };
31209
31958
  return {
@@ -31211,7 +31960,11 @@ function verifyCommunityCommit(raw, parent, parentRoster, groupId) {
31211
31960
  roster
31212
31961
  };
31213
31962
  }
31214
- /** A whole chain from its genesis; the rosters after each commit and the entry key at the end. */
31963
+ /**
31964
+ * A whole chain from its genesis; the rosters after each commit and the entry key at the end. What a newcomer is
31965
+ * handed: a `leave` in it is not held to the admission it ends, since a chain from before 2026-10-10 may hold a
31966
+ * member's second leave under the one statement there was, and no newcomer could enter that group again.
31967
+ */
31215
31968
  function verifyCommunityChain(raw, groupId) {
31216
31969
  if (!Array.isArray(raw) || raw.length === 0 || raw.length > COMMUNITY_LIMITS.chain) return { error: "Malformed membership chain" };
31217
31970
  const chain = [], rosters = [];
@@ -31702,13 +32455,17 @@ var CommunitySession = class {
31702
32455
  placeSide(commit) {
31703
32456
  const parent = this.known.get(commit.p), parentRoster = parent ? this.rosterAt(commit.p) : void 0;
31704
32457
  if (!parentRoster || !parent) return false;
31705
- const result = verifyCommunityCommit(commit, parent, parentRoster, this.id);
32458
+ const result = verifyCommunityCommit(commit, parent, parentRoster, this.id, this.ancestry(commit.p));
31706
32459
  if ("error" in result) return false;
31707
32460
  const h = communityCommitHash(result.commit);
31708
32461
  this.known.set(h, result.commit);
31709
32462
  this.rosters.set(h, result.roster);
31710
32463
  return true;
31711
32464
  }
32465
+ /** The commit `h` and those before it on its branch, newest first. */
32466
+ *ancestry(h) {
32467
+ for (let c = this.known.get(h); c; c = this.known.get(c.p)) yield c;
32468
+ }
31712
32469
  rosterOf(h) {
31713
32470
  return this.rosterAt(h);
31714
32471
  }
@@ -31831,8 +32588,9 @@ var CommunitySession = class {
31831
32588
  }
31832
32589
  const parsed = parseCommit(raw);
31833
32590
  if (!parsed || this.known.has(communityCommitHash(parsed))) return false;
31834
- const result = verifyCommunityCommit(raw, parent, parentRoster, this.id);
32591
+ const result = verifyCommunityCommit(raw, parent, parentRoster, this.id, this.ancestry(p));
31835
32592
  if ("error" in result) return false;
32593
+ if (GROWS.has(result.commit.k) && !keepsRoom(result.commit.e, result.roster)) return false;
31836
32594
  const commit = result.commit, h = communityCommitHash(commit);
31837
32595
  const admin = rosterAdmin(parentRoster);
31838
32596
  if (commit.by === admin) {
@@ -32063,8 +32821,8 @@ var CommunitySession = class {
32063
32821
  ts: now
32064
32822
  };
32065
32823
  const roster = communityRoster(this.roster, draftBase);
32066
- if (!roster) throw new Error("This change is not allowed");
32067
- if (GROWS.has(kind) && this.state.chain.length + 1 + 2 * (roster.length - 1) > COMMUNITY_LIMITS.chain) throw new Error("This group has reached its membership history limit. Create a new group.");
32824
+ if (!roster || kind === "leave" && !leaveStands(draftBase, this.ancestry(parentHash))) throw new Error("This change is not allowed");
32825
+ if (GROWS.has(kind) && !keepsRoom(draftBase.e, roster)) throw new Error("This group has reached its membership history limit. Create a new group.");
32068
32826
  const draft = {
32069
32827
  ...draftBase,
32070
32828
  m: rosterHash(roster)
@@ -32234,6 +32992,10 @@ var CommunitySession = class {
32234
32992
  s: this.myKey,
32235
32993
  ls: toBase64Url(sign(leaveStatement(this.id, this.myKey), this.identity.seed))
32236
32994
  };
32995
+ for (const c of this.ancestry(this.topHash)) if (c.k === "add" && c.s === this.myKey || c.k === "create" && c.by === this.myKey) {
32996
+ frame.ls3 = toBase64Url(sign(leaveStatement3(this.id, this.myKey, communityCommitHash(c)), this.identity.seed));
32997
+ break;
32998
+ }
32237
32999
  this.hooks.broadcast(frame);
32238
33000
  this.out("left", "You left this group");
32239
33001
  await this.persist();
@@ -32255,7 +33017,8 @@ var CommunitySession = class {
32255
33017
  try {
32256
33018
  const { hash } = await this.commit("leave", {
32257
33019
  s: request.s,
32258
- ls: request.ls
33020
+ ls: request.ls,
33021
+ ...request.ls3 ? { ls3: request.ls3 } : {}
32259
33022
  }, now);
32260
33023
  this.markLeft(hash, request.s);
32261
33024
  done++;
@@ -32393,17 +33156,18 @@ var CommunitySession = class {
32393
33156
  return this.serialize(async () => {
32394
33157
  if (!this.isMember) return { error: this.state.statusReason ?? "You are not in this group" };
32395
33158
  if (communityMessageAuthor(edit.id) !== this.myKey) return { error: "Only your own messages can be edited" };
32396
- if (!(edit.card ? cardEditNumber(edit.v) : validEditNumber(edit.v))) return { error: "This message was edited too many times" };
33159
+ if (!(edit.remove ? validRemovalNumber(edit.v) : edit.card ? cardEditNumber(edit.v) : validEditNumber(edit.v))) return { error: "This message was edited too many times" };
32397
33160
  const text = edit.text.trim();
32398
33161
  if (!validEditText(text)) return { error: text ? "Message exceeds 16 KiB" : "An edit cannot be empty" };
32399
- const named = validMentions(wireMentions(edit.mentions ?? []), text, false);
33162
+ const named = edit.remove ? [] : validMentions(wireMentions(edit.mentions ?? []), text, false);
32400
33163
  const frame = communityEditFrame({
32401
33164
  id: edit.id,
32402
33165
  e: edit.v,
32403
33166
  ts: edit.ts,
32404
33167
  m: text,
32405
33168
  k: named,
32406
- ...edit.card && { sc: edit.card }
33169
+ ...edit.card && !edit.remove && { sc: edit.card },
33170
+ ...edit.remove && { rm: true }
32407
33171
  });
32408
33172
  const room = COMMUNITY_LIMITS.textBytes + 256, clean = sanitizeNick(nick);
32409
33173
  const size = (withNick) => utf8Encode(JSON.stringify(withNick && clean ? {
@@ -32653,11 +33417,27 @@ var CommunitySession = class {
32653
33417
  receiveLeave(frame) {
32654
33418
  const s = frame.s, ls = frame.ls;
32655
33419
  if (typeof s !== "string" || !MEMBER_KEY.test(s) || typeof ls !== "string" || !SIG.test(ls) || !rosterHas(this.roster, s)) return false;
32656
- if (this.state.pendingLeaves.some((r) => r.s === s)) return false;
33420
+ const ls3 = typeof frame.ls3 === "string" && SIG.test(frame.ls3) ? frame.ls3 : void 0;
33421
+ let held = this.state.pendingLeaves.find((r) => r.s === s);
33422
+ if (held && !leaveStands({
33423
+ g: this.id,
33424
+ ...held
33425
+ }, this.ancestry(this.topHash))) {
33426
+ this.state.pendingLeaves = this.state.pendingLeaves.filter((r) => r !== held);
33427
+ held = void 0;
33428
+ }
33429
+ if (held && (held.ls3 || !ls3)) return false;
32657
33430
  if (!verify(fromBase64Url(ls), leaveStatement(this.id, s), publicKeyFromZ32(s))) return false;
32658
- this.state.pendingLeaves = [...this.state.pendingLeaves, {
33431
+ if (!leaveStands({
33432
+ g: this.id,
33433
+ s,
33434
+ ls,
33435
+ ls3
33436
+ }, this.ancestry(this.topHash))) return false;
33437
+ this.state.pendingLeaves = [...this.state.pendingLeaves.filter((r) => r !== held), {
32659
33438
  s,
32660
- ls
33439
+ ls,
33440
+ ...ls3 ? { ls3 } : {}
32661
33441
  }].slice(-COMMUNITY_LIMITS.pendingLeaves);
32662
33442
  this.persistSoon();
32663
33443
  return true;
@@ -34406,6 +35186,6 @@ function x401ApprovalDigest(subject) {
34406
35186
  return toBase64Url(sha256(utf8Encode(canonical)));
34407
35187
  }
34408
35188
  //#endregion
34409
- export { COMMUNITY_LIMITS as $, sign as $S, ENROLL_PROOF as $_, PAIRING_ATTEMPT_MS as $a, verifyDeviceTransports as $b, APPS_CAPABILITY as $c, recordingMime as $d, reactionIsNewer as $f, handoffContext as $g, waitForIceGathering as $h, sparkNetworkOf as $i, CAPS_LABEL as $l, TRANSPORTS_GONE_MS as $m, bip322ToSpend as $n, wireHubPolicy as $o, commitUntaggedHash as $p, didGhostlyServiceEntry as $r, mayPin as $s, communityMessageAuthor as $t, proofHash as $u, readLinkRecord as $v, GROUP_BURST_MS as $x, previewable as $y, readX401ProofResponseHeader as A, __exportAll as AC, heldBackError as AS, readHandoffManifest as A_, fedimintRequestPayload as Aa, inviteQrSegments as Ab, encryptPushPayload as Ac, LIVE_POLL_MS as Ad, linkEnd as Af, HANDOFF_HELLO as Ag, RTC_SIGNAL_FUTURE_MS as Ah, signDidDhtPacket as Ai, DNS_TYPE as Al, REANSWERS as Am, parseGroupMetaTag as An, readGroupHave as Ao, readStatusCard as Ap, AtprotoProofError as Ar, transferStalled as As, GROUP_WAKE_FRAME as At, identityPresentationBytes as Au, LINK_RECORD_LABEL as Av, sealTurnBody as Ax, appFingerprint as Ay, APP_STORE_KINDS as B, openRelayPayload as BS, encodeSetSlots as B_, CROSSED_WAIT_MS as Ba, deviceEchoFrame as Bb, APP_RESUME_GRACE_MS as Bc, safeBlobType as Bd, GROUP_REACTION_FRAME as Bf, HANDOFF_TIMINGS as Bg, answersOffer as Bh, arkAddressPrefix as Bi, domainWellKnownFile as Bl, DHT_POLL_INTERVALS as Bm, parseSshSignature as Bn, SIGNAL_HOLD_MS as Bo, receivedTimestamp as Bp, unsignedCommitBytes as Br, TypingSender as Bs, GROUP_LIMITS as Bt, IDENTITY_TIMELINE_MAX as Bu, STAMP_BITS_MAX as Bv, turnSequence as Bx, readAppRevocation as By, buildX401TokenObject as C, toBase64 as CC, BREAKER_ALL_DOWN_PROBE_MS as CS, readHandoffBusy as C_, requestLnurlInvoice as Ca, createChatInvite as Cb, wakeFrame as Cc, ACTIVE_DHT_POLL_MS as Cd, parseEditFrame as Cf, HANDOFF_CANCEL as Cg, decodeControl as Ch, didDhtKey as Ci, HOLD_LIMITS as Cl, ANSWER_REFUSED_REDIALS as Cm, groupName as Cn, GROUP_VERSION_FILES as Co, buttonLabelClash as Cp, atprotoProofRkey as Cr, FILE_DATA_KIND as Cs, encodeGroupEntryLink as Ct, IDENTITY_REVOCATION_LABEL as Cu, settleRequest as Cv, TurnRecordError as Cx, readAppBundle as Cy, readX401ProofRequest as D, utf8Encode as DC, RelayBreaker as DS, readHandoffFileFrame as D_, findBolt11 as Da, encodeInviteCode as Db, WebPushError as Dc, DHT_TEXT_BYTES as Dd, LINK_MAX_CHARS as Df, HANDOFF_FILE_MISSING as Dg, wrapDataChannel as Dh, jwkThumbprint as Di, newMailbox as Dl, GATHER_ATTEMPTS as Dm, parseGroupMetaBody as Dn, groupFileFallback as Do, cardTimeUtc as Dp, parseAtprotoDidDocument as Dr, encodeFileData as Ds, knockRecords as Dt, IdentityExchange as Du, ContactRequestError as Dv, openTurnValue as Dx, APP_NAME as Dy, isX401Protocol as E, utf8Decode as EC, BREAKER_THRESHOLD as ES, readHandoffDone as E_, decodeBolt11 as Ea, encodeGhostlyInvite as Eb, PUSH_SERVICE_HOSTS as Ec, DHT_MESSAGE_TTL as Ed, validEditNumber as Ef, HANDOFF_DONE as Eg, sendBody as Eh, encodeDidDhtPacket as Ei, isHoldUrl as El, DataLink as Em, openGroupMeta as En, fetchesByItself as Eo, cardLinkHost as Ep, normalizeAtprotoHandle as Er, decodeFileData as Es, knockIdentity as Et, IdentityCheckUnavailable as Eu, CONTACT_RECORD_TTL as Ev, nextTurnPosition as Ex, yieldThread as Ey, appRevocationFor as F, PacketTooLargeError as FS, sameDigest as F_, ANSWERS_REFUSED_PAUSES as Fa, DEVICE_CAPABILITIES as Fb, APP_DATA_MAX_BYTES as Fc, dhtFileId as Fd, FORWARD_LIMITS as Ff, HANDOFF_PAKE as Fg, parseRtcSignal as Fh, SEPOLIA_TEST_USDT as Fi, NIP05_PATH as Fl, DirectPathWatch as Fm, SSHSIG_NAMESPACE as Fn, GROUP_SIGNAL_FRAME as Fo, usageLeft as Fp, findInMst as Fr, TYPING_REFRESH_MS as Fs, GroupWakeLimiter as Ft, newIdentityBinding as Fu, REQUEST_LIFETIME_MS as Fv, turnKeys as Fx, checkAppRevokeStatement as Fy, readAppStore as G, decodeTxtPacket as GS, signTombstone as G_, GhostLink as Ga, deviceLinkParams as Gb, appDataBytes as Gc, VOICE_LIMITS as Gd, ReactionWindow as Gf, filePartDigest as Gg, decompressSdp as Gh, parsePaymentAmount as Gi, parseDomainTxt as Gl, MAX_DHT_TEXT_BYTES as Gm, verifySshSignature as Gn, GROUP_VERSION_HUBS as Go, GROUP_VERSION_LARGE as Gp, DID_GHOSTLY_SERVICE as Gr, typingFrame as Gs, chainPieces as Gt, PeerProofs as Gu, knockSlotOf as Gv, BACKGROUND_WHILE_SIGNALING as Gx, signAppRevocation as Gy, checkAppListing as H, readOwnRelayPayload as HS, setAckFrame as H_, DEMOTE_MS as Ha, deviceFrameCapability as Hb, APP_VERSION_MAX as Hc, sanitizeMime as Hd, REACTED_FRAME as Hf, HANDOFF_VERSION as Hg, callRtcConfig as Hh, assertWholeSats as Hi, isPublicAddress as Hl, FIRST_PUBLISH_MAX_MS as Hm, sshFingerprint as Hn, SIGNAL_REPLY_MS as Ho, GROUP_ADMIN_OFF_ERROR as Hp, verifyAtprotoSignature as Hr, parseTypingFrame as Hs, GROUP_READ_NOTE as Ht, lastSharedWithMe as Hu, contactDay as Hv, turnStatedVerifier as Hx, readAppRevocations as Hy, appStoreDecision as I, RELAY_PAYLOAD_MAX_BYTES as IS, sealHandoffPiece as I_, ANSWERS_REFUSED_PAUSE_MS as Ia, DEVICE_ECHO_FRAME as Ib, APP_FRAME as Ic, readDhtFile as Id, forwardedAgain as If, HANDOFF_PIECE_BYTES as Ig, CALL_SIGNAL_FUTURE_MS as Ih, SEPOLIA_TEST_USDT_FAUCET as Ii, WELL_KNOWN_PATH as Il, directBlocked as Im, SSH_KEY_TYPES as In, GROUP_VERSION_SIGNALS as Io, MESSAGE_CLOCK_SKEW_MS as Ip, parseAtprotoCar as Ir, TYPING_SEND_LIMIT as Is, groupWakeFrame as It, receivedIdentityStatus as Iu, REQUEST_NAME_UNITS as Iv, turnName as Ix, isAppHash as Iy, GROUP_TYPING_FRAME as J, IDENTITY_MEMO_SIZE as JS, ENROLL_CANCEL as J_, INVITE_TAKEN as Ja, deviceLinkSecret as Jb, chatAppId as Jc, downsamplePeaks as Jd, parseReactionFrame as Jf, handoffAttemptAllowed as Jg, isGlobalIpv4Host as Jh, SPARK_NETWORKS as Ji, recordsName as Jl, OFFER_STEP_MAX as Jm, verifyBitcoinMessage as Jn, mayBeHub as Jo, MAX_GROUP_MEMBERS as Jp, DID_MAX_LENGTH as Jr, GROUP_PIN_FRAME as Js, COMMUNITY_EDIT_FRAME as Jt, emptyProofLedger as Ju, makeStamp as Jv, CHAT_RESERVE_PER_CHAT as Jx, verifyAppStatementBytes as Jy, readAppStoreSteps as K, encodeTxtPacket as KS, verifySetUpdate as K_, HANDLED_WAIT_MS as Ka, deviceLinkRendezvousSeed as Kb, appDataFrame as Kc, VOICE_METER as Kd, nextReactionNumber as Kf, filePartName as Kg, extractParamsFromSdp as Kh, validatePaymentTarget as Ki, recordsFromTxt as Kl, OFFER_FAST_MS as Km, isLegacySignature as Kn, MESH_HUBS as Ko, LEGACY_GROUP_MEMBERS as Kp, DID_JWS_ALGS as Kr, typingKindOf as Ks, frameBytes as Kt, STORAGE_LIFETIME as Ku, knockSlotRecords as Kv, CHAT_RESERVE as Kx, verifyAppRevocation as Ky, appUpdateDecision as L, createRelayPayload as LS, sortParts as L_, BLOCKED_DIAL_WAIT_MS as La, DEVICE_PING_FRAME as Lb, APP_PEER_OPEN_MAX as Lc, FileTransfers as Ld, forwardedMany as Lf, HANDOFF_PIECE_OVERHEAD as Lg, CALL_SIGNAL_MAX_AGE_MS as Lh, TEST_USDT_FAUCET_AMOUNT as Li, decodeDnsResponse as Ll, symmetricNat as Lm, SSH_PUBLIC_KEY_MAX as Ln, SIGNALS_PER_MINUTE as Lo, arrivalKey as Lp, parseAtprotoDidKey as Lr, TYPING_STATUS_MAX as Ls, groupWakes as Lt, revokesIdentity as Lu, REQUEST_PACKET_BYTES as Lv, turnPacket as Lx, isAppKey as Ly, readX401ProofResultHeader as M, __toCommonJS as MC, withRequestOptions as MS, readHandoffRelease as M_, isFederationId as Ma, ownInviteRefusal as Mb, pushRequest as Mc, peekDhtMailbox as Md, parseLinkPreview as Mf, HANDOFF_LIST_PER_FRAME as Mg, buildDataSdp as Mh, EVM_TEST_CHAINS as Mi, DOMAIN_MAX_RECORDS as Ml, DIRECT_EVIDENCE_MS as Mm, verifyGroupMetaSignature as Mn, readGroupWantNo as Mo, statusCardBytes as Mp, decodeAtprotoCommit as Mr, TYPING_KINDS as Ms, GROUP_WAKE_GROUP_WINDOW_MS as Mt, identityStatement as Mu, MAX_SLOT_KNOCKS as Mv, signTurnPacket as Mx, appRefPublisher as My, x401AnswerableRequests as N, MAX_DNS_PACKET_BYTES as NS, readHandoffTurnFrame as N_, parseCashuRequestPayload as Na, readInviteCode as Nb, vapidAuthorization as Nc, DHT_FILE_CAPABILITY as Nd, previewImageSize as Nf, HANDOFF_MANIFEST as Ng, extractRtcParams as Nh, ONCHAIN_PROVIDER as Ni, DOMAIN_METHODS as Nl, DIRECT_OWN_ATTEMPTS as Nm, wrapGroupMeta as Nn, CARRIED_DEFER_MS as No, statusCardText as Np, decodeDagCbor as Nr, TYPING_RATE_LIMIT as Ns, GROUP_WAKE_MEMBER_INTERVAL_MS as Nt, identityStatementText as Nu, REQUEST_CLOCK_SKEW_MS as Nv, signTurnRelease as Nx, appRevocationId as Ny, readX401ProofRequestHeader as O, __commonJSMin as OC, DiscoveryBudgetError as OS, readHandoffHave as O_, ENDPOINT as Oa, inviteLink as Ob, checkPushEndpoint as Oc, DHT_TEXT_REFUSED as Od, LINK_PREVIEW_LIMITS as Of, HANDOFF_FILE_REQUEST as Og, DATA_CHANNEL_ID as Oh, openDidDhtPayload as Oi, readManifest as Ol, GATHER_STALL_MS as Om, parseGroupMetaFrame as On, isGroupMessageId as Oo, cardUrl as Op, shortAtprotoDid as Or, refusalText as Os, mergeKnocks as Ot, boundVerifiedIdentity as Ou, KNOCK_SLOTS as Ov, readTurnBody as Ox, APP_PREFIXES as Oy, addedAppPermissions as P, PKARR_FUTURE_SKEW_MS as PS, readHandoffVerified as P_, parseFedimintRequestPayload as Pa, DEVICES_CAPABILITY as Pb, vapidKeysMatch as Pc, dhtFileElements as Pd, sanitizePreviewImage as Pf, HANDOFF_OFFER as Pg, offerIsFresh as Ph, PaymentPreflightError as Pi, DOMAIN_TXT_MAX_BYTES as Pl, DIRECT_PEERS as Pm, SSHSIG_MAX_ARMOR as Pn, CarriedTransport as Po, taskProgress as Pp, encodeDagCbor as Pr, TYPING_RATE_WINDOW_MS as Ps, GROUP_WAKE_RECEIVE_LIMIT as Pt, isIdentityBinding as Pu, REQUEST_LABEL as Pv, turnInstance as Px, appSignedBytes as Py, sealGroupTyping as Q, publicKeyFromZ32 as QS, ENROLL_HELLO as Q_, PAIRED_FRAME_TOO_LARGE as Qa, unsignedDeviceTransports as Qb, readAppFrame as Qc, parseVoiceMeta as Qd, reactionFrame as Qf, handoffCancelFrame as Qg, signalHasVideo as Qh, sparkInvoiceDetails as Qi, CAPS_ISSUED_BACK_MS as Ql, STALLED_LOOK_MS as Qm, bip322ToSign as Qn, pickMeshHubs as Qo, commitHash as Qp, checkDidSignature as Qr, PIN_LIMITS as Qs, communityEditFrame as Qt, proofCapability as Qu, readKnockSlot as Qv, FRESH_READ_MS as Qx, parseImageMeta as Qy, checkAppBeforeRun as R, measureRecords as RS, SET_ACK as R_, CROSSED_FRESH_MS as Ra, ENROLL_CAPABILITY as Rb, APP_RATE_LIMIT as Rc, PREVIEWABLE_IMAGE as Rd, readForwarded as Rf, HANDOFF_RELEASE as Rg, PAIRED_CALL_CANDIDATES as Rh, USDT_PUBLIC_RPC as Ri, dnsProofName as Rl, AWAITING_PEER_MS as Rm, SshSigError as Rn, SIGNAL_CARRIERS as Ro, claimedTime as Rp, parseAtprotoVerificationKey as Rr, TYPING_TIMEOUT_MS as Rs, mentionedMembers as Rt, signIdentityPresentation as Ru, REQUEST_TEXT_BYTES as Rv, turnPayloadSequence as Rx, isAppRef as Ry, buildX401ResultArtifact as S, randomBytes as SC, traceLink as SS, readHandoffAck as S_, parsePayParams as Sa, OwnInviteError as Sb, relayRequest as Sc, transportOrder as Sd, editedFrame as Sf, HANDOFF_BUSY_REASONS as Sg, decodeChunk as Sh, didDhtFromPublicKey as Si, HOLD_DATED_BACK_MS as Sl, sha256Hex as Sm, groupMetaToHand as Sn, GROUP_HAVE_FRAME as So, appCardId as Sp, atprotoProofRecord as Sr, ChatFiles as Ss, decodeGroupEntryLink as St, IDENTITY_PROVIDER_ID as Su, planKnocks as Sv, TURN_VERSION as Sx, pacer as Sy, encodeX401Header as T, toZ32 as TC, BREAKER_MAX_MS as TS, readHandoffData as T_, BOLT11_PATTERN as Ta, decodeInviteCode as Tb, wakeRequest as Tc, DHT_FILE_TOO_LARGE as Td, validEditMessage as Tf, HANDOFF_DATA as Tg, encodeControl as Th, encodeDidDhtDeactivated as Ti, HoldRefusedError as Tl, DATA_SETTLE_MS as Tm, nextGroupMetaRevision as Tn, GROUP_WANT_NO_FRAME as To, cardLine as Tp, isAtprotoDid as Tr, FILE_LIMITS as Ts, groupEntryUrl as Tt, IDENTITY_SUBJECT as Tu, turnOff as Tv, firstDeviceSetSecret as Tx, sha256Paced as Ty, checkAppStoreIndex as U, signRelayPayload as US, setUpdateFrame as U_, DHT_PIN_GRACE_MS as Ua, deviceKeyZ32 as Ub, AppSessions as Uc, PLAYABLE_AUDIO as Ud, REACTION_FRAME as Uf, HANDOFF_WINDOW as Ug, callSignalHeardAt as Uh, formatPaymentAmount as Ui, nip05RootKey as Ul, IDLE_THRESHOLD as Um, sshKeyDigestHex as Un, groupSignalFrame as Uo, GROUP_ID as Up, DID_DOCUMENT_MAX_BYTES as Ur, sanitizeTypingStatus as Us, GroupSession as Ut, PROOF_ADAPTERS as Uu, knockHolds as Uv, turnVerifierMark as Ux, readAppSignature as Uy, APP_STORE_LIMITS as V, parseRelayPayload as VS, readSetUpdate as V_, DEMOTE_AFTER_FAILURES as Va, deviceEchoNonce as Vb, APP_SEND_LIMIT as Vc, sanitizeFileName as Vd, QUICK_REACTIONS as Vf, HANDOFF_VERIFIED as Vg, buildSdpFromSignal as Vh, assertTokenUnits as Vi, encodeDnsQuery as Vl, EXPECT_PEER_MS as Vm, sameSshKey as Vn, SIGNAL_PROVEN_MS as Vo, shownTime as Vp, verifyAtprotoRecordProof as Vr, parseTypingActivity as Vs, GROUP_REACTED_FRAME as Vt, applyIdentityEvent as Vu, STAMP_BITS_MIN as Vv, turnSignedMessage as Vx, readAppRevocationShape as Vy, readAppListing as W, decodeDnsAnswers as WS, setUpdateMessage as W_, EARLY_DIAL_JOIN_MS as Wa, deviceLinkPairing as Wb, appCloseFrame as Wc, RECORDING_TYPES as Wd, REACTION_LIMITS as Wf, NO_ATTEMPTS as Wg, compressSdp as Wh, isWalletNetwork as Wi, normalizeDomain as Wl, LinkSession as Wm, sshSignCommand as Wn, readGroupSignal as Wo, GROUP_MEMBER_CAP as Wp, DID_FILE_MAX_BYTES as Wr, typingActivity as Ws, asWritten as Wt, PROOF_CAPABILITY as Wu, knockSlotIdentity as Wv, BACKGROUND_REQUESTS_PER_MINUTE as Wx, signAppObject as Wy, groupTypingEpoch as X, identityFromSeed as XS, ENROLL_DONE as X_, LIVENESS_PING_MS as Xa, newDeviceSetSecret as Xb, isChatAppId as Xc, formatVoiceDuration as Xd, reactedFrame as Xf, handoffAttemptSucceeded as Xg, pickCallCandidates as Xh, isSparkAddress as Xi, validDomainRecord as Xl, PRESENCE_WINDOW as Xm, MessageRefusal as Xn, meshRendezvous as Xo, OWN_FRAME_LIMIT as Xp, DidError as Xr, PIN_CLOCK_SKEW_MS as Xs, GROUP_EDIT_TEXT_BYTES as Xt, isProofAdapter as Xu, mergeContactKnocks as Xv, DEFAULT_RELAYS as Xx, imageSize as Xy, GroupTypingBoard as Y, createIdentity as YS, ENROLL_CANCEL_REASONS as Y_, LIVENESS_MISSED_PINGS as Ya, devicePingFrame as Yb, isAppVersion as Yc, fileMessageText as Yd, queueReaction as Yf, handoffAttemptFailed as Yg, parseCallSignal as Yh, SPARK_PROVIDER as Yi, txtValue as Yl, PRESENCE_HEARTBEAT as Ym, BIP322_REVISION as Yn, meshHubs as Yo, MEMBER_KEY as Yp, DID_METHODS as Yr, PINNED_FRAME as Ys, GROUP_EDIT_FRAME as Yt, importedProof as Yu, makeStampPaced as Yv, CHAT_WATCH_SHARE as Yx, IMAGE_LIMITS as Yy, openGroupTyping as Z, identityFromSeedB64 as ZS, ENROLL_GRANT as Z_, MAX_PAIRED_MESSAGE_FRAME as Za, signDeviceTransports as Zb, parseAppFrame as Zc, isPlayableAudioType as Zd, reactionEmoji as Zf, handoffBusyFrame as Zg, sdpHasCandidates as Zh, sparkAddressKind as Zi, wellKnownUrl as Zl, RELAY_POLL_INTERVALS as Zm, bip322MessageHash as Zn, parseHubPolicy as Zo, SAID_AGAIN as Zp, checkDidJws as Zr, PIN_FRAME as Zs, carryMentions as Zt, nostrProofTemplate as Zu, openRequest as Zv, DEPARTED_READS as Zx, isImageMime as Zy, X401_PROTOCOLS as _, concatBytes as _C, WRITE_FIRST_MS as _S, handoffVerifiedMessage as __, fetchLnurlJson as _a, DEVICE_INVITE_VERSION as _b, deviceWakeRequest as _c, checkedDescriptors as _d, EDIT_SEND_LIMIT as _f, servicesToWire as _g, CHUNK_FLAG_END as _h, DID_DHT_TTL as _i, PAIRED_PROFILE as _l, newEpochSecret as _m, groupMetaBody as _n, engineError as _o, PR_STATES as _p, ATPROTO_DECLARED_SCOPE as _r, validHead as _s, verifyCommunityChain as _t, IDENTITY_MAX_EVIDENCE as _u, REOPEN_BELOW as _v, TURN_REV_LIMIT as _x, checkAppManifest as _y, X401_DCQL_LIMITS as a, tryDecrypt as aC, HEDGE_MS as aS, handoffFileMissingFrame as a_, isPubkyProofFolder as aa, CONTACT_LINK_VERSION as ab, pinNumberHolds as ac, verifyNostrProof as ad, PLAYABLE_VIDEO as af, isEmptyLinkPacket as ag, unusedInviteWait as ah, didWebFileUrl as ai, KNOWN_SESSION_CAPABILITIES as al, signCommit as am, mentionsBytes as an, REDESCRIBED_GRACE_MS as ao, REPLY_ID as ap, decodeAnyBitcoinAddress as ar, hubRank as as, communityHasFrame as at, CapsRefusedError as au, enrollHelloFrame as av, TURN_VISIBLE_MS as ax, APP_BUNDLE_MAGIC as ay, buildX401ProofRequest as b, fromZ32 as bC, readRelayBody as bS, newHandoffId as b_, parseInvoiceCallback as ba, INVITE_MAX_LENGTH as bb, readWake as bc, rankTransports as bd, dhtEditId as bf, HANDOFF_ATTEMPTS as bg, MAX_CHUNK_PAYLOAD_BYTES as bh, decodeDidDhtPacket as bi, SESSION_RECEIVE_PENDING as bl, sealPair as bm, groupMetaPicture as bn, PairingTracker as bo, STATUS_CARD_LIMITS as bp, ATPROTO_PROOF_SCOPE as br, PairedCalls as bs, KNOCK_TTL_MS as bt, IDENTITY_MAX_VALIDITY as bu, inboxRecord as bv, TURN_SLOTS as bx, isAppPath as by, readX401DcqlQuery as c, jpegSize$1 as cC, REQUESTS_PER_MINUTE as cS, handoffHelloFrame as c_, pubkyProofCapability as ca, readContactLink as cb, DEVICE_WAKE_TTL_SECONDS as cc, ringAuthorization as cd, isPlayableVideoType as cf, LEGACY_SERVICES as cg, HttpHost as ch, parseDid as ci, SERVICES_CAPABILITY as cl, verifyCommit as cm, wireMentions as cn, SWITCH_RETIRE_MS as co, pairedReplyAuthor as cp, decodeWitness as cr, mergeBeacon as cs, communityUntaggedHash as ct, dialDescriptors as cu, formatEnrollDigits as cv, turnPutSummary as cx, APP_FORBIDDEN_KEYS as cy, newX401HolderKey as d, hasVisible as dC, SIGNALING_WINDOW_MS as dS, handoffPakeFrame as d_, decodeSvcbRecords as da, DEVICE_INVITE_OWN_DEVICE as db, WAKE_CALL_WAIT_MS as dc, validRingKey as dd, EDITED_FRAME as df, decodeServices as dg, relativizeLocation as dh, parseDidSignaturePaste as di, SessionCapabilities as dl, confirmationMatches as dm, MAX_GROUP_META_BODY as dn, pairedMessageFits as do, wireReply as dp, hash160 as dr, pickHubs as ds, encodeCommunityLink as dt, parsePacketTransports as du, verifyEnrollProof as dv, TURN_BODY_BYTES as dx, APP_SCREENSHOTS_DIR as dy, verify as eC, GROUP_BURST_ONE_LINK as eS, handoffContextProof as e_, BITCOIN_NETWORKS as ea, readImageMeta as eb, nextPinNumber as ec, proofStatement as ed, voiceDownloadName as ef, LABEL$1 as eg, UNUSED_INVITE_READS_PER_MINUTE as eh, didJwsAlg as ei, BUTTONS_CAPABILITY as el, expectedRoster as em, meshMessageRef as en, PAIRING_RETRY_MS as eo, readDhtReactions as ep, decodeBase64 as er, COMMUNITY_TOPOLOGY as es, COMMUNITY_PROFILE as et, CAPS_LIMITS as eu, enrollCancelFrame as ev, seedSigner as ex, requestPlaintextBytes as ey, readX401SdJwtVc as f, sanitizeDisplayText as fC, SLOW_DEMOTE_MS as fS, handoffReleaseFrame as f_, encodeSvcbPacket as fa, createDeviceInvite as fb, WAKE_FRAME as fc, verifyRingAuthorization as fd, EDIT_BUFFER_MAX as ff, encodeServices as fg, resolveTargetUrl as fh, signingKeys as fi, TYPING_CAPABILITY as fl, confirmationTag as fm, MAX_GROUP_NAME_BYTES as fn, pairedMessageFrame as fo, ACTIVE_TASK_STATUSES as fp, sha256d as fr, rankHubs as fs, leaveStatement as ft, IDENTITY_CHALLENGE_WINDOW as fu, FLOOD_PER_DAY as fv, TURN_LABEL as fx, APP_VIEWS as fy, X401_LIMITS as g, bytesEqual as gC, WAY_BACK_SHARE as gS, handoffVerifiedFrame as g_, LNURL_LIMITS as ga, readDeviceInvite as gb, WakeLimiter as gc, automaticTransport as gd, EDIT_RECEIVE_LIMIT as gf, servicesFromWire as gg, webLocalFetch as gh, DID_DHT_PREFIX as gi, sessionCapabilitiesFrame as gl, epochKeys as gm, groupDisplayName as gn, EngineError as go, PR_CHECKS as gp, varBytes as gr, shouldBeHub as gs, signCommunity as gt, IDENTITY_FRAME_WINDOW_MS as gu, NEW_PER_HOUR as gv, TURN_NO_ACTIVE as gx, buildAppBundle as gy, X401_HEADERS as h, trimEndOf as hC, WATCH_SHARE as hS, handoffStreamKey as h_, LIGHTNING_DESTINATION_PATTERN as ha, encodeDeviceInvite as hb, WAKE_TTL_SECONDS as hc, TRANSPORTS as hd, EDIT_RATE_WINDOW_MS as hf, serviceIdFromName as hg, viewerResponseHeaders as hh, DID_DHT_MAX_PAYLOAD as hi, parseSessionCapabilities as hl, encryptText as hm, encodeGroupMetaBody as hn, ENGINE_ERRORS as ho, ITEM_STATES as hp, u64 as hr, readLobby as hs, shortHash as ht, IDENTITY_FRAME_LIMIT as hu, MAX_WAITING as hv, TURN_NAME_BYTES as hx, assembleAppBundle as hy, x401ApprovalDigest as i, sealedLength as iC, HEDGE_MISSING_MS as iS, handoffEphemeral as i_, isPubkyKey as ia, CONTACT_LINK_BYTES as ib, pinIsNewer as ic, validExternalKey as id, voicePeaksOf as if, emptyLinkRecords as ig, presenceSeenAt as ih, didWebFileNames as ii, FILES_CAPABILITY as il, rosterHas as im, MENTION_LIMITS as in, RACE_RELAYED_MS as io, PAIRED_REPLY_AUTHORS as ip, compactSize as ir, freshHubs as is, communityGroupId as it, CapsKeys as iu, enrollGrantFrame as iv, TURN_SETTLE_MS as ix, APP_BUNDLE_LIMITS as iy, readX401ProofResult as j, __require as jC, isDiscoveryBudgetError as jS, readHandoffPake as j_, findEndpoint as ja, inviteQrText as jb, generateVapidKeys as jc, emptyDhtDeliveryState as jd, linksIn as jf, HANDOFF_LATER_BYTES as jg, RTC_SIGNAL_MAX_AGE_MS as jh, ETHEREUM_USDT as ji, DOMAIN_FILE_MAX_BYTES as jl, STALLED_EVIDENCE_MS as jm, signGroupMeta as jn, readGroupWant as jo, sameButtonText as jp, atprotoCidFor as jr, TYPING_FRAME as js, GROUP_WAKE_GROUP_LIMIT as jt, identityRevocationValue as ju, MAX_SEEN as jv, signTurnBody as jx, appRef as jy, readX401ProofResponse as k, __esmMin as kC, budgetRetryMs as kS, readHandoffHello as k_, cashuRequestPayload as ka, inviteOwnership as kb, decryptPushPayload as kc, DhtDelivery as kd, canonicalUrl as kf, HANDOFF_HAVE as kg, DATA_CHANNEL_LABEL as kh, resolveDidDht as ki, DNS_LABEL as kl, OFFER_HOST_GATHER_MS as km, parseGroupMetaStatement as kn, readGroupFileMeta as ko, checkStatusCard as kp, AtprotoCid as kr, transferEnded as ks, readKnocks as kt, emptyIdentityLedger as ku, KNOCK_SLOT_LABEL as kv, readTurnPacket as kx, APP_STATEMENT_LIMITS as ky, x401VpToken as l, sanitizeAvatar as lC, RelayTransport as lS, handoffManifestFrames as l_, pubkyProofFile as la, DEVICE_INVITE_BYTES as lb, WAKE_CALL_INTERVAL_MS as lc, ringClaims as ld, isVideoMime as lf, MAX_SERVICES as lg, formatLocalTarget as lh, parseDidDocument as li, SESSION_CAPABILITIES_FRAME as ll, verifyCommitSignature as lm, GROUP_META_PAST as ln, UNPROVEN_AUTH_MS as lo, readReply as lp, encodeTx as lr, mergeLobby as ls, decodeCommunityLink as lt, emptyCapsState as lu, readEnrollGrant as lv, TOMBSTONE_SEQUENCE as lx, APP_ICON_PATH as ly, x401HolderJwk as m, stripHidden as mC, TURN_SOURCE_TIMEOUT_MS as mS, handoffRetryAfter as m_, pubkyHomeserverOf as ma, deviceInviteJoinerParams as mb, WAKE_SUBJECT as mc, RELAY_URL as md, EDIT_FRAME as mf, isViewerTag as mg, sanitizeResponseHeaders as mh, strictBase64Url as mi, WAKE_SESSION_CAPABILITY as ml, edgeParams as mm, MAX_GROUP_PICTURE_LENGTH as mn, publishFailure as mo, BUTTON_STYLES as mp, u32$1 as mr, readBeaconHead as ms, rosterHash as mt, IDENTITY_CLOCK_SKEW as mu, MAX_MISSED as mv, TURN_MAX as mx, appViewOf as my, X401_RESPONSE_MODES as n, encrypt as nC, GROUP_RATION_WINDOW_MS as nS, handoffDigest as n_, PUBKY_PROOF_MAX_BYTES as na, canonicalJsonBytes as nb, parsePinnedFrame as nc, storageProofBody as nd, voiceLevel as nf, RECORD_TTL as ng, WATCH_PEER_MS as nh, didWebDocumentUrl as ni, EDIT_CAPABILITY as nl, rememberAlone as nm, validEditText as nn, RACE_ANSWERED_MS as no, validReactionNumber as np, BitcoinAddressError as nr, beaconRecords as ns, GROUP_READ_NOTE_COMMUNITY as nt, CAPS_REFRESH_MS as nu, enrollDigits as nv, TURN_PUT_WINDOW_MS as nx, seenEntry as ny, matchX401Dcql as o, MAX_AVATAR_LENGTH as oC, PREVIOUS_DEFAULT_RELAYS as oS, handoffFileRequestFrame as o_, newPubkyProofFolder as oa, createContactLink as ob, pinnedFrame as oc, verifyPeerProof as od, VIDEO_LIMITS as of, parseLinkRecords as og, GhostlyHttpError as oh, didWebHost as oi, PIN_CAPABILITY as ol, sortRoster as om, mentionsMember as on, RESUME_WAIT_MS as oo, REPLY_LIMITS as op, decodeBitcoinAddress as or, lobbyKeys as os, communityMessageId as ot, DHT_TEXT_CAPABILITY as ou, enrollMessage as ov, classifyTurnRead as ox, APP_CLIENTS as oy, sameX401HolderJwk as p, sanitizeNick as pC, SLOW_MS as pS, handoffRequestFrame as p_, homeserverWebEndpoint as pa, deviceInviteJoinerKeyZ32 as pb, WAKE_INTERVAL_MS as pc, verifyRingEvidence as pd, EDIT_BUFFER_MS as pf, isValidServiceId as pg, sanitizeRequestHeaders as ph, staticDidDocument as pi, UPGRADE_CAPABILITY as pl, decryptText as pm, MAX_GROUP_NAME_LENGTH as pn, parsePaymentNetworks as po, BUTTON_ID as pp, txHash as pr, readBeacon as ps, leftStatement as pt, IDENTITY_CHECK_UNAVAILABLE as pu, MAX_DONE as pv, TURN_LAST_SEQUENCE as px, appDigest as py, signAppStore as q, readDnsName as qS, DEVICE_KINDS as q_, INVITER_DIAL_GRACE_MS as qa, deviceLinkSealKey as qb, appOpenFrame as qc, baseMime as qd, parseReactedFrame as qf, handoffAckFrame as qg, heardCallSignal as qh, walletNetworkOf as qi, recordsFromWellKnown as ql, OFFER_LOOK_MS as qm, legacyMessageHash as qn, NO_HUB_POLICY as qo, MAX_GROUP_CHAIN as qp, DID_JWS_MAX_LENGTH as qr, COMMUNITY_PIN_FRAME as qs, groupMessageId as qt, STORAGE_ROOT as qu, linkRecords as qv, CHAT_RESERVE_MOST_SHARE as qx, verifyAppSignature as qy, readX401OpenId4VpRequest as r, generateEncryptionKey as rC, GROUP_SIGNALING_ALLOWANCE_SHARE as rS, handoffDoneFrame as r_, PUBKY_PROOF_ROOT as ra, readCanonicalJson as rb, pinFrame as rc, storageProofPath as rd, voiceLevelsOf as rf, buildLinkRecords as rg, countUnusedInvite as rh, didWebFile as ri, FILES_BINARY_CAPABILITY as rl, rosterAdmin as rm, MENTION_EVERYONE as rn, RACE_DIRECT_MS as ro, wireReaction as rp, ByteReader as rr, doorHubs as rs, communityCommitHash as rt, CapsExchange as ru, enrollDoneFrame as rv, TURN_RAISE_READ_TIMEOUT_MS as rx, stampHolds as ry, presentX401SdJwtVc as s, MAX_AVATAR_SIDE as sC, RELAY_REQUESTS_PER_MINUTE as sS, handoffHaveFrames as s_, normalizePubkyKey as sa, encodeContactLink as sb, readPin as sc, RING_LIFETIME as sd, formatVideoDuration as sf, HTTP_SERVICE_PROTO as sg, HttpClient as sh, normalizeDid as si, REACTIONS_CAPABILITY as sl, verifyChain as sm, validMentions as sn, RTC_UNSTARTED_MS as so, groupReplyAuthor as sp, decodeTx as sr, lobbyRecords as ss, communityRoster as st, capsDescriptors as su, enrollProofFrame as sv, keptAtEqualSequence as sx, APP_CLIENT_NAME as sy, X401_REQUEST_LIMITS as t, decrypt as tC, GROUP_OVER_PACE_MS as tS, handoffDataFrame as t_, isBitcoinAddress as ta, canonicalJson as tb, parsePinFrame as tc, storageProof as td, voiceFileName as tf, MAX_MSGS_PAYLOAD_B64 as tg, UNUSED_INVITE_WAIT_MAX_MS as th, didSignedMessages as ti, CALLS_CAPABILITY as tl, parseGroupCommit as tm, parseCommunityEdit as tn, PONG_WAIT_MS as to, readReaction as tp, verifyBip322 as tr, beaconKeys as ts, CommunitySession as tt, CAPS_PUBLISH_SPACING_MS as tu, enrollCancelReason as tv, webCryptoSigner as tx, requestRecords as ty, X401_CREDENTIAL_LIMITS as u, MAX_NICK_LENGTH as uC, SIGNALING_ALLOWANCE_SHARE as uS, handoffOfferFrame as u_, pubkyProofPath as ua, DEVICE_INVITE_LIFETIME_S as ub, WAKE_CALL_TTL_SECONDS as uc, ringEvidence as ud, parseVideoMeta as uf, SERVICES_VERSION as ug, parseLocalTarget as uh, parseDidJws as ui, STATUS_CARD_CAPABILITY as ul, GROUP_PROFILE as um, GROUP_META_PAST_CHARS as un, WAKE_LOST_MS as uo, replySnippet as up, encodeWitness as ur, newerHead as us, derivedSecret as ut, encodePacketTransports as uu, readEnrollHello as uv, TOMBSTONE_TURN as ux, APP_PERMISSIONS as uy, X401_SCHEME as v, fromBase64 as vC, currentRelays as vS, handoffVersions as v_, findLightningDestination as va, INVITE_HRP as vb, newWakeToken as vc, irohDescriptor as vd, MAX_EDITS_PER_MESSAGE as vf, viewerTag as vg, CHUNK_KIND as vh, DID_DHT_VERSION as vi, PairedSession as vl, openPair as vm, groupMetaChange as vn, engineText as vo, ROUTINE_STATES as vp, ATPROTO_FULL_SCOPE as vr, MAX_PAIRED_CALL_SIGNAL as vs, verifyCommunityCommit as vt, IDENTITY_MAX_FRAME as vu, clearMissed as vv, TURN_SEALED_BYTES as vx, findAppForbiddenKey as vy, decodeX401Header as w, toBase64Url as wC, BREAKER_BASE_MS as wS, readHandoffCancel as w_, resolveLightningDestination as wa, createLink as wb, wakePayload as wc, DHT_FILE_REFUSED as wd, parseEditedFrame as wf, HANDOFF_CANCEL_REASONS as wg, encodeChunk as wh, didDhtRecords as wi, HoldKeys as wl, CONNECT_TIMEOUT_MS as wm, keepPastGroupMeta as wn, GROUP_WANT_FRAME as wo, cardEditNumber as wp, checkAtprotoProofRecord as wr, FILE_FRAMES as ws, entryParams as wt, IDENTITY_STATEMENT_PREFIX as wu, takeRequest as wv, encodeTurnFields as wx, readAppBundleAsync as wy, buildX401ProofResult as x, isZ32Key as xC, setLinkTraceSink as xS, openHandoffPiece as x_, parseLightningDestination as xa, INVITE_VERSION as xb, readWakePayload as xc, relayedTransports as xd, editFrame as xf, HANDOFF_BUSY as xg, PROTOCOL_VERSION as xh, didDhtDocument as xi, HOLD_CAPABILITY as xl, sealSecret as xm, groupMetaTag as xn, GROUP_FILE_LIMITS as xo, TASK_STATUSES as xp, atprotoDidMethod as xr, parsePairedCallFrame as xs, MAX_KNOCKS as xt, IDENTITY_PROOF_CAPABILITY as xu, newInbox as xv, TURN_TTL as xx, isAppUrl as xy, X401_VERSION as y, fromBase64Url as yC, normalizeRelayUrl as yS, isHandoffPartName as y_, invoiceCallbackUrl as ya, INVITE_LINK_ORIGIN as yb, parseWakeFrame as yc, irohRelayUrl as yd, RateWindow as yf, HANDOFF_ACK as yg, LIMITS as yh, DidDhtError as yi, SESSION_FRAME_MAX as yl, openSecret as ym, groupMetaNewer as yn, parseEngineError as yo, RUN_RESULTS as yp, ATPROTO_PROOF_COLLECTION as yr, PAIRED_CALL_FRAME as ys, GROUP_ENTRY_PROFILE as yt, IDENTITY_MAX_RECEIVED as yu, endedRequests as yv, TURN_SIGNED_BYTES as yx, isAppLicense as yy, planAppUpdate as z, newerPacket as zS, SET_UPDATE as z_, CROSSED_PROBE_MS as za, HANDOFF_CAPABILITY as zb, APP_RATE_WINDOW_MS as zc, formatFileSize as zd, COMMUNITY_REACTION_FRAME as zf, HANDOFF_REQUEST as zg, RTC_CONFIG as zh, WALLET_NETWORKS as zi, domainTxtRecord as zl, DEPARTED_READ_MS as zm, parseSshPublicKey as zn, SIGNAL_FRESH_MS as zo, heardTime as zp, readAtprotoCid as zr, TypingReceiver as zs, parseGroupWakeFrame as zt, verifyIdentityPresentation as zu, STAMP_BITS_DEFAULT as zv, turnReleaseMessage as zx, isAppSignature as zy };
35189
+ export { COMMUNITY_LIMITS as $, toZ32 as $C, BREAKER_MAX_MS as $S, readHandoffDone as $_, MAX_PAIRED_MESSAGE_FRAME as $a, encodeGhostlyInvite as $b, APP_DATA_MAX_BYTES as $c, dhtFileElements as $d, linksIn as $f, HANDOFF_DONE as $g, DATA_CHANNEL_ID as $h, sparkAddressKind as $i, DOMAIN_TXT_MAX_BYTES as $l, GATHER_STALL_MS as $m, bip322MessageHash as $n, parseHubPolicy as $o, checkStatusCard as $p, checkDidJws as $r, PIN_FRAME as $s, carryMentions as $t, isIdentityBinding as $u, CONTACT_RECORD_TTL as $v, nextTurnPosition as $x, yieldThread as $y, readX401ProofResponseHeader as A, encrypt as AC, GROUP_SIGNALING_ALLOWANCE_SHARE as AS, handoffDoneFrame as A_, ENDPOINT as Aa, readCanonicalJson as Ab, checkPushEndpoint as Ac, validRingKey as Ad, EDITED_FRAME as Af, buildLinkRecords as Ag, unusedInviteWait as Ah, openDidDhtPayload as Ai, SessionCapabilities as Al, signCommit as Am, parseGroupMetaFrame as An, isGroupMessageId as Ao, pairedReplyAuthor as Ap, shortAtprotoDid as Ar, refusalText as As, mergeKnocks as At, parsePacketTransports as Au, enrollDoneFrame as Av, TURN_RAISE_READ_TIMEOUT_MS as Ax, stampHolds as Ay, APP_STORE_KINDS as B, sanitizeDisplayText as BC, SLOW_DEMOTE_MS as BS, handoffRequestFrame as B_, CROSSED_FRESH_MS as Ba, deviceInviteJoinerKeyZ32 as Bb, APP_RANGE_LIMITS as Bc, relayedTransports as Bd, RateWindow as Bf, isValidServiceId as Bg, viewerResponseHeaders as Bh, USDT_PUBLIC_RPC as Bi, HOLD_CAPABILITY as Bl, encryptText as Bm, SshSigError as Bn, SIGNAL_CARRIERS as Bo, PR_STATES as Bp, parseAtprotoVerificationKey as Br, TYPING_TIMEOUT_MS as Bs, mentionedMembers as Bt, IDENTITY_PROOF_CAPABILITY as Bu, MAX_DONE as Bv, TURN_LAST_SEQUENCE as Bx, appDigest as By, buildX401TokenObject as C, createIdentity as CC, DEFAULT_RELAYS as CS, handoffAttemptSucceeded as C_, parseLightningDestination as Ca, imageSize as Cb, readWakePayload as Cc, validExternalKey as Cd, voicePeaksOf as Cf, pickCallCandidates as Cg, STALLED_LOOK_MS as Ch, didDhtDocument as Ci, FILES_CAPABILITY as Cl, commitHash as Cm, groupMetaTag as Cn, GROUP_FILE_LIMITS as Co, readReaction as Cp, atprotoDidMethod as Cr, parsePairedCallFrame as Cs, MAX_KNOCKS as Ct, CapsKeys as Cu, ENROLL_DONE as Cv, newDeviceSetSecret as Cx, mergeContactKnocks as Cy, readX401ProofRequest as D, sign as DC, GROUP_BURST_ONE_LINK as DS, handoffContextProof as D_, BOLT11_PATTERN as Da, readImageMeta as Db, wakeRequest as Dc, ringAuthorization as Dd, isPlayableVideoType as Df, LABEL$1 as Dg, WATCH_PEER_MS as Dh, encodeDidDhtDeactivated as Di, SERVICES_CAPABILITY as Dl, rememberAlone as Dm, nextGroupMetaRevision as Dn, GROUP_WANT_NO_FRAME as Do, REPLY_ID as Dp, isAtprotoDid as Dr, FILE_LIMITS as Ds, groupEntryUrl as Dt, dialDescriptors as Du, enrollCancelFrame as Dv, seedSigner as Dx, requestPlaintextBytes as Dy, isX401Protocol as E, publicKeyFromZ32 as EC, GROUP_BURST_MS as ES, handoffContext as E_, resolveLightningDestination as Ea, previewable as Eb, wakePayload as Ec, RING_LIFETIME as Ed, formatVideoDuration as Ef, waitForIceGathering as Eg, UNUSED_INVITE_WAIT_MAX_MS as Eh, didDhtRecords as Ei, REACTIONS_CAPABILITY as El, parseGroupCommit as Em, keepPastGroupMeta as En, GROUP_WANT_FRAME as Eo, PAIRED_REPLY_AUTHORS as Ep, checkAtprotoProofRecord as Er, FILE_FRAMES as Es, entryParams as Et, capsDescriptors as Eu, ENROLL_PROOF as Ev, verifyDeviceTransports as Ex, readLinkRecord as Ey, appRevocationFor as F, MAX_AVATAR_SIDE as FC, REQUESTS_PER_MINUTE as FS, handoffHelloFrame as F_, parseCashuRequestPayload as Fa, readContactLink as Fb, vapidAuthorization as Fc, automaticTransport as Fd, EDIT_RECEIVE_LIMIT as Ff, LEGACY_SERVICES as Fg, parseLocalTarget as Fh, ONCHAIN_PROVIDER as Fi, sessionCapabilitiesFrame as Fl, GROUP_PROFILE as Fm, wrapGroupMeta as Fn, CARRIED_DEFER_MS as Fo, BUTTON_ID as Fp, decodeDagCbor as Fr, TYPING_RATE_LIMIT as Fs, GROUP_WAKE_MEMBER_INTERVAL_MS as Ft, IDENTITY_FRAME_WINDOW_MS as Fu, formatEnrollDigits as Fv, turnPutSummary as Fx, APP_FORBIDDEN_KEYS as Fy, readAppStore as G, concatBytes as GC, WRITE_FIRST_MS as GS, handoffVersions as G_, DHT_PIN_GRACE_MS as Ga, INVITE_HRP as Gb, appRangeEndFrame as Gc, DHT_MESSAGE_TTL as Gd, parseEditedFrame as Gf, viewerTag as Gg, MAX_CHUNK_PAYLOAD_BYTES as Gh, formatPaymentAmount as Gi, isHoldUrl as Gl, sealPair as Gm, sshKeyDigestHex as Gn, groupSignalFrame as Go, TASK_STATUSES as Gp, DID_DOCUMENT_MAX_BYTES as Gr, sanitizeTypingStatus as Gs, GroupSession as Gt, IdentityCheckUnavailable as Gu, clearMissed as Gv, TURN_SEALED_BYTES as Gx, findAppForbiddenKey as Gy, checkAppListing as H, stripHidden as HC, TURN_SOURCE_TIMEOUT_MS as HS, handoffStreamKey as H_, CROSSED_WAIT_MS as Ha, encodeDeviceInvite as Hb, appRangeCancelFrame as Hc, ACTIVE_DHT_POLL_MS as Hd, editFrame as Hf, serviceIdFromName as Hg, CHUNK_FLAG_END as Hh, arkAddressPrefix as Hi, HOLD_LIMITS as Hl, newEpochSecret as Hm, parseSshSignature as Hn, SIGNAL_HOLD_MS as Ho, ROUTINE_STATES as Hp, unsignedCommitBytes as Hr, TypingSender as Hs, GROUP_LIMITS as Ht, IDENTITY_REVOCATION_LABEL as Hu, MAX_WAITING as Hv, TURN_NAME_BYTES as Hx, assembleAppBundle as Hy, appStoreDecision as I, jpegSize$1 as IC, RelayTransport as IS, handoffManifestFrames as I_, parseFedimintRequestPayload as Ia, DEVICE_INVITE_BYTES as Ib, vapidKeysMatch as Ic, checkedDescriptors as Id, EDIT_SEND_LIMIT as If, MAX_SERVICES as Ig, relativizeLocation as Ih, PaymentPreflightError as Ii, PAIRED_PROFILE as Il, confirmationMatches as Im, SSHSIG_MAX_ARMOR as In, CarriedTransport as Io, BUTTON_STYLES as Ip, encodeDagCbor as Ir, TYPING_RATE_WINDOW_MS as Is, GROUP_WAKE_RECEIVE_LIMIT as It, IDENTITY_MAX_EVIDENCE as Iu, readEnrollGrant as Iv, TOMBSTONE_SEQUENCE as Ix, APP_ICON_PATH as Iy, GROUP_TYPING_FRAME as J, fromZ32 as JC, readRelayBody as JS, openHandoffPiece as J_, HANDLED_WAIT_MS as Ja, INVITE_VERSION as Jb, decodeAppRangeData as Jc, DhtDelivery as Jd, validRemovalNumber as Jf, HANDOFF_BUSY as Jg, decodeControl as Jh, validatePaymentTarget as Ji, DNS_LABEL as Jl, ANSWER_REFUSED_REDIALS as Jm, isLegacySignature as Jn, MESH_HUBS as Jo, cardEditNumber as Jp, DID_JWS_ALGS as Jr, typingKindOf as Js, frameBytes as Jt, emptyIdentityLedger as Ju, newInbox as Jv, TURN_TTL as Jx, isAppUrl as Jy, readAppStoreSteps as K, fromBase64 as KC, currentRelays as KS, isHandoffPartName as K_, EARLY_DIAL_JOIN_MS as Ka, INVITE_LINK_ORIGIN as Kb, appRangeErrorFrame as Kc, DHT_TEXT_BYTES as Kd, validEditMessage as Kf, HANDOFF_ACK as Kg, PROTOCOL_VERSION as Kh, isWalletNetwork as Ki, newMailbox as Kl, sealSecret as Km, sshSignCommand as Kn, readGroupSignal as Ko, appCardId as Kp, DID_FILE_MAX_BYTES as Kr, typingActivity as Ks, asWritten as Kt, IdentityExchange as Ku, endedRequests as Kv, TURN_SIGNED_BYTES as Kx, isAppLicense as Ky, appUpdateDecision as L, sanitizeAvatar as LC, RelaysFailedError as LS, handoffOfferFrame as L_, ANSWERS_REFUSED_PAUSES as La, DEVICE_INVITE_LIFETIME_S as Lb, APP_RANGE_DATA_KIND as Lc, irohDescriptor as Ld, MAX_EDITS_PER_MESSAGE as Lf, SERVICES_VERSION as Lg, resolveTargetUrl as Lh, SEPOLIA_TEST_USDT as Li, PairedSession as Ll, confirmationTag as Lm, SSHSIG_NAMESPACE as Ln, GROUP_SIGNAL_FRAME as Lo, CRON_LINE as Lp, findInMst as Lr, TYPING_REFRESH_MS as Ls, GroupWakeLimiter as Lt, IDENTITY_MAX_FRAME as Lu, readEnrollHello as Lv, TOMBSTONE_TURN as Lx, APP_PERMISSIONS as Ly, readX401ProofResultHeader as M, sealedLength as MC, HEDGE_MS as MS, handoffFileMissingFrame as M_, fedimintRequestPayload as Ma, CONTACT_LINK_VERSION as Mb, encryptPushPayload as Mc, verifyRingEvidence as Md, EDIT_BUFFER_MS as Mf, isEmptyLinkPacket as Mg, HttpClient as Mh, signDidDhtPacket as Mi, UPGRADE_CAPABILITY as Ml, verifyChain as Mm, parseGroupMetaTag as Mn, readGroupHave as Mo, replySnippet as Mp, AtprotoProofError as Mr, transferStalled as Ms, GROUP_WAKE_FRAME as Mt, IDENTITY_CHECK_UNAVAILABLE as Mu, enrollHelloFrame as Mv, TURN_VISIBLE_MS as Mx, APP_BUNDLE_MAGIC as My, x401AnswerableRequests as N, tryDecrypt as NC, PREVIOUS_DEFAULT_RELAYS as NS, handoffFileRequestFrame as N_, findEndpoint as Na, createContactLink as Nb, generateVapidKeys as Nc, RELAY_URL as Nd, EDIT_FRAME as Nf, parseLinkRecords as Ng, HttpHost as Nh, ETHEREUM_USDT as Ni, WAKE_SESSION_CAPABILITY as Nl, verifyCommit as Nm, signGroupMeta as Nn, readGroupWant as No, wireReply as Np, atprotoCidFor as Nr, TYPING_FRAME as Ns, GROUP_WAKE_GROUP_LIMIT as Nt, IDENTITY_CLOCK_SKEW as Nu, enrollMessage as Nv, classifyTurnRead as Nx, APP_CLIENTS as Ny, readX401ProofRequestHeader as O, verify as OC, GROUP_OVER_PACE_MS as OS, handoffDataFrame as O_, decodeBolt11 as Oa, canonicalJson as Ob, PUSH_SERVICE_HOSTS as Oc, ringClaims as Od, isVideoMime as Of, MAX_MSGS_PAYLOAD_B64 as Og, countUnusedInvite as Oh, encodeDidDhtPacket as Oi, SESSION_CAPABILITIES_FRAME as Ol, rosterAdmin as Om, openGroupMeta as On, fetchesByItself as Oo, REPLY_LIMITS as Op, normalizeAtprotoHandle as Or, decodeFileData as Os, knockIdentity as Ot, emptyCapsState as Ou, enrollCancelReason as Ov, webCryptoSigner as Ox, requestRecords as Oy, addedAppPermissions as P, MAX_AVATAR_LENGTH as PC, RELAY_REQUESTS_PER_MINUTE as PS, handoffHaveFrames as P_, isFederationId as Pa, encodeContactLink as Pb, pushRequest as Pc, TRANSPORTS as Pd, EDIT_RATE_WINDOW_MS as Pf, HTTP_SERVICE_PROTO as Pg, formatLocalTarget as Ph, EVM_TEST_CHAINS as Pi, parseSessionCapabilities as Pl, verifyCommitSignature as Pm, verifyGroupMetaSignature as Pn, readGroupWantNo as Po, ACTIVE_TASK_STATUSES as Pp, decodeAtprotoCommit as Pr, TYPING_KINDS as Ps, GROUP_WAKE_GROUP_WINDOW_MS as Pt, IDENTITY_FRAME_LIMIT as Pu, enrollProofFrame as Pv, keptAtEqualSequence as Px, APP_CLIENT_NAME as Py, sealGroupTyping as Q, toBase64Url as QC, BREAKER_BASE_MS as QS, readHandoffData as Q_, LIVENESS_PING_MS as Qa, decodeInviteCode as Qb, readAppRangeFrame as Qc, DHT_FILE_CAPABILITY as Qd, linkEnd as Qf, HANDOFF_DATA as Qg, wrapDataChannel as Qh, isSparkAddress as Qi, DOMAIN_METHODS as Ql, GATHER_ATTEMPTS as Qm, MessageRefusal as Qn, meshRendezvous as Qo, cardUrl as Qp, DidError as Qr, PIN_CLOCK_SKEW_MS as Qs, GROUP_EDIT_TEXT_BYTES as Qt, identityStatementText as Qu, turnOff as Qv, firstDeviceSetSecret as Qx, sha256Paced as Qy, checkAppBeforeRun as R, MAX_NICK_LENGTH as RC, SIGNALING_ALLOWANCE_SHARE as RS, handoffPakeFrame as R_, ANSWERS_REFUSED_PAUSE_MS as Ra, DEVICE_INVITE_OWN_DEVICE as Rb, APP_RANGE_ERRORS as Rc, irohRelayUrl as Rd, MAX_REMOVAL_NUMBER as Rf, decodeServices as Rg, sanitizeRequestHeaders as Rh, SEPOLIA_TEST_USDT_FAUCET as Ri, SESSION_FRAME_MAX as Rl, decryptText as Rm, SSH_KEY_TYPES as Rn, GROUP_VERSION_SIGNALS as Ro, ITEM_STATES as Rp, parseAtprotoCar as Rr, TYPING_SEND_LIMIT as Rs, groupWakeFrame as Rt, IDENTITY_MAX_RECEIVED as Ru, verifyEnrollProof as Rv, TURN_BODY_BYTES as Rx, APP_SCREENSHOTS_DIR as Ry, buildX401ResultArtifact as S, IDENTITY_MEMO_SIZE as SC, CHAT_WATCH_SHARE as SS, handoffAttemptFailed as S_, parseInvoiceCallback as Sa, IMAGE_LIMITS as Sb, readWake as Sc, storageProofPath as Sd, voiceLevelsOf as Sf, parseCallSignal as Sg, RELAY_POLL_INTERVALS as Sh, decodeDidDhtPacket as Si, FILES_BINARY_CAPABILITY as Sl, SAID_AGAIN as Sm, groupMetaPicture as Sn, PairingTracker as So, readDhtReactions as Sp, ATPROTO_PROOF_SCOPE as Sr, PairedCalls as Ss, KNOCK_TTL_MS as St, CapsExchange as Su, ENROLL_CANCEL_REASONS as Sv, devicePingFrame as Sx, makeStampPaced as Sy, encodeX401Header as T, identityFromSeedB64 as TC, FRESH_READ_MS as TS, handoffCancelFrame as T_, requestLnurlInvoice as Ta, parseImageMeta as Tb, wakeFrame as Tc, verifyPeerProof as Td, VIDEO_LIMITS as Tf, signalHasVideo as Tg, UNUSED_INVITE_READS_PER_MINUTE as Th, didDhtKey as Ti, PIN_CAPABILITY as Tl, expectedRoster as Tm, groupName as Tn, GROUP_VERSION_FILES as To, wireReaction as Tp, atprotoProofRkey as Tr, FILE_DATA_KIND as Ts, encodeGroupEntryLink as Tt, DHT_TEXT_CAPABILITY as Tu, ENROLL_HELLO as Tv, unsignedDeviceTransports as Tx, readKnockSlot as Ty, checkAppStoreIndex as U, trimEndOf as UC, WATCH_SHARE as US, handoffVerifiedFrame as U_, DEMOTE_AFTER_FAILURES as Ua, readDeviceInvite as Ub, appRangeChunk as Uc, DHT_FILE_REFUSED as Ud, editedFrame as Uf, servicesFromWire as Ug, CHUNK_KIND as Uh, assertTokenUnits as Ui, HoldKeys as Ul, openPair as Um, sameSshKey as Un, SIGNAL_PROVEN_MS as Uo, RUN_RESULTS as Up, verifyAtprotoRecordProof as Ur, parseTypingActivity as Us, GROUP_REACTED_FRAME as Ut, IDENTITY_STATEMENT_PREFIX as Uu, NEW_PER_HOUR as Uv, TURN_NO_ACTIVE as Ux, buildAppBundle as Uy, APP_STORE_LIMITS as V, sanitizeNick as VC, SLOW_MS as VS, handoffRetryAfter as V_, CROSSED_PROBE_MS as Va, deviceInviteJoinerParams as Vb, AppRanges as Vc, transportOrder as Vd, dhtEditId as Vf, isViewerTag as Vg, webLocalFetch as Vh, WALLET_NETWORKS as Vi, HOLD_DATED_BACK_MS as Vl, epochKeys as Vm, parseSshPublicKey as Vn, SIGNAL_FRESH_MS as Vo, REMOVABLE_KINDS as Vp, readAtprotoCid as Vr, TypingReceiver as Vs, parseGroupWakeFrame as Vt, IDENTITY_PROVIDER_ID as Vu, MAX_MISSED as Vv, TURN_MAX as Vx, appViewOf as Vy, readAppListing as W, bytesEqual as WC, WAY_BACK_SHARE as WS, handoffVerifiedMessage as W_, DEMOTE_MS as Wa, DEVICE_INVITE_VERSION as Wb, appRangeDataFrame as Wc, DHT_FILE_TOO_LARGE as Wd, parseEditFrame as Wf, servicesToWire as Wg, LIMITS as Wh, assertWholeSats as Wi, HoldRefusedError as Wl, openSecret as Wm, sshFingerprint as Wn, SIGNAL_REPLY_MS as Wo, STATUS_CARD_LIMITS as Wp, verifyAtprotoSignature as Wr, parseTypingFrame as Ws, GROUP_READ_NOTE as Wt, IDENTITY_SUBJECT as Wu, REOPEN_BELOW as Wv, TURN_REV_LIMIT as Wx, checkAppManifest as Wy, groupTypingEpoch as X, randomBytes as XC, traceLink as XS, readHandoffBusy as X_, INVITE_TAKEN as Xa, createChatInvite as Xb, isServeId as Xc, emptyDhtDeliveryState as Xd, LINK_PREVIEW_LIMITS as Xf, HANDOFF_CANCEL as Xg, encodeControl as Xh, SPARK_NETWORKS as Xi, DOMAIN_FILE_MAX_BYTES as Xl, DATA_SETTLE_MS as Xm, verifyBitcoinMessage as Xn, mayBeHub as Xo, cardLinkHost as Xp, DID_MAX_LENGTH as Xr, GROUP_PIN_FRAME as Xs, COMMUNITY_EDIT_FRAME as Xt, identityRevocationValue as Xu, settleRequest as Xv, TurnRecordError as Xx, readAppBundle as Xy, GroupTypingBoard as Y, isZ32Key as YC, setLinkTraceSink as YS, readHandoffAck as Y_, INVITER_DIAL_GRACE_MS as Ya, OwnInviteError as Yb, encodeAppRangeData as Yc, LIVE_POLL_MS as Yd, LINK_MAX_CHARS as Yf, HANDOFF_BUSY_REASONS as Yg, encodeChunk as Yh, walletNetworkOf as Yi, DNS_TYPE as Yl, CONNECT_TIMEOUT_MS as Ym, legacyMessageHash as Yn, NO_HUB_POLICY as Yo, cardLine as Yp, DID_JWS_MAX_LENGTH as Yr, COMMUNITY_PIN_FRAME as Ys, groupMessageId as Yt, identityPresentationBytes as Yu, planKnocks as Yv, TURN_VERSION as Yx, pacer as Yy, openGroupTyping as Z, toBase64 as ZC, BREAKER_ALL_DOWN_PROBE_MS as ZS, readHandoffCancel as Z_, LIVENESS_MISSED_PINGS as Za, createLink as Zb, parseAppRangeFrame as Zc, peekDhtMailbox as Zd, canonicalUrl as Zf, HANDOFF_CANCEL_REASONS as Zg, sendBody as Zh, SPARK_PROVIDER as Zi, DOMAIN_MAX_RECORDS as Zl, DataLink as Zm, BIP322_REVISION as Zn, meshHubs as Zo, cardTimeUtc as Zp, DID_METHODS as Zr, PINNED_FRAME as Zs, GROUP_EDIT_FRAME as Zt, identityStatement as Zu, takeRequest as Zv, encodeTurnFields as Zx, readAppBundleAsync as Zy, X401_PROTOCOLS as _, signRelayPayload as _C, BACKGROUND_REQUESTS_PER_MINUTE as _S, NO_ATTEMPTS as __, LIGHTNING_DESTINATION_PATTERN as _a, signAppObject as _b, WAKE_TTL_SECONDS as _c, proofCapability as _d, parseVoiceMeta as _f, decompressSdp as _g, OFFER_FAST_MS as _h, DID_DHT_MAX_PAYLOAD as _i, APPS_CAPABILITY as _l, LEGACY_GROUP_MEMBERS as _m, encodeGroupMetaBody as _n, ENGINE_ERRORS as _o, queueReaction as _p, u64 as _r, readLobby as _s, shortHash as _t, CAPS_ISSUED_BACK_MS as _u, setUpdateMessage as _v, deviceLinkPairing as _x, knockSlotIdentity as _y, X401_DCQL_LIMITS as a, isDiscoveryBudgetError as aC, signTurnPacket as aS, HANDOFF_LIST_PER_FRAME as a_, PUBKY_PROOF_ROOT as aa, appRefPublisher as ab, pinFrame as ac, IDENTITY_TIMELINE_MAX as ad, safeBlobType as af, offerIsFresh as ag, DIRECT_PEERS as ah, didWebFile as ai, APP_SEND_LIMIT as al, taskProgress as am, MENTION_EVERYONE as an, RACE_DIRECT_MS as ao, forwardedMany as ap, ByteReader as ar, doorHubs as as, communityHasFrame as at, domainWellKnownFile as au, readHandoffRelease as av, __require as aw, ownInviteRefusal as ax, MAX_SLOT_KNOCKS as ay, buildX401ProofRequest as b, encodeTxtPacket as bC, CHAT_RESERVE_MOST_SHARE as bS, handoffAckFrame as b_, findLightningDestination as ba, verifyAppSignature as bb, newWakeToken as bc, storageProof as bd, voiceFileName as bf, isGlobalIpv4Host as bg, PRESENCE_HEARTBEAT as bh, DID_DHT_VERSION as bi, CALLS_CAPABILITY as bl, MEMBER_KEY as bm, groupMetaChange as bn, engineText as bo, reactionFrame as bp, ATPROTO_FULL_SCOPE as br, MAX_PAIRED_CALL_SIGNAL as bs, verifyCommunityCommit as bt, CAPS_PUBLISH_SPACING_MS as bu, DEVICE_KINDS as bv, deviceLinkSealKey as bx, linkRecords as by, readX401DcqlQuery as c, PKARR_FUTURE_SKEW_MS as cC, turnKeys as cS, HANDOFF_PAKE as c_, newPubkyProofFolder as ca, checkAppRevokeStatement as cb, pinnedFrame as cc, PROOF_ADAPTERS as cd, PLAYABLE_AUDIO as cf, CALL_SIGNAL_MAX_AGE_MS as cg, symmetricNat as ch, didWebHost as ci, appCloseFrame as cl, arrivalKey as cm, mentionsMember as cn, RESUME_WAIT_MS as co, GROUP_REACTION_FRAME as cp, decodeBitcoinAddress as cr, lobbyKeys as cs, communityUntaggedHash as ct, nip05RootKey as cu, sameDigest as cv, DEVICE_CAPABILITIES as cx, REQUEST_LIFETIME_MS as cy, newX401HolderKey as d, createRelayPayload as dC, turnPayloadSequence as dS, HANDOFF_RELEASE as d_, pubkyProofFile as da, isAppRef as db, WAKE_CALL_INTERVAL_MS as dc, STORAGE_LIFETIME as dd, VOICE_METER as df, answersOffer as dg, DHT_POLL_INTERVALS as dh, parseDidDocument as di, appOpenFrame as dl, receivedTimestamp as dm, GROUP_META_PAST as dn, UNPROVEN_AUTH_MS as do, REACTION_FRAME as dp, encodeTx as dr, mergeLobby as ds, encodeCommunityLink as dt, recordsFromTxt as du, SET_ACK as dv, ENROLL_CAPABILITY as dx, REQUEST_TEXT_BYTES as dy, BREAKER_THRESHOLD as eC, openTurnValue as eS, HANDOFF_FILE_MISSING as e_, sparkInvoiceDetails as ea, APP_NAME as eb, PIN_LIMITS as ec, newIdentityBinding as ed, dhtFileId as ef, DATA_CHANNEL_LABEL as eg, OFFER_HOST_GATHER_MS as eh, checkDidSignature as ei, APP_FRAME as el, readStatusCard as em, communityEditFrame as en, PAIRED_FRAME_TOO_LARGE as eo, parseLinkPreview as ep, bip322ToSign as er, pickMeshHubs as es, COMMUNITY_PROFILE as et, NIP05_PATH as eu, readHandoffFileFrame as ev, utf8Decode as ew, encodeInviteCode as ex, ContactRequestError as ey, readX401SdJwtVc as f, measureRecords as fC, turnReleaseMessage as fS, HANDOFF_REQUEST as f_, pubkyProofPath as fa, isAppSignature as fb, WAKE_CALL_TTL_SECONDS as fc, STORAGE_ROOT as fd, baseMime as ff, buildSdpFromSignal as fg, EXPECT_PEER_MS as fh, parseDidJws as fi, chatAppId as fl, shownTime as fm, GROUP_META_PAST_CHARS as fn, WAKE_LOST_MS as fo, REACTION_LIMITS as fp, encodeWitness as fr, newerHead as fs, leaveStands as ft, recordsFromWellKnown as fu, SET_UPDATE as fv, HANDOFF_CAPABILITY as fx, STAMP_BITS_DEFAULT as fy, X401_LIMITS as g, readOwnRelayPayload as gC, turnVerifierMark as gS, HANDOFF_WINDOW as g_, pubkyHomeserverOf as ga, readAppSignature as gb, WAKE_SUBJECT as gc, nostrProofTemplate as gd, isPlayableAudioType as gf, contactRtcConfig as gg, MAX_DHT_TEXT_BYTES as gh, strictBase64Url as gi, readAppFrame as gl, GROUP_VERSION_LARGE as gm, MAX_GROUP_PICTURE_LENGTH as gn, publishFailure as go, parseReactionFrame as gp, u32$1 as gr, readBeaconHead as gs, rosterHash as gt, wellKnownUrl as gu, setUpdateFrame as gv, deviceKeyZ32 as gx, knockHolds as gy, X401_HEADERS as h, parseRelayPayload as hC, turnStatedVerifier as hS, HANDOFF_VERSION as h_, homeserverWebEndpoint as ha, readAppRevocations as hb, WAKE_INTERVAL_MS as hc, isProofAdapter as hd, formatVoiceDuration as hf, compressSdp as hg, LinkSession as hh, staticDidDocument as hi, parseAppFrame as hl, GROUP_MEMBER_CAP as hm, MAX_GROUP_NAME_LENGTH as hn, parsePaymentNetworks as ho, parseReactedFrame as hp, txHash as hr, readBeacon as hs, leftStatement as ht, validDomainRecord as hu, setAckFrame as hv, deviceFrameCapability as hx, contactDay as hy, x401ApprovalDigest as i, heldBackError as iC, signTurnBody as iS, HANDOFF_LATER_BYTES as i_, PUBKY_PROOF_MAX_BYTES as ia, appRef as ib, parsePinnedFrame as ic, verifyIdentityPresentation as id, formatFileSize as if, extractRtcParams as ig, DIRECT_OWN_ATTEMPTS as ih, didWebDocumentUrl as ii, APP_RESUME_GRACE_MS as il, statusCardText as im, validEditText as in, RACE_ANSWERED_MS as io, forwardedAgain as ip, BitcoinAddressError as ir, beaconRecords as is, communityGroupId as it, domainTxtRecord as iu, readHandoffPake as iv, __exportAll as iw, inviteQrText as ix, MAX_SEEN as iy, readX401ProofResult as j, generateEncryptionKey as jC, HEDGE_MISSING_MS as jS, handoffEphemeral as j_, cashuRequestPayload as ja, CONTACT_LINK_BYTES as jb, decryptPushPayload as jc, verifyRingAuthorization as jd, EDIT_BUFFER_MAX as jf, emptyLinkRecords as jg, GhostlyHttpError as jh, resolveDidDht as ji, TYPING_CAPABILITY as jl, sortRoster as jm, parseGroupMetaStatement as jn, readGroupFileMeta as jo, readReply as jp, AtprotoCid as jr, transferEnded as js, readKnocks as jt, IDENTITY_CHALLENGE_WINDOW as ju, enrollGrantFrame as jv, TURN_SETTLE_MS as jx, APP_BUNDLE_LIMITS as jy, readX401ProofResponse as k, decrypt as kC, GROUP_RATION_WINDOW_MS as kS, handoffDigest as k_, findBolt11 as ka, canonicalJsonBytes as kb, WebPushError as kc, ringEvidence as kd, parseVideoMeta as kf, RECORD_TTL as kg, presenceSeenAt as kh, jwkThumbprint as ki, STATUS_CARD_CAPABILITY as kl, rosterHas as km, parseGroupMetaBody as kn, groupFileFallback as ko, groupReplyAuthor as kp, parseAtprotoDidDocument as kr, encodeFileData as ks, knockRecords as kt, encodePacketTransports as ku, enrollDigits as kv, TURN_PUT_WINDOW_MS as kx, seenEntry as ky, x401VpToken as l, PacketTooLargeError as lC, turnName as lS, HANDOFF_PIECE_BYTES as l_, normalizePubkyKey as la, isAppHash as lb, readPin as lc, PROOF_CAPABILITY as ld, RECORDING_TYPES as lf, PAIRED_CALL_CANDIDATES as lg, AWAITING_PEER_MS as lh, normalizeDid as li, appDataBytes as ll, claimedTime as lm, validMentions as ln, RTC_UNSTARTED_MS as lo, QUICK_REACTIONS as lp, decodeTx as lr, lobbyRecords as ls, decodeCommunityLink as lt, normalizeDomain as lu, sealHandoffPiece as lv, DEVICE_ECHO_FRAME as lx, REQUEST_NAME_UNITS as ly, x401HolderJwk as m, openRelayPayload as mC, turnSignedMessage as mS, HANDOFF_VERIFIED as m_, encodeSvcbPacket as ma, readAppRevocationShape as mb, WAKE_FRAME as mc, importedProof as md, fileMessageText as mf, callSignalHeardAt as mg, IDLE_THRESHOLD as mh, signingKeys as mi, isChatAppId as ml, GROUP_ID as mm, MAX_GROUP_NAME_BYTES as mn, pairedMessageFrame as mo, nextReactionNumber as mp, sha256d as mr, rankHubs as ms, leaveStatement3 as mt, txtValue as mu, readSetUpdate as mv, deviceEchoNonce as mx, STAMP_BITS_MIN as my, X401_RESPONSE_MODES as n, DiscoveryBudgetError as nC, readTurnPacket as nS, HANDOFF_HAVE as n_, BITCOIN_NETWORKS as na, APP_STATEMENT_LIMITS as nb, nextPinNumber as nc, revokesIdentity as nd, FileTransfers as nf, RTC_SIGNAL_MAX_AGE_MS as ng, STALLED_EVIDENCE_MS as nh, didJwsAlg as ni, APP_RATE_LIMIT as nl, sameButtonText as nm, meshMessageRef as nn, PAIRING_RETRY_MS as no, sanitizePreviewImage as np, decodeBase64 as nr, COMMUNITY_TOPOLOGY as ns, GROUP_READ_NOTE_COMMUNITY as nt, decodeDnsResponse as nu, readHandoffHello as nv, __commonJSMin as nw, inviteOwnership as nx, KNOCK_SLOT_LABEL as ny, matchX401Dcql as o, withRequestOptions as oC, signTurnRelease as oS, HANDOFF_MANIFEST as o_, isPubkyKey as oa, appRevocationId as ob, pinIsNewer as oc, applyIdentityEvent as od, sanitizeFileName as of, parseRtcSignal as og, DirectPathWatch as oh, didWebFileNames as oi, APP_VERSION_MAX as ol, usageLeft as om, MENTION_LIMITS as on, RACE_RELAYED_MS as oo, readForwarded as op, compactSize as or, freshHubs as os, communityMessageId as ot, encodeDnsQuery as ou, readHandoffTurnFrame as ov, __toCommonJS as ow, readInviteCode as ox, REQUEST_CLOCK_SKEW_MS as oy, sameX401HolderJwk as p, newerPacket as pC, turnSequence as pS, HANDOFF_TIMINGS as p_, decodeSvcbRecords as pa, readAppRevocation as pb, WAKE_CALL_WAIT_MS as pc, emptyProofLedger as pd, downsamplePeaks as pf, callRtcConfig as pg, FIRST_PUBLISH_MAX_MS as ph, parseDidSignaturePaste as pi, isAppVersion as pl, GROUP_ADMIN_OFF_ERROR as pm, MAX_GROUP_META_BODY as pn, pairedMessageFits as po, ReactionWindow as pp, hash160 as pr, pickHubs as ps, leaveStatement as pt, recordsName as pu, encodeSetSlots as pv, deviceEchoFrame as px, STAMP_BITS_MAX as py, signAppStore as q, fromBase64Url as qC, normalizeRelayUrl as qS, newHandoffId as q_, GhostLink as qa, INVITE_MAX_LENGTH as qb, appRangeGetFrame as qc, DHT_TEXT_REFUSED as qd, validEditNumber as qf, HANDOFF_ATTEMPTS as qg, decodeChunk as qh, parsePaymentAmount as qi, readManifest as ql, sha256Hex as qm, verifySshSignature as qn, GROUP_VERSION_HUBS as qo, buttonLabelClash as qp, DID_GHOSTLY_SERVICE as qr, typingFrame as qs, chainPieces as qt, boundVerifiedIdentity as qu, inboxRecord as qv, TURN_SLOTS as qx, isAppPath as qy, readX401OpenId4VpRequest as r, budgetRetryMs as rC, sealTurnBody as rS, HANDOFF_HELLO as r_, isBitcoinAddress as ra, appFingerprint as rb, parsePinFrame as rc, signIdentityPresentation as rd, PREVIEWABLE_IMAGE as rf, buildDataSdp as rg, DIRECT_EVIDENCE_MS as rh, didSignedMessages as ri, APP_RATE_WINDOW_MS as rl, statusCardBytes as rm, parseCommunityEdit as rn, PONG_WAIT_MS as ro, FORWARD_LIMITS as rp, verifyBip322 as rr, beaconKeys as rs, communityCommitHash as rt, dnsProofName as ru, readHandoffManifest as rv, __esmMin as rw, inviteQrSegments as rx, LINK_RECORD_LABEL as ry, presentX401SdJwtVc as s, MAX_DNS_PACKET_BYTES as sC, turnInstance as sS, HANDOFF_OFFER as s_, isPubkyProofFolder as sa, appSignedBytes as sb, pinNumberHolds as sc, lastSharedWithMe as sd, sanitizeMime as sf, CALL_SIGNAL_FUTURE_MS as sg, directBlocked as sh, didWebFileUrl as si, AppSessions as sl, MESSAGE_CLOCK_SKEW_MS as sm, mentionsBytes as sn, REDESCRIBED_GRACE_MS as so, COMMUNITY_REACTION_FRAME as sp, decodeAnyBitcoinAddress as sr, hubRank as ss, communityRoster as st, isPublicAddress as su, readHandoffVerified as sv, DEVICES_CAPABILITY as sx, REQUEST_LABEL as sy, X401_REQUEST_LIMITS as t, RelayBreaker as tC, readTurnBody as tS, HANDOFF_FILE_REQUEST as t_, sparkNetworkOf as ta, APP_PREFIXES as tb, mayPin as tc, receivedIdentityStatus as td, readDhtFile as tf, RTC_SIGNAL_FUTURE_MS as tg, REANSWERS as th, didGhostlyServiceEntry as ti, APP_PEER_OPEN_MAX as tl, removedCardText as tm, communityMessageAuthor as tn, PAIRING_ATTEMPT_MS as to, previewImageSize as tp, bip322ToSpend as tr, wireHubPolicy as ts, CommunitySession as tt, WELL_KNOWN_PATH as tu, readHandoffHave as tv, utf8Encode as tw, inviteLink as tx, KNOCK_SLOTS as ty, X401_CREDENTIAL_LIMITS as u, RELAY_PAYLOAD_MAX_BYTES as uC, turnPacket as uS, HANDOFF_PIECE_OVERHEAD as u_, pubkyProofCapability as ua, isAppKey as ub, DEVICE_WAKE_TTL_SECONDS as uc, PeerProofs as ud, VOICE_LIMITS as uf, RTC_CONFIG as ug, DEPARTED_READ_MS as uh, parseDid as ui, appDataFrame as ul, heardTime as um, wireMentions as un, SWITCH_RETIRE_MS as uo, REACTED_FRAME as up, decodeWitness as ur, mergeBeacon as us, derivedSecret as ut, parseDomainTxt as uu, sortParts as uv, DEVICE_PING_FRAME as ux, REQUEST_PACKET_BYTES as uy, X401_SCHEME as v, decodeDnsAnswers as vC, BACKGROUND_WHILE_SIGNALING as vS, filePartDigest as v_, LNURL_LIMITS as va, signAppRevocation as vb, WakeLimiter as vc, proofHash as vd, recordingMime as vf, extractParamsFromSdp as vg, OFFER_LOOK_MS as vh, DID_DHT_PREFIX as vi, APP_RANGES_CAPABILITY as vl, MAX_GROUP_CHAIN as vm, groupDisplayName as vn, EngineError as vo, reactedFrame as vp, varBytes as vr, shouldBeHub as vs, signCommunity as vt, CAPS_LABEL as vu, signTombstone as vv, deviceLinkParams as vx, knockSlotOf as vy, decodeX401Header as w, identityFromSeed as wC, DEPARTED_READS as wS, handoffBusyFrame as w_, parsePayParams as wa, isImageMime as wb, relayRequest as wc, verifyNostrProof as wd, PLAYABLE_VIDEO as wf, sdpHasCandidates as wg, TRANSPORTS_GONE_MS as wh, didDhtFromPublicKey as wi, KNOWN_SESSION_CAPABILITIES as wl, commitUntaggedHash as wm, groupMetaToHand as wn, GROUP_HAVE_FRAME as wo, validReactionNumber as wp, atprotoProofRecord as wr, ChatFiles as ws, decodeGroupEntryLink as wt, CapsRefusedError as wu, ENROLL_GRANT as wv, signDeviceTransports as wx, openRequest as wy, buildX401ProofResult as x, readDnsName as xC, CHAT_RESERVE_PER_CHAT as xS, handoffAttemptAllowed as x_, invoiceCallbackUrl as xa, verifyAppStatementBytes as xb, parseWakeFrame as xc, storageProofBody as xd, voiceLevel as xf, keepsToRelays as xg, PRESENCE_WINDOW as xh, DidDhtError as xi, EDIT_CAPABILITY as xl, OWN_FRAME_LIMIT as xm, groupMetaNewer as xn, parseEngineError as xo, reactionIsNewer as xp, ATPROTO_PROOF_COLLECTION as xr, PAIRED_CALL_FRAME as xs, GROUP_ENTRY_PROFILE as xt, CAPS_REFRESH_MS as xu, ENROLL_CANCEL as xv, deviceLinkSecret as xx, makeStamp as xy, X401_VERSION as y, decodeTxtPacket as yC, CHAT_RESERVE as yS, filePartName as y_, fetchLnurlJson as ya, verifyAppRevocation as yb, deviceWakeRequest as yc, proofStatement as yd, voiceDownloadName as yf, heardCallSignal as yg, OFFER_STEP_MAX as yh, DID_DHT_TTL as yi, BUTTONS_CAPABILITY as yl, MAX_GROUP_MEMBERS as ym, groupMetaBody as yn, engineError as yo, reactionEmoji as yp, ATPROTO_DECLARED_SCOPE as yr, validHead as ys, verifyCommunityChain as yt, CAPS_LIMITS as yu, verifySetUpdate as yv, deviceLinkRendezvousSeed as yx, knockSlotRecords as yy, planAppUpdate as z, hasVisible as zC, SIGNALING_WINDOW_MS as zS, handoffReleaseFrame as z_, BLOCKED_DIAL_WAIT_MS as za, createDeviceInvite as zb, APP_RANGE_FRAMES as zc, rankTransports as zd, REMOVED_TEXT as zf, encodeServices as zg, sanitizeResponseHeaders as zh, TEST_USDT_FAUCET_AMOUNT as zi, SESSION_RECEIVE_PENDING as zl, edgeParams as zm, SSH_PUBLIC_KEY_MAX as zn, SIGNALS_PER_MINUTE as zo, PR_CHECKS as zp, parseAtprotoDidKey as zr, TYPING_STATUS_MAX as zs, groupWakes as zt, IDENTITY_MAX_VALIDITY as zu, FLOOD_PER_DAY as zv, TURN_LABEL as zx, APP_VIEWS as zy };
34410
35190
 
34411
- //# sourceMappingURL=src-BdAF18HA.js.map
35191
+ //# sourceMappingURL=src-D9oJLTXM.js.map