hyperframes 0.9.52 → 0.9.54

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 (310) hide show
  1. package/dist/{add-Z6G2DLNE.js → add-OVHVUHQR.js} +26 -21
  2. package/dist/{agentPromptGenerator-RCTC2XXL.js → agentPromptGenerator-L2B3HMHF.js} +16 -21
  3. package/dist/{animatedGifPrep-X7KILCDI.js → animatedGifPrep-YMJH33FX.js} +19 -20
  4. package/dist/api.js +52 -51
  5. package/dist/{appHistory-DK2XI4EZ.js → appHistory-T3ZLA7QN.js} +4 -3
  6. package/dist/{asset-A3ENWWCU.js → asset-ORCN4EVH.js} +2 -2
  7. package/dist/{assetCataloger-TIMZTOYH.js → assetCataloger-X23VB66T.js} +17 -17
  8. package/dist/{audio-HMCUO2CV.js → audio-NHNXBUI2.js} +103 -74
  9. package/dist/{auth-NXR3QM4C.js → auth-DQDDXQFC.js} +5 -5
  10. package/dist/{autoUpdate-TY7P2Z4F.js → autoUpdate-LF7BJN34.js} +4 -2
  11. package/dist/{avatars-36MYJUPA.js → avatars-KFUMWRVX.js} +23 -21
  12. package/dist/{backgroundChecks-EWWJEGF6.js → backgroundChecks-Y6RHADW6.js} +5 -3
  13. package/dist/backgroundChecksWorker.js +5 -4
  14. package/dist/{batchRender-VKM4E7PI.js → batchRender-CMG4SVBX.js} +27 -8
  15. package/dist/{beats-Z4B4B4KM.js → beats-JXZBK7JI.js} +17 -17
  16. package/dist/{benchmark-PLGO2THH.js → benchmark-CLU6JUGY.js} +34 -16
  17. package/dist/{billing-ZIXACCLR.js → billing-5GMYFDMC.js} +23 -22
  18. package/dist/{browser-VZFBNASB.js → browser-S4R6LZMF.js} +13 -13
  19. package/dist/{bundleWithLocalizedFonts-XD2XDEQL.js → bundleWithLocalizedFonts-SFUFSBEU.js} +1 -1
  20. package/dist/{capture-BAFLHNDI.js → capture-A3FLQIDI.js} +32 -33
  21. package/dist/{capture-GC4F54XT.js → capture-NL7V23HG.js} +5 -5
  22. package/dist/{captureCompositionFrame-YBVEFKWM.js → captureCompositionFrame-R7GYVNTF.js} +22 -22
  23. package/dist/{captureFile-R5JZ7WRA.js → captureFile-LXMDM5TD.js} +3 -3
  24. package/dist/{catalog-LHOCJUO2.js → catalog-42I7W7AU.js} +26 -21
  25. package/dist/{catch-up-6FNQ6I7Q.js → catch-up-TFSQZQZD.js} +16 -15
  26. package/dist/{check-S7T5LE6V.js → check-CXRQZBLD.js} +59 -56
  27. package/dist/{checkAudio-AKOI4AWK.js → checkAudio-AJUH6RU6.js} +20 -20
  28. package/dist/{checkBrowser-NABXGNNM.js → checkBrowser-4BLSYI25.js} +52 -49
  29. package/dist/{chunk-47MEWWCO.js → chunk-26RTKW2U.js} +2 -2
  30. package/dist/{chunk-UAU4SIOQ.js → chunk-2PASB3PC.js} +8 -8
  31. package/dist/{chunk-ZG6BVWQ7.js → chunk-32DAUKF5.js} +4 -4
  32. package/dist/{chunk-YXQA6MKA.js → chunk-3IHRXHJQ.js} +4 -4
  33. package/dist/{chunk-PRG42HNH.js → chunk-3IUBSGD2.js} +2 -2
  34. package/dist/{chunk-GEIWJSWN.js → chunk-3NPZZT2K.js} +10 -10
  35. package/dist/{chunk-5B425ZB3.js → chunk-3NXY6O4X.js} +1 -1
  36. package/dist/{chunk-U7ZCBWNM.js → chunk-4IUOWNDS.js} +3 -3
  37. package/dist/{chunk-4OHV7UZZ.js → chunk-4NG5GSTO.js} +1 -1
  38. package/dist/{chunk-CIMOTEZB.js → chunk-4Q3Q4NFK.js} +4 -4
  39. package/dist/{chunk-KUZTIMY3.js → chunk-4WK4O5FI.js} +8 -8
  40. package/dist/{chunk-CIGQUDEV.js → chunk-4ZFNNWUX.js} +51 -16
  41. package/dist/{chunk-2MNSS7PH.js → chunk-5HJZGP54.js} +3 -3
  42. package/dist/{chunk-UX2KMUKC.js → chunk-5XLTJMCN.js} +10 -10
  43. package/dist/{chunk-YXR5MVBM.js → chunk-63ESYLBY.js} +2 -2
  44. package/dist/{chunk-MP4TEYUJ.js → chunk-6EMFSRTW.js} +4 -1
  45. package/dist/{chunk-S5EMQAKL.js → chunk-6SRBTOGD.js} +3 -3
  46. package/dist/{chunk-7RLMDAUO.js → chunk-6T4PB35F.js} +2 -1
  47. package/dist/{chunk-IB722ALN.js → chunk-73UFPVUC.js} +2 -2
  48. package/dist/{chunk-KLIVZ5VG.js → chunk-75TCOXNT.js} +1 -1
  49. package/dist/{chunk-C66O6A2J.js → chunk-77U3646W.js} +2 -2
  50. package/dist/{chunk-64T46P7K.js → chunk-7RGWVZOS.js} +3 -3
  51. package/dist/{chunk-MF53JVZ5.js → chunk-7RI3U46M.js} +1 -1
  52. package/dist/{chunk-G6QCHM2N.js → chunk-7WRLK2K4.js} +5 -5
  53. package/dist/{chunk-YPURY3MW.js → chunk-AROERRUJ.js} +2 -2
  54. package/dist/{chunk-MOTJT42J.js → chunk-ATKA5KHE.js} +15 -3
  55. package/dist/{chunk-Z2EKCD7H.js → chunk-AU4ZBCR3.js} +1 -1
  56. package/dist/{chunk-6NGJ55V5.js → chunk-AYESPEPQ.js} +2 -2
  57. package/dist/{chunk-FCNMU7LC.js → chunk-B5HSHXE2.js} +2 -2
  58. package/dist/{chunk-CDK23M57.js → chunk-B6AK5P2D.js} +9 -9
  59. package/dist/{chunk-UBHBB3TB.js → chunk-BBDWXUO3.js} +45 -53
  60. package/dist/{chunk-AMWWQXTC.js → chunk-BDWLBCTG.js} +7 -7
  61. package/dist/{chunk-NQ3NHCF6.js → chunk-BNONW4QT.js} +2 -2
  62. package/dist/{chunk-POGZYVM2.js → chunk-C7LNWZ7G.js} +9 -9
  63. package/dist/{chunk-WN4W76IQ.js → chunk-CAYQATCT.js} +1 -1
  64. package/dist/{chunk-TDQUQAW5.js → chunk-CBCB6GPL.js} +105 -41
  65. package/dist/{chunk-U3LWQGCD.js → chunk-CIYNUD7Q.js} +1 -1
  66. package/dist/{chunk-SQ64IEA7.js → chunk-CNZOKODL.js} +3 -3
  67. package/dist/{chunk-7VQ3RAKO.js → chunk-CWXJZB44.js} +19 -16
  68. package/dist/{chunk-J45SCYTD.js → chunk-D4EGZYDN.js} +8 -8
  69. package/dist/{chunk-ZW6ZUKBB.js → chunk-DOLVT6CH.js} +1 -1
  70. package/dist/{chunk-E2KJT7JR.js → chunk-DVTRMGYG.js} +2 -2
  71. package/dist/{chunk-I6SCA2ME.js → chunk-DWDCE4PO.js} +55 -26
  72. package/dist/{chunk-P37ZACC6.js → chunk-DXVK3NMV.js} +3 -3
  73. package/dist/{chunk-DPVXBVLL.js → chunk-DZWAYZG2.js} +6254 -6096
  74. package/dist/{chunk-HD5RVDL6.js → chunk-E2DHBP6C.js} +1 -1
  75. package/dist/{chunk-IU5DC4HP.js → chunk-E7T5SMDK.js} +44 -15
  76. package/dist/{chunk-HS7LT4PL.js → chunk-E7X54BVP.js} +1 -1
  77. package/dist/{chunk-DE7Q2LWF.js → chunk-EA5W2DWO.js} +2 -2
  78. package/dist/{chunk-4Q2HYZZK.js → chunk-EB4IWBBC.js} +58 -3
  79. package/dist/{chunk-B2ZZYISD.js → chunk-ECGNWHFE.js} +29 -6
  80. package/dist/{chunk-H4S3WY2N.js → chunk-EKANCN4D.js} +3 -3
  81. package/dist/{chunk-TI7JN55F.js → chunk-EKCGL4MV.js} +1 -1
  82. package/dist/{chunk-7SZ7QQJ3.js → chunk-ELA3IV4P.js} +2 -2
  83. package/dist/{chunk-SZGQU7EB.js → chunk-ER22SVLT.js} +1 -1
  84. package/dist/{chunk-I2UMQAOQ.js → chunk-EXXIFMUX.js} +1 -1
  85. package/dist/{chunk-UIIQA7DN.js → chunk-EZQJFCWA.js} +6 -3
  86. package/dist/{chunk-YJFIGFON.js → chunk-F64VFCVC.js} +2 -2
  87. package/dist/{chunk-UX4HQHMS.js → chunk-F7B2YDPM.js} +17 -13
  88. package/dist/{chunk-ETXOQXWT.js → chunk-FICKJQU2.js} +5 -5
  89. package/dist/{chunk-24M5C5EQ.js → chunk-FUPEHRNT.js} +2 -2
  90. package/dist/{chunk-VXX4S2PH.js → chunk-GA6QR6LN.js} +648 -166
  91. package/dist/{chunk-P27QDOID.js → chunk-GEUM7NDY.js} +2 -2
  92. package/dist/chunk-GIOLHGCC.js +181 -0
  93. package/dist/{chunk-RMO7KIFX.js → chunk-H2GJDFF6.js} +4 -4
  94. package/dist/{chunk-7GVHPY7W.js → chunk-H5KHQ6KS.js} +1 -1
  95. package/dist/{chunk-DYYAFCZH.js → chunk-H7DKHNBF.js} +1 -1
  96. package/dist/{chunk-DONVZZLV.js → chunk-HYO4DIYT.js} +1 -1
  97. package/dist/{chunk-O45HB74L.js → chunk-IB6FFEDH.js} +32 -28
  98. package/dist/{chunk-MI54IK7G.js → chunk-IEESWUIQ.js} +11 -2
  99. package/dist/{chunk-6MKM2RVL.js → chunk-IH2C53YV.js} +460 -1
  100. package/dist/{chunk-6MYO2IHD.js → chunk-IHXMN5YH.js} +7 -0
  101. package/dist/{chunk-YHJOTCTV.js → chunk-IJYIIHGK.js} +10 -5
  102. package/dist/{chunk-NFRKPLTJ.js → chunk-IR2GEREV.js} +1 -1
  103. package/dist/{chunk-PCH55NAO.js → chunk-JAAIW4JR.js} +1 -1
  104. package/dist/{chunk-WPC2FKNB.js → chunk-JRSBBFUU.js} +405 -175
  105. package/dist/{chunk-L2KUIV56.js → chunk-JSYLOPVJ.js} +1 -1
  106. package/dist/{chunk-DE3JRSGT.js → chunk-KCF6Q54R.js} +1 -1
  107. package/dist/{chunk-2AZMG6DR.js → chunk-KTLRJZFK.js} +7 -7
  108. package/dist/{chunk-XWK2RSD5.js → chunk-KWTTELUY.js} +2 -2
  109. package/dist/{chunk-UB44XZOI.js → chunk-KYUCSRZU.js} +1 -1
  110. package/dist/{chunk-MOR3H5FK.js → chunk-LKWWY6WN.js} +1 -1
  111. package/dist/{chunk-HT4FWRIT.js → chunk-LRXARA5O.js} +1 -1
  112. package/dist/chunk-MEGSQW2I.js +72 -0
  113. package/dist/{chunk-445BBSZS.js → chunk-MPU2CRFV.js} +4 -4
  114. package/dist/{chunk-IMNIW22F.js → chunk-N7M2SNAF.js} +2 -2
  115. package/dist/{chunk-MQGRMXFN.js → chunk-NCLBKHCX.js} +4 -4
  116. package/dist/{chunk-4Y5IDZOJ.js → chunk-NKAW4RVE.js} +4 -4
  117. package/dist/{chunk-CQ5VQNOD.js → chunk-NKUUNSII.js} +1 -1
  118. package/dist/{chunk-Z46RV43W.js → chunk-NRGNEP3R.js} +2 -2
  119. package/dist/{chunk-ZGWOCGSJ.js → chunk-O6E5HSVF.js} +2 -2
  120. package/dist/{chunk-RCTY7VNK.js → chunk-O7TIBLSJ.js} +15 -101
  121. package/dist/{chunk-M3BJEZ7E.js → chunk-OIO7YMBP.js} +44 -13
  122. package/dist/{chunk-QUUZ2BGC.js → chunk-ON3CGL3V.js} +1 -1
  123. package/dist/{chunk-LZTBL7SR.js → chunk-OSKSTJNQ.js} +12 -2
  124. package/dist/{chunk-22EEGJLH.js → chunk-OTWFSHYH.js} +85 -57
  125. package/dist/{chunk-NXDFCWF2.js → chunk-OWS4ZWEY.js} +1 -1
  126. package/dist/{chunk-4QFWV5GQ.js → chunk-P2ZMVHTF.js} +2 -1
  127. package/dist/{chunk-N36NHUGP.js → chunk-P4YIRU76.js} +1 -1
  128. package/dist/{chunk-7QM73IH2.js → chunk-PAA5FUUL.js} +4 -4
  129. package/dist/{chunk-6PXVXIC7.js → chunk-PLOVBMJF.js} +177 -69
  130. package/dist/{chunk-T6VQGCN3.js → chunk-PPLFDG7N.js} +9 -5
  131. package/dist/chunk-PXLGDX2S.js +104 -0
  132. package/dist/{chunk-LNZHSISH.js → chunk-Q3ESTCZH.js} +11 -11
  133. package/dist/{chunk-G55B5LP6.js → chunk-Q42L7V5T.js} +1 -1
  134. package/dist/{chunk-3LIMD4YP.js → chunk-QBN2W4T3.js} +6 -8
  135. package/dist/{chunk-ZXMZSU5Y.js → chunk-QGKRHG4Q.js} +15 -15
  136. package/dist/{chunk-LIPVGXPV.js → chunk-QKYGGUOQ.js} +4 -4
  137. package/dist/{chunk-JJLPGVTA.js → chunk-QONV77VI.js} +1 -1
  138. package/dist/{chunk-UFET7UTU.js → chunk-RBBWUYMG.js} +4 -4
  139. package/dist/{chunk-4FWR7OE3.js → chunk-RXSPJW77.js} +4 -4
  140. package/dist/{chunk-X3IULMVV.js → chunk-RZJ7BHXB.js} +1 -1
  141. package/dist/{chunk-7RHN6N5F.js → chunk-SDFGDNWV.js} +1 -1
  142. package/dist/{chunk-R64WJS45.js → chunk-SOMX57XG.js} +6 -6
  143. package/dist/{chunk-42JBYXIQ.js → chunk-SUG2AA33.js} +42 -26
  144. package/dist/{chunk-IZQDQ5AN.js → chunk-SULPT5X6.js} +53 -17
  145. package/dist/{chunk-VOJ3ICMF.js → chunk-SVIA7POL.js} +1 -1
  146. package/dist/chunk-SWAG64KW.js +367 -0
  147. package/dist/{chunk-DC7AOIHN.js → chunk-T5S7U5C6.js} +1 -1
  148. package/dist/{chunk-L56WTLQP.js → chunk-TM7D3NOR.js} +34 -15
  149. package/dist/{chunk-KCPIENND.js → chunk-TMV76KPG.js} +1 -1
  150. package/dist/{chunk-H4LCNEA2.js → chunk-TRAPS5WB.js} +195 -128
  151. package/dist/{chunk-M4E7CMYS.js → chunk-TW4DB2NK.js} +2 -2
  152. package/dist/{chunk-XHUFLQGD.js → chunk-UZJ7Y7WU.js} +3 -3
  153. package/dist/{chunk-M425BL2U.js → chunk-VCKUDUPN.js} +1 -1
  154. package/dist/{chunk-M6TIOPL5.js → chunk-VT2K6I4A.js} +3 -3
  155. package/dist/{chunk-QP7MQ43Y.js → chunk-WAAXVZIT.js} +3 -3
  156. package/dist/{chunk-4XETQ5LC.js → chunk-WPD7JH6F.js} +2 -2
  157. package/dist/{chunk-HLXZFHEY.js → chunk-WPSPW7SI.js} +6 -6
  158. package/dist/{chunk-RULKJFRT.js → chunk-X6TDH2OM.js} +1 -1
  159. package/dist/chunk-XGEJPKRY.js +5069 -0
  160. package/dist/{chunk-APT2TSYC.js → chunk-Y6UCMYJZ.js} +1 -1
  161. package/dist/{chunk-7PBJR7WI.js → chunk-YBLBI3O2.js} +1 -1
  162. package/dist/{chunk-WSZJS4QC.js → chunk-YNF3SH26.js} +61 -10
  163. package/dist/{chunk-YRXIEP35.js → chunk-YU5LSWA2.js} +90 -11
  164. package/dist/{chunk-RIHRYTNB.js → chunk-YUDWGRNZ.js} +15 -15
  165. package/dist/{chunk-MR7VKWYT.js → chunk-YVCPUVHV.js} +1 -1
  166. package/dist/{clean-Y6YIQRPM.js → clean-JK4VQMTH.js} +35 -34
  167. package/dist/cli.js +67 -66
  168. package/dist/{cloud-A5U7YYNA.js → cloud-JZ2WKHQG.js} +4 -4
  169. package/dist/{cloud-5C5SCK4H.js → cloud-LU4FVT33.js} +7 -6
  170. package/dist/{cloudrun-EULFHQQL.js → cloudrun-QBXSGBGX.js} +9 -9
  171. package/dist/{compare-6XCTMUF3.js → compare-YE5BTDCG.js} +50 -48
  172. package/dist/{compiler-DUG4GFRI.js → compiler-QEA5UQRG.js} +9 -9
  173. package/dist/{component-JDQIZSAL.js → component-MGT5ZJ4M.js} +3 -3
  174. package/dist/{compositions-HZDEOSRL.js → compositions-7OF6FDCH.js} +30 -23
  175. package/dist/{contactSheet-O3FOOHOX.js → contactSheet-CCHQAZLA.js} +4 -4
  176. package/dist/{curve-SE7ZAMI6.js → curve-JQLVUDXR.js} +20 -19
  177. package/dist/{cuts-AEFJGBFP.js → cuts-MCJP6LMJ.js} +21 -20
  178. package/dist/{delete-EQUQ7Z2K.js → delete-PUYEW3RJ.js} +11 -8
  179. package/dist/{deploy-NSLC6BYZ.js → deploy-M4XGMJM5.js} +2 -2
  180. package/dist/{describeProject-FTJBPDL3.js → describeProject-P7CBZ6NW.js} +17 -17
  181. package/dist/{destroy-4O4T3KL3.js → destroy-6XJWSH2A.js} +2 -2
  182. package/dist/{deterministicFonts-QY4KNTOU.js → deterministicFonts-OXGNMVJE.js} +5 -5
  183. package/dist/{diff-VJ3CS7YE.js → diff-BATSO64W.js} +46 -44
  184. package/dist/{dist-2YJCNIWI.js → dist-G6W7GKGP.js} +6 -6
  185. package/dist/{dist-MNFB4YKV.js → dist-PC3EMMET.js} +21 -21
  186. package/dist/{dist-MXWEGMRB.js → dist-T62DJJZX.js} +6 -6
  187. package/dist/{doctor-RR7SNO6X.js → doctor-ONTGSPYF.js} +28 -23
  188. package/dist/{dotEnv-33RDHX7P.js → dotEnv-RZ52L7X3.js} +5 -4
  189. package/dist/{energy-PN23W2UJ.js → energy-FNZICGW2.js} +21 -20
  190. package/dist/{events-5OLO73VJ.js → events-6TNBAVVY.js} +23 -22
  191. package/dist/{events-NR6UPBHG.js → events-ENJZNXWG.js} +5 -5
  192. package/dist/{events-4ECJEB2W.js → events-LBHSU7C2.js} +12 -12
  193. package/dist/{execute-TS3BP65F.js → execute-RXTEBACV.js} +42 -42
  194. package/dist/{extract-GCZ5HSEN.js → extract-F2CWTMLX.js} +21 -20
  195. package/dist/{face-QKMYBRV3.js → face-7HL4CP32.js} +22 -21
  196. package/dist/{feedback-3H43EK7N.js → feedback-4NDDMECH.js} +46 -33
  197. package/dist/{ffmpeg-JRNM74WY.js → ffmpeg-3LL345SO.js} +18 -18
  198. package/dist/{figma-JGP2UGGU.js → figma-474E54NB.js} +3 -3
  199. package/dist/fontLocalizeCli.js +24 -25
  200. package/dist/{frames-OYSWKB3F.js → frames-EZWGM7QQ.js} +23 -22
  201. package/dist/{generate-TDXLUFMR.js → generate-I75DZWDU.js} +36 -34
  202. package/dist/{get-UB2MNBYO.js → get-BHU6CBWO.js} +11 -8
  203. package/dist/{gpuPolicy-6CTTH3NY.js → gpuPolicy-6J2STCV2.js} +15 -15
  204. package/dist/{grade-compare-2DXT4RWV.js → grade-compare-D4TBMCBG.js} +49 -47
  205. package/dist/{gsapParser-L7TM3RGH.js → gsapParser-TSPNHW7F.js} +1 -1
  206. package/dist/hangReport.js +2 -1
  207. package/dist/{heifImagePrep-VDZVZ4G7.js → heifImagePrep-VLYGRKSS.js} +20 -21
  208. package/dist/{help-RGKY4DR4.js → help-2CUXKYJ6.js} +1 -1
  209. package/dist/{history-AVDXYNAP.js → history-LVAVYTAN.js} +19 -18
  210. package/dist/hyperframe.manifest.json +1 -1
  211. package/dist/hyperframe.runtime.iife.js +67 -67
  212. package/dist/hyperframes-player.global.js +3 -3
  213. package/dist/{info-NGTQABZC.js → info-SUZOEH6L.js} +29 -23
  214. package/dist/{init-C3EARHDW.js → init-XI5QN3A6.js} +46 -44
  215. package/dist/{ink-ISO3VXRQ.js → ink-OVDZOCQJ.js} +21 -20
  216. package/dist/{inspect-V6MPU5I5.js → inspect-INBCGPBD.js} +50 -47
  217. package/dist/{installer-FI6HT2FW.js → installer-JNQKFCTN.js} +10 -10
  218. package/dist/{keyframes-PTJDE47Y.js → keyframes-LYZJK4RH.js} +21 -17
  219. package/dist/{lambda-JTO5YD2I.js → lambda-DUDXZV6X.js} +21 -21
  220. package/dist/{layout-QMLEZP5T.js → layout-JKUJW6A4.js} +50 -47
  221. package/dist/{lint-6BWOQAW6.js → lint-NKDC7IJ2.js} +25 -19
  222. package/dist/{lintProject-G4MXY4YA.js → lintProject-5Z34NNS4.js} +6 -6
  223. package/dist/{list-7E4VD7JA.js → list-5HUMDJYL.js} +11 -8
  224. package/dist/{localPage-BQOYZAOW.js → localPage-RRBRFR4Y.js} +16 -16
  225. package/dist/{login-37MSZXCY.js → login-C3SHKITR.js} +6 -5
  226. package/dist/{logout-QGNBUJKS.js → logout-CCATTNTL.js} +2 -1
  227. package/dist/{look-5GXW3NVP.js → look-3TX2U4BE.js} +21 -20
  228. package/dist/{manager-TMKN4DX5.js → manager-45VB2G5F.js} +4 -4
  229. package/dist/{manager-J2IRAOR7.js → manager-MOR255LW.js} +16 -16
  230. package/dist/{measure-23IL23BL.js → measure-ZAKBHNGY.js} +11 -11
  231. package/dist/{media-treatment-7ODBREPX.js → media-treatment-QJ35DSED.js} +25 -24
  232. package/dist/{media-use-QJA6NB3V.js → media-use-YBKHJVXL.js} +12 -18
  233. package/dist/{models-2Z6SURXU.js → models-OQHKG7B4.js} +20 -20
  234. package/dist/{motionShot-CYS3L6FK.js → motionShot-TWQTREFH.js} +26 -26
  235. package/dist/{normalize-audio-6YVF4LED.js → normalize-audio-PXHPUOMD.js} +19 -19
  236. package/dist/{open-WQ6NRHCN.js → open-TVGO5KVF.js} +34 -27
  237. package/dist/{parakeetRunner-R7KK6ZHD.js → parakeetRunner-MVJMZSIG.js} +23 -23
  238. package/dist/{pipeline-HRCK2JQL.js → pipeline-4S5UE4O4.js} +18 -18
  239. package/dist/{plan-FQNKACYR.js → plan-AMBZUX55.js} +30 -30
  240. package/dist/{play-UJZBNX2O.js → play-KEAESNBM.js} +43 -39
  241. package/dist/{preflight-VIMLSE3I.js → preflight-K3CM3W55.js} +18 -18
  242. package/dist/{present-JIOVM3ZH.js → present-42WDBGBA.js} +35 -32
  243. package/dist/{preview-HCYGBEWR.js → preview-KSHBU7ZR.js} +43 -34
  244. package/dist/{probe-6YQA2ZZC.js → probe-TMSXGCL4.js} +21 -20
  245. package/dist/{producer-JIM74BGL.js → producer-KXRSJPJF.js} +1 -1
  246. package/dist/{projectConfig-VPL64JBD.js → projectConfig-LOHNVOJG.js} +13 -13
  247. package/dist/{publicNetwork-F3ZXSVOD.js → publicNetwork-GW7SVP7N.js} +1 -1
  248. package/dist/{publication-ST3VFFWM.js → publication-LYPU7NTZ.js} +8 -8
  249. package/dist/{publish-3TTCO4R4.js → publish-PYZXDQJW.js} +51 -38
  250. package/dist/{refresh-6ONVQ3WV.js → refresh-X5ZLKQO5.js} +2 -1
  251. package/dist/{remove-background-XTICO22L.js → remove-background-HVX52VOF.js} +19 -19
  252. package/dist/{render-PFBZJRAN.js → render-57ZYQ53S.js} +73 -62
  253. package/dist/{render-WYDOZEZ5.js → render-5KMA5P2U.js} +90 -57
  254. package/dist/{render-MG5MX45D.js → render-CM4MCNVA.js} +9 -9
  255. package/dist/{render-batch-C3XGAQGX.js → render-batch-URBBGOVC.js} +9 -9
  256. package/dist/renderSetupWorker.js +10 -10
  257. package/dist/{resolver-AGMKICJW.js → resolver-UPUCU4XT.js} +10 -10
  258. package/dist/{reverse-TV524NFW.js → reverse-UYS7KVE2.js} +1 -1
  259. package/dist/{run-NQBD5RDR.js → run-4LNEWQLG.js} +10 -6
  260. package/dist/{screenshotCapture-OUZMH7EQ.js → screenshotCapture-IF5AO5XM.js} +18 -18
  261. package/dist/{service-UIHDIMFM.js → service-OEOC34BD.js} +22 -21
  262. package/dist/{share-WD7MCA4I.js → share-NS7CMVSU.js} +25 -24
  263. package/dist/{sherpa-H67ZJICN.js → sherpa-QBTXL6JA.js} +22 -22
  264. package/dist/sherpaWorker.js +3 -3
  265. package/dist/skills/hyperframes-cli/references/cloud.md +1 -1
  266. package/dist/skills/media-use/audio/references/requirements.md +7 -7
  267. package/dist/skills/media-use/audio/references/tts.md +8 -6
  268. package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +39 -13
  269. package/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +176 -2
  270. package/dist/skills/media-use/references/heygen.md +1 -1
  271. package/dist/{skills-7TUSQF6W.js → skills-S5U2MQAI.js} +16 -15
  272. package/dist/{skillsUpdateCheck-HF6SQWRA.js → skillsUpdateCheck-UZ7CZ6VC.js} +5 -3
  273. package/dist/{snapshot-P7ZSTKED.js → snapshot-YWFWQTAV.js} +118 -75
  274. package/dist/{src-H2EUJUV3.js → src-N2SMYJ44.js} +22 -23
  275. package/dist/{src-TQQ743H4.js → src-UQ3K3UW2.js} +31 -17
  276. package/dist/{start-7ZTAKHD4.js → start-4IA5GG5D.js} +34 -32
  277. package/dist/{staticProjectServer-X4PARIVN.js → staticProjectServer-5JP25RRX.js} +34 -33
  278. package/dist/{status-ELQXIXIB.js → status-ITCKXFBF.js} +25 -24
  279. package/dist/studio/assets/{hyperframes-player-D7LhzIg1.js → hyperframes-player-Oju91F6x.js} +2 -2
  280. package/dist/studio/assets/{index-D3WxJaqm.js → index-B0VEzzD2.js} +180 -180
  281. package/dist/studio/assets/index-Dv67Vrl6.js +74 -0
  282. package/dist/studio/assets/{index-CQ7o0CBU.js → index-XEm_N45R.js} +1 -1
  283. package/dist/studio/assets/{pausedVideoDecoder-BVUmBgn0.js → pausedVideoDecoder-p6zibxVM.js} +1 -1
  284. package/dist/studio/index.html +1 -1
  285. package/dist/{studio-api-OJEU24EG.js → studio-api-GENM2XVL.js} +21 -21
  286. package/dist/{studioServer-E5CLZC46.js → studioServer-SWR5Q3PD.js} +90 -77
  287. package/dist/{sync-VEJWMKDP.js → sync-CK6TTCXO.js} +21 -20
  288. package/dist/{synthesize-HOLHQCR2.js → synthesize-EXNEBJSY.js} +5 -5
  289. package/dist/{system-I5KGZTUG.js → system-JBPJHNTG.js} +3 -3
  290. package/dist/{telemetry-3U4UGQ5V.js → telemetry-T4HQ6AKZ.js} +12 -12
  291. package/dist/{templates-AUAOWIYA.js → templates-7O7NOIUC.js} +23 -22
  292. package/dist/{timeline-YO27AP66.js → timeline-P2PLN53O.js} +33 -32
  293. package/dist/{tokens-UXLQGLVG.js → tokens-SPQN27VG.js} +2 -2
  294. package/dist/{transcribe-FZ3TE4FK.js → transcribe-SCZG6IM4.js} +19 -19
  295. package/dist/{transcribe-I7MTUH4M.js → transcribe-YJQ3DDDI.js} +40 -39
  296. package/dist/{tts-3VHEX4RB.js → tts-5OAB5XX6.js} +1 -1
  297. package/dist/{update-KBKSO3SH.js → update-JYPZW35A.js} +18 -17
  298. package/dist/{updateCheck-MUYN55HR.js → updateCheck-5M2JJTH3.js} +4 -2
  299. package/dist/{upgrade-CRCX7CCK.js → upgrade-BP62FM6V.js} +7 -5
  300. package/dist/{urlDownloader-4EM6GLN4.js → urlDownloader-WOZQCE6P.js} +14 -14
  301. package/dist/{validate-Y2KF2DU3.js → validate-NEC5QLH7.js} +40 -39
  302. package/dist/{video-HG6SINBD.js → video-XEEBISSO.js} +17 -17
  303. package/dist/{voices-O4UHHFZS.js → voices-GCHA27JA.js} +34 -32
  304. package/dist/warmCheck.js +59 -57
  305. package/dist/warmCheckClient.js +2 -1
  306. package/package.json +1 -1
  307. package/dist/chunk-DQZRNGDS.js +0 -5069
  308. package/dist/chunk-IGLEPPTN.js +0 -24
  309. package/dist/chunk-L2U4ISSS.js +0 -93
  310. package/dist/studio/assets/index-BX3KHhGX.js +0 -71
@@ -1,4 +1,4 @@
1
- var je=Object.defineProperty;var Be=(r,t,e)=>t in r?je(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var h=(r,t,e)=>Be(r,typeof t!="symbol"?t+"":t,e);import{S as qe,r as Ge,P as Ye,i as Xe,a as be,b as we,c as Ke,m as Ue,s as Ze,d as A,e as Ae,p as Je,f as Qe,g as et,h as tt,j as it,k as Se,F as Te}from"./index-D3WxJaqm.js";function st(r){return r.hasRuntime||r.runtimeInjected?!1:!!(r.hasNestedCompositions||r.hasTimelines&&r.attempts>=5)}function F(r){return typeof r=="object"&&r!==null}function rt(r){return F(r)&&typeof r.getDuration=="function"}function nt(r){return F(r)&&typeof r.duration=="function"&&typeof r.time=="function"&&typeof r.seek=="function"&&typeof r.play=="function"&&typeof r.pause=="function"}function ot(r){if(!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(r))throw new Error(`Invalid HyperFrames runtime version: ${r}`);return`https://cdn.jsdelivr.net/npm/@hyperframes/core@${r}/dist/hyperframe.runtime.iife.js`}const B=typeof __HYPERFRAMES_RUNTIME_CDN_URL__=="string"?__HYPERFRAMES_RUNTIME_CDN_URL__:ot("0.0.0-dev");function Y(r){if(r===null)return null;const t=Number.parseInt(r,10);return Number.isFinite(t)&&t>0?t:null}function at(r){const t=(r==null?void 0:r.querySelector("[data-composition-id][data-width][data-height]"))??(r==null?void 0:r.querySelector("[data-width][data-height]"));if(!t)return null;const e=Y(t.getAttribute("data-width")),i=Y(t.getAttribute("data-height"));return e!==null&&i!==null?{width:e,height:i}:null}function dt(r){return Array.isArray(r)?r.find(t=>typeof t=="string"&&t.trim()!==""&&t!=="[object Event]")??null:null}class ht{constructor(t,e){h(this,"_interval",null);h(this,"_runtimeInjected",!1);h(this,"_runtimeScript",null);h(this,"_failure",null);this._iframe=t,this._callbacks=e}get failed(){return this._failure!==null&&this._failure.document===this._iframe.contentDocument}get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._failure=null,this._runtimeInjected=!1;let t=0;this._interval=setInterval(()=>{t++;let e=null;try{e=this._poll(t)}catch(i){i instanceof DOMException&&i.name==="SecurityError"||(e={kind:"error",message:i instanceof Error?i.message:String(i)})}e??(e=this._deadlineOutcome(t)),e&&(this.stop(),e.kind==="error"?(this._failure={document:this._iframe.contentDocument},this._callbacks.onError(e.message)):this._callbacks.onReady(e.result))},200)}_deadlineOutcome(t){var e,i;return t<40||(i=(e=this._callbacks).hostOwnsDeadline)!=null&&i.call(e)?null:{kind:"error",message:"Composition timeline not found after 8s"}}_poll(t){const e=this._iframe.contentWindow;if(!e)return null;const i=dt(Reflect.get(e,qe));if(i!==null)return{kind:"error",message:i};const s=this._iframe.contentDocument,n=Reflect.get(e,"__timelines"),o=this.hasRuntimeBridge(e);if(st({hasRuntime:o,hasTimelines:F(n)&&Object.keys(n).length>0,hasNestedCompositions:!!(s!=null&&s.querySelector("[data-composition-src]")),runtimeInjected:this._runtimeInjected,attempts:t}))return this._injectRuntime(),null;if(this._runtimeInjected&&!o)return null;const a=this._resolveReadyResult(e,s);return a?{kind:"ready",result:a}:null}_resolveReadyResult(t,e){var n;const i=this._resolvePlaybackDurationAdapter(t)??{kind:"document",getDuration:()=>0};let s=i.getDuration();if(!Number.isFinite(s)||s<=0){if(i.kind==="direct-timeline")return null;s=e?((n=Ge(e))==null?void 0:n.durationSeconds)??0:0}return s<=0?null:{duration:s,adapter:{...i,getDuration:()=>s},compositionSize:at(e)}}stop(){this._runtimeScript&&(this._runtimeScript.onerror=null,this._runtimeScript=null),this.failed||(this._failure=null),this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{const t=this._iframe.contentWindow;return t?this._resolveDirectTimelineAdapterFromWindow(t):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(t){return this._resolveDirectTimelineAdapterFromWindow(t)}hasRuntimeBridge(t){return F(Reflect.get(t,"__player"))}_injectRuntime(){var t,e,i,s;this._runtimeInjected=!0;try{const n=this._iframe.contentDocument;if(!n)return;const o=n.createElement("script");o.src=((e=(t=this._callbacks).resolveRuntimeUrl)==null?void 0:e.call(t))??B,this._runtimeScript=o,o.onerror=()=>{this._runtimeScript!==o||this._iframe.contentDocument!==n||(this.stop(),this._failure={document:n},this._callbacks.onError("HyperFrames runtime failed to load from "+o.src))},(n.head||n.documentElement).appendChild(o),(s=(i=this._callbacks).onRuntimeInjected)==null||s.call(i)}catch{}}_resolveDirectTimelineAdapterFromWindow(t){var a,c;if(this.hasRuntimeBridge(t))return null;const e=Reflect.get(t,"__timelines");if(!F(e))return null;const i=Object.keys(e);if(i.length===0)return null;const s=(c=(a=this._iframe.contentDocument)==null?void 0:a.querySelector("[data-composition-id]"))==null?void 0:c.getAttribute("data-composition-id"),n=s&&s in e?s:i[i.length-1],o=e[n];return nt(o)?o:null}_resolvePlaybackDurationAdapter(t){const e=Reflect.get(t,"__player");if(rt(e))return{kind:"runtime",getDuration:()=>e.getDuration()};const i=this._resolveDirectTimelineAdapterFromWindow(t);return i?{kind:"direct-timeline",timeline:i,getDuration:()=>i.duration()}:null}}const lt=`
1
+ var je=Object.defineProperty;var Be=(r,t,e)=>t in r?je(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var h=(r,t,e)=>Be(r,typeof t!="symbol"?t+"":t,e);import{S as qe,r as Ge,P as Ye,i as Xe,a as be,b as we,c as Ke,m as Ue,s as Ze,d as A,e as Ae,p as Je,f as Qe,g as et,h as tt,j as it,k as Se,F as Te}from"./index-B0VEzzD2.js";function st(r){return r.hasRuntime||r.runtimeInjected?!1:!!(r.hasNestedCompositions||r.hasTimelines&&r.attempts>=5)}function F(r){return typeof r=="object"&&r!==null}function rt(r){return F(r)&&typeof r.getDuration=="function"}function nt(r){return F(r)&&typeof r.duration=="function"&&typeof r.time=="function"&&typeof r.seek=="function"&&typeof r.play=="function"&&typeof r.pause=="function"}function ot(r){if(!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(r))throw new Error(`Invalid HyperFrames runtime version: ${r}`);return`https://cdn.jsdelivr.net/npm/@hyperframes/core@${r}/dist/hyperframe.runtime.iife.js`}const B=typeof __HYPERFRAMES_RUNTIME_CDN_URL__=="string"?__HYPERFRAMES_RUNTIME_CDN_URL__:ot("0.0.0-dev");function Y(r){if(r===null)return null;const t=Number.parseInt(r,10);return Number.isFinite(t)&&t>0?t:null}function at(r){const t=(r==null?void 0:r.querySelector("[data-composition-id][data-width][data-height]"))??(r==null?void 0:r.querySelector("[data-width][data-height]"));if(!t)return null;const e=Y(t.getAttribute("data-width")),i=Y(t.getAttribute("data-height"));return e!==null&&i!==null?{width:e,height:i}:null}function dt(r){return Array.isArray(r)?r.find(t=>typeof t=="string"&&t.trim()!==""&&t!=="[object Event]")??null:null}class ht{constructor(t,e){h(this,"_interval",null);h(this,"_runtimeInjected",!1);h(this,"_runtimeScript",null);h(this,"_failure",null);this._iframe=t,this._callbacks=e}get failed(){return this._failure!==null&&this._failure.document===this._iframe.contentDocument}get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._failure=null,this._runtimeInjected=!1;let t=0;this._interval=setInterval(()=>{t++;let e=null;try{e=this._poll(t)}catch(i){i instanceof DOMException&&i.name==="SecurityError"||(e={kind:"error",message:i instanceof Error?i.message:String(i)})}e??(e=this._deadlineOutcome(t)),e&&(this.stop(),e.kind==="error"?(this._failure={document:this._iframe.contentDocument},this._callbacks.onError(e.message)):this._callbacks.onReady(e.result))},200)}_deadlineOutcome(t){var e,i;return t<40||(i=(e=this._callbacks).hostOwnsDeadline)!=null&&i.call(e)?null:{kind:"error",message:"Composition timeline not found after 8s"}}_poll(t){const e=this._iframe.contentWindow;if(!e)return null;const i=dt(Reflect.get(e,qe));if(i!==null)return{kind:"error",message:i};const s=this._iframe.contentDocument,n=Reflect.get(e,"__timelines"),o=this.hasRuntimeBridge(e);if(st({hasRuntime:o,hasTimelines:F(n)&&Object.keys(n).length>0,hasNestedCompositions:!!(s!=null&&s.querySelector("[data-composition-src]")),runtimeInjected:this._runtimeInjected,attempts:t}))return this._injectRuntime(),null;if(this._runtimeInjected&&!o)return null;const a=this._resolveReadyResult(e,s);return a?{kind:"ready",result:a}:null}_resolveReadyResult(t,e){var n;const i=this._resolvePlaybackDurationAdapter(t)??{kind:"document",getDuration:()=>0};let s=i.getDuration();if(!Number.isFinite(s)||s<=0){if(i.kind==="direct-timeline")return null;s=e?((n=Ge(e))==null?void 0:n.durationSeconds)??0:0}return s<=0?null:{duration:s,adapter:{...i,getDuration:()=>s},compositionSize:at(e)}}stop(){this._runtimeScript&&(this._runtimeScript.onerror=null,this._runtimeScript=null),this.failed||(this._failure=null),this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{const t=this._iframe.contentWindow;return t?this._resolveDirectTimelineAdapterFromWindow(t):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(t){return this._resolveDirectTimelineAdapterFromWindow(t)}hasRuntimeBridge(t){return F(Reflect.get(t,"__player"))}_injectRuntime(){var t,e,i,s;this._runtimeInjected=!0;try{const n=this._iframe.contentDocument;if(!n)return;const o=n.createElement("script");o.src=((e=(t=this._callbacks).resolveRuntimeUrl)==null?void 0:e.call(t))??B,this._runtimeScript=o,o.onerror=()=>{this._runtimeScript!==o||this._iframe.contentDocument!==n||(this.stop(),this._failure={document:n},this._callbacks.onError("HyperFrames runtime failed to load from "+o.src))},(n.head||n.documentElement).appendChild(o),(s=(i=this._callbacks).onRuntimeInjected)==null||s.call(i)}catch{}}_resolveDirectTimelineAdapterFromWindow(t){var a,c;if(this.hasRuntimeBridge(t))return null;const e=Reflect.get(t,"__timelines");if(!F(e))return null;const i=Object.keys(e);if(i.length===0)return null;const s=(c=(a=this._iframe.contentDocument)==null?void 0:a.querySelector("[data-composition-id]"))==null?void 0:c.getAttribute("data-composition-id"),n=s&&s in e?s:i[i.length-1],o=e[n];return nt(o)?o:null}_resolvePlaybackDurationAdapter(t){const e=Reflect.get(t,"__player");if(rt(e))return{kind:"runtime",getDuration:()=>e.getDuration()};const i=this._resolveDirectTimelineAdapterFromWindow(t);return i?{kind:"direct-timeline",timeline:i,getDuration:()=>i.duration()}:null}}const lt=`
2
2
  :host {
3
3
  display: block;
4
4
  position: relative;
@@ -561,5 +561,5 @@ var je=Object.defineProperty;var Be=(r,t,e)=>t in r?je(r,t,{enumerable:!0,config
561
561
  background: var(--hfp-accent, #fff);
562
562
  pointer-events: none;
563
563
  }
564
- `,ut='<svg width="24" height="24" viewBox="46 21 54 56" fill="currentColor"><path d="M87.5129 57.5141L56.9696 73.5433C52.8371 75.7098 48.7046 73.2553 49.6688 69.2104L58.9483 30.1391C59.9125 26.0942 65.2097 23.6397 68.3154 25.8062L91.2447 41.8354C96.4668 45.4796 94.4631 53.8699 87.5129 57.5141Z"/></svg>',ct='<svg width="24" height="24" viewBox="0 0 18 18" fill="currentColor"><rect x="3" y="2" width="4" height="14"/><rect x="11" y="2" width="4" height="14"/></svg>',Ee='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/><path d="M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></svg>',Re='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/></svg>',pt='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z" opacity="0.3"/><line x1="18" y1="7" x2="14" y2="17" stroke="currentColor" stroke-width="2"/></svg>',ft=[.25,.5,1,1.5,2,4];function M(r){return Number.isInteger(r)?`${r}x`:`${r}x`}function Ce(r){if(!Number.isFinite(r)||r<0)return"0:00";const t=Math.floor(r),e=Math.floor(t/60),i=t%60;return`${e}:${i.toString().padStart(2,"0")}`}function mt(r,t,e={}){const i=e.speedPresets??ft,s=document.createElement("div");s.className="hfp-controls",s.addEventListener("click",d=>{d.stopPropagation()});const n=document.createElement("button");n.className="hfp-play-btn",n.type="button",n.innerHTML=`<span class="hfp-ico hfp-ico-play">${ut}</span><span class="hfp-ico hfp-ico-pause">${ct}</span>`,n.setAttribute("aria-label","Play");const o=document.createElement("div");o.className="hfp-scrubber";const a=document.createElement("div");a.className="hfp-progress",a.style.width="0%",o.appendChild(a);const c=document.createElement("span");c.className="hfp-time",c.textContent="0:00 / 0:00";const p=document.createElement("div");p.className="hfp-speed-wrap";const l=document.createElement("button");l.className="hfp-speed-btn",l.type="button",l.textContent="1x",l.setAttribute("aria-label","Playback speed: 1x");const g=document.createElement("div");g.className="hfp-speed-menu",g.setAttribute("role","menu");for(const d of i){const u=document.createElement("button");u.className="hfp-speed-option",u.type="button",u.setAttribute("role","menuitem"),u.dataset.speed=String(d),u.textContent=M(d),d===1&&u.classList.add("hfp-active"),g.appendChild(u)}p.appendChild(g),p.appendChild(l);const _=document.createElement("div");_.className="hfp-volume-wrap";const m=document.createElement("button");m.className="hfp-mute-btn",m.type="button",m.innerHTML=Ee,m.setAttribute("aria-label","Mute");const y=document.createElement("div");y.className="hfp-volume-slider-wrap";const f=document.createElement("div");f.className="hfp-volume-slider",f.setAttribute("role","slider"),f.setAttribute("aria-label","Volume"),f.setAttribute("aria-valuemin","0"),f.setAttribute("aria-valuemax","100"),f.setAttribute("aria-valuenow","100"),f.tabIndex=0;const b=document.createElement("div");b.className="hfp-volume-fill",b.style.width="100%",f.appendChild(b),y.appendChild(f),_.appendChild(y),_.appendChild(m),e.audioLocked&&(_.style.display="none"),s.appendChild(n),s.appendChild(o),s.appendChild(c),s.appendChild(_),s.appendChild(p),r.appendChild(s);let w=!1,S=!1,R=1,C=null;i.indexOf(1);const U=(d,u)=>d?pt:u===0||u<.5?Re:Ee;n.addEventListener("click",d=>{d.stopPropagation(),w?t.onPause():t.onPlay()}),m.addEventListener("click",d=>{d.stopPropagation(),t.onMuteToggle()});let k=!1;const V=d=>{const u=f.getBoundingClientRect(),v=Math.max(0,Math.min(1,(d-u.left)/u.width));R=v,b.style.width=`${v*100}%`,f.setAttribute("aria-valuenow",String(Math.round(v*100))),S&&v>0&&t.onMuteToggle(),m.innerHTML=U(S,v),t.onVolumeChange(v)};f.addEventListener("mousedown",d=>{d.stopPropagation(),k=!0,V(d.clientX)});const oe=d=>{k&&V(d.clientX)},ae=()=>{k=!1};document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ae),f.addEventListener("touchstart",d=>{k=!0;const u=d.touches[0];u&&V(u.clientX)},{passive:!0});const de=d=>{if(k){const u=d.touches[0];u&&V(u.clientX)}},he=()=>{k=!1};document.addEventListener("touchmove",de,{passive:!0}),document.addEventListener("touchend",he);const le=.05;f.addEventListener("keydown",d=>{let u=R;if(d.key==="ArrowRight"||d.key==="ArrowUp")u=Math.min(1,R+le);else if(d.key==="ArrowLeft"||d.key==="ArrowDown")u=Math.max(0,R-le);else return;d.preventDefault(),d.stopPropagation(),R=u,b.style.width=`${u*100}%`,f.setAttribute("aria-valuenow",String(Math.round(u*100))),S&&u>0&&t.onMuteToggle(),m.innerHTML=U(S,u),t.onVolumeChange(u)});const ue=d=>{for(const u of g.querySelectorAll(".hfp-speed-option"))u.classList.toggle("hfp-active",u.dataset.speed===String(d))};l.addEventListener("click",d=>{d.stopPropagation();const u=g.classList.toggle("hfp-open");l.setAttribute("aria-expanded",String(u))}),g.addEventListener("click",d=>{d.stopPropagation();const u=d.target.closest(".hfp-speed-option");if(!u)return;const v=parseFloat(u.dataset.speed);i.indexOf(v),l.textContent=M(v),l.setAttribute("aria-label",`Playback speed: ${M(v)}`),ue(v),g.classList.remove("hfp-open"),l.setAttribute("aria-expanded","false"),t.onSpeedChange(v)});const ce=()=>{g.classList.remove("hfp-open"),l.setAttribute("aria-expanded","false")};document.addEventListener("click",ce);const H=d=>{const u=o.getBoundingClientRect(),v=Math.max(0,Math.min(1,(d-u.left)/u.width));t.onSeek(v)};let T=!1;o.addEventListener("mousedown",d=>{var u;d.stopPropagation(),T=!0,(u=t.onScrubStart)==null||u.call(t),H(d.clientX)});const pe=d=>{T&&H(d.clientX)},fe=()=>{var d;T&&(T=!1,(d=t.onScrubEnd)==null||d.call(t))};document.addEventListener("mousemove",pe),document.addEventListener("mouseup",fe),o.addEventListener("touchstart",d=>{var v;T=!0,(v=t.onScrubStart)==null||v.call(t);const u=d.touches[0];u&&H(u.clientX)},{passive:!0});const me=d=>{if(T){const u=d.touches[0];u&&H(u.clientX)}},_e=()=>{var d;T&&(T=!1,(d=t.onScrubEnd)==null||d.call(t))};document.addEventListener("touchmove",me,{passive:!0}),document.addEventListener("touchend",_e);const ge=()=>w&&!T&&!k&&!s.querySelector(":focus-visible"),ye=()=>{s.classList.remove("hfp-hidden"),C&&clearTimeout(C),C=setTimeout(()=>{ge()&&s.classList.add("hfp-hidden")},3e3)},E=r instanceof ShadowRoot?r.host:r,P=()=>ye(),ve=()=>{ge()&&s.classList.add("hfp-hidden")};return E.addEventListener("mousemove",P),E.addEventListener("keydown",P),E.addEventListener("focusin",P),E.addEventListener("mouseleave",ve),{updateTime(d,u){const v=u>0?Math.min(d,u):d,$e=u>0?v/u*100:0;a.style.width=`${$e}%`,c.textContent=`${Ce(v)} / ${Ce(u)}`},updatePlaying(d){const u=d!==w;w=d,n.classList.toggle("hfp-playing",d),n.setAttribute("aria-label",d?"Pause":"Play"),d?u&&ye():(C&&clearTimeout(C),s.classList.remove("hfp-hidden"))},updateSpeed(d){i.indexOf(d),l.textContent=M(d),l.setAttribute("aria-label",`Playback speed: ${M(d)}`),ue(d)},updateMuted(d){S=d,m.innerHTML=U(d,R),m.setAttribute("aria-label",d?"Unmute":"Mute")},updateVolume(d){R=d,b.style.width=`${d*100}%`,f.setAttribute("aria-valuenow",String(Math.round(d*100))),m.innerHTML=U(S,d)},setVolumeControlsHidden(d){_.style.display=d?"none":""},show(){s.style.display=""},hide(){s.style.display="none"},destroy(){document.removeEventListener("mousemove",pe),document.removeEventListener("mouseup",fe),document.removeEventListener("touchmove",me),document.removeEventListener("touchend",_e),document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ae),document.removeEventListener("touchmove",de),document.removeEventListener("touchend",he),document.removeEventListener("click",ce),E.removeEventListener("mousemove",P),E.removeEventListener("keydown",P),E.removeEventListener("focusin",P),E.removeEventListener("mouseleave",ve),C&&clearTimeout(C),s.remove()}}}function _t(r,t,e,i,s,n=!1){const o=i?i.split(",").map(Number).filter(p=>!isNaN(p)&&p>0):void 0,a={...o?{speedPresets:o}:{},audioLocked:n},c=mt(r,s,a);return c.updateMuted(t),c.updateVolume(e),c}function ke(r,t,e){return t?(e||(e=document.createElement("img"),e.className="hfp-poster",r.appendChild(e)),e.src=t,e):(e==null||e.remove(),null)}function gt(r){return r.composedPath().some(t=>t instanceof HTMLElement&&t.classList.contains("hfp-controls"))}let W=null;function yt(r,t){if(typeof CSSStyleSheet<"u")try{W||(W=new CSSStyleSheet,W.replaceSync(t)),r.adoptedStyleSheets=[W];return}catch{}const e=document.createElement("style");e.textContent=t,r.appendChild(e)}function vt(){const r=document.createElement("div");r.className="hfp-container";const t=document.createElement("iframe");return t.className="hfp-iframe",t.sandbox.add("allow-scripts","allow-same-origin"),t.allow="autoplay; fullscreen",t.referrerPolicy="no-referrer",t.title="HyperFrames Composition",t.setAttribute(Ye,""),r.appendChild(t),{container:r,iframe:t}}function bt(r,t,e,i){const s=r.offsetWidth,n=r.offsetHeight;if(s===0||n===0)return!1;const o=Math.min(s/e,n/i);return t.style.width=`${e}px`,t.style.height=`${i}px`,t.style.transform=`translate(-50%, -50%) scale(${o})`,!0}const wt=100,At=.001;function St(r,t,e){if(e.end<=0)return!1;const i=e.shown<e.end&&t>0?t+At:0;return r+i>=e.end}class Tt{constructor(t){h(this,"_raf",null);h(this,"_lastUpdateMs",0);h(this,"_tick",null);this._callbacks=t}start(t,e,i,s,n){this.stop();let o=null,a=0,c=0;const p=()=>{if(s()){this._raf=null;return}let l;try{l=t.time()}catch{this._raf=null;return}const g=i(),_=n();_.end>0&&(l=Math.min(l,_.end));const m=o===null?0:l-o;m!==0&&(c=Math.min(m,a),a=m),o=l;const y=St(l,c,_);y&&(l=_.shown);const f=performance.now();if((f-this._lastUpdateMs>wt||y)&&(this._lastUpdateMs=f,this._callbacks.onTimeUpdate(l,g)),y){if(this._callbacks.getLoop()){this._callbacks.restart();return}try{t.pause(),_.shown<_.end&&t.seek(_.shown,!1)}catch{}this._callbacks.onPaused(),this._raf=null;return}this._raf=requestAnimationFrame(p)};this._tick=p,this._raf=requestAnimationFrame(p)}poll(){this._raf===null||!this._tick||(cancelAnimationFrame(this._raf),this._tick())}stop(){this._raf!==null&&(cancelAnimationFrame(this._raf),this._raf=null)}get isRunning(){return this._raf!==null}}function Et(r){const t=Array.from(r.querySelectorAll("[data-composition-id]"));if(t.length===0)return r.body?[r.body]:[];const e=[];for(const i of t)Ct(i)||e.push(i);return Rt(r),e}function Rt(r){const t=r.body;if(!t||typeof console>"u"||typeof console.warn!="function")return;const e=t.querySelectorAll("audio[data-start], video[data-start]");if(e.length===0)return;const i=[];for(const s of e)s.closest("[data-composition-id]")||i.push(s);i.length!==0&&console.warn(`[hyperframes-player] selectMediaObserverTargets: composition hosts are present, but ${i.length} body-level timed media element(s) sit outside every [data-composition-id] subtree and will not be observed. Move them inside a composition host or the parent-frame proxy will never adopt them.`,i)}function Ct(r){let t=r.parentElement;for(;t;){if(t.hasAttribute("data-composition-id"))return!0;t=t.parentElement}return!1}const X=.04,kt=.5,Pt=.03,Lt=[[.3,.25],[.1,.1]],Dt=.01,Mt=.1,xt=.1,It=.65,L=new WeakMap,q=new WeakSet;function Ot(r,t,e,i,s=r.tagName==="AUDIO"){var g;const n=Math.abs(t);if(s&&Xe())return L.delete(r),{rate:e,seek:i&&n>It};i&&n<=X&&q.delete(r);const o=!q.has(r)||n>kt;if(s&&i&&n>xt&&o)return L.delete(r),q.add(r),{rate:e,seek:!0};const a=Math.sign(t),c=L.get(r);if(n>X)L.set(r,a);else if(c!==a||n<=Dt)return L.delete(r),{rate:e,seek:!1};const p=((g=Lt.find(([_])=>n>_))==null?void 0:g[1])??Pt,l=s?Math.min(p,Mt):p;return{rate:e*(1+a*l),seek:!1}}function Nt(r){L.delete(r),q.delete(r)}const Ft=.004,Ut=1.5;class Vt{constructor(t){h(this,"_entries",[]);h(this,"_mediaObserver");h(this,"_playbackErrorPosted",!1);h(this,"_audioOwner","runtime");h(this,"_urlAudioEntry",null);h(this,"_urlAudioSrc",null);h(this,"_dispatchEvent");h(this,"_getMuted");h(this,"_getVolume");h(this,"_getPlaybackRate");h(this,"_getCurrentTime");h(this,"_isPaused");this._dispatchEvent=t.dispatchEvent,this._getMuted=t.getMuted,this._getVolume=t.getVolume,this._getPlaybackRate=t.getPlaybackRate,this._getCurrentTime=t.getCurrentTime,this._isPaused=t.isPaused}get audioOwner(){return this._audioOwner}get entries(){return this._entries}resetForIframeLoad(){this._playbackErrorPosted=!1;const t=this._audioOwner==="parent";this._audioOwner="runtime",this.pauseAll();for(const e of this._entries)e!==this._urlAudioEntry&&(e.el.src="");this._entries=this._urlAudioEntry?[this._urlAudioEntry]:[],this._urlAudioSrc&&!this._urlAudioEntry&&(this._urlAudioEntry=this._createEntry(this._urlAudioSrc,"audio",0,1/0)),this.teardownObserver(),t&&this._dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"runtime",reason:"iframe-reload"}}))}destroy(){this.teardownObserver();for(const t of this._entries)t.el.pause(),t.el.src="";this._entries=[],this._urlAudioEntry=null,this._urlAudioSrc=null,this._audioOwner="runtime",this._playbackErrorPosted=!1}updateMuted(t){for(const e of this._entries)e.el.muted=t}updateVolume(t){for(const e of this._entries)e.el.volume=t}updatePlaybackRate(t){for(const e of this._entries)e.el.playbackRate=t}_playEntry(t){t.el.src&&t.el.play().catch(e=>this._reportPlaybackError(e))}_playEntryIfActive(t){this._refreshEntryBounds(t),this._inWindow(t,this._getCurrentTime())&&this._playEntry(t)}_refreshEntryBounds(t){var i;if(!((i=t.source)!=null&&i.isConnected))return;const e=be(t.source);t.start=e.start??0,t.mediaStart=we(t.source).mediaStart,t.duration=e.duration!=null&&e.duration>0?e.duration:Number.POSITIVE_INFINITY}_inWindow(t,e){return Ke(e,t.start,t.start+t.duration)}_preseekUpcoming(t,e){const i=t.start-e;i<=0||i>Ut||!t.el.paused||Math.abs(t.el.currentTime-t.mediaStart)>X&&this._seekTo(t,t.mediaStart)}_seekTo(t,e,i=!1){const s=i?(t.seekLatency??0)*this._getPlaybackRate():0;t.seekIssuedAt=i?performance.now():void 0,t.el.currentTime=Ue(e+s)}_noteSeekLanded(t){if(t.seekIssuedAt===void 0)return;const e=(performance.now()-t.seekIssuedAt)/1e3;t.seekLatency=t.seekLatency===void 0?e:(t.seekLatency+e)/2,t.seekIssuedAt=void 0}_releaseSteering(t){Nt(t.el),t.lastOffset=void 0;const e=this._getPlaybackRate();t.el.playbackRate!==e&&(t.el.playbackRate=e)}_mediaTime(t,e){return e-t.start+t.mediaStart}_gateEntryPlayback(t,e){return this._inWindow(t,e)?(this._audioOwner==="parent"&&!this._isPaused()&&t.el.paused&&this._playEntry(t),!0):(t.el.paused||t.el.pause(),this._releaseSteering(t),!1)}playAll(){for(const t of this._entries)this._playEntryIfActive(t)}primeAll(){if(Ze())for(const t of this._entries)t.el.paused&&(t.el.play().catch(()=>{}),t.el.pause())}pauseAll(){for(const t of this._entries)t.el.pause()}stopAdoptedMedia(){for(const t of this._entries)t.source&&t.el.pause()}seekAll(t){for(const e of this._entries)this._refreshEntryBounds(e),this._inWindow(e,t)&&this._jumpTo(e,this._mediaTime(e,t))}scrubAll(t){for(const e of this._entries)this._refreshEntryBounds(e),this._inWindow(e,t)?(this._jumpTo(e,this._mediaTime(e,t)),this._playEntry(e)):e.el.paused||e.el.pause()}mirrorTime(t,e){const i=(e==null?void 0:e.force)===!0;for(const s of this._entries){this._refreshEntryBounds(s),this._preseekUpcoming(s,t);const n=s.el.paused;if(!this._gateEntryPlayback(s,t))continue;const o=this._mediaTime(s,t),a=o-s.el.currentTime;if(i||n){Math.abs(a)>X&&this._jumpTo(s,o);continue}this._steer(s,o,a)}}_steer(t,e,i){const s=t.lastOffset!==void 0&&Math.abs(i-t.lastOffset)<Ft;t.lastOffset=i;const{rate:n,seek:o}=Ot(t.el,i,this._getPlaybackRate(),s,!0);o?this._jumpTo(t,e,!0):Math.abs(t.el.playbackRate-n)>1e-6&&(t.el.playbackRate=n)}_jumpTo(t,e,i=!1){this._seekTo(t,e,i),this._releaseSteering(t)}promoteToParentProxy(t,e){if(this._audioOwner==="parent")return;if(this._audioOwner="parent",t)for(const s of t.querySelectorAll("video, audio"))A(s)&&(s.muted=!0);for(const s of[...this._entries])this._repointToSource(s);const i=this._getCurrentTime();e?e(i,{force:!0}):this.mirrorTime(i,{force:!0}),this._isPaused()||this.playAll(),this._dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"parent",reason:"autoplay-blocked"}}))}setupFromIframe(t){const e=t.querySelectorAll("audio[data-start], video[data-start]");for(const i of e)A(i)&&this._adoptIframeMedia(i);this._observeDynamicMedia(t)}setupFromUrl(t){if(this._urlAudioSrc===t&&this._urlAudioEntry)return;this.teardownUrlAudio();const e=this._createEntry(t,"audio",0,1/0);this._urlAudioEntry=e,this._urlAudioSrc=t,e&&this._audioOwner==="parent"&&!this._isPaused()&&(this.mirrorTime(this._getCurrentTime(),{force:!0}),this.playAll())}teardownUrlAudio(){const t=this._urlAudioEntry;if(this._urlAudioEntry=null,this._urlAudioSrc=null,!t)return;t.el.pause(),t.el.src="";const e=this._entries.indexOf(t);e!==-1&&this._entries.splice(e,1)}teardownObserver(){var t;(t=this._mediaObserver)==null||t.disconnect(),this._mediaObserver=void 0}_reportPlaybackError(t){this._playbackErrorPosted||(this._playbackErrorPosted=!0,this._dispatchEvent(new CustomEvent("playbackerror",{detail:{source:"parent-proxy",error:t}})))}_createEntry(t,e,i,s,n){if(!n&&this._urlTaken(t))return null;const o=e==="video"?document.createElement("video"):new Audio;o.preload="auto";const a=n==null?void 0:n.getAttribute("crossorigin");a!=null&&o.setAttribute("crossorigin",a),o.src=t,o.load(),o.muted=this._getMuted(),o.volume=this._getVolume();const c=this._getPlaybackRate();c!==1&&(o.playbackRate=c);const p={el:o,start:i,duration:s,mediaStart:n?we(n).mediaStart:0,source:n};return o.addEventListener("seeked",()=>this._noteSeekLanded(p)),this._entries.push(p),p}_resolveIframeMediaSrc(t){var i;const e=t.getAttribute("src")||((i=t.querySelector("source"))==null?void 0:i.getAttribute("src"));return e?new URL(e,t.ownerDocument.baseURI).href:null}_adoptIframeMedia(t){if(t.preload==="metadata"||t.preload==="none"||this._entries.some(c=>c.source===t)||t.tagName==="VIDEO"&&t.hasAttribute("muted"))return;const e=this._resolveIframeMediaSrc(t);if(!e)return;const i=be(t),s=i.start??0,n=i.duration??Number.POSITIVE_INFINITY,o=t.tagName==="VIDEO"?"video":"audio",a=this._createEntry(e,o,s,n,t);a&&this._audioOwner==="parent"&&(this.mirrorTime(this._getCurrentTime(),{force:!0}),this._isPaused()||this._playEntryIfActive(a))}_followIframeMediaSrc(t){const e=this._entries.find(i=>i.source===t);if(!e)return this._adoptIframeMedia(t);this._audioOwner!=="parent"||!this._repointToSource(e)||(this.mirrorTime(this._getCurrentTime(),{force:!0}),this._isPaused()||this._playEntryIfActive(e))}_urlTaken(t){return this._entries.some(e=>e.source&&!e.source.isConnected?!1:(e.source&&this._resolveIframeMediaSrc(e.source)||e.el.src)===t)}_repointToSource(t){const e=t.source?this._resolveIframeMediaSrc(t.source):null;return!e||t.el.src===e?!1:(t.el.src=e,t.el.load(),!0)}_detachIframeMedia(t){const e=this._entries.find(i=>i.source===t);e&&this._removeEntry(e)}_removeEntry(t){t.el.pause(),t.el.src="",this._entries.splice(this._entries.indexOf(t),1)}_observeDynamicMedia(t){if(this.teardownObserver(),typeof MutationObserver>"u"||!t.body)return;const e=new MutationObserver(n=>{for(const o of n){if(o.type==="attributes"&&o.attributeName==="src"){const a=o.target;A(a)&&a.matches("audio[data-start], video[data-start]")&&this._followIframeMediaSrc(a);continue}if(o.type==="attributes"&&o.attributeName==="preload"){const a=o.target;A(a)&&a.matches("audio[data-start], video[data-start]")&&(a.preload==="auto"?this._adoptIframeMedia(a):this._detachIframeMedia(a));continue}for(const a of o.addedNodes){if(!Ae(a))continue;const c=[];A(a)&&a.matches("audio[data-start], video[data-start]")&&c.push(a);const p=a.querySelectorAll("audio[data-start], video[data-start]");for(const l of p)A(l)&&c.push(l);for(const l of c)this._adoptIframeMedia(l)}for(const a of o.removedNodes){if(!Ae(a))continue;const c=[];A(a)&&a.matches("audio[data-start], video[data-start]")&&c.push(a);const p=a.querySelectorAll("audio[data-start], video[data-start]");for(const l of p)A(l)&&c.push(l);for(const l of c)this._detachIframeMedia(l)}}}),i={childList:!0,subtree:!0,attributes:!0,attributeFilter:["preload","src"]},s=Et(t);for(const n of s)e.observe(n,i);this._mediaObserver=e}}function Pe(r,t,e){if(r===null&&t===null)return{range:null,clamped:!1};const i=r??0,s=t!==null&&e>0&&t>e,n=s?e:t,o=n??(e>0?e:1/0);return!(i>=0)||!(o>i)?{range:null,clamped:!0}:{range:{start:i,end:n},clamped:s}}function re(r,t,e){const i=r.end??t;return i<t?Je(r.start,i,e):i}function Le(r,t,e,i){return r<t.start||r>=re(t,e,i)}const Ht=100;function Wt(r,t){return typeof r.currentTime=="number"&&Number.isFinite(r.currentTime)?r.currentTime:(r.frame??0)/t}function Ve(r,t,e){return e<=0?!1:r.ended===!0?!0:r.ended===!1&&!r.isPlaying?!1:t>=e}function zt(r,t,e,i,s,n){const{duration:o}=e;if(!s){const a=Ve(r,t,o);return{start:0,shownAtEnd:o,atEnd:a,stopRuntime:!1,entering:!1}}if(r.ownsRange){const a=i&&r.ended===!0&&!r.isPlaying;return{start:s.start,shownAtEnd:t,atEnd:a,stopRuntime:!1,entering:!1}}return $t(r,t,e,i,s,n)}function $t(r,t,e,i,s,n){const o=s.end??e.duration,a=e.enteringRange===!0&&(t<s.start||t>=o);return{start:s.start,shownAtEnd:re(s,e.duration,n),atEnd:i&&!a&&Ve(r,t,o),stopRuntime:r.isPlaying,entering:a}}function jt(r,t,e,i){var S;const s=Wt(r,t),n=!e.paused,o=n||r.isPlaying,a=(S=i.getPlayRange)==null?void 0:S.call(i),c=zt(r,s,e,o,a,t),{atEnd:p,start:l}=c,g=e.duration>0?Math.min(s,e.duration):s,_=p?c.shownAtEnd:g,m=!r.isPlaying,y=p&&o;if(y&&i.getLoop())return i.media.audioOwner==="parent"&&i.media.pauseAll(),i.seek(l),i.play(),{...e,currentTime:l,paused:!1,enteringRange:!0};const f={...e,currentTime:_,paused:m,enteringRange:c.entering};i.media.audioOwner==="parent"&&(n&&m?i.media.pauseAll():!n&&!m&&i.media.playAll(),i.media.mirrorTime(_));const b=performance.now(),w=m!==e.paused;return(b-e.lastUpdateMs>Ht||w)&&(f.lastUpdateMs=b,i.updateControlsTime(_,e.duration),i.updateControlsPlaying(!m),i.dispatchEvent(new CustomEvent("timeupdate",{detail:{currentTime:_}}))),y&&(c.stopRuntime&&i.seek(_),i.media.audioOwner==="parent"&&i.media.pauseAll(),f.paused=!0,i.updateControlsPlaying(!1),i.dispatchEvent(new Event("ended"))),f}function Bt(r){return Array.isArray(r)?r.filter(t=>typeof t=="object"&&t!==null&&typeof t.id=="string"&&typeof t.start=="number"&&typeof t.duration=="number"):[]}function qt(r,t,e){var o,a,c,p,l,g,_;if(r.source!==t)return;const i=r.data;if(!i||i.source!=="hf-preview")return;const s=Qe(i);if(s.status==="unsupported"){e.dispatchEvent(new CustomEvent("runtimeprotocolerror",{detail:{code:s.code,receivedVersion:s.receivedVersion}}));return}(o=e.setRuntimeFps)==null||o.call(e,s.fps);const n=s.status==="supported"&&s.metadata.capabilities.includes("play-range");if((a=e.setRuntimeOwnsPlayRange)==null||a.call(e,n),i.type==="shader-transition-state"){const m=i.state&&typeof i.state=="object"?i.state:{};e.shaderLoader.update(m,e.getShaderLoadingMode()),e.dispatchEvent(new CustomEvent("shadertransitionstate",{detail:{compositionId:i.compositionId,state:m}}));return}if(i.type==="ready"){e.onRuntimeReady();return}if(i.type==="assets-ready"){(c=e.onRuntimeAssetsReady)==null||c.call(e,i.timedOut===!0);return}if(i.type==="runtime-data-error"){(p=e.onRuntimeDataError)==null||p.call(e,i.channel,i.requestId,i.message);return}if(i.type==="runtime-data-applied"){(l=e.onRuntimeDataApplied)==null||l.call(e,i.channel,i.requestId);return}if(i.type==="state"){e.setPlaybackState(jt({frame:i.frame??0,currentTime:i.currentTime,ended:typeof i.ended=="boolean"?i.ended:void 0,isPlaying:!!i.isPlaying,ownsRange:n},s.fps,e.getPlaybackState(),e)),(g=e.setBuffering)==null||g.call(e,i.buffering===!0);return}if(i.type==="media-autoplay-blocked"){if(((_=e.shouldPromoteMediaAutoplayFallback)==null?void 0:_.call(e))===!1)return;let m=null;try{m=e.getIframeDoc()}catch{}e.media.promoteToParentProxy(m,(y,f)=>e.media.mirrorTime(y,f)),e.sendControl("set-media-output-muted",{muted:!0});return}if(i.type==="timeline"&&i.durationInFrames>0){const m=Number(i.durationSeconds),y=Number(i.durationInFrames),f=Number.isFinite(m)&&m>0?m:y/s.fps;if(Number.isFinite(i.compositionWidth)&&i.compositionWidth>0&&Number.isFinite(i.compositionHeight)&&i.compositionHeight>0&&e.setCompositionSize(i.compositionWidth,i.compositionHeight),Number.isFinite(f)&&f>0){const b=e.getPlaybackState();e.setPlaybackState({...b,duration:f}),e.updateControlsTime(b.currentTime,f),e.onRuntimeTimelineReady(f,typeof i.assetsReady=="boolean"?i.assetsReady:void 0)}e.setScenes(Bt(i.scenes));return}i.type==="stage-size"&&Number.isFinite(i.width)&&i.width>0&&Number.isFinite(i.height)&&i.height>0&&e.setCompositionSize(i.width,i.height)}function Gt(r,t){return r.includes(t)?!0:/hyperframe\.runtime\.iife\.js|__hyperframes\s*=/.test(r)}const Yt=new Set([">"," "," ",`
564
+ `,ut='<svg width="24" height="24" viewBox="46 21 54 56" fill="currentColor"><path d="M87.5129 57.5141L56.9696 73.5433C52.8371 75.7098 48.7046 73.2553 49.6688 69.2104L58.9483 30.1391C59.9125 26.0942 65.2097 23.6397 68.3154 25.8062L91.2447 41.8354C96.4668 45.4796 94.4631 53.8699 87.5129 57.5141Z"/></svg>',ct='<svg width="24" height="24" viewBox="0 0 18 18" fill="currentColor"><rect x="3" y="2" width="4" height="14"/><rect x="11" y="2" width="4" height="14"/></svg>',Ee='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/><path d="M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></svg>',Re='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/></svg>',pt='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z" opacity="0.3"/><line x1="18" y1="7" x2="14" y2="17" stroke="currentColor" stroke-width="2"/></svg>',ft=[.25,.5,1,1.5,2,4];function M(r){return Number.isInteger(r)?`${r}x`:`${r}x`}function Ce(r){if(!Number.isFinite(r)||r<0)return"0:00";const t=Math.floor(r),e=Math.floor(t/60),i=t%60;return`${e}:${i.toString().padStart(2,"0")}`}function mt(r,t,e={}){const i=e.speedPresets??ft,s=document.createElement("div");s.className="hfp-controls",s.addEventListener("click",d=>{d.stopPropagation()});const n=document.createElement("button");n.className="hfp-play-btn",n.type="button",n.innerHTML=`<span class="hfp-ico hfp-ico-play">${ut}</span><span class="hfp-ico hfp-ico-pause">${ct}</span>`,n.setAttribute("aria-label","Play");const o=document.createElement("div");o.className="hfp-scrubber";const a=document.createElement("div");a.className="hfp-progress",a.style.width="0%",o.appendChild(a);const c=document.createElement("span");c.className="hfp-time",c.textContent="0:00 / 0:00";const p=document.createElement("div");p.className="hfp-speed-wrap";const l=document.createElement("button");l.className="hfp-speed-btn",l.type="button",l.textContent="1x",l.setAttribute("aria-label","Playback speed: 1x");const g=document.createElement("div");g.className="hfp-speed-menu",g.setAttribute("role","menu");for(const d of i){const u=document.createElement("button");u.className="hfp-speed-option",u.type="button",u.setAttribute("role","menuitem"),u.dataset.speed=String(d),u.textContent=M(d),d===1&&u.classList.add("hfp-active"),g.appendChild(u)}p.appendChild(g),p.appendChild(l);const _=document.createElement("div");_.className="hfp-volume-wrap";const m=document.createElement("button");m.className="hfp-mute-btn",m.type="button",m.innerHTML=Ee,m.setAttribute("aria-label","Mute");const y=document.createElement("div");y.className="hfp-volume-slider-wrap";const f=document.createElement("div");f.className="hfp-volume-slider",f.setAttribute("role","slider"),f.setAttribute("aria-label","Volume"),f.setAttribute("aria-valuemin","0"),f.setAttribute("aria-valuemax","100"),f.setAttribute("aria-valuenow","100"),f.tabIndex=0;const b=document.createElement("div");b.className="hfp-volume-fill",b.style.width="100%",f.appendChild(b),y.appendChild(f),_.appendChild(y),_.appendChild(m),e.audioLocked&&(_.style.display="none"),s.appendChild(n),s.appendChild(o),s.appendChild(c),s.appendChild(_),s.appendChild(p),r.appendChild(s);let w=!1,S=!1,R=1,C=null;i.indexOf(1);const U=(d,u)=>d?pt:u===0||u<.5?Re:Ee;n.addEventListener("click",d=>{d.stopPropagation(),w?t.onPause():t.onPlay()}),m.addEventListener("click",d=>{d.stopPropagation(),t.onMuteToggle()});let k=!1;const V=d=>{const u=f.getBoundingClientRect(),v=Math.max(0,Math.min(1,(d-u.left)/u.width));R=v,b.style.width=`${v*100}%`,f.setAttribute("aria-valuenow",String(Math.round(v*100))),S&&v>0&&t.onMuteToggle(),m.innerHTML=U(S,v),t.onVolumeChange(v)};f.addEventListener("mousedown",d=>{d.stopPropagation(),k=!0,V(d.clientX)});const oe=d=>{k&&V(d.clientX)},ae=()=>{k=!1};document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ae),f.addEventListener("touchstart",d=>{k=!0;const u=d.touches[0];u&&V(u.clientX)},{passive:!0});const de=d=>{if(k){const u=d.touches[0];u&&V(u.clientX)}},he=()=>{k=!1};document.addEventListener("touchmove",de,{passive:!0}),document.addEventListener("touchend",he);const le=.05;f.addEventListener("keydown",d=>{let u=R;if(d.key==="ArrowRight"||d.key==="ArrowUp")u=Math.min(1,R+le);else if(d.key==="ArrowLeft"||d.key==="ArrowDown")u=Math.max(0,R-le);else return;d.preventDefault(),d.stopPropagation(),R=u,b.style.width=`${u*100}%`,f.setAttribute("aria-valuenow",String(Math.round(u*100))),S&&u>0&&t.onMuteToggle(),m.innerHTML=U(S,u),t.onVolumeChange(u)});const ue=d=>{for(const u of g.querySelectorAll(".hfp-speed-option"))u.classList.toggle("hfp-active",u.dataset.speed===String(d))};l.addEventListener("click",d=>{d.stopPropagation();const u=g.classList.toggle("hfp-open");l.setAttribute("aria-expanded",String(u))}),g.addEventListener("click",d=>{d.stopPropagation();const u=d.target.closest(".hfp-speed-option");if(!u)return;const v=parseFloat(u.dataset.speed);i.indexOf(v),l.textContent=M(v),l.setAttribute("aria-label",`Playback speed: ${M(v)}`),ue(v),g.classList.remove("hfp-open"),l.setAttribute("aria-expanded","false"),t.onSpeedChange(v)});const ce=()=>{g.classList.remove("hfp-open"),l.setAttribute("aria-expanded","false")};document.addEventListener("click",ce);const H=d=>{const u=o.getBoundingClientRect(),v=Math.max(0,Math.min(1,(d-u.left)/u.width));t.onSeek(v)};let T=!1;o.addEventListener("mousedown",d=>{var u;d.stopPropagation(),T=!0,(u=t.onScrubStart)==null||u.call(t),H(d.clientX)});const pe=d=>{T&&H(d.clientX)},fe=()=>{var d;T&&(T=!1,(d=t.onScrubEnd)==null||d.call(t))};document.addEventListener("mousemove",pe),document.addEventListener("mouseup",fe),o.addEventListener("touchstart",d=>{var v;T=!0,(v=t.onScrubStart)==null||v.call(t);const u=d.touches[0];u&&H(u.clientX)},{passive:!0});const me=d=>{if(T){const u=d.touches[0];u&&H(u.clientX)}},_e=()=>{var d;T&&(T=!1,(d=t.onScrubEnd)==null||d.call(t))};document.addEventListener("touchmove",me,{passive:!0}),document.addEventListener("touchend",_e);const ge=()=>w&&!T&&!k&&!s.querySelector(":focus-visible"),ye=()=>{s.classList.remove("hfp-hidden"),C&&clearTimeout(C),C=setTimeout(()=>{ge()&&s.classList.add("hfp-hidden")},3e3)},E=r instanceof ShadowRoot?r.host:r,P=()=>ye(),ve=()=>{ge()&&s.classList.add("hfp-hidden")};return E.addEventListener("mousemove",P),E.addEventListener("keydown",P),E.addEventListener("focusin",P),E.addEventListener("mouseleave",ve),{updateTime(d,u){const v=u>0?Math.min(d,u):d,$e=u>0?v/u*100:0;a.style.width=`${$e}%`,c.textContent=`${Ce(v)} / ${Ce(u)}`},updatePlaying(d){const u=d!==w;w=d,n.classList.toggle("hfp-playing",d),n.setAttribute("aria-label",d?"Pause":"Play"),d?u&&ye():(C&&clearTimeout(C),s.classList.remove("hfp-hidden"))},updateSpeed(d){i.indexOf(d),l.textContent=M(d),l.setAttribute("aria-label",`Playback speed: ${M(d)}`),ue(d)},updateMuted(d){S=d,m.innerHTML=U(d,R),m.setAttribute("aria-label",d?"Unmute":"Mute")},updateVolume(d){R=d,b.style.width=`${d*100}%`,f.setAttribute("aria-valuenow",String(Math.round(d*100))),m.innerHTML=U(S,d)},setVolumeControlsHidden(d){_.style.display=d?"none":""},show(){s.style.display=""},hide(){s.style.display="none"},destroy(){document.removeEventListener("mousemove",pe),document.removeEventListener("mouseup",fe),document.removeEventListener("touchmove",me),document.removeEventListener("touchend",_e),document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ae),document.removeEventListener("touchmove",de),document.removeEventListener("touchend",he),document.removeEventListener("click",ce),E.removeEventListener("mousemove",P),E.removeEventListener("keydown",P),E.removeEventListener("focusin",P),E.removeEventListener("mouseleave",ve),C&&clearTimeout(C),s.remove()}}}function _t(r,t,e,i,s,n=!1){const o=i?i.split(",").map(Number).filter(p=>!isNaN(p)&&p>0):void 0,a={...o?{speedPresets:o}:{},audioLocked:n},c=mt(r,s,a);return c.updateMuted(t),c.updateVolume(e),c}function ke(r,t,e){return t?(e||(e=document.createElement("img"),e.className="hfp-poster",r.appendChild(e)),e.src=t,e):(e==null||e.remove(),null)}function gt(r){return r.composedPath().some(t=>t instanceof HTMLElement&&t.classList.contains("hfp-controls"))}let W=null;function yt(r,t){if(typeof CSSStyleSheet<"u")try{W||(W=new CSSStyleSheet,W.replaceSync(t)),r.adoptedStyleSheets=[W];return}catch{}const e=document.createElement("style");e.textContent=t,r.appendChild(e)}function vt(){const r=document.createElement("div");r.className="hfp-container";const t=document.createElement("iframe");return t.className="hfp-iframe",t.sandbox.add("allow-scripts","allow-same-origin"),t.allow="autoplay; fullscreen",t.referrerPolicy="same-origin",t.title="HyperFrames Composition",t.setAttribute(Ye,""),r.appendChild(t),{container:r,iframe:t}}function bt(r,t,e,i){const s=r.offsetWidth,n=r.offsetHeight;if(s===0||n===0)return!1;const o=Math.min(s/e,n/i);return t.style.width=`${e}px`,t.style.height=`${i}px`,t.style.transform=`translate(-50%, -50%) scale(${o})`,!0}const wt=100,At=.001;function St(r,t,e){if(e.end<=0)return!1;const i=e.shown<e.end&&t>0?t+At:0;return r+i>=e.end}class Tt{constructor(t){h(this,"_raf",null);h(this,"_lastUpdateMs",0);h(this,"_tick",null);this._callbacks=t}start(t,e,i,s,n){this.stop();let o=null,a=0,c=0;const p=()=>{if(s()){this._raf=null;return}let l;try{l=t.time()}catch{this._raf=null;return}const g=i(),_=n();_.end>0&&(l=Math.min(l,_.end));const m=o===null?0:l-o;m!==0&&(c=Math.min(m,a),a=m),o=l;const y=St(l,c,_);y&&(l=_.shown);const f=performance.now();if((f-this._lastUpdateMs>wt||y)&&(this._lastUpdateMs=f,this._callbacks.onTimeUpdate(l,g)),y){if(this._callbacks.getLoop()){this._callbacks.restart();return}try{t.pause(),_.shown<_.end&&t.seek(_.shown,!1)}catch{}this._callbacks.onPaused(),this._raf=null;return}this._raf=requestAnimationFrame(p)};this._tick=p,this._raf=requestAnimationFrame(p)}poll(){this._raf===null||!this._tick||(cancelAnimationFrame(this._raf),this._tick())}stop(){this._raf!==null&&(cancelAnimationFrame(this._raf),this._raf=null)}get isRunning(){return this._raf!==null}}function Et(r){const t=Array.from(r.querySelectorAll("[data-composition-id]"));if(t.length===0)return r.body?[r.body]:[];const e=[];for(const i of t)Ct(i)||e.push(i);return Rt(r),e}function Rt(r){const t=r.body;if(!t||typeof console>"u"||typeof console.warn!="function")return;const e=t.querySelectorAll("audio[data-start], video[data-start]");if(e.length===0)return;const i=[];for(const s of e)s.closest("[data-composition-id]")||i.push(s);i.length!==0&&console.warn(`[hyperframes-player] selectMediaObserverTargets: composition hosts are present, but ${i.length} body-level timed media element(s) sit outside every [data-composition-id] subtree and will not be observed. Move them inside a composition host or the parent-frame proxy will never adopt them.`,i)}function Ct(r){let t=r.parentElement;for(;t;){if(t.hasAttribute("data-composition-id"))return!0;t=t.parentElement}return!1}const X=.04,kt=.5,Pt=.03,Lt=[[.3,.25],[.1,.1]],Dt=.01,Mt=.1,xt=.1,It=.65,L=new WeakMap,q=new WeakSet;function Ot(r,t,e,i,s=r.tagName==="AUDIO"){var g;const n=Math.abs(t);if(s&&Xe())return L.delete(r),{rate:e,seek:i&&n>It};i&&n<=X&&q.delete(r);const o=!q.has(r)||n>kt;if(s&&i&&n>xt&&o)return L.delete(r),q.add(r),{rate:e,seek:!0};const a=Math.sign(t),c=L.get(r);if(n>X)L.set(r,a);else if(c!==a||n<=Dt)return L.delete(r),{rate:e,seek:!1};const p=((g=Lt.find(([_])=>n>_))==null?void 0:g[1])??Pt,l=s?Math.min(p,Mt):p;return{rate:e*(1+a*l),seek:!1}}function Nt(r){L.delete(r),q.delete(r)}const Ft=.004,Ut=1.5;class Vt{constructor(t){h(this,"_entries",[]);h(this,"_mediaObserver");h(this,"_playbackErrorPosted",!1);h(this,"_audioOwner","runtime");h(this,"_urlAudioEntry",null);h(this,"_urlAudioSrc",null);h(this,"_dispatchEvent");h(this,"_getMuted");h(this,"_getVolume");h(this,"_getPlaybackRate");h(this,"_getCurrentTime");h(this,"_isPaused");this._dispatchEvent=t.dispatchEvent,this._getMuted=t.getMuted,this._getVolume=t.getVolume,this._getPlaybackRate=t.getPlaybackRate,this._getCurrentTime=t.getCurrentTime,this._isPaused=t.isPaused}get audioOwner(){return this._audioOwner}get entries(){return this._entries}resetForIframeLoad(){this._playbackErrorPosted=!1;const t=this._audioOwner==="parent";this._audioOwner="runtime",this.pauseAll();for(const e of this._entries)e!==this._urlAudioEntry&&(e.el.src="");this._entries=this._urlAudioEntry?[this._urlAudioEntry]:[],this._urlAudioSrc&&!this._urlAudioEntry&&(this._urlAudioEntry=this._createEntry(this._urlAudioSrc,"audio",0,1/0)),this.teardownObserver(),t&&this._dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"runtime",reason:"iframe-reload"}}))}destroy(){this.teardownObserver();for(const t of this._entries)t.el.pause(),t.el.src="";this._entries=[],this._urlAudioEntry=null,this._urlAudioSrc=null,this._audioOwner="runtime",this._playbackErrorPosted=!1}updateMuted(t){for(const e of this._entries)e.el.muted=t}updateVolume(t){for(const e of this._entries)e.el.volume=t}updatePlaybackRate(t){for(const e of this._entries)e.el.playbackRate=t}_playEntry(t){t.el.src&&t.el.play().catch(e=>this._reportPlaybackError(e))}_playEntryIfActive(t){this._refreshEntryBounds(t),this._inWindow(t,this._getCurrentTime())&&this._playEntry(t)}_refreshEntryBounds(t){var i;if(!((i=t.source)!=null&&i.isConnected))return;const e=be(t.source);t.start=e.start??0,t.mediaStart=we(t.source).mediaStart,t.duration=e.duration!=null&&e.duration>0?e.duration:Number.POSITIVE_INFINITY}_inWindow(t,e){return Ke(e,t.start,t.start+t.duration)}_preseekUpcoming(t,e){const i=t.start-e;i<=0||i>Ut||!t.el.paused||Math.abs(t.el.currentTime-t.mediaStart)>X&&this._seekTo(t,t.mediaStart)}_seekTo(t,e,i=!1){const s=i?(t.seekLatency??0)*this._getPlaybackRate():0;t.seekIssuedAt=i?performance.now():void 0,t.el.currentTime=Ue(e+s)}_noteSeekLanded(t){if(t.seekIssuedAt===void 0)return;const e=(performance.now()-t.seekIssuedAt)/1e3;t.seekLatency=t.seekLatency===void 0?e:(t.seekLatency+e)/2,t.seekIssuedAt=void 0}_releaseSteering(t){Nt(t.el),t.lastOffset=void 0;const e=this._getPlaybackRate();t.el.playbackRate!==e&&(t.el.playbackRate=e)}_mediaTime(t,e){return e-t.start+t.mediaStart}_gateEntryPlayback(t,e){return this._inWindow(t,e)?(this._audioOwner==="parent"&&!this._isPaused()&&t.el.paused&&this._playEntry(t),!0):(t.el.paused||t.el.pause(),this._releaseSteering(t),!1)}playAll(){for(const t of this._entries)this._playEntryIfActive(t)}primeAll(){if(Ze())for(const t of this._entries)t.el.paused&&(t.el.play().catch(()=>{}),t.el.pause())}pauseAll(){for(const t of this._entries)t.el.pause()}stopAdoptedMedia(){for(const t of this._entries)t.source&&t.el.pause()}seekAll(t){for(const e of this._entries)this._refreshEntryBounds(e),this._inWindow(e,t)&&this._jumpTo(e,this._mediaTime(e,t))}scrubAll(t){for(const e of this._entries)this._refreshEntryBounds(e),this._inWindow(e,t)?(this._jumpTo(e,this._mediaTime(e,t)),this._playEntry(e)):e.el.paused||e.el.pause()}mirrorTime(t,e){const i=(e==null?void 0:e.force)===!0;for(const s of this._entries){this._refreshEntryBounds(s),this._preseekUpcoming(s,t);const n=s.el.paused;if(!this._gateEntryPlayback(s,t))continue;const o=this._mediaTime(s,t),a=o-s.el.currentTime;if(i||n){Math.abs(a)>X&&this._jumpTo(s,o);continue}this._steer(s,o,a)}}_steer(t,e,i){const s=t.lastOffset!==void 0&&Math.abs(i-t.lastOffset)<Ft;t.lastOffset=i;const{rate:n,seek:o}=Ot(t.el,i,this._getPlaybackRate(),s,!0);o?this._jumpTo(t,e,!0):Math.abs(t.el.playbackRate-n)>1e-6&&(t.el.playbackRate=n)}_jumpTo(t,e,i=!1){this._seekTo(t,e,i),this._releaseSteering(t)}promoteToParentProxy(t,e){if(this._audioOwner==="parent")return;if(this._audioOwner="parent",t)for(const s of t.querySelectorAll("video, audio"))A(s)&&(s.muted=!0);for(const s of[...this._entries])this._repointToSource(s);const i=this._getCurrentTime();e?e(i,{force:!0}):this.mirrorTime(i,{force:!0}),this._isPaused()||this.playAll(),this._dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"parent",reason:"autoplay-blocked"}}))}setupFromIframe(t){const e=t.querySelectorAll("audio[data-start], video[data-start]");for(const i of e)A(i)&&this._adoptIframeMedia(i);this._observeDynamicMedia(t)}setupFromUrl(t){if(this._urlAudioSrc===t&&this._urlAudioEntry)return;this.teardownUrlAudio();const e=this._createEntry(t,"audio",0,1/0);this._urlAudioEntry=e,this._urlAudioSrc=t,e&&this._audioOwner==="parent"&&!this._isPaused()&&(this.mirrorTime(this._getCurrentTime(),{force:!0}),this.playAll())}teardownUrlAudio(){const t=this._urlAudioEntry;if(this._urlAudioEntry=null,this._urlAudioSrc=null,!t)return;t.el.pause(),t.el.src="";const e=this._entries.indexOf(t);e!==-1&&this._entries.splice(e,1)}teardownObserver(){var t;(t=this._mediaObserver)==null||t.disconnect(),this._mediaObserver=void 0}_reportPlaybackError(t){this._playbackErrorPosted||(this._playbackErrorPosted=!0,this._dispatchEvent(new CustomEvent("playbackerror",{detail:{source:"parent-proxy",error:t}})))}_createEntry(t,e,i,s,n){if(!n&&this._urlTaken(t))return null;const o=e==="video"?document.createElement("video"):new Audio;o.preload="auto";const a=n==null?void 0:n.getAttribute("crossorigin");a!=null&&o.setAttribute("crossorigin",a),o.src=t,o.load(),o.muted=this._getMuted(),o.volume=this._getVolume();const c=this._getPlaybackRate();c!==1&&(o.playbackRate=c);const p={el:o,start:i,duration:s,mediaStart:n?we(n).mediaStart:0,source:n};return o.addEventListener("seeked",()=>this._noteSeekLanded(p)),this._entries.push(p),p}_resolveIframeMediaSrc(t){var i;const e=t.getAttribute("src")||((i=t.querySelector("source"))==null?void 0:i.getAttribute("src"));return e?new URL(e,t.ownerDocument.baseURI).href:null}_adoptIframeMedia(t){if(t.preload==="metadata"||t.preload==="none"||this._entries.some(c=>c.source===t)||t.tagName==="VIDEO"&&t.hasAttribute("muted"))return;const e=this._resolveIframeMediaSrc(t);if(!e)return;const i=be(t),s=i.start??0,n=i.duration??Number.POSITIVE_INFINITY,o=t.tagName==="VIDEO"?"video":"audio",a=this._createEntry(e,o,s,n,t);a&&this._audioOwner==="parent"&&(this.mirrorTime(this._getCurrentTime(),{force:!0}),this._isPaused()||this._playEntryIfActive(a))}_followIframeMediaSrc(t){const e=this._entries.find(i=>i.source===t);if(!e)return this._adoptIframeMedia(t);this._audioOwner!=="parent"||!this._repointToSource(e)||(this.mirrorTime(this._getCurrentTime(),{force:!0}),this._isPaused()||this._playEntryIfActive(e))}_urlTaken(t){return this._entries.some(e=>e.source&&!e.source.isConnected?!1:(e.source&&this._resolveIframeMediaSrc(e.source)||e.el.src)===t)}_repointToSource(t){const e=t.source?this._resolveIframeMediaSrc(t.source):null;return!e||t.el.src===e?!1:(t.el.src=e,t.el.load(),!0)}_detachIframeMedia(t){const e=this._entries.find(i=>i.source===t);e&&this._removeEntry(e)}_removeEntry(t){t.el.pause(),t.el.src="",this._entries.splice(this._entries.indexOf(t),1)}_observeDynamicMedia(t){if(this.teardownObserver(),typeof MutationObserver>"u"||!t.body)return;const e=new MutationObserver(n=>{for(const o of n){if(o.type==="attributes"&&o.attributeName==="src"){const a=o.target;A(a)&&a.matches("audio[data-start], video[data-start]")&&this._followIframeMediaSrc(a);continue}if(o.type==="attributes"&&o.attributeName==="preload"){const a=o.target;A(a)&&a.matches("audio[data-start], video[data-start]")&&(a.preload==="auto"?this._adoptIframeMedia(a):this._detachIframeMedia(a));continue}for(const a of o.addedNodes){if(!Ae(a))continue;const c=[];A(a)&&a.matches("audio[data-start], video[data-start]")&&c.push(a);const p=a.querySelectorAll("audio[data-start], video[data-start]");for(const l of p)A(l)&&c.push(l);for(const l of c)this._adoptIframeMedia(l)}for(const a of o.removedNodes){if(!Ae(a))continue;const c=[];A(a)&&a.matches("audio[data-start], video[data-start]")&&c.push(a);const p=a.querySelectorAll("audio[data-start], video[data-start]");for(const l of p)A(l)&&c.push(l);for(const l of c)this._detachIframeMedia(l)}}}),i={childList:!0,subtree:!0,attributes:!0,attributeFilter:["preload","src"]},s=Et(t);for(const n of s)e.observe(n,i);this._mediaObserver=e}}function Pe(r,t,e){if(r===null&&t===null)return{range:null,clamped:!1};const i=r??0,s=t!==null&&e>0&&t>e,n=s?e:t,o=n??(e>0?e:1/0);return!(i>=0)||!(o>i)?{range:null,clamped:!0}:{range:{start:i,end:n},clamped:s}}function re(r,t,e){const i=r.end??t;return i<t?Je(r.start,i,e):i}function Le(r,t,e,i){return r<t.start||r>=re(t,e,i)}const Ht=100;function Wt(r,t){return typeof r.currentTime=="number"&&Number.isFinite(r.currentTime)?r.currentTime:(r.frame??0)/t}function Ve(r,t,e){return e<=0?!1:r.ended===!0?!0:r.ended===!1&&!r.isPlaying?!1:t>=e}function zt(r,t,e,i,s,n){const{duration:o}=e;if(!s){const a=Ve(r,t,o);return{start:0,shownAtEnd:o,atEnd:a,stopRuntime:!1,entering:!1}}if(r.ownsRange){const a=i&&r.ended===!0&&!r.isPlaying;return{start:s.start,shownAtEnd:t,atEnd:a,stopRuntime:!1,entering:!1}}return $t(r,t,e,i,s,n)}function $t(r,t,e,i,s,n){const o=s.end??e.duration,a=e.enteringRange===!0&&(t<s.start||t>=o);return{start:s.start,shownAtEnd:re(s,e.duration,n),atEnd:i&&!a&&Ve(r,t,o),stopRuntime:r.isPlaying,entering:a}}function jt(r,t,e,i){var S;const s=Wt(r,t),n=!e.paused,o=n||r.isPlaying,a=(S=i.getPlayRange)==null?void 0:S.call(i),c=zt(r,s,e,o,a,t),{atEnd:p,start:l}=c,g=e.duration>0?Math.min(s,e.duration):s,_=p?c.shownAtEnd:g,m=!r.isPlaying,y=p&&o;if(y&&i.getLoop())return i.media.audioOwner==="parent"&&i.media.pauseAll(),i.seek(l),i.play(),{...e,currentTime:l,paused:!1,enteringRange:!0};const f={...e,currentTime:_,paused:m,enteringRange:c.entering};i.media.audioOwner==="parent"&&(n&&m?i.media.pauseAll():!n&&!m&&i.media.playAll(),i.media.mirrorTime(_));const b=performance.now(),w=m!==e.paused;return(b-e.lastUpdateMs>Ht||w)&&(f.lastUpdateMs=b,i.updateControlsTime(_,e.duration),i.updateControlsPlaying(!m),i.dispatchEvent(new CustomEvent("timeupdate",{detail:{currentTime:_}}))),y&&(c.stopRuntime&&i.seek(_),i.media.audioOwner==="parent"&&i.media.pauseAll(),f.paused=!0,i.updateControlsPlaying(!1),i.dispatchEvent(new Event("ended"))),f}function Bt(r){return Array.isArray(r)?r.filter(t=>typeof t=="object"&&t!==null&&typeof t.id=="string"&&typeof t.start=="number"&&typeof t.duration=="number"):[]}function qt(r,t,e){var o,a,c,p,l,g,_;if(r.source!==t)return;const i=r.data;if(!i||i.source!=="hf-preview")return;const s=Qe(i);if(s.status==="unsupported"){e.dispatchEvent(new CustomEvent("runtimeprotocolerror",{detail:{code:s.code,receivedVersion:s.receivedVersion}}));return}(o=e.setRuntimeFps)==null||o.call(e,s.fps);const n=s.status==="supported"&&s.metadata.capabilities.includes("play-range");if((a=e.setRuntimeOwnsPlayRange)==null||a.call(e,n),i.type==="shader-transition-state"){const m=i.state&&typeof i.state=="object"?i.state:{};e.shaderLoader.update(m,e.getShaderLoadingMode()),e.dispatchEvent(new CustomEvent("shadertransitionstate",{detail:{compositionId:i.compositionId,state:m}}));return}if(i.type==="ready"){e.onRuntimeReady();return}if(i.type==="assets-ready"){(c=e.onRuntimeAssetsReady)==null||c.call(e,i.timedOut===!0);return}if(i.type==="runtime-data-error"){(p=e.onRuntimeDataError)==null||p.call(e,i.channel,i.requestId,i.message);return}if(i.type==="runtime-data-applied"){(l=e.onRuntimeDataApplied)==null||l.call(e,i.channel,i.requestId);return}if(i.type==="state"){e.setPlaybackState(jt({frame:i.frame??0,currentTime:i.currentTime,ended:typeof i.ended=="boolean"?i.ended:void 0,isPlaying:!!i.isPlaying,ownsRange:n},s.fps,e.getPlaybackState(),e)),(g=e.setBuffering)==null||g.call(e,i.buffering===!0);return}if(i.type==="media-autoplay-blocked"){if(((_=e.shouldPromoteMediaAutoplayFallback)==null?void 0:_.call(e))===!1)return;let m=null;try{m=e.getIframeDoc()}catch{}e.media.promoteToParentProxy(m,(y,f)=>e.media.mirrorTime(y,f)),e.sendControl("set-media-output-muted",{muted:!0});return}if(i.type==="timeline"&&i.durationInFrames>0){const m=Number(i.durationSeconds),y=Number(i.durationInFrames),f=Number.isFinite(m)&&m>0?m:y/s.fps;if(Number.isFinite(i.compositionWidth)&&i.compositionWidth>0&&Number.isFinite(i.compositionHeight)&&i.compositionHeight>0&&e.setCompositionSize(i.compositionWidth,i.compositionHeight),Number.isFinite(f)&&f>0){const b=e.getPlaybackState();e.setPlaybackState({...b,duration:f}),e.updateControlsTime(b.currentTime,f),e.onRuntimeTimelineReady(f,typeof i.assetsReady=="boolean"?i.assetsReady:void 0)}e.setScenes(Bt(i.scenes));return}i.type==="stage-size"&&Number.isFinite(i.width)&&i.width>0&&Number.isFinite(i.height)&&i.height>0&&e.setCompositionSize(i.width,i.height)}function Gt(r,t){return r.includes(t)?!0:/hyperframe\.runtime\.iife\.js|__hyperframes\s*=/.test(r)}const Yt=new Set([">"," "," ",`
565
565
  `,"\r","\f"]);function Z(r,t){const e=r.toLowerCase(),i=`<${t}`;let s=0;for(;s<e.length;){const n=e.indexOf(i,s);if(n<0)return null;const o=e[n+i.length];if(Yt.has(o)){const a=e.indexOf(">",n+i.length);return a<0?null:{index:n,end:a+1}}s=n+i.length}return null}function Xt(r,t){if(!r||Gt(r,t))return r;const e=`<script src="${t}"><\/script>`,i=Z(r,"head");if(i)return r.slice(0,i.end)+e+r.slice(i.end);const s=Z(r,"body");if(s)return r.slice(0,s.index)+e+r.slice(s.index);const n=Z(r,"html");return n?r.slice(0,n.end)+e+r.slice(n.end):e+r}const D="shader-capture-scale",N="shader-loading",se="runtime-src",De="__hf_shader_capture_scale",Me="__hf_shader_loading",G=["Preparing scene transitions","Sampling outgoing scene motion","Sampling incoming scene motion","Caching transition frames","Finalizing transition preview"];function ne(r){if(r===null)return null;const t=Number(r);return!Number.isFinite(t)||t<=0?null:String(Math.min(1,Math.max(.25,t)))}function Kt(r){if(r===null||r.trim()==="")return"composition";const t=r.trim().toLowerCase();return t==="none"||t==="false"||t==="0"||t==="off"?"none":t==="player"||t==="true"||t==="1"||t==="on"?"player":"composition"}function xe(r,t){return r.filter(e=>e!==""&&e.split("=")[0]!==t)}function Zt(r,t,e){const i=r.indexOf("#"),s=i>=0?r.slice(0,i):r,n=i>=0?r.slice(i):"",o=s.indexOf("?"),a=o>=0?s.slice(0,o):s,c=o>=0?s.slice(o+1):"";let p=xe(c.split("&"),De);p=xe(p,Me),t!==null&&p.push(`${De}=${encodeURIComponent(t)}`),e!=="composition"&&p.push(`${Me}=${encodeURIComponent(e)}`);const l=p.join("&");return`${a}${l?`?${l}`:""}${n}`}function Jt(r,t,e){if(t===null&&e==="composition")return r;const i=[];t!==null&&i.push(`window.__HF_SHADER_CAPTURE_SCALE=${JSON.stringify(t)};`),e!=="composition"&&i.push(`window.__HF_SHADER_LOADING=${JSON.stringify(e)};`);const s=`<script data-hyperframes-player-shader-options>${i.join("")}<\/script>`;return/<head\b[^>]*>/i.test(r)?r.replace(/<head\b[^>]*>/i,n=>`${n}${s}`):/<html\b[^>]*>/i.test(r)?r.replace(/<html\b[^>]*>/i,n=>`${n}${s}`):`${s}${r}`}function K(r){return Kt(r.getAttribute(N))}function Qt(r){return Number(ne(r.getAttribute(D))??"1")}function ei(r,t){return Zt(t,ne(r.getAttribute(D)),K(r))}function z(r,t){return Xt(Jt(t,ne(r.getAttribute(D)),K(r)),He(r))}function He(r){var e;const t=(e=r.getAttribute(se))==null?void 0:e.trim();if(!t)return B;try{const i=new URL(t,document.baseURI),s=i.protocol==="http:"||i.protocol==="https:",n=i.hostname==="127.0.0.1"||i.hostname==="localhost"||i.hostname==="[::1]";return s&&(n||i.origin===location.origin)?i.href:B}catch{return B}}const We="M10.1851 57.8021L33.1145 73.8313C36.2202 75.9978 41.5173 73.5433 42.4816 69.4984L51.7611 30.4271C52.7253 26.3822 48.5802 23.9277 44.4602 26.0942L13.917 42.1235C6.96677 45.7676 4.97564 54.1579 10.1851 57.8021Z",ze="M87.5129 57.5141L56.9696 73.5433C52.8371 75.7098 48.7046 73.2553 49.6688 69.2104L58.9483 30.1391C59.9125 26.0942 65.2097 23.6397 68.3154 25.8062L91.2447 41.8354C96.4668 45.4796 94.4631 53.8699 87.5129 57.5141Z",Ie=`url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="${We}"/><path d="${ze}"/></svg>`)}")`;function ti(){const r=document.createElement("div");r.className="hfp-shader-loader",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.setAttribute("aria-label","Preparing scene transitions"),r.setAttribute("data-hyperframes-ignore",""),r.draggable=!1;const t=y=>{y.preventDefault(),y.stopPropagation()};for(const y of["selectstart","dragstart","pointerdown","mousedown","click","dblclick","contextmenu","touchstart"])r.addEventListener(y,t,{capture:!0});const e=document.createElement("div");e.className="hfp-shader-loader-panel",e.draggable=!1;const i=document.createElement("div");i.className="hfp-shader-loader-mark",i.draggable=!1,i.innerHTML=['<svg width="78" height="78" viewBox="0 0 100 100" fill="none" aria-hidden="true" draggable="false">',`<path d="${We}" fill="url(#hfp-shader-loader-grad-left)"/>`,`<path d="${ze}" fill="url(#hfp-shader-loader-grad-right)"/>`,"<defs>",'<linearGradient id="hfp-shader-loader-grad-left" x1="48.5676" y1="25" x2="44.7804" y2="71.9384" gradientUnits="userSpaceOnUse">','<stop stop-color="#06E3FA"/>','<stop offset="1" stop-color="#4FDB5E"/>',"</linearGradient>",'<linearGradient id="hfp-shader-loader-grad-right" x1="54.8282" y1="73.8392" x2="72.0989" y2="32.8932" gradientUnits="userSpaceOnUse">','<stop stop-color="#06E3FA"/>','<stop offset="1" stop-color="#4FDB5E"/>',"</linearGradient>","</defs>","</svg>"].join("");const s=document.createElement("div");s.className="hfp-shader-loader-sheen",s.style.setProperty("mask-image",Ie),s.style.setProperty("-webkit-mask-image",Ie),i.appendChild(s);const n=document.createElement("div");n.className="hfp-shader-loader-title";const o=document.createElement("span");o.className="hfp-shader-loader-title-text",o.textContent=G[0],n.appendChild(o);const a=document.createElement("div");a.className="hfp-shader-loader-detail",a.textContent="Rendering animated scene samples for shader transitions.";const c=document.createElement("div");c.className="hfp-shader-loader-track",c.setAttribute("aria-hidden","true");const p=document.createElement("div");p.className="hfp-shader-loader-fill",c.appendChild(p);const l=document.createElement("div");l.className="hfp-shader-loader-progress";const g=y=>{const f=document.createElement("div");f.className="hfp-shader-loader-row";const b=document.createElement("span");b.className="hfp-shader-loader-label",b.textContent=y;const w=document.createElement("span");return w.className="hfp-shader-loader-value",f.appendChild(b),f.appendChild(w),l.appendChild(f),{row:f,label:b,value:w}},_=g("transition"),m=g("transition frame");return e.appendChild(i),e.appendChild(n),e.appendChild(a),e.appendChild(c),e.appendChild(l),r.appendChild(e),{root:r,fill:p,title:o,detail:a,transitionValue:_.value,transitionRow:_.row,frameLabel:m.label,frameValue:m.value,frameRow:m.row}}const ii=420;function $(r,t,e){t.textContent=e,r.style.visibility=e?"visible":"hidden"}class si{constructor(t){h(this,"_el");h(this,"_hideTimeout",null);h(this,"_hiddenCallbacks",[]);h(this,"_drawingAssets",!1);this._el=t}show(){this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null),this._el.root.classList.remove("hfp-hiding"),this._el.root.classList.add("hfp-visible")}hide(){if(this._el.root.classList.contains("hfp-hiding")){this._hideTimeout||this._scheduleCleanup();return}this._el.root.classList.contains("hfp-visible")&&(this._el.root.classList.add("hfp-hiding"),this._el.root.classList.remove("hfp-visible"),this._scheduleCleanup())}whenHidden(t){const e=this._el.root.classList;e.contains("hfp-visible")||e.contains("hfp-hiding")?this._hiddenCallbacks.push(t):t()}_flushHidden(){const t=this._hiddenCallbacks;this._hiddenCallbacks=[];for(const e of t)e()}reset(){this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null),this._el.root.classList.remove("hfp-visible","hfp-hiding"),this._drawingAssets=!1,this._el.root.classList.remove("hfp-assets"),this._flushHidden(),this._el.fill.style.transform="scaleX(0)",$(this._el.transitionRow,this._el.transitionValue,""),$(this._el.frameRow,this._el.frameValue,"")}update(t,e){const i=e==="player"&&t.loading&&!t.ready;if(this._drawingAssets&&!i)return;if(e!=="player"){this.reset();return}if(t.ready||!t.loading){this.hide();return}this._el.root.setAttribute("aria-label","Preparing scene transitions"),this._drawingAssets=!1,this._el.root.classList.remove("hfp-assets");const s=typeof t.progress=="number"&&Number.isFinite(t.progress)?t.progress:0,n=typeof t.total=="number"&&Number.isFinite(t.total)?t.total:0,o=n>0?Math.min(1,Math.max(0,s/n)):0,a=Math.min(G.length-1,Math.floor(o*G.length));this._el.title.textContent=G[a]||"Preparing scene transitions",this._el.detail.textContent=t.phase==="cached"?"Loading cached transition frames before playback.":t.phase==="finalizing"?"Uploading transition textures for smooth playback.":"Rendering animated scene samples for shader transitions.",this._el.fill.style.transform=`scaleX(${o})`;const c=t.currentTransition!==void 0&&t.transitionTotal!==void 0?`${t.currentTransition}/${t.transitionTotal}`:n>0?`${s}/${n}`:"",p=t.transitionFrame!==void 0&&t.transitionFrames!==void 0?`${t.transitionFrame}/${t.transitionFrames}`:"";this._el.frameLabel.textContent=t.phase==="cached"?"cached transition frames":t.phase==="finalizing"?"finalizing transition frames":"rendering transition frames",$(this._el.transitionRow,this._el.transitionValue,c),$(this._el.frameRow,this._el.frameValue,p),this._el.root.setAttribute("aria-valuenow",String(Math.round(o*100))),this.show()}showAssetsLoading(t="Loading assets",e="Waiting for images, video and fonts to finish loading."){this.reset(),this._el.title.textContent=t,this._el.detail.textContent=e,this._el.root.setAttribute("aria-label",t),this._drawingAssets=!0,this._el.root.classList.add("hfp-assets"),this.show()}hideAssetsLoading(){this._drawingAssets&&this.hide()}get hideTimeout(){return this._hideTimeout}destroy(){this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null),this._hiddenCallbacks=[]}_scheduleCleanup(){this._hideTimeout&&clearTimeout(this._hideTimeout),this._hideTimeout=setTimeout(()=>{this._el.root.classList.remove("hfp-hiding"),this._hideTimeout=null,this._flushHidden()},ii)}}function ri(r){return(r==null?void 0:r.trim().toLowerCase().startsWith("video/"))??!1}function ni(r){const t=document.createElement("video");t.className="hfp-video",t.playsInline=!0,t.preload="metadata";const e=new AbortController,{signal:i}=e;return t.addEventListener("loadedmetadata",()=>r.onMetadata(t),{signal:i}),t.addEventListener("durationchange",()=>r.onDurationChange(t),{signal:i}),t.addEventListener("resize",()=>r.onResize(t),{signal:i}),t.addEventListener("play",()=>r.onPlay(t),{signal:i}),t.addEventListener("pause",()=>r.onPause(t),{signal:i}),t.addEventListener("timeupdate",()=>r.onTimeUpdate(),{signal:i}),t.addEventListener("error",()=>{var n,o;return r.onError(((n=t.error)==null?void 0:n.message)||"Video failed to load",((o=t.error)==null?void 0:o.code)??null)},{signal:i}),{video:t,adapter:{duration:()=>t.duration,time:()=>t.currentTime,seek:n=>{t.currentTime=Ue(n)},play:()=>t.play().catch(n=>{i.aborted||r.onPlayRejected(n)}),pause:()=>t.pause(),timeScale:n=>{t.defaultPlaybackRate=n,t.playbackRate=n}},destroy:()=>{e.abort(),t.pause(),t.removeAttribute("src"),t.load(),t.remove()}}}const oi=.1,ai=5,J="sandbox-origin",Oe=1e4,Q=8e3,ee="assets-loading",x="assets-loading-ui",j="buffering",te="low-power-idle",Ne="disable-click-to-play",I="range-start",O="range-end",Fe=150;function ie(r){return!Number.isFinite(r)||r<=0?1:Math.max(oi,Math.min(ai,r))}class di extends HTMLElement{constructor(){super();h(this,"shadow");h(this,"container");h(this,"sizer",document.createElement("div"));h(this,"iframe");h(this,"posterEl",null);h(this,"controlsApi",null);h(this,"resizeObserver");h(this,"shaderLoader");h(this,"probe");h(this,"_ready",!1);h(this,"_readyDocument",null);h(this,"_connected",!1);h(this,"_assetsReady",!1);h(this,"_painted",!1);h(this,"_pendingPlay",!1);h(this,"_assetsGeneration",0);h(this,"_assetsLoadingShowTimer",null);h(this,"_bufferingShowTimer",null);h(this,"_currentTime",0);h(this,"_duration",0);h(this,"_paused",!0);h(this,"_scrubbing",!1);h(this,"_lastUpdateMs",0);h(this,"_volume",1);h(this,"_compositionWidth",1920);h(this,"_compositionHeight",1080);h(this,"_rescaleWarned",!1);h(this,"_directTimelineAdapter",null);h(this,"_directTimelineClock");h(this,"_parentTickRaf",null);h(this,"_media");h(this,"_scenes",[]);h(this,"_runtimeFps",30);h(this,"_runtimeBridgeReady",!1);h(this,"_runtimeAssetsReadyGeneration",-1);h(this,"_runtimeData",new Map);h(this,"_runtimeDataRequestId",0);h(this,"_pendingRuntimeData",new Map);h(this,"_afterUpdate",null);h(this,"_videoSource",null);h(this,"_runtimeOwnsPlayRange",!1);h(this,"_enteringRange",!1);h(this,"_rangeClampReported","");this.shadow=this.attachShadow({mode:"open"}),yt(this.shadow,lt),{container:this.container,iframe:this.iframe}=vt(),this.sizer.className="hfp-sizer",this.shadow.appendChild(this.sizer),this.shadow.appendChild(this.container);const e=ti();this.shadow.appendChild(e.root),this.shaderLoader=new si(e),this._media=new Vt({dispatchEvent:i=>this._emit(i),getMuted:()=>this.muted,getVolume:()=>this._volume,getPlaybackRate:()=>this.playbackRate,getCurrentTime:()=>this._currentTime,isPaused:()=>this._paused}),this._directTimelineClock=new Tt({onTimeUpdate:(i,s)=>{var n;this._currentTime=i,(n=this.controlsApi)==null||n.updateTime(i,s),this._emit(new CustomEvent("timeupdate",{detail:{currentTime:i}}))},getLoop:()=>this.loop,restart:()=>{var i;this.seek(((i=this._playRange())==null?void 0:i.start)??0),this.play()},onPaused:()=>{var i;this._media.audioOwner==="parent"&&this._media.pauseAll(),this._paused=!0,(i=this.controlsApi)==null||i.updatePlaying(!1),this._emit(new Event("ended"))},onEnded:()=>this.loop}),this.probe=new ht(this.iframe,{resolveRuntimeUrl:()=>He(this),hostOwnsDeadline:()=>this.hasAttribute("no-load-timeout"),onReady:i=>this._onProbeReady(i),onError:i=>this._emit(new CustomEvent("error",{detail:{message:i}}))}),this.addEventListener("click",i=>{this.disableClickToPlay||gt(i)||(this._paused?this.play():this.pause())}),this.resizeObserver=new ResizeObserver(()=>this._rescale()),this._onMessage=this._onMessage.bind(this),this._onIframeLoad=this._onIframeLoad.bind(this),this.iframe.addEventListener("load",this._onIframeLoad)}static get observedAttributes(){return["src","srcdoc","width","height","controls","muted","audio-locked","volume","poster","playback-rate","audio-src","type",J,se,D,N,x,te,I,O]}connectedCallback(){this._connected=!0,this._applySandboxOriginPolicy(),this.resizeObserver.observe(this),window.addEventListener("message",this._onMessage),this.hasAttribute("controls")&&this._setupControls(),this.hasAttribute("poster")&&(this.posterEl=ke(this.shadow,this.getAttribute("poster"),this.posterEl)),this.hasAttribute("audio-src")&&this._media.setupFromUrl(this.getAttribute("audio-src")),this.hasAttribute("srcdoc")&&(this.iframe.srcdoc=z(this,this.getAttribute("srcdoc"))),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),!this.hasAttribute("audio-locked")&&this._isLockedHostEnvironment()&&this._applyAudioLock(!0)}disconnectedCallback(){var e;this._connected=!1,this._teardownVideo(),this._sendControl("pause"),this._stopIframeMedia(),this.resizeObserver.disconnect(),window.removeEventListener("message",this._onMessage),this.probe.stop(),this._directTimelineClock.stop(),this._stopParentTickClock(),this._directTimelineAdapter=null,this.shaderLoader.destroy(),this._media.destroy(),(e=this.controlsApi)==null||e.destroy(),this.controlsApi=null,this._paused=!0,this._pendingPlay=!1,this._abandonComposition("Player disconnected before runtime data was applied")}attributeChangedCallback(e,i,s){var n,o,a,c,p;switch(e){case"src":if(!this.isConnected)break;(s||this._videoSource)&&this._navigateSrc(s??"");break;case"type":{const l=this.getAttribute("src");if(!this.isConnected||l===null||!!this._videoSource===this._wantsVideo())break;this._navigateSrc(l);break}case"srcdoc":if(!this.isConnected)break;if(this._pendingPlay=!1,this._abandonComposition("Composition navigated before runtime data was applied"),s!==null)this._pauseForVideoSwitch(),this._teardownVideo(),this.iframe.srcdoc=z(this,s);else{this.iframe.removeAttribute("srcdoc");const l=this.getAttribute("src");l!==null&&this._wantsVideo()&&this._navigateSrc(l)}break;case J:this._applySandboxOriginPolicy(this.isConnected&&i!==s);break;case"width":this._setCompositionSize(Y(s)??1920,this._compositionHeight);break;case"height":this._setCompositionSize(this._compositionWidth,Y(s)??1080);break;case"controls":s!==null?this._setupControls():((n=this.controlsApi)==null||n.destroy(),this.controlsApi=null);break;case"poster":this.posterEl=ke(this.shadow,s,this.posterEl);break;case"playback-rate":{const l=ie(parseFloat(s||"1"));this._media.updatePlaybackRate(l),this._sendControl("set-playback-rate",{playbackRate:l}),(a=(o=this._directTimelineAdapter)==null?void 0:o.timeScale)==null||a.call(o,l),(c=this.controlsApi)==null||c.updateSpeed(l),this._emit(new Event("ratechange"));break}case"muted":this._handleMutedChange(s);break;case"audio-locked":this._applyAudioLock(s!==null);break;case"volume":{const l=Math.max(0,Math.min(1,parseFloat(s||"1")));this._volume=l,this._syncVideoAudio(),this._media.updateVolume(l),this._sendControl("set-volume",{volume:l}),(p=this.controlsApi)==null||p.updateVolume(l),this._emit(new Event("volumechange"));break}case"audio-src":s?this._media.setupFromUrl(s):this._media.teardownUrlAudio();break;case x:s==="none"&&this.shaderLoader.hideAssetsLoading();break;case te:this._sendControl("set-idle-heartbeat",{slow:s!==null});break;case I:case O:this._applyPlayRange(!0);break;case D:case N:case se:if(!this.isConnected)break;this._reloadShaderOptions();break}}_applySandboxOriginPolicy(e=!1){this.hasAttribute(J)?this.iframe.sandbox.remove("allow-same-origin"):this.iframe.sandbox.add("allow-same-origin"),e&&this._reloadForSandboxOriginPolicy()}_reloadForSandboxOriginPolicy(){if(this._videoSource)return;this._abandonComposition("Sandbox policy changed before runtime data was applied");const e=this.getAttribute("srcdoc");if(e!==null){this.iframe.srcdoc=z(this,e);return}const i=this.getAttribute("src");i===null?this.iframe.src="about:blank":this._loadSrc(i)}get iframeElement(){return this.iframe}get scenes(){return this._scenes}play(){this._play(!0)}_play(e){var o,a;if(this._ready&&!this._assetsReady){this._pendingPlay=!0;return}this._pendingPlay=!1,(o=this.posterEl)==null||o.remove(),this.posterEl=null;const i=this._ready?this._playRange():null;i?Le(this._currentTime,i,this._duration,this._runtimeFps)&&(this.seek(i.start),this._enteringRange=!0):this._duration>0&&this._currentTime>=this._duration&&this.seek(0),this._paused=!1;const s=this._tryDirectTimelinePlay();let n=!1;this._sendDisplayScale(),s||(this._sendControl("play"),this._ready&&!this._directTimelineAdapter?this._startParentTickClock():this._ready||(this._pendingPlay=!0,n=!0)),this._media.audioOwner==="parent"?this._media.playAll():this._media.primeAll(),(a=this.controlsApi)==null||a.updatePlaying(!0),!n&&e&&this._emit(new Event("play")),s&&this._directTimelineAdapter&&this._directTimelineClock.start(this._directTimelineAdapter,()=>this._currentTime,()=>this._duration,()=>this._paused,()=>this._clockStop())}pause(){var e;this._pendingPlay=!1,this._tryDirectTimelinePause()?this._showPausedVideoTime():this._sendControl("pause"),this._directTimelineClock.stop(),this._stopParentTickClock(),this._media.audioOwner==="parent"&&this._media.pauseAll(),this._paused=!0,(e=this.controlsApi)==null||e.updatePlaying(!1),this._emit(new Event("pause"))}stopMedia(){this._sendControl("stop-media"),this._stopIframeMedia(),this._media.stopAdoptedMedia()}seek(e){var i,s;this._pendingPlay=!1,!this._trySyncSeek(e)&&!this._tryDirectTimelineSeek(e)&&this._sendControl("seek",{timeSeconds:e,frame:Math.round(e*this._runtimeFps)}),this._directTimelineClock.stop(),this._stopParentTickClock(),this._currentTime=e,this._media.audioOwner==="parent"&&(this._scrubbing?this._media.scrubAll(e):(this._media.pauseAll(),this._media.seekAll(e))),this._paused=!0,(i=this.controlsApi)==null||i.updatePlaying(!1),(s=this.controlsApi)==null||s.updateTime(this._currentTime,this._duration)}setColorGrading(e,i){this._sendControl("set-color-grading",{target:e,grading:i})}clearColorGrading(e){this._sendControl("set-color-grading",{target:e,grading:null})}setColorGradingCompare(e,i){this._sendControl("set-color-grading-compare",{target:e,compare:i})}clearColorGradingCompare(e){this._sendControl("set-color-grading-compare",{target:e,compare:{enabled:!1}})}setRuntimeData(e,i){if(!/^[a-z][a-z0-9-]{0,63}$/.test(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);if(typeof structuredClone!="function")throw new Error("HyperFrames runtime data requires structuredClone support; refusing an unverified payload");const s=structuredClone(i);this._runtimeData.set(e,s),this._deliverRuntimeData(e,s)}clearRuntimeData(e){if(!/^[a-z][a-z0-9-]{0,63}$/.test(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);this._runtimeData.delete(e),this._deliverRuntimeDataClear(e)}get currentTime(){return this._currentTime}set currentTime(e){this.seek(e)}get duration(){return this._duration}get compositionWidth(){return this._compositionWidth}get compositionHeight(){return this._compositionHeight}get paused(){return this._paused}get ready(){return this._ready}get assetsReady(){return this._assetsReady}get painted(){return this._painted}get playbackRate(){return ie(parseFloat(this.getAttribute("playback-rate")||"1"))}set playbackRate(e){this.setAttribute("playback-rate",String(ie(e)))}get shaderCaptureScale(){return Qt(this)}set shaderCaptureScale(e){this.setAttribute(D,String(e))}get shaderLoading(){return K(this)}set shaderLoading(e){e==="composition"?this.removeAttribute(N):this.setAttribute(N,e)}get assetsLoadingUi(){return this.getAttribute(x)==="none"?"none":"player"}set assetsLoadingUi(e){e==="none"?this.setAttribute(x,"none"):this.removeAttribute(x)}get muted(){return this.hasAttribute("muted")}set muted(e){e?this.setAttribute("muted",""):this.removeAttribute("muted")}get audioLocked(){return this.hasAttribute("audio-locked")}set audioLocked(e){e?this.setAttribute("audio-locked",""):this.removeAttribute("audio-locked")}_isLockedHostEnvironment(){if(typeof navigator>"u")return!1;const e=navigator.userAgent||"";return/\bClaude\/\d/.test(e)&&/\bElectron\b/.test(e)}_isAudioLocked(){return this.hasAttribute("audio-locked")||this._isLockedHostEnvironment()}_isSlideshowPlayer(){return this.closest("hyperframes-slideshow")!==null}_handleMutedChange(e){var i;if(e===null&&this._isAudioLocked()){this.setAttribute("muted","");return}this._media.updateMuted(e!==null),this._syncVideoAudio(),this._setIframeMediaMuted(e!==null),this._sendControl("set-muted",{muted:e!==null}),(i=this.controlsApi)==null||i.updateMuted(e!==null),this._emit(new Event("volumechange"))}_applyAudioLock(e){var i;e&&(this.muted=!0),(i=this.controlsApi)==null||i.setVolumeControlsHidden(e)}get volume(){return this._volume}set volume(e){this.setAttribute("volume",String(Math.max(0,Math.min(1,e))))}get disableClickToPlay(){return this.hasAttribute(Ne)}set disableClickToPlay(e){this.toggleAttribute(Ne,e)}get loop(){return this.hasAttribute("loop")}set loop(e){e?this.setAttribute("loop",""):this.removeAttribute("loop")}get rangeStart(){return this._readSeconds(I)}set rangeStart(e){this._writeSeconds(I,e)}get rangeEnd(){return this._readSeconds(O)}set rangeEnd(e){this._writeSeconds(O,e)}_readSeconds(e){const i=this.getAttribute(e);return i===null?null:Number(i)}_writeSeconds(e,i){i==null?this.removeAttribute(e):this.setAttribute(e,String(i))}_hasPlayRange(){return this.hasAttribute(I)||this.hasAttribute(O)}_playRange(){return Pe(this.rangeStart,this.rangeEnd,this._duration).range}_sendPlayRange(e){const i=(e==null?void 0:e.end)??null;this._sendControl("set-play-range",{startSeconds:(e==null?void 0:e.start)??null,endSeconds:i})}_applyPlayRange(e){const{range:i,clamped:s}=Pe(this.rangeStart,this.rangeEnd,this._duration);this._sendPlayRange(i),this._ready&&(this._reportRangeClamp(i,s),i&&e&&!this._pendingPlay&&this._moveIntoPlayRange(i))}_reportRangeClamp(e,i){const s=i?`${this.rangeStart},${this.rangeEnd},${this._duration}`:"";if(s===this._rangeClampReported||(this._rangeClampReported=s,!i))return;const n={rangeStart:(e==null?void 0:e.start)??null,rangeEnd:(e==null?void 0:e.end)??null};this._emit(new CustomEvent("rangeclamped",{detail:{...n,duration:this._duration}}))}_moveIntoPlayRange(e){Le(this._currentTime,e,this._duration,this._runtimeFps)&&(this._paused?this.seek(e.start):this._jumpWhilePlaying(e.start))}_jumpWhilePlaying(e){this._directTimelineAdapter?(this._directTimelineAdapter.seek(e,!1),this._currentTime=e):this._runtimeOwnsPlayRange||(this.seek(e),this._enteringRange=!0,this._play(!1))}_clockStop(){const e=this._playRange(),i=(e==null?void 0:e.end)??this._duration;if(!e)return{end:i,shown:i};const s=re(e,this._duration,this._runtimeFps);return{end:i,shown:s<i?(s+i)/2:s}}_sendControl(e,i={}){try{const s=this.iframe.contentWindow;return s?(s.postMessage({...i,source:"hf-parent",type:"control",action:e,...et(this._runtimeFps)},"*"),!0):((e==="set-runtime-data"||e==="clear-runtime-data")&&this._rejectRuntimeDataDelivery(i.channel,i.requestId,"Composition iframe is unavailable"),!1)}catch(s){return(e==="set-runtime-data"||e==="clear-runtime-data")&&this._rejectRuntimeDataDelivery(i.channel,i.requestId,s instanceof Error?s.message:String(s)),!1}}_deliverRuntimeData(e,i){if(!this.isConnected||!this._runtimeBridgeReady)return;const s=this._beginRuntimeDataDelivery(e);this._trySetRuntimeDataDirect(e,i,s)||this._sendControl("set-runtime-data",{channel:e,payload:i,requestId:s})}_deliverRuntimeDataClear(e){if(!this.isConnected||!this._runtimeBridgeReady)return;const i=this._beginRuntimeDataDelivery(e);this._tryClearRuntimeDataDirect(e,i)||this._sendControl("clear-runtime-data",{channel:e,requestId:i})}_trySetRuntimeDataDirect(e,i,s){var n;try{const o=(n=this.iframe.contentWindow)==null?void 0:n.__hyperframes;return typeof(o==null?void 0:o.setRuntimeData)!="function"?!1:(o.setRuntimeData(e,i,s),!0)}catch{return!1}}_tryClearRuntimeDataDirect(e,i){var s;try{const n=(s=this.iframe.contentWindow)==null?void 0:s.__hyperframes;return typeof(n==null?void 0:n.clearRuntimeData)!="function"?!1:(n.clearRuntimeData(e,i),!0)}catch{return!1}}_replayRuntimeData(){for(const[e,i]of this._runtimeData)this._deliverRuntimeData(e,i)}_beginRuntimeDataDelivery(e){const i=this._pendingRuntimeData.get(e);i&&window.clearTimeout(i.timeoutId),this._runtimeDataRequestId+=1;const s=this._runtimeDataRequestId,n=window.setTimeout(()=>{this._rejectRuntimeDataDelivery(e,s,`Runtime data delivery timed out after ${Oe}ms`)},Oe);return this._pendingRuntimeData.set(e,{requestId:s,timeoutId:n}),s}_resolveRuntimeDataDelivery(e,i){const s=this._takeRuntimeDataDelivery(e,i);s&&this._emit(new CustomEvent("runtimedataapplied",{detail:{channel:e,requestId:s.requestId}}))}_rejectRuntimeDataDelivery(e,i,s){const n=this._takeRuntimeDataDelivery(e,i);n&&this._emit(new CustomEvent("runtimedataerror",{detail:{channel:e,requestId:n.requestId,message:typeof s=="string"?s:String(s)}}))}_takeRuntimeDataDelivery(e,i){if(typeof e!="string"||typeof i!="number"||!Number.isSafeInteger(i))return null;const s=this._pendingRuntimeData.get(e);return!s||s.requestId!==i?null:(window.clearTimeout(s.timeoutId),this._pendingRuntimeData.delete(e),s)}_rejectAllRuntimeDataDeliveries(e){for(const[i,s]of[...this._pendingRuntimeData])this._rejectRuntimeDataDelivery(i,s.requestId,e)}_getSameOriginIframeDocument(){try{return this.iframe.contentDocument}catch{return null}}_setIframeMediaMuted(e){const i=this._getSameOriginIframeDocument();if(i)for(const s of i.querySelectorAll("video, audio"))A(s)&&(s.muted=e||s.defaultMuted)}_stopIframeMedia(){const e=this._getSameOriginIframeDocument();if(e)for(const i of e.querySelectorAll("video, audio"))A(i)&&i.pause()}_replayBridgeState(){this._sendControl("set-muted",{muted:this.muted}),this._sendControl("set-volume",{volume:this._volume}),this._sendControl("set-playback-rate",{playbackRate:this.playbackRate}),this._sendControl("set-native-media-sync-disabled",{disabled:this._isSlideshowPlayer()}),this._sendControl("set-web-audio-media-disabled",{disabled:this._isSlideshowPlayer()}),this._sendControl("set-idle-heartbeat",{slow:this.hasAttribute(te)}),this._sendDisplayScale()}_sendDisplayScale(){const e=tt(this.iframe);e&&this._sendControl("set-display-scale",{scale:e})}_reloadShaderOptions(){if(!this._videoSource){if(this._abandonComposition("Shader options changed before runtime data was applied"),this.hasAttribute("srcdoc")){this.iframe.srcdoc=z(this,this.getAttribute("srcdoc")||"");return}this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")||"")}}_navigateSrc(e){this._pendingPlay=!1,this._pauseForVideoSwitch(),this._abandonComposition("Composition navigated before runtime data was applied"),this._loadSrc(e)}_wantsVideo(){return ri(this.getAttribute("type"))&&!this.hasAttribute("srcdoc")}_pauseForVideoSwitch(){var e;!this._videoSource&&!this._wantsVideo()||(this._paused=!0,(e=this.controlsApi)==null||e.updatePlaying(!1))}_loadSrc(e){if(this._wantsVideo()){this._loadVideo(e);return}this._teardownVideo(),this.iframe.src=ei(this,e)}_loadVideo(e){var n,o;this._videoSource||(this._videoSource=ni({onMetadata:a=>this._applyThenEmit(()=>this._onVideoReady(a)),onDurationChange:a=>this._applyTimelineDuration(a.duration),onResize:a=>this._applyVideoSize(a),onPlay:a=>{!a.paused&&this._paused&&this.play()},onPause:a=>{a.paused&&!a.ended&&!this._paused&&this.pause()},onTimeUpdate:()=>{document.hidden&&this._playRange()&&this._directTimelineClock.poll()},onError:(a,c)=>{this._paused||this.pause(),this._emit(new CustomEvent("error",{detail:{message:a,code:c}}))},onPlayRejected:a=>this._onVideoPlayRejected(a)}),this.container.appendChild(this._videoSource.video),this.iframe.hidden=!0,this.iframe.src="about:blank"),this.probe.stop();const{video:i,adapter:s}=this._videoSource;this._directTimelineAdapter=s,this._currentTime=0,this._duration=0,(n=this.controlsApi)==null||n.updateTime(0,0),this._syncVideoAudio(),(o=s.timeScale)==null||o.call(s,this.playbackRate),e?i.src=e:(i.removeAttribute("src"),i.load())}_teardownVideo(){this._videoSource&&(this._videoSource.destroy(),this._videoSource=null,this.iframe.hidden=!1)}_syncVideoAudio(){this._videoSource&&(this._videoSource.video.muted=this.muted,this._videoSource.video.volume=this._volume)}_onVideoReady(e){this._applyTimelineDuration(e.duration),this._applyVideoSize(e),this._ready=!0,this._dispatchReady(),this._waitForAssetsReady(null),this._afterEvents(()=>{this.hasAttribute("autoplay")&&this._paused&&this.play()})}_applyTimelineDuration(e){var i;!Number.isFinite(e)||e<=0||(this._setDuration(e),(i=this.controlsApi)==null||i.updateTime(this._currentTime,e))}_applyVideoSize(e){e.videoWidth>0&&e.videoHeight>0&&this._setCompositionSize(e.videoWidth,e.videoHeight)}_onVideoPlayRejected(e){e instanceof DOMException&&e.name==="NotAllowedError"&&(this._paused||this.pause(),this._emit(new CustomEvent("playbackerror",{detail:{source:"video",error:e}})))}_trySyncSeek(e){if(this._videoSource)return!1;try{const i=this.iframe.contentWindow,s=i==null?void 0:i.__player;return typeof(s==null?void 0:s.seek)!="function"?!1:(s.seek.call(s,e),!0)}catch{return!1}}_withDirectTimeline(e){const i=this._videoSource?null:this.probe.resolveDirectTimelineAdapter(),s=i||this._directTimelineAdapter;if(!s)return!1;try{return e(s),i&&i!==this._directTimelineAdapter&&this._applyTimelineDuration(i.duration()),this._directTimelineAdapter=s,!0}catch{return!1}}_tryDirectTimelineSeek(e){return this._withDirectTimeline(i=>{i.seek(e,!1),i.pause()})}_tryDirectTimelinePlay(){return this._withDirectTimeline(e=>void e.play())}_tryDirectTimelinePause(){return this._withDirectTimeline(e=>void e.pause())}_showPausedVideoTime(){var e;this._videoSource&&(this._currentTime=this._videoSource.video.currentTime,(e=this.controlsApi)==null||e.updateTime(this._currentTime,this._duration),this._emit(new CustomEvent("timeupdate",{detail:{currentTime:this._currentTime}})))}_startParentTickClock(){this._stopParentTickClock();const e=()=>{if(this._paused){this._parentTickRaf=null;return}this._sendControl("tick"),this._parentTickRaf=requestAnimationFrame(e)};this._parentTickRaf=requestAnimationFrame(e)}_stopParentTickClock(){this._parentTickRaf!==null&&(cancelAnimationFrame(this._parentTickRaf),this._parentTickRaf=null)}_onMessage(e){this._videoSource||this.probe.failed||this._applyThenEmit(()=>this._handleRuntimeMessage(e))}_handleRuntimeMessage(e){qt(e,this.iframe.contentWindow,{getPlaybackState:()=>({currentTime:this._currentTime,duration:this._duration,paused:this._paused,lastUpdateMs:this._lastUpdateMs,enteringRange:this._enteringRange}),setPlaybackState:({currentTime:i,duration:s,paused:n,lastUpdateMs:o,enteringRange:a})=>{this._enteringRange=a===!0,this._currentTime=i,this._setDuration(s),this._paused=n,this._lastUpdateMs=o},getShaderLoadingMode:()=>K(this),shaderLoader:this.shaderLoader,setCompositionSize:(i,s)=>this._setCompositionSize(i,s),sendControl:(i,s)=>this._sendControl(i,s),getIframeDoc:()=>this.iframe.contentDocument,onRuntimeReady:()=>{this._runtimeBridgeReady=!0,this._replayBridgeState(),this._hasPlayRange()&&this._sendPlayRange(this._playRange()),this._replayRuntimeData()},onRuntimeAssetsReady:()=>{this._runtimeAssetsReadyGeneration===this._assetsGeneration&&this._settleAssetsReady(this._assetsGeneration)},onRuntimeDataApplied:(i,s)=>this._resolveRuntimeDataDelivery(i,s),onRuntimeDataError:(i,s,n)=>this._rejectRuntimeDataDelivery(i,s,n),onRuntimeTimelineReady:(i,s)=>this._onRuntimeTimelineReady(i,s),setBuffering:i=>this._setBuffering(i),setRuntimeFps:i=>{this._runtimeFps=i},setRuntimeOwnsPlayRange:i=>{this._runtimeOwnsPlayRange=i},shouldPromoteMediaAutoplayFallback:()=>!this._isSlideshowPlayer(),setScenes:i=>{this._scenes=i,this._emit(new CustomEvent("scenes",{detail:{scenes:i}}))},updateControlsTime:(i,s)=>{var n;return(n=this.controlsApi)==null?void 0:n.updateTime(i,s)},updateControlsPlaying:i=>{var s;return(s=this.controlsApi)==null?void 0:s.updatePlaying(i)},dispatchEvent:i=>this._emit(i),seek:i=>this.seek(i),play:()=>this.play(),getLoop:()=>this.loop,getPlayRange:()=>this._playRange(),media:this._media})}_onRuntimeTimelineReady(e,i){var n;if(this._ready)return;this.probe.stop(),this._setDuration(e),this._directTimelineAdapter=null,this._ready=!0,(n=this.controlsApi)==null||n.updateTime(this._currentTime,e),this._dispatchReady();const s=this._getSameOriginIframeDocument();s&&this._media.setupFromIframe(s),this._replayBridgeState(),this._setIframeMediaMuted(this.muted),this._waitForAssetsReady(s,i),this._playWhenWanted()}_onProbeReady(e){this._applyThenEmit(()=>this._applyProbeResult(e))}_applyProbeResult({duration:e,adapter:i,compositionSize:s}){var o;this._setDuration(e),this._directTimelineAdapter=i.kind==="direct-timeline"?i.timeline:null,s&&this._setCompositionSize(s.width,s.height),this._ready=!0,(o=this.controlsApi)==null||o.updateTime(0,e),this._dispatchReady();const n=this._getSameOriginIframeDocument();n&&this._media.setupFromIframe(n),this._setIframeMediaMuted(this.muted),this._waitForAssetsReady(n),this._playWhenWanted()}_waitForAssetsReady(e,i){this._clearAssetsLoadingShowTimer(),this._assetsReady=!1,this._painted=!1;const s=++this._assetsGeneration;if(!e){i===!1?(this._runtimeAssetsReadyGeneration=s,this._startAssetsLoadingOverlayTimer(s),setTimeout(()=>this._settleAssetsReady(s),Q)):this._settleAssetsReady(s);return}it(e,({timedOut:n})=>{s===this._assetsGeneration&&(n&&this._warnStuckAssets(e),this._settleAssetsReady(s))},{timeoutMs:Q}),this._assetsReady||this._startAssetsLoadingOverlayTimer(s)}_startAssetsLoadingOverlayTimer(e){this._assetsLoadingShowTimer=setTimeout(()=>{this._assetsLoadingShowTimer=null,!(e!==this._assetsGeneration||this._assetsReady)&&(this.setAttribute(ee,""),this.assetsLoadingUi!=="none"&&this.shaderLoader.showAssetsLoading())},Fe)}_setBuffering(e){if(e){if(this._bufferingShowTimer!==null||this.hasAttribute(j))return;this._bufferingShowTimer=setTimeout(()=>{this._bufferingShowTimer=null,this.setAttribute(j,""),this.assetsLoadingUi!=="none"&&this.shaderLoader.showAssetsLoading("Buffering","")},Fe);return}this._bufferingShowTimer!==null&&clearTimeout(this._bufferingShowTimer),this._bufferingShowTimer=null,this.hasAttribute(j)&&(this.removeAttribute(j),this.shaderLoader.hideAssetsLoading())}_hasPendingFirstFrameAssets(e){const{pendingMedia:i,pendingImages:s,fontsLoading:n}=Se(e,{scope:Te});return i.length>0||s.length>0||n}_warnStuckAssets(e){const{pendingMedia:i,pendingImages:s,fontsLoading:n}=Se(e,{scope:Te}),o=e.defaultView;console.warn(`[hyperframes-player] assets-loading timed out after ${Q}ms, playing anyway`,{stuckMedia:i.map(a=>a.currentSrc||a.getAttribute("src")||`<${a.tagName.toLowerCase()}>`),stuckImages:s.map(a=>a.currentSrc||a.getAttribute("src")||"<img>"),fontsLoading:n,computeReady:(o==null?void 0:o.__renderReady)===!0,documentHidden:e.hidden===!0})}_settleAssetsReady(e){e!==this._assetsGeneration||this._assetsReady||(this._clearAssetsLoadingShowTimer(),this._assetsReady=!0,this.removeAttribute(ee),this.shaderLoader.hideAssetsLoading(),this._emit(new Event("assetsready")),this.shaderLoader.whenHidden(()=>{e===this._assetsGeneration&&(this._painted=!0,this._emit(new Event("painted")))}),this._afterEvents(()=>{this._pendingPlay&&this.play()}))}_abandonComposition(e){this.probe.stop(),this._ready=!1,this._readyDocument=null,this._invalidateAssetsWait(),this._releaseDocument(),this._runtimeBridgeReady=!1,this._rejectAllRuntimeDataDeliveries(e)}_releaseDocument(){this._runtimeOwnsPlayRange=!1,this._enteringRange=!1,this._directTimelineAdapter=null,this._directTimelineClock.stop(),this._stopParentTickClock(),this._setBuffering(!1),this.shaderLoader.reset(),this._media.resetForIframeLoad()}_invalidateAssetsWait(){this._clearAssetsLoadingShowTimer(),this._assetsReady=!1,this._painted=!1,this._assetsGeneration++,this.removeAttribute(ee),this.shaderLoader.hide()}_clearAssetsLoadingShowTimer(){this._assetsLoadingShowTimer!==null&&(clearTimeout(this._assetsLoadingShowTimer),this._assetsLoadingShowTimer=null)}_dispatchReady(){this._readyDocument=this._getSameOriginIframeDocument();const e={duration:this._duration,compositionWidth:this._compositionWidth,compositionHeight:this._compositionHeight};this._emit(new CustomEvent("ready",{detail:e})),this._rescale(),this._rangeClampReported="",this._hasPlayRange()&&this._applyPlayRange(!0)}_setDuration(e){e!==this._duration&&(this._duration=e,this._ready&&(this._emit(new CustomEvent("durationchange",{detail:{duration:e}})),this._hasPlayRange()&&this._applyPlayRange(!1)))}_setCompositionSize(e,i){const s=e!==this._compositionWidth||i!==this._compositionHeight;if(this._compositionWidth=e,this._compositionHeight=i,this.sizer.style.aspectRatio=`${e} / ${i}`,this._rescale(),!s)return;const n={compositionWidth:e,compositionHeight:i};this._emit(new CustomEvent("resize",{detail:n}))}_applyThenEmit(e){if(this._afterUpdate){e();return}const i=[];this._afterUpdate=i;const s=[],n=o=>{try{o()}catch(a){s.push(a)}};n(e);for(const o of i)n(o);if(this._afterUpdate=null,s.length>0)throw s[0]}_afterEvents(e){this._afterUpdate?this._afterUpdate.push(e):e()}_playWhenWanted(){this._afterEvents(()=>{(this.hasAttribute("autoplay")||this._pendingPlay)&&this.play()})}_emit(e){this._afterEvents(()=>this.dispatchEvent(e))}_rescale(){const e=bt(this,this.iframe,this._compositionWidth,this._compositionHeight);e&&this._sendDisplayScale(),!e&&this._ready&&!this._rescaleWarned&&(this._rescaleWarned=!0,console.warn("[hyperframes-player] rescale no-op after ready: zero-size player element",{src:this.getAttribute("src"),offsetWidth:this.offsetWidth,offsetHeight:this.offsetHeight,compositionWidth:this._compositionWidth,compositionHeight:this._compositionHeight}))}_onIframeLoad(){if(!this._connected||this._videoSource)return;const e=this._getSameOriginIframeDocument();if(this._ready&&e===this._readyDocument){e&&this._hasPendingFirstFrameAssets(e)&&this._waitForAssetsReady(e);return}this._ready=!1,this._invalidateAssetsWait(),this._releaseDocument(),this.probe.start()}_setupControls(){this.controlsApi||(this.controlsApi=_t(this.shadow,this.muted,this._volume,this.getAttribute("speed-presets"),{onPlay:()=>this.play(),onPause:()=>this.pause(),onSeek:e=>this.seek(e*this._duration),onScrubStart:()=>{this._scrubbing=!0},onScrubEnd:()=>{this._scrubbing=!1,this.seek(this._currentTime)},onSpeedChange:e=>void(this.playbackRate=e),onMuteToggle:()=>void(this.muted=!this.muted),onVolumeChange:e=>void(this.volume=e)},this._isAudioLocked()),this.controlsApi.updateTime(this._currentTime,this._duration),this.controlsApi.updatePlaying(!this._paused),this.controlsApi.updateSpeed(this.playbackRate))}get _audioOwner(){return this._media.audioOwner}get _parentMedia(){return this._media.entries}_mirrorParentMediaTime(e,i){this._media.mirrorTime(e,i)}_promoteToParentProxy(){let e=null;try{e=this.iframe.contentDocument}catch{}this._media.promoteToParentProxy(e,(i,s)=>this._mirrorParentMediaTime(i,s)),this._sendControl("set-media-output-muted",{muted:!0})}_observeDynamicMedia(e){this._media.setupFromIframe(e)}}customElements.get("hyperframes-player")||customElements.define("hyperframes-player",di);export{di as HyperframesPlayer,ft as SPEED_PRESETS,M as formatSpeed,Ce as formatTime};