@caprid/moq-core 0.4.0 → 0.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.
@@ -0,0 +1,297 @@
1
+ /**
2
+ * One MOQT session that publishes and subscribes: the subscribe driver (`session.ts`) and the publish driver
3
+ * (`publish-session.ts`) share one transport, as draft-22 allows (a subscription "can be established by either
4
+ * endpoint"; roles belong to entities, not sessions).
5
+ *
6
+ * The subscribe driver owns the session: it sends and reads SETUP, starts every request this endpoint makes (SUBSCRIBE,
7
+ * SUBSCRIBE_NAMESPACE, FETCH, TRACK_STATUS), and reads every incoming unidirectional stream, the control stream and
8
+ * subgroup data alike. The publish driver serves the peer: each request stream the peer opens is routed by its first
9
+ * message type, so SUBSCRIBE_NAMESPACE (the relay's solicitation, which carries announces), SUBSCRIBE, TRACK_STATUS
10
+ * and FETCH reach the publish driver, and anything else (PUBLISH, PUBLISH_NAMESPACE) the subscribe driver. The publish
11
+ * driver's own control stream is swallowed, and it is handed the peer's SETUP options and any control-stream GOAWAY
12
+ * the subscribe driver reads, so its readiness and migration silence follow the real session.
13
+ *
14
+ * This endpoint's Request IDs are allocated by the subscribe driver alone. The peer's are consumed session-wide
15
+ * (§6.4.2.1), so both drivers claim them in one shared set: an ID one driver consumed is a reuse to the other.
16
+ *
17
+ * Measured against moq-relay on 2026-11-18 (spec/behavior.md, "One connection that publishes and subscribes"): one
18
+ * session announced, served the
19
+ * relay's SUBSCRIBE and subscribed to another session's track at once, with the relay soliciting its announces even
20
+ * though SETUP carried SOLICIT. The relay never routes a session's own announcements back to it.
21
+ */
22
+ import { encodeGoaway, encodeSetup, MESSAGE_TYPE } from './control-messages.js';
23
+ import { createMoqtPublishSession } from './publish-session.js';
24
+ import { createMoqtSession } from './session.js';
25
+ import { decodeVarint, varintLengthFromFirstByte } from './varint.js';
26
+ /** Peer-initiated requests the publish driver serves; every other request type goes to the subscribe driver. */
27
+ const PUBLISHER_REQUESTS = new Set([
28
+ MESSAGE_TYPE.SUBSCRIBE_NAMESPACE,
29
+ MESSAGE_TYPE.SUBSCRIBE,
30
+ MESSAGE_TYPE.TRACK_STATUS,
31
+ MESSAGE_TYPE.FETCH,
32
+ ]);
33
+ const concat = (a, b) => {
34
+ const out = new Uint8Array(a.length + b.length);
35
+ out.set(a);
36
+ out.set(b, a.length);
37
+ return out;
38
+ };
39
+ /**
40
+ * Read a request stream's first message type without consuming it: the type, or undefined if the stream ended or
41
+ * failed first, and a stream that replays every byte read.
42
+ */
43
+ async function peekRequestType(stream) {
44
+ const reader = stream.readable.getReader();
45
+ let buffered = new Uint8Array(0);
46
+ let type;
47
+ let failure;
48
+ for (;;) {
49
+ // The first byte gives the varint's length (MOQT's leading-ones prefix, up to nine bytes); once a whole one is
50
+ // in, the router has what it needs.
51
+ const first = buffered[0];
52
+ if (first !== undefined && buffered.length >= varintLengthFromFirstByte(first)) {
53
+ try {
54
+ type = decodeVarint(buffered).value;
55
+ }
56
+ catch {
57
+ // A varint this endpoint cannot represent: no driver serves it, and the subscriber's reader refuses it.
58
+ }
59
+ break;
60
+ }
61
+ try {
62
+ const { done, value } = await reader.read();
63
+ if (done)
64
+ break;
65
+ buffered = concat(buffered, value);
66
+ }
67
+ catch (error) {
68
+ failure = { error };
69
+ break;
70
+ }
71
+ }
72
+ const replay = buffered;
73
+ const readable = new ReadableStream({
74
+ start(controller) {
75
+ if (replay.length > 0)
76
+ controller.enqueue(replay);
77
+ if (failure) {
78
+ controller.error(failure.error);
79
+ reader.releaseLock();
80
+ }
81
+ },
82
+ // The peek reader is released once the replay has read the stream to its end, by FIN, reset or cancel.
83
+ async pull(controller) {
84
+ try {
85
+ const { done, value } = await reader.read();
86
+ if (!done) {
87
+ controller.enqueue(value);
88
+ return;
89
+ }
90
+ controller.close();
91
+ }
92
+ catch (error) {
93
+ controller.error(error);
94
+ }
95
+ reader.releaseLock();
96
+ },
97
+ async cancel(reason) {
98
+ try {
99
+ await reader.cancel(reason);
100
+ }
101
+ finally {
102
+ reader.releaseLock();
103
+ }
104
+ },
105
+ });
106
+ return { type, stream: { readable, writable: stream.writable } };
107
+ }
108
+ /**
109
+ * Run a subscribe driver and a publish driver over one established transport. The transport must have negotiated its
110
+ * MOQT version already, as for either driver alone.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * const { subscriber, publisher } = createMoqtDuplexSession(transport, {
115
+ * subscriber: { setupOptions: [{ type: SETUP_OPTION.SOLICIT, value: 1 }] },
116
+ * });
117
+ * publisher.announce(['room', 'p', 'alice']);
118
+ * publisher.registerTrack({ trackNamespace: ['room', 'p', 'alice'], trackName: 'video' });
119
+ * subscriber.subscribe({ trackNamespace: ['room', 'p', 'bob'], trackName: 'video' }, handlers);
120
+ * ```;
121
+ */
122
+ export function createMoqtDuplexSession(transport, config = {}) {
123
+ let toSubscriber;
124
+ let toPublisher;
125
+ let toPublisherControl;
126
+ const subscriberRequests = new ReadableStream({
127
+ start: (controller) => {
128
+ toSubscriber = controller;
129
+ },
130
+ });
131
+ const publisherRequests = new ReadableStream({
132
+ start: (controller) => {
133
+ toPublisher = controller;
134
+ },
135
+ });
136
+ // The publish driver's control stream from the peer: the peer's SETUP and any GOAWAY, copied from the real one. It
137
+ // never closes: the publish driver reads a closed control stream as the end of the session, and the transport's
138
+ // `closed` tells it that first.
139
+ const publisherControl = new ReadableStream({
140
+ start: (controller) => {
141
+ toPublisherControl = controller;
142
+ },
143
+ });
144
+ /** Set by `destroy()`: the subscriber's own close must not cut the publisher's drain short. */
145
+ let deferSubscriberClose = false;
146
+ let destroyed = false;
147
+ const peerRequestIds = new Set();
148
+ let toPublisherUni;
149
+ let controlTaken = false;
150
+ const publisherView = {
151
+ get protocol() {
152
+ return transport.protocol;
153
+ },
154
+ incomingUnidirectionalStreams: new ReadableStream({
155
+ start: (controller) => {
156
+ toPublisherUni = controller;
157
+ controller.enqueue(publisherControl);
158
+ },
159
+ }),
160
+ incomingBidirectionalStreams: publisherRequests,
161
+ createUnidirectionalStream(options) {
162
+ // The driver's first stream is its control stream, opened before anything else; the subscribe driver's is the
163
+ // session's.
164
+ if (!controlTaken) {
165
+ controlTaken = true;
166
+ return Promise.resolve(new WritableStream());
167
+ }
168
+ return transport.createUnidirectionalStream(options);
169
+ },
170
+ createBidirectionalStream: () => Promise.reject(new Error('the publish side of a duplex session starts no requests')),
171
+ close: (closeInfo) => transport.close(closeInfo),
172
+ get closed() {
173
+ return transport.closed;
174
+ },
175
+ };
176
+ const subscriberView = {
177
+ get protocol() {
178
+ return transport.protocol;
179
+ },
180
+ get incomingUnidirectionalStreams() {
181
+ return transport.incomingUnidirectionalStreams;
182
+ },
183
+ incomingBidirectionalStreams: subscriberRequests,
184
+ createUnidirectionalStream: (options) => transport.createUnidirectionalStream(options),
185
+ createBidirectionalStream: () => transport.createBidirectionalStream(),
186
+ close: (closeInfo) => {
187
+ if (!deferSubscriberClose)
188
+ transport.close(closeInfo);
189
+ },
190
+ get closed() {
191
+ return transport.closed;
192
+ },
193
+ };
194
+ const callbacks = config.subscriber?.callbacks ?? {};
195
+ const subscriber = createMoqtSession(subscriberView, {
196
+ ...config.subscriber,
197
+ peerRequestIds,
198
+ callbacks: {
199
+ ...callbacks,
200
+ onReady: (serverOptions) => {
201
+ toPublisherControl.enqueue(encodeSetup(serverOptions));
202
+ callbacks.onReady?.(serverOptions);
203
+ },
204
+ onGoaway: (goaway) => {
205
+ // After `destroy()` the publisher is draining, and a GOAWAY changes nothing for it.
206
+ if (!destroyed)
207
+ try {
208
+ toPublisherControl.enqueue(encodeGoaway(goaway.timeout, goaway.newSessionUri));
209
+ }
210
+ catch {
211
+ // The publish driver's control stream is gone with the session.
212
+ }
213
+ callbacks.onGoaway?.(goaway);
214
+ },
215
+ },
216
+ });
217
+ const publisher = createMoqtPublishSession(publisherView, { ...config.publisher, peerRequestIds });
218
+ // Once the transport has closed, end the publish driver's synthetic streams, so none of its reads wait forever. This
219
+ // handler runs after the driver's own `closed` handler, registered in its constructor, so the driver has already ended
220
+ // and does not read the closed control stream as the peer closing it.
221
+ const endSynthetic = () => {
222
+ for (const end of [() => toPublisherControl.close(), () => toPublisherUni.close()]) {
223
+ try {
224
+ end();
225
+ }
226
+ catch {
227
+ // Already closed.
228
+ }
229
+ }
230
+ };
231
+ void transport.closed.then(endSynthetic, endSynthetic);
232
+ void (async () => {
233
+ const reader = transport.incomingBidirectionalStreams.getReader();
234
+ try {
235
+ for (;;) {
236
+ const { done, value } = await reader.read();
237
+ if (done)
238
+ break;
239
+ void peekRequestType(value).then(({ type, stream }) => {
240
+ const forPublisher = type !== undefined && PUBLISHER_REQUESTS.has(type);
241
+ // After `destroy()` the subscriber has reported its end: a request for it is refused, not delivered, while the
242
+ // publisher drains.
243
+ try {
244
+ if (!forPublisher && destroyed)
245
+ throw new Error('the subscriber has ended');
246
+ (forPublisher ? toPublisher : toSubscriber).enqueue(stream);
247
+ }
248
+ catch {
249
+ void stream.readable.cancel().catch(() => { });
250
+ void stream.writable.abort().catch(() => { });
251
+ }
252
+ });
253
+ }
254
+ toSubscriber.close();
255
+ toPublisher.close();
256
+ }
257
+ catch (error) {
258
+ toSubscriber.error(error);
259
+ toPublisher.error(error);
260
+ }
261
+ finally {
262
+ reader.releaseLock();
263
+ }
264
+ })();
265
+ // The subscriber ends now but leaves the transport to the publisher, which closes it after its drain.
266
+ const end = (endSubscriber, endPublisher) => {
267
+ if (destroyed)
268
+ return;
269
+ destroyed = true;
270
+ deferSubscriberClose = true;
271
+ // A throwing subscriber callback must not leave the publisher, and with it the transport, open.
272
+ try {
273
+ endSubscriber();
274
+ }
275
+ finally {
276
+ endPublisher();
277
+ }
278
+ };
279
+ return {
280
+ // The driver itself, except that ending it ends the session in order, as `destroy()` below does.
281
+ subscriber: {
282
+ ready: subscriber.ready,
283
+ get maxAgeSupported() {
284
+ return subscriber.maxAgeSupported;
285
+ },
286
+ subscribe: (options, handlers) => subscriber.subscribe(options, handlers),
287
+ fetch: (options, handlers) => subscriber.fetch(options, handlers),
288
+ trackStatus: (options, handlers) => subscriber.trackStatus(options, handlers),
289
+ subscribeNamespace: (options, handlers) => subscriber.subscribeNamespace(options, handlers),
290
+ close: (closeCode, reason) => end(() => subscriber.close(closeCode, reason), () => publisher.close(closeCode, reason)),
291
+ destroy: (error) => end(() => subscriber.destroy(error), () => publisher.destroy(error)),
292
+ },
293
+ publisher,
294
+ destroy: (error) => end(() => subscriber.destroy(error), () => publisher.destroy(error)),
295
+ };
296
+ }
297
+ //# sourceMappingURL=duplex-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duplex-session.js","sourceRoot":"","sources":["../../src/protocol/duplex-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAAE,wBAAwB,EAA0D,MAAM,sBAAsB,CAAC;AAExH,OAAO,EAAE,iBAAiB,EAAgE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAEtE,gHAAgH;AAChH,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IACtD,YAAY,CAAC,mBAAmB;IAChC,YAAY,CAAC,SAAS;IACtB,YAAY,CAAC,YAAY;IACzB,YAAY,CAAC,KAAK;CACnB,CAAC,CAAC;AAiCH,MAAM,MAAM,GAAG,CAAC,CAAa,EAAE,CAAa,EAAc,EAAE;IAC1D,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IAChD,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACX,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF;;;GAGG;AACH,KAAK,UAAU,eAAe,CAC5B,MAA+B;IAE/B,MAA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AAO,EAAE,QAAQ,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC;YACjE,WAAW,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC;YAC7E,kBAAkB,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC;YAC3F,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAC3B,GAAG,CACD,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,EACzC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CACzC;YACH,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,GAAG,CACD,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,EAC/B,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAC/B;SACJ;QACD,SAAS;QACT,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,GAAG,CACD,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,EAC/B,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAC/B;KACJ,CAAC;AACJ,CAAC"}
@@ -18,18 +18,20 @@ export interface MoqtPublishSessionCallbacks {
18
18
  /** GOAWAY (control stream or a request stream): stop initiating, migrate. */
19
19
  onGoaway?(goaway: Goaway): void;
20
20
  /**
21
- * The announced namespace reached the wire on an accepted SUBSCRIBE_NAMESPACE solicitation — the peer can now route
22
- * SUBSCRIBEs to it. NAMESPACE entries have no acknowledgement of their own; this is the strongest "announced" fact
23
- * the transport draft offers.
21
+ * An announced namespace first reached the wire on an accepted SUBSCRIBE_NAMESPACE solicitation — the peer can now
22
+ * route SUBSCRIBEs to it. NAMESPACE entries have no acknowledgement of their own; this is the strongest "announced"
23
+ * fact the transport draft offers. Called once per namespace per `announce()`.
24
24
  */
25
25
  onAnnounced?(info: {
26
26
  namespace: TrackNamespace;
27
27
  }): void;
28
28
  /**
29
- * The solicitation stream carrying the announce ended while the session was still live — the peer rejected the
30
- * announce (unauthorized suffix) or withdrew its namespace interest. Either way the ingest path is gone.
29
+ * The last solicitation stream carrying an announced namespace ended while the session was still live — the peer
30
+ * rejected the announce (unauthorized suffix) or withdrew its namespace interest. Either way that namespace's ingest
31
+ * path is gone. Not called for a namespace `withdraw()` removed.
31
32
  */
32
33
  onAnnounceEnded?(info: {
34
+ namespace: TrackNamespace;
33
35
  error?: unknown;
34
36
  }): void;
35
37
  /** The peer subscribed to a registered track (already answered SUBSCRIBE_OK). */
@@ -45,6 +47,7 @@ export interface MoqtPublishSessionCallbacks {
45
47
  */
46
48
  onSubscribeFailed?(info: {
47
49
  requestId: number;
50
+ trackNamespace: TrackNamespace;
48
51
  trackName: string;
49
52
  error: unknown;
50
53
  }): void;
@@ -56,6 +59,7 @@ export interface MoqtPublishSessionCallbacks {
56
59
  * forwarding subscription, so no data streams may be opened for the track.
57
60
  */
58
61
  onTrackBinding?(info: {
62
+ trackNamespace: TrackNamespace;
59
63
  trackName: string;
60
64
  trackAlias: number | undefined;
61
65
  }): void;
@@ -71,13 +75,23 @@ export interface MoqtPublishSessionCallbacks {
71
75
  updateRequestId: number;
72
76
  parameters: MessageParameters;
73
77
  }): void;
74
- /** The session ended — transport closed, or a fatal protocol error. */
78
+ /**
79
+ * The session ended — transport closed, or a fatal protocol error. It is the last callback. From `close()` or
80
+ * `destroy()` until it runs, the session takes no new work and reports only ends (`onSubscribeEnd`, an `onTrackBinding`
81
+ * with no alias): requests are refused with GOING_AWAY, and a GOAWAY or an update is not reported. A track whose
82
+ * `end({ after })` is still waiting is served as before until that end.
83
+ */
75
84
  onClosed?(info: {
76
85
  error?: unknown;
77
86
  }): void;
78
87
  }
79
88
  /** Options for {@link createMoqtPublishSession}. */
80
89
  export interface MoqtPublishSessionConfig {
90
+ /**
91
+ * The peer's consumed Request IDs (§6.4.2.1). Sessions sharing one transport pass the same set, so an ID one of them
92
+ * consumed is a reuse to the other; `createMoqtDuplexSession` does. Default: the session's own.
93
+ */
94
+ peerRequestIds?: Set<number>;
81
95
  /** Extra Setup Options to send (an implementation identifier is added automatically). */
82
96
  setupOptions?: KeyValuePair[];
83
97
  /** Identifies this implementation in SETUP (§9.1.5). */
@@ -143,14 +157,25 @@ export interface RegisteredTrack {
143
157
  export interface MoqtPublishSession {
144
158
  /** Resolves when the server's SETUP has been received. */
145
159
  readonly ready: Promise<void>;
146
- /** Whether a current solicitation covers the desired namespace; undefined before any is accepted. */
160
+ /**
161
+ * Whether a current solicitation covers an announced namespace; undefined before any solicitation is accepted or
162
+ * while nothing is announced. With several namespaces announced, use {@link isSolicited} for one of them.
163
+ */
147
164
  readonly namespaceSolicited: boolean | undefined;
165
+ /** Whether a current solicitation covers `trackNamespace`; undefined before any solicitation is accepted. */
166
+ isSolicited(trackNamespace: TrackNamespace): boolean | undefined;
148
167
  /**
149
- * Announce the namespace on every matching solicitation — current and future. The wire write additionally waits for
150
- * the first `registerTrack()`: an announce invites immediate SUBSCRIBEs, and an empty registry would answer them with
151
- * a terminal DOES_NOT_EXIST. Result via `onAnnounced` / `onAnnounceEnded`.
168
+ * Announce a namespace on every matching solicitation — current and future. A session announces any number of
169
+ * namespaces; announcing one already announced does nothing. The wire write additionally waits for the first
170
+ * `registerTrack()` in that namespace: an announce invites immediate SUBSCRIBEs, and an empty registry would answer
171
+ * them with a terminal DOES_NOT_EXIST. Result via `onAnnounced` / `onAnnounceEnded`.
152
172
  */
153
173
  announce(trackNamespace: TrackNamespace): void;
174
+ /**
175
+ * Stop announcing a namespace: NAMESPACE_DONE on every solicitation that carried it. Its tracks stay registered and
176
+ * their subscriptions are untouched; end them first. Withdrawing a namespace not announced does nothing.
177
+ */
178
+ withdraw(trackNamespace: TrackNamespace): void;
154
179
  /** Register one servable track; the peer's SUBSCRIBEs are answered from this registry. */
155
180
  registerTrack(options: RegisterTrackOptions): RegisteredTrack;
156
181
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"publish-session.d.ts","sourceRoot":"","sources":["../../src/protocol/publish-session.ts"],"names":[],"mappings":"AAsCA,OAAO,EAaL,KAAK,YAAY,EACjB,KAAK,QAAQ,EAGb,KAAK,iBAAiB,EAOtB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQjF,yGAAyG;AACzG,MAAM,WAAW,iBAAiB;IAChC,8FAA8F;IAC9F,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,cAAc,EAAE,cAAc,CAAC;IAC/B,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,UAAU,EAAE,iBAAiB,CAAC;CAC/B;AAED,8EAA8E;AAC9E,MAAM,WAAW,2BAA2B;IAC1C,oEAAoE;IACpE,OAAO,CAAC,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC9C,6EAA6E;IAC7E,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,WAAW,CAAC,CAAC,IAAI,EAAE;QAAE,SAAS,EAAE,cAAc,CAAA;KAAE,GAAG,IAAI,CAAC;IACxD;;;OAGG;IACH,eAAe,CAAC,CAAC,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAClD,iFAAiF;IACjF,WAAW,CAAC,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjD,2EAA2E;IAC3E,cAAc,CAAC,CAAC,IAAI,EAAE;QAAE,SAAS,EA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