@remotion/promo-pages 4.0.341 → 4.0.345

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.
package/dist/Homepage.js CHANGED
@@ -19,36 +19,38 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
19
19
 
20
20
  // ../core/dist/esm/index.mjs
21
21
  import { createContext } from "react";
22
+ import React22 from "react";
22
23
  import React4 from "react";
23
24
  import { createContext as createContext2, useContext } from "react";
24
25
  import { jsx as jsx10 } from "react/jsx-runtime";
25
26
  import {
26
27
  forwardRef as forwardRef2,
27
- useContext as useContext10,
28
+ useContext as useContext11,
28
29
  useEffect as useEffect3,
29
30
  useMemo as useMemo9,
30
- useState as useState4
31
+ useState as useState5
31
32
  } from "react";
32
33
  import { forwardRef, useMemo as useMemo2 } from "react";
33
34
  import { jsx as jsx22 } from "react/jsx-runtime";
34
35
  import { createContext as createContext3 } from "react";
35
- import React32, { useCallback as useCallback2, useMemo as useMemo22, useState as useState2 } from "react";
36
+ import React42, { useCallback as useCallback2, useMemo as useMemo22, useState as useState2 } from "react";
36
37
  import { jsx as jsx32 } from "react/jsx-runtime";
37
38
  import { createContext as createContext4, useContext as useContext2, useEffect as useEffect2, useRef, useState as useState22 } from "react";
38
- import { createContext as createContext8, useContext as useContext5, useMemo as useMemo6 } from "react";
39
- import { useContext as useContext4, useMemo as useMemo5 } from "react";
39
+ import { createContext as createContext8, useContext as useContext6, useMemo as useMemo6 } from "react";
40
+ import { useContext as useContext3, useState as useState3 } from "react";
41
+ import { useContext as useContext5, useMemo as useMemo5 } from "react";
40
42
  import { createContext as createContext5 } from "react";
41
43
  import {
42
44
  createContext as createContext7,
43
45
  createRef,
44
46
  useCallback as useCallback3,
45
- useContext as useContext3,
47
+ useContext as useContext4,
46
48
  useEffect as useEffect22,
47
49
  useImperativeHandle as useImperativeHandle2,
48
50
  useMemo as useMemo4,
49
- useState as useState3
51
+ useState as useState4
50
52
  } from "react";
51
- import React42, {
53
+ import React5, {
52
54
  createContext as createContext6,
53
55
  useCallback as useCallback22,
54
56
  useImperativeHandle,
@@ -56,12 +58,12 @@ import React42, {
56
58
  } from "react";
57
59
  import { jsx as jsx42 } from "react/jsx-runtime";
58
60
  import { jsx as jsx52 } from "react/jsx-runtime";
59
- import { useContext as useContext7 } from "react";
61
+ import { useContext as useContext8 } from "react";
60
62
  import { createContext as createContext9 } from "react";
61
63
  import { jsx as jsx62 } from "react/jsx-runtime";
62
- import { useContext as useContext6, useMemo as useMemo7 } from "react";
63
- import { useContext as useContext9, useMemo as useMemo8 } from "react";
64
- import { useContext as useContext8 } from "react";
64
+ import { useContext as useContext7, useMemo as useMemo7 } from "react";
65
+ import { useContext as useContext10, useMemo as useMemo8 } from "react";
66
+ import { useContext as useContext9 } from "react";
65
67
  import { jsx as jsx72 } from "react/jsx-runtime";
66
68
  import { jsx as jsx82 } from "react/jsx-runtime";
67
69
  import {
@@ -70,82 +72,83 @@ import {
70
72
  useImperativeHandle as useImperativeHandle4,
71
73
  useLayoutEffect,
72
74
  useRef as useRef3,
73
- useState as useState5
75
+ useState as useState6
74
76
  } from "react";
75
- import React8, { useCallback as useCallback4, useImperativeHandle as useImperativeHandle3, useRef as useRef2 } from "react";
77
+ import { useCallback as useCallback4 } from "react";
78
+ import React9, { useCallback as useCallback5, useImperativeHandle as useImperativeHandle3, useRef as useRef2 } from "react";
76
79
  import { jsx as jsx92 } from "react/jsx-runtime";
77
80
  import { jsx as jsx102 } from "react/jsx-runtime";
78
- import { useContext as useContext11, useEffect as useEffect5, useState as useState7 } from "react";
81
+ import { useContext as useContext12, useEffect as useEffect5, useState as useState8 } from "react";
79
82
  import {
80
83
  createContext as createContext10,
81
- useCallback as useCallback5,
84
+ useCallback as useCallback6,
82
85
  useLayoutEffect as useLayoutEffect2,
83
86
  useMemo as useMemo10,
84
- useState as useState6
87
+ useState as useState7
85
88
  } from "react";
86
89
  import { jsx as jsx11 } from "react/jsx-runtime";
87
- import { forwardRef as forwardRef6, useCallback as useCallback10, useContext as useContext24 } from "react";
88
- import React9, { createContext as createContext11, useMemo as useMemo11 } from "react";
90
+ import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext25 } from "react";
91
+ import React10, { createContext as createContext11, useMemo as useMemo11 } from "react";
89
92
  import { jsx as jsx12 } from "react/jsx-runtime";
90
- import { useContext as useContext12 } from "react";
91
- import { createContext as createContext12, useEffect as useEffect6, useState as useState8 } from "react";
93
+ import { useContext as useContext13 } from "react";
94
+ import { createContext as createContext12, useEffect as useEffect6, useState as useState9 } from "react";
92
95
  import { jsx as jsx13 } from "react/jsx-runtime";
93
96
  import { createContext as createContext13, useMemo as useMemo12, useReducer } from "react";
94
97
  import { jsx as jsx14 } from "react/jsx-runtime";
95
98
  import {
96
99
  forwardRef as forwardRef4,
97
- useContext as useContext22,
100
+ useContext as useContext23,
98
101
  useEffect as useEffect13,
99
102
  useImperativeHandle as useImperativeHandle5,
100
103
  useMemo as useMemo20,
101
104
  useRef as useRef11,
102
- useState as useState13
105
+ useState as useState14
103
106
  } from "react";
104
107
  import { createContext as createContext14 } from "react";
105
- import * as React12 from "react";
106
- import { useContext as useContext15, useLayoutEffect as useLayoutEffect3, useRef as useRef6 } from "react";
107
- import React13, {
108
+ import * as React13 from "react";
109
+ import { useContext as useContext16, useLayoutEffect as useLayoutEffect3, useRef as useRef6 } from "react";
110
+ import React14, {
108
111
  createContext as createContext15,
109
112
  createRef as createRef2,
110
- useCallback as useCallback6,
111
- useContext as useContext14,
113
+ useCallback as useCallback7,
114
+ useContext as useContext15,
112
115
  useEffect as useEffect7,
113
116
  useMemo as useMemo14,
114
117
  useRef as useRef4,
115
- useState as useState9
118
+ useState as useState10
116
119
  } from "react";
117
120
  import { useMemo as useMemo13 } from "react";
118
121
  import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
119
122
  import { useRef as useRef5 } from "react";
120
- import { useContext as useContext17, useEffect as useEffect8, useMemo as useMemo15, useState as useState10 } from "react";
121
- import { useContext as useContext16 } from "react";
123
+ import { useContext as useContext18, useEffect as useEffect8, useMemo as useMemo15, useState as useState11 } from "react";
124
+ import { useContext as useContext17 } from "react";
122
125
  import {
123
- useCallback as useCallback9,
124
- useContext as useContext20,
126
+ useCallback as useCallback10,
127
+ useContext as useContext21,
125
128
  useEffect as useEffect12,
126
129
  useLayoutEffect as useLayoutEffect5,
127
130
  useRef as useRef10
128
131
  } from "react";
129
- import { useCallback as useCallback8, useMemo as useMemo18, useRef as useRef8 } from "react";
130
- import { useContext as useContext19, useMemo as useMemo17 } from "react";
131
- import React14, {
132
- useCallback as useCallback7,
133
- useContext as useContext18,
132
+ import { useCallback as useCallback9, useMemo as useMemo18, useRef as useRef8 } from "react";
133
+ import { useContext as useContext20, useMemo as useMemo17 } from "react";
134
+ import React15, {
135
+ useCallback as useCallback8,
136
+ useContext as useContext19,
134
137
  useEffect as useEffect9,
135
138
  useLayoutEffect as useLayoutEffect4,
136
139
  useMemo as useMemo16,
137
140
  useRef as useRef7,
138
- useState as useState11
141
+ useState as useState12
139
142
  } from "react";
140
143
  import { jsx as jsx16 } from "react/jsx-runtime";
141
- import React15 from "react";
142
- import { useEffect as useEffect10, useState as useState12 } from "react";
144
+ import React16 from "react";
145
+ import { useEffect as useEffect10, useState as useState13 } from "react";
143
146
  import { useEffect as useEffect11, useRef as useRef9 } from "react";
144
- import { createContext as createContext16, useContext as useContext21, useMemo as useMemo19 } from "react";
147
+ import { createContext as createContext16, useContext as useContext22, useMemo as useMemo19 } from "react";
145
148
  import { jsx as jsx17 } from "react/jsx-runtime";
146
149
  import {
147
150
  forwardRef as forwardRef5,
148
- useContext as useContext23,
151
+ useContext as useContext24,
149
152
  useEffect as useEffect14,
150
153
  useImperativeHandle as useImperativeHandle6,
151
154
  useLayoutEffect as useLayoutEffect6,
@@ -154,31 +157,31 @@ import {
154
157
  } from "react";
155
158
  import { jsx as jsx18 } from "react/jsx-runtime";
156
159
  import { jsx as jsx19 } from "react/jsx-runtime";
157
- import { Suspense, useContext as useContext26, useEffect as useEffect16 } from "react";
160
+ import { Suspense, useContext as useContext27, useEffect as useEffect16 } from "react";
158
161
  import { createPortal } from "react-dom";
159
- import { createContext as createContext17, useContext as useContext25, useEffect as useEffect15, useMemo as useMemo222 } from "react";
162
+ import { createContext as createContext17, useContext as useContext26, useEffect as useEffect15, useMemo as useMemo222 } from "react";
160
163
  import { jsx as jsx20 } from "react/jsx-runtime";
161
164
  import { jsx as jsx21, jsxs as jsxs22 } from "react/jsx-runtime";
162
- import React19, { useMemo as useMemo23 } from "react";
165
+ import React20, { useMemo as useMemo23 } from "react";
163
166
  import { jsx as jsx222 } from "react/jsx-runtime";
164
- import { forwardRef as forwardRef7, useCallback as useCallback11, useState as useState14 } from "react";
167
+ import { forwardRef as forwardRef7, useCallback as useCallback12, useState as useState15 } from "react";
165
168
  import { jsx as jsx23 } from "react/jsx-runtime";
166
169
  import {
167
170
  forwardRef as forwardRef8,
168
- useCallback as useCallback12,
169
- useContext as useContext27,
171
+ useCallback as useCallback13,
172
+ useContext as useContext28,
170
173
  useImperativeHandle as useImperativeHandle7,
171
174
  useLayoutEffect as useLayoutEffect7,
172
175
  useRef as useRef13
173
176
  } from "react";
174
177
  import { jsx as jsx24 } from "react/jsx-runtime";
175
178
  import { createRef as createRef3 } from "react";
176
- import React23, {
177
- useCallback as useCallback13,
179
+ import React24, {
180
+ useCallback as useCallback14,
178
181
  useImperativeHandle as useImperativeHandle8,
179
182
  useMemo as useMemo24,
180
183
  useRef as useRef14,
181
- useState as useState15
184
+ useState as useState16
182
185
  } from "react";
183
186
  import { jsx as jsx25 } from "react/jsx-runtime";
184
187
  import {
@@ -186,44 +189,44 @@ import {
186
189
  useLayoutEffect as useLayoutEffect8,
187
190
  useMemo as useMemo25,
188
191
  useRef as useRef15,
189
- useState as useState16
192
+ useState as useState17
190
193
  } from "react";
191
194
  import { jsx as jsx26 } from "react/jsx-runtime";
192
- import React25, { createContext as createContext18 } from "react";
195
+ import React26, { createContext as createContext18 } from "react";
193
196
  import {
194
197
  forwardRef as forwardRef9,
195
- useContext as useContext28,
198
+ useContext as useContext29,
196
199
  useEffect as useEffect19,
197
200
  useImperativeHandle as useImperativeHandle9,
198
201
  useMemo as useMemo26,
199
202
  useRef as useRef16,
200
- useState as useState17
203
+ useState as useState18
201
204
  } from "react";
202
205
  import { useEffect as useEffect18 } from "react";
203
206
  import { jsx as jsx27 } from "react/jsx-runtime";
204
- import React27, { useMemo as useMemo27 } from "react";
207
+ import React28, { useMemo as useMemo27 } from "react";
205
208
  import { jsx as jsx28 } from "react/jsx-runtime";
206
209
  import { Children, forwardRef as forwardRef10, useMemo as useMemo28 } from "react";
207
- import React28 from "react";
208
- import React29, { createContext as createContext19 } from "react";
210
+ import React29 from "react";
211
+ import React30, { createContext as createContext19 } from "react";
209
212
  import { jsx as jsx29 } from "react/jsx-runtime";
210
213
  import { jsx as jsx30 } from "react/jsx-runtime";
211
- import React31 from "react";
212
- import { useCallback as useCallback15 } from "react";
214
+ import React32 from "react";
215
+ import { useCallback as useCallback16 } from "react";
213
216
  import {
214
- useCallback as useCallback14,
215
- useContext as useContext29,
217
+ useCallback as useCallback15,
218
+ useContext as useContext30,
216
219
  useEffect as useEffect20,
217
220
  useLayoutEffect as useLayoutEffect9,
218
221
  useMemo as useMemo29,
219
- useState as useState18
222
+ useState as useState19
220
223
  } from "react";
221
224
  import { jsx as jsx31 } from "react/jsx-runtime";
222
225
  import { jsx as jsx322 } from "react/jsx-runtime";
223
- import { forwardRef as forwardRef12, useCallback as useCallback16, useContext as useContext31 } from "react";
226
+ import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as useContext32 } from "react";
224
227
  import {
225
228
  forwardRef as forwardRef11,
226
- useContext as useContext30,
229
+ useContext as useContext31,
227
230
  useEffect as useEffect21,
228
231
  useImperativeHandle as useImperativeHandle10,
229
232
  useLayoutEffect as useLayoutEffect10,
@@ -436,18 +439,18 @@ function exponentialBackoff(errorCount) {
436
439
  return 1000 * 2 ** (errorCount - 1);
437
440
  }
438
441
  function useRemotionContexts() {
439
- const compositionManagerCtx = React27.useContext(CompositionManager);
440
- const timelineContext = React27.useContext(TimelineContext);
441
- const setTimelineContext = React27.useContext(SetTimelineContext);
442
- const sequenceContext = React27.useContext(SequenceContext);
443
- const nonceContext = React27.useContext(NonceContext);
444
- const canUseRemotionHooksContext = React27.useContext(CanUseRemotionHooks);
445
- const preloadContext = React27.useContext(PreloadContext);
446
- const resolveCompositionContext = React27.useContext(ResolveCompositionContext);
447
- const renderAssetManagerContext = React27.useContext(RenderAssetManager);
448
- const sequenceManagerContext = React27.useContext(SequenceManager);
449
- const bufferManagerContext = React27.useContext(BufferingContextReact);
450
- const logLevelContext = React27.useContext(LogLevelContext);
442
+ const compositionManagerCtx = React28.useContext(CompositionManager);
443
+ const timelineContext = React28.useContext(TimelineContext);
444
+ const setTimelineContext = React28.useContext(SetTimelineContext);
445
+ const sequenceContext = React28.useContext(SequenceContext);
446
+ const nonceContext = React28.useContext(NonceContext);
447
+ const canUseRemotionHooksContext = React28.useContext(CanUseRemotionHooks);
448
+ const preloadContext = React28.useContext(PreloadContext);
449
+ const resolveCompositionContext = React28.useContext(ResolveCompositionContext);
450
+ const renderAssetManagerContext = React28.useContext(RenderAssetManager);
451
+ const sequenceManagerContext = React28.useContext(SequenceManager);
452
+ const bufferManagerContext = React28.useContext(BufferingContextReact);
453
+ const logLevelContext = React28.useContext(LogLevelContext);
451
454
  return useMemo27(() => ({
452
455
  compositionManagerCtx,
453
456
  timelineContext,
@@ -703,9 +706,10 @@ var __defProp2, __export2 = (target, all) => {
703
706
  isStudio,
704
707
  isRendering,
705
708
  isPlayer,
706
- isReadOnlyStudio
709
+ isReadOnlyStudio,
710
+ isClientSideRendering: false
707
711
  };
708
- }, originalCreateElement, componentsToAddStacksTo, enableSequenceStackTraces = () => {
712
+ }, RemotionEnvironmentContext, originalCreateElement, componentsToAddStacksTo, enableSequenceStackTraces = () => {
709
713
  if (!getRemotionEnvironment().isStudio) {
710
714
  return;
711
715
  }
@@ -722,7 +726,7 @@ var __defProp2, __export2 = (target, all) => {
722
726
  return Reflect.apply(target, thisArg, argArray);
723
727
  }
724
728
  });
725
- React4.createElement = proxy;
729
+ React22.createElement = proxy;
726
730
  }, addSequenceStackTraces = (component) => {
727
731
  componentsToAddStacksTo.push(component);
728
732
  enableSequenceStackTraces();
@@ -735,7 +739,7 @@ var __defProp2, __export2 = (target, all) => {
735
739
  });
736
740
  }, useIsPlayer = () => {
737
741
  return useContext(IsPlayerContext);
738
- }, VERSION = "4.0.341", checkMultipleRemotionVersions = () => {
742
+ }, VERSION = "4.0.345", checkMultipleRemotionVersions = () => {
739
743
  if (typeof globalThis === "undefined") {
740
744
  return;
741
745
  }
@@ -893,8 +897,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
893
897
  setNonce(context.getNonce);
894
898
  }, [context]);
895
899
  return nonce;
896
- }, exports_timeline_position_state, CompositionManager, CompositionSetters, EditorPropsContext, editorPropsProviderRef, timeValueRef, EditorPropsProvider = ({ children }) => {
897
- const [props, setProps] = React42.useState({});
900
+ }, exports_timeline_position_state, useRemotionEnvironment = () => {
901
+ const context = useContext3(RemotionEnvironmentContext);
902
+ const [env] = useState3(() => getRemotionEnvironment());
903
+ return context ?? env;
904
+ }, CompositionManager, CompositionSetters, EditorPropsContext, editorPropsProviderRef, timeValueRef, EditorPropsProvider = ({ children }) => {
905
+ const [props, setProps] = React5.useState({});
898
906
  const updateProps = useCallback22(({
899
907
  defaultProps,
900
908
  id,
@@ -1058,7 +1066,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
1058
1066
  defaultProps,
1059
1067
  props: originalProps,
1060
1068
  abortSignal: signal,
1061
- compositionId
1069
+ compositionId,
1070
+ isRendering: getRemotionEnvironment().isRendering
1062
1071
  }) : null;
1063
1072
  if (calculatedProm !== null && typeof calculatedProm === "object" && "then" in calculatedProm) {
1064
1073
  return calculatedProm.then((c) => {
@@ -1140,19 +1149,20 @@ Check that all your Remotion packages are on the same version. If your dependenc
1140
1149
  }, ResolveCompositionContext, resolveCompositionsRef, needsResolution = (composition) => {
1141
1150
  return Boolean(composition.calculateMetadata);
1142
1151
  }, PROPS_UPDATED_EXTERNALLY = "remotion.propsUpdatedExternally", ResolveCompositionConfig = ({ children }) => {
1143
- const [currentRenderModalComposition, setCurrentRenderModalComposition] = useState3(null);
1144
- const { compositions, canvasContent, currentCompositionMetadata } = useContext3(CompositionManager);
1145
- const { fastRefreshes, manualRefreshes } = useContext3(NonceContext);
1152
+ const [currentRenderModalComposition, setCurrentRenderModalComposition] = useState4(null);
1153
+ const { compositions, canvasContent, currentCompositionMetadata } = useContext4(CompositionManager);
1154
+ const { fastRefreshes, manualRefreshes } = useContext4(NonceContext);
1146
1155
  if (manualRefreshes) {}
1147
1156
  const selectedComposition = useMemo4(() => {
1148
1157
  return compositions.find((c) => canvasContent && canvasContent.type === "composition" && canvasContent.compositionId === c.id);
1149
1158
  }, [canvasContent, compositions]);
1150
1159
  const renderModalComposition = compositions.find((c) => c.id === currentRenderModalComposition);
1151
- const { props: allEditorProps } = useContext3(EditorPropsContext);
1160
+ const { props: allEditorProps } = useContext4(EditorPropsContext);
1161
+ const env = useRemotionEnvironment();
1152
1162
  const inputProps = useMemo4(() => {
1153
- return typeof window === "undefined" || getRemotionEnvironment().isPlayer ? {} : getInputProps() ?? {};
1154
- }, []);
1155
- const [resolvedConfigs, setResolvedConfigs] = useState3({});
1163
+ return typeof window === "undefined" || env.isPlayer ? {} : getInputProps() ?? {};
1164
+ }, [env.isPlayer]);
1165
+ const [resolvedConfigs, setResolvedConfigs] = useState4({});
1156
1166
  const selectedEditorProps = useMemo4(() => {
1157
1167
  return selectedComposition ? allEditorProps[selectedComposition.id] ?? {} : {};
1158
1168
  }, [allEditorProps, selectedComposition]);
@@ -1390,15 +1400,16 @@ Check that all your Remotion packages are on the same version. If your dependenc
1390
1400
  children
1391
1401
  });
1392
1402
  }, useResolvedVideoConfig = (preferredCompositionId) => {
1393
- const context = useContext3(ResolveCompositionContext);
1394
- const { props: allEditorProps } = useContext3(EditorPropsContext);
1395
- const { compositions, canvasContent, currentCompositionMetadata } = useContext3(CompositionManager);
1403
+ const context = useContext4(ResolveCompositionContext);
1404
+ const { props: allEditorProps } = useContext4(EditorPropsContext);
1405
+ const { compositions, canvasContent, currentCompositionMetadata } = useContext4(CompositionManager);
1396
1406
  const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
1397
1407
  const compositionId = preferredCompositionId ?? currentComposition;
1398
1408
  const composition = compositions.find((c) => c.id === compositionId);
1399
1409
  const selectedEditorProps = useMemo4(() => {
1400
1410
  return composition ? allEditorProps[composition.id] ?? {} : {};
1401
1411
  }, [allEditorProps, composition]);
1412
+ const env = useRemotionEnvironment();
1402
1413
  return useMemo4(() => {
1403
1414
  if (!composition) {
1404
1415
  return null;
@@ -1433,7 +1444,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1433
1444
  props: {
1434
1445
  ...composition.defaultProps ?? {},
1435
1446
  ...selectedEditorProps ?? {},
1436
- ...typeof window === "undefined" || getRemotionEnvironment().isPlayer ? {} : getInputProps() ?? {}
1447
+ ...typeof window === "undefined" || env.isPlayer ? {} : getInputProps() ?? {}
1437
1448
  },
1438
1449
  defaultCodec: null,
1439
1450
  defaultOutName: null,
@@ -1446,9 +1457,15 @@ Check that all your Remotion packages are on the same version. If your dependenc
1446
1457
  return null;
1447
1458
  }
1448
1459
  return context[composition.id];
1449
- }, [composition, context, currentCompositionMetadata, selectedEditorProps]);
1460
+ }, [
1461
+ composition,
1462
+ context,
1463
+ currentCompositionMetadata,
1464
+ selectedEditorProps,
1465
+ env.isPlayer
1466
+ ]);
1450
1467
  }, useVideo = () => {
1451
- const { canvasContent, compositions, currentCompositionMetadata } = useContext4(CompositionManager);
1468
+ const { canvasContent, compositions, currentCompositionMetadata } = useContext5(CompositionManager);
1452
1469
  const selected = compositions.find((c) => {
1453
1470
  return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
1454
1471
  });
@@ -1494,18 +1511,19 @@ Check that all your Remotion packages are on the same version. If your dependenc
1494
1511
  return window.remotion_initialFrame ?? 0;
1495
1512
  }, useTimelinePosition = () => {
1496
1513
  const videoConfig = useVideo();
1497
- const state = useContext5(TimelineContext);
1514
+ const state = useContext6(TimelineContext);
1515
+ const env = useRemotionEnvironment();
1498
1516
  if (!videoConfig) {
1499
1517
  return typeof window === "undefined" ? 0 : window.remotion_initialFrame ?? 0;
1500
1518
  }
1501
- const unclamped = state.frame[videoConfig.id] ?? (getRemotionEnvironment().isPlayer ? 0 : getFrameForComposition(videoConfig.id));
1519
+ const unclamped = state.frame[videoConfig.id] ?? (env.isPlayer ? 0 : getFrameForComposition(videoConfig.id));
1502
1520
  return Math.min(videoConfig.durationInFrames - 1, unclamped);
1503
1521
  }, useTimelineSetFrame = () => {
1504
- const { setFrame } = useContext5(SetTimelineContext);
1522
+ const { setFrame } = useContext6(SetTimelineContext);
1505
1523
  return setFrame;
1506
1524
  }, usePlayingState = () => {
1507
- const { playing, imperativePlaying } = useContext5(TimelineContext);
1508
- const { setPlaying } = useContext5(SetTimelineContext);
1525
+ const { playing, imperativePlaying } = useContext6(TimelineContext);
1526
+ const { setPlaying } = useContext6(SetTimelineContext);
1509
1527
  return useMemo6(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
1510
1528
  }, CanUseRemotionHooks, CanUseRemotionHooksProvider = ({ children }) => {
1511
1529
  return /* @__PURE__ */ jsx62(CanUseRemotionHooks.Provider, {
@@ -1513,7 +1531,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1513
1531
  children
1514
1532
  });
1515
1533
  }, useUnsafeVideoConfig = () => {
1516
- const context = useContext6(SequenceContext);
1534
+ const context = useContext7(SequenceContext);
1517
1535
  const ctxWidth = context?.width ?? null;
1518
1536
  const ctxHeight = context?.height ?? null;
1519
1537
  const ctxDuration = context?.durationInFrames ?? null;
@@ -1551,7 +1569,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1551
1569
  }, [ctxDuration, ctxHeight, ctxWidth, video]);
1552
1570
  }, useVideoConfig = () => {
1553
1571
  const videoConfig = useUnsafeVideoConfig();
1554
- const context = useContext7(CanUseRemotionHooks);
1572
+ const context = useContext8(CanUseRemotionHooks);
1555
1573
  const isPlayer = useIsPlayer();
1556
1574
  if (!videoConfig) {
1557
1575
  if (typeof window !== "undefined" && window.remotion_isPlayer || isPlayer) {
@@ -1568,15 +1586,16 @@ Check that all your Remotion packages are on the same version. If your dependenc
1568
1586
  }
1569
1587
  return videoConfig;
1570
1588
  }, useCurrentFrame = () => {
1571
- const canUseRemotionHooks = useContext8(CanUseRemotionHooks);
1589
+ const canUseRemotionHooks = useContext9(CanUseRemotionHooks);
1590
+ const env = useRemotionEnvironment();
1572
1591
  if (!canUseRemotionHooks) {
1573
- if (getRemotionEnvironment().isPlayer) {
1592
+ if (env.isPlayer) {
1574
1593
  throw new Error(`useCurrentFrame can only be called inside a component that was passed to <Player>. See: https://www.remotion.dev/docs/player/examples`);
1575
1594
  }
1576
1595
  throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
1577
1596
  }
1578
1597
  const frame = useTimelinePosition();
1579
- const context = useContext8(SequenceContext);
1598
+ const context = useContext9(SequenceContext);
1580
1599
  const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
1581
1600
  return frame - contextOffset;
1582
1601
  }, Freeze = ({
@@ -1606,8 +1625,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
1606
1625
  return active(frame);
1607
1626
  }
1608
1627
  }, [active, frame]);
1609
- const timelineContext = useContext9(TimelineContext);
1610
- const sequenceContext = useContext9(SequenceContext);
1628
+ const timelineContext = useContext10(TimelineContext);
1629
+ const sequenceContext = useContext10(SequenceContext);
1611
1630
  const relativeFrom = sequenceContext?.relativeFrom ?? 0;
1612
1631
  const timelineValue = useMemo8(() => {
1613
1632
  if (!isActive) {
@@ -1643,9 +1662,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
1643
1662
  ...other
1644
1663
  }, ref) => {
1645
1664
  const { layout = "absolute-fill" } = other;
1646
- const [id] = useState4(() => String(Math.random()));
1647
- const parentSequence = useContext10(SequenceContext);
1648
- const { rootId } = useContext10(TimelineContext);
1665
+ const [id] = useState5(() => String(Math.random()));
1666
+ const parentSequence = useContext11(SequenceContext);
1667
+ const { rootId } = useContext11(TimelineContext);
1649
1668
  const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
1650
1669
  const nonce = useNonce();
1651
1670
  if (layout !== "absolute-fill" && layout !== "none") {
@@ -1670,8 +1689,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
1670
1689
  const videoConfig = useVideoConfig();
1671
1690
  const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - from, durationInFrames) : durationInFrames;
1672
1691
  const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
1673
- const { registerSequence, unregisterSequence } = useContext10(SequenceManager);
1674
- const { hidden } = useContext10(SequenceVisibilityToggleContext);
1692
+ const { registerSequence, unregisterSequence } = useContext11(SequenceManager);
1693
+ const { hidden } = useContext11(SequenceVisibilityToggleContext);
1675
1694
  const premounting = useMemo9(() => {
1676
1695
  return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
1677
1696
  }, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
@@ -1704,8 +1723,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
1704
1723
  const timelineClipName = useMemo9(() => {
1705
1724
  return name ?? "";
1706
1725
  }, [name]);
1726
+ const env = useRemotionEnvironment();
1707
1727
  useEffect3(() => {
1708
- if (!getRemotionEnvironment().isStudio) {
1728
+ if (!env.isStudio) {
1709
1729
  return;
1710
1730
  }
1711
1731
  registerSequence({
@@ -1742,7 +1762,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
1742
1762
  loopDisplay,
1743
1763
  stack,
1744
1764
  premountDisplay,
1745
- postmountDisplay
1765
+ postmountDisplay,
1766
+ env.isStudio
1746
1767
  ]);
1747
1768
  const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
1748
1769
  const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
@@ -1822,7 +1843,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
1822
1843
  })
1823
1844
  });
1824
1845
  }, PremountedPostmountedSequence, SequenceRefForwardingFunction = (props, ref) => {
1825
- if (props.layout !== "none" && !getRemotionEnvironment().isRendering) {
1846
+ const env = useRemotionEnvironment();
1847
+ if (props.layout !== "none" && !env.isRendering) {
1826
1848
  if (props.premountFor || props.postmountFor) {
1827
1849
  return /* @__PURE__ */ jsx82(PremountedPostmountedSequence, {
1828
1850
  ...props,
@@ -1861,14 +1883,14 @@ Check that all your Remotion packages are on the same version. If your dependenc
1861
1883
  return logLevels.indexOf(level);
1862
1884
  }, isEqualOrBelowLogLevel = (currentLevel, level) => {
1863
1885
  return getNumberForLogLevel(currentLevel) <= getNumberForLogLevel(level);
1864
- }, Log, handles, DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:", DELAY_RENDER_RETRIES_LEFT = "Retries left: ", DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.", DELAY_RENDER_CLEAR_TOKEN = "handle was cleared after", defaultTimeout = 30000, delayRender = (label, options) => {
1886
+ }, Log, handles, DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:", DELAY_RENDER_RETRIES_LEFT = "Retries left: ", DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.", DELAY_RENDER_CLEAR_TOKEN = "handle was cleared after", defaultTimeout = 30000, delayRenderInternal = (environment, label, options) => {
1865
1887
  if (typeof label !== "string" && typeof label !== "undefined") {
1866
1888
  throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label));
1867
1889
  }
1868
1890
  const handle = Math.random();
1869
1891
  handles.push(handle);
1870
1892
  const called = Error().stack?.replace(/^Error/g, "") ?? "";
1871
- if (getRemotionEnvironment().isRendering) {
1893
+ if (environment.isRendering) {
1872
1894
  const timeoutToUse = (options?.timeoutInMilliseconds ?? (typeof window === "undefined" ? defaultTimeout : window.remotion_puppeteerTimeout ?? defaultTimeout)) - 2000;
1873
1895
  if (typeof window !== "undefined") {
1874
1896
  const retriesLeft = (options?.retries ?? 0) - (window.remotion_attempt - 1);
@@ -1894,7 +1916,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1894
1916
  window.remotion_renderReady = false;
1895
1917
  }
1896
1918
  return handle;
1897
- }, continueRender = (handle) => {
1919
+ }, continueRenderInternal = (handle, environment) => {
1898
1920
  if (typeof handle === "undefined") {
1899
1921
  throw new TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");
1900
1922
  }
@@ -1903,7 +1925,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1903
1925
  }
1904
1926
  handles = handles.filter((h) => {
1905
1927
  if (h === handle) {
1906
- if (getRemotionEnvironment().isRendering) {
1928
+ if (environment.isRendering) {
1907
1929
  if (!window.remotion_delayRenderTimeouts[handle]) {
1908
1930
  return false;
1909
1931
  }
@@ -1924,6 +1946,15 @@ Check that all your Remotion packages are on the same version. If your dependenc
1924
1946
  if (handles.length === 0 && typeof window !== "undefined") {
1925
1947
  window.remotion_renderReady = true;
1926
1948
  }
1949
+ }, useDelayRender = () => {
1950
+ const environment = useRemotionEnvironment();
1951
+ const delayRender2 = useCallback4((label, options) => {
1952
+ return delayRenderInternal(environment, label, options);
1953
+ }, [environment]);
1954
+ const continueRender2 = useCallback4((handle) => {
1955
+ continueRenderInternal(handle, environment);
1956
+ }, [environment]);
1957
+ return { delayRender: delayRender2, continueRender: continueRender2 };
1927
1958
  }, calcArgs = (fit, frameSize, canvasSize) => {
1928
1959
  switch (fit) {
1929
1960
  case "fill": {
@@ -1973,7 +2004,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1973
2004
  }
1974
2005
  }, CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
1975
2006
  const canvasRef = useRef2(null);
1976
- const draw = useCallback4((imageData) => {
2007
+ const draw = useCallback5((imageData) => {
1977
2008
  const canvas = canvasRef.current;
1978
2009
  const canvasWidth = width ?? imageData.displayWidth;
1979
2010
  const canvasHeight = height ?? imageData.displayHeight;
@@ -2186,14 +2217,14 @@ Check that all your Remotion packages are on the same version. If your dependenc
2186
2217
  }
2187
2218
  validateContent(artifact.content);
2188
2219
  }, RenderAssetManager, RenderAssetManagerProvider = ({ children }) => {
2189
- const [renderAssets, setRenderAssets] = useState6([]);
2190
- const registerRenderAsset = useCallback5((renderAsset) => {
2220
+ const [renderAssets, setRenderAssets] = useState7([]);
2221
+ const registerRenderAsset = useCallback6((renderAsset) => {
2191
2222
  validateRenderAsset(renderAsset);
2192
2223
  setRenderAssets((assets) => {
2193
2224
  return [...assets, renderAsset];
2194
2225
  });
2195
2226
  }, []);
2196
- const unregisterRenderAsset = useCallback5((id) => {
2227
+ const unregisterRenderAsset = useCallback6((id) => {
2197
2228
  setRenderAssets((assts) => {
2198
2229
  return assts.filter((a) => a.id !== id);
2199
2230
  });
@@ -2218,10 +2249,10 @@ Check that all your Remotion packages are on the same version. If your dependenc
2218
2249
  children
2219
2250
  });
2220
2251
  }, ArtifactThumbnail, Artifact = ({ filename, content, downloadBehavior }) => {
2221
- const { registerRenderAsset, unregisterRenderAsset } = useContext11(RenderAssetManager);
2222
- const [env] = useState7(() => getRemotionEnvironment());
2252
+ const { registerRenderAsset, unregisterRenderAsset } = useContext12(RenderAssetManager);
2253
+ const env = useRemotionEnvironment();
2223
2254
  const frame = useCurrentFrame();
2224
- const [id] = useState7(() => {
2255
+ const [id] = useState8(() => {
2225
2256
  return String(Math.random());
2226
2257
  });
2227
2258
  useEffect5(() => {
@@ -2296,7 +2327,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
2296
2327
  const actualDuration = duration / playbackRate;
2297
2328
  return Math.floor(actualDuration);
2298
2329
  }, LoopContext, useLoop = () => {
2299
- return React9.useContext(LoopContext);
2330
+ return React10.useContext(LoopContext);
2300
2331
  }, Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) => {
2301
2332
  const currentFrame = useCurrentFrame();
2302
2333
  const { durationInFrames: compDuration } = useVideoConfig();
@@ -2357,7 +2388,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
2357
2388
  preloads = updater(preloads);
2358
2389
  updaters.forEach((u) => u());
2359
2390
  }, PrefetchProvider = ({ children }) => {
2360
- const [_preloads, _setPreloads] = useState8(() => preloads);
2391
+ const [_preloads, _setPreloads] = useState9(() => preloads);
2361
2392
  useEffect6(() => {
2362
2393
  const updaterFunction = () => {
2363
2394
  _setPreloads(preloads);
@@ -2384,7 +2415,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
2384
2415
  }
2385
2416
  return src.slice(0, hashIndex);
2386
2417
  }, usePreload = (src) => {
2387
- const preloads2 = useContext12(PreloadContext);
2418
+ const preloads2 = useContext13(PreloadContext);
2388
2419
  const hashFragmentIndex = removeAndGetHashFragment(src);
2389
2420
  const withoutHashFragment = getSrcWithoutHash(src);
2390
2421
  if (!preloads2[withoutHashFragment]) {
@@ -2681,13 +2712,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
2681
2712
  }
2682
2713
  return;
2683
2714
  }, LogLevelContext, useLogLevel = () => {
2684
- const { logLevel } = React12.useContext(LogLevelContext);
2715
+ const { logLevel } = React13.useContext(LogLevelContext);
2685
2716
  if (logLevel === null) {
2686
2717
  throw new Error("useLogLevel must be used within a LogLevelProvider");
2687
2718
  }
2688
2719
  return logLevel;
2689
2720
  }, useMountTime = () => {
2690
- const { mountTime } = React12.useContext(LogLevelContext);
2721
+ const { mountTime } = React13.useContext(LogLevelContext);
2691
2722
  if (mountTime === null) {
2692
2723
  throw new Error("useMountTime must be used within a LogLevelProvider");
2693
2724
  }
@@ -2712,7 +2743,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
2712
2743
  onAutoPlayError,
2713
2744
  logLevel,
2714
2745
  mountTime,
2715
- reason
2746
+ reason,
2747
+ isPlayer
2716
2748
  }) => {
2717
2749
  const { current } = mediaRef;
2718
2750
  if (!current) {
@@ -2757,7 +2789,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
2757
2789
  return;
2758
2790
  }
2759
2791
  console.log(`The video will be muted and we'll retry playing it.`);
2760
- if (mediaType === "video" && getRemotionEnvironment().isPlayer) {
2792
+ if (mediaType === "video" && isPlayer) {
2761
2793
  console.log("Use onAutoPlayError() to handle this error yourself.");
2762
2794
  }
2763
2795
  current.muted = true;
@@ -2827,7 +2859,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
2827
2859
  return true;
2828
2860
  }, SharedAudioContext, SharedAudioContextProvider = ({ children, numberOfAudioTags, component, audioLatencyHint }) => {
2829
2861
  const audios = useRef4([]);
2830
- const [initialNumberOfAudioTags] = useState9(numberOfAudioTags);
2862
+ const [initialNumberOfAudioTags] = useState10(numberOfAudioTags);
2831
2863
  if (numberOfAudioTags !== initialNumberOfAudioTags) {
2832
2864
  throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
2833
2865
  }
@@ -2847,7 +2879,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
2847
2879
  });
2848
2880
  }, [audioContext, numberOfAudioTags]);
2849
2881
  const takenAudios = useRef4(new Array(numberOfAudioTags).fill(false));
2850
- const rerenderAudios = useCallback6(() => {
2882
+ const rerenderAudios = useCallback7(() => {
2851
2883
  refs.forEach(({ ref, id }) => {
2852
2884
  const data = audios.current?.find((a) => a.id === id);
2853
2885
  const { current } = ref;
@@ -2868,7 +2900,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
2868
2900
  });
2869
2901
  });
2870
2902
  }, [refs]);
2871
- const registerAudio = useCallback6((options) => {
2903
+ const registerAudio = useCallback7((options) => {
2872
2904
  const { aud, audioId, premounting } = options;
2873
2905
  const found = audios.current?.find((a) => a.audioId === audioId);
2874
2906
  if (found) {
@@ -2894,7 +2926,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
2894
2926
  rerenderAudios();
2895
2927
  return newElem;
2896
2928
  }, [numberOfAudioTags, refs, rerenderAudios]);
2897
- const unregisterAudio = useCallback6((id) => {
2929
+ const unregisterAudio = useCallback7((id) => {
2898
2930
  const cloned = [...takenAudios.current];
2899
2931
  const index = refs.findIndex((r2) => r2.id === id);
2900
2932
  if (index === -1) {
@@ -2905,7 +2937,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
2905
2937
  audios.current = audios.current?.filter((a) => a.id !== id);
2906
2938
  rerenderAudios();
2907
2939
  }, [refs, rerenderAudios]);
2908
- const updateAudio = useCallback6(({
2940
+ const updateAudio = useCallback7(({
2909
2941
  aud,
2910
2942
  audioId,
2911
2943
  id,
@@ -2933,7 +2965,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
2933
2965
  }
2934
2966
  }, [rerenderAudios]);
2935
2967
  const mountTime = useMountTime();
2936
- const playAllAudios = useCallback6(() => {
2968
+ const env = useRemotionEnvironment();
2969
+ const playAllAudios = useCallback7(() => {
2937
2970
  refs.forEach((ref) => {
2938
2971
  const audio = audios.current.find((a) => a.el === ref.ref);
2939
2972
  if (audio?.premounting) {
@@ -2945,11 +2978,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
2945
2978
  onAutoPlayError: null,
2946
2979
  logLevel,
2947
2980
  mountTime,
2948
- reason: "playing all audios"
2981
+ reason: "playing all audios",
2982
+ isPlayer: env.isPlayer
2949
2983
  });
2950
2984
  });
2951
2985
  audioContext?.resume();
2952
- }, [audioContext, logLevel, mountTime, refs]);
2986
+ }, [audioContext, logLevel, mountTime, refs, env.isPlayer]);
2953
2987
  const value = useMemo14(() => {
2954
2988
  return {
2955
2989
  registerAudio,
@@ -2967,7 +3001,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
2967
3001
  updateAudio,
2968
3002
  audioContext
2969
3003
  ]);
2970
- const resetAudio = useCallback6(() => {
3004
+ const resetAudio = useCallback7(() => {
2971
3005
  takenAudios.current = new Array(numberOfAudioTags).fill(false);
2972
3006
  audios.current = [];
2973
3007
  rerenderAudios();
@@ -2995,12 +3029,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
2995
3029
  audioId,
2996
3030
  premounting
2997
3031
  }) => {
2998
- const ctx = useContext14(SharedAudioContext);
2999
- const [elem] = useState9(() => {
3032
+ const ctx = useContext15(SharedAudioContext);
3033
+ const [elem] = useState10(() => {
3000
3034
  if (ctx && ctx.numberOfAudioTags > 0) {
3001
3035
  return ctx.registerAudio({ aud, audioId, premounting });
3002
3036
  }
3003
- const el = React13.createRef();
3037
+ const el = React14.createRef();
3004
3038
  const mediaElementSourceNode = ctx?.audioContext ? makeSharedElementSourceNode({
3005
3039
  audioContext: ctx.audioContext,
3006
3040
  ref: el
@@ -3014,7 +3048,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3014
3048
  premounting
3015
3049
  };
3016
3050
  });
3017
- const effectToUse = React13.useInsertionEffect ?? React13.useLayoutEffect;
3051
+ const effectToUse = React14.useInsertionEffect ?? React14.useLayoutEffect;
3018
3052
  if (typeof document !== "undefined") {
3019
3053
  effectToUse(() => {
3020
3054
  if (ctx && ctx.numberOfAudioTags > 0) {
@@ -3149,7 +3183,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3149
3183
  const audioStuffRef = useRef6(null);
3150
3184
  const currentVolumeRef = useRef6(volume);
3151
3185
  currentVolumeRef.current = volume;
3152
- const sharedAudioContext = useContext15(SharedAudioContext);
3186
+ const sharedAudioContext = useContext16(SharedAudioContext);
3153
3187
  if (!sharedAudioContext) {
3154
3188
  throw new Error("useAmplification must be used within a SharedAudioContext");
3155
3189
  }
@@ -3203,7 +3237,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3203
3237
  }
3204
3238
  return audioStuffRef;
3205
3239
  }, useMediaStartsAt = () => {
3206
- const parentSequence = useContext16(SequenceContext);
3240
+ const parentSequence = useContext17(SequenceContext);
3207
3241
  const startsAt = Math.min(0, parentSequence?.relativeFrom ?? 0);
3208
3242
  return startsAt;
3209
3243
  }, useFrameForVolumeProp = (behavior) => {
@@ -3266,13 +3300,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
3266
3300
  isPostmounting
3267
3301
  }) => {
3268
3302
  const videoConfig = useVideoConfig();
3269
- const { rootId, audioAndVideoTags } = useContext17(TimelineContext);
3270
- const parentSequence = useContext17(SequenceContext);
3303
+ const { rootId, audioAndVideoTags } = useContext18(TimelineContext);
3304
+ const parentSequence = useContext18(SequenceContext);
3271
3305
  const actualFrom = parentSequence ? parentSequence.relativeFrom + parentSequence.cumulatedFrom : 0;
3272
- const { imperativePlaying } = useContext17(TimelineContext);
3306
+ const { imperativePlaying } = useContext18(TimelineContext);
3273
3307
  const startsAt = useMediaStartsAt();
3274
- const { registerSequence, unregisterSequence } = useContext17(SequenceManager);
3275
- const [initialVolume] = useState10(() => volume);
3308
+ const { registerSequence, unregisterSequence } = useContext18(SequenceManager);
3309
+ const [initialVolume] = useState11(() => volume);
3276
3310
  const logLevel = useLogLevel();
3277
3311
  const mountTime = useMountTime();
3278
3312
  const nonce = useNonce();
@@ -3295,6 +3329,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3295
3329
  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`);
3296
3330
  }
3297
3331
  }, [initialVolume, mediaType, src, volume]);
3332
+ const env = useRemotionEnvironment();
3298
3333
  useEffect8(() => {
3299
3334
  if (!mediaRef.current) {
3300
3335
  return;
@@ -3302,7 +3337,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3302
3337
  if (!src) {
3303
3338
  throw new Error("No src passed");
3304
3339
  }
3305
- if (!getRemotionEnvironment().isStudio && window.process?.env?.NODE_ENV !== "test") {
3340
+ if (!env.isStudio && window.process?.env?.NODE_ENV !== "test") {
3306
3341
  return;
3307
3342
  }
3308
3343
  if (!showInTimeline) {
@@ -3352,7 +3387,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
3352
3387
  stack,
3353
3388
  showInTimeline,
3354
3389
  premountDisplay,
3355
- postmountDisplay
3390
+ postmountDisplay,
3391
+ env.isStudio
3356
3392
  ]);
3357
3393
  useEffect8(() => {
3358
3394
  const tag = {
@@ -3370,7 +3406,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
3370
3406
  onAutoPlayError,
3371
3407
  logLevel,
3372
3408
  mountTime,
3373
- reason
3409
+ reason,
3410
+ isPlayer: env.isPlayer
3374
3411
  });
3375
3412
  }
3376
3413
  };
@@ -3388,14 +3425,15 @@ Check that all your Remotion packages are on the same version. If your dependenc
3388
3425
  isPremounting,
3389
3426
  isPostmounting,
3390
3427
  logLevel,
3391
- mountTime
3428
+ mountTime,
3429
+ env.isPlayer
3392
3430
  ]);
3393
3431
  }, useBufferManager = (logLevel, mountTime) => {
3394
- const [blocks, setBlocks] = useState11([]);
3395
- const [onBufferingCallbacks, setOnBufferingCallbacks] = useState11([]);
3396
- const [onResumeCallbacks, setOnResumeCallbacks] = useState11([]);
3432
+ const [blocks, setBlocks] = useState12([]);
3433
+ const [onBufferingCallbacks, setOnBufferingCallbacks] = useState12([]);
3434
+ const [onResumeCallbacks, setOnResumeCallbacks] = useState12([]);
3397
3435
  const buffering = useRef7(false);
3398
- const addBlock = useCallback7((block) => {
3436
+ const addBlock = useCallback8((block) => {
3399
3437
  setBlocks((b) => [...b, block]);
3400
3438
  return {
3401
3439
  unblock: () => {
@@ -3409,7 +3447,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3409
3447
  }
3410
3448
  };
3411
3449
  }, []);
3412
- const listenForBuffering = useCallback7((callback) => {
3450
+ const listenForBuffering = useCallback8((callback) => {
3413
3451
  setOnBufferingCallbacks((c) => [...c, callback]);
3414
3452
  return {
3415
3453
  remove: () => {
@@ -3417,7 +3455,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3417
3455
  }
3418
3456
  };
3419
3457
  }, []);
3420
- const listenForResume = useCallback7((callback) => {
3458
+ const listenForResume = useCallback8((callback) => {
3421
3459
  setOnResumeCallbacks((c) => [...c, callback]);
3422
3460
  return {
3423
3461
  remove: () => {
@@ -3453,14 +3491,14 @@ Check that all your Remotion packages are on the same version. If your dependenc
3453
3491
  return { addBlock, listenForBuffering, listenForResume, buffering };
3454
3492
  }, [addBlock, buffering, listenForBuffering, listenForResume]);
3455
3493
  }, BufferingContextReact, BufferingProvider = ({ children }) => {
3456
- const { logLevel, mountTime } = useContext18(LogLevelContext);
3494
+ const { logLevel, mountTime } = useContext19(LogLevelContext);
3457
3495
  const bufferManager = useBufferManager(logLevel ?? "info", mountTime);
3458
3496
  return /* @__PURE__ */ jsx16(BufferingContextReact.Provider, {
3459
3497
  value: bufferManager,
3460
3498
  children
3461
3499
  });
3462
3500
  }, useIsPlayerBuffering = (bufferManager) => {
3463
- const [isBuffering, setIsBuffering] = useState11(bufferManager.buffering.current);
3501
+ const [isBuffering, setIsBuffering] = useState12(bufferManager.buffering.current);
3464
3502
  useEffect9(() => {
3465
3503
  const onBuffer = () => {
3466
3504
  setIsBuffering(true);
@@ -3481,7 +3519,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3481
3519
  }, [bufferManager]);
3482
3520
  return isBuffering;
3483
3521
  }, useBufferState = () => {
3484
- const buffer = useContext19(BufferingContextReact);
3522
+ const buffer = useContext20(BufferingContextReact);
3485
3523
  const addBlock = buffer ? buffer.addBlock : null;
3486
3524
  return useMemo17(() => ({
3487
3525
  delayPlayback: () => {
@@ -3507,7 +3545,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3507
3545
  }) => {
3508
3546
  const bufferingRef = useRef8(false);
3509
3547
  const { delayPlayback } = useBufferState();
3510
- const bufferUntilFirstFrame = useCallback8((requestedTime) => {
3548
+ const bufferUntilFirstFrame = useCallback9((requestedTime) => {
3511
3549
  if (mediaType !== "video") {
3512
3550
  return;
3513
3551
  }
@@ -3585,7 +3623,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3585
3623
  };
3586
3624
  }, [bufferUntilFirstFrame]);
3587
3625
  }, useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
3588
- const lastUpdate = React15.useRef({
3626
+ const lastUpdate = React16.useRef({
3589
3627
  time: mediaRef.current?.currentTime ?? 0,
3590
3628
  lastUpdate: performance.now()
3591
3629
  });
@@ -3623,7 +3661,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3623
3661
  src
3624
3662
  }) => {
3625
3663
  const buffer = useBufferState();
3626
- const [isBuffering, setIsBuffering] = useState12(false);
3664
+ const [isBuffering, setIsBuffering] = useState13(false);
3627
3665
  useEffect10(() => {
3628
3666
  let cleanupFns = [];
3629
3667
  const { current } = element;
@@ -3872,11 +3910,11 @@ Check that all your Remotion packages are on the same version. If your dependenc
3872
3910
  isPostmounting,
3873
3911
  onAutoPlayError
3874
3912
  }) => {
3875
- const { playbackRate: globalPlaybackRate } = useContext20(TimelineContext);
3913
+ const { playbackRate: globalPlaybackRate } = useContext21(TimelineContext);
3876
3914
  const frame = useCurrentFrame();
3877
3915
  const absoluteFrame = useTimelinePosition();
3878
3916
  const [playing] = usePlayingState();
3879
- const buffering = useContext20(BufferingContextReact);
3917
+ const buffering = useContext21(BufferingContextReact);
3880
3918
  const { fps } = useVideoConfig();
3881
3919
  const mediaStartsAt = useMediaStartsAt();
3882
3920
  const lastSeekDueToShift = useRef10(null);
@@ -3887,7 +3925,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3887
3925
  throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
3888
3926
  }
3889
3927
  const isVariableFpsVideoMap = useRef10({});
3890
- const onVariableFpsVideoDetected = useCallback9(() => {
3928
+ const onVariableFpsVideoDetected = useCallback10(() => {
3891
3929
  if (!src) {
3892
3930
  return;
3893
3931
  }
@@ -3976,6 +4014,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3976
4014
  playing,
3977
4015
  isPostmounting
3978
4016
  ]);
4017
+ const env = useRemotionEnvironment();
3979
4018
  useLayoutEffect5(() => {
3980
4019
  const playbackRateToSet = Math.max(0, playbackRate);
3981
4020
  if (mediaRef.current && mediaRef.current.playbackRate !== playbackRateToSet) {
@@ -4019,7 +4058,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
4019
4058
  onAutoPlayError,
4020
4059
  logLevel,
4021
4060
  mountTime,
4022
- reason: "player is playing but media tag is paused, and just seeked"
4061
+ reason: "player is playing but media tag is paused, and just seeked",
4062
+ isPlayer: env.isPlayer
4023
4063
  });
4024
4064
  }
4025
4065
  }
@@ -4066,7 +4106,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
4066
4106
  onAutoPlayError,
4067
4107
  logLevel,
4068
4108
  mountTime,
4069
- reason: `player is playing and ${reason}`
4109
+ reason: `player is playing and ${reason}`,
4110
+ isPlayer: env.isPlayer
4070
4111
  });
4071
4112
  if (!isVariableFpsVideo && playbackRate > 0) {
4072
4113
  bufferUntilFirstFrame(shouldBeTime);
@@ -4093,22 +4134,23 @@ Check that all your Remotion packages are on the same version. If your dependenc
4093
4134
  isPostmounting,
4094
4135
  pauseWhenBuffering,
4095
4136
  mountTime,
4096
- mediaTagCurrentTime
4137
+ mediaTagCurrentTime,
4138
+ env.isPlayer
4097
4139
  ]);
4098
4140
  }, MediaVolumeContext, SetMediaVolumeContext, useMediaVolumeState = () => {
4099
- const { mediaVolume } = useContext21(MediaVolumeContext);
4100
- const { setMediaVolume } = useContext21(SetMediaVolumeContext);
4141
+ const { mediaVolume } = useContext22(MediaVolumeContext);
4142
+ const { setMediaVolume } = useContext22(SetMediaVolumeContext);
4101
4143
  return useMemo19(() => {
4102
4144
  return [mediaVolume, setMediaVolume];
4103
4145
  }, [mediaVolume, setMediaVolume]);
4104
4146
  }, useMediaMutedState = () => {
4105
- const { mediaMuted } = useContext21(MediaVolumeContext);
4106
- const { setMediaMuted } = useContext21(SetMediaVolumeContext);
4147
+ const { mediaMuted } = useContext22(MediaVolumeContext);
4148
+ const { setMediaMuted } = useContext22(SetMediaVolumeContext);
4107
4149
  return useMemo19(() => {
4108
4150
  return [mediaMuted, setMediaMuted];
4109
4151
  }, [mediaMuted, setMediaMuted]);
4110
4152
  }, AudioForDevelopmentForwardRefFunction = (props, ref) => {
4111
- const [initialShouldPreMountAudioElements] = useState13(props.shouldPreMountAudioTags);
4153
+ const [initialShouldPreMountAudioElements] = useState14(props.shouldPreMountAudioTags);
4112
4154
  if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
4113
4155
  throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
4114
4156
  }
@@ -4147,13 +4189,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
4147
4189
  const [mediaVolume] = useMediaVolumeState();
4148
4190
  const [mediaMuted] = useMediaMutedState();
4149
4191
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
4150
- const { hidden } = useContext22(SequenceVisibilityToggleContext);
4192
+ const { hidden } = useContext23(SequenceVisibilityToggleContext);
4151
4193
  if (!src) {
4152
4194
  throw new TypeError("No 'src' was passed to <Audio>.");
4153
4195
  }
4154
4196
  const preloadedSrc = usePreload(src);
4155
- const sequenceContext = useContext22(SequenceContext);
4156
- const [timelineId] = useState13(() => String(Math.random()));
4197
+ const sequenceContext = useContext23(SequenceContext);
4198
+ const [timelineId] = useState14(() => String(Math.random()));
4157
4199
  const isSequenceHidden = hidden[timelineId] ?? false;
4158
4200
  const userPreferredVolume = evaluateVolume({
4159
4201
  frame: volumePropFrame,
@@ -4190,7 +4232,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4190
4232
  props.muted,
4191
4233
  props.loop
4192
4234
  ]);
4193
- const context = useContext22(SharedAudioContext);
4235
+ const context = useContext23(SharedAudioContext);
4194
4236
  if (!context) {
4195
4237
  throw new Error("SharedAudioContext not found");
4196
4238
  }
@@ -4289,8 +4331,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
4289
4331
  const absoluteFrame = useTimelinePosition();
4290
4332
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
4291
4333
  const frame = useCurrentFrame();
4292
- const sequenceContext = useContext23(SequenceContext);
4293
- const { registerRenderAsset, unregisterRenderAsset } = useContext23(RenderAssetManager);
4334
+ const sequenceContext = useContext24(SequenceContext);
4335
+ const { registerRenderAsset, unregisterRenderAsset } = useContext24(RenderAssetManager);
4336
+ const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
4294
4337
  const id = useMemo21(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
4295
4338
  props.src,
4296
4339
  sequenceContext?.relativeFrom,
@@ -4356,7 +4399,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4356
4399
  if (!needsToRenderAudioTag) {
4357
4400
  return;
4358
4401
  }
4359
- const newHandle = delayRender("Loading <Audio> duration with src=" + src, {
4402
+ const newHandle = delayRender2("Loading <Audio> duration with src=" + src, {
4360
4403
  retries: delayRenderRetries ?? undefined,
4361
4404
  timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
4362
4405
  });
@@ -4365,24 +4408,26 @@ Check that all your Remotion packages are on the same version. If your dependenc
4365
4408
  if (current?.duration) {
4366
4409
  onDuration(current.src, current.duration);
4367
4410
  }
4368
- continueRender(newHandle);
4411
+ continueRender2(newHandle);
4369
4412
  };
4370
4413
  if (current?.duration) {
4371
4414
  onDuration(current.src, current.duration);
4372
- continueRender(newHandle);
4415
+ continueRender2(newHandle);
4373
4416
  } else {
4374
4417
  current?.addEventListener("loadedmetadata", didLoad, { once: true });
4375
4418
  }
4376
4419
  return () => {
4377
4420
  current?.removeEventListener("loadedmetadata", didLoad);
4378
- continueRender(newHandle);
4421
+ continueRender2(newHandle);
4379
4422
  };
4380
4423
  }, [
4381
4424
  src,
4382
4425
  onDuration,
4383
4426
  needsToRenderAudioTag,
4384
4427
  delayRenderRetries,
4385
- delayRenderTimeoutInMilliseconds
4428
+ delayRenderTimeoutInMilliseconds,
4429
+ continueRender2,
4430
+ delayRender2
4386
4431
  ]);
4387
4432
  if (!needsToRenderAudioTag) {
4388
4433
  return null;
@@ -4393,7 +4438,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4393
4438
  onError: onNativeError
4394
4439
  });
4395
4440
  }, AudioForRendering, AudioRefForwardingFunction = (props, ref) => {
4396
- const audioContext = useContext24(SharedAudioContext);
4441
+ const audioContext = useContext25(SharedAudioContext);
4397
4442
  const {
4398
4443
  startFrom,
4399
4444
  endAt,
@@ -4408,13 +4453,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
4408
4453
  } = props;
4409
4454
  const { loop, ...propsOtherThanLoop } = props;
4410
4455
  const { fps } = useVideoConfig();
4411
- const environment = getRemotionEnvironment();
4412
- const { durations, setDurations } = useContext24(DurationsContext);
4456
+ const environment = useRemotionEnvironment();
4457
+ const { durations, setDurations } = useContext25(DurationsContext);
4413
4458
  if (typeof props.src !== "string") {
4414
4459
  throw new TypeError(`The \`<Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
4415
4460
  }
4416
4461
  const preloadedSrc = usePreload(props.src);
4417
- const onError = useCallback10((e) => {
4462
+ const onError = useCallback11((e) => {
4418
4463
  console.log(e.currentTarget.error);
4419
4464
  const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
4420
4465
  if (loop) {
@@ -4428,7 +4473,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4428
4473
  console.warn(errMessage);
4429
4474
  }
4430
4475
  }, [loop, onRemotionError, preloadedSrc]);
4431
- const onDuration = useCallback10((src, durationInSeconds) => {
4476
+ const onDuration = useCallback11((src, durationInSeconds) => {
4432
4477
  setDurations({ type: "got-duration", durationInSeconds, src });
4433
4478
  }, [setDurations]);
4434
4479
  const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
@@ -4580,13 +4625,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
4580
4625
  if (typeof compProps.component === "undefined") {
4581
4626
  throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
4582
4627
  }
4583
- return React19.lazy(() => Promise.resolve({ default: compProps.component }));
4628
+ return React20.lazy(() => Promise.resolve({ default: compProps.component }));
4584
4629
  }
4585
4630
  if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
4586
4631
  if (typeof compProps.lazyComponent === "undefined") {
4587
4632
  throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
4588
4633
  }
4589
- return React19.lazy(compProps.lazyComponent);
4634
+ return React20.lazy(compProps.lazyComponent);
4590
4635
  }
4591
4636
  throw new Error("You must pass either 'component' or 'lazyComponent'");
4592
4637
  }, [compProps.component, compProps.lazyComponent]);
@@ -4606,10 +4651,11 @@ Check that all your Remotion packages are on the same version. If your dependenc
4606
4651
  throw new Error(`"${name}" must be an object, an array was passed ${compositionId ? `for composition "${compositionId}"` : ""}`);
4607
4652
  }
4608
4653
  }, Fallback = () => {
4654
+ const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
4609
4655
  useEffect16(() => {
4610
- const fallback = delayRender("Waiting for Root component to unsuspend");
4611
- return () => continueRender(fallback);
4612
- }, []);
4656
+ const fallback = delayRender2("Waiting for Root component to unsuspend");
4657
+ return () => continueRender2(fallback);
4658
+ }, [continueRender2, delayRender2]);
4613
4659
  return null;
4614
4660
  }, InnerComposition = ({
4615
4661
  width,
@@ -4621,7 +4667,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4621
4667
  schema,
4622
4668
  ...compProps
4623
4669
  }) => {
4624
- const compManager = useContext26(CompositionSetters);
4670
+ const compManager = useContext27(CompositionSetters);
4625
4671
  const { registerComposition, unregisterComposition } = compManager;
4626
4672
  const video = useVideo();
4627
4673
  const lazy = useLazyComponent({
@@ -4631,15 +4677,15 @@ Check that all your Remotion packages are on the same version. If your dependenc
4631
4677
  });
4632
4678
  const nonce = useNonce();
4633
4679
  const isPlayer = useIsPlayer();
4634
- const environment = getRemotionEnvironment();
4635
- const canUseComposition = useContext26(CanUseRemotionHooks);
4680
+ const environment = useRemotionEnvironment();
4681
+ const canUseComposition = useContext27(CanUseRemotionHooks);
4636
4682
  if (canUseComposition) {
4637
4683
  if (isPlayer) {
4638
4684
  throw new Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.");
4639
4685
  }
4640
4686
  throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
4641
4687
  }
4642
- const { folderName, parentName } = useContext26(FolderContext);
4688
+ const { folderName, parentName } = useContext27(FolderContext);
4643
4689
  useEffect16(() => {
4644
4690
  if (!id) {
4645
4691
  throw new Error("No id for composition passed.");
@@ -4717,7 +4763,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4717
4763
  }
4718
4764
  return null;
4719
4765
  }, Composition = (props2) => {
4720
- const { onlyRenderComposition } = useContext26(CompositionSetters);
4766
+ const { onlyRenderComposition } = useContext27(CompositionSetters);
4721
4767
  if (onlyRenderComposition && onlyRenderComposition !== props2.id) {
4722
4768
  return null;
4723
4769
  }
@@ -4731,22 +4777,23 @@ Check that all your Remotion packages are on the same version. If your dependenc
4731
4777
  delayRenderTimeoutInMilliseconds,
4732
4778
  ...props2
4733
4779
  }, ref) => {
4734
- const [handle] = useState14(() => delayRender(`Loading <IFrame> with source ${props2.src}`, {
4780
+ const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
4781
+ const [handle] = useState15(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
4735
4782
  retries: delayRenderRetries ?? undefined,
4736
4783
  timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
4737
4784
  }));
4738
- const didLoad = useCallback11((e) => {
4739
- continueRender(handle);
4785
+ const didLoad = useCallback12((e) => {
4786
+ continueRender2(handle);
4740
4787
  onLoad?.(e);
4741
- }, [handle, onLoad]);
4742
- const didGetError = useCallback11((e) => {
4743
- continueRender(handle);
4788
+ }, [handle, onLoad, continueRender2]);
4789
+ const didGetError = useCallback12((e) => {
4790
+ continueRender2(handle);
4744
4791
  if (onError) {
4745
4792
  onError(e);
4746
4793
  } else {
4747
4794
  console.error("Error loading iframe:", e, "Handle the event using the onError() prop to make this message disappear.");
4748
4795
  }
4749
- }, [handle, onError]);
4796
+ }, [handle, onError, continueRender2]);
4750
4797
  return /* @__PURE__ */ jsx23("iframe", {
4751
4798
  ...props2,
4752
4799
  ref,
@@ -4767,7 +4814,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4767
4814
  const imageRef = useRef13(null);
4768
4815
  const errors = useRef13({});
4769
4816
  const { delayPlayback } = useBufferState();
4770
- const sequenceContext = useContext27(SequenceContext);
4817
+ const sequenceContext = useContext28(SequenceContext);
4771
4818
  if (!src) {
4772
4819
  throw new Error('No "src" prop was passed to <Img>.');
4773
4820
  }
@@ -4779,7 +4826,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4779
4826
  return imageRef.current;
4780
4827
  }, []);
4781
4828
  const actualSrc = usePreload(src);
4782
- const retryIn = useCallback12((timeout) => {
4829
+ const retryIn = useCallback13((timeout) => {
4783
4830
  if (!imageRef.current) {
4784
4831
  return;
4785
4832
  }
@@ -4796,7 +4843,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4796
4843
  imageRef.current.setAttribute("src", newSrc);
4797
4844
  }, timeout);
4798
4845
  }, []);
4799
- const didGetError = useCallback12((e) => {
4846
+ const didGetError = useCallback13((e) => {
4800
4847
  if (!errors.current) {
4801
4848
  return;
4802
4849
  }
@@ -4813,6 +4860,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4813
4860
  }
4814
4861
  cancelRender("Error loading image with src: " + imageRef.current?.src);
4815
4862
  }, [maxRetries, onError, retryIn]);
4863
+ const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
4816
4864
  if (typeof window !== "undefined") {
4817
4865
  const isPremounting = Boolean(sequenceContext?.premounting);
4818
4866
  const isPostmounting = Boolean(sequenceContext?.postmounting);
@@ -4827,7 +4875,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4827
4875
  if (!current) {
4828
4876
  return;
4829
4877
  }
4830
- const newHandle = delayRender("Loading <Img> with src=" + actualSrc, {
4878
+ const newHandle = delayRender2("Loading <Img> with src=" + actualSrc, {
4831
4879
  retries: delayRenderRetries ?? undefined,
4832
4880
  timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
4833
4881
  });
@@ -4837,7 +4885,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4837
4885
  let unmounted = false;
4838
4886
  const onComplete = () => {
4839
4887
  if (unmounted) {
4840
- continueRender(newHandle);
4888
+ continueRender2(newHandle);
4841
4889
  return;
4842
4890
  }
4843
4891
  if ((errors.current[imageRef.current?.src] ?? 0) > 0) {
@@ -4848,7 +4896,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4848
4896
  onImageFrame?.(current);
4849
4897
  }
4850
4898
  unblock();
4851
- continueRender(newHandle);
4899
+ continueRender2(newHandle);
4852
4900
  };
4853
4901
  if (!imageRef.current) {
4854
4902
  onComplete();
@@ -4871,7 +4919,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4871
4919
  unmounted = true;
4872
4920
  current.removeEventListener("load", onComplete);
4873
4921
  unblock();
4874
- continueRender(newHandle);
4922
+ continueRender2(newHandle);
4875
4923
  };
4876
4924
  }, [
4877
4925
  actualSrc,
@@ -4881,7 +4929,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
4881
4929
  pauseWhenLoading,
4882
4930
  isPremounting,
4883
4931
  isPostmounting,
4884
- onImageFrame
4932
+ onImageFrame,
4933
+ continueRender2,
4934
+ delayRender2
4885
4935
  ]);
4886
4936
  }
4887
4937
  const crossOriginValue = getCrossOriginValue({
@@ -4901,18 +4951,18 @@ Check that all your Remotion packages are on the same version. If your dependenc
4901
4951
  currentCompositionMetadata,
4902
4952
  audioLatencyHint
4903
4953
  }) => {
4904
- const [compositions, setCompositions] = useState15([]);
4954
+ const [compositions, setCompositions] = useState16([]);
4905
4955
  const currentcompositionsRef = useRef14(compositions);
4906
- const [folders, setFolders] = useState15([]);
4907
- const [canvasContent, setCanvasContent] = useState15(null);
4908
- const updateCompositions = useCallback13((updateComps) => {
4956
+ const [folders, setFolders] = useState16([]);
4957
+ const [canvasContent, setCanvasContent] = useState16(null);
4958
+ const updateCompositions = useCallback14((updateComps) => {
4909
4959
  setCompositions((comps) => {
4910
4960
  const updated = updateComps(comps);
4911
4961
  currentcompositionsRef.current = updated;
4912
4962
  return updated;
4913
4963
  });
4914
4964
  }, []);
4915
- const registerComposition = useCallback13((comp) => {
4965
+ const registerComposition = useCallback14((comp) => {
4916
4966
  updateCompositions((comps) => {
4917
4967
  if (comps.find((c2) => c2.id === comp.id)) {
4918
4968
  throw new Error(`Multiple composition with id ${comp.id} are registered.`);
@@ -4921,12 +4971,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
4921
4971
  return value;
4922
4972
  });
4923
4973
  }, [updateCompositions]);
4924
- const unregisterComposition = useCallback13((id) => {
4974
+ const unregisterComposition = useCallback14((id) => {
4925
4975
  setCompositions((comps) => {
4926
4976
  return comps.filter((c2) => c2.id !== id);
4927
4977
  });
4928
4978
  }, []);
4929
- const registerFolder = useCallback13((name, parent) => {
4979
+ const registerFolder = useCallback14((name, parent) => {
4930
4980
  setFolders((prevFolders) => {
4931
4981
  return [
4932
4982
  ...prevFolders,
@@ -4937,7 +4987,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4937
4987
  ];
4938
4988
  });
4939
4989
  }, []);
4940
- const unregisterFolder = useCallback13((name, parent) => {
4990
+ const unregisterFolder = useCallback14((name, parent) => {
4941
4991
  setFolders((prevFolders) => {
4942
4992
  return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
4943
4993
  });
@@ -4948,7 +4998,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4948
4998
  };
4949
4999
  }, []);
4950
5000
  const composition = compositions.find((c2) => canvasContent?.type === "composition" ? c2.id === canvasContent.compositionId : null);
4951
- const updateCompositionDefaultProps = useCallback13((id, newDefaultProps) => {
5001
+ const updateCompositionDefaultProps = useCallback14((id, newDefaultProps) => {
4952
5002
  setCompositions((comps) => {
4953
5003
  const updated = comps.map((c2) => {
4954
5004
  if (c2.id === id) {
@@ -5068,19 +5118,20 @@ Check that all your Remotion packages are on the same version. If your dependenc
5068
5118
  currentCompositionMetadata,
5069
5119
  audioLatencyHint
5070
5120
  }) => {
5071
- const [remotionRootId] = useState16(() => String(random(null)));
5072
- const [frame, setFrame] = useState16(() => getInitialFrameState());
5073
- const [playing, setPlaying] = useState16(false);
5121
+ const [remotionRootId] = useState17(() => String(random(null)));
5122
+ const [frame, setFrame] = useState17(() => getInitialFrameState());
5123
+ const [playing, setPlaying] = useState17(false);
5074
5124
  const imperativePlaying = useRef15(false);
5075
- const [fastRefreshes, setFastRefreshes] = useState16(0);
5076
- const [manualRefreshes, setManualRefreshes] = useState16(0);
5077
- const [playbackRate, setPlaybackRate] = useState16(1);
5125
+ const [fastRefreshes, setFastRefreshes] = useState17(0);
5126
+ const [manualRefreshes, setManualRefreshes] = useState17(0);
5127
+ const [playbackRate, setPlaybackRate] = useState17(1);
5078
5128
  const audioAndVideoTags = useRef15([]);
5129
+ const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
5079
5130
  if (typeof window !== "undefined") {
5080
5131
  useLayoutEffect8(() => {
5081
5132
  window.remotion_setFrame = (f, composition, attempt) => {
5082
5133
  window.remotion_attempt = attempt;
5083
- const id = delayRender(`Setting the current frame to ${f}`);
5134
+ const id = delayRender2(`Setting the current frame to ${f}`);
5084
5135
  let asyncUpdate = true;
5085
5136
  setFrame((s) => {
5086
5137
  const currentFrame = s[composition] ?? window.remotion_initialFrame;
@@ -5094,13 +5145,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
5094
5145
  };
5095
5146
  });
5096
5147
  if (asyncUpdate) {
5097
- requestAnimationFrame(() => continueRender(id));
5148
+ requestAnimationFrame(() => continueRender2(id));
5098
5149
  } else {
5099
- continueRender(id);
5150
+ continueRender2(id);
5100
5151
  }
5101
5152
  };
5102
5153
  window.remotion_isPlayer = false;
5103
- }, []);
5154
+ }, [continueRender2, delayRender2]);
5104
5155
  }
5105
5156
  const timelineContextValue = useMemo25(() => {
5106
5157
  return {
@@ -5243,7 +5294,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5243
5294
  };
5244
5295
  }, [onVideoFrame, ref]);
5245
5296
  }, VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
5246
- const context = useContext28(SharedAudioContext);
5297
+ const context = useContext29(SharedAudioContext);
5247
5298
  if (!context) {
5248
5299
  throw new Error("SharedAudioContext not found");
5249
5300
  }
@@ -5291,11 +5342,11 @@ Check that all your Remotion packages are on the same version. If your dependenc
5291
5342
  }
5292
5343
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
5293
5344
  const { fps, durationInFrames } = useVideoConfig();
5294
- const parentSequence = useContext28(SequenceContext);
5295
- const { hidden } = useContext28(SequenceVisibilityToggleContext);
5345
+ const parentSequence = useContext29(SequenceContext);
5346
+ const { hidden } = useContext29(SequenceVisibilityToggleContext);
5296
5347
  const logLevel = useLogLevel();
5297
5348
  const mountTime = useMountTime();
5298
- const [timelineId] = useState17(() => String(Math.random()));
5349
+ const [timelineId] = useState18(() => String(Math.random()));
5299
5350
  const isSequenceHidden = hidden[timelineId] ?? false;
5300
5351
  if (typeof acceptableTimeShift !== "undefined") {
5301
5352
  throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
@@ -5355,7 +5406,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5355
5406
  useImperativeHandle9(ref, () => {
5356
5407
  return videoRef.current;
5357
5408
  }, []);
5358
- useState17(() => playbackLogging({
5409
+ useState18(() => playbackLogging({
5359
5410
  logLevel,
5360
5411
  message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
5361
5412
  tag: "video",
@@ -5504,9 +5555,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
5504
5555
  throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
5505
5556
  }
5506
5557
  }, flattenChildren = (children) => {
5507
- const childrenArray = React28.Children.toArray(children);
5558
+ const childrenArray = React29.Children.toArray(children);
5508
5559
  return childrenArray.reduce((flatChildren, child) => {
5509
- if (child.type === React28.Fragment) {
5560
+ if (child.type === React29.Fragment) {
5510
5561
  return flatChildren.concat(flattenChildren(child.props.children));
5511
5562
  }
5512
5563
  flatChildren.push(child);
@@ -5523,7 +5574,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5523
5574
  children
5524
5575
  });
5525
5576
  }, useRequireToBeInsideSeries = () => {
5526
- const isInsideSeries = React29.useContext(IsInsideSeriesContext);
5577
+ const isInsideSeries = React30.useContext(IsInsideSeriesContext);
5527
5578
  if (!isInsideSeries) {
5528
5579
  throw new Error("This component must be inside a <Series /> component.");
5529
5580
  }
@@ -5815,12 +5866,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
5815
5866
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
5816
5867
  const videoConfig = useUnsafeVideoConfig();
5817
5868
  const videoRef = useRef17(null);
5818
- const sequenceContext = useContext30(SequenceContext);
5869
+ const sequenceContext = useContext31(SequenceContext);
5819
5870
  const mediaStartsAt = useMediaStartsAt();
5820
- const environment = getRemotionEnvironment();
5871
+ const environment = useRemotionEnvironment();
5821
5872
  const logLevel = useLogLevel();
5822
5873
  const mountTime = useMountTime();
5823
- const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
5874
+ const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
5875
+ const { registerRenderAsset, unregisterRenderAsset } = useContext31(RenderAssetManager);
5824
5876
  const id = useMemo30(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
5825
5877
  props2.src,
5826
5878
  sequenceContext?.cumulatedFrom,
@@ -5892,21 +5944,21 @@ Check that all your Remotion packages are on the same version. If your dependenc
5892
5944
  startFrom: -mediaStartsAt,
5893
5945
  fps: videoConfig.fps
5894
5946
  });
5895
- const handle = delayRender(`Rendering <Video /> with src="${props2.src}" at time ${currentTime}`, {
5947
+ const handle = delayRender2(`Rendering <Video /> with src="${props2.src}" at time ${currentTime}`, {
5896
5948
  retries: delayRenderRetries ?? undefined,
5897
5949
  timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
5898
5950
  });
5899
5951
  if (window.process?.env?.NODE_ENV === "test") {
5900
- continueRender(handle);
5952
+ continueRender2(handle);
5901
5953
  return;
5902
5954
  }
5903
5955
  if (isApproximatelyTheSame(current.currentTime, currentTime)) {
5904
5956
  if (current.readyState >= 2) {
5905
- continueRender(handle);
5957
+ continueRender2(handle);
5906
5958
  return;
5907
5959
  }
5908
5960
  const loadedDataHandler = () => {
5909
- continueRender(handle);
5961
+ continueRender2(handle);
5910
5962
  };
5911
5963
  current.addEventListener("loadeddata", loadedDataHandler, { once: true });
5912
5964
  return () => {
@@ -5914,7 +5966,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5914
5966
  };
5915
5967
  }
5916
5968
  const endedHandler = () => {
5917
- continueRender(handle);
5969
+ continueRender2(handle);
5918
5970
  };
5919
5971
  const seek2 = seekToTimeMultipleUntilRight({
5920
5972
  element: current,
@@ -5924,7 +5976,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5924
5976
  mountTime
5925
5977
  });
5926
5978
  seek2.prom.then(() => {
5927
- continueRender(handle);
5979
+ continueRender2(handle);
5928
5980
  });
5929
5981
  current.addEventListener("ended", endedHandler, { once: true });
5930
5982
  const errorHandler = () => {
@@ -5943,7 +5995,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5943
5995
  seek2.cancel();
5944
5996
  current.removeEventListener("ended", endedHandler);
5945
5997
  current.removeEventListener("error", errorHandler);
5946
- continueRender(handle);
5998
+ continueRender2(handle);
5947
5999
  };
5948
6000
  }, [
5949
6001
  volumePropsFrame,
@@ -5956,7 +6008,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
5956
6008
  delayRenderRetries,
5957
6009
  delayRenderTimeoutInMilliseconds,
5958
6010
  logLevel,
5959
- mountTime
6011
+ mountTime,
6012
+ continueRender2,
6013
+ delayRender2
5960
6014
  ]);
5961
6015
  const { src } = props2;
5962
6016
  if (environment.isRendering) {
@@ -5964,7 +6018,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5964
6018
  if (window.process?.env?.NODE_ENV === "test") {
5965
6019
  return;
5966
6020
  }
5967
- const newHandle = delayRender("Loading <Video> duration with src=" + src, {
6021
+ const newHandle = delayRender2("Loading <Video> duration with src=" + src, {
5968
6022
  retries: delayRenderRetries ?? undefined,
5969
6023
  timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
5970
6024
  });
@@ -5973,19 +6027,26 @@ Check that all your Remotion packages are on the same version. If your dependenc
5973
6027
  if (current?.duration) {
5974
6028
  onDuration(src, current.duration);
5975
6029
  }
5976
- continueRender(newHandle);
6030
+ continueRender2(newHandle);
5977
6031
  };
5978
6032
  if (current?.duration) {
5979
6033
  onDuration(src, current.duration);
5980
- continueRender(newHandle);
6034
+ continueRender2(newHandle);
5981
6035
  } else {
5982
6036
  current?.addEventListener("loadedmetadata", didLoad, { once: true });
5983
6037
  }
5984
6038
  return () => {
5985
6039
  current?.removeEventListener("loadedmetadata", didLoad);
5986
- continueRender(newHandle);
6040
+ continueRender2(newHandle);
5987
6041
  };
5988
- }, [src, onDuration, delayRenderRetries, delayRenderTimeoutInMilliseconds]);
6042
+ }, [
6043
+ src,
6044
+ onDuration,
6045
+ delayRenderRetries,
6046
+ delayRenderTimeoutInMilliseconds,
6047
+ continueRender2,
6048
+ delayRender2
6049
+ ]);
5989
6050
  }
5990
6051
  return /* @__PURE__ */ jsx33("video", {
5991
6052
  ref: videoRef,
@@ -6008,8 +6069,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
6008
6069
  } = props2;
6009
6070
  const { loop, ...propsOtherThanLoop } = props2;
6010
6071
  const { fps } = useVideoConfig();
6011
- const environment = getRemotionEnvironment();
6012
- const { durations, setDurations } = useContext31(DurationsContext);
6072
+ const environment = useRemotionEnvironment();
6073
+ const { durations, setDurations } = useContext32(DurationsContext);
6013
6074
  if (typeof ref === "string") {
6014
6075
  throw new Error("string refs are not supported");
6015
6076
  }
@@ -6017,10 +6078,10 @@ Check that all your Remotion packages are on the same version. If your dependenc
6017
6078
  throw new TypeError(`The \`<Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
6018
6079
  }
6019
6080
  const preloadedSrc = usePreload(props2.src);
6020
- const onDuration = useCallback16((src, durationInSeconds) => {
6081
+ const onDuration = useCallback17((src, durationInSeconds) => {
6021
6082
  setDurations({ type: "got-duration", durationInSeconds, src });
6022
6083
  }, [setDurations]);
6023
- const onVideoFrame = useCallback16(() => {}, []);
6084
+ const onVideoFrame = useCallback17(() => {}, []);
6024
6085
  const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
6025
6086
  validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
6026
6087
  const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
@@ -6107,12 +6168,13 @@ var init_esm = __esm(() => {
6107
6168
  throw new Error(err.join(`
6108
6169
  `));
6109
6170
  }
6110
- originalCreateElement = React4.createElement;
6171
+ RemotionEnvironmentContext = React4.createContext(null);
6172
+ originalCreateElement = React22.createElement;
6111
6173
  componentsToAddStacksTo = [];
6112
6174
  IsPlayerContext = createContext2(false);
6113
6175
  AbsoluteFill = forwardRef(AbsoluteFillRefForwarding);
6114
6176
  SequenceContext = createContext3(null);
6115
- SequenceManager = React32.createContext({
6177
+ SequenceManager = React42.createContext({
6116
6178
  registerSequence: () => {
6117
6179
  throw new Error("SequenceManagerContext not initialized");
6118
6180
  },
@@ -6121,7 +6183,7 @@ var init_esm = __esm(() => {
6121
6183
  },
6122
6184
  sequences: []
6123
6185
  });
6124
- SequenceVisibilityToggleContext = React32.createContext({
6186
+ SequenceVisibilityToggleContext = React42.createContext({
6125
6187
  hidden: {},
6126
6188
  setHidden: () => {
6127
6189
  throw new Error("SequenceVisibilityToggle not initialized");
@@ -6182,8 +6244,8 @@ var init_esm = __esm(() => {
6182
6244
  throw new Error("Not implemented");
6183
6245
  }
6184
6246
  });
6185
- editorPropsProviderRef = React42.createRef();
6186
- timeValueRef = React42.createRef();
6247
+ editorPropsProviderRef = React5.createRef();
6248
+ timeValueRef = React5.createRef();
6187
6249
  validCodecs = [
6188
6250
  "h264",
6189
6251
  "h265",
@@ -6257,7 +6319,7 @@ var init_esm = __esm(() => {
6257
6319
  if (typeof window !== "undefined") {
6258
6320
  window.remotion_delayRenderTimeouts = {};
6259
6321
  }
6260
- Canvas = React8.forwardRef(CanvasRefForwardingFunction);
6322
+ Canvas = React9.forwardRef(CanvasRefForwardingFunction);
6261
6323
  AnimatedImage = forwardRef3(({
6262
6324
  src,
6263
6325
  width,
@@ -6277,8 +6339,9 @@ var init_esm = __esm(() => {
6277
6339
  };
6278
6340
  }, []);
6279
6341
  const resolvedSrc = resolveAnimatedImageSource(src);
6280
- const [imageDecoder, setImageDecoder] = useState5(null);
6281
- const [decodeHandle] = useState5(() => delayRender(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
6342
+ const [imageDecoder, setImageDecoder] = useState6(null);
6343
+ const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
6344
+ const [decodeHandle] = useState6(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
6282
6345
  const frame = useCurrentFrame();
6283
6346
  const { fps } = useVideoConfig();
6284
6347
  const currentTime = frame / playbackRate / fps;
@@ -6292,7 +6355,7 @@ var init_esm = __esm(() => {
6292
6355
  }
6293
6356
  return c;
6294
6357
  }, []);
6295
- const [initialLoopBehavior] = useState5(() => loopBehavior);
6358
+ const [initialLoopBehavior] = useState6(() => loopBehavior);
6296
6359
  useEffect4(() => {
6297
6360
  const controller = new AbortController;
6298
6361
  decodeImage({
@@ -6302,15 +6365,15 @@ var init_esm = __esm(() => {
6302
6365
  initialLoopBehavior
6303
6366
  }).then((d) => {
6304
6367
  setImageDecoder(d);
6305
- continueRender(decodeHandle);
6368
+ continueRender2(decodeHandle);
6306
6369
  }).catch((err) => {
6307
6370
  if (err.name === "AbortError") {
6308
- continueRender(decodeHandle);
6371
+ continueRender2(decodeHandle);
6309
6372
  return;
6310
6373
  }
6311
6374
  if (onError) {
6312
6375
  onError?.(err);
6313
- continueRender(decodeHandle);
6376
+ continueRender2(decodeHandle);
6314
6377
  } else {
6315
6378
  cancelRender(err);
6316
6379
  }
@@ -6318,12 +6381,18 @@ var init_esm = __esm(() => {
6318
6381
  return () => {
6319
6382
  controller.abort();
6320
6383
  };
6321
- }, [resolvedSrc, decodeHandle, onError, initialLoopBehavior]);
6384
+ }, [
6385
+ resolvedSrc,
6386
+ decodeHandle,
6387
+ onError,
6388
+ initialLoopBehavior,
6389
+ continueRender2
6390
+ ]);
6322
6391
  useLayoutEffect(() => {
6323
6392
  if (!imageDecoder) {
6324
6393
  return;
6325
6394
  }
6326
- const delay = delayRender(`Rendering frame at ${currentTime} of <AnimatedImage src="${src}"/>`);
6395
+ const delay = delayRender2(`Rendering frame at ${currentTime} of <AnimatedImage src="${src}"/>`);
6327
6396
  imageDecoder.getFrame(currentTime, loopBehavior).then((videoFrame) => {
6328
6397
  if (mountState.current.isMounted) {
6329
6398
  if (videoFrame === null) {
@@ -6332,16 +6401,24 @@ var init_esm = __esm(() => {
6332
6401
  ref.current?.draw(videoFrame.frame);
6333
6402
  }
6334
6403
  }
6335
- continueRender(delay);
6404
+ continueRender2(delay);
6336
6405
  }).catch((err) => {
6337
6406
  if (onError) {
6338
6407
  onError(err);
6339
- continueRender(delay);
6408
+ continueRender2(delay);
6340
6409
  } else {
6341
6410
  cancelRender(err);
6342
6411
  }
6343
6412
  });
6344
- }, [currentTime, imageDecoder, loopBehavior, onError, src]);
6413
+ }, [
6414
+ currentTime,
6415
+ imageDecoder,
6416
+ loopBehavior,
6417
+ onError,
6418
+ src,
6419
+ continueRender2,
6420
+ delayRender2
6421
+ ]);
6345
6422
  return /* @__PURE__ */ jsx102(Canvas, {
6346
6423
  ref,
6347
6424
  width,
@@ -6378,7 +6455,7 @@ var init_esm = __esm(() => {
6378
6455
  });
6379
6456
  SharedAudioContext = createContext15(null);
6380
6457
  didWarn = {};
6381
- BufferingContextReact = React14.createContext(null);
6458
+ BufferingContextReact = React15.createContext(null);
6382
6459
  alreadyWarned = {};
6383
6460
  MediaVolumeContext = createContext16({
6384
6461
  mediaMuted: false,
@@ -6417,7 +6494,7 @@ var init_esm = __esm(() => {
6417
6494
  kSampleStepSize = 1 / (kSplineTableSize - 1);
6418
6495
  IFrame = forwardRef7(IFrameRefForwarding);
6419
6496
  Img = forwardRef8(ImgRefForwarding);
6420
- compositionsRef = React23.createRef();
6497
+ compositionsRef = React24.createRef();
6421
6498
  exports_default_css = {};
6422
6499
  __export2(exports_default_css, {
6423
6500
  makeDefaultPreviewCSS: () => makeDefaultPreviewCSS,
@@ -6426,7 +6503,7 @@ var init_esm = __esm(() => {
6426
6503
  });
6427
6504
  injected = {};
6428
6505
  listeners = [];
6429
- CurrentScaleContext = React25.createContext(null);
6506
+ CurrentScaleContext = React26.createContext(null);
6430
6507
  PreviewSizeContext = createContext18({
6431
6508
  setSize: () => {
6432
6509
  return;
@@ -6510,7 +6587,8 @@ var init_esm = __esm(() => {
6510
6587
  useLogLevel,
6511
6588
  playbackLogging,
6512
6589
  timeValueRef,
6513
- compositionSelectorRef
6590
+ compositionSelectorRef,
6591
+ RemotionEnvironmentContext
6514
6592
  };
6515
6593
  PERCENTAGE = NUMBER + "%";
6516
6594
  IsInsideSeriesContext = createContext19(false);
@@ -6580,7 +6658,7 @@ __export(exports_esm, {
6580
6658
  Lottie: () => Lottie
6581
6659
  });
6582
6660
  import lottie from "lottie-web";
6583
- import { useEffect as useEffect26, useRef as useRef21, useState as useState21 } from "react";
6661
+ import { useEffect as useEffect26, useRef as useRef21, useState as useState24 } from "react";
6584
6662
  import { jsx as jsx41 } from "react/jsx-runtime";
6585
6663
  var getLottieMetadata = (animationData) => {
6586
6664
  const width2 = animationData.w;
@@ -6650,12 +6728,13 @@ var getLottieMetadata = (animationData) => {
6650
6728
  const containerRef = useRef21(null);
6651
6729
  const onAnimationLoadedRef = useRef21(onAnimationLoaded);
6652
6730
  onAnimationLoadedRef.current = onAnimationLoaded;
6653
- const [handle] = useState21(() => delayRender("Waiting for Lottie animation to load"));
6731
+ const { delayRender, continueRender } = useDelayRender();
6732
+ const [handle] = useState24(() => delayRender("Waiting for Lottie animation to load"));
6654
6733
  useEffect26(() => {
6655
6734
  return () => {
6656
6735
  continueRender(handle);
6657
6736
  };
6658
- }, [handle]);
6737
+ }, [handle, continueRender]);
6659
6738
  const frame = useCurrentFrame();
6660
6739
  currentFrameRef.current = frame;
6661
6740
  useEffect26(() => {
@@ -6700,7 +6779,8 @@ var getLottieMetadata = (animationData) => {
6700
6779
  loop,
6701
6780
  playbackRate,
6702
6781
  preserveAspectRatio,
6703
- renderer
6782
+ renderer,
6783
+ continueRender
6704
6784
  ]);
6705
6785
  useEffect26(() => {
6706
6786
  if (animationRef.current && direction) {
@@ -6736,7 +6816,7 @@ var getLottieMetadata = (animationData) => {
6736
6816
  }, { once: true });
6737
6817
  img.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", img.href.baseVal);
6738
6818
  });
6739
- }, [direction, frame, loop, playbackRate]);
6819
+ }, [direction, frame, loop, playbackRate, delayRender, continueRender]);
6740
6820
  return /* @__PURE__ */ jsx41("div", {
6741
6821
  ref: containerRef,
6742
6822
  className: className2,
@@ -11704,15 +11784,15 @@ init_esm();
11704
11784
  init_esm();
11705
11785
  import { jsx as jsx35, jsxs as jsxs10 } from "react/jsx-runtime";
11706
11786
  import { jsx as jsx210, jsxs as jsxs23, Fragment } from "react/jsx-runtime";
11707
- import React5 from "react";
11708
- import { useContext as useContext210, useEffect as useEffect23, useState as useState19 } from "react";
11709
- import { useContext as useContext32, useEffect as useEffect24 } from "react";
11787
+ import React8 from "react";
11788
+ import { useContext as useContext210, useEffect as useEffect23, useState as useState20 } from "react";
11789
+ import { useContext as useContext33, useEffect as useEffect24 } from "react";
11710
11790
  import { jsx as jsx36 } from "react/jsx-runtime";
11711
- import { useCallback as useCallback17, useRef as useRef18 } from "react";
11791
+ import { useCallback as useCallback18, useRef as useRef18 } from "react";
11712
11792
  import { useEffect as useEffect32, useState as useState23 } from "react";
11713
11793
  import { useContext as useContext42, useEffect as useEffect62, useRef as useRef42 } from "react";
11714
11794
  import { useEffect as useEffect42 } from "react";
11715
- import { useCallback as useCallback23, useContext as useContext33, useMemo as useMemo31, useRef as useRef22, useState as useState32 } from "react";
11795
+ import { useCallback as useCallback23, useContext as useContext34, useMemo as useMemo31, useRef as useRef22, useState as useState32 } from "react";
11716
11796
  import { useEffect as useEffect52, useRef as useRef32 } from "react";
11717
11797
  import { useCallback as useCallback32, useEffect as useEffect72, useMemo as useMemo210, useState as useState42 } from "react";
11718
11798
  import {
@@ -11724,7 +11804,7 @@ import {
11724
11804
  useRef as useRef112,
11725
11805
  useState as useState132
11726
11806
  } from "react";
11727
- import React10, {
11807
+ import React102, {
11728
11808
  Suspense as Suspense2,
11729
11809
  forwardRef as forwardRef13,
11730
11810
  useCallback as useCallback112,
@@ -11767,6 +11847,7 @@ import { useCallback as useCallback122, useMemo as useMemo132, useState as useSt
11767
11847
  import { jsx as jsx132 } from "react/jsx-runtime";
11768
11848
 
11769
11849
  // ../core/dist/esm/no-react.mjs
11850
+ import React6 from "react";
11770
11851
  function interpolateFunction2(input, inputRange, outputRange, options) {
11771
11852
  const { extrapolateLeft, extrapolateRight, easing } = options;
11772
11853
  let result = input;
@@ -11866,6 +11947,7 @@ function interpolate2(input, inputRange, outputRange, options) {
11866
11947
  extrapolateRight
11867
11948
  });
11868
11949
  }
11950
+ var RemotionEnvironmentContext2 = React6.createContext(null);
11869
11951
  function truthy2(value) {
11870
11952
  return Boolean(value);
11871
11953
  }
@@ -12724,8 +12806,8 @@ var calculateOuter = ({
12724
12806
  overflow: overflowVisible ? "visible" : "hidden"
12725
12807
  };
12726
12808
  };
12727
- var PlayerEventEmitterContext = React5.createContext(undefined);
12728
- var ThumbnailEmitterContext = React5.createContext(undefined);
12809
+ var PlayerEventEmitterContext = React8.createContext(undefined);
12810
+ var ThumbnailEmitterContext = React8.createContext(undefined);
12729
12811
 
12730
12812
  class PlayerEmitter {
12731
12813
  listeners = {
@@ -12839,7 +12921,7 @@ class ThumbnailEmitter {
12839
12921
  };
12840
12922
  }
12841
12923
  var useBufferStateEmitter = (emitter) => {
12842
- const bufferManager = useContext32(Internals.BufferingContextReact);
12924
+ const bufferManager = useContext33(Internals.BufferingContextReact);
12843
12925
  if (!bufferManager) {
12844
12926
  throw new Error("BufferingContextReact not found");
12845
12927
  }
@@ -12859,7 +12941,7 @@ var useBufferStateEmitter = (emitter) => {
12859
12941
  }, [bufferManager, emitter]);
12860
12942
  };
12861
12943
  var PlayerEmitterProvider = ({ children, currentPlaybackRate }) => {
12862
- const [emitter] = useState19(() => new PlayerEmitter);
12944
+ const [emitter] = useState20(() => new PlayerEmitter);
12863
12945
  const bufferManager = useContext210(Internals.BufferingContextReact);
12864
12946
  if (!bufferManager) {
12865
12947
  throw new Error("BufferingContextReact not found");
@@ -12922,20 +13004,20 @@ var usePlayer = () => {
12922
13004
  const playStart = useRef22(frame);
12923
13005
  const setFrame = Internals.Timeline.useTimelineSetFrame();
12924
13006
  const setTimelinePosition = Internals.Timeline.useTimelineSetFrame();
12925
- const audioContext = useContext33(Internals.SharedAudioContext);
12926
- const { audioAndVideoTags } = useContext33(Internals.Timeline.TimelineContext);
13007
+ const audioContext = useContext34(Internals.SharedAudioContext);
13008
+ const { audioAndVideoTags } = useContext34(Internals.Timeline.TimelineContext);
12927
13009
  const frameRef = useRef22(frame);
12928
13010
  frameRef.current = frame;
12929
13011
  const video = Internals.useVideo();
12930
13012
  const config = Internals.useUnsafeVideoConfig();
12931
- const emitter = useContext33(PlayerEventEmitterContext);
13013
+ const emitter = useContext34(PlayerEventEmitterContext);
12932
13014
  const lastFrame = (config?.durationInFrames ?? 1) - 1;
12933
13015
  const isLastFrame = frame === lastFrame;
12934
13016
  const isFirstFrame = frame === 0;
12935
13017
  if (!emitter) {
12936
13018
  throw new TypeError("Expected Player event emitter context");
12937
13019
  }
12938
- const bufferingContext = useContext33(Internals.BufferingContextReact);
13020
+ const bufferingContext = useContext34(Internals.BufferingContextReact);
12939
13021
  if (!bufferingContext) {
12940
13022
  throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
12941
13023
  }
@@ -14594,7 +14676,7 @@ var useClickPreventionOnDoubleClick = (onClick, onDoubleClick, doubleClickToFull
14594
14676
  }, [doubleClickToFullscreen, handleDoubleClick, handlePointerDown, onClick]);
14595
14677
  return returnValue;
14596
14678
  };
14597
- var reactVersion = React10.version.split(".")[0];
14679
+ var reactVersion = React102.version.split(".")[0];
14598
14680
  if (reactVersion === "0") {
14599
14681
  throw new Error(`Version ${reactVersion} of "react" is not supported by Remotion`);
14600
14682
  }
@@ -15158,26 +15240,38 @@ var SharedPlayerContexts = ({
15158
15240
  mountTime: Date.now()
15159
15241
  };
15160
15242
  }, [logLevel]);
15161
- return /* @__PURE__ */ jsx132(Internals.LogLevelContext.Provider, {
15162
- value: logLevelContext,
15163
- children: /* @__PURE__ */ jsx132(Internals.CanUseRemotionHooksProvider, {
15164
- children: /* @__PURE__ */ jsx132(Internals.Timeline.TimelineContext.Provider, {
15165
- value: timelineContext,
15166
- children: /* @__PURE__ */ jsx132(Internals.CompositionManager.Provider, {
15167
- value: compositionManagerContext,
15168
- children: /* @__PURE__ */ jsx132(Internals.ResolveCompositionConfig, {
15169
- children: /* @__PURE__ */ jsx132(Internals.PrefetchProvider, {
15170
- children: /* @__PURE__ */ jsx132(Internals.DurationsContextProvider, {
15171
- children: /* @__PURE__ */ jsx132(Internals.MediaVolumeContext.Provider, {
15172
- value: mediaVolumeContextValue,
15173
- children: /* @__PURE__ */ jsx132(Internals.SetMediaVolumeContext.Provider, {
15174
- value: setMediaVolumeContextValue,
15175
- children: /* @__PURE__ */ jsx132(Internals.SharedAudioContextProvider, {
15176
- numberOfAudioTags: numberOfSharedAudioTags,
15177
- component,
15178
- audioLatencyHint,
15179
- children: /* @__PURE__ */ jsx132(Internals.BufferingProvider, {
15180
- children
15243
+ const env = useMemo132(() => {
15244
+ return {
15245
+ isPlayer: true,
15246
+ isRendering: false,
15247
+ isStudio: false,
15248
+ isClientSideRendering: false,
15249
+ isReadOnlyStudio: false
15250
+ };
15251
+ }, []);
15252
+ return /* @__PURE__ */ jsx132(Internals.RemotionEnvironmentContext, {
15253
+ value: env,
15254
+ children: /* @__PURE__ */ jsx132(Internals.LogLevelContext.Provider, {
15255
+ value: logLevelContext,
15256
+ children: /* @__PURE__ */ jsx132(Internals.CanUseRemotionHooksProvider, {
15257
+ children: /* @__PURE__ */ jsx132(Internals.Timeline.TimelineContext.Provider, {
15258
+ value: timelineContext,
15259
+ children: /* @__PURE__ */ jsx132(Internals.CompositionManager.Provider, {
15260
+ value: compositionManagerContext,
15261
+ children: /* @__PURE__ */ jsx132(Internals.ResolveCompositionConfig, {
15262
+ children: /* @__PURE__ */ jsx132(Internals.PrefetchProvider, {
15263
+ children: /* @__PURE__ */ jsx132(Internals.DurationsContextProvider, {
15264
+ children: /* @__PURE__ */ jsx132(Internals.MediaVolumeContext.Provider, {
15265
+ value: mediaVolumeContextValue,
15266
+ children: /* @__PURE__ */ jsx132(Internals.SetMediaVolumeContext.Provider, {
15267
+ value: setMediaVolumeContextValue,
15268
+ children: /* @__PURE__ */ jsx132(Internals.SharedAudioContextProvider, {
15269
+ numberOfAudioTags: numberOfSharedAudioTags,
15270
+ component,
15271
+ audioLatencyHint,
15272
+ children: /* @__PURE__ */ jsx132(Internals.BufferingProvider, {
15273
+ children
15274
+ })
15181
15275
  })
15182
15276
  })
15183
15277
  })
@@ -15347,9 +15441,7 @@ var PlayerFn = ({
15347
15441
  ...componentProps
15348
15442
  }, ref) => {
15349
15443
  if (typeof window !== "undefined") {
15350
- useLayoutEffect11(() => {
15351
- window.remotion_isPlayer = true;
15352
- }, []);
15444
+ window.remotion_isPlayer = true;
15353
15445
  }
15354
15446
  if (componentProps.defaultProps !== undefined) {
15355
15447
  throw new Error("The <Player /> component does not accept `defaultProps`, but some were passed. Use `inputProps` instead.");
@@ -15748,11 +15840,11 @@ var Thumbnail = forward2(ThumbnailFn);
15748
15840
 
15749
15841
  // src/components/homepage/Demo/index.tsx
15750
15842
  import {
15751
- useCallback as useCallback33,
15843
+ useCallback as useCallback35,
15752
15844
  useEffect as useEffect38,
15753
15845
  useMemo as useMemo41,
15754
15846
  useRef as useRef28,
15755
- useState as useState31
15847
+ useState as useState33
15756
15848
  } from "react";
15757
15849
 
15758
15850
  // ../../node_modules/.pnpm/@babel+runtime@7.27.1/node_modules/@babel/runtime/helpers/esm/extends.js
@@ -16501,9 +16593,9 @@ var UNDERLAY_RED = curriedTransparentize$1(0.9, RED);
16501
16593
  var BLUE_TEXT = curriedDarken$1(0.3, "#42e9f5");
16502
16594
 
16503
16595
  // src/components/homepage/layout/use-color-mode.tsx
16504
- import React6, { useContext as useContext34, useMemo as useMemo33 } from "react";
16596
+ import React11, { useContext as useContext35, useMemo as useMemo33 } from "react";
16505
16597
  import { jsx as jsx37 } from "react/jsx-runtime";
16506
- var Context = React6.createContext(undefined);
16598
+ var Context = React11.createContext(undefined);
16507
16599
  var ColorModeProvider = ({
16508
16600
  children,
16509
16601
  colorMode,
@@ -16518,7 +16610,7 @@ var ColorModeProvider = ({
16518
16610
  });
16519
16611
  };
16520
16612
  function useColorMode() {
16521
- const context = useContext34(Context);
16613
+ const context = useContext35(Context);
16522
16614
  if (context === null || context === undefined) {
16523
16615
  throw new Error("ColorModeProvider");
16524
16616
  }
@@ -16527,21 +16619,21 @@ function useColorMode() {
16527
16619
 
16528
16620
  // src/components/homepage/Demo/Comp.tsx
16529
16621
  init_esm();
16530
- import { useCallback as useCallback26, useEffect as useEffect30, useMemo as useMemo36, useState as useState27 } from "react";
16622
+ import { useCallback as useCallback27, useEffect as useEffect30, useMemo as useMemo36, useState as useState28 } from "react";
16531
16623
 
16532
16624
  // src/components/homepage/Demo/Cards.tsx
16533
16625
  init_esm();
16534
16626
  import {
16535
16627
  createRef as createRef4,
16536
- useCallback as useCallback24,
16628
+ useCallback as useCallback26,
16537
16629
  useEffect as useEffect29,
16538
16630
  useRef as useRef25,
16539
- useState as useState26
16631
+ useState as useState27
16540
16632
  } from "react";
16541
16633
 
16542
16634
  // src/components/homepage/Demo/Card.tsx
16543
16635
  init_esm();
16544
- import { useCallback as useCallback20, useRef as useRef20 } from "react";
16636
+ import { useCallback as useCallback21, useRef as useRef20 } from "react";
16545
16637
 
16546
16638
  // src/components/homepage/Demo/math.ts
16547
16639
  var paddingAndMargin = 20;
@@ -16575,10 +16667,10 @@ var getIndexFromPosition = (clientX, clientY) => {
16575
16667
  };
16576
16668
 
16577
16669
  // src/components/homepage/Demo/Switcher.tsx
16578
- import { useCallback as useCallback19 } from "react";
16670
+ import { useCallback as useCallback20 } from "react";
16579
16671
  import { jsx as jsx38, jsxs as jsxs11 } from "react/jsx-runtime";
16580
16672
  var Switcher = ({ type, theme, onTap }) => {
16581
- const onPointerDown = useCallback19((e) => {
16673
+ const onPointerDown = useCallback20((e) => {
16582
16674
  e.stopPropagation();
16583
16675
  onTap();
16584
16676
  }, [onTap]);
@@ -16641,7 +16733,7 @@ var Card = ({
16641
16733
  const refToUse = refsToUse[index];
16642
16734
  const stopPrevious = useRef20([]);
16643
16735
  let newIndices = [...indices];
16644
- const applyPositions = useCallback20((except) => {
16736
+ const applyPositions = useCallback21((except) => {
16645
16737
  let stopped = false;
16646
16738
  stopPrevious.current.forEach((s) => {
16647
16739
  s();
@@ -16714,7 +16806,7 @@ var Card = ({
16714
16806
  update();
16715
16807
  });
16716
16808
  }, [newIndices, onUpdate, positions, refsToUse, shouldBePositions]);
16717
- const onPointerDown = useCallback20((e) => {
16809
+ const onPointerDown = useCallback21((e) => {
16718
16810
  e.currentTarget.setPointerCapture(e.pointerId);
16719
16811
  const cardLeft = refToUse.current.offsetLeft;
16720
16812
  const cardTop = refToUse.current.offsetTop;
@@ -16775,7 +16867,7 @@ var Card = ({
16775
16867
  }, { once: true });
16776
16868
  refToUse.current.addEventListener("pointermove", onMove);
16777
16869
  }, [applyPositions, index, positions, refToUse, shouldBePositions]);
16778
- const onPointerUp = useCallback20((e) => {
16870
+ const onPointerUp = useCallback21((e) => {
16779
16871
  e.currentTarget.releasePointerCapture(e.pointerId);
16780
16872
  }, []);
16781
16873
  const { x, y } = getPositionForIndex(index);
@@ -16904,7 +16996,7 @@ var CurrentCountry = ({ theme, countryPaths, countryLabel }) => {
16904
16996
  init_esm();
16905
16997
  import {
16906
16998
  forwardRef as forwardRef15,
16907
- useCallback as useCallback21,
16999
+ useCallback as useCallback24,
16908
17000
  useEffect as useEffect28,
16909
17001
  useImperativeHandle as useImperativeHandle13,
16910
17002
  useRef as useRef23
@@ -16912,12 +17004,13 @@ import {
16912
17004
 
16913
17005
  // src/components/homepage/Demo/DisplayedEmoji.tsx
16914
17006
  init_esm();
16915
- import { useEffect as useEffect27, useMemo as useMemo34, useState as useState24 } from "react";
17007
+ import { useEffect as useEffect27, useMemo as useMemo34, useState as useState26 } from "react";
16916
17008
  import { jsx as jsx44 } from "react/jsx-runtime";
16917
17009
  var DisplayedEmoji = ({ emoji }) => {
16918
- const [data, setData] = useState24(null);
17010
+ const [data, setData] = useState26(null);
16919
17011
  const { durationInFrames, fps } = useVideoConfig();
16920
- const [browser, setBrowser] = useState24(typeof document !== "undefined");
17012
+ const [browser, setBrowser] = useState26(typeof document !== "undefined");
17013
+ const { delayRender, continueRender } = useDelayRender();
16921
17014
  const src = useMemo34(() => {
16922
17015
  if (emoji === "melting") {
16923
17016
  return "https://fonts.gstatic.com/s/e/notoemoji/latest/1fae0/lottie.json";
@@ -16930,7 +17023,7 @@ var DisplayedEmoji = ({ emoji }) => {
16930
17023
  }
16931
17024
  throw new Error("Unknown emoji");
16932
17025
  }, [emoji]);
16933
- const [handle] = useState24(() => delayRender());
17026
+ const [handle] = useState26(() => delayRender());
16934
17027
  useEffect27(() => {
16935
17028
  Promise.all([
16936
17029
  fetch(src).then((res) => res.json()),
@@ -16948,7 +17041,7 @@ var DisplayedEmoji = ({ emoji }) => {
16948
17041
  }).catch((err) => {
16949
17042
  cancelRender(err);
16950
17043
  });
16951
- }, [handle, src]);
17044
+ }, [handle, src, continueRender]);
16952
17045
  useEffect27(() => {
16953
17046
  if (typeof document !== "undefined") {
16954
17047
  setBrowser(true);
@@ -17023,7 +17116,7 @@ var EmojiCardRefFn = ({ emojiIndex }, ref) => {
17023
17116
  const ref2 = useRef23(null);
17024
17117
  const ref3 = useRef23(null);
17025
17118
  const transforms = useRef23([-100, 0, 100]);
17026
- const onLeft = useCallback21(() => {
17119
+ const onLeft = useCallback24(() => {
17027
17120
  if (!ref1.current || !ref2.current || !ref3.current) {
17028
17121
  return;
17029
17122
  }
@@ -17034,7 +17127,7 @@ var EmojiCardRefFn = ({ emojiIndex }, ref) => {
17034
17127
  transforms: transforms.current
17035
17128
  });
17036
17129
  }, []);
17037
- const onRight = useCallback21(() => {
17130
+ const onRight = useCallback24(() => {
17038
17131
  if (!ref1.current || !ref2.current || !ref3.current) {
17039
17132
  return;
17040
17133
  }
@@ -17073,6 +17166,7 @@ var EmojiCardRefFn = ({ emojiIndex }, ref) => {
17073
17166
  transforms: transforms.current
17074
17167
  });
17075
17168
  }, []);
17169
+ const env = useRemotionEnvironment();
17076
17170
  return /* @__PURE__ */ jsxs14(AbsoluteFill, {
17077
17171
  style: {
17078
17172
  justifyContent: "center",
@@ -17100,7 +17194,7 @@ var EmojiCardRefFn = ({ emojiIndex }, ref) => {
17100
17194
  whiteSpace: "nowrap",
17101
17195
  height: "100%"
17102
17196
  },
17103
- children: getRemotionEnvironment().isRendering ? /* @__PURE__ */ jsx46("div", {
17197
+ children: env.isRendering ? /* @__PURE__ */ jsx46("div", {
17104
17198
  style: emojiStyle,
17105
17199
  children: /* @__PURE__ */ jsx46(DisplayedEmoji, {
17106
17200
  emoji: emojiIndex
@@ -17475,14 +17569,14 @@ var Cards = ({
17475
17569
  trending
17476
17570
  }) => {
17477
17571
  const container4 = useRef25(null);
17478
- const [refs] = useState26(() => {
17572
+ const [refs] = useState27(() => {
17479
17573
  return new Array(4).fill(true).map(() => {
17480
17574
  return createRef4();
17481
17575
  });
17482
17576
  });
17483
17577
  const positions = useRef25(getInitialPositions());
17484
17578
  const shouldBePositions = useRef25(getInitialPositions());
17485
- const { isRendering } = getRemotionEnvironment();
17579
+ const { isRendering } = useRemotionEnvironment();
17486
17580
  useEffect29(() => {
17487
17581
  const { current } = container4;
17488
17582
  if (!current) {
@@ -17500,11 +17594,11 @@ var Cards = ({
17500
17594
  };
17501
17595
  }, [onToggle]);
17502
17596
  const ref = useRef25(null);
17503
- const onLeft = useCallback24(() => {
17597
+ const onLeft = useCallback26(() => {
17504
17598
  ref.current?.onRight();
17505
17599
  onRightPress();
17506
17600
  }, [onRightPress]);
17507
- const onRight = useCallback24(() => {
17601
+ const onRight = useCallback26(() => {
17508
17602
  ref.current?.onLeft();
17509
17603
  onLeftPress();
17510
17604
  }, [onLeftPress]);
@@ -17573,8 +17667,8 @@ var HomepageVideoComp = ({
17573
17667
  onClickLeft,
17574
17668
  onClickRight
17575
17669
  }) => {
17576
- const [rerenders, setRerenders] = useState27(0);
17577
- const onUpdate = useCallback26((newIndices) => {
17670
+ const [rerenders, setRerenders] = useState28(0);
17671
+ const onUpdate = useCallback27((newIndices) => {
17578
17672
  setRerenders(rerenders + 1);
17579
17673
  updateCardOrder(newIndices);
17580
17674
  }, [rerenders, updateCardOrder]);
@@ -17644,7 +17738,7 @@ var DemoError = () => {
17644
17738
  };
17645
17739
 
17646
17740
  // src/components/homepage/Demo/DemoRender.tsx
17647
- import React34, { useCallback as useCallback27 } from "react";
17741
+ import React37, { useCallback as useCallback28 } from "react";
17648
17742
  import { z } from "zod";
17649
17743
 
17650
17744
  // src/components/homepage/Demo/DemoErrorIcon.tsx
@@ -17718,7 +17812,7 @@ var DoneCheckmark = () => {
17718
17812
  };
17719
17813
 
17720
17814
  // ../shapes/dist/esm/index.mjs
17721
- import React26, { useMemo as useMemo37 } from "react";
17815
+ import React34, { useMemo as useMemo37 } from "react";
17722
17816
  import { version } from "react-dom";
17723
17817
  import { jsx as jsx60, jsxs as jsxs21 } from "react/jsx-runtime";
17724
17818
  import { jsx as jsx212 } from "react/jsx-runtime";
@@ -18000,10 +18094,10 @@ var style2 = {
18000
18094
  justifyContent: "center"
18001
18095
  };
18002
18096
  var RenderButton = ({ renderData, onError }) => {
18003
- const [state, setState] = React34.useState({
18097
+ const [state, setState] = React37.useState({
18004
18098
  type: "idle"
18005
18099
  });
18006
- const triggerRender = useCallback27(async () => {
18100
+ const triggerRender = useCallback28(async () => {
18007
18101
  if (renderData === null) {
18008
18102
  return;
18009
18103
  }
@@ -18180,12 +18274,12 @@ var DragAndDropNudge = () => {
18180
18274
 
18181
18275
  // src/components/homepage/Demo/PlayerSeekBar.tsx
18182
18276
  init_esm();
18183
- import { useCallback as useCallback29, useEffect as useEffect33, useMemo as useMemo40, useRef as useRef26, useState as useState29 } from "react";
18277
+ import { useCallback as useCallback30, useEffect as useEffect33, useMemo as useMemo40, useRef as useRef26, useState as useState30 } from "react";
18184
18278
 
18185
18279
  // src/components/homepage/layout/use-el-size.ts
18186
- import { useCallback as useCallback28, useEffect as useEffect31, useMemo as useMemo39, useState as useState28 } from "react";
18280
+ import { useCallback as useCallback29, useEffect as useEffect31, useMemo as useMemo39, useState as useState29 } from "react";
18187
18281
  var useElementSize2 = (ref) => {
18188
- const [size, setSize] = useState28(null);
18282
+ const [size, setSize] = useState29(null);
18189
18283
  const observer = useMemo39(() => {
18190
18284
  if (typeof ResizeObserver === "undefined") {
18191
18285
  return;
@@ -18197,7 +18291,7 @@ var useElementSize2 = (ref) => {
18197
18291
  });
18198
18292
  });
18199
18293
  }, []);
18200
- const updateSize = useCallback28(() => {
18294
+ const updateSize = useCallback29(() => {
18201
18295
  if (ref === null) {
18202
18296
  return;
18203
18297
  }
@@ -18262,7 +18356,7 @@ var findBodyInWhichDivIsLocated2 = (div) => {
18262
18356
  return current;
18263
18357
  };
18264
18358
  var useHoverState2 = (ref, hideControlsWhenPointerDoesntMove) => {
18265
- const [hovered, setHovered] = useState29(false);
18359
+ const [hovered, setHovered] = useState30(false);
18266
18360
  useEffect33(() => {
18267
18361
  const { current } = ref;
18268
18362
  if (!current) {
@@ -18312,8 +18406,8 @@ var PlayerSeekBar2 = ({
18312
18406
  const containerRef = useRef26(null);
18313
18407
  const barHovered = useHoverState2(containerRef, false);
18314
18408
  const size = useElementSize2(containerRef.current);
18315
- const [playing, setPlaying] = useState29(false);
18316
- const [frame, setFrame] = useState29(0);
18409
+ const [playing, setPlaying] = useState30(false);
18410
+ const [frame, setFrame] = useState30(0);
18317
18411
  useEffect33(() => {
18318
18412
  const { current } = playerRef;
18319
18413
  if (!current) {
@@ -18345,11 +18439,11 @@ var PlayerSeekBar2 = ({
18345
18439
  current.removeEventListener("pause", onPause);
18346
18440
  };
18347
18441
  }, [playerRef]);
18348
- const [dragging, setDragging] = useState29({
18442
+ const [dragging, setDragging] = useState30({
18349
18443
  dragging: false
18350
18444
  });
18351
18445
  const width2 = size?.width ?? 0;
18352
- const onPointerDown = useCallback29((e) => {
18446
+ const onPointerDown = useCallback30((e) => {
18353
18447
  if (e.button !== 0) {
18354
18448
  return;
18355
18449
  }
@@ -18363,7 +18457,7 @@ var PlayerSeekBar2 = ({
18363
18457
  });
18364
18458
  onSeekStart();
18365
18459
  }, [durationInFrames, width2, playerRef, playing, onSeekStart]);
18366
- const onPointerMove = useCallback29((e) => {
18460
+ const onPointerMove = useCallback30((e) => {
18367
18461
  if (!size) {
18368
18462
  throw new Error("Player has no size");
18369
18463
  }
@@ -18374,7 +18468,7 @@ var PlayerSeekBar2 = ({
18374
18468
  const _frame = getFrameFromX2(e.clientX - posLeft, durationInFrames, size.width);
18375
18469
  playerRef.current.seekTo(_frame);
18376
18470
  }, [dragging.dragging, durationInFrames, playerRef, size]);
18377
- const onPointerUp = useCallback29(() => {
18471
+ const onPointerUp = useCallback30(() => {
18378
18472
  setDragging({
18379
18473
  dragging: false
18380
18474
  });
@@ -18458,7 +18552,7 @@ var PlayerSeekBar2 = ({
18458
18552
  };
18459
18553
 
18460
18554
  // src/components/homepage/Demo/PlayerVolume.tsx
18461
- import { useCallback as useCallback30, useEffect as useEffect35, useRef as useRef27, useState as useState30 } from "react";
18555
+ import { useCallback as useCallback31, useEffect as useEffect35, useRef as useRef27, useState as useState31 } from "react";
18462
18556
 
18463
18557
  // src/components/homepage/Demo/icons.tsx
18464
18558
  import { jsx as jsx71 } from "react/jsx-runtime";
@@ -18516,8 +18610,8 @@ var IsMutedIcon = (props) => {
18516
18610
  // src/components/homepage/Demo/PlayerVolume.tsx
18517
18611
  import { jsx as jsx75 } from "react/jsx-runtime";
18518
18612
  var PlayerVolume = ({ playerRef }) => {
18519
- const [muted, setIsMuted] = useState30(() => playerRef.current?.isMuted() ?? true);
18520
- const [isHovered, setIsHovered] = useState30(false);
18613
+ const [muted, setIsMuted] = useState31(() => playerRef.current?.isMuted() ?? true);
18614
+ const [isHovered, setIsHovered] = useState31(false);
18521
18615
  const timerRef = useRef27(null);
18522
18616
  useEffect35(() => {
18523
18617
  const { current } = playerRef;
@@ -18539,7 +18633,7 @@ var PlayerVolume = ({ playerRef }) => {
18539
18633
  document.body.style.userSelect = "auto";
18540
18634
  }
18541
18635
  }, [isHovered]);
18542
- const onClick = useCallback30(() => {
18636
+ const onClick = useCallback31(() => {
18543
18637
  if (timerRef.current !== null) {
18544
18638
  clearTimeout(timerRef.current);
18545
18639
  timerRef.current = null;
@@ -18577,7 +18671,7 @@ var PlayerVolume = ({ playerRef }) => {
18577
18671
  };
18578
18672
 
18579
18673
  // src/components/homepage/Demo/PlayPauseButton.tsx
18580
- import React38, { useCallback as useCallback31, useEffect as useEffect36 } from "react";
18674
+ import React40, { useCallback as useCallback33, useEffect as useEffect36 } from "react";
18581
18675
  import { jsx as jsx77 } from "react/jsx-runtime";
18582
18676
  var playerButtonStyle2 = {
18583
18677
  appearance: "none",
@@ -18594,7 +18688,7 @@ var playerButtonStyle2 = {
18594
18688
  color: PALETTE.TEXT_COLOR
18595
18689
  };
18596
18690
  var PlayPauseButton = ({ playerRef }) => {
18597
- const [playing, setPlaying] = React38.useState(true);
18691
+ const [playing, setPlaying] = React40.useState(true);
18598
18692
  useEffect36(() => {
18599
18693
  const { current } = playerRef;
18600
18694
  if (!current) {
@@ -18613,7 +18707,7 @@ var PlayPauseButton = ({ playerRef }) => {
18613
18707
  current.removeEventListener("pause", onPause);
18614
18708
  };
18615
18709
  }, [playerRef]);
18616
- const onToggle = useCallback31(() => {
18710
+ const onToggle = useCallback33(() => {
18617
18711
  playerRef.current?.toggle();
18618
18712
  }, [playerRef]);
18619
18713
  const playPauseIconStyle = {
@@ -18632,7 +18726,7 @@ var PlayPauseButton = ({ playerRef }) => {
18632
18726
  };
18633
18727
 
18634
18728
  // src/components/homepage/Demo/TimeDisplay.tsx
18635
- import React39, { useEffect as useEffect37 } from "react";
18729
+ import React41, { useEffect as useEffect37 } from "react";
18636
18730
  import { jsx as jsx78 } from "react/jsx-runtime";
18637
18731
  var formatTime2 = (timeInSeconds) => {
18638
18732
  const minutes = Math.floor(timeInSeconds / 60);
@@ -18640,7 +18734,7 @@ var formatTime2 = (timeInSeconds) => {
18640
18734
  return `${String(minutes)}:${String(seconds).padStart(2, "0")}`;
18641
18735
  };
18642
18736
  var TimeDisplay = ({ fps, playerRef }) => {
18643
- const [time, setTime] = React39.useState(0);
18737
+ const [time, setTime] = React41.useState(0);
18644
18738
  useEffect37(() => {
18645
18739
  const { current } = playerRef;
18646
18740
  if (!current) {
@@ -18719,7 +18813,7 @@ var PlayerControls = ({ playerRef, durationInFrames, fps, children }) => {
18719
18813
  };
18720
18814
 
18721
18815
  // src/components/homepage/Demo/ThemeNudge.tsx
18722
- import React40 from "react";
18816
+ import React43 from "react";
18723
18817
  import { jsx as jsx80, jsxs as jsxs31 } from "react/jsx-runtime";
18724
18818
  var origWidth3 = 21;
18725
18819
  var scale3 = 0.4;
@@ -18741,7 +18835,7 @@ var Icon3 = () => {
18741
18835
  };
18742
18836
  var ThemeNudge = () => {
18743
18837
  const { colorMode, setColorMode } = useColorMode();
18744
- const toggleTheme = React40.useCallback((e) => {
18838
+ const toggleTheme = React43.useCallback((e) => {
18745
18839
  e.preventDefault();
18746
18840
  setColorMode(colorMode === "dark" ? "light" : "dark");
18747
18841
  }, [colorMode, setColorMode]);
@@ -18806,12 +18900,12 @@ var playerWrapper = {
18806
18900
  };
18807
18901
  var Demo = () => {
18808
18902
  const { colorMode } = useColorMode();
18809
- const [data2, setData] = useState31(null);
18903
+ const [data2, setData] = useState33(null);
18810
18904
  const ref = useRef28(null);
18811
- const [isFullscreen, setIsFullscreen] = useState31(false);
18812
- const [cardOrder, setCardOrder] = useState31([0, 1, 2, 3]);
18813
- const [emojiIndex, setEmojiIndex] = useState31(0);
18814
- const [error, setError] = useState31(false);
18905
+ const [isFullscreen, setIsFullscreen] = useState33(false);
18906
+ const [cardOrder, setCardOrder] = useState33([0, 1, 2, 3]);
18907
+ const [emojiIndex, setEmojiIndex] = useState33(0);
18908
+ const [error, setError] = useState33(false);
18815
18909
  useEffect38(() => {
18816
18910
  getDataAndProps().then((d) => {
18817
18911
  setData(d);
@@ -18833,7 +18927,7 @@ var Demo = () => {
18833
18927
  playerRef.removeEventListener("fullscreenchange", onFullscreenChange);
18834
18928
  };
18835
18929
  }, [data2]);
18836
- const updateCardOrder = useCallback33((newCardOrder) => {
18930
+ const updateCardOrder = useCallback35((newCardOrder) => {
18837
18931
  setCardOrder(newCardOrder);
18838
18932
  }, []);
18839
18933
  const props = useMemo41(() => {
@@ -18855,7 +18949,7 @@ var Demo = () => {
18855
18949
  emojiIndex
18856
18950
  };
18857
18951
  }, [cardOrder, emojiIndex, colorMode, data2, updateCardOrder]);
18858
- const onError = useCallback33(() => {
18952
+ const onError = useCallback35(() => {
18859
18953
  setError(true);
18860
18954
  }, []);
18861
18955
  return /* @__PURE__ */ jsxs33("div", {
@@ -18964,7 +19058,7 @@ import { forwardRef as forwardRef17, useEffect as useEffect40, useImperativeHand
18964
19058
  // src/components/homepage/VideoPlayerWithControls.tsx
18965
19059
  import Hls from "hls.js";
18966
19060
  import"plyr/dist/plyr.css";
18967
- import { forwardRef as forwardRef16, useCallback as useCallback35, useEffect as useEffect39, useRef as useRef29, useState as useState33 } from "react";
19061
+ import { forwardRef as forwardRef16, useCallback as useCallback36, useEffect as useEffect39, useRef as useRef29, useState as useState35 } from "react";
18968
19062
  import { jsx as jsx87 } from "react/jsx-runtime";
18969
19063
  var useCombinedRefs = function(...refs) {
18970
19064
  const targetRef = useRef29(null);
@@ -18985,9 +19079,9 @@ var VideoPlayerWithControls = forwardRef16(({ playbackId, poster, currentTime, o
18985
19079
  const videoRef = useRef29(null);
18986
19080
  const metaRef = useCombinedRefs(ref, videoRef);
18987
19081
  const playerRef = useRef29(null);
18988
- const [playerInitTime] = useState33(Date.now());
18989
- const videoError = useCallback35((event) => onError(event), [onError]);
18990
- const onImageLoad = useCallback35((event) => {
19082
+ const [playerInitTime] = useState35(Date.now());
19083
+ const videoError = useCallback36((event) => onError(event), [onError]);
19084
+ const onImageLoad = useCallback36((event) => {
18991
19085
  const [w, h] = [event.target.width, event.target.height];
18992
19086
  if (w && h) {
18993
19087
  onSize({ width: w, height: h });
@@ -19185,10 +19279,10 @@ var EditorStarterSection = () => {
19185
19279
  var EditorStarterSection_default = EditorStarterSection;
19186
19280
 
19187
19281
  // src/components/homepage/EvaluateRemotion.tsx
19188
- import { useEffect as useEffect41, useState as useState35 } from "react";
19282
+ import { useEffect as useEffect41, useState as useState36 } from "react";
19189
19283
  import { jsx as jsx90, jsxs as jsxs36 } from "react/jsx-runtime";
19190
19284
  var EvaluateRemotionSection = () => {
19191
- const [dailyAvatars, setDailyAvatars] = useState35([]);
19285
+ const [dailyAvatars, setDailyAvatars] = useState36([]);
19192
19286
  useEffect41(() => {
19193
19287
  const avatars = [
19194
19288
  "/img/freelancers/alex.jpeg",
@@ -19288,7 +19382,7 @@ var EvaluateRemotionSection = () => {
19288
19382
  var EvaluateRemotion_default = EvaluateRemotionSection;
19289
19383
 
19290
19384
  // src/components/homepage/IfYouKnowReact.tsx
19291
- import { useEffect as useEffect43, useState as useState36 } from "react";
19385
+ import { useEffect as useEffect43, useState as useState37 } from "react";
19292
19386
  import { jsx as jsx91, jsxs as jsxs37 } from "react/jsx-runtime";
19293
19387
  var isWebkit = () => {
19294
19388
  if (typeof window === "undefined") {
@@ -19303,7 +19397,7 @@ var icon2 = {
19303
19397
  marginLeft: 10
19304
19398
  };
19305
19399
  var IfYouKnowReact = () => {
19306
- const [vid, setVid] = useState36("/img/compose.webm");
19400
+ const [vid, setVid] = useState37("/img/compose.webm");
19307
19401
  useEffect43(() => {
19308
19402
  if (isWebkit()) {
19309
19403
  setVid("/img/compose.mp4");
@@ -19460,7 +19554,7 @@ var MoreVideoPowerSection = () => {
19460
19554
  };
19461
19555
 
19462
19556
  // src/components/homepage/NewsletterButton.tsx
19463
- import { useCallback as useCallback36, useState as useState37 } from "react";
19557
+ import { useCallback as useCallback37, useState as useState38 } from "react";
19464
19558
 
19465
19559
  // src/components/homepage/Spacer.tsx
19466
19560
  import { jsx as jsx97 } from "react/jsx-runtime";
@@ -19473,10 +19567,10 @@ var Spacer = () => {
19473
19567
  // src/components/homepage/NewsletterButton.tsx
19474
19568
  import { jsx as jsx98, jsxs as jsxs39 } from "react/jsx-runtime";
19475
19569
  var NewsletterButton = () => {
19476
- const [email, setEmail] = useState37("");
19477
- const [submitting, setSubmitting] = useState37(false);
19478
- const [subscribed, setSubscribed] = useState37(false);
19479
- const handleSubmit = useCallback36(async (e) => {
19570
+ const [email, setEmail] = useState38("");
19571
+ const [submitting, setSubmitting] = useState38(false);
19572
+ const [subscribed, setSubscribed] = useState38(false);
19573
+ const handleSubmit = useCallback37(async (e) => {
19480
19574
  try {
19481
19575
  setSubmitting(true);
19482
19576
  e.preventDefault();
@@ -19553,7 +19647,7 @@ var NewsletterButton = () => {
19553
19647
  };
19554
19648
 
19555
19649
  // src/components/homepage/ParameterizeAndEdit.tsx
19556
- import { useEffect as useEffect45, useRef as useRef31, useState as useState38 } from "react";
19650
+ import { useEffect as useEffect45, useRef as useRef31, useState as useState39 } from "react";
19557
19651
  import { jsx as jsx99, jsxs as jsxs40 } from "react/jsx-runtime";
19558
19652
  var icon3 = {
19559
19653
  height: 16,
@@ -19561,7 +19655,7 @@ var icon3 = {
19561
19655
  };
19562
19656
  var ParameterizeAndEdit = () => {
19563
19657
  const ref = useRef31(null);
19564
- const [vid, setVid] = useState38("/img/editing-vp9-chrome.webm");
19658
+ const [vid, setVid] = useState39("/img/editing-vp9-chrome.webm");
19565
19659
  useEffect45(() => {
19566
19660
  if (isWebkit()) {
19567
19661
  setVid("/img/editing-safari.mp4");
@@ -19676,7 +19770,7 @@ var ParameterizeAndEdit = () => {
19676
19770
  };
19677
19771
 
19678
19772
  // src/components/homepage/RealMp4Videos.tsx
19679
- import { useEffect as useEffect46, useRef as useRef33, useState as useState39 } from "react";
19773
+ import { useEffect as useEffect46, useRef as useRef33, useState as useState40 } from "react";
19680
19774
  import { jsx as jsx100, jsxs as jsxs41 } from "react/jsx-runtime";
19681
19775
  var icon4 = {
19682
19776
  height: 16,
@@ -19685,7 +19779,7 @@ var icon4 = {
19685
19779
  var RealMP4Videos = () => {
19686
19780
  const ref = useRef33(null);
19687
19781
  const videoRef = useRef33(null);
19688
- const [vid, setVid] = useState39("/img/render-progress.webm");
19782
+ const [vid, setVid] = useState40("/img/render-progress.webm");
19689
19783
  useEffect46(() => {
19690
19784
  if (isWebkit()) {
19691
19785
  setVid("/img/render-progress.mp4");
@@ -19985,7 +20079,7 @@ var TrustedByBanner = () => {
19985
20079
  var TrustedByBanner_default = TrustedByBanner;
19986
20080
 
19987
20081
  // src/components/homepage/VideoAppsShowcase.tsx
19988
- import { useEffect as useEffect47, useRef as useRef35, useState as useState40 } from "react";
20082
+ import { useEffect as useEffect47, useRef as useRef35, useState as useState41 } from "react";
19989
20083
  import { jsx as jsx104, jsxs as jsxs45 } from "react/jsx-runtime";
19990
20084
  var tabs = [
19991
20085
  "Music visualization",
@@ -20038,9 +20132,9 @@ var icon5 = {
20038
20132
  marginLeft: 10
20039
20133
  };
20040
20134
  var VideoAppsShowcase = () => {
20041
- const [activeTab, setActiveTab] = useState40(0);
20042
- const [isMuted, setIsMuted] = useState40(true);
20043
- const [isPlaying, setIsPlaying] = useState40(false);
20135
+ const [activeTab, setActiveTab] = useState41(0);
20136
+ const [isMuted, setIsMuted] = useState41(true);
20137
+ const [isPlaying, setIsPlaying] = useState41(false);
20044
20138
  const videoRef = useRef35(null);
20045
20139
  const containerRef = useRef35(null);
20046
20140
  useEffect47(() => {
@@ -21323,7 +21417,7 @@ var ChooseTemplate = () => {
21323
21417
  };
21324
21418
 
21325
21419
  // src/components/homepage/GetStartedStrip.tsx
21326
- import { useState as useState41 } from "react";
21420
+ import { useState as useState43 } from "react";
21327
21421
 
21328
21422
  // src/components/homepage/GitHubButton.tsx
21329
21423
  import { jsx as jsx130, jsxs as jsxs56 } from "react/jsx-runtime";
@@ -21358,7 +21452,7 @@ var GithubButton = () => {
21358
21452
  // src/components/homepage/GetStartedStrip.tsx
21359
21453
  import { jsx as jsx131, jsxs as jsxs57 } from "react/jsx-runtime";
21360
21454
  var GetStarted = () => {
21361
- const [clicked, setClicked] = useState41(null);
21455
+ const [clicked, setClicked] = useState43(null);
21362
21456
  return /* @__PURE__ */ jsxs57("div", {
21363
21457
  className: "flex flex-col lg:flex-row items-center justify-center text-center w-full",
21364
21458
  children: [