@videojs/html 10.0.0-beta.28 → 10.0.0-beta.29

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 (533) hide show
  1. package/cdn/{adapter-XTen-YVQ.js → adapter-CEnNWvii.js} +17 -4
  2. package/cdn/adapter-CEnNWvii.js.map +1 -0
  3. package/cdn/adapter-DaKW8NzI.js +2 -0
  4. package/cdn/adapter-DaKW8NzI.js.map +1 -0
  5. package/cdn/audio-headless.dev.js +1 -1
  6. package/cdn/audio-headless.js +1 -1
  7. package/cdn/audio-minimal-ui.dev.js +2 -2
  8. package/cdn/audio-minimal-ui.js +1 -1
  9. package/cdn/audio-minimal.dev.js +5 -5
  10. package/cdn/audio-minimal.dev.js.map +1 -1
  11. package/cdn/audio-minimal.js +1 -1
  12. package/cdn/audio-minimal.js.map +1 -1
  13. package/cdn/audio-ui.dev.js +2 -2
  14. package/cdn/audio-ui.js +1 -1
  15. package/cdn/audio.dev.js +5 -5
  16. package/cdn/audio.dev.js.map +1 -1
  17. package/cdn/audio.js +1 -1
  18. package/cdn/audio.js.map +1 -1
  19. package/cdn/background.dev.js +1 -1
  20. package/cdn/background.js +1 -1
  21. package/cdn/background.js.map +1 -1
  22. package/cdn/compounds-C4YYLyL2.js +8 -0
  23. package/cdn/compounds-C4YYLyL2.js.map +1 -0
  24. package/cdn/{compounds-nk9RJtBK.js → compounds-C73u1MeO.js} +63 -59
  25. package/cdn/compounds-C73u1MeO.js.map +1 -0
  26. package/cdn/create-player-BU8LDJDL.js +2 -0
  27. package/cdn/create-player-BU8LDJDL.js.map +1 -0
  28. package/cdn/{create-player-DK9WOywd.js → create-player-Db1CIvlK.js} +58 -46
  29. package/cdn/create-player-Db1CIvlK.js.map +1 -0
  30. package/cdn/{default-BqQDVloS.js → default-A3aM0skz.js} +2 -2
  31. package/cdn/default-A3aM0skz.js.map +1 -0
  32. package/cdn/default-BDyhiTCm.js +2 -0
  33. package/cdn/default-BDyhiTCm.js.map +1 -0
  34. package/cdn/{default-I2LasfxC.js → default-C1_k1NeB.js} +2 -2
  35. package/cdn/default-C1_k1NeB.js.map +1 -0
  36. package/cdn/default-DHrMd4ie.js +2 -0
  37. package/cdn/default-DHrMd4ie.js.map +1 -0
  38. package/cdn/error-surface-BID4D3DW.js +59 -0
  39. package/cdn/error-surface-BID4D3DW.js.map +1 -0
  40. package/cdn/{select-tracks-nRPBa1NC.js → error-surface-D0bo71gD.js} +442 -48
  41. package/cdn/error-surface-D0bo71gD.js.map +1 -0
  42. package/cdn/gesture-element-CeRy1IVs.js +2 -0
  43. package/cdn/gesture-element-CeRy1IVs.js.map +1 -0
  44. package/cdn/{gesture-element-6Ld1YwIL.js → gesture-element-DB67OYCE.js} +3 -3
  45. package/cdn/gesture-element-DB67OYCE.js.map +1 -0
  46. package/cdn/{hls-js-C4P_b2tT.js → hls-js-CiE4wOrG.js} +2 -2
  47. package/cdn/{hls-js-C4P_b2tT.js.map → hls-js-CiE4wOrG.js.map} +1 -1
  48. package/cdn/{hls-js-CATW7NBm.js → hls-js-DBKRCbQm.js} +2 -2
  49. package/cdn/{hls-js-CATW7NBm.js.map → hls-js-DBKRCbQm.js.map} +1 -1
  50. package/cdn/{hls-js-BEuVm0u9.js → hls-js-DX2NGCAr.js} +2 -2
  51. package/cdn/{hls-js-BEuVm0u9.js.map → hls-js-DX2NGCAr.js.map} +1 -1
  52. package/cdn/{hls-js-WCNy9MVh.js → hls-js-JeH8yvsP.js} +2 -2
  53. package/cdn/{hls-js-WCNy9MVh.js.map → hls-js-JeH8yvsP.js.map} +1 -1
  54. package/cdn/i18n-CpBDXf6M.js +2 -0
  55. package/cdn/{i18n-Dc7WM2xd.js.map → i18n-CpBDXf6M.js.map} +1 -1
  56. package/cdn/{i18n-Ch4t6EjV.js → i18n-D0nhPa0m.js} +2 -2
  57. package/cdn/{i18n-Ch4t6EjV.js.map → i18n-D0nhPa0m.js.map} +1 -1
  58. package/cdn/{live-button-element-DaHgnYdw.js → live-button-element-Co8z2LkI.js} +2 -2
  59. package/cdn/{live-button-element-DaHgnYdw.js.map → live-button-element-Co8z2LkI.js.map} +1 -1
  60. package/cdn/{live-button-element-Bae44kBN.js → live-button-element-zE-8uoR2.js} +3 -3
  61. package/cdn/{live-button-element-Bae44kBN.js.map → live-button-element-zE-8uoR2.js.map} +1 -1
  62. package/cdn/live-video-minimal.dev.js +11 -9
  63. package/cdn/live-video-minimal.dev.js.map +1 -1
  64. package/cdn/live-video-minimal.js +1 -1
  65. package/cdn/live-video-minimal.js.map +1 -1
  66. package/cdn/live-video.dev.js +12 -10
  67. package/cdn/live-video.dev.js.map +1 -1
  68. package/cdn/live-video.js +1 -1
  69. package/cdn/live-video.js.map +1 -1
  70. package/cdn/media/hls-audio.dev.js +1 -1
  71. package/cdn/media/hls-audio.js +1 -1
  72. package/cdn/media/hls-background-video.dev.js +1 -1
  73. package/cdn/media/hls-background-video.js +1 -1
  74. package/cdn/media/hls-video.dev.js +1 -1
  75. package/cdn/media/hls-video.js +1 -1
  76. package/cdn/media/mux-audio/hls-js.dev.js +1 -1
  77. package/cdn/media/mux-audio/hls-js.js +1 -1
  78. package/cdn/media/mux-audio/spf.dev.js +2 -2
  79. package/cdn/media/mux-audio/spf.js +1 -1
  80. package/cdn/media/mux-audio.dev.js +1 -1
  81. package/cdn/media/mux-audio.js +1 -1
  82. package/cdn/media/mux-background-video.dev.js +1 -1
  83. package/cdn/media/mux-background-video.js +1 -1
  84. package/cdn/media/mux-data.dev.js +1 -1
  85. package/cdn/media/mux-data.dev.js.map +1 -1
  86. package/cdn/media/mux-data.js +1 -1
  87. package/cdn/media/mux-data.js.map +1 -1
  88. package/cdn/media/mux-video/hls-js.dev.js +1 -1
  89. package/cdn/media/mux-video/hls-js.js +1 -1
  90. package/cdn/media/mux-video/spf.dev.js +2 -2
  91. package/cdn/media/mux-video/spf.js +1 -1
  92. package/cdn/media/mux-video.dev.js +1 -1
  93. package/cdn/media/mux-video.js +1 -1
  94. package/cdn/media/vimeo-video.dev.js +27 -5
  95. package/cdn/media/vimeo-video.dev.js.map +1 -1
  96. package/cdn/media/vimeo-video.js +1 -1
  97. package/cdn/media/vimeo-video.js.map +1 -1
  98. package/cdn/{media-Uxm0d3Vx.js → media-BI8caj07.js} +3 -3
  99. package/cdn/{media-Uxm0d3Vx.js.map → media-BI8caj07.js.map} +1 -1
  100. package/cdn/{media-COIe3uI5.js → media-BNuI0Im7.js} +19 -6
  101. package/cdn/media-BNuI0Im7.js.map +1 -0
  102. package/cdn/media-CQxFuDcv.js +2 -0
  103. package/cdn/{media-CPVSKLdk.js.map → media-CQxFuDcv.js.map} +1 -1
  104. package/cdn/media-D4tG62L5.js +2 -0
  105. package/cdn/{media-BTipOcKo.js.map → media-D4tG62L5.js.map} +1 -1
  106. package/cdn/{media-oa3nyL2o.js → media-DI6DvYm3.js} +3 -3
  107. package/cdn/{media-oa3nyL2o.js.map → media-DI6DvYm3.js.map} +1 -1
  108. package/cdn/media-DU3Xf5XR.js +2 -0
  109. package/cdn/media-DU3Xf5XR.js.map +1 -0
  110. package/cdn/media-mYKOAsk3.js +825 -0
  111. package/cdn/media-mYKOAsk3.js.map +1 -0
  112. package/cdn/media-zReLnePj.js +2 -0
  113. package/cdn/media-zReLnePj.js.map +1 -0
  114. package/cdn/{minimal-DQCLKRyR.js → minimal-3OmH0xQS.js} +2 -2
  115. package/cdn/minimal-3OmH0xQS.js.map +1 -0
  116. package/cdn/{minimal-DLosvq31.js → minimal-6w_Vyyl9.js} +2 -2
  117. package/cdn/minimal-6w_Vyyl9.js.map +1 -0
  118. package/cdn/minimal-BWLTn7oQ.js +2 -0
  119. package/cdn/minimal-BWLTn7oQ.js.map +1 -0
  120. package/cdn/minimal-DIGrklyh.js +2 -0
  121. package/cdn/minimal-DIGrklyh.js.map +1 -0
  122. package/cdn/{minimal-ui-CRKvUmB8.js → minimal-ui-BCIESK8f.js} +8 -8
  123. package/cdn/{minimal-ui-CRKvUmB8.js.map → minimal-ui-BCIESK8f.js.map} +1 -1
  124. package/cdn/minimal-ui-BXrq3z4U.js +2 -0
  125. package/cdn/{minimal-ui-Et2Wcn7r.js.map → minimal-ui-BXrq3z4U.js.map} +1 -1
  126. package/cdn/{minimal-ui-BpHxIo4z.js → minimal-ui-DEalpMk6.js} +4 -4
  127. package/cdn/{minimal-ui-BpHxIo4z.js.map → minimal-ui-DEalpMk6.js.map} +1 -1
  128. package/cdn/{minimal-ui-8iRZf_72.js → minimal-ui-vY3QgohH.js} +2 -2
  129. package/cdn/{minimal-ui-8iRZf_72.js.map → minimal-ui-vY3QgohH.js.map} +1 -1
  130. package/cdn/{player-DM9rUXg-.js → player-B3GlPF90.js} +2 -2
  131. package/cdn/{player-DM9rUXg-.js.map → player-B3GlPF90.js.map} +1 -1
  132. package/cdn/player-CtTC7qa5.js +2 -0
  133. package/cdn/{player-rCFqzWrA.js.map → player-CtTC7qa5.js.map} +1 -1
  134. package/cdn/player-DKkph8UM.js +2 -0
  135. package/cdn/{player-BRQLp5bX.js.map → player-DKkph8UM.js.map} +1 -1
  136. package/cdn/{player-CKTAtwit.js → player-DPDmTRvg.js} +2 -2
  137. package/cdn/{player-CKTAtwit.js.map → player-DPDmTRvg.js.map} +1 -1
  138. package/cdn/player-DrDd7LJi.js +2 -0
  139. package/cdn/{player-BloX4l6F.js.map → player-DrDd7LJi.js.map} +1 -1
  140. package/cdn/{player-B2oraRyD.js → player-L5UpZmT4.js} +2 -2
  141. package/cdn/{player-B2oraRyD.js.map → player-L5UpZmT4.js.map} +1 -1
  142. package/cdn/{poster-element-BGr1VQJB.js → poster-element-B5tdJ2ub.js} +179 -38
  143. package/cdn/poster-element-B5tdJ2ub.js.map +1 -0
  144. package/cdn/poster-element-B8QwXSU_.js +2 -0
  145. package/cdn/poster-element-B8QwXSU_.js.map +1 -0
  146. package/cdn/{error-surface-drmCvBVW.js → relocation-pipelines-Dh8CcgHw.js} +5 -343
  147. package/cdn/relocation-pipelines-Dh8CcgHw.js.map +1 -0
  148. package/cdn/relocation-pipelines-DunE4gcV.js +2 -0
  149. package/cdn/relocation-pipelines-DunE4gcV.js.map +1 -0
  150. package/cdn/{seek-button-element-XMTLIxZj.js → seek-button-element-5co-k0Dx.js} +4 -4
  151. package/cdn/seek-button-element-5co-k0Dx.js.map +1 -0
  152. package/cdn/{seek-button-element-FlgBVoGM.js → seek-button-element-B8TkILg-.js} +2 -2
  153. package/cdn/{seek-button-element-FlgBVoGM.js.map → seek-button-element-B8TkILg-.js.map} +1 -1
  154. package/cdn/shallow-equal-C7S8rj2f.js +16 -0
  155. package/cdn/shallow-equal-C7S8rj2f.js.map +1 -0
  156. package/cdn/shallow-equal-KV1zFqZi.js +2 -0
  157. package/cdn/shallow-equal-KV1zFqZi.js.map +1 -0
  158. package/cdn/{skin-element-DL-Kqa5f.js → skin-element-DrkI8xuM.js} +2 -2
  159. package/cdn/{skin-element-DL-Kqa5f.js.map → skin-element-DrkI8xuM.js.map} +1 -1
  160. package/cdn/{skin-element-DNytI-uu.js → skin-element-DvX6Bxsv.js} +2 -2
  161. package/cdn/{skin-element-DNytI-uu.js.map → skin-element-DvX6Bxsv.js.map} +1 -1
  162. package/cdn/{text-element-DeWBNKXb.js → text-element-BoY6AhMn.js} +2 -2
  163. package/cdn/{text-element-DeWBNKXb.js.map → text-element-BoY6AhMn.js.map} +1 -1
  164. package/cdn/{text-element-D88ArbZz.js → text-element-cg6l21cd.js} +2 -2
  165. package/cdn/{text-element-D88ArbZz.js.map → text-element-cg6l21cd.js.map} +1 -1
  166. package/cdn/time-slider-chapters-element-BfLjdnU4.js +2 -0
  167. package/cdn/time-slider-chapters-element-BfLjdnU4.js.map +1 -0
  168. package/cdn/{time-slider-chapters-element-DJ0abZXI.js → time-slider-chapters-element-CznFQWFm.js} +5 -5
  169. package/cdn/time-slider-chapters-element-CznFQWFm.js.map +1 -0
  170. package/cdn/{ui-BU3_2gDQ.js → ui-BwzqkJNK.js} +7 -7
  171. package/cdn/{ui-BU3_2gDQ.js.map → ui-BwzqkJNK.js.map} +1 -1
  172. package/cdn/ui-DayfItun.js +2 -0
  173. package/cdn/{ui-C0isALTQ.js.map → ui-DayfItun.js.map} +1 -1
  174. package/cdn/ui-PSnD-pv8.js +2 -0
  175. package/cdn/{ui-DVpkE1MN.js.map → ui-PSnD-pv8.js.map} +1 -1
  176. package/cdn/{ui-BsaWWE4y.js → ui-fnKp94a7.js} +9 -9
  177. package/cdn/{ui-BsaWWE4y.js.map → ui-fnKp94a7.js.map} +1 -1
  178. package/cdn/video-headless.dev.js +1 -1
  179. package/cdn/video-headless.js +1 -1
  180. package/cdn/video-minimal-ui.dev.js +2 -2
  181. package/cdn/video-minimal-ui.js +1 -1
  182. package/cdn/video-minimal.dev.js +8 -6
  183. package/cdn/video-minimal.dev.js.map +1 -1
  184. package/cdn/video-minimal.js +1 -1
  185. package/cdn/video-minimal.js.map +1 -1
  186. package/cdn/video-ui.dev.js +2 -2
  187. package/cdn/video-ui.js +1 -1
  188. package/cdn/video.dev.js +9 -7
  189. package/cdn/video.dev.js.map +1 -1
  190. package/cdn/video.js +1 -1
  191. package/cdn/video.js.map +1 -1
  192. package/dist/default/__generated__/skins/default-video/styles/buttons.css +132 -18
  193. package/dist/default/__generated__/skins/default-video/styles/captions.css +22 -0
  194. package/dist/default/__generated__/skins/default-video/styles/container.css +121 -8
  195. package/dist/default/__generated__/skins/default-video/styles/controls.css +436 -21
  196. package/dist/default/__generated__/skins/default-video/styles/dialog.css +169 -0
  197. package/dist/default/__generated__/skins/default-video/styles/indicator.css +459 -0
  198. package/dist/default/__generated__/skins/default-video/styles/menus.css +254 -0
  199. package/dist/default/__generated__/skins/default-video/styles/overlays.css +26 -2
  200. package/dist/default/__generated__/skins/default-video/styles/popups.css +338 -12
  201. package/dist/default/__generated__/skins/default-video/styles/poster.css +4 -4
  202. package/dist/default/__generated__/skins/default-video/styles/sliders.css +355 -31
  203. package/dist/default/__generated__/skins/default-video/styles/styles.css +2455 -216
  204. package/dist/default/__generated__/skins/default-video/styles/theme.css +4 -19
  205. package/dist/default/__generated__/skins/default-video/styles/video.css +29 -0
  206. package/dist/default/__generated__/skins/minimal-video/styles/base.css +25 -0
  207. package/dist/default/__generated__/skins/minimal-video/styles/buttons.css +266 -0
  208. package/dist/default/__generated__/skins/minimal-video/styles/captions.css +22 -0
  209. package/dist/default/__generated__/skins/minimal-video/styles/container.css +158 -0
  210. package/dist/default/__generated__/skins/minimal-video/styles/controls.css +182 -0
  211. package/dist/default/__generated__/skins/minimal-video/styles/dialog.css +77 -0
  212. package/dist/default/__generated__/skins/minimal-video/styles/indicator.css +322 -0
  213. package/dist/default/__generated__/skins/minimal-video/styles/menus.css +254 -0
  214. package/dist/default/__generated__/skins/minimal-video/styles/overlays.css +35 -0
  215. package/dist/default/__generated__/skins/minimal-video/styles/popups.css +371 -0
  216. package/dist/default/__generated__/skins/minimal-video/styles/poster.css +47 -0
  217. package/dist/default/__generated__/skins/minimal-video/styles/sliders.css +436 -0
  218. package/dist/default/__generated__/skins/minimal-video/styles/styles.css +2246 -0
  219. package/dist/default/__generated__/skins/minimal-video/styles/theme.css +7 -0
  220. package/dist/default/__generated__/skins/minimal-video/styles/video.css +29 -0
  221. package/dist/default/_virtual/inline-css_src/define/audio/minimal-skin.js +1 -1
  222. package/dist/default/_virtual/inline-css_src/define/audio/minimal-skin.js.map +1 -1
  223. package/dist/default/_virtual/inline-css_src/define/audio/skin.js +1 -1
  224. package/dist/default/_virtual/inline-css_src/define/audio/skin.js.map +1 -1
  225. package/dist/default/_virtual/inline-css_src/define/live-audio/minimal-skin.js +1 -1
  226. package/dist/default/_virtual/inline-css_src/define/live-audio/minimal-skin.js.map +1 -1
  227. package/dist/default/_virtual/inline-css_src/define/live-audio/skin.js +1 -1
  228. package/dist/default/_virtual/inline-css_src/define/live-audio/skin.js.map +1 -1
  229. package/dist/default/_virtual/inline-css_src/define/live-video/minimal-skin.js +1 -1
  230. package/dist/default/_virtual/inline-css_src/define/live-video/minimal-skin.js.map +1 -1
  231. package/dist/default/_virtual/inline-css_src/define/live-video/skin.js +1 -1
  232. package/dist/default/_virtual/inline-css_src/define/live-video/skin.js.map +1 -1
  233. package/dist/default/_virtual/inline-css_src/define/video/minimal-skin.js +1 -1
  234. package/dist/default/_virtual/inline-css_src/define/video/minimal-skin.js.map +1 -1
  235. package/dist/default/_virtual/inline-css_src/define/video/skin.js +1 -1
  236. package/dist/default/_virtual/inline-css_src/define/video/skin.js.map +1 -1
  237. package/dist/default/define/audio/minimal-skin.css +103 -101
  238. package/dist/default/define/audio/skin.css +68 -69
  239. package/dist/default/define/live-audio/minimal-skin.css +103 -101
  240. package/dist/default/define/live-audio/skin.css +68 -69
  241. package/dist/default/define/live-video/minimal-skin.css +140 -120
  242. package/dist/default/define/live-video/minimal-skin.js +1 -1
  243. package/dist/default/define/live-video/minimal-skin.js.map +1 -1
  244. package/dist/default/define/live-video/minimal-skin.tailwind.js +1 -1
  245. package/dist/default/define/live-video/minimal-skin.tailwind.js.map +1 -1
  246. package/dist/default/define/live-video/skin.css +89 -76
  247. package/dist/default/define/live-video/skin.js +1 -1
  248. package/dist/default/define/live-video/skin.js.map +1 -1
  249. package/dist/default/define/live-video/skin.tailwind.js +1 -1
  250. package/dist/default/define/live-video/skin.tailwind.js.map +1 -1
  251. package/dist/default/define/ui/gesture.js +7 -0
  252. package/dist/default/define/ui/gesture.js.map +1 -0
  253. package/dist/default/define/video/minimal-skin.css +140 -120
  254. package/dist/default/define/video/minimal-skin.js +1 -1
  255. package/dist/default/define/video/minimal-skin.js.map +1 -1
  256. package/dist/default/define/video/minimal-skin.tailwind.js +1 -1
  257. package/dist/default/define/video/minimal-skin.tailwind.js.map +1 -1
  258. package/dist/default/define/video/skin.css +89 -76
  259. package/dist/default/define/video/skin.js +1 -1
  260. package/dist/default/define/video/skin.js.map +1 -1
  261. package/dist/default/define/video/skin.tailwind.js +1 -1
  262. package/dist/default/define/video/skin.tailwind.js.map +1 -1
  263. package/dist/default/icons/dist/element/default/icons.js +1 -1
  264. package/dist/default/icons/dist/element/default/icons.js.map +1 -1
  265. package/dist/default/icons/dist/element/minimal/icons.js +1 -1
  266. package/dist/default/icons/dist/element/minimal/icons.js.map +1 -1
  267. package/dist/default/icons/dist/html/default/airplay-exit.js +1 -1
  268. package/dist/default/icons/dist/html/default/airplay-exit.js.map +1 -1
  269. package/dist/default/icons/dist/html/minimal/airplay-exit.js +1 -1
  270. package/dist/default/icons/dist/html/minimal/airplay-exit.js.map +1 -1
  271. package/dist/default/icons/dist/render/default/index.js +1 -1
  272. package/dist/default/icons/dist/render/default/index.js.map +1 -1
  273. package/dist/default/icons/dist/render/minimal/index.js +1 -1
  274. package/dist/default/icons/dist/render/minimal/index.js.map +1 -1
  275. package/dist/default/media/hls-background-video/media.js +18 -0
  276. package/dist/default/media/hls-background-video/media.js.map +1 -1
  277. package/dist/default/skins/dist/default/default/tailwind/components/button.js +3 -1
  278. package/dist/default/skins/dist/default/default/tailwind/components/button.js.map +1 -1
  279. package/dist/default/skins/dist/default/default/tailwind/components/poster.js +8 -1
  280. package/dist/default/skins/dist/default/default/tailwind/components/poster.js.map +1 -1
  281. package/dist/default/skins/dist/default/default/tailwind/components/slider.js +10 -10
  282. package/dist/default/skins/dist/default/default/tailwind/components/slider.js.map +1 -1
  283. package/dist/default/skins/dist/default/default/tailwind/components/thumbnail.js +1 -1
  284. package/dist/default/skins/dist/default/default/tailwind/components/thumbnail.js.map +1 -1
  285. package/dist/default/skins/dist/default/default/tailwind/video.tailwind.js +2 -2
  286. package/dist/default/skins/dist/default/default/tailwind/video.tailwind.js.map +1 -1
  287. package/dist/default/skins/dist/default/minimal/tailwind/components/poster.js +8 -1
  288. package/dist/default/skins/dist/default/minimal/tailwind/components/poster.js.map +1 -1
  289. package/dist/default/skins/dist/default/minimal/tailwind/components/slider.js +13 -12
  290. package/dist/default/skins/dist/default/minimal/tailwind/components/slider.js.map +1 -1
  291. package/dist/default/skins/dist/default/minimal/tailwind/components/thumbnail.js +1 -1
  292. package/dist/default/skins/dist/default/minimal/tailwind/components/thumbnail.js.map +1 -1
  293. package/dist/default/skins/dist/default/minimal/tailwind/video.tailwind.js +6 -5
  294. package/dist/default/skins/dist/default/minimal/tailwind/video.tailwind.js.map +1 -1
  295. package/dist/default/skins/dist/default/shared/tailwind/icon-state.js +4 -4
  296. package/dist/default/skins/dist/default/shared/tailwind/icon-state.js.map +1 -1
  297. package/dist/default/store/provider-mixin.js +22 -8
  298. package/dist/default/store/provider-mixin.js.map +1 -1
  299. package/dist/default/ui/audio-track-radio-group/audio-track-radio-group-element.js +1 -1
  300. package/dist/default/ui/audio-track-radio-group/audio-track-radio-group-element.js.map +1 -1
  301. package/dist/default/ui/captions-radio-group/captions-radio-group-element.js +1 -1
  302. package/dist/default/ui/captions-radio-group/captions-radio-group-element.js.map +1 -1
  303. package/dist/default/ui/gesture/gesture-element.js.map +1 -1
  304. package/dist/default/ui/hotkey/hotkey-element.js.map +1 -1
  305. package/dist/default/ui/menu/context.js.map +1 -1
  306. package/dist/default/ui/menu/menu-element.js +28 -27
  307. package/dist/default/ui/menu/menu-element.js.map +1 -1
  308. package/dist/default/ui/menu/menu-radio-group-element.js +14 -14
  309. package/dist/default/ui/menu/menu-radio-group-element.js.map +1 -1
  310. package/dist/default/ui/playback-rate-radio-group/playback-rate-radio-group-element.js +1 -1
  311. package/dist/default/ui/playback-rate-radio-group/playback-rate-radio-group-element.js.map +1 -1
  312. package/dist/default/ui/poster/poster-element.js +138 -8
  313. package/dist/default/ui/poster/poster-element.js.map +1 -1
  314. package/dist/default/ui/quality-radio-group/quality-radio-group-element.js +1 -1
  315. package/dist/default/ui/quality-radio-group/quality-radio-group-element.js.map +1 -1
  316. package/dist/default/ui/slider/slider-preview-element.js.map +1 -1
  317. package/dist/dev/__generated__/skins/default-video/styles/buttons.css +132 -18
  318. package/dist/dev/__generated__/skins/default-video/styles/captions.css +22 -0
  319. package/dist/dev/__generated__/skins/default-video/styles/container.css +121 -8
  320. package/dist/dev/__generated__/skins/default-video/styles/controls.css +436 -21
  321. package/dist/dev/__generated__/skins/default-video/styles/dialog.css +169 -0
  322. package/dist/dev/__generated__/skins/default-video/styles/indicator.css +459 -0
  323. package/dist/dev/__generated__/skins/default-video/styles/menus.css +254 -0
  324. package/dist/dev/__generated__/skins/default-video/styles/overlays.css +26 -2
  325. package/dist/dev/__generated__/skins/default-video/styles/popups.css +338 -12
  326. package/dist/dev/__generated__/skins/default-video/styles/poster.css +4 -4
  327. package/dist/dev/__generated__/skins/default-video/styles/sliders.css +355 -31
  328. package/dist/dev/__generated__/skins/default-video/styles/styles.css +2455 -216
  329. package/dist/dev/__generated__/skins/default-video/styles/theme.css +4 -19
  330. package/dist/dev/__generated__/skins/default-video/styles/video.css +29 -0
  331. package/dist/dev/__generated__/skins/minimal-video/styles/base.css +25 -0
  332. package/dist/dev/__generated__/skins/minimal-video/styles/buttons.css +266 -0
  333. package/dist/dev/__generated__/skins/minimal-video/styles/captions.css +22 -0
  334. package/dist/dev/__generated__/skins/minimal-video/styles/container.css +158 -0
  335. package/dist/dev/__generated__/skins/minimal-video/styles/controls.css +182 -0
  336. package/dist/dev/__generated__/skins/minimal-video/styles/dialog.css +77 -0
  337. package/dist/dev/__generated__/skins/minimal-video/styles/indicator.css +322 -0
  338. package/dist/dev/__generated__/skins/minimal-video/styles/menus.css +254 -0
  339. package/dist/dev/__generated__/skins/minimal-video/styles/overlays.css +35 -0
  340. package/dist/dev/__generated__/skins/minimal-video/styles/popups.css +371 -0
  341. package/dist/dev/__generated__/skins/minimal-video/styles/poster.css +47 -0
  342. package/dist/dev/__generated__/skins/minimal-video/styles/sliders.css +436 -0
  343. package/dist/dev/__generated__/skins/minimal-video/styles/styles.css +2246 -0
  344. package/dist/dev/__generated__/skins/minimal-video/styles/theme.css +7 -0
  345. package/dist/dev/__generated__/skins/minimal-video/styles/video.css +29 -0
  346. package/dist/dev/_virtual/inline-css_src/define/audio/minimal-skin.js +1 -1
  347. package/dist/dev/_virtual/inline-css_src/define/audio/minimal-skin.js.map +1 -1
  348. package/dist/dev/_virtual/inline-css_src/define/audio/skin.js +1 -1
  349. package/dist/dev/_virtual/inline-css_src/define/audio/skin.js.map +1 -1
  350. package/dist/dev/_virtual/inline-css_src/define/live-audio/minimal-skin.js +1 -1
  351. package/dist/dev/_virtual/inline-css_src/define/live-audio/minimal-skin.js.map +1 -1
  352. package/dist/dev/_virtual/inline-css_src/define/live-audio/skin.js +1 -1
  353. package/dist/dev/_virtual/inline-css_src/define/live-audio/skin.js.map +1 -1
  354. package/dist/dev/_virtual/inline-css_src/define/live-video/minimal-skin.js +1 -1
  355. package/dist/dev/_virtual/inline-css_src/define/live-video/minimal-skin.js.map +1 -1
  356. package/dist/dev/_virtual/inline-css_src/define/live-video/skin.js +1 -1
  357. package/dist/dev/_virtual/inline-css_src/define/live-video/skin.js.map +1 -1
  358. package/dist/dev/_virtual/inline-css_src/define/video/minimal-skin.js +1 -1
  359. package/dist/dev/_virtual/inline-css_src/define/video/minimal-skin.js.map +1 -1
  360. package/dist/dev/_virtual/inline-css_src/define/video/skin.js +1 -1
  361. package/dist/dev/_virtual/inline-css_src/define/video/skin.js.map +1 -1
  362. package/dist/dev/define/audio/minimal-skin.css +103 -101
  363. package/dist/dev/define/audio/skin.css +68 -69
  364. package/dist/dev/define/live-audio/minimal-skin.css +103 -101
  365. package/dist/dev/define/live-audio/skin.css +68 -69
  366. package/dist/dev/define/live-video/minimal-skin.css +140 -120
  367. package/dist/dev/define/live-video/minimal-skin.d.ts.map +1 -1
  368. package/dist/dev/define/live-video/minimal-skin.js +3 -1
  369. package/dist/dev/define/live-video/minimal-skin.js.map +1 -1
  370. package/dist/dev/define/live-video/minimal-skin.tailwind.d.ts.map +1 -1
  371. package/dist/dev/define/live-video/minimal-skin.tailwind.js +3 -1
  372. package/dist/dev/define/live-video/minimal-skin.tailwind.js.map +1 -1
  373. package/dist/dev/define/live-video/skin.css +89 -76
  374. package/dist/dev/define/live-video/skin.d.ts.map +1 -1
  375. package/dist/dev/define/live-video/skin.js +3 -1
  376. package/dist/dev/define/live-video/skin.js.map +1 -1
  377. package/dist/dev/define/live-video/skin.tailwind.d.ts.map +1 -1
  378. package/dist/dev/define/live-video/skin.tailwind.js +4 -2
  379. package/dist/dev/define/live-video/skin.tailwind.js.map +1 -1
  380. package/dist/dev/define/ui/gesture.d.ts +8 -0
  381. package/dist/dev/define/ui/gesture.d.ts.map +1 -0
  382. package/dist/dev/define/ui/gesture.js +7 -0
  383. package/dist/dev/define/ui/gesture.js.map +1 -0
  384. package/dist/dev/define/video/minimal-skin.css +140 -120
  385. package/dist/dev/define/video/minimal-skin.d.ts.map +1 -1
  386. package/dist/dev/define/video/minimal-skin.js +3 -1
  387. package/dist/dev/define/video/minimal-skin.js.map +1 -1
  388. package/dist/dev/define/video/minimal-skin.tailwind.d.ts.map +1 -1
  389. package/dist/dev/define/video/minimal-skin.tailwind.js +3 -1
  390. package/dist/dev/define/video/minimal-skin.tailwind.js.map +1 -1
  391. package/dist/dev/define/video/skin.css +89 -76
  392. package/dist/dev/define/video/skin.d.ts.map +1 -1
  393. package/dist/dev/define/video/skin.js +3 -1
  394. package/dist/dev/define/video/skin.js.map +1 -1
  395. package/dist/dev/define/video/skin.tailwind.d.ts.map +1 -1
  396. package/dist/dev/define/video/skin.tailwind.js +4 -2
  397. package/dist/dev/define/video/skin.tailwind.js.map +1 -1
  398. package/dist/dev/media/hls-background-video/media.d.ts +16 -0
  399. package/dist/dev/media/hls-background-video/media.d.ts.map +1 -1
  400. package/dist/dev/media/hls-background-video/media.js +18 -0
  401. package/dist/dev/media/hls-background-video/media.js.map +1 -1
  402. package/dist/dev/packages/icons/dist/element/default/icons.js +1 -1
  403. package/dist/dev/packages/icons/dist/element/default/icons.js.map +1 -1
  404. package/dist/dev/packages/icons/dist/element/minimal/icons.js +1 -1
  405. package/dist/dev/packages/icons/dist/element/minimal/icons.js.map +1 -1
  406. package/dist/dev/packages/icons/dist/html/default/airplay-exit.js +1 -1
  407. package/dist/dev/packages/icons/dist/html/default/airplay-exit.js.map +1 -1
  408. package/dist/dev/packages/icons/dist/html/minimal/airplay-exit.js +1 -1
  409. package/dist/dev/packages/icons/dist/html/minimal/airplay-exit.js.map +1 -1
  410. package/dist/dev/packages/icons/dist/render/default/index.js +1 -1
  411. package/dist/dev/packages/icons/dist/render/default/index.js.map +1 -1
  412. package/dist/dev/packages/icons/dist/render/minimal/index.js +1 -1
  413. package/dist/dev/packages/icons/dist/render/minimal/index.js.map +1 -1
  414. package/dist/dev/packages/skins/dist/default/default/tailwind/components/button.js +3 -1
  415. package/dist/dev/packages/skins/dist/default/default/tailwind/components/button.js.map +1 -1
  416. package/dist/dev/packages/skins/dist/default/default/tailwind/components/poster.js +8 -1
  417. package/dist/dev/packages/skins/dist/default/default/tailwind/components/poster.js.map +1 -1
  418. package/dist/dev/packages/skins/dist/default/default/tailwind/components/slider.js +10 -10
  419. package/dist/dev/packages/skins/dist/default/default/tailwind/components/slider.js.map +1 -1
  420. package/dist/dev/packages/skins/dist/default/default/tailwind/components/thumbnail.js +1 -1
  421. package/dist/dev/packages/skins/dist/default/default/tailwind/components/thumbnail.js.map +1 -1
  422. package/dist/dev/packages/skins/dist/default/default/tailwind/video.tailwind.js +2 -2
  423. package/dist/dev/packages/skins/dist/default/default/tailwind/video.tailwind.js.map +1 -1
  424. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/poster.js +8 -1
  425. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/poster.js.map +1 -1
  426. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/slider.js +13 -12
  427. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/slider.js.map +1 -1
  428. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/thumbnail.js +1 -1
  429. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/thumbnail.js.map +1 -1
  430. package/dist/dev/packages/skins/dist/default/minimal/tailwind/video.tailwind.js +6 -5
  431. package/dist/dev/packages/skins/dist/default/minimal/tailwind/video.tailwind.js.map +1 -1
  432. package/dist/dev/packages/skins/dist/default/shared/tailwind/icon-state.js +4 -4
  433. package/dist/dev/packages/skins/dist/default/shared/tailwind/icon-state.js.map +1 -1
  434. package/dist/dev/store/provider-mixin.d.ts.map +1 -1
  435. package/dist/dev/store/provider-mixin.js +24 -8
  436. package/dist/dev/store/provider-mixin.js.map +1 -1
  437. package/dist/dev/store/types.d.ts +2 -2
  438. package/dist/dev/store/types.d.ts.map +1 -1
  439. package/dist/dev/ui/audio-track-radio-group/audio-track-radio-group-element.js +1 -1
  440. package/dist/dev/ui/audio-track-radio-group/audio-track-radio-group-element.js.map +1 -1
  441. package/dist/dev/ui/captions-radio-group/captions-radio-group-element.js +1 -1
  442. package/dist/dev/ui/captions-radio-group/captions-radio-group-element.js.map +1 -1
  443. package/dist/dev/ui/gesture/gesture-element.d.ts +7 -7
  444. package/dist/dev/ui/gesture/gesture-element.d.ts.map +1 -1
  445. package/dist/dev/ui/gesture/gesture-element.js.map +1 -1
  446. package/dist/dev/ui/hotkey/hotkey-element.d.ts +6 -6
  447. package/dist/dev/ui/hotkey/hotkey-element.d.ts.map +1 -1
  448. package/dist/dev/ui/hotkey/hotkey-element.js.map +1 -1
  449. package/dist/dev/ui/menu/context.d.ts +8 -8
  450. package/dist/dev/ui/menu/context.d.ts.map +1 -1
  451. package/dist/dev/ui/menu/context.js.map +1 -1
  452. package/dist/dev/ui/menu/menu-element.d.ts.map +1 -1
  453. package/dist/dev/ui/menu/menu-element.js +28 -27
  454. package/dist/dev/ui/menu/menu-element.js.map +1 -1
  455. package/dist/dev/ui/menu/menu-radio-group-element.d.ts +1 -1
  456. package/dist/dev/ui/menu/menu-radio-group-element.d.ts.map +1 -1
  457. package/dist/dev/ui/menu/menu-radio-group-element.js +14 -14
  458. package/dist/dev/ui/menu/menu-radio-group-element.js.map +1 -1
  459. package/dist/dev/ui/playback-rate-radio-group/playback-rate-radio-group-element.js +1 -1
  460. package/dist/dev/ui/playback-rate-radio-group/playback-rate-radio-group-element.js.map +1 -1
  461. package/dist/dev/ui/poster/poster-element.d.ts +20 -18
  462. package/dist/dev/ui/poster/poster-element.d.ts.map +1 -1
  463. package/dist/dev/ui/poster/poster-element.js +145 -8
  464. package/dist/dev/ui/poster/poster-element.js.map +1 -1
  465. package/dist/dev/ui/quality-radio-group/quality-radio-group-element.js +1 -1
  466. package/dist/dev/ui/quality-radio-group/quality-radio-group-element.js.map +1 -1
  467. package/dist/dev/ui/slider/slider-preview-element.d.ts +2 -2
  468. package/dist/dev/ui/slider/slider-preview-element.d.ts.map +1 -1
  469. package/dist/dev/ui/slider/slider-preview-element.js.map +1 -1
  470. package/docs/README.md +1 -1
  471. package/docs/concepts/skins.md +91 -78
  472. package/docs/how-to/customize-skins.md +411 -377
  473. package/docs/reference/menu.md +3 -19
  474. package/docs/reference/popover.md +2 -2
  475. package/docs/reference/poster.md +211 -21
  476. package/docs/reference/slider.md +1 -1
  477. package/docs/reference/time-slider.md +1 -1
  478. package/docs/reference/tooltip.md +6 -6
  479. package/docs/reference/volume-slider.md +1 -1
  480. package/package.json +14 -9
  481. package/cdn/adapter-Bk03SAxn.js +0 -2
  482. package/cdn/adapter-Bk03SAxn.js.map +0 -1
  483. package/cdn/adapter-XTen-YVQ.js.map +0 -1
  484. package/cdn/compounds-BEO1d3ZM.js +0 -8
  485. package/cdn/compounds-BEO1d3ZM.js.map +0 -1
  486. package/cdn/compounds-nk9RJtBK.js.map +0 -1
  487. package/cdn/create-player-DK9WOywd.js.map +0 -1
  488. package/cdn/create-player-hSdQMP5p.js +0 -2
  489. package/cdn/create-player-hSdQMP5p.js.map +0 -1
  490. package/cdn/default-BqQDVloS.js.map +0 -1
  491. package/cdn/default-CXWVp2oG.js +0 -2
  492. package/cdn/default-CXWVp2oG.js.map +0 -1
  493. package/cdn/default-Dw6cIEqT.js +0 -2
  494. package/cdn/default-Dw6cIEqT.js.map +0 -1
  495. package/cdn/default-I2LasfxC.js.map +0 -1
  496. package/cdn/error-surface-DCT1m2p1.js +0 -2
  497. package/cdn/error-surface-DCT1m2p1.js.map +0 -1
  498. package/cdn/error-surface-drmCvBVW.js.map +0 -1
  499. package/cdn/gesture-element-6Ld1YwIL.js.map +0 -1
  500. package/cdn/gesture-element-BC48ucj9.js +0 -2
  501. package/cdn/gesture-element-BC48ucj9.js.map +0 -1
  502. package/cdn/i18n-Dc7WM2xd.js +0 -2
  503. package/cdn/media-BTipOcKo.js +0 -2
  504. package/cdn/media-Bmablv4g.js +0 -2
  505. package/cdn/media-Bmablv4g.js.map +0 -1
  506. package/cdn/media-COIe3uI5.js.map +0 -1
  507. package/cdn/media-CPVSKLdk.js +0 -2
  508. package/cdn/media-Dq4zmIJa.js +0 -2
  509. package/cdn/media-Dq4zmIJa.js.map +0 -1
  510. package/cdn/media-suYcjCG2.js +0 -445
  511. package/cdn/media-suYcjCG2.js.map +0 -1
  512. package/cdn/minimal-BedCvMBG.js +0 -2
  513. package/cdn/minimal-BedCvMBG.js.map +0 -1
  514. package/cdn/minimal-BoP112ye.js +0 -2
  515. package/cdn/minimal-BoP112ye.js.map +0 -1
  516. package/cdn/minimal-DLosvq31.js.map +0 -1
  517. package/cdn/minimal-DQCLKRyR.js.map +0 -1
  518. package/cdn/minimal-ui-Et2Wcn7r.js +0 -2
  519. package/cdn/player-BRQLp5bX.js +0 -2
  520. package/cdn/player-BloX4l6F.js +0 -2
  521. package/cdn/player-rCFqzWrA.js +0 -2
  522. package/cdn/poster-element-BGr1VQJB.js.map +0 -1
  523. package/cdn/poster-element-DBmgOyep.js +0 -2
  524. package/cdn/poster-element-DBmgOyep.js.map +0 -1
  525. package/cdn/seek-button-element-XMTLIxZj.js.map +0 -1
  526. package/cdn/select-tracks-nRPBa1NC.js.map +0 -1
  527. package/cdn/select-tracks-xV1s28xD.js +0 -59
  528. package/cdn/select-tracks-xV1s28xD.js.map +0 -1
  529. package/cdn/time-slider-chapters-element-DJ0abZXI.js.map +0 -1
  530. package/cdn/time-slider-chapters-element-DW8YyJn8.js +0 -2
  531. package/cdn/time-slider-chapters-element-DW8YyJn8.js.map +0 -1
  532. package/cdn/ui-C0isALTQ.js +0 -2
  533. package/cdn/ui-DVpkE1MN.js +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-surface-D0bo71gD.js","names":["deriveState","#readableStream","#runFn","#externalSignal","#signal","#abortController","#status","#value","#error","#previous","#promise","#execute","#destroyed","#pending","#chain","#current","#reschedule","#active","#cancel","deriveState","deriveState"],"sources":["../../utils/dist/string/generate-id.js","../../../node_modules/.pnpm/signal-polyfill@0.2.2/node_modules/signal-polyfill/dist/index.js","../../spf/dist/dev/core/signals/effect.js","../../spf/dist/dev/media/errors.js","../../spf/dist/dev/core/signals/primitives.js","../../spf/dist/dev/core/composition/create-composition.js","../../spf/dist/dev/core/composition/share-signals.js","../../spf/dist/dev/core/machine.js","../../spf/dist/dev/core/reactors/create-machine-reactor.js","../../spf/dist/dev/media/types/index.js","../../spf/dist/dev/media/buffer/forward-buffer.js","../../spf/dist/dev/media/utils/tracks.js","../../spf/dist/dev/playback/primitives/track-types.js","../../spf/dist/dev/playback/behaviors/dom/load-segments.js","../../spf/dist/dev/playback/behaviors/dom/track-current-time.js","../../spf/dist/dev/media/dom/mse/mediasource-setup.js","../../spf/dist/dev/media/hls/parse-attributes.js","../../spf/dist/dev/media/hls/resolve-url.js","../../spf/dist/dev/media/hls/parse-media-playlist.js","../../spf/dist/dev/media/dom/capabilities.js","../../spf/dist/dev/media/hls/parse-multivariant.js","../../spf/dist/dev/media/utils/track-selection.js","../../spf/dist/dev/playback/behaviors/calculate-presentation-duration.js","../../spf/dist/dev/playback/behaviors/collect-errors.js","../../spf/dist/dev/media/utils/cdn.js","../../spf/dist/dev/media/dom/mse/duration.js","../../spf/dist/dev/media/dom/mse/end-of-stream.js","../../spf/dist/dev/playback/behaviors/dom/end-of-stream.js","../../spf/dist/dev/network/ewma.js","../../spf/dist/dev/network/bandwidth-estimator.js","../../spf/dist/dev/network/chunked-stream-iterable.js","../../spf/dist/dev/network/fetch.js","../../spf/dist/dev/core/tasks/task.js","../../spf/dist/dev/core/actors/create-machine-actor.js","../../spf/dist/dev/media/buffer/back-buffer.js","../../spf/dist/dev/playback/primitives/segment-load-pipeline.js","../../spf/dist/dev/playback/actors/dom/segment-loader.js","../../spf/dist/dev/media/dom/mse/append-segment.js","../../spf/dist/dev/media/dom/mse/buffer-flusher.js","../../spf/dist/dev/playback/actors/dom/source-buffer.js","../../spf/dist/dev/playback/primitives/failover-fetch.js","../../spf/dist/dev/playback/behaviors/dom/setup-buffer-actors.js","../../spf/dist/dev/playback/behaviors/dom/setup-mediasource.js","../../spf/dist/dev/playback/behaviors/dom/update-mediasource-duration.js","../../spf/dist/dev/media/utils/preload.js","../../spf/dist/dev/playback/behaviors/resolve-presentation.js","../../spf/dist/dev/core/signals/when.js","../../spf/dist/dev/playback/behaviors/resolve-track.js","../../spf/dist/dev/media/primitives/select-tracks.js","../../spf/dist/dev/playback/primitives/selection-rules.js","../../spf/dist/dev/playback/primitives/report-track-conditions.js","../../spf/dist/dev/playback/primitives/error-messages.js","../../spf/dist/dev/playback/adapters/hls-video/error-surface.js"],"sourcesContent":["//#region src/string/generate-id.ts\n/**\n* Generate a unique-ish string ID via timestamp + random.\n*\n* @returns String in `timestamp-random` format (e.g. `\"1738423156789-542891\"`).\n*\n* @example\n* const id = generateId(); // \"1738423156789-542891\"\n*/\nfunction generateId() {\n\treturn `${Date.now()}-${Math.floor(Math.random() * 1e6)}`;\n}\n//#endregion\nexport { generateId };\n\n//# sourceMappingURL=generate-id.js.map","var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nvar __accessCheck = (obj, member, msg) => {\n if (!member.has(obj))\n throw TypeError(\"Cannot \" + msg);\n};\nvar __privateIn = (member, obj) => {\n if (Object(obj) !== obj)\n throw TypeError('Cannot use the \"in\" operator on this value');\n return member.has(obj);\n};\nvar __privateAdd = (obj, member, value) => {\n if (member.has(obj))\n throw TypeError(\"Cannot add the same private member more than once\");\n member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n};\nvar __privateMethod = (obj, member, method) => {\n __accessCheck(obj, member, \"access private method\");\n return method;\n};\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction defaultEquals(a, b) {\n return Object.is(a, b);\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nlet activeConsumer = null;\nlet inNotificationPhase = false;\nlet epoch = 1;\nconst SIGNAL = /* @__PURE__ */ Symbol(\"SIGNAL\");\nfunction setActiveConsumer(consumer) {\n const prev = activeConsumer;\n activeConsumer = consumer;\n return prev;\n}\nfunction getActiveConsumer() {\n return activeConsumer;\n}\nfunction isInNotificationPhase() {\n return inNotificationPhase;\n}\nconst REACTIVE_NODE = {\n version: 0,\n lastCleanEpoch: 0,\n dirty: false,\n producerNode: void 0,\n producerLastReadVersion: void 0,\n producerIndexOfThis: void 0,\n nextProducerIndex: 0,\n liveConsumerNode: void 0,\n liveConsumerIndexOfThis: void 0,\n consumerAllowSignalWrites: false,\n consumerIsAlwaysLive: false,\n producerMustRecompute: () => false,\n producerRecomputeValue: () => {\n },\n consumerMarkedDirty: () => {\n },\n consumerOnSignalRead: () => {\n }\n};\nfunction producerAccessed(node) {\n if (inNotificationPhase) {\n throw new Error(\n typeof ngDevMode !== \"undefined\" && ngDevMode ? `Assertion error: signal read during notification phase` : \"\"\n );\n }\n if (activeConsumer === null) {\n return;\n }\n activeConsumer.consumerOnSignalRead(node);\n const idx = activeConsumer.nextProducerIndex++;\n assertConsumerNode(activeConsumer);\n if (idx < activeConsumer.producerNode.length && activeConsumer.producerNode[idx] !== node) {\n if (consumerIsLive(activeConsumer)) {\n const staleProducer = activeConsumer.producerNode[idx];\n producerRemoveLiveConsumerAtIndex(staleProducer, activeConsumer.producerIndexOfThis[idx]);\n }\n }\n if (activeConsumer.producerNode[idx] !== node) {\n activeConsumer.producerNode[idx] = node;\n activeConsumer.producerIndexOfThis[idx] = consumerIsLive(activeConsumer) ? producerAddLiveConsumer(node, activeConsumer, idx) : 0;\n }\n activeConsumer.producerLastReadVersion[idx] = node.version;\n}\nfunction producerIncrementEpoch() {\n epoch++;\n}\nfunction producerUpdateValueVersion(node) {\n if (!node.dirty && node.lastCleanEpoch === epoch) {\n return;\n }\n if (!node.producerMustRecompute(node) && !consumerPollProducersForChange(node)) {\n node.dirty = false;\n node.lastCleanEpoch = epoch;\n return;\n }\n node.producerRecomputeValue(node);\n node.dirty = false;\n node.lastCleanEpoch = epoch;\n}\nfunction producerNotifyConsumers(node) {\n if (node.liveConsumerNode === void 0) {\n return;\n }\n const prev = inNotificationPhase;\n inNotificationPhase = true;\n try {\n for (const consumer of node.liveConsumerNode) {\n if (!consumer.dirty) {\n consumerMarkDirty(consumer);\n }\n }\n } finally {\n inNotificationPhase = prev;\n }\n}\nfunction producerUpdatesAllowed() {\n return (activeConsumer == null ? void 0 : activeConsumer.consumerAllowSignalWrites) !== false;\n}\nfunction consumerMarkDirty(node) {\n var _a;\n node.dirty = true;\n producerNotifyConsumers(node);\n (_a = node.consumerMarkedDirty) == null ? void 0 : _a.call(node.wrapper ?? node);\n}\nfunction consumerBeforeComputation(node) {\n node && (node.nextProducerIndex = 0);\n return setActiveConsumer(node);\n}\nfunction consumerAfterComputation(node, prevConsumer) {\n setActiveConsumer(prevConsumer);\n if (!node || node.producerNode === void 0 || node.producerIndexOfThis === void 0 || node.producerLastReadVersion === void 0) {\n return;\n }\n if (consumerIsLive(node)) {\n for (let i = node.nextProducerIndex; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n while (node.producerNode.length > node.nextProducerIndex) {\n node.producerNode.pop();\n node.producerLastReadVersion.pop();\n node.producerIndexOfThis.pop();\n }\n}\nfunction consumerPollProducersForChange(node) {\n assertConsumerNode(node);\n for (let i = 0; i < node.producerNode.length; i++) {\n const producer = node.producerNode[i];\n const seenVersion = node.producerLastReadVersion[i];\n if (seenVersion !== producer.version) {\n return true;\n }\n producerUpdateValueVersion(producer);\n if (seenVersion !== producer.version) {\n return true;\n }\n }\n return false;\n}\nfunction producerAddLiveConsumer(node, consumer, indexOfThis) {\n var _a;\n assertProducerNode(node);\n assertConsumerNode(node);\n if (node.liveConsumerNode.length === 0) {\n (_a = node.watched) == null ? void 0 : _a.call(node.wrapper);\n for (let i = 0; i < node.producerNode.length; i++) {\n node.producerIndexOfThis[i] = producerAddLiveConsumer(node.producerNode[i], node, i);\n }\n }\n node.liveConsumerIndexOfThis.push(indexOfThis);\n return node.liveConsumerNode.push(consumer) - 1;\n}\nfunction producerRemoveLiveConsumerAtIndex(node, idx) {\n var _a;\n assertProducerNode(node);\n assertConsumerNode(node);\n if (typeof ngDevMode !== \"undefined\" && ngDevMode && idx >= node.liveConsumerNode.length) {\n throw new Error(\n `Assertion error: active consumer index ${idx} is out of bounds of ${node.liveConsumerNode.length} consumers)`\n );\n }\n if (node.liveConsumerNode.length === 1) {\n (_a = node.unwatched) == null ? void 0 : _a.call(node.wrapper);\n for (let i = 0; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n const lastIdx = node.liveConsumerNode.length - 1;\n node.liveConsumerNode[idx] = node.liveConsumerNode[lastIdx];\n node.liveConsumerIndexOfThis[idx] = node.liveConsumerIndexOfThis[lastIdx];\n node.liveConsumerNode.length--;\n node.liveConsumerIndexOfThis.length--;\n if (idx < node.liveConsumerNode.length) {\n const idxProducer = node.liveConsumerIndexOfThis[idx];\n const consumer = node.liveConsumerNode[idx];\n assertConsumerNode(consumer);\n consumer.producerIndexOfThis[idxProducer] = idx;\n }\n}\nfunction consumerIsLive(node) {\n var _a;\n return node.consumerIsAlwaysLive || (((_a = node == null ? void 0 : node.liveConsumerNode) == null ? void 0 : _a.length) ?? 0) > 0;\n}\nfunction assertConsumerNode(node) {\n node.producerNode ?? (node.producerNode = []);\n node.producerIndexOfThis ?? (node.producerIndexOfThis = []);\n node.producerLastReadVersion ?? (node.producerLastReadVersion = []);\n}\nfunction assertProducerNode(node) {\n node.liveConsumerNode ?? (node.liveConsumerNode = []);\n node.liveConsumerIndexOfThis ?? (node.liveConsumerIndexOfThis = []);\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction computedGet(node) {\n producerUpdateValueVersion(node);\n producerAccessed(node);\n if (node.value === ERRORED) {\n throw node.error;\n }\n return node.value;\n}\nfunction createComputed(computation) {\n const node = Object.create(COMPUTED_NODE);\n node.computation = computation;\n const computed = () => computedGet(node);\n computed[SIGNAL] = node;\n return computed;\n}\nconst UNSET = /* @__PURE__ */ Symbol(\"UNSET\");\nconst COMPUTING = /* @__PURE__ */ Symbol(\"COMPUTING\");\nconst ERRORED = /* @__PURE__ */ Symbol(\"ERRORED\");\nconst COMPUTED_NODE = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n value: UNSET,\n dirty: true,\n error: null,\n equal: defaultEquals,\n producerMustRecompute(node) {\n return node.value === UNSET || node.value === COMPUTING;\n },\n producerRecomputeValue(node) {\n if (node.value === COMPUTING) {\n throw new Error(\"Detected cycle in computations.\");\n }\n const oldValue = node.value;\n node.value = COMPUTING;\n const prevConsumer = consumerBeforeComputation(node);\n let newValue;\n let wasEqual = false;\n try {\n newValue = node.computation.call(node.wrapper);\n const oldOk = oldValue !== UNSET && oldValue !== ERRORED;\n wasEqual = oldOk && node.equal.call(node.wrapper, oldValue, newValue);\n } catch (err) {\n newValue = ERRORED;\n node.error = err;\n } finally {\n consumerAfterComputation(node, prevConsumer);\n }\n if (wasEqual) {\n node.value = oldValue;\n return;\n }\n node.value = newValue;\n node.version++;\n }\n };\n})();\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction defaultThrowError() {\n throw new Error();\n}\nlet throwInvalidWriteToSignalErrorFn = defaultThrowError;\nfunction throwInvalidWriteToSignalError() {\n throwInvalidWriteToSignalErrorFn();\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction createSignal(initialValue) {\n const node = Object.create(SIGNAL_NODE);\n node.value = initialValue;\n const getter = () => {\n producerAccessed(node);\n return node.value;\n };\n getter[SIGNAL] = node;\n return getter;\n}\nfunction signalGetFn() {\n producerAccessed(this);\n return this.value;\n}\nfunction signalSetFn(node, newValue) {\n if (!producerUpdatesAllowed()) {\n throwInvalidWriteToSignalError();\n }\n if (!node.equal.call(node.wrapper, node.value, newValue)) {\n node.value = newValue;\n signalValueChanged(node);\n }\n}\nconst SIGNAL_NODE = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n equal: defaultEquals,\n value: void 0\n };\n})();\nfunction signalValueChanged(node) {\n node.version++;\n producerIncrementEpoch();\n producerNotifyConsumers(node);\n}\n/**\n * @license\n * Copyright 2024 Bloomberg Finance L.P.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst NODE = Symbol(\"node\");\nvar Signal;\n((Signal2) => {\n var _a, _brand, brand_fn, _b, _brand2, brand_fn2;\n class State {\n constructor(initialValue, options = {}) {\n __privateAdd(this, _brand);\n __publicField(this, _a);\n const ref = createSignal(initialValue);\n const node = ref[SIGNAL];\n this[NODE] = node;\n node.wrapper = this;\n if (options) {\n const equals = options.equals;\n if (equals) {\n node.equal = equals;\n }\n node.watched = options[Signal2.subtle.watched];\n node.unwatched = options[Signal2.subtle.unwatched];\n }\n }\n get() {\n if (!(0, Signal2.isState)(this))\n throw new TypeError(\"Wrong receiver type for Signal.State.prototype.get\");\n return signalGetFn.call(this[NODE]);\n }\n set(newValue) {\n if (!(0, Signal2.isState)(this))\n throw new TypeError(\"Wrong receiver type for Signal.State.prototype.set\");\n if (isInNotificationPhase()) {\n throw new Error(\"Writes to signals not permitted during Watcher callback\");\n }\n const ref = this[NODE];\n signalSetFn(ref, newValue);\n }\n }\n _a = NODE;\n _brand = new WeakSet();\n brand_fn = function() {\n };\n Signal2.isState = (s) => typeof s === \"object\" && __privateIn(_brand, s);\n Signal2.State = State;\n class Computed {\n // Create a Signal which evaluates to the value returned by the callback.\n // Callback is called with this signal as the parameter.\n constructor(computation, options) {\n __privateAdd(this, _brand2);\n __publicField(this, _b);\n const ref = createComputed(computation);\n const node = ref[SIGNAL];\n node.consumerAllowSignalWrites = true;\n this[NODE] = node;\n node.wrapper = this;\n if (options) {\n const equals = options.equals;\n if (equals) {\n node.equal = equals;\n }\n node.watched = options[Signal2.subtle.watched];\n node.unwatched = options[Signal2.subtle.unwatched];\n }\n }\n get() {\n if (!(0, Signal2.isComputed)(this))\n throw new TypeError(\"Wrong receiver type for Signal.Computed.prototype.get\");\n return computedGet(this[NODE]);\n }\n }\n _b = NODE;\n _brand2 = new WeakSet();\n brand_fn2 = function() {\n };\n Signal2.isComputed = (c) => typeof c === \"object\" && __privateIn(_brand2, c);\n Signal2.Computed = Computed;\n ((subtle2) => {\n var _a2, _brand3, brand_fn3, _assertSignals, assertSignals_fn;\n function untrack(cb) {\n let output;\n let prevActiveConsumer = null;\n try {\n prevActiveConsumer = setActiveConsumer(null);\n output = cb();\n } finally {\n setActiveConsumer(prevActiveConsumer);\n }\n return output;\n }\n subtle2.untrack = untrack;\n function introspectSources(sink) {\n var _a3;\n if (!(0, Signal2.isComputed)(sink) && !(0, Signal2.isWatcher)(sink)) {\n throw new TypeError(\"Called introspectSources without a Computed or Watcher argument\");\n }\n return ((_a3 = sink[NODE].producerNode) == null ? void 0 : _a3.map((n) => n.wrapper)) ?? [];\n }\n subtle2.introspectSources = introspectSources;\n function introspectSinks(signal) {\n var _a3;\n if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isState)(signal)) {\n throw new TypeError(\"Called introspectSinks without a Signal argument\");\n }\n return ((_a3 = signal[NODE].liveConsumerNode) == null ? void 0 : _a3.map((n) => n.wrapper)) ?? [];\n }\n subtle2.introspectSinks = introspectSinks;\n function hasSinks(signal) {\n if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isState)(signal)) {\n throw new TypeError(\"Called hasSinks without a Signal argument\");\n }\n const liveConsumerNode = signal[NODE].liveConsumerNode;\n if (!liveConsumerNode)\n return false;\n return liveConsumerNode.length > 0;\n }\n subtle2.hasSinks = hasSinks;\n function hasSources(signal) {\n if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isWatcher)(signal)) {\n throw new TypeError(\"Called hasSources without a Computed or Watcher argument\");\n }\n const producerNode = signal[NODE].producerNode;\n if (!producerNode)\n return false;\n return producerNode.length > 0;\n }\n subtle2.hasSources = hasSources;\n class Watcher {\n // When a (recursive) source of Watcher is written to, call this callback,\n // if it hasn't already been called since the last `watch` call.\n // No signals may be read or written during the notify.\n constructor(notify) {\n __privateAdd(this, _brand3);\n __privateAdd(this, _assertSignals);\n __publicField(this, _a2);\n let node = Object.create(REACTIVE_NODE);\n node.wrapper = this;\n node.consumerMarkedDirty = notify;\n node.consumerIsAlwaysLive = true;\n node.consumerAllowSignalWrites = false;\n node.producerNode = [];\n this[NODE] = node;\n }\n // Add these signals to the Watcher's set, and set the watcher to run its\n // notify callback next time any signal in the set (or one of its dependencies) changes.\n // Can be called with no arguments just to reset the \"notified\" state, so that\n // the notify callback will be invoked again.\n watch(...signals) {\n if (!(0, Signal2.isWatcher)(this)) {\n throw new TypeError(\"Called unwatch without Watcher receiver\");\n }\n __privateMethod(this, _assertSignals, assertSignals_fn).call(this, signals);\n const node = this[NODE];\n node.dirty = false;\n const prev = setActiveConsumer(node);\n for (const signal of signals) {\n producerAccessed(signal[NODE]);\n }\n setActiveConsumer(prev);\n }\n // Remove these signals from the watched set (e.g., for an effect which is disposed)\n unwatch(...signals) {\n if (!(0, Signal2.isWatcher)(this)) {\n throw new TypeError(\"Called unwatch without Watcher receiver\");\n }\n __privateMethod(this, _assertSignals, assertSignals_fn).call(this, signals);\n const node = this[NODE];\n assertConsumerNode(node);\n for (let i = node.producerNode.length - 1; i >= 0; i--) {\n if (signals.includes(node.producerNode[i].wrapper)) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n const lastIdx = node.producerNode.length - 1;\n node.producerNode[i] = node.producerNode[lastIdx];\n node.producerIndexOfThis[i] = node.producerIndexOfThis[lastIdx];\n node.producerNode.length--;\n node.producerIndexOfThis.length--;\n node.nextProducerIndex--;\n if (i < node.producerNode.length) {\n const idxConsumer = node.producerIndexOfThis[i];\n const producer = node.producerNode[i];\n assertProducerNode(producer);\n producer.liveConsumerIndexOfThis[idxConsumer] = i;\n }\n }\n }\n }\n // Returns the set of computeds in the Watcher's set which are still yet\n // to be re-evaluated\n getPending() {\n if (!(0, Signal2.isWatcher)(this)) {\n throw new TypeError(\"Called getPending without Watcher receiver\");\n }\n const node = this[NODE];\n return node.producerNode.filter((n) => n.dirty).map((n) => n.wrapper);\n }\n }\n _a2 = NODE;\n _brand3 = new WeakSet();\n brand_fn3 = function() {\n };\n _assertSignals = new WeakSet();\n assertSignals_fn = function(signals) {\n for (const signal of signals) {\n if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isState)(signal)) {\n throw new TypeError(\"Called watch/unwatch without a Computed or State argument\");\n }\n }\n };\n Signal2.isWatcher = (w) => __privateIn(_brand3, w);\n subtle2.Watcher = Watcher;\n function currentComputed() {\n var _a3;\n return (_a3 = getActiveConsumer()) == null ? void 0 : _a3.wrapper;\n }\n subtle2.currentComputed = currentComputed;\n subtle2.watched = Symbol(\"watched\");\n subtle2.unwatched = Symbol(\"unwatched\");\n })(Signal2.subtle || (Signal2.subtle = {}));\n})(Signal || (Signal = {}));\nexport {\n Signal\n};\n","import { Signal } from \"signal-polyfill\";\n//#region src/core/signals/effect.ts\nconst pending = /* @__PURE__ */ new Set();\nconst watcher = new Signal.subtle.Watcher(() => {\n\tqueueMicrotask(runPending);\n});\nfunction runPending() {\n\tfor (const c of watcher.getPending()) pending.add(c);\n\twatcher.watch();\n\tfor (const c of pending) {\n\t\tpending.delete(c);\n\t\tc.get();\n\t}\n}\n/**\n* Run a side effect whenever its signal dependencies change.\n*\n* Executes immediately (synchronous initial run), then re-runs on the next\n* microtask after any dependency changes. If the callback returns a function,\n* it is called before each re-run and when the effect is stopped — the same\n* cleanup contract as Preact Signals, Maverick Signals, and Svelte 5 $effect.\n*\n* Returns a cleanup function that stops the effect.\n*/\nfunction effect(fn) {\n\tlet cleanup;\n\tconst c = new Signal.Computed(() => {\n\t\tif (typeof cleanup === \"function\") cleanup();\n\t\tcleanup = fn();\n\t});\n\twatcher.watch(c);\n\tc.get();\n\treturn () => {\n\t\twatcher.unwatch(c);\n\t\tif (typeof cleanup === \"function\") cleanup();\n\t};\n}\n//#endregion\nexport { effect };\n\n//# sourceMappingURL=effect.js.map","//#region src/media/errors.ts\n/** SVTA 1 [Media Content] 004 — the video is in a format we can't play (e.g. an MPEG-TS container). */\nconst SVTA_UNSUPPORTED_VIDEO_FORMAT = 1004;\n/** SVTA 1 [Media Content] 005 — the audio counterpart of {@link SVTA_UNSUPPORTED_VIDEO_FORMAT}. */\nconst SVTA_UNSUPPORTED_AUDIO_FORMAT = 1005;\n/**\n* SVTA 4 [Content Protection] 008 — unsupported or unavailable DRM system. Used\n* for \"this source is encrypted and we have no decryption pipeline,\" which is\n* detection, not a license failure.\n*/\nconst SVTA_UNSUPPORTED_DRM_SYSTEM = 4008;\n/**\n* SVTA 2 [Playback] 011 — no video track the environment can play.\n*\n* Covers both ways a composition can end up with nothing to select: renditions\n* that existed and were all excluded as unplayable, and — where the composition\n* composes `reportAbsentTrackType` to say it needs the type — a source carrying\n* none to begin with. Deliberately one code for both, because they are the same\n* answer to a viewer, and because the alternative is a code the SVTA spec doesn't\n* define. Whether an absent type is a failure is the composition's to state,\n* which is why it opts in rather than being read off the source.\n*/\nconst SVTA_NO_SUPPORTED_VIDEO_TRACK = 2011;\n/** SVTA 2 [Playback] 012 — the audio counterpart of {@link SVTA_NO_SUPPORTED_VIDEO_TRACK}. */\nconst SVTA_NO_SUPPORTED_AUDIO_TRACK = 2012;\n/**\n* SVTA 99 [Custom] 001 — this engine has no pipeline for something the source\n* requires, so the source is unplayable *here* rather than broken.\n*\n* Custom rather than standard because the standard codes available describe\n* either narrower or wider things. The causes (1004/1005 unsupported format,\n* 4008 unsupported DRM) say what one rendition hit; the verdicts (2011/2012 no\n* supported track) say a type emptied without saying why it's unfixable. And\n* 2039 \"Manifest feature unsupported\" covers features that are unsupported but\n* still *playable* — LL-HLS degrading to standard live is a 2039 — so\n* overloading it for a fatal condition would make it useless for the notices it\n* belongs on.\n*\n* Index `001`: the spec defines only `99000` (Unknown) for the custom category\n* and leaves the rest to the publisher, so this is the first code we define.\n*\n* Five digits, and deliberately not special-cased anywhere: {@link svtaCategory}\n* and {@link svtaIndex} decompose it correctly by arithmetic alone, because\n* every standard category is below `8000` and custom starts at `99000`.\n*/\nconst SVTA_UNSUPPORTED_PLAYBACK_FEATURE = 99001;\n/**\n* The error's domain — `code / 1000`, per the spec's \"divide by one thousand to\n* obtain the error category\". Works uniformly across the four-digit native form\n* and the five-digit form embedding an external standard: `\"03404\"` is\n* numerically 3404, which decomposes identically. That also makes a numeric code\n* immune to the spec's inconsistent zero-padding (§Approach writes a\n* category-unknown network error as `\"0300\"` where the error index implies\n* category 3 / index 000).\n*/\nfunction svtaCategory(code) {\n\treturn Math.floor(code / 1e3);\n}\n/**\n* The specific error within its category — `code % 1000`. For a five-digit code\n* this is the embedded external value (an HTTP status, a VAST code).\n*/\nfunction svtaIndex(code) {\n\treturn code % 1e3;\n}\n//#endregion\nexport { SVTA_NO_SUPPORTED_AUDIO_TRACK, SVTA_NO_SUPPORTED_VIDEO_TRACK, SVTA_UNSUPPORTED_AUDIO_FORMAT, SVTA_UNSUPPORTED_DRM_SYSTEM, SVTA_UNSUPPORTED_PLAYBACK_FEATURE, SVTA_UNSUPPORTED_VIDEO_FORMAT, svtaCategory, svtaIndex };\n\n//# sourceMappingURL=errors.js.map","import { Signal } from \"signal-polyfill\";\n//#region src/core/signals/primitives.ts\n/** Read a signal value without tracking it as a dependency. */\nconst untrack = Signal.subtle.untrack;\n/**\n* Read a signal's current value without tracking it as a dependency. Sugar\n* for `untrack(() => signal.get())` to reduce boilerplate at single-read\n* sites. Structurally typed to accept any signal-like (Signal, Computed,\n* ReadonlySignal).\n*\n* Accepts an optional `transform` to project the value in the same call;\n* the default is the identity function so the single-arg form returns `T`\n* unchanged.\n*\n* @example\n* const value = peek(someSignal);\n* const id = peek(presentationSignal, (p) => p?.id);\n*/\nfunction peek(source, transform = (v) => v) {\n\treturn untrack(() => transform(source.get()));\n}\n/** Create a writable reactive value. */\nfunction signal(initialValue, options) {\n\treturn new Signal.State(initialValue, options);\n}\n/** Create a computed reactive value. */\nfunction computed(fn, options) {\n\treturn new Signal.Computed(fn, options);\n}\nfunction update(signal, updater) {\n\tconst current = untrack(() => signal.get());\n\tif (typeof updater === \"function\") signal.set(updater(current));\n\telse signal.set({\n\t\t...current,\n\t\t...updater\n\t});\n}\n/**\n* Read every signal in a map and return a plain object snapshot. Each read\n* tracks in the surrounding Computed/Effect — equivalent to calling `.get()`\n* on a single `Signal<S>` over the merged shape.\n*\n* Convenience for behaviors that pass whole state/context snapshots to pure\n* helpers; prefer per-field reads when only a few fields are needed.\n*/\nfunction snapshot(map) {\n\tconst out = {};\n\tfor (const key in map) out[key] = map[key].get();\n\treturn out;\n}\n//#endregion\nexport { computed, peek, signal, snapshot, untrack, update };\n\n//# sourceMappingURL=primitives.js.map","import { signal } from \"../signals/primitives.js\";\n//#region src/core/composition/create-composition.ts\n/**\n* Create a composition from a set of behaviors.\n*\n* Composition unions the behaviors' declared `stateKeys` / `contextKeys`\n* to know which signals to create. Each signal is seeded from\n* `initialState` / `initialContext` when supplied, defaulting to\n* `undefined`. Behaviors are responsible for writing their own slots\n* once their preconditions are met.\n*\n* Cross-behavior type conflicts (e.g. two behaviors disagreeing on a\n* field's type) surface as a compose-time type error via\n* `ValidateComposition`.\n*\n* @example\n* ```ts\n* const composition = createComposition([resolvePresentation, switchVideoTrack], {\n* config: { parsePresentation: parseMultivariantPlaylist, initialBandwidth: 2_000_000 },\n* initialState: { bandwidthState: { fastEstimate: 0, ... } },\n* });\n* ```\n*/\n/**\n* Create a typed signal map for a given set of keys, seeded from an\n* optional partial initial value.\n*\n* Pipeline: `Set` dedupes the iterable (insertion order preserved, so\n* first occurrence wins) → `Object.fromEntries` materializes one\n* `signal()` per unique key, seeded from `initial[key]` or `undefined`.\n*\n* Per-key value types live in TypeScript only — at runtime every signal\n* is `Signal<unknown>`. The boundary cast at the return narrows the wide\n* `Record<PropertyKey, Signal<unknown>>` shape to the caller's expected\n* per-key types from `S`.\n*\n* Used by `createComposition` to derive engine state/context maps from\n* the union of behaviors' declared `stateKeys` / `contextKeys`.\n*\n* @example\n* ```ts\n* interface State { count?: number; label?: string }\n* const state = buildSignalMap<State>(['count', 'label'], { count: 5 });\n* state.count.get(); // 5\n* state.label.get(); // undefined\n* ```\n*/\nfunction buildSignalMap(keys, initial) {\n\tconst init = initial;\n\tconst uniqueKeys = new Set(keys);\n\treturn Object.fromEntries([...uniqueKeys].map((key) => [key, signal(init[key])]));\n}\nfunction createComposition(behaviors, options) {\n\tconst validBehaviors = behaviors;\n\tconst state = buildSignalMap(validBehaviors.flatMap((b) => b.stateKeys), options?.initialState ?? {});\n\tconst context = buildSignalMap(validBehaviors.flatMap((b) => b.contextKeys), options?.initialContext ?? {});\n\tconst deps = {\n\t\tstate,\n\t\tcontext,\n\t\tconfig: options?.config ?? {}\n\t};\n\tconst cleanups = validBehaviors.map((behavior) => behavior.setup(deps));\n\treturn {\n\t\tstate,\n\t\tcontext,\n\t\tasync destroy() {\n\t\t\tconst results = [];\n\t\t\tfor (const cleanup of cleanups) {\n\t\t\t\tif (cleanup == null) continue;\n\t\t\t\tif (typeof cleanup === \"function\") results.push(cleanup());\n\t\t\t\telse if (\"destroy\" in cleanup) results.push(cleanup.destroy());\n\t\t\t}\n\t\t\tawait Promise.all(results);\n\t\t\tfor (const sig of Object.values(state)) sig.set(void 0);\n\t\t\tfor (const sig of Object.values(context)) sig.set(void 0);\n\t\t}\n\t};\n}\nfunction defineBehavior(behavior) {\n\treturn behavior;\n}\n//#endregion\nexport { buildSignalMap, createComposition, defineBehavior };\n\n//# sourceMappingURL=create-composition.js.map","//#region src/core/composition/share-signals.ts\n/**\n* Behavior factory that hands the composition's signal refs to a\n* consumer-supplied callback (`config.onSignalsReady`) at setup time.\n*\n* Generic over `S` and `C` — the caller instantiates with their own\n* state/context types, and the callback's parameter shape is fully\n* type-driven from those. Suitable for both reads and writes (per-slot\n* intent can be expressed by typing captured refs as `Signal<T>` or\n* `ReadonlySignal<T>` at the call site).\n*\n* By default declares no keys; the composition's state/context maps come from\n* other behaviors. Pass `inputStateKeys` / `inputContextKeys` to *materialize*\n* consumer-input slots that no other behavior produces — a slot the consumer\n* writes (e.g. `userAudioTrackSelection`) but only a rule reads. shareSignals\n* is the consumer boundary, so it's the natural place to bring those slots into\n* existence; readers then treat them as optional.\n*\n* Uses a `Behavior<>` literal (not `defineBehavior`) so its (possibly empty,\n* possibly partial) key arrays don't trip the exhaustiveness check — the\n* setup-param state/context shapes describe what the callback receives (the\n* full `S` / `C`), not the subset this behavior materializes.\n*/\nfunction makeShareSignals(inputStateKeys = [], inputContextKeys = []) {\n\treturn {\n\t\tstateKeys: inputStateKeys,\n\t\tcontextKeys: inputContextKeys,\n\t\tsetup: ({ state, context, config }) => {\n\t\t\tconfig.onSignalsReady?.({\n\t\t\t\tstate,\n\t\t\t\tcontext\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\nexport { makeShareSignals };\n\n//# sourceMappingURL=share-signals.js.map","import { signal, untrack, update } from \"./signals/primitives.js\";\n//#region src/core/machine.ts\n/**\n* Provisions the shared mechanics for all machine-like primitives: a snapshot\n* signal, an untracked state reader, and a transition function.\n*\n* Internal — consumed by `createMachineActor` and `createMachineReactor`. Not part of the\n* public API.\n*/\nfunction createMachineCore(initialSnapshot) {\n\tconst snapshotSignal = signal(initialSnapshot);\n\tconst getState = () => untrack(() => snapshotSignal.get().value);\n\tconst transition = (to) => update(snapshotSignal, (current) => ({\n\t\t...current,\n\t\tvalue: to\n\t}));\n\treturn {\n\t\tsnapshotSignal,\n\t\tgetState,\n\t\ttransition\n\t};\n}\n//#endregion\nexport { createMachineCore };\n\n//# sourceMappingURL=machine.js.map","import { untrack } from \"../signals/primitives.js\";\nimport { effect } from \"../signals/effect.js\";\nimport { createMachineCore } from \"../machine.js\";\n//#region src/core/reactors/create-machine-reactor.ts\nconst toArray = (x) => x === void 0 ? [] : Array.isArray(x) ? x : [x];\n/**\n* Creates a reactive Reactor from a declarative definition.\n*\n* A Reactor is driven by subscriptions to external signals rather than\n* imperative messages. Each state holds an array of effect functions —\n* every element becomes one independent `effect()` call gated on that state,\n* with its own dependency tracking and cleanup lifecycle.\n*\n* `'destroying'` and `'destroyed'` are always implicit terminal states.\n* `destroy()` transitions through both in sequence: `'destroying'` first (for\n* potential async teardown in a future extension), then immediately `'destroyed'`\n* for the synchronous base case. Active effect cleanups fire via disposal.\n*\n* @example\n* const reactor = createMachineReactor({\n* initial: 'waiting',\n* monitor: () => srcSignal.get() ? 'active' : 'waiting',\n* states: {\n* active: {\n* // entry: runs once on state entry; fn body is automatically untracked.\n* entry: () => listen(el, 'play', handler),\n* // effects: re-runs whenever tracked signals change.\n* effects: () => { currentTimeSignal.get(); return cleanup; },\n* },\n* waiting: {},\n* }\n* });\n*/\nfunction createMachineReactor(def) {\n\tconst { snapshotSignal, getState, transition } = createMachineCore({ value: def.initial });\n\tconst effectDisposals = [];\n\tconst wrapResult = (result) => {\n\t\tif (!result) return void 0;\n\t\tif (typeof result === \"function\") return result;\n\t\treturn () => result.abort();\n\t};\n\tconst untracked = (baseCall) => () => untrack(baseCall);\n\tconst isTerminal = (snapshot) => snapshot.value === \"destroying\" || snapshot.value === \"destroyed\";\n\tconst descriptors = [...toArray(def.monitor).map((fn) => ({\n\t\tfn: () => {\n\t\t\tconst target = fn();\n\t\t\tif (target !== getState()) transition(target);\n\t\t},\n\t\tshouldSkip: isTerminal\n\t})), ...Object.entries(def.states).flatMap(([state, stateDef]) => {\n\t\tconst isNotState = (snapshot) => snapshot.value !== state;\n\t\treturn [...toArray(stateDef.entry).map((fn) => ({\n\t\t\tfn,\n\t\t\tshouldSkip: isNotState,\n\t\t\ttoFnCall: untracked\n\t\t})), ...toArray(stateDef.effects).map((fn) => ({\n\t\t\tfn,\n\t\t\tshouldSkip: isNotState\n\t\t}))];\n\t})];\n\tconst toEffect = ({ fn, shouldSkip, toFnCall = (baseCall) => baseCall }) => effect(() => {\n\t\tif (shouldSkip(snapshotSignal.get())) return;\n\t\tconst baseCall = () => fn();\n\t\treturn wrapResult(toFnCall(baseCall)());\n\t});\n\teffectDisposals.push(...descriptors.map(toEffect));\n\treturn {\n\t\tget snapshot() {\n\t\t\treturn snapshotSignal;\n\t\t},\n\t\tdestroy() {\n\t\t\tconst state = getState();\n\t\t\tif (state === \"destroying\" || state === \"destroyed\") return;\n\t\t\ttransition(\"destroying\");\n\t\t\ttransition(\"destroyed\");\n\t\t\tfor (const dispose of effectDisposals) dispose();\n\t\t}\n\t};\n}\n//#endregion\nexport { createMachineReactor };\n\n//# sourceMappingURL=create-machine-reactor.js.map","//#region src/media/types/index.ts\n/**\n* Floating-point tolerance for matching segments by `startTime`. Two\n* segments are considered the same position when\n* `Math.abs(a.startTime - b.startTime) < SEGMENT_TIME_EPSILON`. Used by\n* the source-buffer dedup and segment-loader quality-aware filter to\n* tolerate sub-millisecond drift in segment timestamps across multiple\n* playlists / quality levels.\n*/\nconst SEGMENT_TIME_EPSILON = 1e-4;\n/** Key under `Ham.metadata` where {@link MediaPlaylistMetadata} is stored. */\nconst MEDIA_PLAYLIST_METADATA_KEY = \"mediaPlaylist\";\n/** Typed read of the media-playlist metadata stashed in `ham.metadata`. */\nfunction getMediaPlaylistMetadata(ham) {\n\treturn ham.metadata?.[MEDIA_PLAYLIST_METADATA_KEY];\n}\n/**\n* Derive {@link StreamType} from a media playlist's metadata. Per the model,\n* only `#EXT-X-PLAYLIST-TYPE:VOD` marks on-demand; everything else (EVENT, or\n* the tag absent) is live — completeness (`endList`) never factors in.\n*/\nfunction deriveStreamType(metadata) {\n\treturn metadata?.playlistType === \"VOD\" ? \"on-demand\" : \"live\";\n}\nfunction isResolvedTrack(track) {\n\treturn \"segments\" in track;\n}\n/**\n* Check if a presentation has duration (at least one track resolved).\n* Narrows type to include required duration.\n*/\nfunction hasPresentationDuration(presentation) {\n\treturn presentation.duration !== void 0;\n}\n/**\n* Narrows a `MaybeResolvedPresentation` to a fully resolved `Presentation`.\n*\n* A presentation is resolved once `resolvePresentation` has parsed the\n* manifest and populated both `id` and `selectionSets`. Both must be\n* present — a partial value with only one of them isn't usable, and\n* letting it through would have downstream behaviors crash when they\n* access `selectionSets`.\n*/\nfunction isResolvedPresentation(presentation) {\n\treturn presentation !== void 0 && presentation.id !== void 0 && presentation.selectionSets !== void 0;\n}\n//#endregion\nexport { MEDIA_PLAYLIST_METADATA_KEY, SEGMENT_TIME_EPSILON, deriveStreamType, getMediaPlaylistMetadata, hasPresentationDuration, isResolvedPresentation, isResolvedTrack };\n\n//# sourceMappingURL=index.js.map","import { SEGMENT_TIME_EPSILON } from \"../types/index.js\";\n//#region src/media/buffer/forward-buffer.ts\n/**\n* Forward Buffer Strategy (Simple)\n*\n* Determines which segments to load for forward buffer management.\n* V1 uses simple fixed-duration strategy (buffer N seconds ahead).\n*/\n/**\n* Merge intervals into sorted, disjoint ranges; touching or overlapping ranges\n* (gap ≤ `epsilon`) are joined. Empty/inverted ranges are dropped.\n*/\nfunction mergeTimeRanges(ranges, epsilon = SEGMENT_TIME_EPSILON) {\n\tconst sorted = ranges.filter((r) => r.end > r.start).sort((a, b) => a.start - b.start);\n\tconst merged = [];\n\tfor (const r of sorted) {\n\t\tconst last = merged[merged.length - 1];\n\t\tif (last && r.start <= last.end + epsilon) last.end = Math.max(last.end, r.end);\n\t\telse merged.push({\n\t\t\tstart: r.start,\n\t\t\tend: r.end\n\t\t});\n\t}\n\treturn merged;\n}\n/**\n* Whether `[start, end)` is fully covered by the union of `merged` ranges,\n* tolerating `epsilon` of overhang at each edge. `merged` must be disjoint and\n* sorted (as returned by `mergeTimeRanges`), so full coverage means a single\n* merged range contains the interval.\n*/\nfunction isTimeRangeCovered(start, end, merged, epsilon = SEGMENT_TIME_EPSILON) {\n\treturn merged.some((r) => r.start <= start + epsilon && r.end >= end - epsilon);\n}\n/**\n* Default forward buffer configuration.\n*/\nconst DEFAULT_FORWARD_BUFFER_CONFIG = { bufferDuration: 30 };\n/**\n* Get segments that need to be loaded for forward buffer.\n*\n* Determines which segments to load to maintain target buffer duration.\n* Handles discontiguous buffering (gaps after seeks).\n*\n* Algorithm:\n* 1. Calculate target time: currentTime + bufferDuration\n* 2. Find all segments in range [currentTime, targetTime)\n* 3. Filter out segments already buffered at that time position\n* 4. Return segments to load (fills gaps + extends to target)\n*\n* @param segments - All available segments from playlist\n* @param bufferedSegments - Segments already buffered (ordered by startTime)\n* @param currentTime - Current playback position in seconds\n* @param config - Optional forward buffer configuration\n* @returns Array of segments to load (empty if buffer is sufficient)\n*\n* @example\n* // After seek: buffered [0-12, 18-30], playing at 7s\n* const toLoad = getSegmentsToLoad(segments, buffered, 7, { bufferDuration: 24 });\n* // Returns [seg-12, seg-30] (fills gap, extends to target 31s)\n*/\n/**\n* Calculate the start time from which to flush forward buffer content.\n*\n* Content that starts at or beyond `currentTime + bufferDuration` is no\n* longer needed for the current playback position and should be removed\n* from the SourceBuffer. This prevents unbounded accumulation of scattered\n* SourceBuffer content after seeks, which can cause QuotaExceededError on\n* long-form content.\n*\n* Returns `Infinity` when nothing needs flushing (no buffered segments\n* exist beyond the threshold).\n*\n* @param bufferedSegments - Segments currently tracked in the buffer model\n* @param currentTime - Current playback position in seconds\n* @param config - Optional forward buffer configuration\n* @returns Start time to flush from (flush range: [flushStart, Infinity)),\n* or Infinity if no flush is needed\n*\n* @example\n* // Playing at 0s, buffered [0,6,12,18,24,30,36], bufferDuration=30\n* const flushStart = calculateForwardFlushPoint(segments, 0);\n* // Returns 30 — flush [30, Infinity), keep [0, 30)\n*/\nfunction calculateForwardFlushPoint(bufferedSegments, currentTime, config = DEFAULT_FORWARD_BUFFER_CONFIG) {\n\tif (bufferedSegments.length === 0) return Infinity;\n\tconst threshold = currentTime + config.bufferDuration;\n\tconst beyond = bufferedSegments.filter((seg) => seg.startTime >= threshold);\n\tif (beyond.length === 0) return Infinity;\n\treturn Math.min(...beyond.map((seg) => seg.startTime));\n}\n/**\n* Find the start time of the segment containing `currentTime` (or the last\n* segment if `currentTime` is past the end). Returns `undefined` when\n* `currentTime` is undefined or when no segment matches.\n*\n* Used to detect \"meaningful currentTime change\" — two times that map to the\n* same segment start aren't a load-trigger; crossing a segment boundary is.\n*/\nfunction segmentStartForTime(currentTime, segments) {\n\tif (currentTime == null) return void 0;\n\treturn segments?.find(({ startTime, duration }, i, all) => currentTime >= startTime && (currentTime < startTime + duration || i === all.length - 1))?.startTime;\n}\nfunction getSegmentsToLoad(segments, bufferedSegments, currentTime, config = DEFAULT_FORWARD_BUFFER_CONFIG) {\n\tif (segments.length === 0) return [];\n\tconst targetTime = currentTime + config.bufferDuration;\n\tconst bufferedStartTimes = new Set(bufferedSegments.map((seg) => seg.startTime));\n\treturn segments.filter((seg, i) => {\n\t\tconst segmentEnd = seg.startTime + seg.duration;\n\t\tconst overlapsPlayhead = i === segments.length - 1 || segmentEnd > currentTime;\n\t\tconst isInRange = seg.startTime < targetTime && overlapsPlayhead;\n\t\tconst isNotBuffered = !bufferedStartTimes.has(seg.startTime);\n\t\treturn isInRange && isNotBuffered;\n\t});\n}\n//#endregion\nexport { DEFAULT_FORWARD_BUFFER_CONFIG, calculateForwardFlushPoint, getSegmentsToLoad, isTimeRangeCovered, mergeTimeRanges, segmentStartForTime };\n\n//# sourceMappingURL=forward-buffer.js.map","import { isResolvedTrack } from \"../types/index.js\";\n//#region src/media/utils/tracks.ts\n/**\n* Get the tracks of the given type from a presentation's first switching set.\n*\n* Returns `[]` when the presentation is unresolved, when no selection set of\n* `type` exists, or when its first switching set is empty. Returned tracks may\n* be partially resolved (URL only) or fully resolved (with segments) — callers\n* narrow as needed.\n*\n* The \"first switching set\" assumption matches the rest of the codebase\n* (HLS typically has one switching set per type); multi-group / multi-period\n* support would generalize this.\n*/\nfunction getTracksByType(presentation, type) {\n\treturn presentation.selectionSets?.find(({ type: t }) => t === type)?.switchingSets[0]?.tracks ?? [];\n}\n/**\n* Find a track of the given type and id within a presentation.\n*\n* Returns the matching track from the first switching set of the matching\n* selection set, or `undefined` if either is missing. The returned track may\n* be partially resolved (URL only) or fully resolved (with segments) — callers\n* narrow as needed.\n*/\nfunction findTrack(presentation, type, trackId) {\n\treturn getTracksByType(presentation, type).find(({ id }) => id === trackId);\n}\n/**\n* Find a track by id across all selection sets in a presentation, without\n* knowing its type up front. Used when the caller has a track id obtained\n* from a downstream consumer (e.g. `SourceBufferActor.initTrackId`) and\n* needs to locate the corresponding track in the presentation.\n*\n* Track ids are unique within a presentation per the HLS spec; the first\n* match wins.\n*/\nfunction findTrackById(presentation, trackId) {\n\tfor (const selectionSet of presentation.selectionSets ?? []) {\n\t\tconst track = selectionSet.switchingSets[0]?.tracks.find(({ id }) => id === trackId);\n\t\tif (track) return track;\n\t}\n}\n/**\n* Find a text track of the given id within a presentation and narrow it to\n* the fully-resolved `TextTrack` shape (segments populated). Returns\n* `undefined` if no track matches the id, the matching track isn't a text\n* track, or it hasn't been resolved yet.\n*\n* The segments-non-empty check stays at the call site — a resolved track\n* with zero segments is a valid state, distinct from \"ready to load.\"\n*/\nfunction findResolvedTextTrack(presentation, trackId) {\n\tif (!presentation || !trackId) return void 0;\n\tconst track = findTrack(presentation, \"text\", trackId);\n\tif (track?.type !== \"text\" || !isResolvedTrack(track)) return void 0;\n\treturn track;\n}\nfunction findResolvedVideoTrack(presentation, trackId) {\n\tif (!presentation || !trackId) return void 0;\n\tconst track = findTrack(presentation, \"video\", trackId);\n\tif (track?.type !== \"video\" || !isResolvedTrack(track)) return void 0;\n\treturn track;\n}\nfunction findResolvedAudioTrack(presentation, trackId) {\n\tif (!presentation || !trackId) return void 0;\n\tconst track = findTrack(presentation, \"audio\", trackId);\n\tif (track?.type !== \"audio\" || !isResolvedTrack(track)) return void 0;\n\treturn track;\n}\n/**\n* Whether a track carries a non-empty `codecs` array. Both partially-\n* resolved and fully-resolved tracks may carry codecs — they come from\n* the multivariant playlist's `EXT-X-STREAM-INF` line, not from the\n* per-type media playlist — so this works at either resolution stage.\n*\n* `TextTrack` doesn't declare a `codecs` field; the `'codecs' in track`\n* check narrows it out for the false branch.\n*/\nfunction hasCodecs(track) {\n\treturn !!track && \"codecs\" in track && !!track.codecs?.length;\n}\n/**\n* Set `mimeType` on every track of one `type` (immutably). Used to propagate a\n* detected container across a type's renditions: an ABR ladder is the same\n* content at different bitrates, so one rendition's container holds for all of\n* them — capability probing + SourceBuffer setup then get the right MIME for the\n* whole type from a single resolved media playlist, without fetching the rest.\n*\n* Scoped to one type on purpose: propagating *across* audio/video would be wrong\n* for mixed-container sources (e.g. muxed-TS video + raw-`.aac` audio) and races\n* concurrent per-type resolution. Same-type writes are disjoint and safe.\n* Idempotent — tracks already at `mimeType` are left as-is.\n*\n* **Assumes one container per type, which the HLS specs don't guarantee.** Apple's\n* HLS Authoring Specification not only permits a mixed ladder, it produces one:\n* §1.5 requires HEVC in fMP4, while §9.22 says a 192 kbit/s H.264 variant\n* *packaged in a transport stream* SHOULD be provided for cellular — so a\n* conformant HEVC ladder with that fallback is necessarily mixed. RFC 8216 is\n* silent too (§6.2.4 constrains variant *content*, not container).\n*\n* Where that happens, resolving the TS variant first relabels the whole type,\n* capability probing prunes all of it, and a source whose fMP4 variants were fine\n* reports as unplayable. Accepted because the current target is CMAF-compliant\n* single-container delivery (plus Apple's official fMP4 example); revisit by\n* narrowing the relabel to the resolved track, or gating propagation on config,\n* if mixed ladders come into scope.\n*/\nfunction applyContainerMimeType(presentation, type, mimeType) {\n\treturn {\n\t\t...presentation,\n\t\tselectionSets: presentation.selectionSets.map((selectionSet) => selectionSet.type === type ? {\n\t\t\t...selectionSet,\n\t\t\tswitchingSets: selectionSet.switchingSets.map((switchingSet) => ({\n\t\t\t\t...switchingSet,\n\t\t\t\ttracks: switchingSet.tracks.map((track) => track.mimeType === mimeType ? track : {\n\t\t\t\t\t...track,\n\t\t\t\t\tmimeType\n\t\t\t\t})\n\t\t\t}))\n\t\t} : selectionSet)\n\t};\n}\n/**\n* Updates a track within a presentation (immutably). Generic — works for\n* video, audio, or text tracks.\n*/\nfunction updateTrackInPresentation(presentation, resolvedTrack) {\n\tconst trackId = resolvedTrack.id;\n\treturn {\n\t\t...presentation,\n\t\tselectionSets: presentation.selectionSets.map((selectionSet) => ({\n\t\t\t...selectionSet,\n\t\t\tswitchingSets: selectionSet.switchingSets.map((switchingSet) => ({\n\t\t\t\t...switchingSet,\n\t\t\t\ttracks: switchingSet.tracks.map((track) => track.id === trackId ? resolvedTrack : track)\n\t\t\t}))\n\t\t}))\n\t};\n}\n//#endregion\nexport { applyContainerMimeType, findResolvedAudioTrack, findResolvedTextTrack, findResolvedVideoTrack, findTrack, findTrackById, getTracksByType, hasCodecs, updateTrackInPresentation };\n\n//# sourceMappingURL=tracks.js.map","//#region src/playback/primitives/track-types.ts\n/**\n* **Per-type config bundles for per-type behavior variants.**\n*\n* Each `*_TYPE_CONFIG` constant names the per-type slot keys that\n* per-type-variant setup-shape helpers consume. Variants reference the\n* shared constant at their `defineBehavior` setup body rather than\n* constructing the config inline, so the per-type identity (which state\n* slot, which context slot, which discriminant) lives in one place per\n* type.\n*\n* Variants spread their composition-time `config` over the defaults so\n* engines can layer composition-supplied additions on top (e.g. a\n* custom fetch closure, a non-default segment resolver). Defaults\n* first, engine config second.\n*\n* Helpers continue to consume their slice via the existing typed-key\n* generics (`<K extends SelectedTrackKey>` etc.); the extra fields on\n* the config object (carrying facets other helpers care about) are fine\n* under structural typing.\n*/\n/**\n* Type-identity bundle for video-track-typed behaviors.\n*\n* @see setupVideoBufferActors, loadVideoSegments\n*/\nconst VIDEO_TYPE_CONFIG = {\n\ttype: \"video\",\n\tselectedKey: \"selectedVideoTrackId\",\n\tactorKey: \"videoBufferActor\",\n\tloaderKey: \"videoSegmentLoaderActor\"\n};\n/**\n* Type-identity bundle for audio-track-typed behaviors.\n*\n* @see setupAudioBufferActors, loadAudioSegments\n*/\nconst AUDIO_TYPE_CONFIG = {\n\ttype: \"audio\",\n\tselectedKey: \"selectedAudioTrackId\",\n\tactorKey: \"audioBufferActor\",\n\tloaderKey: \"audioSegmentLoaderActor\"\n};\n/**\n* Type-identity bundle for text-track-typed behaviors. Text tracks have\n* no `SourceBufferActor` (MSE doesn't apply), so this bundle omits\n* `actorKey`. The `loaderKey` points at the text-track-segment-loader\n* actor (a `MessageActor` with continue-vs-preempt semantics, parallel\n* to v/a's `SegmentLoaderActor`).\n*\n* @see loadTextTrackSegments, setupTextTrackActors\n*/\nconst TEXT_TYPE_CONFIG = {\n\ttype: \"text\",\n\tselectedKey: \"selectedTextTrackId\",\n\tloaderKey: \"textTrackSegmentLoaderActor\"\n};\n//#endregion\nexport { AUDIO_TYPE_CONFIG, TEXT_TYPE_CONFIG, VIDEO_TYPE_CONFIG };\n\n//# sourceMappingURL=track-types.js.map","import { computed, peek } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { DEFAULT_FORWARD_BUFFER_CONFIG, segmentStartForTime } from \"../../../media/buffer/forward-buffer.js\";\nimport { findResolvedAudioTrack, findResolvedTextTrack, findResolvedVideoTrack } from \"../../../media/utils/tracks.js\";\nimport { AUDIO_TYPE_CONFIG, TEXT_TYPE_CONFIG, VIDEO_TYPE_CONFIG } from \"../../primitives/track-types.js\";\n//#region src/playback/behaviors/dom/load-segments.ts\n/**\n* **Per-type segment loading dispatch.** Per available track type (video /\n* audio / text), reads the per-type segment-loader actor from context and\n* sends typed `'load'` messages whenever a meaningful loading condition\n* changes (selected track, current time crossing a segment boundary).\n*\n* Loader-actor lifecycle is owned upstream:\n* - Video: `setupVideoBufferActors`\n* - Audio: `setupAudioBufferActors`\n* - Text: `setupTextTrackActors`\n*\n* This behavior is pure-consumer: it reads `context[loaderKey]` and\n* dispatches typed messages via the variant's per-type `findResolvedTrack`\n* resolver.\n*\n* # Load modes as reactor states\n*\n* Four states encode the load-gating policy directly:\n*\n* - `'preconditions-unmet'` — no loader actor in context, or the selected\n* track hasn't resolved.\n* - `'dormant'` — loading disabled by policy: an observed `loadingSuspended`\n* (highest precedence) or `preload === 'none' && !loadActivated`. Nothing\n* fires; already-queued loader work drains. Auto-resumes into the derived\n* state when the policy lifts.\n* - `'metadata-only'` — `!loadActivated && preload !== 'auto' && preload !== 'none'`.\n* Fires an init-segment-only `load` message **once on entry**. The\n* variant's loader actor decides what to do — v/a's actor fetches the\n* init segment; text's actor no-ops (no init concept).\n* - `'full-range'` — `loadActivated || preload === 'auto'`. Effect re-fires\n* on selected-track change and on segment-boundary crossing.\n*\n* # Per-type parameterization (inference-driven)\n*\n* The helper is generic over `Track` — the resolved-track type. Each\n* variant supplies its own `findResolvedTrack` resolver via config; TS\n* infers `Track` from the resolver's return type. The loader signal's\n* value type is constrained to `SegmentLoaderLike<Track>` — anything with\n* a `send` method accepting the `Track`-parameterized message. Concrete\n* actor types (`SegmentLoaderActor`, `TextTrackSegmentLoaderActor`)\n* satisfy this via function-parameter contravariance: an actor whose\n* `.send` accepts a wider track type is assignable to a slot expecting a\n* narrower track type.\n*\n* No widening of actor message types is needed; no casts inside the\n* helper. Per-variant wiring (right loader paired with right resolver)\n* is enforced at the variant call site.\n*/\n/**\n* Specialization helper. Generic over `Track` (inferred from\n* `findResolvedTrack`'s return type). The loader value type is\n* constrained to `SegmentLoaderLike<Track>` — concrete actor types\n* (whose `.send` accepts a wider track union) satisfy this via\n* function-parameter contravariance.\n*\n* Tracks that the helper handles must have a `segments` field — used by\n* `segmentBoundarySignal` to compute the load-anchor boundary. Each\n* variant's resolver narrows to the right resolved-track shape.\n*/\nfunction setupSegmentLoading({ state, context, config }) {\n\tconst { selectedKey, loaderKey, findResolvedTrack } = config;\n\tconst bufferDuration = config.forwardBuffer?.bufferDuration ?? DEFAULT_FORWARD_BUFFER_CONFIG.bufferDuration;\n\tconst selectedTrack = computed(() => findResolvedTrack(state.presentation.get(), state[selectedKey].get()));\n\tconst segmentBoundarySignal = computed(() => {\n\t\tconst track = selectedTrack.get();\n\t\tif (!track) return void 0;\n\t\treturn segmentStartForTime(state.currentTime.get() ?? 0, track.segments);\n\t});\n\tconst derivedStateSignal = computed(() => {\n\t\tif (state.loadingSuspended?.get()) return \"dormant\";\n\t\tif (!context[loaderKey].get() || !selectedTrack.get()) return \"preconditions-unmet\";\n\t\tif (state.loadActivated.get() || state.preload.get() === \"auto\") return \"full-range\";\n\t\tif (state.preload.get() === \"none\") return \"dormant\";\n\t\treturn \"metadata-only\";\n\t});\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\tdormant: {},\n\t\t\t\"metadata-only\": { entry: () => {\n\t\t\t\tconst track = selectedTrack.get();\n\t\t\t\tcontext[loaderKey].get().send({\n\t\t\t\t\ttype: \"load\",\n\t\t\t\t\ttrack\n\t\t\t\t});\n\t\t\t} },\n\t\t\t\"full-range\": { effects: () => {\n\t\t\t\tconst track = selectedTrack.get();\n\t\t\t\tsegmentBoundarySignal.get();\n\t\t\t\tconst currentTime = peek(state.currentTime) ?? 0;\n\t\t\t\tpeek(context[loaderKey]).send({\n\t\t\t\t\ttype: \"load\",\n\t\t\t\t\ttrack,\n\t\t\t\t\trange: {\n\t\t\t\t\t\tstart: currentTime,\n\t\t\t\t\t\tend: currentTime + bufferDuration\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} }\n\t\t}\n\t});\n}\nconst VIDEO_SEGMENT_LOADING_CONFIG = {\n\t...VIDEO_TYPE_CONFIG,\n\tfindResolvedTrack: findResolvedVideoTrack\n};\nconst AUDIO_SEGMENT_LOADING_CONFIG = {\n\t...AUDIO_TYPE_CONFIG,\n\tfindResolvedTrack: findResolvedAudioTrack\n};\nconst TEXT_SEGMENT_LOADING_CONFIG = {\n\t...TEXT_TYPE_CONFIG,\n\tfindResolvedTrack: findResolvedTextTrack\n};\nconst loadVideoSegments = defineBehavior({\n\tstateKeys: [\n\t\t\"presentation\",\n\t\t\"preload\",\n\t\t\"currentTime\",\n\t\t\"loadActivated\",\n\t\t\"selectedVideoTrackId\"\n\t],\n\tcontextKeys: [\"videoSegmentLoaderActor\"],\n\tsetup: ({ state, context, config = {} }) => setupSegmentLoading({\n\t\tstate,\n\t\tcontext,\n\t\tconfig: {\n\t\t\t...VIDEO_SEGMENT_LOADING_CONFIG,\n\t\t\t...config\n\t\t}\n\t})\n});\nconst loadAudioSegments = defineBehavior({\n\tstateKeys: [\n\t\t\"presentation\",\n\t\t\"preload\",\n\t\t\"currentTime\",\n\t\t\"loadActivated\",\n\t\t\"selectedAudioTrackId\"\n\t],\n\tcontextKeys: [\"audioSegmentLoaderActor\"],\n\tsetup: ({ state, context, config = {} }) => setupSegmentLoading({\n\t\tstate,\n\t\tcontext,\n\t\tconfig: {\n\t\t\t...AUDIO_SEGMENT_LOADING_CONFIG,\n\t\t\t...config\n\t\t}\n\t})\n});\nconst loadTextTrackSegments = defineBehavior({\n\tstateKeys: [\n\t\t\"presentation\",\n\t\t\"preload\",\n\t\t\"currentTime\",\n\t\t\"loadActivated\",\n\t\t\"selectedTextTrackId\"\n\t],\n\tcontextKeys: [\"textTrackSegmentLoaderActor\"],\n\tsetup: ({ state, context, config = {} }) => setupSegmentLoading({\n\t\tstate,\n\t\tcontext,\n\t\tconfig: {\n\t\t\t...TEXT_SEGMENT_LOADING_CONFIG,\n\t\t\t...config\n\t\t}\n\t})\n});\n//#endregion\nexport { loadAudioSegments, loadTextTrackSegments, loadVideoSegments };\n\n//# sourceMappingURL=load-segments.js.map","import { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { effect } from \"../../../core/signals/effect.js\";\nimport { listen } from \"@videojs/utils/dom\";\n//#region src/playback/behaviors/dom/track-current-time.ts\n/**\n* Mirror `mediaElement.currentTime` into reactive state. Listens for:\n* - `timeupdate` — fires during playback (~4 Hz)\n* - `seeking` — fires when a seek begins; per spec, `currentTime` is already\n* at the new position when this event dispatches, so buffer management can\n* react immediately rather than waiting for `timeupdate`, which does not\n* fire while paused.\n* - `emptied` — fires when the resource selection algorithm tears down the\n* current media (e.g. a new `src` is set on the same element). Re-syncs so\n* downstream state doesn't retain the stale playback position from the\n* previous source when the engine is reused across src changes.\n*\n* Also syncs immediately when a media element becomes available.\n*\n* When no media element is attached, writes `config.defaultCurrentTime`\n* (default-default `0`, matching the HTMLMediaElement spec) so consumers\n* always see a defined position. Read-only mirror; does not push\n* `state.currentTime` back to the element.\n*/\nfunction trackCurrentTimeSetup({ state, context, config }) {\n\tconst defaultCurrentTime = config?.defaultCurrentTime ?? 0;\n\treturn effect(() => {\n\t\tconst mediaElement = context.mediaElement.get();\n\t\tif (!mediaElement) {\n\t\t\tstate.currentTime.set(defaultCurrentTime);\n\t\t\treturn;\n\t\t}\n\t\tconst sync = () => state.currentTime.set(mediaElement.currentTime);\n\t\tsync();\n\t\tconst removeEmptied = listen(mediaElement, \"emptied\", sync);\n\t\tconst removeTimeupdate = listen(mediaElement, \"timeupdate\", sync);\n\t\tconst removeSeeking = listen(mediaElement, \"seeking\", sync);\n\t\treturn () => {\n\t\t\tremoveEmptied();\n\t\t\tremoveTimeupdate();\n\t\t\tremoveSeeking();\n\t\t};\n\t});\n}\nconst trackCurrentTime = defineBehavior({\n\tstateKeys: [\"currentTime\"],\n\tcontextKeys: [\"mediaElement\"],\n\tsetup: trackCurrentTimeSetup\n});\n//#endregion\nexport { trackCurrentTime };\n\n//# sourceMappingURL=track-current-time.js.map","//#region src/media/dom/mse/mediasource-setup.ts\n/**\n* MediaSource Setup\n*\n* Utilities for creating and configuring MediaSource/ManagedMediaSource\n* for MSE (Media Source Extensions) playback.\n*\n* Global ManagedMediaSource types are defined in ./mediasource.d.ts\n*/\n/**\n* Check if MediaSource API is supported.\n*/\nfunction supportsMediaSource() {\n\treturn typeof MediaSource !== \"undefined\";\n}\n/**\n* Check if ManagedMediaSource API is supported.\n* ManagedMediaSource is a newer Safari API with better lifecycle management.\n*/\nfunction supportsManagedMediaSource() {\n\treturn typeof ManagedMediaSource !== \"undefined\";\n}\n/**\n* Create a MediaSource or ManagedMediaSource instance.\n*\n* @param options - Creation options\n* @returns A MediaSource or ManagedMediaSource instance\n* @throws Error if no MediaSource API is available\n*\n* @example\n* const mediaSource = createMediaSource();\n* const mediaElement = document.querySelector('video');\n* attachMediaSource(mediaSource, mediaElement);\n*/\nfunction createMediaSource(options = {}) {\n\tconst { preferManaged = false } = options;\n\tif (preferManaged && supportsManagedMediaSource()) return new ManagedMediaSource();\n\tif (supportsMediaSource()) return new MediaSource();\n\tthrow new Error(\"MediaSource API is not supported\");\n}\n/**\n* Attach a MediaSource to an HTMLMediaElement via the `src` attribute.\n*\n* The object URL on the `src` attribute is the industry-hardened MSE attach\n* across the browser matrix, and works for ManagedMediaSource too (`srcObject`\n* buys nothing over it and forfeits the uniform URL lifecycle).\n*\n* @param mediaSource - The MediaSource to attach\n* @param mediaElement - The media element to attach to\n* @returns Object with URL and detach function\n*\n* @example\n* const mediaSource = createMediaSource();\n* const { detach } = attachMediaSource(mediaSource, videoElement);\n* // Use mediaSource...\n* // Later, to clean up:\n* detach();\n*/\nfunction attachMediaSource(mediaSource, mediaElement) {\n\tif (supportsManagedMediaSource() && mediaSource instanceof ManagedMediaSource) mediaElement.disableRemotePlayback = true;\n\tconst url = URL.createObjectURL(mediaSource);\n\tmediaElement.src = url;\n\tconst detach = ({ deferReset } = {}) => {\n\t\tmediaElement.removeAttribute(\"src\");\n\t\tscheduleReset(mediaSource, mediaElement, url, deferReset);\n\t\tURL.revokeObjectURL(url);\n\t};\n\treturn {\n\t\turl,\n\t\tdetach\n\t};\n}\n/**\n* Attach a MediaSource as a `<source>` child element.\n*\n* The object URL rides a `<source type=\"video/mp4\">` inserted as the\n* element's FIRST child (any bare `src` attribute is dropped; `load()`\n* re-runs resource selection). Unlike `srcObject`/`src` — which commit the\n* element to the MSE resource and ignore every `<source>` child — this\n* keeps sibling `<source>` alternatives part of resource selection, so a\n* composition can offer the element a natively-playable alternative next to\n* MSE. Canonical consumer: `setupAirPlay`'s native-HLS fallback source,\n* wired through `setupMediaSource`'s `attachMediaSource` config\n* (https://webkit.org/blog/15036/how-to-use-media-source-extensions-with-airplay/).\n*/\nfunction attachMediaSourceAsSourceElement(mediaSource, mediaElement) {\n\tif (supportsManagedMediaSource() && mediaSource instanceof ManagedMediaSource) mediaElement.disableRemotePlayback = true;\n\tconst url = URL.createObjectURL(mediaSource);\n\tconst sourceEl = document.createElement(\"source\");\n\tsourceEl.type = \"video/mp4\";\n\tsourceEl.src = url;\n\tmediaElement.removeAttribute(\"src\");\n\tmediaElement.prepend(sourceEl);\n\tmediaElement.load();\n\tconst detach = ({ deferReset } = {}) => {\n\t\tsourceEl.remove();\n\t\tscheduleReset(mediaSource, mediaElement, url, deferReset);\n\t\tURL.revokeObjectURL(url);\n\t};\n\treturn {\n\t\turl,\n\t\tdetach\n\t};\n}\n/**\n* Detach's `load()` reset, applied only when tearing down an **unclosed**\n* attachment the element is still committed to:\n*\n* - **Closed MediaSource**: skip. The attachment is already dead, and the\n* element deliberately keeps whatever playback state it carries for\n* whatever attaches next — that attach's own `load()` performs the reset.\n* - **Element moved to another resource**: skip — resetting would rip that\n* resource out from under its owner.\n*/\nfunction resetIfOwnedAndNotClosed(mediaSource, mediaElement, url) {\n\tif (mediaSource.readyState !== \"closed\" && mediaElement.currentSrc === url) mediaElement.load();\n}\n/**\n* Run the reset now, or on the next microtask when the caller has sibling\n* `<source>` owners that clear on an effect (see {@link DetachOptions.deferReset}).\n*\n* Deferring is safe because removing this attachment's own source does not by\n* itself re-run resource selection: the element stays committed to the object\n* URL until something calls `load()`, so nothing starts playing in the gap.\n*/\nfunction scheduleReset(mediaSource, mediaElement, url, deferReset) {\n\tif (deferReset) {\n\t\tqueueMicrotask(() => resetIfOwnedAndNotClosed(mediaSource, mediaElement, url));\n\t\treturn;\n\t}\n\tresetIfOwnedAndNotClosed(mediaSource, mediaElement, url);\n}\n/**\n* Create a SourceBuffer on a MediaSource.\n*\n* @param mediaSource - The MediaSource (must be in 'open' state)\n* @param mimeCodec - MIME type with codecs (e.g., 'video/mp4; codecs=\"avc1.42E01E\"')\n* @returns The created SourceBuffer\n* @throws Error if MediaSource is not open or codec is unsupported\n*\n* @example\n* const buffer = createSourceBuffer(mediaSource, 'video/mp4; codecs=\"avc1.42E01E\"');\n*/\nfunction createSourceBuffer(mediaSource, mimeCodec) {\n\tif (mediaSource.readyState !== \"open\") throw new Error(\"MediaSource is not open\");\n\tif (!isCodecSupported(mimeCodec)) throw new Error(`Codec not supported: ${mimeCodec}`);\n\treturn mediaSource.addSourceBuffer(mimeCodec);\n}\n/**\n* Build a MIME codec string from a track's `mimeType` + `codecs`. Works\n* on partially-resolved tracks — both fields come from the multivariant\n* playlist and are available before media-playlist resolution.\n*\n* @param track - Track carrying `mimeType` and `codecs`\n* @returns MIME codec string suitable for `MediaSource.addSourceBuffer`\n*\n* @example\n* buildMimeCodec({ mimeType: 'video/mp4', codecs: ['avc1.42E01E'] })\n* // => 'video/mp4; codecs=\"avc1.42E01E\"'\n*/\nfunction buildMimeCodec(track) {\n\tconst codecString = track.codecs?.join(\",\") ?? \"\";\n\treturn `${track.mimeType}; codecs=\"${codecString}\"`;\n}\n/**\n* Check if a codec is supported.\n*\n* @param mimeCodec - MIME type with codecs string\n* @returns True if the codec is supported\n*\n* @example\n* if (isCodecSupported('video/mp4; codecs=\"avc1.42E01E\"')) {\n* // Create source buffer\n* }\n*/\nfunction isCodecSupported(mimeCodec) {\n\tif (!supportsMediaSource()) return false;\n\treturn MediaSource.isTypeSupported(mimeCodec);\n}\n/**\n* Observe `mediaSource.readyState` changes via DOM events.\n*\n* Listens to `sourceopen`, `sourceended`, and `sourceclose` and invokes\n* `onChange` with the current `readyState` after each event. Listeners\n* are automatically removed when `abortSignal` is aborted.\n*\n* @param mediaSource - The MediaSource to observe\n* @param abortSignal - AbortSignal that controls listener lifetime\n* @param onChange - Called with the current readyState after each change\n*\n* @example\n* const controller = new AbortController();\n* onMediaSourceReadyStateChange(mediaSource, controller.signal, (state) => {\n* if (state === 'open') { ... }\n* });\n* // Later: controller.abort();\n*/\nfunction onMediaSourceReadyStateChange(mediaSource, abortSignal, onChange) {\n\tconst update = () => onChange(mediaSource.readyState);\n\tconst options = { signal: abortSignal };\n\tmediaSource.addEventListener(\"sourceopen\", update, options);\n\tmediaSource.addEventListener(\"sourceended\", update, options);\n\tmediaSource.addEventListener(\"sourceclose\", update, options);\n}\n/**\n* Wait until `mediaSource.readyState` transitions away from `'closed'`\n* (the next `sourceopen`/`sourceended`/`sourceclose` event), or until\n* `signal` aborts — whichever fires first.\n*\n* Resolves immediately when `readyState` is already `'open'` or `'ended'`\n* (no further transition is coming, so there's nothing to wait for). The\n* caller is expected to re-check `readyState` after the await to\n* distinguish `'open'` from terminal states.\n*\n* Companion to `onMediaSourceReadyStateChange` for one-shot use in async\n* sequences (e.g., a behavior's reactor entry that needs to wait for the\n* MediaSource to attach before performing a spec-conforming mutation).\n*\n* @example\n* await waitForMediaSourceOpen(mediaSource, signal);\n* if (signal.aborted || mediaSource.readyState !== 'open') return;\n* // safe to perform 'open'-state-only work\n*/\nfunction waitForMediaSourceOpen(mediaSource, signal) {\n\tif (signal.aborted) return Promise.resolve();\n\tif (mediaSource.readyState !== \"closed\") return Promise.resolve();\n\treturn new Promise((resolve) => {\n\t\tconst done = () => resolve();\n\t\tconst options = {\n\t\t\tonce: true,\n\t\t\tsignal\n\t\t};\n\t\tmediaSource.addEventListener(\"sourceopen\", done, options);\n\t\tmediaSource.addEventListener(\"sourceended\", done, options);\n\t\tmediaSource.addEventListener(\"sourceclose\", done, options);\n\t\tsignal.addEventListener(\"abort\", done, { once: true });\n\t});\n}\n//#endregion\nexport { attachMediaSource, attachMediaSourceAsSourceElement, buildMimeCodec, createMediaSource, createSourceBuffer, isCodecSupported, onMediaSourceReadyStateChange, supportsManagedMediaSource, supportsMediaSource, waitForMediaSourceOpen };\n\n//# sourceMappingURL=mediasource-setup.js.map","//#region src/media/hls/parse-attributes.ts\n/**\n* Parse HLS attribute list from a tag line.\n* Handles both quoted and unquoted values.\n*/\nfunction parseAttributeList(line) {\n\tconst attributes = /* @__PURE__ */ new Map();\n\tfor (const match of line.matchAll(/([A-Z0-9-]+)=(?:\"([^\"]*)\"|([^,]*))/g)) {\n\t\tconst key = match[1];\n\t\tconst value = match[2] ?? match[3] ?? \"\";\n\t\tif (key) attributes.set(key, value);\n\t}\n\treturn attributes;\n}\n/**\n* Parse RESOLUTION attribute value (WIDTHxHEIGHT).\n*/\nfunction parseResolution(value) {\n\tconst match = /^(\\d+)x(\\d+)$/.exec(value);\n\tif (!match) return null;\n\treturn {\n\t\twidth: Number.parseInt(match[1], 10),\n\t\theight: Number.parseInt(match[2], 10)\n\t};\n}\n/**\n* Parse FRAME-RATE attribute to rational frame rate.\n*/\nfunction parseFrameRate(value) {\n\tconst fps = Number.parseFloat(value);\n\tif (Number.isNaN(fps) || fps <= 0) return void 0;\n\tif (Math.abs(fps - 23.976) < .01) return {\n\t\tframeRateNumerator: 24e3,\n\t\tframeRateDenominator: 1001\n\t};\n\tif (Math.abs(fps - 29.97) < .01) return {\n\t\tframeRateNumerator: 3e4,\n\t\tframeRateDenominator: 1001\n\t};\n\tif (Math.abs(fps - 59.94) < .01) return {\n\t\tframeRateNumerator: 6e4,\n\t\tframeRateDenominator: 1001\n\t};\n\tif (fps % 1 === 0) return { frameRateNumerator: Math.round(fps) };\n\treturn { frameRateNumerator: Math.round(fps) };\n}\nconst AUDIO_CODEC_PREFIXES = [\n\t\"mp4a.\",\n\t\"ac-3\",\n\t\"ec-3\",\n\t\"ac-4\",\n\t\"opus\",\n\t\"flac\",\n\t\"dts\",\n\t\"alac\",\n\t\"vorbis\"\n];\n/**\n* Parse CODECS attribute into separate video and audio codecs.\n*/\nfunction parseCodecs(codecs) {\n\tconst parts = codecs.split(\",\").map((s) => s.trim());\n\tconst result = {};\n\tfor (const codec of parts) {\n\t\tconst lower = codec.toLowerCase();\n\t\tif (codec.startsWith(\"avc1.\") || codec.startsWith(\"hvc1.\") || codec.startsWith(\"hev1.\")) result.video = codec;\n\t\telse if (AUDIO_CODEC_PREFIXES.some((prefix) => lower.startsWith(prefix))) result.audio = codec;\n\t}\n\treturn result;\n}\n/**\n* Parse #EXTINF duration value.\n*/\nfunction parseExtInfDuration(value) {\n\tconst durationPart = value.split(\",\")[0] ?? value;\n\tconst duration = Number.parseFloat(durationPart);\n\treturn Number.isNaN(duration) ? 0 : duration;\n}\n/**\n* Parse BYTERANGE attribute value.\n* Format: \"length[@offset]\"\n* If offset is omitted, it continues from the previous byte range end.\n*/\nfunction parseByteRange(value, previousEnd) {\n\tconst match = /^(\\d+)(?:@(\\d+))?$/.exec(value);\n\tif (!match) return null;\n\tconst length = Number.parseInt(match[1], 10);\n\tif (Number.isNaN(length)) return null;\n\tlet start;\n\tif (match[2] !== void 0) {\n\t\tstart = Number.parseInt(match[2], 10);\n\t\tif (Number.isNaN(start)) return null;\n\t} else if (previousEnd !== void 0) start = previousEnd;\n\telse return null;\n\treturn {\n\t\tstart,\n\t\tend: start + length - 1\n\t};\n}\n/**\n* Create AttributeList from raw attribute string.\n*/\nfunction createAttributeList(line) {\n\tconst map = parseAttributeList(line);\n\treturn {\n\t\tget(key) {\n\t\t\treturn map.get(key);\n\t\t},\n\t\tgetInt(key, defaultValue) {\n\t\t\tconst value = map.get(key);\n\t\t\tif (value === void 0) return defaultValue;\n\t\t\tconst parsed = Number.parseInt(value, 10);\n\t\t\treturn Number.isNaN(parsed) ? defaultValue : parsed;\n\t\t},\n\t\tgetFloat(key, defaultValue) {\n\t\t\tconst value = map.get(key);\n\t\t\tif (value === void 0) return defaultValue;\n\t\t\tconst parsed = Number.parseFloat(value);\n\t\t\treturn Number.isNaN(parsed) ? defaultValue : parsed;\n\t\t},\n\t\tgetBool(key) {\n\t\t\treturn map.get(key) === \"YES\";\n\t\t},\n\t\tgetResolution(key) {\n\t\t\tconst value = map.get(key);\n\t\t\tif (!value) return void 0;\n\t\t\treturn parseResolution(value) ?? void 0;\n\t\t},\n\t\tgetFrameRate(key) {\n\t\t\tconst value = map.get(key);\n\t\t\tif (!value) return void 0;\n\t\t\treturn parseFrameRate(value);\n\t\t}\n\t};\n}\n/**\n* Match a tag and extract its attributes.\n* Returns null if the line doesn't match the tag.\n*/\nfunction matchTag(line, tag) {\n\tconst prefix = `#${tag}:`;\n\tif (!line.startsWith(prefix)) return null;\n\treturn createAttributeList(line.slice(prefix.length));\n}\n//#endregion\nexport { createAttributeList, matchTag, parseAttributeList, parseByteRange, parseCodecs, parseExtInfDuration, parseFrameRate, parseResolution };\n\n//# sourceMappingURL=parse-attributes.js.map","//#region src/media/hls/resolve-url.ts\n/**\n* Resolve a potentially relative URL against a base URL using native URL API.\n*/\nfunction resolveUrl(url, baseUrl) {\n\treturn new URL(url, baseUrl).href;\n}\n//#endregion\nexport { resolveUrl };\n\n//# sourceMappingURL=resolve-url.js.map","import { MEDIA_PLAYLIST_METADATA_KEY, getMediaPlaylistMetadata, isResolvedTrack } from \"../types/index.js\";\nimport { matchTag, parseByteRange, parseExtInfDuration } from \"./parse-attributes.js\";\nimport { resolveUrl } from \"./resolve-url.js\";\nimport { isUndefined } from \"@videojs/utils/predicate\";\n//#region src/media/hls/parse-media-playlist.ts\n/** MPEG-2 Transport Stream (IANA `video/MP2T`, lowercased for `isTypeSupported`). Video + audio TS — there is no `audio/mp2t`. */\nconst MPEG_TS_MIME = \"video/mp2t\";\n/** Raw ADTS AAC packed-audio (HLS `.aac` segments; IANA `audio/aac`). */\nconst RAW_AAC_MIME = \"audio/aac\";\nconst CONTAINER_MIME_BY_EXTENSION = {\n\t\".ts\": MPEG_TS_MIME,\n\t\".aac\": RAW_AAC_MIME\n};\n/** The non-fMP4 container MIMEs the parser detects — all currently treated as unplayable. */\nconst NON_FMP4_CONTAINER_MIMES = new Set(Object.values(CONTAINER_MIME_BY_EXTENSION));\n/**\n* Non-fMP4 container MIME for a (resolved, absolute) segment URL, by file\n* extension, ignoring the query string. `undefined` for fMP4 / unrecognized.\n*/\nfunction containerMimeFromSegment(url) {\n\tif (!url) return void 0;\n\tlet path;\n\ttry {\n\t\tpath = new URL(url).pathname.toLowerCase();\n\t} catch {\n\t\tpath = url.toLowerCase().split(\"?\")[0] ?? \"\";\n\t}\n\tconst dot = path.lastIndexOf(\".\");\n\treturn dot === -1 ? void 0 : CONTAINER_MIME_BY_EXTENSION[path.slice(dot)];\n}\n/**\n* Position a freshly-parsed window (whose segment `startTime`s are snapshot-\n* local, i.e. from 0) onto the timeline established by the previous resolved\n* snapshot. Carries the timeline forward using the media-sequence overlap and\n* the previous window's *actual* segment durations — see\n* `internal/design/spf/live-presentation-timeline-model.md`.\n*\n* - **Overlap** (`0 <= offset < previous.segments.length`): the new window's\n* first segment is the same segment as `previous.segments[offset]`; anchor to\n* its start (URLs checked — a mismatch warns).\n* - **Sequence went backwards** (non-conformant): reset to the local base.\n* - **Full turnover** (no overlap): estimate forward from the previous window's\n* end across the unseen gap. This is the *only* place EXT-X-TARGETDURATION is\n* used for timing — an upper-bound estimate, since the actual rolled-off\n* durations are gone (exact recovery is the deferred PDT decision).\n*\n* Returns the rebased segments (the window edge is `segments[0].startTime`,\n* derived — never stored on the track).\n*/\nfunction placeOnPreviousTimeline(previous, segments, mediaSequence, targetDuration) {\n\tconst prevSegments = previous.segments;\n\tconst localBase = segments[0]?.startTime ?? 0;\n\tif (prevSegments.length === 0 || segments.length === 0) return segments;\n\tconst offset = mediaSequence - (getMediaPlaylistMetadata(previous)?.mediaSequence ?? 0);\n\tlet anchor;\n\tif (offset >= 0 && offset < prevSegments.length) {\n\t\tconst overlap = prevSegments[offset];\n\t\tif (overlap.url !== segments[0].url) console.warn(`[parseMediaPlaylist] media-sequence aligns previous[${offset}] with the new window's first segment, but URLs differ (${overlap.url} vs ${segments[0].url}); sequence numbers may be unreliable.`);\n\t\tanchor = overlap.startTime;\n\t} else if (offset < 0) {\n\t\tconsole.warn(`[parseMediaPlaylist] media-sequence went backwards (offset ${offset}); resetting timeline.`);\n\t\tanchor = localBase;\n\t} else {\n\t\tconst last = prevSegments[prevSegments.length - 1];\n\t\tconst newFirst = segments[0];\n\t\tif (last.startDate !== void 0 && newFirst.startDate !== void 0) anchor = last.startTime + (newFirst.startDate - last.startDate);\n\t\telse {\n\t\t\tanchor = last.startTime + last.duration + (offset - prevSegments.length) * targetDuration;\n\t\t\tconsole.warn(`[parseMediaPlaylist] full window turnover (offset ${offset} >= ${prevSegments.length}); no PDT to bridge — estimating from previous end.`);\n\t\t}\n\t}\n\tconst shift = anchor - localBase;\n\treturn shift === 0 ? segments : segments.map((segment) => ({\n\t\t...segment,\n\t\tstartTime: segment.startTime + shift\n\t}));\n}\n/**\n* Place a window on the frozen wall-clock anchor — the track's `startDate`\n* (wall clock at media-time 0). The anchoring PDT-bearing segment lands at\n* `segment.startDate − anchor`, so the window sits on the shared presentation\n* timeline rather than a local-from-zero one (the `startDate` recomputed\n* afterwards then reads back as the anchor — idempotent). This is the **main\n* live path on every parse**: first resolves place against the pre-stamped\n* shell anchor, and reloads re-place from PDT so drift can't accumulate and a\n* long-stall turnover re-places with no overlap bridging (the HLS authoring\n* spec's §8.1 EXTINF-accuracy rule bounds the per-reload correction to ~one\n* video frame). Falls back to the local base when no segment carries PDT —\n* there's nothing to anchor against (callers guard this for reloads, where the\n* local base would reset the timeline).\n*/\nfunction placeOnAnchor(segments, anchor) {\n\tconst anchorSegment = segments.find((segment) => !isUndefined(segment.startDate));\n\tif (!anchorSegment || isUndefined(anchorSegment.startDate)) return segments;\n\tconst shift = anchorSegment.startDate - anchor - anchorSegment.startTime;\n\tif (shift === 0) return segments;\n\treturn segments.map((segment) => ({\n\t\t...segment,\n\t\tstartTime: segment.startTime + shift\n\t}));\n}\n/**\n* Parse HLS media playlist and resolve track with segments.\n*\n* `previous` is what was known about this track before this parse: the\n* partially-resolved track from the multivariant playlist on the first resolve,\n* or the previously-resolved snapshot on a live reload. Its metadata is carried\n* onto the result either way; when it's already resolved (has segments), its\n* timeline is carried forward so the new window lands on a stable, advancing\n* timeline (see {@link placeOnPreviousTimeline}).\n*\n* @param text - Media playlist text content\n* @param previous - Prior track state (unresolved shell, or previous resolved snapshot)\n* @returns Resolved track with segments (type inferred from input)\n*/\nfunction parseMediaPlaylist(text, previous) {\n\tconst lines = text.split(/\\r?\\n/);\n\tconst baseUrl = previous.url;\n\tconst segments = [];\n\tlet initSegmentUrl;\n\tlet initSegmentByteRange;\n\tlet currentDuration = 0;\n\tlet currentByteRange;\n\tlet currentTime = 0;\n\tlet segmentIndex = 0;\n\tlet previousByteRangeEnd;\n\tlet currentStartDate;\n\tlet targetDuration = 0;\n\tlet mediaSequence = 0;\n\tlet playlistType;\n\tlet endList = false;\n\tlet holdBack;\n\tlet lowLatency = false;\n\tlet encrypted = false;\n\tfor (const line of lines) {\n\t\tconst trimmed = line.trim();\n\t\tif (!trimmed || trimmed.startsWith(\"#\") && !trimmed.startsWith(\"#EXT\")) continue;\n\t\tif (trimmed.startsWith(\"#EXT-X-TARGETDURATION:\")) {\n\t\t\ttargetDuration = Number.parseInt(trimmed.slice(22), 10) || 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (trimmed.startsWith(\"#EXT-X-MEDIA-SEQUENCE:\")) {\n\t\t\tmediaSequence = Number.parseInt(trimmed.slice(22), 10) || 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (trimmed.startsWith(\"#EXT-X-PROGRAM-DATE-TIME:\")) {\n\t\t\tconst parsed = Date.parse(trimmed.slice(25).trim());\n\t\t\tcurrentStartDate = Number.isNaN(parsed) ? currentStartDate : parsed / 1e3;\n\t\t\tcontinue;\n\t\t}\n\t\tif (trimmed.startsWith(\"#EXT-X-PLAYLIST-TYPE:\")) {\n\t\t\tconst value = trimmed.slice(21).trim();\n\t\t\tplaylistType = value === \"VOD\" || value === \"EVENT\" ? value : void 0;\n\t\t\tcontinue;\n\t\t}\n\t\tconst key = matchTag(trimmed, \"EXT-X-KEY\");\n\t\tif (key) {\n\t\t\tconst method = key.get(\"METHOD\");\n\t\t\tif (method !== void 0 && method !== \"NONE\") encrypted = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst serverControl = matchTag(trimmed, \"EXT-X-SERVER-CONTROL\");\n\t\tif (serverControl) {\n\t\t\tconst value = serverControl.get(\"HOLD-BACK\");\n\t\t\tif (value !== void 0) {\n\t\t\t\tconst parsed = Number.parseFloat(value);\n\t\t\t\tif (Number.isFinite(parsed) && parsed > 0) holdBack = parsed;\n\t\t\t}\n\t\t\tif (serverControl.get(\"PART-HOLD-BACK\") !== void 0) lowLatency = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (trimmed.startsWith(\"#EXT-X-PART-INF\") || trimmed.startsWith(\"#EXT-X-PART:\")) {\n\t\t\tlowLatency = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (trimmed === \"#EXTM3U\" || trimmed.startsWith(\"#EXT-X-VERSION:\") || trimmed.startsWith(\"#EXT-X-INDEPENDENT-SEGMENTS\")) continue;\n\t\tconst mapAttrs = matchTag(trimmed, \"EXT-X-MAP\");\n\t\tif (mapAttrs) {\n\t\t\tconst uri = mapAttrs.get(\"URI\");\n\t\t\tif (uri) {\n\t\t\t\tinitSegmentUrl = resolveUrl(uri, baseUrl);\n\t\t\t\tconst byteRangeStr = mapAttrs.get(\"BYTERANGE\");\n\t\t\t\tif (byteRangeStr) initSegmentByteRange = parseByteRange(byteRangeStr, 0) ?? void 0;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tif (trimmed.startsWith(\"#EXTINF:\")) {\n\t\t\tcurrentDuration = parseExtInfDuration(trimmed.slice(8));\n\t\t\tcontinue;\n\t\t}\n\t\tif (trimmed.startsWith(\"#EXT-X-BYTERANGE:\")) {\n\t\t\tcurrentByteRange = parseByteRange(trimmed.slice(17), previousByteRangeEnd) ?? void 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (trimmed === \"#EXT-X-ENDLIST\") {\n\t\t\tendList = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (!trimmed.startsWith(\"#\") && currentDuration > 0) {\n\t\t\tconst segment = {\n\t\t\t\tid: `segment-${mediaSequence + segmentIndex}`,\n\t\t\t\turl: resolveUrl(trimmed, baseUrl),\n\t\t\t\tduration: currentDuration,\n\t\t\t\tstartTime: currentTime\n\t\t\t};\n\t\t\tif (!isUndefined(currentStartDate)) {\n\t\t\t\tsegment.startDate = currentStartDate;\n\t\t\t\tcurrentStartDate += currentDuration;\n\t\t\t}\n\t\t\tif (currentByteRange) {\n\t\t\t\tsegment.byteRange = currentByteRange;\n\t\t\t\tpreviousByteRangeEnd = currentByteRange.end + 1;\n\t\t\t} else previousByteRangeEnd = void 0;\n\t\t\tsegments.push(segment);\n\t\t\tcurrentTime += currentDuration;\n\t\t\tsegmentIndex++;\n\t\t\tcurrentDuration = 0;\n\t\t\tcurrentByteRange = void 0;\n\t\t}\n\t}\n\tconst complete = endList || playlistType === \"VOD\";\n\tconst anchor = previous.startDate;\n\tconst hasPdt = segments.some((segment) => !isUndefined(segment.startDate));\n\tconst placed = !isUndefined(anchor) && hasPdt ? placeOnAnchor(segments, anchor) : isResolvedTrack(previous) ? placeOnPreviousTimeline(previous, segments, mediaSequence, targetDuration) : segments;\n\tconst lastPlaced = placed[placed.length - 1];\n\tconst placedEnd = lastPlaced ? lastPlaced.startTime + lastPlaced.duration : 0;\n\tconst trackDuration = complete ? placedEnd : Number.POSITIVE_INFINITY;\n\tconst anchorSegment = placed.find((segment) => !isUndefined(segment.startDate));\n\tconst startDate = anchorSegment && !isUndefined(anchorSegment.startDate) ? anchorSegment.startDate - anchorSegment.startTime : void 0;\n\tconst initialization = previous.type === \"text\" && !initSegmentUrl ? void 0 : initSegmentUrl ? {\n\t\turl: initSegmentUrl,\n\t\t...initSegmentByteRange ? { byteRange: initSegmentByteRange } : {}\n\t} : { url: \"\" };\n\tconst detectedContainer = initSegmentUrl ? void 0 : containerMimeFromSegment(placed[0]?.url);\n\tconst mimeType = previous.type !== \"text\" && detectedContainer ? detectedContainer : previous.mimeType;\n\treturn {\n\t\t...previous,\n\t\tmimeType,\n\t\tstartTime: 0,\n\t\tstartDate,\n\t\tduration: trackDuration,\n\t\tsegments: placed,\n\t\tinitialization,\n\t\tmetadata: {\n\t\t\t...previous.metadata,\n\t\t\t[MEDIA_PLAYLIST_METADATA_KEY]: {\n\t\t\t\ttargetDuration,\n\t\t\t\tmediaSequence,\n\t\t\t\tplaylistType,\n\t\t\t\tlowLatency,\n\t\t\t\tendList,\n\t\t\t\tholdBack,\n\t\t\t\tencrypted\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\nexport { MPEG_TS_MIME, NON_FMP4_CONTAINER_MIMES, RAW_AAC_MIME, parseMediaPlaylist };\n\n//# sourceMappingURL=parse-media-playlist.js.map","import { getMediaPlaylistMetadata } from \"../types/index.js\";\nimport { NON_FMP4_CONTAINER_MIMES } from \"../hls/parse-media-playlist.js\";\nimport { buildMimeCodec, isCodecSupported } from \"./mse/mediasource-setup.js\";\n//#region src/media/dom/capabilities.ts\n/**\n* Capability probing — the engine's foundation for asking the browser what it\n* can actually decode before committing a rendition to the pipeline.\n*\n* Today this is the synchronous codec half: `canPlayTrack` answers \"can this\n* environment play this track?\" by building the track's MIME codec string and\n* passing it to `MediaSource.isTypeSupported` (via `isCodecSupported`). It's the\n* DOM implementation of the DOM-free `CanPlayTrack` predicate the\n* track-switching hard-constraint pre-pass consumes — injected through engine\n* config so the (DOM-free) behavior never imports a DOM API directly.\n*\n* Results are memoized by built MIME string: codec support is a pure function\n* of (codec, environment) and never changes after load, so probing is lazy\n* (per candidate, at constraint-apply time) but each unique MIME is asked once.\n*\n* Future cluster-D phases (async `requestMediaKeySystemAccess` key-system\n* probing, `SourceBuffer.changeType()` availability) extend this surface; the\n* async ones land as a state-slot writer behavior rather than a config\n* predicate, since their verdict resolves asynchronously.\n*/\nconst codecSupportCache = /* @__PURE__ */ new Map();\n/**\n* Whether the environment can decode `track`, by codec. Builds the track's\n* MIME codec string and checks `MediaSource.isTypeSupported`, memoized by MIME.\n* A track without enough to probe — no `mimeType`, or no declared `codecs`\n* (CODECS is optional per the HLS spec) — is unprobeable and passes through as\n* playable (`true`) rather than being dropped; the late `createSourceBuffer`\n* check stays as the backstop for those.\n*\n* Detected non-fMP4 containers (`video/mp2t`, `audio/aac`) are asserted\n* unsupported regardless of the probe, so they're pruned before selection\n* (the type makes no pick) instead of failing/stalling deep in the pipeline.\n* Two different reasons, neither UA-based:\n*\n* - **MPEG-TS** can't be played at all here: `isTypeSupported('video/mp2t…')` is\n* a genuine false positive on Chromium (reports `true` but appends produce no\n* buffered range), and this engine has no TS transmux pipeline.\n* - **Raw ADTS AAC** is a *temporary* limitation. The browser genuinely\n* supports it (Chrome/Safari decode `audio/aac`; Firefox doesn't), so it could\n* be made playable — but our segment actors / loading behaviors / append\n* pipeline assume every rendition has an `EXT-X-MAP` init segment (e.g. an\n* `append-init` task with an empty URL, fMP4-shaped append handling). Until\n* that init-segment assumption is removed, ADTS would fetch but never buffer\n* (a silent stall), so we assert it unplayable for now. FOLLOW-UP: drop the\n* init-required assumption in the pipeline and switch this to a bare-MIME\n* probe (`buildMimeCodec` would project `audio/aac` with no codecs) so it\n* plays where the browser supports it.\n*\n* Override via the engine's `canPlayTrack` config when those pipelines land.\n*/\nconst canPlayTrack = (track) => {\n\tif (track.mimeType && NON_FMP4_CONTAINER_MIMES.has(track.mimeType)) return false;\n\tif (getMediaPlaylistMetadata(track)?.encrypted) return false;\n\tif (!track.mimeType || !track.codecs?.length) return true;\n\tconst mimeCodec = buildMimeCodec({\n\t\tmimeType: track.mimeType,\n\t\tcodecs: track.codecs\n\t});\n\tconst cached = codecSupportCache.get(mimeCodec);\n\tif (cached !== void 0) return cached;\n\tconst supported = isCodecSupported(mimeCodec);\n\tcodecSupportCache.set(mimeCodec, supported);\n\treturn supported;\n};\n//#endregion\nexport { canPlayTrack };\n\n//# sourceMappingURL=capabilities.js.map","import { matchTag, parseCodecs } from \"./parse-attributes.js\";\nimport { resolveUrl } from \"./resolve-url.js\";\nimport { generateId } from \"@videojs/utils/string\";\n//#region src/media/hls/parse-multivariant.ts\n/**\n* Parse HLS multivariant playlist into a Presentation.\n*\n* Returns Presentation with partially resolved tracks (no segment information).\n* Tracks contain metadata from multivariant playlist (bandwidth, resolution, codecs)\n* but segment information is added when media playlists are fetched.\n*\n* @param text - Raw playlist text content\n* @param unresolved - Unresolved presentation (contains URL for base URL resolution)\n* @returns Presentation with partially resolved tracks (duration is undefined)\n*/\nfunction parseMultivariantPlaylist(text, unresolved) {\n\tconst baseUrl = unresolved.url;\n\tconst lines = text.split(/\\r?\\n/);\n\tconst streams = [];\n\tconst audioRenditions = [];\n\tconst subtitleRenditions = [];\n\tlet pendingStreamInfo = null;\n\tfor (const line of lines) {\n\t\tconst trimmed = line.trim();\n\t\tif (!trimmed || trimmed.startsWith(\"#\") && !trimmed.startsWith(\"#EXT\")) continue;\n\t\tif (trimmed === \"#EXTM3U\" || trimmed.startsWith(\"#EXT-X-VERSION:\") || trimmed.startsWith(\"#EXT-X-INDEPENDENT-SEGMENTS\")) continue;\n\t\tconst mediaAttrs = matchTag(trimmed, \"EXT-X-MEDIA\");\n\t\tif (mediaAttrs) {\n\t\t\tconst type = mediaAttrs.get(\"TYPE\");\n\t\t\tconst groupId = mediaAttrs.get(\"GROUP-ID\");\n\t\t\tconst name = mediaAttrs.get(\"NAME\");\n\t\t\tif (type === \"AUDIO\" && groupId && name) {\n\t\t\t\tconst uri = mediaAttrs.get(\"URI\");\n\t\t\t\taudioRenditions.push({\n\t\t\t\t\tgroupId,\n\t\t\t\t\tname,\n\t\t\t\t\tlanguage: mediaAttrs.get(\"LANGUAGE\"),\n\t\t\t\t\turi: uri ? resolveUrl(uri, baseUrl) : void 0,\n\t\t\t\t\tdefault: mediaAttrs.getBool(\"DEFAULT\"),\n\t\t\t\t\tautoselect: mediaAttrs.getBool(\"AUTOSELECT\"),\n\t\t\t\t\tchannels: mediaAttrs.getInt(\"CHANNELS\")\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (type === \"SUBTITLES\" && groupId && name) {\n\t\t\t\tconst uri = mediaAttrs.get(\"URI\");\n\t\t\t\tif (uri) subtitleRenditions.push({\n\t\t\t\t\tgroupId,\n\t\t\t\t\tname,\n\t\t\t\t\tlanguage: mediaAttrs.get(\"LANGUAGE\"),\n\t\t\t\t\turi: resolveUrl(uri, baseUrl),\n\t\t\t\t\tdefault: mediaAttrs.getBool(\"DEFAULT\"),\n\t\t\t\t\tautoselect: mediaAttrs.getBool(\"AUTOSELECT\"),\n\t\t\t\t\tforced: mediaAttrs.getBool(\"FORCED\")\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tconst streamInfAttrs = matchTag(trimmed, \"EXT-X-STREAM-INF\");\n\t\tif (streamInfAttrs) {\n\t\t\tpendingStreamInfo = {\n\t\t\t\tbandwidth: streamInfAttrs.getInt(\"BANDWIDTH\", 0),\n\t\t\t\tresolution: streamInfAttrs.getResolution(\"RESOLUTION\"),\n\t\t\t\tcodecs: streamInfAttrs.get(\"CODECS\"),\n\t\t\t\tframeRate: streamInfAttrs.getFrameRate(\"FRAME-RATE\"),\n\t\t\t\taudioGroupId: streamInfAttrs.get(\"AUDIO\")\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tif (!trimmed.startsWith(\"#\") && pendingStreamInfo) {\n\t\t\tstreams.push({\n\t\t\t\t...pendingStreamInfo,\n\t\t\t\turi: resolveUrl(trimmed, baseUrl)\n\t\t\t});\n\t\t\tpendingStreamInfo = null;\n\t\t}\n\t}\n\tconst videoStreams = [];\n\tconst audioOnlyStreams = [];\n\tfor (const stream of streams) {\n\t\tif (!stream.codecs) {\n\t\t\tvideoStreams.push(stream);\n\t\t\tcontinue;\n\t\t}\n\t\tconst parsedCodecs = parseCodecs(stream.codecs);\n\t\tif (stream.codecs.split(\",\").length === 1) if (parsedCodecs.audio && !parsedCodecs.video) audioOnlyStreams.push(stream);\n\t\telse videoStreams.push(stream);\n\t\telse videoStreams.push(stream);\n\t}\n\tconst videoTracksByUrl = /* @__PURE__ */ new Map();\n\tfor (const stream of videoStreams) {\n\t\tconst existing = videoTracksByUrl.get(stream.uri);\n\t\tif (existing) {\n\t\t\tif (stream.audioGroupId && !existing.audioGroupIds?.includes(stream.audioGroupId)) existing.audioGroupIds = [...existing.audioGroupIds ?? [], stream.audioGroupId];\n\t\t\tif (stream.bandwidth < existing.bandwidth) existing.bandwidth = stream.bandwidth;\n\t\t\tcontinue;\n\t\t}\n\t\tconst codecs = stream.codecs ? parseCodecs(stream.codecs) : void 0;\n\t\tconst track = {\n\t\t\ttype: \"video\",\n\t\t\tid: generateId(),\n\t\t\turl: stream.uri,\n\t\t\tbandwidth: stream.bandwidth,\n\t\t\tmimeType: \"video/mp4\",\n\t\t\tcodecs: []\n\t\t};\n\t\tif (stream.resolution?.width !== void 0) track.width = stream.resolution.width;\n\t\tif (stream.resolution?.height !== void 0) track.height = stream.resolution.height;\n\t\tif (codecs?.video) track.codecs = codecs.audio && !stream.audioGroupId ? [codecs.video, codecs.audio] : [codecs.video];\n\t\tif (stream.frameRate) track.frameRate = stream.frameRate;\n\t\tif (stream.audioGroupId) track.audioGroupIds = [stream.audioGroupId];\n\t\tvideoTracksByUrl.set(stream.uri, track);\n\t}\n\tconst videoTracks = [...videoTracksByUrl.values()];\n\tconst audioOnlyTracks = audioOnlyStreams.map((stream) => {\n\t\tconst codecs = stream.codecs ? parseCodecs(stream.codecs) : void 0;\n\t\treturn {\n\t\t\ttype: \"audio\",\n\t\t\tid: generateId(),\n\t\t\turl: stream.uri,\n\t\t\tbandwidth: stream.bandwidth,\n\t\t\tmimeType: \"audio/mp4\",\n\t\t\tcodecs: codecs?.audio ? [codecs.audio] : [],\n\t\t\tgroupId: stream.audioGroupId || \"default\",\n\t\t\tname: \"Default\",\n\t\t\tsampleRate: 48e3,\n\t\t\tchannels: 2\n\t\t};\n\t});\n\tconst audioTracks = [...audioRenditions.flatMap((rendition) => {\n\t\tlet audioCodecs;\n\t\tfor (const stream of streams) if (stream.audioGroupId === rendition.groupId && stream.codecs) {\n\t\t\tconst codecs = parseCodecs(stream.codecs);\n\t\t\tif (codecs.audio) {\n\t\t\t\taudioCodecs = [codecs.audio];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!rendition.uri) {\n\t\t\tconst carrier = audioOnlyTracks.find((track) => track.groupId === rendition.groupId);\n\t\t\tif (carrier) {\n\t\t\t\tcarrier.name = rendition.name;\n\t\t\t\tif (rendition.language) carrier.language = rendition.language;\n\t\t\t\tif (rendition.channels) carrier.channels = rendition.channels;\n\t\t\t\tif (rendition.default) carrier.default = rendition.default;\n\t\t\t\tif (rendition.autoselect) carrier.autoselect = rendition.autoselect;\n\t\t\t\treturn [];\n\t\t\t}\n\t\t}\n\t\tconst track = {\n\t\t\ttype: \"audio\",\n\t\t\tid: generateId(),\n\t\t\turl: rendition.uri ?? \"\",\n\t\t\tgroupId: rendition.groupId,\n\t\t\tname: rendition.name,\n\t\t\tmimeType: \"audio/mp4\",\n\t\t\tbandwidth: 0,\n\t\t\tsampleRate: 48e3,\n\t\t\tchannels: rendition.channels ?? 2,\n\t\t\tcodecs: []\n\t\t};\n\t\tif (rendition.language) track.language = rendition.language;\n\t\tif (audioCodecs) track.codecs = audioCodecs;\n\t\tif (rendition.default) track.default = rendition.default;\n\t\tif (rendition.autoselect) track.autoselect = rendition.autoselect;\n\t\treturn [track];\n\t}), ...audioOnlyTracks];\n\tconst textTracks = subtitleRenditions.map((rendition) => {\n\t\tconst track = {\n\t\t\ttype: \"text\",\n\t\t\tid: generateId(),\n\t\t\turl: rendition.uri,\n\t\t\tgroupId: rendition.groupId,\n\t\t\tlabel: rendition.name,\n\t\t\tkind: \"subtitles\",\n\t\t\tmimeType: \"text/vtt\",\n\t\t\tbandwidth: 0\n\t\t};\n\t\tif (rendition.language) track.language = rendition.language;\n\t\tif (rendition.default && rendition.autoselect) track.default = true;\n\t\tif (rendition.autoselect) track.autoselect = rendition.autoselect;\n\t\tif (rendition.forced) track.forced = rendition.forced;\n\t\treturn track;\n\t});\n\tconst selectionSets = [];\n\tif (videoTracks.length > 0) {\n\t\tconst videoSwitchingSet = {\n\t\t\tid: generateId(),\n\t\t\ttype: \"video\",\n\t\t\ttracks: videoTracks\n\t\t};\n\t\tconst videoSelectionSet = {\n\t\t\tid: generateId(),\n\t\t\ttype: \"video\",\n\t\t\tswitchingSets: [videoSwitchingSet]\n\t\t};\n\t\tselectionSets.push(videoSelectionSet);\n\t}\n\tif (audioTracks.length > 0) {\n\t\tconst audioSwitchingSet = {\n\t\t\tid: generateId(),\n\t\t\ttype: \"audio\",\n\t\t\ttracks: audioTracks\n\t\t};\n\t\tconst audioSelectionSet = {\n\t\t\tid: generateId(),\n\t\t\ttype: \"audio\",\n\t\t\tswitchingSets: [audioSwitchingSet]\n\t\t};\n\t\tselectionSets.push(audioSelectionSet);\n\t}\n\tif (textTracks.length > 0) {\n\t\tconst textSwitchingSet = {\n\t\t\tid: generateId(),\n\t\t\ttype: \"text\",\n\t\t\ttracks: textTracks\n\t\t};\n\t\tconst textSelectionSet = {\n\t\t\tid: generateId(),\n\t\t\ttype: \"text\",\n\t\t\tswitchingSets: [textSwitchingSet]\n\t\t};\n\t\tselectionSets.push(textSelectionSet);\n\t}\n\treturn {\n\t\tid: generateId(),\n\t\turl: unresolved.url,\n\t\tstartTime: 0,\n\t\tselectionSets\n\t};\n}\n//#endregion\nexport { parseMultivariantPlaylist };\n\n//# sourceMappingURL=parse-multivariant.js.map","import { isResolvedTrack } from \"../types/index.js\";\n//#region src/media/utils/track-selection.ts\n/**\n* Map track type to selected track ID property key in state.\n*/\nconst SelectedTrackIdKeyByType = {\n\tvideo: \"selectedVideoTrackId\",\n\taudio: \"selectedAudioTrackId\",\n\ttext: \"selectedTextTrackId\"\n};\n/**\n* Get selected track from state by type.\n* Returns properly typed track (partially or fully resolved) or undefined.\n* Type parameter T is inferred from the type argument.\n*\n* @example\n* const videoTrack = getSelectedTrack(state, 'video');\n* if (videoTrack && isResolvedTrack(videoTrack)) {\n* // videoTrack is VideoTrack\n* }\n*/\nfunction getSelectedTrack(state, type) {\n\tconst { presentation } = state;\n\tif (!presentation?.selectionSets) return void 0;\n\tconst trackId = state[SelectedTrackIdKeyByType[type]];\n\treturn presentation.selectionSets.find(({ type: selectionSetType }) => selectionSetType === type)?.switchingSets[0]?.tracks.find(({ id }) => id === trackId);\n}\n/**\n* Returns the duration of the first resolved selected track, preferring\n* video over audio. A track is \"resolved\" once its media playlist has been\n* parsed (per {@link isResolvedTrack}). Returns `undefined` if neither\n* selected track is resolved.\n*/\nfunction getResolvedSelectedTrackDuration(state) {\n\tif (state.selectedVideoTrackId) {\n\t\tconst video = getSelectedTrack(state, \"video\");\n\t\tif (video && isResolvedTrack(video)) return video.duration;\n\t}\n\tif (state.selectedAudioTrackId) {\n\t\tconst audio = getSelectedTrack(state, \"audio\");\n\t\tif (audio && isResolvedTrack(audio)) return audio.duration;\n\t}\n}\n//#endregion\nexport { SelectedTrackIdKeyByType, getResolvedSelectedTrackDuration, getSelectedTrack };\n\n//# sourceMappingURL=track-selection.js.map","import { untrack, update } from \"../../core/signals/primitives.js\";\nimport { effect } from \"../../core/signals/effect.js\";\n//#region src/playback/behaviors/calculate-presentation-duration.ts\nfunction calculatePresentationDurationSetup({ state, config }) {\n\treturn effect(() => {\n\t\tconst presentation = state.presentation.get();\n\t\tif (!presentation || presentation.duration !== void 0) return;\n\t\tconst resolverInput = untrack(() => ({\n\t\t\tpresentation,\n\t\t\tselectedVideoTrackId: state.selectedVideoTrackId?.get(),\n\t\t\tselectedAudioTrackId: state.selectedAudioTrackId?.get()\n\t\t}));\n\t\tconst duration = config.resolveDuration(resolverInput);\n\t\tif (duration === void 0 || Number.isNaN(duration) || duration <= 0) return;\n\t\tupdate(state.presentation, { duration });\n\t});\n}\n/**\n* `calculatePresentationDuration` uses a manual `Behavior<>` literal\n* (rather than `defineBehavior`) so it can declare just `presentation`\n* in its stateKeys while the typed setup-param shape includes the\n* optional `selectedVideoTrackId` / `selectedAudioTrackId` reads used\n* at runtime. Mirrors the pattern in `endOfStream` for the same\n* reason: the behavior is uniform-across-tracks and reads slots\n* contributed by other behaviors, so it shouldn't leak those slot\n* declarations into variants that don't compose the contributors.\n*/\nconst calculatePresentationDuration = {\n\tstateKeys: [\"presentation\"],\n\tcontextKeys: [],\n\tsetup: calculatePresentationDurationSetup\n};\n//#endregion\nexport { calculatePresentationDuration };\n\n//# sourceMappingURL=calculate-presentation-duration.js.map","import { computed, peek, update } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../media/types/index.js\";\n//#region src/playback/behaviors/collect-errors.ts\n/**\n* **Owns the engine's error sequence.** Reporters append through\n* {@link emitError}; this behavior owns the slot and its per-source lifecycle,\n* clearing it on exit so a new source starts clean and the sequence can't grow\n* unbounded across a session.\n*\n* Same split as `setupFailoverMonitor` and `failedCdns`: writes come from\n* wherever the condition is detected, one behavior owns the slot. Deliberately\n* has no `effects` — it holds no policy and derives nothing. Severity is decided\n* at the adapter, not here (see `internal/design/spf/features/errors.md`), which\n* is why this is a lifecycle owner rather than an error *handler*.\n*\n* Clearing binds to *exit* of `presentation-resolved`, mirroring the sibling\n* mixins' clear-on-teardown (`emptied` / `MEDIA_DETACHED`). A live reload swaps\n* the presentation object without leaving the resolved state, so it doesn't\n* clear — only an actual source change or destroy does. Known gap: a\n* resolved→resolved source swap that never passes through unresolved carries the\n* prior source's errors forward; `resolve-track` guards the same transition with\n* a commit-time id check, and doing likewise here is a follow-up.\n*\n* The vocabulary itself ({@link SvtaError} and the codes) is DOM- and\n* signal-free in `media/errors`; only the write seam lives here, with the slot\n* it writes.\n*/\n/**\n* Append `error` to the engine's error sequence. No-op when no owner is\n* composed. Replaces the array rather than mutating it, so signal consumers\n* notify; duplicates are kept, since a repeated condition is a real observation.\n* Writes go through `update` so concurrent reporters can't lose each other's\n* appends.\n*\n* Every emission is logged, deliberately *before* the owner check. A condition\n* emitted with no `collectErrors` composed is dropped on the floor — that's the\n* case where a log is the only evidence it happened at all, so gating the log on\n* the same check would hide exactly what's worth seeing. Emissions that *are*\n* collected still get logged, because reaching `state.errors` is no guarantee of\n* reaching a person: only *verdicts* are promoted to the media surface, so every\n* cause (and any non-fatal notice) is otherwise invisible outside a debugger.\n*\n* Ungated rather than `__DEV__`-only, matching the other reporting paths in this\n* package (`resolve-presentation`, `track-switching`, the segment actors).\n*/\nfunction emitError(state, error) {\n\tconsole.error(\"[spf] reported condition\", error);\n\tif (!state.errors) return;\n\tupdate(state.errors, (errors) => [...errors ?? [], error]);\n}\n/**\n* A \"constraint\" that reports a type the source carries **no** renditions of, for\n* a composition that can't play without it.\n*\n* Strange on purpose, and the strangeness is the point: it never constrains\n* anything, always returning its input untouched. It is shaped as a rule so a\n* composition opts in by adding it to `constraints` — nothing to thread through\n* config, and no cost at all to a composition that leaves it out.\n*\n* **Belongs first in the chain.** A constraint sees the list as it stands at its\n* own position, so only at the head does an empty input mean \"the source offers\n* none of this type\" rather than \"the constraints ahead of me pruned them all.\"\n*\n* This is the one failure no per-rendition cause can report: causes come from\n* `reportUnsupportedTrackConditions` as each media playlist resolves, and here\n* nothing resolves, because there is nothing to resolve. Everything else already\n* reports something more specific than a verdict.\n*\n* Idempotent because the constraint chain runs inside a `computed` that re-derives\n* on every `presentation` write — segment appends and live reloads included — and\n* the sequence deliberately keeps duplicates. `peek` is what keeps that computed\n* from subscribing to the slot this writes.\n*\n* @example\n* // engine-background-video.ts — video-only, so a source with none can't play\n* constraints: [reportAbsentTrackType(SVTA_NO_SUPPORTED_VIDEO_TRACK), excludeUnplayableTracks]\n*/\nfunction reportAbsentTrackType(code) {\n\treturn (tracks, { state }) => {\n\t\tconst reported = state.errors && peek(state.errors);\n\t\tif (!tracks.length && !reported?.some((error) => error.code === code)) emitError(state, { code });\n\t\treturn tracks;\n\t};\n}\n/**\n* Own `errors` for the resolved source's lifetime.\n*\n* @example\n* const reactor = collectErrors.setup({ state });\n*/\nconst collectErrors = defineBehavior({\n\tstateKeys: [\"presentation\", \"errors\"],\n\tcontextKeys: [],\n\tsetup: ({ state }) => {\n\t\tconst derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? \"presentation-resolved\" : \"presentation-unresolved\");\n\t\treturn createMachineReactor({\n\t\t\tinitial: \"presentation-unresolved\",\n\t\t\tmonitor: () => derivedStateSignal.get(),\n\t\t\tstates: {\n\t\t\t\t\"presentation-unresolved\": {},\n\t\t\t\t\"presentation-resolved\": { entry: () => () => state.errors.set(void 0) }\n\t\t\t}\n\t\t});\n\t}\n});\n//#endregion\nexport { collectErrors, emitError, reportAbsentTrackType };\n\n//# sourceMappingURL=collect-errors.js.map","//#region src/media/utils/cdn.ts\n/**\n* Default {@link GetCdnId}: the URL's origin (scheme + host + port); falls back\n* to the raw string when the URL can't be parsed, so the return value is always\n* a stable grouping key.\n*/\nfunction getCdnId(url) {\n\ttry {\n\t\treturn new URL(url).origin;\n\t} catch {\n\t\treturn url;\n\t}\n}\nconst CDN_TYPE_PRIORITY = {\n\tvideo: 0,\n\taudio: 1,\n\ttext: 2\n};\n/**\n* The distinct CDNs a presentation's tracks are served from, ordered video CDNs\n* first, then audio, then text (manifest order within a type). The head is the\n* primary CDN — the one a sticky pick defaults to — and is always video-derived\n* when the source has video. Returns `[]` for an unresolved presentation with\n* no tracks.\n*\n* Redundant-stream sources list the same content on multiple hosts (e.g. Mux's\n* `?redundant_streams=true`), so each host contributes its own candidate tracks;\n* this collapses them to the set of CDNs across every track type. The CDN-id\n* derivation defaults to {@link getCdnId}; pass a consumer-configured `getId` to\n* key on something other than origin.\n*/\nfunction getOrderedCdnIds(presentation, getId = getCdnId) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst ids = [];\n\tconst selectionSets = [...presentation.selectionSets ?? []].sort((a, b) => CDN_TYPE_PRIORITY[a.type] - CDN_TYPE_PRIORITY[b.type]);\n\tfor (const selectionSet of selectionSets) for (const switchingSet of selectionSet.switchingSets) for (const track of switchingSet.tracks) {\n\t\tconst id = getId(track.url);\n\t\tif (seen.has(id)) continue;\n\t\tseen.add(id);\n\t\tids.push(id);\n\t}\n\treturn ids;\n}\n/**\n* Add a CDN id to a failed-CDN list, preserving order and ignoring duplicates.\n* Idempotent: re-adding an already-present id returns the same array reference\n* (so a no-op trip doesn't churn the `failedCdns` signal). The failover trip in\n* `resolve-track` and the segment loaders feed this into `failedCdns` via `update`.\n*/\nfunction addFailedCdn(failed, cdn) {\n\treturn failed?.includes(cdn) ? failed : [...failed ?? [], cdn];\n}\n//#endregion\nexport { addFailedCdn, getCdnId, getOrderedCdnIds };\n\n//# sourceMappingURL=cdn.js.map","import { hasPresentationDuration } from \"../../types/index.js\";\n//#region src/media/dom/mse/duration.ts\n/**\n* Check if we have the basics to update MediaSource duration:\n* a `mediaSource` and a `presentation` with a numeric duration.\n*/\nfunction canUpdateDuration(presentation, mediaSource) {\n\treturn !!(mediaSource && presentation && hasPresentationDuration(presentation));\n}\nfunction getBufferedEnd(buffers, isEndMatch) {\n\treturn [...buffers].reduce((endMatch, buffer) => {\n\t\tconst { buffered } = buffer;\n\t\tif (!buffered.length) return endMatch;\n\t\tconst end = buffered.end(buffered.length - 1);\n\t\tif (!endMatch) return end;\n\t\treturn isEndMatch(end, endMatch) ? end : endMatch;\n\t}, void 0) ?? 0;\n}\nconst isGreaterThan = (x, y) => x > y;\nconst isLessThan = (x, y) => x < y;\n/**\n* Get the maximum buffered end time across an iterable of SourceBuffers\n* (typically `mediaSource.sourceBuffers`). Returns `0` when the collection is\n* empty or no buffer has any buffered ranges.\n*/\nfunction getMaxBufferedEnd(buffers) {\n\treturn getBufferedEnd(buffers, isGreaterThan);\n}\n/**\n* Get the reachable buffered end across an iterable of SourceBuffers (typically\n* `mediaSource.sourceBuffers`): the `min` of each buffer's last buffered-range end\n* — the furthest point every track can play to (the intersection end). Buffers with\n* no buffered ranges are skipped. Returns `0` when the collection is empty or no\n* buffer has any buffered ranges.\n*\n* Counterpart to {@link getMaxBufferedEnd}: `max` bounds the overall presentation\n* end (e.g. for setting `duration`), `min` bounds where playback can actually reach\n* when tracks end at slightly different times (e.g. skewed A/V near end-of-stream).\n*/\nfunction getMinBufferedEnd(buffers) {\n\treturn getBufferedEnd(buffers, isLessThan);\n}\n/**\n* Check if the preconditions are met to *attempt* a `mediaSource.duration`\n* write: a `mediaSource` is in scope and the presentation has a valid\n* positive duration (or `Infinity` for live).\n*\n* Does **not** check `mediaSource.readyState` or `mediaSource.duration` —\n* those are DOM properties the caller resolves at write time (e.g., by\n* `await`ing `waitForMediaSourceOpen` and re-checking `readyState` after,\n* and guarding on the existing `mediaSource.duration` for idempotency).\n* Keeping these off the signal-driven predicate lets callers use this\n* inside reactor state derivation without smuggling non-reactive DOM\n* reads into `computed(...)`.\n*\n* `Infinity` is allowed — per the MSE spec, `mediaSource.duration = +Infinity`\n* is how live playback signals an indefinite duration.\n*/\nfunction shouldUpdateDuration(presentation, mediaSource) {\n\tif (!canUpdateDuration(presentation, mediaSource)) return false;\n\tconst duration = presentation.duration;\n\tif (Number.isNaN(duration) || duration <= 0) return false;\n\treturn true;\n}\n/**\n* Wait for all currently-updating SourceBuffers in `buffers` to finish, or\n* until `signal` aborts — whichever fires first.\n*\n* The MSE spec forbids setting `MediaSource.duration` while any attached\n* SourceBuffer has `updating === true`. This defers until all are idle.\n* Listeners are registered with `{ signal }` so an abort tears them down\n* up-front rather than leaving them dangling until the next `updateend`.\n*/\nfunction waitForSourceBuffersReady(buffers, signal) {\n\tif (signal.aborted) return Promise.resolve();\n\tconst updating = [];\n\tfor (const buf of buffers) if (buf.updating) updating.push(buf);\n\tif (updating.length === 0) return Promise.resolve();\n\treturn new Promise((resolve) => {\n\t\tlet remaining = updating.length;\n\t\tconst onUpdateEnd = () => {\n\t\t\tremaining--;\n\t\t\tif (remaining === 0) resolve();\n\t\t};\n\t\tfor (const buf of updating) buf.addEventListener(\"updateend\", onUpdateEnd, {\n\t\t\tonce: true,\n\t\t\tsignal\n\t\t});\n\t\tsignal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t});\n}\n//#endregion\nexport { canUpdateDuration, getBufferedEnd, getMaxBufferedEnd, getMinBufferedEnd, shouldUpdateDuration, waitForSourceBuffersReady };\n\n//# sourceMappingURL=duration.js.map","//#region src/media/dom/mse/end-of-stream.ts\n/**\n* Check if the temporally last segment of `expectedSegments` is present in\n* `appendedSegments` and not marked partial.\n*\n* Compares by segment ID rather than by a pipeline flag, so the result\n* stays correct across quality switches (different tracks have different\n* segment IDs) and back-buffer flushes (flushed segment IDs are removed\n* from the appended list).\n*/\nfunction isLastSegmentAppended(expectedSegments, appendedSegments) {\n\tif (expectedSegments.length === 0) return true;\n\tconst lastSeg = expectedSegments[expectedSegments.length - 1];\n\tif (!lastSeg) return false;\n\treturn appendedSegments?.some((s) => s.id === lastSeg.id && !s.partial) ?? false;\n}\n//#endregion\nexport { isLastSegmentAppended };\n\n//# sourceMappingURL=end-of-stream.js.map","import { computed, signal } from \"../../../core/signals/primitives.js\";\nimport { effect } from \"../../../core/signals/effect.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedTrack } from \"../../../media/types/index.js\";\nimport { findTrackById } from \"../../../media/utils/tracks.js\";\nimport { onMediaSourceReadyStateChange } from \"../../../media/dom/mse/mediasource-setup.js\";\nimport { getMaxBufferedEnd, waitForSourceBuffersReady } from \"../../../media/dom/mse/duration.js\";\nimport { isLastSegmentAppended } from \"../../../media/dom/mse/end-of-stream.js\";\n//#region src/playback/behaviors/dom/end-of-stream.ts\n/**\n* Slack (seconds) on the \"playhead has reached the last segment\" gate. A tiny final\n* segment (e.g. Apple's ~44ms last segment) starts right at the buffered end, and the\n* browser freezes the playhead ~50–70ms short of that end (its render horizon), so a\n* strict `currentTime >= lastSegStart` would never open — deadlocking `endOfStream`\n* (the MediaSource stays `'open'`, so the browser keeps the playhead frozen waiting for\n* data/EOS that never comes). This slack lets a playhead stalled just short of the final\n* segment still finalize. Firing slightly early is harmless: the last segment is already\n* appended (the gate above), so no more data is expected.\n*/\nconst LAST_SEGMENT_REACHED_SLACK = .5;\nfunction deriveState(presentation, mediaSource, msIsOpen, videoBufferActor, audioBufferActor, currentTime) {\n\tif (!mediaSource || !presentation || !msIsOpen) return \"preconditions-unmet\";\n\tconst actors = [videoBufferActor, audioBufferActor].filter((a) => a !== void 0);\n\tif (actors.length === 0) return \"preconditions-unmet\";\n\tlet lastSegStart;\n\tfor (const actor of actors) {\n\t\tconst snapshot = actor.snapshot.get();\n\t\tif (snapshot.value !== \"idle\") return \"preconditions-unmet\";\n\t\tconst { initTrackId, segments: appended } = snapshot.context;\n\t\tif (!initTrackId) return \"preconditions-unmet\";\n\t\tconst track = findTrackById(presentation, initTrackId);\n\t\tif (!track || !isResolvedTrack(track)) return \"preconditions-unmet\";\n\t\tif (!Number.isFinite(track.duration)) return \"preconditions-unmet\";\n\t\tif (!isLastSegmentAppended(track.segments, appended)) return \"preconditions-unmet\";\n\t\tif (track.segments.length > 0) {\n\t\t\tconst start = track.segments[track.segments.length - 1].startTime;\n\t\t\tif (lastSegStart === void 0 || start > lastSegStart) lastSegStart = start;\n\t\t}\n\t}\n\tif (lastSegStart !== void 0 && (currentTime ?? 0) < lastSegStart - LAST_SEGMENT_REACHED_SLACK) return \"preconditions-unmet\";\n\treturn \"eos-ready\";\n}\nfunction endOfStreamSetup({ state, context }) {\n\tconst msIsOpen = signal(false);\n\tconst cleanupMsListener = effect(() => {\n\t\tconst mediaSource = context.mediaSource.get();\n\t\tif (!mediaSource) {\n\t\t\tmsIsOpen.set(false);\n\t\t\treturn;\n\t\t}\n\t\tmsIsOpen.set(mediaSource.readyState === \"open\");\n\t\tconst controller = new AbortController();\n\t\tonMediaSourceReadyStateChange(mediaSource, controller.signal, (rs) => {\n\t\t\tmsIsOpen.set(rs === \"open\");\n\t\t});\n\t\treturn () => controller.abort();\n\t});\n\tconst derivedStateSignal = computed(() => deriveState(state.presentation.get(), context.mediaSource.get(), msIsOpen.get(), context.videoBufferActor?.get(), context.audioBufferActor?.get(), state.currentTime.get()));\n\tconst reactor = createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\t\"eos-ready\": { entry: () => {\n\t\t\t\tconst mediaSource = context.mediaSource.get();\n\t\t\t\tconst controller = new AbortController();\n\t\t\t\tconst endStreamWhenReady = async () => {\n\t\t\t\t\tawait waitForSourceBuffersReady(mediaSource.sourceBuffers, controller.signal);\n\t\t\t\t\tif (controller.signal.aborted) return;\n\t\t\t\t\tconst bufferedEnd = getMaxBufferedEnd(mediaSource.sourceBuffers);\n\t\t\t\t\tif (bufferedEnd > 0) mediaSource.duration = bufferedEnd;\n\t\t\t\t\tmediaSource.endOfStream();\n\t\t\t\t};\n\t\t\t\tendStreamWhenReady().catch((err) => console.error(\"Failed to call endOfStream:\", err));\n\t\t\t\treturn () => controller.abort();\n\t\t\t} }\n\t\t}\n\t});\n\treturn () => {\n\t\tcleanupMsListener();\n\t\treactor.destroy();\n\t};\n}\n/**\n* `endOfStream` uses a manual `Behavior<>` literal (rather than\n* `defineBehavior`) because it reads `videoBufferActor` /\n* `audioBufferActor` defensively without declaring them in its\n* contextKeys — those slots are contributed by other behaviors and\n* compose conditionally per engine variant. The `Behavior<>` literal\n* opts out of the exhaustiveness check so the typed context shape can\n* include the optional fields used at runtime. See the comment on\n* `endOfStreamSetup`'s context param for the discipline.\n*/\nconst endOfStream = {\n\tstateKeys: [\"presentation\", \"currentTime\"],\n\tcontextKeys: [\"mediaSource\"],\n\tsetup: endOfStreamSetup\n};\n//#endregion\nexport { endOfStream };\n\n//# sourceMappingURL=end-of-stream.js.map","//#region src/network/ewma.ts\n/**\n* Exponentially Weighted Moving Average (EWMA)\n*\n* Pure functional implementation of EWMA calculations.\n* Based on Shaka Player's EWMA algorithm.\n*/\n/**\n* Calculate alpha (decay factor) from half-life.\n*\n* Alpha determines how quickly old data \"expires\":\n* - alpha close to 1 = slow decay (long memory)\n* - alpha close to 0 = fast decay (short memory)\n*\n* @param halfLife - The quantity of prior samples (by weight) that make up\n* half of the new estimate. Must be positive.\n* @returns Alpha value between 0 and 1\n*\n* @example\n* const alpha = calculateAlpha(2); // ≈ 0.7071 for 2-second half-life\n*/\nfunction calculateAlpha(halfLife) {\n\treturn Math.exp(Math.log(.5) / halfLife);\n}\n/**\n* Calculate exponentially weighted moving average.\n*\n* Updates an estimate by blending a new value with the previous estimate,\n* weighted by the sample duration. Longer samples have more influence.\n*\n* @param prevEstimate - Previous EWMA estimate\n* @param value - New sample value to incorporate\n* @param weight - Sample weight (typically duration in seconds)\n* @param halfLife - Half-life for decay (typically 2-5 seconds)\n* @returns Updated EWMA estimate\n*\n* @example\n* let estimate = 0;\n* estimate = calculateEwma(estimate, 1_000_000, 1, 2); // First sample\n* estimate = calculateEwma(estimate, 2_000_000, 1, 2); // Second sample\n*/\nfunction calculateEwma(prevEstimate, value, weight, halfLife) {\n\tconst adjAlpha = calculateAlpha(halfLife) ** weight;\n\treturn value * (1 - adjAlpha) + adjAlpha * prevEstimate;\n}\n/**\n* Apply zero-factor correction to EWMA estimate.\n*\n* The zero-factor correction compensates for bias when starting from zero.\n* Without this correction, early estimates would be artificially low.\n*\n* As totalWeight increases, the correction factor approaches 1, meaning\n* the estimate becomes more reliable and needs less correction.\n*\n* @param estimate - Raw EWMA estimate (uncorrected)\n* @param totalWeight - Accumulated weight from all samples\n* @param halfLife - Half-life used in EWMA calculation\n* @returns Corrected estimate, or 0 if totalWeight is 0\n*\n* @example\n* const raw = calculateEwma(0, 1_000_000, 1, 2);\n* const corrected = applyZeroFactor(raw, 1, 2); // ≈ 1_000_000\n*/\nfunction applyZeroFactor(estimate, totalWeight, halfLife) {\n\tif (totalWeight === 0) return 0;\n\treturn estimate / (1 - calculateAlpha(halfLife) ** totalWeight);\n}\n//#endregion\nexport { applyZeroFactor, calculateAlpha, calculateEwma };\n\n//# sourceMappingURL=ewma.js.map","import { applyZeroFactor, calculateEwma } from \"./ewma.js\";\n//#region src/network/bandwidth-estimator.ts\n/**\n* Dual EWMA Bandwidth Estimator\n*\n* Estimates available bandwidth using two EWMA calculations with different\n* half-lives, taking the minimum of both. This approach (from Shaka Player):\n*\n* - **Fast EWMA** (2s half-life): Reacts quickly to bandwidth drops\n* - **Slow EWMA** (5s half-life): Provides stability during fluctuations\n* - **min(fast, slow)**: Adapts down quickly, up slowly\n*\n* This naturally provides asymmetric behavior needed for good QoE:\n* avoiding stalls (quick downgrade) while preventing oscillation (slow upgrade).\n*/\n/**\n* Default bandwidth estimator configuration.\n*\n* Values match Shaka Player defaults based on experimentation.\n*/\nconst DEFAULT_BANDWIDTH_CONFIG = {\n\tfastHalfLife: 2,\n\tslowHalfLife: 5,\n\tminTotalBytes: 128e3,\n\tminBytes: 16e3,\n\tminDuration: 5\n};\n/**\n* Add a bandwidth sample from a segment download.\n*\n* Samples are filtered based on:\n* - Minimum bytes (filters TTFB-dominated small segments)\n* - Minimum duration (filters cached responses)\n*\n* Valid samples update both fast and slow EWMA estimates.\n*\n* @param state - Current estimator state\n* @param durationMs - Download duration in milliseconds\n* @param numBytes - Number of bytes downloaded\n* @param config - Optional estimator configuration (uses defaults if not provided)\n* @returns New estimator state with sample incorporated (or unchanged if filtered)\n*\n* @example\n* let state = { fastEstimate: 0, fastTotalWeight: 0, ... };\n* // Sample: 1MB in 1 second\n* state = sampleBandwidth(state, 1000, 1_000_000);\n*/\nfunction sampleBandwidth(state, durationMs, numBytes, config = DEFAULT_BANDWIDTH_CONFIG) {\n\tconst updatedBytesSampled = state.bytesSampled + numBytes;\n\tif (numBytes < config.minBytes) return {\n\t\t...state,\n\t\tbytesSampled: updatedBytesSampled\n\t};\n\tif (durationMs < config.minDuration) return {\n\t\t...state,\n\t\tbytesSampled: updatedBytesSampled\n\t};\n\tconst bandwidth = 8e3 * numBytes / durationMs;\n\tconst weight = durationMs / 1e3;\n\treturn {\n\t\tfastEstimate: calculateEwma(state.fastEstimate, bandwidth, weight, config.fastHalfLife),\n\t\tfastTotalWeight: state.fastTotalWeight + weight,\n\t\tslowEstimate: calculateEwma(state.slowEstimate, bandwidth, weight, config.slowHalfLife),\n\t\tslowTotalWeight: state.slowTotalWeight + weight,\n\t\tbytesSampled: updatedBytesSampled\n\t};\n}\n/**\n* Get the current bandwidth estimate.\n*\n* Returns the **minimum** of the fast and slow EWMA estimates.\n* This provides the key asymmetric behavior:\n* - When bandwidth drops, fast EWMA reacts first and dominates (quick adaptation)\n* - When bandwidth rises, slow EWMA lags behind and dominates (slow adaptation)\n*\n* Uses default estimate until enough data has been sampled — and when no\n* estimator state exists at all (`state === undefined`).\n*\n* @param state - Current estimator state, or `undefined` before any samples have been collected\n* @param defaultEstimate - Fallback estimate before sufficient samples (bps)\n* @param config - Optional estimator configuration (uses defaults if not provided)\n* @returns Bandwidth estimate in bits per second\n*\n* @example\n* const estimate = getBandwidthEstimate(state, 5_000_000); // 5 Mbps default\n*/\nfunction getBandwidthEstimate(state, defaultEstimate, config = DEFAULT_BANDWIDTH_CONFIG) {\n\tif (!state || state.bytesSampled < config.minTotalBytes) return defaultEstimate;\n\tconst fastEstimate = applyZeroFactor(state.fastEstimate, state.fastTotalWeight, config.fastHalfLife);\n\tconst slowEstimate = applyZeroFactor(state.slowEstimate, state.slowTotalWeight, config.slowHalfLife);\n\treturn Math.min(fastEstimate, slowEstimate);\n}\n//#endregion\nexport { DEFAULT_BANDWIDTH_CONFIG, getBandwidthEstimate, sampleBandwidth };\n\n//# sourceMappingURL=bandwidth-estimator.js.map","//#region src/network/chunked-stream-iterable.ts\nconst DEFAULT_MIN_CHUNK_SIZE = 2 ** 17;\n/**\n* Adapts a `ReadableStream<Uint8Array>` (e.g. `response.body`) into an\n* `AsyncIterable<Uint8Array>` that yields chunks no smaller than\n* `minChunkSize` bytes. Smaller network chunks are accumulated and yielded\n* together once the threshold is met. Any remainder is flushed on stream end.\n*\n* Errors from the underlying stream propagate naturally — the reader lock is\n* always released via `finally`.\n*/\nvar ChunkedStreamIterable = class {\n\tminChunkSize;\n\t#readableStream;\n\tconstructor(readableStream, { minChunkSize = DEFAULT_MIN_CHUNK_SIZE } = {}) {\n\t\tthis.#readableStream = readableStream;\n\t\tthis.minChunkSize = minChunkSize;\n\t}\n\tasync *[Symbol.asyncIterator]() {\n\t\tlet pending;\n\t\tconst reader = this.#readableStream.getReader();\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\tif (done) {\n\t\t\t\t\tif (pending) yield pending;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tpending = pending ? concat(pending, value) : value;\n\t\t\t\tif (pending.length >= this.minChunkSize) {\n\t\t\t\t\tyield pending;\n\t\t\t\t\tpending = void 0;\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\treader.releaseLock();\n\t\t}\n\t}\n};\nfunction concat(a, b) {\n\tconst result = new Uint8Array(a.length + b.length);\n\tresult.set(a);\n\tresult.set(b, a.length);\n\treturn result;\n}\n//#endregion\nexport { ChunkedStreamIterable };\n\n//# sourceMappingURL=chunked-stream-iterable.js.map","import { sampleBandwidth } from \"./bandwidth-estimator.js\";\nimport { ChunkedStreamIterable } from \"./chunked-stream-iterable.js\";\n//#region src/network/fetch.ts\n/**\n* HTTP Fetch Wrapper\n*\n* Composable building blocks:\n* - fetchResolvable() — fetch a Resource (handles byte ranges); returns Response\n* - getResponseText() — extract text from Response\n* - fetchResolvableStream() — single-stage async generator over body chunks\n* - fetchStream() — two-stage: await connection establishment, then lazily\n* iterate body chunks. Use when timing the connection start independently\n* of body consumption matters (e.g., observable fetch timing for ABR).\n* - createTrackedFetch() — factory for a fetchStream-shape function that\n* samples bandwidth (via EWMA) per chunk and notifies via callback.\n*/\n/**\n* Fetch resolvable from a Resource.\n*\n* Handles byte range requests if byteRange is present.\n* Returns native fetch Response for composability (can extract text, stream, etc.).\n*\n* @param addressable - Resource to fetch (url + optional byteRange)\n* @returns Promise resolving to Response\n*\n* @example\n* const response = await fetchResolvable({ url: 'https://example.com/segment.m4s' });\n* const text = await getResponseText(response);\n*\n* @example\n* // With byte range\n* const response = await fetchResolvable({\n* url: 'https://example.com/file.mp4',\n* byteRange: { start: 1000, end: 1999 }\n* });\n*/\nasync function fetchResolvable(addressable, options) {\n\tconst headers = new Headers(options?.headers);\n\tif (addressable.byteRange) {\n\t\tconst { start, end } = addressable.byteRange;\n\t\theaders.set(\"Range\", `bytes=${start}-${end}`);\n\t}\n\tconst request = new Request(addressable.url, {\n\t\tmethod: \"GET\",\n\t\theaders,\n\t\t...options\n\t});\n\treturn fetch(request);\n}\n/**\n* Extract text from Response.\n*\n* Accepts minimal Response-like object (just needs text() method).\n* Returns promise from response.text().\n*\n* @param response - Response-like object with text() method\n* @returns Promise resolving to text content\n*\n* @example\n* const response = await fetchResolvable(addressable);\n* const text = await getResponseText(response);\n*/\nfunction getResponseText(response) {\n\treturn response.text();\n}\n/** Default {@link FetchText}: fetch the resource, reject on non-OK, return text. */\nconst fetchResolvableText = async (addressable, options) => {\n\tconst response = await fetchResolvable(addressable, options);\n\tif (!response.ok) throw new Error(`fetchResolvableText: ${response.status} ${response.statusText} for ${addressable.url}`);\n\treturn getResponseText(response);\n};\nasync function fetchStream(addressable, options) {\n\tconst { minChunkSize, ...fetchOptions } = options ?? {};\n\tconst response = await fetchResolvable(addressable, fetchOptions);\n\tif (!response.body) throw new Error(\"Response has no body\");\n\treturn new ChunkedStreamIterable(response.body, ...minChunkSize !== void 0 ? [{ minChunkSize }] : []);\n}\n/**\n* Returns a {@link FetchBytes} function that samples bandwidth via EWMA\n* per body chunk. The factory captures the running bandwidth state\n* internally; per chunk it computes the next state and notifies the\n* supplied `onSample` callback.\n*\n* The factory's internal accumulator is seeded from `initial` and updated\n* on every chunk; callers don't need to thread it back in. `onSample`\n* receives the *new* state after each chunk — typical use is to bridge\n* samples back into engine state for ABR consumers.\n*\n* @param initial - Starting `BandwidthState` (commonly zeros or the\n* engine's current accumulator).\n* @param onSample - Called with the new `BandwidthState` after each chunk.\n*/\nfunction createTrackedFetch(initial, onSample) {\n\tlet state = initial;\n\treturn async (addressable, options) => {\n\t\tconst { minChunkSize, ...fetchOptions } = options ?? {};\n\t\tconst response = await fetchResolvable(addressable, fetchOptions);\n\t\tif (!response.body) throw new Error(\"Response has no body\");\n\t\tconst body = response.body;\n\t\treturn { [Symbol.asyncIterator]: async function* () {\n\t\t\tlet chunkStart = performance.now();\n\t\t\tfor await (const chunk of new ChunkedStreamIterable(body, ...minChunkSize !== void 0 ? [{ minChunkSize }] : [])) {\n\t\t\t\tconst elapsed = performance.now() - chunkStart;\n\t\t\t\tstate = sampleBandwidth(state, elapsed, chunk.byteLength);\n\t\t\t\tonSample(state);\n\t\t\t\tyield chunk;\n\t\t\t\tchunkStart = performance.now();\n\t\t\t}\n\t\t} };\n\t};\n}\n//#endregion\nexport { createTrackedFetch, fetchResolvable, fetchResolvableText, fetchStream, getResponseText };\n\n//# sourceMappingURL=fetch.js.map","import { anyAbortSignal } from \"@videojs/utils/events\";\nimport { generateId } from \"@videojs/utils/string\";\n//#region src/core/tasks/task.ts\n/**\n* Generic reusable task that wraps an async run function.\n*\n* Owns its own AbortController so it can always be aborted independently.\n* Optionally composes an external AbortSignal so that a parent's cancellation\n* propagates into the task's work without requiring the caller to track the\n* task separately.\n*\n* `run()` is memoized: the work runs at most once per instance, and every call\n* returns the same promise (so observers can `await run()` to read the result\n* without re-triggering the work). To re-run the *same* work, take a `clone()` —\n* a fresh instance with its own AbortController and a pending state.\n*\n* Ordering guarantee: `value` is written before `status` transitions to `'done'`;\n* `error` is written before `status` transitions to `'error'`. Any reader\n* observing `status === 'done'` is guaranteed `value` is already present.\n*/\nvar Task = class Task {\n\tid;\n\t#runFn;\n\t#externalSignal;\n\t#abortController = new AbortController();\n\t#signal;\n\t#status = \"pending\";\n\t#value = void 0;\n\t#error = void 0;\n\t#previous = void 0;\n\t#promise = void 0;\n\tconstructor(runFn, config) {\n\t\tthis.#runFn = runFn;\n\t\tconst rawId = config?.id;\n\t\tthis.id = typeof rawId === \"function\" ? rawId() : rawId ?? generateId();\n\t\tthis.#externalSignal = config?.signal;\n\t\tthis.#signal = config?.signal ? anyAbortSignal([this.#abortController.signal, config.signal]) : this.#abortController.signal;\n\t}\n\tget status() {\n\t\treturn this.#status;\n\t}\n\tget value() {\n\t\treturn this.#value;\n\t}\n\tget error() {\n\t\treturn this.#error;\n\t}\n\tget previous() {\n\t\treturn this.#previous;\n\t}\n\tget signal() {\n\t\treturn this.#signal;\n\t}\n\trun() {\n\t\tthis.#promise ??= this.#execute();\n\t\treturn this.#promise;\n\t}\n\tasync #execute() {\n\t\tthis.#status = \"running\";\n\t\ttry {\n\t\t\tconst result = await this.#runFn(this.#signal);\n\t\t\tthis.#value = result;\n\t\t\tthis.#status = \"done\";\n\t\t\treturn result;\n\t\t} catch (e) {\n\t\t\tthis.#error = e;\n\t\t\tthis.#status = \"error\";\n\t\t\tthrow e;\n\t\t}\n\t}\n\tabort() {\n\t\tthis.#abortController.abort();\n\t}\n\t/**\n\t* A fresh task with the same work, id, and external signal, in a pending state\n\t* (its own AbortController, no memoized result) — so it can be run again. Used\n\t* to re-run structurally identical work (e.g. `RecurringRunner` reloads).\n\t*\n\t* The clone inherits this run's value as its `previous` (or this run's own\n\t* `previous` if it never produced one — e.g. it errored), so a recurrence's\n\t* `previous` always tracks the last *successful* value across the lineage with\n\t* no bookkeeping in the runner.\n\t*/\n\tclone() {\n\t\tconst cloned = new Task(this.#runFn, {\n\t\t\tid: this.id,\n\t\t\tsignal: this.#externalSignal\n\t\t});\n\t\tcloned.#previous = this.#value ?? this.#previous;\n\t\treturn cloned;\n\t}\n};\n/**\n* Runs tasks concurrently, deduplicated by task id.\n*\n* If a task with a given id is already in flight, subsequent schedule() calls\n* for that id are silently ignored until the first completes. Tasks are stored\n* so abortAll() can cancel any in-flight work (e.g. on engine cleanup).\n*/\nvar ConcurrentRunner = class {\n\t#pending = /* @__PURE__ */ new Map();\n\t#settled = Promise.resolve();\n\t#resolveSettled = null;\n\t#destroyed = false;\n\tschedule(task) {\n\t\tif (this.#destroyed) return Promise.resolve();\n\t\tconst existing = this.#pending.get(task.id);\n\t\tif (existing) return existing.promise;\n\t\tif (this.#pending.size === 0) this.#settled = new Promise((resolve) => {\n\t\t\tthis.#resolveSettled = resolve;\n\t\t});\n\t\tconst promise = task.run();\n\t\tpromise.catch(() => {});\n\t\tconst cleanup = () => {\n\t\t\tthis.#pending.delete(task.id);\n\t\t\tif (this.#pending.size === 0) {\n\t\t\t\tthis.#resolveSettled?.();\n\t\t\t\tthis.#resolveSettled = null;\n\t\t\t}\n\t\t};\n\t\tpromise.then(cleanup, cleanup);\n\t\tthis.#pending.set(task.id, {\n\t\t\ttask,\n\t\t\tpromise\n\t\t});\n\t\treturn promise;\n\t}\n\t/**\n\t* Registers a callback to fire when all currently in-flight tasks settle.\n\t* If the runner is already idle, the callback is never called. If abortAll()\n\t* is called before the batch settles, the callback is superseded and silently\n\t* dropped — no stale callbacks, no generation token required by the caller.\n\t*/\n\twhenSettled(callback) {\n\t\tif (this.#pending.size === 0) return;\n\t\tconst captured = this.#settled;\n\t\tcaptured.then(() => {\n\t\t\tif (this.#settled !== captured) return;\n\t\t\tcallback();\n\t\t}, () => {});\n\t}\n\tabortAll() {\n\t\tfor (const { task } of this.#pending.values()) task.abort();\n\t\tthis.#pending.clear();\n\t\tthis.#resolveSettled?.();\n\t\tthis.#resolveSettled = null;\n\t\tthis.#settled = Promise.resolve();\n\t}\n\tdestroy() {\n\t\tthis.#destroyed = true;\n\t\tthis.abortAll();\n\t}\n};\n/**\n* Runs tasks one at a time in submission order.\n*\n* Each schedule() call returns a Promise that resolves or rejects with the\n* task's result when it is eventually executed. Tasks wait in queue until the\n* prior task completes.\n*\n* Serialization is achieved by chaining each task's run() onto the tail of a\n* shared promise chain — no explicit queue or drain loop needed.\n*\n* abortAll() aborts all pending (not yet started) tasks and the currently\n* in-flight task. Pending tasks still run briefly but receive an aborted\n* signal and are expected to exit early.\n*/\nvar SerialRunner = class {\n\t#chain = Promise.resolve();\n\t#pending = /* @__PURE__ */ new Set();\n\t#current = null;\n\t#destroyed = false;\n\tschedule(task) {\n\t\tif (this.#destroyed) return Promise.resolve();\n\t\tconst t = task;\n\t\tthis.#pending.add(t);\n\t\tconst result = this.#chain.then(() => {\n\t\t\tthis.#pending.delete(t);\n\t\t\tthis.#current = t;\n\t\t\treturn task.run();\n\t\t}).finally(() => {\n\t\t\tthis.#current = null;\n\t\t});\n\t\tthis.#chain = result.then(() => {}, () => {});\n\t\treturn result;\n\t}\n\t/**\n\t* A promise that resolves when all currently-scheduled tasks have settled.\n\t* Use the reference as a generation token: capture it after scheduling a\n\t* batch, then check identity in the resolution callback to detect whether\n\t* a subsequent abortAll() + new batch has superseded this one.\n\t*/\n\tget settled() {\n\t\treturn this.#chain;\n\t}\n\t/**\n\t* Registers a callback to fire when all currently-pending tasks settle.\n\t* If the runner is already idle (no pending or running tasks), the callback\n\t* is never called. If new tasks are scheduled before the current batch\n\t* settles, the callback is superseded and silently dropped — no stale\n\t* callbacks, no generation token required by the caller.\n\t*/\n\twhenSettled(callback) {\n\t\tif (this.#pending.size === 0 && this.#current === null) return;\n\t\tconst currentChain = this.#chain;\n\t\tcurrentChain.then(() => {\n\t\t\tif (this.#chain !== currentChain) return;\n\t\t\tcallback();\n\t\t}, () => {});\n\t}\n\t/** Aborts and clears queued tasks without touching the in-flight task. */\n\tabortPending() {\n\t\tfor (const task of this.#pending) task.abort();\n\t\tthis.#pending.clear();\n\t}\n\tabortAll() {\n\t\tthis.abortPending();\n\t\tthis.#current?.abort();\n\t}\n\tdestroy() {\n\t\tthis.#destroyed = true;\n\t\tthis.abortAll();\n\t}\n};\n/**\n* A {@link Reschedule} that never recurs — the task runs exactly once. Pass it to\n* a {@link RecurringRunner} for non-recurring, run-once work (e.g. resolving a\n* complete VoD playlist that can never go stale).\n*/\nconst runOnce = () => Promise.resolve(false);\n/**\n* Runs a task, then re-runs it whenever a {@link Reschedule} function says to,\n* until it says stop (or it's aborted) — the recurring sibling of\n* {@link ConcurrentRunner} / {@link SerialRunner}, and like them it's handed a\n* {@link TaskLike} to run.\n*\n* The runner has no notion of time: it just awaits whatever `reschedule`\n* returns (resolves `true` → re-run; `false` → stop). A `reschedule` is required;\n* pass {@link runOnce} for non-recurring, run-exactly-once work.\n*\n* Single-slot, keyed by task **id**: there is always at most one identified\n* active task for re-running. Scheduling a task whose id matches the active one\n* is a no-op — the existing recurrence keeps running (dedup by id). Scheduling a\n* task with a *different* id aborts the prior task's in-flight run and pending\n* reschedule, then takes over the slot (abort-and-replace) — the right shape\n* when there's one logical unit of recurring work (e.g. reloading the *selected*\n* track's media playlist).\n*\n* Each re-run is a fresh `clone()` of the task (since `Task.run()` is memoized —\n* the same instance won't re-execute), carrying the same id so the slot's\n* identity is stable across cycles. The clone also carries the prior cycle's\n* value forward as `task.previous`. The run function should read any inputs that\n* change between cycles at call time rather than capturing them once.\n*\n* The task is the sole cancellation channel: `abortAll()` aborts the active task,\n* which fires `task.signal` — cancelling both its in-flight run and any pending\n* reschedule delay waiting on that signal. An aborted (or stopped) recurrence\n* frees the slot, so a later schedule of the same id starts fresh.\n*/\nvar RecurringRunner = class {\n\t#reschedule;\n\t#active = null;\n\t#destroyed = false;\n\tconstructor(reschedule) {\n\t\tthis.#reschedule = reschedule;\n\t}\n\t/**\n\t* Run `task` and recur per the `reschedule` verdict, as a single promise.\n\t* Resolves with the *final* cycle's value when the recurrence stops; **rejects**\n\t* if a run (or reschedule) genuinely fails — the rejection propagates to the\n\t* caller, who owns error handling; the runner only frees its slot (no\n\t* swallowing). The runner's *own* cancellation (abort/supersede/destroy) is not\n\t* a failure, so an aborted recurrence settles quietly rather than rejecting —\n\t* callers don't have to `.catch` routine teardown.\n\t*\n\t* Each cycle runs the task and consults `reschedule` concurrently (so the delay\n\t* can be measured from the run's start); when both settle and this cycle still\n\t* owns the slot, a `true` verdict re-schedules a `clone()` whose promise is\n\t* *returned* — so the recurrence is the method calling itself, threaded into one\n\t* promise, no separate loop. The clone shares the id, so the slot's identity is\n\t* stable across cycles; it's released just before the re-schedule so the call\n\t* advances rather than dedup-returning.\n\t*\n\t* Note: because each cycle's promise adopts the next, the chain retains every\n\t* prior cycle for the life of the recurrence — bounded for finite recurrences,\n\t* an unbounded (small per-cycle) cost for a long-lived one (e.g. live reload).\n\t*/\n\tschedule(task) {\n\t\tif (this.#destroyed) return Promise.resolve();\n\t\tif (this.#active?.id === task.id) return this.#active.run();\n\t\tthis.#cancel();\n\t\tthis.#active = task;\n\t\treturn Promise.all([task.run(), this.#reschedule(task)]).then(([value, again]) => {\n\t\t\tif (this.#active === task && again && !task.signal.aborted) {\n\t\t\t\tthis.#active = null;\n\t\t\t\treturn this.schedule(task.clone());\n\t\t\t}\n\t\t\tif (this.#active === task) this.#active = null;\n\t\t\treturn value;\n\t\t}, (error) => {\n\t\t\tif (this.#active === task) this.#active = null;\n\t\t\tif (task.signal.aborted) return void 0;\n\t\t\tthrow error;\n\t\t});\n\t}\n\t#cancel() {\n\t\tthis.#active?.abort();\n\t\tthis.#active = null;\n\t}\n\tabortAll() {\n\t\tthis.#cancel();\n\t}\n\tdestroy() {\n\t\tthis.#destroyed = true;\n\t\tthis.abortAll();\n\t}\n};\n//#endregion\nexport { ConcurrentRunner, RecurringRunner, SerialRunner, Task, runOnce };\n\n//# sourceMappingURL=task.js.map","import { untrack, update } from \"../signals/primitives.js\";\nimport { createMachineCore } from \"../machine.js\";\n//#region src/core/actors/create-machine-actor.ts\n/**\n* Creates a message-driven actor from a declarative definition.\n*\n* The actor owns a reactive snapshot signal (state + context), an optional\n* runner, and dispatches incoming messages to per-state handlers. `'destroyed'`\n* is always the implicit terminal state — `destroy()` transitions there\n* unconditionally and all subsequent `send()` calls are no-ops.\n*\n* When a state declares `onSettled`, the framework calls `runner.whenSettled()`\n* after the handler returns. The runner owns the generation-token logic — if\n* new tasks are scheduled before the current batch settles, the callback is\n* automatically superseded.\n*\n* @example\n* const actor = createMachineActor({\n* runner: () => new SerialRunner(),\n* initial: 'idle',\n* context: {},\n* states: {\n* idle: {\n* on: {\n* load: (msg, { transition, runner }) => {\n* segments.forEach(s => runner.schedule(new Task(...)));\n* transition('loading');\n* }\n* }\n* },\n* loading: {\n* onSettled: 'idle',\n* on: {\n* load: (msg, { runner }) => {\n* runner.abortAll();\n* segments.forEach(s => runner.schedule(new Task(...)));\n* }\n* }\n* }\n* }\n* });\n*/\nfunction createMachineActor(def) {\n\tconst runner = def.runner?.();\n\tconst { snapshotSignal, getState, transition } = createMachineCore({\n\t\tvalue: def.initial,\n\t\tcontext: def.context\n\t});\n\tconst getContext = () => untrack(() => snapshotSignal.get().context);\n\tconst setContext = (context) => {\n\t\tupdate(snapshotSignal, { context });\n\t};\n\treturn {\n\t\tget snapshot() {\n\t\t\treturn snapshotSignal;\n\t\t},\n\t\tsend(message) {\n\t\t\tconst state = getState();\n\t\t\tif (state === \"destroyed\") return;\n\t\t\tconst handler = def.states[state]?.on?.[message.type];\n\t\t\tif (!handler) return;\n\t\t\thandler(message, {\n\t\t\t\tcontext: getContext(),\n\t\t\t\tgetContext,\n\t\t\t\ttransition: (to) => transition(to),\n\t\t\t\tsetContext,\n\t\t\t\t...runner ? { runner } : {}\n\t\t\t});\n\t\t\tconst newState = getState();\n\t\t\tif (newState !== \"destroyed\") {\n\t\t\t\tconst newStateDef = def.states[newState];\n\t\t\t\tif (newStateDef?.onSettled && runner) {\n\t\t\t\t\tconst targetState = newStateDef.onSettled;\n\t\t\t\t\trunner.whenSettled(() => {\n\t\t\t\t\t\tif (getState() !== newState) return;\n\t\t\t\t\t\ttransition(targetState);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tdestroy() {\n\t\t\tif (getState() === \"destroyed\") return;\n\t\t\trunner?.destroy();\n\t\t\ttransition(\"destroyed\");\n\t\t}\n\t};\n}\n//#endregion\nexport { createMachineActor };\n\n//# sourceMappingURL=create-machine-actor.js.map","//#region src/media/buffer/back-buffer.ts\n/**\n* Default back buffer configuration.\n*/\nconst DEFAULT_BACK_BUFFER_CONFIG = { keepSegments: 2 };\n/**\n* Calculate back buffer flush point.\n*\n* Determines where to flush old segments from the back buffer.\n* Keeps a fixed number of segments behind the current playback position.\n*\n* Algorithm:\n* 1. Find segments before currentTime\n* 2. Count back N segments (keepSegments)\n* 3. Return startTime of segment N+1 back (flush everything before this)\n*\n* @param segments - Available segments (should be sorted by startTime)\n* @param currentTime - Current playback position in seconds\n* @param config - Optional back buffer configuration\n* @returns Time in seconds to flush up to (flush range: [0, flushEnd))\n*\n* @example\n* const segments = [\n* { startTime: 0, duration: 6, ... },\n* { startTime: 6, duration: 6, ... },\n* { startTime: 12, duration: 6, ... },\n* { startTime: 18, duration: 6, ... },\n* ];\n*\n* // Playing at 18s, keep 2 segments\n* const flushEnd = calculateBackBufferFlushPoint(segments, 18);\n* // Returns 6 (flush [0, 6), keep [6-18))\n*/\nfunction calculateBackBufferFlushPoint(segments, currentTime, config = DEFAULT_BACK_BUFFER_CONFIG) {\n\tif (segments.length === 0) return 0;\n\tconst segmentsBefore = segments.filter((seg) => seg.startTime < currentTime);\n\tif (segmentsBefore.length === 0) return 0;\n\tconst segmentsToFlush = segmentsBefore.length - config.keepSegments;\n\tif (segmentsToFlush <= 0) return 0;\n\tif (segmentsToFlush >= segmentsBefore.length) return currentTime;\n\treturn segmentsBefore[segmentsToFlush].startTime;\n}\n//#endregion\nexport { DEFAULT_BACK_BUFFER_CONFIG, calculateBackBufferFlushPoint };\n\n//# sourceMappingURL=back-buffer.js.map","import { effect } from \"../../core/signals/effect.js\";\n//#region src/playback/primitives/segment-load-pipeline.ts\n/**\n* Base-step view of the loader's own wiring. `createSegmentLoaderActor` folds its\n* `sourceBufferActor` + `fetch` into the threaded `config` so base steps read them\n* from the uniform passthrough — present whether the loader runs inside a composition\n* or standalone. `config` is loose (`object`), so assert the shape here (one cast, like\n* relocation's `containerSlot`).\n*/\nfunction stepWiring(deps) {\n\treturn deps.config;\n}\n/**\n* Resolves when the SourceBufferActor snapshot reaches 'idle'.\n* Rejects if the signal is aborted or the actor is destroyed.\n*\n* Used to sequence SourceBufferActor operations without awaiting send()\n* directly — send() is fire-and-forget; callers observe completion via\n* state transition.\n*/\nfunction waitForIdle(snapshot, signal) {\n\treturn new Promise((resolve, reject) => {\n\t\tif (snapshot.get().value === \"idle\") {\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\t\tif (snapshot.get().value === \"destroyed\") {\n\t\t\treject(new DOMException(\"Aborted\", \"AbortError\"));\n\t\t\treturn;\n\t\t}\n\t\tif (signal.aborted) {\n\t\t\treject(signal.reason);\n\t\t\treturn;\n\t\t}\n\t\tlet stop;\n\t\tconst cleanup = (fn) => {\n\t\t\tstop?.();\n\t\t\tsignal.removeEventListener(\"abort\", onAbort);\n\t\t\tfn();\n\t\t};\n\t\tconst onAbort = () => cleanup(() => reject(signal.reason));\n\t\tstop = effect(() => {\n\t\t\tconst value = snapshot.get().value;\n\t\t\tif (value === \"idle\") cleanup(resolve);\n\t\t\telse if (value === \"destroyed\") cleanup(() => reject(new DOMException(\"Aborted\", \"AbortError\")));\n\t\t});\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n}\n/** Build the SourceBuffer message a completed frame dispatches. `fetchStep` always precedes `dispatchStep` in append pipelines, so `data` is set by now. */\nfunction toMessage({ op, data, meta }) {\n\tswitch (op.type) {\n\t\tcase \"remove\": return op;\n\t\tcase \"append-init\": return {\n\t\t\ttype: \"append-init\",\n\t\t\tdata,\n\t\t\tmeta: op.meta\n\t\t};\n\t\tcase \"append-segment\": return {\n\t\t\ttype: \"append-segment\",\n\t\t\tdata,\n\t\t\tmeta: meta ?? op.meta\n\t\t};\n\t}\n}\n/**\n* Fetch this op's bytes into the frame. Init segments need the full body\n* (`minChunkSize: Infinity`) before appending; media segments stream so chunks\n* append as they arrive. Awaiting headers eagerly also starts the HTTP\n* connection (and records the fetch in observers like tests).\n*/\nconst fetchStep = async (frame, signal, deps) => {\n\tconst { op } = frame;\n\tif (op.type === \"remove\") return;\n\tconst { fetch } = stepWiring(deps);\n\tframe.data = await fetch(op, op.type === \"append-init\" ? {\n\t\tsignal,\n\t\tminChunkSize: Infinity\n\t} : { signal });\n};\n/** Dispatch the frame's message to the SourceBufferActor and await its return to idle. */\nconst dispatchStep = async (frame, signal, deps) => {\n\tconst { sourceBufferActor } = stepWiring(deps);\n\tsourceBufferActor.send(toMessage(frame));\n\tawait waitForIdle(sourceBufferActor.snapshot, signal);\n};\n/** Tier 0 default: fetch (for ops that carry bytes) then dispatch. No relocation vocabulary. */\nconst DEFAULT_MESSAGE_PIPELINES = () => ({\n\tremove: [dispatchStep],\n\t\"append-init\": [fetchStep, dispatchStep],\n\t\"append-segment\": [fetchStep, dispatchStep]\n});\n//#endregion\nexport { DEFAULT_MESSAGE_PIPELINES, dispatchStep, fetchStep };\n\n//# sourceMappingURL=segment-load-pipeline.js.map","import { peek } from \"../../../core/signals/primitives.js\";\nimport { SerialRunner, Task } from \"../../../core/tasks/task.js\";\nimport { createMachineActor } from \"../../../core/actors/create-machine-actor.js\";\nimport \"../../../media/types/index.js\";\nimport { DEFAULT_FORWARD_BUFFER_CONFIG, calculateForwardFlushPoint, getSegmentsToLoad, isTimeRangeCovered, mergeTimeRanges } from \"../../../media/buffer/forward-buffer.js\";\nimport { DEFAULT_BACK_BUFFER_CONFIG, calculateBackBufferFlushPoint } from \"../../../media/buffer/back-buffer.js\";\nimport { DEFAULT_MESSAGE_PIPELINES } from \"../../primitives/segment-load-pipeline.js\";\n//#region src/playback/actors/dom/segment-loader.ts\n/**\n* Wraps a LoadTask descriptor into a Task that runs the op's message pipeline\n* (fetch/discover/stamp/dispatch, per the composition's `messagePipelines`).\n* Updates in-flight context around the async region so the loading handler can\n* make accurate continue/preempt decisions at any point, and checks the abort\n* signal before each step.\n*/\nfunction makeLoadTask(op, { getContext, setContext, pipelines, deps }) {\n\treturn new Task(async (taskSignal) => {\n\t\tif (taskSignal.aborted) return;\n\t\tconst frame = op.type === \"append-segment\" ? {\n\t\t\top,\n\t\t\tmeta: op.meta\n\t\t} : { op };\n\t\ttry {\n\t\t\tif (op.type === \"append-init\") setContext({\n\t\t\t\t...getContext(),\n\t\t\t\tinFlightInitTrackId: op.meta.trackId\n\t\t\t});\n\t\t\telse if (op.type === \"append-segment\") setContext({\n\t\t\t\t...getContext(),\n\t\t\t\tinFlightSegment: {\n\t\t\t\t\tid: op.meta.id,\n\t\t\t\t\ttrackId: op.meta.trackId\n\t\t\t\t}\n\t\t\t});\n\t\t\tfor (const step of pipelines[op.type]) {\n\t\t\t\tif (taskSignal.aborted) return;\n\t\t\t\tawait step(frame, taskSignal, deps);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (op.type === \"append-init\") setContext({\n\t\t\t\t...getContext(),\n\t\t\t\tinFlightInitTrackId: null\n\t\t\t});\n\t\t\telse if (op.type === \"append-segment\") setContext({\n\t\t\t\t...getContext(),\n\t\t\t\tinFlightSegment: null\n\t\t\t});\n\t\t}\n\t});\n}\n/**\n* Creates a SegmentLoaderActor for one track type (video or audio).\n*\n* Receives load assignments via `send()` and owns all execution: planning,\n* removes, fetches, and appends. Coordinates with the SourceBufferActor for\n* all physical SourceBuffer operations.\n*\n* Planning (Cases 1–3) happens in the `load` handler on every incoming\n* message, producing an ordered LoadTask list. The runner drains that list\n* sequentially via SerialRunner. When a new message arrives mid-run, the\n* handler replans and either continues the in-flight operation (abortPending\n* + schedule new remainder) or preempts it (abortAll + cancel SourceBuffer\n* if needed + schedule new plan).\n*\n* @param sourceBufferActor - Shared SourceBufferActor reference (not owned)\n* @param fetchBytes - Tracked fetch closure (owns throughput sampling for segments).\n* Accepts an optional `minChunkSize` in options; init segments pass `Infinity`\n* so the entire body accumulates as one chunk before appending.\n* @param compositionDeps - The composition's `state`/`context`/`config`, threaded\n* opaquely into each step's {@link StepDeps} (the loader never reads them). Lets\n* injected steps (relocation) read composition signals at call time. Defaults to\n* empty for standalone / base-pipeline use.\n*/\nfunction createSegmentLoaderActor(sourceBufferActor, fetchBytes, config = {}, compositionDeps = {\n\tstate: {},\n\tcontext: {},\n\tconfig: {}\n}) {\n\tconst forwardBufferConfig = {\n\t\t...DEFAULT_FORWARD_BUFFER_CONFIG,\n\t\t...config.forwardBuffer\n\t};\n\tconst backBufferConfig = {\n\t\t...DEFAULT_BACK_BUFFER_CONFIG,\n\t\t...config.backBuffer\n\t};\n\tconst deps = {\n\t\tstate: compositionDeps.state,\n\t\tcontext: compositionDeps.context,\n\t\tconfig: {\n\t\t\t...compositionDeps.config,\n\t\t\tsourceBufferActor,\n\t\t\tfetch: fetchBytes\n\t\t}\n\t};\n\tconst pipelines = (config.messagePipelines ?? DEFAULT_MESSAGE_PIPELINES)();\n\tconst getBufferedSegments = (allSegments) => {\n\t\tconst merged = mergeTimeRanges(peek(sourceBufferActor.snapshot).context.segments.filter((s) => !s.partial).map((s) => ({\n\t\t\tstart: s.startTime,\n\t\t\tend: s.startTime + s.duration\n\t\t})));\n\t\treturn allSegments.filter((s) => isTimeRangeCovered(s.startTime, s.startTime + s.duration, merged));\n\t};\n\t/**\n\t* Translate a load message into an ordered LoadTask list based on committed\n\t* actor state. In-flight awareness is handled separately in the load handler.\n\t*\n\t* @todo Rename alongside LoadTask (e.g. planOps).\n\t*\n\t* Case 1 — Removes: forward and back buffer flush points, segment-aligned.\n\t* ABR-style track switches (same content, different bitrate) do not flush:\n\t* appending new content overwrites existing buffer ranges, and the actor's\n\t* time-aligned deduplication keeps the segment model accurate as new\n\t* segments arrive.\n\t*\n\t* Cross-rendition track switches (audio language change, text language\n\t* change) do flush: the buffered content is semantically incompatible with\n\t* the newly-selected track, so overwrite-on-append would leave stale\n\t* content playing until each replacement segment lands. Today's predicate:\n\t* `actorCtx.initTrackLanguage !== track.language` — fires for language\n\t* changes, no-ops for video / same-language audio bitrate switches.\n\t* Future stage: pluggable predicate / strategy at actor construction time\n\t* for codec-change (5.1 surround) and other cross-rendition shapes.\n\t*\n\t* Case 2 — Init: schedule if not yet committed for this track.\n\t*\n\t* Case 3 — Segments: all segments in the load window not yet committed.\n\t*/\n\tconst planTasks = (message) => {\n\t\tconst { track, range } = message;\n\t\tconst actorCtx = peek(sourceBufferActor.snapshot).context;\n\t\tconst bufferedSegments = getBufferedSegments(track.segments);\n\t\tconst currentTime = range?.start ?? 0;\n\t\tconst tasks = [];\n\t\tconst isCrossRenditionSwitch = actorCtx.initTrackId !== void 0 && actorCtx.initTrackId !== track.id && actorCtx.initTrackLanguage !== track.language;\n\t\tconst removes = [];\n\t\tconst staleRanges = [];\n\t\tif (range) {\n\t\t\tif (isCrossRenditionSwitch) {\n\t\t\t\tconst staleStart = actorCtx.segments.find((s) => s.startTime <= currentTime && s.startTime + s.duration > currentTime)?.startTime ?? actorCtx.segments.find((s) => s.startTime > currentTime)?.startTime;\n\t\t\t\tif (staleStart !== void 0) staleRanges.push({\n\t\t\t\t\tstart: staleStart,\n\t\t\t\t\tend: Infinity\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst forwardFlushStart = calculateForwardFlushPoint(bufferedSegments, currentTime, forwardBufferConfig);\n\t\t\tif (forwardFlushStart < Infinity) removes.push({\n\t\t\t\tstart: forwardFlushStart,\n\t\t\t\tend: Infinity\n\t\t\t});\n\t\t\tconst backFlushEnd = calculateBackBufferFlushPoint(bufferedSegments, currentTime, backBufferConfig);\n\t\t\tif (backFlushEnd > 0) removes.push({\n\t\t\t\tstart: 0,\n\t\t\t\tend: backFlushEnd\n\t\t\t});\n\t\t\tfor (const r of removes) tasks.push({\n\t\t\t\ttype: \"remove\",\n\t\t\t\tstart: r.start,\n\t\t\t\tend: r.end\n\t\t\t});\n\t\t}\n\t\tconst overlapsStale = (seg) => {\n\t\t\tconst segEnd = seg.startTime + seg.duration;\n\t\t\treturn removes.some((r) => seg.startTime < r.end && segEnd > r.start) || staleRanges.some((r) => seg.startTime < r.end && segEnd > r.start);\n\t\t};\n\t\tconst effectiveBuffered = removes.length + staleRanges.length > 0 ? bufferedSegments.filter((s) => !overlapsStale(s)) : bufferedSegments;\n\t\tif (actorCtx.initTrackId !== track.id) tasks.push({\n\t\t\ttype: \"append-init\",\n\t\t\tmeta: {\n\t\t\t\ttrackId: track.id,\n\t\t\t\tlanguage: track.language\n\t\t\t},\n\t\t\turl: track.initialization.url,\n\t\t\t...track.initialization.byteRange !== void 0 && { byteRange: track.initialization.byteRange }\n\t\t});\n\t\tif (range) {\n\t\t\tconst segmentsToLoad = getSegmentsToLoad(track.segments, effectiveBuffered, currentTime, forwardBufferConfig).filter((seg) => {\n\t\t\t\tconst existing = actorCtx.segments.find((s) => !overlapsStale(s) && Math.abs(s.startTime - seg.startTime) < 1e-4);\n\t\t\t\tif (existing?.partial) return true;\n\t\t\t\tif (!existing?.trackBandwidth || !track.bandwidth) return true;\n\t\t\t\treturn track.bandwidth > existing.trackBandwidth;\n\t\t\t});\n\t\t\tfor (const segment of segmentsToLoad) tasks.push({\n\t\t\t\ttype: \"append-segment\",\n\t\t\t\tmeta: {\n\t\t\t\t\tid: segment.id,\n\t\t\t\t\tstartTime: segment.startTime,\n\t\t\t\t\tduration: segment.duration,\n\t\t\t\t\ttrackId: track.id,\n\t\t\t\t\ttrackBandwidth: track.bandwidth\n\t\t\t\t},\n\t\t\t\turl: segment.url,\n\t\t\t\t...segment.byteRange !== void 0 && { byteRange: segment.byteRange }\n\t\t\t});\n\t\t}\n\t\treturn tasks;\n\t};\n\tconst scheduleAll = (tasks, { getContext, setContext, runner }) => {\n\t\ttasks.forEach((op) => {\n\t\t\trunner.schedule(makeLoadTask(op, {\n\t\t\t\tgetContext,\n\t\t\t\tsetContext,\n\t\t\t\tpipelines,\n\t\t\t\tdeps\n\t\t\t})).then(void 0, (e) => {\n\t\t\t\tif (e instanceof Error && e.name === \"AbortError\") return;\n\t\t\t\tconsole.error(\"Unexpected error in segment loader:\", e);\n\t\t\t\trunner.abortPending();\n\t\t\t});\n\t\t});\n\t};\n\treturn createMachineActor({\n\t\trunner: () => new SerialRunner(),\n\t\tinitial: \"idle\",\n\t\tcontext: {\n\t\t\tinFlightInitTrackId: null,\n\t\t\tinFlightSegment: null\n\t\t},\n\t\tstates: {\n\t\t\tidle: { on: { load: (msg, ctx) => {\n\t\t\t\tconst allTasks = planTasks(msg);\n\t\t\t\tif (allTasks.length === 0) return;\n\t\t\t\tctx.transition(\"loading\");\n\t\t\t\tscheduleAll(allTasks, ctx);\n\t\t\t} } },\n\t\t\tloading: {\n\t\t\t\tonSettled: \"idle\",\n\t\t\t\ton: { load: (msg, ctx) => {\n\t\t\t\t\tconst { context, runner } = ctx;\n\t\t\t\t\tconst allTasks = planTasks(msg);\n\t\t\t\t\tconst inFlight = context.inFlightSegment;\n\t\t\t\t\tconst segmentInFlightStillNeeded = (t) => t.type === \"append-segment\" && inFlight !== null && t.meta.id === inFlight.id && t.meta.trackId === inFlight.trackId;\n\t\t\t\t\tif (inFlight !== null && allTasks.some(segmentInFlightStillNeeded) || context.inFlightInitTrackId !== null && allTasks.some((t) => t.type === \"append-init\" && t.meta.trackId === context.inFlightInitTrackId)) {\n\t\t\t\t\t\trunner.abortPending();\n\t\t\t\t\t\tscheduleAll(allTasks.filter((t) => !segmentInFlightStillNeeded(t) && !(t.type === \"append-init\" && t.meta.trackId === context.inFlightInitTrackId)), ctx);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trunner.abortAll();\n\t\t\t\t\t\tif (context.inFlightSegment !== null || context.inFlightInitTrackId !== null && allTasks.some((t) => t.type === \"append-init\" && t.meta.trackId !== context.inFlightInitTrackId)) sourceBufferActor.send({ type: \"cancel\" });\n\t\t\t\t\t\tscheduleAll(allTasks, ctx);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t}\n\t\t}\n\t});\n}\n//#endregion\nexport { createSegmentLoaderActor };\n\n//# sourceMappingURL=segment-loader.js.map","//#region src/media/dom/mse/append-segment.ts\n/**\n* Append media data to a SourceBuffer.\n*\n* Accepts either a full ArrayBuffer (single append) or an AsyncIterable of\n* Uint8Array chunks (one append per chunk, in order). Waits for `updateend`\n* between each call so appends are serialized correctly.\n*\n* Errors from the SourceBuffer (`error` event) or from the iterable are\n* propagated as rejections.\n*/\nasync function appendSegment(sourceBuffer, data, signal) {\n\tif (data instanceof ArrayBuffer) await appendChunk(sourceBuffer, data);\n\telse try {\n\t\tfor await (const chunk of data) {\n\t\t\tif (signal?.aborted) throw signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\t\t\tawait appendChunk(sourceBuffer, chunk);\n\t\t}\n\t} catch (e) {\n\t\tif (e instanceof DOMException && e.name === \"AbortError\" && !sourceBuffer.updating) try {\n\t\t\tsourceBuffer.abort();\n\t\t} catch {}\n\t\tthrow e;\n\t}\n}\nasync function appendChunk(sourceBuffer, data) {\n\tif (sourceBuffer.updating) await new Promise((resolve) => {\n\t\tconst onUpdateEnd = () => {\n\t\t\tsourceBuffer.removeEventListener(\"updateend\", onUpdateEnd);\n\t\t\tresolve();\n\t\t};\n\t\tsourceBuffer.addEventListener(\"updateend\", onUpdateEnd);\n\t});\n\treturn new Promise((resolve, reject) => {\n\t\tconst onUpdateEnd = () => {\n\t\t\tcleanup();\n\t\t\tresolve();\n\t\t};\n\t\tconst onError = (event) => {\n\t\t\tcleanup();\n\t\t\treject(/* @__PURE__ */ new Error(`SourceBuffer append error: ${event.type}`));\n\t\t};\n\t\tconst cleanup = () => {\n\t\t\tsourceBuffer.removeEventListener(\"updateend\", onUpdateEnd);\n\t\t\tsourceBuffer.removeEventListener(\"error\", onError);\n\t\t};\n\t\tsourceBuffer.addEventListener(\"updateend\", onUpdateEnd);\n\t\tsourceBuffer.addEventListener(\"error\", onError);\n\t\ttry {\n\t\t\tsourceBuffer.appendBuffer(data);\n\t\t} catch (error) {\n\t\t\tcleanup();\n\t\t\treject(error);\n\t\t}\n\t});\n}\n//#endregion\nexport { appendSegment };\n\n//# sourceMappingURL=append-segment.js.map","//#region src/media/dom/mse/buffer-flusher.ts\n/**\n* Buffer flusher helper (P12)\n*\n* Removes a time range from a SourceBuffer to manage memory.\n*/\n/**\n* Remove a time range from a SourceBuffer.\n*\n* Waits for the SourceBuffer to be ready (not updating), then removes\n* the specified range. Returns a promise that resolves when removal completes.\n*\n* @param sourceBuffer - The SourceBuffer to remove data from\n* @param start - Start of the time range to remove (seconds)\n* @param end - End of the time range to remove (seconds)\n* @returns Promise that resolves when removal completes\n*\n* @example\n* await flushBuffer(videoSourceBuffer, 0, 30);\n*/\nasync function flushBuffer(sourceBuffer, start, end) {\n\tif (sourceBuffer.updating) await new Promise((resolve) => {\n\t\tconst onUpdateEnd = () => {\n\t\t\tsourceBuffer.removeEventListener(\"updateend\", onUpdateEnd);\n\t\t\tresolve();\n\t\t};\n\t\tsourceBuffer.addEventListener(\"updateend\", onUpdateEnd);\n\t});\n\treturn new Promise((resolve, reject) => {\n\t\tconst onUpdateEnd = () => {\n\t\t\tcleanup();\n\t\t\tresolve();\n\t\t};\n\t\tconst onError = (event) => {\n\t\t\tcleanup();\n\t\t\treject(/* @__PURE__ */ new Error(`SourceBuffer remove error: ${event.type}`));\n\t\t};\n\t\tconst cleanup = () => {\n\t\t\tsourceBuffer.removeEventListener(\"updateend\", onUpdateEnd);\n\t\t\tsourceBuffer.removeEventListener(\"error\", onError);\n\t\t};\n\t\tsourceBuffer.addEventListener(\"updateend\", onUpdateEnd);\n\t\tsourceBuffer.addEventListener(\"error\", onError);\n\t\ttry {\n\t\t\tsourceBuffer.remove(start, end);\n\t\t} catch (error) {\n\t\t\tcleanup();\n\t\t\treject(error);\n\t\t}\n\t});\n}\n//#endregion\nexport { flushBuffer };\n\n//# sourceMappingURL=buffer-flusher.js.map","import { SerialRunner, Task } from \"../../../core/tasks/task.js\";\nimport { createMachineActor } from \"../../../core/actors/create-machine-actor.js\";\nimport { appendSegment } from \"../../../media/dom/mse/append-segment.js\";\nimport { flushBuffer } from \"../../../media/dom/mse/buffer-flusher.js\";\nimport { SEGMENT_TIME_EPSILON } from \"../../../media/types/index.js\";\n//#region src/playback/actors/dom/source-buffer.ts\nfunction snapshotBuffered(buffered) {\n\tconst ranges = [];\n\tfor (let i = 0; i < buffered.length; i++) ranges.push({\n\t\tstart: buffered.start(i),\n\t\tend: buffered.end(i)\n\t});\n\treturn ranges;\n}\nfunction appendInitTask(message, { getContext, sourceBuffer }) {\n\treturn new Task(async (taskSignal) => {\n\t\tconst ctx = getContext();\n\t\tif (taskSignal.aborted) return ctx;\n\t\tawait appendSegment(sourceBuffer, message.data);\n\t\treturn {\n\t\t\t...ctx,\n\t\t\tinitTrackId: message.meta.trackId,\n\t\t\tinitTrackLanguage: message.meta.language\n\t\t};\n\t});\n}\nfunction appendSegmentTask(message, { getContext, sourceBuffer, setContext }) {\n\treturn new Task(async (taskSignal) => {\n\t\tconst ctx = getContext();\n\t\tif (taskSignal.aborted) return ctx;\n\t\tconst { meta } = message;\n\t\tconst filtered = ctx.segments.filter((s) => Math.abs(s.startTime - meta.startTime) >= SEGMENT_TIME_EPSILON);\n\t\tif (!(message.data instanceof ArrayBuffer)) setContext({\n\t\t\t...ctx,\n\t\t\tsegments: [...filtered, {\n\t\t\t\tid: meta.id,\n\t\t\t\tstartTime: meta.startTime,\n\t\t\t\tduration: meta.duration,\n\t\t\t\ttrackId: meta.trackId,\n\t\t\t\t...meta.trackBandwidth !== void 0 && { trackBandwidth: meta.trackBandwidth },\n\t\t\t\tpartial: true\n\t\t\t}],\n\t\t\tbufferedRanges: ctx.bufferedRanges\n\t\t});\n\t\tif (meta.timestampOffset != null && sourceBuffer.timestampOffset !== meta.timestampOffset) sourceBuffer.timestampOffset = meta.timestampOffset;\n\t\tawait appendSegment(sourceBuffer, message.data, taskSignal);\n\t\treturn {\n\t\t\t...ctx,\n\t\t\tsegments: [...filtered, {\n\t\t\t\tid: meta.id,\n\t\t\t\tstartTime: meta.startTime,\n\t\t\t\tduration: meta.duration,\n\t\t\t\ttrackId: meta.trackId,\n\t\t\t\t...meta.trackBandwidth !== void 0 && { trackBandwidth: meta.trackBandwidth }\n\t\t\t}],\n\t\t\tbufferedRanges: snapshotBuffered(sourceBuffer.buffered)\n\t\t};\n\t});\n}\nfunction removeTask(message, { getContext, sourceBuffer }) {\n\treturn new Task(async (taskSignal) => {\n\t\tconst ctx = getContext();\n\t\tif (taskSignal.aborted) return ctx;\n\t\tawait flushBuffer(sourceBuffer, message.start, message.end);\n\t\tconst bufferedRanges = snapshotBuffered(sourceBuffer.buffered);\n\t\tconst filtered = ctx.segments.filter((s) => {\n\t\t\tconst midpoint = s.startTime + s.duration / 2;\n\t\t\treturn bufferedRanges.some((r) => midpoint >= r.start && midpoint < r.end);\n\t\t});\n\t\treturn {\n\t\t\t...ctx,\n\t\t\tsegments: filtered,\n\t\t\tbufferedRanges\n\t\t};\n\t});\n}\nconst messageTaskFactories = {\n\t\"append-init\": appendInitTask,\n\t\"append-segment\": appendSegmentTask,\n\tremove: removeTask\n};\nfunction messageToTask(message, options) {\n\tconst factory = messageTaskFactories[message.type];\n\treturn factory(message, options);\n}\nfunction createSourceBufferActor(sourceBuffer, initialContext) {\n\tconst handleError = (e) => {\n\t\tif (!(e instanceof Error && e.name === \"AbortError\")) console.error(\"SourceBuffer operation failed:\", e);\n\t};\n\tconst onMessage = (msg, { transition, setContext, getContext, runner }) => {\n\t\ttransition(\"updating\");\n\t\tconst task = messageToTask(msg, {\n\t\t\tgetContext,\n\t\t\tsourceBuffer,\n\t\t\tsetContext\n\t\t});\n\t\trunner.schedule(task).then(setContext, handleError);\n\t};\n\treturn createMachineActor({\n\t\trunner: () => new SerialRunner(),\n\t\tinitial: \"idle\",\n\t\tcontext: {\n\t\t\tsegments: [],\n\t\t\tbufferedRanges: [],\n\t\t\tinitTrackId: void 0,\n\t\t\t...initialContext\n\t\t},\n\t\tstates: {\n\t\t\tidle: { on: {\n\t\t\t\t\"append-init\": onMessage,\n\t\t\t\t\"append-segment\": onMessage,\n\t\t\t\tremove: onMessage,\n\t\t\t\tbatch: (msg, { transition, setContext, getContext, runner }) => {\n\t\t\t\t\tconst { messages } = msg;\n\t\t\t\t\tif (messages.length === 0) return;\n\t\t\t\t\ttransition(\"updating\");\n\t\t\t\t\tmessages.forEach((msg) => {\n\t\t\t\t\t\tconst task = messageToTask(msg, {\n\t\t\t\t\t\t\tgetContext,\n\t\t\t\t\t\t\tsourceBuffer,\n\t\t\t\t\t\t\tsetContext\n\t\t\t\t\t\t});\n\t\t\t\t\t\trunner.schedule(task).then(setContext, handleError);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} },\n\t\t\tupdating: {\n\t\t\t\tonSettled: \"idle\",\n\t\t\t\ton: { cancel: (_, { runner }) => {\n\t\t\t\t\trunner.abortAll();\n\t\t\t\t} }\n\t\t\t}\n\t\t}\n\t});\n}\n//#endregion\nexport { createSourceBufferActor };\n\n//# sourceMappingURL=source-buffer.js.map","import { update } from \"../../core/signals/primitives.js\";\nimport { findTrackById } from \"../../media/utils/tracks.js\";\nimport { addFailedCdn, getCdnId } from \"../../media/utils/cdn.js\";\n//#region src/playback/primitives/failover-fetch.ts\n/**\n* Decorate a fetch so a failed request trips the **selected track's** CDN into\n* `failedCdns`. The decorated fetch's type is preserved, so this wraps both\n* `resolve-track`'s playlist `FetchText` and the segment loaders' `FetchBytes`.\n*\n* The CDN id comes from the selected track's media-playlist URL, never the\n* failed addressable: a segment URL resolves relative to its playlist and, per\n* RFC 3986, drops the playlist's query string (`…/r.m3u8?cdn=fastly` → `…/0.ts`),\n* so a query-keyed `getCdnId` (e.g. Mux's `cdn=`) keyed on it would derive an id\n* that never matches the ones `deriveCdnPriority` / track-switching build from\n* `track.url`. The in-flight fetch belongs to the selected track — a source or\n* track switch aborts it, and aborts don't trip — so the selected track is the\n* right CDN to fail over. For `resolve-track` the resolving track *is* the\n* selected track, so this is identical to keying on its addressable.\n*\n* No-op when no failover monitor is composed (it owns the signal) or the\n* selected track can't be located.\n*/\nfunction failoverFetch(baseFetch, state, config) {\n\tconst getCdnId$1 = config.getCdnId ?? getCdnId;\n\treturn (async (addressable, options) => {\n\t\ttry {\n\t\t\treturn await baseFetch(addressable, options);\n\t\t} catch (error) {\n\t\t\tif (!options?.signal?.aborted && state.failedCdns) {\n\t\t\t\tconst presentation = state.presentation.get();\n\t\t\t\tconst trackId = state[config.selectedKey].get();\n\t\t\t\tconst track = presentation && trackId ? findTrackById(presentation, trackId) : void 0;\n\t\t\t\tif (track) update(state.failedCdns, (cdns) => addFailedCdn(cdns, getCdnId$1(track.url)));\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t});\n}\n//#endregion\nexport { failoverFetch };\n\n//# sourceMappingURL=failover-fetch.js.map","import { computed } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { hasCodecs } from \"../../../media/utils/tracks.js\";\nimport { AUDIO_TYPE_CONFIG, VIDEO_TYPE_CONFIG } from \"../../primitives/track-types.js\";\nimport { buildMimeCodec, createSourceBuffer } from \"../../../media/dom/mse/mediasource-setup.js\";\nimport { getSelectedTrack } from \"../../../media/utils/track-selection.js\";\nimport { createTrackedFetch, fetchStream } from \"../../../network/fetch.js\";\nimport { createSegmentLoaderActor } from \"../../actors/dom/segment-loader.js\";\nimport { createSourceBufferActor } from \"../../actors/dom/source-buffer.js\";\nimport { failoverFetch } from \"../../primitives/failover-fetch.js\";\nimport { listen } from \"@videojs/utils/dom\";\n//#region src/playback/behaviors/dom/setup-buffer-actors.ts\n/**\n* **Per-type buffer + segment-loader actor setup.** Per available track\n* type (video / audio), when `mediaSource` is attached and the selected\n* track of that type is present in the presentation with codecs (partial\n* resolution from the multivariant playlist is enough — codecs live on\n* the `EXT-X-STREAM-INF` line, not in the per-type media playlist),\n* creates a `SourceBuffer`, a `SourceBufferActor`, and a\n* `SegmentLoaderActor` bound to that buffer-actor; publishes the per-type\n* actor slots. On `mediaSource` detach or behavior destroy, destroys both\n* actors in reverse order and clears the per-type slots so the next\n* source starts fresh.\n*\n* Each per-type variant (`setupVideoBufferActors` /\n* `setupAudioBufferActors`) is a single-positive-state reactor\n* (`'preconditions-unmet'` ↔ `'buffer-ready'`) gating only on its own\n* type. No cross-type coupling in `stateKeys` —\n* `setupVideoBufferActors` carries only `selectedVideoTrackId` (plus\n* `bandwidthState`, written by its trackedFetch), and audio mirrors.\n*\n* # Firefox `mozHasAudio` invariant\n*\n* Appending to a video `SourceBuffer` before the audio `SourceBuffer`\n* exists causes `mozHasAudio` to be permanently false in Firefox. With\n* the two per-type variants decoupled, the invariant is no longer\n* structural to a single `entry` body (as it was when both buffers were\n* created in one synchronous block inside a merged behavior). It's now\n* preserved by a chain of assumptions about how this behavior composes\n* with its upstream and downstream siblings:\n*\n* 1. **Upstream — default selections land in one `runPending`.**\n* `selectAudioTrack` (default audio) and `switchVideoTrack`\n* (default video) both subscribe to `state.presentation` flipping to\n* resolved; their effects run in the same `runPending` iteration and\n* write `selectedAudioTrackId` + `selectedVideoTrackId` within it.\n* 2. **Self — both per-type monitors flip in one `runPending`.**\n* After (1), both monitors re-evaluate and flip to `'buffer-ready'`\n* in the next `runPending`. Both `entry` bodies run synchronously\n* within that iteration — both `addSourceBuffer` calls land before\n* the iteration ends.\n* 3. **Downstream — `appendBuffer` is async.** `loadVideoSegments` /\n* `loadAudioSegments` read the per-type `xSegmentLoaderActor` slots;\n* their effects fire in the *next* `runPending` and the actual\n* `appendBuffer` requires a network round-trip via the\n* `SegmentLoaderActor` — many microtasks past both `addSourceBuffer`\n* calls.\n*\n* The cross-tick failure mode — a user-initiated audio track switch\n* *after* video segments have begun appending — is out of scope for\n* this behavior and would be addressed in the buffer/segment-loading\n* path via `changeType`-aware logic.\n*\n* # Sole writer\n*\n* `setupVideoBufferActors` is sole writer of `videoBufferActor` +\n* `videoSegmentLoaderActor` (and `bandwidthState` via its\n* trackedFetch); `setupAudioBufferActors` is sole writer of\n* `audioBufferActor` + `audioSegmentLoaderActor`. Both read\n* `mediaSource` from `setupMediaSource`. Downstream MSE behaviors\n* (`loadVideoSegments`, `loadAudioSegments`, `endOfStream`,\n* `updateMediaSourceDuration`) only read these slots.\n*/\nfunction setupBufferActors({ state, context, config }) {\n\tconst { type, selectedKey, actorKey, loaderKey, fetch, forwardBuffer, backBuffer, messagePipelines } = config;\n\tconst derivedStateSignal = computed(() => {\n\t\tif (!context.mediaSource.get()) return \"preconditions-unmet\";\n\t\treturn hasCodecs(getSelectedTrack({\n\t\t\tpresentation: state.presentation.get(),\n\t\t\t[selectedKey]: state[selectedKey].get()\n\t\t}, type)) ? \"buffer-ready\" : \"preconditions-unmet\";\n\t});\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\t\"buffer-ready\": { entry: () => {\n\t\t\t\tconst mediaSource = context.mediaSource.get();\n\t\t\t\tconst bufferActor = createSourceBufferActor(createSourceBuffer(mediaSource, buildMimeCodec(getSelectedTrack({\n\t\t\t\t\tpresentation: state.presentation.get(),\n\t\t\t\t\t[selectedKey]: state[selectedKey].get()\n\t\t\t\t}, type))));\n\t\t\t\tconst segmentLoader = createSegmentLoaderActor(bufferActor, fetch, {\n\t\t\t\t\tforwardBuffer,\n\t\t\t\t\tbackBuffer,\n\t\t\t\t\tmessagePipelines\n\t\t\t\t}, {\n\t\t\t\t\tstate,\n\t\t\t\t\tcontext,\n\t\t\t\t\tconfig\n\t\t\t\t});\n\t\t\t\tcontext[actorKey].set(bufferActor);\n\t\t\t\tcontext[loaderKey].set(segmentLoader);\n\t\t\t\tconst disconnect = new AbortController();\n\t\t\t\tconst teardownActors = () => {\n\t\t\t\t\tsegmentLoader.destroy();\n\t\t\t\t\tbufferActor.destroy();\n\t\t\t\t\tcontext[loaderKey].set(void 0);\n\t\t\t\t\tcontext[actorKey].set(void 0);\n\t\t\t\t\tdisconnect.abort();\n\t\t\t\t};\n\t\t\t\tlisten(mediaSource, \"sourceclose\", teardownActors, { signal: disconnect.signal });\n\t\t\t\treturn teardownActors;\n\t\t\t} }\n\t\t}\n\t});\n}\n/**\n* Set up the video `SourceBufferActor` + `SegmentLoaderActor`. Fires\n* when `mediaSource` is attached and the selected video track is\n* present in the presentation with codecs. Gates only on video state —\n* no cross-type coupling. Owns a bandwidth-sampling `trackedFetch` and\n* is sole writer of `state.bandwidthState`.\n*/\nconst setupVideoBufferActors = defineBehavior({\n\tstateKeys: [\n\t\t\"presentation\",\n\t\t\"selectedVideoTrackId\",\n\t\t\"bandwidthState\"\n\t],\n\tcontextKeys: [\n\t\t\"mediaSource\",\n\t\t\"videoBufferActor\",\n\t\t\"videoSegmentLoaderActor\"\n\t],\n\tsetup: ({ state, context, config = {} }) => {\n\t\tconst trackedFetch = createTrackedFetch(state.bandwidthState.get() ?? {\n\t\t\tfastEstimate: 0,\n\t\t\tfastTotalWeight: 0,\n\t\t\tslowEstimate: 0,\n\t\t\tslowTotalWeight: 0,\n\t\t\tbytesSampled: 0\n\t\t}, (next) => state.bandwidthState.set(next));\n\t\tconst typeConfig = {\n\t\t\t...VIDEO_TYPE_CONFIG,\n\t\t\t...config\n\t\t};\n\t\treturn setupBufferActors({\n\t\t\tstate,\n\t\t\tcontext,\n\t\t\tconfig: {\n\t\t\t\t...typeConfig,\n\t\t\t\tmessagePipelines: config.videoMessagePipelines,\n\t\t\t\tfetch: failoverFetch(trackedFetch, state, typeConfig)\n\t\t\t}\n\t\t});\n\t}\n});\n/**\n* Set up the audio `SourceBufferActor` + `SegmentLoaderActor`. Same\n* shape as `setupVideoBufferActors`, narrowed to audio. Today supplies\n* a non-sampling `fetchStream` (no audio ABR); adding audio ABR is a\n* localized change to this setup body (swap `fetchStream` for a\n* `createTrackedFetch` call + declare `bandwidthState` writable here)\n* without touching the shared helper. See\n* `internal/design/spf/features/audio-abr.md` for the design surface\n* (bandwidth-state sharing, multi-writer coordination, EWMA mixed-\n* source sampling).\n*\n* **Mid-stream audio track switching is NOT this behavior's concern.**\n* Slot writes to `selectedAudioTrackId` (default selection, programmatic\n* filter-driven, future ABR) are owned by `switchAudioTrack` / future\n* `switchAudioQuality` in `track-switching.ts`. Flush orchestration on\n* track change is dispatched from there via `audioBufferActor.send(...)`\n* — keeping this setup behavior focused on per-source actor lifecycle.\n*/\nconst setupAudioBufferActors = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedAudioTrackId\"],\n\tcontextKeys: [\n\t\t\"mediaSource\",\n\t\t\"audioBufferActor\",\n\t\t\"audioSegmentLoaderActor\"\n\t],\n\tsetup: ({ state, context, config = {} }) => {\n\t\tconst typeConfig = {\n\t\t\t...AUDIO_TYPE_CONFIG,\n\t\t\t...config\n\t\t};\n\t\treturn setupBufferActors({\n\t\t\tstate,\n\t\t\tcontext,\n\t\t\tconfig: {\n\t\t\t\t...typeConfig,\n\t\t\t\tmessagePipelines: config.audioMessagePipelines,\n\t\t\t\tfetch: failoverFetch(fetchStream, state, typeConfig)\n\t\t\t}\n\t\t});\n\t}\n});\n//#endregion\nexport { setupAudioBufferActors, setupVideoBufferActors };\n\n//# sourceMappingURL=setup-buffer-actors.js.map","import { computed, signal } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../../media/types/index.js\";\nimport { attachMediaSource, createMediaSource, waitForMediaSourceOpen } from \"../../../media/dom/mse/mediasource-setup.js\";\nimport { listen } from \"@videojs/utils/dom\";\n//#region src/playback/behaviors/dom/setup-mediasource.ts\n/**\n* **Own the MediaSource lifecycle for the current source.** When a resolved\n* presentation and a mediaElement are both in scope, creates a MediaSource,\n* attaches it to the element, waits for `'open'`, and publishes it on\n* `context.mediaSource`. On source change or behavior destroy, detaches the\n* MediaSource and clears the slot so the next source starts fresh.\n*\n* Single-positive-state reactor (`'preconditions-unmet'` ↔ `'mediasource-attached'`):\n* state derivation gates on `mediaElement + isResolvedPresentation`. Riding the\n* resolver's resolved/unresolved lifecycle makes direct URL replacement\n* structural — `resolvePresentation` routes the presentation back through\n* unresolved on URL change, which drives this reactor through\n* `'preconditions-unmet'` so the entry's state-exit cleanup detaches the old\n* MediaSource before the new one is built.\n*\n* The entry resolves preconditions in sequence before publishing:\n*\n* 1. **Create + attach** — `createMediaSource` + `attachMediaSource` run\n* synchronously on entry. The `detach` closure returned by\n* `attachMediaSource` is captured for state-exit cleanup, so the cleanup\n* is always bound to its setup even if the wait below is aborted.\n* 2. **Wait for `'open'`** — `waitForMediaSourceOpen` defers until the first\n* `sourceopen` event (or any readyState transition out of `'closed'`).\n* 3. **Publish on `'open'`** — re-check `readyState === 'open'` after the\n* await (covers `'ended'` / `'closed'` race) before writing to\n* `context.mediaSource`. Downstream `setupVideoBufferActors` /\n* `setupAudioBufferActors` call `addSourceBuffer` directly, which\n* throws on non-open, so publish-only-when-open is the load-bearing\n* contract.\n*\n* State-exit cleanup aborts the in-flight wait, detaches the MediaSource,\n* and clears `context.mediaSource`. Order: abort first (prevents a late\n* publish racing the slot clear), then detach, then clear.\n*\n* # Sourceclose recovery\n*\n* The behavior owns one **unclosed** MediaSource per source identity. The UA can\n* close the attached MediaSource out from under the engine (Safari on an\n* AirPlay handoff — see `setupAirPlay` — or a ManagedMediaSource evicted\n* under memory pressure), and a closed MediaSource can never reopen. The\n* `sourceclose` listener tears the attachment down synchronously; every\n* teardown records a local close-fact, which holds the machine out until\n* the fact is consumed — then the re-derive comes back in with a fresh\n* MediaSource for the *same* source. Cause-agnostic. Consumption honors an\n* observed `loadingSuspended` (attaching runs `element.load()` — new loading\n* work, e.g. resource selection under an active AirPlay receiver), and\n* happens only while the machine is out, so a suspension can never tear\n* down an existing attachment.\n*\n* Sole writer of `context.mediaSource`; other MSE behaviors\n* (`setupVideoBufferActors`, `setupAudioBufferActors`,\n* `updateMediaSourceDuration`, `endOfStream`, `loadVideoSegments`) only\n* read.\n*/\nfunction deriveState(presentation, mediaElement, mediaSourceClosed) {\n\tif (!mediaElement || !isResolvedPresentation(presentation)) return \"preconditions-unmet\";\n\tif (mediaSourceClosed) return \"preconditions-unmet\";\n\treturn \"mediasource-attached\";\n}\nfunction setupMediaSourceSetup({ state, context, config = {} }) {\n\tconst attach = config.attachMediaSource ?? attachMediaSource;\n\tconst loadingSuspended = state.loadingSuspended;\n\tconst mediaSourceClosed = signal(false);\n\tconst derivedStateSignal = computed(() => deriveState(state.presentation.get(), context.mediaElement.get(), mediaSourceClosed.get()));\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": { effects: () => {\n\t\t\t\tif (mediaSourceClosed.get() && !loadingSuspended?.get()) mediaSourceClosed.set(false);\n\t\t\t} },\n\t\t\t\"mediasource-attached\": { entry: () => {\n\t\t\t\tconst mediaElement = context.mediaElement.get();\n\t\t\t\tconst controller = new AbortController();\n\t\t\t\tconst mediaSource = createMediaSource({ preferManaged: true });\n\t\t\t\tconst { detach } = attach(mediaSource, mediaElement);\n\t\t\t\tconst teardown = () => {\n\t\t\t\t\tmediaSourceClosed.set(true);\n\t\t\t\t\tcontroller.abort();\n\t\t\t\t\tcontext.mediaSource.set(void 0);\n\t\t\t\t\tdetach({ deferReset: true });\n\t\t\t\t};\n\t\t\t\tlisten(mediaSource, \"sourceclose\", teardown, { signal: controller.signal });\n\t\t\t\tconst publishWhenOpen = async () => {\n\t\t\t\t\tawait waitForMediaSourceOpen(mediaSource, controller.signal);\n\t\t\t\t\tif (controller.signal.aborted) return;\n\t\t\t\t\tif (mediaSource.readyState !== \"open\") {\n\t\t\t\t\t\tconsole.warn(`[setupMediaSource] MediaSource transitioned to '${mediaSource.readyState}' before first 'sourceopen' — slot left unpublished; recoverable on next source reset.`);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcontext.mediaSource.set(mediaSource);\n\t\t\t\t};\n\t\t\t\tpublishWhenOpen().catch((err) => console.error(\"[setupMediaSource] failed to publish MediaSource:\", err));\n\t\t\t\treturn teardown;\n\t\t\t} }\n\t\t}\n\t});\n}\nconst setupMediaSource = defineBehavior({\n\tstateKeys: [\"presentation\"],\n\tcontextKeys: [\"mediaElement\", \"mediaSource\"],\n\tsetup: setupMediaSourceSetup\n});\n//#endregion\nexport { setupMediaSource };\n\n//# sourceMappingURL=setup-mediasource.js.map","import { computed } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { waitForMediaSourceOpen } from \"../../../media/dom/mse/mediasource-setup.js\";\nimport { getMaxBufferedEnd, shouldUpdateDuration, waitForSourceBuffersReady } from \"../../../media/dom/mse/duration.js\";\n//#region src/playback/behaviors/dom/update-mediasource-duration.ts\n/**\n* **Propagate `presentation.duration` to `mediaSource.duration` — exactly\n* once per MediaSource.**\n*\n* Two paths, by whether the presentation is live:\n*\n* - **Live** (`presentation.duration === Infinity`): write `Infinity` once the\n* MediaSource is open and no SourceBuffer is mid-append. No buffered clamp is\n* needed (`Infinity` ≥ any range) and — unlike the finite case — it needn't\n* precede the first append: `Infinity` overrides whatever finite live-edge\n* value an append may have pinned (a finite duration would otherwise stall\n* the stream once the window slides past it). The wait-for-idle is required\n* because the MSE spec forbids setting `duration` while a buffer is\n* `updating`; both waits resolve immediately when already open / idle.\n*\n* - **VoD** (finite): the value is written once, after `mediaSource` is open and\n* all SourceBuffers are idle, clamped to be ≥ the highest buffered range (MSE\n* spec). Written only while `mediaSource.duration` is still `NaN`; once any\n* non-NaN value is present (us on a prior entry, or `endOfStream` from the\n* buffered end), the property is left alone — re-syncing would race\n* concurrent `appendBuffer()` calls.\n*\n* The entry resolves three async preconditions in order before writing:\n*\n* 1. **MediaSource open** — `waitForMediaSourceOpen` defers until the first\n* `sourceopen` event (or any readyState transition, since `'ended'` /\n* `'closed'` mean we've missed the window and should bail).\n* 2. **All SourceBuffers idle** — `waitForSourceBuffersReady` defers per\n* the MSE-spec rule that `duration` cannot be set while any buffer has\n* `updating === true`.\n* 3. **Buffered-range clamp** — `getMaxBufferedEnd` ensures the written\n* duration is at least the highest buffered end (MSE spec disallows\n* a smaller `duration` than any buffered range).\n*\n* The buffer-set helpers operate across `mediaSource.sourceBuffers` (the\n* canonical aggregate), so the behavior composes uniformly across\n* audio-only, video-only, and mixed configurations.\n*\n* Single-positive-state reactor (`'preconditions-unmet'` ↔ `'duration-writable'`):\n* state derivation is purely signal-driven (presentation validity +\n* mediaSource existence). MediaSource lifecycle state (`readyState`) and\n* the `duration` itself are non-signal DOM properties resolved inside the\n* entry's async sequence. The state-exit cleanup aborts the in-flight\n* wait, so source resets and behavior destroy structurally cancel the\n* pending write. A post-await re-check of `mediaSource.readyState ===\n* 'open'` covers the narrow race where `endOfStream()` synchronously\n* transitions readyState to `'ended'` between our `waitForMediaSourceOpen`\n* resolution and the `mediaSource.duration` write.\n*\n* Downstream of `calculatePresentationDuration` (which writes\n* `presentation.duration`); concurrent with `endOfStream` (which may later\n* write `mediaSource.duration` — the \"exactly once\" contract keeps us out\n* of that path).\n*/\nfunction deriveState(presentation, mediaSource) {\n\treturn shouldUpdateDuration(presentation, mediaSource) ? \"duration-writable\" : \"preconditions-unmet\";\n}\nfunction updateMediaSourceDurationSetup({ state, context }) {\n\tconst derivedStateSignal = computed(() => deriveState(state.presentation.get(), context.mediaSource.get()));\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\t\"duration-writable\": { entry: () => {\n\t\t\t\tconst presentation = state.presentation.get();\n\t\t\t\tconst mediaSource = context.mediaSource.get();\n\t\t\t\tif (presentation.duration === Number.POSITIVE_INFINITY) {\n\t\t\t\t\tif (mediaSource.duration === Number.POSITIVE_INFINITY) return;\n\t\t\t\t\tconst controller = new AbortController();\n\t\t\t\t\t(async () => {\n\t\t\t\t\t\tawait waitForMediaSourceOpen(mediaSource, controller.signal);\n\t\t\t\t\t\tif (controller.signal.aborted || mediaSource.readyState !== \"open\") return;\n\t\t\t\t\t\tawait waitForSourceBuffersReady(mediaSource.sourceBuffers, controller.signal);\n\t\t\t\t\t\tif (controller.signal.aborted || mediaSource.readyState !== \"open\") return;\n\t\t\t\t\t\tif (mediaSource.duration !== Number.POSITIVE_INFINITY) mediaSource.duration = Number.POSITIVE_INFINITY;\n\t\t\t\t\t})();\n\t\t\t\t\treturn () => controller.abort();\n\t\t\t\t}\n\t\t\t\tif (!Number.isNaN(mediaSource.duration)) return;\n\t\t\t\tconst controller = new AbortController();\n\t\t\t\tconst writeWhenReady = async () => {\n\t\t\t\t\tawait waitForMediaSourceOpen(mediaSource, controller.signal);\n\t\t\t\t\tif (controller.signal.aborted) return;\n\t\t\t\t\tif (mediaSource.readyState !== \"open\") return;\n\t\t\t\t\tawait waitForSourceBuffersReady(mediaSource.sourceBuffers, controller.signal);\n\t\t\t\t\tif (controller.signal.aborted) return;\n\t\t\t\t\tif (mediaSource.readyState !== \"open\") return;\n\t\t\t\t\tconst maxBufferedEnd = getMaxBufferedEnd(mediaSource.sourceBuffers);\n\t\t\t\t\tconst duration = maxBufferedEnd > presentation.duration ? maxBufferedEnd : presentation.duration;\n\t\t\t\t\tmediaSource.duration = duration;\n\t\t\t\t};\n\t\t\t\twriteWhenReady();\n\t\t\t\treturn () => controller.abort();\n\t\t\t} }\n\t\t}\n\t});\n}\nconst updateMediaSourceDuration = defineBehavior({\n\tstateKeys: [\"presentation\"],\n\tcontextKeys: [\"mediaSource\"],\n\tsetup: updateMediaSourceDurationSetup\n});\n//#endregion\nexport { updateMediaSourceDuration };\n\n//# sourceMappingURL=update-mediasource-duration.js.map","//#region src/media/utils/preload.ts\nfunction isStandardPreload(value) {\n\treturn value === \"auto\" || value === \"metadata\" || value === \"none\";\n}\n/**\n* Default `preload` value used as the fallback across behaviors\n* (`syncPreload`, `resolvePresentation`, `isBlockingPreload`). Matches the\n* `<video>`/`<audio>` element's implicit default.\n*/\nconst DEFAULT_PRELOAD = \"metadata\";\n/**\n* True when the preload value blocks initial resolution / loading.\n* Falsy values (undefined, empty) fall back to `defaultPreload` (default\n* `DEFAULT_PRELOAD`); the resolved value blocks iff it is `'none'`.\n*/\nfunction isBlockingPreload(preload, defaultPreload = DEFAULT_PRELOAD) {\n\treturn (preload || defaultPreload) === \"none\";\n}\n//#endregion\nexport { DEFAULT_PRELOAD, isBlockingPreload, isStandardPreload };\n\n//# sourceMappingURL=preload.js.map","import { computed } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../media/types/index.js\";\nimport { fetchResolvable, getResponseText } from \"../../network/fetch.js\";\nimport { isBlockingPreload } from \"../../media/utils/preload.js\";\n//#region src/playback/behaviors/resolve-presentation.ts\n/**\n* **Resolve an unresolved presentation by fetching and parsing its manifest.**\n*\n* Reads `state.presentation`; when it holds `{ url }` (unresolved) and the\n* preload / load-activation gate is met, fetches the manifest, parses it via\n* the **required** `config.parsePresentation`, and writes the resolved\n* `Presentation` back to the same slot. The behavior is format-neutral: the\n* composing engine wires in its parser (e.g. the HLS engine supplies the\n* multivariant-playlist parser).\n*\n* Source-identity-driven, expressed as a 4-state machine:\n*\n* ```\n* 'preconditions-unmet' → 'idle' → 'resolving' → 'resolved'\n* ```\n*\n* - `'preconditions-unmet'`: no presentation, or presentation has no URL.\n* - `'idle'`: URL present, unresolved, gate unmet (blocking preload + no\n* load-activation). Waits for the gate to open.\n* - `'resolving'`: URL present, unresolved, gate met. Entry starts the fetch\n* and returns the AbortController — the reactor calls `.abort()` on state\n* exit, so source change / gate-close / destroy all cancel cleanly.\n* - `'resolved'`: `state.presentation` holds a resolved `Presentation`.\n*\n* Gate semantics: `state.preload` (or `config.defaultPreload`, default\n* `'metadata'`, when state.preload is unset) blocks resolution when its\n* value is `'none'` (see `isBlockingPreload` in `media/utils/preload`).\n* `state.loadActivated` is an override — true bypasses the preload gate\n* entirely.\n*\n* Multi-writer with the engine adapter, which writes the initial unresolved\n* `{ url }` to `state.presentation` from src input. Different domains\n* (config-input vs. derived state via fetch) — legitimate multi-writer.\n*/\nfunction deriveState(presentation, preload, loadActivated, defaultPreload) {\n\tif (!presentation?.url) return \"preconditions-unmet\";\n\tif (isResolvedPresentation(presentation)) return \"resolved\";\n\treturn !!loadActivated || !isBlockingPreload(preload, defaultPreload) ? \"resolving\" : \"idle\";\n}\nfunction resolvePresentationSetup({ state, config }) {\n\tconst { parsePresentation } = config;\n\tconst defaultPreload = config.defaultPreload ?? \"metadata\";\n\tconst derivedStateSignal = computed(() => deriveState(state.presentation.get(), state.preload.get(), state.loadActivated.get(), defaultPreload));\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\tidle: {},\n\t\t\tresolving: { entry: () => {\n\t\t\t\tconst presentation = state.presentation.get();\n\t\t\t\tconst ac = new AbortController();\n\t\t\t\tfetchResolvable(presentation, { signal: ac.signal }).then((response) => getResponseText(response)).then((text) => {\n\t\t\t\t\tconst parsed = parsePresentation(text, presentation);\n\t\t\t\t\tstate.presentation.set(parsed);\n\t\t\t\t}).catch((error) => {\n\t\t\t\t\tif (error instanceof Error && error.name === \"AbortError\") return;\n\t\t\t\t\tconsole.error(\"[resolvePresentation] manifest fetch/parse failed:\", error);\n\t\t\t\t});\n\t\t\t\treturn ac;\n\t\t\t} },\n\t\t\tresolved: {}\n\t\t}\n\t});\n}\nconst resolvePresentation = defineBehavior({\n\tstateKeys: [\n\t\t\"presentation\",\n\t\t\"preload\",\n\t\t\"loadActivated\"\n\t],\n\tcontextKeys: [],\n\tsetup: resolvePresentationSetup\n});\n//#endregion\nexport { resolvePresentation };\n\n//# sourceMappingURL=resolve-presentation.js.map","import { effect } from \"./effect.js\";\n//#region src/core/signals/when.ts\n/**\n* Resolve once `condition` returns true. The condition is a tracked read — it\n* re-evaluates whenever a signal it read changes — so this is the promise\n* bridge from signal space into async task bodies (await a state condition\n* mid-task without polling).\n*\n* Settles synchronously when the condition already holds. Rejects with the\n* abort reason when `signal` aborts first (an already-aborted signal rejects\n* without evaluating the condition), so a task awaiting a condition dies with\n* its runner instead of leaking the subscription.\n*/\nfunction when(condition, options = {}) {\n\tconst { signal } = options;\n\tif (signal?.aborted) return Promise.reject(signal.reason);\n\treturn new Promise((resolve, reject) => {\n\t\tlet settled = false;\n\t\tconst settle = (complete) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tcomplete();\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\t\tstop();\n\t\t\t});\n\t\t};\n\t\tconst onAbort = () => settle(() => reject(signal?.reason));\n\t\tsignal?.addEventListener(\"abort\", onAbort, { once: true });\n\t\tconst stop = effect(() => {\n\t\t\tif (!settled && condition()) settle(resolve);\n\t\t});\n\t});\n}\n//#endregion\nexport { when };\n\n//# sourceMappingURL=when.js.map","import { computed, peek, update } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { RecurringRunner, Task, runOnce } from \"../../core/tasks/task.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { deriveStreamType, getMediaPlaylistMetadata, isResolvedPresentation, isResolvedTrack } from \"../../media/types/index.js\";\nimport { applyContainerMimeType, findTrack, updateTrackInPresentation } from \"../../media/utils/tracks.js\";\nimport { AUDIO_TYPE_CONFIG, TEXT_TYPE_CONFIG, VIDEO_TYPE_CONFIG } from \"../primitives/track-types.js\";\nimport { NON_FMP4_CONTAINER_MIMES, parseMediaPlaylist } from \"../../media/hls/parse-media-playlist.js\";\nimport { emitError } from \"./collect-errors.js\";\nimport { fetchResolvableText } from \"../../network/fetch.js\";\nimport { failoverFetch } from \"../primitives/failover-fetch.js\";\nimport { when } from \"../../core/signals/when.js\";\n//#region src/playback/behaviors/resolve-track.ts\nfunction setupTrackResolution({ state, config: { selectedKey, findTrackToResolve, fetchResolvableText: fetchResolvableText$1 = fetchResolvableText, gateFirstParse, reschedule, reportUnsupportedTrackConditions } }) {\n\tconst runner = new RecurringRunner(reschedule ?? runOnce);\n\tconst derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? \"presentation-resolved\" : \"presentation-unresolved\");\n\treturn createMachineReactor({\n\t\tinitial: \"presentation-unresolved\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"presentation-unresolved\": {},\n\t\t\t\"presentation-resolved\": {\n\t\t\t\tentry: () => () => runner.abortAll(),\n\t\t\t\teffects: [() => {\n\t\t\t\t\tconst presentation = peek(state.presentation);\n\t\t\t\t\tconst trackId = state[selectedKey].get();\n\t\t\t\t\tif (!presentation || !trackId) return;\n\t\t\t\t\tconst track = findTrackToResolve(presentation, trackId);\n\t\t\t\t\tif (!track || isResolvedTrack(track) && Number.isFinite(track.duration)) return;\n\t\t\t\t\trunner.schedule(new Task(async (signal) => {\n\t\t\t\t\t\tconst snapshot = peek(state.presentation);\n\t\t\t\t\t\tconst current = snapshot ? findTrackToResolve(snapshot, trackId) : void 0;\n\t\t\t\t\t\tif (!current) throw new Error(\"resolve-track: selected track not found\");\n\t\t\t\t\t\tconst text = await fetchResolvableText$1(current, { signal });\n\t\t\t\t\t\tif (gateFirstParse && !isResolvedTrack(current)) {\n\t\t\t\t\t\t\tconst { selectedVideoTrackId, selectedAudioTrackId } = state;\n\t\t\t\t\t\t\tawait when(() => gateFirstParse(state.presentation.get(), {\n\t\t\t\t\t\t\t\tselectedVideoTrackId: selectedVideoTrackId?.get(),\n\t\t\t\t\t\t\t\tselectedAudioTrackId: selectedAudioTrackId?.get()\n\t\t\t\t\t\t\t}, trackId), { signal });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst live = peek(state.presentation);\n\t\t\t\t\t\tconst previous = live ? findTrackToResolve(live, trackId) : void 0;\n\t\t\t\t\t\tif (!previous) throw new Error(\"resolve-track: selected track not found\");\n\t\t\t\t\t\tconst mediaTrack = parseMediaPlaylist(text, previous);\n\t\t\t\t\t\tif (reportUnsupportedTrackConditions) for (const condition of reportUnsupportedTrackConditions(mediaTrack)) emitError(state, condition);\n\t\t\t\t\t\tupdate(state.presentation, (current) => {\n\t\t\t\t\t\t\tif (!isResolvedPresentation(current)) return current;\n\t\t\t\t\t\t\tconst patched = updateTrackInPresentation(current, mediaTrack);\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...NON_FMP4_CONTAINER_MIMES.has(mediaTrack.mimeType) ? applyContainerMimeType(patched, mediaTrack.type, mediaTrack.mimeType) : patched,\n\t\t\t\t\t\t\t\tstreamType: deriveStreamType(getMediaPlaylistMetadata(mediaTrack))\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn mediaTrack;\n\t\t\t\t\t}, { id: track.id })).catch(() => {});\n\t\t\t\t}]\n\t\t\t}\n\t\t}\n\t});\n}\nconst VIDEO_TRACK_RESOLUTION_CONFIG = {\n\t...VIDEO_TYPE_CONFIG,\n\tfindTrackToResolve: (presentation, trackId) => findTrack(presentation, \"video\", trackId)\n};\nconst AUDIO_TRACK_RESOLUTION_CONFIG = {\n\t...AUDIO_TYPE_CONFIG,\n\tfindTrackToResolve: (presentation, trackId) => findTrack(presentation, \"audio\", trackId)\n};\nconst TEXT_TRACK_RESOLUTION_CONFIG = {\n\t...TEXT_TYPE_CONFIG,\n\tfindTrackToResolve: (presentation, trackId) => findTrack(presentation, \"text\", trackId)\n};\n/**\n* Resolve unresolved video tracks. Schedules a fetch task whenever the\n* selected video track is partially resolved, parses the manifest, and\n* writes the resolved track back into `state.presentation`.\n*/\nconst resolveVideoTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedVideoTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config = {} }) => {\n\t\tconst trackConfig = {\n\t\t\t...VIDEO_TRACK_RESOLUTION_CONFIG,\n\t\t\t...config\n\t\t};\n\t\treturn setupTrackResolution({\n\t\t\tstate,\n\t\t\tconfig: {\n\t\t\t\t...trackConfig,\n\t\t\t\tfetchResolvableText: failoverFetch(fetchResolvableText, state, trackConfig)\n\t\t\t}\n\t\t});\n\t}\n});\n/**\n* Resolve unresolved audio tracks. Same shape as `resolveVideoTrack`,\n* narrowed to audio.\n*/\nconst resolveAudioTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedAudioTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config = {} }) => {\n\t\tconst trackConfig = {\n\t\t\t...AUDIO_TRACK_RESOLUTION_CONFIG,\n\t\t\t...config\n\t\t};\n\t\treturn setupTrackResolution({\n\t\t\tstate,\n\t\t\tconfig: {\n\t\t\t\t...trackConfig,\n\t\t\t\tfetchResolvableText: failoverFetch(fetchResolvableText, state, trackConfig)\n\t\t\t}\n\t\t});\n\t}\n});\n/**\n* Resolve unresolved text tracks. Same shape as `resolveVideoTrack`,\n* narrowed to text.\n*/\nconst resolveTextTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedTextTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config = {} }) => {\n\t\tconst trackConfig = {\n\t\t\t...TEXT_TRACK_RESOLUTION_CONFIG,\n\t\t\t...config\n\t\t};\n\t\treturn setupTrackResolution({\n\t\t\tstate,\n\t\t\tconfig: {\n\t\t\t\t...trackConfig,\n\t\t\t\tfetchResolvableText: failoverFetch(fetchResolvableText, state, trackConfig)\n\t\t\t}\n\t\t});\n\t}\n});\n//#endregion\nexport { resolveAudioTrack, resolveTextTrack, resolveVideoTrack };\n\n//# sourceMappingURL=resolve-track.js.map","//#region src/media/primitives/select-tracks.ts\n/**\n* Test whether a track matches a partial-track description: every present,\n* defined field of `filter` equals the track's. Absent or `undefined` filter\n* fields don't constrain. Used to narrow candidates by a user selection\n* (`{ id }`, `{ language }`, `{ height }`, …).\n*\n* @param track - The track to test\n* @param filter - Partial-track description; only present, defined fields constrain\n* @returns `true` when the track matches every constraining field\n*/\nfunction matchesPartialTrack(track, filter) {\n\tfor (const key in filter) {\n\t\tconst filterValue = filter[key];\n\t\tif (filterValue !== void 0 && track[key] !== filterValue) return false;\n\t}\n\treturn true;\n}\n/** Missing dimensions are treated as area `0`, so a track without them ranks last. */\nfunction pixelArea(track) {\n\treturn (track.width ?? 0) * (track.height ?? 0);\n}\n/**\n* Narrow to the tracks at or below `maxPixelArea`, and nothing else: no ordering,\n* no fallback. Survivors keep their incoming order, and an empty result is a real\n* answer — \"none of these fit\".\n*\n* Deliberately only the filter, because as a selection rule this composes under\n* `applyRules`, which already owns both halves a caller might expect here: an empty\n* result is skipped, so a preference can never narrow the candidate set to nothing;\n* and ordering the survivors is a separate rule's job\n* ({@link byDescendingResolution}, bandwidth ABR). Doing either here would duplicate\n* the composer and give one rule two responsibilities.\n*/\nfunction tracksUnderPixelArea(tracks, maxPixelArea = Number.POSITIVE_INFINITY) {\n\treturn tracks.filter((track) => pixelArea(track) <= maxPixelArea);\n}\n/**\n* Compare two tracks by resolution, largest first, with bandwidth as the tiebreak\n* for renditions of identical dimensions. Missing dimensions are treated as area\n* `0`, so a track without them sorts last.\n*\n* A comparator rather than a \"highest track\" function: the selection-rule chain\n* takes the head of the list it produces, so ranking never has to collapse to a\n* single track. `preferHighestResolution` is `sort` over this and nothing more.\n*/\nfunction byDescendingResolution(a, b) {\n\treturn pixelArea(b) - pixelArea(a) || (b.bandwidth ?? 0) - (a.bandwidth ?? 0);\n}\n/**\n* Default audio policy over a candidate list: the three-tier pick a selection-rule\n* chain applies once it has narrowed the candidates.\n*\n* Priority: `preferredAudioLanguage` match → `DEFAULT=YES` → first track.\n*/\nfunction pickAudioTrackFromTracks(tracks, config) {\n\tif (config?.preferredAudioLanguage) {\n\t\tconst languageMatch = tracks.find((track) => track.language === config.preferredAudioLanguage);\n\t\tif (languageMatch) return languageMatch.id;\n\t}\n\tconst defaultTrack = tracks.find((track) => track.default === true);\n\tif (defaultTrack) return defaultTrack.id;\n\treturn tracks[0]?.id;\n}\n/**\n* Default text-track policy over a candidate list: the opt-in three-tier pick\n* `switchTextTrack`'s terminal applies once it has narrowed the renditions to the\n* constrained, CDN-scoped set.\n*\n* Priority: `preferredSubtitleLanguage` match → `DEFAULT=YES + AUTOSELECT=YES`\n* (only when `enableDefaultTrack`) → `undefined` (opt-in). FORCED tracks are\n* excluded unless `includeForcedTracks` (Apple-spec: a regular track must carry\n* forced content when both exist, so a forced-only track is redundant).\n*/\nfunction pickTextTrackFromTracks(tracks, config) {\n\tconst availableTracks = config?.includeForcedTracks ? tracks : tracks.filter((track) => !track.forced);\n\tif (availableTracks.length === 0) return void 0;\n\tconst { preferredSubtitleLanguage, enableDefaultTrack = false } = config ?? {};\n\tif (preferredSubtitleLanguage) {\n\t\tconst languageMatch = availableTracks.find((track) => track.language === preferredSubtitleLanguage);\n\t\tif (languageMatch) return languageMatch.id;\n\t}\n\tif (enableDefaultTrack) {\n\t\tconst defaultTrack = availableTracks.find((track) => track.default === true);\n\t\tif (defaultTrack) return defaultTrack.id;\n\t}\n}\n//#endregion\nexport { byDescendingResolution, matchesPartialTrack, pickAudioTrackFromTracks, pickTextTrackFromTracks, tracksUnderPixelArea };\n\n//# sourceMappingURL=select-tracks.js.map","//#region src/playback/primitives/selection-rules.ts\n/**\n* Apply rules to a candidate list in order; the pick is the first survivor.\n* Two responsibilities the rules don't carry: a rule that returns nothing is\n* skipped (fall-through — a preference never empties the set), and once one\n* survivor remains the chain stops (early-bail — later rules, including the\n* bandwidth ranker, never run, so the effect doesn't subscribe to their\n* signals while the choice is fixed).\n*\n* @param rules - Rules to apply, most authoritative first\n* @param tracks - Candidate tracks\n* @param deps - The behavior's `{ state, context, config }`, passed through to each rule\n* @returns The surviving candidates, pick first\n*/\nfunction applyRules(rules, tracks, deps) {\n\tlet current = tracks;\n\tfor (const rule of rules) {\n\t\tconst remaining = rule(current, deps);\n\t\tif (remaining.length === 0) continue;\n\t\tcurrent = remaining;\n\t\tif (current.length === 1) break;\n\t}\n\treturn current;\n}\n/**\n* Apply hard constraints to a candidate list — the pre-pass that runs before the\n* rule chain. A constraint shares a rule's signature but its exclusion is\n* *hard*: it removes the unplayable (a codec the environment can't decode, a CDN\n* in failover cooldown) and a removed track is never attempted. Unlike\n* `applyRules`, this never skips an empty result and never early-bails — every\n* constraint always applies, and an empty survivor set is a real outcome\n* (\"nothing playable here\"), not a fall-through. Because each constraint only\n* removes, the order they run in can't change the result.\n*\n* @param constraints - Constraints to apply (pooled, order-independent)\n* @param tracks - Candidate tracks\n* @param deps - The behavior's `{ state, context, config }`, passed to each constraint\n* @returns The playable survivors (possibly empty)\n*/\nfunction applyConstraints(constraints, tracks, deps) {\n\tlet current = tracks;\n\tfor (const constraint of constraints) current = constraint(current, deps);\n\treturn current;\n}\n/**\n* Whether two candidate sets hold the same tracks, by id.\n*\n* The `equals` both selection behaviors give their candidate-set `computed`. A\n* live playlist refresh swaps in a new presentation object carrying the same\n* variants, and a constraint's own inputs can churn without changing which\n* tracks survive; in both cases the set is unchanged and the reaction must not\n* re-fire. Compares by id rather than array identity for exactly that.\n*/\nfunction sameCandidateSet(a, b) {\n\treturn a.length === b.length && a.every((track) => b.some((other) => other.id === track.id));\n}\n/**\n* Capability constraint — a *hard* filter for the {@link applyConstraints}\n* pre-pass. Removes renditions this environment can't decode, probed via the\n* injected `canPlayTrack` (codec → `MediaSource.isTypeSupported`, plus the\n* container and encryption assertions that probe can't make). Constraining here\n* — before selection — means an unplayable variant is pruned upstream and never\n* picked, instead of surviving into the pipeline to fail late at\n* `createSourceBuffer`. That late throw stays as a defensive structural\n* guarantee; with this constraint it should rarely fire.\n*\n* Lives here rather than beside `switchVideoTrack` for the reason this module\n* exists: both the re-evaluating variant and the pinned `selectVideoTrack` apply\n* it, and reaching it through `behaviors/track-switching.ts` would drag the ABR\n* path into a composition that deliberately omits it.\n*\n* Passes everything through when there's no probe (a composition that didn't\n* wire one, or DOM-free tests). When it prunes *every* track, the empty result is\n* preserved (per `applyConstraints`) — \"nothing playable\" — which each consuming\n* behavior answers by clearing its selection and reporting the type's verdict.\n*/\nfunction excludeUnplayableTracks(tracks, { config }) {\n\tconst canPlay = config?.canPlayTrack;\n\tif (!canPlay) return tracks;\n\treturn tracks.filter((track) => canPlay(track));\n}\n//#endregion\nexport { applyConstraints, applyRules, excludeUnplayableTracks, sameCandidateSet };\n\n//# sourceMappingURL=selection-rules.js.map","import { getMediaPlaylistMetadata } from \"../../media/types/index.js\";\nimport { SVTA_UNSUPPORTED_AUDIO_FORMAT, SVTA_UNSUPPORTED_DRM_SYSTEM, SVTA_UNSUPPORTED_VIDEO_FORMAT } from \"../../media/errors.js\";\nimport { NON_FMP4_CONTAINER_MIMES } from \"../../media/hls/parse-media-playlist.js\";\n//#region src/playback/primitives/report-track-conditions.ts\n/**\n* The seam `resolve-track` uses to report conditions discovered in a freshly\n* parsed media playlist.\n*\n* Injected rather than baked in so `resolve-track` stays free of format and\n* policy knowledge: it parses and commits, and whatever the composition wants\n* noticed about the result is this function's business. Which conditions matter,\n* and which codes they carry, therefore vary per composition — a provider that\n* never ships MPEG-TS can drop that check, and future playlist-derived notices\n* (LL-HLS or DVR support that's partial rather than absent) attach here without\n* touching the resolver.\n*\n* Reported **per rendition, as it resolves**, which is why these are causes and\n* not verdicts: one rendition being unplayable doesn't make the source\n* unplayable. The verdict is `track-switching`'s, which reports\n* `SVTA_NO_SUPPORTED_{VIDEO,AUDIO}_TRACK` when a type's candidates actually\n* empty. Keeping the two apart is what lets a mixed source — some renditions\n* encrypted or MPEG-TS, others playable — log its causes and still play.\n*/\n/** Unsupported-format code per type; text has none — absent captions aren't a failure. */\nconst UNSUPPORTED_FORMAT_CODE = {\n\tvideo: SVTA_UNSUPPORTED_VIDEO_FORMAT,\n\taudio: SVTA_UNSUPPORTED_AUDIO_FORMAT\n};\n/**\n* The types a reported cause can legitimately describe: the ones whose candidates\n* `canPlayTrack` actually prunes, via `track-switching`'s `excludeUnplayableTracks`\n* pre-pass.\n*\n* Text is outside it by design — its switching chain runs failed-CDN constraints\n* alone, because an MSE codec probe is the wrong question for a WebVTT rendition\n* (see `track-switching.ts`). So nothing prunes a text rendition, no verdict can\n* follow from one, and a cause reported against it would be an orphan: the\n* adapter's unsupported-feature substitution scans the sequence as a whole, so a\n* lone encrypted subtitle would otherwise recode an unrelated verdict — an\n* all-CDN cooldown among them — as \"this engine can't play the source\".\n*/\nconst CAPABILITY_PRUNED_TYPES = /* @__PURE__ */ new Set([\"video\", \"audio\"]);\n/**\n* The default: report what makes a rendition unplayable *to this engine* — a\n* container MSE can't accept, or encryption with no decryption pipeline. Both\n* mirror what `canPlayTrack` prunes on, so a reported cause always has a\n* corresponding exclusion.\n*\n* A condition carries its code and its context, not copy. `data.mimeType` is\n* what preserves the specificity — the format codes cover every non-fMP4\n* container, so \"which one\" lives there for a consumer that wants to say, rather\n* than being flattened into an English sentence here.\n*\n* Both carry `trackType`, redundantly for the format codes (1004/1005 are\n* already per type) but not for 4008, which isn't per type — SVTA has one\n* content-protection code for both. Nothing branches on the tag: it's diagnostic\n* context, reaching a developer through the logged sequence and `error.data`,\n* which is why it goes on every condition rather than only where the code can't\n* carry it. `trackId` alongside it is what distinguishes two renditions of the\n* same type.\n*/\nfunction reportUnsupportedTrackConditions(track) {\n\tif (!CAPABILITY_PRUNED_TYPES.has(track.type)) return [];\n\tconst conditions = [];\n\tconst data = {\n\t\ttrackType: track.type,\n\t\ttrackId: track.id\n\t};\n\tconst formatCode = UNSUPPORTED_FORMAT_CODE[track.type];\n\tif (formatCode !== void 0 && NON_FMP4_CONTAINER_MIMES.has(track.mimeType)) conditions.push({\n\t\tcode: formatCode,\n\t\tdata: {\n\t\t\t...data,\n\t\t\tmimeType: track.mimeType\n\t\t}\n\t});\n\tif (getMediaPlaylistMetadata(track)?.encrypted) conditions.push({\n\t\tcode: SVTA_UNSUPPORTED_DRM_SYSTEM,\n\t\tdata\n\t});\n\treturn conditions;\n}\n//#endregion\nexport { reportUnsupportedTrackConditions };\n\n//# sourceMappingURL=report-track-conditions.js.map","//#region src/playback/primitives/error-messages.ts\n/**\n* Developer-facing copy for what this engine reports.\n*\n* Everything here reaches a **console**, never a viewer. Viewer-facing copy for\n* a fatal condition is the presentation layer's to compose: the engine reports a\n* code, and a consumer maps that code to localized text it owns.\n*\n* Plain string constants, one export each. Nothing is parameterized — a message\n* that names the engine has to be built at the call site from state the engine\n* carries around solely to say it, which is a lot of plumbing for a console\n* prefix. Separate exports rather than one object so a composition that logs\n* neither notice doesn't carry their bytes.\n*/\n/**\n* Logged when a fatal `SVTA_UNSUPPORTED_PLAYBACK_FEATURE` is surfaced.\n*\n* The developer's half of that event; the viewer gets the localized copy the\n* code maps to. One sentence is enough because the specifics — which container,\n* which rendition, whether it was DRM — stay structured on the reported\n* conditions logged beside it.\n*/\nconst UNSUPPORTED_PLAYBACK_FEATURE_MESSAGE = \"Can't play this source: it requires an unsupported playback feature.\";\n/**\n* Logged for **any** fatal condition, by a composition whose failures don't all\n* reduce to a missing feature.\n*\n* The background variant is the case: it treats a per-rendition cause as fatal on\n* its own, so what reaches its surface can be an unsupported container, DRM it\n* can't decrypt, or a source carrying no video at all. Naming one feature would be\n* wrong for the last of those, so all three are named broadly. Deferring the *why*\n* to the conditions instead would promise prose they don't carry — an `SvtaError`\n* is a code and its context, and nothing on this path sets `message`.\n*/\nconst UNPLAYABLE_SOURCE_MESSAGE = \"Can't play this source — unsupported container, encryption, or no usable video track.\";\n/**\n* LL-HLS delivery, played as standard live. The parser ignores partial segments\n* and the loader fetches whole ones, so latency lands wherever `HOLD-BACK` puts\n* it — the stream plays, just not at the latency it was published for.\n*/\nconst LOW_LATENCY_UNSUPPORTED_MESSAGE = \"Low-Latency HLS is unsupported; playing as standard live at higher latency.\";\n/**\n* `#EXT-X-PLAYLIST-TYPE:EVENT` — a growing window, which is how DVR is\n* delivered. It plays, but the seekable-range and live-edge handling for it is\n* newer and less exercised than sliding-window live.\n*/\nconst DVR_EXPERIMENTAL_MESSAGE = \"DVR support for EVENT playlists is experimental.\";\n//#endregion\nexport { DVR_EXPERIMENTAL_MESSAGE, LOW_LATENCY_UNSUPPORTED_MESSAGE, UNPLAYABLE_SOURCE_MESSAGE, UNSUPPORTED_PLAYBACK_FEATURE_MESSAGE };\n\n//# sourceMappingURL=error-messages.js.map","import { SVTA_UNSUPPORTED_AUDIO_FORMAT, SVTA_UNSUPPORTED_DRM_SYSTEM, SVTA_UNSUPPORTED_VIDEO_FORMAT } from \"../../../media/errors.js\";\n//#region src/playback/adapters/hls-video/error-surface.ts\n/**\n* `message`, plus the alternative-Media sentence when `media`'s class names one.\n*\n* Read off the class rather than passed in so a subclass can point at a\n* better-equipped sibling — the SPF Mux Medias name the hls.js-backed one, which\n* plays the MPEG-TS and DRM sources SPF doesn't — without either adapter knowing\n* that sibling exists.\n*/\nfunction withAlternativeMediaSuggestion(message, media) {\n\tconst { alternativeMediaSuggestion } = media.constructor;\n\tconst suggestion = alternativeMediaSuggestion?.trim();\n\treturn suggestion ? `${message} ${suggestion}` : message;\n}\n/** The first condition `fatalCodes` covers — the root cause, not its consequences. */\nfunction firstFatal(errors, fatalCodes) {\n\treturn errors?.find((error) => fatalCodes.has(error.code));\n}\n/**\n* The causes that mean the engine has no pipeline for what the source delivers —\n* a container it can't append, or encryption it can't decrypt.\n*\n* What these have in common is that no retry, no other CDN, and no other\n* rendition of the same source fixes them: the source needs a capability this\n* engine doesn't have. That's the distinction the surfaced code exists to draw,\n* and it's why the set is these three rather than \"every cause\".\n*/\nconst UNSUPPORTED_FEATURE_CAUSES = /* @__PURE__ */ new Set([\n\tSVTA_UNSUPPORTED_VIDEO_FORMAT,\n\tSVTA_UNSUPPORTED_AUDIO_FORMAT,\n\tSVTA_UNSUPPORTED_DRM_SYSTEM\n]);\n/**\n* Whether anything in the sequence is a cause of the \"we don't implement this\"\n* kind.\n*\n* Deliberately `some` over the whole sequence rather than a per-type match\n* against the verdict. A verdict means one type's candidates emptied, but the\n* *reason* the source is unplayable can sit on another type — an audio-only\n* source whose sole rendition is encrypted empties the audio candidates, and a\n* video source with encrypted video empties the video ones. Both are the same\n* answer to the viewer, so both get the same code.\n*/\nfunction hasUnsupportedFeatureCause(errors) {\n\treturn errors?.some((error) => UNSUPPORTED_FEATURE_CAUSES.has(error.code)) ?? false;\n}\n//#endregion\nexport { firstFatal, hasUnsupportedFeatureCause, withAlternativeMediaSuggestion };\n\n//# sourceMappingURL=error-surface.js.map"],"x_google_ignoreList":[1],"mappings":";;;;;;;;;;;;;AASA,SAAS,aAAa;CACrB,OAAO,GAAG,KAAK,IAAI,EAAE,GAAG,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG;AACvD;;;;ACXA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,KAAK,KAAK,UAAU,OAAO,MAAM,UAAU,KAAK,KAAK;CAAE,YAAY;CAAM,cAAc;CAAM,UAAU;CAAM;AAAM,CAAC,IAAI,IAAI,OAAO;AAC1J,IAAI,iBAAiB,KAAK,KAAK,UAAU;CACvC,gBAAgB,KAAK,OAAO,QAAQ,WAAW,MAAM,KAAK,KAAK,KAAK;CACpE,OAAO;AACT;AACA,IAAI,iBAAiB,KAAK,QAAQ,QAAQ;CACxC,IAAI,CAAC,OAAO,IAAI,GAAG,GACjB,MAAM,UAAU,YAAY,GAAG;AACnC;AACA,IAAI,eAAe,QAAQ,QAAQ;CACjC,IAAI,OAAO,GAAG,MAAM,KAClB,MAAM,UAAU,8CAA4C;CAC9D,OAAO,OAAO,IAAI,GAAG;AACvB;AACA,IAAI,gBAAgB,KAAK,QAAQ,UAAU;CACzC,IAAI,OAAO,IAAI,GAAG,GAChB,MAAM,UAAU,mDAAmD;CACrE,kBAAkB,UAAU,OAAO,IAAI,GAAG,IAAI,OAAO,IAAI,KAAK,KAAK;AACrE;AACA,IAAI,mBAAmB,KAAK,QAAQ,WAAW;CAC7C,cAAc,KAAK,QAAQ,uBAAuB;CAClD,OAAO;AACT;;;;;;;;AAQA,SAAS,cAAc,GAAG,GAAG;CAC3B,OAAO,OAAO,GAAG,GAAG,CAAC;AACvB;;;;;;;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