@remotion/promo-pages 4.0.431 → 4.0.433

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 (284) hide show
  1. package/dist/Homepage.js +4671 -2145
  2. package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/Homepage.js +4671 -2145
  3. package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/design.js +1154 -907
  4. package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/experts.js +1084 -838
  5. package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/homepage/Pricing.js +1147 -900
  6. package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsGallery.js +1152 -905
  7. package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsShow.js +1231 -984
  8. package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsSubmit.js +1237 -990
  9. package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/template-modal-content.js +1151 -904
  10. package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/templates.js +1141 -894
  11. package/dist/design.js +1154 -907
  12. package/dist/experts.js +1084 -838
  13. package/dist/homepage/Pricing.js +1147 -900
  14. package/dist/prompts/PromptsGallery.js +1152 -905
  15. package/dist/prompts/PromptsShow.js +1231 -984
  16. package/dist/prompts/PromptsSubmit.js +1237 -990
  17. package/dist/template-modal-content.js +1151 -904
  18. package/dist/templates.js +1141 -894
  19. package/package.json +18 -14
  20. package/dist/cn.d.ts +0 -2
  21. package/dist/cn.js +0 -5
  22. package/dist/components/3DEngine/ButtonDemo.d.ts +0 -2
  23. package/dist/components/3DEngine/ButtonDemo.js +0 -43
  24. package/dist/components/3DEngine/Faces.d.ts +0 -5
  25. package/dist/components/3DEngine/Faces.js +0 -7
  26. package/dist/components/3DEngine/Outer.d.ts +0 -8
  27. package/dist/components/3DEngine/Outer.js +0 -56
  28. package/dist/components/3DEngine/Switch.d.ts +0 -4
  29. package/dist/components/3DEngine/Switch.js +0 -4
  30. package/dist/components/3DEngine/get-child-node-from.d.ts +0 -1
  31. package/dist/components/3DEngine/get-child-node-from.js +0 -14
  32. package/dist/components/3DEngine/hover-transforms.d.ts +0 -9
  33. package/dist/components/3DEngine/hover-transforms.js +0 -177
  34. package/dist/components/BackButton.d.ts +0 -6
  35. package/dist/components/BackButton.js +0 -9
  36. package/dist/components/CommandCopyButton.d.ts +0 -5
  37. package/dist/components/CommandCopyButton.js +0 -4
  38. package/dist/components/Homepage.d.ts +0 -6
  39. package/dist/components/Homepage.js +0 -20
  40. package/dist/components/ManageTeamMembers.d.ts +0 -2
  41. package/dist/components/ManageTeamMembers.js +0 -42
  42. package/dist/components/Spinner.d.ts +0 -3
  43. package/dist/components/Spinner.js +0 -4
  44. package/dist/components/TeamPicture.d.ts +0 -1
  45. package/dist/components/TeamPicture.js +0 -4
  46. package/dist/components/design.d.ts +0 -1
  47. package/dist/components/design.js +0 -33
  48. package/dist/components/experts/ExpertsPage.d.ts +0 -11
  49. package/dist/components/experts/ExpertsPage.js +0 -50
  50. package/dist/components/experts/experts-data.d.ts +0 -15
  51. package/dist/components/experts/experts-data.js +0 -263
  52. package/dist/components/experts/experts-icons.d.ts +0 -7
  53. package/dist/components/experts/experts-icons.js +0 -36
  54. package/dist/components/experts.d.ts +0 -3
  55. package/dist/components/experts.js +0 -2
  56. package/dist/components/homepage/BackgroundAnimation.d.ts +0 -2
  57. package/dist/components/homepage/BackgroundAnimation.js +0 -66
  58. package/dist/components/homepage/ChooseTemplate.d.ts +0 -2
  59. package/dist/components/homepage/ChooseTemplate.js +0 -25
  60. package/dist/components/homepage/CommunityStats.d.ts +0 -3
  61. package/dist/components/homepage/CommunityStats.js +0 -6
  62. package/dist/components/homepage/CommunityStatsItems.d.ts +0 -7
  63. package/dist/components/homepage/CommunityStatsItems.js +0 -58
  64. package/dist/components/homepage/Demo/Card.d.ts +0 -15
  65. package/dist/components/homepage/Demo/Card.js +0 -174
  66. package/dist/components/homepage/Demo/Cards.d.ts +0 -15
  67. package/dist/components/homepage/Demo/Cards.js +0 -57
  68. package/dist/components/homepage/Demo/Comp.d.ts +0 -38
  69. package/dist/components/homepage/Demo/Comp.js +0 -72
  70. package/dist/components/homepage/Demo/CurrentCountry.d.ts +0 -9
  71. package/dist/components/homepage/Demo/CurrentCountry.js +0 -48
  72. package/dist/components/homepage/Demo/DemoError.d.ts +0 -2
  73. package/dist/components/homepage/Demo/DemoError.js +0 -10
  74. package/dist/components/homepage/Demo/DemoErrorIcon.d.ts +0 -2
  75. package/dist/components/homepage/Demo/DemoErrorIcon.js +0 -16
  76. package/dist/components/homepage/Demo/DemoRender.d.ts +0 -33
  77. package/dist/components/homepage/Demo/DemoRender.js +0 -107
  78. package/dist/components/homepage/Demo/DigitWheel.d.ts +0 -9
  79. package/dist/components/homepage/Demo/DigitWheel.js +0 -94
  80. package/dist/components/homepage/Demo/DisplayedEmoji.d.ts +0 -5
  81. package/dist/components/homepage/Demo/DisplayedEmoji.js +0 -59
  82. package/dist/components/homepage/Demo/DoneCheckmark.d.ts +0 -2
  83. package/dist/components/homepage/Demo/DoneCheckmark.js +0 -20
  84. package/dist/components/homepage/Demo/DownloadNudge.d.ts +0 -2
  85. package/dist/components/homepage/Demo/DownloadNudge.js +0 -27
  86. package/dist/components/homepage/Demo/DragAndDropNudge.d.ts +0 -3
  87. package/dist/components/homepage/Demo/DragAndDropNudge.js +0 -26
  88. package/dist/components/homepage/Demo/EmojiCard.d.ts +0 -10
  89. package/dist/components/homepage/Demo/EmojiCard.js +0 -120
  90. package/dist/components/homepage/Demo/Minus.d.ts +0 -5
  91. package/dist/components/homepage/Demo/Minus.js +0 -11
  92. package/dist/components/homepage/Demo/PlayPauseButton.d.ts +0 -5
  93. package/dist/components/homepage/Demo/PlayPauseButton.js +0 -47
  94. package/dist/components/homepage/Demo/PlayerControls.d.ts +0 -8
  95. package/dist/components/homepage/Demo/PlayerControls.js +0 -15
  96. package/dist/components/homepage/Demo/PlayerSeekBar.d.ts +0 -11
  97. package/dist/components/homepage/Demo/PlayerSeekBar.js +0 -216
  98. package/dist/components/homepage/Demo/PlayerVolume.d.ts +0 -5
  99. package/dist/components/homepage/Demo/PlayerVolume.js +0 -53
  100. package/dist/components/homepage/Demo/Progress.d.ts +0 -4
  101. package/dist/components/homepage/Demo/Progress.js +0 -14
  102. package/dist/components/homepage/Demo/Spinner.d.ts +0 -5
  103. package/dist/components/homepage/Demo/Spinner.js +0 -37
  104. package/dist/components/homepage/Demo/Switcher.d.ts +0 -6
  105. package/dist/components/homepage/Demo/Switcher.js +0 -25
  106. package/dist/components/homepage/Demo/Temperature.d.ts +0 -6
  107. package/dist/components/homepage/Demo/Temperature.js +0 -21
  108. package/dist/components/homepage/Demo/TemperatureNumber.d.ts +0 -5
  109. package/dist/components/homepage/Demo/TemperatureNumber.js +0 -36
  110. package/dist/components/homepage/Demo/ThemeNudge.d.ts +0 -3
  111. package/dist/components/homepage/Demo/ThemeNudge.js +0 -35
  112. package/dist/components/homepage/Demo/TimeDisplay.d.ts +0 -6
  113. package/dist/components/homepage/Demo/TimeDisplay.js +0 -27
  114. package/dist/components/homepage/Demo/TrendingRepos.d.ts +0 -6
  115. package/dist/components/homepage/Demo/TrendingRepos.js +0 -65
  116. package/dist/components/homepage/Demo/icons.d.ts +0 -10
  117. package/dist/components/homepage/Demo/icons.js +0 -22
  118. package/dist/components/homepage/Demo/index.d.ts +0 -2
  119. package/dist/components/homepage/Demo/index.js +0 -95
  120. package/dist/components/homepage/Demo/math.d.ts +0 -10
  121. package/dist/components/homepage/Demo/math.js +0 -29
  122. package/dist/components/homepage/Demo/types.d.ts +0 -6
  123. package/dist/components/homepage/Demo/types.js +0 -0
  124. package/dist/components/homepage/EditorStarterSection.d.ts +0 -3
  125. package/dist/components/homepage/EditorStarterSection.js +0 -8
  126. package/dist/components/homepage/EvaluateRemotion.d.ts +0 -3
  127. package/dist/components/homepage/EvaluateRemotion.js +0 -21
  128. package/dist/components/homepage/FreePricing.d.ts +0 -4
  129. package/dist/components/homepage/FreePricing.js +0 -134
  130. package/dist/components/homepage/GetStartedStrip.d.ts +0 -2
  131. package/dist/components/homepage/GetStartedStrip.js +0 -14
  132. package/dist/components/homepage/GitHubButton.d.ts +0 -2
  133. package/dist/components/homepage/GitHubButton.js +0 -7
  134. package/dist/components/homepage/IconForTemplate.d.ts +0 -6
  135. package/dist/components/homepage/IconForTemplate.js +0 -112
  136. package/dist/components/homepage/IfYouKnowReact.d.ts +0 -3
  137. package/dist/components/homepage/IfYouKnowReact.js +0 -23
  138. package/dist/components/homepage/InfoTooltip.d.ts +0 -6
  139. package/dist/components/homepage/InfoTooltip.js +0 -6
  140. package/dist/components/homepage/MoreTemplatesButton.d.ts +0 -2
  141. package/dist/components/homepage/MoreTemplatesButton.js +0 -11
  142. package/dist/components/homepage/MuxVideo.d.ts +0 -7
  143. package/dist/components/homepage/MuxVideo.js +0 -45
  144. package/dist/components/homepage/NewsletterButton.d.ts +0 -2
  145. package/dist/components/homepage/NewsletterButton.js +0 -38
  146. package/dist/components/homepage/ParameterizeAndEdit.d.ts +0 -2
  147. package/dist/components/homepage/ParameterizeAndEdit.js +0 -22
  148. package/dist/components/homepage/Pricing.d.ts +0 -2
  149. package/dist/components/homepage/Pricing.js +0 -15
  150. package/dist/components/homepage/PricingBulletPoint.d.ts +0 -6
  151. package/dist/components/homepage/PricingBulletPoint.js +0 -19
  152. package/dist/components/homepage/RealMp4Videos.d.ts +0 -2
  153. package/dist/components/homepage/RealMp4Videos.js +0 -41
  154. package/dist/components/homepage/Spacer.d.ts +0 -2
  155. package/dist/components/homepage/Spacer.js +0 -4
  156. package/dist/components/homepage/TemplateIcon.d.ts +0 -5
  157. package/dist/components/homepage/TemplateIcon.js +0 -24
  158. package/dist/components/homepage/TextInput.d.ts +0 -7
  159. package/dist/components/homepage/TextInput.js +0 -34
  160. package/dist/components/homepage/TrustedByBanner.d.ts +0 -2
  161. package/dist/components/homepage/TrustedByBanner.js +0 -27
  162. package/dist/components/homepage/VideoApps.d.ts +0 -4
  163. package/dist/components/homepage/VideoApps.js +0 -72
  164. package/dist/components/homepage/VideoAppsShowcase.d.ts +0 -3
  165. package/dist/components/homepage/VideoAppsShowcase.js +0 -139
  166. package/dist/components/homepage/VideoAppsTitle.d.ts +0 -4
  167. package/dist/components/homepage/VideoAppsTitle.js +0 -4
  168. package/dist/components/homepage/VideoPlayerWithControls.d.ts +0 -20
  169. package/dist/components/homepage/VideoPlayerWithControls.js +0 -105
  170. package/dist/components/homepage/WriteInReact.d.ts +0 -2
  171. package/dist/components/homepage/WriteInReact.js +0 -10
  172. package/dist/components/homepage/YouAreHere.d.ts +0 -2
  173. package/dist/components/homepage/YouAreHere.js +0 -23
  174. package/dist/components/homepage/layout/Button.d.ts +0 -22
  175. package/dist/components/homepage/layout/Button.js +0 -30
  176. package/dist/components/homepage/layout/colors.d.ts +0 -13
  177. package/dist/components/homepage/layout/colors.js +0 -14
  178. package/dist/components/homepage/layout/use-color-mode.d.ts +0 -21
  179. package/dist/components/homepage/layout/use-color-mode.js +0 -22
  180. package/dist/components/homepage/layout/use-el-size.d.ts +0 -5
  181. package/dist/components/homepage/layout/use-el-size.js +0 -40
  182. package/dist/components/homepage/layout/use-mobile-layout.d.ts +0 -1
  183. package/dist/components/homepage/layout/use-mobile-layout.js +0 -6
  184. package/dist/components/icons/blank.d.ts +0 -3
  185. package/dist/components/icons/blank.js +0 -4
  186. package/dist/components/icons/brain.d.ts +0 -2
  187. package/dist/components/icons/brain.js +0 -4
  188. package/dist/components/icons/clone.d.ts +0 -2
  189. package/dist/components/icons/clone.js +0 -2
  190. package/dist/components/icons/code-hike.d.ts +0 -3
  191. package/dist/components/icons/code-hike.js +0 -4
  192. package/dist/components/icons/cubes.d.ts +0 -3
  193. package/dist/components/icons/cubes.js +0 -4
  194. package/dist/components/icons/editor.d.ts +0 -3
  195. package/dist/components/icons/editor.js +0 -4
  196. package/dist/components/icons/js.d.ts +0 -3
  197. package/dist/components/icons/js.js +0 -4
  198. package/dist/components/icons/music.d.ts +0 -2
  199. package/dist/components/icons/music.js +0 -4
  200. package/dist/components/icons/next.d.ts +0 -4
  201. package/dist/components/icons/next.js +0 -4
  202. package/dist/components/icons/overlay.d.ts +0 -3
  203. package/dist/components/icons/overlay.js +0 -4
  204. package/dist/components/icons/prompt-to-video.d.ts +0 -2
  205. package/dist/components/icons/prompt-to-video.js +0 -4
  206. package/dist/components/icons/recorder.d.ts +0 -3
  207. package/dist/components/icons/recorder.js +0 -4
  208. package/dist/components/icons/remix.d.ts +0 -3
  209. package/dist/components/icons/remix.js +0 -4
  210. package/dist/components/icons/render-server.d.ts +0 -3
  211. package/dist/components/icons/render-server.js +0 -4
  212. package/dist/components/icons/skia.d.ts +0 -3
  213. package/dist/components/icons/skia.js +0 -4
  214. package/dist/components/icons/stargazer.d.ts +0 -3
  215. package/dist/components/icons/stargazer.js +0 -4
  216. package/dist/components/icons/still.d.ts +0 -3
  217. package/dist/components/icons/still.js +0 -4
  218. package/dist/components/icons/tailwind.d.ts +0 -3
  219. package/dist/components/icons/tailwind.js +0 -4
  220. package/dist/components/icons/tiktok.d.ts +0 -3
  221. package/dist/components/icons/tiktok.js +0 -4
  222. package/dist/components/icons/timeline.d.ts +0 -3
  223. package/dist/components/icons/timeline.js +0 -4
  224. package/dist/components/icons/ts.d.ts +0 -3
  225. package/dist/components/icons/ts.js +0 -4
  226. package/dist/components/icons/tts.d.ts +0 -3
  227. package/dist/components/icons/tts.js +0 -4
  228. package/dist/components/icons/undo.d.ts +0 -3
  229. package/dist/components/icons/undo.js +0 -2
  230. package/dist/components/icons/vercel.d.ts +0 -4
  231. package/dist/components/icons/vercel.js +0 -4
  232. package/dist/components/icons/waveform.d.ts +0 -3
  233. package/dist/components/icons/waveform.js +0 -4
  234. package/dist/components/prompts/CardLikeButton.d.ts +0 -5
  235. package/dist/components/prompts/CardLikeButton.js +0 -49
  236. package/dist/components/prompts/ClipboardIcon.d.ts +0 -5
  237. package/dist/components/prompts/ClipboardIcon.js +0 -4
  238. package/dist/components/prompts/CopyPromptButton.d.ts +0 -4
  239. package/dist/components/prompts/CopyPromptButton.js +0 -13
  240. package/dist/components/prompts/LikeButton.d.ts +0 -5
  241. package/dist/components/prompts/LikeButton.js +0 -49
  242. package/dist/components/prompts/MuxPlayer.d.ts +0 -8
  243. package/dist/components/prompts/MuxPlayer.js +0 -21
  244. package/dist/components/prompts/NewBackButton.d.ts +0 -5
  245. package/dist/components/prompts/NewBackButton.js +0 -8
  246. package/dist/components/prompts/Page.d.ts +0 -8
  247. package/dist/components/prompts/Page.js +0 -7
  248. package/dist/components/prompts/PromptsGallery.d.ts +0 -7
  249. package/dist/components/prompts/PromptsGallery.js +0 -60
  250. package/dist/components/prompts/PromptsShow.d.ts +0 -5
  251. package/dist/components/prompts/PromptsShow.js +0 -17
  252. package/dist/components/prompts/PromptsSubmit.d.ts +0 -2
  253. package/dist/components/prompts/PromptsSubmit.js +0 -173
  254. package/dist/components/prompts/config.d.ts +0 -1
  255. package/dist/components/prompts/config.js +0 -1
  256. package/dist/components/prompts/prompt-helpers.d.ts +0 -8
  257. package/dist/components/prompts/prompt-helpers.js +0 -76
  258. package/dist/components/prompts/prompt-types.d.ts +0 -14
  259. package/dist/components/prompts/prompt-types.js +0 -0
  260. package/dist/components/prompts/use-heart-animation.d.ts +0 -5
  261. package/dist/components/prompts/use-heart-animation.js +0 -29
  262. package/dist/components/team/TeamCards.d.ts +0 -6
  263. package/dist/components/team/TeamCards.js +0 -19
  264. package/dist/components/team/TitleTeamCards.d.ts +0 -2
  265. package/dist/components/team/TitleTeamCards.js +0 -6
  266. package/dist/components/team.d.ts +0 -3
  267. package/dist/components/team.js +0 -14
  268. package/dist/components/template-modal-content.d.ts +0 -5
  269. package/dist/components/template-modal-content.js +0 -73
  270. package/dist/components/templates.d.ts +0 -2
  271. package/dist/components/templates.js +0 -27
  272. package/dist/helpers/mobile-layout.d.ts +0 -1
  273. package/dist/helpers/mobile-layout.js +0 -6
  274. package/dist/helpers/use-el-size.d.ts +0 -5
  275. package/dist/helpers/use-el-size.js +0 -40
  276. package/dist/main.d.ts +0 -1
  277. package/dist/main.js +0 -6
  278. package/dist/prompts-show.d.ts +0 -1
  279. package/dist/prompts-show.js +0 -20
  280. package/dist/prompts-submit.d.ts +0 -1
  281. package/dist/prompts-submit.js +0 -6
  282. package/dist/prompts.d.ts +0 -1
  283. package/dist/prompts.js +0 -6
  284. package/dist/team.d.ts +0 -1
@@ -40,12 +40,12 @@ __export(exports_vidstack_CZgUA94N, {
40
40
  waitTimeout: () => waitTimeout,
41
41
  waitIdlePeriod: () => waitIdlePeriod,
42
42
  useStateContext: () => useStateContext,
43
- useState: () => useState43,
43
+ useState: () => useState42,
44
44
  useSignalRecord: () => useSignalRecord,
45
45
  useSignal: () => useSignal,
46
46
  useReactScope: () => useReactScope,
47
47
  useReactContext: () => useReactContext,
48
- useContext: () => useContext45,
48
+ useContext: () => useContext44,
49
49
  uppercaseFirstChar: () => uppercaseFirstChar,
50
50
  untrack: () => untrack,
51
51
  toggleClass: () => toggleClass,
@@ -619,7 +619,7 @@ function provideContext(context, value, scope = getScope()) {
619
619
  const hasProvidedValue = !isUndefined(value);
620
620
  setContext(context.id, hasProvidedValue ? value : context.provide?.(), scope);
621
621
  }
622
- function useContext45(context) {
622
+ function useContext44(context) {
623
623
  const value = getContext(context.id);
624
624
  return value;
625
625
  }
@@ -678,8 +678,8 @@ class State {
678
678
  }
679
679
  }
680
680
  }
681
- function useState43(state) {
682
- return useContext45(state);
681
+ function useState42(state) {
682
+ return useContext44(state);
683
683
  }
684
684
  function camelToKebabCase(str) {
685
685
  return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
@@ -717,7 +717,7 @@ function composeRefs3(...refs) {
717
717
  return (node) => refs.forEach((ref) => setRef3(ref, node));
718
718
  }
719
719
  function createClientComponent(Component2, options2) {
720
- const forwardComponent = React54.forwardRef((props, forwardRef14) => {
720
+ const forwardComponent = React54.forwardRef((props, forwardRef15) => {
721
721
  let parentScopeRef = React54.useContext(ReactScopeContext), scopeRef = React54.useRef(null), stateRef = React54.useRef();
722
722
  if (!stateRef.current) {
723
723
  const state2 = createInternalState(), component = initComponent(Component2, state2, props, parentScopeRef.current);
@@ -740,7 +740,7 @@ function createClientComponent(Component2, options2) {
740
740
  attachToHost(state2, state2.el);
741
741
  }
742
742
  if (!state2.forwardRef) {
743
- setRef3(forwardRef14, state2.component);
743
+ setRef3(forwardRef15, state2.component);
744
744
  state2.forwardRef = true;
745
745
  }
746
746
  return () => detachFromHost(state2);
@@ -1061,7 +1061,7 @@ function createServerComponent(Component2, options2) {
1061
1061
  let scope = React54.useContext(ReactScopeContext), component = createComponent(Component2, {
1062
1062
  props,
1063
1063
  scope: scope.current
1064
- }), host = new MaverickServerElement(component), attrs = {}, { style = {}, children, forwardRef: forwardRef14, ...renderProps } = props;
1064
+ }), host = new MaverickServerElement(component), attrs = {}, { style = {}, children, forwardRef: forwardRef15, ...renderProps } = props;
1065
1065
  if (options2.props.size) {
1066
1066
  for (const prop2 of Object.keys(renderProps)) {
1067
1067
  if (!options2.props.has(prop2))
@@ -7061,7 +7061,7 @@ function boundTime(time, store) {
7061
7061
  return Math.min(Math.max(store.seekableStart() + 0.1, clippedTime), store.seekableEnd() - 0.1);
7062
7062
  }
7063
7063
  function useMediaContext() {
7064
- return useContext45(mediaContext);
7064
+ return useContext44(mediaContext);
7065
7065
  }
7066
7066
 
7067
7067
  class MediaRemoteControl {
@@ -13976,7 +13976,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
13976
13976
  if (!this.connectScope)
13977
13977
  return;
13978
13978
  this.#attach();
13979
- const tooltip = useContext45(tooltipContext);
13979
+ const tooltip = useContext44(tooltipContext);
13980
13980
  onDispose(() => {
13981
13981
  const button = this.#getButton();
13982
13982
  button && tooltip.detachTrigger(button);
@@ -13984,7 +13984,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
13984
13984
  }));
13985
13985
  }
13986
13986
  #attach() {
13987
- const button = this.#getButton(), tooltip = useContext45(tooltipContext);
13987
+ const button = this.#getButton(), tooltip = useContext44(tooltipContext);
13988
13988
  button && tooltip.attachTrigger(button);
13989
13989
  }
13990
13990
  #getButton() {
@@ -14017,7 +14017,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
14017
14017
  }
14018
14018
  onConnect(el) {
14019
14019
  this.#attach(el);
14020
- const tooltip = useContext45(tooltipContext);
14020
+ const tooltip = useContext44(tooltipContext);
14021
14021
  onDispose(() => tooltip.detachContent(el));
14022
14022
  onDispose(requestScopedAnimationFrame(() => {
14023
14023
  if (!this.connectScope)
@@ -14026,11 +14026,11 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
14026
14026
  }));
14027
14027
  }
14028
14028
  #attach(el) {
14029
- const tooltip = useContext45(tooltipContext);
14029
+ const tooltip = useContext44(tooltipContext);
14030
14030
  tooltip.attachContent(el);
14031
14031
  }
14032
14032
  #watchPlacement() {
14033
- const { showing } = useContext45(tooltipContext);
14033
+ const { showing } = useContext44(tooltipContext);
14034
14034
  if (!showing())
14035
14035
  return;
14036
14036
  const { placement, offset: mainOffset, alignOffset } = this.$props;
@@ -14041,7 +14041,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
14041
14041
  });
14042
14042
  }
14043
14043
  #getTrigger() {
14044
- return useContext45(tooltipContext).trigger();
14044
+ return useContext44(tooltipContext).trigger();
14045
14045
  }
14046
14046
  };
14047
14047
  ToggleButtonController = class ToggleButtonController extends ViewController {
@@ -14537,7 +14537,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
14537
14537
  }
14538
14538
  onSetup() {
14539
14539
  if (hasProvidedContext(sliderObserverContext)) {
14540
- this.#observer = useContext45(sliderObserverContext);
14540
+ this.#observer = useContext44(sliderObserverContext);
14541
14541
  }
14542
14542
  }
14543
14543
  onConnect(el) {
@@ -15039,7 +15039,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
15039
15039
  SliderThumbnail = class SliderThumbnail extends Thumbnail {
15040
15040
  #slider;
15041
15041
  onAttach(el) {
15042
- this.#slider = useState43(Slider.state);
15042
+ this.#slider = useState42(Slider.state);
15043
15043
  }
15044
15044
  getTime() {
15045
15045
  const { duration, clipStartTime } = this.media.$state;
@@ -15066,7 +15066,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
15066
15066
  }
15067
15067
  onSetup() {
15068
15068
  this.#media = useMediaContext();
15069
- this.#slider = useState43(Slider.state);
15069
+ this.#slider = useState42(Slider.state);
15070
15070
  this.#watchCrossOrigin();
15071
15071
  this.setAttributes({
15072
15072
  "data-loading": this.#isLoading.bind(this),
@@ -15152,8 +15152,8 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
15152
15152
  #text;
15153
15153
  #slider;
15154
15154
  onSetup() {
15155
- this.#slider = useState43(Slider.state);
15156
- this.#format = useContext45(sliderValueFormatContext);
15155
+ this.#slider = useState42(Slider.state);
15156
+ this.#format = useContext44(sliderValueFormatContext);
15157
15157
  this.#text = computed(this.getValueText.bind(this));
15158
15158
  }
15159
15159
  getValueText() {
@@ -15192,8 +15192,8 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
15192
15192
  };
15193
15193
  #slider;
15194
15194
  onSetup() {
15195
- this.#slider = useContext45(sliderContext);
15196
- const { active } = useState43(Slider.state);
15195
+ this.#slider = useContext44(sliderContext);
15196
+ const { active } = useState42(Slider.state);
15197
15197
  this.setAttributes({
15198
15198
  "data-visible": active
15199
15199
  });
@@ -15620,7 +15620,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
15620
15620
  }
15621
15621
  }
15622
15622
  #watchPreviewing() {
15623
- const player = this.#media.player.el, { preview } = useContext45(sliderContext);
15623
+ const player = this.#media.player.el, { preview } = useContext44(sliderContext);
15624
15624
  player && preview() && setAttribute(player, "data-preview", this.$state.active());
15625
15625
  }
15626
15626
  #seeking(time, event2) {
@@ -15734,7 +15734,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
15734
15734
  }
15735
15735
  onSetup() {
15736
15736
  this.#media = useMediaContext();
15737
- this.#sliderState = useState43(TimeSlider.state);
15737
+ this.#sliderState = useState42(TimeSlider.state);
15738
15738
  }
15739
15739
  onAttach(el) {
15740
15740
  watchActiveTextTrack(this.#media.textTracks, "chapters", this.#setTrack.bind(this));
@@ -16058,7 +16058,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
16058
16058
  closeMenu: this.close.bind(this)
16059
16059
  });
16060
16060
  if (hasProvidedContext(menuContext)) {
16061
- this.#parentMenu = useContext45(menuContext);
16061
+ this.#parentMenu = useContext44(menuContext);
16062
16062
  }
16063
16063
  this.#observeSliders();
16064
16064
  this.setAttributes({
@@ -16103,7 +16103,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
16103
16103
  this.#transitionCallbacks.clear();
16104
16104
  }
16105
16105
  #observeSliders() {
16106
- let sliderActiveTimer = -1, parentSliderObserver = hasProvidedContext(sliderObserverContext) ? useContext45(sliderObserverContext) : null;
16106
+ let sliderActiveTimer = -1, parentSliderObserver = hasProvidedContext(sliderObserverContext) ? useContext44(sliderObserverContext) : null;
16107
16107
  provideContext(sliderObserverContext, {
16108
16108
  onDragStart: () => {
16109
16109
  parentSliderObserver?.onDragStart?.();
@@ -16430,7 +16430,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
16430
16430
  new FocusVisibleController;
16431
16431
  }
16432
16432
  onSetup() {
16433
- this.#menu = useContext45(menuContext);
16433
+ this.#menu = useContext44(menuContext);
16434
16434
  }
16435
16435
  onAttach(el) {
16436
16436
  this.#menu.attachMenuButton(this);
@@ -16546,10 +16546,10 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
16546
16546
  });
16547
16547
  }
16548
16548
  onAttach(el) {
16549
- this.#menu = useContext45(menuContext);
16549
+ this.#menu = useContext44(menuContext);
16550
16550
  this.#menu.attachMenuItems(this);
16551
16551
  if (hasProvidedContext(menuPortalContext)) {
16552
- const portal = useContext45(menuPortalContext);
16552
+ const portal = useContext44(menuPortalContext);
16553
16553
  if (portal) {
16554
16554
  provideContext(menuPortalContext, null);
16555
16555
  portal.attach(el);
@@ -16724,12 +16724,12 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
16724
16724
  }
16725
16725
  #onDisconnect() {
16726
16726
  scoped(() => {
16727
- const group = useContext45(radioControllerContext);
16727
+ const group = useContext44(radioControllerContext);
16728
16728
  group.remove(this.#controller);
16729
16729
  }, this.connectScope);
16730
16730
  }
16731
16731
  #addToGroup() {
16732
- const group = useContext45(radioControllerContext);
16732
+ const group = useContext44(radioControllerContext);
16733
16733
  group.add(this.#controller);
16734
16734
  }
16735
16735
  #watchValue() {
@@ -17367,7 +17367,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
17367
17367
  });
17368
17368
 
17369
17369
  // ../design/dist/esm/index.mjs
17370
- import { useCallback as useCallback17, useRef as useRef22, useState as useState22 } from "react";
17370
+ import { useCallback as useCallback18, useRef as useRef22, useState as useState22 } from "react";
17371
17371
 
17372
17372
  // ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
17373
17373
  function r(e) {
@@ -18709,7 +18709,7 @@ var getDefaultConfig = () => {
18709
18709
  var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
18710
18710
 
18711
18711
  // ../design/dist/esm/index.mjs
18712
- import React5, { useEffect as useEffect19, useMemo as useMemo34, useState as useState20 } from "react";
18712
+ import React4, { useEffect as useEffect18, useMemo as useMemo36, useState as useState19 } from "react";
18713
18713
 
18714
18714
  // ../paths/dist/esm/index.mjs
18715
18715
  var cutLInstruction = ({
@@ -21486,46 +21486,7 @@ import { jsx as jsx6 } from "react/jsx-runtime";
21486
21486
  import { jsx as jsx7 } from "react/jsx-runtime";
21487
21487
  import { jsx as jsx8 } from "react/jsx-runtime";
21488
21488
  import { jsx as jsx9 } from "react/jsx-runtime";
21489
- var makeCircle = ({ radius }) => {
21490
- const instructions = [
21491
- {
21492
- type: "M",
21493
- x: radius,
21494
- y: 0
21495
- },
21496
- {
21497
- type: "a",
21498
- rx: radius,
21499
- ry: radius,
21500
- xAxisRotation: 0,
21501
- largeArcFlag: true,
21502
- sweepFlag: true,
21503
- dx: 0,
21504
- dy: radius * 2
21505
- },
21506
- {
21507
- type: "a",
21508
- rx: radius,
21509
- ry: radius,
21510
- xAxisRotation: 0,
21511
- largeArcFlag: true,
21512
- sweepFlag: true,
21513
- dx: 0,
21514
- dy: -radius * 2
21515
- },
21516
- {
21517
- type: "Z"
21518
- }
21519
- ];
21520
- const path = serializeInstructions(instructions);
21521
- return {
21522
- height: radius * 2,
21523
- width: radius * 2,
21524
- path,
21525
- instructions,
21526
- transformOrigin: `${radius} ${radius}`
21527
- };
21528
- };
21489
+ import { jsx as jsx10 } from "react/jsx-runtime";
21529
21490
  var doesReactSupportTransformOriginProperty = (version2) => {
21530
21491
  if (version2.includes("canary") || version2.includes("experimental")) {
21531
21492
  const last8Chars = parseInt(version2.slice(-8), 10);
@@ -21619,6 +21580,46 @@ var RenderSvg = ({
21619
21580
  ]
21620
21581
  });
21621
21582
  };
21583
+ var makeCircle = ({ radius }) => {
21584
+ const instructions = [
21585
+ {
21586
+ type: "M",
21587
+ x: radius,
21588
+ y: 0
21589
+ },
21590
+ {
21591
+ type: "a",
21592
+ rx: radius,
21593
+ ry: radius,
21594
+ xAxisRotation: 0,
21595
+ largeArcFlag: true,
21596
+ sweepFlag: true,
21597
+ dx: 0,
21598
+ dy: radius * 2
21599
+ },
21600
+ {
21601
+ type: "a",
21602
+ rx: radius,
21603
+ ry: radius,
21604
+ xAxisRotation: 0,
21605
+ largeArcFlag: true,
21606
+ sweepFlag: true,
21607
+ dx: 0,
21608
+ dy: -radius * 2
21609
+ },
21610
+ {
21611
+ type: "Z"
21612
+ }
21613
+ ];
21614
+ const path = serializeInstructions(instructions);
21615
+ return {
21616
+ height: radius * 2,
21617
+ width: radius * 2,
21618
+ path,
21619
+ instructions,
21620
+ transformOrigin: `${radius} ${radius}`
21621
+ };
21622
+ };
21622
21623
  var makeHeart = ({
21623
21624
  height,
21624
21625
  aspectRatio = 1.1,
@@ -21715,7 +21716,7 @@ var Heart = ({
21715
21716
  depthAdjustment = 0,
21716
21717
  ...props
21717
21718
  }) => {
21718
- return /* @__PURE__ */ jsx4(RenderSvg, {
21719
+ return /* @__PURE__ */ jsx5(RenderSvg, {
21719
21720
  ...makeHeart({
21720
21721
  aspectRatio,
21721
21722
  height,
@@ -23048,41 +23049,41 @@ var extrudeAndTransformElement = (options) => {
23048
23049
  // ../core/dist/esm/index.mjs
23049
23050
  import { createContext } from "react";
23050
23051
  import { createContext as createContext2, useContext } from "react";
23051
- import { jsx as jsx10 } from "react/jsx-runtime";
23052
+ import { jsx as jsx11 } from "react/jsx-runtime";
23052
23053
  import {
23053
23054
  forwardRef as forwardRef2,
23054
23055
  useContext as useContext13,
23055
- useEffect as useEffect2,
23056
- useMemo as useMemo10,
23057
- useState as useState5
23056
+ useEffect,
23057
+ useMemo as useMemo11,
23058
+ useState as useState4
23058
23059
  } from "react";
23059
23060
  import { forwardRef, useMemo as useMemo2 } from "react";
23060
23061
  import { jsx as jsx22 } from "react/jsx-runtime";
23061
23062
  import { useContext as useContext11, useMemo as useMemo8 } from "react";
23062
23063
  import { createContext as createContext3 } from "react";
23064
+ import { useContext as useContext7, useMemo as useMemo6 } from "react";
23063
23065
  import {
23064
- createContext as createContext9,
23066
+ createContext as createContext6,
23065
23067
  useLayoutEffect,
23066
- useMemo as useMemo6,
23068
+ useMemo as useMemo22,
23067
23069
  useRef,
23068
23070
  useState as useState2
23069
23071
  } from "react";
23070
- import { useContext as useContext5, useMemo as useMemo5 } from "react";
23071
- import { useContext as useContext2, useState } from "react";
23072
- import React2 from "react";
23073
- import { useContext as useContext4, useMemo as useMemo4 } from "react";
23072
+ import { createContext as createContext5, useCallback, useContext as useContext4 } from "react";
23074
23073
  import { createContext as createContext4 } from "react";
23075
- import { createContext as createContext6, createRef, useContext as useContext3, useMemo as useMemo3 } from "react";
23076
- import React3, {
23077
- createContext as createContext5,
23078
- useCallback,
23079
- useImperativeHandle,
23080
- useMemo as useMemo22
23081
- } from "react";
23074
+ import * as React2 from "react";
23075
+ import { useContext as useContext3, useState } from "react";
23076
+ import React3 from "react";
23082
23077
  import { jsx as jsx32 } from "react/jsx-runtime";
23083
- import { createContext as createContext8, useCallback as useCallback2, useContext as useContext7 } from "react";
23078
+ import { useContext as useContext6, useMemo as useMemo5 } from "react";
23084
23079
  import { createContext as createContext7 } from "react";
23085
- import * as React4 from "react";
23080
+ import { createContext as createContext9, createRef, useContext as useContext5, useMemo as useMemo4 } from "react";
23081
+ import React5, {
23082
+ createContext as createContext8,
23083
+ useCallback as useCallback2,
23084
+ useImperativeHandle,
23085
+ useMemo as useMemo3
23086
+ } from "react";
23086
23087
  import { jsx as jsx42 } from "react/jsx-runtime";
23087
23088
  import { useContext as useContext8 } from "react";
23088
23089
  import { createContext as createContext10 } from "react";
@@ -23090,114 +23091,114 @@ import { jsx as jsx52 } from "react/jsx-runtime";
23090
23091
  import { useContext as useContext10 } from "react";
23091
23092
  import { useContext as useContext9, useMemo as useMemo7 } from "react";
23092
23093
  import { jsx as jsx62 } from "react/jsx-runtime";
23093
- import { createContext as createContext11, useContext as useContext12, useEffect, useRef as useRef2, useState as useState3 } from "react";
23094
+ import { createContext as createContext11, useCallback as useCallback3, useContext as useContext12, useMemo as useMemo9, useRef as useRef2 } from "react";
23094
23095
  import { createContext as createContext12 } from "react";
23095
- import React8, { useCallback as useCallback3, useMemo as useMemo9, useRef as useRef3, useState as useState4 } from "react";
23096
+ import React8, { useCallback as useCallback4, useMemo as useMemo10, useRef as useRef3, useState as useState3 } from "react";
23096
23097
  import { jsx as jsx72 } from "react/jsx-runtime";
23097
23098
  import { jsx as jsx82 } from "react/jsx-runtime";
23098
23099
  import {
23099
23100
  forwardRef as forwardRef3,
23100
- useEffect as useEffect3,
23101
+ useEffect as useEffect2,
23101
23102
  useImperativeHandle as useImperativeHandle3,
23102
23103
  useLayoutEffect as useLayoutEffect2,
23103
23104
  useRef as useRef5,
23104
- useState as useState6
23105
+ useState as useState5
23105
23106
  } from "react";
23106
- import React10, { useCallback as useCallback4, useImperativeHandle as useImperativeHandle2, useRef as useRef4 } from "react";
23107
+ import React10, { useCallback as useCallback5, useImperativeHandle as useImperativeHandle2, useRef as useRef4 } from "react";
23107
23108
  import { jsx as jsx92 } from "react/jsx-runtime";
23108
23109
  import { jsx as jsx102 } from "react/jsx-runtime";
23109
- import { useContext as useContext14, useLayoutEffect as useLayoutEffect4, useState as useState8 } from "react";
23110
+ import { useContext as useContext14, useLayoutEffect as useLayoutEffect4, useState as useState7 } from "react";
23110
23111
  import {
23111
23112
  createContext as createContext13,
23112
- useCallback as useCallback5,
23113
+ useCallback as useCallback6,
23113
23114
  useImperativeHandle as useImperativeHandle4,
23114
23115
  useLayoutEffect as useLayoutEffect3,
23115
- useMemo as useMemo11,
23116
+ useMemo as useMemo12,
23116
23117
  useRef as useRef6,
23117
- useState as useState7
23118
+ useState as useState6
23118
23119
  } from "react";
23119
- import { jsx as jsx11 } from "react/jsx-runtime";
23120
- import { forwardRef as forwardRef6, useCallback as useCallback10, useContext as useContext27 } from "react";
23121
- import React11, { createContext as createContext14, useMemo as useMemo12 } from "react";
23120
+ import { jsx as jsx112 } from "react/jsx-runtime";
23121
+ import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext26 } from "react";
23122
+ import React11, { createContext as createContext14, useMemo as useMemo13 } from "react";
23122
23123
  import { jsx as jsx12 } from "react/jsx-runtime";
23123
23124
  import { useContext as useContext15 } from "react";
23124
- import { createContext as createContext15, useEffect as useEffect4, useState as useState9 } from "react";
23125
+ import { createContext as createContext15, useEffect as useEffect3, useState as useState8 } from "react";
23125
23126
  import { jsx as jsx13 } from "react/jsx-runtime";
23126
- import { createContext as createContext16, useMemo as useMemo13, useReducer } from "react";
23127
+ import { createContext as createContext16, useMemo as useMemo14, useReducer } from "react";
23127
23128
  import { jsx as jsx14 } from "react/jsx-runtime";
23128
23129
  import React17, {
23129
23130
  forwardRef as forwardRef4,
23130
- useContext as useContext25,
23131
- useEffect as useEffect11,
23131
+ useContext as useContext24,
23132
+ useEffect as useEffect10,
23132
23133
  useImperativeHandle as useImperativeHandle5,
23133
- useMemo as useMemo21,
23134
+ useMemo as useMemo222,
23134
23135
  useRef as useRef14,
23135
- useState as useState14
23136
+ useState as useState13
23136
23137
  } from "react";
23137
23138
  import { useContext as useContext17, useLayoutEffect as useLayoutEffect5, useRef as useRef9 } from "react";
23138
23139
  import React14, {
23139
23140
  createContext as createContext17,
23140
23141
  createRef as createRef2,
23141
- useCallback as useCallback6,
23142
+ useCallback as useCallback7,
23142
23143
  useContext as useContext16,
23143
- useMemo as useMemo15,
23144
+ useMemo as useMemo16,
23144
23145
  useRef as useRef7,
23145
- useState as useState10
23146
+ useState as useState9
23146
23147
  } from "react";
23147
- import { useMemo as useMemo14 } from "react";
23148
+ import { useMemo as useMemo15 } from "react";
23148
23149
  import { jsx as jsx15, jsxs as jsxs2 } from "react/jsx-runtime";
23149
23150
  import { useRef as useRef8 } from "react";
23150
- import { useContext as useContext19, useEffect as useEffect5, useMemo as useMemo16, useState as useState11 } from "react";
23151
+ import { useContext as useContext19, useEffect as useEffect4, useMemo as useMemo17, useState as useState10 } from "react";
23151
23152
  import { useContext as useContext18 } from "react";
23152
23153
  import {
23153
- useCallback as useCallback9,
23154
+ useCallback as useCallback10,
23154
23155
  useContext as useContext22,
23155
- useEffect as useEffect9,
23156
+ useEffect as useEffect8,
23156
23157
  useLayoutEffect as useLayoutEffect7,
23157
23158
  useRef as useRef13
23158
23159
  } from "react";
23159
- import { useCallback as useCallback8, useMemo as useMemo19, useRef as useRef11 } from "react";
23160
- import { useContext as useContext21, useMemo as useMemo18 } from "react";
23160
+ import { useCallback as useCallback9, useMemo as useMemo20, useRef as useRef11 } from "react";
23161
+ import { useContext as useContext21, useMemo as useMemo19 } from "react";
23161
23162
  import React15, {
23162
- useCallback as useCallback7,
23163
+ useCallback as useCallback8,
23163
23164
  useContext as useContext20,
23164
- useEffect as useEffect6,
23165
+ useEffect as useEffect5,
23165
23166
  useLayoutEffect as useLayoutEffect6,
23166
- useMemo as useMemo17,
23167
+ useMemo as useMemo18,
23167
23168
  useRef as useRef10,
23168
- useState as useState12
23169
+ useState as useState11
23169
23170
  } from "react";
23170
23171
  import { jsx as jsx16 } from "react/jsx-runtime";
23171
23172
  import React16 from "react";
23172
- import { useEffect as useEffect7, useState as useState13 } from "react";
23173
- import { useEffect as useEffect8, useRef as useRef12 } from "react";
23174
- import { useContext as useContext23, useEffect as useEffect10 } from "react";
23175
- import { createContext as createContext18, useContext as useContext24, useMemo as useMemo20 } from "react";
23173
+ import { useEffect as useEffect6, useState as useState12 } from "react";
23174
+ import { useEffect as useEffect7, useRef as useRef12 } from "react";
23175
+ import { useEffect as useEffect9 } from "react";
23176
+ import { createContext as createContext18, useContext as useContext23, useMemo as useMemo21 } from "react";
23176
23177
  import { jsx as jsx17 } from "react/jsx-runtime";
23177
23178
  import {
23178
23179
  forwardRef as forwardRef5,
23179
- useContext as useContext26,
23180
- useEffect as useEffect12,
23180
+ useContext as useContext25,
23181
+ useEffect as useEffect11,
23181
23182
  useImperativeHandle as useImperativeHandle6,
23182
23183
  useLayoutEffect as useLayoutEffect8,
23183
- useMemo as useMemo222,
23184
+ useMemo as useMemo23,
23184
23185
  useRef as useRef15
23185
23186
  } from "react";
23186
23187
  import { jsx as jsx18 } from "react/jsx-runtime";
23187
23188
  import { jsx as jsx19 } from "react/jsx-runtime";
23188
- import { Suspense, useContext as useContext29, useEffect as useEffect14 } from "react";
23189
+ import { Suspense, useContext as useContext28, useEffect as useEffect13 } from "react";
23189
23190
  import { createPortal } from "react-dom";
23190
- import { createContext as createContext19, useContext as useContext28, useEffect as useEffect13, useMemo as useMemo23 } from "react";
23191
+ import { createContext as createContext19, useContext as useContext27, useEffect as useEffect12, useMemo as useMemo24 } from "react";
23191
23192
  import { jsx as jsx20 } from "react/jsx-runtime";
23192
23193
  import { jsx as jsx21, jsxs as jsxs22 } from "react/jsx-runtime";
23193
- import React20, { useMemo as useMemo24, useRef as useRef16 } from "react";
23194
+ import React20, { useMemo as useMemo25, useRef as useRef16 } from "react";
23194
23195
  import { jsx as jsx222 } from "react/jsx-runtime";
23195
- import { forwardRef as forwardRef7, useCallback as useCallback11, useState as useState15 } from "react";
23196
+ import { forwardRef as forwardRef7, useCallback as useCallback12, useState as useState14 } from "react";
23196
23197
  import { jsx as jsx23 } from "react/jsx-runtime";
23197
23198
  import {
23198
23199
  forwardRef as forwardRef8,
23199
- useCallback as useCallback12,
23200
- useContext as useContext30,
23200
+ useCallback as useCallback13,
23201
+ useContext as useContext29,
23201
23202
  useImperativeHandle as useImperativeHandle7,
23202
23203
  useLayoutEffect as useLayoutEffect9,
23203
23204
  useRef as useRef17
@@ -23206,59 +23207,61 @@ import { jsx as jsx24 } from "react/jsx-runtime";
23206
23207
  import { createRef as createRef3 } from "react";
23207
23208
  import React24 from "react";
23208
23209
  import {
23209
- useCallback as useCallback13,
23210
+ useCallback as useCallback14,
23210
23211
  useImperativeHandle as useImperativeHandle8,
23211
- useMemo as useMemo25,
23212
+ useMemo as useMemo26,
23212
23213
  useRef as useRef18,
23213
- useState as useState16
23214
+ useState as useState15
23214
23215
  } from "react";
23215
23216
  import { jsx as jsx25 } from "react/jsx-runtime";
23216
23217
  import React25 from "react";
23217
- import { useMemo as useMemo27 } from "react";
23218
- import { createContext as createContext20, useContext as useContext31, useMemo as useMemo26 } from "react";
23218
+ import { useMemo as useMemo28 } from "react";
23219
+ import { createContext as createContext20, useContext as useContext30, useMemo as useMemo27 } from "react";
23219
23220
  import { jsx as jsx26 } from "react/jsx-runtime";
23220
23221
  import { jsx as jsx27 } from "react/jsx-runtime";
23221
- import React27, { createContext as createContext21 } from "react";
23222
- import { useContext as useContext32, useMemo as useMemo28, useState as useState17 } from "react";
23223
- import { useContext as useContext33 } from "react";
23224
- import { useCallback as useCallback15 } from "react";
23222
+ import React27 from "react";
23223
+ import React28, { createContext as createContext21 } from "react";
23224
+ import { useContext as useContext31, useMemo as useMemo29, useState as useState16 } from "react";
23225
+ import { useContext as useContext32 } from "react";
23226
+ import { useCallback as useCallback16 } from "react";
23225
23227
  import {
23226
- useCallback as useCallback14,
23227
- useContext as useContext34,
23228
- useEffect as useEffect15,
23228
+ useCallback as useCallback15,
23229
+ useContext as useContext33,
23230
+ useEffect as useEffect14,
23229
23231
  useLayoutEffect as useLayoutEffect10,
23230
- useMemo as useMemo29,
23231
- useState as useState18
23232
+ useMemo as useMemo30,
23233
+ useState as useState17
23232
23234
  } from "react";
23233
23235
  import { jsx as jsx28 } from "react/jsx-runtime";
23234
- import React29, {
23236
+ import React30, {
23235
23237
  forwardRef as forwardRef9,
23236
- useContext as useContext35,
23237
- useEffect as useEffect17,
23238
+ useContext as useContext34,
23239
+ useEffect as useEffect16,
23238
23240
  useImperativeHandle as useImperativeHandle9,
23239
- useMemo as useMemo30,
23241
+ useMemo as useMemo31,
23240
23242
  useRef as useRef19,
23241
- useState as useState19
23243
+ useState as useState18
23242
23244
  } from "react";
23243
- import { useEffect as useEffect16 } from "react";
23245
+ import { useEffect as useEffect15 } from "react";
23244
23246
  import { jsx as jsx29 } from "react/jsx-runtime";
23245
23247
  import { jsx as jsx30 } from "react/jsx-runtime";
23246
- import React31, { useMemo as useMemo31 } from "react";
23248
+ import React32, { forwardRef as forwardRef10, useMemo as useMemo32 } from "react";
23249
+ import React33, { useMemo as useMemo33 } from "react";
23247
23250
  import { jsx as jsx31 } from "react/jsx-runtime";
23248
- import { Children, forwardRef as forwardRef10, useMemo as useMemo32 } from "react";
23249
- import React32 from "react";
23250
- import React33, { createContext as createContext22 } from "react";
23251
+ import { Children, forwardRef as forwardRef11, useMemo as useMemo34 } from "react";
23252
+ import React34 from "react";
23253
+ import React35, { createContext as createContext22 } from "react";
23251
23254
  import { jsx as jsx322 } from "react/jsx-runtime";
23252
23255
  import { jsx as jsx33 } from "react/jsx-runtime";
23253
- import React35 from "react";
23254
- import { forwardRef as forwardRef12, useCallback as useCallback16, useContext as useContext37 } from "react";
23256
+ import React37 from "react";
23257
+ import { forwardRef as forwardRef13, useCallback as useCallback17, useContext as useContext36 } from "react";
23255
23258
  import {
23256
- forwardRef as forwardRef11,
23257
- useContext as useContext36,
23258
- useEffect as useEffect18,
23259
+ forwardRef as forwardRef12,
23260
+ useContext as useContext35,
23261
+ useEffect as useEffect17,
23259
23262
  useImperativeHandle as useImperativeHandle10,
23260
23263
  useLayoutEffect as useLayoutEffect11,
23261
- useMemo as useMemo33,
23264
+ useMemo as useMemo35,
23262
23265
  useRef as useRef20
23263
23266
  } from "react";
23264
23267
  import { jsx as jsx34 } from "react/jsx-runtime";
@@ -23297,7 +23300,7 @@ var IsPlayerContext = createContext2(false);
23297
23300
  var IsPlayerContextProvider = ({
23298
23301
  children
23299
23302
  }) => {
23300
- return /* @__PURE__ */ jsx10(IsPlayerContext.Provider, {
23303
+ return /* @__PURE__ */ jsx11(IsPlayerContext.Provider, {
23301
23304
  value: true,
23302
23305
  children
23303
23306
  });
@@ -23308,7 +23311,7 @@ var useIsPlayer = () => {
23308
23311
  function truthy2(value) {
23309
23312
  return Boolean(value);
23310
23313
  }
23311
- var VERSION = "4.0.431";
23314
+ var VERSION = "4.0.433";
23312
23315
  var checkMultipleRemotionVersions = () => {
23313
23316
  if (typeof globalThis === "undefined") {
23314
23317
  return;
@@ -23429,6 +23432,17 @@ var AbsoluteFillRefForwarding = (props, ref) => {
23429
23432
  };
23430
23433
  var AbsoluteFill = forwardRef(AbsoluteFillRefForwarding);
23431
23434
  var SequenceContext = createContext3(null);
23435
+ var exports_timeline_position_state = {};
23436
+ __export2(exports_timeline_position_state, {
23437
+ useTimelineSetFrame: () => useTimelineSetFrame,
23438
+ useTimelinePosition: () => useTimelinePosition,
23439
+ useTimelineContext: () => useTimelineContext,
23440
+ usePlayingState: () => usePlayingState,
23441
+ useAbsoluteTimelinePosition: () => useAbsoluteTimelinePosition,
23442
+ persistCurrentFrame: () => persistCurrentFrame,
23443
+ getInitialFrameState: () => getInitialFrameState,
23444
+ getFrameForComposition: () => getFrameForComposition
23445
+ });
23432
23446
  function mulberry32(a) {
23433
23447
  let t = a + 1831565813;
23434
23448
  t = Math.imul(t ^ t >>> 15, t | 1);
@@ -23461,15 +23475,55 @@ var random = (seed, dummy) => {
23461
23475
  }
23462
23476
  throw new Error("random() argument must be a number or a string");
23463
23477
  };
23464
- var exports_timeline_position_state = {};
23465
- __export2(exports_timeline_position_state, {
23466
- useTimelineSetFrame: () => useTimelineSetFrame,
23467
- useTimelinePosition: () => useTimelinePosition,
23468
- usePlayingState: () => usePlayingState,
23469
- persistCurrentFrame: () => persistCurrentFrame,
23470
- getInitialFrameState: () => getInitialFrameState,
23471
- getFrameForComposition: () => getFrameForComposition
23472
- });
23478
+ var getErrorStackWithMessage = (error) => {
23479
+ const stack = error.stack ?? "";
23480
+ return stack.startsWith("Error:") ? stack : `${error.message}
23481
+ ${stack}`;
23482
+ };
23483
+ var isErrorLike = (err) => {
23484
+ if (err instanceof Error) {
23485
+ return true;
23486
+ }
23487
+ if (err === null) {
23488
+ return false;
23489
+ }
23490
+ if (typeof err !== "object") {
23491
+ return false;
23492
+ }
23493
+ if (!("stack" in err)) {
23494
+ return false;
23495
+ }
23496
+ if (typeof err.stack !== "string") {
23497
+ return false;
23498
+ }
23499
+ if (!("message" in err)) {
23500
+ return false;
23501
+ }
23502
+ if (typeof err.message !== "string") {
23503
+ return false;
23504
+ }
23505
+ return true;
23506
+ };
23507
+ function cancelRenderInternal(scope, err) {
23508
+ let error;
23509
+ if (isErrorLike(err)) {
23510
+ error = err;
23511
+ if (!error.stack) {
23512
+ error.stack = new Error(error.message).stack;
23513
+ }
23514
+ } else if (typeof err === "string") {
23515
+ error = Error(err);
23516
+ } else {
23517
+ error = Error("Rendering was cancelled");
23518
+ }
23519
+ if (scope) {
23520
+ scope.remotion_cancelledError = getErrorStackWithMessage(error);
23521
+ }
23522
+ throw error;
23523
+ }
23524
+ function cancelRender(err) {
23525
+ return cancelRenderInternal(typeof window !== "undefined" ? window : undefined, err);
23526
+ }
23473
23527
  function getNodeEnvString() {
23474
23528
  return ["NOD", "E_EN", "V"].join("");
23475
23529
  }
@@ -23489,19 +23543,280 @@ var getRemotionEnvironment = () => {
23489
23543
  isClientSideRendering: false
23490
23544
  };
23491
23545
  };
23492
- var RemotionEnvironmentContext = React2.createContext(null);
23546
+ var logLevels = ["trace", "verbose", "info", "warn", "error"];
23547
+ var getNumberForLogLevel = (level) => {
23548
+ return logLevels.indexOf(level);
23549
+ };
23550
+ var isEqualOrBelowLogLevel = (currentLevel, level) => {
23551
+ return getNumberForLogLevel(currentLevel) <= getNumberForLogLevel(level);
23552
+ };
23553
+ var transformArgs = ({
23554
+ args,
23555
+ logLevel,
23556
+ tag
23557
+ }) => {
23558
+ const arr = [...args];
23559
+ if (getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
23560
+ arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
23561
+ }
23562
+ if (tag && getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
23563
+ arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
23564
+ }
23565
+ return arr;
23566
+ };
23567
+ var verbose = (options, ...args) => {
23568
+ if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
23569
+ return console.debug(...transformArgs({ args, logLevel: "verbose", tag: options.tag }));
23570
+ }
23571
+ };
23572
+ var trace = (options, ...args) => {
23573
+ if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
23574
+ return console.debug(...transformArgs({ args, logLevel: "trace", tag: options.tag }));
23575
+ }
23576
+ };
23577
+ var info = (options, ...args) => {
23578
+ if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
23579
+ return console.log(...transformArgs({ args, logLevel: "info", tag: options.tag }));
23580
+ }
23581
+ };
23582
+ var warn = (options, ...args) => {
23583
+ if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
23584
+ return console.warn(...transformArgs({ args, logLevel: "warn", tag: options.tag }));
23585
+ }
23586
+ };
23587
+ var error = (options, ...args) => {
23588
+ return console.error(...transformArgs({ args, logLevel: "error", tag: options.tag }));
23589
+ };
23590
+ var Log = {
23591
+ trace,
23592
+ verbose,
23593
+ info,
23594
+ warn,
23595
+ error
23596
+ };
23597
+ if (typeof window !== "undefined") {
23598
+ window.remotion_renderReady = false;
23599
+ if (!window.remotion_delayRenderTimeouts) {
23600
+ window.remotion_delayRenderTimeouts = {};
23601
+ }
23602
+ window.remotion_delayRenderHandles = [];
23603
+ }
23604
+ var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
23605
+ var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
23606
+ var DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
23607
+ var DELAY_RENDER_CLEAR_TOKEN = "handle was cleared after";
23608
+ var defaultTimeout = 30000;
23609
+ var delayRenderInternal = ({
23610
+ scope,
23611
+ environment,
23612
+ label,
23613
+ options
23614
+ }) => {
23615
+ if (typeof label !== "string" && label !== null) {
23616
+ throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label));
23617
+ }
23618
+ const handle = Math.random();
23619
+ scope.remotion_delayRenderHandles.push(handle);
23620
+ const called = Error().stack?.replace(/^Error/g, "") ?? "";
23621
+ if (environment.isRendering) {
23622
+ const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
23623
+ const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
23624
+ scope.remotion_delayRenderTimeouts[handle] = {
23625
+ label: label ?? null,
23626
+ startTime: Date.now(),
23627
+ timeout: setTimeout(() => {
23628
+ const message = [
23629
+ `A delayRender()`,
23630
+ label ? `"${label}"` : null,
23631
+ `was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
23632
+ retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
23633
+ retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
23634
+ DELAY_RENDER_CALLSTACK_TOKEN,
23635
+ called
23636
+ ].filter(truthy2).join(" ");
23637
+ if (environment.isClientSideRendering) {
23638
+ scope.remotion_cancelledError = getErrorStackWithMessage(Error(message));
23639
+ } else {
23640
+ cancelRenderInternal(scope, Error(message));
23641
+ }
23642
+ }, timeoutToUse)
23643
+ };
23644
+ }
23645
+ scope.remotion_renderReady = false;
23646
+ return handle;
23647
+ };
23648
+ var continueRenderInternal = ({
23649
+ scope,
23650
+ handle,
23651
+ environment,
23652
+ logLevel
23653
+ }) => {
23654
+ if (typeof handle === "undefined") {
23655
+ throw new TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");
23656
+ }
23657
+ if (typeof handle !== "number") {
23658
+ throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: " + JSON.stringify(handle));
23659
+ }
23660
+ scope.remotion_delayRenderHandles = scope.remotion_delayRenderHandles.filter((h) => {
23661
+ if (h === handle) {
23662
+ if (environment.isRendering && scope !== undefined) {
23663
+ if (!scope.remotion_delayRenderTimeouts[handle]) {
23664
+ return false;
23665
+ }
23666
+ const { label, startTime, timeout } = scope.remotion_delayRenderTimeouts[handle];
23667
+ clearTimeout(timeout);
23668
+ const message = [
23669
+ label ? `"${label}"` : "A handle",
23670
+ DELAY_RENDER_CLEAR_TOKEN,
23671
+ `${Date.now() - startTime}ms`
23672
+ ].filter(truthy2).join(" ");
23673
+ Log.verbose({ logLevel, tag: "delayRender()" }, message);
23674
+ delete scope.remotion_delayRenderTimeouts[handle];
23675
+ }
23676
+ return false;
23677
+ }
23678
+ return true;
23679
+ });
23680
+ if (scope.remotion_delayRenderHandles.length === 0) {
23681
+ scope.remotion_renderReady = true;
23682
+ }
23683
+ };
23684
+ var LogLevelContext = createContext4({
23685
+ logLevel: "info",
23686
+ mountTime: 0
23687
+ });
23688
+ var useLogLevel = () => {
23689
+ const { logLevel } = React2.useContext(LogLevelContext);
23690
+ if (logLevel === null) {
23691
+ throw new Error("useLogLevel must be used within a LogLevelProvider");
23692
+ }
23693
+ return logLevel;
23694
+ };
23695
+ var useMountTime = () => {
23696
+ const { mountTime } = React2.useContext(LogLevelContext);
23697
+ if (mountTime === null) {
23698
+ throw new Error("useMountTime must be used within a LogLevelProvider");
23699
+ }
23700
+ return mountTime;
23701
+ };
23702
+ var RemotionEnvironmentContext = React3.createContext(null);
23493
23703
  var useRemotionEnvironment = () => {
23494
- const context = useContext2(RemotionEnvironmentContext);
23704
+ const context = useContext3(RemotionEnvironmentContext);
23495
23705
  const [env] = useState(() => getRemotionEnvironment());
23496
23706
  return context ?? env;
23497
23707
  };
23498
- var CompositionManager = createContext4({
23708
+ var DelayRenderContextType = createContext5(null);
23709
+ var useDelayRender = () => {
23710
+ const environment = useRemotionEnvironment();
23711
+ const scope = useContext4(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
23712
+ const logLevel = useLogLevel();
23713
+ const delayRender2 = useCallback((label, options) => {
23714
+ if (!scope) {
23715
+ return Math.random();
23716
+ }
23717
+ return delayRenderInternal({
23718
+ scope,
23719
+ environment,
23720
+ label: label ?? null,
23721
+ options: options ?? {}
23722
+ });
23723
+ }, [environment, scope]);
23724
+ const continueRender2 = useCallback((handle) => {
23725
+ if (!scope) {
23726
+ return;
23727
+ }
23728
+ continueRenderInternal({
23729
+ scope,
23730
+ handle,
23731
+ environment,
23732
+ logLevel
23733
+ });
23734
+ }, [environment, logLevel, scope]);
23735
+ const cancelRender2 = useCallback((err) => {
23736
+ return cancelRenderInternal(scope ?? (typeof window !== "undefined" ? window : undefined), err);
23737
+ }, [scope]);
23738
+ return { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 };
23739
+ };
23740
+ var SetTimelineContext = createContext6({
23741
+ setFrame: () => {
23742
+ throw new Error("default");
23743
+ },
23744
+ setPlaying: () => {
23745
+ throw new Error("default");
23746
+ }
23747
+ });
23748
+ var TimelineContext = createContext6(null);
23749
+ var AbsoluteTimeContext = createContext6(null);
23750
+ var TimelineContextProvider = ({ children, frameState }) => {
23751
+ const [playing, setPlaying] = useState2(false);
23752
+ const imperativePlaying = useRef(false);
23753
+ const [playbackRate, setPlaybackRate] = useState2(1);
23754
+ const audioAndVideoTags = useRef([]);
23755
+ const [remotionRootId] = useState2(() => String(random(null)));
23756
+ const [_frame, setFrame] = useState2(() => getInitialFrameState());
23757
+ const frame = frameState ?? _frame;
23758
+ const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
23759
+ if (typeof window !== "undefined") {
23760
+ useLayoutEffect(() => {
23761
+ window.remotion_setFrame = (f, composition, attempt) => {
23762
+ window.remotion_attempt = attempt;
23763
+ const id = delayRender2(`Setting the current frame to ${f}`);
23764
+ let asyncUpdate = true;
23765
+ setFrame((s) => {
23766
+ const currentFrame = s[composition] ?? window.remotion_initialFrame;
23767
+ if (currentFrame === f) {
23768
+ asyncUpdate = false;
23769
+ return s;
23770
+ }
23771
+ return {
23772
+ ...s,
23773
+ [composition]: f
23774
+ };
23775
+ });
23776
+ if (asyncUpdate) {
23777
+ requestAnimationFrame(() => continueRender2(id));
23778
+ } else {
23779
+ continueRender2(id);
23780
+ }
23781
+ };
23782
+ window.remotion_isPlayer = false;
23783
+ }, [continueRender2, delayRender2]);
23784
+ }
23785
+ const timelineContextValue = useMemo22(() => {
23786
+ return {
23787
+ frame,
23788
+ playing,
23789
+ imperativePlaying,
23790
+ rootId: remotionRootId,
23791
+ playbackRate,
23792
+ setPlaybackRate,
23793
+ audioAndVideoTags
23794
+ };
23795
+ }, [frame, playbackRate, playing, remotionRootId]);
23796
+ const setTimelineContextValue = useMemo22(() => {
23797
+ return {
23798
+ setFrame,
23799
+ setPlaying
23800
+ };
23801
+ }, []);
23802
+ return /* @__PURE__ */ jsx32(AbsoluteTimeContext.Provider, {
23803
+ value: timelineContextValue,
23804
+ children: /* @__PURE__ */ jsx32(TimelineContext.Provider, {
23805
+ value: timelineContextValue,
23806
+ children: /* @__PURE__ */ jsx32(SetTimelineContext.Provider, {
23807
+ value: setTimelineContextValue,
23808
+ children
23809
+ })
23810
+ })
23811
+ });
23812
+ };
23813
+ var CompositionManager = createContext7({
23499
23814
  compositions: [],
23500
23815
  folders: [],
23501
23816
  currentCompositionMetadata: null,
23502
23817
  canvasContent: null
23503
23818
  });
23504
- var CompositionSetters = createContext4({
23819
+ var CompositionSetters = createContext7({
23505
23820
  registerComposition: () => {
23506
23821
  return;
23507
23822
  },
@@ -23635,7 +23950,7 @@ var getInputProps = () => {
23635
23950
  const parsed = deserializeJSONWithSpecialTypes(param);
23636
23951
  return parsed;
23637
23952
  };
23638
- var EditorPropsContext = createContext5({
23953
+ var EditorPropsContext = createContext8({
23639
23954
  props: {},
23640
23955
  updateProps: () => {
23641
23956
  throw new Error("Not implemented");
@@ -23644,11 +23959,11 @@ var EditorPropsContext = createContext5({
23644
23959
  throw new Error("Not implemented");
23645
23960
  }
23646
23961
  });
23647
- var editorPropsProviderRef = React3.createRef();
23648
- var timeValueRef = React3.createRef();
23962
+ var editorPropsProviderRef = React5.createRef();
23963
+ var timeValueRef = React5.createRef();
23649
23964
  var EditorPropsProvider = ({ children }) => {
23650
- const [props, setProps] = React3.useState({});
23651
- const updateProps = useCallback(({
23965
+ const [props, setProps] = React5.useState({});
23966
+ const updateProps = useCallback2(({
23652
23967
  defaultProps,
23653
23968
  id,
23654
23969
  newProps
@@ -23660,7 +23975,7 @@ var EditorPropsProvider = ({ children }) => {
23660
23975
  };
23661
23976
  });
23662
23977
  }, []);
23663
- const resetUnsaved = useCallback((compositionId) => {
23978
+ const resetUnsaved = useCallback2((compositionId) => {
23664
23979
  setProps((prev) => {
23665
23980
  if (prev[compositionId]) {
23666
23981
  const newProps = { ...prev };
@@ -23676,10 +23991,10 @@ var EditorPropsProvider = ({ children }) => {
23676
23991
  setProps
23677
23992
  };
23678
23993
  }, [props]);
23679
- const ctx = useMemo22(() => {
23994
+ const ctx = useMemo3(() => {
23680
23995
  return { props, updateProps, resetUnsaved };
23681
23996
  }, [props, resetUnsaved, updateProps]);
23682
- return /* @__PURE__ */ jsx32(EditorPropsContext.Provider, {
23997
+ return /* @__PURE__ */ jsx42(EditorPropsContext.Provider, {
23683
23998
  value: ctx,
23684
23999
  children
23685
24000
  });
@@ -23736,24 +24051,24 @@ function validateFps(fps, location2, isGif) {
23736
24051
  throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
23737
24052
  }
23738
24053
  }
23739
- var ResolveCompositionContext = createContext6(null);
24054
+ var ResolveCompositionContext = createContext9(null);
23740
24055
  var resolveCompositionsRef = createRef();
23741
24056
  var needsResolution = (composition) => {
23742
24057
  return Boolean(composition.calculateMetadata);
23743
24058
  };
23744
24059
  var PROPS_UPDATED_EXTERNALLY = "remotion.propsUpdatedExternally";
23745
24060
  var useResolvedVideoConfig = (preferredCompositionId) => {
23746
- const context = useContext3(ResolveCompositionContext);
23747
- const { props: allEditorProps } = useContext3(EditorPropsContext);
23748
- const { compositions, canvasContent, currentCompositionMetadata } = useContext3(CompositionManager);
24061
+ const context = useContext5(ResolveCompositionContext);
24062
+ const { props: allEditorProps } = useContext5(EditorPropsContext);
24063
+ const { compositions, canvasContent, currentCompositionMetadata } = useContext5(CompositionManager);
23749
24064
  const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
23750
24065
  const compositionId = preferredCompositionId ?? currentComposition;
23751
24066
  const composition = compositions.find((c) => c.id === compositionId);
23752
- const selectedEditorProps = useMemo3(() => {
24067
+ const selectedEditorProps = useMemo4(() => {
23753
24068
  return composition ? allEditorProps[composition.id] ?? {} : {};
23754
24069
  }, [allEditorProps, composition]);
23755
24070
  const env = useRemotionEnvironment();
23756
- return useMemo3(() => {
24071
+ return useMemo4(() => {
23757
24072
  if (!composition) {
23758
24073
  return null;
23759
24074
  }
@@ -23813,12 +24128,12 @@ var useResolvedVideoConfig = (preferredCompositionId) => {
23813
24128
  ]);
23814
24129
  };
23815
24130
  var useVideo = () => {
23816
- const { canvasContent, compositions, currentCompositionMetadata } = useContext4(CompositionManager);
24131
+ const { canvasContent, compositions, currentCompositionMetadata } = useContext6(CompositionManager);
23817
24132
  const selected = compositions.find((c) => {
23818
24133
  return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
23819
24134
  });
23820
24135
  const resolved = useResolvedVideoConfig(selected?.id ?? null);
23821
- return useMemo4(() => {
24136
+ return useMemo5(() => {
23822
24137
  if (!resolved) {
23823
24138
  return null;
23824
24139
  }
@@ -23862,9 +24177,8 @@ var getFrameForComposition = (composition) => {
23862
24177
  }
23863
24178
  return window.remotion_initialFrame ?? 0;
23864
24179
  };
23865
- var useTimelinePosition = () => {
24180
+ var useTimelinePositionFromContext = (state) => {
23866
24181
  const videoConfig = useVideo();
23867
- const state = useContext5(TimelineContext);
23868
24182
  const env = useRemotionEnvironment();
23869
24183
  if (!videoConfig) {
23870
24184
  return typeof window === "undefined" ? 0 : window.remotion_initialFrame ?? 0;
@@ -23872,332 +24186,32 @@ var useTimelinePosition = () => {
23872
24186
  const unclamped = state.frame[videoConfig.id] ?? (env.isPlayer ? 0 : getFrameForComposition(videoConfig.id));
23873
24187
  return Math.min(videoConfig.durationInFrames - 1, unclamped);
23874
24188
  };
23875
- var useTimelineSetFrame = () => {
23876
- const { setFrame } = useContext5(SetTimelineContext);
23877
- return setFrame;
23878
- };
23879
- var usePlayingState = () => {
23880
- const { playing, imperativePlaying } = useContext5(TimelineContext);
23881
- const { setPlaying } = useContext5(SetTimelineContext);
23882
- return useMemo5(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
23883
- };
23884
- var getErrorStackWithMessage = (error) => {
23885
- const stack = error.stack ?? "";
23886
- return stack.startsWith("Error:") ? stack : `${error.message}
23887
- ${stack}`;
23888
- };
23889
- var isErrorLike = (err) => {
23890
- if (err instanceof Error) {
23891
- return true;
23892
- }
23893
- if (err === null) {
23894
- return false;
23895
- }
23896
- if (typeof err !== "object") {
23897
- return false;
23898
- }
23899
- if (!("stack" in err)) {
23900
- return false;
23901
- }
23902
- if (typeof err.stack !== "string") {
23903
- return false;
23904
- }
23905
- if (!("message" in err)) {
23906
- return false;
23907
- }
23908
- if (typeof err.message !== "string") {
23909
- return false;
23910
- }
23911
- return true;
23912
- };
23913
- function cancelRenderInternal(scope, err) {
23914
- let error;
23915
- if (isErrorLike(err)) {
23916
- error = err;
23917
- if (!error.stack) {
23918
- error.stack = new Error(error.message).stack;
23919
- }
23920
- } else if (typeof err === "string") {
23921
- error = Error(err);
23922
- } else {
23923
- error = Error("Rendering was cancelled");
23924
- }
23925
- if (scope) {
23926
- scope.remotion_cancelledError = getErrorStackWithMessage(error);
23927
- }
23928
- throw error;
23929
- }
23930
- function cancelRender(err) {
23931
- return cancelRenderInternal(typeof window !== "undefined" ? window : undefined, err);
23932
- }
23933
- var logLevels = ["trace", "verbose", "info", "warn", "error"];
23934
- var getNumberForLogLevel = (level) => {
23935
- return logLevels.indexOf(level);
23936
- };
23937
- var isEqualOrBelowLogLevel = (currentLevel, level) => {
23938
- return getNumberForLogLevel(currentLevel) <= getNumberForLogLevel(level);
23939
- };
23940
- var transformArgs = ({
23941
- args,
23942
- logLevel,
23943
- tag
23944
- }) => {
23945
- const arr = [...args];
23946
- if (getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
23947
- arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
23948
- }
23949
- if (tag && getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
23950
- arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
23951
- }
23952
- return arr;
23953
- };
23954
- var verbose = (options, ...args) => {
23955
- if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
23956
- return console.debug(...transformArgs({ args, logLevel: "verbose", tag: options.tag }));
23957
- }
23958
- };
23959
- var trace = (options, ...args) => {
23960
- if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
23961
- return console.debug(...transformArgs({ args, logLevel: "trace", tag: options.tag }));
23962
- }
23963
- };
23964
- var info = (options, ...args) => {
23965
- if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
23966
- return console.log(...transformArgs({ args, logLevel: "info", tag: options.tag }));
23967
- }
23968
- };
23969
- var warn = (options, ...args) => {
23970
- if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
23971
- return console.warn(...transformArgs({ args, logLevel: "warn", tag: options.tag }));
23972
- }
23973
- };
23974
- var error = (options, ...args) => {
23975
- return console.error(...transformArgs({ args, logLevel: "error", tag: options.tag }));
23976
- };
23977
- var Log = {
23978
- trace,
23979
- verbose,
23980
- info,
23981
- warn,
23982
- error
23983
- };
23984
- if (typeof window !== "undefined") {
23985
- window.remotion_renderReady = false;
23986
- if (!window.remotion_delayRenderTimeouts) {
23987
- window.remotion_delayRenderTimeouts = {};
23988
- }
23989
- window.remotion_delayRenderHandles = [];
23990
- }
23991
- var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
23992
- var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
23993
- var DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
23994
- var DELAY_RENDER_CLEAR_TOKEN = "handle was cleared after";
23995
- var defaultTimeout = 30000;
23996
- var delayRenderInternal = ({
23997
- scope,
23998
- environment,
23999
- label,
24000
- options
24001
- }) => {
24002
- if (typeof label !== "string" && label !== null) {
24003
- throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label));
24004
- }
24005
- const handle = Math.random();
24006
- scope.remotion_delayRenderHandles.push(handle);
24007
- const called = Error().stack?.replace(/^Error/g, "") ?? "";
24008
- if (environment.isRendering) {
24009
- const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
24010
- const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
24011
- scope.remotion_delayRenderTimeouts[handle] = {
24012
- label: label ?? null,
24013
- startTime: Date.now(),
24014
- timeout: setTimeout(() => {
24015
- const message = [
24016
- `A delayRender()`,
24017
- label ? `"${label}"` : null,
24018
- `was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
24019
- retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
24020
- retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
24021
- DELAY_RENDER_CALLSTACK_TOKEN,
24022
- called
24023
- ].filter(truthy2).join(" ");
24024
- if (environment.isClientSideRendering) {
24025
- scope.remotion_cancelledError = getErrorStackWithMessage(Error(message));
24026
- } else {
24027
- cancelRenderInternal(scope, Error(message));
24028
- }
24029
- }, timeoutToUse)
24030
- };
24031
- }
24032
- scope.remotion_renderReady = false;
24033
- return handle;
24034
- };
24035
- var continueRenderInternal = ({
24036
- scope,
24037
- handle,
24038
- environment,
24039
- logLevel
24040
- }) => {
24041
- if (typeof handle === "undefined") {
24042
- throw new TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");
24043
- }
24044
- if (typeof handle !== "number") {
24045
- throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: " + JSON.stringify(handle));
24046
- }
24047
- scope.remotion_delayRenderHandles = scope.remotion_delayRenderHandles.filter((h) => {
24048
- if (h === handle) {
24049
- if (environment.isRendering && scope !== undefined) {
24050
- if (!scope.remotion_delayRenderTimeouts[handle]) {
24051
- return false;
24052
- }
24053
- const { label, startTime, timeout } = scope.remotion_delayRenderTimeouts[handle];
24054
- clearTimeout(timeout);
24055
- const message = [
24056
- label ? `"${label}"` : "A handle",
24057
- DELAY_RENDER_CLEAR_TOKEN,
24058
- `${Date.now() - startTime}ms`
24059
- ].filter(truthy2).join(" ");
24060
- Log.verbose({ logLevel, tag: "delayRender()" }, message);
24061
- delete scope.remotion_delayRenderTimeouts[handle];
24062
- }
24063
- return false;
24064
- }
24065
- return true;
24066
- });
24067
- if (scope.remotion_delayRenderHandles.length === 0) {
24068
- scope.remotion_renderReady = true;
24189
+ var useTimelineContext = () => {
24190
+ const state = useContext7(TimelineContext);
24191
+ if (state === null) {
24192
+ throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
24069
24193
  }
24194
+ return state;
24070
24195
  };
24071
- var LogLevelContext = createContext7({
24072
- logLevel: "info",
24073
- mountTime: 0
24074
- });
24075
- var useLogLevel = () => {
24076
- const { logLevel } = React4.useContext(LogLevelContext);
24077
- if (logLevel === null) {
24078
- throw new Error("useLogLevel must be used within a LogLevelProvider");
24079
- }
24080
- return logLevel;
24196
+ var useTimelinePosition = () => {
24197
+ const state = useTimelineContext();
24198
+ return useTimelinePositionFromContext(state);
24081
24199
  };
24082
- var useMountTime = () => {
24083
- const { mountTime } = React4.useContext(LogLevelContext);
24084
- if (mountTime === null) {
24085
- throw new Error("useMountTime must be used within a LogLevelProvider");
24200
+ var useAbsoluteTimelinePosition = () => {
24201
+ const state = useContext7(AbsoluteTimeContext);
24202
+ if (state === null) {
24203
+ throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
24086
24204
  }
24087
- return mountTime;
24205
+ return useTimelinePositionFromContext(state);
24088
24206
  };
24089
- var DelayRenderContextType = createContext8(null);
24090
- var useDelayRender = () => {
24091
- const environment = useRemotionEnvironment();
24092
- const scope = useContext7(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
24093
- const logLevel = useLogLevel();
24094
- const delayRender2 = useCallback2((label, options) => {
24095
- if (!scope) {
24096
- return Math.random();
24097
- }
24098
- return delayRenderInternal({
24099
- scope,
24100
- environment,
24101
- label: label ?? null,
24102
- options: options ?? {}
24103
- });
24104
- }, [environment, scope]);
24105
- const continueRender2 = useCallback2((handle) => {
24106
- if (!scope) {
24107
- return;
24108
- }
24109
- continueRenderInternal({
24110
- scope,
24111
- handle,
24112
- environment,
24113
- logLevel
24114
- });
24115
- }, [environment, logLevel, scope]);
24116
- const cancelRender2 = useCallback2((err) => {
24117
- return cancelRenderInternal(scope ?? (typeof window !== "undefined" ? window : undefined), err);
24118
- }, [scope]);
24119
- return { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 };
24207
+ var useTimelineSetFrame = () => {
24208
+ const { setFrame } = useContext7(SetTimelineContext);
24209
+ return setFrame;
24120
24210
  };
24121
- var SetTimelineContext = createContext9({
24122
- setFrame: () => {
24123
- throw new Error("default");
24124
- },
24125
- setPlaying: () => {
24126
- throw new Error("default");
24127
- }
24128
- });
24129
- var TimelineContext = createContext9({
24130
- frame: {},
24131
- playing: false,
24132
- playbackRate: 1,
24133
- rootId: "",
24134
- imperativePlaying: {
24135
- current: false
24136
- },
24137
- setPlaybackRate: () => {
24138
- throw new Error("default");
24139
- },
24140
- audioAndVideoTags: { current: [] }
24141
- });
24142
- var TimelineContextProvider = ({ children, frameState }) => {
24143
- const [playing, setPlaying] = useState2(false);
24144
- const imperativePlaying = useRef(false);
24145
- const [playbackRate, setPlaybackRate] = useState2(1);
24146
- const audioAndVideoTags = useRef([]);
24147
- const [remotionRootId] = useState2(() => String(random(null)));
24148
- const [_frame, setFrame] = useState2(() => getInitialFrameState());
24149
- const frame = frameState ?? _frame;
24150
- const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
24151
- if (typeof window !== "undefined") {
24152
- useLayoutEffect(() => {
24153
- window.remotion_setFrame = (f, composition, attempt) => {
24154
- window.remotion_attempt = attempt;
24155
- const id = delayRender2(`Setting the current frame to ${f}`);
24156
- let asyncUpdate = true;
24157
- setFrame((s) => {
24158
- const currentFrame = s[composition] ?? window.remotion_initialFrame;
24159
- if (currentFrame === f) {
24160
- asyncUpdate = false;
24161
- return s;
24162
- }
24163
- return {
24164
- ...s,
24165
- [composition]: f
24166
- };
24167
- });
24168
- if (asyncUpdate) {
24169
- requestAnimationFrame(() => continueRender2(id));
24170
- } else {
24171
- continueRender2(id);
24172
- }
24173
- };
24174
- window.remotion_isPlayer = false;
24175
- }, [continueRender2, delayRender2]);
24176
- }
24177
- const timelineContextValue = useMemo6(() => {
24178
- return {
24179
- frame,
24180
- playing,
24181
- imperativePlaying,
24182
- rootId: remotionRootId,
24183
- playbackRate,
24184
- setPlaybackRate,
24185
- audioAndVideoTags
24186
- };
24187
- }, [frame, playbackRate, playing, remotionRootId]);
24188
- const setTimelineContextValue = useMemo6(() => {
24189
- return {
24190
- setFrame,
24191
- setPlaying
24192
- };
24193
- }, []);
24194
- return /* @__PURE__ */ jsx42(TimelineContext.Provider, {
24195
- value: timelineContextValue,
24196
- children: /* @__PURE__ */ jsx42(SetTimelineContext.Provider, {
24197
- value: setTimelineContextValue,
24198
- children
24199
- })
24200
- });
24211
+ var usePlayingState = () => {
24212
+ const { playing, imperativePlaying } = useTimelineContext();
24213
+ const { setPlaying } = useContext7(SetTimelineContext);
24214
+ return useMemo6(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
24201
24215
  };
24202
24216
  var CanUseRemotionHooks = createContext10(false);
24203
24217
  var CanUseRemotionHooksProvider = ({ children }) => {
@@ -24306,7 +24320,7 @@ var Freeze = ({
24306
24320
  return active(frame);
24307
24321
  }
24308
24322
  }, [active, frame]);
24309
- const timelineContext = useContext11(TimelineContext);
24323
+ const timelineContext = useTimelineContext();
24310
24324
  const sequenceContext = useContext11(SequenceContext);
24311
24325
  const relativeFrom = sequenceContext?.relativeFrom ?? 0;
24312
24326
  const timelineValue = useMemo8(() => {
@@ -24347,18 +24361,36 @@ var Freeze = ({
24347
24361
  var NonceContext = createContext11({
24348
24362
  getNonce: () => 0
24349
24363
  });
24364
+ var fastRefreshNonce = 0;
24365
+ try {
24366
+ if (typeof __webpack_module__ !== "undefined") {
24367
+ if (__webpack_module__.hot) {
24368
+ __webpack_module__.hot.addStatusHandler((status) => {
24369
+ if (status === "idle") {
24370
+ fastRefreshNonce++;
24371
+ }
24372
+ });
24373
+ }
24374
+ }
24375
+ } catch {}
24350
24376
  var useNonce = () => {
24351
24377
  const context = useContext12(NonceContext);
24352
- const [nonce, setNonce] = useState3(() => context.getNonce());
24353
- const lastContext = useRef2(context);
24354
- useEffect(() => {
24355
- if (lastContext.current === context) {
24356
- return;
24378
+ const nonce = context.getNonce();
24379
+ const nonceRef = useRef2(nonce);
24380
+ nonceRef.current = nonce;
24381
+ const history = useRef2([[fastRefreshNonce, nonce]]);
24382
+ const get = useCallback3(() => {
24383
+ if (fastRefreshNonce !== history.current[history.current.length - 1][0]) {
24384
+ history.current = [
24385
+ ...history.current,
24386
+ [fastRefreshNonce, nonceRef.current]
24387
+ ];
24357
24388
  }
24358
- lastContext.current = context;
24359
- setNonce(context.getNonce);
24360
- }, [context]);
24361
- return nonce;
24389
+ return history.current;
24390
+ }, [history]);
24391
+ return useMemo9(() => {
24392
+ return { get };
24393
+ }, [get]);
24362
24394
  };
24363
24395
  var PremountContext = createContext12({
24364
24396
  premountFramesRemaining: 0,
@@ -24379,22 +24411,28 @@ var SequenceVisibilityToggleContext = React8.createContext({
24379
24411
  throw new Error("SequenceVisibilityToggle not initialized");
24380
24412
  }
24381
24413
  });
24382
- var SequenceControlOverrideContext = React8.createContext({
24383
- overrides: {},
24384
- setOverride: () => {
24385
- throw new Error("SequenceControlOverrideContext not initialized");
24414
+ var VisualModeOverridesContext = React8.createContext({
24415
+ dragOverrides: {},
24416
+ setDragOverrides: () => {
24417
+ throw new Error("VisualModeOverridesContext not initialized");
24386
24418
  },
24387
- clearOverrides: () => {
24388
- throw new Error("SequenceControlOverrideContext not initialized");
24389
- }
24419
+ clearDragOverrides: () => {
24420
+ throw new Error("VisualModeOverridesContext not initialized");
24421
+ },
24422
+ codeValues: {},
24423
+ setCodeValues: () => {
24424
+ throw new Error("VisualModeOverridesContext not initialized");
24425
+ },
24426
+ visualModeEnabled: false
24390
24427
  });
24391
- var SequenceManagerProvider = ({ children }) => {
24392
- const [sequences, setSequences] = useState4([]);
24393
- const [hidden, setHidden] = useState4({});
24394
- const [controlOverrides, setControlOverrides] = useState4({});
24395
- const controlOverridesRef = useRef3(controlOverrides);
24396
- controlOverridesRef.current = controlOverrides;
24397
- const setOverride = useCallback3((sequenceId, key, value) => {
24428
+ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
24429
+ const [sequences, setSequences] = useState3([]);
24430
+ const [hidden, setHidden] = useState3({});
24431
+ const [dragOverrides, setControlOverrides] = useState3({});
24432
+ const controlOverridesRef = useRef3(dragOverrides);
24433
+ controlOverridesRef.current = dragOverrides;
24434
+ const [codeValues, setCodeValuesMapState] = useState3({});
24435
+ const setDragOverrides = useCallback4((sequenceId, key, value) => {
24398
24436
  setControlOverrides((prev) => ({
24399
24437
  ...prev,
24400
24438
  [sequenceId]: {
@@ -24403,7 +24441,7 @@ var SequenceManagerProvider = ({ children }) => {
24403
24441
  }
24404
24442
  }));
24405
24443
  }, []);
24406
- const clearOverrides = useCallback3((sequenceId) => {
24444
+ const clearDragOverrides = useCallback4((sequenceId) => {
24407
24445
  setControlOverrides((prev) => {
24408
24446
  if (!prev[sequenceId]) {
24409
24447
  return prev;
@@ -24413,39 +24451,65 @@ var SequenceManagerProvider = ({ children }) => {
24413
24451
  return next;
24414
24452
  });
24415
24453
  }, []);
24416
- const registerSequence = useCallback3((seq) => {
24454
+ const setCodeValues = useCallback4((sequenceId, values) => {
24455
+ setCodeValuesMapState((prev) => {
24456
+ if (prev[sequenceId] === values) {
24457
+ return prev;
24458
+ }
24459
+ if (values === null) {
24460
+ if (!(sequenceId in prev)) {
24461
+ return prev;
24462
+ }
24463
+ const next = { ...prev };
24464
+ delete next[sequenceId];
24465
+ return next;
24466
+ }
24467
+ return { ...prev, [sequenceId]: values };
24468
+ });
24469
+ }, []);
24470
+ const registerSequence = useCallback4((seq) => {
24417
24471
  setSequences((seqs) => {
24418
24472
  return [...seqs, seq];
24419
24473
  });
24420
24474
  }, []);
24421
- const unregisterSequence = useCallback3((seq) => {
24475
+ const unregisterSequence = useCallback4((seq) => {
24422
24476
  setSequences((seqs) => seqs.filter((s) => s.id !== seq));
24423
24477
  }, []);
24424
- const sequenceContext = useMemo9(() => {
24478
+ const sequenceContext = useMemo10(() => {
24425
24479
  return {
24426
24480
  registerSequence,
24427
24481
  sequences,
24428
24482
  unregisterSequence
24429
24483
  };
24430
24484
  }, [registerSequence, sequences, unregisterSequence]);
24431
- const hiddenContext = useMemo9(() => {
24485
+ const hiddenContext = useMemo10(() => {
24432
24486
  return {
24433
24487
  hidden,
24434
24488
  setHidden
24435
24489
  };
24436
24490
  }, [hidden]);
24437
- const overrideContext = useMemo9(() => {
24491
+ const overrideContext = useMemo10(() => {
24438
24492
  return {
24439
- overrides: controlOverrides,
24440
- setOverride,
24441
- clearOverrides
24493
+ visualModeEnabled,
24494
+ dragOverrides,
24495
+ setDragOverrides,
24496
+ clearDragOverrides,
24497
+ codeValues,
24498
+ setCodeValues
24442
24499
  };
24443
- }, [controlOverrides, setOverride, clearOverrides]);
24500
+ }, [
24501
+ visualModeEnabled,
24502
+ dragOverrides,
24503
+ setDragOverrides,
24504
+ clearDragOverrides,
24505
+ codeValues,
24506
+ setCodeValues
24507
+ ]);
24444
24508
  return /* @__PURE__ */ jsx72(SequenceManager.Provider, {
24445
24509
  value: sequenceContext,
24446
24510
  children: /* @__PURE__ */ jsx72(SequenceVisibilityToggleContext.Provider, {
24447
24511
  value: hiddenContext,
24448
- children: /* @__PURE__ */ jsx72(SequenceControlOverrideContext.Provider, {
24512
+ children: /* @__PURE__ */ jsx72(VisualModeOverridesContext.Provider, {
24449
24513
  value: overrideContext,
24450
24514
  children
24451
24515
  })
@@ -24469,9 +24533,9 @@ var RegularSequenceRefForwardingFunction = ({
24469
24533
  ...other
24470
24534
  }, ref) => {
24471
24535
  const { layout = "absolute-fill" } = other;
24472
- const [id] = useState5(() => String(Math.random()));
24536
+ const [id] = useState4(() => String(Math.random()));
24473
24537
  const parentSequence = useContext13(SequenceContext);
24474
- const { rootId } = useContext13(TimelineContext);
24538
+ const { rootId } = useTimelineContext();
24475
24539
  const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
24476
24540
  const nonce = useNonce();
24477
24541
  if (layout !== "absolute-fill" && layout !== "none") {
@@ -24498,13 +24562,13 @@ var RegularSequenceRefForwardingFunction = ({
24498
24562
  const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
24499
24563
  const { registerSequence, unregisterSequence } = useContext13(SequenceManager);
24500
24564
  const { hidden } = useContext13(SequenceVisibilityToggleContext);
24501
- const premounting = useMemo10(() => {
24565
+ const premounting = useMemo11(() => {
24502
24566
  return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
24503
24567
  }, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
24504
- const postmounting = useMemo10(() => {
24568
+ const postmounting = useMemo11(() => {
24505
24569
  return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
24506
24570
  }, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
24507
- const contextValue = useMemo10(() => {
24571
+ const contextValue = useMemo11(() => {
24508
24572
  return {
24509
24573
  cumulatedFrom,
24510
24574
  relativeFrom: from,
@@ -24531,12 +24595,12 @@ var RegularSequenceRefForwardingFunction = ({
24531
24595
  premountDisplay,
24532
24596
  postmountDisplay
24533
24597
  ]);
24534
- const timelineClipName = useMemo10(() => {
24598
+ const timelineClipName = useMemo11(() => {
24535
24599
  return name ?? "";
24536
24600
  }, [name]);
24537
24601
  const env = useRemotionEnvironment();
24538
24602
  const inheritedStack = other?.stack ?? null;
24539
- useEffect2(() => {
24603
+ useEffect(() => {
24540
24604
  if (!env.isStudio) {
24541
24605
  return;
24542
24606
  }
@@ -24549,7 +24613,7 @@ var RegularSequenceRefForwardingFunction = ({
24549
24613
  type: "sequence",
24550
24614
  rootId,
24551
24615
  showInTimeline,
24552
- nonce,
24616
+ nonce: nonce.get(),
24553
24617
  loopDisplay,
24554
24618
  stack: stack ?? inheritedStack,
24555
24619
  premountDisplay: premountDisplay ?? null,
@@ -24583,7 +24647,7 @@ var RegularSequenceRefForwardingFunction = ({
24583
24647
  const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
24584
24648
  const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
24585
24649
  const styleIfThere = other.layout === "none" ? undefined : other.style;
24586
- const defaultStyle = useMemo10(() => {
24650
+ const defaultStyle = useMemo11(() => {
24587
24651
  return {
24588
24652
  flexDirection: undefined,
24589
24653
  ...width ? { width } : {},
@@ -24610,7 +24674,8 @@ var RegularSequenceRefForwardingFunction = ({
24610
24674
  };
24611
24675
  var RegularSequence = forwardRef2(RegularSequenceRefForwardingFunction);
24612
24676
  var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
24613
- const frame = useCurrentFrame();
24677
+ const parentPremountContext = useContext13(PremountContext);
24678
+ const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
24614
24679
  if (props.layout === "none") {
24615
24680
  throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');
24616
24681
  }
@@ -24629,7 +24694,7 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
24629
24694
  const postmountingActive = frame > endThreshold && frame <= endThreshold + postmountFor;
24630
24695
  const freezeFrame = premountingActive ? from : postmountingActive ? from + durationInFrames - 1 : 0;
24631
24696
  const isFreezingActive = premountingActive || postmountingActive;
24632
- const style = useMemo10(() => {
24697
+ const style = useMemo11(() => {
24633
24698
  return {
24634
24699
  ...passedStyle,
24635
24700
  opacity: premountingActive || postmountingActive ? 0 : 1,
@@ -24644,10 +24709,9 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
24644
24709
  styleWhilePremounted,
24645
24710
  styleWhilePostmounted
24646
24711
  ]);
24647
- const parentPremountContext = useContext13(PremountContext);
24648
- const { playing } = useContext13(TimelineContext);
24649
- const premountFramesRemaining = parentPremountContext.premountFramesRemaining + (premountingActive ? from - frame : 0);
24650
- const premountContextValue = useMemo10(() => {
24712
+ const { playing } = useTimelineContext();
24713
+ const premountFramesRemaining = premountingActive ? from - frame : 0;
24714
+ const premountContextValue = useMemo11(() => {
24651
24715
  return {
24652
24716
  premountFramesRemaining,
24653
24717
  playing: parentPremountContext.playing || playing
@@ -24742,7 +24806,7 @@ var calcArgs = (fit, frameSize, canvasSize) => {
24742
24806
  };
24743
24807
  var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
24744
24808
  const canvasRef = useRef4(null);
24745
- const draw = useCallback4((imageData) => {
24809
+ const draw = useCallback5((imageData) => {
24746
24810
  const canvas = canvasRef.current;
24747
24811
  const canvasWidth = width ?? imageData.displayWidth;
24748
24812
  const canvasHeight = height ?? imageData.displayHeight;
@@ -24945,7 +25009,7 @@ var AnimatedImage = forwardRef3(({
24945
25009
  ...props
24946
25010
  }, canvasRef) => {
24947
25011
  const mountState = useRef5({ isMounted: true });
24948
- useEffect3(() => {
25012
+ useEffect2(() => {
24949
25013
  const { current } = mountState;
24950
25014
  current.isMounted = true;
24951
25015
  return () => {
@@ -24953,9 +25017,9 @@ var AnimatedImage = forwardRef3(({
24953
25017
  };
24954
25018
  }, []);
24955
25019
  const resolvedSrc = resolveAnimatedImageSource(src);
24956
- const [imageDecoder, setImageDecoder] = useState6(null);
25020
+ const [imageDecoder, setImageDecoder] = useState5(null);
24957
25021
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
24958
- const [decodeHandle] = useState6(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
25022
+ const [decodeHandle] = useState5(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
24959
25023
  const frame = useCurrentFrame();
24960
25024
  const { fps } = useVideoConfig();
24961
25025
  const currentTime = frame / playbackRate / fps;
@@ -24969,8 +25033,8 @@ var AnimatedImage = forwardRef3(({
24969
25033
  }
24970
25034
  return c;
24971
25035
  }, []);
24972
- const [initialLoopBehavior] = useState6(() => loopBehavior);
24973
- useEffect3(() => {
25036
+ const [initialLoopBehavior] = useState5(() => loopBehavior);
25037
+ useEffect2(() => {
24974
25038
  const controller = new AbortController;
24975
25039
  decodeImage({
24976
25040
  resolvedSrc,
@@ -25080,9 +25144,9 @@ var RenderAssetManager = createContext13({
25080
25144
  renderAssets: []
25081
25145
  });
25082
25146
  var RenderAssetManagerProvider = ({ children, collectAssets }) => {
25083
- const [renderAssets, setRenderAssets] = useState7([]);
25147
+ const [renderAssets, setRenderAssets] = useState6([]);
25084
25148
  const renderAssetsRef = useRef6([]);
25085
- const registerRenderAsset = useCallback5((renderAsset) => {
25149
+ const registerRenderAsset = useCallback6((renderAsset) => {
25086
25150
  validateRenderAsset(renderAsset);
25087
25151
  renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
25088
25152
  setRenderAssets(renderAssetsRef.current);
@@ -25099,7 +25163,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
25099
25163
  };
25100
25164
  }, []);
25101
25165
  }
25102
- const unregisterRenderAsset = useCallback5((id) => {
25166
+ const unregisterRenderAsset = useCallback6((id) => {
25103
25167
  renderAssetsRef.current = renderAssetsRef.current.filter((a) => a.id !== id);
25104
25168
  setRenderAssets(renderAssetsRef.current);
25105
25169
  }, []);
@@ -25113,14 +25177,14 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
25113
25177
  };
25114
25178
  }
25115
25179
  }, []);
25116
- const contextValue = useMemo11(() => {
25180
+ const contextValue = useMemo12(() => {
25117
25181
  return {
25118
25182
  registerRenderAsset,
25119
25183
  unregisterRenderAsset,
25120
25184
  renderAssets
25121
25185
  };
25122
25186
  }, [renderAssets, registerRenderAsset, unregisterRenderAsset]);
25123
- return /* @__PURE__ */ jsx11(RenderAssetManager.Provider, {
25187
+ return /* @__PURE__ */ jsx112(RenderAssetManager.Provider, {
25124
25188
  value: contextValue,
25125
25189
  children
25126
25190
  });
@@ -25130,7 +25194,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
25130
25194
  const { registerRenderAsset, unregisterRenderAsset } = useContext14(RenderAssetManager);
25131
25195
  const env = useRemotionEnvironment();
25132
25196
  const frame = useCurrentFrame();
25133
- const [id] = useState8(() => {
25197
+ const [id] = useState7(() => {
25134
25198
  return String(Math.random());
25135
25199
  });
25136
25200
  useLayoutEffect4(() => {
@@ -25235,14 +25299,14 @@ var Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) =>
25235
25299
  const iteration = Math.floor(currentFrame / durationInFrames);
25236
25300
  const start = iteration * durationInFrames;
25237
25301
  const from = Math.min(start, maxFrame);
25238
- const loopDisplay = useMemo12(() => {
25302
+ const loopDisplay = useMemo13(() => {
25239
25303
  return {
25240
25304
  numberOfTimes: Math.min(compDuration / durationInFrames, times),
25241
25305
  startOffset: -from,
25242
25306
  durationInFrames
25243
25307
  };
25244
25308
  }, [compDuration, durationInFrames, from, times]);
25245
- const loopContext = useMemo12(() => {
25309
+ const loopContext = useMemo13(() => {
25246
25310
  return {
25247
25311
  iteration: Math.floor(currentFrame / durationInFrames),
25248
25312
  durationInFrames
@@ -25279,8 +25343,8 @@ var setPreloads = (updater) => {
25279
25343
  updaters.forEach((u) => u());
25280
25344
  };
25281
25345
  var PrefetchProvider = ({ children }) => {
25282
- const [_preloads, _setPreloads] = useState9(() => preloads);
25283
- useEffect4(() => {
25346
+ const [_preloads, _setPreloads] = useState8(() => preloads);
25347
+ useEffect3(() => {
25284
25348
  const updaterFunction = () => {
25285
25349
  _setPreloads(preloads);
25286
25350
  };
@@ -25600,7 +25664,7 @@ var DurationsContext = createContext16({
25600
25664
  });
25601
25665
  var DurationsContextProvider = ({ children }) => {
25602
25666
  const [durations, setDurations] = useReducer(durationReducer, {});
25603
- const value = useMemo13(() => {
25667
+ const value = useMemo14(() => {
25604
25668
  return {
25605
25669
  durations,
25606
25670
  setDurations
@@ -25734,7 +25798,7 @@ var useSingletonAudioContext = ({
25734
25798
  audioEnabled
25735
25799
  }) => {
25736
25800
  const env = useRemotionEnvironment();
25737
- const audioContext = useMemo14(() => {
25801
+ const audioContext = useMemo15(() => {
25738
25802
  if (env.isRendering) {
25739
25803
  return null;
25740
25804
  }
@@ -25781,7 +25845,7 @@ var didPropChange = (key, newProp, prevProp) => {
25781
25845
  var SharedAudioContext = createContext17(null);
25782
25846
  var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHint, audioEnabled }) => {
25783
25847
  const audios = useRef7([]);
25784
- const [initialNumberOfAudioTags] = useState10(numberOfAudioTags);
25848
+ const [initialNumberOfAudioTags] = useState9(numberOfAudioTags);
25785
25849
  if (numberOfAudioTags !== initialNumberOfAudioTags) {
25786
25850
  throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
25787
25851
  }
@@ -25791,7 +25855,64 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
25791
25855
  latencyHint: audioLatencyHint,
25792
25856
  audioEnabled
25793
25857
  });
25794
- const refs = useMemo15(() => {
25858
+ const audioSyncAnchor = useMemo16(() => ({ value: 0 }), []);
25859
+ const prevEndTimes = useRef7({ scheduledEndTime: null, mediaEndTime: null });
25860
+ const scheduleAudioNode = useMemo16(() => {
25861
+ return ({
25862
+ node,
25863
+ mediaTimestamp,
25864
+ targetTime,
25865
+ currentTime,
25866
+ sequenceEndTime,
25867
+ sequenceStartTime,
25868
+ debugAudioScheduling
25869
+ }) => {
25870
+ if (!audioContext) {
25871
+ throw new Error("Audio context not found");
25872
+ }
25873
+ const bufferDuration = node.buffer?.duration ?? 0;
25874
+ const unclampedMediaEndTime = mediaTimestamp + bufferDuration;
25875
+ const needsTrimEnd = unclampedMediaEndTime > sequenceEndTime;
25876
+ const needsTrimStart = mediaTimestamp < sequenceStartTime;
25877
+ const offsetBecauseOfTrim = needsTrimStart ? sequenceStartTime - mediaTimestamp : 0;
25878
+ const offsetBecauseOfTooLate = targetTime < 0 ? -targetTime : 0;
25879
+ const offset = offsetBecauseOfTrim + offsetBecauseOfTooLate;
25880
+ const duration = needsTrimEnd ? bufferDuration - Math.max(0, unclampedMediaEndTime - sequenceEndTime) - offset : bufferDuration - offset;
25881
+ const scheduledTime = targetTime + currentTime + offset;
25882
+ if (offset < 0) {
25883
+ throw new Error("offset < 0: " + JSON.stringify({
25884
+ offset,
25885
+ targetTime,
25886
+ currentTime,
25887
+ offsetBecauseOfTrim,
25888
+ offsetBecauseOfTooLate
25889
+ }));
25890
+ }
25891
+ if (duration > 0) {
25892
+ node.start(scheduledTime, offset, duration);
25893
+ }
25894
+ const scheduledEndTime = scheduledTime + duration / node.playbackRate.value;
25895
+ const mediaTime = mediaTimestamp + offset;
25896
+ const mediaEndTime = mediaTime + duration;
25897
+ const latency = audioContext.baseLatency + audioContext.outputLatency;
25898
+ const timeDiff = scheduledTime - currentTime - latency;
25899
+ const prev = prevEndTimes.current;
25900
+ const scheduledMismatch = prev.scheduledEndTime !== null && Math.abs(scheduledTime - prev.scheduledEndTime) > 0.001;
25901
+ const mediaMismatch = prev.mediaEndTime !== null && Math.abs(mediaTime - prev.mediaEndTime) > 0.001;
25902
+ if (debugAudioScheduling) {
25903
+ Log.info({ logLevel, tag: "audio-scheduling" }, "scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s", scheduledMismatch ? "color: red; font-weight: bold" : "", scheduledTime.toFixed(4), "", scheduledEndTime.toFixed(4), mediaMismatch ? "color: red; font-weight: bold" : "", mediaTime.toFixed(4), "", mediaEndTime.toFixed(4), duration < 0 ? "color: red; font-weight: bold" : timeDiff < 0 ? "color: red; font-weight: bold" : "color: blue; font-weight: bold", duration < 0 ? "missed " + Math.abs(offset).toFixed(2) + "s" : Math.abs(timeDiff).toFixed(2) + (timeDiff < 0 ? " delay" : " ahead"), "", "current=" + currentTime.toFixed(4), "offset=" + offset.toFixed(4), "latency=" + latency.toFixed(4), "state=" + audioContext.state);
25904
+ }
25905
+ prev.scheduledEndTime = scheduledEndTime;
25906
+ prev.mediaEndTime = mediaEndTime;
25907
+ return duration > 0 ? {
25908
+ type: "started",
25909
+ scheduledTime
25910
+ } : {
25911
+ type: "not-started"
25912
+ };
25913
+ };
25914
+ }, [audioContext, logLevel]);
25915
+ const refs = useMemo16(() => {
25795
25916
  return new Array(numberOfAudioTags).fill(true).map(() => {
25796
25917
  const ref = createRef2();
25797
25918
  return {
@@ -25815,7 +25936,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
25815
25936
  };
25816
25937
  }, [refs]);
25817
25938
  const takenAudios = useRef7(new Array(numberOfAudioTags).fill(false));
25818
- const rerenderAudios = useCallback6(() => {
25939
+ const rerenderAudios = useCallback7(() => {
25819
25940
  refs.forEach(({ ref, id }) => {
25820
25941
  const data = audios.current?.find((a) => a.id === id);
25821
25942
  const { current } = ref;
@@ -25836,7 +25957,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
25836
25957
  });
25837
25958
  });
25838
25959
  }, [refs]);
25839
- const registerAudio = useCallback6((options) => {
25960
+ const registerAudio = useCallback7((options) => {
25840
25961
  const { aud, audioId, premounting, postmounting } = options;
25841
25962
  const found = audios.current?.find((a) => a.audioId === audioId);
25842
25963
  if (found) {
@@ -25865,7 +25986,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
25865
25986
  rerenderAudios();
25866
25987
  return newElem;
25867
25988
  }, [numberOfAudioTags, refs, rerenderAudios]);
25868
- const unregisterAudio = useCallback6((id) => {
25989
+ const unregisterAudio = useCallback7((id) => {
25869
25990
  const cloned = [...takenAudios.current];
25870
25991
  const index = refs.findIndex((r2) => r2.id === id);
25871
25992
  if (index === -1) {
@@ -25876,7 +25997,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
25876
25997
  audios.current = audios.current?.filter((a) => a.id !== id);
25877
25998
  rerenderAudios();
25878
25999
  }, [refs, rerenderAudios]);
25879
- const updateAudio = useCallback6(({
26000
+ const updateAudio = useCallback7(({
25880
26001
  aud,
25881
26002
  audioId,
25882
26003
  id,
@@ -25912,7 +26033,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
25912
26033
  }, [rerenderAudios]);
25913
26034
  const mountTime = useMountTime();
25914
26035
  const env = useRemotionEnvironment();
25915
- const playAllAudios = useCallback6(() => {
26036
+ const playAllAudios = useCallback7(() => {
25916
26037
  refs.forEach((ref) => {
25917
26038
  const audio = audios.current.find((a) => a.el === ref.ref);
25918
26039
  if (audio?.premounting) {
@@ -25930,14 +26051,16 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
25930
26051
  });
25931
26052
  audioContext?.resume();
25932
26053
  }, [audioContext, logLevel, mountTime, refs, env.isPlayer]);
25933
- const value = useMemo15(() => {
26054
+ const value = useMemo16(() => {
25934
26055
  return {
25935
26056
  registerAudio,
25936
26057
  unregisterAudio,
25937
26058
  updateAudio,
25938
26059
  playAllAudios,
25939
26060
  numberOfAudioTags,
25940
- audioContext
26061
+ audioContext,
26062
+ audioSyncAnchor,
26063
+ scheduleAudioNode
25941
26064
  };
25942
26065
  }, [
25943
26066
  numberOfAudioTags,
@@ -25945,7 +26068,9 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
25945
26068
  registerAudio,
25946
26069
  unregisterAudio,
25947
26070
  updateAudio,
25948
- audioContext
26071
+ audioContext,
26072
+ audioSyncAnchor,
26073
+ scheduleAudioNode
25949
26074
  ]);
25950
26075
  return /* @__PURE__ */ jsxs2(SharedAudioContext.Provider, {
25951
26076
  value,
@@ -25968,7 +26093,7 @@ var useSharedAudio = ({
25968
26093
  postmounting
25969
26094
  }) => {
25970
26095
  const ctx = useContext16(SharedAudioContext);
25971
- const [elem] = useState10(() => {
26096
+ const [elem] = useState9(() => {
25972
26097
  if (ctx && ctx.numberOfAudioTags > 0) {
25973
26098
  return ctx.registerAudio({ aud, audioId, premounting, postmounting });
25974
26099
  }
@@ -26262,7 +26387,7 @@ var useBasicMediaInTimeline = ({
26262
26387
  const startsAt = useMediaStartsAt();
26263
26388
  const parentSequence = useContext19(SequenceContext);
26264
26389
  const videoConfig = useVideoConfig();
26265
- const [initialVolume] = useState11(() => volume);
26390
+ const [initialVolume] = useState10(() => volume);
26266
26391
  const mediaDuration = calculateMediaDuration({
26267
26392
  mediaDurationInFrames: videoConfig.durationInFrames,
26268
26393
  playbackRate,
@@ -26270,7 +26395,7 @@ var useBasicMediaInTimeline = ({
26270
26395
  trimAfter
26271
26396
  });
26272
26397
  const duration = parentSequence ? Math.min(parentSequence.durationInFrames, mediaDuration) : mediaDuration;
26273
- const volumes = useMemo16(() => {
26398
+ const volumes = useMemo17(() => {
26274
26399
  if (typeof volume === "number") {
26275
26400
  return volume;
26276
26401
  }
@@ -26282,14 +26407,14 @@ var useBasicMediaInTimeline = ({
26282
26407
  });
26283
26408
  }).join(",");
26284
26409
  }, [duration, startsAt, volume, mediaVolume]);
26285
- useEffect5(() => {
26410
+ useEffect4(() => {
26286
26411
  if (typeof volume === "number" && volume !== initialVolume) {
26287
26412
  warnOnce2(`Remotion: The ${mediaType} with src ${src} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`);
26288
26413
  }
26289
26414
  }, [initialVolume, mediaType, src, volume]);
26290
26415
  const doesVolumeChange = typeof volume === "function";
26291
26416
  const nonce = useNonce();
26292
- const { rootId } = useContext19(TimelineContext);
26417
+ const { rootId } = useTimelineContext();
26293
26418
  const env = useRemotionEnvironment();
26294
26419
  return {
26295
26420
  volumes,
@@ -26336,7 +26461,7 @@ var useMediaInTimeline = ({
26336
26461
  trimBefore: undefined,
26337
26462
  playbackRate
26338
26463
  });
26339
- useEffect5(() => {
26464
+ useEffect4(() => {
26340
26465
  if (!src) {
26341
26466
  throw new Error("No src passed");
26342
26467
  }
@@ -26357,7 +26482,7 @@ var useMediaInTimeline = ({
26357
26482
  rootId,
26358
26483
  volume: volumes,
26359
26484
  showInTimeline: true,
26360
- nonce,
26485
+ nonce: nonce.get(),
26361
26486
  startMediaFrom: 0 - startsAt,
26362
26487
  doesVolumeChange,
26363
26488
  loopDisplay,
@@ -26394,13 +26519,13 @@ var useMediaInTimeline = ({
26394
26519
  ]);
26395
26520
  };
26396
26521
  var useBufferManager = (logLevel, mountTime) => {
26397
- const [blocks, setBlocks] = useState12([]);
26398
- const [onBufferingCallbacks, setOnBufferingCallbacks] = useState12([]);
26399
- const [onResumeCallbacks, setOnResumeCallbacks] = useState12([]);
26522
+ const [blocks, setBlocks] = useState11([]);
26523
+ const [onBufferingCallbacks, setOnBufferingCallbacks] = useState11([]);
26524
+ const [onResumeCallbacks, setOnResumeCallbacks] = useState11([]);
26400
26525
  const env = useRemotionEnvironment();
26401
26526
  const rendering = env.isRendering;
26402
26527
  const buffering = useRef10(false);
26403
- const addBlock = useCallback7((block) => {
26528
+ const addBlock = useCallback8((block) => {
26404
26529
  if (rendering) {
26405
26530
  return {
26406
26531
  unblock: () => {
@@ -26421,7 +26546,7 @@ var useBufferManager = (logLevel, mountTime) => {
26421
26546
  }
26422
26547
  };
26423
26548
  }, [rendering]);
26424
- const listenForBuffering = useCallback7((callback) => {
26549
+ const listenForBuffering = useCallback8((callback) => {
26425
26550
  setOnBufferingCallbacks((c) => [...c, callback]);
26426
26551
  return {
26427
26552
  remove: () => {
@@ -26429,7 +26554,7 @@ var useBufferManager = (logLevel, mountTime) => {
26429
26554
  }
26430
26555
  };
26431
26556
  }, []);
26432
- const listenForResume = useCallback7((callback) => {
26557
+ const listenForResume = useCallback8((callback) => {
26433
26558
  setOnResumeCallbacks((c) => [...c, callback]);
26434
26559
  return {
26435
26560
  remove: () => {
@@ -26437,7 +26562,7 @@ var useBufferManager = (logLevel, mountTime) => {
26437
26562
  }
26438
26563
  };
26439
26564
  }, []);
26440
- useEffect6(() => {
26565
+ useEffect5(() => {
26441
26566
  if (rendering) {
26442
26567
  return;
26443
26568
  }
@@ -26467,7 +26592,7 @@ var useBufferManager = (logLevel, mountTime) => {
26467
26592
  }
26468
26593
  }, [blocks]);
26469
26594
  }
26470
- return useMemo17(() => {
26595
+ return useMemo18(() => {
26471
26596
  return { addBlock, listenForBuffering, listenForResume, buffering };
26472
26597
  }, [addBlock, buffering, listenForBuffering, listenForResume]);
26473
26598
  };
@@ -26481,8 +26606,8 @@ var BufferingProvider = ({ children }) => {
26481
26606
  });
26482
26607
  };
26483
26608
  var useIsPlayerBuffering = (bufferManager) => {
26484
- const [isBuffering, setIsBuffering] = useState12(bufferManager.buffering.current);
26485
- useEffect6(() => {
26609
+ const [isBuffering, setIsBuffering] = useState11(bufferManager.buffering.current);
26610
+ useEffect5(() => {
26486
26611
  const onBuffer = () => {
26487
26612
  setIsBuffering(true);
26488
26613
  };
@@ -26505,7 +26630,7 @@ var useIsPlayerBuffering = (bufferManager) => {
26505
26630
  var useBufferState = () => {
26506
26631
  const buffer = useContext21(BufferingContextReact);
26507
26632
  const addBlock = buffer ? buffer.addBlock : null;
26508
- return useMemo18(() => ({
26633
+ return useMemo19(() => ({
26509
26634
  delayPlayback: () => {
26510
26635
  if (!addBlock) {
26511
26636
  throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");
@@ -26531,7 +26656,7 @@ var useBufferUntilFirstFrame = ({
26531
26656
  }) => {
26532
26657
  const bufferingRef = useRef11(false);
26533
26658
  const { delayPlayback } = useBufferState();
26534
- const bufferUntilFirstFrame = useCallback8((requestedTime) => {
26659
+ const bufferUntilFirstFrame = useCallback9((requestedTime) => {
26535
26660
  if (mediaType !== "video") {
26536
26661
  return;
26537
26662
  }
@@ -26602,7 +26727,7 @@ var useBufferUntilFirstFrame = ({
26602
26727
  onVariableFpsVideoDetected,
26603
26728
  pauseWhenBuffering
26604
26729
  ]);
26605
- return useMemo19(() => {
26730
+ return useMemo20(() => {
26606
26731
  return {
26607
26732
  isBuffering: () => bufferingRef.current,
26608
26733
  bufferUntilFirstFrame
@@ -26650,8 +26775,8 @@ var useMediaBuffering = ({
26650
26775
  src
26651
26776
  }) => {
26652
26777
  const buffer = useBufferState();
26653
- const [isBuffering, setIsBuffering] = useState13(false);
26654
- useEffect7(() => {
26778
+ const [isBuffering, setIsBuffering] = useState12(false);
26779
+ useEffect6(() => {
26655
26780
  let cleanupFns = [];
26656
26781
  const { current } = element;
26657
26782
  if (!current) {
@@ -26784,7 +26909,7 @@ var useRequestVideoCallbackTime = ({
26784
26909
  onVariableFpsVideoDetected
26785
26910
  }) => {
26786
26911
  const currentTime = useRef12(null);
26787
- useEffect8(() => {
26912
+ useEffect7(() => {
26788
26913
  const { current } = mediaRef;
26789
26914
  if (current) {
26790
26915
  currentTime.current = {
@@ -27004,7 +27129,7 @@ var useMediaPlayback = ({
27004
27129
  isPostmounting,
27005
27130
  onAutoPlayError
27006
27131
  }) => {
27007
- const { playbackRate: globalPlaybackRate } = useContext22(TimelineContext);
27132
+ const { playbackRate: globalPlaybackRate } = useTimelineContext();
27008
27133
  const frame = useCurrentFrame();
27009
27134
  const absoluteFrame = useTimelinePosition();
27010
27135
  const [playing] = usePlayingState();
@@ -27019,7 +27144,7 @@ var useMediaPlayback = ({
27019
27144
  throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
27020
27145
  }
27021
27146
  const isVariableFpsVideoMap = useRef13({});
27022
- const onVariableFpsVideoDetected = useCallback9(() => {
27147
+ const onVariableFpsVideoDetected = useCallback10(() => {
27023
27148
  if (!src) {
27024
27149
  return;
27025
27150
  }
@@ -27070,7 +27195,7 @@ var useMediaPlayback = ({
27070
27195
  return acceptableTimeshift ?? defaultAcceptableTimeshift;
27071
27196
  })();
27072
27197
  const isPlayerBuffering = useIsPlayerBuffering(buffering);
27073
- useEffect9(() => {
27198
+ useEffect8(() => {
27074
27199
  if (mediaRef.current?.paused) {
27075
27200
  return;
27076
27201
  }
@@ -27115,7 +27240,7 @@ var useMediaPlayback = ({
27115
27240
  mediaRef.current.playbackRate = playbackRateToSet;
27116
27241
  }
27117
27242
  }, [mediaRef, playbackRate]);
27118
- useEffect9(() => {
27243
+ useEffect8(() => {
27119
27244
  const tagName = mediaType === "audio" ? "<Html5Audio>" : "<Html5Video>";
27120
27245
  if (!mediaRef.current) {
27121
27246
  throw new Error(`No ${mediaType} ref found`);
@@ -27240,11 +27365,11 @@ var useMediaTag = ({
27240
27365
  isPremounting,
27241
27366
  isPostmounting
27242
27367
  }) => {
27243
- const { audioAndVideoTags, imperativePlaying } = useContext23(TimelineContext);
27368
+ const { audioAndVideoTags, imperativePlaying } = useTimelineContext();
27244
27369
  const logLevel = useLogLevel();
27245
27370
  const mountTime = useMountTime();
27246
27371
  const env = useRemotionEnvironment();
27247
- useEffect10(() => {
27372
+ useEffect9(() => {
27248
27373
  const tag = {
27249
27374
  id,
27250
27375
  play: (reason) => {
@@ -27296,16 +27421,16 @@ var SetMediaVolumeContext = createContext18({
27296
27421
  }
27297
27422
  });
27298
27423
  var useMediaVolumeState = () => {
27299
- const { mediaVolume } = useContext24(MediaVolumeContext);
27300
- const { setMediaVolume } = useContext24(SetMediaVolumeContext);
27301
- return useMemo20(() => {
27424
+ const { mediaVolume } = useContext23(MediaVolumeContext);
27425
+ const { setMediaVolume } = useContext23(SetMediaVolumeContext);
27426
+ return useMemo21(() => {
27302
27427
  return [mediaVolume, setMediaVolume];
27303
27428
  }, [mediaVolume, setMediaVolume]);
27304
27429
  };
27305
27430
  var useMediaMutedState = () => {
27306
- const { mediaMuted } = useContext24(MediaVolumeContext);
27307
- const { setMediaMuted } = useContext24(SetMediaVolumeContext);
27308
- return useMemo20(() => {
27431
+ const { mediaMuted } = useContext23(MediaVolumeContext);
27432
+ const { setMediaMuted } = useContext23(SetMediaVolumeContext);
27433
+ return useMemo21(() => {
27309
27434
  return [mediaMuted, setMediaMuted];
27310
27435
  }, [mediaMuted, setMediaMuted]);
27311
27436
  };
@@ -27315,7 +27440,7 @@ var warnAboutTooHighVolume = (volume) => {
27315
27440
  }
27316
27441
  };
27317
27442
  var AudioForDevelopmentForwardRefFunction = (props, ref) => {
27318
- const [initialShouldPreMountAudioElements] = useState14(props.shouldPreMountAudioTags);
27443
+ const [initialShouldPreMountAudioElements] = useState13(props.shouldPreMountAudioTags);
27319
27444
  if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
27320
27445
  throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
27321
27446
  }
@@ -27354,13 +27479,13 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
27354
27479
  const [mediaVolume] = useMediaVolumeState();
27355
27480
  const [mediaMuted] = useMediaMutedState();
27356
27481
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
27357
- const { hidden } = useContext25(SequenceVisibilityToggleContext);
27482
+ const { hidden } = useContext24(SequenceVisibilityToggleContext);
27358
27483
  if (!src) {
27359
27484
  throw new TypeError("No 'src' was passed to <Html5Audio>.");
27360
27485
  }
27361
27486
  const preloadedSrc = usePreload(src);
27362
- const sequenceContext = useContext25(SequenceContext);
27363
- const [timelineId] = useState14(() => String(Math.random()));
27487
+ const sequenceContext = useContext24(SequenceContext);
27488
+ const [timelineId] = useState13(() => String(Math.random()));
27364
27489
  const isSequenceHidden = hidden[timelineId] ?? false;
27365
27490
  const userPreferredVolume = evaluateVolume({
27366
27491
  frame: volumePropFrame,
@@ -27373,7 +27498,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
27373
27498
  requestsVideoFrame: false,
27374
27499
  isClientSideRendering: false
27375
27500
  });
27376
- const propsToPass = useMemo21(() => {
27501
+ const propsToPass = useMemo222(() => {
27377
27502
  return {
27378
27503
  muted: muted || mediaMuted || isSequenceHidden || userPreferredVolume <= 0,
27379
27504
  src: preloadedSrc,
@@ -27391,7 +27516,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
27391
27516
  userPreferredVolume,
27392
27517
  crossOriginValue
27393
27518
  ]);
27394
- const id = useMemo21(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
27519
+ const id = useMemo222(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
27395
27520
  src,
27396
27521
  sequenceContext?.relativeFrom,
27397
27522
  sequenceContext?.cumulatedFrom,
@@ -27463,7 +27588,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
27463
27588
  }, [audioRef]);
27464
27589
  const currentOnDurationCallback = useRef14(onDuration);
27465
27590
  currentOnDurationCallback.current = onDuration;
27466
- useEffect11(() => {
27591
+ useEffect10(() => {
27467
27592
  const { current } = audioRef;
27468
27593
  if (!current) {
27469
27594
  return;
@@ -27514,10 +27639,10 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
27514
27639
  const absoluteFrame = useTimelinePosition();
27515
27640
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
27516
27641
  const frame = useCurrentFrame();
27517
- const sequenceContext = useContext26(SequenceContext);
27518
- const { registerRenderAsset, unregisterRenderAsset } = useContext26(RenderAssetManager);
27642
+ const sequenceContext = useContext25(SequenceContext);
27643
+ const { registerRenderAsset, unregisterRenderAsset } = useContext25(RenderAssetManager);
27519
27644
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
27520
- const id = useMemo222(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
27645
+ const id = useMemo23(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
27521
27646
  props.src,
27522
27647
  sequenceContext?.relativeFrom,
27523
27648
  sequenceContext?.cumulatedFrom,
@@ -27532,7 +27657,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
27532
27657
  useImperativeHandle6(ref, () => {
27533
27658
  return audioRef.current;
27534
27659
  }, []);
27535
- useEffect12(() => {
27660
+ useEffect11(() => {
27536
27661
  if (!props.src) {
27537
27662
  throw new Error("No src passed");
27538
27663
  }
@@ -27624,7 +27749,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
27624
27749
  };
27625
27750
  var AudioForRendering = forwardRef5(AudioForRenderingRefForwardingFunction);
27626
27751
  var AudioRefForwardingFunction = (props, ref) => {
27627
- const audioContext = useContext27(SharedAudioContext);
27752
+ const audioContext = useContext26(SharedAudioContext);
27628
27753
  const {
27629
27754
  startFrom,
27630
27755
  endAt,
@@ -27643,12 +27768,12 @@ var AudioRefForwardingFunction = (props, ref) => {
27643
27768
  if (environment.isClientSideRendering) {
27644
27769
  throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
27645
27770
  }
27646
- const { durations, setDurations } = useContext27(DurationsContext);
27771
+ const { durations, setDurations } = useContext26(DurationsContext);
27647
27772
  if (typeof props.src !== "string") {
27648
27773
  throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
27649
27774
  }
27650
27775
  const preloadedSrc = usePreload(props.src);
27651
- const onError = useCallback10((e) => {
27776
+ const onError = useCallback11((e) => {
27652
27777
  console.log(e.currentTarget.error);
27653
27778
  const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
27654
27779
  if (loop) {
@@ -27662,7 +27787,7 @@ var AudioRefForwardingFunction = (props, ref) => {
27662
27787
  console.warn(errMessage);
27663
27788
  }
27664
27789
  }, [loop, onRemotionError, preloadedSrc]);
27665
- const onDuration = useCallback10((src, durationInSeconds) => {
27790
+ const onDuration = useCallback11((src, durationInSeconds) => {
27666
27791
  setDurations({ type: "got-duration", durationInSeconds, src });
27667
27792
  }, [setDurations]);
27668
27793
  const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
@@ -27836,7 +27961,7 @@ var useLazyComponent = ({
27836
27961
  if ("component" in compProps) {
27837
27962
  componentRef.current = compProps.component;
27838
27963
  }
27839
- const lazy = useMemo24(() => {
27964
+ const lazy = useMemo25(() => {
27840
27965
  if ("component" in compProps) {
27841
27966
  if (typeof document === "undefined" || noSuspense) {
27842
27967
  return compProps.component;
@@ -27881,7 +28006,7 @@ var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
27881
28006
  };
27882
28007
  var Fallback = () => {
27883
28008
  const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
27884
- useEffect14(() => {
28009
+ useEffect13(() => {
27885
28010
  const fallback = delayRender2("Waiting for Root component to unsuspend");
27886
28011
  return () => continueRender2(fallback);
27887
28012
  }, [continueRender2, delayRender2]);
@@ -27897,7 +28022,7 @@ var InnerComposition = ({
27897
28022
  schema,
27898
28023
  ...compProps
27899
28024
  }) => {
27900
- const compManager = useContext29(CompositionSetters);
28025
+ const compManager = useContext28(CompositionSetters);
27901
28026
  const { registerComposition, unregisterComposition } = compManager;
27902
28027
  const video = useVideo();
27903
28028
  const lazy = useLazyComponent({
@@ -27908,7 +28033,7 @@ var InnerComposition = ({
27908
28033
  const nonce = useNonce();
27909
28034
  const isPlayer = useIsPlayer();
27910
28035
  const environment = useRemotionEnvironment();
27911
- const canUseComposition = useContext29(CanUseRemotionHooks);
28036
+ const canUseComposition = useContext28(CanUseRemotionHooks);
27912
28037
  if (typeof window !== "undefined") {
27913
28038
  window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
27914
28039
  }
@@ -27918,8 +28043,8 @@ var InnerComposition = ({
27918
28043
  }
27919
28044
  throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
27920
28045
  }
27921
- const { folderName, parentName } = useContext29(FolderContext);
27922
- useEffect14(() => {
28046
+ const { folderName, parentName } = useContext28(FolderContext);
28047
+ useEffect13(() => {
27923
28048
  if (!id) {
27924
28049
  throw new Error("No id for composition passed.");
27925
28050
  }
@@ -27934,7 +28059,7 @@ var InnerComposition = ({
27934
28059
  folderName,
27935
28060
  component: lazy,
27936
28061
  defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
27937
- nonce,
28062
+ nonce: nonce.get(),
27938
28063
  parentFolderName: parentName,
27939
28064
  schema: schema ?? null,
27940
28065
  calculateMetadata: compProps.calculateMetadata ?? null
@@ -27958,7 +28083,7 @@ var InnerComposition = ({
27958
28083
  registerComposition,
27959
28084
  unregisterComposition
27960
28085
  ]);
27961
- useEffect14(() => {
28086
+ useEffect13(() => {
27962
28087
  window.dispatchEvent(new CustomEvent(PROPS_UPDATED_EXTERNALLY, {
27963
28088
  detail: {
27964
28089
  resetUnsaved: id
@@ -27997,7 +28122,7 @@ var InnerComposition = ({
27997
28122
  return null;
27998
28123
  };
27999
28124
  var Composition = (props2) => {
28000
- const { onlyRenderComposition } = useContext29(CompositionSetters);
28125
+ const { onlyRenderComposition } = useContext28(CompositionSetters);
28001
28126
  if (onlyRenderComposition && onlyRenderComposition !== props2.id) {
28002
28127
  return null;
28003
28128
  }
@@ -28015,15 +28140,15 @@ var IFrameRefForwarding = ({
28015
28140
  ...props2
28016
28141
  }, ref) => {
28017
28142
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
28018
- const [handle] = useState15(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
28143
+ const [handle] = useState14(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
28019
28144
  retries: delayRenderRetries ?? undefined,
28020
28145
  timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
28021
28146
  }));
28022
- const didLoad = useCallback11((e) => {
28147
+ const didLoad = useCallback12((e) => {
28023
28148
  continueRender2(handle);
28024
28149
  onLoad?.(e);
28025
28150
  }, [handle, onLoad, continueRender2]);
28026
- const didGetError = useCallback11((e) => {
28151
+ const didGetError = useCallback12((e) => {
28027
28152
  continueRender2(handle);
28028
28153
  if (onError) {
28029
28154
  onError(e);
@@ -28057,7 +28182,7 @@ var ImgRefForwarding = ({
28057
28182
  const imageRef = useRef17(null);
28058
28183
  const errors = useRef17({});
28059
28184
  const { delayPlayback } = useBufferState();
28060
- const sequenceContext = useContext30(SequenceContext);
28185
+ const sequenceContext = useContext29(SequenceContext);
28061
28186
  if (!src) {
28062
28187
  throw new Error('No "src" prop was passed to <Img>.');
28063
28188
  }
@@ -28069,7 +28194,7 @@ var ImgRefForwarding = ({
28069
28194
  return imageRef.current;
28070
28195
  }, []);
28071
28196
  const actualSrc = usePreload(src);
28072
- const retryIn = useCallback12((timeout) => {
28197
+ const retryIn = useCallback13((timeout) => {
28073
28198
  if (!imageRef.current) {
28074
28199
  return;
28075
28200
  }
@@ -28086,7 +28211,8 @@ var ImgRefForwarding = ({
28086
28211
  imageRef.current.setAttribute("src", newSrc);
28087
28212
  }, timeout);
28088
28213
  }, []);
28089
- const didGetError = useCallback12((e) => {
28214
+ const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
28215
+ const didGetError = useCallback13((e) => {
28090
28216
  if (!errors.current) {
28091
28217
  return;
28092
28218
  }
@@ -28101,9 +28227,10 @@ var ImgRefForwarding = ({
28101
28227
  retryIn(backoff);
28102
28228
  return;
28103
28229
  }
28104
- cancelRender("Error loading image with src: " + imageRef.current?.src);
28105
- }, [maxRetries, onError, retryIn]);
28106
- const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
28230
+ try {
28231
+ cancelRender2("Error loading image with src: " + imageRef.current?.src);
28232
+ } catch {}
28233
+ }, [cancelRender2, maxRetries, onError, retryIn]);
28107
28234
  if (typeof window !== "undefined") {
28108
28235
  const isPremounting = Boolean(sequenceContext?.premounting);
28109
28236
  const isPostmounting = Boolean(sequenceContext?.postmounting);
@@ -28148,7 +28275,7 @@ var ImgRefForwarding = ({
28148
28275
  current.src = actualSrc;
28149
28276
  current.decode().then(onComplete).catch((err) => {
28150
28277
  console.warn(err);
28151
- if (current.complete) {
28278
+ if (current.complete && current.naturalWidth > 0 && current.naturalHeight > 0) {
28152
28279
  onComplete();
28153
28280
  } else {
28154
28281
  current.addEventListener("load", onComplete);
@@ -28196,43 +28323,43 @@ var CompositionManagerProvider = ({
28196
28323
  initialCompositions,
28197
28324
  initialCanvasContent
28198
28325
  }) => {
28199
- const [folders, setFolders] = useState16([]);
28200
- const [canvasContent, setCanvasContent] = useState16(initialCanvasContent);
28201
- const [compositions, setCompositions] = useState16(initialCompositions);
28326
+ const [folders, setFolders] = useState15([]);
28327
+ const [canvasContent, setCanvasContent] = useState15(initialCanvasContent);
28328
+ const [compositions, setCompositions] = useState15(initialCompositions);
28202
28329
  const currentcompositionsRef = useRef18(compositions);
28203
- const updateCompositions = useCallback13((updateComps) => {
28330
+ const updateCompositions = useCallback14((updateComps) => {
28204
28331
  setCompositions((comps) => {
28205
28332
  const updated = updateComps(comps);
28206
28333
  currentcompositionsRef.current = updated;
28207
28334
  return updated;
28208
28335
  });
28209
28336
  }, []);
28210
- const registerComposition = useCallback13((comp) => {
28337
+ const registerComposition = useCallback14((comp) => {
28211
28338
  updateCompositions((comps) => {
28212
28339
  if (comps.find((c2) => c2.id === comp.id)) {
28213
28340
  throw new Error(`Multiple composition with id ${comp.id} are registered.`);
28214
28341
  }
28215
- const value = [...comps, comp].slice().sort((a2, b2) => a2.nonce - b2.nonce);
28216
- return value;
28342
+ return [...comps, comp];
28217
28343
  });
28218
28344
  }, [updateCompositions]);
28219
- const unregisterComposition = useCallback13((id) => {
28345
+ const unregisterComposition = useCallback14((id) => {
28220
28346
  setCompositions((comps) => {
28221
28347
  return comps.filter((c2) => c2.id !== id);
28222
28348
  });
28223
28349
  }, []);
28224
- const registerFolder = useCallback13((name, parent) => {
28350
+ const registerFolder = useCallback14((name, parent, nonce) => {
28225
28351
  setFolders((prevFolders) => {
28226
28352
  return [
28227
28353
  ...prevFolders,
28228
28354
  {
28229
28355
  name,
28230
- parent
28356
+ parent,
28357
+ nonce
28231
28358
  }
28232
28359
  ];
28233
28360
  });
28234
28361
  }, []);
28235
- const unregisterFolder = useCallback13((name, parent) => {
28362
+ const unregisterFolder = useCallback14((name, parent) => {
28236
28363
  setFolders((prevFolders) => {
28237
28364
  return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
28238
28365
  });
@@ -28242,7 +28369,7 @@ var CompositionManagerProvider = ({
28242
28369
  getCompositions: () => currentcompositionsRef.current
28243
28370
  };
28244
28371
  }, []);
28245
- const updateCompositionDefaultProps = useCallback13((id, newDefaultProps) => {
28372
+ const updateCompositionDefaultProps = useCallback14((id, newDefaultProps) => {
28246
28373
  setCompositions((comps) => {
28247
28374
  const updated = comps.map((c2) => {
28248
28375
  if (c2.id === id) {
@@ -28256,7 +28383,7 @@ var CompositionManagerProvider = ({
28256
28383
  return updated;
28257
28384
  });
28258
28385
  }, []);
28259
- const compositionManagerSetters = useMemo25(() => {
28386
+ const compositionManagerSetters = useMemo26(() => {
28260
28387
  return {
28261
28388
  registerComposition,
28262
28389
  unregisterComposition,
@@ -28274,7 +28401,7 @@ var CompositionManagerProvider = ({
28274
28401
  updateCompositionDefaultProps,
28275
28402
  onlyRenderComposition
28276
28403
  ]);
28277
- const compositionManagerContextValue = useMemo25(() => {
28404
+ const compositionManagerContextValue = useMemo26(() => {
28278
28405
  return {
28279
28406
  compositions,
28280
28407
  folders,
@@ -28348,6 +28475,27 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
28348
28475
  }
28349
28476
  `;
28350
28477
  };
28478
+ var getEffectiveVisualModeValue = ({
28479
+ codeValue,
28480
+ runtimeValue,
28481
+ dragOverrideValue,
28482
+ defaultValue,
28483
+ shouldResortToDefaultValueIfUndefined = false
28484
+ }) => {
28485
+ if (dragOverrideValue !== undefined) {
28486
+ return dragOverrideValue;
28487
+ }
28488
+ if (!codeValue) {
28489
+ return runtimeValue;
28490
+ }
28491
+ if (!codeValue.canUpdate) {
28492
+ return runtimeValue;
28493
+ }
28494
+ if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
28495
+ return defaultValue;
28496
+ }
28497
+ return codeValue.codeValue;
28498
+ };
28351
28499
  var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
28352
28500
  var getPreviewDomElement = () => {
28353
28501
  return document.getElementById(REMOTION_STUDIO_CONTAINER_ELEMENT);
@@ -28372,7 +28520,7 @@ var waitForRoot = (fn) => {
28372
28520
  };
28373
28521
  var MediaEnabledContext = createContext20(null);
28374
28522
  var useVideoEnabled = () => {
28375
- const context = useContext31(MediaEnabledContext);
28523
+ const context = useContext30(MediaEnabledContext);
28376
28524
  if (!context) {
28377
28525
  return window.remotion_videoEnabled;
28378
28526
  }
@@ -28382,7 +28530,7 @@ var useVideoEnabled = () => {
28382
28530
  return context.videoEnabled;
28383
28531
  };
28384
28532
  var useAudioEnabled = () => {
28385
- const context = useContext31(MediaEnabledContext);
28533
+ const context = useContext30(MediaEnabledContext);
28386
28534
  if (!context) {
28387
28535
  return window.remotion_audioEnabled;
28388
28536
  }
@@ -28396,7 +28544,7 @@ var MediaEnabledProvider = ({
28396
28544
  videoEnabled,
28397
28545
  audioEnabled
28398
28546
  }) => {
28399
- const value = useMemo26(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
28547
+ const value = useMemo27(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
28400
28548
  return /* @__PURE__ */ jsx26(MediaEnabledContext.Provider, {
28401
28549
  value,
28402
28550
  children
@@ -28410,15 +28558,15 @@ var RemotionRootContexts = ({
28410
28558
  videoEnabled,
28411
28559
  audioEnabled,
28412
28560
  frameState,
28413
- nonceContextSeed
28561
+ visualModeEnabled
28414
28562
  }) => {
28415
- const nonceContext = useMemo27(() => {
28563
+ const nonceContext = useMemo28(() => {
28416
28564
  let counter = 0;
28417
28565
  return {
28418
28566
  getNonce: () => counter++
28419
28567
  };
28420
- }, [nonceContextSeed]);
28421
- const logging = useMemo27(() => {
28568
+ }, []);
28569
+ const logging = useMemo28(() => {
28422
28570
  return { logLevel, mountTime: Date.now() };
28423
28571
  }, [logLevel]);
28424
28572
  return /* @__PURE__ */ jsx27(LogLevelContext.Provider, {
@@ -28433,6 +28581,7 @@ var RemotionRootContexts = ({
28433
28581
  children: /* @__PURE__ */ jsx27(EditorPropsProvider, {
28434
28582
  children: /* @__PURE__ */ jsx27(PrefetchProvider, {
28435
28583
  children: /* @__PURE__ */ jsx27(SequenceManagerProvider, {
28584
+ visualModeEnabled,
28436
28585
  children: /* @__PURE__ */ jsx27(SharedAudioContextProvider, {
28437
28586
  numberOfAudioTags,
28438
28587
  audioLatencyHint,
@@ -28615,6 +28764,7 @@ var resolveVideoConfigOrCatch = (params) => {
28615
28764
  };
28616
28765
  }
28617
28766
  };
28767
+ var SequenceStackTracesUpdateContext = React27.createContext(() => {});
28618
28768
  var getEnvVariables = () => {
28619
28769
  if (getRemotionEnvironment().isRendering) {
28620
28770
  const param = window.remotion_envVariables;
@@ -28640,7 +28790,7 @@ var setupEnvVariables = () => {
28640
28790
  window.process.env[key] = env[key];
28641
28791
  });
28642
28792
  };
28643
- var CurrentScaleContext = React27.createContext(null);
28793
+ var CurrentScaleContext = React28.createContext(null);
28644
28794
  var PreviewSizeContext = createContext21({
28645
28795
  setSize: () => {
28646
28796
  return;
@@ -28666,7 +28816,7 @@ var calculateScale = ({
28666
28816
  };
28667
28817
  var useSchema = (schema, currentValue) => {
28668
28818
  const env = useRemotionEnvironment();
28669
- const earlyReturn = useMemo28(() => {
28819
+ const earlyReturn = useMemo29(() => {
28670
28820
  if (!env.isStudio || env.isReadOnlyStudio) {
28671
28821
  return {
28672
28822
  controls: undefined,
@@ -28678,35 +28828,64 @@ var useSchema = (schema, currentValue) => {
28678
28828
  if (earlyReturn) {
28679
28829
  return earlyReturn;
28680
28830
  }
28681
- const [overrideId] = useState17(() => String(Math.random()));
28682
- const { overrides } = useContext32(SequenceControlOverrideContext);
28683
- return useMemo28(() => {
28831
+ const [overrideId] = useState16(() => String(Math.random()));
28832
+ const {
28833
+ visualModeEnabled,
28834
+ dragOverrides: overrides,
28835
+ codeValues
28836
+ } = useContext31(VisualModeOverridesContext);
28837
+ const controls = useMemo29(() => {
28838
+ if (!visualModeEnabled) {
28839
+ return;
28840
+ }
28684
28841
  if (schema === null || currentValue === null) {
28842
+ return;
28843
+ }
28844
+ return {
28845
+ schema,
28846
+ currentValue,
28847
+ overrideId
28848
+ };
28849
+ }, [schema, currentValue, overrideId, visualModeEnabled]);
28850
+ return useMemo29(() => {
28851
+ if (controls === undefined || currentValue === null || schema === null || !visualModeEnabled) {
28685
28852
  return {
28686
28853
  controls: undefined,
28687
28854
  values: currentValue ?? {}
28688
28855
  };
28689
28856
  }
28690
28857
  const overrideValues = overrides[overrideId] ?? {};
28691
- const merged = { ...currentValue };
28692
- for (const key of Object.keys(overrideValues)) {
28693
- if (key in merged) {
28694
- merged[key] = overrideValues[key];
28695
- }
28858
+ const propStatus = codeValues[overrideId];
28859
+ const currentValueKeys = Object.keys(currentValue);
28860
+ const keysToUpdate = new Set(currentValueKeys).values();
28861
+ const merged = {};
28862
+ for (const key of keysToUpdate) {
28863
+ const codeValueStatus = propStatus?.[key] ?? null;
28864
+ merged[key] = getEffectiveVisualModeValue({
28865
+ codeValue: codeValueStatus,
28866
+ runtimeValue: currentValue[key],
28867
+ dragOverrideValue: overrideValues[key],
28868
+ defaultValue: schema[key]?.default,
28869
+ shouldResortToDefaultValueIfUndefined: false
28870
+ });
28696
28871
  }
28697
28872
  return {
28698
- controls: {
28699
- schema,
28700
- currentValue,
28701
- overrideId
28702
- },
28873
+ controls,
28703
28874
  values: merged
28704
28875
  };
28705
- }, [schema, currentValue, overrides, overrideId]);
28876
+ }, [
28877
+ controls,
28878
+ currentValue,
28879
+ overrideId,
28880
+ overrides,
28881
+ codeValues,
28882
+ schema,
28883
+ visualModeEnabled
28884
+ ]);
28706
28885
  };
28707
28886
  var useSequenceControlOverride = (key) => {
28708
- const seqContext = useContext33(SequenceContext);
28709
- const { overrides } = useContext33(SequenceControlOverrideContext);
28887
+ const seqContext = useContext32(SequenceContext);
28888
+ const { dragOverrides: overrides } = useContext32(VisualModeOverridesContext);
28710
28889
  if (!seqContext) {
28711
28890
  return;
28712
28891
  }
@@ -28743,13 +28922,13 @@ var OffthreadVideoForRendering = ({
28743
28922
  const frame = useCurrentFrame();
28744
28923
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
28745
28924
  const videoConfig = useUnsafeVideoConfig();
28746
- const sequenceContext = useContext34(SequenceContext);
28925
+ const sequenceContext = useContext33(SequenceContext);
28747
28926
  const mediaStartsAt = useMediaStartsAt();
28748
- const { registerRenderAsset, unregisterRenderAsset } = useContext34(RenderAssetManager);
28927
+ const { registerRenderAsset, unregisterRenderAsset } = useContext33(RenderAssetManager);
28749
28928
  if (!src) {
28750
28929
  throw new TypeError("No `src` was passed to <OffthreadVideo>.");
28751
28930
  }
28752
- const id = useMemo29(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
28931
+ const id = useMemo30(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
28753
28932
  src,
28754
28933
  sequenceContext?.cumulatedFrom,
28755
28934
  sequenceContext?.relativeFrom,
@@ -28764,7 +28943,7 @@ var OffthreadVideoForRendering = ({
28764
28943
  mediaVolume: 1
28765
28944
  });
28766
28945
  warnAboutTooHighVolume(volume);
28767
- useEffect15(() => {
28946
+ useEffect14(() => {
28768
28947
  if (!src) {
28769
28948
  throw new Error("No src passed");
28770
28949
  }
@@ -28804,14 +28983,14 @@ var OffthreadVideoForRendering = ({
28804
28983
  sequenceContext?.relativeFrom,
28805
28984
  audioStreamIndex
28806
28985
  ]);
28807
- const currentTime = useMemo29(() => {
28986
+ const currentTime = useMemo30(() => {
28808
28987
  return getExpectedMediaFrameUncorrected({
28809
28988
  frame,
28810
28989
  playbackRate: playbackRate || 1,
28811
28990
  startFrom: -mediaStartsAt
28812
28991
  }) / videoConfig.fps;
28813
28992
  }, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
28814
- const actualSrc = useMemo29(() => {
28993
+ const actualSrc = useMemo30(() => {
28815
28994
  return getOffthreadVideoSource({
28816
28995
  src,
28817
28996
  currentTime,
@@ -28819,7 +28998,7 @@ var OffthreadVideoForRendering = ({
28819
28998
  toneMapped
28820
28999
  });
28821
29000
  }, [toneMapped, currentTime, src, transparent]);
28822
- const [imageSrc, setImageSrc] = useState18(null);
29001
+ const [imageSrc, setImageSrc] = useState17(null);
28823
29002
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
28824
29003
  useLayoutEffect10(() => {
28825
29004
  if (!window.remotion_videoEnabled) {
@@ -28892,17 +29071,17 @@ var OffthreadVideoForRendering = ({
28892
29071
  continueRender2,
28893
29072
  delayRender2
28894
29073
  ]);
28895
- const onErr = useCallback14(() => {
29074
+ const onErr = useCallback15(() => {
28896
29075
  if (onError) {
28897
29076
  onError?.(new Error("Failed to load image with src " + imageSrc));
28898
29077
  } else {
28899
29078
  cancelRender("Failed to load image with src " + imageSrc);
28900
29079
  }
28901
29080
  }, [imageSrc, onError]);
28902
- const className = useMemo29(() => {
29081
+ const className = useMemo30(() => {
28903
29082
  return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy2).join(" ");
28904
29083
  }, [props2.className]);
28905
- const onImageFrame = useCallback14((img) => {
29084
+ const onImageFrame = useCallback15((img) => {
28906
29085
  if (onVideoFrame) {
28907
29086
  onVideoFrame(img);
28908
29087
  }
@@ -28925,7 +29104,7 @@ var useEmitVideoFrame = ({
28925
29104
  ref,
28926
29105
  onVideoFrame
28927
29106
  }) => {
28928
- useEffect16(() => {
29107
+ useEffect15(() => {
28929
29108
  const { current } = ref;
28930
29109
  if (!current) {
28931
29110
  return;
@@ -28948,12 +29127,12 @@ var useEmitVideoFrame = ({
28948
29127
  }, [onVideoFrame, ref]);
28949
29128
  };
28950
29129
  var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
28951
- const context = useContext35(SharedAudioContext);
29130
+ const context = useContext34(SharedAudioContext);
28952
29131
  if (!context) {
28953
29132
  throw new Error("SharedAudioContext not found");
28954
29133
  }
28955
29134
  const videoRef = useRef19(null);
28956
- const sharedSource = useMemo30(() => {
29135
+ const sharedSource = useMemo31(() => {
28957
29136
  if (!context.audioContext) {
28958
29137
  return null;
28959
29138
  }
@@ -28962,7 +29141,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
28962
29141
  ref: videoRef
28963
29142
  });
28964
29143
  }, [context.audioContext]);
28965
- const effectToUse = React29.useInsertionEffect ?? React29.useLayoutEffect;
29144
+ const effectToUse = React30.useInsertionEffect ?? React30.useLayoutEffect;
28966
29145
  effectToUse(() => {
28967
29146
  return () => {
28968
29147
  requestAnimationFrame(() => {
@@ -29004,11 +29183,11 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
29004
29183
  }
29005
29184
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
29006
29185
  const { fps, durationInFrames } = useVideoConfig();
29007
- const parentSequence = useContext35(SequenceContext);
29008
- const { hidden } = useContext35(SequenceVisibilityToggleContext);
29186
+ const parentSequence = useContext34(SequenceContext);
29187
+ const { hidden } = useContext34(SequenceVisibilityToggleContext);
29009
29188
  const logLevel = useLogLevel();
29010
29189
  const mountTime = useMountTime();
29011
- const [timelineId] = useState19(() => String(Math.random()));
29190
+ const [timelineId] = useState18(() => String(Math.random()));
29012
29191
  const isSequenceHidden = hidden[timelineId] ?? false;
29013
29192
  if (typeof acceptableTimeShift !== "undefined") {
29014
29193
  throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
@@ -29074,13 +29253,13 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
29074
29253
  useImperativeHandle9(ref, () => {
29075
29254
  return videoRef.current;
29076
29255
  }, []);
29077
- useState19(() => playbackLogging({
29256
+ useState18(() => playbackLogging({
29078
29257
  logLevel,
29079
29258
  message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
29080
29259
  tag: "video",
29081
29260
  mountTime
29082
29261
  }));
29083
- useEffect17(() => {
29262
+ useEffect16(() => {
29084
29263
  const { current } = videoRef;
29085
29264
  if (!current) {
29086
29265
  return;
@@ -29111,7 +29290,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
29111
29290
  const currentOnDurationCallback = useRef19(onDuration);
29112
29291
  currentOnDurationCallback.current = onDuration;
29113
29292
  useEmitVideoFrame({ ref: videoRef, onVideoFrame });
29114
- useEffect17(() => {
29293
+ useEffect16(() => {
29115
29294
  const { current } = videoRef;
29116
29295
  if (!current) {
29117
29296
  return;
@@ -29128,7 +29307,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
29128
29307
  current.removeEventListener("loadedmetadata", onLoadedMetadata);
29129
29308
  };
29130
29309
  }, [src]);
29131
- useEffect17(() => {
29310
+ useEffect16(() => {
29132
29311
  const { current } = videoRef;
29133
29312
  if (!current) {
29134
29313
  return;
@@ -29139,7 +29318,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
29139
29318
  current.preload = "auto";
29140
29319
  }
29141
29320
  }, []);
29142
- const actualStyle = useMemo30(() => {
29321
+ const actualStyle = useMemo31(() => {
29143
29322
  return {
29144
29323
  ...style,
29145
29324
  opacity: isSequenceHidden ? 0 : style?.opacity ?? 1
@@ -29179,7 +29358,7 @@ var InnerOffthreadVideo = (props2) => {
29179
29358
  if (environment.isClientSideRendering) {
29180
29359
  throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
29181
29360
  }
29182
- const onDuration = useCallback15(() => {
29361
+ const onDuration = useCallback16(() => {
29183
29362
  return;
29184
29363
  }, []);
29185
29364
  if (typeof props2.src !== "string") {
@@ -29320,20 +29499,82 @@ var OffthreadVideo = ({
29320
29499
  };
29321
29500
  addSequenceStackTraces(OffthreadVideo);
29322
29501
  var WATCH_REMOTION_STATIC_FILES = "remotion_staticFilesChanged";
29502
+ var getNestedValue = (obj, key) => {
29503
+ const parts = key.split(".");
29504
+ let current = obj;
29505
+ for (const part of parts) {
29506
+ if (current === null || current === undefined || typeof current !== "object")
29507
+ return;
29508
+ current = current[part];
29509
+ }
29510
+ return current;
29511
+ };
29512
+ var mergeValues = (props2, values, schemaKeys) => {
29513
+ const merged = { ...props2 };
29514
+ for (const key of schemaKeys) {
29515
+ const value = values[key];
29516
+ const parts = key.split(".");
29517
+ if (parts.length === 1) {
29518
+ merged[key] = value;
29519
+ continue;
29520
+ }
29521
+ let current = merged;
29522
+ for (let i = 0;i < parts.length - 1; i++) {
29523
+ const part = parts[i];
29524
+ if (typeof current[part] === "object" && current[part] !== null) {
29525
+ current[part] = { ...current[part] };
29526
+ } else {
29527
+ current[part] = {};
29528
+ }
29529
+ current = current[part];
29530
+ }
29531
+ current[parts[parts.length - 1]] = value;
29532
+ }
29533
+ return merged;
29534
+ };
29535
+ var wrapInSchema = (Component, schema) => {
29536
+ const schemaKeys = Object.keys(schema);
29537
+ const Wrapped = forwardRef10((props2, ref) => {
29538
+ const env = useRemotionEnvironment();
29539
+ if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
29540
+ return React32.createElement(Component, {
29541
+ ...props2,
29542
+ controls: null,
29543
+ ref
29544
+ });
29545
+ }
29546
+ const schemaInput = useMemo32(() => {
29547
+ const input = {};
29548
+ for (const key of schemaKeys) {
29549
+ input[key] = getNestedValue(props2, key);
29550
+ }
29551
+ return input;
29552
+ }, schemaKeys.map((key) => getNestedValue(props2, key)));
29553
+ const { controls, values } = useSchema(schema, schemaInput);
29554
+ const mergedProps = mergeValues(props2, values, schemaKeys);
29555
+ return React32.createElement(Component, {
29556
+ ...mergedProps,
29557
+ controls,
29558
+ ref
29559
+ });
29560
+ });
29561
+ Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
29562
+ return Wrapped;
29563
+ };
29323
29564
  function useRemotionContexts() {
29324
- const compositionManagerCtx = React31.useContext(CompositionManager);
29325
- const timelineContext = React31.useContext(TimelineContext);
29326
- const setTimelineContext = React31.useContext(SetTimelineContext);
29327
- const sequenceContext = React31.useContext(SequenceContext);
29328
- const nonceContext = React31.useContext(NonceContext);
29329
- const canUseRemotionHooksContext = React31.useContext(CanUseRemotionHooks);
29330
- const preloadContext = React31.useContext(PreloadContext);
29331
- const resolveCompositionContext = React31.useContext(ResolveCompositionContext);
29332
- const renderAssetManagerContext = React31.useContext(RenderAssetManager);
29333
- const sequenceManagerContext = React31.useContext(SequenceManager);
29334
- const bufferManagerContext = React31.useContext(BufferingContextReact);
29335
- const logLevelContext = React31.useContext(LogLevelContext);
29336
- return useMemo31(() => ({
29565
+ const compositionManagerCtx = React33.useContext(CompositionManager);
29566
+ const timelineContext = React33.useContext(TimelineContext);
29567
+ const setTimelineContext = React33.useContext(SetTimelineContext);
29568
+ const sequenceContext = React33.useContext(SequenceContext);
29569
+ const nonceContext = React33.useContext(NonceContext);
29570
+ const canUseRemotionHooksContext = React33.useContext(CanUseRemotionHooks);
29571
+ const preloadContext = React33.useContext(PreloadContext);
29572
+ const resolveCompositionContext = React33.useContext(ResolveCompositionContext);
29573
+ const renderAssetManagerContext = React33.useContext(RenderAssetManager);
29574
+ const sequenceManagerContext = React33.useContext(SequenceManager);
29575
+ const bufferManagerContext = React33.useContext(BufferingContextReact);
29576
+ const logLevelContext = React33.useContext(LogLevelContext);
29577
+ return useMemo33(() => ({
29337
29578
  compositionManagerCtx,
29338
29579
  timelineContext,
29339
29580
  setTimelineContext,
@@ -29407,6 +29648,7 @@ var Internals = {
29407
29648
  useUnsafeVideoConfig,
29408
29649
  useFrameForVolumeProp,
29409
29650
  useTimelinePosition,
29651
+ useAbsoluteTimelinePosition,
29410
29652
  evaluateVolume,
29411
29653
  getAbsoluteSrc,
29412
29654
  Timeline: exports_timeline_position_state,
@@ -29416,10 +29658,12 @@ var Internals = {
29416
29658
  VideoForPreview,
29417
29659
  CompositionManager,
29418
29660
  CompositionSetters,
29419
- SequenceControlOverrideContext,
29661
+ VisualModeOverridesContext,
29420
29662
  SequenceManager,
29663
+ SequenceStackTracesUpdateContext,
29421
29664
  SequenceVisibilityToggleContext,
29422
29665
  useSchema,
29666
+ wrapInSchema,
29423
29667
  useSequenceControlOverride,
29424
29668
  RemotionRootContexts,
29425
29669
  CompositionManagerProvider,
@@ -29467,6 +29711,7 @@ var Internals = {
29467
29711
  REMOTION_STUDIO_CONTAINER_ELEMENT,
29468
29712
  RenderAssetManager,
29469
29713
  persistCurrentFrame,
29714
+ useTimelineContext,
29470
29715
  useTimelineSetFrame,
29471
29716
  isIosSafari,
29472
29717
  WATCH_REMOTION_STATIC_FILES,
@@ -29501,7 +29746,9 @@ var Internals = {
29501
29746
  TimelinePosition: exports_timeline_position_state,
29502
29747
  DelayRenderContextType,
29503
29748
  TimelineContext,
29504
- RenderAssetManagerProvider
29749
+ AbsoluteTimeContext,
29750
+ RenderAssetManagerProvider,
29751
+ getEffectiveVisualModeValue
29505
29752
  };
29506
29753
  var NUMBER = "[-+]?\\d*\\.?\\d+";
29507
29754
  var PERCENTAGE = NUMBER + "%";
@@ -29530,9 +29777,9 @@ var validateFrame = ({
29530
29777
  }
29531
29778
  };
29532
29779
  var flattenChildren = (children) => {
29533
- const childrenArray = React32.Children.toArray(children);
29780
+ const childrenArray = React34.Children.toArray(children);
29534
29781
  return childrenArray.reduce((flatChildren, child) => {
29535
- if (child.type === React32.Fragment) {
29782
+ if (child.type === React34.Fragment) {
29536
29783
  return flatChildren.concat(flattenChildren(child.props.children));
29537
29784
  }
29538
29785
  flatChildren.push(child);
@@ -29553,7 +29800,7 @@ var IsNotInsideSeriesProvider = ({ children }) => {
29553
29800
  });
29554
29801
  };
29555
29802
  var useRequireToBeInsideSeries = () => {
29556
- const isInsideSeries = React33.useContext(IsInsideSeriesContext);
29803
+ const isInsideSeries = React35.useContext(IsInsideSeriesContext);
29557
29804
  if (!isInsideSeries) {
29558
29805
  throw new Error("This component must be inside a <Series /> component.");
29559
29806
  }
@@ -29564,9 +29811,9 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
29564
29811
  children
29565
29812
  });
29566
29813
  };
29567
- var SeriesSequence = forwardRef10(SeriesSequenceRefForwardingFunction);
29814
+ var SeriesSequence = forwardRef11(SeriesSequenceRefForwardingFunction);
29568
29815
  var Series = (props2) => {
29569
- const childrenValue = useMemo32(() => {
29816
+ const childrenValue = useMemo34(() => {
29570
29817
  let startFrame = 0;
29571
29818
  const flattenedChildren = flattenChildren(props2.children);
29572
29819
  return Children.map(flattenedChildren, (child, i) => {
@@ -30099,14 +30346,14 @@ var VideoForRenderingForwardFunction = ({
30099
30346
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
30100
30347
  const videoConfig = useUnsafeVideoConfig();
30101
30348
  const videoRef = useRef20(null);
30102
- const sequenceContext = useContext36(SequenceContext);
30349
+ const sequenceContext = useContext35(SequenceContext);
30103
30350
  const mediaStartsAt = useMediaStartsAt();
30104
30351
  const environment = useRemotionEnvironment();
30105
30352
  const logLevel = useLogLevel();
30106
30353
  const mountTime = useMountTime();
30107
30354
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
30108
- const { registerRenderAsset, unregisterRenderAsset } = useContext36(RenderAssetManager);
30109
- const id = useMemo33(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
30355
+ const { registerRenderAsset, unregisterRenderAsset } = useContext35(RenderAssetManager);
30356
+ const id = useMemo35(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
30110
30357
  props2.src,
30111
30358
  sequenceContext?.cumulatedFrom,
30112
30359
  sequenceContext?.relativeFrom,
@@ -30121,7 +30368,7 @@ var VideoForRenderingForwardFunction = ({
30121
30368
  mediaVolume: 1
30122
30369
  });
30123
30370
  warnAboutTooHighVolume(volume);
30124
- useEffect18(() => {
30371
+ useEffect17(() => {
30125
30372
  if (!props2.src) {
30126
30373
  throw new Error("No src passed");
30127
30374
  }
@@ -30164,7 +30411,7 @@ var VideoForRenderingForwardFunction = ({
30164
30411
  useImperativeHandle10(ref, () => {
30165
30412
  return videoRef.current;
30166
30413
  }, []);
30167
- useEffect18(() => {
30414
+ useEffect17(() => {
30168
30415
  if (!window.remotion_videoEnabled) {
30169
30416
  return;
30170
30417
  }
@@ -30288,7 +30535,7 @@ var VideoForRenderingForwardFunction = ({
30288
30535
  ...props2
30289
30536
  });
30290
30537
  };
30291
- var VideoForRendering = forwardRef11(VideoForRenderingForwardFunction);
30538
+ var VideoForRendering = forwardRef12(VideoForRenderingForwardFunction);
30292
30539
  var VideoForwardingFunction = (props2, ref) => {
30293
30540
  const {
30294
30541
  startFrom,
@@ -30309,7 +30556,7 @@ var VideoForwardingFunction = (props2, ref) => {
30309
30556
  if (environment.isClientSideRendering) {
30310
30557
  throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
30311
30558
  }
30312
- const { durations, setDurations } = useContext37(DurationsContext);
30559
+ const { durations, setDurations } = useContext36(DurationsContext);
30313
30560
  if (typeof ref === "string") {
30314
30561
  throw new Error("string refs are not supported");
30315
30562
  }
@@ -30317,10 +30564,10 @@ var VideoForwardingFunction = (props2, ref) => {
30317
30564
  throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
30318
30565
  }
30319
30566
  const preloadedSrc = usePreload(props2.src);
30320
- const onDuration = useCallback16((src, durationInSeconds) => {
30567
+ const onDuration = useCallback17((src, durationInSeconds) => {
30321
30568
  setDurations({ type: "got-duration", durationInSeconds, src });
30322
30569
  }, [setDurations]);
30323
- const onVideoFrame = useCallback16(() => {}, []);
30570
+ const onVideoFrame = useCallback17(() => {}, []);
30324
30571
  const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
30325
30572
  validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
30326
30573
  const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
@@ -30393,7 +30640,7 @@ var VideoForwardingFunction = (props2, ref) => {
30393
30640
  onAutoPlayError: onAutoPlayError ?? undefined
30394
30641
  });
30395
30642
  };
30396
- var Html5Video = forwardRef12(VideoForwardingFunction);
30643
+ var Html5Video = forwardRef13(VideoForwardingFunction);
30397
30644
  addSequenceStackTraces(Html5Video);
30398
30645
  checkMultipleRemotionVersions();
30399
30646
  var proxyObj = {};
@@ -30433,8 +30680,8 @@ import { jsx as jsx83 } from "react/jsx-runtime";
30433
30680
  import React52 from "react";
30434
30681
  import { jsx as jsx93 } from "react/jsx-runtime";
30435
30682
  import { jsx as jsx103 } from "react/jsx-runtime";
30436
- import { jsx as jsx112 } from "react/jsx-runtime";
30437
- import * as React34 from "react";
30683
+ import { jsx as jsx113 } from "react/jsx-runtime";
30684
+ import * as React342 from "react";
30438
30685
  import * as ReactDOM4 from "react-dom";
30439
30686
  import React9 from "react";
30440
30687
  import * as React6 from "react";
@@ -30473,13 +30720,13 @@ import * as React252 from "react";
30473
30720
  import * as React26 from "react";
30474
30721
  import { jsx as jsx223 } from "react/jsx-runtime";
30475
30722
  import * as React332 from "react";
30476
- import * as React292 from "react";
30723
+ import * as React29 from "react";
30477
30724
  import { useState as useState112 } from "react";
30478
30725
  import * as React272 from "react";
30479
- import * as React28 from "react";
30726
+ import * as React282 from "react";
30480
30727
  import * as React322 from "react";
30481
- import * as React312 from "react";
30482
- import * as React30 from "react";
30728
+ import * as React31 from "react";
30729
+ import * as React302 from "react";
30483
30730
  import { Fragment as Fragment62, jsx as jsx232, jsxs as jsxs4 } from "react/jsx-runtime";
30484
30731
  import { forwardRef as forwardRef132, createElement as createElement7 } from "react";
30485
30732
  import { forwardRef as forwardRef122, createElement as createElement6 } from "react";
@@ -30491,7 +30738,7 @@ import * as React36 from "react";
30491
30738
  import { jsx as jsx262 } from "react/jsx-runtime";
30492
30739
  import * as React46 from "react";
30493
30740
  import React39 from "react";
30494
- import * as React37 from "react";
30741
+ import * as React372 from "react";
30495
30742
  import * as React38 from "react";
30496
30743
  import { Fragment as Fragment22, jsx as jsx272 } from "react/jsx-runtime";
30497
30744
  import { jsx as jsx282 } from "react/jsx-runtime";
@@ -30534,19 +30781,19 @@ var getChildNodeFrom = (htmlElement) => {
30534
30781
  return childNode;
30535
30782
  };
30536
30783
  var useHoverTransforms = (ref, disabled) => {
30537
- const [state, setState] = React5.useState({
30784
+ const [state, setState] = React4.useState({
30538
30785
  progress: 0,
30539
30786
  isActive: false
30540
30787
  });
30541
- const eventTarget = useMemo34(() => new EventTarget, []);
30542
- useEffect19(() => {
30788
+ const eventTarget = useMemo36(() => new EventTarget, []);
30789
+ useEffect18(() => {
30543
30790
  if (disabled) {
30544
30791
  eventTarget.dispatchEvent(new Event("disabled"));
30545
30792
  } else {
30546
30793
  eventTarget.dispatchEvent(new Event("enabled"));
30547
30794
  }
30548
30795
  }, [disabled, eventTarget]);
30549
- React5.useEffect(() => {
30796
+ React4.useEffect(() => {
30550
30797
  const element = ref.current;
30551
30798
  if (!element)
30552
30799
  return;
@@ -30621,8 +30868,8 @@ var useHoverTransforms = (ref, disabled) => {
30621
30868
  return state;
30622
30869
  };
30623
30870
  var useClickTransforms = (ref) => {
30624
- const [hoverProgress, setHoverProgress] = React5.useState(0);
30625
- React5.useEffect(() => {
30871
+ const [hoverProgress, setHoverProgress] = React4.useState(0);
30872
+ React4.useEffect(() => {
30626
30873
  const element = getChildNodeFrom(ref.current);
30627
30874
  if (!element) {
30628
30875
  return;
@@ -30685,8 +30932,8 @@ var getAngle = (ref, coordinates) => {
30685
30932
  };
30686
30933
  var lastCoordinates = null;
30687
30934
  var useMousePosition = (ref) => {
30688
- const [angle, setAngle] = useState20(getAngle(ref.current, lastCoordinates));
30689
- useEffect19(() => {
30935
+ const [angle, setAngle] = useState19(getAngle(ref.current, lastCoordinates));
30936
+ useEffect18(() => {
30690
30937
  const element = ref.current;
30691
30938
  if (!element) {
30692
30939
  return;
@@ -30853,7 +31100,7 @@ var Button = ({
30853
31100
  const [dimensions, setDimensions] = useState22(null);
30854
31101
  const ref = useRef22(null);
30855
31102
  const { isActive, progress } = useHoverTransforms(ref, Boolean(disabled || loading));
30856
- const onPointerEnter = useCallback17((e) => {
31103
+ const onPointerEnter = useCallback18((e) => {
30857
31104
  if (e.pointerType !== "mouse") {
30858
31105
  return;
30859
31106
  }
@@ -31085,11 +31332,11 @@ var Link = ({
31085
31332
  });
31086
31333
  };
31087
31334
  var PlanePaperIcon = (props) => {
31088
- return /* @__PURE__ */ jsx112("svg", {
31335
+ return /* @__PURE__ */ jsx113("svg", {
31089
31336
  xmlns: "http://www.w3.org/2000/svg",
31090
31337
  ...props,
31091
31338
  viewBox: "0 0 576 512",
31092
- children: /* @__PURE__ */ jsx112("path", {
31339
+ children: /* @__PURE__ */ jsx113("path", {
31093
31340
  fill: "currentcolor",
31094
31341
  d: "M169.9 280L94.9 448.6 461.2 280 169.9 280zm291.3-48L94.9 63.4 169.9 232 461.2 232zM34.8 465.6L128 256 34.8 46.4C33 42.2 32 37.6 32 33 32 14.8 46.7 0 64.8 0 69.5 0 74.2 1 78.5 3L554.2 222c13.3 6.1 21.8 19.4 21.8 34s-8.5 27.9-21.8 34L78.5 509c-4.3 2-9 3-13.7 3-18.1 0-32.8-14.8-32.8-33 0-4.6 1-9.2 2.8-13.4z"
31095
31342
  })
@@ -34258,7 +34505,7 @@ var SideCar = function(_a) {
34258
34505
  if (!Target) {
34259
34506
  throw new Error("Sidecar medium not found");
34260
34507
  }
34261
- return React28.createElement(Target, __assign({}, rest));
34508
+ return React282.createElement(Target, __assign({}, rest));
34262
34509
  };
34263
34510
  SideCar.isSideCarExport = true;
34264
34511
  function exportSidecar(medium, exported) {
@@ -34269,9 +34516,9 @@ var effectCar = createSidecarMedium();
34269
34516
  var nothing = function() {
34270
34517
  return;
34271
34518
  };
34272
- var RemoveScroll = React292.forwardRef(function(props, parentRef) {
34273
- var ref = React292.useRef(null);
34274
- var _a = React292.useState({
34519
+ var RemoveScroll = React29.forwardRef(function(props, parentRef) {
34520
+ var ref = React29.useRef(null);
34521
+ var _a = React29.useState({
34275
34522
  onScrollCapture: nothing,
34276
34523
  onWheelCapture: nothing,
34277
34524
  onTouchMoveCapture: nothing
@@ -34280,7 +34527,7 @@ var RemoveScroll = React292.forwardRef(function(props, parentRef) {
34280
34527
  var SideCar2 = sideCar;
34281
34528
  var containerRef = useMergeRefs([ref, parentRef]);
34282
34529
  var containerProps = __assign(__assign({}, rest), callbacks);
34283
- return React292.createElement(React292.Fragment, null, enabled && React292.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }), forwardProps ? React292.cloneElement(React292.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React292.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children));
34530
+ return React29.createElement(React29.Fragment, null, enabled && React29.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }), forwardProps ? React29.cloneElement(React29.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React29.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children));
34284
34531
  });
34285
34532
  RemoveScroll.defaultProps = {
34286
34533
  enabled: true,
@@ -34348,7 +34595,7 @@ var stylesheetSingleton = function() {
34348
34595
  var styleHookSingleton = function() {
34349
34596
  var sheet = stylesheetSingleton();
34350
34597
  return function(styles, isDynamic) {
34351
- React30.useEffect(function() {
34598
+ React302.useEffect(function() {
34352
34599
  sheet.add(styles);
34353
34600
  return function() {
34354
34601
  sheet.remove();
@@ -34453,7 +34700,7 @@ var getCurrentUseCounter = function() {
34453
34700
  return isFinite(counter) ? counter : 0;
34454
34701
  };
34455
34702
  var useLockAttribute = function() {
34456
- React312.useEffect(function() {
34703
+ React31.useEffect(function() {
34457
34704
  document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
34458
34705
  return function() {
34459
34706
  var newCounter = getCurrentUseCounter() - 1;
@@ -34468,10 +34715,10 @@ var useLockAttribute = function() {
34468
34715
  var RemoveScrollBar = function(_a) {
34469
34716
  var { noRelative, noImportant, gapMode: _b } = _a, gapMode = _b === undefined ? "margin" : _b;
34470
34717
  useLockAttribute();
34471
- var gap = React312.useMemo(function() {
34718
+ var gap = React31.useMemo(function() {
34472
34719
  return getGapWidth(gapMode);
34473
34720
  }, [gapMode]);
34474
- return React312.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
34721
+ return React31.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
34475
34722
  };
34476
34723
  var passiveSupported = false;
34477
34724
  if (typeof window !== "undefined") {
@@ -34772,9 +35019,9 @@ var Select = (props) => {
34772
35019
  required
34773
35020
  } = props;
34774
35021
  const popperScope = usePopperScope(__scopeSelect);
34775
- const [trigger, setTrigger] = React34.useState(null);
34776
- const [valueNode, setValueNode] = React34.useState(null);
34777
- const [valueNodeHasChildren, setValueNodeHasChildren] = React34.useState(false);
35022
+ const [trigger, setTrigger] = React342.useState(null);
35023
+ const [valueNode, setValueNode] = React342.useState(null);
35024
+ const [valueNodeHasChildren, setValueNodeHasChildren] = React342.useState(false);
34778
35025
  const direction = useDirection(dir);
34779
35026
  const [open = false, setOpen] = useControllableState({
34780
35027
  prop: openProp,
@@ -34786,9 +35033,9 @@ var Select = (props) => {
34786
35033
  defaultProp: defaultValue,
34787
35034
  onChange: onValueChange
34788
35035
  });
34789
- const triggerPointerDownPosRef = React34.useRef(null);
35036
+ const triggerPointerDownPosRef = React342.useRef(null);
34790
35037
  const isFormControl = trigger ? Boolean(trigger.closest("form")) : true;
34791
- const [nativeOptionsSet, setNativeOptionsSet] = React34.useState(/* @__PURE__ */ new Set);
35038
+ const [nativeOptionsSet, setNativeOptionsSet] = React342.useState(/* @__PURE__ */ new Set);
34792
35039
  const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
34793
35040
  return /* @__PURE__ */ jsx232(Root22, { ...popperScope, children: /* @__PURE__ */ jsxs4(SelectProvider, {
34794
35041
  required,
@@ -34810,10 +35057,10 @@ var Select = (props) => {
34810
35057
  children: [
34811
35058
  /* @__PURE__ */ jsx232(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsx232(SelectNativeOptionsProvider, {
34812
35059
  scope: props.__scopeSelect,
34813
- onNativeOptionAdd: React34.useCallback((option) => {
35060
+ onNativeOptionAdd: React342.useCallback((option) => {
34814
35061
  setNativeOptionsSet((prev) => new Set(prev).add(option));
34815
35062
  }, []),
34816
- onNativeOptionRemove: React34.useCallback((option) => {
35063
+ onNativeOptionRemove: React342.useCallback((option) => {
34817
35064
  setNativeOptionsSet((prev) => {
34818
35065
  const optionsSet = new Set(prev);
34819
35066
  optionsSet.delete(option);
@@ -34841,7 +35088,7 @@ var Select = (props) => {
34841
35088
  };
34842
35089
  Select.displayName = SELECT_NAME;
34843
35090
  var TRIGGER_NAME = "SelectTrigger";
34844
- var SelectTrigger = React34.forwardRef((props, forwardedRef) => {
35091
+ var SelectTrigger = React342.forwardRef((props, forwardedRef) => {
34845
35092
  const { __scopeSelect, disabled = false, ...triggerProps } = props;
34846
35093
  const popperScope = usePopperScope(__scopeSelect);
34847
35094
  const context = useSelectContext(TRIGGER_NAME, __scopeSelect);
@@ -34909,7 +35156,7 @@ var SelectTrigger = React34.forwardRef((props, forwardedRef) => {
34909
35156
  });
34910
35157
  SelectTrigger.displayName = TRIGGER_NAME;
34911
35158
  var VALUE_NAME = "SelectValue";
34912
- var SelectValue = React34.forwardRef((props, forwardedRef) => {
35159
+ var SelectValue = React342.forwardRef((props, forwardedRef) => {
34913
35160
  const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props;
34914
35161
  const context = useSelectContext(VALUE_NAME, __scopeSelect);
34915
35162
  const { onValueNodeHasChildrenChange } = context;
@@ -34927,7 +35174,7 @@ var SelectValue = React34.forwardRef((props, forwardedRef) => {
34927
35174
  });
34928
35175
  SelectValue.displayName = VALUE_NAME;
34929
35176
  var ICON_NAME = "SelectIcon";
34930
- var SelectIcon = React34.forwardRef((props, forwardedRef) => {
35177
+ var SelectIcon = React342.forwardRef((props, forwardedRef) => {
34931
35178
  const { __scopeSelect, children, ...iconProps } = props;
34932
35179
  return /* @__PURE__ */ jsx232(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "▼" });
34933
35180
  });
@@ -34938,9 +35185,9 @@ var SelectPortal = (props) => {
34938
35185
  };
34939
35186
  SelectPortal.displayName = PORTAL_NAME2;
34940
35187
  var CONTENT_NAME2 = "SelectContent";
34941
- var SelectContent = React34.forwardRef((props, forwardedRef) => {
35188
+ var SelectContent = React342.forwardRef((props, forwardedRef) => {
34942
35189
  const context = useSelectContext(CONTENT_NAME2, props.__scopeSelect);
34943
- const [fragment, setFragment] = React34.useState();
35190
+ const [fragment, setFragment] = React342.useState();
34944
35191
  useLayoutEffect22(() => {
34945
35192
  setFragment(new DocumentFragment);
34946
35193
  }, []);
@@ -34954,7 +35201,7 @@ SelectContent.displayName = CONTENT_NAME2;
34954
35201
  var CONTENT_MARGIN = 10;
34955
35202
  var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME2);
34956
35203
  var CONTENT_IMPL_NAME = "SelectContentImpl";
34957
- var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
35204
+ var SelectContentImpl = React342.forwardRef((props, forwardedRef) => {
34958
35205
  const {
34959
35206
  __scopeSelect,
34960
35207
  position = "item-aligned",
@@ -34974,20 +35221,20 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
34974
35221
  ...contentProps
34975
35222
  } = props;
34976
35223
  const context = useSelectContext(CONTENT_NAME2, __scopeSelect);
34977
- const [content, setContent] = React34.useState(null);
34978
- const [viewport, setViewport] = React34.useState(null);
35224
+ const [content, setContent] = React342.useState(null);
35225
+ const [viewport, setViewport] = React342.useState(null);
34979
35226
  const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
34980
- const [selectedItem, setSelectedItem] = React34.useState(null);
34981
- const [selectedItemText, setSelectedItemText] = React34.useState(null);
35227
+ const [selectedItem, setSelectedItem] = React342.useState(null);
35228
+ const [selectedItemText, setSelectedItemText] = React342.useState(null);
34982
35229
  const getItems = useCollection(__scopeSelect);
34983
- const [isPositioned, setIsPositioned] = React34.useState(false);
34984
- const firstValidItemFoundRef = React34.useRef(false);
34985
- React34.useEffect(() => {
35230
+ const [isPositioned, setIsPositioned] = React342.useState(false);
35231
+ const firstValidItemFoundRef = React342.useRef(false);
35232
+ React342.useEffect(() => {
34986
35233
  if (content)
34987
35234
  return hideOthers(content);
34988
35235
  }, [content]);
34989
35236
  useFocusGuards();
34990
- const focusFirst2 = React34.useCallback((candidates) => {
35237
+ const focusFirst2 = React342.useCallback((candidates) => {
34991
35238
  const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
34992
35239
  const [lastItem] = restItems.slice(-1);
34993
35240
  const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
@@ -35004,14 +35251,14 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
35004
35251
  return;
35005
35252
  }
35006
35253
  }, [getItems, viewport]);
35007
- const focusSelectedItem = React34.useCallback(() => focusFirst2([selectedItem, content]), [focusFirst2, selectedItem, content]);
35008
- React34.useEffect(() => {
35254
+ const focusSelectedItem = React342.useCallback(() => focusFirst2([selectedItem, content]), [focusFirst2, selectedItem, content]);
35255
+ React342.useEffect(() => {
35009
35256
  if (isPositioned) {
35010
35257
  focusSelectedItem();
35011
35258
  }
35012
35259
  }, [isPositioned, focusSelectedItem]);
35013
35260
  const { onOpenChange, triggerPointerDownPosRef } = context;
35014
- React34.useEffect(() => {
35261
+ React342.useEffect(() => {
35015
35262
  if (content) {
35016
35263
  let pointerMoveDelta = { x: 0, y: 0 };
35017
35264
  const handlePointerMove = (event2) => {
@@ -35041,7 +35288,7 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
35041
35288
  };
35042
35289
  }
35043
35290
  }, [content, onOpenChange, triggerPointerDownPosRef]);
35044
- React34.useEffect(() => {
35291
+ React342.useEffect(() => {
35045
35292
  const close = () => onOpenChange(false);
35046
35293
  window.addEventListener("blur", close);
35047
35294
  window.addEventListener("resize", close);
@@ -35058,7 +35305,7 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
35058
35305
  setTimeout(() => nextItem.ref.current.focus());
35059
35306
  }
35060
35307
  });
35061
- const itemRefCallback = React34.useCallback((node, value, disabled) => {
35308
+ const itemRefCallback = React342.useCallback((node, value, disabled) => {
35062
35309
  const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
35063
35310
  const isSelectedItem = context.value !== undefined && context.value === value;
35064
35311
  if (isSelectedItem || isFirstValidItem) {
@@ -35067,8 +35314,8 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
35067
35314
  firstValidItemFoundRef.current = true;
35068
35315
  }
35069
35316
  }, [context.value]);
35070
- const handleItemLeave = React34.useCallback(() => content?.focus(), [content]);
35071
- const itemTextRefCallback = React34.useCallback((node, value, disabled) => {
35317
+ const handleItemLeave = React342.useCallback(() => content?.focus(), [content]);
35318
+ const itemTextRefCallback = React342.useCallback((node, value, disabled) => {
35072
35319
  const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
35073
35320
  const isSelectedItem = context.value !== undefined && context.value === value;
35074
35321
  if (isSelectedItem || isFirstValidItem) {
@@ -35163,18 +35410,18 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
35163
35410
  });
35164
35411
  SelectContentImpl.displayName = CONTENT_IMPL_NAME;
35165
35412
  var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
35166
- var SelectItemAlignedPosition = React34.forwardRef((props, forwardedRef) => {
35413
+ var SelectItemAlignedPosition = React342.forwardRef((props, forwardedRef) => {
35167
35414
  const { __scopeSelect, onPlaced, ...popperProps } = props;
35168
35415
  const context = useSelectContext(CONTENT_NAME2, __scopeSelect);
35169
35416
  const contentContext = useSelectContentContext(CONTENT_NAME2, __scopeSelect);
35170
- const [contentWrapper, setContentWrapper] = React34.useState(null);
35171
- const [content, setContent] = React34.useState(null);
35417
+ const [contentWrapper, setContentWrapper] = React342.useState(null);
35418
+ const [content, setContent] = React342.useState(null);
35172
35419
  const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
35173
35420
  const getItems = useCollection(__scopeSelect);
35174
- const shouldExpandOnScrollRef = React34.useRef(false);
35175
- const shouldRepositionRef = React34.useRef(true);
35421
+ const shouldExpandOnScrollRef = React342.useRef(false);
35422
+ const shouldRepositionRef = React342.useRef(true);
35176
35423
  const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
35177
- const position = React34.useCallback(() => {
35424
+ const position = React342.useCallback(() => {
35178
35425
  if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
35179
35426
  const triggerRect = context.trigger.getBoundingClientRect();
35180
35427
  const contentRect = content.getBoundingClientRect();
@@ -35255,12 +35502,12 @@ var SelectItemAlignedPosition = React34.forwardRef((props, forwardedRef) => {
35255
35502
  onPlaced
35256
35503
  ]);
35257
35504
  useLayoutEffect22(() => position(), [position]);
35258
- const [contentZIndex, setContentZIndex] = React34.useState();
35505
+ const [contentZIndex, setContentZIndex] = React342.useState();
35259
35506
  useLayoutEffect22(() => {
35260
35507
  if (content)
35261
35508
  setContentZIndex(window.getComputedStyle(content).zIndex);
35262
35509
  }, [content]);
35263
- const handleScrollButtonChange = React34.useCallback((node) => {
35510
+ const handleScrollButtonChange = React342.useCallback((node) => {
35264
35511
  if (node && shouldRepositionRef.current === true) {
35265
35512
  position();
35266
35513
  focusSelectedItem?.();
@@ -35294,7 +35541,7 @@ var SelectItemAlignedPosition = React34.forwardRef((props, forwardedRef) => {
35294
35541
  });
35295
35542
  SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
35296
35543
  var POPPER_POSITION_NAME = "SelectPopperPosition";
35297
- var SelectPopperPosition = React34.forwardRef((props, forwardedRef) => {
35544
+ var SelectPopperPosition = React342.forwardRef((props, forwardedRef) => {
35298
35545
  const {
35299
35546
  __scopeSelect,
35300
35547
  align = "start",
@@ -35324,12 +35571,12 @@ var SelectPopperPosition = React34.forwardRef((props, forwardedRef) => {
35324
35571
  SelectPopperPosition.displayName = POPPER_POSITION_NAME;
35325
35572
  var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME2, {});
35326
35573
  var VIEWPORT_NAME = "SelectViewport";
35327
- var SelectViewport = React34.forwardRef((props, forwardedRef) => {
35574
+ var SelectViewport = React342.forwardRef((props, forwardedRef) => {
35328
35575
  const { __scopeSelect, nonce, ...viewportProps } = props;
35329
35576
  const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);
35330
35577
  const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
35331
35578
  const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
35332
- const prevScrollTopRef = React34.useRef(0);
35579
+ const prevScrollTopRef = React342.useRef(0);
35333
35580
  return /* @__PURE__ */ jsxs4(Fragment62, { children: [
35334
35581
  /* @__PURE__ */ jsx232("style", {
35335
35582
  dangerouslySetInnerHTML: {
@@ -35378,14 +35625,14 @@ var SelectViewport = React34.forwardRef((props, forwardedRef) => {
35378
35625
  SelectViewport.displayName = VIEWPORT_NAME;
35379
35626
  var GROUP_NAME = "SelectGroup";
35380
35627
  var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME);
35381
- var SelectGroup = React34.forwardRef((props, forwardedRef) => {
35628
+ var SelectGroup = React342.forwardRef((props, forwardedRef) => {
35382
35629
  const { __scopeSelect, ...groupProps } = props;
35383
35630
  const groupId = useId();
35384
35631
  return /* @__PURE__ */ jsx232(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx232(Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
35385
35632
  });
35386
35633
  SelectGroup.displayName = GROUP_NAME;
35387
35634
  var LABEL_NAME = "SelectLabel";
35388
- var SelectLabel = React34.forwardRef((props, forwardedRef) => {
35635
+ var SelectLabel = React342.forwardRef((props, forwardedRef) => {
35389
35636
  const { __scopeSelect, ...labelProps } = props;
35390
35637
  const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
35391
35638
  return /* @__PURE__ */ jsx232(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
@@ -35393,7 +35640,7 @@ var SelectLabel = React34.forwardRef((props, forwardedRef) => {
35393
35640
  SelectLabel.displayName = LABEL_NAME;
35394
35641
  var ITEM_NAME = "SelectItem";
35395
35642
  var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);
35396
- var SelectItem = React34.forwardRef((props, forwardedRef) => {
35643
+ var SelectItem = React342.forwardRef((props, forwardedRef) => {
35397
35644
  const {
35398
35645
  __scopeSelect,
35399
35646
  value,
@@ -35404,8 +35651,8 @@ var SelectItem = React34.forwardRef((props, forwardedRef) => {
35404
35651
  const context = useSelectContext(ITEM_NAME, __scopeSelect);
35405
35652
  const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);
35406
35653
  const isSelected = context.value === value;
35407
- const [textValue, setTextValue] = React34.useState(textValueProp ?? "");
35408
- const [isFocused, setIsFocused] = React34.useState(false);
35654
+ const [textValue, setTextValue] = React342.useState(textValueProp ?? "");
35655
+ const [isFocused, setIsFocused] = React342.useState(false);
35409
35656
  const composedRefs = useComposedRefs(forwardedRef, (node) => contentContext.itemRefCallback?.(node, value, disabled));
35410
35657
  const textId = useId();
35411
35658
  const handleSelect = () => {
@@ -35423,7 +35670,7 @@ var SelectItem = React34.forwardRef((props, forwardedRef) => {
35423
35670
  disabled,
35424
35671
  textId,
35425
35672
  isSelected,
35426
- onItemTextChange: React34.useCallback((node) => {
35673
+ onItemTextChange: React342.useCallback((node) => {
35427
35674
  setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
35428
35675
  }, []),
35429
35676
  children: /* @__PURE__ */ jsx232(Collection.ItemSlot, {
@@ -35472,16 +35719,16 @@ var SelectItem = React34.forwardRef((props, forwardedRef) => {
35472
35719
  });
35473
35720
  SelectItem.displayName = ITEM_NAME;
35474
35721
  var ITEM_TEXT_NAME = "SelectItemText";
35475
- var SelectItemText = React34.forwardRef((props, forwardedRef) => {
35722
+ var SelectItemText = React342.forwardRef((props, forwardedRef) => {
35476
35723
  const { __scopeSelect, className, style, ...itemTextProps } = props;
35477
35724
  const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
35478
35725
  const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
35479
35726
  const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
35480
35727
  const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
35481
- const [itemTextNode, setItemTextNode] = React34.useState(null);
35728
+ const [itemTextNode, setItemTextNode] = React342.useState(null);
35482
35729
  const composedRefs = useComposedRefs(forwardedRef, (node) => setItemTextNode(node), itemContext.onItemTextChange, (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled));
35483
35730
  const textContent = itemTextNode?.textContent;
35484
- const nativeOption = React34.useMemo(() => /* @__PURE__ */ jsx232("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value), [itemContext.disabled, itemContext.value, textContent]);
35731
+ const nativeOption = React342.useMemo(() => /* @__PURE__ */ jsx232("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value), [itemContext.disabled, itemContext.value, textContent]);
35485
35732
  const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;
35486
35733
  useLayoutEffect22(() => {
35487
35734
  onNativeOptionAdd(nativeOption);
@@ -35494,17 +35741,17 @@ var SelectItemText = React34.forwardRef((props, forwardedRef) => {
35494
35741
  });
35495
35742
  SelectItemText.displayName = ITEM_TEXT_NAME;
35496
35743
  var ITEM_INDICATOR_NAME = "SelectItemIndicator";
35497
- var SelectItemIndicator = React34.forwardRef((props, forwardedRef) => {
35744
+ var SelectItemIndicator = React342.forwardRef((props, forwardedRef) => {
35498
35745
  const { __scopeSelect, ...itemIndicatorProps } = props;
35499
35746
  const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
35500
35747
  return itemContext.isSelected ? /* @__PURE__ */ jsx232(Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
35501
35748
  });
35502
35749
  SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
35503
35750
  var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
35504
- var SelectScrollUpButton = React34.forwardRef((props, forwardedRef) => {
35751
+ var SelectScrollUpButton = React342.forwardRef((props, forwardedRef) => {
35505
35752
  const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
35506
35753
  const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
35507
- const [canScrollUp, setCanScrollUp] = React34.useState(false);
35754
+ const [canScrollUp, setCanScrollUp] = React342.useState(false);
35508
35755
  const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
35509
35756
  useLayoutEffect22(() => {
35510
35757
  if (contentContext.viewport && contentContext.isPositioned) {
@@ -35532,10 +35779,10 @@ var SelectScrollUpButton = React34.forwardRef((props, forwardedRef) => {
35532
35779
  });
35533
35780
  SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
35534
35781
  var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
35535
- var SelectScrollDownButton = React34.forwardRef((props, forwardedRef) => {
35782
+ var SelectScrollDownButton = React342.forwardRef((props, forwardedRef) => {
35536
35783
  const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
35537
35784
  const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
35538
- const [canScrollDown, setCanScrollDown] = React34.useState(false);
35785
+ const [canScrollDown, setCanScrollDown] = React342.useState(false);
35539
35786
  const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
35540
35787
  useLayoutEffect22(() => {
35541
35788
  if (contentContext.viewport && contentContext.isPositioned) {
@@ -35563,18 +35810,18 @@ var SelectScrollDownButton = React34.forwardRef((props, forwardedRef) => {
35563
35810
  }) : null;
35564
35811
  });
35565
35812
  SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
35566
- var SelectScrollButtonImpl = React34.forwardRef((props, forwardedRef) => {
35813
+ var SelectScrollButtonImpl = React342.forwardRef((props, forwardedRef) => {
35567
35814
  const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;
35568
35815
  const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect);
35569
- const autoScrollTimerRef = React34.useRef(null);
35816
+ const autoScrollTimerRef = React342.useRef(null);
35570
35817
  const getItems = useCollection(__scopeSelect);
35571
- const clearAutoScrollTimer = React34.useCallback(() => {
35818
+ const clearAutoScrollTimer = React342.useCallback(() => {
35572
35819
  if (autoScrollTimerRef.current !== null) {
35573
35820
  window.clearInterval(autoScrollTimerRef.current);
35574
35821
  autoScrollTimerRef.current = null;
35575
35822
  }
35576
35823
  }, []);
35577
- React34.useEffect(() => {
35824
+ React342.useEffect(() => {
35578
35825
  return () => clearAutoScrollTimer();
35579
35826
  }, [clearAutoScrollTimer]);
35580
35827
  useLayoutEffect22(() => {
@@ -35603,13 +35850,13 @@ var SelectScrollButtonImpl = React34.forwardRef((props, forwardedRef) => {
35603
35850
  });
35604
35851
  });
35605
35852
  var SEPARATOR_NAME = "SelectSeparator";
35606
- var SelectSeparator = React34.forwardRef((props, forwardedRef) => {
35853
+ var SelectSeparator = React342.forwardRef((props, forwardedRef) => {
35607
35854
  const { __scopeSelect, ...separatorProps } = props;
35608
35855
  return /* @__PURE__ */ jsx232(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
35609
35856
  });
35610
35857
  SelectSeparator.displayName = SEPARATOR_NAME;
35611
35858
  var ARROW_NAME2 = "SelectArrow";
35612
- var SelectArrow = React34.forwardRef((props, forwardedRef) => {
35859
+ var SelectArrow = React342.forwardRef((props, forwardedRef) => {
35613
35860
  const { __scopeSelect, ...arrowProps } = props;
35614
35861
  const popperScope = usePopperScope(__scopeSelect);
35615
35862
  const context = useSelectContext(ARROW_NAME2, __scopeSelect);
@@ -35620,12 +35867,12 @@ SelectArrow.displayName = ARROW_NAME2;
35620
35867
  function shouldShowPlaceholder(value) {
35621
35868
  return value === "" || value === undefined;
35622
35869
  }
35623
- var BubbleSelect = React34.forwardRef((props, forwardedRef) => {
35870
+ var BubbleSelect = React342.forwardRef((props, forwardedRef) => {
35624
35871
  const { value, ...selectProps } = props;
35625
- const ref = React34.useRef(null);
35872
+ const ref = React342.useRef(null);
35626
35873
  const composedRefs = useComposedRefs(forwardedRef, ref);
35627
35874
  const prevValue = usePrevious(value);
35628
- React34.useEffect(() => {
35875
+ React342.useEffect(() => {
35629
35876
  const select = ref.current;
35630
35877
  const selectProto = window.HTMLSelectElement.prototype;
35631
35878
  const descriptor = Object.getOwnPropertyDescriptor(selectProto, "value");
@@ -35641,9 +35888,9 @@ var BubbleSelect = React34.forwardRef((props, forwardedRef) => {
35641
35888
  BubbleSelect.displayName = "BubbleSelect";
35642
35889
  function useTypeaheadSearch(onSearchChange) {
35643
35890
  const handleSearchChange = useCallbackRef(onSearchChange);
35644
- const searchRef = React34.useRef("");
35645
- const timerRef = React34.useRef(0);
35646
- const handleTypeaheadSearch = React34.useCallback((key) => {
35891
+ const searchRef = React342.useRef("");
35892
+ const timerRef = React342.useRef(0);
35893
+ const handleTypeaheadSearch = React342.useCallback((key) => {
35647
35894
  const search = searchRef.current + key;
35648
35895
  handleSearchChange(search);
35649
35896
  (function updateSearch(value) {
@@ -35653,11 +35900,11 @@ function useTypeaheadSearch(onSearchChange) {
35653
35900
  timerRef.current = window.setTimeout(() => updateSearch(""), 1000);
35654
35901
  })(search);
35655
35902
  }, [handleSearchChange]);
35656
- const resetTypeahead = React34.useCallback(() => {
35903
+ const resetTypeahead = React342.useCallback(() => {
35657
35904
  searchRef.current = "";
35658
35905
  window.clearTimeout(timerRef.current);
35659
35906
  }, []);
35660
- React34.useEffect(() => {
35907
+ React342.useEffect(() => {
35661
35908
  return () => window.clearTimeout(timerRef.current);
35662
35909
  }, []);
35663
35910
  return [searchRef, handleTypeaheadSearch, resetTypeahead];
@@ -35936,7 +36183,7 @@ function composeRefs2(...refs) {
35936
36183
  };
35937
36184
  }
35938
36185
  function useComposedRefs2(...refs) {
35939
- return React37.useCallback(composeRefs2(...refs), refs);
36186
+ return React372.useCallback(composeRefs2(...refs), refs);
35940
36187
  }
35941
36188
  function createSlot(ownerName) {
35942
36189
  const SlotClone2 = /* @__PURE__ */ createSlotClone(ownerName);
@@ -36991,7 +37238,7 @@ var Triangle2 = (props) => {
36991
37238
  };
36992
37239
 
36993
37240
  // src/components/prompts/CopyPromptButton.tsx
36994
- import { useCallback as useCallback29, useState as useState39 } from "react";
37241
+ import { useCallback as useCallback30, useState as useState38 } from "react";
36995
37242
 
36996
37243
  // src/components/prompts/ClipboardIcon.tsx
36997
37244
  import { jsx as jsx38 } from "react/jsx-runtime";
@@ -37011,8 +37258,8 @@ var ClipboardIcon = ({ size: size4 = 16, color = "currentColor" }) => {
37011
37258
  // src/components/prompts/CopyPromptButton.tsx
37012
37259
  import { jsx as jsx39, jsxs as jsxs6 } from "react/jsx-runtime";
37013
37260
  var CopyPromptButton = ({ prompt }) => {
37014
- const [copied, setCopied] = useState39(false);
37015
- const onCopy = useCallback29(() => {
37261
+ const [copied, setCopied] = useState38(false);
37262
+ const onCopy = useCallback30(() => {
37016
37263
  navigator.clipboard.writeText(prompt);
37017
37264
  setCopied(true);
37018
37265
  setTimeout(() => setCopied(false), 2000);
@@ -37041,7 +37288,7 @@ var CopyPromptButton = ({ prompt }) => {
37041
37288
  };
37042
37289
 
37043
37290
  // src/components/prompts/LikeButton.tsx
37044
- import { useCallback as useCallback31, useEffect as useEffect40, useState as useState41 } from "react";
37291
+ import { useCallback as useCallback32, useEffect as useEffect39, useState as useState40 } from "react";
37045
37292
 
37046
37293
  // src/components/prompts/config.ts
37047
37294
  var REMOTION_PRO_ORIGIN = "https://www.remotion.pro";
@@ -37118,13 +37365,13 @@ var getRelativeTime = (dateStr) => {
37118
37365
  };
37119
37366
 
37120
37367
  // src/components/prompts/use-heart-animation.ts
37121
- import { useCallback as useCallback30, useRef as useRef38, useState as useState40 } from "react";
37368
+ import { useCallback as useCallback31, useRef as useRef38, useState as useState39 } from "react";
37122
37369
  var DURATION = 300;
37123
37370
  var useHeartAnimation = () => {
37124
- const [scale, setScale] = useState40(1);
37125
- const [roundness, setRoundness] = useState40(0.09);
37371
+ const [scale, setScale] = useState39(1);
37372
+ const [roundness, setRoundness] = useState39(0.09);
37126
37373
  const rafRef = useRef38(0);
37127
- const animate = useCallback30(() => {
37374
+ const animate = useCallback31(() => {
37128
37375
  cancelAnimationFrame(rafRef.current);
37129
37376
  const start = performance.now();
37130
37377
  const tick = (now) => {
@@ -37149,13 +37396,13 @@ var useHeartAnimation = () => {
37149
37396
  // src/components/prompts/LikeButton.tsx
37150
37397
  import { jsx as jsx40, jsxs as jsxs8 } from "react/jsx-runtime";
37151
37398
  var LikeButton = ({ submissionId, initialLikeCount }) => {
37152
- const [liked, setLiked] = useState41(false);
37153
- const [likeCount, setLikeCount] = useState41(initialLikeCount);
37399
+ const [liked, setLiked] = useState40(false);
37400
+ const [likeCount, setLikeCount] = useState40(initialLikeCount);
37154
37401
  const { scale, roundness, animate } = useHeartAnimation();
37155
- useEffect40(() => {
37402
+ useEffect39(() => {
37156
37403
  setLiked(getLikedIds().has(submissionId));
37157
37404
  }, [submissionId]);
37158
- const onClick = useCallback31(async () => {
37405
+ const onClick = useCallback32(async () => {
37159
37406
  if (liked) {
37160
37407
  setLiked(false);
37161
37408
  setLikeCount((c) => c - 1);
@@ -37228,80 +37475,80 @@ function useMediaContext2() {
37228
37475
  var AirPlayButtonBridge = createReactComponent(AirPlayButtonInstance, {
37229
37476
  domEventsRegex: /^onMedia/
37230
37477
  });
37231
- var AirPlayButton2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37478
+ var AirPlayButton2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37232
37479
  return /* @__PURE__ */ React56.createElement(AirPlayButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.button, {
37233
37480
  ...props2,
37234
- ref: composeRefs3(props2.ref, forwardRef14)
37481
+ ref: composeRefs3(props2.ref, forwardRef15)
37235
37482
  }, children));
37236
37483
  });
37237
37484
  AirPlayButton2.displayName = "AirPlayButton";
37238
37485
  var PlayButtonBridge = createReactComponent(PlayButtonInstance, {
37239
37486
  domEventsRegex: /^onMedia/
37240
37487
  });
37241
- var PlayButton2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37488
+ var PlayButton2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37242
37489
  return /* @__PURE__ */ React56.createElement(PlayButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.button, {
37243
37490
  ...props2,
37244
- ref: composeRefs3(props2.ref, forwardRef14)
37491
+ ref: composeRefs3(props2.ref, forwardRef15)
37245
37492
  }, children));
37246
37493
  });
37247
37494
  PlayButton2.displayName = "PlayButton";
37248
37495
  var CaptionButtonBridge = createReactComponent(CaptionButtonInstance, {
37249
37496
  domEventsRegex: /^onMedia/
37250
37497
  });
37251
- var CaptionButton2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37498
+ var CaptionButton2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37252
37499
  return /* @__PURE__ */ React56.createElement(CaptionButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.button, {
37253
37500
  ...props2,
37254
- ref: composeRefs3(props2.ref, forwardRef14)
37501
+ ref: composeRefs3(props2.ref, forwardRef15)
37255
37502
  }, children));
37256
37503
  });
37257
37504
  CaptionButton2.displayName = "CaptionButton";
37258
37505
  var FullscreenButtonBridge = createReactComponent(FullscreenButtonInstance, {
37259
37506
  domEventsRegex: /^onMedia/
37260
37507
  });
37261
- var FullscreenButton2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37508
+ var FullscreenButton2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37262
37509
  return /* @__PURE__ */ React56.createElement(FullscreenButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.button, {
37263
37510
  ...props2,
37264
- ref: composeRefs3(props2.ref, forwardRef14)
37511
+ ref: composeRefs3(props2.ref, forwardRef15)
37265
37512
  }, children));
37266
37513
  });
37267
37514
  FullscreenButton2.displayName = "FullscreenButton";
37268
37515
  var MuteButtonBridge = createReactComponent(MuteButtonInstance, {
37269
37516
  domEventsRegex: /^onMedia/
37270
37517
  });
37271
- var MuteButton2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37518
+ var MuteButton2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37272
37519
  return /* @__PURE__ */ React56.createElement(MuteButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.button, {
37273
37520
  ...props2,
37274
- ref: composeRefs3(props2.ref, forwardRef14)
37521
+ ref: composeRefs3(props2.ref, forwardRef15)
37275
37522
  }, children));
37276
37523
  });
37277
37524
  MuteButton2.displayName = "MuteButton";
37278
37525
  var PIPButtonBridge = createReactComponent(PIPButtonInstance, {
37279
37526
  domEventsRegex: /^onMedia/
37280
37527
  });
37281
- var PIPButton2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37528
+ var PIPButton2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37282
37529
  return /* @__PURE__ */ React56.createElement(PIPButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.button, {
37283
37530
  ...props2,
37284
- ref: composeRefs3(props2.ref, forwardRef14)
37531
+ ref: composeRefs3(props2.ref, forwardRef15)
37285
37532
  }, children));
37286
37533
  });
37287
37534
  PIPButton2.displayName = "PIPButton";
37288
37535
  var SeekButtonBridge = createReactComponent(SeekButtonInstance, {
37289
37536
  domEventsRegex: /^onMedia/
37290
37537
  });
37291
- var SeekButton2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37538
+ var SeekButton2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37292
37539
  return /* @__PURE__ */ React56.createElement(SeekButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.button, {
37293
37540
  ...props2,
37294
- ref: composeRefs3(props2.ref, forwardRef14)
37541
+ ref: composeRefs3(props2.ref, forwardRef15)
37295
37542
  }, children));
37296
37543
  });
37297
37544
  SeekButton2.displayName = "SeekButton";
37298
37545
  var LiveButtonBridge = createReactComponent(LiveButtonInstance, {
37299
37546
  domEventsRegex: /^onMedia/
37300
37547
  });
37301
- var LiveButton2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37548
+ var LiveButton2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37302
37549
  return /* @__PURE__ */ React56.createElement(LiveButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.button, {
37303
37550
  ...props2,
37304
- ref: composeRefs3(props2.ref, forwardRef14)
37551
+ ref: composeRefs3(props2.ref, forwardRef15)
37305
37552
  }, children));
37306
37553
  });
37307
37554
  LiveButton2.displayName = "LiveButton";
@@ -37316,42 +37563,42 @@ var SliderValueBridge = createReactComponent(SliderValueInstance);
37316
37563
  var SliderBridge = createReactComponent(SliderInstance, {
37317
37564
  events: sliderCallbacks
37318
37565
  });
37319
- var Root$5 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37320
- return /* @__PURE__ */ React56.createElement(SliderBridge, { ...props, ref: forwardRef14 }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2 }, children));
37566
+ var Root$5 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37567
+ return /* @__PURE__ */ React56.createElement(SliderBridge, { ...props, ref: forwardRef15 }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2 }, children));
37321
37568
  });
37322
37569
  Root$5.displayName = "Slider";
37323
- var Thumb = React56.forwardRef((props, forwardRef14) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef14 }));
37570
+ var Thumb = React56.forwardRef((props, forwardRef15) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef15 }));
37324
37571
  Thumb.displayName = "SliderThumb";
37325
- var Track = React56.forwardRef((props, forwardRef14) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef14 }));
37572
+ var Track = React56.forwardRef((props, forwardRef15) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef15 }));
37326
37573
  Track.displayName = "SliderTrack";
37327
- var TrackFill = React56.forwardRef((props, forwardRef14) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef14 }));
37574
+ var TrackFill = React56.forwardRef((props, forwardRef15) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef15 }));
37328
37575
  TrackFill.displayName = "SliderTrackFill";
37329
37576
  var PreviewBridge = createReactComponent(SliderPreviewInstance);
37330
- var Preview = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37577
+ var Preview = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37331
37578
  return /* @__PURE__ */ React56.createElement(PreviewBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, {
37332
37579
  ...props2,
37333
- ref: composeRefs3(props2.ref, forwardRef14)
37580
+ ref: composeRefs3(props2.ref, forwardRef15)
37334
37581
  }, children));
37335
37582
  });
37336
37583
  Preview.displayName = "SliderPreview";
37337
- var Value2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37584
+ var Value2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37338
37585
  return /* @__PURE__ */ React56.createElement(SliderValueBridge, { ...props }, (props2, instance) => {
37339
37586
  const $text = useSignal(() => instance.getValueText(), instance);
37340
- return /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2, ref: forwardRef14 }, $text, children);
37587
+ return /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2, ref: forwardRef15 }, $text, children);
37341
37588
  });
37342
37589
  });
37343
37590
  Value2.displayName = "SliderValue";
37344
- var Steps = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37591
+ var Steps = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37345
37592
  const $min = useSliderState("min"), $max = useSliderState("max"), $step = useSliderState("step"), steps = ($max - $min) / $step;
37346
- return /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef14 }, Array.from({ length: Math.floor(steps) + 1 }).map((_, step) => children(step)));
37593
+ return /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef15 }, Array.from({ length: Math.floor(steps) + 1 }).map((_, step) => children(step)));
37347
37594
  });
37348
37595
  Steps.displayName = "SliderSteps";
37349
37596
  var VolumeSliderBridge = createReactComponent(VolumeSliderInstance, {
37350
37597
  events: sliderCallbacks,
37351
37598
  domEventsRegex: /^onMedia/
37352
37599
  });
37353
- var Root$4 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37354
- return /* @__PURE__ */ React56.createElement(VolumeSliderBridge, { ...props, ref: forwardRef14 }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2 }, children));
37600
+ var Root$4 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37601
+ return /* @__PURE__ */ React56.createElement(VolumeSliderBridge, { ...props, ref: forwardRef15 }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2 }, children));
37355
37602
  });
37356
37603
  Root$4.displayName = "VolumeSlider";
37357
37604
  function createVTTCue(startTime = 0, endTime = 0, text = "") {
@@ -37375,20 +37622,20 @@ function appendParamsToURL2(baseUrl, params) {
37375
37622
  return url.toString();
37376
37623
  }
37377
37624
  var ThumbnailBridge = createReactComponent(ThumbnailInstance);
37378
- var Root$3 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37625
+ var Root$3 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37379
37626
  return /* @__PURE__ */ React56.createElement(ThumbnailBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, {
37380
37627
  ...props2,
37381
- ref: composeRefs3(props2.ref, forwardRef14)
37628
+ ref: composeRefs3(props2.ref, forwardRef15)
37382
37629
  }, children));
37383
37630
  });
37384
37631
  Root$3.displayName = "Thumbnail";
37385
- var Img2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37632
+ var Img2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37386
37633
  const { src, img, crossOrigin } = useStateContext(ThumbnailInstance.state), $src = useSignal(src), $crossOrigin = useSignal(crossOrigin);
37387
37634
  return /* @__PURE__ */ React56.createElement(Primitive3.img, {
37388
37635
  crossOrigin: $crossOrigin,
37389
37636
  ...props,
37390
37637
  src: $src || undefined,
37391
- ref: composeRefs3(img.set, forwardRef14)
37638
+ ref: composeRefs3(img.set, forwardRef15)
37392
37639
  }, children);
37393
37640
  });
37394
37641
  Img2.displayName = "ThumbnailImg";
@@ -37400,16 +37647,16 @@ var TimeSliderBridge = createReactComponent(TimeSliderInstance, {
37400
37647
  events: sliderCallbacks,
37401
37648
  domEventsRegex: /^onMedia/
37402
37649
  });
37403
- var Root$2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37650
+ var Root$2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37404
37651
  const $chapters = React56.useMemo(() => signal(null), []);
37405
- return /* @__PURE__ */ React56.createElement(TimeSliderContext.Provider, { value: { $chapters } }, /* @__PURE__ */ React56.createElement(TimeSliderBridge, { ...props, ref: forwardRef14 }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2 }, children)));
37652
+ return /* @__PURE__ */ React56.createElement(TimeSliderContext.Provider, { value: { $chapters } }, /* @__PURE__ */ React56.createElement(TimeSliderBridge, { ...props, ref: forwardRef15 }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2 }, children)));
37406
37653
  });
37407
37654
  Root$2.displayName = "TimeSlider";
37408
37655
  var SliderChaptersBridge = createReactComponent(SliderChaptersInstance);
37409
- var Chapters = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37656
+ var Chapters = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37410
37657
  return /* @__PURE__ */ React56.createElement(SliderChaptersBridge, { ...props }, (props2, instance) => /* @__PURE__ */ React56.createElement(Primitive3.div, {
37411
37658
  ...props2,
37412
- ref: composeRefs3(props2.ref, forwardRef14)
37659
+ ref: composeRefs3(props2.ref, forwardRef15)
37413
37660
  }, /* @__PURE__ */ React56.createElement(ChapterTracks, { instance }, children)));
37414
37661
  });
37415
37662
  Chapters.displayName = "SliderChapters";
@@ -37434,7 +37681,7 @@ function ChapterTracks({ instance, children }) {
37434
37681
  });
37435
37682
  }
37436
37683
  ChapterTracks.displayName = "SliderChapterTracks";
37437
- var ChapterTitle = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37684
+ var ChapterTitle = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37438
37685
  const { $chapters } = React56.useContext(TimeSliderContext), [title, setTitle] = React56.useState();
37439
37686
  React56.useEffect(() => {
37440
37687
  return effect(() => {
@@ -37442,14 +37689,14 @@ var ChapterTitle = React56.forwardRef(({ children, ...props }, forwardRef14) =>
37442
37689
  setTitle(cue?.text || "");
37443
37690
  });
37444
37691
  }, []);
37445
- return /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef14 }, title, children);
37692
+ return /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef15 }, title, children);
37446
37693
  });
37447
37694
  ChapterTitle.displayName = "SliderChapterTitle";
37448
- var Progress = React56.forwardRef((props, forwardRef14) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef14 }));
37695
+ var Progress = React56.forwardRef((props, forwardRef15) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef15 }));
37449
37696
  Progress.displayName = "SliderProgress";
37450
37697
  var SliderThumbnailBridge = createReactComponent(SliderThumbnailInstance);
37451
- var ThumbnailRoot = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37452
- return /* @__PURE__ */ React56.createElement(SliderThumbnailBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2, ref: composeRefs3(props2.ref, forwardRef14) }, children));
37698
+ var ThumbnailRoot = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37699
+ return /* @__PURE__ */ React56.createElement(SliderThumbnailBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2, ref: composeRefs3(props2.ref, forwardRef15) }, children));
37453
37700
  });
37454
37701
  ThumbnailRoot.displayName = "SliderThumbnail";
37455
37702
  var Thumbnail2 = {
@@ -37459,15 +37706,15 @@ var Thumbnail2 = {
37459
37706
  var VideoBridge = createReactComponent(SliderVideoInstance, {
37460
37707
  events: ["onCanPlay", "onError"]
37461
37708
  });
37462
- var Video = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37709
+ var Video = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37463
37710
  return /* @__PURE__ */ React56.createElement(VideoBridge, { ...props }, (props2, instance) => /* @__PURE__ */ React56.createElement(VideoProvider2, {
37464
37711
  ...props2,
37465
37712
  instance,
37466
- ref: composeRefs3(props2.ref, forwardRef14)
37713
+ ref: composeRefs3(props2.ref, forwardRef15)
37467
37714
  }, children));
37468
37715
  });
37469
37716
  Video.displayName = "SliderVideo";
37470
- var VideoProvider2 = React56.forwardRef(({ instance, children, ...props }, forwardRef14) => {
37717
+ var VideoProvider2 = React56.forwardRef(({ instance, children, ...props }, forwardRef15) => {
37471
37718
  const { canLoad } = useStateContext(mediaState), { src, video, crossOrigin } = instance.$state, $src = useSignal(src), $canLoad = useSignal(canLoad), $crossOrigin = useSignal(crossOrigin);
37472
37719
  return /* @__PURE__ */ React56.createElement(Primitive3.video, {
37473
37720
  style: { maxWidth: "unset" },
@@ -37477,24 +37724,24 @@ var VideoProvider2 = React56.forwardRef(({ instance, children, ...props }, forwa
37477
37724
  playsInline: true,
37478
37725
  preload: $canLoad ? "auto" : "none",
37479
37726
  crossOrigin: $crossOrigin || undefined,
37480
- ref: composeRefs3(video.set, forwardRef14)
37727
+ ref: composeRefs3(video.set, forwardRef15)
37481
37728
  }, children);
37482
37729
  });
37483
37730
  VideoProvider2.displayName = "SliderVideoProvider";
37484
37731
  var RadioGroupBridge = createReactComponent(RadioGroupInstance, {
37485
37732
  events: ["onChange"]
37486
37733
  });
37487
- var Root$1 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37488
- return /* @__PURE__ */ React56.createElement(RadioGroupBridge, { ...props, ref: forwardRef14 }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2 }, children));
37734
+ var Root$1 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37735
+ return /* @__PURE__ */ React56.createElement(RadioGroupBridge, { ...props, ref: forwardRef15 }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2 }, children));
37489
37736
  });
37490
37737
  Root$1.displayName = "RadioGroup";
37491
37738
  var ItemBridge$1 = createReactComponent(RadioInstance, {
37492
37739
  events: ["onChange", "onSelect"]
37493
37740
  });
37494
- var Item$1 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37741
+ var Item$1 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37495
37742
  return /* @__PURE__ */ React56.createElement(ItemBridge$1, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, {
37496
37743
  ...props2,
37497
- ref: composeRefs3(props2.ref, forwardRef14)
37744
+ ref: composeRefs3(props2.ref, forwardRef15)
37498
37745
  }, children));
37499
37746
  });
37500
37747
  Item$1.displayName = "RadioItem";
@@ -37502,8 +37749,8 @@ var MenuBridge = createReactComponent(MenuInstance, {
37502
37749
  events: ["onOpen", "onClose"],
37503
37750
  domEventsRegex: /^onMedia/
37504
37751
  });
37505
- var Root4 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37506
- return /* @__PURE__ */ React56.createElement(MenuBridge, { ...props, ref: forwardRef14 }, (props2, instance) => /* @__PURE__ */ React56.createElement(Primitive3.div, {
37752
+ var Root4 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37753
+ return /* @__PURE__ */ React56.createElement(MenuBridge, { ...props, ref: forwardRef15 }, (props2, instance) => /* @__PURE__ */ React56.createElement(Primitive3.div, {
37507
37754
  ...props2,
37508
37755
  style: { display: !instance.isSubmenu ? "contents" : undefined, ...props2.style }
37509
37756
  }, children));
@@ -37512,14 +37759,14 @@ Root4.displayName = "Menu";
37512
37759
  var ButtonBridge = createReactComponent(MenuButtonInstance, {
37513
37760
  events: ["onSelect"]
37514
37761
  });
37515
- var Button2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37762
+ var Button2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37516
37763
  return /* @__PURE__ */ React56.createElement(ButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.button, {
37517
37764
  ...props2,
37518
- ref: composeRefs3(props2.ref, forwardRef14)
37765
+ ref: composeRefs3(props2.ref, forwardRef15)
37519
37766
  }, children));
37520
37767
  });
37521
37768
  Button2.displayName = "MenuButton";
37522
- var Portal3 = React56.forwardRef(({ container: container3 = null, disabled = false, children, ...props }, forwardRef14) => {
37769
+ var Portal3 = React56.forwardRef(({ container: container3 = null, disabled = false, children, ...props }, forwardRef15) => {
37523
37770
  let fullscreen = useMediaState("fullscreen"), shouldPortal = disabled === "fullscreen" ? !fullscreen : !disabled;
37524
37771
  const target = React56.useMemo(() => {
37525
37772
  if (IS_SERVER3)
@@ -37530,45 +37777,45 @@ var Portal3 = React56.forwardRef(({ container: container3 = null, disabled = fal
37530
37777
  return !target || !shouldPortal ? children : createPortal3(/* @__PURE__ */ React56.createElement(Primitive3.div, {
37531
37778
  ...props,
37532
37779
  style: { display: "contents", ...props.style },
37533
- ref: forwardRef14
37780
+ ref: forwardRef15
37534
37781
  }, children), target);
37535
37782
  });
37536
37783
  Portal3.displayName = "MenuPortal";
37537
37784
  var ItemsBridge = createReactComponent(MenuItemsInstance);
37538
- var Items = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37785
+ var Items = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37539
37786
  return /* @__PURE__ */ React56.createElement(ItemsBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, {
37540
37787
  ...props2,
37541
- ref: composeRefs3(props2.ref, forwardRef14)
37788
+ ref: composeRefs3(props2.ref, forwardRef15)
37542
37789
  }, children));
37543
37790
  });
37544
37791
  Items.displayName = "MenuItems";
37545
37792
  var ItemBridge = createReactComponent(MenuItemInstance);
37546
- var Item3 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37793
+ var Item3 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37547
37794
  return /* @__PURE__ */ React56.createElement(ItemBridge, { ...props }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, {
37548
37795
  ...props2,
37549
- ref: composeRefs3(props2.ref, forwardRef14)
37796
+ ref: composeRefs3(props2.ref, forwardRef15)
37550
37797
  }, children));
37551
37798
  });
37552
37799
  Item3.displayName = "MenuItem";
37553
37800
  var GestureBridge = createReactComponent(GestureInstance, {
37554
37801
  events: ["onWillTrigger", "onTrigger"]
37555
37802
  });
37556
- var Gesture2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37557
- return /* @__PURE__ */ React56.createElement(GestureBridge, { ...props, ref: forwardRef14 }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2 }, children));
37803
+ var Gesture2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37804
+ return /* @__PURE__ */ React56.createElement(GestureBridge, { ...props, ref: forwardRef15 }, (props2) => /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props2 }, children));
37558
37805
  });
37559
37806
  Gesture2.displayName = "Gesture";
37560
37807
  var TimeBridge = createReactComponent(TimeInstance);
37561
- var Time2 = React56.forwardRef(({ children, ...props }, forwardRef14) => {
37808
+ var Time2 = React56.forwardRef(({ children, ...props }, forwardRef15) => {
37562
37809
  return /* @__PURE__ */ React56.createElement(TimeBridge, { ...props }, (props2, instance) => /* @__PURE__ */ React56.createElement(TimeText, {
37563
37810
  ...props2,
37564
37811
  instance,
37565
- ref: composeRefs3(props2.ref, forwardRef14)
37812
+ ref: composeRefs3(props2.ref, forwardRef15)
37566
37813
  }, children));
37567
37814
  });
37568
37815
  Time2.displayName = "Time";
37569
- var TimeText = React56.forwardRef(({ instance, children, ...props }, forwardRef14) => {
37816
+ var TimeText = React56.forwardRef(({ instance, children, ...props }, forwardRef15) => {
37570
37817
  const { timeText } = instance.$state, $timeText = useSignal(timeText);
37571
- return /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef14 }, $timeText, children);
37818
+ return /* @__PURE__ */ React56.createElement(Primitive3.div, { ...props, ref: forwardRef15 }, $timeText, children);
37572
37819
  });
37573
37820
  TimeText.displayName = "TimeText";
37574
37821
  function useMediaPlayer() {
@@ -37672,27 +37919,27 @@ function getTrackValue(track) {
37672
37919
  var MediaAnnouncerBridge = createReactComponent(MediaAnnouncerInstance, {
37673
37920
  events: ["onChange"]
37674
37921
  });
37675
- var MediaAnnouncer2 = React57.forwardRef(({ style, children, ...props }, forwardRef14) => {
37922
+ var MediaAnnouncer2 = React57.forwardRef(({ style, children, ...props }, forwardRef15) => {
37676
37923
  return /* @__PURE__ */ React57.createElement(MediaAnnouncerBridge, { ...props }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.div, {
37677
37924
  ...props2,
37678
37925
  style: { display: "contents", ...style },
37679
- ref: composeRefs3(props2.ref, forwardRef14)
37926
+ ref: composeRefs3(props2.ref, forwardRef15)
37680
37927
  }, children));
37681
37928
  });
37682
37929
  MediaAnnouncer2.displayName = "MediaAnnouncer";
37683
37930
  var ControlsBridge = createReactComponent(ControlsInstance);
37684
- var Root$52 = React57.forwardRef(({ children, ...props }, forwardRef14) => {
37931
+ var Root$52 = React57.forwardRef(({ children, ...props }, forwardRef15) => {
37685
37932
  return /* @__PURE__ */ React57.createElement(ControlsBridge, { ...props }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.div, {
37686
37933
  ...props2,
37687
- ref: composeRefs3(props2.ref, forwardRef14)
37934
+ ref: composeRefs3(props2.ref, forwardRef15)
37688
37935
  }, children));
37689
37936
  });
37690
37937
  Root$52.displayName = "Controls";
37691
37938
  var ControlsGroupBridge = createReactComponent(ControlsGroupInstance);
37692
- var Group = React57.forwardRef(({ children, ...props }, forwardRef14) => {
37939
+ var Group = React57.forwardRef(({ children, ...props }, forwardRef15) => {
37693
37940
  return /* @__PURE__ */ React57.createElement(ControlsGroupBridge, { ...props }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.div, {
37694
37941
  ...props2,
37695
- ref: composeRefs3(props2.ref, forwardRef14)
37942
+ ref: composeRefs3(props2.ref, forwardRef15)
37696
37943
  }, children));
37697
37944
  });
37698
37945
  Group.displayName = "ControlsGroup";
@@ -37702,28 +37949,28 @@ function Root$42({ children, ...props }) {
37702
37949
  }
37703
37950
  Root$42.displayName = "Tooltip";
37704
37951
  var TriggerBridge = createReactComponent(TooltipTriggerInstance);
37705
- var Trigger3 = React57.forwardRef(({ children, ...props }, forwardRef14) => {
37952
+ var Trigger3 = React57.forwardRef(({ children, ...props }, forwardRef15) => {
37706
37953
  return /* @__PURE__ */ React57.createElement(TriggerBridge, { ...props }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.button, {
37707
37954
  ...props2,
37708
- ref: composeRefs3(props2.ref, forwardRef14)
37955
+ ref: composeRefs3(props2.ref, forwardRef15)
37709
37956
  }, children));
37710
37957
  });
37711
37958
  Trigger3.displayName = "TooltipTrigger";
37712
37959
  var ContentBridge = createReactComponent(TooltipContentInstance);
37713
- var Content4 = React57.forwardRef(({ children, ...props }, forwardRef14) => {
37960
+ var Content4 = React57.forwardRef(({ children, ...props }, forwardRef15) => {
37714
37961
  return /* @__PURE__ */ React57.createElement(ContentBridge, { ...props }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.div, {
37715
37962
  ...props2,
37716
- ref: composeRefs3(props2.ref, forwardRef14)
37963
+ ref: composeRefs3(props2.ref, forwardRef15)
37717
37964
  }, children));
37718
37965
  });
37719
37966
  Content4.displayName = "TooltipContent";
37720
37967
  var GoogleCastButtonBridge = createReactComponent(GoogleCastButtonInstance, {
37721
37968
  domEventsRegex: /^onMedia/
37722
37969
  });
37723
- var GoogleCastButton2 = React57.forwardRef(({ children, ...props }, forwardRef14) => {
37970
+ var GoogleCastButton2 = React57.forwardRef(({ children, ...props }, forwardRef15) => {
37724
37971
  return /* @__PURE__ */ React57.createElement(GoogleCastButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.button, {
37725
37972
  ...props2,
37726
- ref: composeRefs3(props2.ref, forwardRef14)
37973
+ ref: composeRefs3(props2.ref, forwardRef15)
37727
37974
  }, children));
37728
37975
  });
37729
37976
  GoogleCastButton2.displayName = "GoogleCastButton";
@@ -37731,29 +37978,29 @@ var QualitySliderBridge = createReactComponent(QualitySliderInstance, {
37731
37978
  events: sliderCallbacks,
37732
37979
  domEventsRegex: /^onMedia/
37733
37980
  });
37734
- var Root$32 = React57.forwardRef(({ children, ...props }, forwardRef14) => {
37735
- return /* @__PURE__ */ React57.createElement(QualitySliderBridge, { ...props, ref: forwardRef14 }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.div, { ...props2 }, children));
37981
+ var Root$32 = React57.forwardRef(({ children, ...props }, forwardRef15) => {
37982
+ return /* @__PURE__ */ React57.createElement(QualitySliderBridge, { ...props, ref: forwardRef15 }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.div, { ...props2 }, children));
37736
37983
  });
37737
37984
  Root$32.displayName = "QualitySlider";
37738
37985
  var AudioGainSliderBridge = createReactComponent(AudioGainSliderInstance, {
37739
37986
  events: sliderCallbacks,
37740
37987
  domEventsRegex: /^onMedia/
37741
37988
  });
37742
- var Root$22 = React57.forwardRef(({ children, ...props }, forwardRef14) => {
37743
- return /* @__PURE__ */ React57.createElement(AudioGainSliderBridge, { ...props, ref: forwardRef14 }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.div, { ...props2 }, children));
37989
+ var Root$22 = React57.forwardRef(({ children, ...props }, forwardRef15) => {
37990
+ return /* @__PURE__ */ React57.createElement(AudioGainSliderBridge, { ...props, ref: forwardRef15 }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.div, { ...props2 }, children));
37744
37991
  });
37745
37992
  Root$22.displayName = "AudioGainSlider";
37746
37993
  var SpeedSliderBridge = createReactComponent(SpeedSliderInstance, {
37747
37994
  events: sliderCallbacks,
37748
37995
  domEventsRegex: /^onMedia/
37749
37996
  });
37750
- var Root$12 = React57.forwardRef(({ children, ...props }, forwardRef14) => {
37751
- return /* @__PURE__ */ React57.createElement(SpeedSliderBridge, { ...props, ref: forwardRef14 }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.div, { ...props2 }, children));
37997
+ var Root$12 = React57.forwardRef(({ children, ...props }, forwardRef15) => {
37998
+ return /* @__PURE__ */ React57.createElement(SpeedSliderBridge, { ...props, ref: forwardRef15 }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.div, { ...props2 }, children));
37752
37999
  });
37753
38000
  Root$12.displayName = "SpeedSlider";
37754
- var Title = React57.forwardRef(({ children, ...props }, forwardRef14) => {
38001
+ var Title = React57.forwardRef(({ children, ...props }, forwardRef15) => {
37755
38002
  const $title = useMediaState("title");
37756
- return /* @__PURE__ */ React57.createElement(Primitive3.span, { ...props, ref: forwardRef14 }, $title, children);
38003
+ return /* @__PURE__ */ React57.createElement(Primitive3.span, { ...props, ref: forwardRef15 }, $title, children);
37757
38004
  });
37758
38005
  Title.displayName = "Title";
37759
38006
  function useActiveTextCues(track) {
@@ -37783,17 +38030,17 @@ function useChapterTitle() {
37783
38030
  const $track = useActiveTextTrack("chapters"), $cues = useActiveTextCues($track);
37784
38031
  return $cues[0]?.text || "";
37785
38032
  }
37786
- var ChapterTitle2 = React57.forwardRef(({ defaultText = "", children, ...props }, forwardRef14) => {
38033
+ var ChapterTitle2 = React57.forwardRef(({ defaultText = "", children, ...props }, forwardRef15) => {
37787
38034
  const $chapterTitle = useChapterTitle();
37788
- return /* @__PURE__ */ React57.createElement(Primitive3.span, { ...props, ref: forwardRef14 }, $chapterTitle || defaultText, children);
38035
+ return /* @__PURE__ */ React57.createElement(Primitive3.span, { ...props, ref: forwardRef15 }, $chapterTitle || defaultText, children);
37789
38036
  });
37790
38037
  ChapterTitle2.displayName = "ChapterTitle";
37791
38038
  var CaptionsBridge = createReactComponent(CaptionsInstance);
37792
- var Captions2 = React57.forwardRef(({ children, ...props }, forwardRef14) => {
37793
- return /* @__PURE__ */ React57.createElement(CaptionsBridge, { ...props, ref: forwardRef14 }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.div, { ...props2 }, children));
38039
+ var Captions2 = React57.forwardRef(({ children, ...props }, forwardRef15) => {
38040
+ return /* @__PURE__ */ React57.createElement(CaptionsBridge, { ...props, ref: forwardRef15 }, (props2) => /* @__PURE__ */ React57.createElement(Primitive3.div, { ...props2 }, children));
37794
38041
  });
37795
38042
  Captions2.displayName = "Captions";
37796
- var Root6 = React57.forwardRef(({ size: size5 = 96, children, ...props }, forwardRef14) => {
38043
+ var Root6 = React57.forwardRef(({ size: size5 = 96, children, ...props }, forwardRef15) => {
37797
38044
  return /* @__PURE__ */ React57.createElement("svg", {
37798
38045
  width: size5,
37799
38046
  height: size5,
@@ -37802,7 +38049,7 @@ var Root6 = React57.forwardRef(({ size: size5 = 96, children, ...props }, forwar
37802
38049
  "aria-hidden": "true",
37803
38050
  "data-part": "root",
37804
38051
  ...props,
37805
- ref: forwardRef14
38052
+ ref: forwardRef15
37806
38053
  }, children);
37807
38054
  });
37808
38055
  var Track2 = React57.forwardRef(({ width = 8, children, ...props }, ref) => /* @__PURE__ */ React57.createElement("circle", {
@@ -38079,7 +38326,7 @@ class AudioGainRadioGroup extends Component {
38079
38326
  onSetup() {
38080
38327
  this.#media = useMediaContext();
38081
38328
  if (hasProvidedContext(menuContext)) {
38082
- this.#menu = useContext45(menuContext);
38329
+ this.#menu = useContext44(menuContext);
38083
38330
  }
38084
38331
  }
38085
38332
  onConnect(el) {
@@ -38185,11 +38432,11 @@ var MediaPlayerBridge = createReactComponent(MediaPlayerInstance, {
38185
38432
  eventsRegex: /^onHls/,
38186
38433
  domEventsRegex: /^onMedia/
38187
38434
  });
38188
- var MediaPlayer2 = React59.forwardRef(({ aspectRatio, children, ...props }, forwardRef14) => {
38435
+ var MediaPlayer2 = React59.forwardRef(({ aspectRatio, children, ...props }, forwardRef15) => {
38189
38436
  return /* @__PURE__ */ React59.createElement(MediaPlayerBridge, {
38190
38437
  ...props,
38191
38438
  src: props.src,
38192
- ref: forwardRef14,
38439
+ ref: forwardRef15,
38193
38440
  style: {
38194
38441
  aspectRatio,
38195
38442
  ...props.style
@@ -38198,9 +38445,9 @@ var MediaPlayer2 = React59.forwardRef(({ aspectRatio, children, ...props }, forw
38198
38445
  });
38199
38446
  MediaPlayer2.displayName = "MediaPlayer";
38200
38447
  var MediaProviderBridge = createReactComponent(MediaProviderInstance);
38201
- var MediaProvider2 = React59.forwardRef(({ loaders = [], children, iframeProps, mediaProps, ...props }, forwardRef14) => {
38448
+ var MediaProvider2 = React59.forwardRef(({ loaders = [], children, iframeProps, mediaProps, ...props }, forwardRef15) => {
38202
38449
  const reactLoaders = React59.useMemo(() => loaders.map((Loader) => new Loader), loaders);
38203
- return /* @__PURE__ */ React59.createElement(MediaProviderBridge, { ...props, loaders: reactLoaders, ref: forwardRef14 }, (props2, instance) => /* @__PURE__ */ React59.createElement("div", { ...props2 }, /* @__PURE__ */ React59.createElement(MediaOutlet, { provider: instance, mediaProps, iframeProps }), children));
38450
+ return /* @__PURE__ */ React59.createElement(MediaProviderBridge, { ...props, loaders: reactLoaders, ref: forwardRef15 }, (props2, instance) => /* @__PURE__ */ React59.createElement("div", { ...props2 }, /* @__PURE__ */ React59.createElement(MediaOutlet, { provider: instance, mediaProps, iframeProps }), children));
38204
38451
  });
38205
38452
  MediaProvider2.displayName = "MediaProvider";
38206
38453
  function MediaOutlet({ provider: provider2, mediaProps, iframeProps }) {
@@ -38270,48 +38517,48 @@ function Track3({ lang, ...props }) {
38270
38517
  }
38271
38518
  Track3.displayName = "Track";
38272
38519
  var ToggleButtonBridge = createReactComponent(ToggleButtonInstance);
38273
- var ToggleButton2 = React59.forwardRef(({ children, ...props }, forwardRef14) => {
38520
+ var ToggleButton2 = React59.forwardRef(({ children, ...props }, forwardRef15) => {
38274
38521
  return /* @__PURE__ */ React59.createElement(ToggleButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React59.createElement(Primitive3.button, {
38275
38522
  ...props2,
38276
- ref: composeRefs3(props2.ref, forwardRef14)
38523
+ ref: composeRefs3(props2.ref, forwardRef15)
38277
38524
  }, children));
38278
38525
  });
38279
38526
  ToggleButton2.displayName = "ToggleButton";
38280
38527
  var PosterBridge = createReactComponent(PosterInstance);
38281
- var Poster2 = React59.forwardRef(({ children, ...props }, forwardRef14) => {
38528
+ var Poster2 = React59.forwardRef(({ children, ...props }, forwardRef15) => {
38282
38529
  return /* @__PURE__ */ React59.createElement(PosterBridge, {
38283
38530
  src: props.asChild && React59.isValidElement(children) ? children.props.src : undefined,
38284
38531
  ...props
38285
38532
  }, (props2, instance) => /* @__PURE__ */ React59.createElement(PosterImg, {
38286
38533
  ...props2,
38287
38534
  instance,
38288
- ref: composeRefs3(props2.ref, forwardRef14)
38535
+ ref: composeRefs3(props2.ref, forwardRef15)
38289
38536
  }, children));
38290
38537
  });
38291
38538
  Poster2.displayName = "Poster";
38292
- var PosterImg = React59.forwardRef(({ instance, children, ...props }, forwardRef14) => {
38539
+ var PosterImg = React59.forwardRef(({ instance, children, ...props }, forwardRef15) => {
38293
38540
  const { src, img, alt, crossOrigin, hidden } = instance.$state, $src = useSignal(src), $alt = useSignal(alt), $crossOrigin = useSignal(crossOrigin), $hidden = useSignal(hidden);
38294
38541
  return /* @__PURE__ */ React59.createElement(Primitive3.img, {
38295
38542
  ...props,
38296
38543
  src: $src || undefined,
38297
38544
  alt: $alt || undefined,
38298
38545
  crossOrigin: $crossOrigin || undefined,
38299
- ref: composeRefs3(img.set, forwardRef14),
38546
+ ref: composeRefs3(img.set, forwardRef15),
38300
38547
  style: { display: $hidden ? "none" : undefined }
38301
38548
  }, children);
38302
38549
  });
38303
38550
  PosterImg.displayName = "PosterImg";
38304
- var Root7 = React59.forwardRef(({ children, ...props }, forwardRef14) => {
38551
+ var Root7 = React59.forwardRef(({ children, ...props }, forwardRef15) => {
38305
38552
  return /* @__PURE__ */ React59.createElement(Primitive3.div, {
38306
38553
  translate: "yes",
38307
38554
  "aria-live": "off",
38308
38555
  "aria-atomic": "true",
38309
38556
  ...props,
38310
- ref: forwardRef14
38557
+ ref: forwardRef15
38311
38558
  }, children);
38312
38559
  });
38313
38560
  Root7.displayName = "Caption";
38314
- var Text = React59.forwardRef((props, forwardRef14) => {
38561
+ var Text = React59.forwardRef((props, forwardRef15) => {
38315
38562
  const textTrack = useMediaState("textTrack"), [activeCue, setActiveCue] = React59.useState();
38316
38563
  React59.useEffect(() => {
38317
38564
  if (!textTrack)
@@ -38331,7 +38578,7 @@ var Text = React59.forwardRef((props, forwardRef14) => {
38331
38578
  dangerouslySetInnerHTML: {
38332
38579
  __html: activeCue?.text || ""
38333
38580
  },
38334
- ref: forwardRef14
38581
+ ref: forwardRef15
38335
38582
  });
38336
38583
  });
38337
38584
  Text.displayName = "CaptionText";
@@ -38481,7 +38728,7 @@ function createDefaultMediaLayout({
38481
38728
  thumbnails = null,
38482
38729
  translations,
38483
38730
  ...props
38484
- }, forwardRef14) => {
38731
+ }, forwardRef15) => {
38485
38732
  const media = useMediaContext2(), $load = useSignal(media.$props.load), $canLoad = useMediaState("canLoad"), $viewType = useMediaState("viewType"), $streamType = useMediaState("streamType"), $smallWhen = createComputed(() => {
38486
38733
  return isBoolean(smallLayoutWhen) ? smallLayoutWhen : smallLayoutWhen(media.player.state);
38487
38734
  }, [smallLayoutWhen]), userPrefersAnnouncements = createSignal(true), userPrefersKeyboardAnimations = createSignal(true), isMatch = $viewType === type, isSmallLayout = $smallWhen(), isForcedLayout = isBoolean(smallLayoutWhen), isLoadLayout = $load === "play" && !$canLoad, canRender = $canLoad || isForcedLayout || isLoadLayout, colorSchemeClass = useColorSchemeClass(colorScheme), layoutEl = createSignal(null);
@@ -38494,7 +38741,7 @@ function createDefaultMediaLayout({
38494
38741
  "data-lg": !isSmallLayout ? "" : null,
38495
38742
  "data-size": isSmallLayout ? "sm" : "lg",
38496
38743
  "data-no-scrub-gesture": noScrubGesture ? "" : null,
38497
- ref: composeRefs3(layoutEl.set, forwardRef14)
38744
+ ref: composeRefs3(layoutEl.set, forwardRef15)
38498
38745
  }, canRender && isMatch ? /* @__PURE__ */ React61.createElement(DefaultLayoutContext.Provider, {
38499
38746
  value: {
38500
38747
  disableTimeSlider,
@@ -38555,9 +38802,9 @@ function DefaultPlayButton({ tooltip }) {
38555
38802
  return /* @__PURE__ */ React61.createElement(DefaultTooltip, { content: $paused ? playText : pauseText, placement: tooltip }, /* @__PURE__ */ React61.createElement(PlayButton2, { className: "vds-play-button vds-button", "aria-label": playText }, $ended ? /* @__PURE__ */ React61.createElement(Icons.PlayButton.Replay, { className: "vds-icon" }) : $paused ? /* @__PURE__ */ React61.createElement(Icons.PlayButton.Play, { className: "vds-icon" }) : /* @__PURE__ */ React61.createElement(Icons.PlayButton.Pause, { className: "vds-icon" })));
38556
38803
  }
38557
38804
  DefaultPlayButton.displayName = "DefaultPlayButton";
38558
- var DefaultMuteButton = React61.forwardRef(({ tooltip }, forwardRef14) => {
38805
+ var DefaultMuteButton = React61.forwardRef(({ tooltip }, forwardRef15) => {
38559
38806
  const { icons: Icons } = useDefaultLayoutContext(), muteText = useDefaultLayoutWord("Mute"), unmuteText = useDefaultLayoutWord("Unmute"), $muted = useMediaState("muted"), $volume = useMediaState("volume");
38560
- return /* @__PURE__ */ React61.createElement(DefaultTooltip, { content: $muted ? unmuteText : muteText, placement: tooltip }, /* @__PURE__ */ React61.createElement(MuteButton2, { className: "vds-mute-button vds-button", "aria-label": muteText, ref: forwardRef14 }, $muted || $volume == 0 ? /* @__PURE__ */ React61.createElement(Icons.MuteButton.Mute, { className: "vds-icon" }) : $volume < 0.5 ? /* @__PURE__ */ React61.createElement(Icons.MuteButton.VolumeLow, { className: "vds-icon" }) : /* @__PURE__ */ React61.createElement(Icons.MuteButton.VolumeHigh, { className: "vds-icon" })));
38807
+ return /* @__PURE__ */ React61.createElement(DefaultTooltip, { content: $muted ? unmuteText : muteText, placement: tooltip }, /* @__PURE__ */ React61.createElement(MuteButton2, { className: "vds-mute-button vds-button", "aria-label": muteText, ref: forwardRef15 }, $muted || $volume == 0 ? /* @__PURE__ */ React61.createElement(Icons.MuteButton.Mute, { className: "vds-icon" }) : $volume < 0.5 ? /* @__PURE__ */ React61.createElement(Icons.MuteButton.VolumeLow, { className: "vds-icon" }) : /* @__PURE__ */ React61.createElement(Icons.MuteButton.VolumeHigh, { className: "vds-icon" })));
38561
38808
  });
38562
38809
  DefaultMuteButton.displayName = "DefaultMuteButton";
38563
38810
  function DefaultCaptionButton({ tooltip }) {
@@ -39333,7 +39580,7 @@ function DefaultTimeSlider() {
39333
39580
  }, /* @__PURE__ */ React61.createElement(Chapters, {
39334
39581
  className: "vds-slider-chapters",
39335
39582
  disabled: width < sliderChaptersMinWidth
39336
- }, (cues, forwardRef14) => cues.map((cue) => /* @__PURE__ */ React61.createElement("div", { className: "vds-slider-chapter", key: cue.startTime, ref: forwardRef14 }, /* @__PURE__ */ React61.createElement(Track, { className: "vds-slider-track" }), /* @__PURE__ */ React61.createElement(TrackFill, { className: "vds-slider-track-fill vds-slider-track" }), /* @__PURE__ */ React61.createElement(Progress, { className: "vds-slider-progress vds-slider-track" })))), /* @__PURE__ */ React61.createElement(Thumb, { className: "vds-slider-thumb" }), /* @__PURE__ */ React61.createElement(Preview, { className: "vds-slider-preview" }, thumbnails ? /* @__PURE__ */ React61.createElement(Thumbnail2.Root, {
39583
+ }, (cues, forwardRef15) => cues.map((cue) => /* @__PURE__ */ React61.createElement("div", { className: "vds-slider-chapter", key: cue.startTime, ref: forwardRef15 }, /* @__PURE__ */ React61.createElement(Track, { className: "vds-slider-track" }), /* @__PURE__ */ React61.createElement(TrackFill, { className: "vds-slider-track-fill vds-slider-track" }), /* @__PURE__ */ React61.createElement(Progress, { className: "vds-slider-progress vds-slider-track" })))), /* @__PURE__ */ React61.createElement(Thumb, { className: "vds-slider-thumb" }), /* @__PURE__ */ React61.createElement(Preview, { className: "vds-slider-preview" }, thumbnails ? /* @__PURE__ */ React61.createElement(Thumbnail2.Root, {
39337
39584
  src: thumbnails,
39338
39585
  className: "vds-slider-thumbnail vds-thumbnail"
39339
39586
  }, /* @__PURE__ */ React61.createElement(Thumbnail2.Img, null)) : $RemotionSliderThumbnail && isRemotionSrc($src) ? /* @__PURE__ */ React61.createElement($RemotionSliderThumbnail, { className: "vds-slider-thumbnail vds-thumbnail" }) : null, /* @__PURE__ */ React61.createElement(ChapterTitle, { className: "vds-slider-chapter-title" }), /* @__PURE__ */ React61.createElement(Value2, { className: "vds-slider-value" })));
@@ -39437,7 +39684,7 @@ function AudioTitle({ title, chapterTitle }) {
39437
39684
  return /* @__PURE__ */ React61.createElement("span", { className: "vds-title-text" }, slot(slots, "title", title), slot(slots, "chapterTitle", /* @__PURE__ */ React61.createElement("span", { className: "vds-chapter-title" }, chapterTitle)));
39438
39685
  }
39439
39686
  AudioTitle.displayName = "AudioTitle";
39440
- var DefaultKeyboardDisplay = React61.forwardRef(({ icons: Icons, ...props }, forwardRef14) => {
39687
+ var DefaultKeyboardDisplay = React61.forwardRef(({ icons: Icons, ...props }, forwardRef15) => {
39441
39688
  const [visible, setVisible] = React61.useState(false), [Icon4, setIcon] = React61.useState(null), [count4, setCount] = React61.useState(0), $lastKeyboardAction = useMediaState("lastKeyboardAction");
39442
39689
  React61.useEffect(() => {
39443
39690
  setCount((n2) => n2 + 1);
@@ -39464,12 +39711,12 @@ var DefaultKeyboardDisplay = React61.forwardRef(({ icons: Icons, ...props }, for
39464
39711
  ...props,
39465
39712
  className,
39466
39713
  "data-action": actionDataAttr,
39467
- ref: forwardRef14
39714
+ ref: forwardRef15
39468
39715
  }, /* @__PURE__ */ React61.createElement("div", { className: "vds-kb-text-wrapper" }, /* @__PURE__ */ React61.createElement("div", { className: "vds-kb-text" }, $text)), /* @__PURE__ */ React61.createElement("div", { className: "vds-kb-bezel", key: count4 }, /* @__PURE__ */ React61.createElement("div", { className: "vds-kb-icon" }, /* @__PURE__ */ React61.createElement(Icon4, null)))) : null;
39469
39716
  });
39470
39717
  DefaultKeyboardDisplay.displayName = "DefaultKeyboardDisplay";
39471
39718
  function getText() {
39472
- const { $state } = useContext45(mediaContext), action = $state.lastKeyboardAction()?.action, audioGain = $state.audioGain() ?? 1;
39719
+ const { $state } = useContext44(mediaContext), action = $state.lastKeyboardAction()?.action, audioGain = $state.audioGain() ?? 1;
39473
39720
  switch (action) {
39474
39721
  case "toggleMuted":
39475
39722
  return $state.muted() ? "0%" : getVolumeText($state.volume(), audioGain);
@@ -39484,7 +39731,7 @@ function getVolumeText(volume, gain) {
39484
39731
  return `${Math.round(volume * gain * 100)}%`;
39485
39732
  }
39486
39733
  function getIcon(Icons) {
39487
- const { $state } = useContext45(mediaContext), action = $state.lastKeyboardAction()?.action;
39734
+ const { $state } = useContext44(mediaContext), action = $state.lastKeyboardAction()?.action;
39488
39735
  switch (action) {
39489
39736
  case "togglePaused":
39490
39737
  return !$state.paused() ? Icons.Play : Icons.Pause;
@@ -39676,10 +39923,10 @@ import"react-dom";
39676
39923
  "use client";
39677
39924
 
39678
39925
  // src/components/prompts/MuxPlayer.tsx
39679
- import { useCallback as useCallback33 } from "react";
39926
+ import { useCallback as useCallback34 } from "react";
39680
39927
  import { jsx as jsx41, jsxs as jsxs9 } from "react/jsx-runtime";
39681
39928
  var MuxPlayer = ({ playbackId, title, rounded = true }) => {
39682
- const onProviderChange = useCallback33((provider2, _e) => {
39929
+ const onProviderChange = useCallback34((provider2, _e) => {
39683
39930
  if (isHLSProvider(provider2)) {
39684
39931
  provider2.library = () => import("hls.js");
39685
39932
  }