@blockcast/mmt-container 0.1.0 → 0.3.0-main.288475b64b3e

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 (800) hide show
  1. package/README.md +538 -0
  2. package/dist/.build-stamp +0 -0
  3. package/dist/__tests__/test-utils.d.ts +71 -0
  4. package/dist/__tests__/test-utils.d.ts.map +1 -0
  5. package/dist/align.d.ts +152 -0
  6. package/dist/align.d.ts.map +1 -0
  7. package/dist/align.js +88 -0
  8. package/dist/align.js.map +7 -0
  9. package/dist/audio-init-parser.d.ts +66 -0
  10. package/dist/audio-init-parser.d.ts.map +1 -0
  11. package/dist/audio-init-parser.js +118 -0
  12. package/dist/audio-init-parser.js.map +7 -0
  13. package/dist/audio-ring-buffer.d.ts +50 -0
  14. package/dist/audio-ring-buffer.d.ts.map +1 -0
  15. package/dist/audio-ring-buffer.js +80 -0
  16. package/dist/audio-ring-buffer.js.map +7 -0
  17. package/dist/authored-timing.d.ts +32 -0
  18. package/dist/authored-timing.d.ts.map +1 -0
  19. package/dist/authored-timing.js +32 -0
  20. package/dist/authored-timing.js.map +7 -0
  21. package/dist/block-policy.d.ts +314 -0
  22. package/dist/block-policy.d.ts.map +1 -0
  23. package/dist/block-policy.js +466 -0
  24. package/dist/block-policy.js.map +7 -0
  25. package/dist/browser-runtime.js +26457 -0
  26. package/dist/browser-runtime.js.map +7 -0
  27. package/dist/carp-catalog.d.ts +445 -0
  28. package/dist/carp-catalog.d.ts.map +1 -0
  29. package/dist/carp-catalog.js +998 -0
  30. package/dist/carp-catalog.js.map +7 -0
  31. package/dist/catalog-fec-params.d.ts +315 -0
  32. package/dist/catalog-fec-params.d.ts.map +1 -0
  33. package/dist/catalog-fec-params.js +730 -0
  34. package/dist/catalog-fec-params.js.map +7 -0
  35. package/dist/catalog-network-source.d.ts +42 -0
  36. package/dist/catalog-network-source.d.ts.map +1 -0
  37. package/dist/catalog-network-source.js +46 -0
  38. package/dist/catalog-network-source.js.map +7 -0
  39. package/dist/catalog-validator.d.ts +18 -0
  40. package/dist/catalog-validator.d.ts.map +1 -0
  41. package/dist/catalog-validator.js +7747 -0
  42. package/dist/catalog-validator.js.map +7 -0
  43. package/dist/cmaf-block-assembler.d.ts +285 -0
  44. package/dist/cmaf-block-assembler.d.ts.map +1 -0
  45. package/dist/cmaf-block-assembler.js +1966 -0
  46. package/dist/cmaf-block-assembler.js.map +7 -0
  47. package/dist/cmaf-group-batcher.d.ts +38 -0
  48. package/dist/cmaf-group-batcher.d.ts.map +1 -0
  49. package/dist/cmaf-group-batcher.js +176 -0
  50. package/dist/cmaf-group-batcher.js.map +7 -0
  51. package/dist/cmcd-producer.d.ts +104 -0
  52. package/dist/cmcd-producer.d.ts.map +1 -0
  53. package/dist/cmcd-producer.js +183 -0
  54. package/dist/cmcd-producer.js.map +7 -0
  55. package/dist/codec-utils.d.ts +384 -0
  56. package/dist/codec-utils.d.ts.map +1 -0
  57. package/dist/codec-utils.js +1546 -0
  58. package/dist/codec-utils.js.map +7 -0
  59. package/dist/conceal-timeline.d.ts +146 -0
  60. package/dist/conceal-timeline.d.ts.map +1 -0
  61. package/dist/conceal-timeline.js +137 -0
  62. package/dist/conceal-timeline.js.map +7 -0
  63. package/dist/delivery-gap.d.ts +75 -0
  64. package/dist/delivery-gap.d.ts.map +1 -0
  65. package/dist/delivery-gap.js +88 -0
  66. package/dist/delivery-gap.js.map +7 -0
  67. package/dist/duplicate-ledger.d.ts +197 -0
  68. package/dist/duplicate-ledger.d.ts.map +1 -0
  69. package/dist/duplicate-ledger.js +226 -0
  70. package/dist/duplicate-ledger.js.map +7 -0
  71. package/dist/fec-codec.d.ts +32 -0
  72. package/dist/fec-codec.d.ts.map +1 -0
  73. package/dist/fec-codec.js +47 -0
  74. package/dist/fec-codec.js.map +7 -0
  75. package/dist/fec-manager.d.ts +589 -0
  76. package/dist/fec-manager.d.ts.map +1 -0
  77. package/dist/fec-manager.js +3840 -0
  78. package/dist/fec-manager.js.map +7 -0
  79. package/dist/fec-starvation-detector.d.ts +59 -0
  80. package/dist/fec-starvation-detector.d.ts.map +1 -0
  81. package/dist/fec-starvation-detector.js +60 -0
  82. package/dist/fec-starvation-detector.js.map +7 -0
  83. package/dist/fec-state.d.ts +140 -0
  84. package/dist/fec-state.d.ts.map +1 -0
  85. package/dist/fec-state.js +86 -0
  86. package/dist/fec-state.js.map +7 -0
  87. package/dist/fec-worker-setup.d.ts +100 -0
  88. package/dist/fec-worker-setup.d.ts.map +1 -0
  89. package/dist/fec-worker-setup.js +671 -0
  90. package/dist/fec-worker-setup.js.map +7 -0
  91. package/dist/fmp4-completion.d.ts +30 -0
  92. package/dist/fmp4-completion.d.ts.map +1 -0
  93. package/dist/fmp4-completion.js +21 -0
  94. package/dist/fmp4-completion.js.map +7 -0
  95. package/dist/fmp4-reader.d.ts +37 -0
  96. package/dist/fmp4-reader.d.ts.map +1 -0
  97. package/dist/fmp4-reader.js +100 -0
  98. package/dist/fmp4-reader.js.map +7 -0
  99. package/dist/index.d.ts +44 -3
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +464 -14
  102. package/dist/index.js.map +7 -1
  103. package/dist/iso-block-locator.d.ts +118 -0
  104. package/dist/iso-block-locator.d.ts.map +1 -0
  105. package/dist/iso-block-locator.js +288 -0
  106. package/dist/iso-block-locator.js.map +7 -0
  107. package/dist/iso-bmff-timing.d.ts +78 -0
  108. package/dist/iso-bmff-timing.d.ts.map +1 -0
  109. package/dist/iso-bmff-timing.js +593 -0
  110. package/dist/iso-bmff-timing.js.map +7 -0
  111. package/dist/loc.d.ts +70 -75
  112. package/dist/loc.d.ts.map +1 -1
  113. package/dist/loc.js +106 -192
  114. package/dist/loc.js.map +7 -1
  115. package/dist/manifest-auth-plan.d.ts +30 -0
  116. package/dist/manifest-auth-plan.d.ts.map +1 -0
  117. package/dist/manifest-auth-plan.js +1266 -0
  118. package/dist/manifest-auth-plan.js.map +7 -0
  119. package/dist/media-router.d.ts +262 -0
  120. package/dist/media-router.d.ts.map +1 -0
  121. package/dist/media-router.js +584 -0
  122. package/dist/media-router.js.map +7 -0
  123. package/dist/mfu-reassembler.d.ts +313 -9
  124. package/dist/mfu-reassembler.d.ts.map +1 -1
  125. package/dist/mfu-reassembler.js +3050 -285
  126. package/dist/mfu-reassembler.js.map +7 -1
  127. package/dist/mfu-reassembly-policy.d.ts +24 -0
  128. package/dist/mfu-reassembly-policy.d.ts.map +1 -0
  129. package/dist/mfu-reassembly-policy.js +99 -0
  130. package/dist/mfu-reassembly-policy.js.map +7 -0
  131. package/dist/mmtp-container-parser.d.ts +573 -0
  132. package/dist/mmtp-container-parser.d.ts.map +1 -0
  133. package/dist/mmtp-container-parser.js +6601 -0
  134. package/dist/mmtp-container-parser.js.map +7 -0
  135. package/dist/mmtp-container-parser.no-modules.js +9645 -0
  136. package/dist/mmtp-container-parser.no-modules.js.map +7 -0
  137. package/dist/mmtp-decode-pipeline.d.ts +138 -0
  138. package/dist/mmtp-decode-pipeline.d.ts.map +1 -0
  139. package/dist/mmtp-decode-pipeline.js +6835 -0
  140. package/dist/mmtp-decode-pipeline.js.map +7 -0
  141. package/dist/mmtp-router.d.ts +702 -0
  142. package/dist/mmtp-router.d.ts.map +1 -0
  143. package/dist/mmtp-router.js +11193 -0
  144. package/dist/mmtp-router.js.map +7 -0
  145. package/dist/mmtp-to-cmaf.d.ts +187 -0
  146. package/dist/mmtp-to-cmaf.d.ts.map +1 -0
  147. package/dist/mmtp-to-cmaf.js +716 -0
  148. package/dist/mmtp-to-cmaf.js.map +7 -0
  149. package/dist/multicast-auth-catalog.d.ts +115 -0
  150. package/dist/multicast-auth-catalog.d.ts.map +1 -0
  151. package/dist/multicast-auth-catalog.js +202 -0
  152. package/dist/multicast-auth-catalog.js.map +7 -0
  153. package/dist/multicast-input.d.ts +141 -0
  154. package/dist/multicast-input.d.ts.map +1 -0
  155. package/dist/multicast-input.js +389 -0
  156. package/dist/multicast-input.js.map +7 -0
  157. package/dist/multicast-manager.d.ts +699 -0
  158. package/dist/multicast-manager.d.ts.map +1 -0
  159. package/dist/multicast-manager.js +19120 -0
  160. package/dist/multicast-manager.js.map +7 -0
  161. package/dist/multicast-transport.d.ts +271 -0
  162. package/dist/multicast-transport.d.ts.map +1 -0
  163. package/dist/multicast-transport.js +2262 -0
  164. package/dist/multicast-transport.js.map +7 -0
  165. package/dist/multicast-unwrap.d.ts +57 -0
  166. package/dist/multicast-unwrap.d.ts.map +1 -0
  167. package/dist/multicast-unwrap.js +417 -0
  168. package/dist/multicast-unwrap.js.map +7 -0
  169. package/dist/no-modules.d.ts +10 -0
  170. package/dist/no-modules.d.ts.map +1 -0
  171. package/dist/no-modules.js +9520 -0
  172. package/dist/no-modules.js.map +7 -0
  173. package/dist/phase14-catalog-override.d.ts +126 -0
  174. package/dist/phase14-catalog-override.d.ts.map +1 -0
  175. package/dist/phase14-catalog-override.js +155 -0
  176. package/dist/phase14-catalog-override.js.map +7 -0
  177. package/dist/repair-fetch.d.ts +281 -0
  178. package/dist/repair-fetch.d.ts.map +1 -0
  179. package/dist/repair-fetch.js +391 -0
  180. package/dist/repair-fetch.js.map +7 -0
  181. package/dist/repair-layers.d.ts +169 -0
  182. package/dist/repair-layers.d.ts.map +1 -0
  183. package/dist/repair-layers.js +351 -0
  184. package/dist/repair-layers.js.map +7 -0
  185. package/dist/sample-combiner.d.ts +212 -0
  186. package/dist/sample-combiner.d.ts.map +1 -0
  187. package/dist/sample-combiner.js +595 -0
  188. package/dist/sample-combiner.js.map +7 -0
  189. package/dist/signaling.d.ts +29 -0
  190. package/dist/signaling.d.ts.map +1 -0
  191. package/dist/signaling.js +568 -0
  192. package/dist/signaling.js.map +7 -0
  193. package/dist/source-auth.d.ts +2 -0
  194. package/dist/source-auth.d.ts.map +1 -0
  195. package/dist/source-auth.js +1209 -0
  196. package/dist/source-auth.js.map +7 -0
  197. package/dist/switching-set-alignment.d.ts +61 -0
  198. package/dist/switching-set-alignment.d.ts.map +1 -0
  199. package/dist/switching-set-alignment.js +70 -0
  200. package/dist/switching-set-alignment.js.map +7 -0
  201. package/dist/timestamp-codec.d.ts +34 -0
  202. package/dist/timestamp-codec.d.ts.map +1 -0
  203. package/dist/timestamp-codec.js +472 -0
  204. package/dist/timestamp-codec.js.map +7 -0
  205. package/dist/track-pipeline-setup.d.ts +83 -0
  206. package/dist/track-pipeline-setup.d.ts.map +1 -0
  207. package/dist/track-pipeline-setup.js +291 -0
  208. package/dist/track-pipeline-setup.js.map +7 -0
  209. package/dist/track-pipeline.d.ts +121 -0
  210. package/dist/track-pipeline.d.ts.map +1 -0
  211. package/dist/track-pipeline.js +209 -0
  212. package/dist/track-pipeline.js.map +7 -0
  213. package/dist/track-session.d.ts +414 -0
  214. package/dist/track-session.d.ts.map +1 -0
  215. package/dist/track-session.js +754 -0
  216. package/dist/track-session.js.map +7 -0
  217. package/dist/transport-pool.d.ts +69 -0
  218. package/dist/transport-pool.d.ts.map +1 -0
  219. package/dist/transport-pool.js +74 -0
  220. package/dist/transport-pool.js.map +7 -0
  221. package/dist/wasm-mfu-reassembler.d.ts +97 -0
  222. package/dist/wasm-mfu-reassembler.d.ts.map +1 -0
  223. package/dist/wasm-mfu-reassembler.js +2132 -0
  224. package/dist/wasm-mfu-reassembler.js.map +7 -0
  225. package/dist/wasm-mmtp-container-parser.d.ts +10 -0
  226. package/dist/wasm-mmtp-container-parser.d.ts.map +1 -0
  227. package/dist/wasm-mmtp-container-parser.js +6855 -0
  228. package/dist/wasm-mmtp-container-parser.js.map +7 -0
  229. package/node_modules/@blockcast/fec-worker/README.md +223 -0
  230. package/node_modules/@blockcast/fec-worker/dist/.build-stamp +0 -0
  231. package/node_modules/@blockcast/fec-worker/dist/block-order.d.ts +22 -0
  232. package/node_modules/@blockcast/fec-worker/dist/block-order.d.ts.map +1 -0
  233. package/node_modules/@blockcast/fec-worker/dist/block-order.js +48 -0
  234. package/node_modules/@blockcast/fec-worker/dist/block-order.js.map +1 -0
  235. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts +92 -0
  236. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts.map +1 -0
  237. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js +345 -0
  238. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js.map +1 -0
  239. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts +373 -0
  240. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts.map +1 -0
  241. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js +11 -0
  242. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js.map +1 -0
  243. package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts +14 -0
  244. package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts.map +1 -0
  245. package/node_modules/@blockcast/fec-worker/dist/fec-worker.js +764 -0
  246. package/node_modules/@blockcast/fec-worker/dist/fec-worker.js.map +7 -0
  247. package/node_modules/@blockcast/fec-worker/dist/index.d.ts +10 -0
  248. package/node_modules/@blockcast/fec-worker/dist/index.d.ts.map +1 -0
  249. package/node_modules/@blockcast/fec-worker/dist/index.js +8 -0
  250. package/node_modules/@blockcast/fec-worker/dist/index.js.map +1 -0
  251. package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts +20 -0
  252. package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts.map +1 -0
  253. package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js +370 -0
  254. package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js.map +7 -0
  255. package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts +104 -0
  256. package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts.map +1 -0
  257. package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js +181 -0
  258. package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js.map +1 -0
  259. package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts +194 -0
  260. package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts.map +1 -0
  261. package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js +62 -0
  262. package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js.map +1 -0
  263. package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts +9 -0
  264. package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts.map +1 -0
  265. package/node_modules/@blockcast/fec-worker/dist/transfer.js +13 -0
  266. package/node_modules/@blockcast/fec-worker/dist/transfer.js.map +1 -0
  267. package/node_modules/@blockcast/fec-worker/package.json +59 -0
  268. package/node_modules/@blockcast/fec-worker/src/block-order.ts +59 -0
  269. package/node_modules/@blockcast/fec-worker/src/fec-worker-client.ts +391 -0
  270. package/node_modules/@blockcast/fec-worker/src/fec-worker-types.ts +392 -0
  271. package/node_modules/@blockcast/fec-worker/src/fec-worker.ts +1386 -0
  272. package/node_modules/@blockcast/fec-worker/src/index.ts +35 -0
  273. package/node_modules/@blockcast/fec-worker/src/shred-fec-worker.ts +589 -0
  274. package/node_modules/@blockcast/fec-worker/src/shred-worker-client.ts +222 -0
  275. package/node_modules/@blockcast/fec-worker/src/shred-worker-types.ts +209 -0
  276. package/node_modules/@blockcast/fec-worker/src/transfer.ts +12 -0
  277. package/node_modules/@blockcast/mmt-alta-parse/README.md +181 -0
  278. package/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
  279. package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +57 -0
  280. package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +1 -0
  281. package/node_modules/@blockcast/mmt-alta-parse/dist/index.js +115 -0
  282. package/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +1 -0
  283. package/node_modules/@blockcast/mmt-alta-parse/package.json +50 -0
  284. package/node_modules/@blockcast/mmt-alta-parse/src/index.ts +136 -0
  285. package/node_modules/@blockcast/mmt-base/README.md +134 -0
  286. package/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
  287. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +55 -0
  288. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +1 -0
  289. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +132 -0
  290. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +1 -0
  291. package/node_modules/@blockcast/mmt-base/dist/index.d.ts +7 -0
  292. package/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +1 -0
  293. package/node_modules/@blockcast/mmt-base/dist/index.js +7 -0
  294. package/node_modules/@blockcast/mmt-base/dist/index.js.map +1 -0
  295. package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +292 -0
  296. package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +1 -0
  297. package/node_modules/@blockcast/mmt-base/dist/mmtp.js +612 -0
  298. package/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +1 -0
  299. package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts +18 -0
  300. package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts.map +1 -0
  301. package/node_modules/@blockcast/mmt-base/dist/net-constants.js +18 -0
  302. package/node_modules/@blockcast/mmt-base/dist/net-constants.js.map +1 -0
  303. package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts +47 -0
  304. package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts.map +1 -0
  305. package/node_modules/@blockcast/mmt-base/dist/ntp-short.js +54 -0
  306. package/node_modules/@blockcast/mmt-base/dist/ntp-short.js.map +1 -0
  307. package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +28 -0
  308. package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +1 -0
  309. package/node_modules/@blockcast/mmt-base/dist/serial-number.js +44 -0
  310. package/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +1 -0
  311. package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +314 -0
  312. package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +1 -0
  313. package/node_modules/@blockcast/mmt-base/dist/signalling.js +637 -0
  314. package/node_modules/@blockcast/mmt-base/dist/signalling.js.map +1 -0
  315. package/node_modules/@blockcast/mmt-base/package.json +49 -0
  316. package/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +145 -0
  317. package/node_modules/@blockcast/mmt-base/src/index.ts +6 -0
  318. package/node_modules/@blockcast/mmt-base/src/mmtp.ts +892 -0
  319. package/node_modules/@blockcast/mmt-base/src/net-constants.ts +17 -0
  320. package/node_modules/@blockcast/mmt-base/src/ntp-short.ts +67 -0
  321. package/node_modules/@blockcast/mmt-base/src/serial-number.ts +49 -0
  322. package/node_modules/@blockcast/mmt-base/src/signalling.ts +860 -0
  323. package/node_modules/@blockcast/mmt-fec/README.md +271 -0
  324. package/node_modules/@blockcast/mmt-fec/dist/.build-stamp +0 -0
  325. package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts +82 -0
  326. package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts.map +1 -0
  327. package/node_modules/@blockcast/mmt-fec/dist/block-manager.js +296 -0
  328. package/node_modules/@blockcast/mmt-fec/dist/block-manager.js.map +1 -0
  329. package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts +105 -0
  330. package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts.map +1 -0
  331. package/node_modules/@blockcast/mmt-fec/dist/block-processor.js +222 -0
  332. package/node_modules/@blockcast/mmt-fec/dist/block-processor.js.map +1 -0
  333. package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts +46 -0
  334. package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts.map +1 -0
  335. package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js +96 -0
  336. package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js.map +1 -0
  337. package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts +33 -0
  338. package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts.map +1 -0
  339. package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js +57 -0
  340. package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js.map +1 -0
  341. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts +149 -0
  342. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts.map +1 -0
  343. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js +161 -0
  344. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js.map +1 -0
  345. package/node_modules/@blockcast/mmt-fec/dist/index.d.ts +28 -0
  346. package/node_modules/@blockcast/mmt-fec/dist/index.d.ts.map +1 -0
  347. package/node_modules/@blockcast/mmt-fec/dist/index.js +28 -0
  348. package/node_modules/@blockcast/mmt-fec/dist/index.js.map +1 -0
  349. package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts +20 -0
  350. package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts.map +1 -0
  351. package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js +28 -0
  352. package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js.map +1 -0
  353. package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts +258 -0
  354. package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts.map +1 -0
  355. package/node_modules/@blockcast/mmt-fec/dist/oti.js +382 -0
  356. package/node_modules/@blockcast/mmt-fec/dist/oti.js.map +1 -0
  357. package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts +41 -0
  358. package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts.map +1 -0
  359. package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js +81 -0
  360. package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js.map +1 -0
  361. package/node_modules/@blockcast/mmt-fec/dist/repair-group.d.ts +82 -0
  362. package/node_modules/@blockcast/mmt-fec/dist/repair-group.d.ts.map +1 -0
  363. package/node_modules/@blockcast/mmt-fec/dist/repair-group.js +170 -0
  364. package/node_modules/@blockcast/mmt-fec/dist/repair-group.js.map +1 -0
  365. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/README.md +181 -0
  366. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
  367. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +57 -0
  368. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +1 -0
  369. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js +115 -0
  370. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +1 -0
  371. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/package.json +50 -0
  372. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/src/index.ts +136 -0
  373. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/README.md +134 -0
  374. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
  375. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +55 -0
  376. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +1 -0
  377. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +132 -0
  378. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +1 -0
  379. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts +7 -0
  380. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +1 -0
  381. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js +7 -0
  382. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js.map +1 -0
  383. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +292 -0
  384. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +1 -0
  385. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js +612 -0
  386. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +1 -0
  387. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts +18 -0
  388. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts.map +1 -0
  389. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.js +18 -0
  390. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.js.map +1 -0
  391. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts +47 -0
  392. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts.map +1 -0
  393. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.js +54 -0
  394. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.js.map +1 -0
  395. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +28 -0
  396. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +1 -0
  397. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.js +44 -0
  398. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +1 -0
  399. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +314 -0
  400. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +1 -0
  401. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.js +637 -0
  402. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.js.map +1 -0
  403. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/package.json +49 -0
  404. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +145 -0
  405. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/index.ts +6 -0
  406. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/mmtp.ts +892 -0
  407. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/net-constants.ts +17 -0
  408. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/ntp-short.ts +67 -0
  409. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/serial-number.ts +49 -0
  410. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/signalling.ts +860 -0
  411. package/node_modules/@blockcast/mmt-fec/package.json +79 -0
  412. package/node_modules/@blockcast/mmt-fec/src/block-manager.ts +371 -0
  413. package/node_modules/@blockcast/mmt-fec/src/block-processor.ts +360 -0
  414. package/node_modules/@blockcast/mmt-fec/src/cmaf-recovery.ts +127 -0
  415. package/node_modules/@blockcast/mmt-fec/src/cmaf-symbols.ts +68 -0
  416. package/node_modules/@blockcast/mmt-fec/src/fec-block-mapper.ts +225 -0
  417. package/node_modules/@blockcast/mmt-fec/src/index.ts +93 -0
  418. package/node_modules/@blockcast/mmt-fec/src/loc-symbols.ts +34 -0
  419. package/node_modules/@blockcast/mmt-fec/src/oti.ts +463 -0
  420. package/node_modules/@blockcast/mmt-fec/src/reorder-buffer.ts +101 -0
  421. package/node_modules/@blockcast/mmt-fec/src/repair-group.ts +195 -0
  422. package/node_modules/@blockcast/mmt-manifest-verify/dist/.build-stamp +0 -0
  423. package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts +28 -0
  424. package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts.map +1 -0
  425. package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js +128 -0
  426. package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js.map +1 -0
  427. package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts +4 -0
  428. package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts.map +1 -0
  429. package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js +4 -0
  430. package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js.map +1 -0
  431. package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts +37 -0
  432. package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts.map +1 -0
  433. package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js +179 -0
  434. package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js.map +1 -0
  435. package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts +99 -0
  436. package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts.map +1 -0
  437. package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js +492 -0
  438. package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js.map +1 -0
  439. package/node_modules/@blockcast/mmt-manifest-verify/package.json +45 -0
  440. package/node_modules/@blockcast/mmt-manifest-verify/src/admission.ts +171 -0
  441. package/node_modules/@blockcast/mmt-manifest-verify/src/index.ts +3 -0
  442. package/node_modules/@blockcast/mmt-manifest-verify/src/source-auth.ts +230 -0
  443. package/node_modules/@blockcast/mmt-manifest-verify/src/verifier.ts +669 -0
  444. package/node_modules/@noble/hashes/LICENSE +21 -0
  445. package/node_modules/@noble/hashes/README.md +521 -0
  446. package/node_modules/@noble/hashes/_assert.d.ts +17 -0
  447. package/node_modules/@noble/hashes/_assert.d.ts.map +1 -0
  448. package/node_modules/@noble/hashes/_assert.js +18 -0
  449. package/node_modules/@noble/hashes/_assert.js.map +1 -0
  450. package/node_modules/@noble/hashes/_blake.d.ts +14 -0
  451. package/node_modules/@noble/hashes/_blake.d.ts.map +1 -0
  452. package/node_modules/@noble/hashes/_blake.js +50 -0
  453. package/node_modules/@noble/hashes/_blake.js.map +1 -0
  454. package/node_modules/@noble/hashes/_md.d.ts +51 -0
  455. package/node_modules/@noble/hashes/_md.d.ts.map +1 -0
  456. package/node_modules/@noble/hashes/_md.js +162 -0
  457. package/node_modules/@noble/hashes/_md.js.map +1 -0
  458. package/node_modules/@noble/hashes/_u64.d.ts +55 -0
  459. package/node_modules/@noble/hashes/_u64.d.ts.map +1 -0
  460. package/node_modules/@noble/hashes/_u64.js +90 -0
  461. package/node_modules/@noble/hashes/_u64.js.map +1 -0
  462. package/node_modules/@noble/hashes/argon2.d.ts +32 -0
  463. package/node_modules/@noble/hashes/argon2.d.ts.map +1 -0
  464. package/node_modules/@noble/hashes/argon2.js +401 -0
  465. package/node_modules/@noble/hashes/argon2.js.map +1 -0
  466. package/node_modules/@noble/hashes/blake1.d.ts +106 -0
  467. package/node_modules/@noble/hashes/blake1.d.ts.map +1 -0
  468. package/node_modules/@noble/hashes/blake1.js +459 -0
  469. package/node_modules/@noble/hashes/blake1.js.map +1 -0
  470. package/node_modules/@noble/hashes/blake2.d.ts +116 -0
  471. package/node_modules/@noble/hashes/blake2.d.ts.map +1 -0
  472. package/node_modules/@noble/hashes/blake2.js +420 -0
  473. package/node_modules/@noble/hashes/blake2.js.map +1 -0
  474. package/node_modules/@noble/hashes/blake2b.d.ts +11 -0
  475. package/node_modules/@noble/hashes/blake2b.d.ts.map +1 -0
  476. package/node_modules/@noble/hashes/blake2b.js +14 -0
  477. package/node_modules/@noble/hashes/blake2b.js.map +1 -0
  478. package/node_modules/@noble/hashes/blake2s.d.ts +20 -0
  479. package/node_modules/@noble/hashes/blake2s.d.ts.map +1 -0
  480. package/node_modules/@noble/hashes/blake2s.js +24 -0
  481. package/node_modules/@noble/hashes/blake2s.js.map +1 -0
  482. package/node_modules/@noble/hashes/blake3.d.ts +54 -0
  483. package/node_modules/@noble/hashes/blake3.d.ts.map +1 -0
  484. package/node_modules/@noble/hashes/blake3.js +255 -0
  485. package/node_modules/@noble/hashes/blake3.js.map +1 -0
  486. package/node_modules/@noble/hashes/crypto.d.ts +2 -0
  487. package/node_modules/@noble/hashes/crypto.d.ts.map +1 -0
  488. package/node_modules/@noble/hashes/crypto.js +5 -0
  489. package/node_modules/@noble/hashes/crypto.js.map +1 -0
  490. package/node_modules/@noble/hashes/cryptoNode.d.ts +2 -0
  491. package/node_modules/@noble/hashes/cryptoNode.d.ts.map +1 -0
  492. package/node_modules/@noble/hashes/cryptoNode.js +18 -0
  493. package/node_modules/@noble/hashes/cryptoNode.js.map +1 -0
  494. package/node_modules/@noble/hashes/eskdf.d.ts +47 -0
  495. package/node_modules/@noble/hashes/eskdf.d.ts.map +1 -0
  496. package/node_modules/@noble/hashes/eskdf.js +166 -0
  497. package/node_modules/@noble/hashes/eskdf.js.map +1 -0
  498. package/node_modules/@noble/hashes/esm/_assert.d.ts +17 -0
  499. package/node_modules/@noble/hashes/esm/_assert.d.ts.map +1 -0
  500. package/node_modules/@noble/hashes/esm/_assert.js +15 -0
  501. package/node_modules/@noble/hashes/esm/_assert.js.map +1 -0
  502. package/node_modules/@noble/hashes/esm/_blake.d.ts +14 -0
  503. package/node_modules/@noble/hashes/esm/_blake.d.ts.map +1 -0
  504. package/node_modules/@noble/hashes/esm/_blake.js +45 -0
  505. package/node_modules/@noble/hashes/esm/_blake.js.map +1 -0
  506. package/node_modules/@noble/hashes/esm/_md.d.ts +51 -0
  507. package/node_modules/@noble/hashes/esm/_md.d.ts.map +1 -0
  508. package/node_modules/@noble/hashes/esm/_md.js +155 -0
  509. package/node_modules/@noble/hashes/esm/_md.js.map +1 -0
  510. package/node_modules/@noble/hashes/esm/_u64.d.ts +55 -0
  511. package/node_modules/@noble/hashes/esm/_u64.d.ts.map +1 -0
  512. package/node_modules/@noble/hashes/esm/_u64.js +67 -0
  513. package/node_modules/@noble/hashes/esm/_u64.js.map +1 -0
  514. package/node_modules/@noble/hashes/esm/argon2.d.ts +32 -0
  515. package/node_modules/@noble/hashes/esm/argon2.d.ts.map +1 -0
  516. package/node_modules/@noble/hashes/esm/argon2.js +392 -0
  517. package/node_modules/@noble/hashes/esm/argon2.js.map +1 -0
  518. package/node_modules/@noble/hashes/esm/blake1.d.ts +106 -0
  519. package/node_modules/@noble/hashes/esm/blake1.d.ts.map +1 -0
  520. package/node_modules/@noble/hashes/esm/blake1.js +452 -0
  521. package/node_modules/@noble/hashes/esm/blake1.js.map +1 -0
  522. package/node_modules/@noble/hashes/esm/blake2.d.ts +116 -0
  523. package/node_modules/@noble/hashes/esm/blake2.d.ts.map +1 -0
  524. package/node_modules/@noble/hashes/esm/blake2.js +413 -0
  525. package/node_modules/@noble/hashes/esm/blake2.js.map +1 -0
  526. package/node_modules/@noble/hashes/esm/blake2b.d.ts +11 -0
  527. package/node_modules/@noble/hashes/esm/blake2b.d.ts.map +1 -0
  528. package/node_modules/@noble/hashes/esm/blake2b.js +11 -0
  529. package/node_modules/@noble/hashes/esm/blake2b.js.map +1 -0
  530. package/node_modules/@noble/hashes/esm/blake2s.d.ts +20 -0
  531. package/node_modules/@noble/hashes/esm/blake2s.d.ts.map +1 -0
  532. package/node_modules/@noble/hashes/esm/blake2s.js +21 -0
  533. package/node_modules/@noble/hashes/esm/blake2s.js.map +1 -0
  534. package/node_modules/@noble/hashes/esm/blake3.d.ts +54 -0
  535. package/node_modules/@noble/hashes/esm/blake3.d.ts.map +1 -0
  536. package/node_modules/@noble/hashes/esm/blake3.js +251 -0
  537. package/node_modules/@noble/hashes/esm/blake3.js.map +1 -0
  538. package/node_modules/@noble/hashes/esm/crypto.d.ts +2 -0
  539. package/node_modules/@noble/hashes/esm/crypto.d.ts.map +1 -0
  540. package/node_modules/@noble/hashes/esm/crypto.js +2 -0
  541. package/node_modules/@noble/hashes/esm/crypto.js.map +1 -0
  542. package/node_modules/@noble/hashes/esm/cryptoNode.d.ts +2 -0
  543. package/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map +1 -0
  544. package/node_modules/@noble/hashes/esm/cryptoNode.js +15 -0
  545. package/node_modules/@noble/hashes/esm/cryptoNode.js.map +1 -0
  546. package/node_modules/@noble/hashes/esm/eskdf.d.ts +47 -0
  547. package/node_modules/@noble/hashes/esm/eskdf.d.ts.map +1 -0
  548. package/node_modules/@noble/hashes/esm/eskdf.js +160 -0
  549. package/node_modules/@noble/hashes/esm/eskdf.js.map +1 -0
  550. package/node_modules/@noble/hashes/esm/hkdf.d.ts +36 -0
  551. package/node_modules/@noble/hashes/esm/hkdf.d.ts.map +1 -0
  552. package/node_modules/@noble/hashes/esm/hkdf.js +82 -0
  553. package/node_modules/@noble/hashes/esm/hkdf.js.map +1 -0
  554. package/node_modules/@noble/hashes/esm/hmac.d.ts +35 -0
  555. package/node_modules/@noble/hashes/esm/hmac.d.ts.map +1 -0
  556. package/node_modules/@noble/hashes/esm/hmac.js +86 -0
  557. package/node_modules/@noble/hashes/esm/hmac.js.map +1 -0
  558. package/node_modules/@noble/hashes/esm/index.d.ts +2 -0
  559. package/node_modules/@noble/hashes/esm/index.d.ts.map +1 -0
  560. package/node_modules/@noble/hashes/esm/index.js +33 -0
  561. package/node_modules/@noble/hashes/esm/index.js.map +1 -0
  562. package/node_modules/@noble/hashes/esm/legacy.d.ts +71 -0
  563. package/node_modules/@noble/hashes/esm/legacy.d.ts.map +1 -0
  564. package/node_modules/@noble/hashes/esm/legacy.js +281 -0
  565. package/node_modules/@noble/hashes/esm/legacy.js.map +1 -0
  566. package/node_modules/@noble/hashes/esm/package.json +10 -0
  567. package/node_modules/@noble/hashes/esm/pbkdf2.d.ts +23 -0
  568. package/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map +1 -0
  569. package/node_modules/@noble/hashes/esm/pbkdf2.js +97 -0
  570. package/node_modules/@noble/hashes/esm/pbkdf2.js.map +1 -0
  571. package/node_modules/@noble/hashes/esm/ripemd160.d.ts +13 -0
  572. package/node_modules/@noble/hashes/esm/ripemd160.d.ts.map +1 -0
  573. package/node_modules/@noble/hashes/esm/ripemd160.js +13 -0
  574. package/node_modules/@noble/hashes/esm/ripemd160.js.map +1 -0
  575. package/node_modules/@noble/hashes/esm/scrypt.d.ts +34 -0
  576. package/node_modules/@noble/hashes/esm/scrypt.d.ts.map +1 -0
  577. package/node_modules/@noble/hashes/esm/scrypt.js +228 -0
  578. package/node_modules/@noble/hashes/esm/scrypt.js.map +1 -0
  579. package/node_modules/@noble/hashes/esm/sha1.d.ts +11 -0
  580. package/node_modules/@noble/hashes/esm/sha1.d.ts.map +1 -0
  581. package/node_modules/@noble/hashes/esm/sha1.js +11 -0
  582. package/node_modules/@noble/hashes/esm/sha1.js.map +1 -0
  583. package/node_modules/@noble/hashes/esm/sha2.d.ts +159 -0
  584. package/node_modules/@noble/hashes/esm/sha2.d.ts.map +1 -0
  585. package/node_modules/@noble/hashes/esm/sha2.js +375 -0
  586. package/node_modules/@noble/hashes/esm/sha2.js.map +1 -0
  587. package/node_modules/@noble/hashes/esm/sha256.d.ts +20 -0
  588. package/node_modules/@noble/hashes/esm/sha256.d.ts.map +1 -0
  589. package/node_modules/@noble/hashes/esm/sha256.js +20 -0
  590. package/node_modules/@noble/hashes/esm/sha256.js.map +1 -0
  591. package/node_modules/@noble/hashes/esm/sha3-addons.d.ts +142 -0
  592. package/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map +1 -0
  593. package/node_modules/@noble/hashes/esm/sha3-addons.js +393 -0
  594. package/node_modules/@noble/hashes/esm/sha3-addons.js.map +1 -0
  595. package/node_modules/@noble/hashes/esm/sha3.d.ts +53 -0
  596. package/node_modules/@noble/hashes/esm/sha3.d.ts.map +1 -0
  597. package/node_modules/@noble/hashes/esm/sha3.js +234 -0
  598. package/node_modules/@noble/hashes/esm/sha3.js.map +1 -0
  599. package/node_modules/@noble/hashes/esm/sha512.d.ts +26 -0
  600. package/node_modules/@noble/hashes/esm/sha512.d.ts.map +1 -0
  601. package/node_modules/@noble/hashes/esm/sha512.js +26 -0
  602. package/node_modules/@noble/hashes/esm/sha512.js.map +1 -0
  603. package/node_modules/@noble/hashes/esm/utils.d.ts +161 -0
  604. package/node_modules/@noble/hashes/esm/utils.d.ts.map +1 -0
  605. package/node_modules/@noble/hashes/esm/utils.js +281 -0
  606. package/node_modules/@noble/hashes/esm/utils.js.map +1 -0
  607. package/node_modules/@noble/hashes/hkdf.d.ts +36 -0
  608. package/node_modules/@noble/hashes/hkdf.d.ts.map +1 -0
  609. package/node_modules/@noble/hashes/hkdf.js +88 -0
  610. package/node_modules/@noble/hashes/hkdf.js.map +1 -0
  611. package/node_modules/@noble/hashes/hmac.d.ts +35 -0
  612. package/node_modules/@noble/hashes/hmac.d.ts.map +1 -0
  613. package/node_modules/@noble/hashes/hmac.js +91 -0
  614. package/node_modules/@noble/hashes/hmac.js.map +1 -0
  615. package/node_modules/@noble/hashes/index.d.ts +1 -0
  616. package/node_modules/@noble/hashes/index.d.ts.map +1 -0
  617. package/node_modules/@noble/hashes/index.js +33 -0
  618. package/node_modules/@noble/hashes/index.js.map +1 -0
  619. package/node_modules/@noble/hashes/legacy.d.ts +71 -0
  620. package/node_modules/@noble/hashes/legacy.d.ts.map +1 -0
  621. package/node_modules/@noble/hashes/legacy.js +287 -0
  622. package/node_modules/@noble/hashes/legacy.js.map +1 -0
  623. package/node_modules/@noble/hashes/package.json +266 -0
  624. package/node_modules/@noble/hashes/pbkdf2.d.ts +23 -0
  625. package/node_modules/@noble/hashes/pbkdf2.d.ts.map +1 -0
  626. package/node_modules/@noble/hashes/pbkdf2.js +101 -0
  627. package/node_modules/@noble/hashes/pbkdf2.js.map +1 -0
  628. package/node_modules/@noble/hashes/ripemd160.d.ts +13 -0
  629. package/node_modules/@noble/hashes/ripemd160.d.ts.map +1 -0
  630. package/node_modules/@noble/hashes/ripemd160.js +16 -0
  631. package/node_modules/@noble/hashes/ripemd160.js.map +1 -0
  632. package/node_modules/@noble/hashes/scrypt.d.ts +34 -0
  633. package/node_modules/@noble/hashes/scrypt.d.ts.map +1 -0
  634. package/node_modules/@noble/hashes/scrypt.js +232 -0
  635. package/node_modules/@noble/hashes/scrypt.js.map +1 -0
  636. package/node_modules/@noble/hashes/sha1.d.ts +11 -0
  637. package/node_modules/@noble/hashes/sha1.d.ts.map +1 -0
  638. package/node_modules/@noble/hashes/sha1.js +14 -0
  639. package/node_modules/@noble/hashes/sha1.js.map +1 -0
  640. package/node_modules/@noble/hashes/sha2.d.ts +159 -0
  641. package/node_modules/@noble/hashes/sha2.d.ts.map +1 -0
  642. package/node_modules/@noble/hashes/sha2.js +384 -0
  643. package/node_modules/@noble/hashes/sha2.js.map +1 -0
  644. package/node_modules/@noble/hashes/sha256.d.ts +20 -0
  645. package/node_modules/@noble/hashes/sha256.d.ts.map +1 -0
  646. package/node_modules/@noble/hashes/sha256.js +23 -0
  647. package/node_modules/@noble/hashes/sha256.js.map +1 -0
  648. package/node_modules/@noble/hashes/sha3-addons.d.ts +142 -0
  649. package/node_modules/@noble/hashes/sha3-addons.d.ts.map +1 -0
  650. package/node_modules/@noble/hashes/sha3-addons.js +402 -0
  651. package/node_modules/@noble/hashes/sha3-addons.js.map +1 -0
  652. package/node_modules/@noble/hashes/sha3.d.ts +53 -0
  653. package/node_modules/@noble/hashes/sha3.d.ts.map +1 -0
  654. package/node_modules/@noble/hashes/sha3.js +239 -0
  655. package/node_modules/@noble/hashes/sha3.js.map +1 -0
  656. package/node_modules/@noble/hashes/sha512.d.ts +26 -0
  657. package/node_modules/@noble/hashes/sha512.d.ts.map +1 -0
  658. package/node_modules/@noble/hashes/sha512.js +29 -0
  659. package/node_modules/@noble/hashes/sha512.js.map +1 -0
  660. package/node_modules/@noble/hashes/src/_assert.ts +22 -0
  661. package/node_modules/@noble/hashes/src/_blake.ts +50 -0
  662. package/node_modules/@noble/hashes/src/_md.ts +176 -0
  663. package/node_modules/@noble/hashes/src/_u64.ts +91 -0
  664. package/node_modules/@noble/hashes/src/argon2.ts +497 -0
  665. package/node_modules/@noble/hashes/src/blake1.ts +534 -0
  666. package/node_modules/@noble/hashes/src/blake2.ts +486 -0
  667. package/node_modules/@noble/hashes/src/blake2b.ts +10 -0
  668. package/node_modules/@noble/hashes/src/blake2s.ts +20 -0
  669. package/node_modules/@noble/hashes/src/blake3.ts +272 -0
  670. package/node_modules/@noble/hashes/src/crypto.ts +9 -0
  671. package/node_modules/@noble/hashes/src/cryptoNode.ts +15 -0
  672. package/node_modules/@noble/hashes/src/eskdf.ts +187 -0
  673. package/node_modules/@noble/hashes/src/hkdf.ts +88 -0
  674. package/node_modules/@noble/hashes/src/hmac.ts +94 -0
  675. package/node_modules/@noble/hashes/src/index.ts +31 -0
  676. package/node_modules/@noble/hashes/src/legacy.ts +293 -0
  677. package/node_modules/@noble/hashes/src/pbkdf2.ts +122 -0
  678. package/node_modules/@noble/hashes/src/ripemd160.ts +12 -0
  679. package/node_modules/@noble/hashes/src/scrypt.ts +257 -0
  680. package/node_modules/@noble/hashes/src/sha1.ts +10 -0
  681. package/node_modules/@noble/hashes/src/sha2.ts +402 -0
  682. package/node_modules/@noble/hashes/src/sha256.ts +24 -0
  683. package/node_modules/@noble/hashes/src/sha3-addons.ts +499 -0
  684. package/node_modules/@noble/hashes/src/sha3.ts +258 -0
  685. package/node_modules/@noble/hashes/src/sha512.ts +34 -0
  686. package/node_modules/@noble/hashes/src/utils.ts +395 -0
  687. package/node_modules/@noble/hashes/utils.d.ts +161 -0
  688. package/node_modules/@noble/hashes/utils.d.ts.map +1 -0
  689. package/node_modules/@noble/hashes/utils.js +313 -0
  690. package/node_modules/@noble/hashes/utils.js.map +1 -0
  691. package/package.json +179 -8
  692. package/schemas/catalog.schema.json +357 -0
  693. package/src/align.ts +239 -0
  694. package/src/audio-init-parser.ts +189 -0
  695. package/src/audio-ring-buffer.ts +120 -0
  696. package/src/authored-timing.ts +63 -0
  697. package/src/block-policy.ts +903 -0
  698. package/src/carp-catalog.ts +1086 -0
  699. package/src/catalog-fec-params.ts +803 -0
  700. package/src/catalog-network-source.ts +74 -0
  701. package/src/catalog-validator.ts +34 -0
  702. package/src/cmaf-block-assembler.ts +1255 -0
  703. package/src/cmaf-group-batcher.ts +104 -0
  704. package/src/cmcd-producer.ts +329 -0
  705. package/src/codec-utils.ts +1984 -0
  706. package/src/conceal-timeline.ts +293 -0
  707. package/src/delivery-gap.ts +147 -0
  708. package/src/duplicate-ledger.ts +372 -0
  709. package/src/fec-codec.ts +61 -0
  710. package/src/fec-manager.ts +4241 -0
  711. package/src/fec-starvation-detector.ts +128 -0
  712. package/src/fec-state.ts +228 -0
  713. package/src/fec-worker-setup.ts +291 -0
  714. package/src/fmp4-completion.ts +47 -0
  715. package/src/fmp4-reader.ts +112 -0
  716. package/src/index.ts +592 -21
  717. package/src/iso-block-locator.ts +329 -0
  718. package/src/iso-bmff-timing.ts +813 -0
  719. package/src/loc.ts +128 -154
  720. package/src/manifest-auth-plan.ts +107 -0
  721. package/src/media-router.ts +841 -0
  722. package/src/mfu-reassembler.ts +3480 -155
  723. package/src/mfu-reassembly-policy.ts +134 -0
  724. package/src/mmtp-container-parser.ts +2406 -0
  725. package/src/mmtp-decode-pipeline.ts +406 -0
  726. package/src/mmtp-router.ts +4712 -0
  727. package/src/mmtp-to-cmaf.ts +977 -0
  728. package/src/multicast-auth-catalog.ts +340 -0
  729. package/src/multicast-input.ts +793 -0
  730. package/src/multicast-manager.ts +2895 -0
  731. package/src/multicast-transport.ts +1058 -0
  732. package/src/multicast-unwrap.ts +132 -0
  733. package/src/no-modules.ts +21 -0
  734. package/src/phase14-catalog-override.ts +336 -0
  735. package/src/repair-fetch.ts +786 -0
  736. package/src/repair-layers.ts +553 -0
  737. package/src/sample-combiner.ts +938 -0
  738. package/src/signaling.ts +78 -0
  739. package/src/source-auth.ts +1 -0
  740. package/src/switching-set-alignment.ts +109 -0
  741. package/src/timestamp-codec.ts +265 -0
  742. package/src/track-pipeline-setup.ts +205 -0
  743. package/src/track-pipeline.ts +332 -0
  744. package/src/track-session.ts +1010 -0
  745. package/src/transport-pool.ts +128 -0
  746. package/src/wasm-mfu-reassembler.ts +405 -0
  747. package/src/wasm-mmtp-container-parser.ts +23 -0
  748. package/test-vectors/align.json +199 -0
  749. package/test-vectors/catalog/README.md +123 -0
  750. package/test-vectors/catalog/negative/archive-origin-with-path.json +33 -0
  751. package/test-vectors/catalog/negative/archive-unknown-field.json +34 -0
  752. package/test-vectors/catalog/negative/fec-block-profile-missing.json +51 -0
  753. package/test-vectors/catalog/negative/fec-block-profile-retired.json +52 -0
  754. package/test-vectors/catalog/negative/fec-block-profile-unknown.json +52 -0
  755. package/test-vectors/catalog/negative/fec-enhancement-repair-removed.json +28 -0
  756. package/test-vectors/catalog/negative/fec-repair-layer-geometry.json +33 -0
  757. package/test-vectors/catalog/negative/fec-repair-layer-missing-symbols.json +31 -0
  758. package/test-vectors/catalog/negative/fec-repair-multiple-depends.json +32 -0
  759. package/test-vectors/catalog/negative/fec-repair-overlay-with-layer.json +34 -0
  760. package/test-vectors/catalog/negative/fec-repair-priority-out-of-band.json +24 -0
  761. package/test-vectors/catalog/negative/fec-repair-source-symbols-without-scope.json +33 -0
  762. package/test-vectors/catalog/negative/legacy-selection-params.json +15 -0
  763. package/test-vectors/catalog/negative/media-track-repair-layer.json +16 -0
  764. package/test-vectors/catalog/negative/missing-mmtp-fields.json +12 -0
  765. package/test-vectors/catalog/negative/multicast-auth-padded-key.json +37 -0
  766. package/test-vectors/catalog/negative/multicast-auth-reused-track-format.json +53 -0
  767. package/test-vectors/catalog/negative/multicast-auth-trailing-pad-bits.json +37 -0
  768. package/test-vectors/catalog/negative/multicast-endpoint-missing-protocol-and-source.json +24 -0
  769. package/test-vectors/catalog/negative/multicast-network-source-empty.json +44 -0
  770. package/test-vectors/catalog/negative/multicast-packet-id-signaling.json +26 -0
  771. package/test-vectors/catalog/negative/network-source-object.json +25 -0
  772. package/test-vectors/catalog/negative/raptorq-source-symbols-over-max.json +24 -0
  773. package/test-vectors/catalog/negative/raptorq-unaligned-symbol.json +27 -0
  774. package/test-vectors/catalog/negative/repair-track-legacy-shape.json +19 -0
  775. package/test-vectors/catalog/negative/track-role-empty.json +16 -0
  776. package/test-vectors/catalog/negative/track-role-non-string.json +16 -0
  777. package/test-vectors/catalog/positive/archive-origin.json +34 -0
  778. package/test-vectors/catalog/positive/fec-iso-ssbg1.json +52 -0
  779. package/test-vectors/catalog/positive/fec-layered-repair.json +106 -0
  780. package/test-vectors/catalog/positive/fec-multicast.json +53 -0
  781. package/test-vectors/catalog/positive/flat-av.json +30 -0
  782. package/test-vectors/catalog/positive/multicast-auth-rotation.json +55 -0
  783. package/test-vectors/catalog/positive/multicast-native-ssm-no-network-source.json +44 -0
  784. package/test-vectors/catalog/positive/ticks-and-mixed-timescales.json +39 -0
  785. package/test-vectors/catalog/positive/track-role.json +49 -0
  786. package/test-vectors/catalog/releases/moqcast-native-v16-v1/catalog.json +65 -0
  787. package/test-vectors/catalog/releases/moqcast-native-v16-v1.archive.sha256 +1 -0
  788. package/test-vectors/catalog-multicast-auth-v1.json +26 -0
  789. package/test-vectors/catalog-validation.json +767 -0
  790. package/test-vectors/catalog-validator-public-api.mjs +25 -0
  791. package/test-vectors/generate-source-auth-fixture.mjs +114 -0
  792. package/test-vectors/hevc-x265-repeat-headers-v1.json +40 -0
  793. package/test-vectors/source-auth-v1.json +61 -0
  794. package/test-vectors/source-contiguity-v1.json +131 -0
  795. package/test-vectors/subsample-placement-v1.json +230 -0
  796. package/dist/mmtp.d.ts +0 -73
  797. package/dist/mmtp.d.ts.map +0 -1
  798. package/dist/mmtp.js +0 -210
  799. package/dist/mmtp.js.map +0 -1
  800. package/src/mmtp.ts +0 -277
@@ -0,0 +1,1209 @@
1
+ // ../mmt-manifest-verify/node_modules/@noble/hashes/esm/utils.js
2
+ function isBytes(a) {
3
+ return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
4
+ }
5
+ function anumber(n) {
6
+ if (!Number.isSafeInteger(n) || n < 0)
7
+ throw new Error("positive integer expected, got " + n);
8
+ }
9
+ function abytes(b, ...lengths) {
10
+ if (!isBytes(b))
11
+ throw new Error("Uint8Array expected");
12
+ if (lengths.length > 0 && !lengths.includes(b.length))
13
+ throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
14
+ }
15
+ function aexists(instance, checkFinished = true) {
16
+ if (instance.destroyed)
17
+ throw new Error("Hash instance has been destroyed");
18
+ if (checkFinished && instance.finished)
19
+ throw new Error("Hash#digest() has already been called");
20
+ }
21
+ function aoutput(out, instance) {
22
+ abytes(out);
23
+ const min = instance.outputLen;
24
+ if (out.length < min) {
25
+ throw new Error("digestInto() expects output buffer of length at least " + min);
26
+ }
27
+ }
28
+ function u8(arr) {
29
+ return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
30
+ }
31
+ function u32(arr) {
32
+ return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
33
+ }
34
+ function clean(...arrays) {
35
+ for (let i = 0; i < arrays.length; i++) {
36
+ arrays[i].fill(0);
37
+ }
38
+ }
39
+ function rotr(word, shift) {
40
+ return word << 32 - shift | word >>> shift;
41
+ }
42
+ var isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
43
+ function byteSwap(word) {
44
+ return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
45
+ }
46
+ var swap8IfBE = isLE ? (n) => n : (n) => byteSwap(n);
47
+ function byteSwap32(arr) {
48
+ for (let i = 0; i < arr.length; i++) {
49
+ arr[i] = byteSwap(arr[i]);
50
+ }
51
+ return arr;
52
+ }
53
+ var swap32IfBE = isLE ? (u) => u : byteSwap32;
54
+ function utf8ToBytes(str) {
55
+ if (typeof str !== "string")
56
+ throw new Error("string expected");
57
+ return new Uint8Array(new TextEncoder().encode(str));
58
+ }
59
+ function toBytes(data) {
60
+ if (typeof data === "string")
61
+ data = utf8ToBytes(data);
62
+ abytes(data);
63
+ return data;
64
+ }
65
+ var Hash = class {
66
+ };
67
+ function createXOFer(hashCons) {
68
+ const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
69
+ const tmp = hashCons({});
70
+ hashC.outputLen = tmp.outputLen;
71
+ hashC.blockLen = tmp.blockLen;
72
+ hashC.create = (opts) => hashCons(opts);
73
+ return hashC;
74
+ }
75
+
76
+ // ../mmt-manifest-verify/node_modules/@noble/hashes/esm/_md.js
77
+ var SHA256_IV = /* @__PURE__ */ Uint32Array.from([
78
+ 1779033703,
79
+ 3144134277,
80
+ 1013904242,
81
+ 2773480762,
82
+ 1359893119,
83
+ 2600822924,
84
+ 528734635,
85
+ 1541459225
86
+ ]);
87
+
88
+ // ../mmt-manifest-verify/node_modules/@noble/hashes/esm/_u64.js
89
+ var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
90
+ var _32n = /* @__PURE__ */ BigInt(32);
91
+ function fromBig(n, le = false) {
92
+ if (le)
93
+ return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
94
+ return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
95
+ }
96
+
97
+ // ../mmt-manifest-verify/node_modules/@noble/hashes/esm/_blake.js
98
+ function G1s(a, b, c, d, x) {
99
+ a = a + b + x | 0;
100
+ d = rotr(d ^ a, 16);
101
+ c = c + d | 0;
102
+ b = rotr(b ^ c, 12);
103
+ return { a, b, c, d };
104
+ }
105
+ function G2s(a, b, c, d, x) {
106
+ a = a + b + x | 0;
107
+ d = rotr(d ^ a, 8);
108
+ c = c + d | 0;
109
+ b = rotr(b ^ c, 7);
110
+ return { a, b, c, d };
111
+ }
112
+
113
+ // ../mmt-manifest-verify/node_modules/@noble/hashes/esm/blake2.js
114
+ var BLAKE2 = class extends Hash {
115
+ constructor(blockLen, outputLen) {
116
+ super();
117
+ this.finished = false;
118
+ this.destroyed = false;
119
+ this.length = 0;
120
+ this.pos = 0;
121
+ anumber(blockLen);
122
+ anumber(outputLen);
123
+ this.blockLen = blockLen;
124
+ this.outputLen = outputLen;
125
+ this.buffer = new Uint8Array(blockLen);
126
+ this.buffer32 = u32(this.buffer);
127
+ }
128
+ update(data) {
129
+ aexists(this);
130
+ data = toBytes(data);
131
+ abytes(data);
132
+ const { blockLen, buffer, buffer32 } = this;
133
+ const len = data.length;
134
+ const offset = data.byteOffset;
135
+ const buf = data.buffer;
136
+ for (let pos = 0; pos < len; ) {
137
+ if (this.pos === blockLen) {
138
+ swap32IfBE(buffer32);
139
+ this.compress(buffer32, 0, false);
140
+ swap32IfBE(buffer32);
141
+ this.pos = 0;
142
+ }
143
+ const take = Math.min(blockLen - this.pos, len - pos);
144
+ const dataOffset = offset + pos;
145
+ if (take === blockLen && !(dataOffset % 4) && pos + take < len) {
146
+ const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4));
147
+ swap32IfBE(data32);
148
+ for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) {
149
+ this.length += blockLen;
150
+ this.compress(data32, pos32, false);
151
+ }
152
+ swap32IfBE(data32);
153
+ continue;
154
+ }
155
+ buffer.set(data.subarray(pos, pos + take), this.pos);
156
+ this.pos += take;
157
+ this.length += take;
158
+ pos += take;
159
+ }
160
+ return this;
161
+ }
162
+ digestInto(out) {
163
+ aexists(this);
164
+ aoutput(out, this);
165
+ const { pos, buffer32 } = this;
166
+ this.finished = true;
167
+ clean(this.buffer.subarray(pos));
168
+ swap32IfBE(buffer32);
169
+ this.compress(buffer32, 0, true);
170
+ swap32IfBE(buffer32);
171
+ const out32 = u32(out);
172
+ this.get().forEach((v, i) => out32[i] = swap8IfBE(v));
173
+ }
174
+ digest() {
175
+ const { buffer, outputLen } = this;
176
+ this.digestInto(buffer);
177
+ const res = buffer.slice(0, outputLen);
178
+ this.destroy();
179
+ return res;
180
+ }
181
+ _cloneInto(to) {
182
+ const { buffer, length, finished, destroyed, outputLen, pos } = this;
183
+ to || (to = new this.constructor({ dkLen: outputLen }));
184
+ to.set(...this.get());
185
+ to.buffer.set(buffer);
186
+ to.destroyed = destroyed;
187
+ to.finished = finished;
188
+ to.length = length;
189
+ to.pos = pos;
190
+ to.outputLen = outputLen;
191
+ return to;
192
+ }
193
+ clone() {
194
+ return this._cloneInto();
195
+ }
196
+ };
197
+ function compress(s, offset, msg, rounds, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) {
198
+ let j = 0;
199
+ for (let i = 0; i < rounds; i++) {
200
+ ({ a: v0, b: v4, c: v8, d: v12 } = G1s(v0, v4, v8, v12, msg[offset + s[j++]]));
201
+ ({ a: v0, b: v4, c: v8, d: v12 } = G2s(v0, v4, v8, v12, msg[offset + s[j++]]));
202
+ ({ a: v1, b: v5, c: v9, d: v13 } = G1s(v1, v5, v9, v13, msg[offset + s[j++]]));
203
+ ({ a: v1, b: v5, c: v9, d: v13 } = G2s(v1, v5, v9, v13, msg[offset + s[j++]]));
204
+ ({ a: v2, b: v6, c: v10, d: v14 } = G1s(v2, v6, v10, v14, msg[offset + s[j++]]));
205
+ ({ a: v2, b: v6, c: v10, d: v14 } = G2s(v2, v6, v10, v14, msg[offset + s[j++]]));
206
+ ({ a: v3, b: v7, c: v11, d: v15 } = G1s(v3, v7, v11, v15, msg[offset + s[j++]]));
207
+ ({ a: v3, b: v7, c: v11, d: v15 } = G2s(v3, v7, v11, v15, msg[offset + s[j++]]));
208
+ ({ a: v0, b: v5, c: v10, d: v15 } = G1s(v0, v5, v10, v15, msg[offset + s[j++]]));
209
+ ({ a: v0, b: v5, c: v10, d: v15 } = G2s(v0, v5, v10, v15, msg[offset + s[j++]]));
210
+ ({ a: v1, b: v6, c: v11, d: v12 } = G1s(v1, v6, v11, v12, msg[offset + s[j++]]));
211
+ ({ a: v1, b: v6, c: v11, d: v12 } = G2s(v1, v6, v11, v12, msg[offset + s[j++]]));
212
+ ({ a: v2, b: v7, c: v8, d: v13 } = G1s(v2, v7, v8, v13, msg[offset + s[j++]]));
213
+ ({ a: v2, b: v7, c: v8, d: v13 } = G2s(v2, v7, v8, v13, msg[offset + s[j++]]));
214
+ ({ a: v3, b: v4, c: v9, d: v14 } = G1s(v3, v4, v9, v14, msg[offset + s[j++]]));
215
+ ({ a: v3, b: v4, c: v9, d: v14 } = G2s(v3, v4, v9, v14, msg[offset + s[j++]]));
216
+ }
217
+ return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 };
218
+ }
219
+
220
+ // ../mmt-manifest-verify/node_modules/@noble/hashes/esm/blake3.js
221
+ var B3_Flags = {
222
+ CHUNK_START: 1,
223
+ CHUNK_END: 2,
224
+ PARENT: 4,
225
+ ROOT: 8,
226
+ KEYED_HASH: 16,
227
+ DERIVE_KEY_CONTEXT: 32,
228
+ DERIVE_KEY_MATERIAL: 64
229
+ };
230
+ var B3_IV = SHA256_IV.slice();
231
+ var B3_SIGMA = /* @__PURE__ */ (() => {
232
+ const Id = Array.from({ length: 16 }, (_, i) => i);
233
+ const permute = (arr) => [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]);
234
+ const res = [];
235
+ for (let i = 0, v = Id; i < 7; i++, v = permute(v))
236
+ res.push(...v);
237
+ return Uint8Array.from(res);
238
+ })();
239
+ var BLAKE3 = class _BLAKE3 extends BLAKE2 {
240
+ constructor(opts = {}, flags = 0) {
241
+ super(64, opts.dkLen === void 0 ? 32 : opts.dkLen);
242
+ this.chunkPos = 0;
243
+ this.chunksDone = 0;
244
+ this.flags = 0 | 0;
245
+ this.stack = [];
246
+ this.posOut = 0;
247
+ this.bufferOut32 = new Uint32Array(16);
248
+ this.chunkOut = 0;
249
+ this.enableXOF = true;
250
+ const { key, context } = opts;
251
+ const hasContext = context !== void 0;
252
+ if (key !== void 0) {
253
+ if (hasContext)
254
+ throw new Error('Only "key" or "context" can be specified at same time');
255
+ const k = toBytes(key).slice();
256
+ abytes(k, 32);
257
+ this.IV = u32(k);
258
+ swap32IfBE(this.IV);
259
+ this.flags = flags | B3_Flags.KEYED_HASH;
260
+ } else if (hasContext) {
261
+ const ctx = toBytes(context);
262
+ const contextKey = new _BLAKE3({ dkLen: 32 }, B3_Flags.DERIVE_KEY_CONTEXT).update(ctx).digest();
263
+ this.IV = u32(contextKey);
264
+ swap32IfBE(this.IV);
265
+ this.flags = flags | B3_Flags.DERIVE_KEY_MATERIAL;
266
+ } else {
267
+ this.IV = B3_IV.slice();
268
+ this.flags = flags;
269
+ }
270
+ this.state = this.IV.slice();
271
+ this.bufferOut = u8(this.bufferOut32);
272
+ }
273
+ // Unused
274
+ get() {
275
+ return [];
276
+ }
277
+ set() {
278
+ }
279
+ b2Compress(counter, flags, buf, bufPos = 0) {
280
+ const { state: s, pos } = this;
281
+ const { h, l } = fromBig(BigInt(counter), true);
282
+ const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(B3_SIGMA, bufPos, buf, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], h, l, pos, flags);
283
+ s[0] = v0 ^ v8;
284
+ s[1] = v1 ^ v9;
285
+ s[2] = v2 ^ v10;
286
+ s[3] = v3 ^ v11;
287
+ s[4] = v4 ^ v12;
288
+ s[5] = v5 ^ v13;
289
+ s[6] = v6 ^ v14;
290
+ s[7] = v7 ^ v15;
291
+ }
292
+ compress(buf, bufPos = 0, isLast = false) {
293
+ let flags = this.flags;
294
+ if (!this.chunkPos)
295
+ flags |= B3_Flags.CHUNK_START;
296
+ if (this.chunkPos === 15 || isLast)
297
+ flags |= B3_Flags.CHUNK_END;
298
+ if (!isLast)
299
+ this.pos = this.blockLen;
300
+ this.b2Compress(this.chunksDone, flags, buf, bufPos);
301
+ this.chunkPos += 1;
302
+ if (this.chunkPos === 16 || isLast) {
303
+ let chunk = this.state;
304
+ this.state = this.IV.slice();
305
+ for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) {
306
+ if (!(last = this.stack.pop()))
307
+ break;
308
+ this.buffer32.set(last, 0);
309
+ this.buffer32.set(chunk, 8);
310
+ this.pos = this.blockLen;
311
+ this.b2Compress(0, this.flags | B3_Flags.PARENT, this.buffer32, 0);
312
+ chunk = this.state;
313
+ this.state = this.IV.slice();
314
+ }
315
+ this.chunksDone++;
316
+ this.chunkPos = 0;
317
+ this.stack.push(chunk);
318
+ }
319
+ this.pos = 0;
320
+ }
321
+ _cloneInto(to) {
322
+ to = super._cloneInto(to);
323
+ const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this;
324
+ to.state.set(state.slice());
325
+ to.stack = stack.map((i) => Uint32Array.from(i));
326
+ to.IV.set(IV);
327
+ to.flags = flags;
328
+ to.chunkPos = chunkPos;
329
+ to.chunksDone = chunksDone;
330
+ to.posOut = posOut;
331
+ to.chunkOut = chunkOut;
332
+ to.enableXOF = this.enableXOF;
333
+ to.bufferOut32.set(this.bufferOut32);
334
+ return to;
335
+ }
336
+ destroy() {
337
+ this.destroyed = true;
338
+ clean(this.state, this.buffer32, this.IV, this.bufferOut32);
339
+ clean(...this.stack);
340
+ }
341
+ // Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8)
342
+ b2CompressOut() {
343
+ const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this;
344
+ const { h, l } = fromBig(BigInt(this.chunkOut++));
345
+ swap32IfBE(buffer32);
346
+ const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(B3_SIGMA, 0, buffer32, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], l, h, pos, flags);
347
+ out32[0] = v0 ^ v8;
348
+ out32[1] = v1 ^ v9;
349
+ out32[2] = v2 ^ v10;
350
+ out32[3] = v3 ^ v11;
351
+ out32[4] = v4 ^ v12;
352
+ out32[5] = v5 ^ v13;
353
+ out32[6] = v6 ^ v14;
354
+ out32[7] = v7 ^ v15;
355
+ out32[8] = s[0] ^ v8;
356
+ out32[9] = s[1] ^ v9;
357
+ out32[10] = s[2] ^ v10;
358
+ out32[11] = s[3] ^ v11;
359
+ out32[12] = s[4] ^ v12;
360
+ out32[13] = s[5] ^ v13;
361
+ out32[14] = s[6] ^ v14;
362
+ out32[15] = s[7] ^ v15;
363
+ swap32IfBE(buffer32);
364
+ swap32IfBE(out32);
365
+ this.posOut = 0;
366
+ }
367
+ finish() {
368
+ if (this.finished)
369
+ return;
370
+ this.finished = true;
371
+ clean(this.buffer.subarray(this.pos));
372
+ let flags = this.flags | B3_Flags.ROOT;
373
+ if (this.stack.length) {
374
+ flags |= B3_Flags.PARENT;
375
+ swap32IfBE(this.buffer32);
376
+ this.compress(this.buffer32, 0, true);
377
+ swap32IfBE(this.buffer32);
378
+ this.chunksDone = 0;
379
+ this.pos = this.blockLen;
380
+ } else {
381
+ flags |= (!this.chunkPos ? B3_Flags.CHUNK_START : 0) | B3_Flags.CHUNK_END;
382
+ }
383
+ this.flags = flags;
384
+ this.b2CompressOut();
385
+ }
386
+ writeInto(out) {
387
+ aexists(this, false);
388
+ abytes(out);
389
+ this.finish();
390
+ const { blockLen, bufferOut } = this;
391
+ for (let pos = 0, len = out.length; pos < len; ) {
392
+ if (this.posOut >= blockLen)
393
+ this.b2CompressOut();
394
+ const take = Math.min(blockLen - this.posOut, len - pos);
395
+ out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
396
+ this.posOut += take;
397
+ pos += take;
398
+ }
399
+ return out;
400
+ }
401
+ xofInto(out) {
402
+ if (!this.enableXOF)
403
+ throw new Error("XOF is not possible after digest call");
404
+ return this.writeInto(out);
405
+ }
406
+ xof(bytes) {
407
+ anumber(bytes);
408
+ return this.xofInto(new Uint8Array(bytes));
409
+ }
410
+ digestInto(out) {
411
+ aoutput(out, this);
412
+ if (this.finished)
413
+ throw new Error("digest() was already called");
414
+ this.enableXOF = false;
415
+ this.writeInto(out);
416
+ this.destroy();
417
+ return out;
418
+ }
419
+ digest() {
420
+ return this.digestInto(new Uint8Array(this.outputLen));
421
+ }
422
+ };
423
+ var blake3 = /* @__PURE__ */ createXOFer((opts) => new BLAKE3(opts));
424
+
425
+ // ../mmt-manifest-verify/dist/source-auth.js
426
+ var SOURCE_AUTH_MANIFEST_VERSION = 1;
427
+ var SOURCE_AUTH_OBJECT_ENTRY_FRAME = 1;
428
+ var SOURCE_AUTH_GROUP_CLOSE_FRAME = 2;
429
+ var SOURCE_AUTH_OBJECT_ENTRY_LENGTH = 52;
430
+ var SOURCE_AUTH_GROUP_CLOSE_LENGTH = 112;
431
+ var SOURCE_AUTH_MAX_OBJECTS_PER_GROUP = 4096;
432
+ var SOURCE_AUTH_MAX_TRUE_LENGTH = 16 * 1024 * 1024;
433
+ var SOURCE_AUTH_SCOPE_LENGTH = 32;
434
+ var SIGNATURE_DOMAIN = new TextEncoder().encode("blockcast-mmt-root-v1\0\0\0");
435
+ function requireBytes(name, value, length) {
436
+ if (value.byteLength !== length) {
437
+ throw new Error(`${name} must be ${length} bytes, got ${value.byteLength}`);
438
+ }
439
+ }
440
+ function requireU32(name, value) {
441
+ if (!Number.isInteger(value) || value < 0 || value > 4294967295) {
442
+ throw new Error(`${name} must be an unsigned 32-bit integer`);
443
+ }
444
+ }
445
+ function requireU64(name, value) {
446
+ if (value < 0n || value > 0xffffffffffffffffn) {
447
+ throw new Error(`${name} must be an unsigned 64-bit integer`);
448
+ }
449
+ }
450
+ function requireTrueLength(value) {
451
+ requireU32("trueLength", value);
452
+ if (value > SOURCE_AUTH_MAX_TRUE_LENGTH) {
453
+ throw new Error(`trueLength exceeds the ${SOURCE_AUTH_MAX_TRUE_LENGTH}-byte profile maximum`);
454
+ }
455
+ }
456
+ function sourceAuthObjectDigest(object) {
457
+ return blake3(object);
458
+ }
459
+ function sourceAuthLeafHash(groupId, objectId, digest, trueLength) {
460
+ requireU64("groupId", groupId);
461
+ requireU32("objectId", objectId);
462
+ requireBytes("digest", digest, 32);
463
+ requireTrueLength(trueLength);
464
+ const preimage = new Uint8Array(49);
465
+ const view = new DataView(preimage.buffer);
466
+ view.setBigUint64(1, groupId);
467
+ view.setUint32(9, objectId);
468
+ preimage.set(digest, 13);
469
+ view.setUint32(45, trueLength);
470
+ return blake3(preimage);
471
+ }
472
+ function sourceAuthMerkleRoot(entries) {
473
+ if (entries.length === 0)
474
+ throw new Error("Merkle tree requires at least one object");
475
+ if (entries.length > SOURCE_AUTH_MAX_OBJECTS_PER_GROUP) {
476
+ throw new Error(`group exceeds ${SOURCE_AUTH_MAX_OBJECTS_PER_GROUP} objects`);
477
+ }
478
+ const groupId = entries[0].groupId;
479
+ const objectIds = /* @__PURE__ */ new Set();
480
+ const ordered = [...entries].sort((left, right) => left.objectId - right.objectId);
481
+ let level = ordered.map((entry) => {
482
+ if (entry.groupId !== groupId)
483
+ throw new Error("Merkle entries must belong to one group");
484
+ if (objectIds.has(entry.objectId))
485
+ throw new Error(`duplicate objectId ${entry.objectId}`);
486
+ objectIds.add(entry.objectId);
487
+ return sourceAuthLeafHash(entry.groupId, entry.objectId, entry.digest, entry.trueLength);
488
+ });
489
+ while (level.length > 1) {
490
+ const parents = [];
491
+ for (let index = 0; index < level.length; index += 2) {
492
+ const left = level[index];
493
+ const right = level[index + 1] ?? left;
494
+ const preimage = new Uint8Array(65);
495
+ preimage[0] = 1;
496
+ preimage.set(left, 1);
497
+ preimage.set(right, 33);
498
+ parents.push(blake3(preimage));
499
+ }
500
+ level = parents;
501
+ }
502
+ return level[0];
503
+ }
504
+ function trimRecoveredSourceAuthObject(recoveredSymbol, trueLength) {
505
+ requireTrueLength(trueLength);
506
+ if (trueLength > recoveredSymbol.byteLength) {
507
+ throw new Error(`true length ${trueLength} exceeds recovered object size ${recoveredSymbol.byteLength}`);
508
+ }
509
+ return recoveredSymbol.subarray(0, trueLength);
510
+ }
511
+ function encodeSourceAuthObjectEntry(entry) {
512
+ requireU32("objectId", entry.objectId);
513
+ requireTrueLength(entry.trueLength);
514
+ requireU64("groupId", entry.groupId);
515
+ requireBytes("digest", entry.digest, 32);
516
+ const frame = new Uint8Array(SOURCE_AUTH_OBJECT_ENTRY_LENGTH);
517
+ const view = new DataView(frame.buffer);
518
+ frame[0] = SOURCE_AUTH_OBJECT_ENTRY_FRAME;
519
+ frame[1] = SOURCE_AUTH_MANIFEST_VERSION;
520
+ view.setBigUint64(4, entry.groupId);
521
+ view.setUint32(12, entry.objectId);
522
+ view.setUint32(16, entry.trueLength);
523
+ frame.set(entry.digest, 20);
524
+ return frame;
525
+ }
526
+ function encodeSourceAuthGroupClose(close) {
527
+ requireU32("objectCount", close.objectCount);
528
+ if (close.objectCount === 0 || close.objectCount > SOURCE_AUTH_MAX_OBJECTS_PER_GROUP) {
529
+ throw new Error(`objectCount must be between 1 and ${SOURCE_AUTH_MAX_OBJECTS_PER_GROUP}`);
530
+ }
531
+ requireU64("groupId", close.groupId);
532
+ requireBytes("root", close.root, 32);
533
+ requireBytes("signature", close.signature, 64);
534
+ const frame = new Uint8Array(SOURCE_AUTH_GROUP_CLOSE_LENGTH);
535
+ const view = new DataView(frame.buffer);
536
+ frame[0] = SOURCE_AUTH_GROUP_CLOSE_FRAME;
537
+ frame[1] = SOURCE_AUTH_MANIFEST_VERSION;
538
+ view.setBigUint64(4, close.groupId);
539
+ view.setUint32(12, close.objectCount);
540
+ frame.set(close.root, 16);
541
+ frame.set(close.signature, 48);
542
+ return frame;
543
+ }
544
+ function sourceAuthSignaturePreimage(authScope, groupId, objectCount, root) {
545
+ requireU32("objectCount", objectCount);
546
+ if (objectCount === 0 || objectCount > SOURCE_AUTH_MAX_OBJECTS_PER_GROUP) {
547
+ throw new Error(`objectCount must be between 1 and ${SOURCE_AUTH_MAX_OBJECTS_PER_GROUP}`);
548
+ }
549
+ requireU64("groupId", groupId);
550
+ requireBytes("authScope", authScope, SOURCE_AUTH_SCOPE_LENGTH);
551
+ requireBytes("root", root, 32);
552
+ const preimage = new Uint8Array(100);
553
+ const view = new DataView(preimage.buffer);
554
+ preimage.set(SIGNATURE_DOMAIN);
555
+ preimage.set(authScope, 24);
556
+ view.setBigUint64(56, groupId);
557
+ view.setUint32(64, objectCount);
558
+ preimage.set(root, 68);
559
+ return preimage;
560
+ }
561
+ function decodeSourceAuthManifestFrame(frame) {
562
+ const frameType = frame[0];
563
+ const expectedLength = frameType === SOURCE_AUTH_OBJECT_ENTRY_FRAME ? SOURCE_AUTH_OBJECT_ENTRY_LENGTH : frameType === SOURCE_AUTH_GROUP_CLOSE_FRAME ? SOURCE_AUTH_GROUP_CLOSE_LENGTH : 0;
564
+ if (expectedLength === 0)
565
+ throw new Error(`unsupported manifest frame type ${frameType}`);
566
+ if (frame.byteLength !== expectedLength) {
567
+ throw new Error(`manifest frame has invalid length ${frame.byteLength} for type ${frameType}`);
568
+ }
569
+ if (frame[1] !== SOURCE_AUTH_MANIFEST_VERSION) {
570
+ throw new Error(`unsupported manifest version ${frame[1]}`);
571
+ }
572
+ if (frame[2] !== 0 || frame[3] !== 0)
573
+ throw new Error("manifest reserved bits must be zero");
574
+ const view = new DataView(frame.buffer, frame.byteOffset, frame.byteLength);
575
+ const groupId = view.getBigUint64(4);
576
+ if (frameType === SOURCE_AUTH_OBJECT_ENTRY_FRAME) {
577
+ const entry = {
578
+ kind: "object",
579
+ groupId,
580
+ objectId: view.getUint32(12),
581
+ trueLength: view.getUint32(16),
582
+ digest: frame.slice(20, 52)
583
+ };
584
+ requireTrueLength(entry.trueLength);
585
+ return entry;
586
+ }
587
+ const close = {
588
+ kind: "close",
589
+ groupId,
590
+ objectCount: view.getUint32(12),
591
+ root: frame.slice(16, 48),
592
+ signature: frame.slice(48, 112)
593
+ };
594
+ if (close.objectCount === 0 || close.objectCount > SOURCE_AUTH_MAX_OBJECTS_PER_GROUP) {
595
+ throw new Error(`objectCount must be between 1 and ${SOURCE_AUTH_MAX_OBJECTS_PER_GROUP}`);
596
+ }
597
+ return close;
598
+ }
599
+
600
+ // ../mmt-manifest-verify/dist/admission.js
601
+ function requireU642(name, value) {
602
+ if (value < 0n || value > 0xffffffffffffffffn) {
603
+ throw new Error(`${name} must be an unsigned 64-bit integer`);
604
+ }
605
+ }
606
+ function equalBytes(left, right) {
607
+ if (left.byteLength !== right.byteLength)
608
+ return false;
609
+ return left.every((value, index) => value === right[index]);
610
+ }
611
+ var SourceAuthAdmission = class {
612
+ #manifestAuthenticated;
613
+ #entries = /* @__PURE__ */ new Map();
614
+ #pendingObjects = /* @__PURE__ */ new Map();
615
+ #entriesAwaitingObjects = /* @__PURE__ */ new Set();
616
+ #admissions = /* @__PURE__ */ new Map();
617
+ #groupId = null;
618
+ #closed = false;
619
+ constructor(options) {
620
+ this.#manifestAuthenticated = options.manifestAuthenticated;
621
+ }
622
+ admitObject(input) {
623
+ this.#requireGroup(input.groupId);
624
+ if (this.#closed)
625
+ throw new Error("source-auth group is already closed");
626
+ if (this.#admissions.has(input.objectId) || this.#pendingObjects.has(input.objectId)) {
627
+ throw new Error(`duplicate source-auth object ${input.objectId}`);
628
+ }
629
+ const entry = this.#entries.get(input.objectId);
630
+ if (entry) {
631
+ this.#entriesAwaitingObjects.delete(input.objectId);
632
+ return this.#verifyObject(entry, input.bytes, input.recovered ?? false);
633
+ }
634
+ if (this.#pendingObjects.size >= 1) {
635
+ throw new Error("source-auth media exceeds one-object manifest skew");
636
+ }
637
+ this.#pendingObjects.set(input.objectId, {
638
+ bytes: input.bytes,
639
+ recovered: input.recovered ?? false
640
+ });
641
+ return {
642
+ groupId: input.groupId,
643
+ objectId: input.objectId,
644
+ recovered: input.recovered ?? false,
645
+ state: "pending-entry"
646
+ };
647
+ }
648
+ admitEntry(entry) {
649
+ this.#requireGroup(entry.groupId);
650
+ if (this.#closed)
651
+ throw new Error("source-auth group is already closed");
652
+ if (this.#entries.has(entry.objectId)) {
653
+ throw new Error(`duplicate source-auth manifest entry ${entry.objectId}`);
654
+ }
655
+ const pending = this.#pendingObjects.get(entry.objectId);
656
+ if (!pending && this.#entriesAwaitingObjects.size >= 1) {
657
+ throw new Error("source-auth manifest exceeds one-object media skew");
658
+ }
659
+ this.#entries.set(entry.objectId, entry);
660
+ if (!pending) {
661
+ this.#entriesAwaitingObjects.add(entry.objectId);
662
+ return "pending-object";
663
+ }
664
+ this.#pendingObjects.delete(entry.objectId);
665
+ return this.#verifyObject(entry, pending.bytes, pending.recovered);
666
+ }
667
+ objectState(objectId) {
668
+ if (this.#pendingObjects.has(objectId))
669
+ return "pending-entry";
670
+ if (this.#entriesAwaitingObjects.has(objectId))
671
+ return "pending-object";
672
+ if (this.#closed && this.#admissions.has(objectId))
673
+ return "authenticated";
674
+ return this.#admissions.get(objectId)?.state;
675
+ }
676
+ async verifyClose(close, authScope, publicKey, subtle = globalThis.crypto.subtle) {
677
+ this.#requireGroup(close.groupId);
678
+ if (this.#closed)
679
+ throw new Error("source-auth group is already closed");
680
+ if (this.#pendingObjects.size !== 0 || this.#entriesAwaitingObjects.size !== 0) {
681
+ throw new Error("source-auth group closed with unmatched objects or entries");
682
+ }
683
+ if (close.objectCount !== this.#entries.size || this.#admissions.size !== this.#entries.size) {
684
+ throw new Error("source-auth group close object count mismatch");
685
+ }
686
+ const root = sourceAuthMerkleRoot([...this.#entries.values()]);
687
+ if (!equalBytes(root, close.root))
688
+ throw new Error("source-auth group root mismatch");
689
+ const verified = await subtle.verify("Ed25519", publicKey, new Uint8Array(close.signature).buffer, new Uint8Array(sourceAuthSignaturePreimage(authScope, close.groupId, close.objectCount, root)).buffer);
690
+ if (!verified)
691
+ throw new Error("source-auth group close signature failed");
692
+ for (const admission of this.#admissions.values())
693
+ admission.state = "authenticated";
694
+ this.#closed = true;
695
+ }
696
+ #requireGroup(groupId) {
697
+ requireU642("groupId", groupId);
698
+ if (this.#groupId === null)
699
+ this.#groupId = groupId;
700
+ else if (this.#groupId !== groupId)
701
+ throw new Error("source-auth group identity mismatch");
702
+ }
703
+ #verifyObject(entry, bytes, recovered) {
704
+ const authenticated = recovered ? trimRecoveredSourceAuthObject(bytes, entry.trueLength) : bytes;
705
+ if (!recovered && bytes.byteLength !== entry.trueLength) {
706
+ throw new Error(`direct source-auth object length mismatch for ${entry.objectId}`);
707
+ }
708
+ if (!equalBytes(sourceAuthObjectDigest(authenticated), entry.digest)) {
709
+ throw new Error(`source-auth object digest mismatch for ${entry.objectId}`);
710
+ }
711
+ const admission = {
712
+ groupId: entry.groupId,
713
+ objectId: entry.objectId,
714
+ recovered,
715
+ state: this.#manifestAuthenticated ? "authenticated" : "provisional"
716
+ };
717
+ this.#admissions.set(entry.objectId, admission);
718
+ return admission;
719
+ }
720
+ };
721
+
722
+ // ../mmt-manifest-verify/dist/verifier.js
723
+ function manifestBindingId(trackName, sourceSymbolFormat) {
724
+ return JSON.stringify([trackName, sourceSymbolFormat]);
725
+ }
726
+ function createWebCryptoEd25519Verifier(subtle = globalThis.crypto.subtle) {
727
+ return async (publicKey, message, signature) => {
728
+ const keyBytes = Uint8Array.from(publicKey);
729
+ const messageBytes = Uint8Array.from(message);
730
+ const signatureBytes = Uint8Array.from(signature);
731
+ const key = await subtle.importKey("raw", keyBytes.buffer, "Ed25519", false, ["verify"]);
732
+ return subtle.verify("Ed25519", key, signatureBytes.buffer, messageBytes.buffer);
733
+ };
734
+ }
735
+ var FAILURE_REASONS = [
736
+ "sigInvalid",
737
+ "digestMismatch",
738
+ "manifestLate",
739
+ "manifestAbsent",
740
+ "verifierError"
741
+ ];
742
+ var equalBytes2 = (left, right) => {
743
+ if (left.byteLength !== right.byteLength)
744
+ return false;
745
+ let diff = 0;
746
+ for (let index = 0; index < left.byteLength; index++)
747
+ diff |= left[index] ^ right[index];
748
+ return diff === 0;
749
+ };
750
+ var isPromiseLike = (value) => typeof value === "object" && value !== null && typeof value.then === "function";
751
+ var ManifestVerifier = class {
752
+ #config;
753
+ #verifySignature;
754
+ #onFailure;
755
+ #tracks = /* @__PURE__ */ new Map();
756
+ #stats = {
757
+ verified: 0,
758
+ failures: Object.fromEntries(FAILURE_REASONS.map((reason) => [reason, 0])),
759
+ quarantinedBytes: 0
760
+ };
761
+ #disposed = false;
762
+ constructor(options) {
763
+ this.#config = { ...options.manifestAuth };
764
+ this.#verifySignature = options.verifySignature;
765
+ this.#onFailure = options.onFailure;
766
+ }
767
+ get config() {
768
+ return this.#config;
769
+ }
770
+ get stats() {
771
+ let quarantined = 0;
772
+ for (const track of this.#tracks.values())
773
+ quarantined += track.quarantine.length;
774
+ return {
775
+ verified: this.#stats.verified,
776
+ failures: { ...this.#stats.failures },
777
+ quarantined,
778
+ quarantinedBytes: this.#stats.quarantinedBytes
779
+ };
780
+ }
781
+ setMode(mode) {
782
+ this.#config = { ...this.#config, mode };
783
+ if (mode !== "enforce")
784
+ this.#releaseAllQuarantine(false);
785
+ }
786
+ registerTrack(context) {
787
+ const bindingId = context.bindingId ?? context.trackName;
788
+ if (this.#tracks.has(bindingId)) {
789
+ throw new Error(`manifest binding ${bindingId} is already registered`);
790
+ }
791
+ if (!Number.isFinite(context.bitrate) || context.bitrate <= 0) {
792
+ throw new Error("manifest track bitrate must be > 0");
793
+ }
794
+ if (!Number.isFinite(context.groupDurationMs) || context.groupDurationMs <= 0) {
795
+ throw new Error("manifest track groupDurationMs must be > 0");
796
+ }
797
+ if (context.authScope.byteLength !== 32)
798
+ throw new Error("manifest authScope must be 32 bytes");
799
+ if (context.publicKey.byteLength !== 32)
800
+ throw new Error("manifest publicKey must be 32 bytes");
801
+ for (const key of context.acceptedPublicKeys ?? []) {
802
+ if (key.byteLength !== 32)
803
+ throw new Error("manifest acceptedPublicKeys must contain 32-byte keys");
804
+ }
805
+ for (const [name, value] of Object.entries({
806
+ broadcastNamespaceId: context.broadcastNamespaceId,
807
+ trackName: context.trackName,
808
+ codec: context.codec,
809
+ timing: context.timing,
810
+ fecGeometry: context.fecGeometry
811
+ })) {
812
+ if (value.length === 0)
813
+ throw new Error(`manifest ${name} must not be empty`);
814
+ }
815
+ this.#tracks.set(bindingId, {
816
+ context: { ...context, bindingId },
817
+ groups: /* @__PURE__ */ new Map(),
818
+ quarantine: [],
819
+ quarantinedBytes: 0,
820
+ capBytes: Math.ceil(context.bitrate * context.groupDurationMs / 8e3),
821
+ manifestEntries: 0,
822
+ maxManifestEntries: Math.ceil(context.bitrate * context.groupDurationMs / (8e3 * 52)),
823
+ maxGroups: context.mapper.d + 1
824
+ });
825
+ }
826
+ ingestManifestFrame(bindingId, frameBytes) {
827
+ const track = this.#requireTrack(bindingId);
828
+ try {
829
+ const frame = decodeSourceAuthManifestFrame(frameBytes);
830
+ const groupId = frame.groupId;
831
+ const group = this.#group(track, groupId);
832
+ if (frame.kind === "object") {
833
+ if (group.close || group.signaturePending || group.failed) {
834
+ this.#failure({ trackName: track.context.trackName, bindingId, groupId, objectId: frame.objectId }, "verifierError");
835
+ return;
836
+ }
837
+ if (group.entries.has(frame.objectId)) {
838
+ this.#failure({ trackName: track.context.trackName, bindingId, groupId, objectId: frame.objectId }, "verifierError");
839
+ return;
840
+ }
841
+ if (group.entries.size >= 4096 || track.manifestEntries >= track.maxManifestEntries) {
842
+ this.#failure({ trackName: track.context.trackName, bindingId, groupId, objectId: frame.objectId }, "verifierError");
843
+ return;
844
+ }
845
+ group.entries.set(frame.objectId, frame);
846
+ track.manifestEntries++;
847
+ const pending = group.pending.get(frame.objectId);
848
+ if (pending) {
849
+ this.#failure(pending.identity, "manifestLate");
850
+ this.#resolvePending(track, group, pending, frame);
851
+ }
852
+ if (group.pendingClose && group.entries.size === group.pendingClose.objectCount) {
853
+ const close = group.pendingClose;
854
+ group.pendingClose = void 0;
855
+ this.#closeGroup(track, groupId, group, close);
856
+ }
857
+ return;
858
+ }
859
+ this.#closeGroup(track, groupId, group, frame);
860
+ } catch {
861
+ this.#failure({ trackName: track.context.trackName, bindingId, groupId: 0, objectId: 0 }, "verifierError");
862
+ }
863
+ }
864
+ admitObject(identity, data, release, discard) {
865
+ if (this.#config.mode === "off") {
866
+ release();
867
+ return { action: "play", verified: false };
868
+ }
869
+ const track = this.#tracks.get(identity.bindingId ?? identity.trackName);
870
+ if (!track) {
871
+ release();
872
+ this.#failure(identity, "verifierError");
873
+ return { action: "play", verified: false, reason: "verifierError" };
874
+ }
875
+ try {
876
+ if (!this.#validateIdentity(track, identity)) {
877
+ return this.#rejectOrShadow(identity, release, "digestMismatch");
878
+ }
879
+ const group = this.#group(track, BigInt(identity.groupId));
880
+ if (group.failed === "sigInvalid" || group.failed === "digestMismatch") {
881
+ return this.#rejectOrShadow(identity, release, group.failed);
882
+ }
883
+ const entry = group.entries.get(identity.objectId);
884
+ if (entry)
885
+ return this.#admitAgainstEntry(track, group, identity, data, release, entry, discard);
886
+ if (this.#config.mode === "shadow" || this.#config.onMissingManifest === "fallback-shadow") {
887
+ release();
888
+ this.#failure(identity, "manifestAbsent");
889
+ return { action: "play", verified: false, reason: "manifestAbsent" };
890
+ }
891
+ if (!this.#quarantine(track, group, { identity, data, release, discard, bytes: data.byteLength })) {
892
+ return { action: "drop", verified: false };
893
+ }
894
+ return { action: "stall", verified: false };
895
+ } catch {
896
+ release();
897
+ this.#failure(identity, "verifierError");
898
+ return { action: "play", verified: false, reason: "verifierError" };
899
+ }
900
+ }
901
+ dispose() {
902
+ if (this.#disposed)
903
+ return;
904
+ this.#disposed = true;
905
+ this.#releaseAllQuarantine(false);
906
+ this.#tracks.clear();
907
+ }
908
+ #requireTrack(bindingId) {
909
+ const track = this.#tracks.get(bindingId);
910
+ if (!track)
911
+ throw new Error(`unknown manifest binding ${bindingId}`);
912
+ return track;
913
+ }
914
+ #group(track, groupId) {
915
+ let group = track.groups.get(groupId);
916
+ if (!group) {
917
+ group = { entries: /* @__PURE__ */ new Map(), pending: /* @__PURE__ */ new Map(), rootVerified: false };
918
+ track.groups.set(groupId, group);
919
+ while (track.groups.size > track.maxGroups) {
920
+ const oldest = track.groups.entries().next().value;
921
+ if (!oldest)
922
+ break;
923
+ const [oldestId, oldestGroup] = oldest;
924
+ for (const pending of [...oldestGroup.pending.values()]) {
925
+ this.#removePending(track, oldestGroup, pending);
926
+ this.#giveUpOnPending(pending);
927
+ this.#failure(pending.identity, "manifestAbsent");
928
+ }
929
+ track.manifestEntries -= oldestGroup.entries.size;
930
+ track.groups.delete(oldestId);
931
+ }
932
+ }
933
+ return group;
934
+ }
935
+ #validateIdentity(track, identity) {
936
+ const coordinates = track.context.mapper.derive(Number(identity.groupId), identity.objectId);
937
+ return identity.ssId === void 0 || coordinates.ssId === identity.ssId;
938
+ }
939
+ #admitAgainstEntry(track, group, identity, data, release, entry, discard) {
940
+ if (entry.trueLength !== data.byteLength) {
941
+ return this.#rejectOrShadow(identity, release, "digestMismatch");
942
+ }
943
+ const digestMatches = equalBytes2(sourceAuthObjectDigest(data.subarray(0, entry.trueLength)), entry.digest);
944
+ if (!digestMatches)
945
+ return this.#rejectOrShadow(identity, release, "digestMismatch");
946
+ if (!track.context.manifestChannelAuthenticated && !group.rootVerified) {
947
+ if (this.#config.mode === "shadow") {
948
+ release();
949
+ return { action: "play", verified: false };
950
+ }
951
+ if (!this.#quarantine(track, group, { identity, data, release, discard, bytes: data.byteLength })) {
952
+ return { action: "drop", verified: false };
953
+ }
954
+ return { action: "stall", verified: false };
955
+ }
956
+ release();
957
+ this.#stats.verified++;
958
+ return { action: "play", verified: true };
959
+ }
960
+ #rejectOrShadow(identity, release, reason) {
961
+ this.#failure(identity, reason);
962
+ if (this.#config.mode === "enforce") {
963
+ console.warn(JSON.stringify({ event: "manifest-enforce-drop", track: identity.trackName, group: String(identity.groupId), object: identity.objectId, reason }));
964
+ return { action: "drop", verified: false, reason };
965
+ }
966
+ release();
967
+ return { action: "play", verified: false, reason };
968
+ }
969
+ #resolvePending(track, group, pending, entry) {
970
+ this.#removePending(track, group, pending);
971
+ this.#admitAgainstEntry(track, group, pending.identity, pending.data, pending.release, entry, pending.discard);
972
+ }
973
+ #closeGroup(track, groupId, group, close) {
974
+ if (group.close || group.signaturePending)
975
+ return;
976
+ const entries = [...group.entries.values()];
977
+ if (entries.length !== close.objectCount) {
978
+ group.pendingClose = close;
979
+ const hadPending = group.pending.size > 0;
980
+ if (this.#config.onMissingManifest === "fallback-shadow" || this.#config.mode === "shadow") {
981
+ for (const pending of [...group.pending.values()]) {
982
+ this.#removePending(track, group, pending);
983
+ pending.release();
984
+ this.#failure(pending.identity, "manifestAbsent");
985
+ }
986
+ } else {
987
+ for (const pending of group.pending.values()) {
988
+ this.#failure(pending.identity, "manifestAbsent");
989
+ }
990
+ }
991
+ if (!hadPending) {
992
+ this.#failure({ trackName: track.context.trackName, groupId, objectId: 0 }, "manifestAbsent");
993
+ }
994
+ return;
995
+ }
996
+ if (!equalBytes2(sourceAuthMerkleRoot(entries), close.root)) {
997
+ group.failed = "digestMismatch";
998
+ this.#failGroup(track, groupId, group, "digestMismatch");
999
+ return;
1000
+ }
1001
+ const preimage = sourceAuthSignaturePreimage(track.context.authScope, close.groupId, close.objectCount, close.root);
1002
+ let signatureValid;
1003
+ try {
1004
+ signatureValid = this.#verifyAcceptedSignature(track, preimage, close.signature);
1005
+ } catch {
1006
+ this.#failOpenGroup(track, groupId, group);
1007
+ return;
1008
+ }
1009
+ if (isPromiseLike(signatureValid)) {
1010
+ group.signaturePending = true;
1011
+ void signatureValid.then((valid) => {
1012
+ if (this.#disposed)
1013
+ return;
1014
+ group.signaturePending = false;
1015
+ this.#finishGroupSignature(track, groupId, group, close, valid);
1016
+ }, () => {
1017
+ if (this.#disposed)
1018
+ return;
1019
+ group.signaturePending = false;
1020
+ this.#failOpenGroup(track, groupId, group);
1021
+ });
1022
+ return;
1023
+ }
1024
+ this.#finishGroupSignature(track, groupId, group, close, signatureValid);
1025
+ }
1026
+ #finishGroupSignature(track, groupId, group, close, signatureValid) {
1027
+ if (!signatureValid) {
1028
+ group.failed = "sigInvalid";
1029
+ this.#failGroup(track, groupId, group, "sigInvalid");
1030
+ return;
1031
+ }
1032
+ group.failed = void 0;
1033
+ group.close = close;
1034
+ group.pendingClose = void 0;
1035
+ group.rootVerified = true;
1036
+ for (const pending of [...group.pending.values()]) {
1037
+ const entry = group.entries.get(pending.identity.objectId);
1038
+ if (entry)
1039
+ this.#resolvePending(track, group, pending, entry);
1040
+ else if (this.#config.onMissingManifest === "fallback-shadow") {
1041
+ this.#removePending(track, group, pending);
1042
+ pending.release();
1043
+ this.#failure(pending.identity, "manifestAbsent");
1044
+ }
1045
+ }
1046
+ }
1047
+ #verifyAcceptedSignature(track, message, signature) {
1048
+ const keys = track.context.acceptedPublicKeys ?? [track.context.publicKey];
1049
+ const pending = [];
1050
+ let hadSynchronousError = false;
1051
+ for (const key of keys) {
1052
+ try {
1053
+ const result = this.#verifySignature(key, message, signature);
1054
+ if (isPromiseLike(result)) {
1055
+ pending.push(Promise.resolve(result).then((valid) => valid, () => "error"));
1056
+ } else if (result) {
1057
+ return true;
1058
+ }
1059
+ } catch {
1060
+ hadSynchronousError = true;
1061
+ }
1062
+ }
1063
+ if (pending.length === 0) {
1064
+ if (hadSynchronousError)
1065
+ throw new Error("manifest signature verifier unavailable");
1066
+ return false;
1067
+ }
1068
+ return Promise.all(pending).then((results) => {
1069
+ if (results.some((valid) => valid === true))
1070
+ return true;
1071
+ if (hadSynchronousError || results.some((valid) => valid === "error")) {
1072
+ throw new Error("manifest signature verifier unavailable");
1073
+ }
1074
+ return false;
1075
+ });
1076
+ }
1077
+ #failGroup(track, groupId, group, reason) {
1078
+ if (group.pending.size === 0) {
1079
+ this.#failure({ trackName: track.context.trackName, groupId, objectId: 0 }, reason);
1080
+ return;
1081
+ }
1082
+ for (const pending of [...group.pending.values()]) {
1083
+ this.#removePending(track, group, pending);
1084
+ if (this.#rejectOrShadow(pending.identity, pending.release, reason).action === "drop") {
1085
+ pending.discard?.();
1086
+ }
1087
+ }
1088
+ }
1089
+ #removePending(track, group, pending) {
1090
+ if (group.pending.get(pending.identity.objectId) === pending) {
1091
+ group.pending.delete(pending.identity.objectId);
1092
+ }
1093
+ const index = track.quarantine.indexOf(pending);
1094
+ if (index >= 0)
1095
+ track.quarantine.splice(index, 1);
1096
+ track.quarantinedBytes -= pending.bytes;
1097
+ this.#stats.quarantinedBytes -= pending.bytes;
1098
+ }
1099
+ #quarantine(track, group, pending) {
1100
+ if (group.pending.has(pending.identity.objectId))
1101
+ return false;
1102
+ group.pending.set(pending.identity.objectId, pending);
1103
+ track.quarantine.push(pending);
1104
+ track.quarantinedBytes += pending.bytes;
1105
+ this.#stats.quarantinedBytes += pending.bytes;
1106
+ this.#enforceCap(track);
1107
+ return true;
1108
+ }
1109
+ #enforceCap(track) {
1110
+ while (track.quarantinedBytes > track.capBytes && track.quarantine.length > 0) {
1111
+ const pending = track.quarantine.shift();
1112
+ const group = track.groups.get(BigInt(pending.identity.groupId));
1113
+ if (group)
1114
+ group.pending.delete(pending.identity.objectId);
1115
+ track.quarantinedBytes -= pending.bytes;
1116
+ this.#stats.quarantinedBytes -= pending.bytes;
1117
+ this.#giveUpOnPending(pending);
1118
+ this.#failure(pending.identity, "manifestAbsent");
1119
+ console.warn(`[ManifestVerifier] quarantine cap eviction track=${pending.identity.trackName} group=${pending.identity.groupId} object=${pending.identity.objectId} disposition=${this.#config.mode === "enforce" ? "drop" : "fail-open"}`);
1120
+ }
1121
+ }
1122
+ /**
1123
+ * Stop waiting for a manifest that never arrived. In `enforce` the object is
1124
+ * discarded: an eviction is a rejection, not a deferred play, so unverified
1125
+ * media never reaches the player two groups after the stall was recorded
1126
+ * (BLO-30095, CTO disposition on the issue thread).
1127
+ *
1128
+ * Deliberately NOT used by `#failOpenGroup`/`#failOpenTrack` — failing open on
1129
+ * a genuine verifier fault is correct and stays untouched.
1130
+ */
1131
+ #giveUpOnPending(pending) {
1132
+ if (this.#config.mode !== "enforce") {
1133
+ pending.release();
1134
+ return;
1135
+ }
1136
+ pending.discard?.();
1137
+ }
1138
+ #failOpenTrack(track, reason) {
1139
+ for (const pending of [...track.quarantine]) {
1140
+ const group = track.groups.get(BigInt(pending.identity.groupId));
1141
+ if (group)
1142
+ this.#removePending(track, group, pending);
1143
+ pending.release();
1144
+ this.#failure(pending.identity, reason);
1145
+ }
1146
+ }
1147
+ #failOpenGroup(track, groupId, group) {
1148
+ const pending = [...group.pending.values()];
1149
+ if (pending.length === 0) {
1150
+ this.#failure({ trackName: track.context.trackName, groupId, objectId: 0 }, "verifierError");
1151
+ return;
1152
+ }
1153
+ for (const object of pending) {
1154
+ this.#removePending(track, group, object);
1155
+ object.release();
1156
+ this.#failure(object.identity, "verifierError");
1157
+ }
1158
+ }
1159
+ #releaseAllQuarantine(countFailure) {
1160
+ for (const track of this.#tracks.values()) {
1161
+ for (const pending of [...track.quarantine]) {
1162
+ const group = track.groups.get(BigInt(pending.identity.groupId));
1163
+ if (group)
1164
+ this.#removePending(track, group, pending);
1165
+ pending.release();
1166
+ if (countFailure)
1167
+ this.#failure(pending.identity, "verifierError");
1168
+ }
1169
+ }
1170
+ }
1171
+ #failure(identity, reason) {
1172
+ this.#stats.failures[reason]++;
1173
+ this.#onFailure?.({
1174
+ trackName: identity.trackName,
1175
+ ...identity.bindingId === void 0 ? {} : { bindingId: identity.bindingId },
1176
+ groupId: identity.groupId,
1177
+ objectId: identity.objectId,
1178
+ reason
1179
+ });
1180
+ }
1181
+ };
1182
+ export {
1183
+ ManifestVerifier,
1184
+ SOURCE_AUTH_GROUP_CLOSE_FRAME,
1185
+ SOURCE_AUTH_GROUP_CLOSE_LENGTH,
1186
+ SOURCE_AUTH_MANIFEST_VERSION,
1187
+ SOURCE_AUTH_MAX_OBJECTS_PER_GROUP,
1188
+ SOURCE_AUTH_MAX_TRUE_LENGTH,
1189
+ SOURCE_AUTH_OBJECT_ENTRY_FRAME,
1190
+ SOURCE_AUTH_OBJECT_ENTRY_LENGTH,
1191
+ SOURCE_AUTH_SCOPE_LENGTH,
1192
+ SourceAuthAdmission,
1193
+ createWebCryptoEd25519Verifier,
1194
+ decodeSourceAuthManifestFrame,
1195
+ encodeSourceAuthGroupClose,
1196
+ encodeSourceAuthObjectEntry,
1197
+ manifestBindingId,
1198
+ sourceAuthLeafHash,
1199
+ sourceAuthMerkleRoot,
1200
+ sourceAuthObjectDigest,
1201
+ sourceAuthSignaturePreimage,
1202
+ trimRecoveredSourceAuthObject
1203
+ };
1204
+ /*! Bundled license information:
1205
+
1206
+ @noble/hashes/esm/utils.js:
1207
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
1208
+ */
1209
+ //# sourceMappingURL=source-auth.js.map