@clickmax/studio-bridge 0.0.0-stage → 12.5.7

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 (521) hide show
  1. package/README.md +22 -2
  2. package/dist/clickmax-bridge.js +291 -0
  3. package/editor/assets/__vite-browser-external-CV6URZNE.js +1 -0
  4. package/editor/assets/chunk-UYWON5AX-NUuRHjnO.js +1 -0
  5. package/editor/assets/dist-DFhRmUKu.js +56 -0
  6. package/editor/assets/domEditingLayers-KBTPQKGA-tvsAmAbb.js +1 -0
  7. package/editor/assets/hyperframes-player-CAjGal_q.js +473 -0
  8. package/editor/assets/index-CxuF8nIS.js +406 -0
  9. package/editor/assets/index-D5lVrSDr.css +1 -0
  10. package/editor/assets/lib-DlEuZBGC.js +1 -0
  11. package/editor/assets/rolldown-runtime-B0Z9INg1.js +1 -0
  12. package/editor/assets/src-DDA8OuTJ.js +117 -0
  13. package/editor/index.html +39 -0
  14. package/moments/catalog.json +2436 -0
  15. package/package.json +41 -3
  16. package/plugin/.claude-plugin/plugin.json +6 -0
  17. package/plugin/hooks/creative-check.mjs +116 -0
  18. package/plugin/hooks/hooks.json +15 -0
  19. package/plugin/skills/achadinho/SKILL.md +71 -0
  20. package/plugin/skills/brasil-mapas/SKILL.md +139 -0
  21. package/plugin/skills/brasil-mapas/geo/br-municipios.topojson +1 -0
  22. package/plugin/skills/brasil-mapas/geo/br-regioes.topojson +1 -0
  23. package/plugin/skills/brasil-mapas/geo/br-uf.topojson +1 -0
  24. package/plugin/skills/brasil-mapas/scripts/mapa-base.mjs +527 -0
  25. package/plugin/skills/brasil-mapas/scripts/seca.mjs +258 -0
  26. package/plugin/skills/criativos/SKILL.md +182 -0
  27. package/plugin/skills/design-criativos/SKILL.md +153 -0
  28. package/plugin/skills/imagens/SKILL.md +57 -0
  29. package/plugin/skills/imagens/scripts/gerar-imagem.mjs +141 -0
  30. package/prompts/agent-system-prompt.md +27 -0
  31. package/prompts/creative-system-prompt.md +17 -0
  32. package/templates/creative/agenda-aberta-calendario/page-01.html +217 -0
  33. package/templates/creative/agenda-aberta-calendario/preview.jpg +0 -0
  34. package/templates/creative/agenda-aberta-calendario/template.json +8 -0
  35. package/templates/creative/agenda-lotando-fim-de-ano/page-01.html +201 -0
  36. package/templates/creative/agenda-lotando-fim-de-ano/preview.jpg +0 -0
  37. package/templates/creative/agenda-lotando-fim-de-ano/template.json +8 -0
  38. package/templates/creative/alerta-vencimento-mensal/page-01.html +163 -0
  39. package/templates/creative/alerta-vencimento-mensal/preview.jpg +0 -0
  40. package/templates/creative/alerta-vencimento-mensal/template.json +8 -0
  41. package/templates/creative/ano-novo-agradecimento/page-01.html +244 -0
  42. package/templates/creative/ano-novo-agradecimento/preview.jpg +0 -0
  43. package/templates/creative/ano-novo-agradecimento/template.json +8 -0
  44. package/templates/creative/antes-depois/assets/img/exemplo-antes.jpg +0 -0
  45. package/templates/creative/antes-depois/assets/img/exemplo-depois.jpg +0 -0
  46. package/templates/creative/antes-depois/page-01.html +123 -0
  47. package/templates/creative/antes-depois/preview.jpg +0 -0
  48. package/templates/creative/antes-depois/template.json +8 -0
  49. package/templates/creative/anuncio-link/assets/img/exemplo-escritorio.jpg +0 -0
  50. package/templates/creative/anuncio-link/page-01.html +86 -0
  51. package/templates/creative/anuncio-link/preview.jpg +0 -0
  52. package/templates/creative/anuncio-link/template.json +8 -0
  53. package/templates/creative/aula-ao-vivo-retrato/assets/img/exemplo-confeiteira.jpg +0 -0
  54. package/templates/creative/aula-ao-vivo-retrato/page-01.html +148 -0
  55. package/templates/creative/aula-ao-vivo-retrato/preview.jpg +0 -0
  56. package/templates/creative/aula-ao-vivo-retrato/template.json +8 -0
  57. package/templates/creative/aula-experimental-gratis/assets/img/exemplo-treino-barra.jpg +0 -0
  58. package/templates/creative/aula-experimental-gratis/page-01.html +136 -0
  59. package/templates/creative/aula-experimental-gratis/preview.jpg +0 -0
  60. package/templates/creative/aula-experimental-gratis/template.json +8 -0
  61. package/templates/creative/avaliacao-google-qr/page-01.html +158 -0
  62. package/templates/creative/avaliacao-google-qr/preview.jpg +0 -0
  63. package/templates/creative/avaliacao-google-qr/template.json +8 -0
  64. package/templates/creative/aviso-feriado-fechado/page-01.html +157 -0
  65. package/templates/creative/aviso-feriado-fechado/preview.jpg +0 -0
  66. package/templates/creative/aviso-feriado-fechado/template.json +8 -0
  67. package/templates/creative/banner-oferta-semana/assets/img/exemplo-emporio.jpg +0 -0
  68. package/templates/creative/banner-oferta-semana/page-01.html +126 -0
  69. package/templates/creative/banner-oferta-semana/preview.jpg +0 -0
  70. package/templates/creative/banner-oferta-semana/template.json +8 -0
  71. package/templates/creative/black-friday-escuro-dourado/assets/img/exemplo-retrato.jpg +0 -0
  72. package/templates/creative/black-friday-escuro-dourado/page-01.html +191 -0
  73. package/templates/creative/black-friday-escuro-dourado/preview.jpg +0 -0
  74. package/templates/creative/black-friday-escuro-dourado/template.json +8 -0
  75. package/templates/creative/black-friday-sofisticada/page-01.html +149 -0
  76. package/templates/creative/black-friday-sofisticada/preview.jpg +0 -0
  77. package/templates/creative/black-friday-sofisticada/template.json +8 -0
  78. package/templates/creative/bonus-empilhados/page-01.html +203 -0
  79. package/templates/creative/bonus-empilhados/preview.jpg +0 -0
  80. package/templates/creative/bonus-empilhados/template.json +8 -0
  81. package/templates/creative/campanha-vacinacao-pet/assets/img/exemplo-cao-vacina.jpg +0 -0
  82. package/templates/creative/campanha-vacinacao-pet/page-01.html +182 -0
  83. package/templates/creative/campanha-vacinacao-pet/preview.jpg +0 -0
  84. package/templates/creative/campanha-vacinacao-pet/template.json +8 -0
  85. package/templates/creative/capa-live-youtube/assets/img/exemplo-evento.jpg +0 -0
  86. package/templates/creative/capa-live-youtube/page-01.html +124 -0
  87. package/templates/creative/capa-live-youtube/preview.jpg +0 -0
  88. package/templates/creative/capa-live-youtube/template.json +8 -0
  89. package/templates/creative/capa-video-aula/assets/img/exemplo-escritorio.jpg +0 -0
  90. package/templates/creative/capa-video-aula/page-01.html +108 -0
  91. package/templates/creative/capa-video-aula/preview.jpg +0 -0
  92. package/templates/creative/capa-video-aula/template.json +8 -0
  93. package/templates/creative/cardapio-do-dia-lousa/page-01.html +191 -0
  94. package/templates/creative/cardapio-do-dia-lousa/preview.jpg +0 -0
  95. package/templates/creative/cardapio-do-dia-lousa/template.json +8 -0
  96. package/templates/creative/cardapio-tv-pizza/assets/img/exemplo-pizza.jpg +0 -0
  97. package/templates/creative/cardapio-tv-pizza/page-01.html +145 -0
  98. package/templates/creative/cardapio-tv-pizza/preview.jpg +0 -0
  99. package/templates/creative/cardapio-tv-pizza/template.json +8 -0
  100. package/templates/creative/carrinho-aberto-curso/page-01.html +219 -0
  101. package/templates/creative/carrinho-aberto-curso/preview.jpg +0 -0
  102. package/templates/creative/carrinho-aberto-curso/template.json +8 -0
  103. package/templates/creative/carrossel-catalogo/assets/img/exemplo-cafe-pacote.webp +0 -0
  104. package/templates/creative/carrossel-catalogo/assets/img/exemplo-emporio.jpg +0 -0
  105. package/templates/creative/carrossel-catalogo/assets/img/exemplo-produto.webp +0 -0
  106. package/templates/creative/carrossel-catalogo/assets/img/exemplo-queijo.webp +0 -0
  107. package/templates/creative/carrossel-catalogo/page-01.html +91 -0
  108. package/templates/creative/carrossel-catalogo/page-02.html +110 -0
  109. package/templates/creative/carrossel-catalogo/page-03.html +110 -0
  110. package/templates/creative/carrossel-catalogo/page-04.html +110 -0
  111. package/templates/creative/carrossel-catalogo/page-05.html +91 -0
  112. package/templates/creative/carrossel-catalogo/preview.jpg +0 -0
  113. package/templates/creative/carrossel-catalogo/template.json +8 -0
  114. package/templates/creative/carrossel-dicas/assets/img/exemplo-escritorio.jpg +0 -0
  115. package/templates/creative/carrossel-dicas/page-01.html +102 -0
  116. package/templates/creative/carrossel-dicas/page-02.html +113 -0
  117. package/templates/creative/carrossel-dicas/page-03.html +113 -0
  118. package/templates/creative/carrossel-dicas/page-04.html +113 -0
  119. package/templates/creative/carrossel-dicas/page-05.html +105 -0
  120. package/templates/creative/carrossel-dicas/preview.jpg +0 -0
  121. package/templates/creative/carrossel-dicas/template.json +8 -0
  122. package/templates/creative/carrossel-direitos/assets/img/exemplo-advogada.jpg +0 -0
  123. package/templates/creative/carrossel-direitos/page-01.html +95 -0
  124. package/templates/creative/carrossel-direitos/page-02.html +103 -0
  125. package/templates/creative/carrossel-direitos/page-03.html +103 -0
  126. package/templates/creative/carrossel-direitos/page-04.html +102 -0
  127. package/templates/creative/carrossel-direitos/page-05.html +102 -0
  128. package/templates/creative/carrossel-direitos/page-06.html +85 -0
  129. package/templates/creative/carrossel-direitos/preview.jpg +0 -0
  130. package/templates/creative/carrossel-direitos/template.json +8 -0
  131. package/templates/creative/carrossel-erros-iniciante/page-01.html +179 -0
  132. package/templates/creative/carrossel-erros-iniciante/page-02.html +187 -0
  133. package/templates/creative/carrossel-erros-iniciante/page-03.html +187 -0
  134. package/templates/creative/carrossel-erros-iniciante/page-04.html +182 -0
  135. package/templates/creative/carrossel-erros-iniciante/page-05.html +179 -0
  136. package/templates/creative/carrossel-erros-iniciante/preview.jpg +0 -0
  137. package/templates/creative/carrossel-erros-iniciante/template.json +8 -0
  138. package/templates/creative/carrossel-lancamento-planta/assets/img/exemplo-predio.jpg +0 -0
  139. package/templates/creative/carrossel-lancamento-planta/page-01.html +123 -0
  140. package/templates/creative/carrossel-lancamento-planta/page-02.html +121 -0
  141. package/templates/creative/carrossel-lancamento-planta/page-03.html +121 -0
  142. package/templates/creative/carrossel-lancamento-planta/page-04.html +122 -0
  143. package/templates/creative/carrossel-lancamento-planta/page-05.html +129 -0
  144. package/templates/creative/carrossel-lancamento-planta/page-06.html +111 -0
  145. package/templates/creative/carrossel-lancamento-planta/preview.jpg +0 -0
  146. package/templates/creative/carrossel-lancamento-planta/template.json +8 -0
  147. package/templates/creative/carrossel-lancamento-prato/assets/img/exemplo-burger-gourmet.jpg +0 -0
  148. package/templates/creative/carrossel-lancamento-prato/page-01.html +255 -0
  149. package/templates/creative/carrossel-lancamento-prato/page-02.html +256 -0
  150. package/templates/creative/carrossel-lancamento-prato/page-03.html +254 -0
  151. package/templates/creative/carrossel-lancamento-prato/page-04.html +255 -0
  152. package/templates/creative/carrossel-lancamento-prato/preview.jpg +0 -0
  153. package/templates/creative/carrossel-lancamento-prato/template.json +8 -0
  154. package/templates/creative/carrossel-perguntas-saude/page-01.html +108 -0
  155. package/templates/creative/carrossel-perguntas-saude/page-02.html +142 -0
  156. package/templates/creative/carrossel-perguntas-saude/page-03.html +142 -0
  157. package/templates/creative/carrossel-perguntas-saude/page-04.html +142 -0
  158. package/templates/creative/carrossel-perguntas-saude/page-05.html +112 -0
  159. package/templates/creative/carrossel-perguntas-saude/page-06.html +100 -0
  160. package/templates/creative/carrossel-perguntas-saude/preview.jpg +0 -0
  161. package/templates/creative/carrossel-perguntas-saude/template.json +8 -0
  162. package/templates/creative/carrossel-plano-anual/assets/img/exemplo-academia.jpg +0 -0
  163. package/templates/creative/carrossel-plano-anual/page-01.html +119 -0
  164. package/templates/creative/carrossel-plano-anual/page-02.html +140 -0
  165. package/templates/creative/carrossel-plano-anual/page-03.html +127 -0
  166. package/templates/creative/carrossel-plano-anual/page-04.html +129 -0
  167. package/templates/creative/carrossel-plano-anual/preview.jpg +0 -0
  168. package/templates/creative/carrossel-plano-anual/template.json +8 -0
  169. package/templates/creative/carrossel-servico-novo/assets/img/exemplo-sobrancelha.jpg +0 -0
  170. package/templates/creative/carrossel-servico-novo/page-01.html +110 -0
  171. package/templates/creative/carrossel-servico-novo/page-02.html +116 -0
  172. package/templates/creative/carrossel-servico-novo/page-03.html +105 -0
  173. package/templates/creative/carrossel-servico-novo/page-04.html +141 -0
  174. package/templates/creative/carrossel-servico-novo/preview.jpg +0 -0
  175. package/templates/creative/carrossel-servico-novo/template.json +8 -0
  176. package/templates/creative/cartao-fidelidade-carimbos/page-01.html +182 -0
  177. package/templates/creative/cartao-fidelidade-carimbos/page-02.html +114 -0
  178. package/templates/creative/cartao-fidelidade-carimbos/page-03.html +113 -0
  179. package/templates/creative/cartao-fidelidade-carimbos/preview.jpg +0 -0
  180. package/templates/creative/cartao-fidelidade-carimbos/template.json +8 -0
  181. package/templates/creative/chaves-entregues/assets/img/exemplo-casal-chave.jpg +0 -0
  182. package/templates/creative/chaves-entregues/page-01.html +135 -0
  183. package/templates/creative/chaves-entregues/preview.jpg +0 -0
  184. package/templates/creative/chaves-entregues/template.json +8 -0
  185. package/templates/creative/checklist-revisao-viagem/assets/img/exemplo-carro-elevador.jpg +0 -0
  186. package/templates/creative/checklist-revisao-viagem/page-01.html +201 -0
  187. package/templates/creative/checklist-revisao-viagem/page-02.html +202 -0
  188. package/templates/creative/checklist-revisao-viagem/page-03.html +202 -0
  189. package/templates/creative/checklist-revisao-viagem/page-04.html +202 -0
  190. package/templates/creative/checklist-revisao-viagem/page-05.html +200 -0
  191. package/templates/creative/checklist-revisao-viagem/page-06.html +200 -0
  192. package/templates/creative/checklist-revisao-viagem/preview.jpg +0 -0
  193. package/templates/creative/checklist-revisao-viagem/template.json +8 -0
  194. package/templates/creative/checklist-semanal-carrossel/page-01.html +142 -0
  195. package/templates/creative/checklist-semanal-carrossel/page-02.html +154 -0
  196. package/templates/creative/checklist-semanal-carrossel/page-03.html +154 -0
  197. package/templates/creative/checklist-semanal-carrossel/page-04.html +154 -0
  198. package/templates/creative/checklist-semanal-carrossel/page-05.html +154 -0
  199. package/templates/creative/checklist-semanal-carrossel/page-06.html +155 -0
  200. package/templates/creative/checklist-semanal-carrossel/preview.jpg +0 -0
  201. package/templates/creative/checklist-semanal-carrossel/template.json +8 -0
  202. package/templates/creative/citacao/page-01.html +81 -0
  203. package/templates/creative/citacao/preview.jpg +0 -0
  204. package/templates/creative/citacao/template.json +8 -0
  205. package/templates/creative/cliente-usando-produto/assets/img/exemplo-cliente-moletom.jpg +0 -0
  206. package/templates/creative/cliente-usando-produto/page-01.html +146 -0
  207. package/templates/creative/cliente-usando-produto/preview.jpg +0 -0
  208. package/templates/creative/cliente-usando-produto/template.json +8 -0
  209. package/templates/creative/combo-cafe-da-manha/assets/img/exemplo-cafe.jpg +0 -0
  210. package/templates/creative/combo-cafe-da-manha/page-01.html +220 -0
  211. package/templates/creative/combo-cafe-da-manha/preview.jpg +0 -0
  212. package/templates/creative/combo-cafe-da-manha/template.json +8 -0
  213. package/templates/creative/combo-dia-de-beleza/page-01.html +216 -0
  214. package/templates/creative/combo-dia-de-beleza/preview.jpg +0 -0
  215. package/templates/creative/combo-dia-de-beleza/template.json +8 -0
  216. package/templates/creative/combo-familia-entrega/assets/img/exemplo-mesa-burgers.jpg +0 -0
  217. package/templates/creative/combo-familia-entrega/page-01.html +146 -0
  218. package/templates/creative/combo-familia-entrega/preview.jpg +0 -0
  219. package/templates/creative/combo-familia-entrega/template.json +8 -0
  220. package/templates/creative/comparativo-tres-opcoes/page-01.html +184 -0
  221. package/templates/creative/comparativo-tres-opcoes/preview.jpg +0 -0
  222. package/templates/creative/comparativo-tres-opcoes/template.json +8 -0
  223. package/templates/creative/comprar-ou-alugar/page-01.html +100 -0
  224. package/templates/creative/comprar-ou-alugar/page-02.html +129 -0
  225. package/templates/creative/comprar-ou-alugar/page-03.html +131 -0
  226. package/templates/creative/comprar-ou-alugar/page-04.html +105 -0
  227. package/templates/creative/comprar-ou-alugar/page-05.html +94 -0
  228. package/templates/creative/comprar-ou-alugar/preview.jpg +0 -0
  229. package/templates/creative/comprar-ou-alugar/template.json +8 -0
  230. package/templates/creative/conheca-a-equipe/assets/img/exemplo-equipe.jpg +0 -0
  231. package/templates/creative/conheca-a-equipe/page-01.html +131 -0
  232. package/templates/creative/conheca-a-equipe/preview.jpg +0 -0
  233. package/templates/creative/conheca-a-equipe/template.json +8 -0
  234. package/templates/creative/consulta-gratuita-vagas/assets/img/exemplo-balanca-justica.jpg +0 -0
  235. package/templates/creative/consulta-gratuita-vagas/page-01.html +154 -0
  236. package/templates/creative/consulta-gratuita-vagas/preview.jpg +0 -0
  237. package/templates/creative/consulta-gratuita-vagas/template.json +8 -0
  238. package/templates/creative/contagem-prazo-final/page-01.html +152 -0
  239. package/templates/creative/contagem-prazo-final/preview.jpg +0 -0
  240. package/templates/creative/contagem-prazo-final/template.json +8 -0
  241. package/templates/creative/contagem-reveillon/assets/img/exemplo-piscina-noite.jpg +0 -0
  242. package/templates/creative/contagem-reveillon/page-01.html +170 -0
  243. package/templates/creative/contagem-reveillon/preview.jpg +0 -0
  244. package/templates/creative/contagem-reveillon/template.json +8 -0
  245. package/templates/creative/cupom-recortavel/page-01.html +164 -0
  246. package/templates/creative/cupom-recortavel/preview.jpg +0 -0
  247. package/templates/creative/cupom-recortavel/template.json +8 -0
  248. package/templates/creative/data-institucional/page-01.html +114 -0
  249. package/templates/creative/data-institucional/preview.jpg +0 -0
  250. package/templates/creative/data-institucional/template.json +8 -0
  251. package/templates/creative/depoimento/assets/img/exemplo-retrato.jpg +0 -0
  252. package/templates/creative/depoimento/page-01.html +112 -0
  253. package/templates/creative/depoimento/preview.jpg +0 -0
  254. package/templates/creative/depoimento/template.json +8 -0
  255. package/templates/creative/depoimento-familia-viagem/assets/img/exemplo-familia-praia.jpg +0 -0
  256. package/templates/creative/depoimento-familia-viagem/page-01.html +157 -0
  257. package/templates/creative/depoimento-familia-viagem/preview.jpg +0 -0
  258. package/templates/creative/depoimento-familia-viagem/template.json +8 -0
  259. package/templates/creative/depoimento-print-conversa/page-01.html +188 -0
  260. package/templates/creative/depoimento-print-conversa/preview.jpg +0 -0
  261. package/templates/creative/depoimento-print-conversa/template.json +8 -0
  262. package/templates/creative/desafio-30-dias/assets/img/exemplo-alunos-comemorando.jpg +0 -0
  263. package/templates/creative/desafio-30-dias/page-01.html +192 -0
  264. package/templates/creative/desafio-30-dias/preview.jpg +0 -0
  265. package/templates/creative/desafio-30-dias/template.json +8 -0
  266. package/templates/creative/dia-da-feira-hortifruti/assets/img/exemplo-frutas.webp +0 -0
  267. package/templates/creative/dia-da-feira-hortifruti/assets/img/exemplo-tomates.webp +0 -0
  268. package/templates/creative/dia-da-feira-hortifruti/page-01.html +209 -0
  269. package/templates/creative/dia-da-feira-hortifruti/preview.jpg +0 -0
  270. package/templates/creative/dia-da-feira-hortifruti/template.json +8 -0
  271. package/templates/creative/dica-rapida-story/page-01.html +128 -0
  272. package/templates/creative/dica-rapida-story/preview.jpg +0 -0
  273. package/templates/creative/dica-rapida-story/template.json +8 -0
  274. package/templates/creative/dicas-verao-pet/page-01.html +138 -0
  275. package/templates/creative/dicas-verao-pet/page-02.html +139 -0
  276. package/templates/creative/dicas-verao-pet/page-03.html +139 -0
  277. package/templates/creative/dicas-verao-pet/page-04.html +139 -0
  278. package/templates/creative/dicas-verao-pet/page-05.html +138 -0
  279. package/templates/creative/dicas-verao-pet/preview.jpg +0 -0
  280. package/templates/creative/dicas-verao-pet/template.json +8 -0
  281. package/templates/creative/drop-colecao-numerada/assets/img/exemplo-moletom.jpg +0 -0
  282. package/templates/creative/drop-colecao-numerada/page-01.html +208 -0
  283. package/templates/creative/drop-colecao-numerada/preview.jpg +0 -0
  284. package/templates/creative/drop-colecao-numerada/template.json +8 -0
  285. package/templates/creative/encarte-ofertas/assets/img/exemplo-cafe-pacote.webp +0 -0
  286. package/templates/creative/encarte-ofertas/assets/img/exemplo-frutas.webp +0 -0
  287. package/templates/creative/encarte-ofertas/assets/img/exemplo-queijo.webp +0 -0
  288. package/templates/creative/encarte-ofertas/assets/img/exemplo-tomates.webp +0 -0
  289. package/templates/creative/encarte-ofertas/page-01.html +154 -0
  290. package/templates/creative/encarte-ofertas/preview.jpg +0 -0
  291. package/templates/creative/encarte-ofertas/template.json +8 -0
  292. package/templates/creative/encomenda-bolo-tamanhos/assets/img/exemplo-bolo.webp +0 -0
  293. package/templates/creative/encomenda-bolo-tamanhos/page-01.html +158 -0
  294. package/templates/creative/encomenda-bolo-tamanhos/preview.jpg +0 -0
  295. package/templates/creative/encomenda-bolo-tamanhos/template.json +8 -0
  296. package/templates/creative/enquete-caixa-pergunta/page-01.html +122 -0
  297. package/templates/creative/enquete-caixa-pergunta/preview.jpg +0 -0
  298. package/templates/creative/enquete-caixa-pergunta/template.json +8 -0
  299. package/templates/creative/evento/assets/img/exemplo-evento.jpg +0 -0
  300. package/templates/creative/evento/page-01.html +122 -0
  301. package/templates/creative/evento/preview.jpg +0 -0
  302. package/templates/creative/evento/template.json +8 -0
  303. package/templates/creative/faixa-frete-gratis-site/page-01.html +159 -0
  304. package/templates/creative/faixa-frete-gratis-site/preview.jpg +0 -0
  305. package/templates/creative/faixa-frete-gratis-site/template.json +8 -0
  306. package/templates/creative/feira-adocao/assets/img/exemplo-filhote-caramelo.jpg +0 -0
  307. package/templates/creative/feira-adocao/page-01.html +182 -0
  308. package/templates/creative/feira-adocao/preview.jpg +0 -0
  309. package/templates/creative/feira-adocao/template.json +8 -0
  310. package/templates/creative/festa-junina-oferta/page-01.html +153 -0
  311. package/templates/creative/festa-junina-oferta/preview.jpg +0 -0
  312. package/templates/creative/festa-junina-oferta/template.json +8 -0
  313. package/templates/creative/ficha-imovel-preco/assets/img/exemplo-sala.jpg +0 -0
  314. package/templates/creative/ficha-imovel-preco/page-01.html +174 -0
  315. package/templates/creative/ficha-imovel-preco/preview.jpg +0 -0
  316. package/templates/creative/ficha-imovel-preco/template.json +8 -0
  317. package/templates/creative/garantia-refazemos/assets/img/exemplo-equipe.jpg +0 -0
  318. package/templates/creative/garantia-refazemos/page-01.html +175 -0
  319. package/templates/creative/garantia-refazemos/preview.jpg +0 -0
  320. package/templates/creative/garantia-refazemos/template.json +8 -0
  321. package/templates/creative/homenagem-dia-das-maes/assets/img/exemplo-flores.jpg +0 -0
  322. package/templates/creative/homenagem-dia-das-maes/page-01.html +103 -0
  323. package/templates/creative/homenagem-dia-das-maes/preview.jpg +0 -0
  324. package/templates/creative/homenagem-dia-das-maes/template.json +8 -0
  325. package/templates/creative/horario-especial-festas/page-01.html +134 -0
  326. package/templates/creative/horario-especial-festas/preview.jpg +0 -0
  327. package/templates/creative/horario-especial-festas/template.json +8 -0
  328. package/templates/creative/horarios-clinica-story/assets/img/exemplo-recepcao.jpg +0 -0
  329. package/templates/creative/horarios-clinica-story/page-01.html +145 -0
  330. package/templates/creative/horarios-clinica-story/preview.jpg +0 -0
  331. package/templates/creative/horarios-clinica-story/template.json +8 -0
  332. package/templates/creative/horarios-contados-agenda/assets/img/exemplo-unhas-nude.jpg +0 -0
  333. package/templates/creative/horarios-contados-agenda/page-01.html +167 -0
  334. package/templates/creative/horarios-contados-agenda/preview.jpg +0 -0
  335. package/templates/creative/horarios-contados-agenda/template.json +8 -0
  336. package/templates/creative/inauguracao-unidade/assets/img/exemplo-fachada.jpg +0 -0
  337. package/templates/creative/inauguracao-unidade/page-01.html +160 -0
  338. package/templates/creative/inauguracao-unidade/preview.jpg +0 -0
  339. package/templates/creative/inauguracao-unidade/template.json +8 -0
  340. package/templates/creative/indicacao-premiada-pix/page-01.html +169 -0
  341. package/templates/creative/indicacao-premiada-pix/preview.jpg +0 -0
  342. package/templates/creative/indicacao-premiada-pix/template.json +8 -0
  343. package/templates/creative/indique-e-ganhe-passos/page-01.html +115 -0
  344. package/templates/creative/indique-e-ganhe-passos/page-02.html +142 -0
  345. package/templates/creative/indique-e-ganhe-passos/page-03.html +161 -0
  346. package/templates/creative/indique-e-ganhe-passos/preview.jpg +0 -0
  347. package/templates/creative/indique-e-ganhe-passos/template.json +8 -0
  348. package/templates/creative/kit-presente-data/assets/img/exemplo-caixa-presente.jpg +0 -0
  349. package/templates/creative/kit-presente-data/page-01.html +208 -0
  350. package/templates/creative/kit-presente-data/preview.jpg +0 -0
  351. package/templates/creative/kit-presente-data/template.json +8 -0
  352. package/templates/creative/lancamento/assets/img/exemplo-cafe.jpg +0 -0
  353. package/templates/creative/lancamento/page-01.html +95 -0
  354. package/templates/creative/lancamento/preview.jpg +0 -0
  355. package/templates/creative/lancamento/template.json +8 -0
  356. package/templates/creative/lista-de-espera-banner/assets/img/exemplo-brigadeiros.jpg +0 -0
  357. package/templates/creative/lista-de-espera-banner/page-01.html +156 -0
  358. package/templates/creative/lista-de-espera-banner/preview.jpg +0 -0
  359. package/templates/creative/lista-de-espera-banner/template.json +8 -0
  360. package/templates/creative/look-do-dia-precos/assets/img/exemplo-look-streetwear.jpg +0 -0
  361. package/templates/creative/look-do-dia-precos/page-01.html +170 -0
  362. package/templates/creative/look-do-dia-precos/preview.jpg +0 -0
  363. package/templates/creative/look-do-dia-precos/template.json +8 -0
  364. package/templates/creative/mensagem-de-natal/page-01.html +161 -0
  365. package/templates/creative/mensagem-de-natal/preview.jpg +0 -0
  366. package/templates/creative/mensagem-de-natal/template.json +8 -0
  367. package/templates/creative/mito-ou-verdade/page-01.html +160 -0
  368. package/templates/creative/mito-ou-verdade/preview.jpg +0 -0
  369. package/templates/creative/mito-ou-verdade/template.json +8 -0
  370. package/templates/creative/mudanca-endereco-banner/assets/img/exemplo-recepcao-espelhos.jpg +0 -0
  371. package/templates/creative/mudanca-endereco-banner/page-01.html +140 -0
  372. package/templates/creative/mudanca-endereco-banner/preview.jpg +0 -0
  373. package/templates/creative/mudanca-endereco-banner/template.json +8 -0
  374. package/templates/creative/natal-pet-foto/page-01.html +168 -0
  375. package/templates/creative/natal-pet-foto/preview.jpg +0 -0
  376. package/templates/creative/natal-pet-foto/template.json +8 -0
  377. package/templates/creative/novidades-emporio-carrossel/assets/img/exemplo-cafe-pacote.webp +0 -0
  378. package/templates/creative/novidades-emporio-carrossel/assets/img/exemplo-queijo.webp +0 -0
  379. package/templates/creative/novidades-emporio-carrossel/page-01.html +155 -0
  380. package/templates/creative/novidades-emporio-carrossel/page-02.html +163 -0
  381. package/templates/creative/novidades-emporio-carrossel/page-03.html +163 -0
  382. package/templates/creative/novidades-emporio-carrossel/page-04.html +108 -0
  383. package/templates/creative/novidades-emporio-carrossel/preview.jpg +0 -0
  384. package/templates/creative/novidades-emporio-carrossel/template.json +8 -0
  385. package/templates/creative/oferta-parcelada-discreta/page-01.html +176 -0
  386. package/templates/creative/oferta-parcelada-discreta/preview.jpg +0 -0
  387. package/templates/creative/oferta-parcelada-discreta/template.json +8 -0
  388. package/templates/creative/open-house-convite/assets/img/exemplo-casa.jpg +0 -0
  389. package/templates/creative/open-house-convite/page-01.html +173 -0
  390. package/templates/creative/open-house-convite/preview.jpg +0 -0
  391. package/templates/creative/open-house-convite/template.json +8 -0
  392. package/templates/creative/orcamento-em-minutos/assets/img/exemplo-mecanico.jpg +0 -0
  393. package/templates/creative/orcamento-em-minutos/page-01.html +170 -0
  394. package/templates/creative/orcamento-em-minutos/preview.jpg +0 -0
  395. package/templates/creative/orcamento-em-minutos/template.json +8 -0
  396. package/templates/creative/orcamento-por-foto/assets/img/exemplo-sala.jpg +0 -0
  397. package/templates/creative/orcamento-por-foto/page-01.html +175 -0
  398. package/templates/creative/orcamento-por-foto/preview.jpg +0 -0
  399. package/templates/creative/orcamento-por-foto/template.json +8 -0
  400. package/templates/creative/pacote-feriado-pousada/assets/img/exemplo-pousada.jpg +0 -0
  401. package/templates/creative/pacote-feriado-pousada/page-01.html +194 -0
  402. package/templates/creative/pacote-feriado-pousada/preview.jpg +0 -0
  403. package/templates/creative/pacote-feriado-pousada/template.json +8 -0
  404. package/templates/creative/pacote-ultimos-quartos/assets/img/exemplo-festa.jpg +0 -0
  405. package/templates/creative/pacote-ultimos-quartos/page-01.html +208 -0
  406. package/templates/creative/pacote-ultimos-quartos/preview.jpg +0 -0
  407. package/templates/creative/pacote-ultimos-quartos/template.json +8 -0
  408. package/templates/creative/parcela-em-destaque/assets/img/exemplo-tenis.webp +0 -0
  409. package/templates/creative/parcela-em-destaque/page-01.html +144 -0
  410. package/templates/creative/parcela-em-destaque/preview.jpg +0 -0
  411. package/templates/creative/parcela-em-destaque/template.json +8 -0
  412. package/templates/creative/parceria-duas-marcas/assets/img/exemplo-aperto-mao.jpg +0 -0
  413. package/templates/creative/parceria-duas-marcas/page-01.html +169 -0
  414. package/templates/creative/parceria-duas-marcas/preview.jpg +0 -0
  415. package/templates/creative/parceria-duas-marcas/template.json +8 -0
  416. package/templates/creative/pequenos-reparos-banner/assets/img/exemplo-torneira-reparo.jpg +0 -0
  417. package/templates/creative/pequenos-reparos-banner/page-01.html +115 -0
  418. package/templates/creative/pequenos-reparos-banner/preview.jpg +0 -0
  419. package/templates/creative/pequenos-reparos-banner/template.json +8 -0
  420. package/templates/creative/pergunta/page-01.html +126 -0
  421. package/templates/creative/pergunta/preview.jpg +0 -0
  422. package/templates/creative/pergunta/template.json +8 -0
  423. package/templates/creative/pergunta-do-seguidor/page-01.html +132 -0
  424. package/templates/creative/pergunta-do-seguidor/preview.jpg +0 -0
  425. package/templates/creative/pergunta-do-seguidor/template.json +8 -0
  426. package/templates/creative/pneus-black-friday-banner/assets/img/exemplo-pneus.jpg +0 -0
  427. package/templates/creative/pneus-black-friday-banner/page-01.html +141 -0
  428. package/templates/creative/pneus-black-friday-banner/preview.jpg +0 -0
  429. package/templates/creative/pneus-black-friday-banner/template.json +8 -0
  430. package/templates/creative/prazo-imposto-renda/page-01.html +196 -0
  431. package/templates/creative/prazo-imposto-renda/preview.jpg +0 -0
  432. package/templates/creative/prazo-imposto-renda/template.json +8 -0
  433. package/templates/creative/produto-destaque/assets/img/exemplo-produto.webp +0 -0
  434. package/templates/creative/produto-destaque/page-01.html +129 -0
  435. package/templates/creative/produto-destaque/preview.jpg +0 -0
  436. package/templates/creative/produto-destaque/template.json +8 -0
  437. package/templates/creative/projeto-verao-semanas/assets/img/exemplo-kettlebell.jpg +0 -0
  438. package/templates/creative/projeto-verao-semanas/page-01.html +168 -0
  439. package/templates/creative/projeto-verao-semanas/preview.jpg +0 -0
  440. package/templates/creative/projeto-verao-semanas/template.json +8 -0
  441. package/templates/creative/promo-relampago-delivery/assets/img/exemplo-hamburguer.jpg +0 -0
  442. package/templates/creative/promo-relampago-delivery/page-01.html +198 -0
  443. package/templates/creative/promo-relampago-delivery/preview.jpg +0 -0
  444. package/templates/creative/promo-relampago-delivery/template.json +8 -0
  445. package/templates/creative/promocao/assets/img/exemplo-tenis.webp +0 -0
  446. package/templates/creative/promocao/page-01.html +167 -0
  447. package/templates/creative/promocao/preview.jpg +0 -0
  448. package/templates/creative/promocao/template.json +8 -0
  449. package/templates/creative/queima-de-estoque/page-01.html +182 -0
  450. package/templates/creative/queima-de-estoque/preview.jpg +0 -0
  451. package/templates/creative/queima-de-estoque/template.json +8 -0
  452. package/templates/creative/resultado-aluno-numeros/page-01.html +173 -0
  453. package/templates/creative/resultado-aluno-numeros/preview.jpg +0 -0
  454. package/templates/creative/resultado-aluno-numeros/template.json +8 -0
  455. package/templates/creative/resultado-com-aviso/assets/img/exemplo-sorriso.jpg +0 -0
  456. package/templates/creative/resultado-com-aviso/page-01.html +145 -0
  457. package/templates/creative/resultado-com-aviso/preview.jpg +0 -0
  458. package/templates/creative/resultado-com-aviso/template.json +8 -0
  459. package/templates/creative/roteiro-um-dia-carrossel/assets/img/exemplo-praia-espelho.jpg +0 -0
  460. package/templates/creative/roteiro-um-dia-carrossel/assets/img/exemplo-vila-trancoso.jpg +0 -0
  461. package/templates/creative/roteiro-um-dia-carrossel/page-01.html +119 -0
  462. package/templates/creative/roteiro-um-dia-carrossel/page-02.html +123 -0
  463. package/templates/creative/roteiro-um-dia-carrossel/page-03.html +125 -0
  464. package/templates/creative/roteiro-um-dia-carrossel/page-04.html +125 -0
  465. package/templates/creative/roteiro-um-dia-carrossel/page-05.html +140 -0
  466. package/templates/creative/roteiro-um-dia-carrossel/preview.jpg +0 -0
  467. package/templates/creative/roteiro-um-dia-carrossel/template.json +8 -0
  468. package/templates/creative/selo-garantia-7-dias/page-01.html +158 -0
  469. package/templates/creative/selo-garantia-7-dias/preview.jpg +0 -0
  470. package/templates/creative/selo-garantia-7-dias/template.json +8 -0
  471. package/templates/creative/sorteio-aniversario/page-01.html +224 -0
  472. package/templates/creative/sorteio-aniversario/preview.jpg +0 -0
  473. package/templates/creative/sorteio-aniversario/template.json +8 -0
  474. package/templates/creative/story-contagem/assets/img/exemplo-pizza.jpg +0 -0
  475. package/templates/creative/story-contagem/page-01.html +135 -0
  476. package/templates/creative/story-contagem/preview.jpg +0 -0
  477. package/templates/creative/story-contagem/template.json +8 -0
  478. package/templates/creative/story-oferta/assets/img/exemplo-fundo-story.jpg +0 -0
  479. package/templates/creative/story-oferta/assets/img/exemplo-produto.webp +0 -0
  480. package/templates/creative/story-oferta/page-01.html +119 -0
  481. package/templates/creative/story-oferta/preview.jpg +0 -0
  482. package/templates/creative/story-oferta/template.json +8 -0
  483. package/templates/creative/tabela-banho-tosa/assets/img/exemplo-shihtzu.webp +0 -0
  484. package/templates/creative/tabela-banho-tosa/page-01.html +171 -0
  485. package/templates/creative/tabela-banho-tosa/preview.jpg +0 -0
  486. package/templates/creative/tabela-banho-tosa/template.json +8 -0
  487. package/templates/creative/tabela-planos-academia/page-01.html +187 -0
  488. package/templates/creative/tabela-planos-academia/preview.jpg +0 -0
  489. package/templates/creative/tabela-planos-academia/template.json +8 -0
  490. package/templates/creative/tabela-precos-servicos/page-01.html +192 -0
  491. package/templates/creative/tabela-precos-servicos/preview.jpg +0 -0
  492. package/templates/creative/tabela-precos-servicos/template.json +8 -0
  493. package/templates/creative/temporada-reservas-banner/assets/img/exemplo-praia.jpg +0 -0
  494. package/templates/creative/temporada-reservas-banner/page-01.html +148 -0
  495. package/templates/creative/temporada-reservas-banner/preview.jpg +0 -0
  496. package/templates/creative/temporada-reservas-banner/template.json +8 -0
  497. package/templates/creative/troca-facil-passos/page-01.html +109 -0
  498. package/templates/creative/troca-facil-passos/page-02.html +107 -0
  499. package/templates/creative/troca-facil-passos/page-03.html +107 -0
  500. package/templates/creative/troca-facil-passos/page-04.html +106 -0
  501. package/templates/creative/troca-facil-passos/preview.jpg +0 -0
  502. package/templates/creative/troca-facil-passos/template.json +8 -0
  503. package/templates/creative/troca-oleo-preco/assets/img/exemplo-galao-oleo.webp +0 -0
  504. package/templates/creative/troca-oleo-preco/page-01.html +178 -0
  505. package/templates/creative/troca-oleo-preco/preview.jpg +0 -0
  506. package/templates/creative/troca-oleo-preco/template.json +8 -0
  507. package/templates/creative/ultimas-vagas-mentoria/assets/img/exemplo-retrato.jpg +0 -0
  508. package/templates/creative/ultimas-vagas-mentoria/page-01.html +140 -0
  509. package/templates/creative/ultimas-vagas-mentoria/preview.jpg +0 -0
  510. package/templates/creative/ultimas-vagas-mentoria/template.json +8 -0
  511. package/templates/creative/vaga-emprego-funcoes/page-01.html +178 -0
  512. package/templates/creative/vaga-emprego-funcoes/preview.jpg +0 -0
  513. package/templates/creative/vaga-emprego-funcoes/template.json +8 -0
  514. package/templates/creative/voltou-ao-estoque/assets/img/exemplo-produto.webp +0 -0
  515. package/templates/creative/voltou-ao-estoque/page-01.html +155 -0
  516. package/templates/creative/voltou-ao-estoque/preview.jpg +0 -0
  517. package/templates/creative/voltou-ao-estoque/template.json +8 -0
  518. package/templates/creative/voucher-presente/assets/img/exemplo-voucher-flor.jpg +0 -0
  519. package/templates/creative/voucher-presente/page-01.html +181 -0
  520. package/templates/creative/voucher-presente/preview.jpg +0 -0
  521. package/templates/creative/voucher-presente/template.json +8 -0
@@ -0,0 +1,473 @@
1
+ function e(e){return e.hasRuntime||e.runtimeInjected?!1:!!(e.hasNestedCompositions||e.hasTimelines&&e.attempts>=5)}function t(e){return typeof e==`object`&&!!e}function n(e){return t(e)&&typeof e.getDuration==`function`}function r(e){return t(e)&&typeof e.duration==`function`&&typeof e.time==`function`&&typeof e.seek==`function`&&typeof e.play==`function`&&typeof e.pause==`function`}var i=`https://cdn.jsdelivr.net/npm/@hyperframes/core@0.8.140/dist/hyperframe.runtime.iife.js`;function a(e){if(e===null)return null;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:null}function o(e){let t=e?.querySelector(`[data-composition-id][data-width][data-height]`)??e?.querySelector(`[data-width][data-height]`);if(!t)return null;let n=a(t.getAttribute(`data-width`)),r=a(t.getAttribute(`data-height`));return n!==null&&r!==null?{width:n,height:r}:null}var s=class{constructor(e,t){this._iframe=e,this._callbacks=t}_iframe;_callbacks;_interval=null;_runtimeInjected=!1;get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let t=0;this._interval=setInterval(()=>{t++;try{let n=this._iframe.contentWindow;if(!n)return;let r=!!(n.__hf||n.__player);if(e({hasRuntime:r,hasTimelines:!!(n.__timelines&&Object.keys(n.__timelines).length>0),hasNestedCompositions:!!this._iframe.contentDocument?.querySelector(`[data-composition-src]`),runtimeInjected:this._runtimeInjected,attempts:t})){this._injectRuntime();return}if(this._runtimeInjected&&!r)return;let i=this._resolvePlaybackDurationAdapter(n);if(i&&i.getDuration()>0){this.stop();let e=o(this._iframe.contentDocument);this._callbacks.onReady({duration:i.getDuration(),adapter:i,compositionSize:e});return}}catch{}t>=40&&(this.stop(),this._callbacks.onError(`Composition timeline not found after 8s`))},200)}stop(){this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{let e=this._iframe.contentWindow;return e?this._resolveDirectTimelineAdapterFromWindow(e):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(e){return this._resolveDirectTimelineAdapterFromWindow(e)}hasRuntimeBridge(e){return Reflect.get(e,`__hf`)!==void 0||t(Reflect.get(e,`__player`))}_injectRuntime(){this._runtimeInjected=!0;try{let e=this._iframe.contentDocument;if(!e)return;let t=e.createElement(`script`);t.src=i,(e.head||e.documentElement).appendChild(t),this._callbacks.onRuntimeInjected?.()}catch{}}_resolveDirectTimelineAdapterFromWindow(e){if(this.hasRuntimeBridge(e))return null;let n=Reflect.get(e,`__timelines`);if(!t(n))return null;let i=Object.keys(n);if(i.length===0)return null;let a=this._iframe.contentDocument?.querySelector(`[data-composition-id]`)?.getAttribute(`data-composition-id`),o=n[a&&a in n?a:i[i.length-1]];return r(o)?o:null}_resolvePlaybackDurationAdapter(e){let t=Reflect.get(e,`__player`);if(n(t))return{kind:`runtime`,getDuration:()=>t.getDuration()};let r=this._resolveDirectTimelineAdapterFromWindow(e);return r?{kind:`direct-timeline`,timeline:r,getDuration:()=>r.duration()}:null}},c=`
2
+ :host {
3
+ display: block;
4
+ position: relative;
5
+ overflow: hidden;
6
+ background: #000;
7
+ contain: layout style;
8
+ }
9
+
10
+ .hfp-container {
11
+ position: absolute;
12
+ inset: 0;
13
+ overflow: hidden;
14
+ pointer-events: none;
15
+ }
16
+
17
+
18
+ .hfp-iframe {
19
+ position: absolute;
20
+ top: 50%;
21
+ left: 50%;
22
+ border: none;
23
+ pointer-events: none;
24
+ }
25
+
26
+ /* Opt-in: an interactive composition (e.g. a live slideshow/app with playable
27
+ media or controls) — let pointer events reach the iframe content. */
28
+ :host([interactive]) .hfp-container,
29
+ :host([interactive]) .hfp-iframe {
30
+ pointer-events: auto;
31
+ }
32
+
33
+ .hfp-video {
34
+ position: absolute;
35
+ inset: 0;
36
+ width: 100%;
37
+ height: 100%;
38
+ object-fit: contain;
39
+ pointer-events: none;
40
+ }
41
+
42
+ .hfp-poster {
43
+ position: absolute;
44
+ inset: 0;
45
+ object-fit: contain;
46
+ z-index: 1;
47
+ pointer-events: none;
48
+ }
49
+
50
+ .hfp-shader-loader {
51
+ position: absolute;
52
+ inset: 0;
53
+ z-index: 20;
54
+ display: grid;
55
+ place-items: center;
56
+ visibility: hidden;
57
+ opacity: 0;
58
+ pointer-events: none;
59
+ background: #030504;
60
+ color: #f4f7fb;
61
+ cursor: default;
62
+ user-select: none;
63
+ -webkit-user-select: none;
64
+ transition: opacity 420ms ease-out, visibility 420ms ease-out;
65
+ }
66
+
67
+ .hfp-shader-loader.hfp-visible,
68
+ .hfp-shader-loader.hfp-hiding {
69
+ visibility: visible;
70
+ }
71
+
72
+ .hfp-shader-loader.hfp-visible {
73
+ opacity: 1;
74
+ pointer-events: auto;
75
+ }
76
+
77
+ .hfp-shader-loader.hfp-hiding {
78
+ opacity: 0;
79
+ pointer-events: none;
80
+ }
81
+
82
+ .hfp-shader-loader-panel {
83
+ display: grid;
84
+ grid-template-rows: 86px 40px 26px 12px 44px;
85
+ justify-items: center;
86
+ align-items: center;
87
+ gap: 8px;
88
+ width: min(620px, 82%);
89
+ text-align: center;
90
+ font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
91
+ }
92
+
93
+ .hfp-shader-loader-mark {
94
+ width: 86px;
95
+ height: 86px;
96
+ display: grid;
97
+ place-items: center;
98
+ overflow: visible;
99
+ }
100
+
101
+ .hfp-shader-loader-mark svg {
102
+ display: block;
103
+ overflow: visible;
104
+ filter: drop-shadow(0 0 5px rgba(79, 219, 94, 0.16));
105
+ pointer-events: none;
106
+ }
107
+
108
+ .hfp-shader-loader-title {
109
+ width: 100%;
110
+ height: 40px;
111
+ overflow: hidden;
112
+ white-space: nowrap;
113
+ text-overflow: ellipsis;
114
+ font-size: 26px;
115
+ line-height: 40px;
116
+ font-weight: 700;
117
+ letter-spacing: 0;
118
+ }
119
+
120
+ .hfp-shader-loader-title-text {
121
+ color: transparent;
122
+ background: linear-gradient(
123
+ 90deg,
124
+ rgba(244, 247, 251, 0.84) 0%,
125
+ #ffffff 42%,
126
+ #80efe4 52%,
127
+ #ffffff 62%,
128
+ rgba(244, 247, 251, 0.84) 100%
129
+ );
130
+ background-size: 220% 100%;
131
+ -webkit-background-clip: text;
132
+ background-clip: text;
133
+ animation: hfp-shader-loader-sheen 1.9s linear infinite;
134
+ }
135
+
136
+ .hfp-shader-loader:not(.hfp-visible):not(.hfp-hiding) .hfp-shader-loader-title-text {
137
+ animation-play-state: paused;
138
+ }
139
+
140
+ .hfp-shader-loader-detail {
141
+ width: 100%;
142
+ height: 26px;
143
+ overflow: hidden;
144
+ white-space: nowrap;
145
+ text-overflow: ellipsis;
146
+ color: rgba(244, 247, 251, 0.62);
147
+ font-size: 15px;
148
+ line-height: 26px;
149
+ font-weight: 500;
150
+ }
151
+
152
+ .hfp-shader-loader-track {
153
+ width: min(360px, 100%);
154
+ height: 8px;
155
+ overflow: hidden;
156
+ border-radius: 999px;
157
+ background: rgba(255, 255, 255, 0.1);
158
+ }
159
+
160
+ .hfp-shader-loader-fill {
161
+ width: 100%;
162
+ height: 100%;
163
+ border-radius: inherit;
164
+ background: linear-gradient(90deg, #06e3fa, #4fdb5e);
165
+ transform: scaleX(0);
166
+ transform-origin: left center;
167
+ transition: transform 160ms ease;
168
+ }
169
+
170
+ .hfp-shader-loader-progress {
171
+ width: min(420px, 100%);
172
+ height: 44px;
173
+ display: grid;
174
+ grid-template-rows: repeat(2, 22px);
175
+ color: rgba(244, 247, 251, 0.48);
176
+ font: 600 13px/22px "IBM Plex Mono", "SF Mono", "Fira Code", "Courier New", monospace;
177
+ font-variant-numeric: tabular-nums;
178
+ }
179
+
180
+ .hfp-shader-loader-row {
181
+ display: grid;
182
+ grid-template-columns: minmax(0, 1fr) 74px;
183
+ align-items: center;
184
+ column-gap: 20px;
185
+ width: 100%;
186
+ white-space: nowrap;
187
+ }
188
+
189
+ .hfp-shader-loader-label {
190
+ min-width: 0;
191
+ overflow: hidden;
192
+ text-align: left;
193
+ text-overflow: ellipsis;
194
+ }
195
+
196
+ .hfp-shader-loader-value {
197
+ text-align: right;
198
+ }
199
+
200
+ @keyframes hfp-shader-loader-sheen {
201
+ from {
202
+ background-position: 140% 0;
203
+ }
204
+ to {
205
+ background-position: -140% 0;
206
+ }
207
+ }
208
+
209
+ /* ── Theming via CSS custom properties ──
210
+ *
211
+ * Override from outside the shadow DOM:
212
+ * hyperframes-player {
213
+ * --hfp-controls-bg: linear-gradient(transparent, rgba(0,0,0,0.9));
214
+ * --hfp-accent: #ff6b6b;
215
+ * --hfp-font: "Inter", sans-serif;
216
+ * }
217
+ */
218
+
219
+ .hfp-controls {
220
+ position: absolute;
221
+ bottom: 0;
222
+ left: 0;
223
+ right: 0;
224
+ display: flex;
225
+ align-items: center;
226
+ gap: var(--hfp-controls-gap, 12px);
227
+ padding: var(--hfp-controls-padding, 8px 16px);
228
+ background: var(--hfp-controls-bg, linear-gradient(transparent, rgba(0, 0, 0, 0.7)));
229
+ color: var(--hfp-color, #fff);
230
+ font-family: var(--hfp-font, system-ui, -apple-system, sans-serif);
231
+ font-size: var(--hfp-font-size, 13px);
232
+ z-index: 10;
233
+ pointer-events: auto;
234
+ opacity: 1;
235
+ transition: opacity 0.3s ease;
236
+ user-select: none;
237
+ }
238
+
239
+ .hfp-controls.hfp-hidden {
240
+ opacity: 0;
241
+ pointer-events: none;
242
+ }
243
+
244
+ .hfp-play-btn {
245
+ position: relative;
246
+ background: none;
247
+ border: none;
248
+ color: var(--hfp-color, #fff);
249
+ cursor: pointer;
250
+ padding: 8px;
251
+ display: flex;
252
+ align-items: center;
253
+ justify-content: center;
254
+ width: 40px;
255
+ height: 40px;
256
+ flex-shrink: 0;
257
+ z-index: 10;
258
+ }
259
+
260
+ .hfp-play-btn:hover {
261
+ opacity: 0.8;
262
+ }
263
+
264
+ /* Stacked play/pause glyphs that crossfade-morph on toggle (rotate + scale). */
265
+ .hfp-play-btn .hfp-ico {
266
+ position: absolute;
267
+ display: flex;
268
+ align-items: center;
269
+ justify-content: center;
270
+ transition:
271
+ opacity 200ms ease,
272
+ transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
273
+ }
274
+ .hfp-play-btn .hfp-ico-play {
275
+ opacity: 1;
276
+ transform: rotate(0) scale(1);
277
+ }
278
+ .hfp-play-btn .hfp-ico-pause {
279
+ opacity: 0;
280
+ transform: rotate(-90deg) scale(0.4);
281
+ }
282
+ .hfp-play-btn.hfp-playing .hfp-ico-play {
283
+ opacity: 0;
284
+ transform: rotate(90deg) scale(0.4);
285
+ }
286
+ .hfp-play-btn.hfp-playing .hfp-ico-pause {
287
+ opacity: 1;
288
+ transform: rotate(0) scale(1);
289
+ }
290
+ @media (prefers-reduced-motion: reduce) {
291
+ .hfp-play-btn .hfp-ico {
292
+ transition-duration: 0ms;
293
+ transform: none;
294
+ }
295
+ }
296
+
297
+ .hfp-play-btn svg,
298
+ .hfp-play-btn svg * {
299
+ pointer-events: none;
300
+ }
301
+
302
+ .hfp-scrubber {
303
+ flex: 1;
304
+ min-width: 0;
305
+ height: var(--hfp-scrubber-height, 4px);
306
+ background: var(--hfp-scrubber-bg, rgba(255, 255, 255, 0.3));
307
+ border-radius: var(--hfp-scrubber-radius, 2px);
308
+ cursor: pointer;
309
+ position: relative;
310
+ overflow: hidden;
311
+ }
312
+
313
+ .hfp-scrubber:hover {
314
+ height: var(--hfp-scrubber-height-hover, 6px);
315
+ }
316
+
317
+ .hfp-progress {
318
+ position: absolute;
319
+ top: 0;
320
+ left: 0;
321
+ height: 100%;
322
+ background: var(--hfp-accent, #fff);
323
+ pointer-events: none;
324
+ }
325
+
326
+ .hfp-time {
327
+ flex-shrink: 0;
328
+ font-variant-numeric: tabular-nums;
329
+ opacity: 0.9;
330
+ }
331
+
332
+ .hfp-speed-wrap {
333
+ position: relative;
334
+ flex-shrink: 0;
335
+ }
336
+
337
+ .hfp-speed-btn {
338
+ background: var(--hfp-speed-btn-bg, rgba(255, 255, 255, 0.15));
339
+ border: none;
340
+ border-radius: var(--hfp-speed-btn-radius, 4px);
341
+ color: var(--hfp-color, #fff);
342
+ cursor: pointer;
343
+ font-family: var(--hfp-font, system-ui, -apple-system, sans-serif);
344
+ font-size: 12px;
345
+ font-variant-numeric: tabular-nums;
346
+ font-weight: 600;
347
+ padding: 4px 8px;
348
+ min-width: 40px;
349
+ text-align: center;
350
+ transition: background 0.15s ease;
351
+ }
352
+
353
+ .hfp-speed-btn:hover {
354
+ background: var(--hfp-speed-btn-bg-hover, rgba(255, 255, 255, 0.3));
355
+ }
356
+
357
+ .hfp-speed-menu {
358
+ position: absolute;
359
+ bottom: calc(100% + 8px);
360
+ right: 0;
361
+ background: var(--hfp-menu-bg, rgba(20, 20, 20, 0.95));
362
+ backdrop-filter: blur(12px);
363
+ -webkit-backdrop-filter: blur(12px);
364
+ border: 1px solid var(--hfp-menu-border, rgba(255, 255, 255, 0.1));
365
+ border-radius: var(--hfp-menu-radius, 8px);
366
+ padding: 4px;
367
+ display: flex;
368
+ flex-direction: column;
369
+ gap: 2px;
370
+ min-width: 80px;
371
+ opacity: 0;
372
+ visibility: hidden;
373
+ transform: translateY(4px);
374
+ transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
375
+ box-shadow: var(--hfp-menu-shadow, 0 8px 24px rgba(0, 0, 0, 0.4));
376
+ }
377
+
378
+ .hfp-speed-menu.hfp-open {
379
+ opacity: 1;
380
+ visibility: visible;
381
+ transform: translateY(0);
382
+ }
383
+
384
+ .hfp-speed-option {
385
+ background: none;
386
+ border: none;
387
+ border-radius: 4px;
388
+ color: var(--hfp-menu-color, rgba(255, 255, 255, 0.7));
389
+ cursor: pointer;
390
+ font-family: var(--hfp-font, system-ui, -apple-system, sans-serif);
391
+ font-size: 13px;
392
+ font-variant-numeric: tabular-nums;
393
+ padding: 6px 12px;
394
+ text-align: left;
395
+ transition: background 0.1s ease, color 0.1s ease;
396
+ white-space: nowrap;
397
+ }
398
+
399
+ .hfp-speed-option:hover {
400
+ background: var(--hfp-menu-hover-bg, rgba(255, 255, 255, 0.1));
401
+ color: var(--hfp-color, #fff);
402
+ }
403
+
404
+ .hfp-speed-option.hfp-active {
405
+ color: var(--hfp-accent, #fff);
406
+ font-weight: 600;
407
+ }
408
+
409
+ .hfp-volume-wrap {
410
+ position: relative;
411
+ flex-shrink: 0;
412
+ display: flex;
413
+ align-items: center;
414
+ gap: 0;
415
+ }
416
+
417
+ .hfp-mute-btn {
418
+ background: none;
419
+ border: none;
420
+ color: var(--hfp-color, #fff);
421
+ cursor: pointer;
422
+ padding: 4px;
423
+ display: flex;
424
+ align-items: center;
425
+ justify-content: center;
426
+ width: 32px;
427
+ height: 32px;
428
+ flex-shrink: 0;
429
+ }
430
+
431
+ .hfp-mute-btn:hover {
432
+ opacity: 0.8;
433
+ }
434
+
435
+ .hfp-mute-btn svg,
436
+ .hfp-mute-btn svg * {
437
+ pointer-events: none;
438
+ }
439
+
440
+ .hfp-volume-slider-wrap {
441
+ width: 0;
442
+ overflow: hidden;
443
+ transition: width 0.2s ease;
444
+ display: flex;
445
+ align-items: center;
446
+ }
447
+
448
+ .hfp-volume-wrap:hover .hfp-volume-slider-wrap {
449
+ width: 64px;
450
+ }
451
+
452
+ .hfp-volume-slider {
453
+ width: 56px;
454
+ height: var(--hfp-scrubber-height, 4px);
455
+ background: var(--hfp-scrubber-bg, rgba(255, 255, 255, 0.3));
456
+ border-radius: var(--hfp-scrubber-radius, 2px);
457
+ cursor: pointer;
458
+ position: relative;
459
+ overflow: hidden;
460
+ margin-left: 4px;
461
+ margin-right: 4px;
462
+ }
463
+
464
+ .hfp-volume-fill {
465
+ position: absolute;
466
+ top: 0;
467
+ left: 0;
468
+ height: 100%;
469
+ background: var(--hfp-accent, #fff);
470
+ pointer-events: none;
471
+ }
472
+ `,l=`<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>`,u=`<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>`,d=`<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>`,f=`<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>`,p=`<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>`,m=[.25,.5,1,1.5,2,4];function h(e){return`${e}x`}function g(e){if(!Number.isFinite(e)||e<0)return`0:00`;let t=Math.floor(e);return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function _(e,t,n={}){let r=n.speedPresets??m,i=document.createElement(`div`);i.className=`hfp-controls`,i.addEventListener(`click`,e=>{e.stopPropagation()});let a=document.createElement(`button`);a.className=`hfp-play-btn`,a.type=`button`,a.innerHTML=`<span class="hfp-ico hfp-ico-play">${l}</span><span class="hfp-ico hfp-ico-pause">${u}</span>`,a.setAttribute(`aria-label`,`Play`);let o=document.createElement(`div`);o.className=`hfp-scrubber`;let s=document.createElement(`div`);s.className=`hfp-progress`,s.style.width=`0%`,o.appendChild(s);let c=document.createElement(`span`);c.className=`hfp-time`,c.textContent=`0:00 / 0:00`;let _=document.createElement(`div`);_.className=`hfp-speed-wrap`;let v=document.createElement(`button`);v.className=`hfp-speed-btn`,v.type=`button`,v.textContent=`1x`,v.setAttribute(`aria-label`,`Playback speed`);let y=document.createElement(`div`);y.className=`hfp-speed-menu`,y.setAttribute(`role`,`menu`);for(let e of r){let t=document.createElement(`button`);t.className=`hfp-speed-option`,t.type=`button`,t.setAttribute(`role`,`menuitem`),t.dataset.speed=String(e),t.textContent=h(e),e===1&&t.classList.add(`hfp-active`),y.appendChild(t)}_.appendChild(y),_.appendChild(v);let b=document.createElement(`div`);b.className=`hfp-volume-wrap`;let x=document.createElement(`button`);x.className=`hfp-mute-btn`,x.type=`button`,x.innerHTML=d,x.setAttribute(`aria-label`,`Mute`);let ee=document.createElement(`div`);ee.className=`hfp-volume-slider-wrap`;let S=document.createElement(`div`);S.className=`hfp-volume-slider`,S.setAttribute(`role`,`slider`),S.setAttribute(`aria-label`,`Volume`),S.setAttribute(`aria-valuemin`,`0`),S.setAttribute(`aria-valuemax`,`100`),S.setAttribute(`aria-valuenow`,`100`),S.tabIndex=0;let C=document.createElement(`div`);C.className=`hfp-volume-fill`,C.style.width=`100%`,S.appendChild(C),ee.appendChild(S),b.appendChild(ee),b.appendChild(x),n.audioLocked&&(b.style.display=`none`),i.appendChild(a),i.appendChild(o),i.appendChild(c),i.appendChild(b),i.appendChild(_),e.appendChild(i);let w=!1,T=!1,E=1,D=null,O=r.indexOf(1);O===-1&&(O=0);let k=(e,t)=>e?p:t===0||t<.5?f:d;a.addEventListener(`click`,e=>{e.stopPropagation(),w?t.onPause():t.onPlay()}),x.addEventListener(`click`,e=>{e.stopPropagation(),t.onMuteToggle()});let A=!1,j=e=>{let n=S.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e-n.left)/n.width));E=r,C.style.width=`${r*100}%`,S.setAttribute(`aria-valuenow`,String(Math.round(r*100))),T&&r>0&&t.onMuteToggle(),x.innerHTML=k(T,r),t.onVolumeChange(r)};S.addEventListener(`mousedown`,e=>{e.stopPropagation(),A=!0,j(e.clientX)});let te=e=>{A&&j(e.clientX)},M=()=>{A=!1};document.addEventListener(`mousemove`,te),document.addEventListener(`mouseup`,M),S.addEventListener(`touchstart`,e=>{A=!0;let t=e.touches[0];t&&j(t.clientX)},{passive:!0});let ne=e=>{if(A){let t=e.touches[0];t&&j(t.clientX)}},N=()=>{A=!1};document.addEventListener(`touchmove`,ne,{passive:!0}),document.addEventListener(`touchend`,N);let P=.05;S.addEventListener(`keydown`,e=>{let n=E;if(e.key===`ArrowRight`||e.key===`ArrowUp`)n=Math.min(1,E+P);else if(e.key===`ArrowLeft`||e.key===`ArrowDown`)n=Math.max(0,E-P);else return;e.preventDefault(),e.stopPropagation(),E=n,C.style.width=`${n*100}%`,S.setAttribute(`aria-valuenow`,String(Math.round(n*100))),T&&n>0&&t.onMuteToggle(),x.innerHTML=k(T,n),t.onVolumeChange(n)});let F=e=>{for(let t of y.querySelectorAll(`.hfp-speed-option`))t.classList.toggle(`hfp-active`,t.dataset.speed===String(e))};v.addEventListener(`click`,e=>{e.stopPropagation();let t=y.classList.toggle(`hfp-open`);v.setAttribute(`aria-expanded`,String(t))}),y.addEventListener(`click`,e=>{e.stopPropagation();let n=e.target.closest(`.hfp-speed-option`);if(!n)return;let i=parseFloat(n.dataset.speed);O=r.indexOf(i),v.textContent=h(i),F(i),y.classList.remove(`hfp-open`),v.setAttribute(`aria-expanded`,`false`),t.onSpeedChange(i)});let re=()=>{y.classList.remove(`hfp-open`),v.setAttribute(`aria-expanded`,`false`)};document.addEventListener(`click`,re);let I=e=>{let n=o.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e-n.left)/n.width));t.onSeek(r)},L=!1;o.addEventListener(`mousedown`,e=>{e.stopPropagation(),L=!0,t.onScrubStart?.(),I(e.clientX)});let ie=e=>{L&&I(e.clientX)},ae=()=>{L&&(L=!1,t.onScrubEnd?.())};document.addEventListener(`mousemove`,ie),document.addEventListener(`mouseup`,ae),o.addEventListener(`touchstart`,e=>{L=!0,t.onScrubStart?.();let n=e.touches[0];n&&I(n.clientX)},{passive:!0});let oe=e=>{if(L){let t=e.touches[0];t&&I(t.clientX)}},se=()=>{L&&(L=!1,t.onScrubEnd?.())};document.addEventListener(`touchmove`,oe,{passive:!0}),document.addEventListener(`touchend`,se);let ce=()=>{D&&clearTimeout(D),D=setTimeout(()=>{w&&i.classList.add(`hfp-hidden`)},3e3)},R=e instanceof ShadowRoot?e.host:e,le=()=>{i.classList.remove(`hfp-hidden`),ce()},z=()=>{w&&i.classList.add(`hfp-hidden`)};return R.addEventListener(`mousemove`,le),R.addEventListener(`mouseleave`,z),{updateTime(e,t){let n=t>0?Math.min(e,t):e,r=t>0?n/t*100:0;s.style.width=`${r}%`,c.textContent=`${g(n)} / ${g(t)}`},updatePlaying(e){w=e,a.classList.toggle(`hfp-playing`,e),a.setAttribute(`aria-label`,e?`Pause`:`Play`),e?ce():i.classList.remove(`hfp-hidden`)},updateSpeed(e){let t=r.indexOf(e);t!==-1&&(O=t),v.textContent=h(e),F(e)},updateMuted(e){T=e,x.innerHTML=k(e,E),x.setAttribute(`aria-label`,e?`Unmute`:`Mute`)},updateVolume(e){E=e,C.style.width=`${e*100}%`,S.setAttribute(`aria-valuenow`,String(Math.round(e*100))),x.innerHTML=k(T,e)},setVolumeControlsHidden(e){b.style.display=e?`none`:``},show(){i.style.display=``},hide(){i.style.display=`none`},destroy(){document.removeEventListener(`mousemove`,ie),document.removeEventListener(`mouseup`,ae),document.removeEventListener(`touchmove`,oe),document.removeEventListener(`touchend`,se),document.removeEventListener(`mousemove`,te),document.removeEventListener(`mouseup`,M),document.removeEventListener(`touchmove`,ne),document.removeEventListener(`touchend`,N),document.removeEventListener(`click`,re),R.removeEventListener(`mousemove`,le),R.removeEventListener(`mouseleave`,z),D&&clearTimeout(D),i.remove()}}}function v(e,t,n,r,i,a=!1){let o=r?r.split(`,`).map(Number).filter(e=>!isNaN(e)&&e>0):void 0,s=_(e,i,{...o?{speedPresets:o}:{},audioLocked:a});return s.updateMuted(t),s.updateVolume(n),s}function y(e,t,n){return t?(n||(n=document.createElement(`img`),n.className=`hfp-poster`,e.appendChild(n)),n.src=t,n):(n?.remove(),null)}function b(e){return e.composedPath().some(e=>e instanceof HTMLElement&&e.classList.contains(`hfp-controls`))}var x=null;function ee(e,t){if(typeof CSSStyleSheet<`u`)try{x||(x=new CSSStyleSheet,x.replaceSync(t)),e.adoptedStyleSheets=[x];return}catch{}let n=document.createElement(`style`);n.textContent=t,e.appendChild(n)}function S(){let e=document.createElement(`div`);e.className=`hfp-container`;let 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`,e.appendChild(t),{container:e,iframe:t}}function C(e,t,n,r){let i=e.offsetWidth,a=e.offsetHeight;if(i===0||a===0)return!1;let o=Math.min(i/n,a/r);return t.style.width=`${n}px`,t.style.height=`${r}px`,t.style.transform=`translate(-50%, -50%) scale(${o})`,!0}function w(e,t,n){return n.end<=0?!1:e+(n.shown<n.end&&t>0?t+.001:0)>=n.end}var T=class{constructor(e){this._callbacks=e}_callbacks;_raf=null;_lastUpdateMs=0;_tick=null;start(e,t,n,r,i){this.stop();let a=null,o=0,s=0,c=()=>{if(r()){this._raf=null;return}let t;try{t=e.time()}catch{this._raf=null;return}let l=n(),u=i();u.end>0&&(t=Math.min(t,u.end));let d=a===null?0:t-a;d!==0&&(s=Math.min(d,o),o=d),a=t;let f=w(t,s,u);f&&(t=u.shown);let p=performance.now();if((p-this._lastUpdateMs>100||f)&&(this._lastUpdateMs=p,this._callbacks.onTimeUpdate(t,l)),f){if(this._callbacks.getLoop()){this._callbacks.restart();return}try{e.pause(),u.shown<u.end&&e.seek(u.shown,!1)}catch{}this._callbacks.onPaused(),this._raf=null;return}this._raf=requestAnimationFrame(c)};this._tick=c,this._raf=requestAnimationFrame(c)}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 E(e){let t=Array.from(e.querySelectorAll(`[data-composition-id]`));if(t.length===0)return e.body?[e.body]:[];let n=[];for(let e of t)O(e)||n.push(e);return D(e),n}function D(e){let t=e.body;if(!t||typeof console>`u`||typeof console.warn!=`function`)return;let n=t.querySelectorAll(`audio[data-start], video[data-start]`);if(n.length===0)return;let r=[];for(let e of n)e.closest(`[data-composition-id]`)||r.push(e);r.length!==0&&console.warn(`[hyperframes-player] selectMediaObserverTargets: composition hosts are present, but ${r.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.`,r)}function O(e){let t=e.parentElement;for(;t;){if(t.hasAttribute(`data-composition-id`))return!0;t=t.parentElement}return!1}function k(){return globalThis}function A(e,t){if(typeof window>`u`)return;let n=k(),r=n.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch{}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var j=`data-hf-authored-duration`,te=`data-hf-authored-end`;function M(e){if(e==null||typeof e==`string`&&e.trim()===``)return null;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t:null}function ne(e){let t=M(e.start);if(t==null)return null;let n=Math.max(0,t),r=M(e.duration),i=M(e.authoredDuration),a=r!=null&&r>0?r:i!=null&&i>0?i:null;if(a!=null)return{start:n,duration:a,end:n+a};let o=M(e.end),s=M(e.authoredEnd),c=o!=null&&o>n?o:s!=null&&s>n?s:null;return{start:n,duration:c==null?null:c-n,end:c}}var N=Object.freeze({start:`data-start`,duration:`data-duration`,trackIndex:`data-track-index`,derivedEnd:`data-end`,legacyTrack:`data-layer`});Object.freeze([N.start,N.duration,N.trackIndex]),Object.freeze([N.derivedEnd]),Object.freeze([N.derivedEnd,N.legacyTrack]);function P(e){if(e==null||e.trim()===``)return null;let t=Number(e);return Number.isFinite(t)?t:null}var F=e=>{let t=P(e);return t!==null&&t>=0?t:null};function re(e){return F(e(`data-playback-start`))??F(e(`data-media-start`))??0}var I=.1,L=10;function ie(e){return Number.isFinite(e)&&e>0?Math.max(I,Math.min(L,e)):1}function ae(e,t=1){let n=Number.parseFloat(e(`data-playback-rate`)??``);return ie(Number.isFinite(n)&&n>0?n:t)}function oe(e){let t=P(e(`data-duration`));return t!==null&&t>0?t:null}function se(e,t){let n=oe(e);if(n!==null)return n;let r=P(e(`data-end`));return r===null?null:r-t}var ce=3;function R(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/ie(n):null}function le(e){let{tag:t,authoredDurationSeconds:n,sourceDurationSeconds:r,mediaStartSeconds:i,playbackRate:a}=e;if(n!==null&&n>0)return{seconds:n,source:`authored`};if(t===`img`)return{seconds:ce,source:`default`};if(r===null)return{seconds:null,source:`pending`,reason:`source duration not yet probed`};let o=R(r,i,a);return o===null?{seconds:null,source:`pending`,reason:`source reported a non-finite duration`}:{seconds:o,source:`media`}}var z=(e=`frequency`,t=`Frequency`,n=1e3,r=20,i=2e4)=>({kind:`number`,key:e,label:t,unit:`Hz`,min:r,max:i,step:1,default:n,scale:`log`,automatable:!0}),ue=(e=.707,t=`Bandwidth — higher is narrower.`)=>({kind:`number`,key:`q`,label:`Q`,unit:``,min:.1,max:20,step:.01,default:e,scale:`log`,automatable:!0,hint:t}),de=(e=-40,t=40,n=0)=>({kind:`number`,key:`gain`,label:`Gain`,unit:`dB`,min:e,max:t,step:.1,default:n,automatable:!0}),fe={kind:`enum`,key:`poles`,label:`Slope`,options:[{value:`1`,label:`6 dB/oct`},{value:`2`,label:`12 dB/oct`}],default:`2`,hint:`Two poles is the usual biquad; one pole is gentler.`},pe=[{id:`gain`,label:`Gain`,group:`dynamics`,description:`Raise or lower the whole signal. Automate it to duck under something else.`,params:[de(-60,12,0)],web:`gain-node`},{id:`peaking`,label:`Peaking EQ`,group:`filter`,description:`Boost or cut a band, leaving everything either side alone.`,params:[z(`frequency`,`Frequency`,1e3),de(-40,40,0),ue(1)],web:`biquad-peaking`},{id:`lowshelf`,label:`Low Shelf`,group:`filter`,description:`Lift or drop everything below the corner frequency.`,params:[z(`frequency`,`Frequency`,200,20,2e3),de(-40,40,0)],web:`biquad-lowshelf`},{id:`highshelf`,label:`High Shelf`,group:`filter`,description:`Lift or drop everything above the corner frequency.`,params:[z(`frequency`,`Frequency`,4e3,500,2e4),de(-40,40,0)],web:`biquad-highshelf`},{id:`highpass`,label:`High-pass`,group:`filter`,description:`Remove low frequencies — the usual fix for rumble on a voice.`,params:[z(`frequency`,`Cutoff`,300,20,2e4),ue(.707),fe],web:`biquad-highpass`},{id:`lowpass`,label:`Low-pass`,group:`filter`,description:`Remove high frequencies — darkens or muffles a track.`,params:[z(`frequency`,`Cutoff`,8e3,100,2e4),ue(.707),fe],web:`biquad-lowpass`},{id:`compressor`,label:`Compressor`,group:`dynamics`,description:`Pull loud parts down so the quiet ones can come up.`,params:[{kind:`number`,key:`threshold`,label:`Threshold`,unit:`dB`,min:-60,max:0,step:.5,default:-24,hint:`Level above which the compressor starts working.`},{kind:`number`,key:`ratio`,label:`Ratio`,unit:`:1`,min:1,max:20,step:.1,default:4},{kind:`number`,key:`attack`,label:`Attack`,unit:`ms`,min:.01,max:2e3,step:.1,default:20,scale:`log`},{kind:`number`,key:`release`,label:`Release`,unit:`ms`,min:.01,max:9e3,step:1,default:250,scale:`log`},{kind:`number`,key:`knee`,label:`Knee`,unit:``,min:1,max:8,step:.01,default:2.83,hint:`1 is a hard corner; higher eases into it.`},{kind:`number`,key:`makeup`,label:`Makeup`,unit:`dB`,min:0,max:36,step:.1,default:0},{kind:`number`,key:`mix`,label:`Mix`,unit:``,min:0,max:1,step:.01,default:1,hint:`Below 1 blends the dry signal back in.`}],web:`worklet-compressor`},{id:`limiter`,label:`Limiter`,group:`dynamics`,description:`Hard ceiling — nothing gets past the limit.`,params:[{kind:`number`,key:`limit`,label:`Ceiling`,unit:`dB`,min:-24,max:0,step:.1,default:-1},{kind:`number`,key:`attack`,label:`Attack`,unit:`ms`,min:.1,max:80,step:.1,default:5},{kind:`number`,key:`release`,label:`Release`,unit:`ms`,min:1,max:8e3,step:1,default:50,scale:`log`},{kind:`number`,key:`level_out`,label:`Output`,unit:`dB`,min:-24,max:24,step:.1,default:0}],web:`worklet-limiter`},{id:`gate`,label:`Noise Gate`,group:`dynamics`,description:`Silence the track when it drops below the threshold.`,params:[{kind:`number`,key:`threshold`,label:`Threshold`,unit:`dB`,min:-80,max:0,step:.5,default:-35},{kind:`number`,key:`range`,label:`Range`,unit:`dB`,min:-80,max:0,step:.5,default:-24,hint:`How far down the gate pulls when closed.`},{kind:`number`,key:`ratio`,label:`Ratio`,unit:`:1`,min:1,max:20,step:.1,default:10},{kind:`number`,key:`attack`,label:`Attack`,unit:`ms`,min:.01,max:9e3,step:.1,default:1,scale:`log`},{kind:`number`,key:`release`,label:`Release`,unit:`ms`,min:.01,max:9e3,step:1,default:100,scale:`log`},{kind:`number`,key:`knee`,label:`Knee`,unit:``,min:1,max:8,step:.01,default:2.83}],web:`worklet-gate`},{id:`saturate`,label:`Saturation`,group:`nonlinear`,description:`Soft-clip the waveform for warmth or outright distortion.`,params:[{kind:`enum`,key:`type`,label:`Curve`,options:[{value:`tanh`,label:`Tanh`},{value:`atan`,label:`Arctan`},{value:`cubic`,label:`Cubic`},{value:`exp`,label:`Exponential`},{value:`alg`,label:`Algebraic`},{value:`quintic`,label:`Quintic`},{value:`sin`,label:`Sine`},{value:`erf`,label:`Error function`},{value:`hard`,label:`Hard clip`}],default:`tanh`},{kind:`number`,key:`threshold`,label:`Threshold`,unit:`dB`,min:-40,max:0,step:.1,default:-6},{kind:`number`,key:`output`,automatable:!0,label:`Output`,unit:`dB`,min:-24,max:24,step:.1,default:0},{kind:`number`,key:`oversample`,label:`Oversample`,unit:`x`,min:1,max:8,step:1,default:4,hint:`Higher costs more but keeps aliasing down.`}],web:`waveshaper`},{id:`bitcrush`,label:`Bitcrush`,group:`nonlinear`,description:`Drop bit depth and sample rate for a lo-fi, digital sound.`,params:[{kind:`number`,key:`bits`,label:`Bit depth`,unit:`bit`,min:1,max:32,step:.1,default:8},{kind:`number`,key:`samples`,label:`Sample hold`,unit:`x`,min:1,max:250,step:1,default:1,hint:`Repeats each sample N times — a crude downsample.`},{kind:`number`,key:`mix`,label:`Mix`,unit:``,min:0,max:1,step:.01,default:1}],web:`worklet-bitcrush`},{id:`pitchshift`,label:`Pitch shift`,group:`time`,description:`Shifts pitch up or down without changing playback speed. Adds ~50 ms of latency.`,params:[{kind:`number`,key:`semitones`,label:`Semitones`,unit:`st`,min:-12,max:12,step:1,default:0},{kind:`number`,key:`mix`,label:`Mix`,unit:``,min:0,max:1,step:.01,default:1}],web:`worklet-pitchshift`},{id:`delay`,label:`Delay`,group:`time`,description:`Repeating echoes behind the dry signal.`,params:[{kind:`number`,key:`time`,automatable:!0,label:`Time`,unit:`ms`,min:1,max:5e3,step:1,default:250,scale:`log`},{kind:`number`,key:`feedback`,automatable:!0,label:`Feedback`,unit:``,min:.01,max:.95,step:.01,default:.35},{kind:`number`,key:`mix`,automatable:!0,label:`Mix`,unit:``,min:0,max:1,step:.01,default:.4}],web:`delay-feedback`},{id:`chorus`,label:`Chorus`,group:`time`,description:`Detuned copies of the signal for width and thickness.`,params:[{kind:`number`,key:`delay`,automatable:!0,label:`Delay`,unit:`ms`,min:1,max:100,step:.1,default:7},{kind:`number`,key:`depth`,automatable:!0,label:`Depth`,unit:`ms`,min:0,max:10,step:.01,default:2},{kind:`number`,key:`speed`,automatable:!0,label:`Rate`,unit:`Hz`,min:.01,max:10,step:.01,default:1},{kind:`number`,key:`mix`,automatable:!0,label:`Mix`,unit:``,min:0,max:1,step:.01,default:.5}],web:`chorus-lfo`},{id:`phaser`,label:`Phaser`,group:`time`,description:`Sweeping notches moving through the spectrum.`,params:[{kind:`number`,key:`in_gain`,automatable:!0,label:`Input`,unit:``,min:0,max:1,step:.01,default:.4},{kind:`number`,key:`out_gain`,automatable:!0,label:`Output`,unit:``,min:0,max:2,step:.01,default:.74},{kind:`number`,key:`delay`,label:`Delay`,unit:`ms`,min:.1,max:5,step:.1,default:3},{kind:`number`,key:`decay`,label:`Decay`,unit:``,min:0,max:.99,step:.01,default:.4},{kind:`number`,key:`speed`,automatable:!0,label:`Rate`,unit:`Hz`,min:.1,max:2,step:.01,default:.5},{kind:`enum`,key:`type`,label:`Waveform`,options:[{value:`0`,label:`Triangular`},{value:`1`,label:`Sinusoidal`}],default:`0`}],web:`allpass-phaser`},{id:`reverb`,label:`Reverb`,group:`time`,description:`Room tail. Both ends convolve the same generated impulse, so preview matches render.`,params:[{kind:`number`,key:`size`,label:`Room size`,unit:``,min:.05,max:1,step:.01,default:.7},{kind:`number`,key:`damping`,label:`Damping`,unit:``,min:0,max:1,step:.01,default:.5,hint:`Higher rolls the top off the tail faster.`},{kind:`number`,key:`wet`,automatable:!0,label:`Wet`,unit:``,min:0,max:1,step:.01,default:.35},{kind:`number`,key:`dry`,automatable:!0,label:`Dry`,unit:``,min:0,max:1,step:.01,default:.7}],web:`convolver`}];new Map(pe.map(e=>[e.id,e])),pe.map(e=>e.id);function me(e){return 10**(e/20)}var he=me(12),ge=1,_e=512,B=class extends Error{constructor(e){super(e),this.name=`AudioAutomationError`}},ve=`volume`,ye=`rate`;function be(e){if(e===ve)return{kind:`volume`};if(e===ye)return{kind:`rate`};let t=e.split(`.`);if(t.length===3&&t[0]===`fx`&&t[1]===xe){let e=t[2];return e?{kind:`preset`,presetId:e}:null}if(t.length!==3||t[0]!==`fx`)return null;let[,n,r]=t;return!n||!r?null:{kind:`fx`,nodeId:n,param:r}}var xe=`preset`,Se={min:0,max:he,step:.01,unit:``,label:`Volume`,scale:`linear`,default:1},Ce={min:I,max:L,step:.05,unit:`x`,label:`Speed`,scale:`log`,default:1};function V(e){if(typeof e==`number`)return Number.isFinite(e)?e:null;if(typeof e==`string`&&e.trim()!==``){let t=Number(e);return Number.isFinite(t)?t:null}return null}function we(e){let t=V(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function Te(e,t){let n=V(e),r=V(t);if(n===null||r===null)return null;let i=e=>Math.min(.999,Math.max(.001,e)),a=i(n),o=i(r);return Math.abs(a-o)<1e-6?null:{x:a,y:o}}function Ee(e){let t=we(e?.curve),n=Te(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function De(e,t){let n=V(e?.t),r=V(e?.v);if(n===null||r===null)return null;let i=t?Math.min(t.max,Math.max(t.min,r)):r;return{t:Math.max(0,n),v:i,...Ee(e)}}function Oe(e,t){let n=e.map(e=>De(e,t)).filter(e=>e!==null).sort((e,t)=>e.t-t.t),r=[];for(let e of n)r.length>0&&r[r.length-1].t===e.t?r[r.length-1]=e:r.push(e);return r.slice(0,_e)}function ke(e){let t=[];for(let n of e.lanes){if(!be(n.target))continue;let e=n.target===ve?Se:n.target===ye?Ce:null,r=Oe(n.points??[],e);r.length>0&&t.push({target:n.target,points:r})}return{version:ge,lanes:t}}function Ae(e){let t;try{t=JSON.parse(e)}catch(e){throw new B(`Automation is not valid JSON: ${e.message}`)}if(typeof t!=`object`||!t)throw new B(`Automation must be a JSON object.`);let n=t;if(n.version!==ge)throw new B(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new B("Automation is missing a `lanes` array.");return ke({version:ge,lanes:n.lanes.map((e,t)=>{if(typeof e!=`object`||!e)throw new B(`Lane ${t} is not an object.`);let n=e;if(typeof n.target!=`string`||!be(n.target))throw new B(`Lane ${t} has an unreadable target: ${String(n.target)}`);if(!Array.isArray(n.points))throw new B(`Lane ${t} is missing a \`points\` array.`);return{target:n.target,points:n.points}})})}function je(e,t){return t?e**2**(2*t):e}function Me(e,t){let n=e-.5,r=t-.5,i=.999,a=n>0?n/(i-e):n<0?-n/(e-.0010000000000000009):0,o=r>0?r/(i-t):r<0?-r/(t-.0010000000000000009):0,s=Math.min(1e6,Math.max(1,a,o));return{cx:e+n/s,cy:t+r/s,w:s}}function Ne(e,t,n){let{cx:r,cy:i,w:a}=Me(t,n),o=2-2*a,s=Pe(e*o-1+2*a*r,-e*o-2*a*r,e),c=1-s,l=c*c+2*a*s*c+s*s;return l>0?(2*a*i*s*c+s*s)/l:e}function Pe(e,t,n){if(Math.abs(e)<1e-12)return Math.abs(t)<1e-12?n:-n/t;let r=Math.sqrt(Math.max(0,t*t-4*e*n)),i=(-t+r)/(2*e),a=(-t-r)/(2*e),o=e=>e>=-1e-9&&e<=1+1e-9;return o(i)?Math.min(1,Math.max(0,i)):o(a)?Math.min(1,Math.max(0,a)):n}function Fe(e,t){let n=Te(t.viaX,t.viaY);return n?Ne(Math.min(1,Math.max(0,e)),n.x,n.y):je(e,t.curve)}function Ie(e,t,n,r){return r===`log`&&e>0&&t>0?Math.exp(Math.log(e)+(Math.log(t)-Math.log(e))*n):e+(t-e)*n}function Le(e,t,n=`linear`){let r=e.points;if(r.length===0)return 0;let i=r[0];if(t<=i.t)return i.v;let a=r[r.length-1];if(t>=a.t)return a.v;let o=0,s=r.length-1;for(;s-o>1;){let e=o+s>>1;r[e].t<=t?o=e:s=e}let c=r[o],l=r[s],u=l.t-c.t;return u<=0?l.v:Ie(c.v,l.v,Fe((t-c.t)/u,c),n)}var H=new Map,Re=64;function ze(e,t=ve){let n=`${t}\0${e}`,r=H.get(n);if(r!==void 0)return r;let i=null;try{i=Ae(e).lanes.find(e=>e.target===t)??null}catch{i=null}return H.size>Re&&H.clear(),H.set(n,i),i}var Be=48,Ve=new WeakMap;function He(e){let t=e.points,n=t[0].v,r=t[t.length-1].v,i=[0],a=[0],o=t=>{let n=i[i.length-1];if(t<=n)return;let r=Le(e,n,`log`);i.push(t),a.push(a[a.length-1]+(r+Le(e,t,`log`))/2*(t-n))};o(Math.max(0,t[0].t));for(let e=1;e<t.length;e+=1){let n=t[e-1].t,r=t[e].t;if(!(r<=0))for(let e=1;e<=Be;e+=1)o(Math.max(n,0)+(r-n)*e/Be)}return{ts:Float64Array.from(i),ss:Float64Array.from(a),firstRate:n,lastRate:r}}function Ue(e){let t=Ve.get(e);return t||(t=He(e),Ve.set(e,t)),t}function We(e){return typeof e!=`number`&&e.points.length>0}function Ge(e,t,n){let r=0,i=e.length-1;for(;i-r>1;){let t=r+i>>1;e[t]<=n?r=t:i=t}return t[r]+(t[i]-t[r])*(n-e[r])/(e[i]-e[r])}function Ke(e,t){if(typeof e==`number`)return t/e;if(!We(e))return t;let{ts:n,ss:r,firstRate:i,lastRate:a}=Ue(e),o=n.length-1;return t<=0?t/i:t>=r[o]?n[o]+(t-r[o])/a:Ge(r,n,t)}function qe(e){return e?ze(e,ye):null}function Je(e,t){return qe(e)??t}var Ye=`http://www.w3.org/1999/xhtml`;function Xe(e){return e!=null&&e.nodeType===1}function Ze(e){return Xe(e)&&e.namespaceURI===Ye}function Qe(e,t){return Ze(e)&&e.localName===t}function $e(e){return Qe(e,`video`)}function et(e){return Qe(e,`audio`)}function tt(e){return $e(e)||et(e)}function nt(e){return Qe(e,`img`)}var U=Object.freeze({start:`data-start`,duration:`data-duration`,trackIndex:`data-track-index`,derivedEnd:`data-end`,legacyTrack:`data-layer`});Object.freeze([U.start,U.duration,U.trackIndex]),Object.freeze([U.derivedEnd]),Object.freeze([U.derivedEnd,U.legacyTrack]);function W(e){if(e==null||e.trim()===``)return null;let t=Number(e);return Number.isFinite(t)?t:null}var rt=/^[A-Za-z0-9_.:-]+$/;function it(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function at(e,t){let n=t;for(;n>=0&&it(e,n);)n--;return n}function ot(e,t){let n=t;for(;n>=0&&(e[n]??``).trim()===``;)n--;return n}function st(e){let t=e.length-1;if(!it(e,t))return null;let n=at(e,t);return e[n]===`.`&&(n=at(e,n-1)),n+1}function ct(e){let t=st(e);if(t==null)return null;let n=ot(e,t-1),r=e[n];if(r!==`+`&&r!==`-`)return null;let i=e.slice(0,n).trim();if(!rt.test(i))return null;let a=Number(e.slice(t));return Number.isFinite(a)?{refId:i,operator:r,magnitude:a}:null}function lt(e){let t=(e??``).trim();if(!t)return null;let n=W(t);if(n!=null)return{kind:`absolute`,value:n};if(rt.test(t))return{kind:`reference`,refId:t,offset:0};let r=ct(t);return r?{kind:`reference`,refId:r.refId,offset:r.operator===`-`?-r.magnitude:r.magnitude}:null}function G(e,t,n,r){e.push({code:t,attribute:n,value:r})}function ut(e,t,n,r){if(t==null||t.trim()===``)return n.defaultStart===void 0?0:n.defaultStart;if(!e)return G(r,`invalid-start`,U.start,t),null;if(e.kind===`absolute`)return Math.max(0,e.value);let i=n.resolveReferenceEnd?.(e.refId);return i==null||!Number.isFinite(i)?(G(r,`unresolved-start-reference`,U.start,t),null):Math.max(0,i+e.offset)}var dt=1e-9;function ft(e,t){return Math.abs(e-t)<=dt}function pt(e,t,n){let r=W(e);if(r==null){G(n,`deprecated-end`,U.derivedEnd,e),G(n,`invalid-end`,U.derivedEnd,e);return}if(t==null){G(n,`deprecated-end`,U.derivedEnd,e);return}ft(r,t)||(G(n,`deprecated-end`,U.derivedEnd,e),G(n,`conflicting-end`,U.derivedEnd,e))}function mt(e,t,n){let r=W(e);return r==null||r<0?(G(n,`invalid-duration`,U.duration,e),{duration:null,end:null,durationSource:`invalid`}):{duration:r,end:t==null?null:t+r,durationSource:`duration`}}function ht(e,t,n){G(n,`deprecated-end`,U.derivedEnd,e);let r=W(e);return r==null?(G(n,`invalid-end`,U.derivedEnd,e),{duration:null,end:null,durationSource:`invalid`}):t==null?{duration:null,end:r,durationSource:`legacy-end`}:r<t?(G(n,`end-before-start`,U.derivedEnd,e),{duration:null,end:null,durationSource:`invalid`}):{duration:r-t,end:r,durationSource:`legacy-end`}}function gt(e,t,n){let r=e.getAttribute(U.duration),i=e.getAttribute(U.derivedEnd);if(r==null)return i==null?{duration:null,end:null,durationSource:`missing`}:ht(i,t,n);let a=mt(r,t,n);return i!=null&&pt(i,a.end,n),a}function _t(e,t,n,r){let i=W(e);return i==null||!Number.isInteger(i)?(G(r,`invalid-track-index`,t,e),{trackIndex:0,trackSource:`invalid`}):{trackIndex:i,trackSource:n}}function vt(e,t){let n=e.getAttribute(U.trackIndex),r=e.getAttribute(U.legacyTrack);if(n==null&&r==null)return{trackIndex:0,trackSource:`default`};if(n==null&&r!=null)return G(t,`deprecated-layer`,U.legacyTrack,r),_t(r,U.legacyTrack,`legacy-layer`,t);let i=_t(n??``,U.trackIndex,`track-index`,t);if(r==null)return i;G(t,`deprecated-layer`,U.legacyTrack,r);let a=W(r);return a!=null&&a!==i.trackIndex&&G(t,`conflicting-layer`,U.legacyTrack,r),i}function yt(e,t={}){let n=[],r=e.getAttribute(U.start),i=lt(r),a=ut(i,r,t,n),o=gt(e,a,n),s=vt(e,n);return{startExpression:i,start:a,...o,...s,diagnostics:n}}function bt(e){return W(e)}function xt(e){return ae(t=>e.getAttribute(t),tt(e)?e.defaultPlaybackRate:1)}function St(e){return Je(e.getAttribute(`data-automation`),xt(e))}function Ct(e){return re(t=>e.getAttribute(t))}function wt(e,t){return Et(t,Ct(e),St(e))}function Tt(e,t=0){return!nt(e)||!e.hasAttribute(`data-start`)&&!e.hasAttribute(`data-track-index`)?null:le({tag:`img`,authoredDurationSeconds:se(t=>e.getAttribute(t),t),sourceDurationSeconds:null,mediaStartSeconds:0,playbackRate:1}).seconds}function Et(e,t,n){return typeof n==`number`?R(e,t,n):Number.isFinite(e)?Ke(n,Math.max(0,e-t)):null}var Dt=`data-hf-media-start-basis`;function Ot(e){return e?.trim().toLowerCase()===`global`?`global`:`local`}function kt(e){return Ot(e.basis)===`global`?e.authoredStart:e.hostStart+e.authoredStart}function At(e){return Mt(e)?kt({authoredStart:e.authoredStart,hostStart:e.hostStart,basis:e.basis}):e.ordinaryStart()}function jt(e){return Mt(e)&&Ot(e.basis)===`global`}function Mt(e){return!e.hasAutoStart&&e.authoredStart!=null&&e.hostStart>0}function Nt(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,a=new WeakMap,o=new Set,s=e=>r.getElementById(e)||(r.querySelector(`[data-composition-id="${CSS.escape(e)}"]`)??null),c=e=>{let r=a.get(e);if(r!==void 0)return r;let i=null,o=ne({start:0,duration:e.getAttribute(`data-duration`),authoredDuration:n?e.getAttribute(`data-hf-authored-duration`):null});if(o?.duration!=null&&o.duration>0&&(i=o.duration),i==null||i<=0){let t=ne({start:u(e,0),end:e.getAttribute(`data-end`),authoredEnd:n?e.getAttribute(`data-hf-authored-end`):null});t?.duration!=null&&t.duration>0&&(i=t.duration)}if((i==null||i<=0)&&tt(e)&&(i=wt(e,e.duration)),(i==null||i<=0)&&(i=Tt(e)),i==null||i<=0){let n=e.getAttribute(`data-composition-id`);if(n){let e=t[n]??null;if(e&&typeof e.duration==`function`)try{let t=Number(e.duration());Number.isFinite(t)&&t>0&&(i=t)}catch(e){A(`runtime.startResolver.site1`,e)}}}return i!=null&&Number.isFinite(i)&&i>0?(a.set(e,i),i):(a.set(e,null),null)},l=(e,t)=>{if(e.hasAttribute(`data-composition-id`)){let n=e.parentElement?.closest(`[data-composition-id]`);return n?u(n,t):0}let n=e.closest(`[data-composition-id]`);return n?u(n,t):0},u=(e,t)=>{let n=i.get(e);if(n!==void 0)return n??t;if(o.has(e))return t;o.add(e);try{let n=lt(e.getAttribute(`data-start`));if(!n){if(e.hasAttribute(`data-composition-id`)){let n=e.parentElement;if(n&&(n.hasAttribute(`data-composition-src`)||n.hasAttribute(`data-composition-id`)||n.hasAttribute(`data-composition-file`))){let r=u(n,t);return i.set(e,r),r}}return i.set(e,t),t}if(n.kind===`absolute`){let r=Math.max(0,n.value),a=Math.max(0,l(e,t)+r);return i.set(e,a),a}let r=s(n.refId);if(!r)return i.set(e,t),t;let a=u(r,0),o=c(r);if(o==null||o<=0){let t=Math.max(0,a+n.offset);return i.set(e,t),t}let d=Math.max(0,a+o+n.offset);return i.set(e,d),d}finally{o.delete(e)}},d=e=>{let t=e.closest(`[data-composition-id]`);return{authoredStart:bt(e.getAttribute(`data-start`)),hostStart:t?u(t,0):0,hasAutoStart:e.hasAttribute(`data-hf-auto-start`),basis:e.getAttribute(Dt)}};return{resolveStartForElement:(e,t=0)=>u(e,Math.max(0,t)),resolveDurationForElement:e=>c(e),resolveMediaStartForElement:e=>{let t=d(e);return At({...t,ordinaryStart:()=>u(e,t.hostStart)})},resolveHostStartForElement:e=>l(e,0),isRootGlobalMediaStartForElement:e=>tt(e)&&jt(d(e))}}var Pt=e=>4*2**-52*Math.max(1,Math.abs(e));function Ft(e,t){return!Number.isFinite(e)||!Number.isFinite(t)?e===t:Math.abs(e-t)<=Pt(Math.max(Math.abs(e),Math.abs(t)))}var It=(e,t)=>e>=t||Ft(e,t),Lt=(e,t,n)=>It(e,t)&&e<n&&!Ft(e,n),Rt=1e-6,zt=(e,t,n,r)=>Lt(e,t,n)||It(e,t)&&r>0&&n>=r-Rt;Object.freeze({fadeIn:0,fadeOut:0});function Bt(e){return Number.isFinite(e)&&e>0?e:30}function Vt(e){return Number.isFinite(e)&&e>0?e:0}function Ht(e,t){let n=Bt(t),r=Vt(e),i=r*n,a=Math.round(i);return Math.abs(i-a)<=.001?a/n:r}function Ut(e,t,n){return{start:Ht(e,n),end:Number.isFinite(t)?Ht(t,n):t}}var Wt=[`seconds-time`,`rational-fps`,`seek-keep-playing`,`composition-manifest-v1`,`runtime-data`,`play-range`];function Gt(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let e=n%r;n=r,r=e}return n||1}function Kt(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,r=Math.round(t*n),i=Gt(r,n);return{numerator:r/i,denominator:n/i}}function qt(e,t,n){return Math.max(e,(Math.ceil(t*n-1e-6)-1)/n)}function Jt(e){if(typeof e!=`object`||!e)return null;let t=e;return!Number.isFinite(t.numerator)||!Number.isFinite(t.denominator)||(t.numerator??0)<=0||(t.denominator??0)<=0?null:Number(t.numerator)/Number(t.denominator)}function Yt(e){return{protocolVersion:1,capabilities:Wt,fps:Kt(e)}}function Xt(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Zt(e,t=30){if(typeof e!=`object`||!e)return{status:`legacy`,fps:t};let n=e;if(n.protocolVersion===void 0)return{status:`legacy`,fps:t};if(n.protocolVersion!==1)return{status:`unsupported`,code:`unsupported_protocol_version`,receivedVersion:n.protocolVersion};let r=Jt(n.fps);return r===null||!Xt(n.capabilities)?{status:`unsupported`,code:`invalid_protocol_metadata`,receivedVersion:n.protocolVersion}:{status:`supported`,fps:r,metadata:n}}function Qt(e,t){let n=e.tagName.toLowerCase();if(n===`script`||n===`style`||n===`link`||n===`meta`)return!1;let r=n===`video`||n===`audio`?t.resolver.resolveMediaStartForElement(e):t.resolver.resolveStartForElement(e,0),i=t.resolver.resolveDurationForElement(e),a=e.getAttribute(`data-composition-id`);if(a){let n=t.timelineRegistry[a],r=n&&typeof n.duration==`function`?Number(n.duration()):null;!(e.hasAttribute(`data-duration`)||e.hasAttribute(`data-end`)||e.hasAttribute(j)||e.hasAttribute(te))&&(i==null||i<=0)&&r!=null&&Number.isFinite(r)&&r>0&&(i=r)}let o=i!=null&&i>0?r+i:1/0,s=t.exportRenderSeek?Ut(r,o,t.canonicalFps):{start:r,end:o};return zt(t.currentTime,s.start,s.end,t.compositionDuration)}var $t=`hyperframes-studio-preview`,K=`first-frame`,en=3;function tn(e){let t=e.ownerDocument?.defaultView;return t&&e instanceof t.Element?!0:e instanceof Element}function q(e){if(!tn(e)||e.tagName!==`AUDIO`&&e.tagName!==`VIDEO`)return!1;let t=e.ownerDocument?.defaultView;return t&&e instanceof t.HTMLMediaElement?!0:e instanceof HTMLMediaElement}function nn(e){return e.hasAttribute(`data-start`)||e.hasAttribute(`data-track-index`)}function rn(e,t,n){let r=e;for(;r;){if(nn(r)&&!Qt(r,{currentTime:0,compositionDuration:1/0,canonicalFps:30,exportRenderSeek:!1,timelineRegistry:n,resolver:t}))return!1;r=r.parentElement}return!0}function an(e,t,n,r){return t===`all`||rn(e,n,r)}function on(e,{scope:t=`all`}={}){let n=e.defaultView,r=Nt({documentRef:e,timelineRegistry:n?.__timelines,includeAuthoredTimingAttrs:!0}),i=e.querySelector(`meta[name="${$t}"]`)!==null;return{pendingMedia:Array.from(e.querySelectorAll(`video, audio`)).filter(q).filter(e=>an(e,i&&e.preload!==`auto`?K:t,r,n?.__timelines??{})).filter(e=>e.readyState<en),pendingImages:Array.from(e.querySelectorAll(`img`)).filter(e=>an(e,e.getAttribute(`loading`)?.toLowerCase()===`lazy`?K:t,r,n?.__timelines??{})).filter(e=>!e.complete),fontsLoading:e.fonts?.status===`loading`}}function sn(e,{pendingMedia:t,pendingImages:n,fontsLoading:r},i){let a=t.map(e=>new Promise(t=>{if(e.error){t();return}let n=()=>{e.removeEventListener(`canplay`,n),e.removeEventListener(`error`,n),i.removeEventListener(`abort`,n),t()};e.addEventListener(`canplay`,n),e.addEventListener(`error`,n),i.addEventListener(`abort`,n,{once:!0})})),o=n.map(e=>e.decode?e.decode().catch(()=>{}):Promise.resolve()),s=r&&e.fonts?e.fonts.ready.then(()=>{}):Promise.resolve();return Promise.all([...a,...o,s]).then(()=>{})}function cn(e,t,{scope:n=`all`}={}){let r=on(e,{scope:n});return r.pendingMedia.length===0&&r.pendingImages.length===0&&!r.fontsLoading?null:sn(e,r,t)}var ln=50;function un(e,t){let n=e.defaultView;return!n||n.__renderReady||!n.__hf?null:new Promise(e=>{let r,i=()=>{r!==void 0&&clearTimeout(r),t.removeEventListener(`abort`,i),e()};if(t.aborted){i();return}t.addEventListener(`abort`,i,{once:!0});let a=()=>{if(n.__renderReady){i();return}r=setTimeout(a,ln)};a()})}var dn=50,fn=1.5,pn=2,mn=1500;function hn(e,t){return new Promise(n=>{if(t.aborted){n(-1);return}let r=0,i=()=>{e.cancelAnimationFrame?.(r),n(-1)};t.addEventListener(`abort`,i,{once:!0}),r=e.requestAnimationFrame(e=>{t.removeEventListener(`abort`,i),n(e)})})}function gn(e,t){let n=e.defaultView;return n?(async()=>{let e=await hn(n,t);if(t.aborted)return;let r=await hn(n,t),i=r-e,a=0;for(;!t.aborted&&a<pn;){if(r-e>=mn)return;let o=await hn(n,t);if(t.aborted)return;let s=o-r;i=Math.min(i,s),a=s<dn||s<=i*fn?a+1:0,r=o}})():null}var _n=8e3;function vn(e,t,n={}){let r=n.inputs??[(e,t)=>cn(e,t,{scope:n.scope}),un,gn],i=new AbortController,a=r.map(t=>t(e,i.signal)).filter(e=>e!==null);if(a.length===0){t({timedOut:!1});return}let o=n.timeoutMs??_n,s,c=new Promise(e=>{s=setTimeout(()=>e(`timed-out`),o)});Promise.race([Promise.all(a).then(()=>`done`),c]).then(e=>{clearTimeout(s),i.abort(),t({timedOut:e===`timed-out`})})}function yn(e,t,n={}){vn(e,t,{...n,scope:K})}var bn=.05,xn=2,Sn=class{_entries=[];_mediaObserver;_playbackErrorPosted=!1;_audioOwner=`runtime`;_urlAudioEntry=null;_urlAudioSrc=null;_dispatchEvent;_getMuted;_getVolume;_getPlaybackRate;_getCurrentTime;_isPaused;constructor(e){this._dispatchEvent=e.dispatchEvent,this._getMuted=e.getMuted,this._getVolume=e.getVolume,this._getPlaybackRate=e.getPlaybackRate,this._getCurrentTime=e.getCurrentTime,this._isPaused=e.isPaused}get audioOwner(){return this._audioOwner}get entries(){return this._entries}resetForIframeLoad(){this._playbackErrorPosted=!1;let e=this._audioOwner===`parent`;this._audioOwner=`runtime`,this.pauseAll();for(let 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(),e&&this._dispatchEvent(new CustomEvent(`audioownershipchange`,{detail:{owner:`runtime`,reason:`iframe-reload`}}))}destroy(){this.teardownObserver();for(let e of this._entries)e.el.pause(),e.el.src=``;this._entries=[],this._urlAudioEntry=null,this._urlAudioSrc=null,this._audioOwner=`runtime`,this._playbackErrorPosted=!1}updateMuted(e){for(let t of this._entries)t.el.muted=e}updateVolume(e){for(let t of this._entries)t.el.volume=e}updatePlaybackRate(e){for(let t of this._entries)t.el.playbackRate=e}_playEntry(e){e.el.src&&e.el.play().catch(e=>this._reportPlaybackError(e))}_playEntryIfActive(e){this._refreshEntryBounds(e),this._inWindow(e,this._getCurrentTime())&&this._playEntry(e)}_refreshEntryBounds(e){if(!e.source?.isConnected)return;let t=yt(e.source);e.start=t.start??0,e.duration=t.duration!=null&&t.duration>0?t.duration:1/0}_inWindow(e,t){return Lt(t,e.start,e.start+e.duration)}_gateEntryPlayback(e,t){return this._inWindow(e,t)?(this._audioOwner===`parent`&&!this._isPaused()&&e.el.paused&&this._playEntry(e),!0):(e.el.paused||e.el.pause(),e.driftSamples=0,!1)}playAll(){for(let e of this._entries)this._playEntryIfActive(e)}pauseAll(){for(let e of this._entries)e.el.pause()}stopAdoptedMedia(){for(let e of this._entries)e.source&&e.el.pause()}seekAll(e){for(let t of this._entries)this._refreshEntryBounds(t),this._inWindow(t,e)&&(t.el.currentTime=e-t.start)}scrubAll(e){for(let t of this._entries)this._refreshEntryBounds(t),this._inWindow(t,e)?(t.el.currentTime=e-t.start,this._playEntry(t)):t.el.paused||t.el.pause()}mirrorTime(e,t){let n=t?.force===!0;for(let t of this._entries){if(this._refreshEntryBounds(t),!this._gateEntryPlayback(t,e))continue;let r=e-t.start;Math.abs(t.el.currentTime-r)>bn?(t.driftSamples+=1,(n||t.driftSamples>=xn)&&(t.el.currentTime=r,t.driftSamples=0)):t.driftSamples=0}}promoteToParentProxy(e,t){if(this._audioOwner===`parent`)return;if(this._audioOwner=`parent`,e)for(let t of e.querySelectorAll(`video, audio`))q(t)&&(t.muted=!0);for(let e of[...this._entries])this._repointToSource(e);let n=this._getCurrentTime();t?t(n,{force:!0}):this.mirrorTime(n,{force:!0}),this._isPaused()||this.playAll(),this._dispatchEvent(new CustomEvent(`audioownershipchange`,{detail:{owner:`parent`,reason:`autoplay-blocked`}}))}setupFromIframe(e){let t=e.querySelectorAll(`audio[data-start], video[data-start]`);for(let e of t)q(e)&&this._adoptIframeMedia(e);this._observeDynamicMedia(e)}setupFromUrl(e){if(this._urlAudioSrc===e&&this._urlAudioEntry)return;this.teardownUrlAudio();let t=this._createEntry(e,`audio`,0,1/0);this._urlAudioEntry=t,this._urlAudioSrc=e,t&&this._audioOwner===`parent`&&!this._isPaused()&&(this.mirrorTime(this._getCurrentTime(),{force:!0}),this.playAll())}teardownUrlAudio(){let e=this._urlAudioEntry;if(this._urlAudioEntry=null,this._urlAudioSrc=null,!e)return;e.el.pause(),e.el.src=``;let t=this._entries.indexOf(e);t!==-1&&this._entries.splice(t,1)}teardownObserver(){this._mediaObserver?.disconnect(),this._mediaObserver=void 0}_reportPlaybackError(e){this._playbackErrorPosted||(this._playbackErrorPosted=!0,this._dispatchEvent(new CustomEvent(`playbackerror`,{detail:{source:`parent-proxy`,error:e}})))}_createEntry(e,t,n,r,i){if(this._urlTaken(e))return null;let a=t===`video`?document.createElement(`video`):new Audio;a.preload=`auto`,a.src=e,a.load(),a.muted=this._getMuted(),a.volume=this._getVolume();let o=this._getPlaybackRate();o!==1&&(a.playbackRate=o);let s={el:a,start:n,duration:r,driftSamples:0,source:i};return this._entries.push(s),s}_resolveIframeMediaSrc(e){let t=e.getAttribute(`src`)||e.querySelector(`source`)?.getAttribute(`src`);return t?new URL(t,e.ownerDocument.baseURI).href:null}_adoptIframeMedia(e){if(e.preload===`metadata`||e.preload===`none`)return;let t=this._resolveIframeMediaSrc(e);if(!t)return;let n=yt(e),r=n.start??0,i=n.duration??1/0,a=e.tagName===`VIDEO`?`video`:`audio`,o=this._createEntry(t,a,r,i,e);o&&this._audioOwner===`parent`&&(this.mirrorTime(this._getCurrentTime(),{force:!0}),this._isPaused()||this._playEntryIfActive(o))}_followIframeMediaSrc(e){let t=this._entries.find(t=>t.source===e);if(!t)return this._adoptIframeMedia(e);this._audioOwner!==`parent`||!this._repointToSource(t)||(this.mirrorTime(this._getCurrentTime(),{force:!0}),this._isPaused()||this._playEntryIfActive(t))}_urlTaken(e,t){return this._entries.some(n=>n===t||n.source&&!n.source.isConnected?!1:(n.source&&this._resolveIframeMediaSrc(n.source)||n.el.src)===e)}_repointToSource(e){let t=e.source?this._resolveIframeMediaSrc(e.source):null;return!t||e.el.src===t?!1:this._urlTaken(t,e)?(this._removeEntry(e),!1):(e.el.src=t,e.el.load(),!0)}_detachIframeMedia(e){let t=this._entries.find(t=>t.source===e);t&&this._removeEntry(t)}_removeEntry(e){e.el.pause(),e.el.src=``,this._entries.splice(this._entries.indexOf(e),1)}_observeDynamicMedia(e){if(this.teardownObserver(),typeof MutationObserver>`u`||!e.body)return;let t=new MutationObserver(e=>{for(let t of e){if(t.type===`attributes`&&t.attributeName===`src`){let e=t.target;q(e)&&e.matches(`audio[data-start], video[data-start]`)&&this._followIframeMediaSrc(e);continue}if(t.type===`attributes`&&t.attributeName===`preload`){let e=t.target;q(e)&&e.matches(`audio[data-start], video[data-start]`)&&(e.preload===`auto`?this._adoptIframeMedia(e):this._detachIframeMedia(e));continue}for(let e of t.addedNodes){if(!tn(e))continue;let t=[];q(e)&&e.matches(`audio[data-start], video[data-start]`)&&t.push(e);let n=e.querySelectorAll(`audio[data-start], video[data-start]`);for(let e of n)q(e)&&t.push(e);for(let e of t)this._adoptIframeMedia(e)}for(let e of t.removedNodes){if(!tn(e))continue;let t=[];q(e)&&e.matches(`audio[data-start], video[data-start]`)&&t.push(e);let n=e.querySelectorAll(`audio[data-start], video[data-start]`);for(let e of n)q(e)&&t.push(e);for(let e of t)this._detachIframeMedia(e)}}}),n={childList:!0,subtree:!0,attributes:!0,attributeFilter:[`preload`,`src`]},r=E(e);for(let e of r)t.observe(e,n);this._mediaObserver=t}};function Cn(e,t,n){if(e===null&&t===null)return{range:null,clamped:!1};let r=e??0,i=t!==null&&n>0&&t>n,a=i?n:t;return!(r>=0)||!((a??(n>0?n:1/0))>r)?{range:null,clamped:!0}:{range:{start:r,end:a},clamped:i}}function wn(e,t,n){let r=e.end??t;return r<t?qt(e.start,r,n):r}function Tn(e,t,n,r){return e<t.start||e>=wn(t,n,r)}var En=100;function Dn(e,t){return typeof e.currentTime==`number`&&Number.isFinite(e.currentTime)?e.currentTime:(e.frame??0)/t}function On(e,t,n){return n<=0?!1:e.ended===!0?!0:e.ended===!1&&!e.isPlaying?!1:t>=n}function kn(e,t,n,r,i,a){let{duration:o}=n;if(!i)return{start:0,shownAtEnd:o,atEnd:On(e,t,o),stopRuntime:!1,entering:!1};if(e.ownsRange){let n=r&&e.ended===!0&&!e.isPlaying;return{start:i.start,shownAtEnd:t,atEnd:n,stopRuntime:!1,entering:!1}}return An(e,t,n,r,i,a)}function An(e,t,n,r,i,a){let o=i.end??n.duration,s=n.enteringRange===!0&&(t<i.start||t>=o);return{start:i.start,shownAtEnd:wn(i,n.duration,a),atEnd:r&&!s&&On(e,t,o),stopRuntime:e.isPlaying,entering:s}}function jn(e,t,n,r){let i=Dn(e,t),a=!n.paused,o=a||e.isPlaying,s=r.getPlayRange?.(),c=kn(e,i,n,o,s,t),{atEnd:l,start:u}=c,d=n.duration>0?Math.min(i,n.duration):i,f=l?c.shownAtEnd:d,p=!e.isPlaying,m=l&&o;if(m&&r.getLoop())return r.media.audioOwner===`parent`&&r.media.pauseAll(),r.seek(u),r.play(),{...n,currentTime:u,paused:!1,enteringRange:!0};let h={...n,currentTime:f,paused:p,enteringRange:c.entering};r.media.audioOwner===`parent`&&(a&&p?r.media.pauseAll():!a&&!p&&r.media.playAll(),r.media.mirrorTime(f));let g=performance.now(),_=p!==n.paused;return(g-n.lastUpdateMs>En||_)&&(h.lastUpdateMs=g,r.updateControlsTime(f,n.duration),r.updateControlsPlaying(!p),r.dispatchEvent(new CustomEvent(`timeupdate`,{detail:{currentTime:f}}))),m&&(c.stopRuntime&&r.seek(f),r.media.audioOwner===`parent`&&r.media.pauseAll(),h.paused=!0,r.updateControlsPlaying(!1),r.dispatchEvent(new Event(`ended`))),h}function Mn(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.id==`string`&&typeof e.start==`number`&&typeof e.duration==`number`):[]}function Nn(e,t,n){if(e.source!==t)return;let r=e.data;if(!r||r.source!==`hf-preview`)return;let i=Zt(r);if(i.status===`unsupported`){n.dispatchEvent(new CustomEvent(`runtimeprotocolerror`,{detail:{code:i.code,receivedVersion:i.receivedVersion}}));return}n.setRuntimeFps?.(i.fps);let a=i.status===`supported`&&i.metadata.capabilities.includes(`play-range`);if(n.setRuntimeOwnsPlayRange?.(a),r.type===`shader-transition-state`){let e=r.state&&typeof r.state==`object`?r.state:{};n.shaderLoader.update(e,n.getShaderLoadingMode()),n.dispatchEvent(new CustomEvent(`shadertransitionstate`,{detail:{compositionId:r.compositionId,state:e}}));return}if(r.type===`ready`){n.onRuntimeReady();return}if(r.type===`assets-ready`){n.onRuntimeAssetsReady?.(r.timedOut===!0);return}if(r.type===`runtime-data-error`){n.onRuntimeDataError?.(r.channel,r.requestId,r.message);return}if(r.type===`runtime-data-applied`){n.onRuntimeDataApplied?.(r.channel,r.requestId);return}if(r.type===`state`){n.setPlaybackState(jn({frame:r.frame??0,currentTime:r.currentTime,ended:typeof r.ended==`boolean`?r.ended:void 0,isPlaying:!!r.isPlaying,ownsRange:a},i.fps,n.getPlaybackState(),n));return}if(r.type===`media-autoplay-blocked`){if(n.shouldPromoteMediaAutoplayFallback?.()===!1)return;let e=null;try{e=n.getIframeDoc()}catch{}n.media.promoteToParentProxy(e,(e,t)=>n.media.mirrorTime(e,t)),n.sendControl(`set-media-output-muted`,{muted:!0});return}if(r.type===`timeline`&&r.durationInFrames>0){let e=Number(r.durationSeconds),t=Number(r.durationInFrames),a=Number.isFinite(e)&&e>0?e:t/i.fps;if(Number.isFinite(r.compositionWidth)&&r.compositionWidth>0&&Number.isFinite(r.compositionHeight)&&r.compositionHeight>0&&n.setCompositionSize(r.compositionWidth,r.compositionHeight),Number.isFinite(a)&&a>0){let e=n.getPlaybackState();n.setPlaybackState({...e,duration:a}),n.updateControlsTime(e.currentTime,a),n.onRuntimeTimelineReady(a,typeof r.assetsReady==`boolean`?r.assetsReady:void 0)}n.setScenes(Mn(r.scenes));return}r.type===`stage-size`&&Number.isFinite(r.width)&&r.width>0&&Number.isFinite(r.height)&&r.height>0&&n.setCompositionSize(r.width,r.height)}function Pn(e,t){return e.includes(t)?!0:/hyperframe\.runtime\.iife\.js|__hyperframes\s*=/.test(e)}var Fn=new Set([`>`,` `,` `,`
473
+ `,`\r`,`\f`]);function In(e,t){let n=e.toLowerCase(),r=`<${t}`,i=0;for(;i<n.length;){let e=n.indexOf(r,i);if(e<0)return null;let t=n[e+r.length];if(Fn.has(t)){let t=n.indexOf(`>`,e+r.length);return t<0?null:{index:e,end:t+1}}i=e+r.length}return null}function Ln(e,t){if(!e||Pn(e,t))return e;let n=`<script src="${t}"><\/script>`,r=In(e,`head`);if(r)return e.slice(0,r.end)+n+e.slice(r.end);let i=In(e,`body`);if(i)return e.slice(0,i.index)+n+e.slice(i.index);let a=In(e,`html`);return a?e.slice(0,a.end)+n+e.slice(a.end):n+e}var J=`shader-capture-scale`,Y=`shader-loading`,Rn=`runtime-src`,zn=`__hf_shader_capture_scale`,Bn=`__hf_shader_loading`,Vn=[`Preparing scene transitions`,`Sampling outgoing scene motion`,`Sampling incoming scene motion`,`Caching transition frames`,`Finalizing transition preview`];function Hn(e){if(e===null)return null;let t=Number(e);return!Number.isFinite(t)||t<=0?null:String(Math.min(1,Math.max(.25,t)))}function Un(e){if(e===null||e.trim()===``)return`composition`;let t=e.trim().toLowerCase();return t===`none`||t===`false`||t===`0`||t===`off`?`none`:t===`player`||t===`true`||t===`1`||t===`on`?`player`:`composition`}function Wn(e,t){return e.filter(e=>e!==``&&e.split(`=`)[0]!==t)}function Gn(e,t,n){let r=e.indexOf(`#`),i=r>=0?e.slice(0,r):e,a=r>=0?e.slice(r):``,o=i.indexOf(`?`),s=o>=0?i.slice(0,o):i,c=Wn((o>=0?i.slice(o+1):``).split(`&`),zn);c=Wn(c,Bn),t!==null&&c.push(`${zn}=${encodeURIComponent(t)}`),n!==`composition`&&c.push(`${Bn}=${encodeURIComponent(n)}`);let l=c.join(`&`);return`${s}${l?`?${l}`:``}${a}`}function Kn(e,t,n){if(t===null&&n===`composition`)return e;let r=[];t!==null&&r.push(`window.__HF_SHADER_CAPTURE_SCALE=${JSON.stringify(t)};`),n!==`composition`&&r.push(`window.__HF_SHADER_LOADING=${JSON.stringify(n)};`);let i=`<script data-hyperframes-player-shader-options>${r.join(``)}<\/script>`;return/<head\b[^>]*>/i.test(e)?e.replace(/<head\b[^>]*>/i,e=>`${e}${i}`):/<html\b[^>]*>/i.test(e)?e.replace(/<html\b[^>]*>/i,e=>`${e}${i}`):`${i}${e}`}function qn(e){return Un(e.getAttribute(Y))}function Jn(e){return Number(Hn(e.getAttribute(J))??`1`)}function Yn(e,t){return Gn(t,Hn(e.getAttribute(J)),qn(e))}function Xn(e,t){return Ln(Kn(t,Hn(e.getAttribute(J)),qn(e)),Zn(e))}function Zn(e){let t=e.getAttribute(Rn)?.trim();if(!t)return i;try{let e=new URL(t,document.baseURI),n=e.protocol===`http:`||e.protocol===`https:`,r=e.hostname===`127.0.0.1`||e.hostname===`localhost`||e.hostname===`[::1]`;return n&&(r||e.origin===location.origin)?e.href:i}catch{return i}}function Qn(){let e=document.createElement(`div`);e.className=`hfp-shader-loader`,e.setAttribute(`role`,`status`),e.setAttribute(`aria-live`,`polite`),e.setAttribute(`aria-label`,`Preparing scene transitions`),e.setAttribute(`data-hyperframes-ignore`,``),e.draggable=!1;let t=e=>{e.preventDefault(),e.stopPropagation()};for(let n of[`selectstart`,`dragstart`,`pointerdown`,`mousedown`,`click`,`dblclick`,`contextmenu`,`touchstart`])e.addEventListener(n,t,{capture:!0});let n=document.createElement(`div`);n.className=`hfp-shader-loader-panel`,n.draggable=!1;let r=document.createElement(`div`);r.className=`hfp-shader-loader-mark`,r.draggable=!1,r.innerHTML=[`<svg width="78" height="78" viewBox="0 0 100 100" fill="none" aria-hidden="true" draggable="false">`,`<path d="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" fill="url(#hfp-shader-loader-grad-left)"/>`,`<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" 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(``);let i=document.createElement(`div`);i.className=`hfp-shader-loader-title`;let a=document.createElement(`span`);a.className=`hfp-shader-loader-title-text`,a.textContent=Vn[0]||`Preparing scene transitions`,i.appendChild(a);let o=document.createElement(`div`);o.className=`hfp-shader-loader-detail`,o.textContent=`Rendering animated scene samples for shader transitions.`;let s=document.createElement(`div`);s.className=`hfp-shader-loader-track`,s.setAttribute(`aria-hidden`,`true`);let c=document.createElement(`div`);c.className=`hfp-shader-loader-fill`,s.appendChild(c);let l=document.createElement(`div`);l.className=`hfp-shader-loader-progress`;let u=e=>{let t=document.createElement(`div`);t.className=`hfp-shader-loader-row`;let n=document.createElement(`span`);n.className=`hfp-shader-loader-label`,n.textContent=e;let r=document.createElement(`span`);return r.className=`hfp-shader-loader-value`,t.appendChild(n),t.appendChild(r),l.appendChild(t),{row:t,label:n,value:r}},d=u(`transition`),f=u(`transition frame`);return n.appendChild(r),n.appendChild(i),n.appendChild(o),n.appendChild(s),n.appendChild(l),e.appendChild(n),{root:e,fill:c,title:a,detail:o,transitionValue:d.value,transitionRow:d.row,frameLabel:f.label,frameValue:f.value,frameRow:f.row}}var $n=420;function X(e,t,n){t.textContent=n,e.style.visibility=n?`visible`:`hidden`}var er=class{_el;_hideTimeout=null;_hiddenCallbacks=[];_drawingAssets=!1;constructor(e){this._el=e}show(){this._hideTimeout&&=(clearTimeout(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(e){let t=this._el.root.classList;t.contains(`hfp-visible`)||t.contains(`hfp-hiding`)?this._hiddenCallbacks.push(e):e()}_flushHidden(){let e=this._hiddenCallbacks;this._hiddenCallbacks=[];for(let t of e)t()}reset(){this._hideTimeout&&=(clearTimeout(this._hideTimeout),null),this._el.root.classList.remove(`hfp-visible`,`hfp-hiding`),this._drawingAssets=!1,this._flushHidden(),this._el.fill.style.transform=`scaleX(0)`,X(this._el.transitionRow,this._el.transitionValue,``),X(this._el.frameRow,this._el.frameValue,``)}update(e,t){let n=t===`player`&&e.loading&&!e.ready;if(this._drawingAssets&&!n)return;if(t!==`player`){this.reset();return}if(e.ready||!e.loading){this.hide();return}this._el.root.setAttribute(`aria-label`,`Preparing scene transitions`),this._drawingAssets=!1;let r=typeof e.progress==`number`&&Number.isFinite(e.progress)?e.progress:0,i=typeof e.total==`number`&&Number.isFinite(e.total)?e.total:0,a=i>0?Math.min(1,Math.max(0,r/i)):0,o=Math.min(Vn.length-1,Math.floor(a*Vn.length));this._el.title.textContent=Vn[o]||`Preparing scene transitions`,this._el.detail.textContent=e.phase===`cached`?`Loading cached transition frames before playback.`:e.phase===`finalizing`?`Uploading transition textures for smooth playback.`:`Rendering animated scene samples for shader transitions.`,this._el.fill.style.transform=`scaleX(${a})`;let s=e.currentTransition!==void 0&&e.transitionTotal!==void 0?`${e.currentTransition}/${e.transitionTotal}`:i>0?`${r}/${i}`:``,c=e.transitionFrame!==void 0&&e.transitionFrames!==void 0?`${e.transitionFrame}/${e.transitionFrames}`:``;this._el.frameLabel.textContent=e.phase===`cached`?`cached transition frames`:e.phase===`finalizing`?`finalizing transition frames`:`rendering transition frames`,X(this._el.transitionRow,this._el.transitionValue,s),X(this._el.frameRow,this._el.frameValue,c),this._el.root.setAttribute(`aria-valuenow`,String(Math.round(a*100))),this.show()}showAssetsLoading(){this.reset(),this._el.title.textContent=`Loading assets`,this._el.detail.textContent=`Waiting for images, video and fonts to finish loading.`,this._el.root.setAttribute(`aria-label`,`Loading assets`),this._drawingAssets=!0,this.show()}hideAssetsLoading(){this._drawingAssets&&this.hide()}get hideTimeout(){return this._hideTimeout}destroy(){this._hideTimeout&&=(clearTimeout(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()},$n)}};function tr(e){return e?.trim().toLowerCase().startsWith(`video/`)??!1}function nr(e){let t=document.createElement(`video`);t.className=`hfp-video`,t.playsInline=!0,t.preload=`metadata`;let n=new AbortController,{signal:r}=n;return t.addEventListener(`loadedmetadata`,()=>e.onMetadata(t),{signal:r}),t.addEventListener(`durationchange`,()=>e.onDurationChange(t),{signal:r}),t.addEventListener(`resize`,()=>e.onResize(t),{signal:r}),t.addEventListener(`play`,()=>e.onPlay(t),{signal:r}),t.addEventListener(`pause`,()=>e.onPause(t),{signal:r}),t.addEventListener(`timeupdate`,()=>e.onTimeUpdate(),{signal:r}),t.addEventListener(`error`,()=>e.onError(t.error?.message||`Video failed to load`,t.error?.code??null),{signal:r}),{video:t,adapter:{duration:()=>t.duration,time:()=>t.currentTime,seek:e=>{t.currentTime=e},play:()=>t.play().catch(t=>{r.aborted||e.onPlayRejected(t)}),pause:()=>t.pause(),timeScale:e=>{t.defaultPlaybackRate=e,t.playbackRate=e}},destroy:()=>{n.abort(),t.pause(),t.removeAttribute(`src`),t.load(),t.remove()}}}var rr=.1,ir=5,ar=`sandbox-origin`,or=1e4,sr=8e3,cr=`assets-loading`,Z=`assets-loading-ui`,lr=`low-power-idle`,ur=`disable-click-to-play`,Q=`range-start`,$=`range-end`,dr=150;function fr(e){return!Number.isFinite(e)||e<=0?1:Math.max(rr,Math.min(ir,e))}var pr=class extends HTMLElement{static get observedAttributes(){return[`src`,`srcdoc`,`width`,`height`,`controls`,`muted`,`audio-locked`,`volume`,`poster`,`playback-rate`,`audio-src`,`type`,ar,Rn,J,Y,Z,lr,Q,$]}shadow;container;iframe;posterEl=null;controlsApi=null;resizeObserver;shaderLoader;probe;_ready=!1;_readyDocument=null;_connected=!1;_assetsReady=!1;_painted=!1;_pendingPlay=!1;_assetsGeneration=0;_assetsLoadingShowTimer=null;_currentTime=0;_duration=0;_paused=!0;_scrubbing=!1;_lastUpdateMs=0;_volume=1;_compositionWidth=1920;_compositionHeight=1080;_rescaleWarned=!1;_directTimelineAdapter=null;_directTimelineClock;_parentTickRaf=null;_media;_scenes=[];_runtimeFps=30;_runtimeBridgeReady=!1;_runtimeAssetsReadyGeneration=-1;_runtimeData=new Map;_runtimeDataRequestId=0;_pendingRuntimeData=new Map;_afterUpdate=null;_videoSource=null;_runtimeOwnsPlayRange=!1;_enteringRange=!1;_rangeClampReported=``;constructor(){super(),this.shadow=this.attachShadow({mode:`open`}),ee(this.shadow,c),{container:this.container,iframe:this.iframe}=S(),this.shadow.appendChild(this.container);let e=Qn();this.shadow.appendChild(e.root),this.shaderLoader=new er(e),this._media=new Sn({dispatchEvent:e=>this._emit(e),getMuted:()=>this.muted,getVolume:()=>this._volume,getPlaybackRate:()=>this.playbackRate,getCurrentTime:()=>this._currentTime,isPaused:()=>this._paused}),this._directTimelineClock=new T({onTimeUpdate:(e,t)=>{this._currentTime=e,this.controlsApi?.updateTime(e,t),this._emit(new CustomEvent(`timeupdate`,{detail:{currentTime:e}}))},getLoop:()=>this.loop,restart:()=>{this.seek(this._playRange()?.start??0),this.play()},onPaused:()=>{this._media.audioOwner===`parent`&&this._media.pauseAll(),this._paused=!0,this.controlsApi?.updatePlaying(!1),this._emit(new Event(`ended`))},onEnded:()=>this.loop}),this.probe=new s(this.iframe,{onReady:e=>this._onProbeReady(e),onError:e=>this._emit(new CustomEvent(`error`,{detail:{message:e}}))}),this.addEventListener(`click`,e=>{this.disableClickToPlay||b(e)||(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)}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=y(this.shadow,this.getAttribute(`poster`),this.posterEl)),this.hasAttribute(`audio-src`)&&this._media.setupFromUrl(this.getAttribute(`audio-src`)),this.hasAttribute(`srcdoc`)&&(this.iframe.srcdoc=Xn(this,this.getAttribute(`srcdoc`))),this.hasAttribute(`src`)&&this._loadSrc(this.getAttribute(`src`)),!this.hasAttribute(`audio-locked`)&&this._isLockedHostEnvironment()&&this._applyAudioLock(!0)}disconnectedCallback(){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(),this.controlsApi?.destroy(),this.controlsApi=null,this._paused=!0,this._pendingPlay=!1,this._abandonComposition(`Player disconnected before runtime data was applied`)}attributeChangedCallback(e,t,n){switch(e){case`src`:if(!this.isConnected)break;n&&this._navigateSrc(n);break;case`type`:{let e=this.getAttribute(`src`);if(!this.isConnected||e===null||!!this._videoSource===this._wantsVideo())break;this._navigateSrc(e);break}case`srcdoc`:if(!this.isConnected)break;if(this._pendingPlay=!1,this._abandonComposition(`Composition navigated before runtime data was applied`),n!==null)this._pauseForVideoSwitch(),this._teardownVideo(),this.iframe.srcdoc=Xn(this,n);else{this.iframe.removeAttribute(`srcdoc`);let e=this.getAttribute(`src`);e!==null&&this._wantsVideo()&&this._navigateSrc(e)}break;case ar:this._applySandboxOriginPolicy(this.isConnected&&t!==n);break;case`width`:this._setCompositionSize(a(n)??1920,this._compositionHeight);break;case`height`:this._setCompositionSize(this._compositionWidth,a(n)??1080);break;case`controls`:n===null?(this.controlsApi?.destroy(),this.controlsApi=null):this._setupControls();break;case`poster`:this.posterEl=y(this.shadow,n,this.posterEl);break;case`playback-rate`:{let e=fr(parseFloat(n||`1`));this._media.updatePlaybackRate(e),this._sendControl(`set-playback-rate`,{playbackRate:e}),this._directTimelineAdapter?.timeScale?.(e),this.controlsApi?.updateSpeed(e),this._emit(new Event(`ratechange`));break}case`muted`:this._handleMutedChange(n);break;case`audio-locked`:this._applyAudioLock(n!==null);break;case`volume`:{let e=Math.max(0,Math.min(1,parseFloat(n||`1`)));this._volume=e,this._syncVideoAudio(),this._media.updateVolume(e),this._sendControl(`set-volume`,{volume:e}),this.controlsApi?.updateVolume(e),this._emit(new Event(`volumechange`));break}case`audio-src`:n?this._media.setupFromUrl(n):this._media.teardownUrlAudio();break;case Z:n===`none`&&this.shaderLoader.hideAssetsLoading();break;case lr:this._sendControl(`set-idle-heartbeat`,{slow:n!==null});break;case Q:case $:this._applyPlayRange(!0);break;case J:case Y:case Rn:if(!this.isConnected)break;this._reloadShaderOptions()}}_applySandboxOriginPolicy(e=!1){this.hasAttribute(ar)?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`);let e=this.getAttribute(`srcdoc`);if(e!==null){this.iframe.srcdoc=Xn(this,e);return}let t=this.getAttribute(`src`);t===null?this.iframe.src=`about:blank`:this._loadSrc(t)}get iframeElement(){return this.iframe}get scenes(){return this._scenes}play(){this._play(!0)}_play(e){if(this._ready&&!this._assetsReady){this._pendingPlay=!0;return}this._pendingPlay=!1,this.posterEl?.remove(),this.posterEl=null;let t=this._ready?this._playRange():null;t?Tn(this._currentTime,t,this._duration,this._runtimeFps)&&(this.seek(t.start),this._enteringRange=!0):this._duration>0&&this._currentTime>=this._duration&&this.seek(0),this._paused=!1;let n=this._tryDirectTimelinePlay(),r=!1;n||(this._sendControl(`play`),this._ready&&!this._directTimelineAdapter?this._startParentTickClock():this._ready||(this._pendingPlay=!0,r=!0)),this._media.audioOwner===`parent`&&this._media.playAll(),this.controlsApi?.updatePlaying(!0),!r&&e&&this._emit(new Event(`play`)),n&&this._directTimelineAdapter&&this._directTimelineClock.start(this._directTimelineAdapter,()=>this._currentTime,()=>this._duration,()=>this._paused,()=>this._clockStop())}pause(){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,this.controlsApi?.updatePlaying(!1),this._emit(new Event(`pause`))}stopMedia(){this._sendControl(`stop-media`),this._stopIframeMedia(),this._media.stopAdoptedMedia()}seek(e){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,this.controlsApi?.updatePlaying(!1),this.controlsApi?.updateTime(this._currentTime,this._duration)}setColorGrading(e,t){this._sendControl(`set-color-grading`,{target:e,grading:t})}clearColorGrading(e){this._sendControl(`set-color-grading`,{target:e,grading:null})}setColorGradingCompare(e,t){this._sendControl(`set-color-grading-compare`,{target:e,compare:t})}clearColorGradingCompare(e){this._sendControl(`set-color-grading-compare`,{target:e,compare:{enabled:!1}})}setRuntimeData(e,t){if(!/^[a-z][a-z0-9-]{0,63}$/.test(e))throw Error(`Invalid HyperFrames runtime-data channel: ${e}`);if(typeof structuredClone!=`function`)throw Error(`HyperFrames runtime data requires structuredClone support; refusing an unverified payload`);let n=structuredClone(t);this._runtimeData.set(e,n),this._deliverRuntimeData(e,n)}clearRuntimeData(e){if(!/^[a-z][a-z0-9-]{0,63}$/.test(e))throw 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 fr(parseFloat(this.getAttribute(`playback-rate`)||`1`))}set playbackRate(e){this.setAttribute(`playback-rate`,String(fr(e)))}get shaderCaptureScale(){return Jn(this)}set shaderCaptureScale(e){this.setAttribute(J,String(e))}get shaderLoading(){return qn(this)}set shaderLoading(e){e===`composition`?this.removeAttribute(Y):this.setAttribute(Y,e)}get assetsLoadingUi(){return this.getAttribute(Z)===`none`?`none`:`player`}set assetsLoadingUi(e){e===`none`?this.setAttribute(Z,`none`):this.removeAttribute(Z)}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;let 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){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}),this.controlsApi?.updateMuted(e!==null),this._emit(new Event(`volumechange`))}_applyAudioLock(e){e&&(this.muted=!0),this.controlsApi?.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(ur)}set disableClickToPlay(e){this.toggleAttribute(ur,e)}get loop(){return this.hasAttribute(`loop`)}set loop(e){e?this.setAttribute(`loop`,``):this.removeAttribute(`loop`)}get rangeStart(){return this._readSeconds(Q)}set rangeStart(e){this._writeSeconds(Q,e)}get rangeEnd(){return this._readSeconds($)}set rangeEnd(e){this._writeSeconds($,e)}_readSeconds(e){let t=this.getAttribute(e);return t===null?null:Number(t)}_writeSeconds(e,t){t==null?this.removeAttribute(e):this.setAttribute(e,String(t))}_hasPlayRange(){return this.hasAttribute(Q)||this.hasAttribute($)}_playRange(){return Cn(this.rangeStart,this.rangeEnd,this._duration).range}_sendPlayRange(e){let t=e?.end??null;this._sendControl(`set-play-range`,{startSeconds:e?.start??null,endSeconds:t})}_applyPlayRange(e){let{range:t,clamped:n}=Cn(this.rangeStart,this.rangeEnd,this._duration);this._sendPlayRange(t),this._ready&&(this._reportRangeClamp(t,n),t&&e&&!this._pendingPlay&&this._moveIntoPlayRange(t))}_reportRangeClamp(e,t){let n=t?`${this.rangeStart},${this.rangeEnd},${this._duration}`:``;if(n===this._rangeClampReported||(this._rangeClampReported=n,!t))return;let r={rangeStart:e?.start??null,rangeEnd:e?.end??null};this._emit(new CustomEvent(`rangeclamped`,{detail:{...r,duration:this._duration}}))}_moveIntoPlayRange(e){Tn(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(){let e=this._playRange(),t=e?.end??this._duration;if(!e)return{end:t,shown:t};let n=wn(e,this._duration,this._runtimeFps);return{end:t,shown:n<t?(n+t)/2:n}}_sendControl(e,t={}){try{let n=this.iframe.contentWindow;return n?(n.postMessage({...t,source:`hf-parent`,type:`control`,action:e,...Yt(this._runtimeFps)},`*`),!0):((e===`set-runtime-data`||e===`clear-runtime-data`)&&this._rejectRuntimeDataDelivery(t.channel,t.requestId,`Composition iframe is unavailable`),!1)}catch(n){return(e===`set-runtime-data`||e===`clear-runtime-data`)&&this._rejectRuntimeDataDelivery(t.channel,t.requestId,n instanceof Error?n.message:String(n)),!1}}_deliverRuntimeData(e,t){if(!this.isConnected||!this._runtimeBridgeReady)return;let n=this._beginRuntimeDataDelivery(e);this._trySetRuntimeDataDirect(e,t,n)||this._sendControl(`set-runtime-data`,{channel:e,payload:t,requestId:n})}_deliverRuntimeDataClear(e){if(!this.isConnected||!this._runtimeBridgeReady)return;let t=this._beginRuntimeDataDelivery(e);this._tryClearRuntimeDataDirect(e,t)||this._sendControl(`clear-runtime-data`,{channel:e,requestId:t})}_trySetRuntimeDataDirect(e,t,n){try{let r=this.iframe.contentWindow?.__hyperframes;return typeof r?.setRuntimeData==`function`&&(r.setRuntimeData(e,t,n),!0)}catch{return!1}}_tryClearRuntimeDataDirect(e,t){try{let n=this.iframe.contentWindow?.__hyperframes;return typeof n?.clearRuntimeData==`function`&&(n.clearRuntimeData(e,t),!0)}catch{return!1}}_replayRuntimeData(){for(let[e,t]of this._runtimeData)this._deliverRuntimeData(e,t)}_beginRuntimeDataDelivery(e){let t=this._pendingRuntimeData.get(e);t&&window.clearTimeout(t.timeoutId),this._runtimeDataRequestId+=1;let n=this._runtimeDataRequestId,r=window.setTimeout(()=>{this._rejectRuntimeDataDelivery(e,n,`Runtime data delivery timed out after ${or}ms`)},or);return this._pendingRuntimeData.set(e,{requestId:n,timeoutId:r}),n}_resolveRuntimeDataDelivery(e,t){let n=this._takeRuntimeDataDelivery(e,t);n&&this._emit(new CustomEvent(`runtimedataapplied`,{detail:{channel:e,requestId:n.requestId}}))}_rejectRuntimeDataDelivery(e,t,n){let r=this._takeRuntimeDataDelivery(e,t);r&&this._emit(new CustomEvent(`runtimedataerror`,{detail:{channel:e,requestId:r.requestId,message:typeof n==`string`?n:String(n)}}))}_takeRuntimeDataDelivery(e,t){if(typeof e!=`string`||typeof t!=`number`||!Number.isSafeInteger(t))return null;let n=this._pendingRuntimeData.get(e);return!n||n.requestId!==t?null:(window.clearTimeout(n.timeoutId),this._pendingRuntimeData.delete(e),n)}_rejectAllRuntimeDataDeliveries(e){for(let[t,n]of[...this._pendingRuntimeData])this._rejectRuntimeDataDelivery(t,n.requestId,e)}_getSameOriginIframeDocument(){try{return this.iframe.contentDocument}catch{return null}}_setIframeMediaMuted(e){let t=this._getSameOriginIframeDocument();if(t)for(let n of t.querySelectorAll(`video, audio`))q(n)&&(n.muted=e||n.defaultMuted)}_stopIframeMedia(){let e=this._getSameOriginIframeDocument();if(e)for(let t of e.querySelectorAll(`video, audio`))q(t)&&t.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(lr)})}_reloadShaderOptions(){if(!this._videoSource){if(this._abandonComposition(`Shader options changed before runtime data was applied`),this.hasAttribute(`srcdoc`)){this.iframe.srcdoc=Xn(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 tr(this.getAttribute(`type`))&&!this.hasAttribute(`srcdoc`)}_pauseForVideoSwitch(){!this._videoSource&&!this._wantsVideo()||(this._paused=!0,this.controlsApi?.updatePlaying(!1))}_loadSrc(e){if(this._wantsVideo()){this._loadVideo(e);return}this._teardownVideo(),this.iframe.src=Yn(this,e)}_loadVideo(e){this._videoSource||(this._videoSource=nr({onMetadata:e=>this._applyThenEmit(()=>this._onVideoReady(e)),onDurationChange:e=>this._applyTimelineDuration(e.duration),onResize:e=>this._applyVideoSize(e),onPlay:e=>{!e.paused&&this._paused&&this.play()},onPause:e=>{e.paused&&!e.ended&&!this._paused&&this.pause()},onTimeUpdate:()=>{document.hidden&&this._playRange()&&this._directTimelineClock.poll()},onError:(e,t)=>{this._paused||this.pause(),this._emit(new CustomEvent(`error`,{detail:{message:e,code:t}}))},onPlayRejected:e=>this._onVideoPlayRejected(e)}),this.container.appendChild(this._videoSource.video),this.iframe.hidden=!0,this.iframe.src=`about:blank`),this.probe.stop();let{video:t,adapter:n}=this._videoSource;this._directTimelineAdapter=n,this._currentTime=0,this._duration=0,this.controlsApi?.updateTime(0,0),this._syncVideoAudio(),n.timeScale?.(this.playbackRate),t.src=e}_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){!Number.isFinite(e)||e<=0||(this._setDuration(e),this.controlsApi?.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{let t=this.iframe.contentWindow?.__player;return typeof t?.seek==`function`&&(t.seek.call(t,e),!0)}catch{return!1}}_withDirectTimeline(e){let t=this._videoSource?null:this.probe.resolveDirectTimelineAdapter(),n=t||this._directTimelineAdapter;if(!n)return!1;try{return e(n),t&&t!==this._directTimelineAdapter&&this._applyTimelineDuration(t.duration()),this._directTimelineAdapter=n,!0}catch{return!1}}_tryDirectTimelineSeek(e){return this._withDirectTimeline(t=>{t.seek(e,!1),t.pause()})}_tryDirectTimelinePlay(){return this._withDirectTimeline(e=>{e.play()})}_tryDirectTimelinePause(){return this._withDirectTimeline(e=>{e.pause()})}_showPausedVideoTime(){this._videoSource&&(this._currentTime=this._videoSource.video.currentTime,this.controlsApi?.updateTime(this._currentTime,this._duration),this._emit(new CustomEvent(`timeupdate`,{detail:{currentTime:this._currentTime}})))}_startParentTickClock(){this._stopParentTickClock();let 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._applyThenEmit(()=>this._handleRuntimeMessage(e))}_handleRuntimeMessage(e){Nn(e,this.iframe.contentWindow,{getPlaybackState:()=>({currentTime:this._currentTime,duration:this._duration,paused:this._paused,lastUpdateMs:this._lastUpdateMs,enteringRange:this._enteringRange}),setPlaybackState:({currentTime:e,duration:t,paused:n,lastUpdateMs:r,enteringRange:i})=>{this._enteringRange=i===!0,this._currentTime=e,this._setDuration(t),this._paused=n,this._lastUpdateMs=r},getShaderLoadingMode:()=>qn(this),shaderLoader:this.shaderLoader,setCompositionSize:(e,t)=>this._setCompositionSize(e,t),sendControl:(e,t)=>this._sendControl(e,t),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:(e,t)=>this._resolveRuntimeDataDelivery(e,t),onRuntimeDataError:(e,t,n)=>this._rejectRuntimeDataDelivery(e,t,n),onRuntimeTimelineReady:(e,t)=>this._onRuntimeTimelineReady(e,t),setRuntimeFps:e=>{this._runtimeFps=e},setRuntimeOwnsPlayRange:e=>{this._runtimeOwnsPlayRange=e},shouldPromoteMediaAutoplayFallback:()=>!this._isSlideshowPlayer(),setScenes:e=>{this._scenes=e,this._emit(new CustomEvent(`scenes`,{detail:{scenes:e}}))},updateControlsTime:(e,t)=>this.controlsApi?.updateTime(e,t),updateControlsPlaying:e=>this.controlsApi?.updatePlaying(e),dispatchEvent:e=>this._emit(e),seek:e=>this.seek(e),play:()=>this.play(),getLoop:()=>this.loop,getPlayRange:()=>this._playRange(),media:this._media})}_onRuntimeTimelineReady(e,t){if(this._ready)return;this.probe.stop(),this._setDuration(e),this._directTimelineAdapter=null,this._ready=!0,this.controlsApi?.updateTime(this._currentTime,e),this._dispatchReady();let n=this._getSameOriginIframeDocument();n&&this._media.setupFromIframe(n),this._replayBridgeState(),this._setIframeMediaMuted(this.muted),this._waitForAssetsReady(n,t),this._playWhenWanted()}_onProbeReady(e){this._applyThenEmit(()=>this._applyProbeResult(e))}_applyProbeResult({duration:e,adapter:t,compositionSize:n}){this._setDuration(e),this._directTimelineAdapter=t.kind===`direct-timeline`?t.timeline:null,n&&this._setCompositionSize(n.width,n.height),this._ready=!0,this.controlsApi?.updateTime(0,e),this._dispatchReady();let r=this._getSameOriginIframeDocument();r&&this._media.setupFromIframe(r),this._setIframeMediaMuted(this.muted),this._waitForAssetsReady(r),this._playWhenWanted()}_waitForAssetsReady(e,t){this._clearAssetsLoadingShowTimer(),this._assetsReady=!1,this._painted=!1;let n=++this._assetsGeneration;if(!e){t===!1?(this._runtimeAssetsReadyGeneration=n,this._startAssetsLoadingOverlayTimer(n),setTimeout(()=>this._settleAssetsReady(n),sr)):this._settleAssetsReady(n);return}yn(e,({timedOut:t})=>{n===this._assetsGeneration&&(t&&this._warnStuckAssets(e),this._settleAssetsReady(n))},{timeoutMs:sr}),this._assetsReady||this._startAssetsLoadingOverlayTimer(n)}_startAssetsLoadingOverlayTimer(e){this._assetsLoadingShowTimer=setTimeout(()=>{this._assetsLoadingShowTimer=null,!(e!==this._assetsGeneration||this._assetsReady)&&(this.setAttribute(cr,``),this.assetsLoadingUi!==`none`&&this.shaderLoader.showAssetsLoading())},dr)}_hasPendingFirstFrameAssets(e){let{pendingMedia:t,pendingImages:n,fontsLoading:r}=on(e,{scope:K});return t.length>0||n.length>0||r}_warnStuckAssets(e){let{pendingMedia:t,pendingImages:n,fontsLoading:r}=on(e,{scope:K}),i=e.defaultView;console.warn(`[hyperframes-player] assets-loading timed out after ${sr}ms \u2014 playing anyway`,{stuckMedia:t.map(e=>e.currentSrc||e.getAttribute(`src`)||`<${e.tagName.toLowerCase()}>`),stuckImages:n.map(e=>e.currentSrc||e.getAttribute(`src`)||`<img>`),fontsLoading:r,computeReady:i?.__renderReady===!0,documentHidden:e.hidden===!0})}_settleAssetsReady(e){e!==this._assetsGeneration||this._assetsReady||(this._clearAssetsLoadingShowTimer(),this._assetsReady=!0,this.removeAttribute(cr),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._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.shaderLoader.reset(),this._media.resetForIframeLoad()}_invalidateAssetsWait(){this._clearAssetsLoadingShowTimer(),this._assetsReady=!1,this._painted=!1,this._assetsGeneration++,this.removeAttribute(cr),this.shaderLoader.hide()}_clearAssetsLoadingShowTimer(){this._assetsLoadingShowTimer!==null&&(clearTimeout(this._assetsLoadingShowTimer),this._assetsLoadingShowTimer=null)}_dispatchReady(){this._readyDocument=this._getSameOriginIframeDocument();let 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,t){let n=e!==this._compositionWidth||t!==this._compositionHeight;if(this._compositionWidth=e,this._compositionHeight=t,this._rescale(),!n)return;let r={compositionWidth:e,compositionHeight:t};this._emit(new CustomEvent(`resize`,{detail:r}))}_applyThenEmit(e){if(this._afterUpdate){e();return}let t=[];this._afterUpdate=t;let n=[],r=e=>{try{e()}catch(e){n.push(e)}};r(e);for(let e of t)r(e);if(this._afterUpdate=null,n.length>0)throw n[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(){!C(this,this.iframe,this._compositionWidth,this._compositionHeight)&&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;let 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||=v(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=>{this.playbackRate=e},onMuteToggle:()=>{this.muted=!this.muted},onVolumeChange:e=>{this.volume=e}},this._isAudioLocked())}get _audioOwner(){return this._media.audioOwner}get _parentMedia(){return this._media.entries}_mirrorParentMediaTime(e,t){this._media.mirrorTime(e,t)}_promoteToParentProxy(){let e=null;try{e=this.iframe.contentDocument}catch{}this._media.promoteToParentProxy(e,(e,t)=>this._mirrorParentMediaTime(e,t)),this._sendControl(`set-media-output-muted`,{muted:!0})}_observeDynamicMedia(e){this._media.setupFromIframe(e)}};customElements.get(`hyperframes-player`)||customElements.define(`hyperframes-player`,pr);export{pr as HyperframesPlayer,m as SPEED_PRESETS,h as formatSpeed,g as formatTime};