moqtail 0.14.0 → 0.16.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 (44) hide show
  1. package/README.md +153 -473
  2. package/dist/{client-Z7egUKTO.cjs → client-DQ5aGbLR.cjs} +1100 -1099
  3. package/dist/client-DUzLw_Y8.d.cts +1932 -0
  4. package/dist/{client-BW1agDFV.mjs → client-DVi4Nh1J.mjs} +942 -947
  5. package/dist/client-epHqMdHm.d.mts +1932 -0
  6. package/dist/client.cjs +121 -4
  7. package/dist/client.d.cts +23 -1933
  8. package/dist/client.d.mts +23 -1933
  9. package/dist/client.mjs +117 -2
  10. package/dist/emitter-UbeRcbuf.mjs +109 -0
  11. package/dist/{logger-c2NoQqtx.cjs → emitter-qNJYD3yQ.cjs} +61 -2
  12. package/dist/index-B-BMK-b6.d.mts +2090 -0
  13. package/dist/index-BtemTtwe.d.cts +2090 -0
  14. package/dist/{index-DBbxKcc1.d.cts → index-CNn9BgO6.d.mts} +168 -337
  15. package/dist/index.cjs +39 -34
  16. package/dist/index.d.cts +20 -4
  17. package/dist/index.d.mts +20 -4
  18. package/dist/index.mjs +5 -4
  19. package/dist/logger-B8IYkljn.d.cts +64 -0
  20. package/dist/logger-B8IYkljn.d.mts +64 -0
  21. package/dist/model.cjs +208 -359
  22. package/dist/model.d.cts +2896 -2
  23. package/dist/model.d.mts +17 -2
  24. package/dist/model.mjs +207 -359
  25. package/dist/player/component.cjs +317 -0
  26. package/dist/player/component.d.cts +50 -0
  27. package/dist/player/component.d.mts +50 -0
  28. package/dist/player/component.mjs +315 -0
  29. package/dist/player-CJayEzwt.cjs +6750 -0
  30. package/dist/player-DcctWhyM.mjs +6599 -0
  31. package/dist/player.cjs +27 -0
  32. package/dist/player.d.cts +17 -0
  33. package/dist/player.d.mts +17 -0
  34. package/dist/player.mjs +1 -0
  35. package/dist/rolldown-runtime-CmQyd0Gu.cjs +27 -0
  36. package/dist/util.cjs +9 -10
  37. package/dist/util.d.cts +20 -13
  38. package/dist/util.d.mts +20 -13
  39. package/dist/util.mjs +4 -6
  40. package/package.json +45 -5
  41. package/dist/index-DBbxKcc1.d.mts +0 -3051
  42. package/dist/logger-ByDB8lYF.mjs +0 -56
  43. package/dist/logger-dEoueCj7.d.cts +0 -35
  44. package/dist/logger-dEoueCj7.d.mts +0 -35
package/dist/model.mjs CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/model/error/error.ts
1
+ // src/model/error/error.ts
2
2
  /**
3
3
  * Copyright 2025 The MOQtail Authors
4
4
  *
@@ -195,8 +195,7 @@ var TerminationError = class extends MOQtailError {
195
195
  this.terminationCode = terminationCode;
196
196
  }
197
197
  };
198
- //#endregion
199
- //#region src/model/common/pair.ts
198
+ // src/model/common/pair.ts
200
199
  /**
201
200
  * Copyright 2025 The MOQtail Authors
202
201
  *
@@ -449,8 +448,7 @@ function isVarInt(pair) {
449
448
  function isBytes(pair) {
450
449
  return pair.value instanceof Uint8Array;
451
450
  }
452
- //#endregion
453
- //#region src/model/common/location.ts
451
+ // src/model/common/location.ts
454
452
  /**
455
453
  * Copyright 2025 The MOQtail Authors
456
454
  *
@@ -536,8 +534,7 @@ var Location = class Location {
536
534
  return 0;
537
535
  }
538
536
  };
539
- //#endregion
540
- //#region src/model/common/tuple.ts
537
+ // src/model/common/tuple.ts
541
538
  /**
542
539
  * Copyright 2025 The MOQtail Authors
543
540
  *
@@ -706,8 +703,7 @@ var Tuple = class Tuple {
706
703
  return this.fields.every((f, i) => f.value.toString() === other.fields[i].value.toString());
707
704
  }
708
705
  };
709
- //#endregion
710
- //#region src/model/common/reason_phrase.ts
706
+ // src/model/common/reason_phrase.ts
711
707
  /**
712
708
  * Copyright 2025 The MOQtail Authors
713
709
  *
@@ -811,8 +807,7 @@ var ReasonPhrase = class ReasonPhrase {
811
807
  }
812
808
  }
813
809
  };
814
- //#endregion
815
- //#region src/model/error/constant.ts
810
+ // src/model/error/constant.ts
816
811
  /**
817
812
  * Copyright 2025 The MOQtail Authors
818
813
  *
@@ -879,8 +874,7 @@ let TerminationCode = /* @__PURE__ */ function(TerminationCode) {
879
874
  }
880
875
  _TerminationCode.tryFrom = tryFrom;
881
876
  })(TerminationCode || (TerminationCode = {}));
882
- //#endregion
883
- //#region src/model/error/stream_reset.ts
877
+ // src/model/error/stream_reset.ts
884
878
  /**
885
879
  * Copyright 2026 The MOQtail Authors
886
880
  *
@@ -934,8 +928,7 @@ let StreamResetCode = /* @__PURE__ */ function(StreamResetCode) {
934
928
  }
935
929
  _StreamResetCode.tryFrom = tryFrom;
936
930
  })(StreamResetCode || (StreamResetCode = {}));
937
- //#endregion
938
- //#region src/model/data/constant.ts
931
+ // src/model/data/constant.ts
939
932
  /**
940
933
  * Copyright 2025 The MOQtail Authors
941
934
  *
@@ -1239,8 +1232,7 @@ let ObjectStatus = /* @__PURE__ */ function(ObjectStatus) {
1239
1232
  }
1240
1233
  _ObjectStatus.tryFrom = tryFrom;
1241
1234
  })(ObjectStatus || (ObjectStatus = {}));
1242
- //#endregion
1243
- //#region src/model/data/datagram.ts
1235
+ // src/model/data/datagram.ts
1244
1236
  /**
1245
1237
  * Copyright 2026 The MOQtail Authors
1246
1238
  *
@@ -1349,8 +1341,7 @@ var Datagram = class Datagram {
1349
1341
  return new Datagram(msgType, trackAlias, new Location(groupId, objectId), publisherPriority, properties, payload, objectStatus, endOfGroup);
1350
1342
  }
1351
1343
  };
1352
- //#endregion
1353
- //#region src/model/data/fetch_header.ts
1344
+ // src/model/data/fetch_header.ts
1354
1345
  /**
1355
1346
  * Copyright 2025 The MOQtail Authors
1356
1347
  *
@@ -1386,8 +1377,7 @@ var FetchHeader = class FetchHeader {
1386
1377
  return new FetchHeader(type, requestId);
1387
1378
  }
1388
1379
  };
1389
- //#endregion
1390
- //#region src/model/control/constant.ts
1380
+ // src/model/control/constant.ts
1391
1381
  /**
1392
1382
  * Copyright 2025 The MOQtail Authors
1393
1383
  *
@@ -1682,8 +1672,7 @@ let RequestErrorCode = /* @__PURE__ */ function(RequestErrorCode) {
1682
1672
  }
1683
1673
  _RequestErrorCode.fromWire = fromWire;
1684
1674
  })(RequestErrorCode || (RequestErrorCode = {}));
1685
- //#endregion
1686
- //#region src/model/data/fetch_object.ts
1675
+ // src/model/data/fetch_object.ts
1687
1676
  /**
1688
1677
  * Copyright 2025 The MOQtail Authors
1689
1678
  *
@@ -1711,13 +1700,21 @@ const SUBGROUP_MODE_PRIOR_PLUS_ONE = 2;
1711
1700
  const SUBGROUP_MODE_PRESENT = 3;
1712
1701
  const END_OF_NON_EXISTENT_RANGE = 140n;
1713
1702
  const END_OF_UNKNOWN_RANGE = 268n;
1703
+ const END_OF_TIMED_OUT_RANGE = 524n;
1714
1704
  const MAX_VARINT = 2n ** 64n - 1n;
1715
1705
  /**
1716
- * Kind discriminator for End-of-Range markers (§11.5).
1706
+ * Kind discriminator for End-of-Range markers.
1717
1707
  */
1718
1708
  let EndOfRangeKind = /* @__PURE__ */ function(EndOfRangeKind) {
1709
+ /** Serialization Flags = 0x8C: all objects in the range are known not to exist. */
1719
1710
  EndOfRangeKind[EndOfRangeKind["NonExistent"] = 140] = "NonExistent";
1711
+ /** Serialization Flags = 0x10C: the range is cache-unknown. */
1720
1712
  EndOfRangeKind[EndOfRangeKind["Unknown"] = 268] = "Unknown";
1713
+ /**
1714
+ * Serialization Flags = 0x20C: the range timed out, e.g. a relay ran out of its
1715
+ * fill budget before it could retrieve it.
1716
+ */
1717
+ EndOfRangeKind[EndOfRangeKind["TimedOut"] = 524] = "TimedOut";
1721
1718
  return EndOfRangeKind;
1722
1719
  }({});
1723
1720
  /**
@@ -1752,11 +1749,20 @@ var FetchObject = class FetchObject {
1752
1749
  return this.location.object;
1753
1750
  }
1754
1751
  /**
1755
- * Context to thread into the next call on this stream.
1756
- * Returns null for EndOfRange markers — they MUST NOT update prior state.
1752
+ * What the entry after this one is encoded against, given what this one was
1753
+ * encoded against (`prev`).
1754
+ *
1755
+ * After an Object, that is the Object itself. After an End of Range marker, it is
1756
+ * the marker's Group and Object IDs, with the Subgroup ID and priority still those
1757
+ * of the last Object before the marker, or none if no Object came before it.
1757
1758
  */
1758
- toContext() {
1759
- if (this.kind === "end_of_range") return null;
1759
+ nextContext(prev) {
1760
+ if (this.kind === "end_of_range") return {
1761
+ groupId: this.groupId,
1762
+ subgroupId: prev?.subgroupId ?? null,
1763
+ objectId: this.objectId,
1764
+ publisherPriority: prev?.publisherPriority ?? null
1765
+ };
1760
1766
  return {
1761
1767
  groupId: this.groupId,
1762
1768
  subgroupId: this.subgroupId,
@@ -1773,7 +1779,7 @@ var FetchObject = class FetchObject {
1773
1779
  serialize(prev, groupOrder = 0) {
1774
1780
  const buf = new ByteBuffer();
1775
1781
  if (this.kind === "end_of_range") {
1776
- buf.putVI(this.endOfRange === 140 ? END_OF_NON_EXISTENT_RANGE : END_OF_UNKNOWN_RANGE);
1782
+ buf.putVI(BigInt(this.endOfRange));
1777
1783
  buf.putVI(this.groupId);
1778
1784
  buf.putVI(this.objectId);
1779
1785
  return buf.freeze();
@@ -1799,7 +1805,7 @@ var FetchObject = class FetchObject {
1799
1805
  let subgroupMode;
1800
1806
  if (isDatagram || this.subgroupId === 0n) subgroupMode = SUBGROUP_MODE_ZERO;
1801
1807
  else if (prev && prev.subgroupId === this.subgroupId) subgroupMode = SUBGROUP_MODE_PRIOR;
1802
- else if (prev && prev.subgroupId + 1n === this.subgroupId) subgroupMode = SUBGROUP_MODE_PRIOR_PLUS_ONE;
1808
+ else if (prev && prev.subgroupId !== null && prev.subgroupId + 1n === this.subgroupId) subgroupMode = SUBGROUP_MODE_PRIOR_PLUS_ONE;
1803
1809
  else subgroupMode = SUBGROUP_MODE_PRESENT;
1804
1810
  let flags = subgroupMode & FLAG_SUBGROUP_MODE_MASK;
1805
1811
  if (objectDelta !== null) flags |= FLAG_OBJECT_ID_PRESENT;
@@ -1823,6 +1829,7 @@ var FetchObject = class FetchObject {
1823
1829
  let kind;
1824
1830
  if (flagsRaw === END_OF_NON_EXISTENT_RANGE) kind = 140;
1825
1831
  else if (flagsRaw === END_OF_UNKNOWN_RANGE) kind = 268;
1832
+ else if (flagsRaw === END_OF_TIMED_OUT_RANGE) kind = 524;
1826
1833
  else throw new ProtocolViolationError("FetchObject.deserialize", `invalid Serialization Flags value 0x${flagsRaw.toString(16)}`);
1827
1834
  const groupId = buf.getVI();
1828
1835
  const objectId = buf.getVI();
@@ -1858,11 +1865,11 @@ var FetchObject = class FetchObject {
1858
1865
  subgroupId = 0n;
1859
1866
  break;
1860
1867
  case SUBGROUP_MODE_PRIOR:
1861
- if (!prev) throw new ProtocolViolationError("FetchObject.deserialize", "subgroup_id inherited but no prior object");
1868
+ if (!prev || prev.subgroupId === null) throw new ProtocolViolationError("FetchObject.deserialize", "subgroup_id inherited but no prior object");
1862
1869
  subgroupId = prev.subgroupId;
1863
1870
  break;
1864
1871
  case SUBGROUP_MODE_PRIOR_PLUS_ONE:
1865
- if (!prev) throw new ProtocolViolationError("FetchObject.deserialize", "subgroup_id inherited but no prior object");
1872
+ if (!prev || prev.subgroupId === null) throw new ProtocolViolationError("FetchObject.deserialize", "subgroup_id inherited but no prior object");
1866
1873
  subgroupId = prev.subgroupId + 1n;
1867
1874
  break;
1868
1875
  case SUBGROUP_MODE_PRESENT:
@@ -1884,7 +1891,7 @@ var FetchObject = class FetchObject {
1884
1891
  if (objectId > MAX_VARINT) throw new ProtocolViolationError("FetchObject.deserialize", `object id wraps: prior=${prev.objectId} +1`);
1885
1892
  }
1886
1893
  const publisherPriority = hasPriority ? buf.getU8() : (() => {
1887
- if (!prev) throw new ProtocolViolationError("FetchObject.deserialize", "priority inherited but no prior object");
1894
+ if (!prev || prev.publisherPriority === null) throw new ProtocolViolationError("FetchObject.deserialize", "priority inherited but no prior object");
1888
1895
  return prev.publisherPriority;
1889
1896
  })();
1890
1897
  let properties = null;
@@ -1899,8 +1906,7 @@ var FetchObject = class FetchObject {
1899
1906
  return FetchObject.newObject(groupId, resolvedSubgroupId, objectId, publisherPriority, forwardingPreference, properties, payload);
1900
1907
  }
1901
1908
  };
1902
- //#endregion
1903
- //#region src/model/data/full_track_name.ts
1909
+ // src/model/data/full_track_name.ts
1904
1910
  /**
1905
1911
  * Copyright 2025 The MOQtail Authors
1906
1912
  *
@@ -2001,8 +2007,7 @@ var FullTrackName = class FullTrackName {
2001
2007
  return new FullTrackName(namespace, name);
2002
2008
  }
2003
2009
  };
2004
- //#endregion
2005
- //#region src/model/property/constant.ts
2010
+ // src/model/property/constant.ts
2006
2011
  /**
2007
2012
  * Copyright 2025 The MOQtail Authors
2008
2013
  *
@@ -2019,11 +2024,12 @@ var FullTrackName = class FullTrackName {
2019
2024
  * limitations under the License.
2020
2025
  */
2021
2026
  let LOCPropertyId = /* @__PURE__ */ function(LOCPropertyId) {
2022
- LOCPropertyId[LOCPropertyId["Timestamp"] = 6] = "Timestamp";
2023
2027
  LOCPropertyId[LOCPropertyId["Timescale"] = 8] = "Timescale";
2024
- LOCPropertyId[LOCPropertyId["VideoFrameMarking"] = 10] = "VideoFrameMarking";
2028
+ LOCPropertyId[LOCPropertyId["VideoFrameMarking"] = 9] = "VideoFrameMarking";
2025
2029
  LOCPropertyId[LOCPropertyId["AudioLevel"] = 12] = "AudioLevel";
2026
2030
  LOCPropertyId[LOCPropertyId["VideoConfig"] = 13] = "VideoConfig";
2031
+ LOCPropertyId[LOCPropertyId["AudioConfig"] = 15] = "AudioConfig";
2032
+ LOCPropertyId[LOCPropertyId["Timestamp"] = 16] = "Timestamp";
2027
2033
  return LOCPropertyId;
2028
2034
  }({});
2029
2035
  let TrackPropertyType = /* @__PURE__ */ function(TrackPropertyType) {
@@ -2040,11 +2046,12 @@ let TrackPropertyType = /* @__PURE__ */ function(TrackPropertyType) {
2040
2046
  }({});
2041
2047
  function locPropertyIdFromNumber(value) {
2042
2048
  switch (value) {
2043
- case 6: return 6;
2044
2049
  case 8: return 8;
2045
- case 10: return 10;
2050
+ case 9: return 9;
2046
2051
  case 12: return 12;
2047
2052
  case 13: return 13;
2053
+ case 15: return 15;
2054
+ case 16: return 16;
2048
2055
  default: throw new InvalidTypeError("locPropertyIdFromNumber", `Invalid LOC property id: ${value}`);
2049
2056
  }
2050
2057
  }
@@ -2094,8 +2101,7 @@ function isApplicationSpecificProperty(typeValue) {
2094
2101
  const v = BigInt(typeValue);
2095
2102
  return inRange(PropertyRanges.AppSpecific1Byte, v) || inRange(PropertyRanges.AppSpecific2Byte, v);
2096
2103
  }
2097
- //#endregion
2098
- //#region src/model/property/timestamp.ts
2104
+ // src/model/property/timestamp.ts
2099
2105
  /**
2100
2106
  * Copyright 2025 The MOQtail Authors
2101
2107
  *
@@ -2113,7 +2119,7 @@ function isApplicationSpecificProperty(typeValue) {
2113
2119
  */
2114
2120
  var Timestamp = class Timestamp {
2115
2121
  timestamp;
2116
- static TYPE = 6;
2122
+ static TYPE = 16;
2117
2123
  constructor(timestamp) {
2118
2124
  this.timestamp = timestamp;
2119
2125
  }
@@ -2124,8 +2130,7 @@ var Timestamp = class Timestamp {
2124
2130
  if (Number(pair.typeValue) === Timestamp.TYPE && typeof pair.value === "bigint") return new Timestamp(pair.value);
2125
2131
  }
2126
2132
  };
2127
- //#endregion
2128
- //#region src/model/property/timescale.ts
2133
+ // src/model/property/timescale.ts
2129
2134
  /**
2130
2135
  * Copyright 2026 The MOQtail Authors
2131
2136
  *
@@ -2154,8 +2159,7 @@ var Timescale = class Timescale {
2154
2159
  if (Number(pair.typeValue) === Timescale.TYPE && typeof pair.value === "bigint") return new Timescale(pair.value);
2155
2160
  }
2156
2161
  };
2157
- //#endregion
2158
- //#region src/model/property/video_frame_marking.ts
2162
+ // src/model/property/video_frame_marking.ts
2159
2163
  /**
2160
2164
  * Copyright 2025 The MOQtail Authors
2161
2165
  *
@@ -2171,21 +2175,27 @@ var Timescale = class Timescale {
2171
2175
  * See the License for the specific language governing permissions and
2172
2176
  * limitations under the License.
2173
2177
  */
2178
+ /** The I (independent frame) bit of the RFC 9626 flag octet. */
2179
+ const INDEPENDENT = 32;
2174
2180
  var VideoFrameMarking = class VideoFrameMarking {
2175
2181
  value;
2176
- static TYPE = 10;
2182
+ static TYPE = 9;
2183
+ /** The RFC 9626 frame-marking octets (1 to 4), without the length prefix. */
2177
2184
  constructor(value) {
2178
2185
  this.value = value;
2179
2186
  }
2187
+ /** True if the frame decodes without temporally prior frames (the I bit). */
2188
+ get independent() {
2189
+ return ((this.value[0] ?? 0) & INDEPENDENT) !== 0;
2190
+ }
2180
2191
  toKeyValuePair() {
2181
- return KeyValuePair.tryNewVarInt(VideoFrameMarking.TYPE, this.value);
2192
+ return KeyValuePair.tryNewBytes(VideoFrameMarking.TYPE, this.value);
2182
2193
  }
2183
2194
  static fromKeyValuePair(pair) {
2184
- if (Number(pair.typeValue) === VideoFrameMarking.TYPE && typeof pair.value === "bigint") return new VideoFrameMarking(pair.value);
2195
+ if (Number(pair.typeValue) === VideoFrameMarking.TYPE && pair.value instanceof Uint8Array) return new VideoFrameMarking(pair.value);
2185
2196
  }
2186
2197
  };
2187
- //#endregion
2188
- //#region src/model/property/audio_level.ts
2198
+ // src/model/property/audio_level.ts
2189
2199
  /**
2190
2200
  * Copyright 2025 The MOQtail Authors
2191
2201
  *
@@ -2214,8 +2224,7 @@ var AudioLevel = class AudioLevel {
2214
2224
  if (Number(pair.typeValue) === AudioLevel.TYPE && typeof pair.value === "bigint") return new AudioLevel(pair.value);
2215
2225
  }
2216
2226
  };
2217
- //#endregion
2218
- //#region src/model/property/video_config.ts
2227
+ // src/model/property/video_config.ts
2219
2228
  /**
2220
2229
  * Copyright 2025 The MOQtail Authors
2221
2230
  *
@@ -2244,12 +2253,40 @@ var VideoConfig = class VideoConfig {
2244
2253
  if (Number(pair.typeValue) === VideoConfig.TYPE && pair.value instanceof Uint8Array) return new VideoConfig(pair.value);
2245
2254
  }
2246
2255
  };
2247
- //#endregion
2248
- //#region src/model/property/loc.ts
2256
+ // src/model/property/audio_config.ts
2257
+ /**
2258
+ * Copyright 2026 The MOQtail Authors
2259
+ *
2260
+ * Licensed under the Apache License, Version 2.0 (the "License");
2261
+ * you may not use this file except in compliance with the License.
2262
+ * You may obtain a copy of the License at
2263
+ *
2264
+ * http://www.apache.org/licenses/LICENSE-2.0
2265
+ *
2266
+ * Unless required by applicable law or agreed to in writing, software
2267
+ * distributed under the License is distributed on an "AS IS" BASIS,
2268
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2269
+ * See the License for the specific language governing permissions and
2270
+ * limitations under the License.
2271
+ */
2272
+ var AudioConfig = class AudioConfig {
2273
+ config;
2274
+ static TYPE = 15;
2275
+ constructor(config) {
2276
+ this.config = config;
2277
+ }
2278
+ toKeyValuePair() {
2279
+ return KeyValuePair.tryNewBytes(AudioConfig.TYPE, this.config);
2280
+ }
2281
+ static fromKeyValuePair(pair) {
2282
+ if (Number(pair.typeValue) === AudioConfig.TYPE && pair.value instanceof Uint8Array) return new AudioConfig(pair.value);
2283
+ }
2284
+ };
2285
+ // src/model/property/loc.ts
2249
2286
  let LOCProperty;
2250
2287
  (function(_LOCProperty) {
2251
2288
  function fromKeyValuePair(pair) {
2252
- return Timestamp.fromKeyValuePair(pair) || Timescale.fromKeyValuePair(pair) || VideoFrameMarking.fromKeyValuePair(pair) || AudioLevel.fromKeyValuePair(pair) || VideoConfig.fromKeyValuePair(pair);
2289
+ return Timestamp.fromKeyValuePair(pair) || Timescale.fromKeyValuePair(pair) || VideoFrameMarking.fromKeyValuePair(pair) || AudioLevel.fromKeyValuePair(pair) || VideoConfig.fromKeyValuePair(pair) || AudioConfig.fromKeyValuePair(pair);
2253
2290
  }
2254
2291
  _LOCProperty.fromKeyValuePair = fromKeyValuePair;
2255
2292
  function toKeyValuePair(header) {
@@ -2276,6 +2313,10 @@ let LOCProperty;
2276
2313
  return header instanceof VideoConfig;
2277
2314
  }
2278
2315
  _LOCProperty.isVideoConfig = isVideoConfig;
2316
+ function isAudioConfig(header) {
2317
+ return header instanceof AudioConfig;
2318
+ }
2319
+ _LOCProperty.isAudioConfig = isAudioConfig;
2279
2320
  })(LOCProperty || (LOCProperty = {}));
2280
2321
  var LOCProperties = class {
2281
2322
  kvps = [];
@@ -2287,8 +2328,9 @@ var LOCProperties = class {
2287
2328
  this.kvps.push(new Timescale(BigInt(timescale)).toKeyValuePair());
2288
2329
  return this;
2289
2330
  }
2290
- addVideoFrameMarking(marking) {
2291
- this.kvps.push(new VideoFrameMarking(BigInt(marking)).toKeyValuePair());
2331
+ /** Marks a whole, non-scalable frame (RFC 9626 short form): S and E set, I set on a keyframe. */
2332
+ addVideoFrameMarking(isKey) {
2333
+ this.kvps.push(new VideoFrameMarking(new Uint8Array([isKey ? 224 : 192])).toKeyValuePair());
2292
2334
  return this;
2293
2335
  }
2294
2336
  addAudioLevel(audioLevel) {
@@ -2299,6 +2341,10 @@ var LOCProperties = class {
2299
2341
  this.kvps.push(new VideoConfig(config).toKeyValuePair());
2300
2342
  return this;
2301
2343
  }
2344
+ addAudioConfig(config) {
2345
+ this.kvps.push(new AudioConfig(config).toKeyValuePair());
2346
+ return this;
2347
+ }
2302
2348
  addRaw(pair) {
2303
2349
  this.kvps.push(pair);
2304
2350
  return this;
@@ -2315,8 +2361,7 @@ var LOCProperties = class {
2315
2361
  return result;
2316
2362
  }
2317
2363
  };
2318
- //#endregion
2319
- //#region src/model/common/grease.ts
2364
+ // src/model/common/grease.ts
2320
2365
  /**
2321
2366
  * Copyright 2026 The MOQtail Authors
2322
2367
  *
@@ -2362,8 +2407,7 @@ function greaseValue(n) {
2362
2407
  const value = GREASE_STEP * BigInt(n) + GREASE_BASE;
2363
2408
  return value > GREASE_MAX ? void 0 : value;
2364
2409
  }
2365
- //#endregion
2366
- //#region src/model/property/track_property.ts
2410
+ // src/model/property/track_property.ts
2367
2411
  /**
2368
2412
  * Copyright 2026 The MOQtail Authors
2369
2413
  *
@@ -2543,8 +2587,7 @@ let TrackProperty;
2543
2587
  }
2544
2588
  _TrackProperty.isUnknown = isUnknown;
2545
2589
  })(TrackProperty || (TrackProperty = {}));
2546
- //#endregion
2547
- //#region src/model/property/object_property.ts
2590
+ // src/model/property/object_property.ts
2548
2591
  /**
2549
2592
  * Copyright 2026 The MOQtail Authors
2550
2593
  *
@@ -2648,8 +2691,41 @@ let ObjectProperty;
2648
2691
  }
2649
2692
  _ObjectProperty.isUnknown = isUnknown;
2650
2693
  })(ObjectProperty || (ObjectProperty = {}));
2651
- //#endregion
2652
- //#region src/model/data/subgroup_object.ts
2694
+ // src/model/property/find.ts
2695
+ /**
2696
+ * Copyright 2026 The MOQtail Authors
2697
+ *
2698
+ * Licensed under the Apache License, Version 2.0 (the "License");
2699
+ * you may not use this file except in compliance with the License.
2700
+ * You may obtain a copy of the License at
2701
+ *
2702
+ * http://www.apache.org/licenses/LICENSE-2.0
2703
+ *
2704
+ * Unless required by applicable law or agreed to in writing, software
2705
+ * distributed under the License is distributed on an "AS IS" BASIS,
2706
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2707
+ * See the License for the specific language governing permissions and
2708
+ * limitations under the License.
2709
+ */
2710
+ /**
2711
+ * @public
2712
+ * Finds the first property of `reader`'s type in a track or object property list and
2713
+ * returns it typed, or `undefined`. Unknown properties keep their raw key-value pair, so
2714
+ * a type the model doesn't know is still found.
2715
+ *
2716
+ * @example
2717
+ * ```ts
2718
+ * const timeout = findProperty(subscribeOk.trackProperties, ObjectDeliveryTimeoutProperty)
2719
+ * ```
2720
+ */
2721
+ function findProperty(properties, reader) {
2722
+ const type = BigInt(reader.TYPE);
2723
+ for (const property of properties ?? []) {
2724
+ const pair = property instanceof KeyValuePair ? property : property.toKeyValuePair();
2725
+ if (pair.typeValue === type) return reader.fromKeyValuePair(pair);
2726
+ }
2727
+ }
2728
+ // src/model/data/subgroup_object.ts
2653
2729
  /**
2654
2730
  * Copyright 2025 The MOQtail Authors
2655
2731
  *
@@ -2714,8 +2790,7 @@ var SubgroupObject = class SubgroupObject {
2714
2790
  return new SubgroupObject(objectId, normalizeProperties(properties), objectStatus, payload);
2715
2791
  }
2716
2792
  };
2717
- //#endregion
2718
- //#region src/model/data/object.ts
2793
+ // src/model/data/object.ts
2719
2794
  var MoqtObject = class MoqtObject {
2720
2795
  fullTrackName;
2721
2796
  publisherPriority;
@@ -2835,8 +2910,7 @@ var MoqtObject = class MoqtObject {
2835
2910
  else return SubgroupObject.newWithStatus(this.location.object, this.properties, this.objectStatus);
2836
2911
  }
2837
2912
  };
2838
- //#endregion
2839
- //#region src/model/data/subgroup_header.ts
2913
+ // src/model/data/subgroup_header.ts
2840
2914
  /**
2841
2915
  * Copyright 2025 The MOQtail Authors
2842
2916
  *
@@ -2907,8 +2981,7 @@ var SubgroupHeader = class SubgroupHeader {
2907
2981
  if (this.subgroupId === void 0 && SubgroupHeaderType.isSubgroupIdFirstObjectId(this.type)) this.subgroupId = firstObjectId;
2908
2982
  }
2909
2983
  };
2910
- //#endregion
2911
- //#region src/model/data/request_id.ts
2984
+ // src/model/data/request_id.ts
2912
2985
  /**
2913
2986
  * Copyright 2025 The MOQtail Authors
2914
2987
  *
@@ -3026,8 +3099,7 @@ var RequestIdMap = class {
3026
3099
  return this.nameToRequestId.has(name);
3027
3100
  }
3028
3101
  };
3029
- //#endregion
3030
- //#region src/model/data/header.ts
3102
+ // src/model/data/header.ts
3031
3103
  /**
3032
3104
  * Copyright 2025 The MOQtail Authors
3033
3105
  *
@@ -3075,8 +3147,7 @@ let Header;
3075
3147
  }
3076
3148
  _Header.deserialize = deserialize;
3077
3149
  })(Header || (Header = {}));
3078
- //#endregion
3079
- //#region src/model/common/byte_buffer.ts
3150
+ // src/model/common/byte_buffer.ts
3080
3151
  /**
3081
3152
  * Copyright 2025 The MOQtail Authors
3082
3153
  *
@@ -3319,8 +3390,7 @@ var FrozenByteBuffer = class extends BaseByteBuffer {
3319
3390
  return this.buf.length;
3320
3391
  }
3321
3392
  };
3322
- //#endregion
3323
- //#region src/model/control/publish_skipped.ts
3393
+ // src/model/control/publish_skipped.ts
3324
3394
  /**
3325
3395
  * Copyright 2026 The MOQtail Authors
3326
3396
  *
@@ -3372,8 +3442,7 @@ var PublishSkipped = class PublishSkipped {
3372
3442
  return new PublishSkipped(trackNamespaceSuffix, trackName);
3373
3443
  }
3374
3444
  };
3375
- //#endregion
3376
- //#region src/model/parameter/constant.ts
3445
+ // src/model/parameter/constant.ts
3377
3446
  /**
3378
3447
  * Copyright 2026 The MOQtail Authors
3379
3448
  *
@@ -3497,8 +3566,7 @@ function tokenAliasTypeFromNumber(value) {
3497
3566
  default: throw new InvalidTypeError("tokenAliasTypeFromNumber", `Invalid token alias type: ${value}`);
3498
3567
  }
3499
3568
  }
3500
- //#endregion
3501
- //#region src/model/common/moqt_url.ts
3569
+ // src/model/common/moqt_url.ts
3502
3570
  /**
3503
3571
  * Copyright 2026 The MOQtail Authors
3504
3572
  *
@@ -3514,6 +3582,8 @@ function tokenAliasTypeFromNumber(value) {
3514
3582
  * See the License for the specific language governing permissions and
3515
3583
  * limitations under the License.
3516
3584
  */
3585
+ /** URI schemes are case-insensitive (RFC 3986 §3.1, MSF 11.1). */
3586
+ const MOQT_SCHEME = /^moqt:\/\//i;
3517
3587
  /**
3518
3588
  * @public
3519
3589
  * A parsed `moqt://authority/path[?query][#fragment]` URI.
@@ -3537,7 +3607,7 @@ var MoqtUrl = class MoqtUrl {
3537
3607
  this.fragment = fragment;
3538
3608
  }
3539
3609
  static parse(input) {
3540
- if (!input.startsWith("moqt://")) throw new ProtocolViolationError("MoqtUrl.parse", `URL must use the moqt:// scheme: ${input}`);
3610
+ if (!MOQT_SCHEME.test(input)) throw new ProtocolViolationError("MoqtUrl.parse", `URL must use the moqt:// scheme: ${input}`);
3541
3611
  let rest = input.slice(7);
3542
3612
  let fragment;
3543
3613
  const hashIdx = rest.indexOf("#");
@@ -3593,7 +3663,7 @@ function parseFragment(fragment) {
3593
3663
  */
3594
3664
  function resolveTransportUrl(url) {
3595
3665
  const raw = typeof url === "string" ? url : url.toString();
3596
- if (!raw.startsWith("moqt://")) return {
3666
+ if (!MOQT_SCHEME.test(raw)) return {
3597
3667
  transportUrl: raw,
3598
3668
  moqtUrl: void 0
3599
3669
  };
@@ -3603,8 +3673,7 @@ function resolveTransportUrl(url) {
3603
3673
  moqtUrl
3604
3674
  };
3605
3675
  }
3606
- //#endregion
3607
- //#region src/model/common/redirect.ts
3676
+ // src/model/common/redirect.ts
3608
3677
  /**
3609
3678
  * Copyright 2026 The MOQtail Authors
3610
3679
  *
@@ -3655,8 +3724,7 @@ var Redirect = class Redirect {
3655
3724
  return new Redirect(connectUri, trackNamespace, trackName);
3656
3725
  }
3657
3726
  };
3658
- //#endregion
3659
- //#region src/model/parameter/common/authorization_token.ts
3727
+ // src/model/parameter/common/authorization_token.ts
3660
3728
  /**
3661
3729
  * Copyright 2026 The MOQtail Authors
3662
3730
  *
@@ -3723,7 +3791,6 @@ var AuthorizationToken = class AuthorizationToken {
3723
3791
  case 3:
3724
3792
  payload.putVI(this.variant.tokenType);
3725
3793
  payload.putBytes(this.variant.tokenValue);
3726
- break;
3727
3794
  }
3728
3795
  return KeyValuePair.tryNewBytes(AuthorizationToken.TYPE, payload.toUint8Array());
3729
3796
  }
@@ -3769,8 +3836,7 @@ var AuthorizationToken = class AuthorizationToken {
3769
3836
  }
3770
3837
  }
3771
3838
  };
3772
- //#endregion
3773
- //#region src/model/parameter/message/fill_timeout.ts
3839
+ // src/model/parameter/message/fill_timeout.ts
3774
3840
  /**
3775
3841
  * Copyright 2026 The MOQtail Authors
3776
3842
  *
@@ -3804,8 +3870,7 @@ var FillTimeout = class FillTimeout {
3804
3870
  return new FillTimeout(pair.value);
3805
3871
  }
3806
3872
  };
3807
- //#endregion
3808
- //#region src/model/parameter/message/object_delivery_timeout.ts
3873
+ // src/model/parameter/message/object_delivery_timeout.ts
3809
3874
  /**
3810
3875
  * Copyright 2026 The MOQtail Authors
3811
3876
  *
@@ -3841,8 +3906,7 @@ var ObjectDeliveryTimeout = class ObjectDeliveryTimeout {
3841
3906
  return new ObjectDeliveryTimeout(pair.value);
3842
3907
  }
3843
3908
  };
3844
- //#endregion
3845
- //#region src/model/parameter/message/rendezvous_timeout.ts
3909
+ // src/model/parameter/message/rendezvous_timeout.ts
3846
3910
  /**
3847
3911
  * Copyright 2026 The MOQtail Authors
3848
3912
  *
@@ -3876,8 +3940,7 @@ var RendezvousTimeout = class RendezvousTimeout {
3876
3940
  return new RendezvousTimeout(pair.value);
3877
3941
  }
3878
3942
  };
3879
- //#endregion
3880
- //#region src/model/parameter/message/subgroup_delivery_timeout.ts
3943
+ // src/model/parameter/message/subgroup_delivery_timeout.ts
3881
3944
  /**
3882
3945
  * Copyright 2026 The MOQtail Authors
3883
3946
  *
@@ -3911,8 +3974,7 @@ var SubgroupDeliveryTimeout = class SubgroupDeliveryTimeout {
3911
3974
  return new SubgroupDeliveryTimeout(pair.value);
3912
3975
  }
3913
3976
  };
3914
- //#endregion
3915
- //#region src/model/parameter/message/expires.ts
3977
+ // src/model/parameter/message/expires.ts
3916
3978
  /**
3917
3979
  * Copyright 2026 The MOQtail Authors
3918
3980
  *
@@ -3947,8 +4009,7 @@ var Expires = class Expires {
3947
4009
  return new Expires(pair.value);
3948
4010
  }
3949
4011
  };
3950
- //#endregion
3951
- //#region src/model/parameter/message/forward.ts
4012
+ // src/model/parameter/message/forward.ts
3952
4013
  /**
3953
4014
  * Copyright 2026 The MOQtail Authors
3954
4015
  *
@@ -3985,8 +4046,7 @@ var Forward = class Forward {
3985
4046
  return new Forward(pair.value === 1n);
3986
4047
  }
3987
4048
  };
3988
- //#endregion
3989
- //#region src/model/parameter/message/include_properties.ts
4049
+ // src/model/parameter/message/include_properties.ts
3990
4050
  /**
3991
4051
  * Copyright 2026 The MOQtail Authors
3992
4052
  *
@@ -4024,8 +4084,7 @@ var IncludeProperties = class IncludeProperties {
4024
4084
  return new IncludeProperties(pair.value === 1n);
4025
4085
  }
4026
4086
  };
4027
- //#endregion
4028
- //#region src/model/parameter/message/group_order_param.ts
4087
+ // src/model/parameter/message/group_order_param.ts
4029
4088
  /**
4030
4089
  * Copyright 2026 The MOQtail Authors
4031
4090
  *
@@ -4062,8 +4121,7 @@ var GroupOrderParam = class GroupOrderParam {
4062
4121
  return new GroupOrderParam(Number(pair.value));
4063
4122
  }
4064
4123
  };
4065
- //#endregion
4066
- //#region src/model/parameter/message/largest_object.ts
4124
+ // src/model/parameter/message/largest_object.ts
4067
4125
  /**
4068
4126
  * Copyright 2026 The MOQtail Authors
4069
4127
  *
@@ -4104,8 +4162,7 @@ var LargestObject = class LargestObject {
4104
4162
  return new LargestObject(location);
4105
4163
  }
4106
4164
  };
4107
- //#endregion
4108
- //#region src/model/parameter/message/new_group_request.ts
4165
+ // src/model/parameter/message/new_group_request.ts
4109
4166
  /**
4110
4167
  * Copyright 2026 The MOQtail Authors
4111
4168
  *
@@ -4140,8 +4197,7 @@ var NewGroupRequest = class NewGroupRequest {
4140
4197
  return new NewGroupRequest(pair.value);
4141
4198
  }
4142
4199
  };
4143
- //#endregion
4144
- //#region src/model/parameter/message/switching_set_assignment.ts
4200
+ // src/model/parameter/message/switching_set_assignment.ts
4145
4201
  /**
4146
4202
  * Copyright 2026 The MOQtail Authors
4147
4203
  *
@@ -4208,8 +4264,7 @@ var SwitchingSetAssignment = class SwitchingSetAssignment {
4208
4264
  return new SwitchingSetAssignment(switchingSetId, algorithmId, throughputThresholdKbps, setThroughputWeight, activateSwitching, setRank);
4209
4265
  }
4210
4266
  };
4211
- //#endregion
4212
- //#region src/model/parameter/message/subscriber_priority.ts
4267
+ // src/model/parameter/message/subscriber_priority.ts
4213
4268
  /**
4214
4269
  * Copyright 2026 The MOQtail Authors
4215
4270
  *
@@ -4246,8 +4301,7 @@ var SubscriberPriority = class SubscriberPriority {
4246
4301
  return new SubscriberPriority(Number(pair.value));
4247
4302
  }
4248
4303
  };
4249
- //#endregion
4250
- //#region src/model/parameter/message/location_filter.ts
4304
+ // src/model/parameter/message/location_filter.ts
4251
4305
  /**
4252
4306
  * Copyright 2026 The MOQtail Authors
4253
4307
  *
@@ -4421,8 +4475,7 @@ var LocationFilter = class LocationFilter {
4421
4475
  return filter;
4422
4476
  }
4423
4477
  };
4424
- //#endregion
4425
- //#region src/model/parameter/message/switch_from.ts
4478
+ // src/model/parameter/message/switch_from.ts
4426
4479
  /**
4427
4480
  * Copyright 2026 The MOQtail Authors
4428
4481
  *
@@ -4473,8 +4526,7 @@ var SwitchFrom = class SwitchFrom {
4473
4526
  return new SwitchFrom(requestId, Number(modeValue), (flags & 128) !== 0);
4474
4527
  }
4475
4528
  };
4476
- //#endregion
4477
- //#region src/model/parameter/message/fill_parameters.ts
4529
+ // src/model/parameter/message/fill_parameters.ts
4478
4530
  /**
4479
4531
  * Copyright 2026 The MOQtail Authors
4480
4532
  *
@@ -4532,8 +4584,7 @@ var FillParameters = class FillParameters {
4532
4584
  return new FillParameters(MessageParameters.fromKeyValuePairs(pairs));
4533
4585
  }
4534
4586
  };
4535
- //#endregion
4536
- //#region src/model/parameter/message/range_filter.ts
4587
+ // src/model/parameter/message/range_filter.ts
4537
4588
  /**
4538
4589
  * Copyright 2026 The MOQtail Authors
4539
4590
  *
@@ -4725,8 +4776,7 @@ var RangeFilter = class RangeFilter {
4725
4776
  return new RangeFilter(kind, setId, propertyType, deltas);
4726
4777
  }
4727
4778
  };
4728
- //#endregion
4729
- //#region src/model/parameter/message_parameter.ts
4779
+ // src/model/parameter/message_parameter.ts
4730
4780
  /**
4731
4781
  * Copyright 2026 The MOQtail Authors
4732
4782
  *
@@ -4949,9 +4999,7 @@ function serializeMessageParameterKvps(items) {
4949
4999
  case 4:
4950
5000
  if (isBytes(kvp)) buf.putLengthPrefixedBytes(kvp.value);
4951
5001
  break;
4952
- case 0:
4953
- if (isVarInt(kvp)) buf.putVI(kvp.value);
4954
- break;
5002
+ case 0: if (isVarInt(kvp)) buf.putVI(kvp.value);
4955
5003
  }
4956
5004
  prevType = kvp.typeValue;
4957
5005
  }
@@ -4988,9 +5036,7 @@ function readMessageParameterKvps(buf, more) {
4988
5036
  case 4:
4989
5037
  items.push(KeyValuePair.deserializeBytesValue(buf, typeValue));
4990
5038
  break;
4991
- case 0:
4992
- items.push(KeyValuePair.tryNewVarInt(typeValue, buf.getVI()));
4993
- break;
5039
+ case 0: items.push(KeyValuePair.tryNewVarInt(typeValue, buf.getVI()));
4994
5040
  }
4995
5041
  prevType = typeValue;
4996
5042
  }
@@ -5011,8 +5057,7 @@ function applyMessageParameterUpdate(current, updates) {
5011
5057
  const kept = current.filter((p) => !updated.has(typeOf(p)));
5012
5058
  current.splice(0, current.length, ...kept, ...updates.filter((u) => !(u instanceof RangeFilter && u.isRemoval)));
5013
5059
  }
5014
- //#endregion
5015
- //#region src/model/control/publish_namespace.ts
5060
+ // src/model/control/publish_namespace.ts
5016
5061
  /**
5017
5062
  * Copyright 2025 The MOQtail Authors
5018
5063
  *
@@ -5096,8 +5141,7 @@ var PublishNamespace = class PublishNamespace {
5096
5141
  return new PublishNamespace(requestId, trackNamespace, parameters);
5097
5142
  }
5098
5143
  };
5099
- //#endregion
5100
- //#region src/model/control/namespace.ts
5144
+ // src/model/control/namespace.ts
5101
5145
  /**
5102
5146
  * Copyright 2025 The MOQtail Authors
5103
5147
  *
@@ -5142,8 +5186,7 @@ var Namespace = class Namespace {
5142
5186
  return new Namespace(trackNamespaceSuffix);
5143
5187
  }
5144
5188
  };
5145
- //#endregion
5146
- //#region src/model/control/namespace_done.ts
5189
+ // src/model/control/namespace_done.ts
5147
5190
  /**
5148
5191
  * Copyright 2025 The MOQtail Authors
5149
5192
  *
@@ -5188,8 +5231,7 @@ var NamespaceDone = class NamespaceDone {
5188
5231
  return new NamespaceDone(trackNamespaceSuffix);
5189
5232
  }
5190
5233
  };
5191
- //#endregion
5192
- //#region src/model/control/setup.ts
5234
+ // src/model/control/setup.ts
5193
5235
  /**
5194
5236
  * Copyright 2026 The MOQtail Authors
5195
5237
  *
@@ -5238,8 +5280,7 @@ var Setup = class Setup {
5238
5280
  return new Setup(setupOptions);
5239
5281
  }
5240
5282
  };
5241
- //#endregion
5242
- //#region src/model/control/fetch.ts
5283
+ // src/model/control/fetch.ts
5243
5284
  /**
5244
5285
  * Copyright 2025 The MOQtail Authors
5245
5286
  *
@@ -5296,8 +5337,7 @@ var Fetch = class Fetch {
5296
5337
  return new Fetch(requestId, fullTrackName, parameters);
5297
5338
  }
5298
5339
  };
5299
- //#endregion
5300
- //#region src/model/control/fetch_ok.ts
5340
+ // src/model/control/fetch_ok.ts
5301
5341
  /**
5302
5342
  * Copyright 2025 The MOQtail Authors
5303
5343
  *
@@ -5361,8 +5401,7 @@ var FetchOk = class FetchOk {
5361
5401
  return new FetchOk(endOfTrack, endLocation, parameters, trackProperties);
5362
5402
  }
5363
5403
  };
5364
- //#endregion
5365
- //#region src/model/control/goaway.ts
5404
+ // src/model/control/goaway.ts
5366
5405
  /**
5367
5406
  * Copyright 2025 The MOQtail Authors
5368
5407
  *
@@ -5437,8 +5476,7 @@ var GoAway = class GoAway {
5437
5476
  return new GoAway(newSessionUri, timeout);
5438
5477
  }
5439
5478
  };
5440
- //#endregion
5441
- //#region src/model/control/subscribe.ts
5479
+ // src/model/control/subscribe.ts
5442
5480
  /**
5443
5481
  * Copyright 2025 The MOQtail Authors
5444
5482
  *
@@ -5491,8 +5529,7 @@ var Subscribe = class Subscribe {
5491
5529
  return new Subscribe(requestId, fullTrackName, parameters);
5492
5530
  }
5493
5531
  };
5494
- //#endregion
5495
- //#region src/model/control/publish_done.ts
5532
+ // src/model/control/publish_done.ts
5496
5533
  /**
5497
5534
  * Copyright 2025 The MOQtail Authors
5498
5535
  *
@@ -5548,8 +5585,7 @@ var PublishDone = class PublishDone {
5548
5585
  return new PublishDone(statusCode, streamCount, errorReason);
5549
5586
  }
5550
5587
  };
5551
- //#endregion
5552
- //#region src/model/control/publish.ts
5588
+ // src/model/control/publish.ts
5553
5589
  /**
5554
5590
  * Copyright 2025 The MOQtail Authors
5555
5591
  *
@@ -5607,8 +5643,7 @@ var Publish = class Publish {
5607
5643
  return new Publish(requestId, fullTrackName, trackAlias, parameters, trackProperties);
5608
5644
  }
5609
5645
  };
5610
- //#endregion
5611
- //#region src/model/control/subscribe_ok.ts
5646
+ // src/model/control/subscribe_ok.ts
5612
5647
  /**
5613
5648
  * Copyright 2025 The MOQtail Authors
5614
5649
  *
@@ -5666,8 +5701,7 @@ var SubscribeOk = class SubscribeOk {
5666
5701
  return new SubscribeOk(trackAlias, parameters, trackProperties);
5667
5702
  }
5668
5703
  };
5669
- //#endregion
5670
- //#region src/model/control/request_update.ts
5704
+ // src/model/control/request_update.ts
5671
5705
  /**
5672
5706
  * Copyright 2025 The MOQtail Authors
5673
5707
  *
@@ -5731,8 +5765,7 @@ var RequestUpdate = class RequestUpdate {
5731
5765
  return true;
5732
5766
  }
5733
5767
  };
5734
- //#endregion
5735
- //#region src/model/control/track_status.ts
5768
+ // src/model/control/track_status.ts
5736
5769
  /**
5737
5770
  * Copyright 2025 The MOQtail Authors
5738
5771
  *
@@ -5801,8 +5834,7 @@ var TrackStatus = class TrackStatus {
5801
5834
  return new TrackStatus(requestId, trackAlias, fullTrackName, subscriberPriority, groupOrder, forward, locationFilter, subscribeParameters);
5802
5835
  }
5803
5836
  };
5804
- //#endregion
5805
- //#region src/model/control/subscribe_namespace.ts
5837
+ // src/model/control/subscribe_namespace.ts
5806
5838
  /**
5807
5839
  * Copyright 2025 The MOQtail Authors
5808
5840
  *
@@ -5852,8 +5884,7 @@ var SubscribeNamespace = class SubscribeNamespace {
5852
5884
  return new SubscribeNamespace(requestId, trackNamespacePrefix, parameters);
5853
5885
  }
5854
5886
  };
5855
- //#endregion
5856
- //#region src/model/control/subscribe_tracks.ts
5887
+ // src/model/control/subscribe_tracks.ts
5857
5888
  /**
5858
5889
  * Copyright 2026 The MOQtail Authors
5859
5890
  *
@@ -5910,8 +5941,7 @@ var SubscribeTracks = class SubscribeTracks {
5910
5941
  return new SubscribeTracks(requestId, trackNamespacePrefix, parameters);
5911
5942
  }
5912
5943
  };
5913
- //#endregion
5914
- //#region src/model/control/request_ok.ts
5944
+ // src/model/control/request_ok.ts
5915
5945
  /**
5916
5946
  * Copyright 2026 The MOQtail Authors
5917
5947
  *
@@ -5994,8 +6024,7 @@ var RequestOk = class RequestOk {
5994
6024
  return new RequestOk(parameters, trackProperties);
5995
6025
  }
5996
6026
  };
5997
- //#endregion
5998
- //#region src/model/control/request_error.ts
6027
+ // src/model/control/request_error.ts
5999
6028
  /**
6000
6029
  * Copyright 2025 The MOQtail Authors
6001
6030
  *
@@ -6057,8 +6086,7 @@ var RequestError = class RequestError {
6057
6086
  return new RequestError(errorCode, retryInterval, reasonPhrase, redirect);
6058
6087
  }
6059
6088
  };
6060
- //#endregion
6061
- //#region src/model/control/control_message.ts
6089
+ // src/model/control/control_message.ts
6062
6090
  /**
6063
6091
  * Copyright 2025 The MOQtail Authors
6064
6092
  *
@@ -6111,176 +6139,7 @@ let ControlMessage;
6111
6139
  }
6112
6140
  _ControlMessage.serialize = serialize;
6113
6141
  })(ControlMessage || (ControlMessage = {}));
6114
- //#endregion
6115
- //#region src/model/catalog/cmsf.ts
6116
- function isString(v) {
6117
- return typeof v === "string";
6118
- }
6119
- function isNumber(v) {
6120
- return typeof v === "number";
6121
- }
6122
- function isStringArray(v) {
6123
- return Array.isArray(v) && v.every((item) => isString(item));
6124
- }
6125
- function isValidPackaging(v) {
6126
- return v === "cmaf" || v === "chunk-per-object" || v === "timeline";
6127
- }
6128
- function isValidRole(v) {
6129
- return v === "video" || v === "audio" || v === "timeline";
6130
- }
6131
- function isValidBase64(str) {
6132
- try {
6133
- return btoa(atob(str)) === str;
6134
- } catch {
6135
- return false;
6136
- }
6137
- }
6138
- function validateTrack(track) {
6139
- if (typeof track !== "object" || track === null) throw new Error("Track must be an object");
6140
- const t = track;
6141
- if (!isString(t["name"])) throw new Error("Track.name must be a string");
6142
- if (!isValidPackaging(t["packaging"])) throw new Error("Track.packaging must be 'cmaf', 'chunk-per-object', or 'timeline'");
6143
- if (!isValidRole(t["role"])) throw new Error("Track.role must be 'video', 'audio', or 'timeline'");
6144
- const name = t["name"];
6145
- const packaging = t["packaging"];
6146
- const role = t["role"];
6147
- let codec;
6148
- if (t["codec"] !== void 0) {
6149
- if (!isString(t["codec"])) throw new Error("Track.codec must be a string");
6150
- codec = t["codec"];
6151
- }
6152
- let depends;
6153
- if (t["depends"] !== void 0) {
6154
- if (!isStringArray(t["depends"])) throw new Error("Track.depends must be an array of strings");
6155
- depends = t["depends"];
6156
- }
6157
- let mimeType;
6158
- if (t["mimeType"] !== void 0) {
6159
- if (!isString(t["mimeType"])) throw new Error("Track.mimeType must be a string");
6160
- mimeType = t["mimeType"];
6161
- }
6162
- let width;
6163
- if (t["width"] !== void 0) {
6164
- if (!isNumber(t["width"])) throw new Error("Track.width must be a number");
6165
- width = t["width"];
6166
- }
6167
- let height;
6168
- if (t["height"] !== void 0) {
6169
- if (!isNumber(t["height"])) throw new Error("Track.height must be a number");
6170
- height = t["height"];
6171
- }
6172
- let timescale;
6173
- if (t["timescale"] !== void 0) {
6174
- if (!isNumber(t["timescale"])) throw new Error("Track.timescale must be a number");
6175
- timescale = t["timescale"];
6176
- }
6177
- let bitrate;
6178
- if (t["bitrate"] !== void 0) {
6179
- if (!isNumber(t["bitrate"])) throw new Error("Track.bitrate must be a number");
6180
- bitrate = t["bitrate"];
6181
- }
6182
- let initData;
6183
- if (t["initData"] !== void 0) {
6184
- if (!isString(t["initData"])) throw new Error("Track.initData must be a string");
6185
- if (!isValidBase64(t["initData"])) throw new Error("Track.initData must be a valid base64 string");
6186
- initData = t["initData"];
6187
- }
6188
- if (packaging === "cmaf" && (!codec || codec.length === 0)) throw new Error("codec is required when packaging is 'cmaf'");
6189
- if (packaging === "timeline" && mimeType !== "text/csv") throw new Error("mimeType must be 'text/csv' when packaging is 'timeline'");
6190
- if (packaging === "timeline" && (!depends || depends.length === 0)) throw new Error("At least one dependee must be present when packaging is 'timeline'");
6191
- const result = {
6192
- name,
6193
- packaging,
6194
- role
6195
- };
6196
- if (codec !== void 0) result.codec = codec;
6197
- if (depends !== void 0) result.depends = depends;
6198
- if (mimeType !== void 0) result.mimeType = mimeType;
6199
- if (width !== void 0) result.width = width;
6200
- if (height !== void 0) result.height = height;
6201
- if (timescale !== void 0) result.timescale = timescale;
6202
- if (bitrate !== void 0) result.bitrate = bitrate;
6203
- if (initData !== void 0) result.initData = initData;
6204
- return result;
6205
- }
6206
- function validateCMSF(obj) {
6207
- if (typeof obj !== "object" || obj === null) throw new Error("CMSF must be an object");
6208
- const o = obj;
6209
- if (!isString(o["version"])) throw new Error("CMSF.version must be a string");
6210
- if (!Array.isArray(o["tracks"])) throw new Error("CMSF.tracks must be an array");
6211
- return {
6212
- version: o["version"],
6213
- tracks: o["tracks"].map(validateTrack)
6214
- };
6215
- }
6216
- var CMSFCatalog = class CMSFCatalog {
6217
- #catalog;
6218
- constructor(catalog) {
6219
- this.#catalog = catalog;
6220
- }
6221
- static from(payload) {
6222
- const json = new TextDecoder().decode(payload);
6223
- const catalog = validateCMSF(JSON.parse(json));
6224
- return new CMSFCatalog(catalog);
6225
- }
6226
- getByTrackName(trackName) {
6227
- return this.#catalog.tracks.find((track) => track.name === this.extractTrackName(trackName));
6228
- }
6229
- getTracks(role) {
6230
- if (role) return this.#catalog.tracks.filter((track) => track.role === role);
6231
- return this.#catalog.tracks;
6232
- }
6233
- getVideo(index = 0) {
6234
- const videos = this.#catalog.tracks.filter((track) => track.role === "video");
6235
- if (index < 0 || index >= videos.length) return void 0;
6236
- return videos[index];
6237
- }
6238
- getAudio(index = 0) {
6239
- const audios = this.#catalog.tracks.filter((track) => track.role === "audio");
6240
- if (index < 0 || index >= audios.length) return void 0;
6241
- return audios[index];
6242
- }
6243
- getTimeline(index = 0) {
6244
- const timelines = this.#catalog.tracks.filter((track) => track.role === "timeline");
6245
- if (index < 0 || index >= timelines.length) return void 0;
6246
- return timelines[index];
6247
- }
6248
- getCodecString(trackName) {
6249
- const track = this.#catalog.tracks.find((track) => track.name === this.extractTrackName(trackName));
6250
- if (!track) return void 0;
6251
- if (!track.codec) throw new Error(`Track ${trackName} does not have a codec`);
6252
- return track.codec;
6253
- }
6254
- getRole(trackName) {
6255
- const track = this.#catalog.tracks.find((track) => track.name === this.extractTrackName(trackName));
6256
- if (!track) return void 0;
6257
- return track.role;
6258
- }
6259
- getPackaging(trackName) {
6260
- const track = this.#catalog.tracks.find((track) => track.name === this.extractTrackName(trackName));
6261
- if (!track) return void 0;
6262
- return track.packaging;
6263
- }
6264
- isCMAF(trackName) {
6265
- const packaging = this.getPackaging(trackName);
6266
- return packaging === "cmaf" || packaging === "chunk-per-object";
6267
- }
6268
- getTimescale(trackName) {
6269
- return this.#catalog.tracks.find((track) => track.name === this.extractTrackName(trackName))?.timescale;
6270
- }
6271
- getInitData(trackName) {
6272
- const track = this.#catalog.tracks.find((track) => track.name === this.extractTrackName(trackName));
6273
- if (!track) return void 0;
6274
- if (!track.initData) throw new Error(`Track ${trackName} does not have initData`);
6275
- return new Uint8Array(atob(track.initData).split("").map((c) => c.charCodeAt(0)));
6276
- }
6277
- extractTrackName(input) {
6278
- const parts = input.split("/");
6279
- return parts[parts.length - 1];
6280
- }
6281
- };
6282
- //#endregion
6283
- //#region src/model/parameter/setup/path.ts
6142
+ // src/model/parameter/setup/path.ts
6284
6143
  /**
6285
6144
  * Copyright 2025 The MOQtail Authors
6286
6145
  *
@@ -6312,8 +6171,7 @@ var Path = class Path {
6312
6171
  return new Path(moqtPath);
6313
6172
  }
6314
6173
  };
6315
- //#endregion
6316
- //#region src/model/parameter/setup/max_auth_token_cache_size.ts
6174
+ // src/model/parameter/setup/max_auth_token_cache_size.ts
6317
6175
  /**
6318
6176
  * Copyright 2025 The MOQtail Authors
6319
6177
  *
@@ -6343,8 +6201,7 @@ var MaxAuthTokenCacheSize = class MaxAuthTokenCacheSize {
6343
6201
  return new MaxAuthTokenCacheSize(pair.value);
6344
6202
  }
6345
6203
  };
6346
- //#endregion
6347
- //#region src/model/parameter/setup/authority.ts
6204
+ // src/model/parameter/setup/authority.ts
6348
6205
  /**
6349
6206
  * Copyright 2026 The MOQtail Authors
6350
6207
  *
@@ -6366,7 +6223,7 @@ var MaxAuthTokenCacheSize = class MaxAuthTokenCacheSize {
6366
6223
  *
6367
6224
  * Client-only; MUST NOT be sent by a server or over WebTransport. moqtail-ts always
6368
6225
  * connects over WebTransport, so its own handshake never sends this — see
6369
- * `MOQtailClient.new`.
6226
+ * `MOQtailClient.init`.
6370
6227
  */
6371
6228
  var Authority = class Authority {
6372
6229
  authority;
@@ -6384,8 +6241,7 @@ var Authority = class Authority {
6384
6241
  return new Authority(authority);
6385
6242
  }
6386
6243
  };
6387
- //#endregion
6388
- //#region src/model/parameter/setup/max_filter_ranges.ts
6244
+ // src/model/parameter/setup/max_filter_ranges.ts
6389
6245
  /**
6390
6246
  * Copyright 2026 The MOQtail Authors
6391
6247
  *
@@ -6420,8 +6276,7 @@ var MaxFilterRanges = class MaxFilterRanges {
6420
6276
  return new MaxFilterRanges(pair.value);
6421
6277
  }
6422
6278
  };
6423
- //#endregion
6424
- //#region src/model/parameter/setup/moqt_implementation.ts
6279
+ // src/model/parameter/setup/moqt_implementation.ts
6425
6280
  /**
6426
6281
  * Copyright 2026 The MOQtail Authors
6427
6282
  *
@@ -6457,8 +6312,7 @@ var MoqtImplementation = class MoqtImplementation {
6457
6312
  return new MoqtImplementation(info);
6458
6313
  }
6459
6314
  };
6460
- //#endregion
6461
- //#region src/model/parameter/setup/max_request_updates.ts
6315
+ // src/model/parameter/setup/max_request_updates.ts
6462
6316
  /**
6463
6317
  * Copyright 2026 The MOQtail Authors
6464
6318
  *
@@ -6493,8 +6347,7 @@ var MaxRequestUpdates = class MaxRequestUpdates {
6493
6347
  return new MaxRequestUpdates(pair.value);
6494
6348
  }
6495
6349
  };
6496
- //#endregion
6497
- //#region src/model/parameter/setup/ssts_algorithms.ts
6350
+ // src/model/parameter/setup/ssts_algorithms.ts
6498
6351
  /**
6499
6352
  * Copyright 2026 The MOQtail Authors
6500
6353
  *
@@ -6538,8 +6391,7 @@ var SstsAlgorithms = class SstsAlgorithms {
6538
6391
  return new SstsAlgorithms(algorithms);
6539
6392
  }
6540
6393
  };
6541
- //#endregion
6542
- //#region src/model/parameter/setup_option.ts
6394
+ // src/model/parameter/setup_option.ts
6543
6395
  let SetupOption;
6544
6396
  (function(_SetupOption) {
6545
6397
  function fromKeyValuePair(pair) {
@@ -6633,8 +6485,7 @@ var SetupOptions = class {
6633
6485
  return result;
6634
6486
  }
6635
6487
  };
6636
- //#endregion
6637
- //#region src/model/parameter/message/combined_filter.ts
6488
+ // src/model/parameter/message/combined_filter.ts
6638
6489
  /**
6639
6490
  * Copyright 2026 The MOQtail Authors
6640
6491
  *
@@ -6697,9 +6548,7 @@ var CombinedFilter = class {
6697
6548
  case RangeFilterKind.Priority:
6698
6549
  set.priority = ranges;
6699
6550
  break;
6700
- case RangeFilterKind.ObjectProperty:
6701
- set.properties.set(filter.propertyType, ranges);
6702
- break;
6551
+ case RangeFilterKind.ObjectProperty: set.properties.set(filter.propertyType, ranges);
6703
6552
  }
6704
6553
  }
6705
6554
  this.rangeCount = rangeCount;
@@ -6752,5 +6601,4 @@ function propertiesPass(required, properties) {
6752
6601
  }
6753
6602
  return true;
6754
6603
  }
6755
- //#endregion
6756
- export { AudioLevel, Authority, AuthorizationToken, BaseByteBuffer, ByteBuffer, CMSFCatalog, CastingError, CombinedFilter, ControlMessage, ControlMessageType, DEFAULT_PUBLISHER_PRIORITY, Datagram, DefaultPublisherGroupOrderProperty, DefaultPublisherPriorityProperty, DynamicGroupsProperty, EndOfRangeKind, Expires, Fetch, FetchHeader, FetchHeaderType, FetchObject, FetchOk, FillParameters, FillTimeout, Forward, FrozenByteBuffer, FullTrackName, GREASE_BASE, GREASE_STEP, GoAway, GroupOrder, GroupOrderParam, Header, ImmutablePropertiesObjectProperty, ImmutablePropertiesTrackProperty, IncludeProperties, InternalError, InvalidEnumValue, InvalidFilterError, InvalidTypeError, InvalidUTF8Error, KeyValueFormattingError, KeyValuePair, LOCProperties, LOCProperty, LOCPropertyId, LargestObject, LengthExceedsMaxError, Location, LocationFilter, LocationFilterType, MAX_FULL_TRACK_NAME_LENGTH, MAX_NAMESPACE_TUPLE_COUNT, MAX_NEW_SESSION_URI_LENGTH, MAX_REASON_PHRASE_LEN, MOQtailError, MaxAuthTokenCacheSize, MaxCacheDurationProperty, MaxFilterRanges, MaxRequestUpdates, MessageParameter, MessageParameterType, MessageParameters, MoqtImplementation, MoqtObject, MoqtUrl, Namespace, NamespaceDone, NewGroupRequest, NotEnoughBytesError, ObjectDatagramType, ObjectDeliveryTimeout, ObjectDeliveryTimeoutProperty, ObjectForwardingPreference, ObjectProperty, ObjectStatus, Path, PriorGroupIdGapProperty, PriorObjectIdGapProperty, PropertyRanges, ProtocolViolationError, Publish, PublishDone, PublishDoneStatusCode, PublishNamespace, PublishSkipped, RangeFilter, RangeFilterKind, ReasonPhrase, Redirect, RendezvousTimeout, RequestError, RequestErrorCode, RequestIdError, RequestIdMap, RequestOk, RequestUpdate, SUPPORTED_VERSIONS, Setup, SetupOption, SetupOptionType, SetupOptions, SstsAlgorithms, StreamResetCode, SubgroupDeliveryTimeout, SubgroupDeliveryTimeoutProperty, SubgroupHeader, SubgroupHeaderType, SubgroupObject, Subscribe, SubscribeNamespace, SubscribeOk, SubscribeTracks, SubscriberPriority, SwitchFrom, SwitchMode, SwitchingSetAssignment, TerminationCode, TerminationError, TimeoutError, Timescale, Timestamp, TokenAliasType, TrackNameError, TrackProperty, TrackPropertyType, TrackStatus, TrackStatusCode, Tuple, TupleField, UnknownObjectProperty, UnknownTrackProperty, VarIntOverflowError, VideoConfig, VideoFrameMarking, applyMessageParameterUpdate, assertNoAuthorityOverWebTransport, deserializeKvpList, deserializeKvpListUntilEmpty, deserializeMessageParameterKvps, encodeRanges, greaseValue, isApplicationSpecificProperty, isBytes, isGrease, isVarInt, locPropertyIdFromNumber, messageParameterTypeFromNumber, resolveTransportUrl, serializeKvpList, serializeMessageParameterKvps, setupOptionTypeFromNumber, tokenAliasTypeFromNumber };
6604
+ export { AudioConfig, AudioLevel, Authority, AuthorizationToken, BaseByteBuffer, ByteBuffer, CastingError, CombinedFilter, ControlMessage, ControlMessageType, DEFAULT_PUBLISHER_PRIORITY, Datagram, DefaultPublisherGroupOrderProperty, DefaultPublisherPriorityProperty, DynamicGroupsProperty, EndOfRangeKind, Expires, Fetch, FetchHeader, FetchHeaderType, FetchObject, FetchOk, FillParameters, FillTimeout, Forward, FrozenByteBuffer, FullTrackName, GREASE_BASE, GREASE_STEP, GoAway, GroupOrder, GroupOrderParam, Header, ImmutablePropertiesObjectProperty, ImmutablePropertiesTrackProperty, IncludeProperties, InternalError, InvalidEnumValue, InvalidFilterError, InvalidTypeError, InvalidUTF8Error, KeyValueFormattingError, KeyValuePair, LOCProperties, LOCProperty, LOCPropertyId, LargestObject, LengthExceedsMaxError, Location, LocationFilter, LocationFilterType, MAX_FULL_TRACK_NAME_LENGTH, MAX_NAMESPACE_TUPLE_COUNT, MAX_NEW_SESSION_URI_LENGTH, MAX_REASON_PHRASE_LEN, MOQtailError, MaxAuthTokenCacheSize, MaxCacheDurationProperty, MaxFilterRanges, MaxRequestUpdates, MessageParameter, MessageParameterType, MessageParameters, MoqtImplementation, MoqtObject, MoqtUrl, Namespace, NamespaceDone, NewGroupRequest, NotEnoughBytesError, ObjectDatagramType, ObjectDeliveryTimeout, ObjectDeliveryTimeoutProperty, ObjectForwardingPreference, ObjectProperty, ObjectStatus, Path, PriorGroupIdGapProperty, PriorObjectIdGapProperty, PropertyRanges, ProtocolViolationError, Publish, PublishDone, PublishDoneStatusCode, PublishNamespace, PublishSkipped, RangeFilter, RangeFilterKind, ReasonPhrase, Redirect, RendezvousTimeout, RequestError, RequestErrorCode, RequestIdError, RequestIdMap, RequestOk, RequestUpdate, SUPPORTED_VERSIONS, Setup, SetupOption, SetupOptionType, SetupOptions, SstsAlgorithms, StreamResetCode, SubgroupDeliveryTimeout, SubgroupDeliveryTimeoutProperty, SubgroupHeader, SubgroupHeaderType, SubgroupObject, Subscribe, SubscribeNamespace, SubscribeOk, SubscribeTracks, SubscriberPriority, SwitchFrom, SwitchMode, SwitchingSetAssignment, TerminationCode, TerminationError, TimeoutError, Timescale, Timestamp, TokenAliasType, TrackNameError, TrackProperty, TrackPropertyType, TrackStatus, TrackStatusCode, Tuple, TupleField, UnknownObjectProperty, UnknownTrackProperty, VarIntOverflowError, VideoConfig, VideoFrameMarking, applyMessageParameterUpdate, assertNoAuthorityOverWebTransport, deserializeKvpList, deserializeKvpListUntilEmpty, deserializeMessageParameterKvps, encodeRanges, findProperty, greaseValue, isApplicationSpecificProperty, isBytes, isGrease, isVarInt, locPropertyIdFromNumber, messageParameterTypeFromNumber, resolveTransportUrl, serializeKvpList, serializeMessageParameterKvps, setupOptionTypeFromNumber, tokenAliasTypeFromNumber };